diff --git a/.github/ISSUE_TEMPLATE/NEW_RELEASE.md b/.github/ISSUE_TEMPLATE/NEW_RELEASE.md
index 54e5942ed9a..f54e219fe59 100644
--- a/.github/ISSUE_TEMPLATE/NEW_RELEASE.md
+++ b/.github/ISSUE_TEMPLATE/NEW_RELEASE.md
@@ -2,7 +2,7 @@
name: New Release
about: Propose a new release
title: Release v0.x.0
-assignees: ahg-g, alculquicondor, tenzen-y
+assignees: alculquicondor, mimowo, tenzen-y
---
@@ -24,38 +24,39 @@ Please do not remove items from the checklist
- [ ] Update `RELEASE_BRANCH` and `RELEASE_VERSION` in `Makefile` and run `make prepare-release-branch`
- [ ] Update the `CHANGELOG`
- [ ] Submit a pull request with the changes:
-- [ ] An OWNER [prepares a draft release](https://github.com/kubernetes-sigs/kueue/releases)
- - [ ] Write the change log into the draft release.
- - [ ] Run
- `make artifacts IMAGE_REGISTRY=registry.k8s.io/kueue GIT_TAG=$VERSION`
- to generate the artifacts and upload the files in the `artifacts` folder
- to the draft release.
- [ ] An OWNER creates a signed tag running
`git tag -s $VERSION`
and inserts the changelog into the tag description.
To perform this step, you need [a PGP key registered on github](https://docs.github.com/en/authentication/managing-commit-signature-verification/checking-for-existing-gpg-keys).
- [ ] An OWNER pushes the tag with
- `git push $VERSION`
+ `git push upstream $VERSION`
- Triggers prow to build and publish a staging container image
`us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue:$VERSION`
+- [ ] An OWNER [prepares a draft release](https://github.com/kubernetes-sigs/kueue/releases)
+ - [ ] Create the draft release poiting out to the created tag.
+ - [ ] Write the change log into the draft release.
+ - [ ] Run
+ `make artifacts IMAGE_REGISTRY=registry.k8s.io/kueue GIT_TAG=$VERSION`
+ to generate the artifacts in the `artifacts` folder.
+ - [ ] Upload the files in the `artifacts` folder to the draft release - either
+ via UI or `gh release upload artifacts/*`.
- [ ] Submit a PR against [k8s.io](https://github.com/kubernetes/k8s.io),
updating `registry.k8s.io/images/k8s-staging-kueue/images.yaml` to
- [promote the container images](https://github.com/kubernetes/k8s.io/tree/main/k8s.gcr.io#image-promoter)
+ [promote the container images](https://github.com/kubernetes/k8s.io/tree/main/registry.k8s.io#image-promoter)
to production:
- [ ] Wait for the PR to be merged and verify that the image `registry.k8s.io/kueue/kueue:$VERSION` is available.
- [ ] Publish the draft release prepared at the [GitHub releases page](https://github.com/kubernetes-sigs/kueue/releases).
Link:
- [ ] Run the [openvex action](https://github.com/kubernetes-sigs/kueue/actions/workflows/openvex.yaml) to generate openvex data. The action will add the file to the release artifacts.
+- [ ] Update the `main` branch :
+ - [ ] Update `RELEASE_VERSION` in `Makefile` and run `make prepare-release-branch`
+ - [ ] Release notes in the `CHANGELOG`
+ - [ ] `SECURITY-INSIGHTS.yaml` values by running `make update-security-insights GIT_TAG=$VERSION`
+ - [ ] Submit a pull request with the changes:
+ - [ ] Cherry-pick the pull request onto the `website` branch
- [ ] Run the [SBOM action](https://github.com/kubernetes-sigs/kueue/actions/workflows/sbom.yaml) to generate the SBOM and add it to the release.
- [ ] For major or minor releases, merge the `main` branch into the `website` branch to publish the updated documentation.
- [ ] Send an announcement email to `sig-scheduling@kubernetes.io` and `wg-batch@kubernetes.io` with the subject `[ANNOUNCE] kueue $VERSION is released`.
-- [ ] Update the below files with respective values in `main` branch :
- - Latest version in `README.md`
- - Latest version in `cmd/experimental/kjobctl/docs/installation.md`
- - Release notes in the `CHANGELOG`
- - `version` in `site/hugo.toml`
- - `appVersion` in `charts/kueue/Chart.yaml`
- - `SECURITY-INSIGHTS.yaml` values by running `make update-security-insights GIT_TAG=$VERSION`
- [ ] For a major or minor release, prepare the repo for the next version:
- [ ] Create an unannotated _devel_ tag in the
`main` branch, on the first commit that gets merged after the release
diff --git a/.golangci.yaml b/.golangci.yaml
index 0c22247a721..ab0dceaf213 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -9,11 +9,17 @@ linters-settings:
disabled-checks:
- appendAssign
- exitAfterDefer
- goimports:
- local-prefixes: sigs.k8s.io/kueue
govet:
enable:
- nilness
+ gci:
+ sections:
+ - standard # Standard section: captures all standard packages.
+ - default # Default section: contains all imports that could not be matched to another section type.
+ - prefix(sigs.k8s.io/kueue) # Custom section: groups all imports with the specified Prefix.
+ - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
+ - dot # Dot section: contains all dot imports.
+ skip-generated: true # Skip generated files.
perfsprint:
int-conversion: false
errorf: true
@@ -34,9 +40,9 @@ linters:
- dupword
- durationcheck
- fatcontext
+ - gci
- ginkgolinter
- gocritic
- - goimports
- govet
- loggercheck
- misspell
@@ -58,8 +64,14 @@ issues:
# TODO(#768): Drop when incrementing the API version.
text: "SA1019: constants.QueueAnnotation is deprecated"
- linters:
- - unused
- path: "^pkg/hierarchy.cohort.go"
+ - staticcheck
+ text: "SA1019: j.Status.State is deprecated: the State field is replaced by the Conditions field."
+ - linters:
+ - staticcheck
+ text: "SA1019: j.Status.RayClusterStatus.State is deprecated: the State field is replaced by the Conditions field."
+ - linters:
+ - fatcontext
+ path: "^test/*"
# Show all issues from a linter
max-issues-per-linter: 0
# Show all issues with the same text
diff --git a/CHANGELOG/CHANGELOG-0.8.md b/CHANGELOG/CHANGELOG-0.8.md
index 40c66b21997..27c1334b963 100644
--- a/CHANGELOG/CHANGELOG-0.8.md
+++ b/CHANGELOG/CHANGELOG-0.8.md
@@ -1,3 +1,25 @@
+## v0.8.1
+
+Changes since `v0.8.0`:
+
+### Feature
+
+- Add gauge metric admission_cycle_preemption_skips that reports the number of Workloads in a ClusterQueue
+ that got preemptions candidates, but had to be skipped in the last cycle. (#2942, @alculquicondor)
+- Publish images via artifact registry (#2832, @alculquicondor)
+
+### Bug or Regression
+
+- CLI: Support `-` and `.` in the resource flavor name on `create cq` (#2706, @trasc)
+- Detect and enable support for job CRDs installed after Kueue starts. (#2991, @ChristianZaccaria)
+- Fix over-admission after deleting resources from borrowing ClusterQueue. (#2879, @mbobrovskyi)
+- Fix support for kuberay 1.2.x (#2983, @mbobrovskyi)
+- Helm: Fix a bug for "unclosed action error". (#2688, @mbobrovskyi)
+- Prevent infinite preemption loop when PrioritySortingWithinCohort=false
+ is used together with borrowWithinCohort. (#2831, @mimowo)
+- Support for helm charts in the us-central1-docker.pkg.dev/k8s-staging-images/charts repository (#2834, @IrvingMg)
+- Update Flavor selection logic to prefer Flavors which allow reclamation of lent nominal quota, over Flavors which require preempting workloads within the ClusterQueue. This matches the behavior in the single Flavor case. (#2829, @gabesaba)
+
## v0.8.0
Changes since `v0.7.0`:
diff --git a/Dockerfile b/Dockerfile
index 8c0b67b390f..84cecdac432 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,6 @@
-ARG BUILDER_IMAGE
-ARG BASE_IMAGE
+ARG BUILDER_IMAGE=golang:1.23
+ARG BASE_IMAGE=gcr.io/distroless/static:nonroot
+
# Build the manager binary
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE} AS builder
diff --git a/Makefile b/Makefile
index 1444ad9918e..53d885386cb 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,7 @@ LD_FLAGS += -X '$(version_pkg).GitCommit=$(shell git rev-parse HEAD)'
# Update these variables when preparing a new release or a release branch.
# Then run `make prepare-release-branch`
-RELEASE_VERSION=v0.8.0
+RELEASE_VERSION=v0.8.1
RELEASE_BRANCH=main
.PHONY: all
@@ -122,7 +122,7 @@ update-helm: manifests yq
.PHONY: generate
generate: gomod-download controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations and client-go libraries.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./apis/..."
- ./hack/update-codegen.sh $(GO_CMD)
+ TOOLS_DIR=${TOOLS_DIR} ./hack/update-codegen.sh $(GO_CMD)
.PHONY: fmt
fmt: ## Run go fmt against code.
@@ -265,7 +265,8 @@ artifacts: kustomize yq helm ## Generate release artifacts.
$(KUSTOMIZE) build config/dev -o artifacts/manifests-dev.yaml
$(KUSTOMIZE) build config/alpha-enabled -o artifacts/manifests-alpha-enabled.yaml
$(KUSTOMIZE) build config/prometheus -o artifacts/prometheus.yaml
- $(KUSTOMIZE) build config/visibility -o artifacts/visibility-api.yaml
+ $(KUSTOMIZE) build config/visibility-apf/default -o artifacts/visibility-apf.yaml
+ $(KUSTOMIZE) build config/visibility-apf/1_28 -o artifacts/visibility-apf-1-28.yaml
@$(call clean-manifests)
# Update the image tag and policy
$(YQ) e '.controllerManager.manager.image.repository = "$(IMAGE_REPO)" | .controllerManager.manager.image.tag = "$(GIT_TAG)" | .controllerManager.manager.image.pullPolicy = "IfNotPresent"' -i charts/kueue/values.yaml
@@ -273,12 +274,12 @@ artifacts: kustomize yq helm ## Generate release artifacts.
$(HELM) package --version $(GIT_TAG) --app-version $(GIT_TAG) charts/kueue -d artifacts/
mv artifacts/kueue-$(GIT_TAG).tgz artifacts/kueue-chart-$(GIT_TAG).tgz
# Revert the image changes
- $(YQ) e '.controllerManager.manager.image.repository = "$(IMAGE_REGISTRY)/$(IMAGE_NAME)" | .controllerManager.manager.image.tag = "main" | .controllerManager.manager.image.pullPolicy = "Always"' -i charts/kueue/values.yaml
+ $(YQ) e '.controllerManager.manager.image.repository = "$(IMAGE_REGISTRY)/$(IMAGE_NAME)" | del(.controllerManager.manager.image.tag) | .controllerManager.manager.image.pullPolicy = "Always"' -i charts/kueue/values.yaml
CGO_ENABLED=$(CGO_ENABLED) GO_CMD="$(GO_CMD)" LD_FLAGS="$(LD_FLAGS)" BUILD_DIR="artifacts" BUILD_NAME=kubectl-kueue PLATFORMS="$(CLI_PLATFORMS)" ./hack/multiplatform-build.sh ./cmd/kueuectl/main.go
.PHONY: prepare-release-branch
prepare-release-branch: yq kustomize ## Prepare the release branch with the release version.
- $(SED) -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/hugo.toml -i cmd/experimental/kjobctl/docs/installation.md
+ $(SED) -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/hugo.toml
$(YQ) e '.appVersion = "$(RELEASE_VERSION)"' -i charts/kueue/Chart.yaml
@$(call clean-manifests)
@@ -340,5 +341,5 @@ generate-apiref: genref
generate-kueuectl-docs: kueuectl-docs
rm -Rf $(PROJECT_DIR)/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl*
$(PROJECT_DIR)/bin/kueuectl-docs \
- $(PROJECT_DIR)/hack/internal/tools/kueuectl-docs/templates \
+ $(PROJECT_DIR)/cmd/kueuectl-docs/templates \
$(PROJECT_DIR)/site/content/en/docs/reference/kubectl-kueue/commands
diff --git a/Makefile-deps.mk b/Makefile-deps.mk
index 942faf99944..aeaf48389b3 100644
--- a/Makefile-deps.mk
+++ b/Makefile-deps.mk
@@ -111,8 +111,19 @@ mpi-operator-crd: ## Copy the CRDs from the mpi-operator to the dep-crds directo
KF_TRAINING_ROOT = $(shell $(GO_CMD) list -m -mod=readonly -f "{{.Dir}}" github.com/kubeflow/training-operator)
.PHONY: kf-training-operator-crd
kf-training-operator-crd: ## Copy the CRDs from the training-operator to the dep-crds directory.
- mkdir -p $(EXTERNAL_CRDS_DIR)/training-operator/
- cp -f $(KF_TRAINING_ROOT)/manifests/base/crds/* $(EXTERNAL_CRDS_DIR)/training-operator/
+ ## Removing kubeflow.org_mpijobs.yaml is required as the version of MPIJob is conflicting between training-operator and mpi-operator - in integration tests.
+ mkdir -p $(EXTERNAL_CRDS_DIR)/training-operator-crds/
+ find $(KF_TRAINING_ROOT)/manifests/base/crds/* -type f -not -name "kubeflow.org_mpijobs.yaml" -exec cp -pf {} $(EXTERNAL_CRDS_DIR)/training-operator-crds/ \;
+
+.PHONY: kf-training-operator-manifests
+kf-training-operator-manifests: ## Copy whole manifests folder from the training-operator to the dep-crds directory.
+ ## Full version of the manifest is required for e2e multikueue tests.
+ if [ -d "$(EXTERNAL_CRDS_DIR)/training-operator" ]; then \
+ chmod -R u+w "$(EXTERNAL_CRDS_DIR)/training-operator" && \
+ rm -rf "$(EXTERNAL_CRDS_DIR)/training-operator"; \
+ fi
+ mkdir -p "$(EXTERNAL_CRDS_DIR)/training-operator"
+ cp -rf "$(KF_TRAINING_ROOT)/manifests" "$(EXTERNAL_CRDS_DIR)/training-operator"
RAY_ROOT = $(shell $(GO_CMD) list -m -mod=readonly -f "{{.Dir}}" github.com/ray-project/kuberay/ray-operator)
.PHONY: ray-operator-crd
@@ -133,11 +144,9 @@ cluster-autoscaler-crd: ## Copy the CRDs from the cluster-autoscaler to the dep-
cp -f $(CLUSTER_AUTOSCALER_ROOT)/config/crd/* $(EXTERNAL_CRDS_DIR)/cluster-autoscaler/
.PHONY: dep-crds
-dep-crds: mpi-operator-crd kf-training-operator-crd ray-operator-crd jobset-operator-crd cluster-autoscaler-crd ## Copy the CRDs from the external operators to the dep-crds directory.
+dep-crds: mpi-operator-crd kf-training-operator-crd ray-operator-crd jobset-operator-crd cluster-autoscaler-crd kf-training-operator-manifests ## Copy the CRDs from the external operators to the dep-crds directory.
@echo "Copying CRDs from external operators to dep-crds directory"
.PHONY: kueuectl-docs
kueuectl-docs:
- cd $(PROJECT_DIR)/hack/internal/tools && \
- go mod download && \
- $(GO_BUILD_ENV) $(GO_CMD) build -ldflags="$(LD_FLAGS)" -o $(PROJECT_DIR)/bin/kueuectl-docs ./kueuectl-docs/main.go
\ No newline at end of file
+ $(GO_BUILD_ENV) $(GO_CMD) build -ldflags="$(LD_FLAGS)" -o $(PROJECT_DIR)/bin/kueuectl-docs ./cmd/kueuectl-docs/main.go
\ No newline at end of file
diff --git a/Makefile-test.mk b/Makefile-test.mk
index cb247ffd73d..2dc94a8a6b8 100644
--- a/Makefile-test.mk
+++ b/Makefile-test.mk
@@ -15,11 +15,16 @@
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
ARTIFACTS ?= $(PROJECT_DIR)/bin
+ifeq ($(shell uname),Darwin)
+ GOFLAGS ?= -ldflags=-extldflags=-Wl,-ld_classic
+endif
+
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
+
GO_CMD ?= go
GO_TEST_FLAGS ?= -race
version_pkg = sigs.k8s.io/kueue/pkg/version
@@ -27,7 +32,7 @@ LD_FLAGS += -X '$(version_pkg).GitVersion=$(GIT_TAG)'
LD_FLAGS += -X '$(version_pkg).GitCommit=$(shell git rev-parse HEAD)'
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION ?= 1.30
+ENVTEST_K8S_VERSION ?= 1.31
# Number of processes to use during integration tests to run specs within a
# suite in parallel. Suites still run sequentially. User may set this value to 1
@@ -38,12 +43,17 @@ INTEGRATION_TARGET ?= ./test/integration/...
# Verbosity level for apiserver logging.
# The logging is disabled if 0.
INTEGRATION_API_LOG_LEVEL ?= 0
+# Integration filters
+INTEGRATION_RUN_ALL?=true
+ifneq ($(INTEGRATION_RUN_ALL),true)
+ INTEGRATION_FILTERS= --label-filter="!slow && !redundant"
+endif
# Folder where the e2e tests are located.
E2E_TARGET ?= ./test/e2e/...
-E2E_KIND_VERSION ?= kindest/node:v1.30.0
+E2E_KIND_VERSION ?= kindest/node:v1.31.0
# E2E_K8S_VERSIONS sets the list of k8s versions included in test-e2e-all
-E2E_K8S_VERSIONS ?= 1.28.9 1.29.4 1.30.0
+E2E_K8S_VERSIONS ?= 1.28.13 1.29.8 1.30.4 1.31.0
# For local testing, we should allow user to use different kind cluster name
# Default will delete default kind cluster
@@ -59,45 +69,49 @@ IMAGE_TAG ?= $(IMAGE_REPO):$(GIT_TAG)
# JobSet Version
JOBSET_VERSION = $(shell $(GO_CMD) list -m -f "{{.Version}}" sigs.k8s.io/jobset)
KUBEFLOW_VERSION = $(shell $(GO_CMD) list -m -f "{{.Version}}" github.com/kubeflow/training-operator)
+KUBEFLOW_MPI_VERSION = $(shell $(GO_CMD) list -m -f "{{.Version}}" github.com/kubeflow/mpi-operator)
##@ Tests
.PHONY: test
test: gotestsum ## Run tests.
- $(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- $(GO_TEST_FLAGS) $(shell $(GO_CMD) list ./... | grep -v '/test/') -coverpkg=./... -coverprofile $(ARTIFACTS)/cover.out
+ $(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- $(GOFLAGS) $(GO_TEST_FLAGS) $(shell $(GO_CMD) list ./... | grep -v '/test/') -coverpkg=./... -coverprofile $(ARTIFACTS)/cover.out
.PHONY: test-integration
-test-integration: gomod-download envtest ginkgo mpi-operator-crd ray-operator-crd jobset-operator-crd kf-training-operator-crd cluster-autoscaler-crd kueuectl ## Run tests.
+test-integration: gomod-download envtest ginkgo dep-crds kueuectl ginkgo-top ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" \
KUEUE_BIN=$(PROJECT_DIR)/bin \
ENVTEST_K8S_VERSION=$(ENVTEST_K8S_VERSION) \
API_LOG_LEVEL=$(INTEGRATION_API_LOG_LEVEL) \
- $(GINKGO) $(GINKGO_ARGS) -procs=$(INTEGRATION_NPROCS) --race --junit-report=junit.xml --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)
+ $(GINKGO) $(INTEGRATION_FILTERS) $(GINKGO_ARGS) -procs=$(INTEGRATION_NPROCS) --race --junit-report=junit.xml --json-report=integration.json --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)
+ $(PROJECT_DIR)/bin/ginkgo-top -i $(ARTIFACTS)/integration.json > $(ARTIFACTS)/integration-top.yaml
CREATE_KIND_CLUSTER ?= true
.PHONY: test-e2e
-test-e2e: kustomize ginkgo yq gomod-download jobset-operator-crd kf-training-operator-crd kueuectl run-test-e2e-$(E2E_KIND_VERSION:kindest/node:v%=%)
+test-e2e: kustomize ginkgo yq gomod-download dep-crds kueuectl ginkgo-top run-test-e2e-$(E2E_KIND_VERSION:kindest/node:v%=%)
.PHONY: test-multikueue-e2e
-test-multikueue-e2e: kustomize ginkgo yq gomod-download jobset-operator-crd kf-training-operator-crd run-test-multikueue-e2e-$(E2E_KIND_VERSION:kindest/node:v%=%)
+test-multikueue-e2e: kustomize ginkgo yq gomod-download dep-crds ginkgo-top run-test-multikueue-e2e-$(E2E_KIND_VERSION:kindest/node:v%=%)
E2E_TARGETS := $(addprefix run-test-e2e-,${E2E_K8S_VERSIONS})
MULTIKUEUE-E2E_TARGETS := $(addprefix run-test-multikueue-e2e-,${E2E_K8S_VERSIONS})
.PHONY: test-e2e-all
-test-e2e-all: ginkgo $(E2E_TARGETS) $(MULTIKUEUE-E2E_TARGETS)
+test-e2e-all: ginkgo ginkgo-top $(E2E_TARGETS) $(MULTIKUEUE-E2E_TARGETS)
FORCE:
run-test-e2e-%: K8S_VERSION = $(@:run-test-e2e-%=%)
run-test-e2e-%: FORCE
@echo Running e2e for k8s ${K8S_VERSION}
- E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" JOBSET_VERSION=$(JOBSET_VERSION) KUBEFLOW_VERSION=$(KUBEFLOW_VERSION) ./hack/e2e-test.sh
+ E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" JOBSET_VERSION=$(JOBSET_VERSION) KUBEFLOW_VERSION=$(KUBEFLOW_VERSION) KUBEFLOW_MPI_VERSION=$(KUBEFLOW_MPI_VERSION) ./hack/e2e-test.sh
+ $(PROJECT_DIR)/bin/ginkgo-top -i $(ARTIFACTS)/$@/e2e.json > $(ARTIFACTS)/$@/e2e-top.yaml
run-test-multikueue-e2e-%: K8S_VERSION = $(@:run-test-multikueue-e2e-%=%)
run-test-multikueue-e2e-%: FORCE
@echo Running multikueue e2e for k8s ${K8S_VERSION}
- E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" JOBSET_VERSION=$(JOBSET_VERSION) KUBEFLOW_VERSION=$(KUBEFLOW_VERSION) ./hack/multikueue-e2e-test.sh
+ E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" JOBSET_VERSION=$(JOBSET_VERSION) KUBEFLOW_VERSION=$(KUBEFLOW_VERSION) KUBEFLOW_MPI_VERSION=$(KUBEFLOW_MPI_VERSION) ./hack/multikueue-e2e-test.sh
+ $(PROJECT_DIR)/bin/ginkgo-top -i $(ARTIFACTS)/$@/e2e.json > $(ARTIFACTS)/$@/e2e-top.yaml
SCALABILITY_RUNNER := $(PROJECT_DIR)/bin/performance-scheduler-runner
.PHONY: performance-scheduler-runner
@@ -139,13 +153,18 @@ run-performance-scheduler: envtest performance-scheduler-runner minimalkueue
--generatorConfig=$(SCALABILITY_GENERATOR_CONFIG) \
--minimalKueue=$(MINIMALKUEUE_RUNNER) $(SCALABILITY_EXTRA_ARGS) $(SCALABILITY_SCRAPE_ARGS)
-.PHONY: test-performance-scheduler
-test-performance-scheduler: gotestsum run-performance-scheduler
+.PHONY: test-performance-scheduler-once
+test-performance-scheduler-once: gotestsum run-performance-scheduler
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- $(GO_TEST_FLAGS) ./test/performance/scheduler/checker \
--summary=$(SCALABILITY_RUN_DIR)/summary.yaml \
--cmdStats=$(SCALABILITY_RUN_DIR)/minimalkueue.stats.yaml \
--range=$(PROJECT_DIR)/test/performance/scheduler/default_rangespec.yaml
+PERFORMANCE_RETRY_COUNT?=2
+.PHONY: test-performance-scheduler
+test-performance-scheduler:
+ ARTIFACTS=$(ARTIFACTS) ./hack/performance-retry.sh $(PERFORMANCE_RETRY_COUNT)
+
.PHONY: run-performance-scheduler-in-cluster
run-performance-scheduler-in-cluster: envtest performance-scheduler-runner
mkdir -p $(ARTIFACTS)/run-performance-scheduler-in-cluster
@@ -154,3 +173,9 @@ run-performance-scheduler-in-cluster: envtest performance-scheduler-runner
--o $(ARTIFACTS)/run-performance-scheduler-in-cluster \
--generatorConfig=$(SCALABILITY_GENERATOR_CONFIG) \
--qps=1000 --burst=2000 --timeout=15m $(SCALABILITY_SCRAPE_ARGS)
+
+.PHONY: ginkgo-top
+ginkgo-top:
+ cd $(PROJECT_DIR)/hack/internal/tools && \
+ go mod download && \
+ $(GO_BUILD_ENV) $(GO_CMD) build -ldflags="$(LD_FLAGS)" -o $(PROJECT_DIR)/bin/ginkgo-top ./ginkgo-top
diff --git a/OWNERS b/OWNERS
index c50d27eab7a..b8dd3f31145 100644
--- a/OWNERS
+++ b/OWNERS
@@ -9,6 +9,7 @@ reviewers:
- alculquicondor
- denkensk
- kerthcet
+- mbobrovskyi
- mimowo
- tenzen-y
- trasc
diff --git a/README.md b/README.md
index 46e307b5c30..34d8020f528 100644
--- a/README.md
+++ b/README.md
@@ -57,7 +57,7 @@ Read the [overview](https://kueue.sigs.k8s.io/docs/overview/) to learn more.
To install the latest release of Kueue in your cluster, run the following command:
```shell
-kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/v0.8.0/manifests.yaml
+kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/v0.8.1/manifests.yaml
```
The controller runs in the `kueue-system` namespace.
diff --git a/SECURITY-INSIGHTS.yaml b/SECURITY-INSIGHTS.yaml
index 0bb799439b2..41261131781 100644
--- a/SECURITY-INSIGHTS.yaml
+++ b/SECURITY-INSIGHTS.yaml
@@ -1,11 +1,11 @@
header:
schema-version: 1.0.0
expiration-date: '2024-09-28T01:00:00.000Z'
- last-updated: '2024-07-19'
- last-reviewed: '2024-07-19'
- commit-hash: 58ef31e6ef674db0aa04cb587d41862570ad1d12
+ last-updated: '2024-09-05'
+ last-reviewed: '2024-09-05'
+ commit-hash: 7cb1dfb41e178aeb0674e36c996e17c711325e89
project-url: 'https://github.com/kubernetes-sigs/kueue'
- project-release: 0.8.0
+ project-release: 0.8.1
changelog: 'https://github.com/kubernetes-sigs/kueue/tree/main/CHANGELOG'
license: 'https://github.com/kubernetes-sigs/kueue/blob/main/LICENSE'
project-lifecycle:
@@ -28,7 +28,7 @@ documentation:
- 'https://kueue.sigs.k8s.io/docs/'
distribution-points:
- >-
- https://github.com/kubernetes-sigs/kueue/releases/download/v0.8.0/manifests.yaml
+ https://github.com/kubernetes-sigs/kueue/releases/download/v0.8.1/manifests.yaml
security-artifacts:
threat-model:
threat-model-created: false
@@ -62,5 +62,5 @@ dependencies:
dependencies-lists:
- 'https://github.com/kubernetes-sigs/kueue/blob/main/go.mod'
sbom:
- - sbom-file: https://github.com/kubernetes-sigs/kueue/releases/download/v0.8.0/kueue-v0.8.0.spdx.json
+ - sbom-file: https://github.com/kubernetes-sigs/kueue/releases/download/v0.8.1/kueue-v0.8.1.spdx.json
sbom-format: SPDX
diff --git a/apis/config/v1beta1/configuration_types.go b/apis/config/v1beta1/configuration_types.go
index 4b28effbfcb..f8e4c0b11f4 100644
--- a/apis/config/v1beta1/configuration_types.go
+++ b/apis/config/v1beta1/configuration_types.go
@@ -66,6 +66,9 @@ type Configuration struct {
// QueueVisibility is configuration to expose the information about the top
// pending workloads.
+ // Deprecated: This field will be removed on v1beta2, use VisibilityOnDemand
+ // (https://kueue.sigs.k8s.io/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/)
+ // instead.
QueueVisibility *QueueVisibility `json:"queueVisibility,omitempty"`
// MultiKueue controls the behaviour of the MultiKueue AdmissionCheck Controller.
diff --git a/apis/kueue/v1alpha1/cohort_types.go b/apis/kueue/v1alpha1/cohort_types.go
index 1450bd95734..e197a38e07f 100644
--- a/apis/kueue/v1alpha1/cohort_types.go
+++ b/apis/kueue/v1alpha1/cohort_types.go
@@ -62,12 +62,6 @@ type CohortSpec struct {
ResourceGroups []kueuebeta.ResourceGroup `json:"resourceGroups,omitempty"`
}
-const (
- // Condition indicating that a Cohort is correctly configured,
- // for example, there is no cycle.
- CohortActive = "Active"
-)
-
// CohortStatus defines the observed state of Cohort
type CohortStatus struct {
@@ -82,7 +76,9 @@ type CohortStatus struct {
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
-// Cohort is the Schema for the cohorts API
+// Cohort is the Schema for the cohorts API. Using Hierarchical
+// Cohorts (any Cohort which has a parent) with Fair Sharing
+// results in undefined behavior in 0.9
type Cohort struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
diff --git a/apis/kueue/v1alpha1/tas_types.go b/apis/kueue/v1alpha1/tas_types.go
new file mode 100644
index 00000000000..0e6aa6ff8f8
--- /dev/null
+++ b/apis/kueue/v1alpha1/tas_types.go
@@ -0,0 +1,29 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+const (
+ // WorkloadAnnotation is an annotation set on the Job's PodTemplate to
+ // indicate the name of the admitted Workload corresponding to the Job. The
+ // annotation is set when starting the Job, and removed on stopping the Job.
+ WorkloadAnnotation = "kueue.x-k8s.io/workload"
+
+ // PodSetLabel is a label set on the Job's PodTemplate to indicate the name
+ // of the PodSet of the admitted Workload corresponding to the PodTemplate.
+ // The label is set when starting the Job, and removed on stopping the Job.
+ PodSetLabel = "kueue.x-k8s.io/podset"
+)
diff --git a/apis/kueue/v1alpha1/zz_generated.deepcopy.go b/apis/kueue/v1alpha1/zz_generated.deepcopy.go
index 7bce77a1e21..2ff1d6db07a 100644
--- a/apis/kueue/v1alpha1/zz_generated.deepcopy.go
+++ b/apis/kueue/v1alpha1/zz_generated.deepcopy.go
@@ -128,193 +128,3 @@ func (in *CohortStatus) DeepCopy() *CohortStatus {
in.DeepCopyInto(out)
return out
}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KubeConfig) DeepCopyInto(out *KubeConfig) {
- *out = *in
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeConfig.
-func (in *KubeConfig) DeepCopy() *KubeConfig {
- if in == nil {
- return nil
- }
- out := new(KubeConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MultiKueueCluster) DeepCopyInto(out *MultiKueueCluster) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- out.Spec = in.Spec
- in.Status.DeepCopyInto(&out.Status)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueCluster.
-func (in *MultiKueueCluster) DeepCopy() *MultiKueueCluster {
- if in == nil {
- return nil
- }
- out := new(MultiKueueCluster)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *MultiKueueCluster) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MultiKueueClusterList) DeepCopyInto(out *MultiKueueClusterList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]MultiKueueCluster, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueClusterList.
-func (in *MultiKueueClusterList) DeepCopy() *MultiKueueClusterList {
- if in == nil {
- return nil
- }
- out := new(MultiKueueClusterList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *MultiKueueClusterList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MultiKueueClusterSpec) DeepCopyInto(out *MultiKueueClusterSpec) {
- *out = *in
- out.KubeConfig = in.KubeConfig
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueClusterSpec.
-func (in *MultiKueueClusterSpec) DeepCopy() *MultiKueueClusterSpec {
- if in == nil {
- return nil
- }
- out := new(MultiKueueClusterSpec)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MultiKueueClusterStatus) DeepCopyInto(out *MultiKueueClusterStatus) {
- *out = *in
- if in.Conditions != nil {
- in, out := &in.Conditions, &out.Conditions
- *out = make([]v1.Condition, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueClusterStatus.
-func (in *MultiKueueClusterStatus) DeepCopy() *MultiKueueClusterStatus {
- if in == nil {
- return nil
- }
- out := new(MultiKueueClusterStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MultiKueueConfig) DeepCopyInto(out *MultiKueueConfig) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- in.Spec.DeepCopyInto(&out.Spec)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueConfig.
-func (in *MultiKueueConfig) DeepCopy() *MultiKueueConfig {
- if in == nil {
- return nil
- }
- out := new(MultiKueueConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *MultiKueueConfig) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MultiKueueConfigList) DeepCopyInto(out *MultiKueueConfigList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]MultiKueueConfig, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueConfigList.
-func (in *MultiKueueConfigList) DeepCopy() *MultiKueueConfigList {
- if in == nil {
- return nil
- }
- out := new(MultiKueueConfigList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *MultiKueueConfigList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MultiKueueConfigSpec) DeepCopyInto(out *MultiKueueConfigSpec) {
- *out = *in
- if in.Clusters != nil {
- in, out := &in.Clusters, &out.Clusters
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueConfigSpec.
-func (in *MultiKueueConfigSpec) DeepCopy() *MultiKueueConfigSpec {
- if in == nil {
- return nil
- }
- out := new(MultiKueueConfigSpec)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/apis/kueue/v1beta1/admissioncheck_types.go b/apis/kueue/v1beta1/admissioncheck_types.go
index 73d5d84f6fc..786cc3e48f2 100644
--- a/apis/kueue/v1beta1/admissioncheck_types.go
+++ b/apis/kueue/v1beta1/admissioncheck_types.go
@@ -52,12 +52,12 @@ type AdmissionCheckSpec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
ControllerName string `json:"controllerName"`
- // RetryDelayMinutes **deprecated** specifies how long to keep the workload suspended after
+ // RetryDelayMinutes specifies how long to keep the workload suspended after
// a failed check (after it transitioned to False). When the delay period has passed, the check
// state goes to "Unknown". The default is 15 min.
- // The default is 15 min.
// +optional
// +kubebuilder:default=15
+ // Deprecated: retryDelayMinutes has already been deprecated since v0.8 and will be removed in v1beta2.
RetryDelayMinutes *int64 `json:"retryDelayMinutes,omitempty"`
// Parameters identifies a configuration with additional parameters for the
diff --git a/apis/kueue/v1beta1/clusterqueue_types.go b/apis/kueue/v1beta1/clusterqueue_types.go
index 996c799fb98..46a02b7ef95 100644
--- a/apis/kueue/v1beta1/clusterqueue_types.go
+++ b/apis/kueue/v1beta1/clusterqueue_types.go
@@ -22,6 +22,19 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
+// ClusterQueue Active condition reasons.
+const (
+ ClusterQueueActiveReasonTerminating = "Terminating"
+ ClusterQueueActiveReasonStopped = "Stopped"
+ ClusterQueueActiveReasonFlavorNotFound = "FlavorNotFound"
+ ClusterQueueActiveReasonAdmissionCheckNotFound = "AdmissionCheckNotFound"
+ ClusterQueueActiveReasonAdmissionCheckInactive = "AdmissionCheckInactive"
+ ClusterQueueActiveReasonMultipleSingleInstanceControllerAdmissionChecks = "MultipleSingleInstanceControllerAdmissionChecks"
+ ClusterQueueActiveReasonFlavorIndependentAdmissionCheckAppliedPerFlavor = "FlavorIndependentAdmissionCheckAppliedPerFlavor"
+ ClusterQueueActiveReasonUnknown = "Unknown"
+ ClusterQueueActiveReasonReady = "Ready"
+)
+
// ClusterQueueSpec defines the desired state of ClusterQueue
// +kubebuilder:validation:XValidation:rule="!has(self.cohort) && has(self.resourceGroups) ? self.resourceGroups.all(rg, rg.flavors.all(f, f.resources.all(r, !has(r.borrowingLimit)))) : true", message="borrowingLimit must be nil when cohort is empty"
type ClusterQueueSpec struct {
@@ -289,6 +302,9 @@ type ClusterQueueStatus struct {
// PendingWorkloadsStatus contains the information exposed about the current
// status of the pending workloads in the cluster queue.
+ // Deprecated: This field will be removed on v1beta2, use VisibilityOnDemand
+ // (https://kueue.sigs.k8s.io/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/)
+ // instead.
// +optional
PendingWorkloadsStatus *ClusterQueuePendingWorkloadsStatus `json:"pendingWorkloadsStatus"`
diff --git a/apis/kueue/v1alpha1/multikueue_types.go b/apis/kueue/v1beta1/multikueue_types.go
similarity index 99%
rename from apis/kueue/v1alpha1/multikueue_types.go
rename to apis/kueue/v1beta1/multikueue_types.go
index fbb50ea214a..a0a18a52382 100644
--- a/apis/kueue/v1alpha1/multikueue_types.go
+++ b/apis/kueue/v1beta1/multikueue_types.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/apis/kueue/v1beta1/zz_generated.deepcopy.go b/apis/kueue/v1beta1/zz_generated.deepcopy.go
index cf773364d58..7e57bd07914 100644
--- a/apis/kueue/v1beta1/zz_generated.deepcopy.go
+++ b/apis/kueue/v1beta1/zz_generated.deepcopy.go
@@ -566,6 +566,21 @@ func (in *FlavorUsage) DeepCopy() *FlavorUsage {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KubeConfig) DeepCopyInto(out *KubeConfig) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeConfig.
+func (in *KubeConfig) DeepCopy() *KubeConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(KubeConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LocalQueue) DeepCopyInto(out *LocalQueue) {
*out = *in
@@ -719,6 +734,181 @@ func (in *LocalQueueStatus) DeepCopy() *LocalQueueStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MultiKueueCluster) DeepCopyInto(out *MultiKueueCluster) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ in.Status.DeepCopyInto(&out.Status)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueCluster.
+func (in *MultiKueueCluster) DeepCopy() *MultiKueueCluster {
+ if in == nil {
+ return nil
+ }
+ out := new(MultiKueueCluster)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MultiKueueCluster) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MultiKueueClusterList) DeepCopyInto(out *MultiKueueClusterList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]MultiKueueCluster, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueClusterList.
+func (in *MultiKueueClusterList) DeepCopy() *MultiKueueClusterList {
+ if in == nil {
+ return nil
+ }
+ out := new(MultiKueueClusterList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MultiKueueClusterList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MultiKueueClusterSpec) DeepCopyInto(out *MultiKueueClusterSpec) {
+ *out = *in
+ out.KubeConfig = in.KubeConfig
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueClusterSpec.
+func (in *MultiKueueClusterSpec) DeepCopy() *MultiKueueClusterSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MultiKueueClusterSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MultiKueueClusterStatus) DeepCopyInto(out *MultiKueueClusterStatus) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]v1.Condition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueClusterStatus.
+func (in *MultiKueueClusterStatus) DeepCopy() *MultiKueueClusterStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MultiKueueClusterStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MultiKueueConfig) DeepCopyInto(out *MultiKueueConfig) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueConfig.
+func (in *MultiKueueConfig) DeepCopy() *MultiKueueConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(MultiKueueConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MultiKueueConfig) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MultiKueueConfigList) DeepCopyInto(out *MultiKueueConfigList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]MultiKueueConfig, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueConfigList.
+func (in *MultiKueueConfigList) DeepCopy() *MultiKueueConfigList {
+ if in == nil {
+ return nil
+ }
+ out := new(MultiKueueConfigList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MultiKueueConfigList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MultiKueueConfigSpec) DeepCopyInto(out *MultiKueueConfigSpec) {
+ *out = *in
+ if in.Clusters != nil {
+ in, out := &in.Clusters, &out.Clusters
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiKueueConfigSpec.
+func (in *MultiKueueConfigSpec) DeepCopy() *MultiKueueConfigSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MultiKueueConfigSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSet) DeepCopyInto(out *PodSet) {
*out = *in
diff --git a/apis/visibility/v1alpha1/openapi/doc.go b/apis/visibility/openapi/doc.go
similarity index 93%
rename from apis/visibility/v1alpha1/openapi/doc.go
rename to apis/visibility/openapi/doc.go
index 0bb26392151..2c76bd1da6f 100644
--- a/apis/visibility/v1alpha1/openapi/doc.go
+++ b/apis/visibility/openapi/doc.go
@@ -15,6 +15,6 @@ limitations under the License.
*/
// To avoid the following error from controller-gen, we need to have this file.
-// "-: build constraints exclude all Go files in /home/prow/go/src/sigs.k8s.io/kueue/apis/visibility/v1alpha1/openapi"
+// "-: build constraints exclude all Go files in /home/prow/go/src/sigs.k8s.io/kueue/apis/visibility/openapi"
package openapi
diff --git a/apis/visibility/v1alpha1/openapi/zz_generated.openapi.go b/apis/visibility/openapi/zz_generated.openapi.go
similarity index 89%
rename from apis/visibility/v1alpha1/openapi/zz_generated.openapi.go
rename to apis/visibility/openapi/zz_generated.openapi.go
index 69a5e0e6b7c..943faad3079 100644
--- a/apis/visibility/v1alpha1/openapi/zz_generated.openapi.go
+++ b/apis/visibility/openapi/zz_generated.openapi.go
@@ -18,8 +18,6 @@ limitations under the License.
*/
// Code generated by openapi-gen. DO NOT EDIT.
-// This file was autogenerated by openapi-gen. Do not edit it manually!
-
package openapi
import (
@@ -40,6 +38,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref),
+ "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref),
@@ -89,6 +88,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"sigs.k8s.io/kueue/apis/visibility/v1alpha1.PendingWorkload": schema_kueue_apis_visibility_v1alpha1_PendingWorkload(ref),
"sigs.k8s.io/kueue/apis/visibility/v1alpha1.PendingWorkloadOptions": schema_kueue_apis_visibility_v1alpha1_PendingWorkloadOptions(ref),
"sigs.k8s.io/kueue/apis/visibility/v1alpha1.PendingWorkloadsSummary": schema_kueue_apis_visibility_v1alpha1_PendingWorkloadsSummary(ref),
+ "sigs.k8s.io/kueue/apis/visibility/v1beta1.ClusterQueue": schema_kueue_apis_visibility_v1beta1_ClusterQueue(ref),
+ "sigs.k8s.io/kueue/apis/visibility/v1beta1.ClusterQueueList": schema_kueue_apis_visibility_v1beta1_ClusterQueueList(ref),
+ "sigs.k8s.io/kueue/apis/visibility/v1beta1.LocalQueue": schema_kueue_apis_visibility_v1beta1_LocalQueue(ref),
+ "sigs.k8s.io/kueue/apis/visibility/v1beta1.LocalQueueList": schema_kueue_apis_visibility_v1beta1_LocalQueueList(ref),
+ "sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkload": schema_kueue_apis_visibility_v1beta1_PendingWorkload(ref),
+ "sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadOptions": schema_kueue_apis_visibility_v1beta1_PendingWorkloadOptions(ref),
+ "sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadsSummary": schema_kueue_apis_visibility_v1beta1_PendingWorkloadsSummary(ref),
}
}
@@ -746,6 +752,56 @@ func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenA
}
}
+func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "key": {
+ SchemaProps: spec.SchemaProps{
+ Description: "key is the field selector key that the requirement applies to.",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "operator": {
+ SchemaProps: spec.SchemaProps{
+ Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "values": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"key", "operator"},
+ },
+ },
+ }
+}
+
func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -2954,3 +3010,327 @@ func schema_kueue_apis_visibility_v1alpha1_PendingWorkloadsSummary(ref common.Re
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/kueue/apis/visibility/v1alpha1.PendingWorkload"},
}
}
+
+func schema_kueue_apis_visibility_v1beta1_ClusterQueue(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
+ },
+ },
+ "pendingWorkloadsSummary": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadsSummary"),
+ },
+ },
+ },
+ Required: []string{"pendingWorkloadsSummary"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadsSummary"},
+ }
+}
+
+func schema_kueue_apis_visibility_v1beta1_ClusterQueueList(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
+ },
+ },
+ "items": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("sigs.k8s.io/kueue/apis/visibility/v1beta1.ClusterQueue"),
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"items"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/kueue/apis/visibility/v1beta1.ClusterQueue"},
+ }
+}
+
+func schema_kueue_apis_visibility_v1beta1_LocalQueue(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
+ },
+ },
+ "pendingWorkloadsSummary": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadsSummary"),
+ },
+ },
+ },
+ Required: []string{"pendingWorkloadsSummary"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadsSummary"},
+ }
+}
+
+func schema_kueue_apis_visibility_v1beta1_LocalQueueList(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
+ },
+ },
+ "items": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("sigs.k8s.io/kueue/apis/visibility/v1beta1.LocalQueue"),
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"items"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/kueue/apis/visibility/v1beta1.LocalQueue"},
+ }
+}
+
+func schema_kueue_apis_visibility_v1beta1_PendingWorkload(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PendingWorkload is a user-facing representation of a pending workload that summarizes the relevant information for position in the cluster queue.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
+ },
+ },
+ "priority": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Priority indicates the workload's priority",
+ Default: 0,
+ Type: []string{"integer"},
+ Format: "int32",
+ },
+ },
+ "localQueueName": {
+ SchemaProps: spec.SchemaProps{
+ Description: "LocalQueueName indicates the name of the LocalQueue the workload is submitted to",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "positionInClusterQueue": {
+ SchemaProps: spec.SchemaProps{
+ Description: "PositionInClusterQueue indicates the workload's position in the ClusterQueue, starting from 0",
+ Default: 0,
+ Type: []string{"integer"},
+ Format: "int32",
+ },
+ },
+ "positionInLocalQueue": {
+ SchemaProps: spec.SchemaProps{
+ Description: "PositionInLocalQueue indicates the workload's position in the LocalQueue, starting from 0",
+ Default: 0,
+ Type: []string{"integer"},
+ Format: "int32",
+ },
+ },
+ },
+ Required: []string{"priority", "localQueueName", "positionInClusterQueue", "positionInLocalQueue"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
+ }
+}
+
+func schema_kueue_apis_visibility_v1beta1_PendingWorkloadOptions(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PendingWorkloadOptions are query params used in the visibility queries",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "offset": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Offset indicates position of the first pending workload that should be fetched, starting from 0. 0 by default",
+ Default: 0,
+ Type: []string{"integer"},
+ Format: "int64",
+ },
+ },
+ "limit": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Limit indicates max number of pending workloads that should be fetched. 1000 by default",
+ Type: []string{"integer"},
+ Format: "int64",
+ },
+ },
+ },
+ Required: []string{"offset"},
+ },
+ },
+ }
+}
+
+func schema_kueue_apis_visibility_v1beta1_PendingWorkloadsSummary(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PendingWorkloadsSummary contains a list of pending workloads in the context of the query (within LocalQueue or ClusterQueue).",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
+ },
+ },
+ "items": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkload"),
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"items"},
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkload"},
+ }
+}
diff --git a/apis/visibility/v1beta1/conversion_test.go b/apis/visibility/v1beta1/conversion_test.go
new file mode 100644
index 00000000000..a9fec3d3401
--- /dev/null
+++ b/apis/visibility/v1beta1/conversion_test.go
@@ -0,0 +1,93 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "net/url"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/util/diff"
+)
+
+func TestPendingWorkloadsOptions(t *testing.T) {
+ scheme := runtime.NewScheme()
+ err := AddToScheme(scheme)
+ if err != nil {
+ t.Fatal(err)
+ }
+ codec := runtime.NewParameterCodec(scheme)
+
+ cases := map[string]struct {
+ inputQueryParams url.Values
+ wantQueryParams url.Values
+ wantPendingWorkloadOptions PendingWorkloadOptions
+ }{
+ "correct parameters": {
+ inputQueryParams: url.Values{
+ "limit": {"1"},
+ "offset": {"2"},
+ },
+ wantQueryParams: url.Values{
+ "limit": {"1"},
+ "offset": {"2"},
+ },
+ wantPendingWorkloadOptions: PendingWorkloadOptions{
+ Limit: 1,
+ Offset: 2,
+ },
+ },
+ "default values": {
+ inputQueryParams: url.Values{
+ "limit": {"0"},
+ "offset": {"0"},
+ },
+ wantQueryParams: url.Values{
+ "limit": {"1000"},
+ "offset": {"0"},
+ },
+ wantPendingWorkloadOptions: PendingWorkloadOptions{
+ Limit: 1000,
+ Offset: 0,
+ },
+ },
+ }
+
+ for name, tc := range cases {
+ t.Run(name, func(t *testing.T) {
+ // versioned -> query params
+ actualParameters, err := codec.EncodeParameters(&tc.wantPendingWorkloadOptions, SchemeGroupVersion)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if d := cmp.Diff(actualParameters, tc.wantQueryParams); d != "" {
+ t.Fatalf("Unexpected serialization:\n%s", diff.ObjectGoPrintSideBySide(tc.wantQueryParams, actualParameters))
+ }
+
+ // query params -> versioned
+ convertedPendingWorkloadOptions := PendingWorkloadOptions{}
+ err = codec.DecodeParameters(tc.inputQueryParams, SchemeGroupVersion, &convertedPendingWorkloadOptions)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if d := cmp.Diff(convertedPendingWorkloadOptions, tc.wantPendingWorkloadOptions); d != "" {
+ t.Fatalf("Unexpected deserialization:\n%s", diff.ObjectGoPrintSideBySide(tc.wantPendingWorkloadOptions, convertedPendingWorkloadOptions))
+ }
+ })
+ }
+}
diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go b/apis/visibility/v1beta1/defaults.go
similarity index 51%
rename from vendor/k8s.io/code-generator/cmd/client-gen/path/path.go
rename to apis/visibility/v1beta1/defaults.go
index 19b269bdf28..2dfe0b95556 100644
--- a/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go
+++ b/apis/visibility/v1beta1/defaults.go
@@ -1,5 +1,5 @@
/*
-Copyright 2017 The Kubernetes Authors.
+Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,18 +14,24 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package path
+package v1beta1
-import "strings"
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+)
-// Vendorless removes the longest match of "*/vendor/" from the front of p.
-// It is useful if a package locates in vendor/, e.g.,
-// k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1, because gengo
-// indexes the package with its import path, e.g.,
-// k8s.io/apimachinery/pkg/apis/meta/v1,
-func Vendorless(p string) string {
- if pos := strings.LastIndex(p, "/vendor/"); pos != -1 {
- return p[pos+len("/vendor/"):]
+func init() {
+ localSchemeBuilder.Register(addDefaultingFuncs)
+}
+
+func addDefaultingFuncs(scheme *runtime.Scheme) error {
+ return RegisterDefaults(scheme)
+}
+
+//nolint:revive // format required by generated code for defaulting
+func SetDefaults_PendingWorkloadOptions(obj *PendingWorkloadOptions) {
+ defaultPendingWorkloadsLimit := int64(1000)
+ if obj.Limit == 0 {
+ obj.Limit = defaultPendingWorkloadsLimit
}
- return p
}
diff --git a/apis/visibility/v1beta1/doc.go b/apis/visibility/v1beta1/doc.go
new file mode 100644
index 00000000000..587f160223d
--- /dev/null
+++ b/apis/visibility/v1beta1/doc.go
@@ -0,0 +1,23 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +kubebuilder:object:generate=true
+// +kubebuilder:skip
+// +groupName=visibility.kueue.x-k8s.io
+// +k8s:openapi-gen=true
+// +k8s:conversion-gen=false
+
+package v1beta1
diff --git a/apis/visibility/v1beta1/groupversion_info.go b/apis/visibility/v1beta1/groupversion_info.go
new file mode 100644
index 00000000000..1ca97c4c099
--- /dev/null
+++ b/apis/visibility/v1beta1/groupversion_info.go
@@ -0,0 +1,53 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package v1beta1 contains API Schema definitions for the pending workloads kueue v1beta1 API group
+// +kubebuilder:object:generate=true
+// +kubebuilder:skip
+// +groupName=visibility.kueue.x-k8s.io
+// +k8s:openapi-gen=true
+// +k8s:conversion-gen=false
+
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects.
+ GroupVersion = schema.GroupVersion{Group: "visibility.kueue.x-k8s.io", Version: "v1beta1"}
+
+ // SchemeGroupVersion is alias to GroupVersion for client-go libraries.
+ // It is required by pkg/client/informers/externalversions/...
+ SchemeGroupVersion = GroupVersion
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // localSchemeBuilder is used to register autogenerated conversion and defaults functions
+ // It is required by ./zz_generated.conversion.go and ./zz_generated.defaults.go
+ localSchemeBuilder = &SchemeBuilder.SchemeBuilder
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+// Resource is required by pkg/client/listers/...
+func Resource(resource string) schema.GroupResource {
+ return GroupVersion.WithResource(resource).GroupResource()
+}
diff --git a/apis/visibility/v1beta1/types.go b/apis/visibility/v1beta1/types.go
new file mode 100644
index 00000000000..7e6c7e59270
--- /dev/null
+++ b/apis/visibility/v1beta1/types.go
@@ -0,0 +1,113 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +genclient
+// +kubebuilder:object:root=true
+// +k8s:openapi-gen=true
+// +genclient:nonNamespaced
+// +genclient:method=GetPendingWorkloadsSummary,verb=get,subresource=pendingworkloads,result=sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadsSummary
+type ClusterQueue struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Summary PendingWorkloadsSummary `json:"pendingWorkloadsSummary"`
+}
+
+// +kubebuilder:object:root=true
+type ClusterQueueList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+
+ Items []ClusterQueue `json:"items"`
+}
+
+// +genclient
+// +kubebuilder:object:root=true
+// +k8s:openapi-gen=true
+// +genclient:method=GetPendingWorkloadsSummary,verb=get,subresource=pendingworkloads,result=sigs.k8s.io/kueue/apis/visibility/v1beta1.PendingWorkloadsSummary
+type LocalQueue struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Summary PendingWorkloadsSummary `json:"pendingWorkloadsSummary"`
+}
+
+// +kubebuilder:object:root=true
+type LocalQueueList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+
+ Items []LocalQueue `json:"items"`
+}
+
+// PendingWorkload is a user-facing representation of a pending workload that summarizes the relevant information for
+// position in the cluster queue.
+type PendingWorkload struct {
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ // Priority indicates the workload's priority
+ Priority int32 `json:"priority"`
+
+ // LocalQueueName indicates the name of the LocalQueue the workload is submitted to
+ LocalQueueName string `json:"localQueueName"`
+
+ // PositionInClusterQueue indicates the workload's position in the ClusterQueue, starting from 0
+ PositionInClusterQueue int32 `json:"positionInClusterQueue"`
+
+ // PositionInLocalQueue indicates the workload's position in the LocalQueue, starting from 0
+ PositionInLocalQueue int32 `json:"positionInLocalQueue"`
+}
+
+// +k8s:openapi-gen=true
+// +kubebuilder:object:root=true
+
+// PendingWorkloadsSummary contains a list of pending workloads in the context
+// of the query (within LocalQueue or ClusterQueue).
+type PendingWorkloadsSummary struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Items []PendingWorkload `json:"items"`
+}
+
+// +kubebuilder:object:root=true
+// +k8s:openapi-gen=true
+// +k8s:conversion-gen:explicit-from=net/url.Values
+// +k8s:defaulter-gen=true
+
+// PendingWorkloadOptions are query params used in the visibility queries
+type PendingWorkloadOptions struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // Offset indicates position of the first pending workload that should be fetched, starting from 0. 0 by default
+ Offset int64 `json:"offset"`
+
+ // Limit indicates max number of pending workloads that should be fetched. 1000 by default
+ Limit int64 `json:"limit,omitempty"`
+}
+
+func init() {
+ SchemeBuilder.Register(
+ &PendingWorkloadsSummary{},
+ &PendingWorkloadOptions{},
+ )
+}
diff --git a/apis/visibility/v1beta1/zz_generated.conversion.go b/apis/visibility/v1beta1/zz_generated.conversion.go
new file mode 100644
index 00000000000..396ba67ec10
--- /dev/null
+++ b/apis/visibility/v1beta1/zz_generated.conversion.go
@@ -0,0 +1,68 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by conversion-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ url "net/url"
+
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+func init() {
+ localSchemeBuilder.Register(RegisterConversions)
+}
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(s *runtime.Scheme) error {
+ if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*PendingWorkloadOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_url_Values_To_v1beta1_PendingWorkloadOptions(a.(*url.Values), b.(*PendingWorkloadOptions), scope)
+ }); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvert_url_Values_To_v1beta1_PendingWorkloadOptions(in *url.Values, out *PendingWorkloadOptions, s conversion.Scope) error {
+ // WARNING: Field TypeMeta does not have json tag, skipping.
+
+ if values, ok := map[string][]string(*in)["offset"]; ok && len(values) > 0 {
+ if err := runtime.Convert_Slice_string_To_int64(&values, &out.Offset, s); err != nil {
+ return err
+ }
+ } else {
+ out.Offset = 0
+ }
+ if values, ok := map[string][]string(*in)["limit"]; ok && len(values) > 0 {
+ if err := runtime.Convert_Slice_string_To_int64(&values, &out.Limit, s); err != nil {
+ return err
+ }
+ } else {
+ out.Limit = 0
+ }
+ return nil
+}
+
+// Convert_url_Values_To_v1beta1_PendingWorkloadOptions is an autogenerated conversion function.
+func Convert_url_Values_To_v1beta1_PendingWorkloadOptions(in *url.Values, out *PendingWorkloadOptions, s conversion.Scope) error {
+ return autoConvert_url_Values_To_v1beta1_PendingWorkloadOptions(in, out, s)
+}
diff --git a/apis/visibility/v1beta1/zz_generated.deepcopy.go b/apis/visibility/v1beta1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..ae6d235718a
--- /dev/null
+++ b/apis/visibility/v1beta1/zz_generated.deepcopy.go
@@ -0,0 +1,213 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterQueue) DeepCopyInto(out *ClusterQueue) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Summary.DeepCopyInto(&out.Summary)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterQueue.
+func (in *ClusterQueue) DeepCopy() *ClusterQueue {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterQueue)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ClusterQueue) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterQueueList) DeepCopyInto(out *ClusterQueueList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]ClusterQueue, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterQueueList.
+func (in *ClusterQueueList) DeepCopy() *ClusterQueueList {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterQueueList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ClusterQueueList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LocalQueue) DeepCopyInto(out *LocalQueue) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Summary.DeepCopyInto(&out.Summary)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalQueue.
+func (in *LocalQueue) DeepCopy() *LocalQueue {
+ if in == nil {
+ return nil
+ }
+ out := new(LocalQueue)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LocalQueue) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LocalQueueList) DeepCopyInto(out *LocalQueueList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]LocalQueue, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalQueueList.
+func (in *LocalQueueList) DeepCopy() *LocalQueueList {
+ if in == nil {
+ return nil
+ }
+ out := new(LocalQueueList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LocalQueueList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PendingWorkload) DeepCopyInto(out *PendingWorkload) {
+ *out = *in
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingWorkload.
+func (in *PendingWorkload) DeepCopy() *PendingWorkload {
+ if in == nil {
+ return nil
+ }
+ out := new(PendingWorkload)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PendingWorkloadOptions) DeepCopyInto(out *PendingWorkloadOptions) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingWorkloadOptions.
+func (in *PendingWorkloadOptions) DeepCopy() *PendingWorkloadOptions {
+ if in == nil {
+ return nil
+ }
+ out := new(PendingWorkloadOptions)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *PendingWorkloadOptions) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PendingWorkloadsSummary) DeepCopyInto(out *PendingWorkloadsSummary) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]PendingWorkload, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingWorkloadsSummary.
+func (in *PendingWorkloadsSummary) DeepCopy() *PendingWorkloadsSummary {
+ if in == nil {
+ return nil
+ }
+ out := new(PendingWorkloadsSummary)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *PendingWorkloadsSummary) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.defaults.go b/apis/visibility/v1beta1/zz_generated.defaults.go
similarity index 69%
rename from vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.defaults.go
rename to apis/visibility/v1beta1/zz_generated.defaults.go
index 82fec011102..4c02fbaaff9 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.defaults.go
+++ b/apis/visibility/v1beta1/zz_generated.defaults.go
@@ -16,10 +16,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
-
// Code generated by defaulter-gen. DO NOT EDIT.
-package v1
+package v1beta1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
@@ -29,18 +28,10 @@ import (
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
- scheme.AddTypeDefaultingFunc(&EncryptionConfiguration{}, func(obj interface{}) { SetObjectDefaults_EncryptionConfiguration(obj.(*EncryptionConfiguration)) })
+ scheme.AddTypeDefaultingFunc(&PendingWorkloadOptions{}, func(obj interface{}) { SetObjectDefaults_PendingWorkloadOptions(obj.(*PendingWorkloadOptions)) })
return nil
}
-func SetObjectDefaults_EncryptionConfiguration(in *EncryptionConfiguration) {
- for i := range in.Resources {
- a := &in.Resources[i]
- for j := range a.Providers {
- b := &a.Providers[j]
- if b.KMS != nil {
- SetDefaults_KMSConfiguration(b.KMS)
- }
- }
- }
+func SetObjectDefaults_PendingWorkloadOptions(in *PendingWorkloadOptions) {
+ SetDefaults_PendingWorkloadOptions(in)
}
diff --git a/charts/kueue/Chart.yaml b/charts/kueue/Chart.yaml
index 61047ebf783..f18fd8fd1e4 100644
--- a/charts/kueue/Chart.yaml
+++ b/charts/kueue/Chart.yaml
@@ -18,4 +18,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
-appVersion: "v0.8.0"
+appVersion: "v0.8.1"
diff --git a/charts/kueue/README.md b/charts/kueue/README.md
index 1c5645c8a7f..7e4bdb29b58 100644
--- a/charts/kueue/README.md
+++ b/charts/kueue/README.md
@@ -48,8 +48,10 @@ The following table lists the configurable parameters of the kueue chart and the
| `fullnameOverride` | override the resource name | `` |
| `enablePrometheus` | enable Prometheus | `false` |
| `enableCertManager` | enable CertManager | `false` |
+| `enableVisibilityAPF` | enable APF for the visibility API | `false` |
| `controllerManager.kubeRbacProxy.image` | controllerManager.kubeRbacProxy's image | `gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0` |
-| `controllerManager.manager.image` | controllerManager.manager's image | `us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue:main` |
+| `controllerManager.manager.image` | controllerManager.manager's image | `us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue` |
+| `controllerManager.manager.tag` | controllerManager.manager's tag | `main` |
| `controllerManager.manager.resources` | controllerManager.manager's resources | abbr. |
| `controllerManager.replicas` | ControllerManager's replicaCount | `1` |
| `controllerManager.imagePullSecrets` | ControllerManager's imagePullSecrets | `[]` |
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_admissionchecks.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_admissionchecks.yaml
index 2663dfc25ad..df13cd85f19 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_admissionchecks.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_admissionchecks.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: admissionchecks.kueue.x-k8s.io
spec:
conversion:
@@ -90,10 +90,10 @@ spec:
retryDelayMinutes:
default: 15
description: |-
- RetryDelayMinutes **deprecated** specifies how long to keep the workload suspended after
+ RetryDelayMinutes specifies how long to keep the workload suspended after
a failed check (after it transitioned to False). When the delay period has passed, the check
state goes to "Unknown". The default is 15 min.
- The default is 15 min.
+ Deprecated: retryDelayMinutes has already been deprecated since v0.8 and will be removed in v1beta2.
format: int64
type: integer
required:
@@ -107,16 +107,8 @@ spec:
conditions hold the latest available observations of the AdmissionCheck
current state.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -157,12 +149,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_clusterqueues.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_clusterqueues.yaml
index 81be518e273..d633eb8ca71 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_clusterqueues.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_clusterqueues.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: clusterqueues.kueue.x-k8s.io
spec:
conversion:
@@ -117,7 +117,6 @@ spec:
cohort that this ClusterQueue belongs to. CQs that belong to the
same cohort can borrow unused resources from each other.
-
A CQ can be a member of a single borrowing cohort. A workload submitted
to a queue referencing this CQ can borrow quota from any CQ in the cohort.
Only quota for the [resource, flavor] pairs listed in the CQ can be
@@ -125,11 +124,9 @@ spec:
If empty, this ClusterQueue cannot borrow from any other ClusterQueue and
vice versa.
-
A cohort is a name that links CQs together, but it doesn't reference any
object.
-
Validation of a cohort name is equivalent to that of object names:
subdomain in DNS (RFC 1123).
maxLength: 253
@@ -169,7 +166,6 @@ spec:
whenCanBorrow determines whether a workload should try the next flavor
before borrowing in current flavor. The possible values are:
-
- `Borrow` (default): allocate in current flavor if borrowing
is possible.
- `TryNextFlavor`: try next flavor even if the current
@@ -184,7 +180,6 @@ spec:
whenCanPreempt determines whether a workload should try the next flavor
before borrowing in current flavor. The possible values are:
-
- `Preempt`: allocate in current flavor if it's possible to preempt some workloads.
- `TryNextFlavor` (default): try next flavor even if there are enough
candidates for preemption in the current flavor.
@@ -250,10 +245,8 @@ spec:
preemption describes policies to preempt Workloads from this ClusterQueue
or the ClusterQueue's cohort.
-
Preemption can happen in two scenarios:
-
- When a Workload fits within the nominal quota of the ClusterQueue, but
the quota is currently borrowed by other ClusterQueues in the cohort.
Preempting Workloads in other ClusterQueues allows this ClusterQueue to
@@ -261,7 +254,6 @@ spec:
- When a Workload doesn't fit within the nominal quota of the ClusterQueue
and there are admitted Workloads in the ClusterQueue with lower priority.
-
The preemption algorithm tries to find a minimal set of Workloads to
preempt to accomomdate the pending Workload, preempting Workloads with
lower priority first.
@@ -303,7 +295,6 @@ spec:
Workloads from other ClusterQueues in the cohort that are using more than
their nominal quota. The possible values are:
-
- `Never` (default): do not preempt Workloads in the cohort.
- `LowerPriority`: if the pending Workload fits within the nominal
quota of its ClusterQueue, only preempt Workloads in the cohort that have
@@ -323,7 +314,6 @@ spec:
within the nominal quota for its ClusterQueue, can preempt active Workloads in
the ClusterQueue. The possible values are:
-
- `Never` (default): do not preempt Workloads in the ClusterQueue.
- `LowerPriority`: only preempt Workloads in the ClusterQueue that have
lower priority than the pending Workload.
@@ -347,7 +337,6 @@ spec:
across the queues in this ClusterQueue.
Current Supported Strategies:
-
- StrictFIFO: workloads are ordered strictly by creation time.
Older workloads that can't be admitted will block admitting newer
workloads even if they fit available quota.
@@ -454,7 +443,6 @@ spec:
should account for resources that can be provided by a component such as
Kubernetes cluster-autoscaler.
-
If the ClusterQueue belongs to a cohort, the sum of the quotas for each
(flavor, resource) combination defines the maximum quantity that can be
allocated by a ClusterQueue in the cohort.
@@ -497,10 +485,8 @@ spec:
stopPolicy - if set to a value different from None, the ClusterQueue is considered Inactive, no new reservation being
made.
-
Depending on its value, its associated workloads will:
-
- None - Workloads are admitted
- HoldAndDrain - Admitted workloads are evicted and Reserving workloads will cancel the reservation.
- Hold - Admitted workloads will run to completion and Reserving workloads will cancel the reservation.
@@ -528,16 +514,8 @@ spec:
conditions hold the latest available observations of the ClusterQueue
current state.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -578,12 +556,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -733,6 +706,9 @@ spec:
description: |-
PendingWorkloadsStatus contains the information exposed about the current
status of the pending workloads in the cluster queue.
+ Deprecated: This field will be removed on v1beta2, use VisibilityOnDemand
+ (https://kueue.sigs.k8s.io/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/)
+ instead.
properties:
clusterQueuePendingWorkload:
description: Head contains the list of top pending workloads.
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_cohorts.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_cohorts.yaml
index 20353ad6686..1f2b2cde062 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_cohorts.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_cohorts.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: cohorts.kueue.x-k8s.io
spec:
conversion:
@@ -32,7 +32,10 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
- description: Cohort is the Schema for the cohorts API
+ description: |-
+ Cohort is the Schema for the cohorts API. Using Hierarchical
+ Cohorts (any Cohort which has a parent) with Fair Sharing
+ results in undefined behavior in 0.9
properties:
apiVersion:
description: |-
@@ -62,7 +65,6 @@ spec:
2) References a non-existent Cohort. We use default Cohort (no borrowing/lending limits).
3) References an existent Cohort.
-
If a cycle is created, we disable all members of the
Cohort, including ClusterQueues, until the cycle is
removed. We prevent further admission while the cycle
@@ -79,15 +81,12 @@ spec:
of one ResourceGroup. There may be up to 16 ResourceGroups
within a Cohort.
-
BorrowingLimit limits how much members of this Cohort
subtree can borrow from the parent subtree.
-
LendingLimit limits how much members of this Cohort subtree
can lend to the parent subtree.
-
Borrowing and Lending limits must only be set when the
Cohort has a parent. Otherwise, the Cohort create/update
will be rejected by the webhook.
@@ -180,7 +179,6 @@ spec:
should account for resources that can be provided by a component such as
Kubernetes cluster-autoscaler.
-
If the ClusterQueue belongs to a cohort, the sum of the quotas for each
(flavor, resource) combination defines the maximum quantity that can be
allocated by a ClusterQueue in the cohort.
@@ -223,16 +221,8 @@ spec:
properties:
conditions:
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -273,12 +263,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_localqueues.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_localqueues.yaml
index ce39a3f9aed..97ec6851e9e 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_localqueues.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_localqueues.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: localqueues.kueue.x-k8s.io
spec:
conversion:
@@ -86,10 +86,8 @@ spec:
stopPolicy - if set to a value different from None, the LocalQueue is considered Inactive,
no new reservation being made.
-
Depending on its value, its associated workloads will:
-
- None - Workloads are admitted
- HoldAndDrain - Admitted workloads are evicted and Reserving workloads will cancel the reservation.
- Hold - Admitted workloads will run to completion and Reserving workloads will cancel the reservation.
@@ -113,16 +111,8 @@ spec:
Conditions hold the latest available observations of the LocalQueue
current state.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -163,12 +153,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueclusters.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueclusters.yaml
index 72466573ad3..60ea3721a44 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueclusters.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueclusters.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: multikueueclusters.kueue.x-k8s.io
spec:
conversion:
@@ -29,7 +29,7 @@ spec:
singular: multikueuecluster
scope: Cluster
versions:
- - name: v1alpha1
+ - name: v1beta1
schema:
openAPIV3Schema:
description: MultiKueueCluster is the Schema for the multikueue API
@@ -60,7 +60,6 @@ spec:
description: |-
Location of the KubeConfig.
-
If LocationType is Secret then Location is the name of the secret inside the namespace in
which the kueue controller manager is running. The config should be stored in the "kubeconfig" key.
type: string
@@ -82,16 +81,8 @@ spec:
properties:
conditions:
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -132,12 +123,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueconfigs.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueconfigs.yaml
index bb8bef3e48d..adc7dd02af7 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueconfigs.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_multikueueconfigs.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: multikueueconfigs.kueue.x-k8s.io
spec:
conversion:
@@ -29,7 +29,7 @@ spec:
singular: multikueueconfig
scope: Cluster
versions:
- - name: v1alpha1
+ - name: v1beta1
schema:
openAPIV3Schema:
description: MultiKueueConfig is the Schema for the multikueue API
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_provisioningrequestconfigs.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_provisioningrequestconfigs.yaml
index 4b2c22d34dc..369dbcb8a86 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_provisioningrequestconfigs.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_provisioningrequestconfigs.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: provisioningrequestconfigs.kueue.x-k8s.io
spec:
conversion:
@@ -60,14 +60,11 @@ spec:
description: |-
managedResources contains the list of resources managed by the autoscaling.
-
If empty, all resources are considered managed.
-
If not empty, the ProvisioningRequest will contain only the podsets that are
requesting at least one of them.
-
If none of the workloads podsets is requesting at least a managed resource,
the workload is considered ready.
items:
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml
index 075e8f3cfca..185c677a120 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: resourceflavors.kueue.x-k8s.io
spec:
conversion:
@@ -71,7 +71,6 @@ spec:
nodeLabels should be injected into the pods of the Workload by the
controller that integrates with the Workload object.
-
nodeLabels can be up to 8 elements.
maxProperties: 8
type: object
@@ -83,11 +82,9 @@ spec:
Workloads' podsets must have tolerations for these nodeTaints in order to
get assigned this ResourceFlavor during admission.
-
An example of a nodeTaint is
cloud.provider.com/preemptible="true":NoSchedule
-
nodeTaints can be up to 8 elements.
items:
description: |-
@@ -129,11 +126,9 @@ spec:
tolerations are extra tolerations that will be added to the pods admitted in
the quota associated with this resource flavor.
-
An example of a toleration is
cloud.provider.com/preemptible="true":NoSchedule
-
tolerations can be up to 8 elements.
items:
description: |-
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_workloadpriorityclasses.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_workloadpriorityclasses.yaml
index 7e17b420f11..017f3c265cb 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_workloadpriorityclasses.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_workloadpriorityclasses.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: workloadpriorityclasses.kueue.x-k8s.io
spec:
conversion:
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml
index fcb07466c89..6f38665ff6e 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml
@@ -8,7 +8,7 @@ metadata:
{{- if .Values.enableCertManager }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
{{- end }}
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: workloads.kueue.x-k8s.io
spec:
conversion:
@@ -84,11 +84,9 @@ spec:
Changing active from true to false will evict any running workloads.
Possible values are:
-
- false: indicates that a workload should never be admitted and evicts running workloads
- true: indicates that a workload can be evaluated for admission into it's respective queue.
-
Defaults to true
type: boolean
podSets:
@@ -110,14 +108,11 @@ spec:
minCount is the minimum number of pods for the spec acceptable
if the workload supports partial admission.
-
If not provided, partial admission for the current PodSet is not
enabled.
-
Only one podSet within the workload can use this.
-
This is an alpha field and requires enabling PartialAdmission feature gate.
format: int32
minimum: 1
@@ -132,15 +127,12 @@ spec:
description: |-
template is the Pod template.
-
The only allowed fields in template.metadata are labels and annotations.
-
If requests are omitted for a container or initContainer,
they default to the limits if they are explicitly specified for the
container or initContainer.
-
During admission, the rules in nodeSelector and
nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution that match
the keys in the nodeLabels from the ResourceFlavors considered for this
@@ -471,7 +463,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -486,7 +478,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -656,7 +648,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -671,7 +663,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -840,7 +832,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -855,7 +847,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1025,7 +1017,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1040,7 +1032,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1208,9 +1200,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -1281,9 +1271,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -1323,9 +1311,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -1348,9 +1334,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -1654,11 +1638,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -1871,11 +1855,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2025,11 +2009,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -2041,6 +2023,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -2164,7 +2152,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -2246,7 +2234,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -2330,11 +2317,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2552,10 +2539,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -2563,11 +2548,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -2676,7 +2659,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -2750,9 +2732,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2823,9 +2803,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2865,9 +2843,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -2890,9 +2866,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -3190,11 +3164,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3397,11 +3371,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3550,11 +3524,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -3566,6 +3538,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -3677,7 +3655,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -3759,7 +3737,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -3837,11 +3814,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3980,7 +3957,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -4069,10 +4045,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -4080,11 +4054,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -4196,9 +4168,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -4295,9 +4265,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -4368,9 +4336,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -4410,9 +4376,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -4435,9 +4399,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -4741,11 +4703,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4958,11 +4920,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5112,11 +5074,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -5128,6 +5088,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -5251,7 +5217,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -5333,7 +5299,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -5417,11 +5382,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5639,10 +5604,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -5650,11 +5613,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -5693,9 +5654,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -5711,11 +5674,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -5730,6 +5691,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -5817,15 +5779,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -5834,33 +5797,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to find the
- ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -5894,7 +5856,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated to a
@@ -5946,12 +5907,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -6038,7 +5997,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -6048,18 +6006,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -6267,7 +6235,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -6307,7 +6274,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -6325,7 +6291,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -6337,7 +6302,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -6406,7 +6370,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -6447,6 +6410,7 @@ spec:
in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -6460,6 +6424,7 @@ spec:
availability set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -6531,9 +6496,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6575,9 +6538,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6650,9 +6611,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether the
@@ -6691,9 +6650,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6837,7 +6794,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -6848,17 +6804,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -6872,7 +6825,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -6882,11 +6834,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -7108,7 +7058,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -7135,7 +7085,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target lun
@@ -7204,9 +7153,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7241,7 +7188,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -7322,9 +7268,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -7341,6 +7284,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -7361,7 +7339,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -7374,6 +7351,7 @@ spec:
Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -7407,9 +7385,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7529,25 +7505,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of volume
- projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be projected
- along with other supported volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -7684,9 +7659,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether
@@ -7835,9 +7808,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field specify
@@ -7929,7 +7900,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -7937,6 +7907,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -7951,6 +7922,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -7976,13 +7948,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -7997,6 +7968,7 @@ spec:
volume attached and mounted on Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -8029,9 +8001,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8041,6 +8011,7 @@ spec:
false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -8155,9 +8126,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8327,7 +8296,6 @@ spec:
description: |-
resourceUsage keeps track of the total resources all the pods in the podset need to run.
-
Beside what is provided in podSet's specs, this calculation takes into account
the LimitRange defaults and RuntimeClass overheads at the moment of admission.
This field will not change in case of quota reclaim.
@@ -8479,25 +8447,15 @@ spec:
conditions hold the latest available observations of the Workload
current state.
-
The type of the condition could be:
-
- Admitted: the Workload was admitted through a ClusterQueue.
- Finished: the associated workload finished running (failed or succeeded).
- PodsReady: at least `.spec.podSets[*].count` Pods are ready or have
succeeded.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -8538,12 +8496,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/charts/kueue/templates/rbac/role.yaml b/charts/kueue/templates/rbac/role.yaml
index 5ad1221638a..e5ba9104c9c 100644
--- a/charts/kueue/templates/rbac/role.yaml
+++ b/charts/kueue/templates/rbac/role.yaml
@@ -18,13 +18,6 @@ rules:
- ""
resources:
- limitranges
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - ""
- resources:
- namespaces
verbs:
- get
@@ -79,6 +72,7 @@ rules:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
+ - validatingwebhookconfigurations
verbs:
- get
- list
@@ -87,11 +81,11 @@ rules:
- apiGroups:
- admissionregistration.k8s.io
resources:
- - validatingwebhookconfigurations
+ - validatingadmissionpolicies
+ - validatingadmissionpolicybindings
verbs:
- get
- list
- - update
- watch
- apiGroups:
- autoscaling.x-k8s.io
@@ -125,13 +119,6 @@ rules:
- batch
resources:
- jobs/finalizers
- verbs:
- - get
- - patch
- - update
- - apiGroups:
- - batch
- resources:
- jobs/status
verbs:
- get
@@ -141,6 +128,7 @@ rules:
- flowcontrol.apiserver.k8s.io
resources:
- flowschemas
+ - prioritylevelconfigurations
verbs:
- list
- watch
@@ -150,13 +138,6 @@ rules:
- flowschemas/status
verbs:
- patch
- - apiGroups:
- - flowcontrol.apiserver.k8s.io
- resources:
- - prioritylevelconfigurations
- verbs:
- - list
- - watch
- apiGroups:
- jobset.x-k8s.io
resources:
@@ -186,30 +167,11 @@ rules:
- kubeflow.org
resources:
- mpijobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - kubeflow.org
- resources:
- - mpijobs/finalizers
- verbs:
- - get
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - mpijobs/status
- verbs:
- - get
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- mxjobs
+ - paddlejobs
+ - pytorchjobs
+ - tfjobs
+ - xgboostjobs
verbs:
- get
- list
@@ -219,105 +181,12 @@ rules:
- apiGroups:
- kubeflow.org
resources:
+ - mpijobs/finalizers
- mxjobs/finalizers
- verbs:
- - get
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- mxjobs/status
- verbs:
- - get
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - paddlejobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - kubeflow.org
- resources:
- paddlejobs/finalizers
- verbs:
- - get
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - paddlejobs/status
- verbs:
- - get
- - patch
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - pytorchjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - kubeflow.org
- resources:
- pytorchjobs/finalizers
- verbs:
- - get
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - pytorchjobs/status
- verbs:
- - get
- - patch
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - tfjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - kubeflow.org
- resources:
- tfjobs/finalizers
- verbs:
- - get
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - tfjobs/status
- verbs:
- - get
- - patch
- - update
- - apiGroups:
- - kubeflow.org
- resources:
- - xgboostjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - kubeflow.org
- resources:
- xgboostjobs/finalizers
verbs:
- get
@@ -325,6 +194,10 @@ rules:
- apiGroups:
- kubeflow.org
resources:
+ - mpijobs/status
+ - paddlejobs/status
+ - pytorchjobs/status
+ - tfjobs/status
- xgboostjobs/status
verbs:
- get
@@ -334,58 +207,10 @@ rules:
- kueue.x-k8s.io
resources:
- admissionchecks
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - admissionchecks/finalizers
- verbs:
- - update
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - admissionchecks/status
- verbs:
- - get
- - patch
- - update
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- clusterqueues
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - clusterqueues/finalizers
- verbs:
- - update
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - clusterqueues/status
- verbs:
- - get
- - patch
- - update
- - apiGroups:
- - kueue.x-k8s.io
- resources:
+ - cohorts
- localqueues
+ - workloads
verbs:
- create
- delete
@@ -397,29 +222,21 @@ rules:
- apiGroups:
- kueue.x-k8s.io
resources:
+ - admissionchecks/finalizers
+ - clusterqueues/finalizers
- localqueues/finalizers
+ - resourceflavors/finalizers
+ - workloads/finalizers
verbs:
- update
- apiGroups:
- kueue.x-k8s.io
resources:
+ - admissionchecks/status
+ - clusterqueues/status
- localqueues/status
- verbs:
- - get
- - patch
- - update
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - multikueueclusters
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- multikueueclusters/status
+ - workloads/status
verbs:
- get
- patch
@@ -427,38 +244,9 @@ rules:
- apiGroups:
- kueue.x-k8s.io
resources:
+ - multikueueclusters
- multikueueconfigs
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- provisioningrequestconfigs
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - resourceflavors
- verbs:
- - delete
- - get
- - list
- - update
- - watch
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - resourceflavors/finalizers
- verbs:
- - update
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- workloadpriorityclasses
verbs:
- get
@@ -467,29 +255,13 @@ rules:
- apiGroups:
- kueue.x-k8s.io
resources:
- - workloads
+ - resourceflavors
verbs:
- - create
- delete
- get
- list
- - patch
- update
- watch
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - workloads/finalizers
- verbs:
- - update
- - apiGroups:
- - kueue.x-k8s.io
- resources:
- - workloads/status
- verbs:
- - get
- - patch
- - update
- apiGroups:
- node.k8s.io
resources:
@@ -502,6 +274,7 @@ rules:
- ray.io
resources:
- rayclusters
+ - rayjobs
verbs:
- get
- list
@@ -512,36 +285,8 @@ rules:
- ray.io
resources:
- rayclusters/finalizers
- verbs:
- - get
- - update
- - apiGroups:
- - ray.io
- resources:
- rayclusters/status
- verbs:
- - get
- - update
- - apiGroups:
- - ray.io
- resources:
- - rayjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
- - apiGroups:
- - ray.io
- resources:
- rayjobs/finalizers
- verbs:
- - get
- - update
- - apiGroups:
- - ray.io
- resources:
- rayjobs/status
verbs:
- get
diff --git a/charts/kueue/templates/visibility-apf/flowschema.yaml b/charts/kueue/templates/visibility-apf/flowschema.yaml
new file mode 100644
index 00000000000..7b5e90e28ed
--- /dev/null
+++ b/charts/kueue/templates/visibility-apf/flowschema.yaml
@@ -0,0 +1,33 @@
+{{- if .Values.enableVisibilityAPF }}
+apiVersion: flowcontrol.apiserver.k8s.io/{{ and (eq .Capabilities.KubeVersion.Major "1") (eq .Capabilities.KubeVersion.Minor "28") | ternary "v1beta3" "v1" }}
+kind: FlowSchema
+metadata:
+ labels:
+ {{- include "kueue.labels" . | nindent 4 }}
+ name: '{{ include "kueue.fullname" . }}-visibility'
+ namespace: '{{ .Release.Namespace }}'
+spec:
+ distinguisherMethod:
+ type: ByUser
+ matchingPrecedence: 9000
+ priorityLevelConfiguration:
+ name: kueue-visibility
+ rules:
+ - resourceRules:
+ - apiGroups:
+ - 'visibility.kueue.x-k8s.io'
+ clusterScope: true
+ namespaces:
+ - '*'
+ resources:
+ - '*'
+ verbs:
+ - '*'
+ subjects:
+ - group:
+ name: system:unauthenticated
+ kind: Group
+ - group:
+ name: system:authenticated
+ kind: Group
+{{- end }}
diff --git a/charts/kueue/templates/visibility-apf/prioritylevelconfigurations.yaml b/charts/kueue/templates/visibility-apf/prioritylevelconfigurations.yaml
new file mode 100644
index 00000000000..b855863c615
--- /dev/null
+++ b/charts/kueue/templates/visibility-apf/prioritylevelconfigurations.yaml
@@ -0,0 +1,20 @@
+{{- if .Values.enableVisibilityAPF }}
+apiVersion: flowcontrol.apiserver.k8s.io/{{ and (eq .Capabilities.KubeVersion.Major "1") (eq .Capabilities.KubeVersion.Minor "28") | ternary "v1beta3" "v1" }}
+kind: PriorityLevelConfiguration
+metadata:
+ labels:
+ {{- include "kueue.labels" . | nindent 4 }}
+ name: '{{ include "kueue.fullname" . }}-visibility'
+ namespace: '{{ .Release.Namespace }}'
+spec:
+ limited:
+ lendablePercent: 90
+ limitResponse:
+ queuing:
+ handSize: 4
+ queueLengthLimit: 50
+ queues: 16
+ type: Queue
+ nominalConcurrencyShares: 10
+ type: Limited
+{{- end }}
diff --git a/charts/kueue/templates/visibility/apiservice.yaml b/charts/kueue/templates/visibility/apiservice_v1alpha1.yaml
similarity index 74%
rename from charts/kueue/templates/visibility/apiservice.yaml
rename to charts/kueue/templates/visibility/apiservice_v1alpha1.yaml
index 4c7ea0e0edc..02a317ad5a9 100644
--- a/charts/kueue/templates/visibility/apiservice.yaml
+++ b/charts/kueue/templates/visibility/apiservice_v1alpha1.yaml
@@ -1,4 +1,3 @@
-{{- if include "kueue.isFeatureGateEnabled" (dict "List" .Values.controllerManager.featureGates "Feature" "VisibilityOnDemand") }}
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
@@ -14,4 +13,3 @@ spec:
namespace: '{{ .Release.Namespace }}'
version: v1alpha1
versionPriority: 100
-{{- end }}
diff --git a/charts/kueue/templates/visibility/apiservice_v1beta1.yaml b/charts/kueue/templates/visibility/apiservice_v1beta1.yaml
new file mode 100644
index 00000000000..38ed65d3321
--- /dev/null
+++ b/charts/kueue/templates/visibility/apiservice_v1beta1.yaml
@@ -0,0 +1,15 @@
+apiVersion: apiregistration.k8s.io/v1
+kind: APIService
+metadata:
+ labels:
+ {{- include "kueue.labels" . | nindent 4 }}
+ name: v1beta1.visibility.kueue.x-k8s.io
+spec:
+ group: visibility.kueue.x-k8s.io
+ groupPriorityMinimum: 100
+ insecureSkipTLSVerify: true
+ service:
+ name: '{{ include "kueue.fullname" . }}-visibility-server'
+ namespace: '{{ .Release.Namespace }}'
+ version: v1beta1
+ versionPriority: 100
diff --git a/charts/kueue/templates/visibility/role_binding.yaml b/charts/kueue/templates/visibility/role_binding.yaml
index 602d05fc965..7ae2aca6e4b 100644
--- a/charts/kueue/templates/visibility/role_binding.yaml
+++ b/charts/kueue/templates/visibility/role_binding.yaml
@@ -1,4 +1,3 @@
-{{- if include "kueue.isFeatureGateEnabled" (dict "List" .Values.controllerManager.featureGates "Feature" "VisibilityOnDemand") }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
@@ -14,4 +13,3 @@ subjects:
- kind: ServiceAccount
name: kueue-controller-manager
namespace: '{{ .Release.Namespace }}'
-{{- end }}
diff --git a/charts/kueue/templates/visibility/service.yaml b/charts/kueue/templates/visibility/service.yaml
index 751190cf7e8..fa3e0e24474 100644
--- a/charts/kueue/templates/visibility/service.yaml
+++ b/charts/kueue/templates/visibility/service.yaml
@@ -1,4 +1,3 @@
-{{- if include "kueue.isFeatureGateEnabled" (dict "List" .Values.controllerManager.featureGates "Feature" "VisibilityOnDemand") }}
apiVersion: v1
kind: Service
metadata:
@@ -14,4 +13,3 @@ spec:
targetPort: 8082
selector:
{{- include "kueue.selectorLabels" . | nindent 4 }}
-{{- end }}
diff --git a/charts/kueue/templates/webhook/webhook.yaml b/charts/kueue/templates/webhook/webhook.yaml
index dcae76f14eb..6ebb76aa61c 100644
--- a/charts/kueue/templates/webhook/webhook.yaml
+++ b/charts/kueue/templates/webhook/webhook.yaml
@@ -11,6 +11,36 @@ metadata:
{{- end }}
namespace: '{{ .Release.Namespace }}'
webhooks:
+ - admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: '{{ include "kueue.fullname" . }}-webhook-service'
+ namespace: '{{ .Release.Namespace }}'
+ path: /mutate-apps-v1-deployment
+ {{- if has "deployment" $integrationsConfig.frameworks }}
+ failurePolicy: Fail
+ {{- else }}
+ failurePolicy: Ignore
+ {{- end }}
+ name: mdeployment.kb.io
+ namespaceSelector:
+ matchExpressions:
+ - key: kubernetes.io/metadata.name
+ operator: NotIn
+ values:
+ - kube-system
+ - '{{ .Release.Namespace }}'
+ rules:
+ - apiGroups:
+ - apps
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ resources:
+ - deployments
+ sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
@@ -235,25 +265,6 @@ webhooks:
resources:
- rayjobs
sideEffects: None
- - admissionReviewVersions:
- - v1
- clientConfig:
- service:
- name: '{{ include "kueue.fullname" . }}-webhook-service'
- namespace: '{{ .Release.Namespace }}'
- path: /mutate-apps-v1-deployment
- failurePolicy: Fail
- name: mdeployment.kb.io
- rules:
- - apiGroups:
- - apps
- apiVersions:
- - v1
- operations:
- - CREATE
- resources:
- - deployments
- sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
@@ -324,6 +335,37 @@ metadata:
{{- end }}
namespace: '{{ .Release.Namespace }}'
webhooks:
+ - admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: '{{ include "kueue.fullname" . }}-webhook-service'
+ namespace: '{{ .Release.Namespace }}'
+ path: /validate-apps-v1-deployment
+ {{- if has "deployment" $integrationsConfig.frameworks }}
+ failurePolicy: Fail
+ {{- else }}
+ failurePolicy: Ignore
+ {{- end }}
+ name: vdeployment.kb.io
+ namespaceSelector:
+ matchExpressions:
+ - key: kubernetes.io/metadata.name
+ operator: NotIn
+ values:
+ - kube-system
+ - '{{ .Release.Namespace }}'
+ rules:
+ - apiGroups:
+ - apps
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - deployments
+ sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
@@ -565,19 +607,19 @@ webhooks:
service:
name: '{{ include "kueue.fullname" . }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
- path: /validate-apps-v1-deployment
+ path: /validate-kueue-x-k8s-io-v1beta1-clusterqueue
failurePolicy: Fail
- name: vdeployment.kb.io
+ name: vclusterqueue.kb.io
rules:
- apiGroups:
- - apps
+ - kueue.x-k8s.io
apiVersions:
- - v1
+ - v1beta1
operations:
- CREATE
- UPDATE
resources:
- - deployments
+ - clusterqueues
sideEffects: None
- admissionReviewVersions:
- v1
@@ -585,19 +627,19 @@ webhooks:
service:
name: '{{ include "kueue.fullname" . }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
- path: /validate-kueue-x-k8s-io-v1beta1-clusterqueue
+ path: /validate-kueue-x-k8s-io-v1alpha1-cohort
failurePolicy: Fail
- name: vclusterqueue.kb.io
+ name: vcohort.kb.io
rules:
- apiGroups:
- kueue.x-k8s.io
apiVersions:
- - v1beta1
+ - v1alpha1
operations:
- CREATE
- UPDATE
resources:
- - clusterqueues
+ - cohorts
sideEffects: None
- admissionReviewVersions:
- v1
diff --git a/charts/kueue/values.yaml b/charts/kueue/values.yaml
index 0fa2ef3f9e3..7be554d4aa1 100644
--- a/charts/kueue/values.yaml
+++ b/charts/kueue/values.yaml
@@ -7,6 +7,8 @@ fullnameOverride: ""
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
+# Enable API Priority and Fairness configuration for the visibility API
+enableVisibilityAPF: false
# Customize controllerManager
controllerManager:
#featureGates:
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admission.go b/client-go/applyconfiguration/kueue/v1beta1/admission.go
index cba5f90f758..5207421d3a1 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admission.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admission.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// AdmissionApplyConfiguration represents an declarative configuration of the Admission type for use
+// AdmissionApplyConfiguration represents a declarative configuration of the Admission type for use
// with apply.
type AdmissionApplyConfiguration struct {
ClusterQueue *v1beta1.ClusterQueueReference `json:"clusterQueue,omitempty"`
PodSetAssignments []PodSetAssignmentApplyConfiguration `json:"podSetAssignments,omitempty"`
}
-// AdmissionApplyConfiguration constructs an declarative configuration of the Admission type for use with
+// AdmissionApplyConfiguration constructs a declarative configuration of the Admission type for use with
// apply.
func Admission() *AdmissionApplyConfiguration {
return &AdmissionApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admissioncheck.go b/client-go/applyconfiguration/kueue/v1beta1/admissioncheck.go
index 7410598b7e0..87c5ea07e6b 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admissioncheck.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admissioncheck.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// AdmissionCheckApplyConfiguration represents an declarative configuration of the AdmissionCheck type for use
+// AdmissionCheckApplyConfiguration represents a declarative configuration of the AdmissionCheck type for use
// with apply.
type AdmissionCheckApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -32,7 +32,7 @@ type AdmissionCheckApplyConfiguration struct {
Status *AdmissionCheckStatusApplyConfiguration `json:"status,omitempty"`
}
-// AdmissionCheck constructs an declarative configuration of the AdmissionCheck type for use with
+// AdmissionCheck constructs a declarative configuration of the AdmissionCheck type for use with
// apply.
func AdmissionCheck(name string) *AdmissionCheckApplyConfiguration {
b := &AdmissionCheckApplyConfiguration{}
@@ -215,3 +215,9 @@ func (b *AdmissionCheckApplyConfiguration) WithStatus(value *AdmissionCheckStatu
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *AdmissionCheckApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckparametersreference.go b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckparametersreference.go
index 2c9a67c165a..eb6dba04108 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckparametersreference.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckparametersreference.go
@@ -17,7 +17,7 @@ limitations under the License.
package v1beta1
-// AdmissionCheckParametersReferenceApplyConfiguration represents an declarative configuration of the AdmissionCheckParametersReference type for use
+// AdmissionCheckParametersReferenceApplyConfiguration represents a declarative configuration of the AdmissionCheckParametersReference type for use
// with apply.
type AdmissionCheckParametersReferenceApplyConfiguration struct {
APIGroup *string `json:"apiGroup,omitempty"`
@@ -25,7 +25,7 @@ type AdmissionCheckParametersReferenceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
}
-// AdmissionCheckParametersReferenceApplyConfiguration constructs an declarative configuration of the AdmissionCheckParametersReference type for use with
+// AdmissionCheckParametersReferenceApplyConfiguration constructs a declarative configuration of the AdmissionCheckParametersReference type for use with
// apply.
func AdmissionCheckParametersReference() *AdmissionCheckParametersReferenceApplyConfiguration {
return &AdmissionCheckParametersReferenceApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckspec.go b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckspec.go
index e6c487001fb..c45f8761800 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckspec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckspec.go
@@ -17,7 +17,7 @@ limitations under the License.
package v1beta1
-// AdmissionCheckSpecApplyConfiguration represents an declarative configuration of the AdmissionCheckSpec type for use
+// AdmissionCheckSpecApplyConfiguration represents a declarative configuration of the AdmissionCheckSpec type for use
// with apply.
type AdmissionCheckSpecApplyConfiguration struct {
ControllerName *string `json:"controllerName,omitempty"`
@@ -25,7 +25,7 @@ type AdmissionCheckSpecApplyConfiguration struct {
Parameters *AdmissionCheckParametersReferenceApplyConfiguration `json:"parameters,omitempty"`
}
-// AdmissionCheckSpecApplyConfiguration constructs an declarative configuration of the AdmissionCheckSpec type for use with
+// AdmissionCheckSpecApplyConfiguration constructs a declarative configuration of the AdmissionCheckSpec type for use with
// apply.
func AdmissionCheckSpec() *AdmissionCheckSpecApplyConfiguration {
return &AdmissionCheckSpecApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admissionchecksstrategy.go b/client-go/applyconfiguration/kueue/v1beta1/admissionchecksstrategy.go
index fb0c4ce292c..7a484792f5f 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admissionchecksstrategy.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admissionchecksstrategy.go
@@ -17,13 +17,13 @@ limitations under the License.
package v1beta1
-// AdmissionChecksStrategyApplyConfiguration represents an declarative configuration of the AdmissionChecksStrategy type for use
+// AdmissionChecksStrategyApplyConfiguration represents a declarative configuration of the AdmissionChecksStrategy type for use
// with apply.
type AdmissionChecksStrategyApplyConfiguration struct {
AdmissionChecks []AdmissionCheckStrategyRuleApplyConfiguration `json:"admissionChecks,omitempty"`
}
-// AdmissionChecksStrategyApplyConfiguration constructs an declarative configuration of the AdmissionChecksStrategy type for use with
+// AdmissionChecksStrategyApplyConfiguration constructs a declarative configuration of the AdmissionChecksStrategy type for use with
// apply.
func AdmissionChecksStrategy() *AdmissionChecksStrategyApplyConfiguration {
return &AdmissionChecksStrategyApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstate.go b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstate.go
index a065ed09528..a6efbf45d6f 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstate.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstate.go
@@ -22,7 +22,7 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// AdmissionCheckStateApplyConfiguration represents an declarative configuration of the AdmissionCheckState type for use
+// AdmissionCheckStateApplyConfiguration represents a declarative configuration of the AdmissionCheckState type for use
// with apply.
type AdmissionCheckStateApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -32,7 +32,7 @@ type AdmissionCheckStateApplyConfiguration struct {
PodSetUpdates []PodSetUpdateApplyConfiguration `json:"podSetUpdates,omitempty"`
}
-// AdmissionCheckStateApplyConfiguration constructs an declarative configuration of the AdmissionCheckState type for use with
+// AdmissionCheckStateApplyConfiguration constructs a declarative configuration of the AdmissionCheckState type for use with
// apply.
func AdmissionCheckState() *AdmissionCheckStateApplyConfiguration {
return &AdmissionCheckStateApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstatus.go b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstatus.go
index 1341cffbce0..85a319d110c 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstatus.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstatus.go
@@ -18,16 +18,16 @@ limitations under the License.
package v1beta1
import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// AdmissionCheckStatusApplyConfiguration represents an declarative configuration of the AdmissionCheckStatus type for use
+// AdmissionCheckStatusApplyConfiguration represents a declarative configuration of the AdmissionCheckStatus type for use
// with apply.
type AdmissionCheckStatusApplyConfiguration struct {
- Conditions []v1.Condition `json:"conditions,omitempty"`
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// AdmissionCheckStatusApplyConfiguration constructs an declarative configuration of the AdmissionCheckStatus type for use with
+// AdmissionCheckStatusApplyConfiguration constructs a declarative configuration of the AdmissionCheckStatus type for use with
// apply.
func AdmissionCheckStatus() *AdmissionCheckStatusApplyConfiguration {
return &AdmissionCheckStatusApplyConfiguration{}
@@ -36,9 +36,12 @@ func AdmissionCheckStatus() *AdmissionCheckStatusApplyConfiguration {
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
-func (b *AdmissionCheckStatusApplyConfiguration) WithConditions(values ...v1.Condition) *AdmissionCheckStatusApplyConfiguration {
+func (b *AdmissionCheckStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *AdmissionCheckStatusApplyConfiguration {
for i := range values {
- b.Conditions = append(b.Conditions, values[i])
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
}
return b
}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstrategyrule.go b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstrategyrule.go
index 84a8e6655b3..3c747fd556d 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstrategyrule.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/admissioncheckstrategyrule.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// AdmissionCheckStrategyRuleApplyConfiguration represents an declarative configuration of the AdmissionCheckStrategyRule type for use
+// AdmissionCheckStrategyRuleApplyConfiguration represents a declarative configuration of the AdmissionCheckStrategyRule type for use
// with apply.
type AdmissionCheckStrategyRuleApplyConfiguration struct {
Name *string `json:"name,omitempty"`
OnFlavors []v1beta1.ResourceFlavorReference `json:"onFlavors,omitempty"`
}
-// AdmissionCheckStrategyRuleApplyConfiguration constructs an declarative configuration of the AdmissionCheckStrategyRule type for use with
+// AdmissionCheckStrategyRuleApplyConfiguration constructs a declarative configuration of the AdmissionCheckStrategyRule type for use with
// apply.
func AdmissionCheckStrategyRule() *AdmissionCheckStrategyRuleApplyConfiguration {
return &AdmissionCheckStrategyRuleApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/borrowwithincohort.go b/client-go/applyconfiguration/kueue/v1beta1/borrowwithincohort.go
index 85d6fcd11a8..49f4be6423c 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/borrowwithincohort.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/borrowwithincohort.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// BorrowWithinCohortApplyConfiguration represents an declarative configuration of the BorrowWithinCohort type for use
+// BorrowWithinCohortApplyConfiguration represents a declarative configuration of the BorrowWithinCohort type for use
// with apply.
type BorrowWithinCohortApplyConfiguration struct {
Policy *v1beta1.BorrowWithinCohortPolicy `json:"policy,omitempty"`
MaxPriorityThreshold *int32 `json:"maxPriorityThreshold,omitempty"`
}
-// BorrowWithinCohortApplyConfiguration constructs an declarative configuration of the BorrowWithinCohort type for use with
+// BorrowWithinCohortApplyConfiguration constructs a declarative configuration of the BorrowWithinCohort type for use with
// apply.
func BorrowWithinCohort() *BorrowWithinCohortApplyConfiguration {
return &BorrowWithinCohortApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/clusterqueue.go b/client-go/applyconfiguration/kueue/v1beta1/clusterqueue.go
index 2c3fe3e1440..fe5cd79cdcf 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/clusterqueue.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/clusterqueue.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ClusterQueueApplyConfiguration represents an declarative configuration of the ClusterQueue type for use
+// ClusterQueueApplyConfiguration represents a declarative configuration of the ClusterQueue type for use
// with apply.
type ClusterQueueApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -32,7 +32,7 @@ type ClusterQueueApplyConfiguration struct {
Status *ClusterQueueStatusApplyConfiguration `json:"status,omitempty"`
}
-// ClusterQueue constructs an declarative configuration of the ClusterQueue type for use with
+// ClusterQueue constructs a declarative configuration of the ClusterQueue type for use with
// apply.
func ClusterQueue(name string) *ClusterQueueApplyConfiguration {
b := &ClusterQueueApplyConfiguration{}
@@ -215,3 +215,9 @@ func (b *ClusterQueueApplyConfiguration) WithStatus(value *ClusterQueueStatusApp
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ClusterQueueApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkload.go b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkload.go
index ee2de5bbdfd..500fd38a4a5 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkload.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkload.go
@@ -17,14 +17,14 @@ limitations under the License.
package v1beta1
-// ClusterQueuePendingWorkloadApplyConfiguration represents an declarative configuration of the ClusterQueuePendingWorkload type for use
+// ClusterQueuePendingWorkloadApplyConfiguration represents a declarative configuration of the ClusterQueuePendingWorkload type for use
// with apply.
type ClusterQueuePendingWorkloadApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Namespace *string `json:"namespace,omitempty"`
}
-// ClusterQueuePendingWorkloadApplyConfiguration constructs an declarative configuration of the ClusterQueuePendingWorkload type for use with
+// ClusterQueuePendingWorkloadApplyConfiguration constructs a declarative configuration of the ClusterQueuePendingWorkload type for use with
// apply.
func ClusterQueuePendingWorkload() *ClusterQueuePendingWorkloadApplyConfiguration {
return &ClusterQueuePendingWorkloadApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkloadsstatus.go b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkloadsstatus.go
index 11da82f7282..c217e77ef49 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkloadsstatus.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuependingworkloadsstatus.go
@@ -21,14 +21,14 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// ClusterQueuePendingWorkloadsStatusApplyConfiguration represents an declarative configuration of the ClusterQueuePendingWorkloadsStatus type for use
+// ClusterQueuePendingWorkloadsStatusApplyConfiguration represents a declarative configuration of the ClusterQueuePendingWorkloadsStatus type for use
// with apply.
type ClusterQueuePendingWorkloadsStatusApplyConfiguration struct {
Head []ClusterQueuePendingWorkloadApplyConfiguration `json:"clusterQueuePendingWorkload,omitempty"`
LastChangeTime *v1.Time `json:"lastChangeTime,omitempty"`
}
-// ClusterQueuePendingWorkloadsStatusApplyConfiguration constructs an declarative configuration of the ClusterQueuePendingWorkloadsStatus type for use with
+// ClusterQueuePendingWorkloadsStatusApplyConfiguration constructs a declarative configuration of the ClusterQueuePendingWorkloadsStatus type for use with
// apply.
func ClusterQueuePendingWorkloadsStatus() *ClusterQueuePendingWorkloadsStatusApplyConfiguration {
return &ClusterQueuePendingWorkloadsStatusApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuepreemption.go b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuepreemption.go
index 7513e90ddc7..15e4f566fbf 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuepreemption.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuepreemption.go
@@ -21,7 +21,7 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// ClusterQueuePreemptionApplyConfiguration represents an declarative configuration of the ClusterQueuePreemption type for use
+// ClusterQueuePreemptionApplyConfiguration represents a declarative configuration of the ClusterQueuePreemption type for use
// with apply.
type ClusterQueuePreemptionApplyConfiguration struct {
ReclaimWithinCohort *v1beta1.PreemptionPolicy `json:"reclaimWithinCohort,omitempty"`
@@ -29,7 +29,7 @@ type ClusterQueuePreemptionApplyConfiguration struct {
WithinClusterQueue *v1beta1.PreemptionPolicy `json:"withinClusterQueue,omitempty"`
}
-// ClusterQueuePreemptionApplyConfiguration constructs an declarative configuration of the ClusterQueuePreemption type for use with
+// ClusterQueuePreemptionApplyConfiguration constructs a declarative configuration of the ClusterQueuePreemption type for use with
// apply.
func ClusterQueuePreemption() *ClusterQueuePreemptionApplyConfiguration {
return &ClusterQueuePreemptionApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuespec.go b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuespec.go
index 1794cea5d09..0c55acf5cef 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuespec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuespec.go
@@ -18,17 +18,17 @@ limitations under the License.
package v1beta1
import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// ClusterQueueSpecApplyConfiguration represents an declarative configuration of the ClusterQueueSpec type for use
+// ClusterQueueSpecApplyConfiguration represents a declarative configuration of the ClusterQueueSpec type for use
// with apply.
type ClusterQueueSpecApplyConfiguration struct {
ResourceGroups []ResourceGroupApplyConfiguration `json:"resourceGroups,omitempty"`
Cohort *string `json:"cohort,omitempty"`
QueueingStrategy *kueuev1beta1.QueueingStrategy `json:"queueingStrategy,omitempty"`
- NamespaceSelector *v1.LabelSelector `json:"namespaceSelector,omitempty"`
+ NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
FlavorFungibility *FlavorFungibilityApplyConfiguration `json:"flavorFungibility,omitempty"`
Preemption *ClusterQueuePreemptionApplyConfiguration `json:"preemption,omitempty"`
AdmissionChecks []string `json:"admissionChecks,omitempty"`
@@ -37,7 +37,7 @@ type ClusterQueueSpecApplyConfiguration struct {
FairSharing *FairSharingApplyConfiguration `json:"fairSharing,omitempty"`
}
-// ClusterQueueSpecApplyConfiguration constructs an declarative configuration of the ClusterQueueSpec type for use with
+// ClusterQueueSpecApplyConfiguration constructs a declarative configuration of the ClusterQueueSpec type for use with
// apply.
func ClusterQueueSpec() *ClusterQueueSpecApplyConfiguration {
return &ClusterQueueSpecApplyConfiguration{}
@@ -75,8 +75,8 @@ func (b *ClusterQueueSpecApplyConfiguration) WithQueueingStrategy(value kueuev1b
// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NamespaceSelector field is set to the value of the last call.
-func (b *ClusterQueueSpecApplyConfiguration) WithNamespaceSelector(value v1.LabelSelector) *ClusterQueueSpecApplyConfiguration {
- b.NamespaceSelector = &value
+func (b *ClusterQueueSpecApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *ClusterQueueSpecApplyConfiguration {
+ b.NamespaceSelector = value
return b
}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuestatus.go b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuestatus.go
index 042aedb3587..5d3d37b7d21 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/clusterqueuestatus.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/clusterqueuestatus.go
@@ -18,10 +18,10 @@ limitations under the License.
package v1beta1
import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ClusterQueueStatusApplyConfiguration represents an declarative configuration of the ClusterQueueStatus type for use
+// ClusterQueueStatusApplyConfiguration represents a declarative configuration of the ClusterQueueStatus type for use
// with apply.
type ClusterQueueStatusApplyConfiguration struct {
FlavorsReservation []FlavorUsageApplyConfiguration `json:"flavorsReservation,omitempty"`
@@ -29,12 +29,12 @@ type ClusterQueueStatusApplyConfiguration struct {
PendingWorkloads *int32 `json:"pendingWorkloads,omitempty"`
ReservingWorkloads *int32 `json:"reservingWorkloads,omitempty"`
AdmittedWorkloads *int32 `json:"admittedWorkloads,omitempty"`
- Conditions []v1.Condition `json:"conditions,omitempty"`
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
PendingWorkloadsStatus *ClusterQueuePendingWorkloadsStatusApplyConfiguration `json:"pendingWorkloadsStatus,omitempty"`
FairSharing *FairSharingStatusApplyConfiguration `json:"fairSharing,omitempty"`
}
-// ClusterQueueStatusApplyConfiguration constructs an declarative configuration of the ClusterQueueStatus type for use with
+// ClusterQueueStatusApplyConfiguration constructs a declarative configuration of the ClusterQueueStatus type for use with
// apply.
func ClusterQueueStatus() *ClusterQueueStatusApplyConfiguration {
return &ClusterQueueStatusApplyConfiguration{}
@@ -93,9 +93,12 @@ func (b *ClusterQueueStatusApplyConfiguration) WithAdmittedWorkloads(value int32
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
-func (b *ClusterQueueStatusApplyConfiguration) WithConditions(values ...v1.Condition) *ClusterQueueStatusApplyConfiguration {
+func (b *ClusterQueueStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ClusterQueueStatusApplyConfiguration {
for i := range values {
- b.Conditions = append(b.Conditions, values[i])
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
}
return b
}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/fairsharing.go b/client-go/applyconfiguration/kueue/v1beta1/fairsharing.go
index e5bba5b4ac0..5448a8f31b9 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/fairsharing.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/fairsharing.go
@@ -21,13 +21,13 @@ import (
resource "k8s.io/apimachinery/pkg/api/resource"
)
-// FairSharingApplyConfiguration represents an declarative configuration of the FairSharing type for use
+// FairSharingApplyConfiguration represents a declarative configuration of the FairSharing type for use
// with apply.
type FairSharingApplyConfiguration struct {
Weight *resource.Quantity `json:"weight,omitempty"`
}
-// FairSharingApplyConfiguration constructs an declarative configuration of the FairSharing type for use with
+// FairSharingApplyConfiguration constructs a declarative configuration of the FairSharing type for use with
// apply.
func FairSharing() *FairSharingApplyConfiguration {
return &FairSharingApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/fairsharingstatus.go b/client-go/applyconfiguration/kueue/v1beta1/fairsharingstatus.go
index 43853ea9689..da3a5b0004f 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/fairsharingstatus.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/fairsharingstatus.go
@@ -17,13 +17,13 @@ limitations under the License.
package v1beta1
-// FairSharingStatusApplyConfiguration represents an declarative configuration of the FairSharingStatus type for use
+// FairSharingStatusApplyConfiguration represents a declarative configuration of the FairSharingStatus type for use
// with apply.
type FairSharingStatusApplyConfiguration struct {
WeightedShare *int64 `json:"weightedShare,omitempty"`
}
-// FairSharingStatusApplyConfiguration constructs an declarative configuration of the FairSharingStatus type for use with
+// FairSharingStatusApplyConfiguration constructs a declarative configuration of the FairSharingStatus type for use with
// apply.
func FairSharingStatus() *FairSharingStatusApplyConfiguration {
return &FairSharingStatusApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/flavorfungibility.go b/client-go/applyconfiguration/kueue/v1beta1/flavorfungibility.go
index 2fae55c58b2..be9eabf2d8e 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/flavorfungibility.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/flavorfungibility.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// FlavorFungibilityApplyConfiguration represents an declarative configuration of the FlavorFungibility type for use
+// FlavorFungibilityApplyConfiguration represents a declarative configuration of the FlavorFungibility type for use
// with apply.
type FlavorFungibilityApplyConfiguration struct {
WhenCanBorrow *v1beta1.FlavorFungibilityPolicy `json:"whenCanBorrow,omitempty"`
WhenCanPreempt *v1beta1.FlavorFungibilityPolicy `json:"whenCanPreempt,omitempty"`
}
-// FlavorFungibilityApplyConfiguration constructs an declarative configuration of the FlavorFungibility type for use with
+// FlavorFungibilityApplyConfiguration constructs a declarative configuration of the FlavorFungibility type for use with
// apply.
func FlavorFungibility() *FlavorFungibilityApplyConfiguration {
return &FlavorFungibilityApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/flavorquotas.go b/client-go/applyconfiguration/kueue/v1beta1/flavorquotas.go
index db48b169254..89fc99ab55a 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/flavorquotas.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/flavorquotas.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// FlavorQuotasApplyConfiguration represents an declarative configuration of the FlavorQuotas type for use
+// FlavorQuotasApplyConfiguration represents a declarative configuration of the FlavorQuotas type for use
// with apply.
type FlavorQuotasApplyConfiguration struct {
Name *v1beta1.ResourceFlavorReference `json:"name,omitempty"`
Resources []ResourceQuotaApplyConfiguration `json:"resources,omitempty"`
}
-// FlavorQuotasApplyConfiguration constructs an declarative configuration of the FlavorQuotas type for use with
+// FlavorQuotasApplyConfiguration constructs a declarative configuration of the FlavorQuotas type for use with
// apply.
func FlavorQuotas() *FlavorQuotasApplyConfiguration {
return &FlavorQuotasApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/flavorusage.go b/client-go/applyconfiguration/kueue/v1beta1/flavorusage.go
index ea4651084c4..b89944bd85e 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/flavorusage.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/flavorusage.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// FlavorUsageApplyConfiguration represents an declarative configuration of the FlavorUsage type for use
+// FlavorUsageApplyConfiguration represents a declarative configuration of the FlavorUsage type for use
// with apply.
type FlavorUsageApplyConfiguration struct {
Name *v1beta1.ResourceFlavorReference `json:"name,omitempty"`
Resources []ResourceUsageApplyConfiguration `json:"resources,omitempty"`
}
-// FlavorUsageApplyConfiguration constructs an declarative configuration of the FlavorUsage type for use with
+// FlavorUsageApplyConfiguration constructs a declarative configuration of the FlavorUsage type for use with
// apply.
func FlavorUsage() *FlavorUsageApplyConfiguration {
return &FlavorUsageApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/kubeconfig.go b/client-go/applyconfiguration/kueue/v1beta1/kubeconfig.go
similarity index 77%
rename from client-go/applyconfiguration/kueue/v1alpha1/kubeconfig.go
rename to client-go/applyconfiguration/kueue/v1beta1/kubeconfig.go
index 7a0422c8366..129f221a33d 100644
--- a/client-go/applyconfiguration/kueue/v1alpha1/kubeconfig.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/kubeconfig.go
@@ -15,20 +15,20 @@ limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// KubeConfigApplyConfiguration represents an declarative configuration of the KubeConfig type for use
+// KubeConfigApplyConfiguration represents a declarative configuration of the KubeConfig type for use
// with apply.
type KubeConfigApplyConfiguration struct {
- Location *string `json:"location,omitempty"`
- LocationType *v1alpha1.LocationType `json:"locationType,omitempty"`
+ Location *string `json:"location,omitempty"`
+ LocationType *v1beta1.LocationType `json:"locationType,omitempty"`
}
-// KubeConfigApplyConfiguration constructs an declarative configuration of the KubeConfig type for use with
+// KubeConfigApplyConfiguration constructs a declarative configuration of the KubeConfig type for use with
// apply.
func KubeConfig() *KubeConfigApplyConfiguration {
return &KubeConfigApplyConfiguration{}
@@ -45,7 +45,7 @@ func (b *KubeConfigApplyConfiguration) WithLocation(value string) *KubeConfigApp
// WithLocationType sets the LocationType field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LocationType field is set to the value of the last call.
-func (b *KubeConfigApplyConfiguration) WithLocationType(value v1alpha1.LocationType) *KubeConfigApplyConfiguration {
+func (b *KubeConfigApplyConfiguration) WithLocationType(value v1beta1.LocationType) *KubeConfigApplyConfiguration {
b.LocationType = &value
return b
}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/localqueue.go b/client-go/applyconfiguration/kueue/v1beta1/localqueue.go
index c6d1cb72460..33f8c222b4c 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/localqueue.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/localqueue.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// LocalQueueApplyConfiguration represents an declarative configuration of the LocalQueue type for use
+// LocalQueueApplyConfiguration represents a declarative configuration of the LocalQueue type for use
// with apply.
type LocalQueueApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -32,7 +32,7 @@ type LocalQueueApplyConfiguration struct {
Status *LocalQueueStatusApplyConfiguration `json:"status,omitempty"`
}
-// LocalQueue constructs an declarative configuration of the LocalQueue type for use with
+// LocalQueue constructs a declarative configuration of the LocalQueue type for use with
// apply.
func LocalQueue(name, namespace string) *LocalQueueApplyConfiguration {
b := &LocalQueueApplyConfiguration{}
@@ -216,3 +216,9 @@ func (b *LocalQueueApplyConfiguration) WithStatus(value *LocalQueueStatusApplyCo
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *LocalQueueApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/localqueueflavorusage.go b/client-go/applyconfiguration/kueue/v1beta1/localqueueflavorusage.go
index 4d223f969c2..7e08ed09911 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/localqueueflavorusage.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/localqueueflavorusage.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// LocalQueueFlavorUsageApplyConfiguration represents an declarative configuration of the LocalQueueFlavorUsage type for use
+// LocalQueueFlavorUsageApplyConfiguration represents a declarative configuration of the LocalQueueFlavorUsage type for use
// with apply.
type LocalQueueFlavorUsageApplyConfiguration struct {
Name *v1beta1.ResourceFlavorReference `json:"name,omitempty"`
Resources []LocalQueueResourceUsageApplyConfiguration `json:"resources,omitempty"`
}
-// LocalQueueFlavorUsageApplyConfiguration constructs an declarative configuration of the LocalQueueFlavorUsage type for use with
+// LocalQueueFlavorUsageApplyConfiguration constructs a declarative configuration of the LocalQueueFlavorUsage type for use with
// apply.
func LocalQueueFlavorUsage() *LocalQueueFlavorUsageApplyConfiguration {
return &LocalQueueFlavorUsageApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/localqueueresourceusage.go b/client-go/applyconfiguration/kueue/v1beta1/localqueueresourceusage.go
index ddcf8a2a001..32cd91339f5 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/localqueueresourceusage.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/localqueueresourceusage.go
@@ -22,14 +22,14 @@ import (
resource "k8s.io/apimachinery/pkg/api/resource"
)
-// LocalQueueResourceUsageApplyConfiguration represents an declarative configuration of the LocalQueueResourceUsage type for use
+// LocalQueueResourceUsageApplyConfiguration represents a declarative configuration of the LocalQueueResourceUsage type for use
// with apply.
type LocalQueueResourceUsageApplyConfiguration struct {
Name *v1.ResourceName `json:"name,omitempty"`
Total *resource.Quantity `json:"total,omitempty"`
}
-// LocalQueueResourceUsageApplyConfiguration constructs an declarative configuration of the LocalQueueResourceUsage type for use with
+// LocalQueueResourceUsageApplyConfiguration constructs a declarative configuration of the LocalQueueResourceUsage type for use with
// apply.
func LocalQueueResourceUsage() *LocalQueueResourceUsageApplyConfiguration {
return &LocalQueueResourceUsageApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/localqueuespec.go b/client-go/applyconfiguration/kueue/v1beta1/localqueuespec.go
index 724b31cd3cf..f92796ff348 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/localqueuespec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/localqueuespec.go
@@ -21,14 +21,14 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// LocalQueueSpecApplyConfiguration represents an declarative configuration of the LocalQueueSpec type for use
+// LocalQueueSpecApplyConfiguration represents a declarative configuration of the LocalQueueSpec type for use
// with apply.
type LocalQueueSpecApplyConfiguration struct {
ClusterQueue *v1beta1.ClusterQueueReference `json:"clusterQueue,omitempty"`
StopPolicy *v1beta1.StopPolicy `json:"stopPolicy,omitempty"`
}
-// LocalQueueSpecApplyConfiguration constructs an declarative configuration of the LocalQueueSpec type for use with
+// LocalQueueSpecApplyConfiguration constructs a declarative configuration of the LocalQueueSpec type for use with
// apply.
func LocalQueueSpec() *LocalQueueSpecApplyConfiguration {
return &LocalQueueSpecApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/localqueuestatus.go b/client-go/applyconfiguration/kueue/v1beta1/localqueuestatus.go
index 9b77e15c4f6..38ca3bf58ac 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/localqueuestatus.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/localqueuestatus.go
@@ -18,21 +18,21 @@ limitations under the License.
package v1beta1
import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// LocalQueueStatusApplyConfiguration represents an declarative configuration of the LocalQueueStatus type for use
+// LocalQueueStatusApplyConfiguration represents a declarative configuration of the LocalQueueStatus type for use
// with apply.
type LocalQueueStatusApplyConfiguration struct {
PendingWorkloads *int32 `json:"pendingWorkloads,omitempty"`
ReservingWorkloads *int32 `json:"reservingWorkloads,omitempty"`
AdmittedWorkloads *int32 `json:"admittedWorkloads,omitempty"`
- Conditions []v1.Condition `json:"conditions,omitempty"`
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
FlavorsReservation []LocalQueueFlavorUsageApplyConfiguration `json:"flavorsReservation,omitempty"`
FlavorUsage []LocalQueueFlavorUsageApplyConfiguration `json:"flavorUsage,omitempty"`
}
-// LocalQueueStatusApplyConfiguration constructs an declarative configuration of the LocalQueueStatus type for use with
+// LocalQueueStatusApplyConfiguration constructs a declarative configuration of the LocalQueueStatus type for use with
// apply.
func LocalQueueStatus() *LocalQueueStatusApplyConfiguration {
return &LocalQueueStatusApplyConfiguration{}
@@ -65,9 +65,12 @@ func (b *LocalQueueStatusApplyConfiguration) WithAdmittedWorkloads(value int32)
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
-func (b *LocalQueueStatusApplyConfiguration) WithConditions(values ...v1.Condition) *LocalQueueStatusApplyConfiguration {
+func (b *LocalQueueStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *LocalQueueStatusApplyConfiguration {
for i := range values {
- b.Conditions = append(b.Conditions, values[i])
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
}
return b
}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/multikueuecluster.go b/client-go/applyconfiguration/kueue/v1beta1/multikueuecluster.go
similarity index 95%
rename from client-go/applyconfiguration/kueue/v1alpha1/multikueuecluster.go
rename to client-go/applyconfiguration/kueue/v1beta1/multikueuecluster.go
index cd1300384a5..ceac56ac8fc 100644
--- a/client-go/applyconfiguration/kueue/v1alpha1/multikueuecluster.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/multikueuecluster.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// MultiKueueClusterApplyConfiguration represents an declarative configuration of the MultiKueueCluster type for use
+// MultiKueueClusterApplyConfiguration represents a declarative configuration of the MultiKueueCluster type for use
// with apply.
type MultiKueueClusterApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -32,13 +32,13 @@ type MultiKueueClusterApplyConfiguration struct {
Status *MultiKueueClusterStatusApplyConfiguration `json:"status,omitempty"`
}
-// MultiKueueCluster constructs an declarative configuration of the MultiKueueCluster type for use with
+// MultiKueueCluster constructs a declarative configuration of the MultiKueueCluster type for use with
// apply.
func MultiKueueCluster(name string) *MultiKueueClusterApplyConfiguration {
b := &MultiKueueClusterApplyConfiguration{}
b.WithName(name)
b.WithKind("MultiKueueCluster")
- b.WithAPIVersion("kueue.x-k8s.io/v1alpha1")
+ b.WithAPIVersion("kueue.x-k8s.io/v1beta1")
return b
}
@@ -215,3 +215,9 @@ func (b *MultiKueueClusterApplyConfiguration) WithStatus(value *MultiKueueCluste
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *MultiKueueClusterApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/multikueueclusterspec.go b/client-go/applyconfiguration/kueue/v1beta1/multikueueclusterspec.go
similarity index 83%
rename from client-go/applyconfiguration/kueue/v1alpha1/multikueueclusterspec.go
rename to client-go/applyconfiguration/kueue/v1beta1/multikueueclusterspec.go
index e7e304f7ea0..d218f49d9dd 100644
--- a/client-go/applyconfiguration/kueue/v1alpha1/multikueueclusterspec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/multikueueclusterspec.go
@@ -15,15 +15,15 @@ limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
-// MultiKueueClusterSpecApplyConfiguration represents an declarative configuration of the MultiKueueClusterSpec type for use
+// MultiKueueClusterSpecApplyConfiguration represents a declarative configuration of the MultiKueueClusterSpec type for use
// with apply.
type MultiKueueClusterSpecApplyConfiguration struct {
KubeConfig *KubeConfigApplyConfiguration `json:"kubeConfig,omitempty"`
}
-// MultiKueueClusterSpecApplyConfiguration constructs an declarative configuration of the MultiKueueClusterSpec type for use with
+// MultiKueueClusterSpecApplyConfiguration constructs a declarative configuration of the MultiKueueClusterSpec type for use with
// apply.
func MultiKueueClusterSpec() *MultiKueueClusterSpecApplyConfiguration {
return &MultiKueueClusterSpecApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/multikueueclusterstatus.go b/client-go/applyconfiguration/kueue/v1beta1/multikueueclusterstatus.go
similarity index 66%
rename from client-go/applyconfiguration/kueue/v1alpha1/multikueueclusterstatus.go
rename to client-go/applyconfiguration/kueue/v1beta1/multikueueclusterstatus.go
index c01eaf7d06e..53b71071569 100644
--- a/client-go/applyconfiguration/kueue/v1alpha1/multikueueclusterstatus.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/multikueueclusterstatus.go
@@ -15,19 +15,19 @@ limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// MultiKueueClusterStatusApplyConfiguration represents an declarative configuration of the MultiKueueClusterStatus type for use
+// MultiKueueClusterStatusApplyConfiguration represents a declarative configuration of the MultiKueueClusterStatus type for use
// with apply.
type MultiKueueClusterStatusApplyConfiguration struct {
- Conditions []v1.Condition `json:"conditions,omitempty"`
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// MultiKueueClusterStatusApplyConfiguration constructs an declarative configuration of the MultiKueueClusterStatus type for use with
+// MultiKueueClusterStatusApplyConfiguration constructs a declarative configuration of the MultiKueueClusterStatus type for use with
// apply.
func MultiKueueClusterStatus() *MultiKueueClusterStatusApplyConfiguration {
return &MultiKueueClusterStatusApplyConfiguration{}
@@ -36,9 +36,12 @@ func MultiKueueClusterStatus() *MultiKueueClusterStatusApplyConfiguration {
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
-func (b *MultiKueueClusterStatusApplyConfiguration) WithConditions(values ...v1.Condition) *MultiKueueClusterStatusApplyConfiguration {
+func (b *MultiKueueClusterStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *MultiKueueClusterStatusApplyConfiguration {
for i := range values {
- b.Conditions = append(b.Conditions, values[i])
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
}
return b
}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/multikueueconfig.go b/client-go/applyconfiguration/kueue/v1beta1/multikueueconfig.go
similarity index 95%
rename from client-go/applyconfiguration/kueue/v1alpha1/multikueueconfig.go
rename to client-go/applyconfiguration/kueue/v1beta1/multikueueconfig.go
index 63c7f1dabbc..b939f5191d7 100644
--- a/client-go/applyconfiguration/kueue/v1alpha1/multikueueconfig.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/multikueueconfig.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// MultiKueueConfigApplyConfiguration represents an declarative configuration of the MultiKueueConfig type for use
+// MultiKueueConfigApplyConfiguration represents a declarative configuration of the MultiKueueConfig type for use
// with apply.
type MultiKueueConfigApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -31,13 +31,13 @@ type MultiKueueConfigApplyConfiguration struct {
Spec *MultiKueueConfigSpecApplyConfiguration `json:"spec,omitempty"`
}
-// MultiKueueConfig constructs an declarative configuration of the MultiKueueConfig type for use with
+// MultiKueueConfig constructs a declarative configuration of the MultiKueueConfig type for use with
// apply.
func MultiKueueConfig(name string) *MultiKueueConfigApplyConfiguration {
b := &MultiKueueConfigApplyConfiguration{}
b.WithName(name)
b.WithKind("MultiKueueConfig")
- b.WithAPIVersion("kueue.x-k8s.io/v1alpha1")
+ b.WithAPIVersion("kueue.x-k8s.io/v1beta1")
return b
}
@@ -206,3 +206,9 @@ func (b *MultiKueueConfigApplyConfiguration) WithSpec(value *MultiKueueConfigSpe
b.Spec = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *MultiKueueConfigApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/multikueueconfigspec.go b/client-go/applyconfiguration/kueue/v1beta1/multikueueconfigspec.go
similarity index 83%
rename from client-go/applyconfiguration/kueue/v1alpha1/multikueueconfigspec.go
rename to client-go/applyconfiguration/kueue/v1beta1/multikueueconfigspec.go
index 143954a1c02..406d3bbac68 100644
--- a/client-go/applyconfiguration/kueue/v1alpha1/multikueueconfigspec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/multikueueconfigspec.go
@@ -15,15 +15,15 @@ limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
-// MultiKueueConfigSpecApplyConfiguration represents an declarative configuration of the MultiKueueConfigSpec type for use
+// MultiKueueConfigSpecApplyConfiguration represents a declarative configuration of the MultiKueueConfigSpec type for use
// with apply.
type MultiKueueConfigSpecApplyConfiguration struct {
Clusters []string `json:"clusters,omitempty"`
}
-// MultiKueueConfigSpecApplyConfiguration constructs an declarative configuration of the MultiKueueConfigSpec type for use with
+// MultiKueueConfigSpecApplyConfiguration constructs a declarative configuration of the MultiKueueConfigSpec type for use with
// apply.
func MultiKueueConfigSpec() *MultiKueueConfigSpecApplyConfiguration {
return &MultiKueueConfigSpecApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/podset.go b/client-go/applyconfiguration/kueue/v1beta1/podset.go
index d05c58dc7ef..fc2d1996f4e 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/podset.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/podset.go
@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
-// PodSetApplyConfiguration represents an declarative configuration of the PodSet type for use
+// PodSetApplyConfiguration represents a declarative configuration of the PodSet type for use
// with apply.
type PodSetApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -30,7 +30,7 @@ type PodSetApplyConfiguration struct {
MinCount *int32 `json:"minCount,omitempty"`
}
-// PodSetApplyConfiguration constructs an declarative configuration of the PodSet type for use with
+// PodSetApplyConfiguration constructs a declarative configuration of the PodSet type for use with
// apply.
func PodSet() *PodSetApplyConfiguration {
return &PodSetApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go b/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go
index 4460c3b08e1..d69bdf4b74a 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go
@@ -22,7 +22,7 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// PodSetAssignmentApplyConfiguration represents an declarative configuration of the PodSetAssignment type for use
+// PodSetAssignmentApplyConfiguration represents a declarative configuration of the PodSetAssignment type for use
// with apply.
type PodSetAssignmentApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -31,7 +31,7 @@ type PodSetAssignmentApplyConfiguration struct {
Count *int32 `json:"count,omitempty"`
}
-// PodSetAssignmentApplyConfiguration constructs an declarative configuration of the PodSetAssignment type for use with
+// PodSetAssignmentApplyConfiguration constructs a declarative configuration of the PodSetAssignment type for use with
// apply.
func PodSetAssignment() *PodSetAssignmentApplyConfiguration {
return &PodSetAssignmentApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/podsetupdate.go b/client-go/applyconfiguration/kueue/v1beta1/podsetupdate.go
index ce1e255da9d..89b53d3ff58 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/podsetupdate.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/podsetupdate.go
@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
-// PodSetUpdateApplyConfiguration represents an declarative configuration of the PodSetUpdate type for use
+// PodSetUpdateApplyConfiguration represents a declarative configuration of the PodSetUpdate type for use
// with apply.
type PodSetUpdateApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -31,7 +31,7 @@ type PodSetUpdateApplyConfiguration struct {
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
}
-// PodSetUpdateApplyConfiguration constructs an declarative configuration of the PodSetUpdate type for use with
+// PodSetUpdateApplyConfiguration constructs a declarative configuration of the PodSetUpdate type for use with
// apply.
func PodSetUpdate() *PodSetUpdateApplyConfiguration {
return &PodSetUpdateApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfig.go b/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfig.go
index 18938ee327c..99ef28e9482 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfig.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfig.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ProvisioningRequestConfigApplyConfiguration represents an declarative configuration of the ProvisioningRequestConfig type for use
+// ProvisioningRequestConfigApplyConfiguration represents a declarative configuration of the ProvisioningRequestConfig type for use
// with apply.
type ProvisioningRequestConfigApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -31,7 +31,7 @@ type ProvisioningRequestConfigApplyConfiguration struct {
Spec *ProvisioningRequestConfigSpecApplyConfiguration `json:"spec,omitempty"`
}
-// ProvisioningRequestConfig constructs an declarative configuration of the ProvisioningRequestConfig type for use with
+// ProvisioningRequestConfig constructs a declarative configuration of the ProvisioningRequestConfig type for use with
// apply.
func ProvisioningRequestConfig(name string) *ProvisioningRequestConfigApplyConfiguration {
b := &ProvisioningRequestConfigApplyConfiguration{}
@@ -206,3 +206,9 @@ func (b *ProvisioningRequestConfigApplyConfiguration) WithSpec(value *Provisioni
b.Spec = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ProvisioningRequestConfigApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfigspec.go b/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfigspec.go
index 88ccf923ba9..ce20f9e9367 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfigspec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfigspec.go
@@ -22,7 +22,7 @@ import (
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
-// ProvisioningRequestConfigSpecApplyConfiguration represents an declarative configuration of the ProvisioningRequestConfigSpec type for use
+// ProvisioningRequestConfigSpecApplyConfiguration represents a declarative configuration of the ProvisioningRequestConfigSpec type for use
// with apply.
type ProvisioningRequestConfigSpecApplyConfiguration struct {
ProvisioningClassName *string `json:"provisioningClassName,omitempty"`
@@ -30,7 +30,7 @@ type ProvisioningRequestConfigSpecApplyConfiguration struct {
ManagedResources []v1.ResourceName `json:"managedResources,omitempty"`
}
-// ProvisioningRequestConfigSpecApplyConfiguration constructs an declarative configuration of the ProvisioningRequestConfigSpec type for use with
+// ProvisioningRequestConfigSpecApplyConfiguration constructs a declarative configuration of the ProvisioningRequestConfigSpec type for use with
// apply.
func ProvisioningRequestConfigSpec() *ProvisioningRequestConfigSpecApplyConfiguration {
return &ProvisioningRequestConfigSpecApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/reclaimablepod.go b/client-go/applyconfiguration/kueue/v1beta1/reclaimablepod.go
index b0a9a30cc0b..0c61c043ad5 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/reclaimablepod.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/reclaimablepod.go
@@ -17,14 +17,14 @@ limitations under the License.
package v1beta1
-// ReclaimablePodApplyConfiguration represents an declarative configuration of the ReclaimablePod type for use
+// ReclaimablePodApplyConfiguration represents a declarative configuration of the ReclaimablePod type for use
// with apply.
type ReclaimablePodApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Count *int32 `json:"count,omitempty"`
}
-// ReclaimablePodApplyConfiguration constructs an declarative configuration of the ReclaimablePod type for use with
+// ReclaimablePodApplyConfiguration constructs a declarative configuration of the ReclaimablePod type for use with
// apply.
func ReclaimablePod() *ReclaimablePodApplyConfiguration {
return &ReclaimablePodApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/requeuestate.go b/client-go/applyconfiguration/kueue/v1beta1/requeuestate.go
index 3123e5a66d6..4bc48fb4638 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/requeuestate.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/requeuestate.go
@@ -21,14 +21,14 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// RequeueStateApplyConfiguration represents an declarative configuration of the RequeueState type for use
+// RequeueStateApplyConfiguration represents a declarative configuration of the RequeueState type for use
// with apply.
type RequeueStateApplyConfiguration struct {
Count *int32 `json:"count,omitempty"`
RequeueAt *v1.Time `json:"requeueAt,omitempty"`
}
-// RequeueStateApplyConfiguration constructs an declarative configuration of the RequeueState type for use with
+// RequeueStateApplyConfiguration constructs a declarative configuration of the RequeueState type for use with
// apply.
func RequeueState() *RequeueStateApplyConfiguration {
return &RequeueStateApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/resourceflavor.go b/client-go/applyconfiguration/kueue/v1beta1/resourceflavor.go
index 5cbc31a7548..a312b4050fd 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/resourceflavor.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/resourceflavor.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ResourceFlavorApplyConfiguration represents an declarative configuration of the ResourceFlavor type for use
+// ResourceFlavorApplyConfiguration represents a declarative configuration of the ResourceFlavor type for use
// with apply.
type ResourceFlavorApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -31,7 +31,7 @@ type ResourceFlavorApplyConfiguration struct {
Spec *ResourceFlavorSpecApplyConfiguration `json:"spec,omitempty"`
}
-// ResourceFlavor constructs an declarative configuration of the ResourceFlavor type for use with
+// ResourceFlavor constructs a declarative configuration of the ResourceFlavor type for use with
// apply.
func ResourceFlavor(name string) *ResourceFlavorApplyConfiguration {
b := &ResourceFlavorApplyConfiguration{}
@@ -206,3 +206,9 @@ func (b *ResourceFlavorApplyConfiguration) WithSpec(value *ResourceFlavorSpecApp
b.Spec = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ResourceFlavorApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go b/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go
index 9c267adcb3a..2c4f8d6bc59 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go
@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
)
-// ResourceFlavorSpecApplyConfiguration represents an declarative configuration of the ResourceFlavorSpec type for use
+// ResourceFlavorSpecApplyConfiguration represents a declarative configuration of the ResourceFlavorSpec type for use
// with apply.
type ResourceFlavorSpecApplyConfiguration struct {
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
@@ -29,7 +29,7 @@ type ResourceFlavorSpecApplyConfiguration struct {
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
}
-// ResourceFlavorSpecApplyConfiguration constructs an declarative configuration of the ResourceFlavorSpec type for use with
+// ResourceFlavorSpecApplyConfiguration constructs a declarative configuration of the ResourceFlavorSpec type for use with
// apply.
func ResourceFlavorSpec() *ResourceFlavorSpecApplyConfiguration {
return &ResourceFlavorSpecApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/resourcegroup.go b/client-go/applyconfiguration/kueue/v1beta1/resourcegroup.go
index d53445d5c9d..339842f8849 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/resourcegroup.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/resourcegroup.go
@@ -21,14 +21,14 @@ import (
v1 "k8s.io/api/core/v1"
)
-// ResourceGroupApplyConfiguration represents an declarative configuration of the ResourceGroup type for use
+// ResourceGroupApplyConfiguration represents a declarative configuration of the ResourceGroup type for use
// with apply.
type ResourceGroupApplyConfiguration struct {
CoveredResources []v1.ResourceName `json:"coveredResources,omitempty"`
Flavors []FlavorQuotasApplyConfiguration `json:"flavors,omitempty"`
}
-// ResourceGroupApplyConfiguration constructs an declarative configuration of the ResourceGroup type for use with
+// ResourceGroupApplyConfiguration constructs a declarative configuration of the ResourceGroup type for use with
// apply.
func ResourceGroup() *ResourceGroupApplyConfiguration {
return &ResourceGroupApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/resourcequota.go b/client-go/applyconfiguration/kueue/v1beta1/resourcequota.go
index 3b68cefba67..8759a2846e0 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/resourcequota.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/resourcequota.go
@@ -22,7 +22,7 @@ import (
resource "k8s.io/apimachinery/pkg/api/resource"
)
-// ResourceQuotaApplyConfiguration represents an declarative configuration of the ResourceQuota type for use
+// ResourceQuotaApplyConfiguration represents a declarative configuration of the ResourceQuota type for use
// with apply.
type ResourceQuotaApplyConfiguration struct {
Name *v1.ResourceName `json:"name,omitempty"`
@@ -31,7 +31,7 @@ type ResourceQuotaApplyConfiguration struct {
LendingLimit *resource.Quantity `json:"lendingLimit,omitempty"`
}
-// ResourceQuotaApplyConfiguration constructs an declarative configuration of the ResourceQuota type for use with
+// ResourceQuotaApplyConfiguration constructs a declarative configuration of the ResourceQuota type for use with
// apply.
func ResourceQuota() *ResourceQuotaApplyConfiguration {
return &ResourceQuotaApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/resourceusage.go b/client-go/applyconfiguration/kueue/v1beta1/resourceusage.go
index c32a406f269..3c847a2b0f3 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/resourceusage.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/resourceusage.go
@@ -22,7 +22,7 @@ import (
resource "k8s.io/apimachinery/pkg/api/resource"
)
-// ResourceUsageApplyConfiguration represents an declarative configuration of the ResourceUsage type for use
+// ResourceUsageApplyConfiguration represents a declarative configuration of the ResourceUsage type for use
// with apply.
type ResourceUsageApplyConfiguration struct {
Name *v1.ResourceName `json:"name,omitempty"`
@@ -30,7 +30,7 @@ type ResourceUsageApplyConfiguration struct {
Borrowed *resource.Quantity `json:"borrowed,omitempty"`
}
-// ResourceUsageApplyConfiguration constructs an declarative configuration of the ResourceUsage type for use with
+// ResourceUsageApplyConfiguration constructs a declarative configuration of the ResourceUsage type for use with
// apply.
func ResourceUsage() *ResourceUsageApplyConfiguration {
return &ResourceUsageApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/workload.go b/client-go/applyconfiguration/kueue/v1beta1/workload.go
index 1304ab682b9..4cc41d5112e 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/workload.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/workload.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// WorkloadApplyConfiguration represents an declarative configuration of the Workload type for use
+// WorkloadApplyConfiguration represents a declarative configuration of the Workload type for use
// with apply.
type WorkloadApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -32,7 +32,7 @@ type WorkloadApplyConfiguration struct {
Status *WorkloadStatusApplyConfiguration `json:"status,omitempty"`
}
-// Workload constructs an declarative configuration of the Workload type for use with
+// Workload constructs a declarative configuration of the Workload type for use with
// apply.
func Workload(name, namespace string) *WorkloadApplyConfiguration {
b := &WorkloadApplyConfiguration{}
@@ -216,3 +216,9 @@ func (b *WorkloadApplyConfiguration) WithStatus(value *WorkloadStatusApplyConfig
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *WorkloadApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/workloadpriorityclass.go b/client-go/applyconfiguration/kueue/v1beta1/workloadpriorityclass.go
index 322aae8e97a..53390cadf59 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/workloadpriorityclass.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/workloadpriorityclass.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// WorkloadPriorityClassApplyConfiguration represents an declarative configuration of the WorkloadPriorityClass type for use
+// WorkloadPriorityClassApplyConfiguration represents a declarative configuration of the WorkloadPriorityClass type for use
// with apply.
type WorkloadPriorityClassApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -32,7 +32,7 @@ type WorkloadPriorityClassApplyConfiguration struct {
Description *string `json:"description,omitempty"`
}
-// WorkloadPriorityClass constructs an declarative configuration of the WorkloadPriorityClass type for use with
+// WorkloadPriorityClass constructs a declarative configuration of the WorkloadPriorityClass type for use with
// apply.
func WorkloadPriorityClass(name string) *WorkloadPriorityClassApplyConfiguration {
b := &WorkloadPriorityClassApplyConfiguration{}
@@ -215,3 +215,9 @@ func (b *WorkloadPriorityClassApplyConfiguration) WithDescription(value string)
b.Description = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *WorkloadPriorityClassApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/workloadspec.go b/client-go/applyconfiguration/kueue/v1beta1/workloadspec.go
index bc20f5edd89..11280bed75a 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/workloadspec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/workloadspec.go
@@ -17,7 +17,7 @@ limitations under the License.
package v1beta1
-// WorkloadSpecApplyConfiguration represents an declarative configuration of the WorkloadSpec type for use
+// WorkloadSpecApplyConfiguration represents a declarative configuration of the WorkloadSpec type for use
// with apply.
type WorkloadSpecApplyConfiguration struct {
PodSets []PodSetApplyConfiguration `json:"podSets,omitempty"`
@@ -28,7 +28,7 @@ type WorkloadSpecApplyConfiguration struct {
Active *bool `json:"active,omitempty"`
}
-// WorkloadSpecApplyConfiguration constructs an declarative configuration of the WorkloadSpec type for use with
+// WorkloadSpecApplyConfiguration constructs a declarative configuration of the WorkloadSpec type for use with
// apply.
func WorkloadSpec() *WorkloadSpecApplyConfiguration {
return &WorkloadSpecApplyConfiguration{}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/workloadstatus.go b/client-go/applyconfiguration/kueue/v1beta1/workloadstatus.go
index b5c72d11eb6..022e37d5e1b 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/workloadstatus.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/workloadstatus.go
@@ -18,20 +18,20 @@ limitations under the License.
package v1beta1
import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// WorkloadStatusApplyConfiguration represents an declarative configuration of the WorkloadStatus type for use
+// WorkloadStatusApplyConfiguration represents a declarative configuration of the WorkloadStatus type for use
// with apply.
type WorkloadStatusApplyConfiguration struct {
Admission *AdmissionApplyConfiguration `json:"admission,omitempty"`
RequeueState *RequeueStateApplyConfiguration `json:"requeueState,omitempty"`
- Conditions []v1.Condition `json:"conditions,omitempty"`
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
ReclaimablePods []ReclaimablePodApplyConfiguration `json:"reclaimablePods,omitempty"`
AdmissionChecks []AdmissionCheckStateApplyConfiguration `json:"admissionChecks,omitempty"`
}
-// WorkloadStatusApplyConfiguration constructs an declarative configuration of the WorkloadStatus type for use with
+// WorkloadStatusApplyConfiguration constructs a declarative configuration of the WorkloadStatus type for use with
// apply.
func WorkloadStatus() *WorkloadStatusApplyConfiguration {
return &WorkloadStatusApplyConfiguration{}
@@ -56,9 +56,12 @@ func (b *WorkloadStatusApplyConfiguration) WithRequeueState(value *RequeueStateA
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
-func (b *WorkloadStatusApplyConfiguration) WithConditions(values ...v1.Condition) *WorkloadStatusApplyConfiguration {
+func (b *WorkloadStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *WorkloadStatusApplyConfiguration {
for i := range values {
- b.Conditions = append(b.Conditions, values[i])
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
}
return b
}
diff --git a/client-go/applyconfiguration/utils.go b/client-go/applyconfiguration/utils.go
index 58c3961c1be..f6fb98da9fa 100644
--- a/client-go/applyconfiguration/utils.go
+++ b/client-go/applyconfiguration/utils.go
@@ -18,34 +18,23 @@ limitations under the License.
package applyconfiguration
import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ testing "k8s.io/client-go/testing"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
- visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
- kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
+ v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ internal "sigs.k8s.io/kueue/client-go/applyconfiguration/internal"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
- applyconfigurationvisibilityv1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1alpha1"
+ visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1alpha1"
+ applyconfigurationvisibilityv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1beta1"
)
// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no
// apply configuration type exists for the given GroupVersionKind.
func ForKind(kind schema.GroupVersionKind) interface{} {
switch kind {
- // Group=kueue.x-k8s.io, Version=v1alpha1
- case v1alpha1.SchemeGroupVersion.WithKind("KubeConfig"):
- return &kueuev1alpha1.KubeConfigApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("MultiKueueCluster"):
- return &kueuev1alpha1.MultiKueueClusterApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("MultiKueueClusterSpec"):
- return &kueuev1alpha1.MultiKueueClusterSpecApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("MultiKueueClusterStatus"):
- return &kueuev1alpha1.MultiKueueClusterStatusApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("MultiKueueConfig"):
- return &kueuev1alpha1.MultiKueueConfigApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("MultiKueueConfigSpec"):
- return &kueuev1alpha1.MultiKueueConfigSpecApplyConfiguration{}
-
- // Group=kueue.x-k8s.io, Version=v1beta1
+ // Group=kueue.x-k8s.io, Version=v1beta1
case v1beta1.SchemeGroupVersion.WithKind("Admission"):
return &kueuev1beta1.AdmissionApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("AdmissionCheck"):
@@ -86,6 +75,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &kueuev1beta1.FlavorQuotasApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("FlavorUsage"):
return &kueuev1beta1.FlavorUsageApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("KubeConfig"):
+ return &kueuev1beta1.KubeConfigApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("LocalQueue"):
return &kueuev1beta1.LocalQueueApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("LocalQueueFlavorUsage"):
@@ -96,6 +87,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &kueuev1beta1.LocalQueueSpecApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("LocalQueueStatus"):
return &kueuev1beta1.LocalQueueStatusApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("MultiKueueCluster"):
+ return &kueuev1beta1.MultiKueueClusterApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("MultiKueueClusterSpec"):
+ return &kueuev1beta1.MultiKueueClusterSpecApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("MultiKueueClusterStatus"):
+ return &kueuev1beta1.MultiKueueClusterStatusApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("MultiKueueConfig"):
+ return &kueuev1beta1.MultiKueueConfigApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("MultiKueueConfigSpec"):
+ return &kueuev1beta1.MultiKueueConfigSpecApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodSet"):
return &kueuev1beta1.PodSetApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodSetAssignment"):
@@ -130,15 +131,29 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &kueuev1beta1.WorkloadStatusApplyConfiguration{}
// Group=visibility.kueue.x-k8s.io, Version=v1alpha1
- case visibilityv1alpha1.SchemeGroupVersion.WithKind("ClusterQueue"):
- return &applyconfigurationvisibilityv1alpha1.ClusterQueueApplyConfiguration{}
- case visibilityv1alpha1.SchemeGroupVersion.WithKind("LocalQueue"):
- return &applyconfigurationvisibilityv1alpha1.LocalQueueApplyConfiguration{}
- case visibilityv1alpha1.SchemeGroupVersion.WithKind("PendingWorkload"):
- return &applyconfigurationvisibilityv1alpha1.PendingWorkloadApplyConfiguration{}
- case visibilityv1alpha1.SchemeGroupVersion.WithKind("PendingWorkloadsSummary"):
- return &applyconfigurationvisibilityv1alpha1.PendingWorkloadsSummaryApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("ClusterQueue"):
+ return &visibilityv1alpha1.ClusterQueueApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("LocalQueue"):
+ return &visibilityv1alpha1.LocalQueueApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PendingWorkload"):
+ return &visibilityv1alpha1.PendingWorkloadApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PendingWorkloadsSummary"):
+ return &visibilityv1alpha1.PendingWorkloadsSummaryApplyConfiguration{}
+
+ // Group=visibility.kueue.x-k8s.io, Version=v1beta1
+ case visibilityv1beta1.SchemeGroupVersion.WithKind("ClusterQueue"):
+ return &applyconfigurationvisibilityv1beta1.ClusterQueueApplyConfiguration{}
+ case visibilityv1beta1.SchemeGroupVersion.WithKind("LocalQueue"):
+ return &applyconfigurationvisibilityv1beta1.LocalQueueApplyConfiguration{}
+ case visibilityv1beta1.SchemeGroupVersion.WithKind("PendingWorkload"):
+ return &applyconfigurationvisibilityv1beta1.PendingWorkloadApplyConfiguration{}
+ case visibilityv1beta1.SchemeGroupVersion.WithKind("PendingWorkloadsSummary"):
+ return &applyconfigurationvisibilityv1beta1.PendingWorkloadsSummaryApplyConfiguration{}
}
return nil
}
+
+func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
+ return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
+}
diff --git a/client-go/applyconfiguration/visibility/v1alpha1/clusterqueue.go b/client-go/applyconfiguration/visibility/v1alpha1/clusterqueue.go
index dd6baa35068..997e27fa557 100644
--- a/client-go/applyconfiguration/visibility/v1alpha1/clusterqueue.go
+++ b/client-go/applyconfiguration/visibility/v1alpha1/clusterqueue.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ClusterQueueApplyConfiguration represents an declarative configuration of the ClusterQueue type for use
+// ClusterQueueApplyConfiguration represents a declarative configuration of the ClusterQueue type for use
// with apply.
type ClusterQueueApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -31,7 +31,7 @@ type ClusterQueueApplyConfiguration struct {
Summary *PendingWorkloadsSummaryApplyConfiguration `json:"pendingWorkloadsSummary,omitempty"`
}
-// ClusterQueue constructs an declarative configuration of the ClusterQueue type for use with
+// ClusterQueue constructs a declarative configuration of the ClusterQueue type for use with
// apply.
func ClusterQueue(name string) *ClusterQueueApplyConfiguration {
b := &ClusterQueueApplyConfiguration{}
@@ -206,3 +206,9 @@ func (b *ClusterQueueApplyConfiguration) WithSummary(value *PendingWorkloadsSumm
b.Summary = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ClusterQueueApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/visibility/v1alpha1/localqueue.go b/client-go/applyconfiguration/visibility/v1alpha1/localqueue.go
index bbf7d7ea4c4..807e1188ccf 100644
--- a/client-go/applyconfiguration/visibility/v1alpha1/localqueue.go
+++ b/client-go/applyconfiguration/visibility/v1alpha1/localqueue.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// LocalQueueApplyConfiguration represents an declarative configuration of the LocalQueue type for use
+// LocalQueueApplyConfiguration represents a declarative configuration of the LocalQueue type for use
// with apply.
type LocalQueueApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -31,7 +31,7 @@ type LocalQueueApplyConfiguration struct {
Summary *PendingWorkloadsSummaryApplyConfiguration `json:"pendingWorkloadsSummary,omitempty"`
}
-// LocalQueue constructs an declarative configuration of the LocalQueue type for use with
+// LocalQueue constructs a declarative configuration of the LocalQueue type for use with
// apply.
func LocalQueue(name, namespace string) *LocalQueueApplyConfiguration {
b := &LocalQueueApplyConfiguration{}
@@ -207,3 +207,9 @@ func (b *LocalQueueApplyConfiguration) WithSummary(value *PendingWorkloadsSummar
b.Summary = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *LocalQueueApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/visibility/v1alpha1/pendingworkload.go b/client-go/applyconfiguration/visibility/v1alpha1/pendingworkload.go
index 4ec90b4f65c..2e7340996bd 100644
--- a/client-go/applyconfiguration/visibility/v1alpha1/pendingworkload.go
+++ b/client-go/applyconfiguration/visibility/v1alpha1/pendingworkload.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// PendingWorkloadApplyConfiguration represents an declarative configuration of the PendingWorkload type for use
+// PendingWorkloadApplyConfiguration represents a declarative configuration of the PendingWorkload type for use
// with apply.
type PendingWorkloadApplyConfiguration struct {
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
@@ -33,7 +33,7 @@ type PendingWorkloadApplyConfiguration struct {
PositionInLocalQueue *int32 `json:"positionInLocalQueue,omitempty"`
}
-// PendingWorkloadApplyConfiguration constructs an declarative configuration of the PendingWorkload type for use with
+// PendingWorkloadApplyConfiguration constructs a declarative configuration of the PendingWorkload type for use with
// apply.
func PendingWorkload() *PendingWorkloadApplyConfiguration {
return &PendingWorkloadApplyConfiguration{}
@@ -212,3 +212,9 @@ func (b *PendingWorkloadApplyConfiguration) WithPositionInLocalQueue(value int32
b.PositionInLocalQueue = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *PendingWorkloadApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/visibility/v1alpha1/pendingworkloadssummary.go b/client-go/applyconfiguration/visibility/v1alpha1/pendingworkloadssummary.go
index 5fb91bd7258..55e8f06ca30 100644
--- a/client-go/applyconfiguration/visibility/v1alpha1/pendingworkloadssummary.go
+++ b/client-go/applyconfiguration/visibility/v1alpha1/pendingworkloadssummary.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// PendingWorkloadsSummaryApplyConfiguration represents an declarative configuration of the PendingWorkloadsSummary type for use
+// PendingWorkloadsSummaryApplyConfiguration represents a declarative configuration of the PendingWorkloadsSummary type for use
// with apply.
type PendingWorkloadsSummaryApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -31,7 +31,7 @@ type PendingWorkloadsSummaryApplyConfiguration struct {
Items []PendingWorkloadApplyConfiguration `json:"items,omitempty"`
}
-// PendingWorkloadsSummaryApplyConfiguration constructs an declarative configuration of the PendingWorkloadsSummary type for use with
+// PendingWorkloadsSummaryApplyConfiguration constructs a declarative configuration of the PendingWorkloadsSummary type for use with
// apply.
func PendingWorkloadsSummary() *PendingWorkloadsSummaryApplyConfiguration {
b := &PendingWorkloadsSummaryApplyConfiguration{}
@@ -210,3 +210,9 @@ func (b *PendingWorkloadsSummaryApplyConfiguration) WithItems(values ...*Pending
}
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *PendingWorkloadsSummaryApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/visibility/v1beta1/clusterqueue.go b/client-go/applyconfiguration/visibility/v1beta1/clusterqueue.go
new file mode 100644
index 00000000000..087a3eed148
--- /dev/null
+++ b/client-go/applyconfiguration/visibility/v1beta1/clusterqueue.go
@@ -0,0 +1,214 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// ClusterQueueApplyConfiguration represents a declarative configuration of the ClusterQueue type for use
+// with apply.
+type ClusterQueueApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Summary *PendingWorkloadsSummaryApplyConfiguration `json:"pendingWorkloadsSummary,omitempty"`
+}
+
+// ClusterQueue constructs a declarative configuration of the ClusterQueue type for use with
+// apply.
+func ClusterQueue(name string) *ClusterQueueApplyConfiguration {
+ b := &ClusterQueueApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("ClusterQueue")
+ b.WithAPIVersion("visibility.kueue.x-k8s.io/v1beta1")
+ return b
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithKind(value string) *ClusterQueueApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithAPIVersion(value string) *ClusterQueueApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithName(value string) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithGenerateName(value string) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithNamespace(value string) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithUID(value types.UID) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithResourceVersion(value string) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithGeneration(value int64) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *ClusterQueueApplyConfiguration) WithLabels(entries map[string]string) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *ClusterQueueApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *ClusterQueueApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *ClusterQueueApplyConfiguration) WithFinalizers(values ...string) *ClusterQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *ClusterQueueApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSummary sets the Summary field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Summary field is set to the value of the last call.
+func (b *ClusterQueueApplyConfiguration) WithSummary(value *PendingWorkloadsSummaryApplyConfiguration) *ClusterQueueApplyConfiguration {
+ b.Summary = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ClusterQueueApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/visibility/v1beta1/localqueue.go b/client-go/applyconfiguration/visibility/v1beta1/localqueue.go
new file mode 100644
index 00000000000..9d7cb18735f
--- /dev/null
+++ b/client-go/applyconfiguration/visibility/v1beta1/localqueue.go
@@ -0,0 +1,215 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// LocalQueueApplyConfiguration represents a declarative configuration of the LocalQueue type for use
+// with apply.
+type LocalQueueApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Summary *PendingWorkloadsSummaryApplyConfiguration `json:"pendingWorkloadsSummary,omitempty"`
+}
+
+// LocalQueue constructs a declarative configuration of the LocalQueue type for use with
+// apply.
+func LocalQueue(name, namespace string) *LocalQueueApplyConfiguration {
+ b := &LocalQueueApplyConfiguration{}
+ b.WithName(name)
+ b.WithNamespace(namespace)
+ b.WithKind("LocalQueue")
+ b.WithAPIVersion("visibility.kueue.x-k8s.io/v1beta1")
+ return b
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithKind(value string) *LocalQueueApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithAPIVersion(value string) *LocalQueueApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithName(value string) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithGenerateName(value string) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithNamespace(value string) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithUID(value types.UID) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithResourceVersion(value string) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithGeneration(value int64) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *LocalQueueApplyConfiguration) WithLabels(entries map[string]string) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *LocalQueueApplyConfiguration) WithAnnotations(entries map[string]string) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *LocalQueueApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *LocalQueueApplyConfiguration) WithFinalizers(values ...string) *LocalQueueApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *LocalQueueApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSummary sets the Summary field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Summary field is set to the value of the last call.
+func (b *LocalQueueApplyConfiguration) WithSummary(value *PendingWorkloadsSummaryApplyConfiguration) *LocalQueueApplyConfiguration {
+ b.Summary = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *LocalQueueApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/visibility/v1beta1/pendingworkload.go b/client-go/applyconfiguration/visibility/v1beta1/pendingworkload.go
new file mode 100644
index 00000000000..0ae8299c999
--- /dev/null
+++ b/client-go/applyconfiguration/visibility/v1beta1/pendingworkload.go
@@ -0,0 +1,220 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// PendingWorkloadApplyConfiguration represents a declarative configuration of the PendingWorkload type for use
+// with apply.
+type PendingWorkloadApplyConfiguration struct {
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Priority *int32 `json:"priority,omitempty"`
+ LocalQueueName *string `json:"localQueueName,omitempty"`
+ PositionInClusterQueue *int32 `json:"positionInClusterQueue,omitempty"`
+ PositionInLocalQueue *int32 `json:"positionInLocalQueue,omitempty"`
+}
+
+// PendingWorkloadApplyConfiguration constructs a declarative configuration of the PendingWorkload type for use with
+// apply.
+func PendingWorkload() *PendingWorkloadApplyConfiguration {
+ return &PendingWorkloadApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithName(value string) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithGenerateName(value string) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithNamespace(value string) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithUID(value types.UID) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithResourceVersion(value string) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithGeneration(value int64) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *PendingWorkloadApplyConfiguration) WithLabels(entries map[string]string) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *PendingWorkloadApplyConfiguration) WithAnnotations(entries map[string]string) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *PendingWorkloadApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *PendingWorkloadApplyConfiguration) WithFinalizers(values ...string) *PendingWorkloadApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *PendingWorkloadApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithPriority sets the Priority field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Priority field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithPriority(value int32) *PendingWorkloadApplyConfiguration {
+ b.Priority = &value
+ return b
+}
+
+// WithLocalQueueName sets the LocalQueueName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LocalQueueName field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithLocalQueueName(value string) *PendingWorkloadApplyConfiguration {
+ b.LocalQueueName = &value
+ return b
+}
+
+// WithPositionInClusterQueue sets the PositionInClusterQueue field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the PositionInClusterQueue field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithPositionInClusterQueue(value int32) *PendingWorkloadApplyConfiguration {
+ b.PositionInClusterQueue = &value
+ return b
+}
+
+// WithPositionInLocalQueue sets the PositionInLocalQueue field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the PositionInLocalQueue field is set to the value of the last call.
+func (b *PendingWorkloadApplyConfiguration) WithPositionInLocalQueue(value int32) *PendingWorkloadApplyConfiguration {
+ b.PositionInLocalQueue = &value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *PendingWorkloadApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/visibility/v1beta1/pendingworkloadssummary.go b/client-go/applyconfiguration/visibility/v1beta1/pendingworkloadssummary.go
new file mode 100644
index 00000000000..c1554dde29e
--- /dev/null
+++ b/client-go/applyconfiguration/visibility/v1beta1/pendingworkloadssummary.go
@@ -0,0 +1,218 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// PendingWorkloadsSummaryApplyConfiguration represents a declarative configuration of the PendingWorkloadsSummary type for use
+// with apply.
+type PendingWorkloadsSummaryApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Items []PendingWorkloadApplyConfiguration `json:"items,omitempty"`
+}
+
+// PendingWorkloadsSummaryApplyConfiguration constructs a declarative configuration of the PendingWorkloadsSummary type for use with
+// apply.
+func PendingWorkloadsSummary() *PendingWorkloadsSummaryApplyConfiguration {
+ b := &PendingWorkloadsSummaryApplyConfiguration{}
+ b.WithKind("PendingWorkloadsSummary")
+ b.WithAPIVersion("visibility.kueue.x-k8s.io/v1beta1")
+ return b
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithKind(value string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithAPIVersion(value string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithName(value string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithGenerateName(value string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithNamespace(value string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithUID(value types.UID) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithResourceVersion(value string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithGeneration(value int64) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithLabels(entries map[string]string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithAnnotations(entries map[string]string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithFinalizers(values ...string) *PendingWorkloadsSummaryApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *PendingWorkloadsSummaryApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithItems adds the given value to the Items field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Items field.
+func (b *PendingWorkloadsSummaryApplyConfiguration) WithItems(values ...*PendingWorkloadApplyConfiguration) *PendingWorkloadsSummaryApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithItems")
+ }
+ b.Items = append(b.Items, *values[i])
+ }
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *PendingWorkloadsSummaryApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/clientset/versioned/clientset.go b/client-go/clientset/versioned/clientset.go
index 1511da78387..2f01cb1402a 100644
--- a/client-go/clientset/versioned/clientset.go
+++ b/client-go/clientset/versioned/clientset.go
@@ -27,6 +27,7 @@ import (
kueuev1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1alpha1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1beta1"
visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1beta1"
)
type Interface interface {
@@ -34,6 +35,7 @@ type Interface interface {
KueueV1alpha1() kueuev1alpha1.KueueV1alpha1Interface
KueueV1beta1() kueuev1beta1.KueueV1beta1Interface
VisibilityV1alpha1() visibilityv1alpha1.VisibilityV1alpha1Interface
+ VisibilityV1beta1() visibilityv1beta1.VisibilityV1beta1Interface
}
// Clientset contains the clients for groups.
@@ -42,6 +44,7 @@ type Clientset struct {
kueueV1alpha1 *kueuev1alpha1.KueueV1alpha1Client
kueueV1beta1 *kueuev1beta1.KueueV1beta1Client
visibilityV1alpha1 *visibilityv1alpha1.VisibilityV1alpha1Client
+ visibilityV1beta1 *visibilityv1beta1.VisibilityV1beta1Client
}
// KueueV1alpha1 retrieves the KueueV1alpha1Client
@@ -59,6 +62,11 @@ func (c *Clientset) VisibilityV1alpha1() visibilityv1alpha1.VisibilityV1alpha1In
return c.visibilityV1alpha1
}
+// VisibilityV1beta1 retrieves the VisibilityV1beta1Client
+func (c *Clientset) VisibilityV1beta1() visibilityv1beta1.VisibilityV1beta1Interface {
+ return c.visibilityV1beta1
+}
+
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
@@ -115,6 +123,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
if err != nil {
return nil, err
}
+ cs.visibilityV1beta1, err = visibilityv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
+ if err != nil {
+ return nil, err
+ }
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
@@ -139,6 +151,7 @@ func New(c rest.Interface) *Clientset {
cs.kueueV1alpha1 = kueuev1alpha1.New(c)
cs.kueueV1beta1 = kueuev1beta1.New(c)
cs.visibilityV1alpha1 = visibilityv1alpha1.New(c)
+ cs.visibilityV1beta1 = visibilityv1beta1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
diff --git a/client-go/clientset/versioned/fake/clientset_generated.go b/client-go/clientset/versioned/fake/clientset_generated.go
index 2914c2175bc..1e31ae2d6ba 100644
--- a/client-go/clientset/versioned/fake/clientset_generated.go
+++ b/client-go/clientset/versioned/fake/clientset_generated.go
@@ -23,6 +23,7 @@ import (
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
+ applyconfiguration "sigs.k8s.io/kueue/client-go/applyconfiguration"
clientset "sigs.k8s.io/kueue/client-go/clientset/versioned"
kueuev1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1alpha1"
fakekueuev1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1alpha1/fake"
@@ -30,12 +31,18 @@ import (
fakekueuev1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1beta1/fake"
visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1alpha1"
fakevisibilityv1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1alpha1/fake"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1beta1"
+ fakevisibilityv1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1beta1/fake"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
-// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
+//
+// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
+// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
+// via --with-applyconfig).
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
@@ -77,6 +84,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
+// NewClientset returns a clientset that will respond with the provided objects.
+// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
+// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// for a real clientset and is mostly useful in simple unit tests.
+func NewClientset(objects ...runtime.Object) *Clientset {
+ o := testing.NewFieldManagedObjectTracker(
+ scheme,
+ codecs.UniversalDecoder(),
+ applyconfiguration.NewTypeConverter(scheme),
+ )
+ for _, obj := range objects {
+ if err := o.Add(obj); err != nil {
+ panic(err)
+ }
+ }
+
+ cs := &Clientset{tracker: o}
+ cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
+ cs.AddReactor("*", "*", testing.ObjectReaction(o))
+ cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
+ gvr := action.GetResource()
+ ns := action.GetNamespace()
+ watch, err := o.Watch(gvr, ns)
+ if err != nil {
+ return false, nil, err
+ }
+ return true, watch, nil
+ })
+
+ return cs
+}
+
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
@@ -96,3 +135,8 @@ func (c *Clientset) KueueV1beta1() kueuev1beta1.KueueV1beta1Interface {
func (c *Clientset) VisibilityV1alpha1() visibilityv1alpha1.VisibilityV1alpha1Interface {
return &fakevisibilityv1alpha1.FakeVisibilityV1alpha1{Fake: &c.Fake}
}
+
+// VisibilityV1beta1 retrieves the VisibilityV1beta1Client
+func (c *Clientset) VisibilityV1beta1() visibilityv1beta1.VisibilityV1beta1Interface {
+ return &fakevisibilityv1beta1.FakeVisibilityV1beta1{Fake: &c.Fake}
+}
diff --git a/client-go/clientset/versioned/fake/register.go b/client-go/clientset/versioned/fake/register.go
index 6df4d26714f..3f13d309781 100644
--- a/client-go/clientset/versioned/fake/register.go
+++ b/client-go/clientset/versioned/fake/register.go
@@ -26,6 +26,7 @@ import (
kueuev1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
)
var scheme = runtime.NewScheme()
@@ -35,6 +36,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
kueuev1alpha1.AddToScheme,
kueuev1beta1.AddToScheme,
visibilityv1alpha1.AddToScheme,
+ visibilityv1beta1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
diff --git a/client-go/clientset/versioned/scheme/register.go b/client-go/clientset/versioned/scheme/register.go
index c72c4376e18..d8b1d5036fd 100644
--- a/client-go/clientset/versioned/scheme/register.go
+++ b/client-go/clientset/versioned/scheme/register.go
@@ -26,6 +26,7 @@ import (
kueuev1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
)
var Scheme = runtime.NewScheme()
@@ -35,6 +36,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
kueuev1alpha1.AddToScheme,
kueuev1beta1.AddToScheme,
visibilityv1alpha1.AddToScheme,
+ visibilityv1beta1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go
index 4fd5360c560..68596e950f8 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go
@@ -20,21 +20,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
- v1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1alpha1"
)
type FakeKueueV1alpha1 struct {
*testing.Fake
}
-func (c *FakeKueueV1alpha1) MultiKueueClusters() v1alpha1.MultiKueueClusterInterface {
- return &FakeMultiKueueClusters{c}
-}
-
-func (c *FakeKueueV1alpha1) MultiKueueConfigs() v1alpha1.MultiKueueConfigInterface {
- return &FakeMultiKueueConfigs{c}
-}
-
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeKueueV1alpha1) RESTClient() rest.Interface {
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go
index 68d65929381..5f6c8d4e03d 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go
@@ -16,7 +16,3 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
-
-type MultiKueueClusterExpansion interface{}
-
-type MultiKueueConfigExpansion interface{}
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go
index 9f143a91e45..eea935c7fec 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go
@@ -27,8 +27,6 @@ import (
type KueueV1alpha1Interface interface {
RESTClient() rest.Interface
- MultiKueueClustersGetter
- MultiKueueConfigsGetter
}
// KueueV1alpha1Client is used to interact with features provided by the kueue.x-k8s.io group.
@@ -36,14 +34,6 @@ type KueueV1alpha1Client struct {
restClient rest.Interface
}
-func (c *KueueV1alpha1Client) MultiKueueClusters() MultiKueueClusterInterface {
- return newMultiKueueClusters(c)
-}
-
-func (c *KueueV1alpha1Client) MultiKueueConfigs() MultiKueueConfigInterface {
- return newMultiKueueConfigs(c)
-}
-
// NewForConfig creates a new KueueV1alpha1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/multikueuecluster.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/multikueuecluster.go
deleted file mode 100644
index 9851c39d415..00000000000
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/multikueuecluster.go
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-// Code generated by client-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- "context"
- json "encoding/json"
- "fmt"
- "time"
-
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- types "k8s.io/apimachinery/pkg/types"
- watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
- kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
- scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
-)
-
-// MultiKueueClustersGetter has a method to return a MultiKueueClusterInterface.
-// A group's client should implement this interface.
-type MultiKueueClustersGetter interface {
- MultiKueueClusters() MultiKueueClusterInterface
-}
-
-// MultiKueueClusterInterface has methods to work with MultiKueueCluster resources.
-type MultiKueueClusterInterface interface {
- Create(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.CreateOptions) (*v1alpha1.MultiKueueCluster, error)
- Update(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.UpdateOptions) (*v1alpha1.MultiKueueCluster, error)
- UpdateStatus(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.UpdateOptions) (*v1alpha1.MultiKueueCluster, error)
- Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
- DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
- Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.MultiKueueCluster, error)
- List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.MultiKueueClusterList, error)
- Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
- Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MultiKueueCluster, err error)
- Apply(ctx context.Context, multiKueueCluster *kueuev1alpha1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueCluster, err error)
- ApplyStatus(ctx context.Context, multiKueueCluster *kueuev1alpha1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueCluster, err error)
- MultiKueueClusterExpansion
-}
-
-// multiKueueClusters implements MultiKueueClusterInterface
-type multiKueueClusters struct {
- client rest.Interface
-}
-
-// newMultiKueueClusters returns a MultiKueueClusters
-func newMultiKueueClusters(c *KueueV1alpha1Client) *multiKueueClusters {
- return &multiKueueClusters{
- client: c.RESTClient(),
- }
-}
-
-// Get takes name of the multiKueueCluster, and returns the corresponding multiKueueCluster object, and an error if there is any.
-func (c *multiKueueClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MultiKueueCluster, err error) {
- result = &v1alpha1.MultiKueueCluster{}
- err = c.client.Get().
- Resource("multikueueclusters").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of MultiKueueClusters that match those selectors.
-func (c *multiKueueClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MultiKueueClusterList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.MultiKueueClusterList{}
- err = c.client.Get().
- Resource("multikueueclusters").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested multiKueueClusters.
-func (c *multiKueueClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("multikueueclusters").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a multiKueueCluster and creates it. Returns the server's representation of the multiKueueCluster, and an error, if there is any.
-func (c *multiKueueClusters) Create(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.CreateOptions) (result *v1alpha1.MultiKueueCluster, err error) {
- result = &v1alpha1.MultiKueueCluster{}
- err = c.client.Post().
- Resource("multikueueclusters").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(multiKueueCluster).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a multiKueueCluster and updates it. Returns the server's representation of the multiKueueCluster, and an error, if there is any.
-func (c *multiKueueClusters) Update(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.UpdateOptions) (result *v1alpha1.MultiKueueCluster, err error) {
- result = &v1alpha1.MultiKueueCluster{}
- err = c.client.Put().
- Resource("multikueueclusters").
- Name(multiKueueCluster.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(multiKueueCluster).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *multiKueueClusters) UpdateStatus(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.UpdateOptions) (result *v1alpha1.MultiKueueCluster, err error) {
- result = &v1alpha1.MultiKueueCluster{}
- err = c.client.Put().
- Resource("multikueueclusters").
- Name(multiKueueCluster.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(multiKueueCluster).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the multiKueueCluster and deletes it. Returns an error if one occurs.
-func (c *multiKueueClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("multikueueclusters").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *multiKueueClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("multikueueclusters").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched multiKueueCluster.
-func (c *multiKueueClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MultiKueueCluster, err error) {
- result = &v1alpha1.MultiKueueCluster{}
- err = c.client.Patch(pt).
- Resource("multikueueclusters").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied multiKueueCluster.
-func (c *multiKueueClusters) Apply(ctx context.Context, multiKueueCluster *kueuev1alpha1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueCluster, err error) {
- if multiKueueCluster == nil {
- return nil, fmt.Errorf("multiKueueCluster provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(multiKueueCluster)
- if err != nil {
- return nil, err
- }
- name := multiKueueCluster.Name
- if name == nil {
- return nil, fmt.Errorf("multiKueueCluster.Name must be provided to Apply")
- }
- result = &v1alpha1.MultiKueueCluster{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("multikueueclusters").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *multiKueueClusters) ApplyStatus(ctx context.Context, multiKueueCluster *kueuev1alpha1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueCluster, err error) {
- if multiKueueCluster == nil {
- return nil, fmt.Errorf("multiKueueCluster provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(multiKueueCluster)
- if err != nil {
- return nil, err
- }
-
- name := multiKueueCluster.Name
- if name == nil {
- return nil, fmt.Errorf("multiKueueCluster.Name must be provided to Apply")
- }
-
- result = &v1alpha1.MultiKueueCluster{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("multikueueclusters").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/multikueueconfig.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/multikueueconfig.go
deleted file mode 100644
index 0e093892f7f..00000000000
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/multikueueconfig.go
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-// Code generated by client-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- "context"
- json "encoding/json"
- "fmt"
- "time"
-
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- types "k8s.io/apimachinery/pkg/types"
- watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
- kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
- scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
-)
-
-// MultiKueueConfigsGetter has a method to return a MultiKueueConfigInterface.
-// A group's client should implement this interface.
-type MultiKueueConfigsGetter interface {
- MultiKueueConfigs() MultiKueueConfigInterface
-}
-
-// MultiKueueConfigInterface has methods to work with MultiKueueConfig resources.
-type MultiKueueConfigInterface interface {
- Create(ctx context.Context, multiKueueConfig *v1alpha1.MultiKueueConfig, opts v1.CreateOptions) (*v1alpha1.MultiKueueConfig, error)
- Update(ctx context.Context, multiKueueConfig *v1alpha1.MultiKueueConfig, opts v1.UpdateOptions) (*v1alpha1.MultiKueueConfig, error)
- Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
- DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
- Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.MultiKueueConfig, error)
- List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.MultiKueueConfigList, error)
- Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
- Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MultiKueueConfig, err error)
- Apply(ctx context.Context, multiKueueConfig *kueuev1alpha1.MultiKueueConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueConfig, err error)
- MultiKueueConfigExpansion
-}
-
-// multiKueueConfigs implements MultiKueueConfigInterface
-type multiKueueConfigs struct {
- client rest.Interface
-}
-
-// newMultiKueueConfigs returns a MultiKueueConfigs
-func newMultiKueueConfigs(c *KueueV1alpha1Client) *multiKueueConfigs {
- return &multiKueueConfigs{
- client: c.RESTClient(),
- }
-}
-
-// Get takes name of the multiKueueConfig, and returns the corresponding multiKueueConfig object, and an error if there is any.
-func (c *multiKueueConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MultiKueueConfig, err error) {
- result = &v1alpha1.MultiKueueConfig{}
- err = c.client.Get().
- Resource("multikueueconfigs").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of MultiKueueConfigs that match those selectors.
-func (c *multiKueueConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MultiKueueConfigList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.MultiKueueConfigList{}
- err = c.client.Get().
- Resource("multikueueconfigs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested multiKueueConfigs.
-func (c *multiKueueConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("multikueueconfigs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a multiKueueConfig and creates it. Returns the server's representation of the multiKueueConfig, and an error, if there is any.
-func (c *multiKueueConfigs) Create(ctx context.Context, multiKueueConfig *v1alpha1.MultiKueueConfig, opts v1.CreateOptions) (result *v1alpha1.MultiKueueConfig, err error) {
- result = &v1alpha1.MultiKueueConfig{}
- err = c.client.Post().
- Resource("multikueueconfigs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(multiKueueConfig).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a multiKueueConfig and updates it. Returns the server's representation of the multiKueueConfig, and an error, if there is any.
-func (c *multiKueueConfigs) Update(ctx context.Context, multiKueueConfig *v1alpha1.MultiKueueConfig, opts v1.UpdateOptions) (result *v1alpha1.MultiKueueConfig, err error) {
- result = &v1alpha1.MultiKueueConfig{}
- err = c.client.Put().
- Resource("multikueueconfigs").
- Name(multiKueueConfig.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(multiKueueConfig).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the multiKueueConfig and deletes it. Returns an error if one occurs.
-func (c *multiKueueConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("multikueueconfigs").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *multiKueueConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("multikueueconfigs").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched multiKueueConfig.
-func (c *multiKueueConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MultiKueueConfig, err error) {
- result = &v1alpha1.MultiKueueConfig{}
- err = c.client.Patch(pt).
- Resource("multikueueconfigs").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied multiKueueConfig.
-func (c *multiKueueConfigs) Apply(ctx context.Context, multiKueueConfig *kueuev1alpha1.MultiKueueConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueConfig, err error) {
- if multiKueueConfig == nil {
- return nil, fmt.Errorf("multiKueueConfig provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(multiKueueConfig)
- if err != nil {
- return nil, err
- }
- name := multiKueueConfig.Name
- if name == nil {
- return nil, fmt.Errorf("multiKueueConfig.Name must be provided to Apply")
- }
- result = &v1alpha1.MultiKueueConfig{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("multikueueconfigs").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/admissioncheck.go b/client-go/clientset/versioned/typed/kueue/v1beta1/admissioncheck.go
index e0dd0ced461..9f110e4bcc8 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/admissioncheck.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/admissioncheck.go
@@ -19,14 +19,11 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -42,6 +39,7 @@ type AdmissionChecksGetter interface {
type AdmissionCheckInterface interface {
Create(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.CreateOptions) (*v1beta1.AdmissionCheck, error)
Update(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.UpdateOptions) (*v1beta1.AdmissionCheck, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.UpdateOptions) (*v1beta1.AdmissionCheck, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -50,193 +48,25 @@ type AdmissionCheckInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AdmissionCheck, err error)
Apply(ctx context.Context, admissionCheck *kueuev1beta1.AdmissionCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AdmissionCheck, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, admissionCheck *kueuev1beta1.AdmissionCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AdmissionCheck, err error)
AdmissionCheckExpansion
}
// admissionChecks implements AdmissionCheckInterface
type admissionChecks struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1beta1.AdmissionCheck, *v1beta1.AdmissionCheckList, *kueuev1beta1.AdmissionCheckApplyConfiguration]
}
// newAdmissionChecks returns a AdmissionChecks
func newAdmissionChecks(c *KueueV1beta1Client) *admissionChecks {
return &admissionChecks{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1beta1.AdmissionCheck, *v1beta1.AdmissionCheckList, *kueuev1beta1.AdmissionCheckApplyConfiguration](
+ "admissionchecks",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.AdmissionCheck { return &v1beta1.AdmissionCheck{} },
+ func() *v1beta1.AdmissionCheckList { return &v1beta1.AdmissionCheckList{} }),
}
}
-
-// Get takes name of the admissionCheck, and returns the corresponding admissionCheck object, and an error if there is any.
-func (c *admissionChecks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AdmissionCheck, err error) {
- result = &v1beta1.AdmissionCheck{}
- err = c.client.Get().
- Resource("admissionchecks").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of AdmissionChecks that match those selectors.
-func (c *admissionChecks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AdmissionCheckList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.AdmissionCheckList{}
- err = c.client.Get().
- Resource("admissionchecks").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested admissionChecks.
-func (c *admissionChecks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("admissionchecks").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a admissionCheck and creates it. Returns the server's representation of the admissionCheck, and an error, if there is any.
-func (c *admissionChecks) Create(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.CreateOptions) (result *v1beta1.AdmissionCheck, err error) {
- result = &v1beta1.AdmissionCheck{}
- err = c.client.Post().
- Resource("admissionchecks").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(admissionCheck).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a admissionCheck and updates it. Returns the server's representation of the admissionCheck, and an error, if there is any.
-func (c *admissionChecks) Update(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.UpdateOptions) (result *v1beta1.AdmissionCheck, err error) {
- result = &v1beta1.AdmissionCheck{}
- err = c.client.Put().
- Resource("admissionchecks").
- Name(admissionCheck.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(admissionCheck).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *admissionChecks) UpdateStatus(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.UpdateOptions) (result *v1beta1.AdmissionCheck, err error) {
- result = &v1beta1.AdmissionCheck{}
- err = c.client.Put().
- Resource("admissionchecks").
- Name(admissionCheck.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(admissionCheck).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the admissionCheck and deletes it. Returns an error if one occurs.
-func (c *admissionChecks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("admissionchecks").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *admissionChecks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("admissionchecks").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched admissionCheck.
-func (c *admissionChecks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AdmissionCheck, err error) {
- result = &v1beta1.AdmissionCheck{}
- err = c.client.Patch(pt).
- Resource("admissionchecks").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied admissionCheck.
-func (c *admissionChecks) Apply(ctx context.Context, admissionCheck *kueuev1beta1.AdmissionCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AdmissionCheck, err error) {
- if admissionCheck == nil {
- return nil, fmt.Errorf("admissionCheck provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(admissionCheck)
- if err != nil {
- return nil, err
- }
- name := admissionCheck.Name
- if name == nil {
- return nil, fmt.Errorf("admissionCheck.Name must be provided to Apply")
- }
- result = &v1beta1.AdmissionCheck{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("admissionchecks").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *admissionChecks) ApplyStatus(ctx context.Context, admissionCheck *kueuev1beta1.AdmissionCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AdmissionCheck, err error) {
- if admissionCheck == nil {
- return nil, fmt.Errorf("admissionCheck provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(admissionCheck)
- if err != nil {
- return nil, err
- }
-
- name := admissionCheck.Name
- if name == nil {
- return nil, fmt.Errorf("admissionCheck.Name must be provided to Apply")
- }
-
- result = &v1beta1.AdmissionCheck{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("admissionchecks").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/clusterqueue.go b/client-go/clientset/versioned/typed/kueue/v1beta1/clusterqueue.go
index 8cb404bbaef..200c0f940e0 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/clusterqueue.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/clusterqueue.go
@@ -19,14 +19,11 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -42,6 +39,7 @@ type ClusterQueuesGetter interface {
type ClusterQueueInterface interface {
Create(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.CreateOptions) (*v1beta1.ClusterQueue, error)
Update(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (*v1beta1.ClusterQueue, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (*v1beta1.ClusterQueue, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -50,193 +48,25 @@ type ClusterQueueInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterQueue, err error)
Apply(ctx context.Context, clusterQueue *kueuev1beta1.ClusterQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterQueue, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, clusterQueue *kueuev1beta1.ClusterQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterQueue, err error)
ClusterQueueExpansion
}
// clusterQueues implements ClusterQueueInterface
type clusterQueues struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1beta1.ClusterQueue, *v1beta1.ClusterQueueList, *kueuev1beta1.ClusterQueueApplyConfiguration]
}
// newClusterQueues returns a ClusterQueues
func newClusterQueues(c *KueueV1beta1Client) *clusterQueues {
return &clusterQueues{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1beta1.ClusterQueue, *v1beta1.ClusterQueueList, *kueuev1beta1.ClusterQueueApplyConfiguration](
+ "clusterqueues",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.ClusterQueue { return &v1beta1.ClusterQueue{} },
+ func() *v1beta1.ClusterQueueList { return &v1beta1.ClusterQueueList{} }),
}
}
-
-// Get takes name of the clusterQueue, and returns the corresponding clusterQueue object, and an error if there is any.
-func (c *clusterQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterQueue, err error) {
- result = &v1beta1.ClusterQueue{}
- err = c.client.Get().
- Resource("clusterqueues").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ClusterQueues that match those selectors.
-func (c *clusterQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterQueueList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.ClusterQueueList{}
- err = c.client.Get().
- Resource("clusterqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested clusterQueues.
-func (c *clusterQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("clusterqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a clusterQueue and creates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
-func (c *clusterQueues) Create(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.CreateOptions) (result *v1beta1.ClusterQueue, err error) {
- result = &v1beta1.ClusterQueue{}
- err = c.client.Post().
- Resource("clusterqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a clusterQueue and updates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
-func (c *clusterQueues) Update(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (result *v1beta1.ClusterQueue, err error) {
- result = &v1beta1.ClusterQueue{}
- err = c.client.Put().
- Resource("clusterqueues").
- Name(clusterQueue.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *clusterQueues) UpdateStatus(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (result *v1beta1.ClusterQueue, err error) {
- result = &v1beta1.ClusterQueue{}
- err = c.client.Put().
- Resource("clusterqueues").
- Name(clusterQueue.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the clusterQueue and deletes it. Returns an error if one occurs.
-func (c *clusterQueues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("clusterqueues").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *clusterQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("clusterqueues").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched clusterQueue.
-func (c *clusterQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterQueue, err error) {
- result = &v1beta1.ClusterQueue{}
- err = c.client.Patch(pt).
- Resource("clusterqueues").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied clusterQueue.
-func (c *clusterQueues) Apply(ctx context.Context, clusterQueue *kueuev1beta1.ClusterQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterQueue, err error) {
- if clusterQueue == nil {
- return nil, fmt.Errorf("clusterQueue provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterQueue)
- if err != nil {
- return nil, err
- }
- name := clusterQueue.Name
- if name == nil {
- return nil, fmt.Errorf("clusterQueue.Name must be provided to Apply")
- }
- result = &v1beta1.ClusterQueue{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusterqueues").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *clusterQueues) ApplyStatus(ctx context.Context, clusterQueue *kueuev1beta1.ClusterQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterQueue, err error) {
- if clusterQueue == nil {
- return nil, fmt.Errorf("clusterQueue provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterQueue)
- if err != nil {
- return nil, err
- }
-
- name := clusterQueue.Name
- if name == nil {
- return nil, fmt.Errorf("clusterQueue.Name must be provided to Apply")
- }
-
- result = &v1beta1.ClusterQueue{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusterqueues").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_admissioncheck.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_admissioncheck.go
index a31dfa301e1..aeea11a5d1d 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_admissioncheck.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_admissioncheck.go
@@ -42,20 +42,22 @@ var admissionchecksKind = v1beta1.SchemeGroupVersion.WithKind("AdmissionCheck")
// Get takes name of the admissionCheck, and returns the corresponding admissionCheck object, and an error if there is any.
func (c *FakeAdmissionChecks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AdmissionCheck, err error) {
+ emptyResult := &v1beta1.AdmissionCheck{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(admissionchecksResource, name), &v1beta1.AdmissionCheck{})
+ Invokes(testing.NewRootGetActionWithOptions(admissionchecksResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.AdmissionCheck), err
}
// List takes label and field selectors, and returns the list of AdmissionChecks that match those selectors.
func (c *FakeAdmissionChecks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AdmissionCheckList, err error) {
+ emptyResult := &v1beta1.AdmissionCheckList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(admissionchecksResource, admissionchecksKind, opts), &v1beta1.AdmissionCheckList{})
+ Invokes(testing.NewRootListActionWithOptions(admissionchecksResource, admissionchecksKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,36 +76,39 @@ func (c *FakeAdmissionChecks) List(ctx context.Context, opts v1.ListOptions) (re
// Watch returns a watch.Interface that watches the requested admissionChecks.
func (c *FakeAdmissionChecks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(admissionchecksResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(admissionchecksResource, opts))
}
// Create takes the representation of a admissionCheck and creates it. Returns the server's representation of the admissionCheck, and an error, if there is any.
func (c *FakeAdmissionChecks) Create(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.CreateOptions) (result *v1beta1.AdmissionCheck, err error) {
+ emptyResult := &v1beta1.AdmissionCheck{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(admissionchecksResource, admissionCheck), &v1beta1.AdmissionCheck{})
+ Invokes(testing.NewRootCreateActionWithOptions(admissionchecksResource, admissionCheck, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.AdmissionCheck), err
}
// Update takes the representation of a admissionCheck and updates it. Returns the server's representation of the admissionCheck, and an error, if there is any.
func (c *FakeAdmissionChecks) Update(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.UpdateOptions) (result *v1beta1.AdmissionCheck, err error) {
+ emptyResult := &v1beta1.AdmissionCheck{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(admissionchecksResource, admissionCheck), &v1beta1.AdmissionCheck{})
+ Invokes(testing.NewRootUpdateActionWithOptions(admissionchecksResource, admissionCheck, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.AdmissionCheck), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeAdmissionChecks) UpdateStatus(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.UpdateOptions) (*v1beta1.AdmissionCheck, error) {
+func (c *FakeAdmissionChecks) UpdateStatus(ctx context.Context, admissionCheck *v1beta1.AdmissionCheck, opts v1.UpdateOptions) (result *v1beta1.AdmissionCheck, err error) {
+ emptyResult := &v1beta1.AdmissionCheck{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(admissionchecksResource, "status", admissionCheck), &v1beta1.AdmissionCheck{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(admissionchecksResource, "status", admissionCheck, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.AdmissionCheck), err
}
@@ -117,7 +122,7 @@ func (c *FakeAdmissionChecks) Delete(ctx context.Context, name string, opts v1.D
// DeleteCollection deletes a collection of objects.
func (c *FakeAdmissionChecks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(admissionchecksResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(admissionchecksResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.AdmissionCheckList{})
return err
@@ -125,10 +130,11 @@ func (c *FakeAdmissionChecks) DeleteCollection(ctx context.Context, opts v1.Dele
// Patch applies the patch and returns the patched admissionCheck.
func (c *FakeAdmissionChecks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AdmissionCheck, err error) {
+ emptyResult := &v1beta1.AdmissionCheck{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(admissionchecksResource, name, pt, data, subresources...), &v1beta1.AdmissionCheck{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(admissionchecksResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.AdmissionCheck), err
}
@@ -146,10 +152,11 @@ func (c *FakeAdmissionChecks) Apply(ctx context.Context, admissionCheck *kueuev1
if name == nil {
return nil, fmt.Errorf("admissionCheck.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.AdmissionCheck{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(admissionchecksResource, *name, types.ApplyPatchType, data), &v1beta1.AdmissionCheck{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(admissionchecksResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.AdmissionCheck), err
}
@@ -168,10 +175,11 @@ func (c *FakeAdmissionChecks) ApplyStatus(ctx context.Context, admissionCheck *k
if name == nil {
return nil, fmt.Errorf("admissionCheck.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.AdmissionCheck{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(admissionchecksResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.AdmissionCheck{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(admissionchecksResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.AdmissionCheck), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_clusterqueue.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_clusterqueue.go
index 8205ce40362..3492096ba43 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_clusterqueue.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_clusterqueue.go
@@ -42,20 +42,22 @@ var clusterqueuesKind = v1beta1.SchemeGroupVersion.WithKind("ClusterQueue")
// Get takes name of the clusterQueue, and returns the corresponding clusterQueue object, and an error if there is any.
func (c *FakeClusterQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(clusterqueuesResource, name), &v1beta1.ClusterQueue{})
+ Invokes(testing.NewRootGetActionWithOptions(clusterqueuesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ClusterQueue), err
}
// List takes label and field selectors, and returns the list of ClusterQueues that match those selectors.
func (c *FakeClusterQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterQueueList, err error) {
+ emptyResult := &v1beta1.ClusterQueueList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(clusterqueuesResource, clusterqueuesKind, opts), &v1beta1.ClusterQueueList{})
+ Invokes(testing.NewRootListActionWithOptions(clusterqueuesResource, clusterqueuesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,36 +76,39 @@ func (c *FakeClusterQueues) List(ctx context.Context, opts v1.ListOptions) (resu
// Watch returns a watch.Interface that watches the requested clusterQueues.
func (c *FakeClusterQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(clusterqueuesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(clusterqueuesResource, opts))
}
// Create takes the representation of a clusterQueue and creates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
func (c *FakeClusterQueues) Create(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.CreateOptions) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(clusterqueuesResource, clusterQueue), &v1beta1.ClusterQueue{})
+ Invokes(testing.NewRootCreateActionWithOptions(clusterqueuesResource, clusterQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ClusterQueue), err
}
// Update takes the representation of a clusterQueue and updates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
func (c *FakeClusterQueues) Update(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(clusterqueuesResource, clusterQueue), &v1beta1.ClusterQueue{})
+ Invokes(testing.NewRootUpdateActionWithOptions(clusterqueuesResource, clusterQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ClusterQueue), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeClusterQueues) UpdateStatus(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (*v1beta1.ClusterQueue, error) {
+func (c *FakeClusterQueues) UpdateStatus(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(clusterqueuesResource, "status", clusterQueue), &v1beta1.ClusterQueue{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusterqueuesResource, "status", clusterQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ClusterQueue), err
}
@@ -117,7 +122,7 @@ func (c *FakeClusterQueues) Delete(ctx context.Context, name string, opts v1.Del
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(clusterqueuesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(clusterqueuesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.ClusterQueueList{})
return err
@@ -125,10 +130,11 @@ func (c *FakeClusterQueues) DeleteCollection(ctx context.Context, opts v1.Delete
// Patch applies the patch and returns the patched clusterQueue.
func (c *FakeClusterQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterqueuesResource, name, pt, data, subresources...), &v1beta1.ClusterQueue{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterqueuesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ClusterQueue), err
}
@@ -146,10 +152,11 @@ func (c *FakeClusterQueues) Apply(ctx context.Context, clusterQueue *kueuev1beta
if name == nil {
return nil, fmt.Errorf("clusterQueue.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterqueuesResource, *name, types.ApplyPatchType, data), &v1beta1.ClusterQueue{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterqueuesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ClusterQueue), err
}
@@ -168,10 +175,11 @@ func (c *FakeClusterQueues) ApplyStatus(ctx context.Context, clusterQueue *kueue
if name == nil {
return nil, fmt.Errorf("clusterQueue.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterqueuesResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.ClusterQueue{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterqueuesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ClusterQueue), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_kueue_client.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_kueue_client.go
index e027e237b31..e3f5e88609b 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_kueue_client.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_kueue_client.go
@@ -39,6 +39,14 @@ func (c *FakeKueueV1beta1) LocalQueues(namespace string) v1beta1.LocalQueueInter
return &FakeLocalQueues{c, namespace}
}
+func (c *FakeKueueV1beta1) MultiKueueClusters() v1beta1.MultiKueueClusterInterface {
+ return &FakeMultiKueueClusters{c}
+}
+
+func (c *FakeKueueV1beta1) MultiKueueConfigs() v1beta1.MultiKueueConfigInterface {
+ return &FakeMultiKueueConfigs{c}
+}
+
func (c *FakeKueueV1beta1) ProvisioningRequestConfigs() v1beta1.ProvisioningRequestConfigInterface {
return &FakeProvisioningRequestConfigs{c}
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_localqueue.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_localqueue.go
index 65db9ec7a49..dea18a40bf2 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_localqueue.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_localqueue.go
@@ -43,22 +43,24 @@ var localqueuesKind = v1beta1.SchemeGroupVersion.WithKind("LocalQueue")
// Get takes name of the localQueue, and returns the corresponding localQueue object, and an error if there is any.
func (c *FakeLocalQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(localqueuesResource, c.ns, name), &v1beta1.LocalQueue{})
+ Invokes(testing.NewGetActionWithOptions(localqueuesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.LocalQueue), err
}
// List takes label and field selectors, and returns the list of LocalQueues that match those selectors.
func (c *FakeLocalQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LocalQueueList, err error) {
+ emptyResult := &v1beta1.LocalQueueList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(localqueuesResource, localqueuesKind, c.ns, opts), &v1beta1.LocalQueueList{})
+ Invokes(testing.NewListActionWithOptions(localqueuesResource, localqueuesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -77,40 +79,43 @@ func (c *FakeLocalQueues) List(ctx context.Context, opts v1.ListOptions) (result
// Watch returns a watch.Interface that watches the requested localQueues.
func (c *FakeLocalQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(localqueuesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(localqueuesResource, c.ns, opts))
}
// Create takes the representation of a localQueue and creates it. Returns the server's representation of the localQueue, and an error, if there is any.
func (c *FakeLocalQueues) Create(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.CreateOptions) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(localqueuesResource, c.ns, localQueue), &v1beta1.LocalQueue{})
+ Invokes(testing.NewCreateActionWithOptions(localqueuesResource, c.ns, localQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.LocalQueue), err
}
// Update takes the representation of a localQueue and updates it. Returns the server's representation of the localQueue, and an error, if there is any.
func (c *FakeLocalQueues) Update(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(localqueuesResource, c.ns, localQueue), &v1beta1.LocalQueue{})
+ Invokes(testing.NewUpdateActionWithOptions(localqueuesResource, c.ns, localQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.LocalQueue), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeLocalQueues) UpdateStatus(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (*v1beta1.LocalQueue, error) {
+func (c *FakeLocalQueues) UpdateStatus(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateSubresourceAction(localqueuesResource, "status", c.ns, localQueue), &v1beta1.LocalQueue{})
+ Invokes(testing.NewUpdateSubresourceActionWithOptions(localqueuesResource, "status", c.ns, localQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.LocalQueue), err
}
@@ -125,7 +130,7 @@ func (c *FakeLocalQueues) Delete(ctx context.Context, name string, opts v1.Delet
// DeleteCollection deletes a collection of objects.
func (c *FakeLocalQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(localqueuesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(localqueuesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.LocalQueueList{})
return err
@@ -133,11 +138,12 @@ func (c *FakeLocalQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOp
// Patch applies the patch and returns the patched localQueue.
func (c *FakeLocalQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(localqueuesResource, c.ns, name, pt, data, subresources...), &v1beta1.LocalQueue{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(localqueuesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.LocalQueue), err
}
@@ -155,11 +161,12 @@ func (c *FakeLocalQueues) Apply(ctx context.Context, localQueue *kueuev1beta1.Lo
if name == nil {
return nil, fmt.Errorf("localQueue.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(localqueuesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.LocalQueue{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(localqueuesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.LocalQueue), err
}
@@ -178,11 +185,12 @@ func (c *FakeLocalQueues) ApplyStatus(ctx context.Context, localQueue *kueuev1be
if name == nil {
return nil, fmt.Errorf("localQueue.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(localqueuesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.LocalQueue{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(localqueuesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.LocalQueue), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_multikueuecluster.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_multikueuecluster.go
similarity index 55%
rename from client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_multikueuecluster.go
rename to client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_multikueuecluster.go
index 70509a5bf9f..80caf792aff 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_multikueuecluster.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_multikueuecluster.go
@@ -27,43 +27,45 @@ import (
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
- kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
)
// FakeMultiKueueClusters implements MultiKueueClusterInterface
type FakeMultiKueueClusters struct {
- Fake *FakeKueueV1alpha1
+ Fake *FakeKueueV1beta1
}
-var multikueueclustersResource = v1alpha1.SchemeGroupVersion.WithResource("multikueueclusters")
+var multikueueclustersResource = v1beta1.SchemeGroupVersion.WithResource("multikueueclusters")
-var multikueueclustersKind = v1alpha1.SchemeGroupVersion.WithKind("MultiKueueCluster")
+var multikueueclustersKind = v1beta1.SchemeGroupVersion.WithKind("MultiKueueCluster")
// Get takes name of the multiKueueCluster, and returns the corresponding multiKueueCluster object, and an error if there is any.
-func (c *FakeMultiKueueClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MultiKueueCluster, err error) {
+func (c *FakeMultiKueueClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MultiKueueCluster, err error) {
+ emptyResult := &v1beta1.MultiKueueCluster{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(multikueueclustersResource, name), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootGetActionWithOptions(multikueueclustersResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueCluster), err
+ return obj.(*v1beta1.MultiKueueCluster), err
}
// List takes label and field selectors, and returns the list of MultiKueueClusters that match those selectors.
-func (c *FakeMultiKueueClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MultiKueueClusterList, err error) {
+func (c *FakeMultiKueueClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MultiKueueClusterList, err error) {
+ emptyResult := &v1beta1.MultiKueueClusterList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(multikueueclustersResource, multikueueclustersKind, opts), &v1alpha1.MultiKueueClusterList{})
+ Invokes(testing.NewRootListActionWithOptions(multikueueclustersResource, multikueueclustersKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
- list := &v1alpha1.MultiKueueClusterList{ListMeta: obj.(*v1alpha1.MultiKueueClusterList).ListMeta}
- for _, item := range obj.(*v1alpha1.MultiKueueClusterList).Items {
+ list := &v1beta1.MultiKueueClusterList{ListMeta: obj.(*v1beta1.MultiKueueClusterList).ListMeta}
+ for _, item := range obj.(*v1beta1.MultiKueueClusterList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@@ -74,67 +76,71 @@ func (c *FakeMultiKueueClusters) List(ctx context.Context, opts v1.ListOptions)
// Watch returns a watch.Interface that watches the requested multiKueueClusters.
func (c *FakeMultiKueueClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(multikueueclustersResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(multikueueclustersResource, opts))
}
// Create takes the representation of a multiKueueCluster and creates it. Returns the server's representation of the multiKueueCluster, and an error, if there is any.
-func (c *FakeMultiKueueClusters) Create(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.CreateOptions) (result *v1alpha1.MultiKueueCluster, err error) {
+func (c *FakeMultiKueueClusters) Create(ctx context.Context, multiKueueCluster *v1beta1.MultiKueueCluster, opts v1.CreateOptions) (result *v1beta1.MultiKueueCluster, err error) {
+ emptyResult := &v1beta1.MultiKueueCluster{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(multikueueclustersResource, multiKueueCluster), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootCreateActionWithOptions(multikueueclustersResource, multiKueueCluster, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueCluster), err
+ return obj.(*v1beta1.MultiKueueCluster), err
}
// Update takes the representation of a multiKueueCluster and updates it. Returns the server's representation of the multiKueueCluster, and an error, if there is any.
-func (c *FakeMultiKueueClusters) Update(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.UpdateOptions) (result *v1alpha1.MultiKueueCluster, err error) {
+func (c *FakeMultiKueueClusters) Update(ctx context.Context, multiKueueCluster *v1beta1.MultiKueueCluster, opts v1.UpdateOptions) (result *v1beta1.MultiKueueCluster, err error) {
+ emptyResult := &v1beta1.MultiKueueCluster{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(multikueueclustersResource, multiKueueCluster), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootUpdateActionWithOptions(multikueueclustersResource, multiKueueCluster, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueCluster), err
+ return obj.(*v1beta1.MultiKueueCluster), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeMultiKueueClusters) UpdateStatus(ctx context.Context, multiKueueCluster *v1alpha1.MultiKueueCluster, opts v1.UpdateOptions) (*v1alpha1.MultiKueueCluster, error) {
+func (c *FakeMultiKueueClusters) UpdateStatus(ctx context.Context, multiKueueCluster *v1beta1.MultiKueueCluster, opts v1.UpdateOptions) (result *v1beta1.MultiKueueCluster, err error) {
+ emptyResult := &v1beta1.MultiKueueCluster{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(multikueueclustersResource, "status", multiKueueCluster), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(multikueueclustersResource, "status", multiKueueCluster, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueCluster), err
+ return obj.(*v1beta1.MultiKueueCluster), err
}
// Delete takes name of the multiKueueCluster and deletes it. Returns an error if one occurs.
func (c *FakeMultiKueueClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
- Invokes(testing.NewRootDeleteActionWithOptions(multikueueclustersResource, name, opts), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootDeleteActionWithOptions(multikueueclustersResource, name, opts), &v1beta1.MultiKueueCluster{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeMultiKueueClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(multikueueclustersResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(multikueueclustersResource, opts, listOpts)
- _, err := c.Fake.Invokes(action, &v1alpha1.MultiKueueClusterList{})
+ _, err := c.Fake.Invokes(action, &v1beta1.MultiKueueClusterList{})
return err
}
// Patch applies the patch and returns the patched multiKueueCluster.
-func (c *FakeMultiKueueClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MultiKueueCluster, err error) {
+func (c *FakeMultiKueueClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MultiKueueCluster, err error) {
+ emptyResult := &v1beta1.MultiKueueCluster{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(multikueueclustersResource, name, pt, data, subresources...), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(multikueueclustersResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueCluster), err
+ return obj.(*v1beta1.MultiKueueCluster), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied multiKueueCluster.
-func (c *FakeMultiKueueClusters) Apply(ctx context.Context, multiKueueCluster *kueuev1alpha1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueCluster, err error) {
+func (c *FakeMultiKueueClusters) Apply(ctx context.Context, multiKueueCluster *kueuev1beta1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MultiKueueCluster, err error) {
if multiKueueCluster == nil {
return nil, fmt.Errorf("multiKueueCluster provided to Apply must not be nil")
}
@@ -146,17 +152,18 @@ func (c *FakeMultiKueueClusters) Apply(ctx context.Context, multiKueueCluster *k
if name == nil {
return nil, fmt.Errorf("multiKueueCluster.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.MultiKueueCluster{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(multikueueclustersResource, *name, types.ApplyPatchType, data), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(multikueueclustersResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueCluster), err
+ return obj.(*v1beta1.MultiKueueCluster), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *FakeMultiKueueClusters) ApplyStatus(ctx context.Context, multiKueueCluster *kueuev1alpha1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueCluster, err error) {
+func (c *FakeMultiKueueClusters) ApplyStatus(ctx context.Context, multiKueueCluster *kueuev1beta1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MultiKueueCluster, err error) {
if multiKueueCluster == nil {
return nil, fmt.Errorf("multiKueueCluster provided to Apply must not be nil")
}
@@ -168,10 +175,11 @@ func (c *FakeMultiKueueClusters) ApplyStatus(ctx context.Context, multiKueueClus
if name == nil {
return nil, fmt.Errorf("multiKueueCluster.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.MultiKueueCluster{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(multikueueclustersResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.MultiKueueCluster{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(multikueueclustersResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueCluster), err
+ return obj.(*v1beta1.MultiKueueCluster), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_multikueueconfig.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_multikueueconfig.go
similarity index 57%
rename from client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_multikueueconfig.go
rename to client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_multikueueconfig.go
index 4a256e025b3..04dbce18a8f 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_multikueueconfig.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_multikueueconfig.go
@@ -27,43 +27,45 @@ import (
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
- kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
)
// FakeMultiKueueConfigs implements MultiKueueConfigInterface
type FakeMultiKueueConfigs struct {
- Fake *FakeKueueV1alpha1
+ Fake *FakeKueueV1beta1
}
-var multikueueconfigsResource = v1alpha1.SchemeGroupVersion.WithResource("multikueueconfigs")
+var multikueueconfigsResource = v1beta1.SchemeGroupVersion.WithResource("multikueueconfigs")
-var multikueueconfigsKind = v1alpha1.SchemeGroupVersion.WithKind("MultiKueueConfig")
+var multikueueconfigsKind = v1beta1.SchemeGroupVersion.WithKind("MultiKueueConfig")
// Get takes name of the multiKueueConfig, and returns the corresponding multiKueueConfig object, and an error if there is any.
-func (c *FakeMultiKueueConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MultiKueueConfig, err error) {
+func (c *FakeMultiKueueConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MultiKueueConfig, err error) {
+ emptyResult := &v1beta1.MultiKueueConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(multikueueconfigsResource, name), &v1alpha1.MultiKueueConfig{})
+ Invokes(testing.NewRootGetActionWithOptions(multikueueconfigsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueConfig), err
+ return obj.(*v1beta1.MultiKueueConfig), err
}
// List takes label and field selectors, and returns the list of MultiKueueConfigs that match those selectors.
-func (c *FakeMultiKueueConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MultiKueueConfigList, err error) {
+func (c *FakeMultiKueueConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MultiKueueConfigList, err error) {
+ emptyResult := &v1beta1.MultiKueueConfigList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(multikueueconfigsResource, multikueueconfigsKind, opts), &v1alpha1.MultiKueueConfigList{})
+ Invokes(testing.NewRootListActionWithOptions(multikueueconfigsResource, multikueueconfigsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
- list := &v1alpha1.MultiKueueConfigList{ListMeta: obj.(*v1alpha1.MultiKueueConfigList).ListMeta}
- for _, item := range obj.(*v1alpha1.MultiKueueConfigList).Items {
+ list := &v1beta1.MultiKueueConfigList{ListMeta: obj.(*v1beta1.MultiKueueConfigList).ListMeta}
+ for _, item := range obj.(*v1beta1.MultiKueueConfigList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@@ -74,56 +76,59 @@ func (c *FakeMultiKueueConfigs) List(ctx context.Context, opts v1.ListOptions) (
// Watch returns a watch.Interface that watches the requested multiKueueConfigs.
func (c *FakeMultiKueueConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(multikueueconfigsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(multikueueconfigsResource, opts))
}
// Create takes the representation of a multiKueueConfig and creates it. Returns the server's representation of the multiKueueConfig, and an error, if there is any.
-func (c *FakeMultiKueueConfigs) Create(ctx context.Context, multiKueueConfig *v1alpha1.MultiKueueConfig, opts v1.CreateOptions) (result *v1alpha1.MultiKueueConfig, err error) {
+func (c *FakeMultiKueueConfigs) Create(ctx context.Context, multiKueueConfig *v1beta1.MultiKueueConfig, opts v1.CreateOptions) (result *v1beta1.MultiKueueConfig, err error) {
+ emptyResult := &v1beta1.MultiKueueConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(multikueueconfigsResource, multiKueueConfig), &v1alpha1.MultiKueueConfig{})
+ Invokes(testing.NewRootCreateActionWithOptions(multikueueconfigsResource, multiKueueConfig, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueConfig), err
+ return obj.(*v1beta1.MultiKueueConfig), err
}
// Update takes the representation of a multiKueueConfig and updates it. Returns the server's representation of the multiKueueConfig, and an error, if there is any.
-func (c *FakeMultiKueueConfigs) Update(ctx context.Context, multiKueueConfig *v1alpha1.MultiKueueConfig, opts v1.UpdateOptions) (result *v1alpha1.MultiKueueConfig, err error) {
+func (c *FakeMultiKueueConfigs) Update(ctx context.Context, multiKueueConfig *v1beta1.MultiKueueConfig, opts v1.UpdateOptions) (result *v1beta1.MultiKueueConfig, err error) {
+ emptyResult := &v1beta1.MultiKueueConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(multikueueconfigsResource, multiKueueConfig), &v1alpha1.MultiKueueConfig{})
+ Invokes(testing.NewRootUpdateActionWithOptions(multikueueconfigsResource, multiKueueConfig, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueConfig), err
+ return obj.(*v1beta1.MultiKueueConfig), err
}
// Delete takes name of the multiKueueConfig and deletes it. Returns an error if one occurs.
func (c *FakeMultiKueueConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
- Invokes(testing.NewRootDeleteActionWithOptions(multikueueconfigsResource, name, opts), &v1alpha1.MultiKueueConfig{})
+ Invokes(testing.NewRootDeleteActionWithOptions(multikueueconfigsResource, name, opts), &v1beta1.MultiKueueConfig{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeMultiKueueConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(multikueueconfigsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(multikueueconfigsResource, opts, listOpts)
- _, err := c.Fake.Invokes(action, &v1alpha1.MultiKueueConfigList{})
+ _, err := c.Fake.Invokes(action, &v1beta1.MultiKueueConfigList{})
return err
}
// Patch applies the patch and returns the patched multiKueueConfig.
-func (c *FakeMultiKueueConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MultiKueueConfig, err error) {
+func (c *FakeMultiKueueConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MultiKueueConfig, err error) {
+ emptyResult := &v1beta1.MultiKueueConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(multikueueconfigsResource, name, pt, data, subresources...), &v1alpha1.MultiKueueConfig{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(multikueueconfigsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueConfig), err
+ return obj.(*v1beta1.MultiKueueConfig), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied multiKueueConfig.
-func (c *FakeMultiKueueConfigs) Apply(ctx context.Context, multiKueueConfig *kueuev1alpha1.MultiKueueConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MultiKueueConfig, err error) {
+func (c *FakeMultiKueueConfigs) Apply(ctx context.Context, multiKueueConfig *kueuev1beta1.MultiKueueConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MultiKueueConfig, err error) {
if multiKueueConfig == nil {
return nil, fmt.Errorf("multiKueueConfig provided to Apply must not be nil")
}
@@ -135,10 +140,11 @@ func (c *FakeMultiKueueConfigs) Apply(ctx context.Context, multiKueueConfig *kue
if name == nil {
return nil, fmt.Errorf("multiKueueConfig.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.MultiKueueConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(multikueueconfigsResource, *name, types.ApplyPatchType, data), &v1alpha1.MultiKueueConfig{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(multikueueconfigsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
- return obj.(*v1alpha1.MultiKueueConfig), err
+ return obj.(*v1beta1.MultiKueueConfig), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_provisioningrequestconfig.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_provisioningrequestconfig.go
index 0947cd10813..ab3507d6457 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_provisioningrequestconfig.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_provisioningrequestconfig.go
@@ -42,20 +42,22 @@ var provisioningrequestconfigsKind = v1beta1.SchemeGroupVersion.WithKind("Provis
// Get takes name of the provisioningRequestConfig, and returns the corresponding provisioningRequestConfig object, and an error if there is any.
func (c *FakeProvisioningRequestConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ProvisioningRequestConfig, err error) {
+ emptyResult := &v1beta1.ProvisioningRequestConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(provisioningrequestconfigsResource, name), &v1beta1.ProvisioningRequestConfig{})
+ Invokes(testing.NewRootGetActionWithOptions(provisioningrequestconfigsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ProvisioningRequestConfig), err
}
// List takes label and field selectors, and returns the list of ProvisioningRequestConfigs that match those selectors.
func (c *FakeProvisioningRequestConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ProvisioningRequestConfigList, err error) {
+ emptyResult := &v1beta1.ProvisioningRequestConfigList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(provisioningrequestconfigsResource, provisioningrequestconfigsKind, opts), &v1beta1.ProvisioningRequestConfigList{})
+ Invokes(testing.NewRootListActionWithOptions(provisioningrequestconfigsResource, provisioningrequestconfigsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,25 +76,27 @@ func (c *FakeProvisioningRequestConfigs) List(ctx context.Context, opts v1.ListO
// Watch returns a watch.Interface that watches the requested provisioningRequestConfigs.
func (c *FakeProvisioningRequestConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(provisioningrequestconfigsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(provisioningrequestconfigsResource, opts))
}
// Create takes the representation of a provisioningRequestConfig and creates it. Returns the server's representation of the provisioningRequestConfig, and an error, if there is any.
func (c *FakeProvisioningRequestConfigs) Create(ctx context.Context, provisioningRequestConfig *v1beta1.ProvisioningRequestConfig, opts v1.CreateOptions) (result *v1beta1.ProvisioningRequestConfig, err error) {
+ emptyResult := &v1beta1.ProvisioningRequestConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(provisioningrequestconfigsResource, provisioningRequestConfig), &v1beta1.ProvisioningRequestConfig{})
+ Invokes(testing.NewRootCreateActionWithOptions(provisioningrequestconfigsResource, provisioningRequestConfig, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ProvisioningRequestConfig), err
}
// Update takes the representation of a provisioningRequestConfig and updates it. Returns the server's representation of the provisioningRequestConfig, and an error, if there is any.
func (c *FakeProvisioningRequestConfigs) Update(ctx context.Context, provisioningRequestConfig *v1beta1.ProvisioningRequestConfig, opts v1.UpdateOptions) (result *v1beta1.ProvisioningRequestConfig, err error) {
+ emptyResult := &v1beta1.ProvisioningRequestConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(provisioningrequestconfigsResource, provisioningRequestConfig), &v1beta1.ProvisioningRequestConfig{})
+ Invokes(testing.NewRootUpdateActionWithOptions(provisioningrequestconfigsResource, provisioningRequestConfig, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ProvisioningRequestConfig), err
}
@@ -106,7 +110,7 @@ func (c *FakeProvisioningRequestConfigs) Delete(ctx context.Context, name string
// DeleteCollection deletes a collection of objects.
func (c *FakeProvisioningRequestConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(provisioningrequestconfigsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(provisioningrequestconfigsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.ProvisioningRequestConfigList{})
return err
@@ -114,10 +118,11 @@ func (c *FakeProvisioningRequestConfigs) DeleteCollection(ctx context.Context, o
// Patch applies the patch and returns the patched provisioningRequestConfig.
func (c *FakeProvisioningRequestConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ProvisioningRequestConfig, err error) {
+ emptyResult := &v1beta1.ProvisioningRequestConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(provisioningrequestconfigsResource, name, pt, data, subresources...), &v1beta1.ProvisioningRequestConfig{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(provisioningrequestconfigsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ProvisioningRequestConfig), err
}
@@ -135,10 +140,11 @@ func (c *FakeProvisioningRequestConfigs) Apply(ctx context.Context, provisioning
if name == nil {
return nil, fmt.Errorf("provisioningRequestConfig.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.ProvisioningRequestConfig{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(provisioningrequestconfigsResource, *name, types.ApplyPatchType, data), &v1beta1.ProvisioningRequestConfig{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(provisioningrequestconfigsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ProvisioningRequestConfig), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_resourceflavor.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_resourceflavor.go
index 1803c75a288..55acf482ddd 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_resourceflavor.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_resourceflavor.go
@@ -42,20 +42,22 @@ var resourceflavorsKind = v1beta1.SchemeGroupVersion.WithKind("ResourceFlavor")
// Get takes name of the resourceFlavor, and returns the corresponding resourceFlavor object, and an error if there is any.
func (c *FakeResourceFlavors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ResourceFlavor, err error) {
+ emptyResult := &v1beta1.ResourceFlavor{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(resourceflavorsResource, name), &v1beta1.ResourceFlavor{})
+ Invokes(testing.NewRootGetActionWithOptions(resourceflavorsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ResourceFlavor), err
}
// List takes label and field selectors, and returns the list of ResourceFlavors that match those selectors.
func (c *FakeResourceFlavors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ResourceFlavorList, err error) {
+ emptyResult := &v1beta1.ResourceFlavorList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(resourceflavorsResource, resourceflavorsKind, opts), &v1beta1.ResourceFlavorList{})
+ Invokes(testing.NewRootListActionWithOptions(resourceflavorsResource, resourceflavorsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,25 +76,27 @@ func (c *FakeResourceFlavors) List(ctx context.Context, opts v1.ListOptions) (re
// Watch returns a watch.Interface that watches the requested resourceFlavors.
func (c *FakeResourceFlavors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(resourceflavorsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(resourceflavorsResource, opts))
}
// Create takes the representation of a resourceFlavor and creates it. Returns the server's representation of the resourceFlavor, and an error, if there is any.
func (c *FakeResourceFlavors) Create(ctx context.Context, resourceFlavor *v1beta1.ResourceFlavor, opts v1.CreateOptions) (result *v1beta1.ResourceFlavor, err error) {
+ emptyResult := &v1beta1.ResourceFlavor{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(resourceflavorsResource, resourceFlavor), &v1beta1.ResourceFlavor{})
+ Invokes(testing.NewRootCreateActionWithOptions(resourceflavorsResource, resourceFlavor, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ResourceFlavor), err
}
// Update takes the representation of a resourceFlavor and updates it. Returns the server's representation of the resourceFlavor, and an error, if there is any.
func (c *FakeResourceFlavors) Update(ctx context.Context, resourceFlavor *v1beta1.ResourceFlavor, opts v1.UpdateOptions) (result *v1beta1.ResourceFlavor, err error) {
+ emptyResult := &v1beta1.ResourceFlavor{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(resourceflavorsResource, resourceFlavor), &v1beta1.ResourceFlavor{})
+ Invokes(testing.NewRootUpdateActionWithOptions(resourceflavorsResource, resourceFlavor, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ResourceFlavor), err
}
@@ -106,7 +110,7 @@ func (c *FakeResourceFlavors) Delete(ctx context.Context, name string, opts v1.D
// DeleteCollection deletes a collection of objects.
func (c *FakeResourceFlavors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(resourceflavorsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(resourceflavorsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.ResourceFlavorList{})
return err
@@ -114,10 +118,11 @@ func (c *FakeResourceFlavors) DeleteCollection(ctx context.Context, opts v1.Dele
// Patch applies the patch and returns the patched resourceFlavor.
func (c *FakeResourceFlavors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ResourceFlavor, err error) {
+ emptyResult := &v1beta1.ResourceFlavor{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(resourceflavorsResource, name, pt, data, subresources...), &v1beta1.ResourceFlavor{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceflavorsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ResourceFlavor), err
}
@@ -135,10 +140,11 @@ func (c *FakeResourceFlavors) Apply(ctx context.Context, resourceFlavor *kueuev1
if name == nil {
return nil, fmt.Errorf("resourceFlavor.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.ResourceFlavor{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(resourceflavorsResource, *name, types.ApplyPatchType, data), &v1beta1.ResourceFlavor{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceflavorsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.ResourceFlavor), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workload.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workload.go
index 7e797ae411e..c2fdbd764fb 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workload.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workload.go
@@ -43,22 +43,24 @@ var workloadsKind = v1beta1.SchemeGroupVersion.WithKind("Workload")
// Get takes name of the workload, and returns the corresponding workload object, and an error if there is any.
func (c *FakeWorkloads) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Workload, err error) {
+ emptyResult := &v1beta1.Workload{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(workloadsResource, c.ns, name), &v1beta1.Workload{})
+ Invokes(testing.NewGetActionWithOptions(workloadsResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.Workload), err
}
// List takes label and field selectors, and returns the list of Workloads that match those selectors.
func (c *FakeWorkloads) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.WorkloadList, err error) {
+ emptyResult := &v1beta1.WorkloadList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(workloadsResource, workloadsKind, c.ns, opts), &v1beta1.WorkloadList{})
+ Invokes(testing.NewListActionWithOptions(workloadsResource, workloadsKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -77,40 +79,43 @@ func (c *FakeWorkloads) List(ctx context.Context, opts v1.ListOptions) (result *
// Watch returns a watch.Interface that watches the requested workloads.
func (c *FakeWorkloads) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(workloadsResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(workloadsResource, c.ns, opts))
}
// Create takes the representation of a workload and creates it. Returns the server's representation of the workload, and an error, if there is any.
func (c *FakeWorkloads) Create(ctx context.Context, workload *v1beta1.Workload, opts v1.CreateOptions) (result *v1beta1.Workload, err error) {
+ emptyResult := &v1beta1.Workload{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(workloadsResource, c.ns, workload), &v1beta1.Workload{})
+ Invokes(testing.NewCreateActionWithOptions(workloadsResource, c.ns, workload, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.Workload), err
}
// Update takes the representation of a workload and updates it. Returns the server's representation of the workload, and an error, if there is any.
func (c *FakeWorkloads) Update(ctx context.Context, workload *v1beta1.Workload, opts v1.UpdateOptions) (result *v1beta1.Workload, err error) {
+ emptyResult := &v1beta1.Workload{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(workloadsResource, c.ns, workload), &v1beta1.Workload{})
+ Invokes(testing.NewUpdateActionWithOptions(workloadsResource, c.ns, workload, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.Workload), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeWorkloads) UpdateStatus(ctx context.Context, workload *v1beta1.Workload, opts v1.UpdateOptions) (*v1beta1.Workload, error) {
+func (c *FakeWorkloads) UpdateStatus(ctx context.Context, workload *v1beta1.Workload, opts v1.UpdateOptions) (result *v1beta1.Workload, err error) {
+ emptyResult := &v1beta1.Workload{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateSubresourceAction(workloadsResource, "status", c.ns, workload), &v1beta1.Workload{})
+ Invokes(testing.NewUpdateSubresourceActionWithOptions(workloadsResource, "status", c.ns, workload, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.Workload), err
}
@@ -125,7 +130,7 @@ func (c *FakeWorkloads) Delete(ctx context.Context, name string, opts v1.DeleteO
// DeleteCollection deletes a collection of objects.
func (c *FakeWorkloads) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(workloadsResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(workloadsResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.WorkloadList{})
return err
@@ -133,11 +138,12 @@ func (c *FakeWorkloads) DeleteCollection(ctx context.Context, opts v1.DeleteOpti
// Patch applies the patch and returns the patched workload.
func (c *FakeWorkloads) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Workload, err error) {
+ emptyResult := &v1beta1.Workload{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(workloadsResource, c.ns, name, pt, data, subresources...), &v1beta1.Workload{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(workloadsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.Workload), err
}
@@ -155,11 +161,12 @@ func (c *FakeWorkloads) Apply(ctx context.Context, workload *kueuev1beta1.Worklo
if name == nil {
return nil, fmt.Errorf("workload.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.Workload{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(workloadsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Workload{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(workloadsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.Workload), err
}
@@ -178,11 +185,12 @@ func (c *FakeWorkloads) ApplyStatus(ctx context.Context, workload *kueuev1beta1.
if name == nil {
return nil, fmt.Errorf("workload.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.Workload{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(workloadsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Workload{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(workloadsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.Workload), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workloadpriorityclass.go b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workloadpriorityclass.go
index 5f954a92355..fa76fd4ce26 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workloadpriorityclass.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/fake/fake_workloadpriorityclass.go
@@ -42,20 +42,22 @@ var workloadpriorityclassesKind = v1beta1.SchemeGroupVersion.WithKind("WorkloadP
// Get takes name of the workloadPriorityClass, and returns the corresponding workloadPriorityClass object, and an error if there is any.
func (c *FakeWorkloadPriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.WorkloadPriorityClass, err error) {
+ emptyResult := &v1beta1.WorkloadPriorityClass{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(workloadpriorityclassesResource, name), &v1beta1.WorkloadPriorityClass{})
+ Invokes(testing.NewRootGetActionWithOptions(workloadpriorityclassesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.WorkloadPriorityClass), err
}
// List takes label and field selectors, and returns the list of WorkloadPriorityClasses that match those selectors.
func (c *FakeWorkloadPriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.WorkloadPriorityClassList, err error) {
+ emptyResult := &v1beta1.WorkloadPriorityClassList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(workloadpriorityclassesResource, workloadpriorityclassesKind, opts), &v1beta1.WorkloadPriorityClassList{})
+ Invokes(testing.NewRootListActionWithOptions(workloadpriorityclassesResource, workloadpriorityclassesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,25 +76,27 @@ func (c *FakeWorkloadPriorityClasses) List(ctx context.Context, opts v1.ListOpti
// Watch returns a watch.Interface that watches the requested workloadPriorityClasses.
func (c *FakeWorkloadPriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(workloadpriorityclassesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(workloadpriorityclassesResource, opts))
}
// Create takes the representation of a workloadPriorityClass and creates it. Returns the server's representation of the workloadPriorityClass, and an error, if there is any.
func (c *FakeWorkloadPriorityClasses) Create(ctx context.Context, workloadPriorityClass *v1beta1.WorkloadPriorityClass, opts v1.CreateOptions) (result *v1beta1.WorkloadPriorityClass, err error) {
+ emptyResult := &v1beta1.WorkloadPriorityClass{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(workloadpriorityclassesResource, workloadPriorityClass), &v1beta1.WorkloadPriorityClass{})
+ Invokes(testing.NewRootCreateActionWithOptions(workloadpriorityclassesResource, workloadPriorityClass, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.WorkloadPriorityClass), err
}
// Update takes the representation of a workloadPriorityClass and updates it. Returns the server's representation of the workloadPriorityClass, and an error, if there is any.
func (c *FakeWorkloadPriorityClasses) Update(ctx context.Context, workloadPriorityClass *v1beta1.WorkloadPriorityClass, opts v1.UpdateOptions) (result *v1beta1.WorkloadPriorityClass, err error) {
+ emptyResult := &v1beta1.WorkloadPriorityClass{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(workloadpriorityclassesResource, workloadPriorityClass), &v1beta1.WorkloadPriorityClass{})
+ Invokes(testing.NewRootUpdateActionWithOptions(workloadpriorityclassesResource, workloadPriorityClass, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.WorkloadPriorityClass), err
}
@@ -106,7 +110,7 @@ func (c *FakeWorkloadPriorityClasses) Delete(ctx context.Context, name string, o
// DeleteCollection deletes a collection of objects.
func (c *FakeWorkloadPriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(workloadpriorityclassesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(workloadpriorityclassesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.WorkloadPriorityClassList{})
return err
@@ -114,10 +118,11 @@ func (c *FakeWorkloadPriorityClasses) DeleteCollection(ctx context.Context, opts
// Patch applies the patch and returns the patched workloadPriorityClass.
func (c *FakeWorkloadPriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.WorkloadPriorityClass, err error) {
+ emptyResult := &v1beta1.WorkloadPriorityClass{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(workloadpriorityclassesResource, name, pt, data, subresources...), &v1beta1.WorkloadPriorityClass{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(workloadpriorityclassesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.WorkloadPriorityClass), err
}
@@ -135,10 +140,11 @@ func (c *FakeWorkloadPriorityClasses) Apply(ctx context.Context, workloadPriorit
if name == nil {
return nil, fmt.Errorf("workloadPriorityClass.Name must be provided to Apply")
}
+ emptyResult := &v1beta1.WorkloadPriorityClass{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(workloadpriorityclassesResource, *name, types.ApplyPatchType, data), &v1beta1.WorkloadPriorityClass{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(workloadpriorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1beta1.WorkloadPriorityClass), err
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/generated_expansion.go b/client-go/clientset/versioned/typed/kueue/v1beta1/generated_expansion.go
index 31cc618f47f..78f0443a7c2 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/generated_expansion.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/generated_expansion.go
@@ -23,6 +23,10 @@ type ClusterQueueExpansion interface{}
type LocalQueueExpansion interface{}
+type MultiKueueClusterExpansion interface{}
+
+type MultiKueueConfigExpansion interface{}
+
type ProvisioningRequestConfigExpansion interface{}
type ResourceFlavorExpansion interface{}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/kueue_client.go b/client-go/clientset/versioned/typed/kueue/v1beta1/kueue_client.go
index f60e1c8aa56..24c724c4180 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/kueue_client.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/kueue_client.go
@@ -30,6 +30,8 @@ type KueueV1beta1Interface interface {
AdmissionChecksGetter
ClusterQueuesGetter
LocalQueuesGetter
+ MultiKueueClustersGetter
+ MultiKueueConfigsGetter
ProvisioningRequestConfigsGetter
ResourceFlavorsGetter
WorkloadsGetter
@@ -53,6 +55,14 @@ func (c *KueueV1beta1Client) LocalQueues(namespace string) LocalQueueInterface {
return newLocalQueues(c, namespace)
}
+func (c *KueueV1beta1Client) MultiKueueClusters() MultiKueueClusterInterface {
+ return newMultiKueueClusters(c)
+}
+
+func (c *KueueV1beta1Client) MultiKueueConfigs() MultiKueueConfigInterface {
+ return newMultiKueueConfigs(c)
+}
+
func (c *KueueV1beta1Client) ProvisioningRequestConfigs() ProvisioningRequestConfigInterface {
return newProvisioningRequestConfigs(c)
}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/localqueue.go b/client-go/clientset/versioned/typed/kueue/v1beta1/localqueue.go
index ad802f5215e..2a3a862bece 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/localqueue.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/localqueue.go
@@ -19,14 +19,11 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -42,6 +39,7 @@ type LocalQueuesGetter interface {
type LocalQueueInterface interface {
Create(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.CreateOptions) (*v1beta1.LocalQueue, error)
Update(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (*v1beta1.LocalQueue, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (*v1beta1.LocalQueue, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -50,206 +48,25 @@ type LocalQueueInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.LocalQueue, err error)
Apply(ctx context.Context, localQueue *kueuev1beta1.LocalQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.LocalQueue, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, localQueue *kueuev1beta1.LocalQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.LocalQueue, err error)
LocalQueueExpansion
}
// localQueues implements LocalQueueInterface
type localQueues struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithListAndApply[*v1beta1.LocalQueue, *v1beta1.LocalQueueList, *kueuev1beta1.LocalQueueApplyConfiguration]
}
// newLocalQueues returns a LocalQueues
func newLocalQueues(c *KueueV1beta1Client, namespace string) *localQueues {
return &localQueues{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithListAndApply[*v1beta1.LocalQueue, *v1beta1.LocalQueueList, *kueuev1beta1.LocalQueueApplyConfiguration](
+ "localqueues",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1beta1.LocalQueue { return &v1beta1.LocalQueue{} },
+ func() *v1beta1.LocalQueueList { return &v1beta1.LocalQueueList{} }),
}
}
-
-// Get takes name of the localQueue, and returns the corresponding localQueue object, and an error if there is any.
-func (c *localQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.LocalQueue, err error) {
- result = &v1beta1.LocalQueue{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("localqueues").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of LocalQueues that match those selectors.
-func (c *localQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LocalQueueList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.LocalQueueList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested localQueues.
-func (c *localQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a localQueue and creates it. Returns the server's representation of the localQueue, and an error, if there is any.
-func (c *localQueues) Create(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.CreateOptions) (result *v1beta1.LocalQueue, err error) {
- result = &v1beta1.LocalQueue{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(localQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a localQueue and updates it. Returns the server's representation of the localQueue, and an error, if there is any.
-func (c *localQueues) Update(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (result *v1beta1.LocalQueue, err error) {
- result = &v1beta1.LocalQueue{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("localqueues").
- Name(localQueue.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(localQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *localQueues) UpdateStatus(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (result *v1beta1.LocalQueue, err error) {
- result = &v1beta1.LocalQueue{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("localqueues").
- Name(localQueue.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(localQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the localQueue and deletes it. Returns an error if one occurs.
-func (c *localQueues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("localqueues").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *localQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched localQueue.
-func (c *localQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.LocalQueue, err error) {
- result = &v1beta1.LocalQueue{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("localqueues").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied localQueue.
-func (c *localQueues) Apply(ctx context.Context, localQueue *kueuev1beta1.LocalQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.LocalQueue, err error) {
- if localQueue == nil {
- return nil, fmt.Errorf("localQueue provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(localQueue)
- if err != nil {
- return nil, err
- }
- name := localQueue.Name
- if name == nil {
- return nil, fmt.Errorf("localQueue.Name must be provided to Apply")
- }
- result = &v1beta1.LocalQueue{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("localqueues").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *localQueues) ApplyStatus(ctx context.Context, localQueue *kueuev1beta1.LocalQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.LocalQueue, err error) {
- if localQueue == nil {
- return nil, fmt.Errorf("localQueue provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(localQueue)
- if err != nil {
- return nil, err
- }
-
- name := localQueue.Name
- if name == nil {
- return nil, fmt.Errorf("localQueue.Name must be provided to Apply")
- }
-
- result = &v1beta1.LocalQueue{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("localqueues").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/multikueuecluster.go b/client-go/clientset/versioned/typed/kueue/v1beta1/multikueuecluster.go
new file mode 100644
index 00000000000..d93fb1ec3eb
--- /dev/null
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/multikueuecluster.go
@@ -0,0 +1,72 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ gentype "k8s.io/client-go/gentype"
+ v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
+ scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
+)
+
+// MultiKueueClustersGetter has a method to return a MultiKueueClusterInterface.
+// A group's client should implement this interface.
+type MultiKueueClustersGetter interface {
+ MultiKueueClusters() MultiKueueClusterInterface
+}
+
+// MultiKueueClusterInterface has methods to work with MultiKueueCluster resources.
+type MultiKueueClusterInterface interface {
+ Create(ctx context.Context, multiKueueCluster *v1beta1.MultiKueueCluster, opts v1.CreateOptions) (*v1beta1.MultiKueueCluster, error)
+ Update(ctx context.Context, multiKueueCluster *v1beta1.MultiKueueCluster, opts v1.UpdateOptions) (*v1beta1.MultiKueueCluster, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+ UpdateStatus(ctx context.Context, multiKueueCluster *v1beta1.MultiKueueCluster, opts v1.UpdateOptions) (*v1beta1.MultiKueueCluster, error)
+ Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
+ DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
+ Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MultiKueueCluster, error)
+ List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MultiKueueClusterList, error)
+ Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
+ Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MultiKueueCluster, err error)
+ Apply(ctx context.Context, multiKueueCluster *kueuev1beta1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MultiKueueCluster, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
+ ApplyStatus(ctx context.Context, multiKueueCluster *kueuev1beta1.MultiKueueClusterApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MultiKueueCluster, err error)
+ MultiKueueClusterExpansion
+}
+
+// multiKueueClusters implements MultiKueueClusterInterface
+type multiKueueClusters struct {
+ *gentype.ClientWithListAndApply[*v1beta1.MultiKueueCluster, *v1beta1.MultiKueueClusterList, *kueuev1beta1.MultiKueueClusterApplyConfiguration]
+}
+
+// newMultiKueueClusters returns a MultiKueueClusters
+func newMultiKueueClusters(c *KueueV1beta1Client) *multiKueueClusters {
+ return &multiKueueClusters{
+ gentype.NewClientWithListAndApply[*v1beta1.MultiKueueCluster, *v1beta1.MultiKueueClusterList, *kueuev1beta1.MultiKueueClusterApplyConfiguration](
+ "multikueueclusters",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.MultiKueueCluster { return &v1beta1.MultiKueueCluster{} },
+ func() *v1beta1.MultiKueueClusterList { return &v1beta1.MultiKueueClusterList{} }),
+ }
+}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/multikueueconfig.go b/client-go/clientset/versioned/typed/kueue/v1beta1/multikueueconfig.go
new file mode 100644
index 00000000000..290a559cfc6
--- /dev/null
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/multikueueconfig.go
@@ -0,0 +1,68 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ gentype "k8s.io/client-go/gentype"
+ v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
+ scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
+)
+
+// MultiKueueConfigsGetter has a method to return a MultiKueueConfigInterface.
+// A group's client should implement this interface.
+type MultiKueueConfigsGetter interface {
+ MultiKueueConfigs() MultiKueueConfigInterface
+}
+
+// MultiKueueConfigInterface has methods to work with MultiKueueConfig resources.
+type MultiKueueConfigInterface interface {
+ Create(ctx context.Context, multiKueueConfig *v1beta1.MultiKueueConfig, opts v1.CreateOptions) (*v1beta1.MultiKueueConfig, error)
+ Update(ctx context.Context, multiKueueConfig *v1beta1.MultiKueueConfig, opts v1.UpdateOptions) (*v1beta1.MultiKueueConfig, error)
+ Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
+ DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
+ Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MultiKueueConfig, error)
+ List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MultiKueueConfigList, error)
+ Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
+ Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MultiKueueConfig, err error)
+ Apply(ctx context.Context, multiKueueConfig *kueuev1beta1.MultiKueueConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MultiKueueConfig, err error)
+ MultiKueueConfigExpansion
+}
+
+// multiKueueConfigs implements MultiKueueConfigInterface
+type multiKueueConfigs struct {
+ *gentype.ClientWithListAndApply[*v1beta1.MultiKueueConfig, *v1beta1.MultiKueueConfigList, *kueuev1beta1.MultiKueueConfigApplyConfiguration]
+}
+
+// newMultiKueueConfigs returns a MultiKueueConfigs
+func newMultiKueueConfigs(c *KueueV1beta1Client) *multiKueueConfigs {
+ return &multiKueueConfigs{
+ gentype.NewClientWithListAndApply[*v1beta1.MultiKueueConfig, *v1beta1.MultiKueueConfigList, *kueuev1beta1.MultiKueueConfigApplyConfiguration](
+ "multikueueconfigs",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.MultiKueueConfig { return &v1beta1.MultiKueueConfig{} },
+ func() *v1beta1.MultiKueueConfigList { return &v1beta1.MultiKueueConfigList{} }),
+ }
+}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/provisioningrequestconfig.go b/client-go/clientset/versioned/typed/kueue/v1beta1/provisioningrequestconfig.go
index d6a3eecc5a1..0517574631e 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/provisioningrequestconfig.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/provisioningrequestconfig.go
@@ -19,14 +19,11 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -54,143 +51,18 @@ type ProvisioningRequestConfigInterface interface {
// provisioningRequestConfigs implements ProvisioningRequestConfigInterface
type provisioningRequestConfigs struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1beta1.ProvisioningRequestConfig, *v1beta1.ProvisioningRequestConfigList, *kueuev1beta1.ProvisioningRequestConfigApplyConfiguration]
}
// newProvisioningRequestConfigs returns a ProvisioningRequestConfigs
func newProvisioningRequestConfigs(c *KueueV1beta1Client) *provisioningRequestConfigs {
return &provisioningRequestConfigs{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1beta1.ProvisioningRequestConfig, *v1beta1.ProvisioningRequestConfigList, *kueuev1beta1.ProvisioningRequestConfigApplyConfiguration](
+ "provisioningrequestconfigs",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.ProvisioningRequestConfig { return &v1beta1.ProvisioningRequestConfig{} },
+ func() *v1beta1.ProvisioningRequestConfigList { return &v1beta1.ProvisioningRequestConfigList{} }),
}
}
-
-// Get takes name of the provisioningRequestConfig, and returns the corresponding provisioningRequestConfig object, and an error if there is any.
-func (c *provisioningRequestConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ProvisioningRequestConfig, err error) {
- result = &v1beta1.ProvisioningRequestConfig{}
- err = c.client.Get().
- Resource("provisioningrequestconfigs").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ProvisioningRequestConfigs that match those selectors.
-func (c *provisioningRequestConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ProvisioningRequestConfigList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.ProvisioningRequestConfigList{}
- err = c.client.Get().
- Resource("provisioningrequestconfigs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested provisioningRequestConfigs.
-func (c *provisioningRequestConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("provisioningrequestconfigs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a provisioningRequestConfig and creates it. Returns the server's representation of the provisioningRequestConfig, and an error, if there is any.
-func (c *provisioningRequestConfigs) Create(ctx context.Context, provisioningRequestConfig *v1beta1.ProvisioningRequestConfig, opts v1.CreateOptions) (result *v1beta1.ProvisioningRequestConfig, err error) {
- result = &v1beta1.ProvisioningRequestConfig{}
- err = c.client.Post().
- Resource("provisioningrequestconfigs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(provisioningRequestConfig).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a provisioningRequestConfig and updates it. Returns the server's representation of the provisioningRequestConfig, and an error, if there is any.
-func (c *provisioningRequestConfigs) Update(ctx context.Context, provisioningRequestConfig *v1beta1.ProvisioningRequestConfig, opts v1.UpdateOptions) (result *v1beta1.ProvisioningRequestConfig, err error) {
- result = &v1beta1.ProvisioningRequestConfig{}
- err = c.client.Put().
- Resource("provisioningrequestconfigs").
- Name(provisioningRequestConfig.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(provisioningRequestConfig).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the provisioningRequestConfig and deletes it. Returns an error if one occurs.
-func (c *provisioningRequestConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("provisioningrequestconfigs").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *provisioningRequestConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("provisioningrequestconfigs").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched provisioningRequestConfig.
-func (c *provisioningRequestConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ProvisioningRequestConfig, err error) {
- result = &v1beta1.ProvisioningRequestConfig{}
- err = c.client.Patch(pt).
- Resource("provisioningrequestconfigs").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied provisioningRequestConfig.
-func (c *provisioningRequestConfigs) Apply(ctx context.Context, provisioningRequestConfig *kueuev1beta1.ProvisioningRequestConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ProvisioningRequestConfig, err error) {
- if provisioningRequestConfig == nil {
- return nil, fmt.Errorf("provisioningRequestConfig provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(provisioningRequestConfig)
- if err != nil {
- return nil, err
- }
- name := provisioningRequestConfig.Name
- if name == nil {
- return nil, fmt.Errorf("provisioningRequestConfig.Name must be provided to Apply")
- }
- result = &v1beta1.ProvisioningRequestConfig{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("provisioningrequestconfigs").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/resourceflavor.go b/client-go/clientset/versioned/typed/kueue/v1beta1/resourceflavor.go
index bf91717350e..cac2f656e14 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/resourceflavor.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/resourceflavor.go
@@ -19,14 +19,11 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -54,143 +51,18 @@ type ResourceFlavorInterface interface {
// resourceFlavors implements ResourceFlavorInterface
type resourceFlavors struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1beta1.ResourceFlavor, *v1beta1.ResourceFlavorList, *kueuev1beta1.ResourceFlavorApplyConfiguration]
}
// newResourceFlavors returns a ResourceFlavors
func newResourceFlavors(c *KueueV1beta1Client) *resourceFlavors {
return &resourceFlavors{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1beta1.ResourceFlavor, *v1beta1.ResourceFlavorList, *kueuev1beta1.ResourceFlavorApplyConfiguration](
+ "resourceflavors",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.ResourceFlavor { return &v1beta1.ResourceFlavor{} },
+ func() *v1beta1.ResourceFlavorList { return &v1beta1.ResourceFlavorList{} }),
}
}
-
-// Get takes name of the resourceFlavor, and returns the corresponding resourceFlavor object, and an error if there is any.
-func (c *resourceFlavors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ResourceFlavor, err error) {
- result = &v1beta1.ResourceFlavor{}
- err = c.client.Get().
- Resource("resourceflavors").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ResourceFlavors that match those selectors.
-func (c *resourceFlavors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ResourceFlavorList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.ResourceFlavorList{}
- err = c.client.Get().
- Resource("resourceflavors").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested resourceFlavors.
-func (c *resourceFlavors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("resourceflavors").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a resourceFlavor and creates it. Returns the server's representation of the resourceFlavor, and an error, if there is any.
-func (c *resourceFlavors) Create(ctx context.Context, resourceFlavor *v1beta1.ResourceFlavor, opts v1.CreateOptions) (result *v1beta1.ResourceFlavor, err error) {
- result = &v1beta1.ResourceFlavor{}
- err = c.client.Post().
- Resource("resourceflavors").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(resourceFlavor).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a resourceFlavor and updates it. Returns the server's representation of the resourceFlavor, and an error, if there is any.
-func (c *resourceFlavors) Update(ctx context.Context, resourceFlavor *v1beta1.ResourceFlavor, opts v1.UpdateOptions) (result *v1beta1.ResourceFlavor, err error) {
- result = &v1beta1.ResourceFlavor{}
- err = c.client.Put().
- Resource("resourceflavors").
- Name(resourceFlavor.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(resourceFlavor).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the resourceFlavor and deletes it. Returns an error if one occurs.
-func (c *resourceFlavors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("resourceflavors").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *resourceFlavors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("resourceflavors").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched resourceFlavor.
-func (c *resourceFlavors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ResourceFlavor, err error) {
- result = &v1beta1.ResourceFlavor{}
- err = c.client.Patch(pt).
- Resource("resourceflavors").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied resourceFlavor.
-func (c *resourceFlavors) Apply(ctx context.Context, resourceFlavor *kueuev1beta1.ResourceFlavorApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ResourceFlavor, err error) {
- if resourceFlavor == nil {
- return nil, fmt.Errorf("resourceFlavor provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(resourceFlavor)
- if err != nil {
- return nil, err
- }
- name := resourceFlavor.Name
- if name == nil {
- return nil, fmt.Errorf("resourceFlavor.Name must be provided to Apply")
- }
- result = &v1beta1.ResourceFlavor{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("resourceflavors").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/workload.go b/client-go/clientset/versioned/typed/kueue/v1beta1/workload.go
index 9ac44253968..25a0e54b12c 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/workload.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/workload.go
@@ -19,14 +19,11 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -42,6 +39,7 @@ type WorkloadsGetter interface {
type WorkloadInterface interface {
Create(ctx context.Context, workload *v1beta1.Workload, opts v1.CreateOptions) (*v1beta1.Workload, error)
Update(ctx context.Context, workload *v1beta1.Workload, opts v1.UpdateOptions) (*v1beta1.Workload, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, workload *v1beta1.Workload, opts v1.UpdateOptions) (*v1beta1.Workload, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -50,206 +48,25 @@ type WorkloadInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Workload, err error)
Apply(ctx context.Context, workload *kueuev1beta1.WorkloadApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Workload, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, workload *kueuev1beta1.WorkloadApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Workload, err error)
WorkloadExpansion
}
// workloads implements WorkloadInterface
type workloads struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithListAndApply[*v1beta1.Workload, *v1beta1.WorkloadList, *kueuev1beta1.WorkloadApplyConfiguration]
}
// newWorkloads returns a Workloads
func newWorkloads(c *KueueV1beta1Client, namespace string) *workloads {
return &workloads{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithListAndApply[*v1beta1.Workload, *v1beta1.WorkloadList, *kueuev1beta1.WorkloadApplyConfiguration](
+ "workloads",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1beta1.Workload { return &v1beta1.Workload{} },
+ func() *v1beta1.WorkloadList { return &v1beta1.WorkloadList{} }),
}
}
-
-// Get takes name of the workload, and returns the corresponding workload object, and an error if there is any.
-func (c *workloads) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Workload, err error) {
- result = &v1beta1.Workload{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("workloads").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Workloads that match those selectors.
-func (c *workloads) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.WorkloadList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.WorkloadList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("workloads").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested workloads.
-func (c *workloads) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("workloads").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a workload and creates it. Returns the server's representation of the workload, and an error, if there is any.
-func (c *workloads) Create(ctx context.Context, workload *v1beta1.Workload, opts v1.CreateOptions) (result *v1beta1.Workload, err error) {
- result = &v1beta1.Workload{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("workloads").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(workload).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a workload and updates it. Returns the server's representation of the workload, and an error, if there is any.
-func (c *workloads) Update(ctx context.Context, workload *v1beta1.Workload, opts v1.UpdateOptions) (result *v1beta1.Workload, err error) {
- result = &v1beta1.Workload{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("workloads").
- Name(workload.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(workload).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *workloads) UpdateStatus(ctx context.Context, workload *v1beta1.Workload, opts v1.UpdateOptions) (result *v1beta1.Workload, err error) {
- result = &v1beta1.Workload{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("workloads").
- Name(workload.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(workload).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the workload and deletes it. Returns an error if one occurs.
-func (c *workloads) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("workloads").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *workloads) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("workloads").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched workload.
-func (c *workloads) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Workload, err error) {
- result = &v1beta1.Workload{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("workloads").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied workload.
-func (c *workloads) Apply(ctx context.Context, workload *kueuev1beta1.WorkloadApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Workload, err error) {
- if workload == nil {
- return nil, fmt.Errorf("workload provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(workload)
- if err != nil {
- return nil, err
- }
- name := workload.Name
- if name == nil {
- return nil, fmt.Errorf("workload.Name must be provided to Apply")
- }
- result = &v1beta1.Workload{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("workloads").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *workloads) ApplyStatus(ctx context.Context, workload *kueuev1beta1.WorkloadApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Workload, err error) {
- if workload == nil {
- return nil, fmt.Errorf("workload provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(workload)
- if err != nil {
- return nil, err
- }
-
- name := workload.Name
- if name == nil {
- return nil, fmt.Errorf("workload.Name must be provided to Apply")
- }
-
- result = &v1beta1.Workload{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("workloads").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/kueue/v1beta1/workloadpriorityclass.go b/client-go/clientset/versioned/typed/kueue/v1beta1/workloadpriorityclass.go
index daf6da61d4a..3e349c58044 100644
--- a/client-go/clientset/versioned/typed/kueue/v1beta1/workloadpriorityclass.go
+++ b/client-go/clientset/versioned/typed/kueue/v1beta1/workloadpriorityclass.go
@@ -19,14 +19,11 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -54,143 +51,18 @@ type WorkloadPriorityClassInterface interface {
// workloadPriorityClasses implements WorkloadPriorityClassInterface
type workloadPriorityClasses struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1beta1.WorkloadPriorityClass, *v1beta1.WorkloadPriorityClassList, *kueuev1beta1.WorkloadPriorityClassApplyConfiguration]
}
// newWorkloadPriorityClasses returns a WorkloadPriorityClasses
func newWorkloadPriorityClasses(c *KueueV1beta1Client) *workloadPriorityClasses {
return &workloadPriorityClasses{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1beta1.WorkloadPriorityClass, *v1beta1.WorkloadPriorityClassList, *kueuev1beta1.WorkloadPriorityClassApplyConfiguration](
+ "workloadpriorityclasses",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.WorkloadPriorityClass { return &v1beta1.WorkloadPriorityClass{} },
+ func() *v1beta1.WorkloadPriorityClassList { return &v1beta1.WorkloadPriorityClassList{} }),
}
}
-
-// Get takes name of the workloadPriorityClass, and returns the corresponding workloadPriorityClass object, and an error if there is any.
-func (c *workloadPriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.WorkloadPriorityClass, err error) {
- result = &v1beta1.WorkloadPriorityClass{}
- err = c.client.Get().
- Resource("workloadpriorityclasses").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of WorkloadPriorityClasses that match those selectors.
-func (c *workloadPriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.WorkloadPriorityClassList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.WorkloadPriorityClassList{}
- err = c.client.Get().
- Resource("workloadpriorityclasses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested workloadPriorityClasses.
-func (c *workloadPriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("workloadpriorityclasses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a workloadPriorityClass and creates it. Returns the server's representation of the workloadPriorityClass, and an error, if there is any.
-func (c *workloadPriorityClasses) Create(ctx context.Context, workloadPriorityClass *v1beta1.WorkloadPriorityClass, opts v1.CreateOptions) (result *v1beta1.WorkloadPriorityClass, err error) {
- result = &v1beta1.WorkloadPriorityClass{}
- err = c.client.Post().
- Resource("workloadpriorityclasses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(workloadPriorityClass).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a workloadPriorityClass and updates it. Returns the server's representation of the workloadPriorityClass, and an error, if there is any.
-func (c *workloadPriorityClasses) Update(ctx context.Context, workloadPriorityClass *v1beta1.WorkloadPriorityClass, opts v1.UpdateOptions) (result *v1beta1.WorkloadPriorityClass, err error) {
- result = &v1beta1.WorkloadPriorityClass{}
- err = c.client.Put().
- Resource("workloadpriorityclasses").
- Name(workloadPriorityClass.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(workloadPriorityClass).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the workloadPriorityClass and deletes it. Returns an error if one occurs.
-func (c *workloadPriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("workloadpriorityclasses").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *workloadPriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("workloadpriorityclasses").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched workloadPriorityClass.
-func (c *workloadPriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.WorkloadPriorityClass, err error) {
- result = &v1beta1.WorkloadPriorityClass{}
- err = c.client.Patch(pt).
- Resource("workloadpriorityclasses").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied workloadPriorityClass.
-func (c *workloadPriorityClasses) Apply(ctx context.Context, workloadPriorityClass *kueuev1beta1.WorkloadPriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.WorkloadPriorityClass, err error) {
- if workloadPriorityClass == nil {
- return nil, fmt.Errorf("workloadPriorityClass provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(workloadPriorityClass)
- if err != nil {
- return nil, err
- }
- name := workloadPriorityClass.Name
- if name == nil {
- return nil, fmt.Errorf("workloadPriorityClass.Name must be provided to Apply")
- }
- result = &v1beta1.WorkloadPriorityClass{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("workloadpriorityclasses").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/client-go/clientset/versioned/typed/visibility/v1alpha1/clusterqueue.go b/client-go/clientset/versioned/typed/visibility/v1alpha1/clusterqueue.go
index a4b6fcbf524..cf3a95be1db 100644
--- a/client-go/clientset/versioned/typed/visibility/v1alpha1/clusterqueue.go
+++ b/client-go/clientset/versioned/typed/visibility/v1alpha1/clusterqueue.go
@@ -19,14 +19,11 @@ package v1alpha1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1alpha1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -56,151 +53,26 @@ type ClusterQueueInterface interface {
// clusterQueues implements ClusterQueueInterface
type clusterQueues struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1alpha1.ClusterQueue, *v1alpha1.ClusterQueueList, *visibilityv1alpha1.ClusterQueueApplyConfiguration]
}
// newClusterQueues returns a ClusterQueues
func newClusterQueues(c *VisibilityV1alpha1Client) *clusterQueues {
return &clusterQueues{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1alpha1.ClusterQueue, *v1alpha1.ClusterQueueList, *visibilityv1alpha1.ClusterQueueApplyConfiguration](
+ "clusterqueues",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1alpha1.ClusterQueue { return &v1alpha1.ClusterQueue{} },
+ func() *v1alpha1.ClusterQueueList { return &v1alpha1.ClusterQueueList{} }),
}
}
-// Get takes name of the clusterQueue, and returns the corresponding clusterQueue object, and an error if there is any.
-func (c *clusterQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterQueue, err error) {
- result = &v1alpha1.ClusterQueue{}
- err = c.client.Get().
- Resource("clusterqueues").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ClusterQueues that match those selectors.
-func (c *clusterQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterQueueList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.ClusterQueueList{}
- err = c.client.Get().
- Resource("clusterqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested clusterQueues.
-func (c *clusterQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("clusterqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a clusterQueue and creates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
-func (c *clusterQueues) Create(ctx context.Context, clusterQueue *v1alpha1.ClusterQueue, opts v1.CreateOptions) (result *v1alpha1.ClusterQueue, err error) {
- result = &v1alpha1.ClusterQueue{}
- err = c.client.Post().
- Resource("clusterqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a clusterQueue and updates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
-func (c *clusterQueues) Update(ctx context.Context, clusterQueue *v1alpha1.ClusterQueue, opts v1.UpdateOptions) (result *v1alpha1.ClusterQueue, err error) {
- result = &v1alpha1.ClusterQueue{}
- err = c.client.Put().
- Resource("clusterqueues").
- Name(clusterQueue.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the clusterQueue and deletes it. Returns an error if one occurs.
-func (c *clusterQueues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("clusterqueues").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *clusterQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("clusterqueues").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched clusterQueue.
-func (c *clusterQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterQueue, err error) {
- result = &v1alpha1.ClusterQueue{}
- err = c.client.Patch(pt).
- Resource("clusterqueues").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied clusterQueue.
-func (c *clusterQueues) Apply(ctx context.Context, clusterQueue *visibilityv1alpha1.ClusterQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterQueue, err error) {
- if clusterQueue == nil {
- return nil, fmt.Errorf("clusterQueue provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterQueue)
- if err != nil {
- return nil, err
- }
- name := clusterQueue.Name
- if name == nil {
- return nil, fmt.Errorf("clusterQueue.Name must be provided to Apply")
- }
- result = &v1alpha1.ClusterQueue{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusterqueues").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
// GetPendingWorkloadsSummary takes name of the clusterQueue, and returns the corresponding v1alpha1.PendingWorkloadsSummary object, and an error if there is any.
func (c *clusterQueues) GetPendingWorkloadsSummary(ctx context.Context, clusterQueueName string, options v1.GetOptions) (result *v1alpha1.PendingWorkloadsSummary, err error) {
result = &v1alpha1.PendingWorkloadsSummary{}
- err = c.client.Get().
+ err = c.GetClient().Get().
Resource("clusterqueues").
Name(clusterQueueName).
SubResource("pendingworkloads").
diff --git a/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_clusterqueue.go b/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_clusterqueue.go
index d0cc7fa7d76..573e8e910f9 100644
--- a/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_clusterqueue.go
+++ b/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_clusterqueue.go
@@ -42,20 +42,22 @@ var clusterqueuesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterQueue")
// Get takes name of the clusterQueue, and returns the corresponding clusterQueue object, and an error if there is any.
func (c *FakeClusterQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterQueue, err error) {
+ emptyResult := &v1alpha1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(clusterqueuesResource, name), &v1alpha1.ClusterQueue{})
+ Invokes(testing.NewRootGetActionWithOptions(clusterqueuesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterQueue), err
}
// List takes label and field selectors, and returns the list of ClusterQueues that match those selectors.
func (c *FakeClusterQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterQueueList, err error) {
+ emptyResult := &v1alpha1.ClusterQueueList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(clusterqueuesResource, clusterqueuesKind, opts), &v1alpha1.ClusterQueueList{})
+ Invokes(testing.NewRootListActionWithOptions(clusterqueuesResource, clusterqueuesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,25 +76,27 @@ func (c *FakeClusterQueues) List(ctx context.Context, opts v1.ListOptions) (resu
// Watch returns a watch.Interface that watches the requested clusterQueues.
func (c *FakeClusterQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(clusterqueuesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(clusterqueuesResource, opts))
}
// Create takes the representation of a clusterQueue and creates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
func (c *FakeClusterQueues) Create(ctx context.Context, clusterQueue *v1alpha1.ClusterQueue, opts v1.CreateOptions) (result *v1alpha1.ClusterQueue, err error) {
+ emptyResult := &v1alpha1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(clusterqueuesResource, clusterQueue), &v1alpha1.ClusterQueue{})
+ Invokes(testing.NewRootCreateActionWithOptions(clusterqueuesResource, clusterQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterQueue), err
}
// Update takes the representation of a clusterQueue and updates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
func (c *FakeClusterQueues) Update(ctx context.Context, clusterQueue *v1alpha1.ClusterQueue, opts v1.UpdateOptions) (result *v1alpha1.ClusterQueue, err error) {
+ emptyResult := &v1alpha1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(clusterqueuesResource, clusterQueue), &v1alpha1.ClusterQueue{})
+ Invokes(testing.NewRootUpdateActionWithOptions(clusterqueuesResource, clusterQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterQueue), err
}
@@ -106,7 +110,7 @@ func (c *FakeClusterQueues) Delete(ctx context.Context, name string, opts v1.Del
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(clusterqueuesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(clusterqueuesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterQueueList{})
return err
@@ -114,10 +118,11 @@ func (c *FakeClusterQueues) DeleteCollection(ctx context.Context, opts v1.Delete
// Patch applies the patch and returns the patched clusterQueue.
func (c *FakeClusterQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterQueue, err error) {
+ emptyResult := &v1alpha1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterqueuesResource, name, pt, data, subresources...), &v1alpha1.ClusterQueue{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterqueuesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterQueue), err
}
@@ -135,20 +140,22 @@ func (c *FakeClusterQueues) Apply(ctx context.Context, clusterQueue *visibilityv
if name == nil {
return nil, fmt.Errorf("clusterQueue.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.ClusterQueue{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterqueuesResource, *name, types.ApplyPatchType, data), &v1alpha1.ClusterQueue{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterqueuesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterQueue), err
}
// GetPendingWorkloadsSummary takes name of the clusterQueue, and returns the corresponding pendingWorkloadsSummary object, and an error if there is any.
func (c *FakeClusterQueues) GetPendingWorkloadsSummary(ctx context.Context, clusterQueueName string, options v1.GetOptions) (result *v1alpha1.PendingWorkloadsSummary, err error) {
+ emptyResult := &v1alpha1.PendingWorkloadsSummary{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetSubresourceAction(clusterqueuesResource, "pendingworkloads", clusterQueueName), &v1alpha1.PendingWorkloadsSummary{})
+ Invokes(testing.NewRootGetSubresourceActionWithOptions(clusterqueuesResource, "pendingworkloads", clusterQueueName, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.PendingWorkloadsSummary), err
}
diff --git a/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_localqueue.go b/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_localqueue.go
index bbf264db067..f874f8f6156 100644
--- a/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_localqueue.go
+++ b/client-go/clientset/versioned/typed/visibility/v1alpha1/fake/fake_localqueue.go
@@ -43,22 +43,24 @@ var localqueuesKind = v1alpha1.SchemeGroupVersion.WithKind("LocalQueue")
// Get takes name of the localQueue, and returns the corresponding localQueue object, and an error if there is any.
func (c *FakeLocalQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LocalQueue, err error) {
+ emptyResult := &v1alpha1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(localqueuesResource, c.ns, name), &v1alpha1.LocalQueue{})
+ Invokes(testing.NewGetActionWithOptions(localqueuesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.LocalQueue), err
}
// List takes label and field selectors, and returns the list of LocalQueues that match those selectors.
func (c *FakeLocalQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LocalQueueList, err error) {
+ emptyResult := &v1alpha1.LocalQueueList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(localqueuesResource, localqueuesKind, c.ns, opts), &v1alpha1.LocalQueueList{})
+ Invokes(testing.NewListActionWithOptions(localqueuesResource, localqueuesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -77,28 +79,30 @@ func (c *FakeLocalQueues) List(ctx context.Context, opts v1.ListOptions) (result
// Watch returns a watch.Interface that watches the requested localQueues.
func (c *FakeLocalQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(localqueuesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(localqueuesResource, c.ns, opts))
}
// Create takes the representation of a localQueue and creates it. Returns the server's representation of the localQueue, and an error, if there is any.
func (c *FakeLocalQueues) Create(ctx context.Context, localQueue *v1alpha1.LocalQueue, opts v1.CreateOptions) (result *v1alpha1.LocalQueue, err error) {
+ emptyResult := &v1alpha1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(localqueuesResource, c.ns, localQueue), &v1alpha1.LocalQueue{})
+ Invokes(testing.NewCreateActionWithOptions(localqueuesResource, c.ns, localQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.LocalQueue), err
}
// Update takes the representation of a localQueue and updates it. Returns the server's representation of the localQueue, and an error, if there is any.
func (c *FakeLocalQueues) Update(ctx context.Context, localQueue *v1alpha1.LocalQueue, opts v1.UpdateOptions) (result *v1alpha1.LocalQueue, err error) {
+ emptyResult := &v1alpha1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(localqueuesResource, c.ns, localQueue), &v1alpha1.LocalQueue{})
+ Invokes(testing.NewUpdateActionWithOptions(localqueuesResource, c.ns, localQueue, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.LocalQueue), err
}
@@ -113,7 +117,7 @@ func (c *FakeLocalQueues) Delete(ctx context.Context, name string, opts v1.Delet
// DeleteCollection deletes a collection of objects.
func (c *FakeLocalQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(localqueuesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(localqueuesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.LocalQueueList{})
return err
@@ -121,11 +125,12 @@ func (c *FakeLocalQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOp
// Patch applies the patch and returns the patched localQueue.
func (c *FakeLocalQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalQueue, err error) {
+ emptyResult := &v1alpha1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(localqueuesResource, c.ns, name, pt, data, subresources...), &v1alpha1.LocalQueue{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(localqueuesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.LocalQueue), err
}
@@ -143,22 +148,24 @@ func (c *FakeLocalQueues) Apply(ctx context.Context, localQueue *visibilityv1alp
if name == nil {
return nil, fmt.Errorf("localQueue.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.LocalQueue{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(localqueuesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.LocalQueue{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(localqueuesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.LocalQueue), err
}
// GetPendingWorkloadsSummary takes name of the localQueue, and returns the corresponding pendingWorkloadsSummary object, and an error if there is any.
func (c *FakeLocalQueues) GetPendingWorkloadsSummary(ctx context.Context, localQueueName string, options v1.GetOptions) (result *v1alpha1.PendingWorkloadsSummary, err error) {
+ emptyResult := &v1alpha1.PendingWorkloadsSummary{}
obj, err := c.Fake.
- Invokes(testing.NewGetSubresourceAction(localqueuesResource, c.ns, "pendingworkloads", localQueueName), &v1alpha1.PendingWorkloadsSummary{})
+ Invokes(testing.NewGetSubresourceActionWithOptions(localqueuesResource, c.ns, "pendingworkloads", localQueueName, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.PendingWorkloadsSummary), err
}
diff --git a/client-go/clientset/versioned/typed/visibility/v1alpha1/localqueue.go b/client-go/clientset/versioned/typed/visibility/v1alpha1/localqueue.go
index 2a8e8f59ec1..42c37acd9e9 100644
--- a/client-go/clientset/versioned/typed/visibility/v1alpha1/localqueue.go
+++ b/client-go/clientset/versioned/typed/visibility/v1alpha1/localqueue.go
@@ -19,14 +19,11 @@ package v1alpha1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1alpha1"
scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -56,163 +53,27 @@ type LocalQueueInterface interface {
// localQueues implements LocalQueueInterface
type localQueues struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithListAndApply[*v1alpha1.LocalQueue, *v1alpha1.LocalQueueList, *visibilityv1alpha1.LocalQueueApplyConfiguration]
}
// newLocalQueues returns a LocalQueues
func newLocalQueues(c *VisibilityV1alpha1Client, namespace string) *localQueues {
return &localQueues{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithListAndApply[*v1alpha1.LocalQueue, *v1alpha1.LocalQueueList, *visibilityv1alpha1.LocalQueueApplyConfiguration](
+ "localqueues",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1alpha1.LocalQueue { return &v1alpha1.LocalQueue{} },
+ func() *v1alpha1.LocalQueueList { return &v1alpha1.LocalQueueList{} }),
}
}
-// Get takes name of the localQueue, and returns the corresponding localQueue object, and an error if there is any.
-func (c *localQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LocalQueue, err error) {
- result = &v1alpha1.LocalQueue{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("localqueues").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of LocalQueues that match those selectors.
-func (c *localQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LocalQueueList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.LocalQueueList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested localQueues.
-func (c *localQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a localQueue and creates it. Returns the server's representation of the localQueue, and an error, if there is any.
-func (c *localQueues) Create(ctx context.Context, localQueue *v1alpha1.LocalQueue, opts v1.CreateOptions) (result *v1alpha1.LocalQueue, err error) {
- result = &v1alpha1.LocalQueue{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(localQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a localQueue and updates it. Returns the server's representation of the localQueue, and an error, if there is any.
-func (c *localQueues) Update(ctx context.Context, localQueue *v1alpha1.LocalQueue, opts v1.UpdateOptions) (result *v1alpha1.LocalQueue, err error) {
- result = &v1alpha1.LocalQueue{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("localqueues").
- Name(localQueue.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(localQueue).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the localQueue and deletes it. Returns an error if one occurs.
-func (c *localQueues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("localqueues").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *localQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("localqueues").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched localQueue.
-func (c *localQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalQueue, err error) {
- result = &v1alpha1.LocalQueue{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("localqueues").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied localQueue.
-func (c *localQueues) Apply(ctx context.Context, localQueue *visibilityv1alpha1.LocalQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LocalQueue, err error) {
- if localQueue == nil {
- return nil, fmt.Errorf("localQueue provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(localQueue)
- if err != nil {
- return nil, err
- }
- name := localQueue.Name
- if name == nil {
- return nil, fmt.Errorf("localQueue.Name must be provided to Apply")
- }
- result = &v1alpha1.LocalQueue{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("localqueues").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
// GetPendingWorkloadsSummary takes name of the localQueue, and returns the corresponding v1alpha1.PendingWorkloadsSummary object, and an error if there is any.
func (c *localQueues) GetPendingWorkloadsSummary(ctx context.Context, localQueueName string, options v1.GetOptions) (result *v1alpha1.PendingWorkloadsSummary, err error) {
result = &v1alpha1.PendingWorkloadsSummary{}
- err = c.client.Get().
- Namespace(c.ns).
+ err = c.GetClient().Get().
+ Namespace(c.GetNamespace()).
Resource("localqueues").
Name(localQueueName).
SubResource("pendingworkloads").
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/clusterqueue.go b/client-go/clientset/versioned/typed/visibility/v1beta1/clusterqueue.go
new file mode 100644
index 00000000000..b39cec618cf
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/clusterqueue.go
@@ -0,0 +1,83 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ gentype "k8s.io/client-go/gentype"
+ v1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1beta1"
+ scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
+)
+
+// ClusterQueuesGetter has a method to return a ClusterQueueInterface.
+// A group's client should implement this interface.
+type ClusterQueuesGetter interface {
+ ClusterQueues() ClusterQueueInterface
+}
+
+// ClusterQueueInterface has methods to work with ClusterQueue resources.
+type ClusterQueueInterface interface {
+ Create(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.CreateOptions) (*v1beta1.ClusterQueue, error)
+ Update(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (*v1beta1.ClusterQueue, error)
+ Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
+ DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
+ Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterQueue, error)
+ List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterQueueList, error)
+ Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
+ Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterQueue, err error)
+ Apply(ctx context.Context, clusterQueue *visibilityv1beta1.ClusterQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterQueue, err error)
+ GetPendingWorkloadsSummary(ctx context.Context, clusterQueueName string, options v1.GetOptions) (*v1beta1.PendingWorkloadsSummary, error)
+
+ ClusterQueueExpansion
+}
+
+// clusterQueues implements ClusterQueueInterface
+type clusterQueues struct {
+ *gentype.ClientWithListAndApply[*v1beta1.ClusterQueue, *v1beta1.ClusterQueueList, *visibilityv1beta1.ClusterQueueApplyConfiguration]
+}
+
+// newClusterQueues returns a ClusterQueues
+func newClusterQueues(c *VisibilityV1beta1Client) *clusterQueues {
+ return &clusterQueues{
+ gentype.NewClientWithListAndApply[*v1beta1.ClusterQueue, *v1beta1.ClusterQueueList, *visibilityv1beta1.ClusterQueueApplyConfiguration](
+ "clusterqueues",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.ClusterQueue { return &v1beta1.ClusterQueue{} },
+ func() *v1beta1.ClusterQueueList { return &v1beta1.ClusterQueueList{} }),
+ }
+}
+
+// GetPendingWorkloadsSummary takes name of the clusterQueue, and returns the corresponding v1beta1.PendingWorkloadsSummary object, and an error if there is any.
+func (c *clusterQueues) GetPendingWorkloadsSummary(ctx context.Context, clusterQueueName string, options v1.GetOptions) (result *v1beta1.PendingWorkloadsSummary, err error) {
+ result = &v1beta1.PendingWorkloadsSummary{}
+ err = c.GetClient().Get().
+ Resource("clusterqueues").
+ Name(clusterQueueName).
+ SubResource("pendingworkloads").
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do(ctx).
+ Into(result)
+ return
+}
diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/config/doc.go b/client-go/clientset/versioned/typed/visibility/v1beta1/doc.go
similarity index 76%
rename from vendor/sigs.k8s.io/controller-runtime/pkg/config/doc.go
rename to client-go/clientset/versioned/typed/visibility/v1beta1/doc.go
index 47a5a2f1d73..87e8d205a12 100644
--- a/vendor/sigs.k8s.io/controller-runtime/pkg/config/doc.go
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/doc.go
@@ -1,5 +1,5 @@
/*
-Copyright 2020 The Kubernetes Authors.
+Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
+// Code generated by client-gen. DO NOT EDIT.
-// Package config contains functionality for interacting with
-// configuration for controller-runtime components.
-package config
+// This package has the automatically generated typed clients.
+package v1beta1
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/fake/doc.go b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/doc.go
new file mode 100644
index 00000000000..3b001592595
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/doc.go
@@ -0,0 +1,19 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+// Package fake has the automatically generated clients.
+package fake
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_clusterqueue.go b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_clusterqueue.go
new file mode 100644
index 00000000000..2f9aefdc267
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_clusterqueue.go
@@ -0,0 +1,161 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ json "encoding/json"
+ "fmt"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+ v1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1beta1"
+)
+
+// FakeClusterQueues implements ClusterQueueInterface
+type FakeClusterQueues struct {
+ Fake *FakeVisibilityV1beta1
+}
+
+var clusterqueuesResource = v1beta1.SchemeGroupVersion.WithResource("clusterqueues")
+
+var clusterqueuesKind = v1beta1.SchemeGroupVersion.WithKind("ClusterQueue")
+
+// Get takes name of the clusterQueue, and returns the corresponding clusterQueue object, and an error if there is any.
+func (c *FakeClusterQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootGetActionWithOptions(clusterqueuesResource, name, options), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.ClusterQueue), err
+}
+
+// List takes label and field selectors, and returns the list of ClusterQueues that match those selectors.
+func (c *FakeClusterQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterQueueList, err error) {
+ emptyResult := &v1beta1.ClusterQueueList{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootListActionWithOptions(clusterqueuesResource, clusterqueuesKind, opts), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1beta1.ClusterQueueList{ListMeta: obj.(*v1beta1.ClusterQueueList).ListMeta}
+ for _, item := range obj.(*v1beta1.ClusterQueueList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested clusterQueues.
+func (c *FakeClusterQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewRootWatchActionWithOptions(clusterqueuesResource, opts))
+}
+
+// Create takes the representation of a clusterQueue and creates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
+func (c *FakeClusterQueues) Create(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.CreateOptions) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootCreateActionWithOptions(clusterqueuesResource, clusterQueue, opts), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.ClusterQueue), err
+}
+
+// Update takes the representation of a clusterQueue and updates it. Returns the server's representation of the clusterQueue, and an error, if there is any.
+func (c *FakeClusterQueues) Update(ctx context.Context, clusterQueue *v1beta1.ClusterQueue, opts v1.UpdateOptions) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootUpdateActionWithOptions(clusterqueuesResource, clusterQueue, opts), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.ClusterQueue), err
+}
+
+// Delete takes name of the clusterQueue and deletes it. Returns an error if one occurs.
+func (c *FakeClusterQueues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewRootDeleteActionWithOptions(clusterqueuesResource, name, opts), &v1beta1.ClusterQueue{})
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeClusterQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
+ action := testing.NewRootDeleteCollectionActionWithOptions(clusterqueuesResource, opts, listOpts)
+
+ _, err := c.Fake.Invokes(action, &v1beta1.ClusterQueueList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched clusterQueue.
+func (c *FakeClusterQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterQueue, err error) {
+ emptyResult := &v1beta1.ClusterQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterqueuesResource, name, pt, data, opts, subresources...), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.ClusterQueue), err
+}
+
+// Apply takes the given apply declarative configuration, applies it and returns the applied clusterQueue.
+func (c *FakeClusterQueues) Apply(ctx context.Context, clusterQueue *visibilityv1beta1.ClusterQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterQueue, err error) {
+ if clusterQueue == nil {
+ return nil, fmt.Errorf("clusterQueue provided to Apply must not be nil")
+ }
+ data, err := json.Marshal(clusterQueue)
+ if err != nil {
+ return nil, err
+ }
+ name := clusterQueue.Name
+ if name == nil {
+ return nil, fmt.Errorf("clusterQueue.Name must be provided to Apply")
+ }
+ emptyResult := &v1beta1.ClusterQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterqueuesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.ClusterQueue), err
+}
+
+// GetPendingWorkloadsSummary takes name of the clusterQueue, and returns the corresponding pendingWorkloadsSummary object, and an error if there is any.
+func (c *FakeClusterQueues) GetPendingWorkloadsSummary(ctx context.Context, clusterQueueName string, options v1.GetOptions) (result *v1beta1.PendingWorkloadsSummary, err error) {
+ emptyResult := &v1beta1.PendingWorkloadsSummary{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootGetSubresourceActionWithOptions(clusterqueuesResource, "pendingworkloads", clusterQueueName, options), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.PendingWorkloadsSummary), err
+}
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_localqueue.go b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_localqueue.go
new file mode 100644
index 00000000000..e8e64cbbd37
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_localqueue.go
@@ -0,0 +1,171 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ json "encoding/json"
+ "fmt"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+ v1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1beta1"
+)
+
+// FakeLocalQueues implements LocalQueueInterface
+type FakeLocalQueues struct {
+ Fake *FakeVisibilityV1beta1
+ ns string
+}
+
+var localqueuesResource = v1beta1.SchemeGroupVersion.WithResource("localqueues")
+
+var localqueuesKind = v1beta1.SchemeGroupVersion.WithKind("LocalQueue")
+
+// Get takes name of the localQueue, and returns the corresponding localQueue object, and an error if there is any.
+func (c *FakeLocalQueues) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewGetActionWithOptions(localqueuesResource, c.ns, name, options), emptyResult)
+
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.LocalQueue), err
+}
+
+// List takes label and field selectors, and returns the list of LocalQueues that match those selectors.
+func (c *FakeLocalQueues) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LocalQueueList, err error) {
+ emptyResult := &v1beta1.LocalQueueList{}
+ obj, err := c.Fake.
+ Invokes(testing.NewListActionWithOptions(localqueuesResource, localqueuesKind, c.ns, opts), emptyResult)
+
+ if obj == nil {
+ return emptyResult, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1beta1.LocalQueueList{ListMeta: obj.(*v1beta1.LocalQueueList).ListMeta}
+ for _, item := range obj.(*v1beta1.LocalQueueList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested localQueues.
+func (c *FakeLocalQueues) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchActionWithOptions(localqueuesResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a localQueue and creates it. Returns the server's representation of the localQueue, and an error, if there is any.
+func (c *FakeLocalQueues) Create(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.CreateOptions) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateActionWithOptions(localqueuesResource, c.ns, localQueue, opts), emptyResult)
+
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.LocalQueue), err
+}
+
+// Update takes the representation of a localQueue and updates it. Returns the server's representation of the localQueue, and an error, if there is any.
+func (c *FakeLocalQueues) Update(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateActionWithOptions(localqueuesResource, c.ns, localQueue, opts), emptyResult)
+
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.LocalQueue), err
+}
+
+// Delete takes name of the localQueue and deletes it. Returns an error if one occurs.
+func (c *FakeLocalQueues) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteActionWithOptions(localqueuesResource, c.ns, name, opts), &v1beta1.LocalQueue{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeLocalQueues) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
+ action := testing.NewDeleteCollectionActionWithOptions(localqueuesResource, c.ns, opts, listOpts)
+
+ _, err := c.Fake.Invokes(action, &v1beta1.LocalQueueList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched localQueue.
+func (c *FakeLocalQueues) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.LocalQueue, err error) {
+ emptyResult := &v1beta1.LocalQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceActionWithOptions(localqueuesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
+
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.LocalQueue), err
+}
+
+// Apply takes the given apply declarative configuration, applies it and returns the applied localQueue.
+func (c *FakeLocalQueues) Apply(ctx context.Context, localQueue *visibilityv1beta1.LocalQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.LocalQueue, err error) {
+ if localQueue == nil {
+ return nil, fmt.Errorf("localQueue provided to Apply must not be nil")
+ }
+ data, err := json.Marshal(localQueue)
+ if err != nil {
+ return nil, err
+ }
+ name := localQueue.Name
+ if name == nil {
+ return nil, fmt.Errorf("localQueue.Name must be provided to Apply")
+ }
+ emptyResult := &v1beta1.LocalQueue{}
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceActionWithOptions(localqueuesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
+
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.LocalQueue), err
+}
+
+// GetPendingWorkloadsSummary takes name of the localQueue, and returns the corresponding pendingWorkloadsSummary object, and an error if there is any.
+func (c *FakeLocalQueues) GetPendingWorkloadsSummary(ctx context.Context, localQueueName string, options v1.GetOptions) (result *v1beta1.PendingWorkloadsSummary, err error) {
+ emptyResult := &v1beta1.PendingWorkloadsSummary{}
+ obj, err := c.Fake.
+ Invokes(testing.NewGetSubresourceActionWithOptions(localqueuesResource, c.ns, "pendingworkloads", localQueueName, options), emptyResult)
+
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1beta1.PendingWorkloadsSummary), err
+}
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_visibility_client.go b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_visibility_client.go
new file mode 100644
index 00000000000..c0c020ad3cf
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/fake/fake_visibility_client.go
@@ -0,0 +1,43 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ rest "k8s.io/client-go/rest"
+ testing "k8s.io/client-go/testing"
+ v1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1beta1"
+)
+
+type FakeVisibilityV1beta1 struct {
+ *testing.Fake
+}
+
+func (c *FakeVisibilityV1beta1) ClusterQueues() v1beta1.ClusterQueueInterface {
+ return &FakeClusterQueues{c}
+}
+
+func (c *FakeVisibilityV1beta1) LocalQueues(namespace string) v1beta1.LocalQueueInterface {
+ return &FakeLocalQueues{c, namespace}
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *FakeVisibilityV1beta1) RESTClient() rest.Interface {
+ var ret *rest.RESTClient
+ return ret
+}
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/generated_expansion.go b/client-go/clientset/versioned/typed/visibility/v1beta1/generated_expansion.go
new file mode 100644
index 00000000000..26e84b21ec9
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/generated_expansion.go
@@ -0,0 +1,22 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+type ClusterQueueExpansion interface{}
+
+type LocalQueueExpansion interface{}
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/localqueue.go b/client-go/clientset/versioned/typed/visibility/v1beta1/localqueue.go
new file mode 100644
index 00000000000..02ccffc9f93
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/localqueue.go
@@ -0,0 +1,84 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ gentype "k8s.io/client-go/gentype"
+ v1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1beta1"
+ scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
+)
+
+// LocalQueuesGetter has a method to return a LocalQueueInterface.
+// A group's client should implement this interface.
+type LocalQueuesGetter interface {
+ LocalQueues(namespace string) LocalQueueInterface
+}
+
+// LocalQueueInterface has methods to work with LocalQueue resources.
+type LocalQueueInterface interface {
+ Create(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.CreateOptions) (*v1beta1.LocalQueue, error)
+ Update(ctx context.Context, localQueue *v1beta1.LocalQueue, opts v1.UpdateOptions) (*v1beta1.LocalQueue, error)
+ Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
+ DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
+ Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.LocalQueue, error)
+ List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LocalQueueList, error)
+ Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
+ Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.LocalQueue, err error)
+ Apply(ctx context.Context, localQueue *visibilityv1beta1.LocalQueueApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.LocalQueue, err error)
+ GetPendingWorkloadsSummary(ctx context.Context, localQueueName string, options v1.GetOptions) (*v1beta1.PendingWorkloadsSummary, error)
+
+ LocalQueueExpansion
+}
+
+// localQueues implements LocalQueueInterface
+type localQueues struct {
+ *gentype.ClientWithListAndApply[*v1beta1.LocalQueue, *v1beta1.LocalQueueList, *visibilityv1beta1.LocalQueueApplyConfiguration]
+}
+
+// newLocalQueues returns a LocalQueues
+func newLocalQueues(c *VisibilityV1beta1Client, namespace string) *localQueues {
+ return &localQueues{
+ gentype.NewClientWithListAndApply[*v1beta1.LocalQueue, *v1beta1.LocalQueueList, *visibilityv1beta1.LocalQueueApplyConfiguration](
+ "localqueues",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1beta1.LocalQueue { return &v1beta1.LocalQueue{} },
+ func() *v1beta1.LocalQueueList { return &v1beta1.LocalQueueList{} }),
+ }
+}
+
+// GetPendingWorkloadsSummary takes name of the localQueue, and returns the corresponding v1beta1.PendingWorkloadsSummary object, and an error if there is any.
+func (c *localQueues) GetPendingWorkloadsSummary(ctx context.Context, localQueueName string, options v1.GetOptions) (result *v1beta1.PendingWorkloadsSummary, err error) {
+ result = &v1beta1.PendingWorkloadsSummary{}
+ err = c.GetClient().Get().
+ Namespace(c.GetNamespace()).
+ Resource("localqueues").
+ Name(localQueueName).
+ SubResource("pendingworkloads").
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do(ctx).
+ Into(result)
+ return
+}
diff --git a/client-go/clientset/versioned/typed/visibility/v1beta1/visibility_client.go b/client-go/clientset/versioned/typed/visibility/v1beta1/visibility_client.go
new file mode 100644
index 00000000000..d606438e9a5
--- /dev/null
+++ b/client-go/clientset/versioned/typed/visibility/v1beta1/visibility_client.go
@@ -0,0 +1,111 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "net/http"
+
+ rest "k8s.io/client-go/rest"
+ v1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
+)
+
+type VisibilityV1beta1Interface interface {
+ RESTClient() rest.Interface
+ ClusterQueuesGetter
+ LocalQueuesGetter
+}
+
+// VisibilityV1beta1Client is used to interact with features provided by the visibility.kueue.x-k8s.io group.
+type VisibilityV1beta1Client struct {
+ restClient rest.Interface
+}
+
+func (c *VisibilityV1beta1Client) ClusterQueues() ClusterQueueInterface {
+ return newClusterQueues(c)
+}
+
+func (c *VisibilityV1beta1Client) LocalQueues(namespace string) LocalQueueInterface {
+ return newLocalQueues(c, namespace)
+}
+
+// NewForConfig creates a new VisibilityV1beta1Client for the given config.
+// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
+// where httpClient was generated with rest.HTTPClientFor(c).
+func NewForConfig(c *rest.Config) (*VisibilityV1beta1Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ httpClient, err := rest.HTTPClientFor(&config)
+ if err != nil {
+ return nil, err
+ }
+ return NewForConfigAndClient(&config, httpClient)
+}
+
+// NewForConfigAndClient creates a new VisibilityV1beta1Client for the given config and http client.
+// Note the http client provided takes precedence over the configured transport values.
+func NewForConfigAndClient(c *rest.Config, h *http.Client) (*VisibilityV1beta1Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ client, err := rest.RESTClientForConfigAndClient(&config, h)
+ if err != nil {
+ return nil, err
+ }
+ return &VisibilityV1beta1Client{client}, nil
+}
+
+// NewForConfigOrDie creates a new VisibilityV1beta1Client for the given config and
+// panics if there is an error in the config.
+func NewForConfigOrDie(c *rest.Config) *VisibilityV1beta1Client {
+ client, err := NewForConfig(c)
+ if err != nil {
+ panic(err)
+ }
+ return client
+}
+
+// New creates a new VisibilityV1beta1Client for the given RESTClient.
+func New(c rest.Interface) *VisibilityV1beta1Client {
+ return &VisibilityV1beta1Client{c}
+}
+
+func setConfigDefaults(config *rest.Config) error {
+ gv := v1beta1.SchemeGroupVersion
+ config.GroupVersion = &gv
+ config.APIPath = "/apis"
+ config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
+
+ if config.UserAgent == "" {
+ config.UserAgent = rest.DefaultKubernetesUserAgent()
+ }
+
+ return nil
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *VisibilityV1beta1Client) RESTClient() rest.Interface {
+ if c == nil {
+ return nil
+ }
+ return c.restClient
+}
diff --git a/client-go/informers/externalversions/factory.go b/client-go/informers/externalversions/factory.go
index 1088f13f8d3..e254a034bba 100644
--- a/client-go/informers/externalversions/factory.go
+++ b/client-go/informers/externalversions/factory.go
@@ -228,6 +228,7 @@ type SharedInformerFactory interface {
// Start initializes all requested informers. They are handled in goroutines
// which run until the stop channel gets closed.
+ // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync.
Start(stopCh <-chan struct{})
// Shutdown marks a factory as shutting down. At that point no new
diff --git a/client-go/informers/externalversions/generic.go b/client-go/informers/externalversions/generic.go
index 20debdeb89f..f4fb9667906 100644
--- a/client-go/informers/externalversions/generic.go
+++ b/client-go/informers/externalversions/generic.go
@@ -22,9 +22,9 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
- visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
@@ -53,19 +53,17 @@ func (f *genericInformer) Lister() cache.GenericLister {
// TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
- // Group=kueue.x-k8s.io, Version=v1alpha1
- case v1alpha1.SchemeGroupVersion.WithResource("multikueueclusters"):
- return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1alpha1().MultiKueueClusters().Informer()}, nil
- case v1alpha1.SchemeGroupVersion.WithResource("multikueueconfigs"):
- return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1alpha1().MultiKueueConfigs().Informer()}, nil
-
- // Group=kueue.x-k8s.io, Version=v1beta1
+ // Group=kueue.x-k8s.io, Version=v1beta1
case v1beta1.SchemeGroupVersion.WithResource("admissionchecks"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().AdmissionChecks().Informer()}, nil
case v1beta1.SchemeGroupVersion.WithResource("clusterqueues"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().ClusterQueues().Informer()}, nil
case v1beta1.SchemeGroupVersion.WithResource("localqueues"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().LocalQueues().Informer()}, nil
+ case v1beta1.SchemeGroupVersion.WithResource("multikueueclusters"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().MultiKueueClusters().Informer()}, nil
+ case v1beta1.SchemeGroupVersion.WithResource("multikueueconfigs"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().MultiKueueConfigs().Informer()}, nil
case v1beta1.SchemeGroupVersion.WithResource("provisioningrequestconfigs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().ProvisioningRequestConfigs().Informer()}, nil
case v1beta1.SchemeGroupVersion.WithResource("resourceflavors"):
@@ -76,11 +74,17 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().WorkloadPriorityClasses().Informer()}, nil
// Group=visibility.kueue.x-k8s.io, Version=v1alpha1
- case visibilityv1alpha1.SchemeGroupVersion.WithResource("clusterqueues"):
+ case v1alpha1.SchemeGroupVersion.WithResource("clusterqueues"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Visibility().V1alpha1().ClusterQueues().Informer()}, nil
- case visibilityv1alpha1.SchemeGroupVersion.WithResource("localqueues"):
+ case v1alpha1.SchemeGroupVersion.WithResource("localqueues"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Visibility().V1alpha1().LocalQueues().Informer()}, nil
+ // Group=visibility.kueue.x-k8s.io, Version=v1beta1
+ case visibilityv1beta1.SchemeGroupVersion.WithResource("clusterqueues"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Visibility().V1beta1().ClusterQueues().Informer()}, nil
+ case visibilityv1beta1.SchemeGroupVersion.WithResource("localqueues"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Visibility().V1beta1().LocalQueues().Informer()}, nil
+
}
return nil, fmt.Errorf("no informer found for %v", resource)
diff --git a/client-go/informers/externalversions/kueue/interface.go b/client-go/informers/externalversions/kueue/interface.go
index 7f89811e13b..28943b8c668 100644
--- a/client-go/informers/externalversions/kueue/interface.go
+++ b/client-go/informers/externalversions/kueue/interface.go
@@ -19,14 +19,11 @@ package kueue
import (
internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
- v1alpha1 "sigs.k8s.io/kueue/client-go/informers/externalversions/kueue/v1alpha1"
v1beta1 "sigs.k8s.io/kueue/client-go/informers/externalversions/kueue/v1beta1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
- // V1alpha1 provides access to shared informers for resources in V1alpha1.
- V1alpha1() v1alpha1.Interface
// V1beta1 provides access to shared informers for resources in V1beta1.
V1beta1() v1beta1.Interface
}
@@ -42,11 +39,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
-// V1alpha1 returns a new v1alpha1.Interface.
-func (g *group) V1alpha1() v1alpha1.Interface {
- return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
-}
-
// V1beta1 returns a new v1beta1.Interface.
func (g *group) V1beta1() v1beta1.Interface {
return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
diff --git a/client-go/informers/externalversions/kueue/v1beta1/interface.go b/client-go/informers/externalversions/kueue/v1beta1/interface.go
index 6fc0a67b2e7..bae59d18949 100644
--- a/client-go/informers/externalversions/kueue/v1beta1/interface.go
+++ b/client-go/informers/externalversions/kueue/v1beta1/interface.go
@@ -29,6 +29,10 @@ type Interface interface {
ClusterQueues() ClusterQueueInformer
// LocalQueues returns a LocalQueueInformer.
LocalQueues() LocalQueueInformer
+ // MultiKueueClusters returns a MultiKueueClusterInformer.
+ MultiKueueClusters() MultiKueueClusterInformer
+ // MultiKueueConfigs returns a MultiKueueConfigInformer.
+ MultiKueueConfigs() MultiKueueConfigInformer
// ProvisioningRequestConfigs returns a ProvisioningRequestConfigInformer.
ProvisioningRequestConfigs() ProvisioningRequestConfigInformer
// ResourceFlavors returns a ResourceFlavorInformer.
@@ -65,6 +69,16 @@ func (v *version) LocalQueues() LocalQueueInformer {
return &localQueueInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
+// MultiKueueClusters returns a MultiKueueClusterInformer.
+func (v *version) MultiKueueClusters() MultiKueueClusterInformer {
+ return &multiKueueClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
+}
+
+// MultiKueueConfigs returns a MultiKueueConfigInformer.
+func (v *version) MultiKueueConfigs() MultiKueueConfigInformer {
+ return &multiKueueConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
+}
+
// ProvisioningRequestConfigs returns a ProvisioningRequestConfigInformer.
func (v *version) ProvisioningRequestConfigs() ProvisioningRequestConfigInformer {
return &provisioningRequestConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
diff --git a/client-go/informers/externalversions/kueue/v1alpha1/multikueuecluster.go b/client-go/informers/externalversions/kueue/v1beta1/multikueuecluster.go
similarity index 83%
rename from client-go/informers/externalversions/kueue/v1alpha1/multikueuecluster.go
rename to client-go/informers/externalversions/kueue/v1beta1/multikueuecluster.go
index 13fd62b717d..781fe6fd0a6 100644
--- a/client-go/informers/externalversions/kueue/v1alpha1/multikueuecluster.go
+++ b/client-go/informers/externalversions/kueue/v1beta1/multikueuecluster.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
"context"
@@ -25,17 +25,17 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
- kueuev1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
versioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
- v1alpha1 "sigs.k8s.io/kueue/client-go/listers/kueue/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/client-go/listers/kueue/v1beta1"
)
// MultiKueueClusterInformer provides access to a shared informer and lister for
// MultiKueueClusters.
type MultiKueueClusterInformer interface {
Informer() cache.SharedIndexInformer
- Lister() v1alpha1.MultiKueueClusterLister
+ Lister() v1beta1.MultiKueueClusterLister
}
type multiKueueClusterInformer struct {
@@ -60,16 +60,16 @@ func NewFilteredMultiKueueClusterInformer(client versioned.Interface, resyncPeri
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.KueueV1alpha1().MultiKueueClusters().List(context.TODO(), options)
+ return client.KueueV1beta1().MultiKueueClusters().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.KueueV1alpha1().MultiKueueClusters().Watch(context.TODO(), options)
+ return client.KueueV1beta1().MultiKueueClusters().Watch(context.TODO(), options)
},
},
- &kueuev1alpha1.MultiKueueCluster{},
+ &kueuev1beta1.MultiKueueCluster{},
resyncPeriod,
indexers,
)
@@ -80,9 +80,9 @@ func (f *multiKueueClusterInformer) defaultInformer(client versioned.Interface,
}
func (f *multiKueueClusterInformer) Informer() cache.SharedIndexInformer {
- return f.factory.InformerFor(&kueuev1alpha1.MultiKueueCluster{}, f.defaultInformer)
+ return f.factory.InformerFor(&kueuev1beta1.MultiKueueCluster{}, f.defaultInformer)
}
-func (f *multiKueueClusterInformer) Lister() v1alpha1.MultiKueueClusterLister {
- return v1alpha1.NewMultiKueueClusterLister(f.Informer().GetIndexer())
+func (f *multiKueueClusterInformer) Lister() v1beta1.MultiKueueClusterLister {
+ return v1beta1.NewMultiKueueClusterLister(f.Informer().GetIndexer())
}
diff --git a/client-go/informers/externalversions/kueue/v1alpha1/multikueueconfig.go b/client-go/informers/externalversions/kueue/v1beta1/multikueueconfig.go
similarity index 83%
rename from client-go/informers/externalversions/kueue/v1alpha1/multikueueconfig.go
rename to client-go/informers/externalversions/kueue/v1beta1/multikueueconfig.go
index 4af4a564898..5921d8a3fa3 100644
--- a/client-go/informers/externalversions/kueue/v1alpha1/multikueueconfig.go
+++ b/client-go/informers/externalversions/kueue/v1beta1/multikueueconfig.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
"context"
@@ -25,17 +25,17 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
- kueuev1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
versioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
- v1alpha1 "sigs.k8s.io/kueue/client-go/listers/kueue/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/client-go/listers/kueue/v1beta1"
)
// MultiKueueConfigInformer provides access to a shared informer and lister for
// MultiKueueConfigs.
type MultiKueueConfigInformer interface {
Informer() cache.SharedIndexInformer
- Lister() v1alpha1.MultiKueueConfigLister
+ Lister() v1beta1.MultiKueueConfigLister
}
type multiKueueConfigInformer struct {
@@ -60,16 +60,16 @@ func NewFilteredMultiKueueConfigInformer(client versioned.Interface, resyncPerio
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.KueueV1alpha1().MultiKueueConfigs().List(context.TODO(), options)
+ return client.KueueV1beta1().MultiKueueConfigs().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.KueueV1alpha1().MultiKueueConfigs().Watch(context.TODO(), options)
+ return client.KueueV1beta1().MultiKueueConfigs().Watch(context.TODO(), options)
},
},
- &kueuev1alpha1.MultiKueueConfig{},
+ &kueuev1beta1.MultiKueueConfig{},
resyncPeriod,
indexers,
)
@@ -80,9 +80,9 @@ func (f *multiKueueConfigInformer) defaultInformer(client versioned.Interface, r
}
func (f *multiKueueConfigInformer) Informer() cache.SharedIndexInformer {
- return f.factory.InformerFor(&kueuev1alpha1.MultiKueueConfig{}, f.defaultInformer)
+ return f.factory.InformerFor(&kueuev1beta1.MultiKueueConfig{}, f.defaultInformer)
}
-func (f *multiKueueConfigInformer) Lister() v1alpha1.MultiKueueConfigLister {
- return v1alpha1.NewMultiKueueConfigLister(f.Informer().GetIndexer())
+func (f *multiKueueConfigInformer) Lister() v1beta1.MultiKueueConfigLister {
+ return v1beta1.NewMultiKueueConfigLister(f.Informer().GetIndexer())
}
diff --git a/client-go/informers/externalversions/visibility/interface.go b/client-go/informers/externalversions/visibility/interface.go
index a7179d892be..7b8442f8917 100644
--- a/client-go/informers/externalversions/visibility/interface.go
+++ b/client-go/informers/externalversions/visibility/interface.go
@@ -20,12 +20,15 @@ package visibility
import (
internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "sigs.k8s.io/kueue/client-go/informers/externalversions/visibility/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/client-go/informers/externalversions/visibility/v1beta1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
+ // V1beta1 provides access to shared informers for resources in V1beta1.
+ V1beta1() v1beta1.Interface
}
type group struct {
@@ -43,3 +46,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
}
+
+// V1beta1 returns a new v1beta1.Interface.
+func (g *group) V1beta1() v1beta1.Interface {
+ return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
+}
diff --git a/client-go/informers/externalversions/visibility/v1beta1/clusterqueue.go b/client-go/informers/externalversions/visibility/v1beta1/clusterqueue.go
new file mode 100644
index 00000000000..e0d445d35f6
--- /dev/null
+++ b/client-go/informers/externalversions/visibility/v1beta1/clusterqueue.go
@@ -0,0 +1,88 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+ time "time"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ versioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
+ internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
+ v1beta1 "sigs.k8s.io/kueue/client-go/listers/visibility/v1beta1"
+)
+
+// ClusterQueueInformer provides access to a shared informer and lister for
+// ClusterQueues.
+type ClusterQueueInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1beta1.ClusterQueueLister
+}
+
+type clusterQueueInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+}
+
+// NewClusterQueueInformer constructs a new informer for ClusterQueue type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewClusterQueueInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredClusterQueueInformer(client, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredClusterQueueInformer constructs a new informer for ClusterQueue type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredClusterQueueInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.VisibilityV1beta1().ClusterQueues().List(context.TODO(), options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.VisibilityV1beta1().ClusterQueues().Watch(context.TODO(), options)
+ },
+ },
+ &visibilityv1beta1.ClusterQueue{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *clusterQueueInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredClusterQueueInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *clusterQueueInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&visibilityv1beta1.ClusterQueue{}, f.defaultInformer)
+}
+
+func (f *clusterQueueInformer) Lister() v1beta1.ClusterQueueLister {
+ return v1beta1.NewClusterQueueLister(f.Informer().GetIndexer())
+}
diff --git a/client-go/informers/externalversions/kueue/v1alpha1/interface.go b/client-go/informers/externalversions/visibility/v1beta1/interface.go
similarity index 65%
rename from client-go/informers/externalversions/kueue/v1alpha1/interface.go
rename to client-go/informers/externalversions/visibility/v1beta1/interface.go
index 4ccfaffc780..7be28f5dd59 100644
--- a/client-go/informers/externalversions/kueue/v1alpha1/interface.go
+++ b/client-go/informers/externalversions/visibility/v1beta1/interface.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
@@ -23,10 +23,10 @@ import (
// Interface provides access to all the informers in this group version.
type Interface interface {
- // MultiKueueClusters returns a MultiKueueClusterInformer.
- MultiKueueClusters() MultiKueueClusterInformer
- // MultiKueueConfigs returns a MultiKueueConfigInformer.
- MultiKueueConfigs() MultiKueueConfigInformer
+ // ClusterQueues returns a ClusterQueueInformer.
+ ClusterQueues() ClusterQueueInformer
+ // LocalQueues returns a LocalQueueInformer.
+ LocalQueues() LocalQueueInformer
}
type version struct {
@@ -40,12 +40,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
-// MultiKueueClusters returns a MultiKueueClusterInformer.
-func (v *version) MultiKueueClusters() MultiKueueClusterInformer {
- return &multiKueueClusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
+// ClusterQueues returns a ClusterQueueInformer.
+func (v *version) ClusterQueues() ClusterQueueInformer {
+ return &clusterQueueInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
-// MultiKueueConfigs returns a MultiKueueConfigInformer.
-func (v *version) MultiKueueConfigs() MultiKueueConfigInformer {
- return &multiKueueConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
+// LocalQueues returns a LocalQueueInformer.
+func (v *version) LocalQueues() LocalQueueInformer {
+ return &localQueueInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
diff --git a/client-go/informers/externalversions/visibility/v1beta1/localqueue.go b/client-go/informers/externalversions/visibility/v1beta1/localqueue.go
new file mode 100644
index 00000000000..c991a908025
--- /dev/null
+++ b/client-go/informers/externalversions/visibility/v1beta1/localqueue.go
@@ -0,0 +1,89 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+ time "time"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ versioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
+ internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
+ v1beta1 "sigs.k8s.io/kueue/client-go/listers/visibility/v1beta1"
+)
+
+// LocalQueueInformer provides access to a shared informer and lister for
+// LocalQueues.
+type LocalQueueInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1beta1.LocalQueueLister
+}
+
+type localQueueInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewLocalQueueInformer constructs a new informer for LocalQueue type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewLocalQueueInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredLocalQueueInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredLocalQueueInformer constructs a new informer for LocalQueue type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredLocalQueueInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.VisibilityV1beta1().LocalQueues(namespace).List(context.TODO(), options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.VisibilityV1beta1().LocalQueues(namespace).Watch(context.TODO(), options)
+ },
+ },
+ &visibilityv1beta1.LocalQueue{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *localQueueInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredLocalQueueInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *localQueueInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&visibilityv1beta1.LocalQueue{}, f.defaultInformer)
+}
+
+func (f *localQueueInformer) Lister() v1beta1.LocalQueueLister {
+ return v1beta1.NewLocalQueueLister(f.Informer().GetIndexer())
+}
diff --git a/client-go/listers/kueue/v1beta1/admissioncheck.go b/client-go/listers/kueue/v1beta1/admissioncheck.go
index 43b7b33e1fb..57b8797b5e6 100644
--- a/client-go/listers/kueue/v1beta1/admissioncheck.go
+++ b/client-go/listers/kueue/v1beta1/admissioncheck.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
@@ -38,30 +38,10 @@ type AdmissionCheckLister interface {
// admissionCheckLister implements the AdmissionCheckLister interface.
type admissionCheckLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.AdmissionCheck]
}
// NewAdmissionCheckLister returns a new AdmissionCheckLister.
func NewAdmissionCheckLister(indexer cache.Indexer) AdmissionCheckLister {
- return &admissionCheckLister{indexer: indexer}
-}
-
-// List lists all AdmissionChecks in the indexer.
-func (s *admissionCheckLister) List(selector labels.Selector) (ret []*v1beta1.AdmissionCheck, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.AdmissionCheck))
- })
- return ret, err
-}
-
-// Get retrieves the AdmissionCheck from the index for a given name.
-func (s *admissionCheckLister) Get(name string) (*v1beta1.AdmissionCheck, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1beta1.Resource("admissioncheck"), name)
- }
- return obj.(*v1beta1.AdmissionCheck), nil
+ return &admissionCheckLister{listers.New[*v1beta1.AdmissionCheck](indexer, v1beta1.Resource("admissioncheck"))}
}
diff --git a/client-go/listers/kueue/v1beta1/clusterqueue.go b/client-go/listers/kueue/v1beta1/clusterqueue.go
index 8ee08815b9b..8473554d623 100644
--- a/client-go/listers/kueue/v1beta1/clusterqueue.go
+++ b/client-go/listers/kueue/v1beta1/clusterqueue.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
@@ -38,30 +38,10 @@ type ClusterQueueLister interface {
// clusterQueueLister implements the ClusterQueueLister interface.
type clusterQueueLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.ClusterQueue]
}
// NewClusterQueueLister returns a new ClusterQueueLister.
func NewClusterQueueLister(indexer cache.Indexer) ClusterQueueLister {
- return &clusterQueueLister{indexer: indexer}
-}
-
-// List lists all ClusterQueues in the indexer.
-func (s *clusterQueueLister) List(selector labels.Selector) (ret []*v1beta1.ClusterQueue, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.ClusterQueue))
- })
- return ret, err
-}
-
-// Get retrieves the ClusterQueue from the index for a given name.
-func (s *clusterQueueLister) Get(name string) (*v1beta1.ClusterQueue, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1beta1.Resource("clusterqueue"), name)
- }
- return obj.(*v1beta1.ClusterQueue), nil
+ return &clusterQueueLister{listers.New[*v1beta1.ClusterQueue](indexer, v1beta1.Resource("clusterqueue"))}
}
diff --git a/client-go/listers/kueue/v1beta1/expansion_generated.go b/client-go/listers/kueue/v1beta1/expansion_generated.go
index 05a3b8a07b9..2061a69e782 100644
--- a/client-go/listers/kueue/v1beta1/expansion_generated.go
+++ b/client-go/listers/kueue/v1beta1/expansion_generated.go
@@ -33,6 +33,14 @@ type LocalQueueListerExpansion interface{}
// LocalQueueNamespaceLister.
type LocalQueueNamespaceListerExpansion interface{}
+// MultiKueueClusterListerExpansion allows custom methods to be added to
+// MultiKueueClusterLister.
+type MultiKueueClusterListerExpansion interface{}
+
+// MultiKueueConfigListerExpansion allows custom methods to be added to
+// MultiKueueConfigLister.
+type MultiKueueConfigListerExpansion interface{}
+
// ProvisioningRequestConfigListerExpansion allows custom methods to be added to
// ProvisioningRequestConfigLister.
type ProvisioningRequestConfigListerExpansion interface{}
diff --git a/client-go/listers/kueue/v1beta1/localqueue.go b/client-go/listers/kueue/v1beta1/localqueue.go
index a333e269840..38629840baf 100644
--- a/client-go/listers/kueue/v1beta1/localqueue.go
+++ b/client-go/listers/kueue/v1beta1/localqueue.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
@@ -37,25 +37,17 @@ type LocalQueueLister interface {
// localQueueLister implements the LocalQueueLister interface.
type localQueueLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.LocalQueue]
}
// NewLocalQueueLister returns a new LocalQueueLister.
func NewLocalQueueLister(indexer cache.Indexer) LocalQueueLister {
- return &localQueueLister{indexer: indexer}
-}
-
-// List lists all LocalQueues in the indexer.
-func (s *localQueueLister) List(selector labels.Selector) (ret []*v1beta1.LocalQueue, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.LocalQueue))
- })
- return ret, err
+ return &localQueueLister{listers.New[*v1beta1.LocalQueue](indexer, v1beta1.Resource("localqueue"))}
}
// LocalQueues returns an object that can list and get LocalQueues.
func (s *localQueueLister) LocalQueues(namespace string) LocalQueueNamespaceLister {
- return localQueueNamespaceLister{indexer: s.indexer, namespace: namespace}
+ return localQueueNamespaceLister{listers.NewNamespaced[*v1beta1.LocalQueue](s.ResourceIndexer, namespace)}
}
// LocalQueueNamespaceLister helps list and get LocalQueues.
@@ -73,26 +65,5 @@ type LocalQueueNamespaceLister interface {
// localQueueNamespaceLister implements the LocalQueueNamespaceLister
// interface.
type localQueueNamespaceLister struct {
- indexer cache.Indexer
- namespace string
-}
-
-// List lists all LocalQueues in the indexer for a given namespace.
-func (s localQueueNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.LocalQueue, err error) {
- err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.LocalQueue))
- })
- return ret, err
-}
-
-// Get retrieves the LocalQueue from the indexer for a given namespace and name.
-func (s localQueueNamespaceLister) Get(name string) (*v1beta1.LocalQueue, error) {
- obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1beta1.Resource("localqueue"), name)
- }
- return obj.(*v1beta1.LocalQueue), nil
+ listers.ResourceIndexer[*v1beta1.LocalQueue]
}
diff --git a/client-go/listers/kueue/v1alpha1/multikueuecluster.go b/client-go/listers/kueue/v1beta1/multikueuecluster.go
similarity index 57%
rename from client-go/listers/kueue/v1alpha1/multikueuecluster.go
rename to client-go/listers/kueue/v1beta1/multikueuecluster.go
index 1d129d4aa7d..ef09942f151 100644
--- a/client-go/listers/kueue/v1alpha1/multikueuecluster.go
+++ b/client-go/listers/kueue/v1beta1/multikueuecluster.go
@@ -15,13 +15,13 @@ limitations under the License.
*/
// Code generated by lister-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
// MultiKueueClusterLister helps list MultiKueueClusters.
@@ -29,39 +29,19 @@ import (
type MultiKueueClusterLister interface {
// List lists all MultiKueueClusters in the indexer.
// Objects returned here must be treated as read-only.
- List(selector labels.Selector) (ret []*v1alpha1.MultiKueueCluster, err error)
+ List(selector labels.Selector) (ret []*v1beta1.MultiKueueCluster, err error)
// Get retrieves the MultiKueueCluster from the index for a given name.
// Objects returned here must be treated as read-only.
- Get(name string) (*v1alpha1.MultiKueueCluster, error)
+ Get(name string) (*v1beta1.MultiKueueCluster, error)
MultiKueueClusterListerExpansion
}
// multiKueueClusterLister implements the MultiKueueClusterLister interface.
type multiKueueClusterLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.MultiKueueCluster]
}
// NewMultiKueueClusterLister returns a new MultiKueueClusterLister.
func NewMultiKueueClusterLister(indexer cache.Indexer) MultiKueueClusterLister {
- return &multiKueueClusterLister{indexer: indexer}
-}
-
-// List lists all MultiKueueClusters in the indexer.
-func (s *multiKueueClusterLister) List(selector labels.Selector) (ret []*v1alpha1.MultiKueueCluster, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.MultiKueueCluster))
- })
- return ret, err
-}
-
-// Get retrieves the MultiKueueCluster from the index for a given name.
-func (s *multiKueueClusterLister) Get(name string) (*v1alpha1.MultiKueueCluster, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("multikueuecluster"), name)
- }
- return obj.(*v1alpha1.MultiKueueCluster), nil
+ return &multiKueueClusterLister{listers.New[*v1beta1.MultiKueueCluster](indexer, v1beta1.Resource("multikueuecluster"))}
}
diff --git a/client-go/listers/kueue/v1alpha1/multikueueconfig.go b/client-go/listers/kueue/v1beta1/multikueueconfig.go
similarity index 57%
rename from client-go/listers/kueue/v1alpha1/multikueueconfig.go
rename to client-go/listers/kueue/v1beta1/multikueueconfig.go
index b38713c2f26..ecefa8a6991 100644
--- a/client-go/listers/kueue/v1alpha1/multikueueconfig.go
+++ b/client-go/listers/kueue/v1beta1/multikueueconfig.go
@@ -15,13 +15,13 @@ limitations under the License.
*/
// Code generated by lister-gen. DO NOT EDIT.
-package v1alpha1
+package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
- v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
// MultiKueueConfigLister helps list MultiKueueConfigs.
@@ -29,39 +29,19 @@ import (
type MultiKueueConfigLister interface {
// List lists all MultiKueueConfigs in the indexer.
// Objects returned here must be treated as read-only.
- List(selector labels.Selector) (ret []*v1alpha1.MultiKueueConfig, err error)
+ List(selector labels.Selector) (ret []*v1beta1.MultiKueueConfig, err error)
// Get retrieves the MultiKueueConfig from the index for a given name.
// Objects returned here must be treated as read-only.
- Get(name string) (*v1alpha1.MultiKueueConfig, error)
+ Get(name string) (*v1beta1.MultiKueueConfig, error)
MultiKueueConfigListerExpansion
}
// multiKueueConfigLister implements the MultiKueueConfigLister interface.
type multiKueueConfigLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.MultiKueueConfig]
}
// NewMultiKueueConfigLister returns a new MultiKueueConfigLister.
func NewMultiKueueConfigLister(indexer cache.Indexer) MultiKueueConfigLister {
- return &multiKueueConfigLister{indexer: indexer}
-}
-
-// List lists all MultiKueueConfigs in the indexer.
-func (s *multiKueueConfigLister) List(selector labels.Selector) (ret []*v1alpha1.MultiKueueConfig, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.MultiKueueConfig))
- })
- return ret, err
-}
-
-// Get retrieves the MultiKueueConfig from the index for a given name.
-func (s *multiKueueConfigLister) Get(name string) (*v1alpha1.MultiKueueConfig, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("multikueueconfig"), name)
- }
- return obj.(*v1alpha1.MultiKueueConfig), nil
+ return &multiKueueConfigLister{listers.New[*v1beta1.MultiKueueConfig](indexer, v1beta1.Resource("multikueueconfig"))}
}
diff --git a/client-go/listers/kueue/v1beta1/provisioningrequestconfig.go b/client-go/listers/kueue/v1beta1/provisioningrequestconfig.go
index 8fff3cd047f..a8666e1af75 100644
--- a/client-go/listers/kueue/v1beta1/provisioningrequestconfig.go
+++ b/client-go/listers/kueue/v1beta1/provisioningrequestconfig.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
@@ -38,30 +38,10 @@ type ProvisioningRequestConfigLister interface {
// provisioningRequestConfigLister implements the ProvisioningRequestConfigLister interface.
type provisioningRequestConfigLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.ProvisioningRequestConfig]
}
// NewProvisioningRequestConfigLister returns a new ProvisioningRequestConfigLister.
func NewProvisioningRequestConfigLister(indexer cache.Indexer) ProvisioningRequestConfigLister {
- return &provisioningRequestConfigLister{indexer: indexer}
-}
-
-// List lists all ProvisioningRequestConfigs in the indexer.
-func (s *provisioningRequestConfigLister) List(selector labels.Selector) (ret []*v1beta1.ProvisioningRequestConfig, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.ProvisioningRequestConfig))
- })
- return ret, err
-}
-
-// Get retrieves the ProvisioningRequestConfig from the index for a given name.
-func (s *provisioningRequestConfigLister) Get(name string) (*v1beta1.ProvisioningRequestConfig, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1beta1.Resource("provisioningrequestconfig"), name)
- }
- return obj.(*v1beta1.ProvisioningRequestConfig), nil
+ return &provisioningRequestConfigLister{listers.New[*v1beta1.ProvisioningRequestConfig](indexer, v1beta1.Resource("provisioningrequestconfig"))}
}
diff --git a/client-go/listers/kueue/v1beta1/resourceflavor.go b/client-go/listers/kueue/v1beta1/resourceflavor.go
index 18b00b47015..ef06f693ff2 100644
--- a/client-go/listers/kueue/v1beta1/resourceflavor.go
+++ b/client-go/listers/kueue/v1beta1/resourceflavor.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
@@ -38,30 +38,10 @@ type ResourceFlavorLister interface {
// resourceFlavorLister implements the ResourceFlavorLister interface.
type resourceFlavorLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.ResourceFlavor]
}
// NewResourceFlavorLister returns a new ResourceFlavorLister.
func NewResourceFlavorLister(indexer cache.Indexer) ResourceFlavorLister {
- return &resourceFlavorLister{indexer: indexer}
-}
-
-// List lists all ResourceFlavors in the indexer.
-func (s *resourceFlavorLister) List(selector labels.Selector) (ret []*v1beta1.ResourceFlavor, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.ResourceFlavor))
- })
- return ret, err
-}
-
-// Get retrieves the ResourceFlavor from the index for a given name.
-func (s *resourceFlavorLister) Get(name string) (*v1beta1.ResourceFlavor, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1beta1.Resource("resourceflavor"), name)
- }
- return obj.(*v1beta1.ResourceFlavor), nil
+ return &resourceFlavorLister{listers.New[*v1beta1.ResourceFlavor](indexer, v1beta1.Resource("resourceflavor"))}
}
diff --git a/client-go/listers/kueue/v1beta1/workload.go b/client-go/listers/kueue/v1beta1/workload.go
index 599fce25f14..e13aa153d2b 100644
--- a/client-go/listers/kueue/v1beta1/workload.go
+++ b/client-go/listers/kueue/v1beta1/workload.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
@@ -37,25 +37,17 @@ type WorkloadLister interface {
// workloadLister implements the WorkloadLister interface.
type workloadLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.Workload]
}
// NewWorkloadLister returns a new WorkloadLister.
func NewWorkloadLister(indexer cache.Indexer) WorkloadLister {
- return &workloadLister{indexer: indexer}
-}
-
-// List lists all Workloads in the indexer.
-func (s *workloadLister) List(selector labels.Selector) (ret []*v1beta1.Workload, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.Workload))
- })
- return ret, err
+ return &workloadLister{listers.New[*v1beta1.Workload](indexer, v1beta1.Resource("workload"))}
}
// Workloads returns an object that can list and get Workloads.
func (s *workloadLister) Workloads(namespace string) WorkloadNamespaceLister {
- return workloadNamespaceLister{indexer: s.indexer, namespace: namespace}
+ return workloadNamespaceLister{listers.NewNamespaced[*v1beta1.Workload](s.ResourceIndexer, namespace)}
}
// WorkloadNamespaceLister helps list and get Workloads.
@@ -73,26 +65,5 @@ type WorkloadNamespaceLister interface {
// workloadNamespaceLister implements the WorkloadNamespaceLister
// interface.
type workloadNamespaceLister struct {
- indexer cache.Indexer
- namespace string
-}
-
-// List lists all Workloads in the indexer for a given namespace.
-func (s workloadNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Workload, err error) {
- err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.Workload))
- })
- return ret, err
-}
-
-// Get retrieves the Workload from the indexer for a given namespace and name.
-func (s workloadNamespaceLister) Get(name string) (*v1beta1.Workload, error) {
- obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1beta1.Resource("workload"), name)
- }
- return obj.(*v1beta1.Workload), nil
+ listers.ResourceIndexer[*v1beta1.Workload]
}
diff --git a/client-go/listers/kueue/v1beta1/workloadpriorityclass.go b/client-go/listers/kueue/v1beta1/workloadpriorityclass.go
index 7037ad9469e..71b9611ab98 100644
--- a/client-go/listers/kueue/v1beta1/workloadpriorityclass.go
+++ b/client-go/listers/kueue/v1beta1/workloadpriorityclass.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1beta1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
@@ -38,30 +38,10 @@ type WorkloadPriorityClassLister interface {
// workloadPriorityClassLister implements the WorkloadPriorityClassLister interface.
type workloadPriorityClassLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1beta1.WorkloadPriorityClass]
}
// NewWorkloadPriorityClassLister returns a new WorkloadPriorityClassLister.
func NewWorkloadPriorityClassLister(indexer cache.Indexer) WorkloadPriorityClassLister {
- return &workloadPriorityClassLister{indexer: indexer}
-}
-
-// List lists all WorkloadPriorityClasses in the indexer.
-func (s *workloadPriorityClassLister) List(selector labels.Selector) (ret []*v1beta1.WorkloadPriorityClass, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1beta1.WorkloadPriorityClass))
- })
- return ret, err
-}
-
-// Get retrieves the WorkloadPriorityClass from the index for a given name.
-func (s *workloadPriorityClassLister) Get(name string) (*v1beta1.WorkloadPriorityClass, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1beta1.Resource("workloadpriorityclass"), name)
- }
- return obj.(*v1beta1.WorkloadPriorityClass), nil
+ return &workloadPriorityClassLister{listers.New[*v1beta1.WorkloadPriorityClass](indexer, v1beta1.Resource("workloadpriorityclass"))}
}
diff --git a/client-go/listers/visibility/v1alpha1/clusterqueue.go b/client-go/listers/visibility/v1alpha1/clusterqueue.go
index 20b0ceb1e03..d4e9d6705b8 100644
--- a/client-go/listers/visibility/v1alpha1/clusterqueue.go
+++ b/client-go/listers/visibility/v1alpha1/clusterqueue.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1alpha1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
)
@@ -38,30 +38,10 @@ type ClusterQueueLister interface {
// clusterQueueLister implements the ClusterQueueLister interface.
type clusterQueueLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1alpha1.ClusterQueue]
}
// NewClusterQueueLister returns a new ClusterQueueLister.
func NewClusterQueueLister(indexer cache.Indexer) ClusterQueueLister {
- return &clusterQueueLister{indexer: indexer}
-}
-
-// List lists all ClusterQueues in the indexer.
-func (s *clusterQueueLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterQueue, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.ClusterQueue))
- })
- return ret, err
-}
-
-// Get retrieves the ClusterQueue from the index for a given name.
-func (s *clusterQueueLister) Get(name string) (*v1alpha1.ClusterQueue, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("clusterqueue"), name)
- }
- return obj.(*v1alpha1.ClusterQueue), nil
+ return &clusterQueueLister{listers.New[*v1alpha1.ClusterQueue](indexer, v1alpha1.Resource("clusterqueue"))}
}
diff --git a/client-go/listers/visibility/v1alpha1/localqueue.go b/client-go/listers/visibility/v1alpha1/localqueue.go
index 18838e40585..1b55b25d8c6 100644
--- a/client-go/listers/visibility/v1alpha1/localqueue.go
+++ b/client-go/listers/visibility/v1alpha1/localqueue.go
@@ -18,8 +18,8 @@ limitations under the License.
package v1alpha1
import (
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
)
@@ -37,25 +37,17 @@ type LocalQueueLister interface {
// localQueueLister implements the LocalQueueLister interface.
type localQueueLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1alpha1.LocalQueue]
}
// NewLocalQueueLister returns a new LocalQueueLister.
func NewLocalQueueLister(indexer cache.Indexer) LocalQueueLister {
- return &localQueueLister{indexer: indexer}
-}
-
-// List lists all LocalQueues in the indexer.
-func (s *localQueueLister) List(selector labels.Selector) (ret []*v1alpha1.LocalQueue, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.LocalQueue))
- })
- return ret, err
+ return &localQueueLister{listers.New[*v1alpha1.LocalQueue](indexer, v1alpha1.Resource("localqueue"))}
}
// LocalQueues returns an object that can list and get LocalQueues.
func (s *localQueueLister) LocalQueues(namespace string) LocalQueueNamespaceLister {
- return localQueueNamespaceLister{indexer: s.indexer, namespace: namespace}
+ return localQueueNamespaceLister{listers.NewNamespaced[*v1alpha1.LocalQueue](s.ResourceIndexer, namespace)}
}
// LocalQueueNamespaceLister helps list and get LocalQueues.
@@ -73,26 +65,5 @@ type LocalQueueNamespaceLister interface {
// localQueueNamespaceLister implements the LocalQueueNamespaceLister
// interface.
type localQueueNamespaceLister struct {
- indexer cache.Indexer
- namespace string
-}
-
-// List lists all LocalQueues in the indexer for a given namespace.
-func (s localQueueNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.LocalQueue, err error) {
- err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.LocalQueue))
- })
- return ret, err
-}
-
-// Get retrieves the LocalQueue from the indexer for a given namespace and name.
-func (s localQueueNamespaceLister) Get(name string) (*v1alpha1.LocalQueue, error) {
- obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("localqueue"), name)
- }
- return obj.(*v1alpha1.LocalQueue), nil
+ listers.ResourceIndexer[*v1alpha1.LocalQueue]
}
diff --git a/client-go/listers/visibility/v1beta1/clusterqueue.go b/client-go/listers/visibility/v1beta1/clusterqueue.go
new file mode 100644
index 00000000000..de16fa1c252
--- /dev/null
+++ b/client-go/listers/visibility/v1beta1/clusterqueue.go
@@ -0,0 +1,47 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
+ "k8s.io/client-go/tools/cache"
+ v1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+)
+
+// ClusterQueueLister helps list ClusterQueues.
+// All objects returned here must be treated as read-only.
+type ClusterQueueLister interface {
+ // List lists all ClusterQueues in the indexer.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1beta1.ClusterQueue, err error)
+ // Get retrieves the ClusterQueue from the index for a given name.
+ // Objects returned here must be treated as read-only.
+ Get(name string) (*v1beta1.ClusterQueue, error)
+ ClusterQueueListerExpansion
+}
+
+// clusterQueueLister implements the ClusterQueueLister interface.
+type clusterQueueLister struct {
+ listers.ResourceIndexer[*v1beta1.ClusterQueue]
+}
+
+// NewClusterQueueLister returns a new ClusterQueueLister.
+func NewClusterQueueLister(indexer cache.Indexer) ClusterQueueLister {
+ return &clusterQueueLister{listers.New[*v1beta1.ClusterQueue](indexer, v1beta1.Resource("clusterqueue"))}
+}
diff --git a/client-go/listers/visibility/v1beta1/expansion_generated.go b/client-go/listers/visibility/v1beta1/expansion_generated.go
new file mode 100644
index 00000000000..c53049a1cf2
--- /dev/null
+++ b/client-go/listers/visibility/v1beta1/expansion_generated.go
@@ -0,0 +1,30 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1beta1
+
+// ClusterQueueListerExpansion allows custom methods to be added to
+// ClusterQueueLister.
+type ClusterQueueListerExpansion interface{}
+
+// LocalQueueListerExpansion allows custom methods to be added to
+// LocalQueueLister.
+type LocalQueueListerExpansion interface{}
+
+// LocalQueueNamespaceListerExpansion allows custom methods to be added to
+// LocalQueueNamespaceLister.
+type LocalQueueNamespaceListerExpansion interface{}
diff --git a/client-go/listers/visibility/v1beta1/localqueue.go b/client-go/listers/visibility/v1beta1/localqueue.go
new file mode 100644
index 00000000000..01319fb93af
--- /dev/null
+++ b/client-go/listers/visibility/v1beta1/localqueue.go
@@ -0,0 +1,69 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
+ "k8s.io/client-go/tools/cache"
+ v1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+)
+
+// LocalQueueLister helps list LocalQueues.
+// All objects returned here must be treated as read-only.
+type LocalQueueLister interface {
+ // List lists all LocalQueues in the indexer.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1beta1.LocalQueue, err error)
+ // LocalQueues returns an object that can list and get LocalQueues.
+ LocalQueues(namespace string) LocalQueueNamespaceLister
+ LocalQueueListerExpansion
+}
+
+// localQueueLister implements the LocalQueueLister interface.
+type localQueueLister struct {
+ listers.ResourceIndexer[*v1beta1.LocalQueue]
+}
+
+// NewLocalQueueLister returns a new LocalQueueLister.
+func NewLocalQueueLister(indexer cache.Indexer) LocalQueueLister {
+ return &localQueueLister{listers.New[*v1beta1.LocalQueue](indexer, v1beta1.Resource("localqueue"))}
+}
+
+// LocalQueues returns an object that can list and get LocalQueues.
+func (s *localQueueLister) LocalQueues(namespace string) LocalQueueNamespaceLister {
+ return localQueueNamespaceLister{listers.NewNamespaced[*v1beta1.LocalQueue](s.ResourceIndexer, namespace)}
+}
+
+// LocalQueueNamespaceLister helps list and get LocalQueues.
+// All objects returned here must be treated as read-only.
+type LocalQueueNamespaceLister interface {
+ // List lists all LocalQueues in the indexer for a given namespace.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1beta1.LocalQueue, err error)
+ // Get retrieves the LocalQueue from the indexer for a given namespace and name.
+ // Objects returned here must be treated as read-only.
+ Get(name string) (*v1beta1.LocalQueue, error)
+ LocalQueueNamespaceListerExpansion
+}
+
+// localQueueNamespaceLister implements the LocalQueueNamespaceLister
+// interface.
+type localQueueNamespaceLister struct {
+ listers.ResourceIndexer[*v1beta1.LocalQueue]
+}
diff --git a/cmd/experimental/kjobctl/.golangci.yaml b/cmd/experimental/kjobctl/.golangci.yaml
index 4bb475b7e05..590912562dd 100644
--- a/cmd/experimental/kjobctl/.golangci.yaml
+++ b/cmd/experimental/kjobctl/.golangci.yaml
@@ -9,11 +9,17 @@ linters-settings:
disabled-checks:
- appendAssign
- exitAfterDefer
- goimports:
- local-prefixes: sigs.k8s.io/kueue
govet:
enable:
- nilness
+ gci:
+ sections:
+ - standard # Standard section: captures all standard packages.
+ - default # Default section: contains all imports that could not be matched to another section type.
+ - prefix(sigs.k8s.io/kueue/cmd/experimental/kjobctl) # Custom section: groups all imports with the specified Prefix.
+ - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
+ - dot # Dot section: contains all dot imports.
+ skip-generated: true # Skip generated files.
perfsprint:
int-conversion: false
errorf: true
@@ -32,9 +38,9 @@ linters:
- copyloopvar
- dupword
- durationcheck
+ - gci
- ginkgolinter
- gocritic
- - goimports
- govet
- loggercheck
- misspell
@@ -53,6 +59,12 @@ issues:
- staticcheck
# TODO(#768): Drop when incrementing the API version.
text: "SA1019: constants.QueueAnnotation is deprecated"
+ - linters:
+ - staticcheck
+ text: "SA1019: j.RayCluster.Status.State is deprecated: the State field is replaced by the Conditions field."
+ - linters:
+ - staticcheck
+ text: "SA1019: rayCluster.Status.State is deprecated: the State field is replaced by the Conditions field."
# Show all issues from a linter
max-issues-per-linter: 0
# Show all issues with the same text
diff --git a/cmd/experimental/kjobctl/Makefile b/cmd/experimental/kjobctl/Makefile
index 96d7b11a792..af65c37e63a 100644
--- a/cmd/experimental/kjobctl/Makefile
+++ b/cmd/experimental/kjobctl/Makefile
@@ -1,5 +1,9 @@
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.30.0
+ENVTEST_K8S_VERSION = 1.31.0
+
+ifeq ($(shell uname),Darwin)
+ GOFLAGS ?= -ldflags=-extldflags=-Wl,-ld_classic
+endif
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -59,7 +63,7 @@ artifacts: kustomize ## Generate release artifacts.
if [ -d artifacts ]; then rm -rf artifacts; fi
mkdir -p artifacts
$(KUSTOMIZE) build config/default -o artifacts/manifests.yaml
- CGO_ENABLED=$(CGO_ENABLED) GO_CMD="$(GO_CMD)" LD_FLAGS="$(LD_FLAGS)" BUILD_DIR="artifacts" BUILD_NAME=kubectl-kjob PLATFORMS="$(CLI_PLATFORMS)" ./hack/multiplatform-build.sh ./cmd/main.go
+ CGO_ENABLED=$(CGO_ENABLED) GO_CMD="$(GO_CMD)" LD_FLAGS="$(LD_FLAGS)" BUILD_DIR="artifacts" BUILD_NAME=kubectl-kjob PLATFORMS="$(CLI_PLATFORMS)" ./hack/multiplatform-build.sh ./cmd/kjobctl/main.go
##@ Development
@@ -118,7 +122,7 @@ test: verify vet test-unit test-integration ## Run all tests.
.PHONY: test-unit
test-unit: gomod-download gotestsum embeded-manifest ## Run unit tests.
- $(GOTESTSUM) --junitfile $(ARTIFACTS)/junit-unit.xml -- $(GO_TEST_FLAGS) $(shell $(GO_CMD) list ./... | grep -v '/test/') -coverpkg=./... -coverprofile $(ARTIFACTS)/cover.out
+ $(GOTESTSUM) --junitfile $(ARTIFACTS)/junit-unit.xml -- $(GOFLAGS) $(GO_TEST_FLAGS) $(shell $(GO_CMD) list ./... | grep -v '/test/') -coverpkg=./... -coverprofile $(ARTIFACTS)/cover.out
.PHONY: test-integration
test-integration: gomod-download envtest ginkgo embeded-manifest ray-operator-crd ## Run integration tests.
@@ -152,19 +156,17 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
.PHONY: kubectl-kjob
kubectl-kjob: embeded-manifest ## Build kubectl-kjob binary file to bin directory.
- CGO_ENABLED=$(CGO_ENABLED) $(GO_BUILD_ENV) $(GO_CMD) build -ldflags="$(LD_FLAGS)" -o bin/kubectl-kjob cmd/main.go
+ CGO_ENABLED=$(CGO_ENABLED) $(GO_BUILD_ENV) $(GO_CMD) build -ldflags="$(LD_FLAGS)" -o bin/kubectl-kjob cmd/kjobctl/main.go
.PHONY: kjobctl-docs
kjobctl-docs: ## Build kjobctl-docs binary file to bin directory.
- cd $(PROJECT_DIR)/hack/tools && \
- go mod download && \
- $(GO_BUILD_ENV) $(GO_CMD) build -ldflags="$(LD_FLAGS)" -o $(PROJECT_DIR)/bin/kjobctl-docs ./kjobctl-docs/main.go
+ $(GO_BUILD_ENV) $(GO_CMD) build -ldflags="$(LD_FLAGS)" -o $(PROJECT_DIR)/bin/kjobctl-docs ./cmd/kjobctl-docs/main.go
.PHONY: generate-kjobctl-docs
generate-kjobctl-docs: kjobctl-docs ## Generate kjobctl docs.
rm -Rf $(PROJECT_DIR)/docs/commands/*
$(PROJECT_DIR)/bin/kjobctl-docs \
- $(PROJECT_DIR)/hack/tools/kjobctl-docs/templates \
+ $(PROJECT_DIR)/cmd/kjobctl-docs/templates \
$(PROJECT_DIR)/docs/commands
##@ Dependencies
diff --git a/cmd/experimental/kjobctl/README.md b/cmd/experimental/kjobctl/README.md
index a3047412137..c7ac6cd25c2 100644
--- a/cmd/experimental/kjobctl/README.md
+++ b/cmd/experimental/kjobctl/README.md
@@ -9,7 +9,7 @@ Read the [overview](docs/_index.md) to learn more.
## Getting Started
### Prerequisites
-- go version v1.22.6+
+- go version v1.23+
- kubectl version v1.27+.
- Access to a Kubernetes v1.27+ cluster.
diff --git a/cmd/experimental/kjobctl/apis/v1alpha1/application_profile_types.go b/cmd/experimental/kjobctl/apis/v1alpha1/application_profile_types.go
index 738d5c27ceb..451ff4ed9eb 100644
--- a/cmd/experimental/kjobctl/apis/v1alpha1/application_profile_types.go
+++ b/cmd/experimental/kjobctl/apis/v1alpha1/application_profile_types.go
@@ -55,6 +55,7 @@ const (
GpusPerTaskFlag Flag = "gpus-per-task"
InputFlag Flag = "input"
JobNameFlag Flag = "job-name"
+ MemPerNodeFlag Flag = "mem"
MemPerCPUFlag Flag = "mem-per-cpu"
MemPerGPUFlag Flag = "mem-per-gpu"
MemPerTaskFlag Flag = "mem-per-task"
@@ -62,6 +63,7 @@ const (
NTasksFlag Flag = "ntasks"
OutputFlag Flag = "output"
PartitionFlag Flag = "partition"
+ PriorityFlag Flag = "priority"
)
// TemplateReference is the name of the template.
@@ -83,6 +85,7 @@ type TemplateReference string
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('gpus-per-task' in self.requiredFlags) || self.name == 'Slurm'", message="gpus-per-task flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('input' in self.requiredFlags) || self.name == 'Slurm'", message="input flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('job-name' in self.requiredFlags) || self.name == 'Slurm'", message="job-name flag can be used only on Slurm mode"
+// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('mem' in self.requiredFlags) || self.name == 'Slurm'", message="mem flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('mem-per-cpu' in self.requiredFlags) || self.name == 'Slurm'", message="mem-per-cpu flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('mem-per-gpu' in self.requiredFlags) || self.name == 'Slurm'", message="mem-per-gpu flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('mem-per-task' in self.requiredFlags) || self.name == 'Slurm'", message="mem-per-task flag can be used only on Slurm mode"
@@ -90,6 +93,7 @@ type TemplateReference string
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('ntasks' in self.requiredFlags) || self.name == 'Slurm'", message="ntasks flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('output' in self.requiredFlags) || self.name == 'Slurm'", message="output flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('partition' in self.requiredFlags) || self.name == 'Slurm'", message="partition flag can be used only on Slurm mode"
+// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || !('priority' in self.requiredFlags) || self.name == 'Slurm'", message="priority flag can be used only on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || self.name != 'Slurm' || !('parallelism' in self.requiredFlags)", message="parallelism flag can't be used on Slurm mode"
// +kubebuilder:validation:XValidation:rule="!has(self.requiredFlags) || self.name != 'Slurm' || !('completions' in self.requiredFlags)", message="completions flag can't be used on Slurm mode"
type SupportedMode struct {
@@ -118,14 +122,14 @@ type SupportedMode struct {
// The request flag used only for Interactive and Job modes.
// The cmd flag used only for Interactive, Job, and RayJob.
// If the raycluster flag are set, none of localqueue, replicas, min-replicas, or max-replicas can be set.
- // For the Slurm mode, the possible values are: array, cpus-per-task, error, gpus-per-task, input, job-name, mem-per-cpu,
- // mem-per-gpu, mem-per-task, nodes, ntasks, output, partition, localqueue.
+ // For the Slurm mode, the possible values are: array, cpus-per-task, error, gpus-per-task, input, job-name, mem, mem-per-cpu,
+ // mem-per-gpu, mem-per-task, nodes, ntasks, output, partition, localqueue, priority.
//
// cmd and requests values are going to be added only to the first primary container.
//
// +optional
// +listType=set
- // +kubebuilder:validation:MaxItems=12
+ // +kubebuilder:validation:MaxItems=13
RequiredFlags []Flag `json:"requiredFlags,omitempty"`
}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/fake/clientset_generated.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/fake/clientset_generated.go
index 86f0112c71c..0f9beb6633d 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/fake/clientset_generated.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/fake/clientset_generated.go
@@ -30,8 +30,12 @@ import (
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
-// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
+//
+// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
+// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
+// via --with-applyconfig).
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/applicationprofile.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/applicationprofile.go
index c0c2b8ed451..e57894b2c60 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/applicationprofile.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/applicationprofile.go
@@ -19,12 +19,11 @@ package v1alpha1
import (
"context"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1alpha1 "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
scheme "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/scheme"
)
@@ -50,128 +49,18 @@ type ApplicationProfileInterface interface {
// applicationProfiles implements ApplicationProfileInterface
type applicationProfiles struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithList[*v1alpha1.ApplicationProfile, *v1alpha1.ApplicationProfileList]
}
// newApplicationProfiles returns a ApplicationProfiles
func newApplicationProfiles(c *KjobctlV1alpha1Client, namespace string) *applicationProfiles {
return &applicationProfiles{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithList[*v1alpha1.ApplicationProfile, *v1alpha1.ApplicationProfileList](
+ "applicationprofiles",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1alpha1.ApplicationProfile { return &v1alpha1.ApplicationProfile{} },
+ func() *v1alpha1.ApplicationProfileList { return &v1alpha1.ApplicationProfileList{} }),
}
}
-
-// Get takes name of the applicationProfile, and returns the corresponding applicationProfile object, and an error if there is any.
-func (c *applicationProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ApplicationProfile, err error) {
- result = &v1alpha1.ApplicationProfile{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("applicationprofiles").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ApplicationProfiles that match those selectors.
-func (c *applicationProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ApplicationProfileList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.ApplicationProfileList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("applicationprofiles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested applicationProfiles.
-func (c *applicationProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("applicationprofiles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a applicationProfile and creates it. Returns the server's representation of the applicationProfile, and an error, if there is any.
-func (c *applicationProfiles) Create(ctx context.Context, applicationProfile *v1alpha1.ApplicationProfile, opts v1.CreateOptions) (result *v1alpha1.ApplicationProfile, err error) {
- result = &v1alpha1.ApplicationProfile{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("applicationprofiles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(applicationProfile).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a applicationProfile and updates it. Returns the server's representation of the applicationProfile, and an error, if there is any.
-func (c *applicationProfiles) Update(ctx context.Context, applicationProfile *v1alpha1.ApplicationProfile, opts v1.UpdateOptions) (result *v1alpha1.ApplicationProfile, err error) {
- result = &v1alpha1.ApplicationProfile{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("applicationprofiles").
- Name(applicationProfile.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(applicationProfile).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the applicationProfile and deletes it. Returns an error if one occurs.
-func (c *applicationProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("applicationprofiles").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *applicationProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("applicationprofiles").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched applicationProfile.
-func (c *applicationProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ApplicationProfile, err error) {
- result = &v1alpha1.ApplicationProfile{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("applicationprofiles").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_applicationprofile.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_applicationprofile.go
index facf97e2064..80963e1e9f4 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_applicationprofile.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_applicationprofile.go
@@ -40,22 +40,24 @@ var applicationprofilesKind = v1alpha1.SchemeGroupVersion.WithKind("ApplicationP
// Get takes name of the applicationProfile, and returns the corresponding applicationProfile object, and an error if there is any.
func (c *FakeApplicationProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ApplicationProfile, err error) {
+ emptyResult := &v1alpha1.ApplicationProfile{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(applicationprofilesResource, c.ns, name), &v1alpha1.ApplicationProfile{})
+ Invokes(testing.NewGetActionWithOptions(applicationprofilesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ApplicationProfile), err
}
// List takes label and field selectors, and returns the list of ApplicationProfiles that match those selectors.
func (c *FakeApplicationProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ApplicationProfileList, err error) {
+ emptyResult := &v1alpha1.ApplicationProfileList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(applicationprofilesResource, applicationprofilesKind, c.ns, opts), &v1alpha1.ApplicationProfileList{})
+ Invokes(testing.NewListActionWithOptions(applicationprofilesResource, applicationprofilesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,28 +76,30 @@ func (c *FakeApplicationProfiles) List(ctx context.Context, opts v1.ListOptions)
// Watch returns a watch.Interface that watches the requested applicationProfiles.
func (c *FakeApplicationProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(applicationprofilesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(applicationprofilesResource, c.ns, opts))
}
// Create takes the representation of a applicationProfile and creates it. Returns the server's representation of the applicationProfile, and an error, if there is any.
func (c *FakeApplicationProfiles) Create(ctx context.Context, applicationProfile *v1alpha1.ApplicationProfile, opts v1.CreateOptions) (result *v1alpha1.ApplicationProfile, err error) {
+ emptyResult := &v1alpha1.ApplicationProfile{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(applicationprofilesResource, c.ns, applicationProfile), &v1alpha1.ApplicationProfile{})
+ Invokes(testing.NewCreateActionWithOptions(applicationprofilesResource, c.ns, applicationProfile, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ApplicationProfile), err
}
// Update takes the representation of a applicationProfile and updates it. Returns the server's representation of the applicationProfile, and an error, if there is any.
func (c *FakeApplicationProfiles) Update(ctx context.Context, applicationProfile *v1alpha1.ApplicationProfile, opts v1.UpdateOptions) (result *v1alpha1.ApplicationProfile, err error) {
+ emptyResult := &v1alpha1.ApplicationProfile{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(applicationprofilesResource, c.ns, applicationProfile), &v1alpha1.ApplicationProfile{})
+ Invokes(testing.NewUpdateActionWithOptions(applicationprofilesResource, c.ns, applicationProfile, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ApplicationProfile), err
}
@@ -110,7 +114,7 @@ func (c *FakeApplicationProfiles) Delete(ctx context.Context, name string, opts
// DeleteCollection deletes a collection of objects.
func (c *FakeApplicationProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(applicationprofilesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(applicationprofilesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ApplicationProfileList{})
return err
@@ -118,11 +122,12 @@ func (c *FakeApplicationProfiles) DeleteCollection(ctx context.Context, opts v1.
// Patch applies the patch and returns the patched applicationProfile.
func (c *FakeApplicationProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ApplicationProfile, err error) {
+ emptyResult := &v1alpha1.ApplicationProfile{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(applicationprofilesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ApplicationProfile{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(applicationprofilesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ApplicationProfile), err
}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_jobtemplate.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_jobtemplate.go
index 590d64aa0a0..456d17661cf 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_jobtemplate.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_jobtemplate.go
@@ -40,22 +40,24 @@ var jobtemplatesKind = v1alpha1.SchemeGroupVersion.WithKind("JobTemplate")
// Get takes name of the jobTemplate, and returns the corresponding jobTemplate object, and an error if there is any.
func (c *FakeJobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobTemplate, err error) {
+ emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(jobtemplatesResource, c.ns, name), &v1alpha1.JobTemplate{})
+ Invokes(testing.NewGetActionWithOptions(jobtemplatesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
// List takes label and field selectors, and returns the list of JobTemplates that match those selectors.
func (c *FakeJobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobTemplateList, err error) {
+ emptyResult := &v1alpha1.JobTemplateList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(jobtemplatesResource, jobtemplatesKind, c.ns, opts), &v1alpha1.JobTemplateList{})
+ Invokes(testing.NewListActionWithOptions(jobtemplatesResource, jobtemplatesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,28 +76,30 @@ func (c *FakeJobTemplates) List(ctx context.Context, opts v1.ListOptions) (resul
// Watch returns a watch.Interface that watches the requested jobTemplates.
func (c *FakeJobTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(jobtemplatesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(jobtemplatesResource, c.ns, opts))
}
// Create takes the representation of a jobTemplate and creates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
func (c *FakeJobTemplates) Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (result *v1alpha1.JobTemplate, err error) {
+ emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(jobtemplatesResource, c.ns, jobTemplate), &v1alpha1.JobTemplate{})
+ Invokes(testing.NewCreateActionWithOptions(jobtemplatesResource, c.ns, jobTemplate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
// Update takes the representation of a jobTemplate and updates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
func (c *FakeJobTemplates) Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) {
+ emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(jobtemplatesResource, c.ns, jobTemplate), &v1alpha1.JobTemplate{})
+ Invokes(testing.NewUpdateActionWithOptions(jobtemplatesResource, c.ns, jobTemplate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
@@ -110,7 +114,7 @@ func (c *FakeJobTemplates) Delete(ctx context.Context, name string, opts v1.Dele
// DeleteCollection deletes a collection of objects.
func (c *FakeJobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(jobtemplatesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(jobtemplatesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.JobTemplateList{})
return err
@@ -118,11 +122,12 @@ func (c *FakeJobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteO
// Patch applies the patch and returns the patched jobTemplate.
func (c *FakeJobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobTemplate, err error) {
+ emptyResult := &v1alpha1.JobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(jobtemplatesResource, c.ns, name, pt, data, subresources...), &v1alpha1.JobTemplate{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(jobtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.JobTemplate), err
}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayclustertemplate.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayclustertemplate.go
index 6de333512e1..4e0cb8637e3 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayclustertemplate.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayclustertemplate.go
@@ -40,22 +40,24 @@ var rayclustertemplatesKind = v1alpha1.SchemeGroupVersion.WithKind("RayClusterTe
// Get takes name of the rayClusterTemplate, and returns the corresponding rayClusterTemplate object, and an error if there is any.
func (c *FakeRayClusterTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RayClusterTemplate, err error) {
+ emptyResult := &v1alpha1.RayClusterTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(rayclustertemplatesResource, c.ns, name), &v1alpha1.RayClusterTemplate{})
+ Invokes(testing.NewGetActionWithOptions(rayclustertemplatesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayClusterTemplate), err
}
// List takes label and field selectors, and returns the list of RayClusterTemplates that match those selectors.
func (c *FakeRayClusterTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RayClusterTemplateList, err error) {
+ emptyResult := &v1alpha1.RayClusterTemplateList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(rayclustertemplatesResource, rayclustertemplatesKind, c.ns, opts), &v1alpha1.RayClusterTemplateList{})
+ Invokes(testing.NewListActionWithOptions(rayclustertemplatesResource, rayclustertemplatesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,28 +76,30 @@ func (c *FakeRayClusterTemplates) List(ctx context.Context, opts v1.ListOptions)
// Watch returns a watch.Interface that watches the requested rayClusterTemplates.
func (c *FakeRayClusterTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(rayclustertemplatesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(rayclustertemplatesResource, c.ns, opts))
}
// Create takes the representation of a rayClusterTemplate and creates it. Returns the server's representation of the rayClusterTemplate, and an error, if there is any.
func (c *FakeRayClusterTemplates) Create(ctx context.Context, rayClusterTemplate *v1alpha1.RayClusterTemplate, opts v1.CreateOptions) (result *v1alpha1.RayClusterTemplate, err error) {
+ emptyResult := &v1alpha1.RayClusterTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(rayclustertemplatesResource, c.ns, rayClusterTemplate), &v1alpha1.RayClusterTemplate{})
+ Invokes(testing.NewCreateActionWithOptions(rayclustertemplatesResource, c.ns, rayClusterTemplate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayClusterTemplate), err
}
// Update takes the representation of a rayClusterTemplate and updates it. Returns the server's representation of the rayClusterTemplate, and an error, if there is any.
func (c *FakeRayClusterTemplates) Update(ctx context.Context, rayClusterTemplate *v1alpha1.RayClusterTemplate, opts v1.UpdateOptions) (result *v1alpha1.RayClusterTemplate, err error) {
+ emptyResult := &v1alpha1.RayClusterTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(rayclustertemplatesResource, c.ns, rayClusterTemplate), &v1alpha1.RayClusterTemplate{})
+ Invokes(testing.NewUpdateActionWithOptions(rayclustertemplatesResource, c.ns, rayClusterTemplate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayClusterTemplate), err
}
@@ -110,7 +114,7 @@ func (c *FakeRayClusterTemplates) Delete(ctx context.Context, name string, opts
// DeleteCollection deletes a collection of objects.
func (c *FakeRayClusterTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(rayclustertemplatesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(rayclustertemplatesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.RayClusterTemplateList{})
return err
@@ -118,11 +122,12 @@ func (c *FakeRayClusterTemplates) DeleteCollection(ctx context.Context, opts v1.
// Patch applies the patch and returns the patched rayClusterTemplate.
func (c *FakeRayClusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RayClusterTemplate, err error) {
+ emptyResult := &v1alpha1.RayClusterTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(rayclustertemplatesResource, c.ns, name, pt, data, subresources...), &v1alpha1.RayClusterTemplate{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(rayclustertemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayClusterTemplate), err
}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayjobtemplate.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayjobtemplate.go
index b155cf40f7d..2c9ea7193e7 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayjobtemplate.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_rayjobtemplate.go
@@ -40,22 +40,24 @@ var rayjobtemplatesKind = v1alpha1.SchemeGroupVersion.WithKind("RayJobTemplate")
// Get takes name of the rayJobTemplate, and returns the corresponding rayJobTemplate object, and an error if there is any.
func (c *FakeRayJobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RayJobTemplate, err error) {
+ emptyResult := &v1alpha1.RayJobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(rayjobtemplatesResource, c.ns, name), &v1alpha1.RayJobTemplate{})
+ Invokes(testing.NewGetActionWithOptions(rayjobtemplatesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayJobTemplate), err
}
// List takes label and field selectors, and returns the list of RayJobTemplates that match those selectors.
func (c *FakeRayJobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RayJobTemplateList, err error) {
+ emptyResult := &v1alpha1.RayJobTemplateList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(rayjobtemplatesResource, rayjobtemplatesKind, c.ns, opts), &v1alpha1.RayJobTemplateList{})
+ Invokes(testing.NewListActionWithOptions(rayjobtemplatesResource, rayjobtemplatesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,28 +76,30 @@ func (c *FakeRayJobTemplates) List(ctx context.Context, opts v1.ListOptions) (re
// Watch returns a watch.Interface that watches the requested rayJobTemplates.
func (c *FakeRayJobTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(rayjobtemplatesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(rayjobtemplatesResource, c.ns, opts))
}
// Create takes the representation of a rayJobTemplate and creates it. Returns the server's representation of the rayJobTemplate, and an error, if there is any.
func (c *FakeRayJobTemplates) Create(ctx context.Context, rayJobTemplate *v1alpha1.RayJobTemplate, opts v1.CreateOptions) (result *v1alpha1.RayJobTemplate, err error) {
+ emptyResult := &v1alpha1.RayJobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(rayjobtemplatesResource, c.ns, rayJobTemplate), &v1alpha1.RayJobTemplate{})
+ Invokes(testing.NewCreateActionWithOptions(rayjobtemplatesResource, c.ns, rayJobTemplate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayJobTemplate), err
}
// Update takes the representation of a rayJobTemplate and updates it. Returns the server's representation of the rayJobTemplate, and an error, if there is any.
func (c *FakeRayJobTemplates) Update(ctx context.Context, rayJobTemplate *v1alpha1.RayJobTemplate, opts v1.UpdateOptions) (result *v1alpha1.RayJobTemplate, err error) {
+ emptyResult := &v1alpha1.RayJobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(rayjobtemplatesResource, c.ns, rayJobTemplate), &v1alpha1.RayJobTemplate{})
+ Invokes(testing.NewUpdateActionWithOptions(rayjobtemplatesResource, c.ns, rayJobTemplate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayJobTemplate), err
}
@@ -110,7 +114,7 @@ func (c *FakeRayJobTemplates) Delete(ctx context.Context, name string, opts v1.D
// DeleteCollection deletes a collection of objects.
func (c *FakeRayJobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(rayjobtemplatesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(rayjobtemplatesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.RayJobTemplateList{})
return err
@@ -118,11 +122,12 @@ func (c *FakeRayJobTemplates) DeleteCollection(ctx context.Context, opts v1.Dele
// Patch applies the patch and returns the patched rayJobTemplate.
func (c *FakeRayJobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RayJobTemplate, err error) {
+ emptyResult := &v1alpha1.RayJobTemplate{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(rayjobtemplatesResource, c.ns, name, pt, data, subresources...), &v1alpha1.RayJobTemplate{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(rayjobtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.RayJobTemplate), err
}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_volumebundle.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_volumebundle.go
index 939237e0021..7626eb02696 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_volumebundle.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/fake/fake_volumebundle.go
@@ -40,22 +40,24 @@ var volumebundlesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeBundle")
// Get takes name of the volumeBundle, and returns the corresponding volumeBundle object, and an error if there is any.
func (c *FakeVolumeBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeBundle, err error) {
+ emptyResult := &v1alpha1.VolumeBundle{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(volumebundlesResource, c.ns, name), &v1alpha1.VolumeBundle{})
+ Invokes(testing.NewGetActionWithOptions(volumebundlesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.VolumeBundle), err
}
// List takes label and field selectors, and returns the list of VolumeBundles that match those selectors.
func (c *FakeVolumeBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeBundleList, err error) {
+ emptyResult := &v1alpha1.VolumeBundleList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(volumebundlesResource, volumebundlesKind, c.ns, opts), &v1alpha1.VolumeBundleList{})
+ Invokes(testing.NewListActionWithOptions(volumebundlesResource, volumebundlesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -74,28 +76,30 @@ func (c *FakeVolumeBundles) List(ctx context.Context, opts v1.ListOptions) (resu
// Watch returns a watch.Interface that watches the requested volumeBundles.
func (c *FakeVolumeBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(volumebundlesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(volumebundlesResource, c.ns, opts))
}
// Create takes the representation of a volumeBundle and creates it. Returns the server's representation of the volumeBundle, and an error, if there is any.
func (c *FakeVolumeBundles) Create(ctx context.Context, volumeBundle *v1alpha1.VolumeBundle, opts v1.CreateOptions) (result *v1alpha1.VolumeBundle, err error) {
+ emptyResult := &v1alpha1.VolumeBundle{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(volumebundlesResource, c.ns, volumeBundle), &v1alpha1.VolumeBundle{})
+ Invokes(testing.NewCreateActionWithOptions(volumebundlesResource, c.ns, volumeBundle, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.VolumeBundle), err
}
// Update takes the representation of a volumeBundle and updates it. Returns the server's representation of the volumeBundle, and an error, if there is any.
func (c *FakeVolumeBundles) Update(ctx context.Context, volumeBundle *v1alpha1.VolumeBundle, opts v1.UpdateOptions) (result *v1alpha1.VolumeBundle, err error) {
+ emptyResult := &v1alpha1.VolumeBundle{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(volumebundlesResource, c.ns, volumeBundle), &v1alpha1.VolumeBundle{})
+ Invokes(testing.NewUpdateActionWithOptions(volumebundlesResource, c.ns, volumeBundle, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.VolumeBundle), err
}
@@ -110,7 +114,7 @@ func (c *FakeVolumeBundles) Delete(ctx context.Context, name string, opts v1.Del
// DeleteCollection deletes a collection of objects.
func (c *FakeVolumeBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(volumebundlesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(volumebundlesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.VolumeBundleList{})
return err
@@ -118,11 +122,12 @@ func (c *FakeVolumeBundles) DeleteCollection(ctx context.Context, opts v1.Delete
// Patch applies the patch and returns the patched volumeBundle.
func (c *FakeVolumeBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeBundle, err error) {
+ emptyResult := &v1alpha1.VolumeBundle{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(volumebundlesResource, c.ns, name, pt, data, subresources...), &v1alpha1.VolumeBundle{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(volumebundlesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.VolumeBundle), err
}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/jobtemplate.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/jobtemplate.go
index 311deefe7c2..3d94830dc99 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/jobtemplate.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/jobtemplate.go
@@ -19,12 +19,11 @@ package v1alpha1
import (
"context"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1alpha1 "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
scheme "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/scheme"
)
@@ -50,128 +49,18 @@ type JobTemplateInterface interface {
// jobTemplates implements JobTemplateInterface
type jobTemplates struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithList[*v1alpha1.JobTemplate, *v1alpha1.JobTemplateList]
}
// newJobTemplates returns a JobTemplates
func newJobTemplates(c *KjobctlV1alpha1Client, namespace string) *jobTemplates {
return &jobTemplates{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithList[*v1alpha1.JobTemplate, *v1alpha1.JobTemplateList](
+ "jobtemplates",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1alpha1.JobTemplate { return &v1alpha1.JobTemplate{} },
+ func() *v1alpha1.JobTemplateList { return &v1alpha1.JobTemplateList{} }),
}
}
-
-// Get takes name of the jobTemplate, and returns the corresponding jobTemplate object, and an error if there is any.
-func (c *jobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobTemplate, err error) {
- result = &v1alpha1.JobTemplate{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("jobtemplates").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of JobTemplates that match those selectors.
-func (c *jobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobTemplateList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.JobTemplateList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("jobtemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested jobTemplates.
-func (c *jobTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("jobtemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a jobTemplate and creates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
-func (c *jobTemplates) Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (result *v1alpha1.JobTemplate, err error) {
- result = &v1alpha1.JobTemplate{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("jobtemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(jobTemplate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a jobTemplate and updates it. Returns the server's representation of the jobTemplate, and an error, if there is any.
-func (c *jobTemplates) Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) {
- result = &v1alpha1.JobTemplate{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("jobtemplates").
- Name(jobTemplate.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(jobTemplate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the jobTemplate and deletes it. Returns an error if one occurs.
-func (c *jobTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("jobtemplates").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *jobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("jobtemplates").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched jobTemplate.
-func (c *jobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobTemplate, err error) {
- result = &v1alpha1.JobTemplate{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("jobtemplates").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayclustertemplate.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayclustertemplate.go
index 5da7db6bb5a..02ca4569c66 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayclustertemplate.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayclustertemplate.go
@@ -19,12 +19,11 @@ package v1alpha1
import (
"context"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1alpha1 "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
scheme "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/scheme"
)
@@ -50,128 +49,18 @@ type RayClusterTemplateInterface interface {
// rayClusterTemplates implements RayClusterTemplateInterface
type rayClusterTemplates struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithList[*v1alpha1.RayClusterTemplate, *v1alpha1.RayClusterTemplateList]
}
// newRayClusterTemplates returns a RayClusterTemplates
func newRayClusterTemplates(c *KjobctlV1alpha1Client, namespace string) *rayClusterTemplates {
return &rayClusterTemplates{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithList[*v1alpha1.RayClusterTemplate, *v1alpha1.RayClusterTemplateList](
+ "rayclustertemplates",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1alpha1.RayClusterTemplate { return &v1alpha1.RayClusterTemplate{} },
+ func() *v1alpha1.RayClusterTemplateList { return &v1alpha1.RayClusterTemplateList{} }),
}
}
-
-// Get takes name of the rayClusterTemplate, and returns the corresponding rayClusterTemplate object, and an error if there is any.
-func (c *rayClusterTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RayClusterTemplate, err error) {
- result = &v1alpha1.RayClusterTemplate{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("rayclustertemplates").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of RayClusterTemplates that match those selectors.
-func (c *rayClusterTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RayClusterTemplateList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.RayClusterTemplateList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("rayclustertemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested rayClusterTemplates.
-func (c *rayClusterTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("rayclustertemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a rayClusterTemplate and creates it. Returns the server's representation of the rayClusterTemplate, and an error, if there is any.
-func (c *rayClusterTemplates) Create(ctx context.Context, rayClusterTemplate *v1alpha1.RayClusterTemplate, opts v1.CreateOptions) (result *v1alpha1.RayClusterTemplate, err error) {
- result = &v1alpha1.RayClusterTemplate{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("rayclustertemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(rayClusterTemplate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a rayClusterTemplate and updates it. Returns the server's representation of the rayClusterTemplate, and an error, if there is any.
-func (c *rayClusterTemplates) Update(ctx context.Context, rayClusterTemplate *v1alpha1.RayClusterTemplate, opts v1.UpdateOptions) (result *v1alpha1.RayClusterTemplate, err error) {
- result = &v1alpha1.RayClusterTemplate{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("rayclustertemplates").
- Name(rayClusterTemplate.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(rayClusterTemplate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the rayClusterTemplate and deletes it. Returns an error if one occurs.
-func (c *rayClusterTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("rayclustertemplates").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *rayClusterTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("rayclustertemplates").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched rayClusterTemplate.
-func (c *rayClusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RayClusterTemplate, err error) {
- result = &v1alpha1.RayClusterTemplate{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("rayclustertemplates").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayjobtemplate.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayjobtemplate.go
index ac9b9588295..3c616960f04 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayjobtemplate.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/rayjobtemplate.go
@@ -19,12 +19,11 @@ package v1alpha1
import (
"context"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1alpha1 "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
scheme "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/scheme"
)
@@ -50,128 +49,18 @@ type RayJobTemplateInterface interface {
// rayJobTemplates implements RayJobTemplateInterface
type rayJobTemplates struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithList[*v1alpha1.RayJobTemplate, *v1alpha1.RayJobTemplateList]
}
// newRayJobTemplates returns a RayJobTemplates
func newRayJobTemplates(c *KjobctlV1alpha1Client, namespace string) *rayJobTemplates {
return &rayJobTemplates{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithList[*v1alpha1.RayJobTemplate, *v1alpha1.RayJobTemplateList](
+ "rayjobtemplates",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1alpha1.RayJobTemplate { return &v1alpha1.RayJobTemplate{} },
+ func() *v1alpha1.RayJobTemplateList { return &v1alpha1.RayJobTemplateList{} }),
}
}
-
-// Get takes name of the rayJobTemplate, and returns the corresponding rayJobTemplate object, and an error if there is any.
-func (c *rayJobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RayJobTemplate, err error) {
- result = &v1alpha1.RayJobTemplate{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("rayjobtemplates").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of RayJobTemplates that match those selectors.
-func (c *rayJobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RayJobTemplateList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.RayJobTemplateList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("rayjobtemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested rayJobTemplates.
-func (c *rayJobTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("rayjobtemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a rayJobTemplate and creates it. Returns the server's representation of the rayJobTemplate, and an error, if there is any.
-func (c *rayJobTemplates) Create(ctx context.Context, rayJobTemplate *v1alpha1.RayJobTemplate, opts v1.CreateOptions) (result *v1alpha1.RayJobTemplate, err error) {
- result = &v1alpha1.RayJobTemplate{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("rayjobtemplates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(rayJobTemplate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a rayJobTemplate and updates it. Returns the server's representation of the rayJobTemplate, and an error, if there is any.
-func (c *rayJobTemplates) Update(ctx context.Context, rayJobTemplate *v1alpha1.RayJobTemplate, opts v1.UpdateOptions) (result *v1alpha1.RayJobTemplate, err error) {
- result = &v1alpha1.RayJobTemplate{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("rayjobtemplates").
- Name(rayJobTemplate.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(rayJobTemplate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the rayJobTemplate and deletes it. Returns an error if one occurs.
-func (c *rayJobTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("rayjobtemplates").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *rayJobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("rayjobtemplates").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched rayJobTemplate.
-func (c *rayJobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RayJobTemplate, err error) {
- result = &v1alpha1.RayJobTemplate{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("rayjobtemplates").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/volumebundle.go b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/volumebundle.go
index cd304512fdf..afa0590e5fd 100644
--- a/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/volumebundle.go
+++ b/cmd/experimental/kjobctl/client-go/clientset/versioned/typed/apis/v1alpha1/volumebundle.go
@@ -19,12 +19,11 @@ package v1alpha1
import (
"context"
- "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
v1alpha1 "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
scheme "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/scheme"
)
@@ -50,128 +49,18 @@ type VolumeBundleInterface interface {
// volumeBundles implements VolumeBundleInterface
type volumeBundles struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithList[*v1alpha1.VolumeBundle, *v1alpha1.VolumeBundleList]
}
// newVolumeBundles returns a VolumeBundles
func newVolumeBundles(c *KjobctlV1alpha1Client, namespace string) *volumeBundles {
return &volumeBundles{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithList[*v1alpha1.VolumeBundle, *v1alpha1.VolumeBundleList](
+ "volumebundles",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1alpha1.VolumeBundle { return &v1alpha1.VolumeBundle{} },
+ func() *v1alpha1.VolumeBundleList { return &v1alpha1.VolumeBundleList{} }),
}
}
-
-// Get takes name of the volumeBundle, and returns the corresponding volumeBundle object, and an error if there is any.
-func (c *volumeBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeBundle, err error) {
- result = &v1alpha1.VolumeBundle{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("volumebundles").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of VolumeBundles that match those selectors.
-func (c *volumeBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeBundleList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.VolumeBundleList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("volumebundles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested volumeBundles.
-func (c *volumeBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("volumebundles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a volumeBundle and creates it. Returns the server's representation of the volumeBundle, and an error, if there is any.
-func (c *volumeBundles) Create(ctx context.Context, volumeBundle *v1alpha1.VolumeBundle, opts v1.CreateOptions) (result *v1alpha1.VolumeBundle, err error) {
- result = &v1alpha1.VolumeBundle{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("volumebundles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(volumeBundle).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a volumeBundle and updates it. Returns the server's representation of the volumeBundle, and an error, if there is any.
-func (c *volumeBundles) Update(ctx context.Context, volumeBundle *v1alpha1.VolumeBundle, opts v1.UpdateOptions) (result *v1alpha1.VolumeBundle, err error) {
- result = &v1alpha1.VolumeBundle{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("volumebundles").
- Name(volumeBundle.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(volumeBundle).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the volumeBundle and deletes it. Returns an error if one occurs.
-func (c *volumeBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("volumebundles").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *volumeBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("volumebundles").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched volumeBundle.
-func (c *volumeBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeBundle, err error) {
- result = &v1alpha1.VolumeBundle{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("volumebundles").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/generators/doc.go b/cmd/experimental/kjobctl/cmd/kjobctl-docs/generators/doc.go
similarity index 99%
rename from cmd/experimental/kjobctl/hack/tools/kjobctl-docs/generators/doc.go
rename to cmd/experimental/kjobctl/cmd/kjobctl-docs/generators/doc.go
index 9d78cc94b7c..ccfdbbb03ec 100644
--- a/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/generators/doc.go
+++ b/cmd/experimental/kjobctl/cmd/kjobctl-docs/generators/doc.go
@@ -327,9 +327,9 @@ func getLinks(cmd *cobra.Command, linkHandler func(string) string, indexFile boo
cname := name + " " + child.Name()
path := strings.ReplaceAll(cname, " ", "_")
if indexFile {
- path = path + ".md"
+ path += ".md"
} else {
- path = path + "/_index.md"
+ path += "/_index.md"
}
link := Link{
diff --git a/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/main.go b/cmd/experimental/kjobctl/cmd/kjobctl-docs/main.go
similarity index 93%
rename from cmd/experimental/kjobctl/hack/tools/kjobctl-docs/main.go
rename to cmd/experimental/kjobctl/cmd/kjobctl-docs/main.go
index 0a2fd605031..218c57aa430 100644
--- a/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/main.go
+++ b/cmd/experimental/kjobctl/cmd/kjobctl-docs/main.go
@@ -24,7 +24,7 @@ import (
"github.com/spf13/pflag"
cliflag "k8s.io/component-base/cli/flag"
- "sigs.k8s.io/kueue/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/generators"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/cmd/kjobctl-docs/generators"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd"
)
diff --git a/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/templates/main.md b/cmd/experimental/kjobctl/cmd/kjobctl-docs/templates/main.md
similarity index 90%
rename from cmd/experimental/kjobctl/hack/tools/kjobctl-docs/templates/main.md
rename to cmd/experimental/kjobctl/cmd/kjobctl-docs/templates/main.md
index c32425d91c7..f66042ced0b 100644
--- a/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/templates/main.md
+++ b/cmd/experimental/kjobctl/cmd/kjobctl-docs/templates/main.md
@@ -1,6 +1,6 @@
{{ html ``}}
# {{.Title}}
@@ -22,7 +22,7 @@ The file is auto-generated from the Go source code of the component using the
## Examples
```
-{{.Example}}
+{{html .Example}}
```
{{- end}}
{{- if .Options}}
diff --git a/cmd/experimental/kjobctl/hack/tools/kjobctl-docs/templates/options.html b/cmd/experimental/kjobctl/cmd/kjobctl-docs/templates/options.html
similarity index 100%
rename from cmd/experimental/kjobctl/hack/tools/kjobctl-docs/templates/options.html
rename to cmd/experimental/kjobctl/cmd/kjobctl-docs/templates/options.html
diff --git a/cmd/experimental/kjobctl/cmd/main.go b/cmd/experimental/kjobctl/cmd/kjobctl/main.go
similarity index 100%
rename from cmd/experimental/kjobctl/cmd/main.go
rename to cmd/experimental/kjobctl/cmd/kjobctl/main.go
diff --git a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_applicationprofiles.yaml b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_applicationprofiles.yaml
index bfa7eb50c2e..537d39d3e7d 100644
--- a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_applicationprofiles.yaml
+++ b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_applicationprofiles.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: applicationprofiles.kjobctl.x-k8s.io
spec:
group: kjobctl.x-k8s.io
@@ -63,9 +63,8 @@ spec:
The request flag used only for Interactive and Job modes.
The cmd flag used only for Interactive, Job, and RayJob.
If the raycluster flag are set, none of localqueue, replicas, min-replicas, or max-replicas can be set.
- For the Slurm mode, the possible values are: array, cpus-per-task, error, gpus-per-task, input, job-name, mem-per-cpu,
- mem-per-gpu, mem-per-task, nodes, ntasks, output, partition, localqueue.
-
+ For the Slurm mode, the possible values are: array, cpus-per-task, error, gpus-per-task, input, job-name, mem, mem-per-cpu,
+ mem-per-gpu, mem-per-task, nodes, ntasks, output, partition, localqueue, priority.
cmd and requests values are going to be added only to the first primary container.
items:
@@ -93,7 +92,7 @@ spec:
- output
- partition
type: string
- maxItems: 12
+ maxItems: 13
type: array
x-kubernetes-list-type: set
template:
@@ -160,6 +159,9 @@ spec:
- message: job-name flag can be used only on Slurm mode
rule: '!has(self.requiredFlags) || !(''job-name'' in self.requiredFlags)
|| self.name == ''Slurm'''
+ - message: mem flag can be used only on Slurm mode
+ rule: '!has(self.requiredFlags) || !(''mem'' in self.requiredFlags)
+ || self.name == ''Slurm'''
- message: mem-per-cpu flag can be used only on Slurm mode
rule: '!has(self.requiredFlags) || !(''mem-per-cpu'' in self.requiredFlags)
|| self.name == ''Slurm'''
@@ -181,6 +183,9 @@ spec:
- message: partition flag can be used only on Slurm mode
rule: '!has(self.requiredFlags) || !(''partition'' in self.requiredFlags)
|| self.name == ''Slurm'''
+ - message: priority flag can be used only on Slurm mode
+ rule: '!has(self.requiredFlags) || !(''priority'' in self.requiredFlags)
+ || self.name == ''Slurm'''
- message: parallelism flag can't be used on Slurm mode
rule: '!has(self.requiredFlags) || self.name != ''Slurm'' || !(''parallelism''
in self.requiredFlags)'
diff --git a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_jobtemplates.yaml b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_jobtemplates.yaml
index 28af1278bf3..ce18886eb36 100644
--- a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_jobtemplates.yaml
+++ b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_jobtemplates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: jobtemplates.kjobctl.x-k8s.io
spec:
group: kjobctl.x-k8s.io
@@ -78,12 +78,10 @@ spec:
completionMode specifies how Pod completions are tracked. It can be
`NonIndexed` (default) or `Indexed`.
-
`NonIndexed` means that the Job is considered complete when there have
been .spec.completions successfully completed Pods. Each Pod completion is
homologous to each other.
-
`Indexed` means that the Pods of a
Job get an associated completion index from 0 to (.spec.completions - 1),
available in the annotation batch.kubernetes.io/job-completion-index.
@@ -95,7 +93,6 @@ spec:
`$(job-name)-$(index)-$(random-string)`,
the Pod hostname takes the form `$(job-name)-$(index)`.
-
More completion modes can be added in the future.
If the Job controller observes a mode that it doesn't recognize, which
is possible during upgrades due to version skew, the controller
@@ -120,8 +117,8 @@ spec:
The value must be a valid domain-prefixed path (e.g. acme.io/foo) -
all characters before the first "/" must be a valid subdomain as defined
by RFC 1123. All characters trailing the first "/" must be valid HTTP Path
- characters as defined by RFC 3986. The value cannot exceed 64 characters.
-
+ characters as defined by RFC 3986. The value cannot exceed 63 characters.
+ This field is immutable.
This field is alpha-level. The job controller accepts setting the field
when the feature gate JobManagedBy is enabled (disabled by default).
@@ -171,10 +168,6 @@ spec:
represented by the jobs's .status.failed field, is incremented and it is
checked against the backoffLimit. This field cannot be used in combination
with restartPolicy=OnFailure.
-
-
- This field is beta-level. It can be used when the `JobPodFailurePolicy`
- feature gate is enabled (enabled by default).
properties:
rules:
description: |-
@@ -193,7 +186,6 @@ spec:
Specifies the action taken on a pod failure when the requirements are satisfied.
Possible values are:
-
- FailJob: indicates that the pod's job is marked as Failed and all
running pods are terminated.
- FailIndex: indicates that the pod's index is marked as Failed and will
@@ -224,7 +216,6 @@ spec:
specified values. Containers completed with success (exit code 0) are
excluded from the requirement check. Possible values are:
-
- In: the requirement is satisfied if at least one container exit code
(might be multiple if there are multiple containers not restricted
by the 'containerName' field) is in the set of specified values.
@@ -294,7 +285,6 @@ spec:
- Failed means to wait until a previously created Pod is fully terminated (has phase
Failed or Succeeded) before creating a replacement Pod.
-
When using podFailurePolicy, Failed is the the only allowed value.
TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.
This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle.
@@ -357,9 +347,8 @@ spec:
When the field is specified, it must be immutable and works only for the Indexed Jobs.
Once the Job meets the SuccessPolicy, the lingering pods are terminated.
-
- This field is alpha-level. To use this field, you must enable the
- `JobSuccessPolicy` feature gate (disabled by default).
+ This field is beta-level. To use this field, you must enable the
+ `JobSuccessPolicy` feature gate (enabled by default).
properties:
rules:
description: |-
@@ -729,7 +718,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -744,7 +733,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -913,7 +902,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -928,7 +917,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1095,7 +1084,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1110,7 +1099,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1279,7 +1268,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1294,7 +1283,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1460,9 +1449,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -1532,9 +1519,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -1574,9 +1559,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -1599,9 +1582,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -1902,11 +1883,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2118,11 +2099,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2272,11 +2253,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -2288,6 +2267,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -2411,7 +2396,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -2493,7 +2478,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -2575,11 +2559,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2797,10 +2781,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -2808,11 +2790,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -2921,7 +2901,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -2994,9 +2973,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -3066,9 +3043,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -3108,9 +3083,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -3133,9 +3106,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -3430,11 +3401,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3636,11 +3607,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3789,11 +3760,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -3805,6 +3774,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -3916,7 +3891,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -3998,7 +3973,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -4074,11 +4048,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4217,7 +4191,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -4306,10 +4279,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -4317,11 +4288,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -4433,9 +4402,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -4531,9 +4498,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -4603,9 +4568,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -4645,9 +4608,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -4670,9 +4631,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -4973,11 +4932,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5189,11 +5148,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5343,11 +5302,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -5359,6 +5316,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -5482,7 +5445,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -5564,7 +5527,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -5646,11 +5608,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5868,10 +5830,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -5879,11 +5839,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -5922,9 +5880,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -5940,11 +5900,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -5959,6 +5917,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -6046,15 +6005,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -6063,33 +6023,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to find the
- ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -6123,7 +6082,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated to a Pod
@@ -6175,12 +6133,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -6267,7 +6223,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -6277,18 +6232,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -6496,7 +6461,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -6536,7 +6500,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -6554,7 +6517,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -6566,7 +6528,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -6634,7 +6595,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -6674,6 +6634,7 @@ spec:
in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -6687,6 +6648,7 @@ spec:
set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -6757,9 +6719,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6801,9 +6761,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6876,9 +6834,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether the ConfigMap
@@ -6917,9 +6873,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7062,7 +7016,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -7073,17 +7026,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -7097,7 +7047,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -7107,11 +7056,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -7315,7 +7262,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -7342,7 +7289,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target lun
@@ -7411,9 +7357,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7448,7 +7392,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -7529,9 +7472,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -7548,6 +7488,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -7568,7 +7543,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -7581,6 +7555,7 @@ spec:
Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -7614,9 +7589,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7735,24 +7708,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of volume projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be projected
- along with other supported volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -7889,9 +7862,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether
@@ -8038,9 +8009,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field specify
@@ -8132,7 +8101,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -8140,6 +8108,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -8154,6 +8123,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -8179,13 +8149,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -8200,6 +8169,7 @@ spec:
volume attached and mounted on Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -8232,9 +8202,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8243,6 +8211,7 @@ spec:
SSL communication with Gateway, default false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -8357,9 +8326,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8432,6 +8399,8 @@ spec:
required:
- spec
type: object
+ required:
+ - template
type: object
served: true
storage: true
diff --git a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayclustertemplates.yaml b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayclustertemplates.yaml
index ab03069f38f..1fe0b7a0ec4 100644
--- a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayclustertemplates.yaml
+++ b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayclustertemplates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: rayclustertemplates.kjobctl.x-k8s.io
spec:
group: kjobctl.x-k8s.io
@@ -90,9 +90,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap or
@@ -158,9 +156,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its
@@ -192,9 +188,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap must
@@ -216,9 +210,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret must be
@@ -254,11 +246,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -269,6 +259,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -374,7 +370,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -456,7 +452,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -543,10 +538,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -554,11 +547,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -671,7 +662,6 @@ spec:
clients must ensure that clusterIPs[0] and clusterIP have the same
value.
-
This field may hold a maximum of two entries (dual-stack IPs, in either order).
These IPs must correspond to the values of the ipFamilies field. Both
clusterIPs and ipFamilies are governed by the ipFamilyPolicy field.
@@ -751,7 +741,6 @@ spec:
NodePort, and LoadBalancer, and does apply to "headless" services.
This field will be wiped when updating a Service to type ExternalName.
-
This field may hold a maximum of two entries (dual-stack families, in
either order). These families must correspond to the values of the
clusterIPs field, if specified. Both clusterIPs and ipFamilies are
@@ -822,17 +811,14 @@ spec:
This field follows standard Kubernetes label syntax.
Valid values are either:
-
* Un-prefixed protocol names - reserved for IANA standard service names (as per
RFC-6335 and https://www.iana.org/assignments/service-names).
-
* Kubernetes-defined prefixed names:
* 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-
* 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455
* 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455
-
* Other protocols should use implementation-defined prefixed names such as
mycompany.com/my-custom-protocol.
type: string
@@ -978,19 +964,8 @@ spec:
conditions:
description: Current service state
items:
- description: "Condition contains details for one
- aspect of the current state of this API Resource.\n---\nThis
- struct is intended for direct use as an array
- at the field path .status.conditions. For example,\n\n\n\ttype
- FooStatus struct{\n\t // Represents the observations
- of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t
- \ // +patchMergeKey=type\n\t // +patchStrategy=merge\n\t
- \ // +listType=map\n\t // +listMapKey=type\n\t
- \ Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one
+ aspect of the current state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -1032,12 +1007,8 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase
+ or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -1099,8 +1070,6 @@ spec:
CamelCase names
- cloud provider specific error values must have names that comply with the
format foo.example.com/CamelCase.
- ---
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -1111,12 +1080,12 @@ spec:
format: int32
type: integer
protocol:
- default: TCP
description: |-
Protocol is the protocol of the service port of which status is recorded here
The supported values are: "TCP", "UDP", "SCTP"
type: string
required:
+ - error
- port
- protocol
type: object
@@ -1454,7 +1423,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1469,7 +1438,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1639,7 +1608,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1654,7 +1623,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1823,7 +1792,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1838,7 +1807,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -2008,7 +1977,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -2023,7 +1992,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -2191,9 +2160,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2266,9 +2233,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2308,9 +2273,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -2333,9 +2296,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -2640,11 +2601,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2861,11 +2822,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3019,11 +2980,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -3035,6 +2994,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -3158,7 +3123,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -3240,7 +3205,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -3325,11 +3289,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3550,10 +3514,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -3561,11 +3523,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -3674,7 +3634,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -3748,9 +3707,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -3823,9 +3780,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -3865,9 +3820,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -3890,9 +3843,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -4191,11 +4142,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4402,11 +4353,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4559,11 +4510,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -4575,6 +4524,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -4686,7 +4641,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -4768,7 +4723,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -4847,11 +4801,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4993,7 +4947,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -5082,10 +5035,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -5093,11 +5044,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -5209,9 +5158,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -5308,9 +5255,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -5383,9 +5328,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -5425,9 +5368,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -5450,9 +5391,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -5757,11 +5696,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5978,11 +5917,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -6136,11 +6075,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -6152,6 +6089,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -6275,7 +6218,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -6357,7 +6300,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -6442,11 +6384,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -6667,10 +6609,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -6678,11 +6618,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -6721,9 +6659,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -6739,11 +6679,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -6758,6 +6696,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -6846,15 +6785,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -6863,33 +6803,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to find
- the ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -6923,7 +6862,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated to
@@ -6975,12 +6913,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -7067,7 +7003,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -7077,18 +7012,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -7296,7 +7241,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -7336,7 +7280,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -7354,7 +7297,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -7366,7 +7308,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -7435,7 +7376,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -7476,6 +7416,7 @@ spec:
disk in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -7489,6 +7430,7 @@ spec:
availability set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -7560,9 +7502,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7604,9 +7544,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7679,9 +7617,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether the
@@ -7720,9 +7656,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7870,7 +7804,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -7881,17 +7814,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -7905,7 +7835,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -7915,11 +7844,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -8125,7 +8052,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -8152,7 +8079,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target
@@ -8221,9 +8147,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8259,7 +8183,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -8340,9 +8263,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -8359,6 +8279,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -8379,7 +8334,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -8392,6 +8346,7 @@ spec:
Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -8425,9 +8380,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8548,25 +8501,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of volume
- projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be projected
- along with other supported volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -8705,9 +8657,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify
@@ -8861,9 +8811,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field specify
@@ -8955,7 +8903,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -8963,6 +8910,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -8977,6 +8925,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -9002,13 +8951,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -9024,6 +8972,7 @@ spec:
nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -9056,9 +9005,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -9068,6 +9015,7 @@ spec:
false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -9184,9 +9132,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -9629,7 +9575,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -9644,7 +9590,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -9816,7 +9762,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -9831,7 +9777,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10003,7 +9949,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10018,7 +9964,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10190,7 +10136,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10205,7 +10151,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10375,9 +10321,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -10450,9 +10394,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -10494,9 +10436,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -10519,9 +10459,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -10826,11 +10764,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -11048,11 +10986,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -11207,11 +11145,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -11223,6 +11159,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -11346,7 +11288,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -11428,7 +11370,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -11513,11 +11454,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -11740,10 +11681,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -11751,11 +11690,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -11864,7 +11801,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -11939,9 +11875,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -12014,9 +11948,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -12058,9 +11990,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -12083,9 +12013,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -12384,11 +12312,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -12596,11 +12524,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -12754,11 +12682,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -12770,6 +12696,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -12881,7 +12813,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -12963,7 +12895,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -13042,11 +12973,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -13189,7 +13120,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -13279,10 +13209,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -13290,11 +13218,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -13406,9 +13332,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -13506,9 +13430,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -13581,9 +13503,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -13625,9 +13545,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -13650,9 +13568,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -13957,11 +13873,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -14179,11 +14095,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -14338,11 +14254,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -14354,6 +14268,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -14477,7 +14397,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -14559,7 +14479,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -14644,11 +14563,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -14871,10 +14790,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -14882,11 +14799,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -14925,9 +14840,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -14943,11 +14860,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -14962,6 +14877,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -15050,15 +14966,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -15067,33 +14984,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to find
- the ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -15127,7 +15043,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated to
@@ -15179,12 +15094,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -15271,7 +15184,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -15281,18 +15193,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -15501,7 +15423,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -15541,7 +15462,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -15559,7 +15479,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -15571,7 +15490,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -15640,7 +15558,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -15682,6 +15599,7 @@ spec:
disk in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -15696,6 +15614,7 @@ spec:
set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -15767,9 +15686,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -15811,9 +15728,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -15886,9 +15801,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether
@@ -15927,9 +15840,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -16077,7 +15988,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -16088,17 +15998,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -16112,7 +16019,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -16122,11 +16028,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -16333,7 +16237,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -16360,7 +16264,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target
@@ -16430,9 +16333,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -16468,7 +16369,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -16549,9 +16449,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -16568,6 +16465,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -16589,7 +16521,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -16602,6 +16533,7 @@ spec:
Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -16635,9 +16567,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -16758,26 +16688,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of volume
- projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be
- projected along with other supported
- volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -16916,9 +16844,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify
@@ -17073,9 +16999,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field
@@ -17168,7 +17092,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -17176,6 +17099,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -17190,6 +17114,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -17215,13 +17140,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -17237,6 +17161,7 @@ spec:
Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -17269,9 +17194,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -17281,6 +17204,7 @@ spec:
false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -17397,9 +17321,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -17471,6 +17393,8 @@ spec:
required:
- spec
type: object
+ required:
+ - template
type: object
served: true
storage: true
diff --git a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayjobtemplates.yaml b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayjobtemplates.yaml
index ec22f7cc36c..56923392839 100644
--- a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayjobtemplates.yaml
+++ b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_rayjobtemplates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: rayjobtemplates.kjobctl.x-k8s.io
spec:
group: kjobctl.x-k8s.io
@@ -139,9 +139,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -208,9 +206,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -242,9 +238,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap must
@@ -266,9 +260,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret must
@@ -304,11 +296,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry
@@ -320,6 +310,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -425,7 +421,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -507,7 +503,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -594,10 +589,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -605,11 +598,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -722,7 +713,6 @@ spec:
clients must ensure that clusterIPs[0] and clusterIP have the same
value.
-
This field may hold a maximum of two entries (dual-stack IPs, in either order).
These IPs must correspond to the values of the ipFamilies field. Both
clusterIPs and ipFamilies are governed by the ipFamilyPolicy field.
@@ -802,7 +792,6 @@ spec:
NodePort, and LoadBalancer, and does apply to "headless" services.
This field will be wiped when updating a Service to type ExternalName.
-
This field may hold a maximum of two entries (dual-stack families, in
either order). These families must correspond to the values of the
clusterIPs field, if specified. Both clusterIPs and ipFamilies are
@@ -873,17 +862,14 @@ spec:
This field follows standard Kubernetes label syntax.
Valid values are either:
-
* Un-prefixed protocol names - reserved for IANA standard service names (as per
RFC-6335 and https://www.iana.org/assignments/service-names).
-
* Kubernetes-defined prefixed names:
* 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-
* 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455
* 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455
-
* Other protocols should use implementation-defined prefixed names such as
mycompany.com/my-custom-protocol.
type: string
@@ -1029,20 +1015,9 @@ spec:
conditions:
description: Current service state
items:
- description: "Condition contains details for
+ description: Condition contains details for
one aspect of the current state of this API
- Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions.
- \ For example,\n\n\n\ttype FooStatus struct{\n\t
- \ // Represents the observations of a foo's
- current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t
- \ // +patchMergeKey=type\n\t // +patchStrategy=merge\n\t
- \ // +listType=map\n\t // +listMapKey=type\n\t
- \ Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ Resource.
properties:
lastTransitionTime:
description: |-
@@ -1084,12 +1059,8 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase
+ or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -1151,8 +1122,6 @@ spec:
CamelCase names
- cloud provider specific error values must have names that comply with the
format foo.example.com/CamelCase.
- ---
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -1163,12 +1132,12 @@ spec:
format: int32
type: integer
protocol:
- default: TCP
description: |-
Protocol is the protocol of the service port of which status is recorded here
The supported values are: "TCP", "UDP", "SCTP"
type: string
required:
+ - error
- port
- protocol
type: object
@@ -1514,7 +1483,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1529,7 +1498,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1701,7 +1670,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1716,7 +1685,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1888,7 +1857,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1903,7 +1872,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -2075,7 +2044,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -2090,7 +2059,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -2260,9 +2229,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -2336,9 +2303,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -2380,9 +2345,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2406,9 +2369,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2713,11 +2674,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2935,11 +2896,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3094,11 +3055,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -3110,6 +3069,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -3233,7 +3198,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -3315,7 +3280,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -3400,11 +3364,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3628,10 +3592,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -3639,11 +3601,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -3752,7 +3712,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -3827,9 +3786,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -3903,9 +3860,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -3947,9 +3902,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -3973,9 +3926,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -4274,11 +4225,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4486,11 +4437,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4644,11 +4595,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -4660,6 +4609,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -4771,7 +4726,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -4853,7 +4808,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -4932,11 +4886,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5079,7 +5033,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -5170,10 +5123,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -5181,11 +5132,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -5299,9 +5248,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -5399,9 +5346,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -5475,9 +5420,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -5519,9 +5462,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -5545,9 +5486,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -5852,11 +5791,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -6074,11 +6013,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -6233,11 +6172,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -6249,6 +6186,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -6372,7 +6315,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -6454,7 +6397,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -6539,11 +6481,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -6767,10 +6709,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -6778,11 +6718,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -6821,9 +6759,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -6839,11 +6779,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -6858,6 +6796,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -6946,15 +6885,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -6963,33 +6903,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to find
- the ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -7023,7 +6962,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated
@@ -7075,12 +7013,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -7167,7 +7103,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -7177,18 +7112,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -7400,7 +7345,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -7440,7 +7384,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -7458,7 +7401,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -7470,7 +7412,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -7539,7 +7480,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -7581,6 +7521,7 @@ spec:
disk in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -7595,6 +7536,7 @@ spec:
availability set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -7667,9 +7609,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7711,9 +7651,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7787,9 +7725,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether
@@ -7830,9 +7766,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7981,7 +7915,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -7992,17 +7925,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -8016,7 +7946,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -8026,11 +7955,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -8241,7 +8168,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -8268,7 +8195,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target
@@ -8338,9 +8264,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8376,7 +8300,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -8457,9 +8380,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -8476,6 +8396,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -8498,7 +8453,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -8511,6 +8465,7 @@ spec:
Qualified Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -8544,9 +8499,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8667,26 +8620,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of
- volume projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be
- projected along with other supported
- volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -8827,9 +8778,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify
@@ -8989,9 +8938,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field
@@ -9085,7 +9032,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -9093,6 +9039,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -9107,6 +9054,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -9132,13 +9080,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -9154,6 +9101,7 @@ spec:
on Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -9186,9 +9134,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -9198,6 +9144,7 @@ spec:
false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -9316,9 +9263,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -9770,7 +9715,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -9785,7 +9730,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -9958,7 +9903,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -9973,7 +9918,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10147,7 +10092,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10162,7 +10107,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10335,7 +10280,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10350,7 +10295,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -10522,9 +10467,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -10599,9 +10542,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -10643,9 +10584,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -10669,9 +10608,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -10976,11 +10913,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -11198,11 +11135,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -11357,11 +11294,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -11373,6 +11308,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -11496,7 +11437,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -11582,7 +11523,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -11667,11 +11607,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -11895,10 +11835,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -11906,11 +11844,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -12019,7 +11955,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -12095,9 +12030,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -12172,9 +12105,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -12216,9 +12147,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -12242,9 +12171,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -12543,11 +12470,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -12755,11 +12682,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -12913,11 +12840,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -12929,6 +12854,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -13040,7 +12971,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -13126,7 +13057,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -13205,11 +13135,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -13352,7 +13282,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -13443,10 +13372,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -13454,11 +13381,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -13572,9 +13497,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -13673,9 +13596,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -13750,9 +13671,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -13794,9 +13713,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -13820,9 +13737,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether
@@ -14127,11 +14042,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -14349,11 +14264,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -14508,11 +14423,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references
@@ -14524,6 +14437,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -14647,7 +14566,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -14733,7 +14652,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -14818,11 +14736,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -15046,10 +14964,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -15057,11 +14973,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -15100,9 +15014,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -15118,11 +15034,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -15137,6 +15051,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -15225,15 +15140,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -15242,33 +15158,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to
- find the ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -15302,7 +15217,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated
@@ -15354,12 +15268,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -15446,7 +15358,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -15456,18 +15367,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -15680,7 +15601,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -15720,7 +15640,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -15738,7 +15657,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -15750,7 +15668,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -15819,7 +15736,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -15861,6 +15777,7 @@ spec:
data disk in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -15876,6 +15793,7 @@ spec:
to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -15948,9 +15866,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -15992,9 +15908,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -16068,9 +15982,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether
@@ -16111,9 +16023,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -16264,7 +16174,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -16275,17 +16184,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -16299,7 +16205,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -16309,11 +16214,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -16524,7 +16427,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -16553,7 +16456,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC
@@ -16623,9 +16525,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -16661,7 +16561,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -16742,9 +16641,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -16761,6 +16657,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -16783,7 +16714,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -16796,6 +16726,7 @@ spec:
Qualified Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -16830,9 +16761,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -16953,26 +16882,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of
- volume projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may
- be projected along with other
- supported volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -17115,9 +17042,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify
@@ -17281,9 +17206,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field
@@ -17377,7 +17300,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -17385,6 +17307,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -17399,6 +17322,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -17424,13 +17348,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -17446,6 +17369,7 @@ spec:
on Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -17478,9 +17402,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -17490,6 +17412,7 @@ spec:
default false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -17609,9 +17532,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -18014,7 +17935,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18029,7 +17950,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18198,7 +18119,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18213,7 +18134,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18380,7 +18301,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18395,7 +18316,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18564,7 +18485,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18579,7 +18500,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -18745,9 +18666,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -18817,9 +18736,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -18859,9 +18776,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -18884,9 +18799,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -19187,11 +19100,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -19403,11 +19316,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -19557,11 +19470,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -19573,6 +19484,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -19696,7 +19613,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -19778,7 +19695,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -19860,11 +19776,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -20082,10 +19998,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -20093,11 +20007,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -20206,7 +20118,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -20279,9 +20190,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -20351,9 +20260,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -20393,9 +20300,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -20418,9 +20323,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -20715,11 +20618,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -20921,11 +20824,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -21074,11 +20977,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -21090,6 +20991,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -21201,7 +21108,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -21283,7 +21190,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -21359,11 +21265,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -21502,7 +21408,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -21591,10 +21496,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -21602,11 +21505,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -21718,9 +21619,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -21816,9 +21715,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -21888,9 +21785,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -21930,9 +21825,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -21955,9 +21848,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -22258,11 +22149,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -22474,11 +22365,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -22628,11 +22519,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -22644,6 +22533,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -22767,7 +22662,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -22849,7 +22744,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -22931,11 +22825,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -23153,10 +23047,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -23164,11 +23056,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -23207,9 +23097,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -23225,11 +23117,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -23244,6 +23134,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -23331,15 +23222,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -23348,33 +23240,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to find the
- ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -23408,7 +23299,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated to a Pod
@@ -23460,12 +23350,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -23552,7 +23440,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -23562,18 +23449,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -23781,7 +23678,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -23821,7 +23717,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -23839,7 +23734,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -23851,7 +23745,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -23919,7 +23812,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -23959,6 +23851,7 @@ spec:
in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -23972,6 +23865,7 @@ spec:
set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -24042,9 +23936,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -24086,9 +23978,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -24161,9 +24051,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether the ConfigMap
@@ -24202,9 +24090,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -24347,7 +24233,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -24358,17 +24243,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -24382,7 +24264,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -24392,11 +24273,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -24600,7 +24479,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -24627,7 +24506,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target lun
@@ -24696,9 +24574,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -24733,7 +24609,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -24814,9 +24689,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -24833,6 +24705,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -24853,7 +24760,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -24866,6 +24772,7 @@ spec:
Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -24899,9 +24806,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -25020,24 +24925,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of volume projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be projected
- along with other supported volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -25174,9 +25079,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether
@@ -25323,9 +25226,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field specify
@@ -25417,7 +25318,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -25425,6 +25325,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -25439,6 +25340,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -25464,13 +25366,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -25485,6 +25386,7 @@ spec:
volume attached and mounted on Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -25517,9 +25419,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -25528,6 +25428,7 @@ spec:
SSL communication with Gateway, default false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -25642,9 +25543,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -25715,12 +25614,12 @@ spec:
It's only working when ShutdownAfterJobFinishes set to true.
format: int32
type: integer
- required:
- - entrypoint
type: object
required:
- spec
type: object
+ required:
+ - template
type: object
served: true
storage: true
diff --git a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_volumebundles.yaml b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_volumebundles.yaml
index 08264880eaa..aa5a898aec7 100644
--- a/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_volumebundles.yaml
+++ b/cmd/experimental/kjobctl/config/crd/bases/kjobctl.x-k8s.io_volumebundles.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: volumebundles.kjobctl.x-k8s.io
spec:
group: kjobctl.x-k8s.io
@@ -73,10 +73,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -84,11 +82,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -152,9 +148,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap or its key
@@ -219,9 +213,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its key must
@@ -258,7 +250,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -298,6 +289,7 @@ spec:
storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -310,6 +302,7 @@ spec:
disk (only in managed availability set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -377,9 +370,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -421,9 +412,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -495,9 +484,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether the ConfigMap or its
@@ -536,9 +523,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -675,7 +660,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -686,17 +670,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -710,7 +691,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -720,11 +700,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -927,7 +905,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -953,7 +931,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target lun number'
@@ -1021,9 +998,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -1057,7 +1032,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -1138,9 +1112,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -1157,6 +1128,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -1177,7 +1183,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -1189,6 +1194,7 @@ spec:
description: iqn is the target iSCSI Qualified Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -1221,9 +1227,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -1340,24 +1344,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of volume projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be projected along with
- other supported volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -1491,9 +1495,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether the ConfigMap
@@ -1631,9 +1633,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field specify whether the
@@ -1723,7 +1723,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -1731,6 +1730,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -1745,6 +1745,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -1770,13 +1771,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -1791,6 +1791,7 @@ spec:
attached and mounted on Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -1822,9 +1823,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -1833,6 +1832,7 @@ spec:
with Gateway, default false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -1946,9 +1946,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
diff --git a/cmd/experimental/kjobctl/config/samples/interactive-sample.yaml b/cmd/experimental/kjobctl/config/samples/interactive-sample.yaml
new file mode 100644
index 00000000000..aa6c50b5ab6
--- /dev/null
+++ b/cmd/experimental/kjobctl/config/samples/interactive-sample.yaml
@@ -0,0 +1,22 @@
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: ApplicationProfile
+metadata:
+ name: interactive-profile
+ namespace: default
+spec:
+ supportedModes:
+ - name: Interactive
+ template: interactive-template
+---
+apiVersion: v1
+kind: PodTemplate
+metadata:
+ name: interactive-template
+ namespace: default
+template:
+ spec:
+ containers:
+ - name: sample-container
+ image: busybox:1.28
+ command: ['/bin/sh']
\ No newline at end of file
diff --git a/cmd/experimental/kjobctl/config/samples/job-sample.yaml b/cmd/experimental/kjobctl/config/samples/job-sample.yaml
new file mode 100644
index 00000000000..674a3798a64
--- /dev/null
+++ b/cmd/experimental/kjobctl/config/samples/job-sample.yaml
@@ -0,0 +1,31 @@
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: ApplicationProfile
+metadata:
+ name: job-profile
+ namespace: default
+spec:
+ supportedModes:
+ - name: Job
+ template: job-template
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: JobTemplate
+metadata:
+ name: job-template
+ namespace: default
+template:
+ spec:
+ parallelism: 3
+ completions: 3
+ template:
+ spec:
+ containers:
+ - name: sample-container
+ image: gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
+ args: [ "30s" ]
+ resources:
+ requests:
+ cpu: "1"
+ memory: "200Mi"
+ restartPolicy: Never
diff --git a/cmd/experimental/kjobctl/config/samples/ray-cluster-sample.yaml b/cmd/experimental/kjobctl/config/samples/ray-cluster-sample.yaml
new file mode 100644
index 00000000000..a263931ec82
--- /dev/null
+++ b/cmd/experimental/kjobctl/config/samples/ray-cluster-sample.yaml
@@ -0,0 +1,120 @@
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: ApplicationProfile
+metadata:
+ name: ray-cluster-profile
+ namespace: default
+spec:
+ supportedModes:
+ - name: RayCluster
+ template: ray-cluster-template
+ volumeBundles: ["ray-cluster-volume-bundle"]
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: RayClusterTemplate
+metadata:
+ name: ray-cluster-template
+ namespace: default
+template:
+ spec:
+ rayVersion: '2.9.0' # should match the Ray version in the image of the containers
+ # Ray head pod template
+ headGroupSpec:
+ rayStartParams: { }
+ #pod template
+ template:
+ spec:
+ containers:
+ - name: ray-head
+ image: rayproject/ray:2.9.0
+ resources:
+ limits:
+ cpu: 1
+ memory: 2Gi
+ requests:
+ cpu: 500m
+ memory: 2Gi
+ ports:
+ - containerPort: 6379
+ name: gcs-server
+ - containerPort: 8265 # Ray dashboard
+ name: dashboard
+ - containerPort: 10001
+ name: client
+ workerGroupSpecs:
+ # the pod replicas in this group typed worker
+ - replicas: 1
+ minReplicas: 1
+ maxReplicas: 5
+ # logical group name, for this called small-group, also can be functional
+ groupName: small-group
+ rayStartParams: { }
+ #pod template
+ template:
+ spec:
+ containers:
+ - name: ray-worker # must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc'
+ image: rayproject/ray:2.9.0
+ resources:
+ limits:
+ cpu: 1
+ memory: 1Gi
+ requests:
+ cpu: 500m
+ memory: 1Gi
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: VolumeBundle
+metadata:
+ name: ray-cluster-volume-bundle
+ namespace: default
+spec:
+ volumes:
+ - name: ray-cluster-code-sample
+ configMap:
+ name: ray-cluster-code-sample
+ items:
+ - key: sample_code.py
+ path: sample_code.py
+ containerVolumeMounts:
+ - name: ray-cluster-code-sample
+ mountPath: /home/ray/samples
+ envVars:
+ - name: ENTRYPOINT_PATH
+ value: /home/ray/samples
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: ray-cluster-code-sample
+ namespace: default
+data:
+ sample_code.py: |
+ import ray
+ import os
+ import requests
+
+ ray.init()
+
+ @ray.remote
+ class Counter:
+ def __init__(self):
+ # Used to verify runtimeEnv
+ self.name = os.getenv("counter_name")
+ assert self.name == "test_counter"
+ self.counter = 0
+
+ def inc(self):
+ self.counter += 1
+
+ def get_counter(self):
+ return "{} got {}".format(self.name, self.counter)
+
+ counter = Counter.remote()
+
+ for _ in range(5):
+ ray.get(counter.inc.remote())
+ print(ray.get(counter.get_counter.remote()))
+
+ # Verify that the correct runtime env was used for the job.
+ assert requests.__version__ == "2.26.0"
\ No newline at end of file
diff --git a/cmd/experimental/kjobctl/config/samples/application_profile.yaml b/cmd/experimental/kjobctl/config/samples/ray-job-sample.yaml
similarity index 59%
rename from cmd/experimental/kjobctl/config/samples/application_profile.yaml
rename to cmd/experimental/kjobctl/config/samples/ray-job-sample.yaml
index 3fe9cb8e941..3d731fb1794 100644
--- a/cmd/experimental/kjobctl/config/samples/application_profile.yaml
+++ b/cmd/experimental/kjobctl/config/samples/ray-job-sample.yaml
@@ -2,81 +2,18 @@
apiVersion: kjobctl.x-k8s.io/v1alpha1
kind: ApplicationProfile
metadata:
- name: sample-profile
+ name: ray-job-profile
namespace: default
spec:
supportedModes:
- - name: Interactive
- template: sample-pod-template
- requiredFlags: []
- - name: Job
- template: sample-job-template
- requiredFlags: ["cmd"]
- - name: Slurm
- template: sample-slurm-template
- requiredFlags: []
- name: RayJob
- template: sample-ray-job-template
- requiredFlags: []
- - name: RayCluster
- template: sample-ray-cluster-template
- requiredFlags: []
- volumeBundles: ["ray-job-volume-bundle", "slurm-volume-bundle"]
----
-apiVersion: v1
-kind: PodTemplate
-metadata:
- name: sample-pod-template
- namespace: default
-template:
- spec:
- containers:
- - name: sample-container
- image: busybox:1.28
- command: ['/bin/sh']
----
-apiVersion: kjobctl.x-k8s.io/v1alpha1
-kind: JobTemplate
-metadata:
- name: sample-job-template
- namespace: default
-template:
- spec:
- parallelism: 3
- completions: 3
- template:
- spec:
- containers:
- - name: sample-container
- image: gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
- args: [ "30s" ]
- resources:
- requests:
- cpu: "1"
- memory: "200Mi"
- restartPolicy: Never
----
-apiVersion: kjobctl.x-k8s.io/v1alpha1
-kind: JobTemplate
-metadata:
- name: sample-slurm-template
- namespace: default
-template:
- spec:
- parallelism: 3
- completions: 3
- completionMode: Indexed
- template:
- spec:
- containers:
- - name: sample-container
- image: python:3-slim
- restartPolicy: OnFailure
+ template: ray-job-template
+ volumeBundles: ["ray-job-volume-bundle"]
---
apiVersion: kjobctl.x-k8s.io/v1alpha1
kind: RayJobTemplate
metadata:
- name: sample-ray-job-template
+ name: ray-job-template
namespace: default
template:
spec:
@@ -164,57 +101,59 @@ template:
cpu: "1"
requests:
cpu: "200m"
-
---
apiVersion: kjobctl.x-k8s.io/v1alpha1
-kind: RayClusterTemplate
+kind: VolumeBundle
metadata:
- name: sample-ray-cluster-template
+ name: ray-job-volume-bundle
namespace: default
-template:
- spec:
- rayVersion: '2.9.0' # should match the Ray version in the image of the containers
- # Ray head pod template
- headGroupSpec:
- rayStartParams: { }
- #pod template
- template:
- spec:
- containers:
- - name: ray-head
- image: rayproject/ray:2.9.0
- resources:
- limits:
- cpu: 1
- memory: 2Gi
- requests:
- cpu: 500m
- memory: 2Gi
- ports:
- - containerPort: 6379
- name: gcs-server
- - containerPort: 8265 # Ray dashboard
- name: dashboard
- - containerPort: 10001
- name: client
- workerGroupSpecs:
- # the pod replicas in this group typed worker
- - replicas: 1
- minReplicas: 1
- maxReplicas: 5
- # logical group name, for this called small-group, also can be functional
- groupName: small-group
- rayStartParams: { }
- #pod template
- template:
- spec:
- containers:
- - name: ray-worker # must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc'
- image: rayproject/ray:2.9.0
- resources:
- limits:
- cpu: 1
- memory: 1Gi
- requests:
- cpu: 500m
- memory: 1Gi
\ No newline at end of file
+spec:
+ volumes:
+ - name: ray-job-code-sample
+ configMap:
+ name: ray-job-code-sample
+ items:
+ - key: sample_code.py
+ path: sample_code.py
+ containerVolumeMounts:
+ - name: ray-job-code-sample
+ mountPath: /home/ray/samples
+ envVars:
+ - name: ENTRYPOINT_PATH
+ value: /home/ray/samples
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: ray-job-code-sample
+ namespace: default
+data:
+ sample_code.py: |
+ import ray
+ import os
+ import requests
+
+ ray.init()
+
+ @ray.remote
+ class Counter:
+ def __init__(self):
+ # Used to verify runtimeEnv
+ self.name = os.getenv("counter_name")
+ assert self.name == "test_counter"
+ self.counter = 0
+
+ def inc(self):
+ self.counter += 1
+
+ def get_counter(self):
+ return "{} got {}".format(self.name, self.counter)
+
+ counter = Counter.remote()
+
+ for _ in range(5):
+ ray.get(counter.inc.remote())
+ print(ray.get(counter.get_counter.remote()))
+
+ # Verify that the correct runtime env was used for the job.
+ assert requests.__version__ == "2.26.0"
\ No newline at end of file
diff --git a/cmd/experimental/kjobctl/config/samples/ray_job_volume_bundle.yaml b/cmd/experimental/kjobctl/config/samples/ray_job_volume_bundle.yaml
deleted file mode 100644
index 4550360c192..00000000000
--- a/cmd/experimental/kjobctl/config/samples/ray_job_volume_bundle.yaml
+++ /dev/null
@@ -1,54 +0,0 @@
----
-apiVersion: kjobctl.x-k8s.io/v1alpha1
-kind: VolumeBundle
-metadata:
- name: ray-job-volume-bundle
-spec:
- volumes:
- - name: ray-job-code-sample
- configMap:
- name: ray-job-code-sample
- items:
- - key: sample_code.py
- path: sample_code.py
- containerVolumeMounts:
- - name: ray-job-code-sample
- mountPath: /home/ray/samples
- envVars:
- - name: ENTRYPOINT_PATH
- value: /home/ray/samples
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: ray-job-code-sample
-data:
- sample_code.py: |
- import ray
- import os
- import requests
-
- ray.init()
-
- @ray.remote
- class Counter:
- def __init__(self):
- # Used to verify runtimeEnv
- self.name = os.getenv("counter_name")
- assert self.name == "test_counter"
- self.counter = 0
-
- def inc(self):
- self.counter += 1
-
- def get_counter(self):
- return "{} got {}".format(self.name, self.counter)
-
- counter = Counter.remote()
-
- for _ in range(5):
- ray.get(counter.inc.remote())
- print(ray.get(counter.get_counter.remote()))
-
- # Verify that the correct runtime env was used for the job.
- assert requests.__version__ == "2.26.0"
\ No newline at end of file
diff --git a/cmd/experimental/kjobctl/config/samples/slurm-sample.sh b/cmd/experimental/kjobctl/config/samples/slurm/script.sh
similarity index 55%
rename from cmd/experimental/kjobctl/config/samples/slurm-sample.sh
rename to cmd/experimental/kjobctl/config/samples/slurm/script.sh
index 6ed512eeb0b..176956aefb7 100644
--- a/cmd/experimental/kjobctl/config/samples/slurm-sample.sh
+++ b/cmd/experimental/kjobctl/config/samples/slurm/script.sh
@@ -2,7 +2,5 @@
#SBATCH --array=1-3%2
-echo "now processing task id:: ${SLURM_ARRAY_TASK_ID}"
+echo "now processing task id: ${SLURM_ARRAY_TASK_ID}"
python /home/slurm/samples/sample_code.py
-
-exit 0
diff --git a/cmd/experimental/kjobctl/config/samples/slurm/slurm-sample.yaml b/cmd/experimental/kjobctl/config/samples/slurm/slurm-sample.yaml
new file mode 100644
index 00000000000..674fcda76bb
--- /dev/null
+++ b/cmd/experimental/kjobctl/config/samples/slurm/slurm-sample.yaml
@@ -0,0 +1,64 @@
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: ApplicationProfile
+metadata:
+ name: slurm-profile
+ namespace: default
+spec:
+ supportedModes:
+ - name: Slurm
+ template: slurm-template
+ volumeBundles: ["slurm-volume-bundle"]
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: JobTemplate
+metadata:
+ name: slurm-template
+ namespace: default
+template:
+ spec:
+ parallelism: 3
+ completions: 3
+ completionMode: Indexed
+ template:
+ spec:
+ containers:
+ - name: sample-container
+ image: python:3-slim
+ restartPolicy: OnFailure
+---
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: VolumeBundle
+metadata:
+ name: slurm-volume-bundle
+ namespace: default
+spec:
+ volumes:
+ - name: slurm-code-sample
+ configMap:
+ name: slurm-code-sample
+ items:
+ - key: sample_code.py
+ path: sample_code.py
+ containerVolumeMounts:
+ - name: slurm-code-sample
+ mountPath: /home/slurm/samples
+ envVars:
+ - name: ENTRYPOINT_PATH
+ value: /home/slurm/samples
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: slurm-code-sample
+ namespace: default
+data:
+ sample_code.py: |
+ import time
+
+ print('start at ' + time.strftime('%H:%M:%S'))
+
+ print('sleep for 10 seconds ...')
+ time.sleep(10)
+
+ print('stop at ' + time.strftime('%H:%M:%S'))
diff --git a/cmd/experimental/kjobctl/config/samples/slurm_volume_bundle.yaml b/cmd/experimental/kjobctl/config/samples/slurm_volume_bundle.yaml
deleted file mode 100644
index 77cc7247194..00000000000
--- a/cmd/experimental/kjobctl/config/samples/slurm_volume_bundle.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
----
-apiVersion: kjobctl.x-k8s.io/v1alpha1
-kind: VolumeBundle
-metadata:
- name: slurm-volume-bundle
-spec:
- volumes:
- - name: slurm-code-sample
- configMap:
- name: slurm-code-sample
- items:
- - key: sample_code.py
- path: sample_code.py
- containerVolumeMounts:
- - name: slurm-code-sample
- mountPath: /home/slurm/samples
- envVars:
- - name: ENTRYPOINT_PATH
- value: /home/slurm/samples
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: slurm-code-sample
-data:
- sample_code.py: |
- import time
-
- print('start at ' + time.strftime('%H:%M:%S'))
-
- print('sleep for 10 seconds ...')
- time.sleep(10)
-
- print('stop at ' + time.strftime('%H:%M:%S'))
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl.md b/cmd/experimental/kjobctl/docs/commands/kjobctl.md
index bb30fd519e8..a4493218a58 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl.md
@@ -1,6 +1,6 @@
# kjobctl
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/_index.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/_index.md
index 2db74858a3e..20c6ced60c4 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/_index.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/_index.md
@@ -1,6 +1,6 @@
# kjobctl create
@@ -15,41 +15,41 @@ Create a task
## Examples
```
- # Create job
- kjobctl create job \
- --profile my-application-profile \
- --cmd "sleep 5" \
- --parallelism 4 \
- --completions 4 \
- --request cpu=500m,ram=4Gi \
- --localqueue my-local-queue-name
+ # Create job
+ kjobctl create job \
+ --profile my-application-profile \
+ --cmd "sleep 5" \
+ --parallelism 4 \
+ --completions 4 \
+ --request cpu=500m,memory=4Gi \
+ --localqueue my-local-queue-name
- # Create interactive
- kjobctl create interactive \
- --profile my-application-profile \
- --pod-running-timeout 30s \
- --rm
+ # Create interactive
+ kjobctl create interactive \
+ --profile my-application-profile \
+ --pod-running-timeout 30s \
+ --rm
- # Create rayjob
- kjobctl create rayjob \
- --profile my-application-profile \
- --cmd "python /home/ray/samples/sample_code.py" \
- --replicas small-group=1 \
- --min-replicas small-group=1 \
- --max-replicas small-group=5 \
- --localqueue my-local-queue-name
+ # Create rayjob
+ kjobctl create rayjob \
+ --profile my-application-profile \
+ --cmd "python /home/ray/samples/sample_code.py" \
+ --replicas small-group=1 \
+ --min-replicas small-group=1 \
+ --max-replicas small-group=5 \
+ --localqueue my-local-queue-name
- # Create raycluster
- kjobctl create raycluster \
- --profile my-application-profile \
- --replicas small-group=1 \
- --min-replicas small-group=1 \
- --max-replicas small-group=5 \
- --localqueue my-local-queue-name
+ # Create raycluster
+ kjobctl create raycluster \
+ --profile my-application-profile \
+ --replicas small-group=1 \
+ --min-replicas small-group=1 \
+ --max-replicas small-group=5 \
+ --localqueue my-local-queue-name
- # Create slurm
+ # Create slurm
kjobctl create slurm --profile my-application-profile -- \
- --array 0-5 --nodes 3 --ntasks 1 ./script.sh
+ --array 0-5 --nodes 3 --ntasks 1 ./script.sh
```
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_interactive.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_interactive.md
index 96105add010..d9a84797f21 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_interactive.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_interactive.md
@@ -1,6 +1,6 @@
# kjobctl create interactive
@@ -12,18 +12,18 @@ The file is auto-generated from the Go source code of the component using the
Create an interactive shell
```
-kjobctl create interactive --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--cmd COMMAND] [--request RESOURCE_NAME=QUANTITY] [--pod-running-timeout DURATION] [--rm]
+kjobctl create interactive --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--skip-localqueue-validation] [--cmd COMMAND] [--request RESOURCE_NAME=QUANTITY] [--pod-running-timeout DURATION] [--rm]
```
## Examples
```
- # Create interactive
- kjobctl create interactive \
- --profile my-application-profile \
- --pod-running-timeout 30s \
- --rm
+ # Create interactive
+ kjobctl create interactive \
+ --profile my-application-profile \
+ --pod-running-timeout 30s \
+ --rm
```
@@ -135,6 +135,15 @@ kjobctl create interactive --profile APPLICATION_PROFILE_NAME [--localqueue LOCA
If true, keep the managedFields when printing objects in JSON or YAML format.
+
+ --skip-localqueue-validation |
+
+
+ |
+
+ Skip local queue validation. Add local queue even if the queue does not exist.
+ |
+
--template string |
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_job.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_job.md
index 70692f911f2..944b79a08ff 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_job.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_job.md
@@ -1,6 +1,6 @@
# kjobctl create job
@@ -12,21 +12,21 @@ The file is auto-generated from the Go source code of the component using the
Create a job
```
-kjobctl create job --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--cmd COMMAND] [--request RESOURCE_NAME=QUANTITY] [--parallelism PARALLELISM] [--completions COMPLETIONS]
+kjobctl create job --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--skip-localqueue-validation] [--cmd COMMAND] [--request RESOURCE_NAME=QUANTITY] [--parallelism PARALLELISM] [--completions COMPLETIONS]
```
## Examples
```
- # Create job
- kjobctl create job \
- --profile my-application-profile \
- --cmd "sleep 5" \
- --parallelism 4 \
- --completions 4 \
- --request cpu=500m,ram=4Gi \
- --localqueue my-local-queue-name
+ # Create job
+ kjobctl create job \
+ --profile my-application-profile \
+ --cmd "sleep 5" \
+ --parallelism 4 \
+ --completions 4 \
+ --request cpu=500m,memory=4Gi \
+ --localqueue my-local-queue-name
```
@@ -138,6 +138,15 @@ kjobctl create job --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_
If true, keep the managedFields when printing objects in JSON or YAML format.
+
+ --skip-localqueue-validation |
+
+
+ |
+
+ Skip local queue validation. Add local queue even if the queue does not exist.
+ |
+
--template string |
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_raycluster.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_raycluster.md
index ce85ec98391..af3becab24c 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_raycluster.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_raycluster.md
@@ -1,6 +1,6 @@
# kjobctl create raycluster
@@ -11,24 +11,23 @@ The file is auto-generated from the Go source code of the component using the
Create a raycluster.
-KubeRay operator is required for RayCluster.
-How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.
+ KubeRay operator is required for RayCluster. How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.
```
-kjobctl create raycluster --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--replicas [WORKER_GROUP]=REPLICAS] [--min-replicas [WORKER_GROUP]=MIN_REPLICAS] [--max-replicas [WORKER_GROUP]=MAX_REPLICAS]
+kjobctl create raycluster --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--skip-localqueue-validation] [--replicas [WORKER_GROUP]=REPLICAS] [--min-replicas [WORKER_GROUP]=MIN_REPLICAS] [--max-replicas [WORKER_GROUP]=MAX_REPLICAS]
```
## Examples
```
- # Create raycluster
- kjobctl create raycluster \
- --profile my-application-profile \
- --replicas small-group=1 \
- --min-replicas small-group=1 \
- --max-replicas small-group=5 \
- --localqueue my-local-queue-name
+ # Create raycluster
+ kjobctl create raycluster \
+ --profile my-application-profile \
+ --replicas small-group=1 \
+ --min-replicas small-group=1 \
+ --max-replicas small-group=5 \
+ --localqueue my-local-queue-name
```
@@ -131,6 +130,15 @@ kjobctl create raycluster --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL
If true, keep the managedFields when printing objects in JSON or YAML format.
+
+ --skip-localqueue-validation |
+
+
+ |
+
+ Skip local queue validation. Add local queue even if the queue does not exist.
+ |
+
--template string |
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_rayjob.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_rayjob.md
index 784e863799f..1d0e778fb18 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_rayjob.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_rayjob.md
@@ -1,6 +1,6 @@
# kjobctl create rayjob
@@ -11,25 +11,24 @@ The file is auto-generated from the Go source code of the component using the
Create a rayjob.
-KubeRay operator is required for RayJob.
-How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.
+ KubeRay operator is required for RayJob. How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.
```
-kjobctl create rayjob --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--cmd COMMAND] [--replicas [WORKER_GROUP]=REPLICAS] [--min-replicas [WORKER_GROUP]=MIN_REPLICAS] [--max-replicas [WORKER_GROUP]=MAX_REPLICAS]
+kjobctl create rayjob --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--skip-localqueue-validation] [--cmd COMMAND] [--replicas [WORKER_GROUP]=REPLICAS] [--min-replicas [WORKER_GROUP]=MIN_REPLICAS] [--max-replicas [WORKER_GROUP]=MAX_REPLICAS]
```
## Examples
```
- # Create rayjob
- kjobctl create rayjob \
- --profile my-application-profile \
- --cmd "python /home/ray/samples/sample_code.py" \
- --replicas small-group=1 \
- --min-replicas small-group=1 \
- --max-replicas small-group=5 \
- --localqueue my-local-queue-name
+ # Create rayjob
+ kjobctl create rayjob \
+ --profile my-application-profile \
+ --cmd "python /home/ray/samples/sample_code.py" \
+ --replicas small-group=1 \
+ --min-replicas small-group=1 \
+ --max-replicas small-group=5 \
+ --localqueue my-local-queue-name
```
@@ -150,6 +149,15 @@ kjobctl create rayjob --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUE
If true, keep the managedFields when printing objects in JSON or YAML format.
+
+ --skip-localqueue-validation |
+
+
+ |
+
+ Skip local queue validation. Add local queue even if the queue does not exist.
+ |
+
--template string |
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_slurm.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_slurm.md
index 2b0f4542fa6..cf79a1cc773 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_slurm.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_create/kjobctl_create_slurm.md
@@ -1,6 +1,6 @@
# kjobctl create slurm
@@ -12,16 +12,16 @@ The file is auto-generated from the Go source code of the component using the
Create a slurm job
```
-kjobctl create slurm --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--ignore-unknown-flags] -- [--array ARRAY] [--cpus-per-task QUANTITY] [--gpus-per-task QUANTITY] [--mem-per-task QUANTITY] [--mem-per-cpu QUANTITY] [--mem-per-gpu QUANTITY] [--nodes COUNT] [--ntasks COUNT] [--output FILENAME_PATTERN] [--error FILENAME_PATTERN] [--input FILENAME_PATTERN] [--job-name NAME] [--partition NAME] SCRIPT
+kjobctl create slurm --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEUE_NAME] [--skip-localqueue-validation] [--ignore-unknown-flags] [--skip-priority-validation] -- [--array ARRAY] [--cpus-per-task QUANTITY] [--gpus-per-task QUANTITY] [--mem QUANTITY] [--mem-per-task QUANTITY] [--mem-per-cpu QUANTITY] [--mem-per-gpu QUANTITY] [--nodes COUNT] [--ntasks COUNT] [--output FILENAME_PATTERN] [--error FILENAME_PATTERN] [--input FILENAME_PATTERN] [--job-name NAME] [--partition NAME] [--priority NAME] SCRIPT
```
## Examples
```
- # Create slurm
+ # Create slurm
kjobctl create slurm --profile my-application-profile -- \
- --array 0-5 --nodes 3 --ntasks 1 ./script.sh
+ --array 0-5 --nodes 3 --ntasks 1 ./script.sh
```
@@ -70,6 +70,15 @@ kjobctl create slurm --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEU
Ignore all the unsupported flags in the bash script.
+
+ --init-image string Default: "bash:5-alpine3.20" |
+
+
+ |
+
+ The image used for the init container.
+ |
+
--localqueue string |
@@ -106,6 +115,24 @@ kjobctl create slurm --profile APPLICATION_PROFILE_NAME [--localqueue LOCAL_QUEU
If true, keep the managedFields when printing objects in JSON or YAML format.
+
+ --skip-localqueue-validation |
+
+
+ |
+
+ Skip local queue validation. Add local queue even if the queue does not exist.
+ |
+
+
+ --skip-priority-validation |
+
+
+ |
+
+ Skip workload priority class validation. Add priority class label even if the class does not exist.
+ |
+
--template string |
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/_index.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/_index.md
index e6ac776bcd9..019783275e3 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/_index.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/_index.md
@@ -1,6 +1,6 @@
# kjobctl delete
@@ -15,16 +15,16 @@ Delete resources
## Examples
```
- # Delete interactive shell
+ # Delete interactive shell
kjobctl delete interactive my-application-profile-interactive-k2wzd
-
- # Delete Job
+
+ # Delete Job
kjobctl delete job my-application-profile-job-k2wzd
-
- # Delete RayJob
+
+ # Delete RayJob
kjobctl delete rayjob my-application-profile-rayjob-k2wzd
-
- # Delete RayCluster
+
+ # Delete RayCluster
kjobctl delete raycluster my-application-profile-raycluster-k2wzd
```
@@ -233,4 +233,5 @@ Delete resources
* [kjobctl delete job](kjobctl_delete_job.md) - Delete Job
* [kjobctl delete raycluster](kjobctl_delete_raycluster.md) - Delete RayCluster
* [kjobctl delete rayjob](kjobctl_delete_rayjob.md) - Delete RayJob
+* [kjobctl delete slurm](kjobctl_delete_slurm.md) - Delete Slurm
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_interactive.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_interactive.md
index 84891820093..3499a37a929 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_interactive.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_interactive.md
@@ -1,6 +1,6 @@
# kjobctl delete interactive
@@ -19,7 +19,7 @@ kjobctl delete interactive NAME [--cascade STRATEGY] [--dry-run STRATEGY]
## Examples
```
- # Delete interactive shell
+ # Delete interactive shell
kjobctl delete interactive my-application-profile-interactive-k2wzd
```
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_job.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_job.md
index f104f2446a2..752252d4bf0 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_job.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_job.md
@@ -1,6 +1,6 @@
# kjobctl delete job
@@ -19,7 +19,7 @@ kjobctl delete job NAME [--cascade STRATEGY] [--dry-run STRATEGY]
## Examples
```
- # Delete Job
+ # Delete Job
kjobctl delete job my-application-profile-job-k2wzd
```
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_raycluster.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_raycluster.md
index c91f1374ea2..8ddca7e1605 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_raycluster.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_raycluster.md
@@ -1,6 +1,6 @@
# kjobctl delete raycluster
@@ -19,7 +19,7 @@ kjobctl delete raycluster NAME [--cascade STRATEGY] [--dry-run STRATEGY]
## Examples
```
- # Delete RayCluster
+ # Delete RayCluster
kjobctl delete raycluster my-application-profile-raycluster-k2wzd
```
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_rayjob.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_rayjob.md
index 43c66747d3b..1f0935159b6 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_rayjob.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_rayjob.md
@@ -1,6 +1,6 @@
# kjobctl delete rayjob
@@ -19,7 +19,7 @@ kjobctl delete rayjob NAME [--cascade STRATEGY] [--dry-run STRATEGY]
## Examples
```
- # Delete RayJob
+ # Delete RayJob
kjobctl delete rayjob my-application-profile-rayjob-k2wzd
```
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_slurm.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_slurm.md
new file mode 100644
index 00000000000..0c4658386da
--- /dev/null
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_delete/kjobctl_delete_slurm.md
@@ -0,0 +1,281 @@
+
+
+# kjobctl delete slurm
+
+
+## Synopsis
+
+
+Delete Slurm
+
+```
+kjobctl delete slurm NAME [--cascade STRATEGY] [--dry-run STRATEGY]
+```
+
+
+## Examples
+
+```
+ # Delete Slurm
+ kjobctl delete slurm my-application-profile-slurm-k2wzd
+```
+
+
+## Options
+
+
+
+
+
+
+
+
+
+ --allow-missing-template-keys Default: true |
+
+
+ |
+
+ If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
+ |
+
+
+ --cascade string Default: "background" |
+
+
+ |
+
+ Must be "background", "orphan", or "foreground". Defaults to background.
+ |
+
+
+ --dry-run string Default: "none" |
+
+
+ |
+
+ Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.
+ |
+
+
+ -h, --help |
+
+
+ |
+
+ help for slurm
+ |
+
+
+ -o, --output string |
+
+
+ |
+
+ Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).
+ |
+
+
+ --show-managed-fields |
+
+
+ |
+
+ If true, keep the managedFields when printing objects in JSON or YAML format.
+ |
+
+
+ --template string |
+
+
+ |
+
+ Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
+ |
+
+
+
+
+
+
+## Options inherited from parent commands
+
+
+
+
+
+
+
+ --as string |
+
+
+ |
+
+ Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
+ |
+
+
+ --as-group strings |
+
+
+ |
+
+ Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
+ |
+
+
+ --as-uid string |
+
+
+ |
+
+ UID to impersonate for the operation.
+ |
+
+
+ --cache-dir string Default: "$HOME/.kube/cache" |
+
+
+ |
+
+ Default cache directory
+ |
+
+
+ --certificate-authority string |
+
+
+ |
+
+ Path to a cert file for the certificate authority
+ |
+
+
+ --client-certificate string |
+
+
+ |
+
+ Path to a client certificate file for TLS
+ |
+
+
+ --client-key string |
+
+
+ |
+
+ Path to a client key file for TLS
+ |
+
+
+ --cluster string |
+
+
+ |
+
+ The name of the kubeconfig cluster to use
+ |
+
+
+ --context string |
+
+
+ |
+
+ The name of the kubeconfig context to use
+ |
+
+
+ --disable-compression |
+
+
+ |
+
+ If true, opt-out of response compression for all requests to the server
+ |
+
+
+ --insecure-skip-tls-verify |
+
+
+ |
+
+ If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
+ |
+
+
+ --kubeconfig string |
+
+
+ |
+
+ Path to the kubeconfig file to use for CLI requests.
+ |
+
+
+ -n, --namespace string |
+
+
+ |
+
+ If present, the namespace scope for this CLI request
+ |
+
+
+ --request-timeout string Default: "0" |
+
+
+ |
+
+ The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
+ |
+
+
+ -s, --server string |
+
+
+ |
+
+ The address and port of the Kubernetes API server
+ |
+
+
+ --tls-server-name string |
+
+
+ |
+
+ Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
+ |
+
+
+ --token string |
+
+
+ |
+
+ Bearer token for authentication to the API server
+ |
+
+
+ --user string |
+
+
+ |
+
+ The name of the kubeconfig user to use
+ |
+
+
+
+
+
+
+## See Also
+
+* [kjobctl_delete](_index.md) - Delete resources
+
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_describe/_index.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_describe/_index.md
index e347ca746cb..f6ad10ca27d 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_describe/_index.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_describe/_index.md
@@ -1,6 +1,6 @@
# kjobctl describe
@@ -21,7 +21,7 @@ kjobctl describe MODE NAME
```
# Describe a task with job mode
kjobctl describe job sample-job
-
+
# Describe a task with job mode
kjobctl describe job/sample-job
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/_index.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/_index.md
index 2a738ac68fa..593d5828eed 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/_index.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/_index.md
@@ -1,6 +1,6 @@
# kjobctl list
@@ -15,7 +15,7 @@ Display resources
## Examples
```
- # List Job
+ # List Job
kjobctl list job
```
@@ -224,4 +224,5 @@ Display resources
* [kjobctl list job](kjobctl_list_job.md) - List Job
* [kjobctl list raycluster](kjobctl_list_raycluster.md) - List RayCluster
* [kjobctl list rayjob](kjobctl_list_rayjob.md) - List RayJob
+* [kjobctl list slurm](kjobctl_list_slurm.md) - List Slurm
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_interactive.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_interactive.md
index aa65b55443d..b0a3cba64e7 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_interactive.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_interactive.md
@@ -1,6 +1,6 @@
# kjobctl list interactive
@@ -21,7 +21,7 @@ kjobctl list interactive [--profile PROFILE_NAME] [--localqueue LOCALQUEUE_NAME]
```
# List Interactive
kjobctl list interactive
-
+
# List Interactive with profile filter
kjobctl list interactive --profile my-profile
```
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_job.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_job.md
index c2afb54e742..10c330016d4 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_job.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_job.md
@@ -1,6 +1,6 @@
# kjobctl list job
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_raycluster.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_raycluster.md
index bac0628c4bd..49d981f701a 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_raycluster.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_raycluster.md
@@ -1,6 +1,6 @@
# kjobctl list raycluster
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_rayjob.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_rayjob.md
index a15866adab9..5d28f863a7b 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_rayjob.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_rayjob.md
@@ -1,6 +1,6 @@
# kjobctl list rayjob
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_slurm.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_slurm.md
new file mode 100644
index 00000000000..a00088e70ae
--- /dev/null
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_list/kjobctl_list_slurm.md
@@ -0,0 +1,311 @@
+
+
+# kjobctl list slurm
+
+
+## Synopsis
+
+
+List Slurm
+
+```
+kjobctl list slurm [--profile PROFILE_NAME] [--localqueue LOCALQUEUE_NAME] [--selector key1=value1] [--field-selector key1=value1] [--all-namespaces]
+```
+
+
+## Examples
+
+```
+ # List Slurm
+ kjobctl list slurm
+
+ # List Slurm with profile filter
+ kjobctl list slurm --profile my-profile
+```
+
+
+## Options
+
+
+
+
+
+
+
+
+
+ -A, --all-namespaces |
+
+
+ |
+
+ If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
+ |
+
+
+ --allow-missing-template-keys Default: true |
+
+
+ |
+
+ If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
+ |
+
+
+ --field-selector string |
+
+
+ |
+
+ Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
+ |
+
+
+ -h, --help |
+
+
+ |
+
+ help for slurm
+ |
+
+
+ -q, --localqueue string |
+
+
+ |
+
+ Filter by localqueue which is associated with the resource.
+ |
+
+
+ -o, --output string |
+
+
+ |
+
+ Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).
+ |
+
+
+ -p, --profile string |
+
+
+ |
+
+ Filter by profile name which is associated with the resource.
+ |
+
+
+ -l, --selector string |
+
+
+ |
+
+ Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
+ |
+
+
+ --show-managed-fields |
+
+
+ |
+
+ If true, keep the managedFields when printing objects in JSON or YAML format.
+ |
+
+
+ --template string |
+
+
+ |
+
+ Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
+ |
+
+
+
+
+
+
+## Options inherited from parent commands
+
+
+
+
+
+
+
+ --as string |
+
+
+ |
+
+ Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
+ |
+
+
+ --as-group strings |
+
+
+ |
+
+ Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
+ |
+
+
+ --as-uid string |
+
+
+ |
+
+ UID to impersonate for the operation.
+ |
+
+
+ --cache-dir string Default: "$HOME/.kube/cache" |
+
+
+ |
+
+ Default cache directory
+ |
+
+
+ --certificate-authority string |
+
+
+ |
+
+ Path to a cert file for the certificate authority
+ |
+
+
+ --client-certificate string |
+
+
+ |
+
+ Path to a client certificate file for TLS
+ |
+
+
+ --client-key string |
+
+
+ |
+
+ Path to a client key file for TLS
+ |
+
+
+ --cluster string |
+
+
+ |
+
+ The name of the kubeconfig cluster to use
+ |
+
+
+ --context string |
+
+
+ |
+
+ The name of the kubeconfig context to use
+ |
+
+
+ --disable-compression |
+
+
+ |
+
+ If true, opt-out of response compression for all requests to the server
+ |
+
+
+ --insecure-skip-tls-verify |
+
+
+ |
+
+ If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
+ |
+
+
+ --kubeconfig string |
+
+
+ |
+
+ Path to the kubeconfig file to use for CLI requests.
+ |
+
+
+ -n, --namespace string |
+
+
+ |
+
+ If present, the namespace scope for this CLI request
+ |
+
+
+ --request-timeout string Default: "0" |
+
+
+ |
+
+ The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
+ |
+
+
+ -s, --server string |
+
+
+ |
+
+ The address and port of the Kubernetes API server
+ |
+
+
+ --tls-server-name string |
+
+
+ |
+
+ Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
+ |
+
+
+ --token string |
+
+
+ |
+
+ Bearer token for authentication to the API server
+ |
+
+
+ --user string |
+
+
+ |
+
+ The name of the kubeconfig user to use
+ |
+
+
+
+
+
+
+## See Also
+
+* [kjobctl_list](_index.md) - Display resources
+
diff --git a/cmd/experimental/kjobctl/docs/commands/kjobctl_printcrds/_index.md b/cmd/experimental/kjobctl/docs/commands/kjobctl_printcrds/_index.md
index 576e91f9844..b42e2347722 100644
--- a/cmd/experimental/kjobctl/docs/commands/kjobctl_printcrds/_index.md
+++ b/cmd/experimental/kjobctl/docs/commands/kjobctl_printcrds/_index.md
@@ -1,6 +1,6 @@
# kjobctl printcrds
@@ -19,12 +19,11 @@ kjobctl printcrds [flags]
## Examples
```
- # Install or update the kjobctl CRDs
+ # Install or update the kjobctl CRDs
kjobctl printcrds | kubectl apply --server-side -f -
-
+
# Remove the kjobctl CRDs
kjobctl printcrds | kubectl delete --ignore-not-found=true -f -
-
```
diff --git a/cmd/experimental/kjobctl/docs/installation.md b/cmd/experimental/kjobctl/docs/installation.md
index 375321d512d..9c8d90d0392 100644
--- a/cmd/experimental/kjobctl/docs/installation.md
+++ b/cmd/experimental/kjobctl/docs/installation.md
@@ -2,44 +2,6 @@
Installing the `kubectl-kjob` plugin, `kjobctl`.
-## Installing From Release Binaries
-
-### 1. Install Kubernetes CRDs
-
-```shell
-kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/v0.8.0/kubectl-kjob-manifests.yaml
-```
-
-### 2. Download the latest release:
-
-On Linux:
-```shell
-# For AMD64 / x86_64
-[ $(uname -m) = x86_64 ] && curl -Lo ./kubectl-kjob https://github.com/kubernetes-sigs/kjob/releases/download/v0.8.0/kubectl-kjob-linux-amd64
-# For ARM64
-[ $(uname -m) = aarch64 ] && curl -Lo ./kubectl-kjob https://github.com/kubernetes-sigs/kjob/releases/download/v0.8.0/kubectl-kjob-linux-arm64
-```
-
-On Mac:
-```shell
-# For Intel Macs
-[ $(uname -m) = x86_64 ] && curl -Lo ./kubectl-kjob https://github.com/kubernetes-sigs/kjob/releases/download/v0.8.0/kubectl-kjob-darwin-amd64
-# For M1 / ARM Macs
-[ $(uname -m) = arm64 ] && curl -Lo ./kubectl-kjob https://github.com/kubernetes-sigs/kjob/releases/download/v0.8.0/kubectl-kjob-darwin-arm64
-```
-
-### 3. Make the kubectl-kjob binary executable.
-
-```shell
-chmod +x ./kubectl-kjob
-```
-
-### 4. Move the kubectl binary to a file location on your system PATH.
-
-```shell
-sudo mv ./kubectl-kjob /usr/local/bin/kubectl-kjob
-```
-
## Installing From Source
```bash
diff --git a/cmd/experimental/kjobctl/docs/run_slurm.md b/cmd/experimental/kjobctl/docs/run_slurm.md
new file mode 100644
index 00000000000..0d342a4b0a7
--- /dev/null
+++ b/cmd/experimental/kjobctl/docs/run_slurm.md
@@ -0,0 +1,224 @@
+# Run a Slurm Job on Kubernetes
+
+This page demonstrates how to run a Slurm job on a Kubernetes cluster using Kjob.
+
+## Before You Begin
+
+Ensure the following prerequisites are met:
+
+- A Kubernetes cluster is operational.
+- The [kjobctl](installation.md) plugin is installed.
+
+## Slurm Mode in Kjob
+
+This mode is specifically designed to offer a compatibility mode for [Slurm](https://slurm.schedmd.com/) jobs. Kjob does not directly incorporate Slurm's components.
+
+Instead, it simulates Slurm behavior to facilitate a smooth transition for users.
+
+By translating Slurm concepts such as nodes into Kubernetes-compatible terms like pods, Kjob ensures that users familiar with Slurm will find the Kjob environment intuitive and easy to use.
+
+The addition of the Slurm mode to the ApplicationProfile in Kjob aims to replicate the experience of using the sbatch command in Slurm as closely as possible, thereby enhancing user satisfaction and efficiency in managing cluster jobs within a Kubernetes context.
+
+### Supported Options
+
+Kjob provides support for executing Slurm scripts by offering several options that can be specified either through the command line interface, `Kjobctl`, or via the `#SBATCH` directive embedded within the bash script. These options are detailed in the table below:
+
+| Option | Description |
+|---------------------|-------------|
+| -a, --array | See [array option](https://slurm.schedmd.com/sbatch.html#OPT_array) for the specification. |
+| --cpus-per-task | Specifies how many CPUs a container inside a pod requires. |
+| -e, --error | Specifies where to redirect the standard error stream of a task. If not passed, it proceeds to stdout and is available via `kubectl logs`. |
+| --gpus-per-task | Specifies how many GPUs a container inside a pod requires. |
+| -i, --input | Specifies what to pipe into the script. |
+| -J, --job-name= | Specifies the job name. |
+| --mem-per-cpu | Specifies how much memory a container requires, multiplying the number of requested CPUs per task by mem-per-cpu. |
+| --mem-per-gpu | Specifies how much memory a container requires, multiplying the number of requested GPUs per task by mem-per-gpu. |
+| --mem-per-task | Specifies how much memory a container requires. |
+| -N, --nodes | Specifies the number of pods to be used at a time - parallelism in indexed jobs. |
+| -n, --ntasks | Specifies the number of identical containers inside of a pod, usually 1. |
+| -o, --output | Specifies where to redirect the standard output stream of a task. If not passed, it proceeds to stdout and is available via `kubectl logs`. |
+| --partition | Specifies the local queue name. See [Local Queue](https://kueue.sigs.k8s.io/docs/concepts/local_queue/) for more information. |
+
+If an unsupported flag is passed in the script, the command will fail with an error unless `--ignore-unknown-flags` is given.
+
+### Supported Environment Variables
+
+| Name | Description |
+|------------------------------|-------------|
+| $SLURM_JOB_ID | The Job ID. |
+| $SLURM_JOBID | Deprecated. Same as $SLURM_JOB_ID. |
+| $SLURM_SUBMIT_DIR | The path of the job submission directory. |
+| $SLURM_SUBMIT_HOST | The hostname of the node used for job submission. |
+| $SLURM_JOB_NODELIST | Contains the definition (list) of the nodes (actually pods) that is assigned to the job. To be supported later. |
+| $SLURM_NODELIST | Deprecated. Same as $SLURM_JOB_NODELIST. |
+| $SLURM_CPUS_PER_TASK | Number of CPUs per task. |
+| $SLURM_CPUS_ON_NODE | Number of CPUs on the allocated node (actually pod). |
+| $SLURM_JOB_CPUS_PER_NODE | Count of processors available to the job on this node. |
+| $SLURM_CPUS_PER_GPU | Number of CPUs requested per allocated GPU. |
+| $SLURM_MEM_PER_CPU | Memory per CPU. Same as --mem-per-cpu. |
+| $SLURM_MEM_PER_GPU | Memory per GPU. |
+| $SLURM_MEM_PER_NODE | Memory per node. Same as --mem. |
+| $SLURM_GPUS | Number of GPUs requested (in total). |
+| $SLURM_NTASKS | Same as -n, --ntasks. The number of tasks. |
+| $SLURM_NTASKS_PER_NODE | Number of tasks requested per node. |
+| $SLURM_NTASKS_PER_SOCKET | Number of tasks requested per socket. To be supported later. |
+| $SLURM_NTASKS_PER_CORE | Number of tasks requested per core. To be supported later. |
+| $SLURM_NTASKS_PER_GPU | Number of tasks requested per GPU. To be supported later. |
+| $SLURM_NPROCS | Same as -n, --ntasks. See $SLURM_NTASKS. |
+| $SLURM_NNODES | Total number of nodes (actually pods) in the job’s resource allocation. |
+| $SLURM_TASKS_PER_NODE | Number of tasks to be initiated on each node. |
+| $SLURM_ARRAY_JOB_ID | Job array’s master job ID number. For now, same as $SLURM_JOB_ID. |
+| $SLURM_ARRAY_TASK_COUNT | Total number of tasks in a job array. |
+| $SLURM_ARRAY_TASK_MAX | Job array’s maximum ID (index) number. |
+| $SLURM_ARRAY_TASK_MIN | Job array’s minimum ID (index) number. |
+
+## Example
+
+The following example demonstrates a use case for running a Python script.
+
+See [config/samples/slurm](../config/samples/slurm/) for the full samples used in this section.
+
+### 1. Create Slurm Template
+
+First, you need to create a template for your job using the `JobTemplate` kind. This template should specify the container image with all the dependencies to run your task. Below is an example of a template to run a Python script.
+
+```yaml
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: JobTemplate
+metadata:
+ name: sample-slurm-template
+ namespace: default
+template:
+ spec:
+ parallelism: 3
+ completions: 3
+ completionMode: Indexed
+ template:
+ spec:
+ containers:
+ - name: sample-container
+ image: python:3-slim
+ restartPolicy: OnFailure
+```
+
+Once you have created your template, you need an `ApplicationProfile` containing `Slurm` and your new template in the supported modes as shown below:
+
+```yaml
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: ApplicationProfile
+metadata:
+ name: slurm-profile
+ namespace: default
+spec:
+ supportedModes:
+ - name: Slurm
+ template: sample-slurm-template
+ requiredFlags: []
+```
+
+Then, save the file as `application_profile.yaml` and create the ApplicationProfile by running:
+
+```bash
+kubectl create -f application_profile.yaml
+```
+
+> Note: This setup process, including the creation of the JobTemplate and ApplicationProfile, only needs to be completed once and can be applied to subsequent Python script executions.
+
+### 2. Prepare the Python Script for the Job
+
+Before loading the Python script for use with the pods, it's crucial to consider how the script will be made accessible.
+
+For the purposes of this tutorial, we'll utilize a ConfigMap to store and pass the Python script. While this method simplifies the setup and is suitable for demonstration purposes, for a scalable setup, using NFS or a similar shared file system is necessary.
+
+#### Creating a ConfigMap with Your Python Script
+
+Create a file named `sample_code.py` and add your Python script. For example:
+
+```python
+import time
+
+print('Start at ' + time.strftime('%H:%M:%S'))
+
+print('Sleep for 10 seconds...')
+time.sleep(10)
+
+print('Stop at ' + time.strftime('%H:%M:%S'))
+```
+
+To create a `ConfigMap` from this Python script, save it and then run the following command:
+
+```bash
+kubectl create configmap slurm-code-sample --from-file=sample_code.py
+```
+
+This command packages your script into a `ConfigMap` named `slurm-code-sample`.
+
+### 3. Integrate the Script with a VolumeBundle
+
+With your Python script now encapsulated in a `ConfigMap`, the next step is to make it accessible to your Slurm pods through a `VolumeBundle`.
+
+#### Creating a VolumeBundle
+
+Define a `VolumeBundle` object to specify how the containers should mount the volumes containing your script:
+
+```yaml
+apiVersion: kjobctl.x-k8s.io/v1alpha1
+kind: VolumeBundle
+metadata:
+ name: slurm-volume-bundle
+ namespace: default
+spec:
+ volumes:
+ - name: slurm-code-sample
+ configMap:
+ name: slurm-code-sample
+ items:
+ - key: sample_code.py
+ path: sample_code.py
+ containerVolumeMounts:
+ - name: slurm-code-sample
+ mountPath: /home/slurm/samples
+ envVars:
+ - name: ENTRYPOINT_PATH
+ value: /home/slurm/samples
+```
+
+Save this definition as a file named `slurm_volume_bundle.yaml`. And then, apply this configuration to your Kubernetes cluster by running:
+
+```bash
+kubectl create -f slurm_volume_bundle.yaml
+```
+
+This setup mounts the `ConfigMap` as a volume at `/home/slurm/samples` on the pods, making your Python script readily accessible to be executed as part of your Slurm job.
+
+### 4. Submit Job
+
+After setting up the `ApplicationProfile` and `VolumeBundle`, you're ready to run tasks using your template. To submit a job, you need to pass a batch script to the `create slurm` command. You can run your script with custom configurations by the supported options via the `#SBATCH` directive or flags.
+
+Below is an example of a simple batch script which wraps the Python script loaded in the previous step and executes it. Additionally, it sets the array option to run 3 multiple jobs and the maximum number of simultaneously running tasks to 2.
+
+```bash
+#!/bin/bash
+
+#SBATCH --array=1-3%2
+
+echo "Now processing task ID: ${SLURM_ARRAY_TASK_ID}"
+python /home/slurm/samples/sample_code.py
+
+exit 0
+```
+
+To run this batch script, save it as `slurm-sample.sh` and execute:
+
+```bash
+kubectl-kjob create slurm --profile slurm-profile -- slurm-sample.sh
+```
+
+Now, after submitting the job, you should be able to see something similar to the following output in the logs:
+
+```
+Now processing task ID: 1
+Start at 17:08:04
+Sleep for 10 seconds...
+Stop at 17:08:14
+```
diff --git a/cmd/experimental/kjobctl/go.mod b/cmd/experimental/kjobctl/go.mod
index 2cf490607be..edbfc45564c 100644
--- a/cmd/experimental/kjobctl/go.mod
+++ b/cmd/experimental/kjobctl/go.mod
@@ -1,39 +1,40 @@
module sigs.k8s.io/kueue/cmd/experimental/kjobctl
-go 1.22.6
+go 1.23
require (
github.com/google/go-cmp v0.6.0
github.com/onsi/ginkgo/v2 v2.20.2
github.com/onsi/gomega v1.34.2
- github.com/ray-project/kuberay/ray-operator v1.2.1
+ github.com/ray-project/kuberay/ray-operator v1.2.2
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
- k8s.io/api v0.30.4
- k8s.io/apimachinery v0.30.4
- k8s.io/cli-runtime v0.30.4
- k8s.io/client-go v0.30.4
+ k8s.io/api v0.31.1
+ k8s.io/apimachinery v0.31.1
+ k8s.io/cli-runtime v0.31.1
+ k8s.io/client-go v0.31.1
+ k8s.io/component-base v0.31.1
k8s.io/klog/v2 v2.130.1
- k8s.io/kubectl v0.30.4
- k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
- sigs.k8s.io/controller-runtime v0.18.4
- sigs.k8s.io/kueue v0.8.0
+ k8s.io/kubectl v0.31.1
+ k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
+ sigs.k8s.io/controller-runtime v0.19.0
+ sigs.k8s.io/kueue v0.8.1
)
require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
+ github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
- github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
- github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/fvbommel/sortorder v1.1.0 // indirect
+ github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
@@ -59,8 +60,8 @@ require (
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
- github.com/moby/spdystream v0.2.0 // indirect
- github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
+ github.com/moby/spdystream v0.4.0 // indirect
+ github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
@@ -73,6 +74,7 @@ require (
github.com/prometheus/common v0.57.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
+ github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
@@ -86,15 +88,15 @@ require (
golang.org/x/tools v0.24.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
+ gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.30.1 // indirect
- k8s.io/component-base v0.30.4 // indirect
+ k8s.io/apiextensions-apiserver v0.31.1 // indirect
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
- sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect
- sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
+ sigs.k8s.io/kustomize/api v0.17.2 // indirect
+ sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
diff --git a/cmd/experimental/kjobctl/go.sum b/cmd/experimental/kjobctl/go.sum
index 94d46c6e9be..2249f5a77f2 100644
--- a/cmd/experimental/kjobctl/go.sum
+++ b/cmd/experimental/kjobctl/go.sum
@@ -8,6 +8,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
+github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -21,8 +23,9 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -37,8 +40,8 @@ github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
-github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw=
-github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
+github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
+github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
@@ -91,7 +94,6 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
@@ -118,14 +120,16 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
+github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY=
+github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
-github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
-github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
-github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA=
-github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
+github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8=
+github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
+github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
+github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -145,8 +149,9 @@ github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+v
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg=
github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -156,14 +161,14 @@ github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVho
github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
-github.com/ray-project/kuberay/ray-operator v1.2.1 h1:H7ofodGclghsU2TxbDHs+gvqvsOp5DJ/vAPGySL1DIE=
-github.com/ray-project/kuberay/ray-operator v1.2.1/go.mod h1:osTiIyaDoWi5IN1f0tOOtZ4TzVf+5kJXZor8VFvcEiI=
+github.com/ray-project/kuberay/ray-operator v1.2.2 h1:wj4qe9SmJfD1ubgEaVPuAsnU/WFDvremzR8j3JslBdk=
+github.com/ray-project/kuberay/ray-operator v1.2.2/go.mod h1:osTiIyaDoWi5IN1f0tOOtZ4TzVf+5kJXZor8VFvcEiI=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
-github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
+github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
+github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -175,6 +180,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
+github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -273,6 +280,8 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
+gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -283,36 +292,36 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-k8s.io/api v0.30.4 h1:XASIELmW8w8q0i1Y4124LqPoWMycLjyQti/fdYHYjCs=
-k8s.io/api v0.30.4/go.mod h1:ZqniWRKu7WIeLijbbzetF4U9qZ03cg5IRwl8YVs8mX0=
-k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws=
-k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4=
-k8s.io/apimachinery v0.30.4 h1:5QHQI2tInzr8LsT4kU/2+fSeibH1eIHswNx480cqIoY=
-k8s.io/apimachinery v0.30.4/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
-k8s.io/cli-runtime v0.30.4 h1:3iDwgInzWaMh3lrDY8JDj1D6c60agHSv2hy3O/a2a0U=
-k8s.io/cli-runtime v0.30.4/go.mod h1:O9Rf0F9x0zeMCcBQEIQxzd4zvxoqfhZZgDAet4hhBPs=
-k8s.io/client-go v0.30.4 h1:eculUe+HPQoPbixfwmaSZGsKcOf7D288tH6hDAdd+wY=
-k8s.io/client-go v0.30.4/go.mod h1:IBS0R/Mt0LHkNHF4E6n+SUDPG7+m2po6RZU7YHeOpzc=
-k8s.io/component-base v0.30.4 h1:FlgKqazIkIIxpLA4wFXsiPiDllJn9fhsN3G4TeX7T7U=
-k8s.io/component-base v0.30.4/go.mod h1:Qd3h+OJxV/LrnriXG/E15ZK83dzd306qJHW9+87S5ls=
+k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
+k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
+k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
+k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
+k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
+k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
+k8s.io/cli-runtime v0.31.1 h1:/ZmKhmZ6hNqDM+yf9s3Y4KEYakNXUn5sod2LWGGwCuk=
+k8s.io/cli-runtime v0.31.1/go.mod h1:pKv1cDIaq7ehWGuXQ+A//1OIF+7DI+xudXtExMCbe9U=
+k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
+k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
+k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8=
+k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b h1:Q9xmGWBvOGd8UJyccgpYlLosk/JlfP3xQLNkQlHJeXw=
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
-k8s.io/kubectl v0.30.4 h1:jU+6WSvcSgzs07H624RA2L79FnqppyV6BKI+dHWDzyo=
-k8s.io/kubectl v0.30.4/go.mod h1:4KnGCshO4fFxd/tncWcbKH3Nj9wtoFYwMYPj8CUnduE=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
-sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
+k8s.io/kubectl v0.31.1 h1:ih4JQJHxsEggFqDJEHSOdJ69ZxZftgeZvYo7M/cpp24=
+k8s.io/kubectl v0.31.1/go.mod h1:aNuQoR43W6MLAtXQ/Bu4GDmoHlbhHKuyD49lmTC8eJM=
+k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3 h1:b2FmK8YH+QEwq/Sy2uAEhmqL5nPfGYbJOcaqjeYYZoA=
+k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q=
+sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4=
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/kueue v0.8.0 h1:fMfZVcqmPFz4YoLwWiYzVwEHvcF4+QuiQBPFtUCW/64=
-sigs.k8s.io/kueue v0.8.0/go.mod h1:rpiskRaOSf4iapxEWFrJ8Ryp5Uij442XSswav3mvdao=
-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=
-sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag=
+sigs.k8s.io/kueue v0.8.1 h1:jK1ei/EkgmcpMqv4qjyt+6Fmz3TyVTrLUikgPkfREXw=
+sigs.k8s.io/kueue v0.8.1/go.mod h1:1u80mOR4w6tny+a9cE9x/Hq9OJDAVuGNu7WIfyPtMTU=
+sigs.k8s.io/kustomize/api v0.17.2 h1:E7/Fjk7V5fboiuijoZHgs4aHuexi5Y2loXlVOAVAG5g=
+sigs.k8s.io/kustomize/api v0.17.2/go.mod h1:UWTz9Ct+MvoeQsHcJ5e+vziRRkwimm3HytpZgIYqye0=
+sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
+sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
diff --git a/cmd/experimental/kjobctl/hack/tools/go.mod b/cmd/experimental/kjobctl/hack/tools/go.mod
index 677483d3ddc..71987e3d43f 100644
--- a/cmd/experimental/kjobctl/hack/tools/go.mod
+++ b/cmd/experimental/kjobctl/hack/tools/go.mod
@@ -1,118 +1,75 @@
module sigs.k8s.io/kueue/cmd/experimental/kjobctl/hack/tools
-go 1.22.6
+go 1.23
require (
- github.com/golangci/golangci-lint v1.60.3
+ github.com/golangci/golangci-lint v1.61.0
github.com/onsi/ginkgo/v2 v2.20.2
- github.com/spf13/cobra v1.8.1
- github.com/spf13/pflag v1.0.5
gotest.tools/gotestsum v1.12.0
- k8s.io/code-generator v0.30.4
- k8s.io/component-base v0.30.4
- sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240605185440-12cc8d59fabe
- sigs.k8s.io/controller-tools v0.15.0
- sigs.k8s.io/kueue/cmd/experimental/kjobctl v0.0.0-20240724135500-379208b7a148
- sigs.k8s.io/kustomize/kustomize/v5 v5.4.3
+ k8s.io/code-generator v0.31.1
+ sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240813183042-b901db121e1f
+ sigs.k8s.io/controller-tools v0.16.4
+ sigs.k8s.io/kustomize/kustomize/v5 v5.5.0
)
-replace sigs.k8s.io/kueue/cmd/experimental/kjobctl => ../..
-
require (
- github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
- github.com/MakeNowJust/heredoc v1.0.0 // indirect
- github.com/beorn7/perks v1.0.1 // indirect
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
- github.com/cespare/xxhash/v2 v2.3.0 // indirect
- github.com/chai2010/gettext-go v1.0.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
- github.com/evanphx/json-patch v5.9.0+incompatible // indirect
- github.com/evanphx/json-patch/v5 v5.9.0 // indirect
- github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
- github.com/fatih/camelcase v1.0.0 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/fvbommel/sortorder v1.1.0 // indirect
+ github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
- github.com/gobuffalo/flect v1.0.2 // indirect
+ github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
- github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
- github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
- github.com/google/uuid v1.6.0 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
- github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
- github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.17.9 // indirect
- github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/mitchellh/go-wordwrap v1.0.1 // indirect
- github.com/moby/spdystream v0.4.0 // indirect
- github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
- github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
- github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
- github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.20.2 // indirect
- github.com/prometheus/client_model v0.6.1 // indirect
- github.com/prometheus/common v0.57.0 // indirect
- github.com/prometheus/procfs v0.15.1 // indirect
- github.com/ray-project/kuberay/ray-operator v1.2.1 // indirect
- github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
+ github.com/spf13/cobra v1.8.1 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
- go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
- golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
- golang.org/x/mod v0.20.0 // indirect
- golang.org/x/net v0.28.0 // indirect
- golang.org/x/oauth2 v0.21.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/mod v0.21.0 // indirect
+ golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/term v0.23.0 // indirect
- golang.org/x/text v0.17.0 // indirect
- golang.org/x/time v0.5.0 // indirect
- golang.org/x/tools v0.24.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
+ golang.org/x/sys v0.26.0 // indirect
+ golang.org/x/term v0.25.0 // indirect
+ golang.org/x/text v0.19.0 // indirect
+ golang.org/x/tools v0.26.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/api v0.30.4 // indirect
- k8s.io/apiextensions-apiserver v0.30.3 // indirect
- k8s.io/apimachinery v0.30.4 // indirect
- k8s.io/cli-runtime v0.30.4 // indirect
- k8s.io/client-go v0.30.4 // indirect
+ k8s.io/apiextensions-apiserver v0.31.1 // indirect
+ k8s.io/apimachinery v0.31.1 // indirect
k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f // indirect
- k8s.io/kubectl v0.30.4 // indirect
- k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
- sigs.k8s.io/controller-runtime v0.18.4 // indirect
+ k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
- sigs.k8s.io/kueue v0.8.0 // indirect
- sigs.k8s.io/kustomize/api v0.17.3 // indirect
- sigs.k8s.io/kustomize/kyaml v0.17.2 // indirect
+ sigs.k8s.io/kustomize/api v0.18.0 // indirect
+ sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
diff --git a/cmd/experimental/kjobctl/hack/tools/go.sum b/cmd/experimental/kjobctl/hack/tools/go.sum
index 50c0bb8cdd0..37a888815f1 100644
--- a/cmd/experimental/kjobctl/hack/tools/go.sum
+++ b/cmd/experimental/kjobctl/hack/tools/go.sum
@@ -1,29 +1,8 @@
-cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
-github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
-github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
-github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
-github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
-github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
-github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE=
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
-github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
-github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/chai2010/gettext-go v1.0.3 h1:9liNh8t+u26xl5ddmWLmsOsdNLwkdRTg5AG+JnTiM80=
-github.com/chai2010/gettext-go v1.0.3/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA=
-github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
-github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
-github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
-github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
@@ -32,24 +11,14 @@ github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk=
github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE=
github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls=
-github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
-github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
-github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
-github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM=
-github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
-github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
-github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
-github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw=
-github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
+github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
+github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
@@ -62,39 +31,18 @@ github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
-github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
-github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
-github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
+github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4=
+github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
-github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
-github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
-github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
-github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
-github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
-github.com/golangci/golangci-lint v1.60.3 h1:l38A5de24ZeDlcFF+EB7m3W5joPD99/hS5SIHJPyZa0=
-github.com/golangci/golangci-lint v1.60.3/go.mod h1:J4vOpcjzRI+lDL2DKNGBZVB3EQSBfCBCMpaydWLtJNo=
-github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
-github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
+github.com/golangci/golangci-lint v1.61.0 h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8=
+github.com/golangci/golangci-lint v1.61.0/go.mod h1:e4lztIrJJgLPhWvFPDkhiMwEFRrWlmFbrZea3FsJyN8=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
-github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -105,34 +53,18 @@ github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSF
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
-github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
-github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
-github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
-github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
-github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
-github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/jarcoal/httpmock v1.2.0 h1:gSvTxxFR/MEMfsGrvRbdfpRUMBStovlSRLw0Ep1bwwc=
-github.com/jarcoal/httpmock v1.2.0/go.mod h1:oCoTsnAz4+UoOUIf5lJOWV2QQIW5UoeUI6aM2YnWAZk=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
-github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
-github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
-github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
-github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
@@ -142,12 +74,6 @@ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
-github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
-github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
-github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8=
-github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
-github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA=
-github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -155,40 +81,22 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
-github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
-github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
-github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4=
github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag=
-github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
-github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
-github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
-github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
+github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
+github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg=
-github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
-github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
-github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
-github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY=
-github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
-github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
-github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
-github.com/ray-project/kuberay/ray-operator v1.2.1 h1:H7ofodGclghsU2TxbDHs+gvqvsOp5DJ/vAPGySL1DIE=
-github.com/ray-project/kuberay/ray-operator v1.2.1/go.mod h1:osTiIyaDoWi5IN1f0tOOtZ4TzVf+5kJXZor8VFvcEiI=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
@@ -210,13 +118,13 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
+github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY=
-go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -232,12 +140,6 @@ golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIi
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
-golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
-golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -247,12 +149,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
-golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
+golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -266,13 +164,8 @@ golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
-golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
+golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -282,15 +175,12 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -303,12 +193,11 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
+golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
@@ -316,8 +205,8 @@ golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
-golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
-golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
+golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
+golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
@@ -327,15 +216,9 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
-golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
+golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
+golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
-golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
@@ -345,30 +228,12 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=
-golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
-golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
+golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
-gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
-google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
-google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
-google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
-google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
-google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -390,48 +255,32 @@ gotest.tools/gotestsum v1.12.0 h1:CmwtaGDkHxrZm4Ib0Vob89MTfpc3GrEFMJKovliPwGk=
gotest.tools/gotestsum v1.12.0/go.mod h1:fAvqkSptospfSbQw26CTYzNwnsE/ztqLeyhP0h67ARY=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
-honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-k8s.io/api v0.30.4 h1:XASIELmW8w8q0i1Y4124LqPoWMycLjyQti/fdYHYjCs=
-k8s.io/api v0.30.4/go.mod h1:ZqniWRKu7WIeLijbbzetF4U9qZ03cg5IRwl8YVs8mX0=
-k8s.io/apiextensions-apiserver v0.30.3 h1:oChu5li2vsZHx2IvnGP3ah8Nj3KyqG3kRSaKmijhB9U=
-k8s.io/apiextensions-apiserver v0.30.3/go.mod h1:uhXxYDkMAvl6CJw4lrDN4CPbONkF3+XL9cacCT44kV4=
-k8s.io/apimachinery v0.30.4 h1:5QHQI2tInzr8LsT4kU/2+fSeibH1eIHswNx480cqIoY=
-k8s.io/apimachinery v0.30.4/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
-k8s.io/cli-runtime v0.30.4 h1:3iDwgInzWaMh3lrDY8JDj1D6c60agHSv2hy3O/a2a0U=
-k8s.io/cli-runtime v0.30.4/go.mod h1:O9Rf0F9x0zeMCcBQEIQxzd4zvxoqfhZZgDAet4hhBPs=
-k8s.io/client-go v0.30.4 h1:eculUe+HPQoPbixfwmaSZGsKcOf7D288tH6hDAdd+wY=
-k8s.io/client-go v0.30.4/go.mod h1:IBS0R/Mt0LHkNHF4E6n+SUDPG7+m2po6RZU7YHeOpzc=
-k8s.io/code-generator v0.30.4 h1:1J2AcpPNBGh/NH9+m4TDh8Yj+mSbM+JyQhH0QdIMwmE=
-k8s.io/code-generator v0.30.4/go.mod h1:Dd8gxOr5ieh9yHCLKnIkKDmk1H2glH8nYCAqwFogD2M=
-k8s.io/component-base v0.30.4 h1:FlgKqazIkIIxpLA4wFXsiPiDllJn9fhsN3G4TeX7T7U=
-k8s.io/component-base v0.30.4/go.mod h1:Qd3h+OJxV/LrnriXG/E15ZK83dzd306qJHW9+87S5ls=
+k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
+k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
+k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
+k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
+k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs=
+k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs=
k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 h1:bKcdZJOPICVmIIuaM9+MXmapE94dn5AYv5ODs1jA43o=
k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f h1:2sXuKesAYbRHxL3aE2PN6zX/gcJr22cjrsej+W784Tc=
k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
-k8s.io/kubectl v0.30.4 h1:jU+6WSvcSgzs07H624RA2L79FnqppyV6BKI+dHWDzyo=
-k8s.io/kubectl v0.30.4/go.mod h1:4KnGCshO4fFxd/tncWcbKH3Nj9wtoFYwMYPj8CUnduE=
-k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
-k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
-sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
-sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240605185440-12cc8d59fabe h1:fPapvQwJ+A7I2Vm56JkEWJ4VsGQq4d6B1tL9DSdn+xA=
-sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240605185440-12cc8d59fabe/go.mod h1:4+4tM2Es0ycqPedATtzPer5RTrUq3Xab59BYogt0mCE=
-sigs.k8s.io/controller-tools v0.15.0 h1:4dxdABXGDhIa68Fiwaif0vcu32xfwmgQ+w8p+5CxoAI=
-sigs.k8s.io/controller-tools v0.15.0/go.mod h1:8zUSS2T8Hx0APCNRhJWbS3CAQEbIxLa07khzh7pZmXM=
+k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3 h1:b2FmK8YH+QEwq/Sy2uAEhmqL5nPfGYbJOcaqjeYYZoA=
+k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240813183042-b901db121e1f h1:RIqUbZQO5yizUt9nozxQdzyLRD1sG6s2oi/QZrlg/hs=
+sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240813183042-b901db121e1f/go.mod h1:IaDsO8xSPRxRG1/rm9CP7+jPmj0nMNAuNi/yiHnLX8k=
+sigs.k8s.io/controller-tools v0.16.4 h1:VXmar78eDXbx1by/H09ikEq1hiq3bqInxuV3lMr3GmQ=
+sigs.k8s.io/controller-tools v0.16.4/go.mod h1:kcsZyYMXiOFuBhofSPtkB90zTSxVRxVVyvtKQcx3q1A=
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/kueue v0.8.0 h1:fMfZVcqmPFz4YoLwWiYzVwEHvcF4+QuiQBPFtUCW/64=
-sigs.k8s.io/kueue v0.8.0/go.mod h1:rpiskRaOSf4iapxEWFrJ8Ryp5Uij442XSswav3mvdao=
-sigs.k8s.io/kustomize/api v0.17.3 h1:6GCuHSsxq7fN5yhF2XrC+AAr8gxQwhexgHflOAD/JJU=
-sigs.k8s.io/kustomize/api v0.17.3/go.mod h1:TuDH4mdx7jTfK61SQ/j1QZM/QWR+5rmEiNjvYlhzFhc=
-sigs.k8s.io/kustomize/kustomize/v5 v5.4.3 h1:SJMDq/0HYNTFPgmlBuxsGzdBB6furxhwHKHEfzBbvSw=
-sigs.k8s.io/kustomize/kustomize/v5 v5.4.3/go.mod h1:vhSLBp3H7wx0oeh/hE7CMQVNft42plZxUqxhvVZxb8Q=
-sigs.k8s.io/kustomize/kyaml v0.17.2 h1:+AzvoJUY0kq4QAhH/ydPHHMRLijtUKiyVyh7fOSshr0=
-sigs.k8s.io/kustomize/kyaml v0.17.2/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
+sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo=
+sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U=
+sigs.k8s.io/kustomize/kustomize/v5 v5.5.0 h1:o1mtt6vpxsxDYaZKrw3BnEtc+pAjLz7UffnIvHNbvW0=
+sigs.k8s.io/kustomize/kustomize/v5 v5.5.0/go.mod h1:AeFCmgCrXzmvjWWaeZCyBp6XzG1Y0w1svYus8GhJEOE=
+sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E=
+sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
diff --git a/cmd/experimental/kjobctl/pkg/builder/builder.go b/cmd/experimental/kjobctl/pkg/builder/builder.go
index e97c4cec2a1..703ceac932e 100644
--- a/cmd/experimental/kjobctl/pkg/builder/builder.go
+++ b/cmd/experimental/kjobctl/pkg/builder/builder.go
@@ -32,12 +32,13 @@ import (
"k8s.io/apimachinery/pkg/runtime"
k8s "k8s.io/client-go/kubernetes"
"k8s.io/utils/ptr"
+ kueueversioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
var (
@@ -71,42 +72,49 @@ var (
)
type builder interface {
- build(ctx context.Context) ([]runtime.Object, error)
+ build(ctx context.Context) (rootObj runtime.Object, childObjs []runtime.Object, err error)
}
type Builder struct {
clientGetter util.ClientGetter
kjobctlClientset versioned.Interface
k8sClientset k8s.Interface
+ kueueClientset kueueversioned.Interface
namespace string
profileName string
modeName v1alpha1.ApplicationProfileMode
- command []string
- parallelism *int32
- completions *int32
- replicas map[string]int
- minReplicas map[string]int
- maxReplicas map[string]int
- requests corev1.ResourceList
- localQueue string
- rayCluster string
- script string
- array string
- cpusPerTask *resource.Quantity
- error string
- gpusPerTask map[string]*resource.Quantity
- input string
- jobName string
- memPerCPU *resource.Quantity
- memPerGPU *resource.Quantity
- memPerTask *resource.Quantity
- nodes *int32
- nTasks *int32
- output string
- partition string
- ignoreUnknown bool
+ command []string
+ parallelism *int32
+ completions *int32
+ replicas map[string]int
+ minReplicas map[string]int
+ maxReplicas map[string]int
+ requests corev1.ResourceList
+ localQueue string
+ rayCluster string
+ script string
+ array string
+ cpusPerTask *resource.Quantity
+ error string
+ gpusPerTask map[string]*resource.Quantity
+ input string
+ jobName string
+ memPerNode *resource.Quantity
+ memPerCPU *resource.Quantity
+ memPerGPU *resource.Quantity
+ memPerTask *resource.Quantity
+ nodes *int32
+ nTasks *int32
+ output string
+ partition string
+ priority string
+ initImage string
+ ignoreUnknown bool
+ skipLocalQueueValidation bool
+ skipPriorityValidation bool
+ changeDir string
profile *v1alpha1.ApplicationProfile
mode *v1alpha1.SupportedMode
@@ -214,6 +222,11 @@ func (b *Builder) WithJobName(jobName string) *Builder {
return b
}
+func (b *Builder) WithMemPerNode(memPerNode *resource.Quantity) *Builder {
+ b.memPerNode = memPerNode
+ return b
+}
+
func (b *Builder) WithMemPerCPU(memPerCPU *resource.Quantity) *Builder {
b.memPerCPU = memPerCPU
return b
@@ -249,12 +262,37 @@ func (b *Builder) WithPartition(partition string) *Builder {
return b
}
+func (b *Builder) WithPriority(priority string) *Builder {
+ b.priority = priority
+ return b
+}
+
+func (b *Builder) WithInitImage(initImage string) *Builder {
+ b.initImage = initImage
+ return b
+}
+
func (b *Builder) WithIgnoreUnknown(ignoreUnknown bool) *Builder {
b.ignoreUnknown = ignoreUnknown
return b
}
-func (b *Builder) validateGeneral() error {
+func (b *Builder) WithChangeDir(chdir string) *Builder {
+ b.changeDir = chdir
+ return b
+}
+
+func (b *Builder) WithSkipLocalQueueValidation(skip bool) *Builder {
+ b.skipLocalQueueValidation = skip
+ return b
+}
+
+func (b *Builder) WithSkipPriorityValidation(skip bool) *Builder {
+ b.skipPriorityValidation = skip
+ return b
+}
+
+func (b *Builder) validateGeneral(ctx context.Context) error {
if b.namespace == "" {
return noNamespaceSpecifiedErr
}
@@ -267,22 +305,20 @@ func (b *Builder) validateGeneral() error {
return noApplicationProfileModeSpecifiedErr
}
+ // check that local queue exists
+ if len(b.localQueue) != 0 && !b.skipLocalQueueValidation {
+ _, err := b.kueueClientset.KueueV1beta1().LocalQueues(b.namespace).Get(ctx, b.localQueue, metav1.GetOptions{})
+ if err != nil {
+ return err
+ }
+ }
+
return nil
}
func (b *Builder) complete(ctx context.Context) error {
var err error
- b.kjobctlClientset, err = b.clientGetter.KjobctlClientset()
- if err != nil {
- return err
- }
-
- b.k8sClientset, err = b.clientGetter.K8sClientset()
- if err != nil {
- return err
- }
-
b.profile, err = b.kjobctlClientset.KjobctlV1alpha1().ApplicationProfiles(b.namespace).Get(ctx, b.profileName, metav1.GetOptions{})
if err != nil {
return err
@@ -298,13 +334,14 @@ func (b *Builder) complete(ctx context.Context) error {
return applicationProfileModeNotConfiguredErr
}
- volumeBundlesList, err := b.kjobctlClientset.KjobctlV1alpha1().VolumeBundles(b.profile.Namespace).List(ctx, metav1.ListOptions{})
- if err != nil {
- return err
+ for _, name := range b.profile.Spec.VolumeBundles {
+ volumeBundle, err := b.kjobctlClientset.KjobctlV1alpha1().VolumeBundles(b.profile.Namespace).Get(ctx, string(name), metav1.GetOptions{})
+ if err != nil {
+ return err
+ }
+ b.volumeBundles = append(b.volumeBundles, *volumeBundle)
}
- b.volumeBundles = volumeBundlesList.Items
-
return nil
}
@@ -400,9 +437,13 @@ func (b *Builder) validateFlags() error {
return nil
}
-func (b *Builder) Do(ctx context.Context) ([]runtime.Object, error) {
- if err := b.validateGeneral(); err != nil {
- return nil, err
+func (b *Builder) Do(ctx context.Context) (runtime.Object, []runtime.Object, error) {
+ if err := b.setClients(); err != nil {
+ return nil, nil, err
+ }
+
+ if err := b.validateGeneral(ctx); err != nil {
+ return nil, nil, err
}
var bImpl builder
@@ -421,20 +462,41 @@ func (b *Builder) Do(ctx context.Context) ([]runtime.Object, error) {
}
if bImpl == nil {
- return nil, invalidApplicationProfileModeErr
+ return nil, nil, invalidApplicationProfileModeErr
}
if err := b.complete(ctx); err != nil {
- return nil, err
+ return nil, nil, err
}
if err := b.validateFlags(); err != nil {
- return nil, err
+ return nil, nil, err
}
return bImpl.build(ctx)
}
+func (b *Builder) setClients() error {
+ var err error
+
+ b.kjobctlClientset, err = b.clientGetter.KjobctlClientset()
+ if err != nil {
+ return err
+ }
+
+ b.k8sClientset, err = b.clientGetter.K8sClientset()
+ if err != nil {
+ return err
+ }
+
+ b.kueueClientset, err = b.clientGetter.KueueClientset()
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (b *Builder) buildObjectMeta(templateObjectMeta metav1.ObjectMeta) metav1.ObjectMeta {
objectMeta := metav1.ObjectMeta{
Namespace: b.profile.Namespace,
@@ -451,6 +513,10 @@ func (b *Builder) buildObjectMeta(templateObjectMeta metav1.ObjectMeta) metav1.O
objectMeta.Labels[constants.ProfileLabel] = b.profile.Name
}
+ if b.mode != nil {
+ objectMeta.Labels[constants.ModeLabel] = string(b.mode.Name)
+ }
+
if len(b.localQueue) > 0 {
objectMeta.Labels[kueueconstants.QueueLabel] = b.localQueue
}
diff --git a/cmd/experimental/kjobctl/pkg/builder/builder_test.go b/cmd/experimental/kjobctl/pkg/builder/builder_test.go
index 41e441a1425..dcaa9afdfa6 100644
--- a/cmd/experimental/kjobctl/pkg/builder/builder_test.go
+++ b/cmd/experimental/kjobctl/pkg/builder/builder_test.go
@@ -32,7 +32,6 @@ import (
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
- "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
)
@@ -44,7 +43,7 @@ func TestBuilder(t *testing.T) {
profile string
mode v1alpha1.ApplicationProfileMode
kjobctlObjs []runtime.Object
- wantObj []runtime.Object
+ wantRootObj runtime.Object
wantErr error
}{
"shouldn't build job because no namespace specified": {
@@ -416,13 +415,12 @@ func TestBuilder(t *testing.T) {
}).
Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeJob("", metav1.NamespaceDefault).GenerateName("profile-job-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Obj(),
- },
+ wantRootObj: wrappers.MakeJob("", metav1.NamespaceDefault).GenerateName("profile-job-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.JobMode).
+ Obj(),
},
}
for name, tc := range testCases {
@@ -432,7 +430,7 @@ func TestBuilder(t *testing.T) {
tcg := cmdtesting.NewTestClientGetter().
WithKjobctlClientset(fake.NewSimpleClientset(tc.kjobctlObjs...))
- gotObjs, gotErr := NewBuilder(tcg, testStartTime).
+ gotRootObj, gotChildObjs, gotErr := NewBuilder(tcg, testStartTime).
WithNamespace(tc.namespace).
WithProfileName(tc.profile).
WithModeName(tc.mode).
@@ -448,8 +446,12 @@ func TestBuilder(t *testing.T) {
return
}
- if diff := cmp.Diff(tc.wantObj, gotObjs); diff != "" {
- t.Errorf("Objects after build (-want,+got):\n%s", diff)
+ if diff := cmp.Diff(tc.wantRootObj, gotRootObj, opts...); diff != "" {
+ t.Errorf("Root object after build (-want,+got):\n%s", diff)
+ }
+
+ if diff := cmp.Diff([]runtime.Object(nil), gotChildObjs, opts...); diff != "" {
+ t.Errorf("Child objects after build (-want,+got):\n%s", diff)
}
})
}
diff --git a/cmd/experimental/kjobctl/pkg/builder/interactive_builder.go b/cmd/experimental/kjobctl/pkg/builder/interactive_builder.go
index 387f222c5c2..081224866a1 100644
--- a/cmd/experimental/kjobctl/pkg/builder/interactive_builder.go
+++ b/cmd/experimental/kjobctl/pkg/builder/interactive_builder.go
@@ -30,10 +30,10 @@ type interactiveBuilder struct {
var _ builder = (*interactiveBuilder)(nil)
-func (b *interactiveBuilder) build(ctx context.Context) ([]runtime.Object, error) {
+func (b *interactiveBuilder) build(ctx context.Context) (runtime.Object, []runtime.Object, error) {
template, err := b.k8sClientset.CoreV1().PodTemplates(b.profile.Namespace).Get(ctx, string(b.mode.Template), metav1.GetOptions{})
if err != nil {
- return nil, err
+ return nil, nil, err
}
pod := &corev1.Pod{
@@ -41,7 +41,7 @@ func (b *interactiveBuilder) build(ctx context.Context) ([]runtime.Object, error
Kind: "Pod",
APIVersion: "v1",
},
- ObjectMeta: b.buildObjectMeta(template.ObjectMeta),
+ ObjectMeta: b.buildObjectMeta(template.Template.ObjectMeta),
Spec: template.Template.Spec,
}
@@ -52,7 +52,7 @@ func (b *interactiveBuilder) build(ctx context.Context) ([]runtime.Object, error
pod.Spec.Containers[0].Stdin = true
}
- return []runtime.Object{pod}, nil
+ return pod, nil, nil
}
func newInteractiveBuilder(b *Builder) *interactiveBuilder {
diff --git a/cmd/experimental/kjobctl/pkg/builder/interactive_builder_test.go b/cmd/experimental/kjobctl/pkg/builder/interactive_builder_test.go
index ff5af01db88..8971aa538bb 100644
--- a/cmd/experimental/kjobctl/pkg/builder/interactive_builder_test.go
+++ b/cmd/experimental/kjobctl/pkg/builder/interactive_builder_test.go
@@ -33,13 +33,13 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
k8sfake "k8s.io/client-go/kubernetes/fake"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
kjobctlfake "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
func TestInteractiveBuilder(t *testing.T) {
@@ -84,7 +84,7 @@ func TestInteractiveBuilder(t *testing.T) {
localQueue string
k8sObjs []runtime.Object
kjobctlObjs []runtime.Object
- wantObj []runtime.Object
+ wantRootObj runtime.Object
wantErr error
}{
"shouldn't build pod because template not found": {
@@ -108,10 +108,11 @@ func TestInteractiveBuilder(t *testing.T) {
WithSupportedMode(v1alpha1.SupportedMode{Name: v1alpha1.InteractiveMode, Template: "pod-template"}).
Obj(),
},
- wantObj: []runtime.Object{wrappers.MakePod("", metav1.NamespaceDefault).GenerateName("profile-interactive-").
+ wantRootObj: wrappers.MakePod("", metav1.NamespaceDefault).GenerateName("profile-interactive-").
Annotation("foo", "baz").
Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
+ Profile("profile").
+ Mode(v1alpha1.InteractiveMode).
Spec(
testPodTemplateWrapper.Clone().
WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
@@ -127,7 +128,6 @@ func TestInteractiveBuilder(t *testing.T) {
Obj().Template.Spec,
).
Obj(),
- },
},
"should build job with replacements": {
namespace: metav1.NamespaceDefault,
@@ -149,33 +149,32 @@ func TestInteractiveBuilder(t *testing.T) {
Obj(),
wrappers.MakeVolumeBundle("vb2", metav1.NamespaceDefault).Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakePod("", metav1.NamespaceDefault).GenerateName("profile-interactive-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Label(kueueconstants.QueueLabel, "lq1").
- Spec(
- testPodTemplateWrapper.Clone().
- Command([]string{"sleep"}).
- WithRequest(corev1.ResourceCPU, resource.MustParse("3")).
- WithVolume("v3", "config3").
- WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
- WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{
- Name: constants.EnvVarTaskID,
- Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
- }).
- WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
- TTY().
- Stdin().
- Obj().Template.Spec,
- ).
- Obj(),
- },
+ wantRootObj: wrappers.MakePod("", metav1.NamespaceDefault).GenerateName("profile-interactive-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.InteractiveMode).
+ Label(kueueconstants.QueueLabel, "lq1").
+ Spec(
+ testPodTemplateWrapper.Clone().
+ Command([]string{"sleep"}).
+ WithRequest(corev1.ResourceCPU, resource.MustParse("3")).
+ WithVolume("v3", "config3").
+ WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
+ WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ TTY().
+ Stdin().
+ Obj().Template.Spec,
+ ).
+ Obj(),
},
}
for name, tc := range testCases {
@@ -187,13 +186,14 @@ func TestInteractiveBuilder(t *testing.T) {
WithKjobctlClientset(kjobctlfake.NewSimpleClientset(tc.kjobctlObjs...)).
WithK8sClientset(k8sfake.NewSimpleClientset(tc.k8sObjs...))
- gotObjs, gotErr := NewBuilder(tcg, testStartTime).
+ gotRootObj, gotChildObjs, gotErr := NewBuilder(tcg, testStartTime).
WithNamespace(tc.namespace).
WithProfileName(tc.profile).
WithModeName(tc.mode).
WithCommand(tc.command).
WithRequests(tc.requests).
WithLocalQueue(tc.localQueue).
+ WithSkipLocalQueueValidation(true).
Do(ctx)
var opts []cmp.Option
@@ -206,8 +206,12 @@ func TestInteractiveBuilder(t *testing.T) {
return
}
- if diff := cmp.Diff(tc.wantObj, gotObjs); diff != "" {
- t.Errorf("Objects after build (-want,+got):\n%s", diff)
+ if diff := cmp.Diff(tc.wantRootObj, gotRootObj, opts...); diff != "" {
+ t.Errorf("Root object after build (-want,+got):\n%s", diff)
+ }
+
+ if diff := cmp.Diff([]runtime.Object(nil), gotChildObjs, opts...); diff != "" {
+ t.Errorf("Child objects after build (-want,+got):\n%s", diff)
}
})
}
diff --git a/cmd/experimental/kjobctl/pkg/builder/job_builder.go b/cmd/experimental/kjobctl/pkg/builder/job_builder.go
index 7556d3e9a51..5443f051222 100644
--- a/cmd/experimental/kjobctl/pkg/builder/job_builder.go
+++ b/cmd/experimental/kjobctl/pkg/builder/job_builder.go
@@ -30,11 +30,11 @@ type jobBuilder struct {
var _ builder = (*jobBuilder)(nil)
-func (b *jobBuilder) build(ctx context.Context) ([]runtime.Object, error) {
+func (b *jobBuilder) build(ctx context.Context) (runtime.Object, []runtime.Object, error) {
template, err := b.kjobctlClientset.KjobctlV1alpha1().JobTemplates(b.profile.Namespace).
Get(ctx, string(b.mode.Template), metav1.GetOptions{})
if err != nil {
- return nil, err
+ return nil, nil, err
}
job := &batchv1.Job{
@@ -42,7 +42,7 @@ func (b *jobBuilder) build(ctx context.Context) ([]runtime.Object, error) {
Kind: "Job",
APIVersion: "batch/v1",
},
- ObjectMeta: b.buildObjectMeta(template.ObjectMeta),
+ ObjectMeta: b.buildObjectMeta(template.Template.ObjectMeta),
Spec: template.Template.Spec,
}
@@ -56,7 +56,7 @@ func (b *jobBuilder) build(ctx context.Context) ([]runtime.Object, error) {
job.Spec.Completions = b.completions
}
- return []runtime.Object{job}, nil
+ return job, nil, nil
}
func newJobBuilder(b *Builder) *jobBuilder {
diff --git a/cmd/experimental/kjobctl/pkg/builder/job_builder_test.go b/cmd/experimental/kjobctl/pkg/builder/job_builder_test.go
index d4f54bf6300..71e9b9bcd35 100644
--- a/cmd/experimental/kjobctl/pkg/builder/job_builder_test.go
+++ b/cmd/experimental/kjobctl/pkg/builder/job_builder_test.go
@@ -33,13 +33,13 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/utils/ptr"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
kjobctlfake "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
func TestJobBuilder(t *testing.T) {
@@ -87,7 +87,7 @@ func TestJobBuilder(t *testing.T) {
requests corev1.ResourceList
localQueue string
kjobctlObjs []runtime.Object
- wantObj []runtime.Object
+ wantRootObj runtime.Object
wantErr error
}{
"shouldn't build job because template not found": {
@@ -111,25 +111,24 @@ func TestJobBuilder(t *testing.T) {
WithSupportedMode(v1alpha1.SupportedMode{Name: v1alpha1.JobMode, Template: "job-template"}).
Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeJob("", metav1.NamespaceDefault).GenerateName("profile-job-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Spec(
- testJobTemplateWrapper.Clone().
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{
- Name: constants.EnvVarTaskID,
- Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
- }).
- WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
- Obj().Template.Spec,
- ).
- Obj(),
- },
+ wantRootObj: wrappers.MakeJob("", metav1.NamespaceDefault).GenerateName("profile-job-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.JobMode).
+ Spec(
+ testJobTemplateWrapper.Clone().
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj().Template.Spec,
+ ).
+ Obj(),
},
"should build job with replacements": {
namespace: metav1.NamespaceDefault,
@@ -153,33 +152,32 @@ func TestJobBuilder(t *testing.T) {
Obj(),
wrappers.MakeVolumeBundle("vb2", metav1.NamespaceDefault).Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeJob("", metav1.NamespaceDefault).GenerateName("profile-job-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Label(kueueconstants.QueueLabel, "lq1").
- Spec(
- testJobTemplateWrapper.Clone().
- Command([]string{"sleep"}).
- Parallelism(2).
- Completions(3).
- WithRequest(corev1.ResourceCPU, resource.MustParse("3")).
- WithVolume("v3", "config3").
- WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
- WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{
- Name: constants.EnvVarTaskID,
- Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
- }).
- WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
- Obj().Template.Spec,
- ).
- Obj(),
- },
+ wantRootObj: wrappers.MakeJob("", metav1.NamespaceDefault).GenerateName("profile-job-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.JobMode).
+ Label(kueueconstants.QueueLabel, "lq1").
+ Spec(
+ testJobTemplateWrapper.Clone().
+ Command([]string{"sleep"}).
+ Parallelism(2).
+ Completions(3).
+ WithRequest(corev1.ResourceCPU, resource.MustParse("3")).
+ WithVolume("v3", "config3").
+ WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
+ WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj().Template.Spec,
+ ).
+ Obj(),
},
}
for name, tc := range testCases {
@@ -190,7 +188,7 @@ func TestJobBuilder(t *testing.T) {
tcg := cmdtesting.NewTestClientGetter().
WithKjobctlClientset(kjobctlfake.NewSimpleClientset(tc.kjobctlObjs...))
- gotObjs, gotErr := NewBuilder(tcg, testStartTime).
+ gotRootObj, gotChildObjs, gotErr := NewBuilder(tcg, testStartTime).
WithNamespace(tc.namespace).
WithProfileName(tc.profile).
WithModeName(tc.mode).
@@ -199,6 +197,7 @@ func TestJobBuilder(t *testing.T) {
WithCompletions(tc.completions).
WithRequests(tc.requests).
WithLocalQueue(tc.localQueue).
+ WithSkipLocalQueueValidation(true).
Do(ctx)
var opts []cmp.Option
@@ -211,8 +210,12 @@ func TestJobBuilder(t *testing.T) {
return
}
- if diff := cmp.Diff(tc.wantObj, gotObjs); diff != "" {
- t.Errorf("Objects after build (-want,+got):\n%s", diff)
+ if diff := cmp.Diff(tc.wantRootObj, gotRootObj, opts...); diff != "" {
+ t.Errorf("Root object after build (-want,+got):\n%s", diff)
+ }
+
+ if diff := cmp.Diff([]runtime.Object(nil), gotChildObjs, opts...); diff != "" {
+ t.Errorf("Child objects after build (-want,+got):\n%s", diff)
}
})
}
diff --git a/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder.go b/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder.go
index be3f9926250..7a9b7192139 100644
--- a/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder.go
+++ b/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder.go
@@ -30,11 +30,11 @@ type rayClusterBuilder struct {
var _ builder = (*rayClusterBuilder)(nil)
-func (b *rayClusterBuilder) build(ctx context.Context) ([]runtime.Object, error) {
+func (b *rayClusterBuilder) build(ctx context.Context) (runtime.Object, []runtime.Object, error) {
template, err := b.kjobctlClientset.KjobctlV1alpha1().RayClusterTemplates(b.profile.Namespace).
Get(ctx, string(b.mode.Template), metav1.GetOptions{})
if err != nil {
- return nil, err
+ return nil, nil, err
}
rayCluster := &rayv1.RayCluster{
@@ -42,13 +42,13 @@ func (b *rayClusterBuilder) build(ctx context.Context) ([]runtime.Object, error)
Kind: "RayCluster",
APIVersion: "ray.io/v1",
},
- ObjectMeta: b.buildObjectMeta(template.ObjectMeta),
+ ObjectMeta: b.buildObjectMeta(template.Template.ObjectMeta),
Spec: template.Template.Spec,
}
b.buildRayClusterSpec(&rayCluster.Spec)
- return []runtime.Object{rayCluster}, nil
+ return rayCluster, nil, nil
}
func newRayClusterBuilder(b *Builder) *rayClusterBuilder {
diff --git a/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder_test.go b/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder_test.go
index ef247bffaca..30ca75e79c0 100644
--- a/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder_test.go
+++ b/cmd/experimental/kjobctl/pkg/builder/ray_cluster_builder_test.go
@@ -32,13 +32,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
kjobctlfake "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
func TestRayClusterBuilder(t *testing.T) {
@@ -121,7 +121,7 @@ func TestRayClusterBuilder(t *testing.T) {
requests corev1.ResourceList
localQueue string
kjobctlObjs []runtime.Object
- wantObj []runtime.Object
+ wantRootObj runtime.Object
wantErr error
}{
"shouldn't build ray cluster because template not found": {
@@ -145,29 +145,28 @@ func TestRayClusterBuilder(t *testing.T) {
WithSupportedMode(v1alpha1.SupportedMode{Name: v1alpha1.RayClusterMode, Template: "ray-cluster-template"}).
Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeRayCluster("", metav1.NamespaceDefault).GenerateName("profile-raycluster-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Spec(
- testRayClusterTemplateWrapper.Clone().
- Spec(
- *wrappers.FromRayClusterSpec(testRayClusterTemplateWrapper.Clone().Template.Spec).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{
- Name: constants.EnvVarTaskID,
- Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
- }).
- WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
- Obj(),
- ).
- Template.Spec,
- ).
- Obj(),
- },
+ wantRootObj: wrappers.MakeRayCluster("", metav1.NamespaceDefault).GenerateName("profile-raycluster-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.RayClusterMode).
+ Spec(
+ testRayClusterTemplateWrapper.Clone().
+ Spec(
+ *wrappers.FromRayClusterSpec(testRayClusterTemplateWrapper.Clone().Template.Spec).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj(),
+ ).
+ Template.Spec,
+ ).
+ Obj(),
},
"should build ray cluster with replacements": {
namespace: metav1.NamespaceDefault,
@@ -192,39 +191,38 @@ func TestRayClusterBuilder(t *testing.T) {
Obj(),
wrappers.MakeVolumeBundle("vb2", metav1.NamespaceDefault).Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeRayCluster("", metav1.NamespaceDefault).GenerateName("profile-raycluster-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Label(kueueconstants.QueueLabel, "lq1").
- Spec(
- testRayClusterTemplateWrapper.Clone().
- Spec(
- *wrappers.FromRayClusterSpec(testRayClusterTemplateWrapper.Clone().Template.Spec).
- Replicas("g1", 10).
- Replicas("g2", 20).
- MinReplicas("g1", 10).
- MinReplicas("g2", 20).
- MaxReplicas("g1", 15).
- MaxReplicas("g2", 25).
- WithVolume("v3", "config3").
- WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
- WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{
- Name: constants.EnvVarTaskID,
- Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
- }).
- WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
- Obj(),
- ).
- Obj().Template.Spec,
- ).
- Obj(),
- },
+ wantRootObj: wrappers.MakeRayCluster("", metav1.NamespaceDefault).GenerateName("profile-raycluster-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.RayClusterMode).
+ Label(kueueconstants.QueueLabel, "lq1").
+ Spec(
+ testRayClusterTemplateWrapper.Clone().
+ Spec(
+ *wrappers.FromRayClusterSpec(testRayClusterTemplateWrapper.Clone().Template.Spec).
+ Replicas("g1", 10).
+ Replicas("g2", 20).
+ MinReplicas("g1", 10).
+ MinReplicas("g2", 20).
+ MaxReplicas("g1", 15).
+ MaxReplicas("g2", 25).
+ WithVolume("v3", "config3").
+ WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
+ WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj(),
+ ).
+ Obj().Template.Spec,
+ ).
+ Obj(),
},
}
for name, tc := range testCases {
@@ -235,7 +233,7 @@ func TestRayClusterBuilder(t *testing.T) {
tcg := cmdtesting.NewTestClientGetter().
WithKjobctlClientset(kjobctlfake.NewSimpleClientset(tc.kjobctlObjs...))
- gotObjs, gotErr := NewBuilder(tcg, testStartTime).
+ gotRootObj, gotChildObjs, gotErr := NewBuilder(tcg, testStartTime).
WithNamespace(tc.namespace).
WithProfileName(tc.profile).
WithModeName(tc.mode).
@@ -244,6 +242,7 @@ func TestRayClusterBuilder(t *testing.T) {
WithMinReplicas(tc.minReplicas).
WithMaxReplicas(tc.maxReplicas).
WithLocalQueue(tc.localQueue).
+ WithSkipLocalQueueValidation(true).
Do(ctx)
var opts []cmp.Option
@@ -256,8 +255,12 @@ func TestRayClusterBuilder(t *testing.T) {
return
}
- if diff := cmp.Diff(tc.wantObj, gotObjs); diff != "" {
- t.Errorf("Objects after build (-want,+got):\n%s", diff)
+ if diff := cmp.Diff(tc.wantRootObj, gotRootObj, opts...); diff != "" {
+ t.Errorf("Root object after build (-want,+got):\n%s", diff)
+ }
+
+ if diff := cmp.Diff([]runtime.Object(nil), gotChildObjs, opts...); diff != "" {
+ t.Errorf("Child objects after build (-want,+got):\n%s", diff)
}
})
}
diff --git a/cmd/experimental/kjobctl/pkg/builder/ray_job_builder.go b/cmd/experimental/kjobctl/pkg/builder/ray_job_builder.go
index 69e681286c8..9cfcb6da05e 100644
--- a/cmd/experimental/kjobctl/pkg/builder/ray_job_builder.go
+++ b/cmd/experimental/kjobctl/pkg/builder/ray_job_builder.go
@@ -24,7 +24,6 @@ import (
rayutil "github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
-
kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
@@ -34,11 +33,11 @@ type rayJobBuilder struct {
var _ builder = (*rayJobBuilder)(nil)
-func (b *rayJobBuilder) build(ctx context.Context) ([]runtime.Object, error) {
+func (b *rayJobBuilder) build(ctx context.Context) (runtime.Object, []runtime.Object, error) {
template, err := b.kjobctlClientset.KjobctlV1alpha1().RayJobTemplates(b.profile.Namespace).
Get(ctx, string(b.mode.Template), metav1.GetOptions{})
if err != nil {
- return nil, err
+ return nil, nil, err
}
rayJob := &rayv1.RayJob{
@@ -46,7 +45,7 @@ func (b *rayJobBuilder) build(ctx context.Context) ([]runtime.Object, error) {
Kind: "RayJob",
APIVersion: "ray.io/v1",
},
- ObjectMeta: b.buildObjectMeta(template.ObjectMeta),
+ ObjectMeta: b.buildObjectMeta(template.Template.ObjectMeta),
Spec: template.Template.Spec,
}
@@ -65,7 +64,7 @@ func (b *rayJobBuilder) build(ctx context.Context) ([]runtime.Object, error) {
b.buildRayClusterSpec(rayJob.Spec.RayClusterSpec)
}
- return []runtime.Object{rayJob}, nil
+ return rayJob, nil, nil
}
func newRayJobBuilder(b *Builder) *rayJobBuilder {
diff --git a/cmd/experimental/kjobctl/pkg/builder/ray_job_builder_test.go b/cmd/experimental/kjobctl/pkg/builder/ray_job_builder_test.go
index 345d45e5c2f..272bee0d0ff 100644
--- a/cmd/experimental/kjobctl/pkg/builder/ray_job_builder_test.go
+++ b/cmd/experimental/kjobctl/pkg/builder/ray_job_builder_test.go
@@ -32,13 +32,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
kjobctlfake "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
func TestRayJobBuilder(t *testing.T) {
@@ -122,7 +122,7 @@ func TestRayJobBuilder(t *testing.T) {
localQueue string
rayCluster string
kjobctlObjs []runtime.Object
- wantObj []runtime.Object
+ wantRootObj runtime.Object
wantErr error
}{
"shouldn't build ray job because template not found": {
@@ -146,29 +146,28 @@ func TestRayJobBuilder(t *testing.T) {
WithSupportedMode(v1alpha1.SupportedMode{Name: v1alpha1.RayJobMode, Template: "ray-job-template"}).
Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeRayJob("", metav1.NamespaceDefault).GenerateName("profile-rayjob-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Spec(
- testRayJobTemplateWrapper.Clone().
- WithRayClusterSpec(
- wrappers.FromRayClusterSpec(*testRayJobTemplateWrapper.Clone().Template.Spec.RayClusterSpec).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{
- Name: constants.EnvVarTaskID,
- Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
- }).
- WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
- Obj(),
- ).
- Template.Spec,
- ).
- Obj(),
- },
+ wantRootObj: wrappers.MakeRayJob("", metav1.NamespaceDefault).GenerateName("profile-rayjob-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.RayJobMode).
+ Spec(
+ testRayJobTemplateWrapper.Clone().
+ WithRayClusterSpec(
+ wrappers.FromRayClusterSpec(*testRayJobTemplateWrapper.Clone().Template.Spec.RayClusterSpec).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj(),
+ ).
+ Template.Spec,
+ ).
+ Obj(),
},
"should build ray job with replacements": {
namespace: metav1.NamespaceDefault,
@@ -193,40 +192,39 @@ func TestRayJobBuilder(t *testing.T) {
Obj(),
wrappers.MakeVolumeBundle("vb2", metav1.NamespaceDefault).Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeRayJob("", metav1.NamespaceDefault).GenerateName("profile-rayjob-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- Label(kueueconstants.QueueLabel, "lq1").
- Spec(
- testRayJobTemplateWrapper.Clone().
- Entrypoint("sleep").
- WithRayClusterSpec(
- wrappers.FromRayClusterSpec(*testRayJobTemplateWrapper.Clone().Template.Spec.RayClusterSpec).
- Replicas("g1", 10).
- Replicas("g2", 20).
- MinReplicas("g1", 10).
- MinReplicas("g2", 20).
- MaxReplicas("g1", 15).
- MaxReplicas("g2", 25).
- WithVolume("v3", "config3").
- WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
- WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
- WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{
- Name: constants.EnvVarTaskID,
- Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
- }).
- WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
- WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
- Obj(),
- ).
- Obj().Template.Spec,
- ).
- Obj(),
- },
+ wantRootObj: wrappers.MakeRayJob("", metav1.NamespaceDefault).GenerateName("profile-rayjob-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.RayJobMode).
+ Label(kueueconstants.QueueLabel, "lq1").
+ Spec(
+ testRayJobTemplateWrapper.Clone().
+ Entrypoint("sleep").
+ WithRayClusterSpec(
+ wrappers.FromRayClusterSpec(*testRayJobTemplateWrapper.Clone().Template.Spec.RayClusterSpec).
+ Replicas("g1", 10).
+ Replicas("g2", 20).
+ MinReplicas("g1", 10).
+ MinReplicas("g2", 20).
+ MaxReplicas("g1", 15).
+ MaxReplicas("g2", 25).
+ WithVolume("v3", "config3").
+ WithVolumeMount(corev1.VolumeMount{Name: "vm3", MountPath: "/etc/config3"}).
+ WithEnvVar(corev1.EnvVar{Name: "e3", Value: "value3"}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj(),
+ ).
+ Obj().Template.Spec,
+ ).
+ Obj(),
},
"should build ray job with raycluster replacement": {
namespace: metav1.NamespaceDefault,
@@ -249,15 +247,14 @@ func TestRayJobBuilder(t *testing.T) {
Obj(),
wrappers.MakeVolumeBundle("vb2", metav1.NamespaceDefault).Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeRayJob("", metav1.NamespaceDefault).GenerateName("profile-rayjob-").
- Annotation("foo", "baz").
- Label("foo", "bar").
- Label(constants.ProfileLabel, "profile").
- WithRayClusterLabelSelector("rc1").
- Entrypoint("python /home/ray/samples/sample_code.py").
- Obj(),
- },
+ wantRootObj: wrappers.MakeRayJob("", metav1.NamespaceDefault).GenerateName("profile-rayjob-").
+ Annotation("foo", "baz").
+ Label("foo", "bar").
+ Profile("profile").
+ Mode(v1alpha1.RayJobMode).
+ WithRayClusterLabelSelector("rc1").
+ Entrypoint("python /home/ray/samples/sample_code.py").
+ Obj(),
},
}
for name, tc := range testCases {
@@ -268,7 +265,7 @@ func TestRayJobBuilder(t *testing.T) {
tcg := cmdtesting.NewTestClientGetter().
WithKjobctlClientset(kjobctlfake.NewSimpleClientset(tc.kjobctlObjs...))
- gotObjs, gotErr := NewBuilder(tcg, testStartTime).
+ gotRootObj, gotChildObjs, gotErr := NewBuilder(tcg, testStartTime).
WithNamespace(tc.namespace).
WithProfileName(tc.profile).
WithModeName(tc.mode).
@@ -277,6 +274,7 @@ func TestRayJobBuilder(t *testing.T) {
WithMinReplicas(tc.minReplicas).
WithMaxReplicas(tc.maxReplicas).
WithLocalQueue(tc.localQueue).
+ WithSkipLocalQueueValidation(true).
WithRayCluster(tc.rayCluster).
Do(ctx)
@@ -290,8 +288,12 @@ func TestRayJobBuilder(t *testing.T) {
return
}
- if diff := cmp.Diff(tc.wantObj, gotObjs); diff != "" {
- t.Errorf("Objects after build (-want,+got):\n%s", diff)
+ if diff := cmp.Diff(tc.wantRootObj, gotRootObj, opts...); diff != "" {
+ t.Errorf("Root object after build (-want,+got):\n%s", diff)
+ }
+
+ if diff := cmp.Diff([]runtime.Object(nil), gotChildObjs, opts...); diff != "" {
+ t.Errorf("Child objects after build (-want,+got):\n%s", diff)
}
})
}
diff --git a/cmd/experimental/kjobctl/pkg/builder/slurm_builder.go b/cmd/experimental/kjobctl/pkg/builder/slurm_builder.go
index bccf4568ea2..6b674a16741 100644
--- a/cmd/experimental/kjobctl/pkg/builder/slurm_builder.go
+++ b/cmd/experimental/kjobctl/pkg/builder/slurm_builder.go
@@ -17,7 +17,9 @@ limitations under the License.
package builder
import (
+ "bytes"
"context"
+ "embed"
"errors"
"fmt"
"math"
@@ -25,6 +27,7 @@ import (
"slices"
"strconv"
"strings"
+ "text/template"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
@@ -33,15 +36,27 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilrand "k8s.io/apimachinery/pkg/util/rand"
"k8s.io/utils/ptr"
+ kueue "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/parser"
)
+//go:embed templates/slurm_*
+var slurmTemplates embed.FS
+
const (
- slurmScriptFilename = "script"
- slurmEntrypointFilename = "entrypoint.sh"
- slurmPath = "/slurm"
+ // Note that the first job ID will always be 1.
+ slurmArrayJobID = 1
+
+ slurmScriptsPath = "/slurm/scripts"
+ slurmInitEntrypointFilename = "init-entrypoint.sh"
+ slurmEntrypointFilename = "entrypoint.sh"
+ slurmScriptFilename = "script"
+
+ slurmEnvsPath = "/slurm/env"
+ slurmSbatchEnvFilename = "sbatch.env"
+ slurmSlurmEnvFilename = "slurm.env"
//# \\ - Do not process any of the replacement symbols.
//# %% - The character "%".
@@ -81,23 +96,48 @@ var (
noScriptSpecifiedErr = errors.New("no script specified")
)
+var (
+ slurmInitEntrypointFilenamePath = fmt.Sprintf("%s/%s", slurmScriptsPath, slurmInitEntrypointFilename)
+ slurmEntrypointFilenamePath = fmt.Sprintf("%s/%s", slurmScriptsPath, slurmEntrypointFilename)
+ slurmScriptFilenamePath = fmt.Sprintf("%s/%s", slurmScriptsPath, slurmScriptFilename)
+)
+
type slurmBuilder struct {
*Builder
+ objectName string
scriptContent string
+ template *template.Template
arrayIndexes parser.ArrayIndexes
cpusOnNode *resource.Quantity
cpusPerGpu *resource.Quantity
totalMemPerNode *resource.Quantity
- totalGpus int
+ totalGpus *resource.Quantity
}
var _ builder = (*slurmBuilder)(nil)
-func (b *slurmBuilder) validateGeneral() error {
+func (b *slurmBuilder) validateGeneral(ctx context.Context) error {
if len(b.script) == 0 {
return noScriptSpecifiedErr
}
+
+ if b.memPerCPU != nil && b.cpusPerTask == nil {
+ return noCpusPerTaskSpecifiedErr
+ }
+
+ if b.memPerGPU != nil && b.gpusPerTask == nil {
+ return noGpusPerTaskSpecifiedErr
+ }
+
+ // check that priority class exists
+ if len(b.priority) != 0 && !b.skipPriorityValidation {
+ _, err := b.kueueClientset.KueueV1beta1().WorkloadPriorityClasses().Get(ctx, b.priority, metav1.GetOptions{})
+ if err != nil {
+ return err
+ }
+ }
+
return nil
}
@@ -108,6 +148,12 @@ func (b *slurmBuilder) complete() error {
}
b.scriptContent = string(content)
+ t, err := template.ParseFS(slurmTemplates, "templates/*")
+ if err != nil {
+ return err
+ }
+ b.template = t
+
if err := b.getSbatchEnvs(); err != nil {
return err
}
@@ -132,11 +178,14 @@ func (b *slurmBuilder) complete() error {
}
}
+ b.objectName = b.generatePrefixName() + utilrand.String(5)
+
return nil
}
func (b *slurmBuilder) validateMutuallyExclusiveFlags() error {
flags := map[string]bool{
+ string(v1alpha1.MemPerNodeFlag): b.memPerNode != nil,
string(v1alpha1.MemPerTaskFlag): b.memPerTask != nil,
string(v1alpha1.MemPerCPUFlag): b.memPerCPU != nil,
string(v1alpha1.MemPerGPUFlag): b.memPerGPU != nil,
@@ -164,84 +213,114 @@ func (b *slurmBuilder) validateMutuallyExclusiveFlags() error {
return nil
}
-func (b *slurmBuilder) build(ctx context.Context) ([]runtime.Object, error) {
- if err := b.validateGeneral(); err != nil {
- return nil, err
+func (b *slurmBuilder) build(ctx context.Context) (runtime.Object, []runtime.Object, error) {
+ if err := b.validateGeneral(ctx); err != nil {
+ return nil, nil, err
}
if err := b.complete(); err != nil {
- return nil, err
+ return nil, nil, err
}
template, err := b.kjobctlClientset.KjobctlV1alpha1().JobTemplates(b.profile.Namespace).
Get(ctx, string(b.mode.Template), metav1.GetOptions{})
if err != nil {
- return nil, err
+ return nil, nil, err
}
+ objectMeta := b.buildObjectMeta(template.Template.ObjectMeta)
+ objectMeta.GenerateName = ""
+ objectMeta.Name = b.objectName
+
job := &batchv1.Job{
- TypeMeta: metav1.TypeMeta{
- Kind: "Job",
- APIVersion: "batch/v1",
- },
- ObjectMeta: b.buildObjectMeta(template.ObjectMeta),
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: objectMeta,
Spec: template.Template.Spec,
}
job.Spec.CompletionMode = ptr.To(batchv1.IndexedCompletion)
+ job.Spec.Template.Spec.Subdomain = b.objectName
- objectName := b.generatePrefixName() + utilrand.String(5)
- job.ObjectMeta.GenerateName = ""
- job.ObjectMeta.Name = objectName
-
- configMap := &corev1.ConfigMap{
- TypeMeta: metav1.TypeMeta{
- Kind: "ConfigMap",
- APIVersion: "v1",
- },
- ObjectMeta: b.buildObjectMeta(template.ObjectMeta),
- Data: map[string]string{
- slurmEntrypointFilename: b.buildEntrypointScript(),
- slurmScriptFilename: b.scriptContent,
- },
+ if len(b.priority) != 0 {
+ job.Labels[kueue.WorkloadPriorityClassLabel] = b.priority
}
- configMap.ObjectMeta.GenerateName = ""
- configMap.ObjectMeta.Name = objectName
b.buildPodSpecVolumesAndEnv(&job.Spec.Template.Spec)
- job.Spec.Template.Spec.Volumes = append(job.Spec.Template.Spec.Volumes, corev1.Volume{
- Name: configMap.Name,
- VolumeSource: corev1.VolumeSource{
- ConfigMap: &corev1.ConfigMapVolumeSource{
- LocalObjectReference: corev1.LocalObjectReference{
- Name: configMap.Name,
- },
- Items: []corev1.KeyToPath{
- {
- Key: slurmEntrypointFilename,
- Path: slurmEntrypointFilename,
+ job.Spec.Template.Spec.Volumes = append(job.Spec.Template.Spec.Volumes,
+ corev1.Volume{
+ Name: "slurm-scripts",
+ VolumeSource: corev1.VolumeSource{
+ ConfigMap: &corev1.ConfigMapVolumeSource{
+ LocalObjectReference: corev1.LocalObjectReference{
+ Name: b.objectName,
},
- {
- Key: slurmScriptFilename,
- Path: slurmScriptFilename,
- Mode: ptr.To[int32](0755),
+ Items: []corev1.KeyToPath{
+ {
+ Key: slurmInitEntrypointFilename,
+ Path: slurmInitEntrypointFilename,
+ },
+ {
+ Key: slurmEntrypointFilename,
+ Path: slurmEntrypointFilename,
+ },
+ {
+ Key: slurmScriptFilename,
+ Path: slurmScriptFilename,
+ Mode: ptr.To[int32](0755),
+ },
},
},
},
},
+ corev1.Volume{
+ Name: "slurm-env",
+ VolumeSource: corev1.VolumeSource{
+ EmptyDir: &corev1.EmptyDirVolumeSource{},
+ },
+ },
+ )
+
+ job.Spec.Template.Spec.InitContainers = append(job.Spec.Template.Spec.InitContainers, corev1.Container{
+ Name: "slurm-init-env",
+ Image: b.initImage,
+ Command: []string{"bash", slurmInitEntrypointFilenamePath},
+ VolumeMounts: []corev1.VolumeMount{
+ {
+ Name: "slurm-scripts",
+ MountPath: slurmScriptsPath,
+ },
+ {
+ Name: "slurm-env",
+ MountPath: slurmEnvsPath,
+ },
+ },
})
- gpusPerTask, err := resource.ParseQuantity("0")
- if err != nil {
- return nil, errors.New("error initializing gpus counter")
- }
+ var totalGPUsPerTask resource.Quantity
for _, number := range b.gpusPerTask {
- gpusPerTask.Add(*number)
+ totalGPUsPerTask.Add(*number)
+ }
+
+ var memPerCPU, memPerGPU, memPerContainer resource.Quantity
+ if b.memPerCPU != nil && b.cpusPerTask != nil {
+ memPerCPU = *b.memPerCPU
+ memPerCPU.Mul(b.cpusPerTask.Value())
+ }
+
+ if b.memPerGPU != nil && b.gpusPerTask != nil {
+ memPerGPU = *b.memPerGPU
+ memPerGPU.Mul(totalGPUsPerTask.Value())
}
+ if b.memPerNode != nil {
+ mem := b.memPerNode.MilliValue() / int64(len(job.Spec.Template.Spec.Containers))
+ memPerContainer = *resource.NewMilliQuantity(mem, b.memPerNode.Format)
+ }
+
+ var totalCpus, totalGpus, totalMem resource.Quantity
for i := range job.Spec.Template.Spec.Containers {
container := &job.Spec.Template.Spec.Containers[i]
- container.Command = []string{"bash", fmt.Sprintf("%s/entrypoint.sh", slurmPath)}
+ container.Command = []string{"bash", slurmEntrypointFilenamePath}
var requests corev1.ResourceList
if b.requests != nil {
@@ -252,38 +331,54 @@ func (b *slurmBuilder) build(ctx context.Context) ([]runtime.Object, error) {
if b.cpusPerTask != nil {
requests[corev1.ResourceCPU] = *b.cpusPerTask
+ totalCpus.Add(*b.cpusPerTask)
}
if b.gpusPerTask != nil {
for name, number := range b.gpusPerTask {
requests[corev1.ResourceName(name)] = *number
}
+ totalGpus.Add(totalGPUsPerTask)
}
if b.memPerTask != nil {
requests[corev1.ResourceMemory] = *b.memPerTask
+ totalMem.Add(*b.memPerTask)
}
- if b.memPerCPU != nil && b.cpusPerTask != nil {
- memPerCPU := *b.memPerCPU
- memPerCPU.Mul(b.cpusPerTask.Value())
+ if !memPerCPU.IsZero() {
requests[corev1.ResourceMemory] = memPerCPU
+ totalMem.Add(memPerCPU)
}
- if b.memPerGPU != nil && b.gpusPerTask != nil {
- memPerGpu := *b.memPerGPU
- memPerGpu.Mul(gpusPerTask.Value())
- requests[corev1.ResourceMemory] = memPerGpu
+ if !memPerGPU.IsZero() {
+ requests[corev1.ResourceMemory] = memPerGPU
+ totalMem.Add(memPerGPU)
}
if len(requests) > 0 {
- container.Resources.Requests = b.requests
+ container.Resources.Requests = requests
}
- container.VolumeMounts = append(container.VolumeMounts, corev1.VolumeMount{
- Name: configMap.Name,
- MountPath: slurmPath,
- })
+ limits := corev1.ResourceList{}
+ if !memPerContainer.IsZero() {
+ limits[corev1.ResourceMemory] = memPerContainer
+ }
+
+ if len(limits) > 0 {
+ container.Resources.Limits = limits
+ }
+
+ container.VolumeMounts = append(container.VolumeMounts,
+ corev1.VolumeMount{
+ Name: "slurm-scripts",
+ MountPath: slurmScriptsPath,
+ },
+ corev1.VolumeMount{
+ Name: "slurm-env",
+ MountPath: slurmEnvsPath,
+ },
+ )
}
nTasks := ptr.Deref(b.nTasks, 1)
@@ -293,13 +388,31 @@ func (b *slurmBuilder) build(ctx context.Context) ([]runtime.Object, error) {
job.Spec.Parallelism = b.nodes
if nTasks > 1 {
+ replicatedContainer := job.Spec.Template.Spec.Containers[0]
for i := 1; i < int(nTasks); i++ {
- job.Spec.Template.Spec.Containers = append(job.Spec.Template.Spec.Containers, job.Spec.Template.Spec.Containers[0])
+ job.Spec.Template.Spec.Containers = append(job.Spec.Template.Spec.Containers, replicatedContainer)
+
+ if b.cpusPerTask != nil {
+ totalCpus.Add(*b.cpusPerTask)
+ }
+
+ if !memPerCPU.IsZero() {
+ totalMem.Add(memPerCPU)
+ }
+
+ if !memPerGPU.IsZero() {
+ totalMem.Add(memPerGPU)
+ }
}
- for i := range nTasks {
+ for i, j := 0, 0; i <= int(nTasks); i++ {
+ if job.Spec.Template.Spec.Containers[i].Name != replicatedContainer.Name {
+ continue
+ }
+
job.Spec.Template.Spec.Containers[i].Name =
- fmt.Sprintf("%s-%d", job.Spec.Template.Spec.Containers[i].Name, i)
+ fmt.Sprintf("%s-%d", job.Spec.Template.Spec.Containers[i].Name, j)
+ j++
}
}
@@ -314,27 +427,62 @@ func (b *slurmBuilder) build(ctx context.Context) ([]runtime.Object, error) {
job.Spec.Parallelism = b.nodes
}
- if b.cpusPerTask != nil {
- b.cpusOnNode = ptr.To(b.cpusPerTask.DeepCopy())
- b.cpusOnNode.Mul(int64(len(job.Spec.Template.Spec.Containers)))
+ if !totalCpus.IsZero() {
+ b.cpusOnNode = &totalCpus
}
- if b.memPerCPU != nil {
- b.totalMemPerNode = ptr.To(b.memPerCPU.DeepCopy())
- b.totalMemPerNode.Mul(int64(len(job.Spec.Template.Spec.Containers)))
+ if !totalGpus.IsZero() {
+ b.totalGpus = &totalGpus
+ }
+
+ if b.memPerNode != nil {
+ b.totalMemPerNode = b.memPerNode
+ } else if !totalMem.IsZero() {
+ b.totalMemPerNode = &totalMem
+ }
+
+ if b.cpusOnNode != nil && b.totalGpus != nil && !totalGpus.IsZero() {
+ cpusPerGpu := totalCpus.MilliValue() / totalGpus.MilliValue()
+ b.cpusPerGpu = resource.NewQuantity(cpusPerGpu, b.cpusOnNode.Format)
}
- totalGpus := gpusPerTask
- totalTasks := int64(len(job.Spec.Template.Spec.Containers))
- totalGpus.Mul(totalTasks)
- b.totalGpus = int(totalGpus.Value())
+ envEntrypointScript, err := b.buildInitEntrypointScript()
+ if err != nil {
+ return nil, nil, err
+ }
- if b.totalGpus > 0 {
- cpusPerGpu := b.cpusOnNode.Value() / int64(b.totalGpus)
- b.cpusPerGpu = resource.NewQuantity(cpusPerGpu, resource.DecimalSI)
+ entrypointScript, err := b.buildEntrypointScript()
+ if err != nil {
+ return nil, nil, err
}
- return []runtime.Object{job, configMap}, nil
+ configMap := &corev1.ConfigMap{
+ TypeMeta: metav1.TypeMeta{
+ Kind: "ConfigMap",
+ APIVersion: "v1",
+ },
+ ObjectMeta: b.buildObjectMeta(template.Template.ObjectMeta),
+ Data: map[string]string{
+ slurmInitEntrypointFilename: envEntrypointScript,
+ slurmEntrypointFilename: entrypointScript,
+ slurmScriptFilename: b.scriptContent,
+ },
+ }
+ configMap.ObjectMeta.GenerateName = ""
+ configMap.ObjectMeta.Name = b.objectName
+
+ service := &corev1.Service{
+ TypeMeta: metav1.TypeMeta{Kind: "Service", APIVersion: "v1"},
+ ObjectMeta: objectMeta,
+ Spec: corev1.ServiceSpec{
+ ClusterIP: "None",
+ Selector: map[string]string{
+ "job-name": b.objectName,
+ },
+ },
+ }
+
+ return job, []runtime.Object{configMap, service}, nil
}
func (b *slurmBuilder) buildIndexesMap() map[int32][]int32 {
@@ -355,7 +503,49 @@ func (b *slurmBuilder) buildIndexesMap() map[int32][]int32 {
return indexMap
}
-func (b *slurmBuilder) buildEntrypointScript() string {
+type slurmInitEntrypointScript struct {
+ ArrayIndexes string
+
+ EnvsPath string
+ SbatchEnvFilename string
+ SlurmEnvFilename string
+
+ SbatchArrayIndex string
+ SbatchGPUsPerTask string
+ SbatchMemPerCPU string
+ SbatchMemPerGPU string
+ SbatchOutput string
+ SbatchError string
+ SbatchInput string
+ SbatchJobName string
+ SbatchPartition string
+
+ SlurmArrayJobID int32
+ SlurmArrayTaskCount int32
+ SlurmArrayTaskMax int32
+ SlurmArrayTaskMin int32
+ SlurmTasksPerNode int32
+ SlurmCPUsPerTask string
+ SlurmCPUsOnNode string
+ SlurmJobCPUsPerNode string
+ SlurmCPUsPerGPU string
+ SlurmMemPerCPU string
+ SlurmMemPerGPU string
+ SlurmMemPerNode string
+ SlurmGPUs string
+ SlurmNTasks int32
+ SlurmNTasksPerNode int32
+ SlurmNProcs int32
+ SlurmNNodes int32
+ SlurmSubmitDir string
+ SlurmJobNodeList string
+ SlurmJobFirstNode string
+}
+
+func (b *slurmBuilder) buildInitEntrypointScript() (string, error) {
+ nTasks := ptr.Deref(b.nTasks, 1)
+ nodes := ptr.Deref(b.nodes, 1)
+
indexesMap := b.buildIndexesMap()
keyValues := make([]string, 0, len(indexesMap))
for key, value := range indexesMap {
@@ -368,52 +558,6 @@ func (b *slurmBuilder) buildEntrypointScript() string {
slices.Sort(keyValues)
- return fmt.Sprintf(`#!/usr/bin/bash
-
-set -o errexit
-set -o nounset
-set -o pipefail
-
-# External variables
-# JOB_COMPLETION_INDEX - completion index of the job.
-# JOB_CONTAINER_INDEX - container index in the container template.
-
-# ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
-declare -A array_indexes=(%[1]s) # Requires bash v4+
-
-container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
-container_indexes=(${container_indexes//,/ })
-
-if [[ ! -v container_indexes[${JOB_CONTAINER_INDEX}] ]];
-then
- exit 0
-fi
-
-%[2]s
-
-%[3]s
-
-export SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * SLURM_TASKS_PER_NODE + JOB_CONTAINER_INDEX + SLURM_ARRAY_JOB_ID )) # The Job ID.
-export SLURM_JOBID=$SLURM_JOB_ID # Deprecated. Same as $SLURM_JOB_ID
-export SLURM_ARRAY_TASK_ID=${container_indexes[${JOB_CONTAINER_INDEX}]} # Task ID.
-
-%[4]s
-
-input_file=$(unmask_filename "$SBATCH_INPUT")
-output_file=$(unmask_filename "$SBATCH_OUTPUT")
-error_path=$(unmask_filename "$SBATCH_ERROR")
-
-%[5]s
-`,
- strings.Join(keyValues, " "), // %[1]s
- b.buildSbatchVariables(), // %[2]s
- b.buildSlurmVariables(), // %[3]s
- unmaskFilenameFunction, // %[4]s
- b.buildEntrypointCommand(), // %[5]s
- )
-}
-
-func (b *slurmBuilder) buildSbatchVariables() string {
var gpusPerTask, memPerCPU, memPerGPU string
if b.gpusPerTask != nil {
gpus := make([]string, 0)
@@ -429,68 +573,85 @@ func (b *slurmBuilder) buildSbatchVariables() string {
memPerGPU = b.memPerGPU.String()
}
- return fmt.Sprintf(`SBATCH_ARRAY_INX=%[1]s
-SBATCH_GPUS_PER_TASK=%[2]s
-SBATCH_MEM_PER_CPU=%[3]s
-SBATCH_MEM_PER_GPU=%[4]s
-SBATCH_OUTPUT=%[5]s
-SBATCH_ERROR=%[6]s
-SBATCH_INPUT=%[7]s
-SBATCH_JOB_NAME=%[8]s
-SBATCH_PARTITION=%[9]s`,
- b.array, // %[1]s
- gpusPerTask, // %[2]s
- memPerCPU, // %[3]s
- memPerGPU, // %[4]s
- b.output, // %[5]s
- b.error, // %[6]s
- b.input, // %[7]s
- b.jobName, // %[8]s
- b.partition, // %[9]s
- )
+ nodeList := make([]string, nodes)
+ for i := int32(0); i < nodes; i++ {
+ nodeList[i] = fmt.Sprintf("%s-%d.%s", b.objectName, i, b.objectName)
+ }
+
+ scriptValues := slurmInitEntrypointScript{
+ ArrayIndexes: strings.Join(keyValues, " "),
+
+ EnvsPath: slurmEnvsPath,
+ SbatchEnvFilename: slurmSbatchEnvFilename,
+ SlurmEnvFilename: slurmSlurmEnvFilename,
+
+ SbatchArrayIndex: b.array,
+ SbatchGPUsPerTask: gpusPerTask,
+ SbatchMemPerCPU: memPerCPU,
+ SbatchMemPerGPU: memPerGPU,
+ SbatchOutput: b.output,
+ SbatchError: b.error,
+ SbatchInput: b.input,
+ SbatchJobName: b.jobName,
+ SbatchPartition: b.partition,
+
+ SlurmArrayJobID: slurmArrayJobID,
+ SlurmArrayTaskCount: int32(b.arrayIndexes.Count()),
+ SlurmArrayTaskMax: b.arrayIndexes.Max(),
+ SlurmArrayTaskMin: b.arrayIndexes.Min(),
+ SlurmTasksPerNode: nTasks,
+ SlurmCPUsPerTask: getValueOrEmpty(b.cpusPerTask),
+ SlurmCPUsOnNode: getValueOrEmpty(b.cpusOnNode),
+ SlurmJobCPUsPerNode: getValueOrEmpty(b.cpusOnNode),
+ SlurmCPUsPerGPU: getValueOrEmpty(b.cpusPerGpu),
+ SlurmMemPerCPU: getValueOrEmpty(b.memPerCPU),
+ SlurmMemPerGPU: getValueOrEmpty(b.memPerGPU),
+ SlurmMemPerNode: getValueOrEmpty(b.totalMemPerNode),
+ SlurmGPUs: getValueOrEmpty(b.totalGpus),
+ SlurmNTasks: nTasks,
+ SlurmNTasksPerNode: nTasks,
+ SlurmNProcs: nTasks,
+ SlurmNNodes: nodes,
+ SlurmSubmitDir: slurmScriptsPath,
+ SlurmJobNodeList: strings.Join(nodeList, ","),
+ SlurmJobFirstNode: nodeList[0],
+ }
+
+ var script bytes.Buffer
+
+ if err := b.template.ExecuteTemplate(&script, "slurm_init_entrypoint_script.sh.tmpl", scriptValues); err != nil {
+ return "", err
+ }
+
+ return script.String(), nil
}
-func (b *slurmBuilder) buildSlurmVariables() string {
- nTasks := ptr.Deref(b.nTasks, 1)
- nodes := ptr.Deref(b.nodes, 1)
+type slurmEntrypointScript struct {
+ EnvsPath string
+ SbatchEnvFilename string
+ SlurmEnvFilename string
+ UnmaskFilenameFunction string
+ ChangeDir string
+ BuildEntrypointCommand string
+}
- return fmt.Sprintf(`export SLURM_ARRAY_JOB_ID=%[1]d # Job array’s master job ID number.
-export SLURM_ARRAY_TASK_COUNT=%[2]d # Total number of tasks in a job array.
-export SLURM_ARRAY_TASK_MAX=%[3]d # Job array’s maximum ID (index) number.
-export SLURM_ARRAY_TASK_MIN=%[4]d # Job array’s minimum ID (index) number.
-export SLURM_TASKS_PER_NODE=%[5]d # Number of tasks to be initiated on each node.
-export SLURM_CPUS_PER_TASK=%[6]s # Number of CPUs per task.
-export SLURM_CPUS_ON_NODE=%[7]s # Number of CPUs on the allocated node (actually pod).
-export SLURM_JOB_CPUS_PER_NODE=%[8]s # Count of processors available to the job on this node.
-export SLURM_CPUS_PER_GPU=%[9]s # Number of CPUs requested per allocated GPU.
-export SLURM_MEM_PER_CPU=%[10]s # Memory per CPU. Same as --mem-per-cpu .
-export SLURM_MEM_PER_GPU=%[11]s # Memory per GPU.
-export SLURM_MEM_PER_NODE=%[12]s # Memory per node. Same as --mem.
-export SLURM_GPUS=%[13]d # Number of GPUs requested (in total).
-export SLURM_NTASKS=%[14]d # Same as -n, –ntasks. The number of tasks.
-export SLURM_NTASKS_PER_NODE=%[15]d # Number of tasks requested per node.
-export SLURM_NPROCS=$SLURM_NTASKS # Same as -n, --ntasks. See $SLURM_NTASKS.
-export SLURM_NNODES=%[16]d # Total number of nodes (actually pods) in the job’s resource allocation.
-export SLURM_SUBMIT_DIR=%[17]s # The path of the job submission directory.
-export SLURM_SUBMIT_HOST=$HOSTNAME # The hostname of the node used for job submission.`,
- 1, // %[1]d
- b.arrayIndexes.Count(), // %[2]d
- b.arrayIndexes.Max(), // %[3]d
- b.arrayIndexes.Min(), // %[4]d
- nTasks, // %[5]d
- getValueOrEmpty(b.cpusPerTask), // %[6]s
- getValueOrEmpty(b.cpusOnNode), // %[7]s
- getValueOrEmpty(b.cpusOnNode), // %[8]s
- getValueOrEmpty(b.cpusPerGpu), // %[9]s
- getValueOrEmpty(b.memPerCPU), // %[10]s
- getValueOrEmpty(b.memPerGPU), // %[11]s
- getValueOrEmpty(b.totalMemPerNode), // %[12]s
- b.totalGpus, // %[13]s
- nTasks, // %[14]d
- nTasks, // %[15]d
- nodes, // %[16]d
- slurmPath, // %[17]s
- )
+func (b *slurmBuilder) buildEntrypointScript() (string, error) {
+ scriptValues := slurmEntrypointScript{
+ EnvsPath: slurmEnvsPath,
+ SbatchEnvFilename: slurmSbatchEnvFilename,
+ SlurmEnvFilename: slurmSlurmEnvFilename,
+ UnmaskFilenameFunction: unmaskFilenameFunction,
+ ChangeDir: b.changeDir,
+ BuildEntrypointCommand: b.buildEntrypointCommand(),
+ }
+
+ var script bytes.Buffer
+
+ if err := b.template.ExecuteTemplate(&script, "slurm_entrypoint_script.sh.tmpl", scriptValues); err != nil {
+ return "", err
+ }
+
+ return script.String(), nil
}
func getValueOrEmpty(ptr *resource.Quantity) string {
@@ -504,9 +665,7 @@ func getValueOrEmpty(ptr *resource.Quantity) string {
func (b *slurmBuilder) buildEntrypointCommand() string {
strBuilder := strings.Builder{}
- strBuilder.WriteString(slurmPath)
- strBuilder.WriteByte('/')
- strBuilder.WriteString(slurmScriptFilename)
+ strBuilder.WriteString(slurmScriptFilenamePath)
if b.input != "" {
strBuilder.WriteString(" <$input_file")
@@ -538,6 +697,16 @@ func (b *slurmBuilder) getSbatchEnvs() error {
}
}
+ if b.memPerNode == nil {
+ if env, ok := os.LookupEnv("SBATCH_MEM_PER_NODE"); ok {
+ val, err := resource.ParseQuantity(env)
+ if err != nil {
+ return fmt.Errorf("cannot parse '%s': %w", env, err)
+ }
+ b.memPerNode = ptr.To(val)
+ }
+ }
+
if b.memPerTask == nil {
if env, ok := os.LookupEnv("SBATCH_MEM_PER_CPU"); ok {
val, err := resource.ParseQuantity(env)
@@ -599,6 +768,10 @@ func (b *slurmBuilder) replaceScriptFlags() error {
b.gpusPerTask = scriptFlags.GpusPerTask
}
+ if b.memPerNode == nil {
+ b.memPerNode = scriptFlags.MemPerNode
+ }
+
if b.memPerTask == nil {
b.memPerTask = scriptFlags.MemPerTask
}
diff --git a/cmd/experimental/kjobctl/pkg/builder/slurm_builder_test.go b/cmd/experimental/kjobctl/pkg/builder/slurm_builder_test.go
index f5b274fb272..da2e400bcbc 100644
--- a/cmd/experimental/kjobctl/pkg/builder/slurm_builder_test.go
+++ b/cmd/experimental/kjobctl/pkg/builder/slurm_builder_test.go
@@ -22,6 +22,7 @@ import (
"fmt"
"os"
"os/exec"
+ "regexp"
"testing"
"time"
@@ -137,29 +138,31 @@ unmask_filename "%s"
}
type slurmBuilderTestCase struct {
- beforeTest func(tc *slurmBuilderTestCase) error
- afterTest func(tc *slurmBuilderTestCase) error
- tempFile string
- namespace string
- profile string
- mode v1alpha1.ApplicationProfileMode
- array string
- cpusPerTask *resource.Quantity
- gpusPerTask map[string]*resource.Quantity
- memPerTask *resource.Quantity
- memPerCPU *resource.Quantity
- memPerGPU *resource.Quantity
- nodes *int32
- nTasks *int32
- output string
- err string
- input string
- jobName string
- partition string
- kjobctlObjs []runtime.Object
- wantObj []runtime.Object
- wantErr error
- cmpopts []cmp.Option
+ beforeTest func(tc *slurmBuilderTestCase) error
+ afterTest func(tc *slurmBuilderTestCase) error
+ tempFile string
+ namespace string
+ profile string
+ mode v1alpha1.ApplicationProfileMode
+ array string
+ cpusPerTask *resource.Quantity
+ gpusPerTask map[string]*resource.Quantity
+ memPerTask *resource.Quantity
+ memPerCPU *resource.Quantity
+ memPerGPU *resource.Quantity
+ nodes *int32
+ nTasks *int32
+ output string
+ err string
+ input string
+ jobName string
+ partition string
+ initImage string
+ kjobctlObjs []runtime.Object
+ wantRootObj runtime.Object
+ wantChildObjs []runtime.Object
+ wantErr error
+ cmpopts []cmp.Option
}
func beforeSlurmTest(tc *slurmBuilderTestCase) error {
@@ -218,6 +221,7 @@ func TestSlurmBuilderDo(t *testing.T) {
profile: "profile",
mode: v1alpha1.SlurmMode,
array: "1-5%2",
+ initImage: "bash:latest",
kjobctlObjs: []runtime.Object{
wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
@@ -226,26 +230,22 @@ func TestSlurmBuilderDo(t *testing.T) {
WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
Obj(),
},
- wantObj: []runtime.Object{
- wrappers.MakeJob("", metav1.NamespaceDefault).
- Parallelism(2).
- Completions(5).
- CompletionMode(batchv1.IndexedCompletion).
- Profile("profile").
- WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
- Command("bash", "/slurm/entrypoint.sh").
- WithVolumeMount(corev1.VolumeMount{MountPath: "/slurm"}).
- Obj()).
- WithVolume(corev1.Volume{
- VolumeSource: corev1.VolumeSource{
- ConfigMap: &corev1.ConfigMapVolumeSource{
- Items: []corev1.KeyToPath{
- {Key: "entrypoint.sh", Path: "entrypoint.sh"},
- {Key: "script", Path: "script", Mode: ptr.To[int32](0755)},
- },
- },
- },
- }).
+ wantRootObj: wrappers.MakeJob("", metav1.NamespaceDefault).
+ Parallelism(2).
+ Completions(5).
+ CompletionMode(batchv1.IndexedCompletion).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ Subdomain("profile-slurm").
+ WithInitContainer(*wrappers.MakeContainer("slurm-init-env", "bash:latest").
+ Command("bash", "/slurm/scripts/init-entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
+ Obj()).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
WithEnvVar(corev1.EnvVar{
@@ -255,32 +255,59 @@ func TestSlurmBuilderDo(t *testing.T) {
WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
WithEnvVar(corev1.EnvVar{Name: "JOB_CONTAINER_INDEX", Value: "0"}).
- Obj(),
+ Obj()).
+ WithVolume(corev1.Volume{
+ Name: "slurm-scripts",
+ VolumeSource: corev1.VolumeSource{
+ ConfigMap: &corev1.ConfigMapVolumeSource{
+ LocalObjectReference: corev1.LocalObjectReference{Name: "profile-slurm"},
+ Items: []corev1.KeyToPath{
+ {Key: "init-entrypoint.sh", Path: "init-entrypoint.sh"},
+ {Key: "entrypoint.sh", Path: "entrypoint.sh"},
+ {Key: "script", Path: "script", Mode: ptr.To[int32](0755)},
+ },
+ },
+ },
+ }).
+ WithVolume(corev1.Volume{
+ Name: "slurm-env",
+ VolumeSource: corev1.VolumeSource{
+ EmptyDir: &corev1.EmptyDirVolumeSource{},
+ },
+ }).
+ Obj(),
+ wantChildObjs: []runtime.Object{
wrappers.MakeConfigMap("", metav1.NamespaceDefault).
Profile("profile").
+ Mode(v1alpha1.SlurmMode).
Data(map[string]string{
"script": "#!/bin/bash\nsleep 300'",
- "entrypoint.sh": `#!/usr/bin/bash
+ "init-entrypoint.sh": `#!/usr/local/bin/bash
set -o errexit
set -o nounset
set -o pipefail
+set -x
# External variables
# JOB_COMPLETION_INDEX - completion index of the job.
-# JOB_CONTAINER_INDEX - container index in the container template.
-# ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
-declare -A array_indexes=(["0"]="1" ["1"]="2" ["2"]="3" ["3"]="4" ["4"]="5") # Requires bash v4+
+for i in {0..1}
+do
+ # ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
+ declare -A array_indexes=(["0"]="1" ["1"]="2" ["2"]="3" ["3"]="4" ["4"]="5") # Requires bash v4+
-container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
-container_indexes=(${container_indexes//,/ })
+ container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
+ container_indexes=(${container_indexes//,/ })
-if [[ ! -v container_indexes[${JOB_CONTAINER_INDEX}] ]];
-then
- exit 0
-fi
+ if [[ ! -v container_indexes[$i] ]];
+ then
+ break
+ fi
+ mkdir -p /slurm/env/$i
+
+ cat << EOF > /slurm/env/$i/sbatch.env
SBATCH_ARRAY_INX=1-5%2
SBATCH_GPUS_PER_TASK=
SBATCH_MEM_PER_CPU=
@@ -290,30 +317,53 @@ SBATCH_ERROR=
SBATCH_INPUT=
SBATCH_JOB_NAME=
SBATCH_PARTITION=
+EOF
+
+ cat << EOF > /slurm/env/$i/slurm.env
+SLURM_ARRAY_JOB_ID=1
+SLURM_ARRAY_TASK_COUNT=5
+SLURM_ARRAY_TASK_MAX=5
+SLURM_ARRAY_TASK_MIN=1
+SLURM_TASKS_PER_NODE=1
+SLURM_CPUS_PER_TASK=
+SLURM_CPUS_ON_NODE=
+SLURM_JOB_CPUS_PER_NODE=
+SLURM_CPUS_PER_GPU=
+SLURM_MEM_PER_CPU=
+SLURM_MEM_PER_GPU=
+SLURM_MEM_PER_NODE=
+SLURM_GPUS=
+SLURM_NTASKS=1
+SLURM_NTASKS_PER_NODE=1
+SLURM_NPROCS=1
+SLURM_NNODES=2
+SLURM_SUBMIT_DIR=/slurm/scripts
+SLURM_SUBMIT_HOST=$HOSTNAME
+SLURM_JOB_NODELIST=profile-slurm-0.profile-slurm,profile-slurm-1.profile-slurm
+SLURM_JOB_FIRST_NODE=profile-slurm-0.profile-slurm
+SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * 1 + i + 1 ))
+SLURM_JOBID=$(( JOB_COMPLETION_INDEX * 1 + i + 1 ))
+SLURM_ARRAY_TASK_ID=${container_indexes[$i]}
+EOF
+
+done
+`,
+ "entrypoint.sh": `#!/usr/local/bin/bash
-export SLURM_ARRAY_JOB_ID=1 # Job array’s master job ID number.
-export SLURM_ARRAY_TASK_COUNT=5 # Total number of tasks in a job array.
-export SLURM_ARRAY_TASK_MAX=5 # Job array’s maximum ID (index) number.
-export SLURM_ARRAY_TASK_MIN=1 # Job array’s minimum ID (index) number.
-export SLURM_TASKS_PER_NODE=1 # Number of tasks to be initiated on each node.
-export SLURM_CPUS_PER_TASK= # Number of CPUs per task.
-export SLURM_CPUS_ON_NODE= # Number of CPUs on the allocated node (actually pod).
-export SLURM_JOB_CPUS_PER_NODE= # Count of processors available to the job on this node.
-export SLURM_CPUS_PER_GPU= # Number of CPUs requested per allocated GPU.
-export SLURM_MEM_PER_CPU= # Memory per CPU. Same as --mem-per-cpu .
-export SLURM_MEM_PER_GPU= # Memory per GPU.
-export SLURM_MEM_PER_NODE= # Memory per node. Same as --mem.
-export SLURM_GPUS=0 # Number of GPUs requested (in total).
-export SLURM_NTASKS=1 # Same as -n, –ntasks. The number of tasks.
-export SLURM_NTASKS_PER_NODE=1 # Number of tasks requested per node.
-export SLURM_NPROCS=$SLURM_NTASKS # Same as -n, --ntasks. See $SLURM_NTASKS.
-export SLURM_NNODES=2 # Total number of nodes (actually pods) in the job’s resource allocation.
-export SLURM_SUBMIT_DIR=/slurm # The path of the job submission directory.
-export SLURM_SUBMIT_HOST=$HOSTNAME # The hostname of the node used for job submission.
-
-export SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * SLURM_TASKS_PER_NODE + JOB_CONTAINER_INDEX + SLURM_ARRAY_JOB_ID )) # The Job ID.
-export SLURM_JOBID=$SLURM_JOB_ID # Deprecated. Same as $SLURM_JOB_ID
-export SLURM_ARRAY_TASK_ID=${container_indexes[${JOB_CONTAINER_INDEX}]} # Task ID.
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# External variables
+# JOB_CONTAINER_INDEX - container index in the container template.
+
+if [ ! -d "/slurm/env/$JOB_CONTAINER_INDEX" ]; then
+ exit 0
+fi
+
+source /slurm/env/$JOB_CONTAINER_INDEX/sbatch.env
+
+export $(cat /slurm/env/$JOB_CONTAINER_INDEX/slurm.env | xargs)
unmask_filename () {
replaced="$1"
@@ -342,15 +392,27 @@ input_file=$(unmask_filename "$SBATCH_INPUT")
output_file=$(unmask_filename "$SBATCH_OUTPUT")
error_path=$(unmask_filename "$SBATCH_ERROR")
-/slurm/script
+/slurm/scripts/script
`,
}).
Obj(),
+ wrappers.MakeService("profile-slurm", metav1.NamespaceDefault).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ ClusterIP("None").
+ Selector("job-name", "profile-slurm").
+ Obj(),
},
cmpopts: []cmp.Option{
- cmpopts.IgnoreFields(corev1.Volume{}, "Name"),
- cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
- cmpopts.IgnoreFields(corev1.VolumeMount{}, "Name"),
+ cmpopts.AcyclicTransformer("RemoveGeneratedNameSuffixInString", func(val string) string {
+ return regexp.MustCompile("(profile-slurm)(-.{5})").ReplaceAllString(val, "$1")
+ }),
+ cmpopts.AcyclicTransformer("RemoveGeneratedNameSuffixInMap", func(m map[string]string) map[string]string {
+ for key, val := range m {
+ m[key] = regexp.MustCompile("(profile-slurm)(-.{5})").ReplaceAllString(val, "$1")
+ }
+ return m
+ }),
},
},
}
@@ -377,7 +439,7 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
tcg := cmdtesting.NewTestClientGetter().
WithKjobctlClientset(kjobctlfake.NewSimpleClientset(tc.kjobctlObjs...))
- gotObjs, gotErr := NewBuilder(tcg, testStartTime).
+ gotRootObj, gotChildObjs, gotErr := NewBuilder(tcg, testStartTime).
WithNamespace(tc.namespace).
WithProfileName(tc.profile).
WithModeName(tc.mode).
@@ -395,6 +457,7 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
WithInput(tc.input).
WithJobName(tc.jobName).
WithPartition(tc.partition).
+ WithInitImage(tc.initImage).
Do(ctx)
var opts []cmp.Option
@@ -409,8 +472,13 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
defaultCmpOpts := []cmp.Option{cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name")}
opts = append(defaultCmpOpts, tc.cmpopts...)
- if diff := cmp.Diff(tc.wantObj, gotObjs, opts...); diff != "" {
- t.Errorf("Objects after build (-want,+got):\n%s", diff)
+
+ if diff := cmp.Diff(tc.wantRootObj, gotRootObj, opts...); diff != "" {
+ t.Errorf("Root object after build (-want,+got):\n%s", diff)
+ }
+
+ if diff := cmp.Diff(tc.wantChildObjs, gotChildObjs, opts...); diff != "" {
+ t.Errorf("Child objects after build (-want,+got):\n%s", diff)
}
})
}
@@ -426,40 +494,40 @@ func TestSlurmBuilderBuildEntrypointCommand(t *testing.T) {
wantEntrypointCommand string
}{
"should build entrypoint command": {
- wantEntrypointCommand: "/slurm/script",
+ wantEntrypointCommand: "/slurm/scripts/script",
},
"should build entrypoint command with output": {
output: "/home/test/stdout.out",
- wantEntrypointCommand: "/slurm/script 1>$output_file",
+ wantEntrypointCommand: "/slurm/scripts/script 1>$output_file",
},
"should build entrypoint command with error": {
error: "/home/test/stderr.out",
- wantEntrypointCommand: "/slurm/script 2>$error_file",
+ wantEntrypointCommand: "/slurm/scripts/script 2>$error_file",
},
"should build entrypoint command with output and error": {
output: "/home/test/stdout.out",
error: "/home/test/stderr.out",
- wantEntrypointCommand: "/slurm/script 1>$output_file 2>$error_file",
+ wantEntrypointCommand: "/slurm/scripts/script 1>$output_file 2>$error_file",
},
"should build entrypoint command with input": {
input: "/home/test/script.sh",
- wantEntrypointCommand: "/slurm/script <$input_file",
+ wantEntrypointCommand: "/slurm/scripts/script <$input_file",
},
"should build entrypoint command with input and output": {
input: "/home/test/script.sh",
output: "/home/test/stdout.out",
- wantEntrypointCommand: "/slurm/script <$input_file 1>$output_file",
+ wantEntrypointCommand: "/slurm/scripts/script <$input_file 1>$output_file",
},
"should build entrypoint command with input and error": {
input: "/home/test/script.sh",
error: "/home/test/stderr.out",
- wantEntrypointCommand: "/slurm/script <$input_file 2>$error_file",
+ wantEntrypointCommand: "/slurm/scripts/script <$input_file 2>$error_file",
},
"should build entrypoint command with input, output and error": {
input: "/home/test/script.sh",
output: "/home/test/stdout.out",
error: "/home/test/stderr.out",
- wantEntrypointCommand: "/slurm/script <$input_file 1>$output_file 2>$error_file",
+ wantEntrypointCommand: "/slurm/scripts/script <$input_file 1>$output_file 2>$error_file",
},
}
for name, tc := range testCases {
diff --git a/cmd/experimental/kjobctl/pkg/builder/templates/slurm_entrypoint_script.sh.tmpl b/cmd/experimental/kjobctl/pkg/builder/templates/slurm_entrypoint_script.sh.tmpl
new file mode 100644
index 00000000000..7c2a3f2cfe6
--- /dev/null
+++ b/cmd/experimental/kjobctl/pkg/builder/templates/slurm_entrypoint_script.sh.tmpl
@@ -0,0 +1,26 @@
+#!/usr/local/bin/bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# External variables
+# JOB_CONTAINER_INDEX - container index in the container template.
+
+if [ ! -d "{{.EnvsPath}}/$JOB_CONTAINER_INDEX" ]; then
+ exit 0
+fi
+
+source {{.EnvsPath}}/$JOB_CONTAINER_INDEX/{{.SbatchEnvFilename}}
+
+export $(cat {{.EnvsPath}}/$JOB_CONTAINER_INDEX/{{.SlurmEnvFilename}} | xargs)
+
+{{.UnmaskFilenameFunction}}
+
+input_file=$(unmask_filename "$SBATCH_INPUT")
+output_file=$(unmask_filename "$SBATCH_OUTPUT")
+error_path=$(unmask_filename "$SBATCH_ERROR")
+{{if .ChangeDir }}
+cd {{.ChangeDir}}
+{{end}}
+{{.BuildEntrypointCommand}}
diff --git a/cmd/experimental/kjobctl/pkg/builder/templates/slurm_init_entrypoint_script.sh.tmpl b/cmd/experimental/kjobctl/pkg/builder/templates/slurm_init_entrypoint_script.sh.tmpl
new file mode 100644
index 00000000000..d5d747288ac
--- /dev/null
+++ b/cmd/experimental/kjobctl/pkg/builder/templates/slurm_init_entrypoint_script.sh.tmpl
@@ -0,0 +1,65 @@
+#!/usr/local/bin/bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+set -x
+
+# External variables
+# JOB_COMPLETION_INDEX - completion index of the job.
+
+for i in {0..{{.SlurmNTasksPerNode}}}
+do
+ # ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
+ declare -A array_indexes=({{.ArrayIndexes}}) # Requires bash v4+
+
+ container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
+ container_indexes=(${container_indexes//,/ })
+
+ if [[ ! -v container_indexes[$i] ]];
+ then
+ break
+ fi
+
+ mkdir -p {{.EnvsPath}}/$i
+
+ cat << EOF > {{.EnvsPath}}/$i/{{.SbatchEnvFilename}}
+SBATCH_ARRAY_INX={{.SbatchArrayIndex}}
+SBATCH_GPUS_PER_TASK={{.SbatchGPUsPerTask}}
+SBATCH_MEM_PER_CPU={{.SbatchMemPerCPU}}
+SBATCH_MEM_PER_GPU={{.SbatchMemPerGPU}}
+SBATCH_OUTPUT={{.SbatchOutput}}
+SBATCH_ERROR={{.SbatchError}}
+SBATCH_INPUT={{.SbatchInput}}
+SBATCH_JOB_NAME={{.SbatchJobName}}
+SBATCH_PARTITION={{.SbatchPartition}}
+EOF
+
+ cat << EOF > {{.EnvsPath}}/$i/{{.SlurmEnvFilename}}
+SLURM_ARRAY_JOB_ID={{.SlurmArrayJobID}}
+SLURM_ARRAY_TASK_COUNT={{.SlurmArrayTaskCount}}
+SLURM_ARRAY_TASK_MAX={{.SlurmArrayTaskMax}}
+SLURM_ARRAY_TASK_MIN={{.SlurmArrayTaskMin}}
+SLURM_TASKS_PER_NODE={{.SlurmTasksPerNode}}
+SLURM_CPUS_PER_TASK={{.SlurmCPUsPerTask}}
+SLURM_CPUS_ON_NODE={{.SlurmCPUsOnNode}}
+SLURM_JOB_CPUS_PER_NODE={{.SlurmJobCPUsPerNode}}
+SLURM_CPUS_PER_GPU={{.SlurmCPUsPerGPU}}
+SLURM_MEM_PER_CPU={{.SlurmMemPerCPU}}
+SLURM_MEM_PER_GPU={{.SlurmMemPerGPU}}
+SLURM_MEM_PER_NODE={{.SlurmMemPerNode}}
+SLURM_GPUS={{.SlurmGPUs}}
+SLURM_NTASKS={{.SlurmNTasks}}
+SLURM_NTASKS_PER_NODE={{.SlurmNTasksPerNode}}
+SLURM_NPROCS={{.SlurmNProcs}}
+SLURM_NNODES={{.SlurmNNodes}}
+SLURM_SUBMIT_DIR={{.SlurmSubmitDir}}
+SLURM_SUBMIT_HOST=$HOSTNAME
+SLURM_JOB_NODELIST={{.SlurmJobNodeList}}
+SLURM_JOB_FIRST_NODE={{.SlurmJobFirstNode}}
+SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * {{.SlurmNTasksPerNode}} + i + {{.SlurmArrayJobID}} ))
+SLURM_JOBID=$(( JOB_COMPLETION_INDEX * {{.SlurmNTasksPerNode}} + i + {{.SlurmArrayJobID}} ))
+SLURM_ARRAY_TASK_ID=${container_indexes[$i]}
+EOF
+
+done
diff --git a/cmd/experimental/kjobctl/pkg/cmd/completion/completion.go b/cmd/experimental/kjobctl/pkg/cmd/completion/completion.go
index 296d9d4624c..91feaa32df7 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/completion/completion.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/completion/completion.go
@@ -17,12 +17,14 @@ limitations under the License.
package completion
import (
+ "fmt"
"slices"
"strings"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
)
@@ -154,7 +156,7 @@ func LocalQueueNameFunc(clientGetter util.ClientGetter) func(*cobra.Command, []s
}
}
-func JobNameFunc(clientGetter util.ClientGetter) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
+func JobNameFunc(clientGetter util.ClientGetter, mode v1alpha1.ApplicationProfileMode) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
clientset, err := clientGetter.K8sClientset()
if err != nil {
@@ -166,7 +168,10 @@ func JobNameFunc(clientGetter util.ClientGetter) func(*cobra.Command, []string,
return []string{}, cobra.ShellCompDirectiveError
}
- opts := metav1.ListOptions{LabelSelector: constants.ProfileLabel, Limit: completionLimit}
+ opts := metav1.ListOptions{
+ LabelSelector: fmt.Sprintf("%s,%s=%s", constants.ProfileLabel, constants.ModeLabel, mode),
+ Limit: completionLimit,
+ }
list, err := clientset.BatchV1().Jobs(namespace).List(cmd.Context(), opts)
if err != nil {
return []string{}, cobra.ShellCompDirectiveError
diff --git a/cmd/experimental/kjobctl/pkg/cmd/completion/completion_test.go b/cmd/experimental/kjobctl/pkg/cmd/completion/completion_test.go
index 3bb84d0ec6c..5251923da7a 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/completion/completion_test.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/completion/completion_test.go
@@ -26,9 +26,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
k8sfake "k8s.io/client-go/kubernetes/fake"
-
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueuefake "sigs.k8s.io/kueue/client-go/clientset/versioned/fake"
+
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
@@ -110,11 +111,14 @@ func TestLocalQueueNameFunc(t *testing.T) {
func TestJobNameCompletionFunc(t *testing.T) {
args := []string{"job1"}
objs := []runtime.Object{
- wrappers.MakeJob("job1", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("job2", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("job3", "test").Profile("p1").Obj(),
- wrappers.MakeJob("job4", metav1.NamespaceDefault).Obj(),
+ wrappers.MakeJob("job1", metav1.NamespaceDefault).Profile("p1").Mode("jJb").Obj(),
+ wrappers.MakeJob("job2", metav1.NamespaceDefault).Profile("p1").Mode("Job").Obj(),
+ wrappers.MakeJob("job3", metav1.NamespaceDefault).Profile("p1").Mode("Slurm").Obj(),
+ wrappers.MakeJob("job4", "test").Profile("p1").Mode("Job").Obj(),
+ wrappers.MakeJob("job5", metav1.NamespaceDefault).Profile("p1").Obj(),
+ wrappers.MakeJob("job6", metav1.NamespaceDefault).Mode("Job").Obj(),
}
+ mode := v1alpha1.JobMode
wantNames := []string{"job2"}
wantDirective := cobra.ShellCompDirectiveNoFileComp
@@ -122,7 +126,7 @@ func TestJobNameCompletionFunc(t *testing.T) {
tcg := cmdtesting.NewTestClientGetter()
tcg.WithK8sClientset(k8sfake.NewSimpleClientset(objs...))
- complFn := JobNameFunc(tcg)
+ complFn := JobNameFunc(tcg, mode)
names, directive := complFn(&cobra.Command{}, args, "")
if diff := cmp.Diff(wantNames, names); diff != "" {
t.Errorf("Unexpected names (-want/+got)\n%s", diff)
diff --git a/cmd/experimental/kjobctl/pkg/cmd/create/create.go b/cmd/experimental/kjobctl/pkg/cmd/create/create.go
index a9565902d1c..ccec998d2f1 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/create/create.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/create/create.go
@@ -40,6 +40,7 @@ import (
"k8s.io/client-go/tools/remotecommand"
"k8s.io/kubectl/pkg/cmd/attach"
"k8s.io/kubectl/pkg/cmd/exec"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
"k8s.io/utils/ptr"
@@ -51,50 +52,14 @@ import (
)
const (
- createJobExample = ` # Create job
- kjobctl create job \
- --profile my-application-profile \
- --cmd "sleep 5" \
- --parallelism 4 \
- --completions 4 \
- --request cpu=500m,ram=4Gi \
- --localqueue my-local-queue-name`
- createInteractiveExample = ` # Create interactive
- kjobctl create interactive \
- --profile my-application-profile \
- --pod-running-timeout 30s \
- --rm`
- createRayJobLong = `Create a rayjob.
-
-KubeRay operator is required for RayJob.
-How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.`
- createRayJobExample = ` # Create rayjob
- kjobctl create rayjob \
- --profile my-application-profile \
- --cmd "python /home/ray/samples/sample_code.py" \
- --replicas small-group=1 \
- --min-replicas small-group=1 \
- --max-replicas small-group=5 \
- --localqueue my-local-queue-name`
- createRayClusterLong = `Create a raycluster.
-
-KubeRay operator is required for RayCluster.
-How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.`
- createRayClusterExample = ` # Create raycluster
- kjobctl create raycluster \
- --profile my-application-profile \
- --replicas small-group=1 \
- --min-replicas small-group=1 \
- --max-replicas small-group=5 \
- --localqueue my-local-queue-name`
- createSlurmExample = ` # Create slurm
- kjobctl create slurm --profile my-application-profile -- \
- --array 0-5 --nodes 3 --ntasks 1 ./script.sh`
-
- profileFlagName = "profile"
- podRunningTimeoutFlagName = "pod-running-timeout"
- removeFlagName = "rm"
- ignoreUnknownFlagName = "ignore-unknown-flags"
+ profileFlagName = "profile"
+ podRunningTimeoutFlagName = "pod-running-timeout"
+ removeFlagName = "rm"
+ ignoreUnknownFlagName = "ignore-unknown-flags"
+ initImageFlagName = "init-image"
+ skipLocalQueueValidationFlagName = "skip-localqueue-validation"
+ skipPriorityValidationFlagName = "skip-priority-validation"
+ changeDirFlagName = "chdir"
commandFlagName = string(v1alpha1.CmdFlag)
parallelismFlagName = string(v1alpha1.ParallelismFlag)
@@ -108,6 +73,7 @@ How to install KubeRay operator you can find here https://ray-project.github.io/
arrayFlagName = string(v1alpha1.ArrayFlag)
cpusPerTaskFlagName = string(v1alpha1.CpusPerTaskFlag)
gpusPerTaskFlagName = string(v1alpha1.GpusPerTaskFlag)
+ memPerNodeFlagName = string(v1alpha1.MemPerNodeFlag)
memPerTaskFlagName = string(v1alpha1.MemPerTaskFlag)
memPerCPUFlagName = string(v1alpha1.MemPerCPUFlag)
memPerGPUFlagName = string(v1alpha1.MemPerGPUFlag)
@@ -118,6 +84,63 @@ How to install KubeRay operator you can find here https://ray-project.github.io/
inputFlagName = string(v1alpha1.InputFlag)
jobNameFlagName = string(v1alpha1.JobNameFlag)
partitionFlagName = string(v1alpha1.PartitionFlag)
+ priorityFlagName = string(v1alpha1.PriorityFlag)
+)
+
+var (
+ createJobExample = templates.Examples(`
+ # Create job
+ kjobctl create job \
+ --profile my-application-profile \
+ --cmd "sleep 5" \
+ --parallelism 4 \
+ --completions 4 \
+ --request cpu=500m,memory=4Gi \
+ --localqueue my-local-queue-name
+ `)
+ createInteractiveExample = templates.Examples(`
+ # Create interactive
+ kjobctl create interactive \
+ --profile my-application-profile \
+ --pod-running-timeout 30s \
+ --rm
+ `)
+ createRayJobLong = templates.LongDesc(`
+ Create a rayjob.
+
+ KubeRay operator is required for RayJob.
+ How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.
+ `)
+ createRayJobExample = templates.Examples(`
+ # Create rayjob
+ kjobctl create rayjob \
+ --profile my-application-profile \
+ --cmd "python /home/ray/samples/sample_code.py" \
+ --replicas small-group=1 \
+ --min-replicas small-group=1 \
+ --max-replicas small-group=5 \
+ --localqueue my-local-queue-name
+ `)
+ createRayClusterLong = templates.LongDesc(`
+ Create a raycluster.
+
+ KubeRay operator is required for RayCluster.
+ How to install KubeRay operator you can find here https://ray-project.github.io/kuberay/deploy/installation/.
+ `)
+ createRayClusterExample = templates.Examples(`
+ # Create raycluster
+ kjobctl create raycluster \
+ --profile my-application-profile \
+ --replicas small-group=1 \
+ --min-replicas small-group=1 \
+ --max-replicas small-group=5 \
+ --localqueue my-local-queue-name
+ `)
+ createSlurmExample = templates.Examples(`
+ # Create slurm
+ kjobctl create slurm --profile my-application-profile -- \
+ --array 0-5 --nodes 3 --ntasks 1 ./script.sh
+ `)
)
var (
@@ -138,34 +161,40 @@ type CreateOptions struct {
ProfileName string
ModeName v1alpha1.ApplicationProfileMode
Script string
+ InitImage string
PodRunningTimeout time.Duration
RemoveInteractivePod bool
+ ChangeDir string
SlurmFlagSet *pflag.FlagSet
- Command []string
- Parallelism *int32
- Completions *int32
- Replicas map[string]int
- MinReplicas map[string]int
- MaxReplicas map[string]int
- Requests corev1.ResourceList
- LocalQueue string
- RayCluster string
- Array string
- CpusPerTask *apiresource.Quantity
- GpusPerTask map[string]*apiresource.Quantity
- MemPerTask *apiresource.Quantity
- MemPerCPU *apiresource.Quantity
- MemPerGPU *apiresource.Quantity
- Nodes *int32
- NTasks *int32
- Output string
- Error string
- Input string
- JobName string
- Partition string
- IgnoreUnknown bool
+ Command []string
+ Parallelism *int32
+ Completions *int32
+ Replicas map[string]int
+ MinReplicas map[string]int
+ MaxReplicas map[string]int
+ Requests corev1.ResourceList
+ LocalQueue string
+ RayCluster string
+ Array string
+ CpusPerTask *apiresource.Quantity
+ GpusPerTask map[string]*apiresource.Quantity
+ MemPerNode *apiresource.Quantity
+ MemPerTask *apiresource.Quantity
+ MemPerCPU *apiresource.Quantity
+ MemPerGPU *apiresource.Quantity
+ Nodes *int32
+ NTasks *int32
+ Output string
+ Error string
+ Input string
+ JobName string
+ Partition string
+ Priority string
+ IgnoreUnknown bool
+ SkipLocalQueueValidation bool
+ SkipPriorityValidation bool
UserSpecifiedCommand string
UserSpecifiedParallelism int32
@@ -173,6 +202,7 @@ type CreateOptions struct {
UserSpecifiedRequest map[string]string
UserSpecifiedCpusPerTask string
UserSpecifiedGpusPerTask string
+ UserSpecifiedMemPerNode string
UserSpecifiedMemPerTask string
UserSpecifiedMemPerCPU string
UserSpecifiedMemPerGPU string
@@ -296,10 +326,12 @@ var createModeSubcommands = map[string]modeSubcommand{
ModeName: v1alpha1.SlurmMode,
Setup: func(clientGetter util.ClientGetter, subcmd *cobra.Command, o *CreateOptions) {
subcmd.Use += " [--ignore-unknown-flags]" +
+ " [--skip-priority-validation]" +
" -- " +
" [--array ARRAY]" +
" [--cpus-per-task QUANTITY]" +
" [--gpus-per-task QUANTITY]" +
+ " [--mem QUANTITY]" +
" [--mem-per-task QUANTITY]" +
" [--mem-per-cpu QUANTITY]" +
" [--mem-per-gpu QUANTITY]" +
@@ -310,6 +342,7 @@ var createModeSubcommands = map[string]modeSubcommand{
" [--input FILENAME_PATTERN]" +
" [--job-name NAME]" +
" [--partition NAME]" +
+ " [--priority NAME]" +
" SCRIPT"
subcmd.Short = "Create a slurm job"
@@ -318,6 +351,10 @@ var createModeSubcommands = map[string]modeSubcommand{
subcmd.Flags().BoolVar(&o.IgnoreUnknown, ignoreUnknownFlagName, false,
"Ignore all the unsupported flags in the bash script.")
+ subcmd.Flags().StringVar(&o.InitImage, initImageFlagName, "bash:5-alpine3.20",
+ "The image used for the init container.")
+ subcmd.Flags().BoolVar(&o.SkipPriorityValidation, skipPriorityValidationFlagName, false,
+ "Skip workload priority class validation. Add priority class label even if the class does not exist.")
o.SlurmFlagSet = pflag.NewFlagSet("slurm", pflag.ExitOnError)
o.SlurmFlagSet.StringVarP(&o.Array, arrayFlagName, "a", "",
@@ -330,6 +367,8 @@ The minimum index value is 0. The maximum index value is 2147483647.`)
"How much cpus a container inside a pod requires.")
o.SlurmFlagSet.StringVar(&o.UserSpecifiedGpusPerTask, gpusPerTaskFlagName, "",
"How much gpus a container inside a pod requires.")
+ o.SlurmFlagSet.StringVar(&o.UserSpecifiedMemPerNode, memPerNodeFlagName, "",
+ "How much memory a pod requires.")
o.SlurmFlagSet.StringVar(&o.UserSpecifiedMemPerTask, memPerTaskFlagName, "",
"How much memory a container requires.")
o.SlurmFlagSet.StringVar(&o.UserSpecifiedMemPerCPU, memPerCPUFlagName, "",
@@ -350,6 +389,10 @@ The minimum index value is 0. The maximum index value is 2147483647.`)
"What is the job name.")
o.SlurmFlagSet.StringVar(&o.Partition, partitionFlagName, "",
"Local queue name.")
+ o.SlurmFlagSet.StringVar(&o.Priority, priorityFlagName, "",
+ "Apply priority for the entire workload.")
+ o.SlurmFlagSet.StringVarP(&o.ChangeDir, changeDirFlagName, "D", "",
+ "Change directory before executing the script.")
},
},
}
@@ -373,7 +416,8 @@ func NewCreateCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStr
subcmd := &cobra.Command{
Use: modeName +
" --profile APPLICATION_PROFILE_NAME" +
- " [--localqueue LOCAL_QUEUE_NAME]",
+ " [--localqueue LOCAL_QUEUE_NAME]" +
+ " [--skip-localqueue-validation]",
DisableFlagsInUseLine: true,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
@@ -394,6 +438,8 @@ func NewCreateCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStr
"Application profile contains a template (with defaults set) for running a specific type of application.")
subcmd.Flags().StringVar(&o.LocalQueue, localQueueFlagName, "",
"Kueue localqueue name which is associated with the resource.")
+ subcmd.Flags().BoolVar(&o.SkipLocalQueueValidation, skipLocalQueueValidationFlagName, false,
+ "Skip local queue validation. Add local queue even if the queue does not exist.")
modeSubcommand.Setup(clientGetter, subcmd, o)
@@ -481,13 +527,21 @@ func (o *CreateOptions) Complete(clientGetter util.ClientGetter, cmd *cobra.Comm
}
if o.SlurmFlagSet.Changed(gpusPerTaskFlagName) {
- gpusPerTask, err := parser.GpusFlag(gpusPerTaskFlagName)
+ gpusPerTask, err := parser.GpusFlag(o.UserSpecifiedGpusPerTask)
if err != nil {
- return fmt.Errorf("cannot parse '%s': %w", o.UserSpecifiedCpusPerTask, err)
+ return fmt.Errorf("cannot parse '%s': %w", o.UserSpecifiedGpusPerTask, err)
}
o.GpusPerTask = gpusPerTask
}
+ if o.SlurmFlagSet.Changed(memPerNodeFlagName) {
+ quantity, err := apiresource.ParseQuantity(o.UserSpecifiedMemPerNode)
+ if err != nil {
+ return fmt.Errorf("cannot parse '%s': %w", o.UserSpecifiedMemPerNode, err)
+ }
+ o.MemPerNode = &quantity
+ }
+
if o.SlurmFlagSet.Changed(memPerTaskFlagName) {
quantity, err := apiresource.ParseQuantity(o.UserSpecifiedMemPerTask)
if err != nil {
@@ -555,7 +609,7 @@ func (o *CreateOptions) Complete(clientGetter util.ClientGetter, cmd *cobra.Comm
}
func (o *CreateOptions) Run(ctx context.Context, clientGetter util.ClientGetter, runTime time.Time) error {
- objs, err := builder.NewBuilder(clientGetter, runTime).
+ rootObj, childObjs, err := builder.NewBuilder(clientGetter, runTime).
WithNamespace(o.Namespace).
WithProfileName(o.ProfileName).
WithModeName(o.ModeName).
@@ -572,6 +626,7 @@ func (o *CreateOptions) Run(ctx context.Context, clientGetter util.ClientGetter,
WithArray(o.Array).
WithCpusPerTask(o.CpusPerTask).
WithGpusPerTask(o.GpusPerTask).
+ WithMemPerNode(o.MemPerNode).
WithMemPerTask(o.MemPerTask).
WithMemPerCPU(o.MemPerCPU).
WithMemPerGPU(o.MemPerGPU).
@@ -582,35 +637,52 @@ func (o *CreateOptions) Run(ctx context.Context, clientGetter util.ClientGetter,
WithInput(o.Input).
WithJobName(o.JobName).
WithPartition(o.Partition).
+ WithPriority(o.Priority).
+ WithInitImage(o.InitImage).
WithIgnoreUnknown(o.IgnoreUnknown).
+ WithSkipLocalQueueValidation(o.SkipLocalQueueValidation).
+ WithSkipPriorityValidation(o.SkipPriorityValidation).
+ WithChangeDir(o.ChangeDir).
Do(ctx)
if err != nil {
return err
}
- for _, obj := range objs {
+ if o.DryRunStrategy != util.DryRunClient {
+ rootObj, err = o.createObject(ctx, clientGetter, rootObj, nil)
+ if err != nil {
+ return err
+ }
+ }
+
+ err = o.PrintObj(rootObj, o.Out)
+ if err != nil {
+ return err
+ }
+
+ for i := range childObjs {
if o.DryRunStrategy != util.DryRunClient {
- obj, err = o.createObject(ctx, clientGetter, obj)
+ childObjs[i], err = o.createObject(ctx, clientGetter, childObjs[i], rootObj)
if err != nil {
return err
}
}
- err = o.PrintObj(obj, o.Out)
+ err = o.PrintObj(childObjs[i], o.Out)
if err != nil {
return err
}
}
- if o.ModeName == v1alpha1.InteractiveMode {
- pod := objs[0].(*corev1.Pod)
+ if o.DryRunStrategy == util.DryRunNone && o.ModeName == v1alpha1.InteractiveMode {
+ pod := rootObj.(*corev1.Pod)
return o.RunInteractivePod(ctx, clientGetter, pod.Name)
}
return nil
}
-func (o *CreateOptions) createObject(ctx context.Context, clientGetter util.ClientGetter, obj runtime.Object) (runtime.Object, error) {
+func (o *CreateOptions) createObject(ctx context.Context, clientGetter util.ClientGetter, obj runtime.Object, owner runtime.Object) (runtime.Object, error) {
options := metav1.CreateOptions{}
if o.DryRunStrategy == util.DryRunServer {
options.DryRun = []string{metav1.DryRunAll}
@@ -633,20 +705,34 @@ func (o *CreateOptions) createObject(ctx context.Context, clientGetter util.Clie
}
gvr := mapping.Resource
- unstructured := &unstructured.Unstructured{}
- unstructured.Object, err = runtime.DefaultUnstructuredConverter.ToUnstructured(obj)
+ unstructuredObj := &unstructured.Unstructured{}
+ unstructuredObj.Object, err = runtime.DefaultUnstructuredConverter.ToUnstructured(obj)
if err != nil {
return nil, err
}
- unstructured, err = dynamicClient.Resource(gvr).Namespace(o.Namespace).Create(ctx, unstructured, options)
+ if owner != nil {
+ unstructuredOwner := &unstructured.Unstructured{}
+ unstructuredOwner.Object, err = runtime.DefaultUnstructuredConverter.ToUnstructured(owner)
+ if err != nil {
+ return nil, err
+ }
+ unstructuredObj.SetOwnerReferences(append(unstructuredOwner.GetOwnerReferences(), metav1.OwnerReference{
+ APIVersion: unstructuredOwner.GetAPIVersion(),
+ Kind: unstructuredOwner.GetKind(),
+ Name: unstructuredOwner.GetName(),
+ UID: unstructuredOwner.GetUID(),
+ }))
+ }
+
+ unstructuredObj, err = dynamicClient.Resource(gvr).Namespace(o.Namespace).Create(ctx, unstructuredObj, options)
if err != nil {
return nil, err
}
createdObj := obj.DeepCopyObject()
- err = runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured.UnstructuredContent(), createdObj)
+ err = runtime.DefaultUnstructuredConverter.FromUnstructured(unstructuredObj.UnstructuredContent(), createdObj)
if err != nil {
return nil, err
}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/create/create_test.go b/cmd/experimental/kjobctl/pkg/cmd/create/create_test.go
index 383bcf48a42..7aa1b47b76c 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/create/create_test.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/create/create_test.go
@@ -35,21 +35,28 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
+ utilrand "k8s.io/apimachinery/pkg/util/rand"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/client-go/dynamic/fake"
k8sfake "k8s.io/client-go/kubernetes/fake"
k8sscheme "k8s.io/client-go/kubernetes/scheme"
restclient "k8s.io/client-go/rest"
+ kubetesting "k8s.io/client-go/testing"
"k8s.io/client-go/tools/remotecommand"
clocktesting "k8s.io/utils/clock/testing"
"k8s.io/utils/ptr"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ kueuefake "sigs.k8s.io/kueue/client-go/clientset/versioned/fake"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
kjobctlfake "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
+ cmdutil "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
)
@@ -110,6 +117,7 @@ type createCmdTestCase struct {
ns string
args func(tc *createCmdTestCase) []string
kjobctlObjs []runtime.Object
+ kueueObjs []runtime.Object
gvks []schema.GroupVersionKind
wantLists []runtime.Object
cmpopts []cmp.Option
@@ -160,6 +168,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeJob("", metav1.NamespaceDefault).
GenerateName("profile-job-").
Profile("profile").
+ Mode(v1alpha1.JobMode).
Obj(),
},
},
@@ -183,6 +192,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayJob("", metav1.NamespaceDefault).
GenerateName("profile-rayjob-").
Profile("profile").
+ Mode(v1alpha1.RayJobMode).
Obj(),
},
},
@@ -206,6 +216,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayCluster("", metav1.NamespaceDefault).
GenerateName("profile-raycluster-").
Profile("profile").
+ Mode(v1alpha1.RayClusterMode).
Obj(),
},
},
@@ -229,6 +240,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeJob("", metav1.NamespaceDefault).
GenerateName("profile-job-").
Profile("profile").
+ Mode(v1alpha1.JobMode).
Obj(),
},
},
@@ -246,6 +258,41 @@ func TestCreateCmd(t *testing.T) {
WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.JobMode, "job-template").Obj()).
Obj(),
},
+ kueueObjs: []runtime.Object{
+ &kueue.LocalQueue{
+ ObjectMeta: metav1.ObjectMeta{
+ Namespace: metav1.NamespaceDefault,
+ Name: "lq1",
+ },
+ },
+ },
+ gvks: []schema.GroupVersionKind{{Group: "batch", Version: "v1", Kind: "Job"}},
+ wantLists: []runtime.Object{
+ &batchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []batchv1.Job{
+ *wrappers.MakeJob("", metav1.NamespaceDefault).
+ GenerateName("profile-job-").
+ Profile("profile").
+ Mode(v1alpha1.JobMode).
+ LocalQueue("lq1").
+ Obj(),
+ },
+ },
+ },
+ // Fake dynamic client not generating name. That's why we have .
+ wantOut: "job.batch/ created\n",
+ },
+ "should create job with localqueue and skip local queue validation": {
+ args: func(tc *createCmdTestCase) []string {
+ return []string{"job", "--profile", "profile", "--localqueue", "lq1", "--skip-localqueue-validation"}
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("job-template", metav1.NamespaceDefault).Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.JobMode, "job-template").Obj()).
+ Obj(),
+ },
gvks: []schema.GroupVersionKind{{Group: "batch", Version: "v1", Kind: "Job"}},
wantLists: []runtime.Object{
&batchv1.JobList{
@@ -254,6 +301,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeJob("", metav1.NamespaceDefault).
GenerateName("profile-job-").
Profile("profile").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Obj(),
},
@@ -283,6 +331,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeJob("", metav1.NamespaceDefault).
GenerateName("profile-job-").
Profile("profile").
+ Mode(v1alpha1.JobMode).
Parallelism(5).
Completions(1).
Obj(),
@@ -313,6 +362,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeJob("", metav1.NamespaceDefault).
GenerateName("profile-job-").
Profile("profile").
+ Mode(v1alpha1.JobMode).
Parallelism(1).
Completions(5).
Obj(),
@@ -345,6 +395,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeJob("", metav1.NamespaceDefault).
GenerateName("profile-job-").
Profile("profile").
+ Mode(v1alpha1.JobMode).
Parallelism(1).
Completions(1).
WithContainer(*wrappers.MakeContainer("c1", "sleep").Command("sleep", "15s").Obj()).
@@ -387,6 +438,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeJob("", metav1.NamespaceDefault).
GenerateName("profile-job-").
Profile("profile").
+ Mode(v1alpha1.JobMode).
Parallelism(1).
Completions(1).
WithContainer(
@@ -435,6 +487,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayJob("", metav1.NamespaceDefault).
GenerateName("profile-rayjob-").
Profile("profile").
+ Mode(v1alpha1.RayJobMode).
WithWorkerGroupSpec(*wrappers.MakeWorkerGroupSpec("g1").Replicas(5).Obj()).
Obj(),
},
@@ -462,6 +515,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayJob("", metav1.NamespaceDefault).
GenerateName("profile-rayjob-").
Profile("profile").
+ Mode(v1alpha1.RayJobMode).
Entrypoint("sleep 3s").
Obj(),
},
@@ -494,6 +548,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayJob("", metav1.NamespaceDefault).
GenerateName("profile-rayjob-").
Profile("profile").
+ Mode(v1alpha1.RayJobMode).
WithWorkerGroupSpec(*wrappers.MakeWorkerGroupSpec("g1").MinReplicas(5).Obj()).
Obj(),
},
@@ -526,6 +581,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayJob("", metav1.NamespaceDefault).
GenerateName("profile-rayjob-").
Profile("profile").
+ Mode(v1alpha1.RayJobMode).
WithWorkerGroupSpec(*wrappers.MakeWorkerGroupSpec("g1").MaxReplicas(5).Obj()).
Obj(),
},
@@ -558,6 +614,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayJob("", metav1.NamespaceDefault).
GenerateName("profile-rayjob-").
Profile("profile").
+ Mode(v1alpha1.RayJobMode).
WithRayClusterLabelSelector("rc1").
Obj(),
},
@@ -606,6 +663,7 @@ func TestCreateCmd(t *testing.T) {
*wrappers.MakeRayCluster("", metav1.NamespaceDefault).
GenerateName("profile-raycluster-").
Profile("profile").
+ Mode(v1alpha1.RayClusterMode).
Obj(),
},
},
@@ -654,29 +712,47 @@ func TestCreateCmd(t *testing.T) {
gvks: []schema.GroupVersionKind{
{Group: "batch", Version: "v1", Kind: "Job"},
{Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
},
wantLists: []runtime.Object{
&batchv1.JobList{
TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
Items: []batchv1.Job{
- *wrappers.MakeJob("", metav1.NamespaceDefault).
+ *wrappers.MakeJob("profile-slurm", metav1.NamespaceDefault).
Completions(1).
CompletionMode(batchv1.IndexedCompletion).
Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ Subdomain("profile-slurm").
+ WithInitContainer(*wrappers.MakeContainer("slurm-init-env", "bash:5-alpine3.20").
+ Command("bash", "/slurm/scripts/init-entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
+ Obj()).
WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
- Command("bash", "/slurm/entrypoint.sh").
- WithVolumeMount(corev1.VolumeMount{MountPath: "/slurm"}).
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
Obj()).
WithVolume(corev1.Volume{
+ Name: "slurm-scripts",
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
+ LocalObjectReference: corev1.LocalObjectReference{Name: "profile-slurm"},
Items: []corev1.KeyToPath{
+ {Key: "init-entrypoint.sh", Path: "init-entrypoint.sh"},
{Key: "entrypoint.sh", Path: "entrypoint.sh"},
{Key: "script", Path: "script", Mode: ptr.To[int32](0755)},
},
},
},
}).
+ WithVolume(corev1.Volume{
+ Name: "slurm-env",
+ VolumeSource: corev1.VolumeSource{
+ EmptyDir: &corev1.EmptyDirVolumeSource{},
+ },
+ }).
WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
WithEnvVar(corev1.EnvVar{
@@ -692,31 +768,42 @@ func TestCreateCmd(t *testing.T) {
&corev1.ConfigMapList{
TypeMeta: metav1.TypeMeta{Kind: "ConfigMapList", APIVersion: "v1"},
Items: []corev1.ConfigMap{
- *wrappers.MakeConfigMap("", metav1.NamespaceDefault).
+ *wrappers.MakeConfigMap("profile-slurm", metav1.NamespaceDefault).
+ WithOwnerReference(metav1.OwnerReference{
+ Name: "profile-slurm",
+ APIVersion: "batch/v1",
+ Kind: "Job",
+ }).
Profile("profile").
+ Mode(v1alpha1.SlurmMode).
Data(map[string]string{
"script": "#!/bin/bash\nsleep 300'",
- "entrypoint.sh": `#!/usr/bin/bash
+ "init-entrypoint.sh": `#!/usr/local/bin/bash
set -o errexit
set -o nounset
set -o pipefail
+set -x
# External variables
# JOB_COMPLETION_INDEX - completion index of the job.
-# JOB_CONTAINER_INDEX - container index in the container template.
-# ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
-declare -A array_indexes=(["0"]="0") # Requires bash v4+
+for i in {0..1}
+do
+ # ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
+ declare -A array_indexes=(["0"]="0") # Requires bash v4+
-container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
-container_indexes=(${container_indexes//,/ })
+ container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
+ container_indexes=(${container_indexes//,/ })
-if [[ ! -v container_indexes[${JOB_CONTAINER_INDEX}] ]];
-then
- exit 0
-fi
+ if [[ ! -v container_indexes[$i] ]];
+ then
+ break
+ fi
+
+ mkdir -p /slurm/env/$i
+ cat << EOF > /slurm/env/$i/sbatch.env
SBATCH_ARRAY_INX=
SBATCH_GPUS_PER_TASK=
SBATCH_MEM_PER_CPU=
@@ -726,30 +813,53 @@ SBATCH_ERROR=
SBATCH_INPUT=
SBATCH_JOB_NAME=
SBATCH_PARTITION=
+EOF
+
+ cat << EOF > /slurm/env/$i/slurm.env
+SLURM_ARRAY_JOB_ID=1
+SLURM_ARRAY_TASK_COUNT=1
+SLURM_ARRAY_TASK_MAX=0
+SLURM_ARRAY_TASK_MIN=0
+SLURM_TASKS_PER_NODE=1
+SLURM_CPUS_PER_TASK=
+SLURM_CPUS_ON_NODE=
+SLURM_JOB_CPUS_PER_NODE=
+SLURM_CPUS_PER_GPU=
+SLURM_MEM_PER_CPU=
+SLURM_MEM_PER_GPU=
+SLURM_MEM_PER_NODE=
+SLURM_GPUS=
+SLURM_NTASKS=1
+SLURM_NTASKS_PER_NODE=1
+SLURM_NPROCS=1
+SLURM_NNODES=1
+SLURM_SUBMIT_DIR=/slurm/scripts
+SLURM_SUBMIT_HOST=$HOSTNAME
+SLURM_JOB_NODELIST=profile-slurm-0.profile-slurm
+SLURM_JOB_FIRST_NODE=profile-slurm-0.profile-slurm
+SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * 1 + i + 1 ))
+SLURM_JOBID=$(( JOB_COMPLETION_INDEX * 1 + i + 1 ))
+SLURM_ARRAY_TASK_ID=${container_indexes[$i]}
+EOF
+
+done
+`,
+ "entrypoint.sh": `#!/usr/local/bin/bash
-export SLURM_ARRAY_JOB_ID=1 # Job array’s master job ID number.
-export SLURM_ARRAY_TASK_COUNT=1 # Total number of tasks in a job array.
-export SLURM_ARRAY_TASK_MAX=0 # Job array’s maximum ID (index) number.
-export SLURM_ARRAY_TASK_MIN=0 # Job array’s minimum ID (index) number.
-export SLURM_TASKS_PER_NODE=1 # Number of tasks to be initiated on each node.
-export SLURM_CPUS_PER_TASK= # Number of CPUs per task.
-export SLURM_CPUS_ON_NODE= # Number of CPUs on the allocated node (actually pod).
-export SLURM_JOB_CPUS_PER_NODE= # Count of processors available to the job on this node.
-export SLURM_CPUS_PER_GPU= # Number of CPUs requested per allocated GPU.
-export SLURM_MEM_PER_CPU= # Memory per CPU. Same as --mem-per-cpu .
-export SLURM_MEM_PER_GPU= # Memory per GPU.
-export SLURM_MEM_PER_NODE= # Memory per node. Same as --mem.
-export SLURM_GPUS=0 # Number of GPUs requested (in total).
-export SLURM_NTASKS=1 # Same as -n, –ntasks. The number of tasks.
-export SLURM_NTASKS_PER_NODE=1 # Number of tasks requested per node.
-export SLURM_NPROCS=$SLURM_NTASKS # Same as -n, --ntasks. See $SLURM_NTASKS.
-export SLURM_NNODES=1 # Total number of nodes (actually pods) in the job’s resource allocation.
-export SLURM_SUBMIT_DIR=/slurm # The path of the job submission directory.
-export SLURM_SUBMIT_HOST=$HOSTNAME # The hostname of the node used for job submission.
-
-export SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * SLURM_TASKS_PER_NODE + JOB_CONTAINER_INDEX + SLURM_ARRAY_JOB_ID )) # The Job ID.
-export SLURM_JOBID=$SLURM_JOB_ID # Deprecated. Same as $SLURM_JOB_ID
-export SLURM_ARRAY_TASK_ID=${container_indexes[${JOB_CONTAINER_INDEX}]} # Task ID.
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# External variables
+# JOB_CONTAINER_INDEX - container index in the container template.
+
+if [ ! -d "/slurm/env/$JOB_CONTAINER_INDEX" ]; then
+ exit 0
+fi
+
+source /slurm/env/$JOB_CONTAINER_INDEX/sbatch.env
+
+export $(cat /slurm/env/$JOB_CONTAINER_INDEX/slurm.env | xargs)
unmask_filename () {
replaced="$1"
@@ -778,17 +888,39 @@ input_file=$(unmask_filename "$SBATCH_INPUT")
output_file=$(unmask_filename "$SBATCH_OUTPUT")
error_path=$(unmask_filename "$SBATCH_ERROR")
-/slurm/script
+/slurm/scripts/script
`,
}).
Obj(),
},
},
+ &corev1.ServiceList{
+ TypeMeta: metav1.TypeMeta{Kind: "ServiceList", APIVersion: "v1"},
+ Items: []corev1.Service{
+ *wrappers.MakeService("profile-slurm", metav1.NamespaceDefault).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ ClusterIP("None").
+ Selector("job-name", "profile-slurm").
+ WithOwnerReference(metav1.OwnerReference{
+ Name: "profile-slurm",
+ APIVersion: "batch/v1",
+ Kind: "Job",
+ }).
+ Obj(),
+ },
+ },
},
cmpopts: []cmp.Option{
- cmpopts.IgnoreFields(corev1.Volume{}, "Name"),
- cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
- cmpopts.IgnoreFields(corev1.VolumeMount{}, "Name"),
+ cmpopts.AcyclicTransformer("RemoveGeneratedNameSuffixInString", func(val string) string {
+ return regexp.MustCompile("(profile-slurm)(-.{5})").ReplaceAllString(val, "$1")
+ }),
+ cmpopts.AcyclicTransformer("RemoveGeneratedNameSuffixInMap", func(m map[string]string) map[string]string {
+ for key, val := range m {
+ m[key] = regexp.MustCompile("(profile-slurm)(-.{5})").ReplaceAllString(val, "$1")
+ }
+ return m
+ }),
},
wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
},
@@ -800,6 +932,7 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
"slurm",
"--profile", "profile",
"--localqueue", "lq1",
+ "--init-image", "bash:latest",
"--",
"--array", "0-25",
"--nodes", "2",
@@ -809,53 +942,93 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
"--input", "/slurm/input.txt",
"--job-name", "job-name",
"--partition", "lq1",
+ "--chdir", "/mydir",
+ "--cpus-per-task", "2",
tc.tempFile,
}
},
kjobctlObjs: []runtime.Object{
wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").Obj()).
Obj(),
wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
Obj(),
},
+ kueueObjs: []runtime.Object{
+ &kueue.LocalQueue{
+ ObjectMeta: metav1.ObjectMeta{
+ Namespace: metav1.NamespaceDefault,
+ Name: "lq1",
+ },
+ },
+ },
gvks: []schema.GroupVersionKind{
{Group: "batch", Version: "v1", Kind: "Job"},
{Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
},
wantLists: []runtime.Object{
&batchv1.JobList{
TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
Items: []batchv1.Job{
- *wrappers.MakeJob("", metav1.NamespaceDefault).
+ *wrappers.MakeJob("profile-slurm", metav1.NamespaceDefault).
Parallelism(2).
Completions(9).
CompletionMode(batchv1.IndexedCompletion).
Profile("profile").
+ Mode(v1alpha1.SlurmMode).
LocalQueue("lq1").
+ Subdomain("profile-slurm").
+ WithInitContainer(*wrappers.MakeContainer("slurm-init-env", "bash:latest").
+ Command("bash", "/slurm/scripts/init-entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
+ Obj()).
WithContainer(*wrappers.MakeContainer("c1-0", "bash:4.4").
- Command("bash", "/slurm/entrypoint.sh").
- WithVolumeMount(corev1.VolumeMount{MountPath: "/slurm"}).
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
+ WithRequest(corev1.ResourceCPU, resource.MustParse("2")).
+ Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
+ WithRequest(corev1.ResourceCPU, resource.MustParse("2")).
Obj()).
WithContainer(*wrappers.MakeContainer("c1-1", "bash:4.4").
- Command("bash", "/slurm/entrypoint.sh").
- WithVolumeMount(corev1.VolumeMount{MountPath: "/slurm"}).
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
+ WithRequest(corev1.ResourceCPU, resource.MustParse("2")).
Obj()).
WithContainer(*wrappers.MakeContainer("c1-2", "bash:4.4").
- Command("bash", "/slurm/entrypoint.sh").
- WithVolumeMount(corev1.VolumeMount{MountPath: "/slurm"}).
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-scripts", MountPath: "/slurm/scripts"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "slurm-env", MountPath: "/slurm/env"}).
+ WithRequest(corev1.ResourceCPU, resource.MustParse("2")).
Obj()).
WithVolume(corev1.Volume{
+ Name: "slurm-scripts",
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
+ LocalObjectReference: corev1.LocalObjectReference{Name: "profile-slurm"},
Items: []corev1.KeyToPath{
+ {Key: "init-entrypoint.sh", Path: "init-entrypoint.sh"},
{Key: "entrypoint.sh", Path: "entrypoint.sh"},
{Key: "script", Path: "script", Mode: ptr.To[int32](0755)},
},
},
},
}).
+ WithVolume(corev1.Volume{
+ Name: "slurm-env",
+ VolumeSource: corev1.VolumeSource{
+ EmptyDir: &corev1.EmptyDirVolumeSource{},
+ },
+ }).
WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
WithEnvVar(corev1.EnvVar{
@@ -871,32 +1044,43 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
&corev1.ConfigMapList{
TypeMeta: metav1.TypeMeta{Kind: "ConfigMapList", APIVersion: "v1"},
Items: []corev1.ConfigMap{
- *wrappers.MakeConfigMap("", metav1.NamespaceDefault).
+ *wrappers.MakeConfigMap("profile-slurm", metav1.NamespaceDefault).
+ WithOwnerReference(metav1.OwnerReference{
+ Name: "profile-slurm",
+ APIVersion: "batch/v1",
+ Kind: "Job",
+ }).
Profile("profile").
+ Mode(v1alpha1.SlurmMode).
LocalQueue("lq1").
Data(map[string]string{
"script": "#!/bin/bash\nsleep 300'",
- "entrypoint.sh": `#!/usr/bin/bash
+ "init-entrypoint.sh": `#!/usr/local/bin/bash
set -o errexit
set -o nounset
set -o pipefail
+set -x
# External variables
# JOB_COMPLETION_INDEX - completion index of the job.
-# JOB_CONTAINER_INDEX - container index in the container template.
-# ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
-declare -A array_indexes=(["0"]="0,1,2" ["1"]="3,4,5" ["2"]="6,7,8" ["3"]="9,10,11" ["4"]="12,13,14" ["5"]="15,16,17" ["6"]="18,19,20" ["7"]="21,22,23" ["8"]="24,25") # Requires bash v4+
+for i in {0..3}
+do
+ # ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
+ declare -A array_indexes=(["0"]="0,1,2" ["1"]="3,4,5" ["2"]="6,7,8" ["3"]="9,10,11" ["4"]="12,13,14" ["5"]="15,16,17" ["6"]="18,19,20" ["7"]="21,22,23" ["8"]="24,25") # Requires bash v4+
-container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
-container_indexes=(${container_indexes//,/ })
+ container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
+ container_indexes=(${container_indexes//,/ })
-if [[ ! -v container_indexes[${JOB_CONTAINER_INDEX}] ]];
-then
- exit 0
-fi
+ if [[ ! -v container_indexes[$i] ]];
+ then
+ break
+ fi
+
+ mkdir -p /slurm/env/$i
+ cat << EOF > /slurm/env/$i/sbatch.env
SBATCH_ARRAY_INX=0-25
SBATCH_GPUS_PER_TASK=
SBATCH_MEM_PER_CPU=
@@ -906,30 +1090,53 @@ SBATCH_ERROR=/slurm/stderr.out
SBATCH_INPUT=/slurm/input.txt
SBATCH_JOB_NAME=job-name
SBATCH_PARTITION=lq1
+EOF
+
+ cat << EOF > /slurm/env/$i/slurm.env
+SLURM_ARRAY_JOB_ID=1
+SLURM_ARRAY_TASK_COUNT=26
+SLURM_ARRAY_TASK_MAX=25
+SLURM_ARRAY_TASK_MIN=0
+SLURM_TASKS_PER_NODE=3
+SLURM_CPUS_PER_TASK=2
+SLURM_CPUS_ON_NODE=8
+SLURM_JOB_CPUS_PER_NODE=8
+SLURM_CPUS_PER_GPU=
+SLURM_MEM_PER_CPU=
+SLURM_MEM_PER_GPU=
+SLURM_MEM_PER_NODE=
+SLURM_GPUS=
+SLURM_NTASKS=3
+SLURM_NTASKS_PER_NODE=3
+SLURM_NPROCS=3
+SLURM_NNODES=2
+SLURM_SUBMIT_DIR=/slurm/scripts
+SLURM_SUBMIT_HOST=$HOSTNAME
+SLURM_JOB_NODELIST=profile-slurm-fpxnj-0.profile-slurm-fpxnj,profile-slurm-fpxnj-1.profile-slurm-fpxnj
+SLURM_JOB_FIRST_NODE=profile-slurm-fpxnj-0.profile-slurm-fpxnj
+SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * 3 + i + 1 ))
+SLURM_JOBID=$(( JOB_COMPLETION_INDEX * 3 + i + 1 ))
+SLURM_ARRAY_TASK_ID=${container_indexes[$i]}
+EOF
+
+done
+`,
+ "entrypoint.sh": `#!/usr/local/bin/bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# External variables
+# JOB_CONTAINER_INDEX - container index in the container template.
+
+if [ ! -d "/slurm/env/$JOB_CONTAINER_INDEX" ]; then
+ exit 0
+fi
+
+source /slurm/env/$JOB_CONTAINER_INDEX/sbatch.env
-export SLURM_ARRAY_JOB_ID=1 # Job array’s master job ID number.
-export SLURM_ARRAY_TASK_COUNT=26 # Total number of tasks in a job array.
-export SLURM_ARRAY_TASK_MAX=25 # Job array’s maximum ID (index) number.
-export SLURM_ARRAY_TASK_MIN=0 # Job array’s minimum ID (index) number.
-export SLURM_TASKS_PER_NODE=3 # Number of tasks to be initiated on each node.
-export SLURM_CPUS_PER_TASK= # Number of CPUs per task.
-export SLURM_CPUS_ON_NODE= # Number of CPUs on the allocated node (actually pod).
-export SLURM_JOB_CPUS_PER_NODE= # Count of processors available to the job on this node.
-export SLURM_CPUS_PER_GPU= # Number of CPUs requested per allocated GPU.
-export SLURM_MEM_PER_CPU= # Memory per CPU. Same as --mem-per-cpu .
-export SLURM_MEM_PER_GPU= # Memory per GPU.
-export SLURM_MEM_PER_NODE= # Memory per node. Same as --mem.
-export SLURM_GPUS=0 # Number of GPUs requested (in total).
-export SLURM_NTASKS=3 # Same as -n, –ntasks. The number of tasks.
-export SLURM_NTASKS_PER_NODE=3 # Number of tasks requested per node.
-export SLURM_NPROCS=$SLURM_NTASKS # Same as -n, --ntasks. See $SLURM_NTASKS.
-export SLURM_NNODES=2 # Total number of nodes (actually pods) in the job’s resource allocation.
-export SLURM_SUBMIT_DIR=/slurm # The path of the job submission directory.
-export SLURM_SUBMIT_HOST=$HOSTNAME # The hostname of the node used for job submission.
-
-export SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * SLURM_TASKS_PER_NODE + JOB_CONTAINER_INDEX + SLURM_ARRAY_JOB_ID )) # The Job ID.
-export SLURM_JOBID=$SLURM_JOB_ID # Deprecated. Same as $SLURM_JOB_ID
-export SLURM_ARRAY_TASK_ID=${container_indexes[${JOB_CONTAINER_INDEX}]} # Task ID.
+export $(cat /slurm/env/$JOB_CONTAINER_INDEX/slurm.env | xargs)
unmask_filename () {
replaced="$1"
@@ -958,17 +1165,499 @@ input_file=$(unmask_filename "$SBATCH_INPUT")
output_file=$(unmask_filename "$SBATCH_OUTPUT")
error_path=$(unmask_filename "$SBATCH_ERROR")
-/slurm/script <$input_file 1>$output_file 2>$error_file
+cd /mydir
+
+/slurm/scripts/script <$input_file 1>$output_file 2>$error_file
`,
}).
Obj(),
},
},
+ &corev1.ServiceList{
+ TypeMeta: metav1.TypeMeta{Kind: "ServiceList", APIVersion: "v1"},
+ Items: []corev1.Service{
+ *wrappers.MakeService("profile-slurm", metav1.NamespaceDefault).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ ClusterIP("None").
+ Selector("job-name", "profile-slurm").
+ WithOwnerReference(metav1.OwnerReference{
+ Name: "profile-slurm",
+ APIVersion: "batch/v1",
+ Kind: "Job",
+ }).
+ Obj(),
+ },
+ },
+ },
+ cmpopts: []cmp.Option{
+ cmpopts.AcyclicTransformer("RemoveGeneratedNameSuffixInString", func(val string) string {
+ return regexp.MustCompile("(profile-slurm)(-.{5})").ReplaceAllString(val, "$1")
+ }),
+ cmpopts.AcyclicTransformer("RemoveGeneratedNameSuffixInMap", func(m map[string]string) map[string]string {
+ for key, val := range m {
+ m[key] = regexp.MustCompile("(profile-slurm)(-.{5})").ReplaceAllString(val, "$1")
+ }
+ return m
+ }),
+ },
+ wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
+ },
+ "should divide --mem exactly across containers": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--",
+ "--mem", "2G",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ gvks: []schema.GroupVersionKind{
+ {Group: "batch", Version: "v1", Kind: "Job"},
+ {Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
+ },
+ wantLists: []runtime.Object{
+ &batchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []batchv1.Job{
+ *wrappers.MakeJob("", metav1.NamespaceDefault).
+ Completions(1).
+ CompletionMode(batchv1.IndexedCompletion).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Limits: corev1.ResourceList{
+ corev1.ResourceMemory: resource.MustParse("1G"),
+ },
+ }).
+ Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Limits: corev1.ResourceList{
+ corev1.ResourceMemory: resource.MustParse("1G"),
+ },
+ }).
+ Obj()).
+ Obj(),
+ },
+ },
+ &corev1.ConfigMapList{},
+ &corev1.ServiceList{},
+ },
+ cmpopts: []cmp.Option{
+ cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
+ cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name"),
+ cmpopts.IgnoreFields(metav1.OwnerReference{}, "Name"),
+ cmpopts.IgnoreFields(corev1.PodSpec{}, "InitContainers", "Subdomain"),
+ cmpopts.IgnoreTypes([]corev1.EnvVar{}),
+ cmpopts.IgnoreTypes([]corev1.Volume{}),
+ cmpopts.IgnoreTypes([]corev1.VolumeMount{}),
+ cmpopts.IgnoreTypes(corev1.ConfigMapList{}),
+ cmpopts.IgnoreTypes(corev1.ServiceList{}),
+ },
+ wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
+ },
+ "should handle non-exact --mem division across containers": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--",
+ "--mem", "1G",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ gvks: []schema.GroupVersionKind{
+ {Group: "batch", Version: "v1", Kind: "Job"},
+ {Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
+ },
+ wantLists: []runtime.Object{
+ &batchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []batchv1.Job{
+ *wrappers.MakeJob("", metav1.NamespaceDefault).
+ Completions(1).
+ CompletionMode(batchv1.IndexedCompletion).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Limits: corev1.ResourceList{
+ corev1.ResourceMemory: resource.MustParse("500M"),
+ },
+ }).
+ Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Limits: corev1.ResourceList{
+ corev1.ResourceMemory: resource.MustParse("500M"),
+ },
+ }).
+ Obj()).
+ Obj(),
+ },
+ },
+ &corev1.ConfigMapList{},
+ &corev1.ServiceList{},
},
cmpopts: []cmp.Option{
- cmpopts.IgnoreFields(corev1.Volume{}, "Name"),
cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
- cmpopts.IgnoreFields(corev1.VolumeMount{}, "Name"),
+ cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name"),
+ cmpopts.IgnoreFields(metav1.OwnerReference{}, "Name"),
+ cmpopts.IgnoreFields(corev1.PodSpec{}, "InitContainers", "Subdomain"),
+ cmpopts.IgnoreTypes([]corev1.EnvVar{}),
+ cmpopts.IgnoreTypes([]corev1.Volume{}),
+ cmpopts.IgnoreTypes([]corev1.VolumeMount{}),
+ cmpopts.IgnoreTypes(corev1.ConfigMapList{}),
+ cmpopts.IgnoreTypes(corev1.ServiceList{}),
+ },
+ wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
+ },
+ "should create slurm with --mem-per-cpu flag": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--",
+ "--cpus-per-task", "2",
+ "--mem-per-cpu", "500M",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ gvks: []schema.GroupVersionKind{
+ {Group: "batch", Version: "v1", Kind: "Job"},
+ {Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
+ },
+ wantLists: []runtime.Object{
+ &batchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []batchv1.Job{
+ *wrappers.MakeJob("", metav1.NamespaceDefault).
+ Completions(1).
+ CompletionMode(batchv1.IndexedCompletion).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{
+ corev1.ResourceCPU: resource.MustParse("2"),
+ corev1.ResourceMemory: resource.MustParse("1G"),
+ },
+ }).
+ Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{
+ corev1.ResourceCPU: resource.MustParse("2"),
+ corev1.ResourceMemory: resource.MustParse("1G"),
+ },
+ }).
+ Obj()).
+ Obj(),
+ },
+ },
+ &corev1.ConfigMapList{},
+ &corev1.ServiceList{},
+ },
+ cmpopts: []cmp.Option{
+ cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
+ cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name"),
+ cmpopts.IgnoreFields(metav1.OwnerReference{}, "Name"),
+ cmpopts.IgnoreFields(corev1.PodSpec{}, "InitContainers", "Subdomain"),
+ cmpopts.IgnoreTypes([]corev1.EnvVar{}),
+ cmpopts.IgnoreTypes([]corev1.Volume{}),
+ cmpopts.IgnoreTypes([]corev1.VolumeMount{}),
+ cmpopts.IgnoreTypes(corev1.ConfigMapList{}),
+ cmpopts.IgnoreTypes(corev1.ServiceList{}),
+ },
+ wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
+ },
+ "shouldn't create slurm with --mem-per-cpu flag because --cpus-per-task flag not specified": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--",
+ "--mem-per-cpu", "500M",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ wantErr: "no cpus-per-task specified",
+ },
+ "should create slurm with --priority flag": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--",
+ "--priority", "sample-priority",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ kueueObjs: []runtime.Object{
+ &kueue.WorkloadPriorityClass{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "sample-priority",
+ },
+ },
+ },
+ gvks: []schema.GroupVersionKind{
+ {Group: "batch", Version: "v1", Kind: "Job"},
+ {Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
+ },
+ wantLists: []runtime.Object{
+ &batchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []batchv1.Job{
+ *wrappers.MakeJob("", metav1.NamespaceDefault).
+ Priority("sample-priority").
+ Completions(1).
+ CompletionMode(batchv1.IndexedCompletion).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ Obj()).
+ Obj(),
+ },
+ },
+ &corev1.ConfigMapList{},
+ &corev1.ServiceList{},
+ },
+ cmpopts: []cmp.Option{
+ cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
+ cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name"),
+ cmpopts.IgnoreFields(metav1.OwnerReference{}, "Name"),
+ cmpopts.IgnoreFields(corev1.PodSpec{}, "InitContainers", "Subdomain"),
+ cmpopts.IgnoreTypes([]corev1.EnvVar{}),
+ cmpopts.IgnoreTypes([]corev1.Volume{}),
+ cmpopts.IgnoreTypes([]corev1.VolumeMount{}),
+ cmpopts.IgnoreTypes(corev1.ConfigMapList{}),
+ cmpopts.IgnoreTypes(corev1.ServiceList{}),
+ },
+ wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
+ },
+ "should create slurm with --mem-per-gpu flag": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--",
+ "--gpus-per-task", "volta:3,kepler:1",
+ "--mem-per-gpu", "500M",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ gvks: []schema.GroupVersionKind{
+ {Group: "batch", Version: "v1", Kind: "Job"},
+ {Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
+ },
+ wantLists: []runtime.Object{
+ &batchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []batchv1.Job{
+ *wrappers.MakeJob("", metav1.NamespaceDefault).
+ Completions(1).
+ CompletionMode(batchv1.IndexedCompletion).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{
+ corev1.ResourceMemory: resource.MustParse("2G"),
+ "volta": resource.MustParse("3"),
+ "kepler": resource.MustParse("1"),
+ },
+ }).
+ Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ WithResources(corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{
+ corev1.ResourceMemory: resource.MustParse("2G"),
+ "volta": resource.MustParse("3"),
+ "kepler": resource.MustParse("1"),
+ },
+ }).
+ Obj()).
+ Obj(),
+ },
+ },
+ &corev1.ConfigMapList{},
+ &corev1.ServiceList{},
+ },
+ cmpopts: []cmp.Option{
+ cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
+ cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name"),
+ cmpopts.IgnoreFields(metav1.OwnerReference{}, "Name"),
+ cmpopts.IgnoreFields(corev1.PodSpec{}, "InitContainers", "Subdomain"),
+ cmpopts.IgnoreTypes([]corev1.EnvVar{}),
+ cmpopts.IgnoreTypes([]corev1.Volume{}),
+ cmpopts.IgnoreTypes([]corev1.VolumeMount{}),
+ cmpopts.IgnoreTypes(corev1.ConfigMapList{}),
+ cmpopts.IgnoreTypes(corev1.ServiceList{}),
+ },
+ wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
+ },
+ "shouldn't create slurm with --mem-per-gpu flag because --gpus-per-task flag not specified": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--",
+ "--mem-per-gpu", "500M",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ WithContainer(*wrappers.MakeContainer("c2", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ wantErr: "no gpus-per-task specified",
+ },
+ "should create slurm with --priority flag and skip workload priority class validation": {
+ beforeTest: beforeSlurmTest,
+ afterTest: afterSlurmTest,
+ args: func(tc *createCmdTestCase) []string {
+ return []string{
+ "slurm",
+ "--profile", "profile",
+ "--skip-priority-validation",
+ "--",
+ "--priority", "sample-priority",
+ tc.tempFile,
+ }
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeJobTemplate("slurm-job-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").Obj()).
+ Obj(),
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.SlurmMode, "slurm-job-template").Obj()).
+ Obj(),
+ },
+ gvks: []schema.GroupVersionKind{
+ {Group: "batch", Version: "v1", Kind: "Job"},
+ {Group: "", Version: "v1", Kind: "ConfigMap"},
+ {Group: "", Version: "v1", Kind: "Service"},
+ },
+ wantLists: []runtime.Object{
+ &batchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []batchv1.Job{
+ *wrappers.MakeJob("", metav1.NamespaceDefault).
+ Priority("sample-priority").
+ Completions(1).
+ CompletionMode(batchv1.IndexedCompletion).
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ Subdomain("profile-slurm").
+ WithContainer(*wrappers.MakeContainer("c1", "bash:4.4").
+ Command("bash", "/slurm/scripts/entrypoint.sh").
+ Obj()).
+ Obj(),
+ },
+ },
+ &corev1.ConfigMapList{},
+ &corev1.ServiceList{},
+ },
+ cmpopts: []cmp.Option{
+ cmpopts.IgnoreFields(corev1.LocalObjectReference{}, "Name"),
+ cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name"),
+ cmpopts.IgnoreFields(metav1.OwnerReference{}, "Name"),
+ cmpopts.IgnoreFields(corev1.PodSpec{}, "InitContainers", "Subdomain"),
+ cmpopts.IgnoreTypes([]corev1.EnvVar{}),
+ cmpopts.IgnoreTypes([]corev1.Volume{}),
+ cmpopts.IgnoreTypes([]corev1.VolumeMount{}),
+ cmpopts.IgnoreTypes(corev1.ConfigMapList{}),
+ cmpopts.IgnoreTypes(corev1.ServiceList{}),
},
wantOutPattern: `job\.batch\/.+ created\\nconfigmap\/.+ created`,
},
@@ -1018,6 +1707,7 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
clientset := kjobctlfake.NewSimpleClientset(tc.kjobctlObjs...)
dynamicClient := fake.NewSimpleDynamicClient(scheme)
+ kueueClientset := kueuefake.NewSimpleClientset(tc.kueueObjs...)
restMapper := meta.NewDefaultRESTMapper([]schema.GroupVersion{})
for _, gvk := range tc.gvks {
@@ -1027,6 +1717,7 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
tcg := cmdtesting.NewTestClientGetter().
WithKjobctlClientset(clientset).
WithDynamicClient(dynamicClient).
+ WithKueueClientset(kueueClientset).
WithRESTMapper(restMapper)
if tc.ns != "" {
tcg.WithNamespace(tc.ns)
@@ -1094,9 +1785,7 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
return
}
- defaultCmpOpts := []cmp.Option{cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name")}
- opts := append(defaultCmpOpts, tc.cmpopts...)
- if diff := cmp.Diff(tc.wantLists[index], gotList, opts...); diff != "" {
+ if diff := cmp.Diff(tc.wantLists[index], gotList, tc.cmpopts...); diff != "" {
t.Errorf("Unexpected list for %s (-want/+got)\n%s", gvk.String(), diff)
}
}
@@ -1104,94 +1793,144 @@ error_path=$(unmask_filename "$SBATCH_ERROR")
}
}
-func TestInteractivePod(t *testing.T) {
+func TestCreateOptionsRunInteractive(t *testing.T) {
+ testStartTime := time.Now()
+ userID := os.Getenv(constants.SystemEnvVarNameUser)
+
testCases := map[string]struct {
- podName string
- options *CreateOptions
- pods []runtime.Object
- wantErr string
+ options *CreateOptions
+ k8sObjs []runtime.Object
+ kjobctlObjs []runtime.Object
+ createMutation func(pod *corev1.Pod)
+ wantPodList *corev1.PodList
+ wantErr string
}{
"success": {
- podName: "foo",
options: &CreateOptions{
- Namespace: "test",
- Attach: &fakeRemoteAttach{},
- AttachFunc: testAttachFunc,
+ Namespace: metav1.NamespaceDefault,
+ ProfileName: "profile",
+ ModeName: v1alpha1.InteractiveMode,
+ Attach: &fakeRemoteAttach{},
+ AttachFunc: testAttachFunc,
+ },
+ k8sObjs: []runtime.Object{
+ wrappers.MakePodTemplate("pod-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
+ Obj(),
},
- pods: []runtime.Object{
- &corev1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "foo",
- Namespace: "test",
- },
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "bar",
- Stdin: true,
- TTY: true,
- },
- },
- },
- Status: corev1.PodStatus{
- Phase: corev1.PodRunning,
- },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.InteractiveMode, "pod-template").Obj()).
+ Obj(),
+ },
+ createMutation: func(pod *corev1.Pod) {
+ pod.Status.Phase = corev1.PodRunning
+ },
+ wantPodList: &corev1.PodList{
+ Items: []corev1.Pod{
+ *wrappers.MakePod("", metav1.NamespaceDefault).
+ GenerateName("profile-interactive-").
+ Profile("profile").
+ Mode(v1alpha1.InteractiveMode).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").
+ TTY().
+ Stdin().
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj()).
+ Phase(corev1.PodRunning).
+ Obj(),
},
},
},
- "tty not allocated": {
- podName: "foo",
+ "success with remove interactive pod": {
options: &CreateOptions{
- Namespace: "test",
- Attach: &fakeRemoteAttach{},
- AttachFunc: testAttachFunc,
+ Namespace: metav1.NamespaceDefault,
+ ProfileName: "profile",
+ ModeName: v1alpha1.InteractiveMode,
+ RemoveInteractivePod: true,
+ Attach: &fakeRemoteAttach{},
+ AttachFunc: testAttachFunc,
+ },
+ k8sObjs: []runtime.Object{
+ wrappers.MakePodTemplate("pod-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
+ Obj(),
},
- pods: []runtime.Object{
- &corev1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "foo",
- Namespace: "test",
- },
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "bar",
- },
- },
- },
- Status: corev1.PodStatus{
- Phase: corev1.PodRunning,
- },
- },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.InteractiveMode, "pod-template").Obj()).
+ Obj(),
},
- wantErr: "error: Unable to use a TTY - container bar did not allocate one",
+ createMutation: func(pod *corev1.Pod) {
+ pod.Status.Phase = corev1.PodRunning
+ },
+ wantPodList: &corev1.PodList{},
+ },
+ "success with dry-run client": {
+ options: &CreateOptions{
+ Namespace: metav1.NamespaceDefault,
+ ProfileName: "profile",
+ ModeName: v1alpha1.InteractiveMode,
+ DryRunStrategy: cmdutil.DryRunClient,
+ Attach: &fakeRemoteAttach{},
+ AttachFunc: testAttachFunc,
+ },
+ k8sObjs: []runtime.Object{
+ wrappers.MakePodTemplate("pod-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
+ Obj(),
+ },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.InteractiveMode, "pod-template").Obj()).
+ Obj(),
+ },
+ wantPodList: &corev1.PodList{},
},
"timeout waiting for pod": {
- podName: "foo",
options: &CreateOptions{
- Namespace: "test",
- Attach: &fakeRemoteAttach{},
- AttachFunc: testAttachFunc,
- PodRunningTimeout: 1 * time.Second,
+ Namespace: metav1.NamespaceDefault,
+ ProfileName: "profile",
+ ModeName: v1alpha1.InteractiveMode,
+ Attach: &fakeRemoteAttach{},
+ AttachFunc: testAttachFunc,
+ },
+ k8sObjs: []runtime.Object{
+ wrappers.MakePodTemplate("pod-template", metav1.NamespaceDefault).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
+ Obj(),
},
- pods: []runtime.Object{
- &corev1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "foo",
- Namespace: "test",
- },
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "bar",
- Stdin: true,
- TTY: true,
- },
- },
- },
- Status: corev1.PodStatus{
- Phase: corev1.PodPending,
- },
+ kjobctlObjs: []runtime.Object{
+ wrappers.MakeApplicationProfile("profile", metav1.NamespaceDefault).
+ WithSupportedMode(*wrappers.MakeSupportedMode(v1alpha1.InteractiveMode, "pod-template").Obj()).
+ Obj(),
+ },
+ wantPodList: &corev1.PodList{
+ Items: []corev1.Pod{
+ *wrappers.MakePod("", metav1.NamespaceDefault).
+ GenerateName("profile-interactive-").
+ Profile("profile").
+ Mode(v1alpha1.InteractiveMode).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").
+ TTY().
+ Stdin().
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarNameUserID, Value: userID}).
+ WithEnvVar(corev1.EnvVar{Name: constants.EnvVarTaskName, Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{
+ Name: constants.EnvVarTaskID,
+ Value: fmt.Sprintf("%s_%s_default_profile", userID, testStartTime.Format(time.RFC3339)),
+ }).
+ WithEnvVar(corev1.EnvVar{Name: "PROFILE", Value: "default_profile"}).
+ WithEnvVar(corev1.EnvVar{Name: "TIMESTAMP", Value: testStartTime.Format(time.RFC3339)}).
+ Obj()).
+ Obj(),
},
},
wantErr: "context deadline exceeded",
@@ -1203,11 +1942,50 @@ func TestInteractivePod(t *testing.T) {
tc.options.IOStreams = streams
tc.options.Out = out
tc.options.ErrOut = outErr
+ tc.options.PrintFlags = genericclioptions.NewPrintFlags("created").WithTypeSetter(k8sscheme.Scheme)
+ printer, err := tc.options.PrintFlags.ToPrinter()
+ if err != nil {
+ t.Fatal(err)
+ }
+ tc.options.PrintObj = printer.PrintObj
- clientset := k8sfake.NewSimpleClientset(tc.pods...)
- tcg := cmdtesting.NewTestClientGetter().WithK8sClientset(clientset)
+ k8sClientset := k8sfake.NewSimpleClientset(tc.k8sObjs...)
+ kjobctlClientset := kjobctlfake.NewSimpleClientset(tc.kjobctlObjs...)
+ dynamicClient := fake.NewSimpleDynamicClient(k8sscheme.Scheme)
+ restMapper := meta.NewDefaultRESTMapper([]schema.GroupVersion{})
+ restMapper.Add(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"}, meta.RESTScopeNamespace)
+
+ dynamicClient.PrependReactor("create", "pods", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
+ createAction := action.(kubetesting.CreateAction)
+
+ unstructuredObj := createAction.GetObject().(*unstructured.Unstructured)
+ unstructuredObj.SetName(unstructuredObj.GetGenerateName() + utilrand.String(5))
+
+ pod := &corev1.Pod{}
- gotErr := tc.options.RunInteractivePod(context.TODO(), tcg, tc.podName)
+ if err = runtime.DefaultUnstructuredConverter.FromUnstructured(unstructuredObj.UnstructuredContent(), pod); err != nil {
+ return true, nil, err
+ }
+
+ if tc.createMutation != nil {
+ tc.createMutation(pod)
+ }
+
+ _, err = k8sClientset.CoreV1().Pods(pod.GetNamespace()).Create(context.Background(), pod, metav1.CreateOptions{})
+ if err != nil {
+ return true, nil, err
+ }
+
+ return true, unstructuredObj, err
+ })
+
+ tcg := cmdtesting.NewTestClientGetter().
+ WithK8sClientset(k8sClientset).
+ WithKjobctlClientset(kjobctlClientset).
+ WithDynamicClient(dynamicClient).
+ WithRESTMapper(restMapper)
+
+ gotErr := tc.options.Run(context.Background(), tcg, testStartTime)
var gotErrStr string
if gotErr != nil {
@@ -1217,6 +1995,16 @@ func TestInteractivePod(t *testing.T) {
if diff := cmp.Diff(tc.wantErr, gotErrStr); diff != "" {
t.Errorf("Unexpected error (-want/+got)\n%s", diff)
}
+
+ gotPodList, err := k8sClientset.CoreV1().Pods(metav1.NamespaceDefault).List(context.Background(), metav1.ListOptions{})
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ defaultCmpOpts := []cmp.Option{cmpopts.IgnoreFields(metav1.ObjectMeta{}, "Name")}
+ if diff := cmp.Diff(tc.wantPodList, gotPodList, defaultCmpOpts...); diff != "" {
+ t.Errorf("Unexpected error (-want/+got)\n%s", diff)
+ }
})
}
}
@@ -1226,12 +2014,12 @@ type fakeRemoteAttach struct {
err error
}
-func (f *fakeRemoteAttach) Attach(url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue remotecommand.TerminalSizeQueue) error {
+func (f *fakeRemoteAttach) Attach(url *url.URL, _ *restclient.Config, _ io.Reader, _, _ io.Writer, _ bool, _ remotecommand.TerminalSizeQueue) error {
f.url = url
return f.err
}
-func testAttachFunc(o *CreateOptions, containerToAttach *corev1.Container, sizeQueue remotecommand.TerminalSizeQueue, pod *corev1.Pod) func() error {
+func testAttachFunc(o *CreateOptions, _ *corev1.Container, sizeQueue remotecommand.TerminalSizeQueue, _ *corev1.Pod) func() error {
return func() error {
u, err := url.Parse("http://kjobctl.test")
if err != nil {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete.go
index 3dd4b36b8e9..d6aba48e727 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/delete/delete.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete.go
@@ -21,22 +21,29 @@ import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
)
+var (
+ deleteExample = templates.Examples(
+ fmt.Sprintf("%s\n\n%s\n\n%s\n\n%s", interactiveExample, jobExample, rayJobExample, rayClusterExample),
+ )
+)
+
func NewDeleteCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
cmd := &cobra.Command{
- Use: "delete",
- Short: "Delete resources",
- Example: fmt.Sprintf("%s\n\n%s\n\n%s\n\n%s",
- interactiveExample, jobExample, rayJobExample, rayClusterExample),
+ Use: "delete",
+ Short: "Delete resources",
+ Example: deleteExample,
}
cmd.AddCommand(NewInteractiveCmd(clientGetter, streams))
cmd.AddCommand(NewJobCmd(clientGetter, streams))
cmd.AddCommand(NewRayJobCmd(clientGetter, streams))
cmd.AddCommand(NewRayClusterCmd(clientGetter, streams))
+ cmd.AddCommand(NewSlurmCmd(clientGetter, streams))
return cmd
}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_interactive.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_interactive.go
index 71b7c50938f..83704d4eddc 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_interactive.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_interactive.go
@@ -27,6 +27,7 @@ import (
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/client-go/kubernetes/scheme"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -35,9 +36,11 @@ import (
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
)
-const (
- interactiveExample = ` # Delete interactive shell
- kjobctl delete interactive my-application-profile-interactive-k2wzd`
+var (
+ interactiveExample = templates.Examples(`
+ # Delete interactive shell
+ kjobctl delete interactive my-application-profile-interactive-k2wzd
+ `)
)
type InteractiveOptions struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job.go
index e276ef92716..5f0ca0981ae 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job.go
@@ -27,17 +27,21 @@ import (
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/client-go/kubernetes/scheme"
batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/completion"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
)
-const (
- jobExample = ` # Delete Job
- kjobctl delete job my-application-profile-job-k2wzd`
+var (
+ jobExample = templates.Examples(`
+ # Delete Job
+ kjobctl delete job my-application-profile-job-k2wzd
+ `)
)
type JobOptions struct {
@@ -72,7 +76,7 @@ func NewJobCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStream
Short: "Delete Job",
Example: jobExample,
Args: cobra.MinimumNArgs(1),
- ValidArgsFunction: completion.JobNameFunc(clientGetter),
+ ValidArgsFunction: completion.JobNameFunc(clientGetter, v1alpha1.JobMode),
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
@@ -149,6 +153,11 @@ func (o *JobOptions) Run(ctx context.Context) error {
fmt.Fprintf(o.ErrOut, "jobs.batch \"%s\" not created via kjob\n", job.Name)
continue
}
+ if job.Labels[constants.ModeLabel] != string(v1alpha1.JobMode) {
+ fmt.Fprintf(o.ErrOut, "jobs.batch \"%s\" created in \"%s\" mode. Switch to the correct mode to delete it\n",
+ job.Name, job.Labels[constants.ModeLabel])
+ continue
+ }
if o.DryRunStrategy != util.DryRunClient {
deleteOptions := metav1.DeleteOptions{
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job_test.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job_test.go
index cc65ab5dc0b..531dabb0f24 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job_test.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_job_test.go
@@ -29,6 +29,7 @@ import (
k8sfake "k8s.io/client-go/kubernetes/fake"
kubetesting "k8s.io/client-go/testing"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
)
@@ -46,12 +47,12 @@ func TestJobCmd(t *testing.T) {
"shouldn't delete job because it is not found": {
args: []string{"j"},
objs: []runtime.Object{
- wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantJobs: []batchv1.Job{
- *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantOutErr: "jobs.batch \"j\" not found\n",
},
@@ -65,33 +66,47 @@ func TestJobCmd(t *testing.T) {
},
wantOutErr: "jobs.batch \"j1\" not created via kjob\n",
},
+ "shouldn't delete job because it is not used for Job mode": {
+ args: []string{"j1", "j2"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantOutErr: `jobs.batch "j1" created in "" mode. Switch to the correct mode to delete it
+jobs.batch "j2" created in "Slurm" mode. Switch to the correct mode to delete it
+`,
+ },
"should delete job": {
args: []string{"j1"},
objs: []runtime.Object{
- wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantJobs: []batchv1.Job{
- *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantOut: "job.batch/j1 deleted\n",
},
"should delete jobs": {
args: []string{"j1", "j2"},
objs: []runtime.Object{
- wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantOut: "job.batch/j1 deleted\njob.batch/j2 deleted\n",
},
"should delete only one job": {
args: []string{"j1", "j"},
objs: []runtime.Object{
- wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantJobs: []batchv1.Job{
- *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantOut: "job.batch/j1 deleted\n",
wantOutErr: "jobs.batch \"j\" not found\n",
@@ -99,24 +114,24 @@ func TestJobCmd(t *testing.T) {
"shouldn't delete job with client dry run": {
args: []string{"j1", "--dry-run", "client"},
objs: []runtime.Object{
- wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantJobs: []batchv1.Job{
- *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantOut: "job.batch/j1 deleted (client dry run)\n",
},
"shouldn't delete job with server dry run": {
args: []string{"j1", "--dry-run", "server"},
objs: []runtime.Object{
- wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantJobs: []batchv1.Job{
- *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
- *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Obj(),
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.JobMode).Obj(),
},
wantOut: "job.batch/j1 deleted (server dry run)\n",
},
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_cluster.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_cluster.go
index 9848ed25b0c..7d963ef0b0e 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_cluster.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_cluster.go
@@ -27,6 +27,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -35,9 +36,11 @@ import (
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
)
-const (
- rayClusterExample = ` # Delete RayCluster
- kjobctl delete raycluster my-application-profile-raycluster-k2wzd`
+var (
+ rayClusterExample = templates.Examples(`
+ # Delete RayCluster
+ kjobctl delete raycluster my-application-profile-raycluster-k2wzd
+ `)
)
type RayClusterOptions struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_job.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_job.go
index e398ee4a2d8..6dee8a7bd22 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_job.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_ray_job.go
@@ -27,6 +27,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -35,9 +36,11 @@ import (
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
)
-const (
- rayJobExample = ` # Delete RayJob
- kjobctl delete rayjob my-application-profile-rayjob-k2wzd`
+var (
+ rayJobExample = templates.Examples(`
+ # Delete RayJob
+ kjobctl delete rayjob my-application-profile-rayjob-k2wzd
+ `)
)
type RayJobOptions struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_slurm.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_slurm.go
new file mode 100644
index 00000000000..babca3ef11c
--- /dev/null
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_slurm.go
@@ -0,0 +1,223 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package delete
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/spf13/cobra"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/cli-runtime/pkg/genericclioptions"
+ "k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/cli-runtime/pkg/printers"
+ k8s "k8s.io/client-go/kubernetes"
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/kubectl/pkg/util/templates"
+ "k8s.io/utils/ptr"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/completion"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
+)
+
+var (
+ slurmExample = templates.Examples(`
+ # Delete Slurm
+ kjobctl delete slurm my-application-profile-slurm-k2wzd
+ `)
+)
+
+type SlurmOptions struct {
+ PrintFlags *genericclioptions.PrintFlags
+
+ JobNames []string
+ Namespace string
+
+ CascadeStrategy metav1.DeletionPropagation
+ DryRunStrategy util.DryRunStrategy
+
+ Clientset k8s.Interface
+
+ PrintObj printers.ResourcePrinterFunc
+
+ genericiooptions.IOStreams
+}
+
+func NewSlurmOptions(streams genericiooptions.IOStreams) *SlurmOptions {
+ return &SlurmOptions{
+ PrintFlags: genericclioptions.NewPrintFlags("deleted").WithTypeSetter(scheme.Scheme),
+ IOStreams: streams,
+ }
+}
+
+func NewSlurmCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
+ o := NewSlurmOptions(streams)
+
+ cmd := &cobra.Command{
+ Use: "slurm NAME [--cascade STRATEGY] [--dry-run STRATEGY]",
+ DisableFlagsInUseLine: true,
+ Short: "Delete Slurm",
+ Example: slurmExample,
+ Args: cobra.MinimumNArgs(1),
+ ValidArgsFunction: completion.JobNameFunc(clientGetter, v1alpha1.SlurmMode),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ cmd.SilenceUsage = true
+
+ err := o.Complete(clientGetter, cmd, args)
+ if err != nil {
+ return err
+ }
+
+ return o.Run(cmd.Context())
+ },
+ }
+
+ addCascadingFlag(cmd)
+ util.AddDryRunFlag(cmd)
+
+ o.PrintFlags.AddFlags(cmd)
+
+ return cmd
+}
+
+func (o *SlurmOptions) Complete(clientGetter util.ClientGetter, cmd *cobra.Command, args []string) error {
+ o.JobNames = args
+
+ var err error
+
+ o.Namespace, _, err = clientGetter.ToRawKubeConfigLoader().Namespace()
+ if err != nil {
+ return err
+ }
+
+ o.DryRunStrategy, err = util.GetDryRunStrategy(cmd)
+ if err != nil {
+ return err
+ }
+
+ err = util.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
+ if err != nil {
+ return err
+ }
+
+ o.CascadeStrategy, err = getCascadingStrategy(cmd)
+ if err != nil {
+ return err
+ }
+
+ printer, err := o.PrintFlags.ToPrinter()
+ if err != nil {
+ return err
+ }
+
+ o.PrintObj = printer.PrintObj
+
+ o.Clientset, err = clientGetter.K8sClientset()
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (o *SlurmOptions) Run(ctx context.Context) error {
+ for _, jobName := range o.JobNames {
+ if err := o.deleteJob(ctx, jobName); err != nil {
+ return err
+ }
+ if err := o.deleteConfigMap(ctx, jobName); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func (o *SlurmOptions) deleteJob(ctx context.Context, jobName string) error {
+ job, err := o.Clientset.BatchV1().Jobs(o.Namespace).Get(ctx, jobName, metav1.GetOptions{})
+ if client.IgnoreNotFound(err) != nil {
+ return err
+ }
+ if err != nil {
+ fmt.Fprintln(o.ErrOut, err)
+ return nil
+ }
+ if _, ok := job.Labels[constants.ProfileLabel]; !ok {
+ fmt.Fprintf(o.ErrOut, "jobs.batch \"%s\" not created via kjob\n", job.Name)
+ return nil
+ }
+ if job.Labels[constants.ModeLabel] != string(v1alpha1.SlurmMode) {
+ fmt.Fprintf(o.ErrOut, "jobs.batch \"%s\" created in \"%s\" mode. Switch to the correct mode to delete it\n",
+ job.Name, job.Labels[constants.ModeLabel])
+ return nil
+ }
+
+ if o.DryRunStrategy != util.DryRunClient {
+ deleteOptions := metav1.DeleteOptions{
+ PropagationPolicy: ptr.To(o.CascadeStrategy),
+ }
+
+ if o.DryRunStrategy == util.DryRunServer {
+ deleteOptions.DryRun = []string{metav1.DryRunAll}
+ }
+
+ if err := o.Clientset.BatchV1().Jobs(o.Namespace).Delete(ctx, jobName, deleteOptions); err != nil {
+ return err
+ }
+ }
+
+ return o.PrintObj(job, o.Out)
+}
+
+func (o *SlurmOptions) deleteConfigMap(ctx context.Context, configMapName string) error {
+ configMap, err := o.Clientset.CoreV1().ConfigMaps(o.Namespace).Get(ctx, configMapName, metav1.GetOptions{})
+ if client.IgnoreNotFound(err) != nil {
+ return err
+ }
+ if err != nil {
+ fmt.Fprintln(o.ErrOut, err)
+ return nil
+ }
+ if _, ok := configMap.Labels[constants.ProfileLabel]; !ok {
+ fmt.Fprintf(o.ErrOut, "configmaps \"%s\" not created via kjob\n", configMap.Name)
+ return nil
+ }
+ if configMap.Labels[constants.ModeLabel] != string(v1alpha1.SlurmMode) {
+ fmt.Fprintf(o.ErrOut, "configmaps \"%s\" created in \"%s\" mode. Switch to the correct mode to delete it\n",
+ configMap.Name, configMap.Labels[constants.ModeLabel])
+ return nil
+ }
+
+ if o.DryRunStrategy != util.DryRunClient {
+ deleteOptions := metav1.DeleteOptions{
+ PropagationPolicy: ptr.To(o.CascadeStrategy),
+ }
+
+ if o.DryRunStrategy == util.DryRunServer {
+ deleteOptions.DryRun = []string{metav1.DryRunAll}
+ }
+
+ if err := o.Clientset.CoreV1().ConfigMaps(o.Namespace).Delete(ctx, configMapName, deleteOptions); err != nil {
+ return err
+ }
+ }
+
+ return o.PrintObj(configMap, o.Out)
+}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/delete/delete_slurm_test.go b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_slurm_test.go
new file mode 100644
index 00000000000..058a42a8a38
--- /dev/null
+++ b/cmd/experimental/kjobctl/pkg/cmd/delete/delete_slurm_test.go
@@ -0,0 +1,267 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package delete
+
+import (
+ "context"
+ "slices"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ batchv1 "k8s.io/api/batch/v1"
+ corev1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/cli-runtime/pkg/genericiooptions"
+ k8sfake "k8s.io/client-go/kubernetes/fake"
+ kubetesting "k8s.io/client-go/testing"
+
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
+ cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
+)
+
+func TestSlurmCmd(t *testing.T) {
+ testCases := map[string]struct {
+ ns string
+ args []string
+ objs []runtime.Object
+ wantJobs []batchv1.Job
+ wantConfigMaps []corev1.ConfigMap
+ wantOut string
+ wantOutErr string
+ wantErr string
+ }{
+ "shouldn't delete slurm job because it is not found": {
+ args: []string{"j"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantConfigMaps: []corev1.ConfigMap{
+ *wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ *wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantOutErr: "jobs.batch \"j\" not found\nconfigmaps \"j\" not found\n",
+ },
+ "shouldn't delete job because it is not created via kjob": {
+ args: []string{"j1"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Obj(),
+ },
+ wantConfigMaps: []corev1.ConfigMap{
+ *wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Obj(),
+ },
+ wantOutErr: "jobs.batch \"j1\" not created via kjob\nconfigmaps \"j1\" not created via kjob\n",
+ },
+ "shouldn't delete slurm job because it is not used for Job mode": {
+ args: []string{"j1", "j2"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ },
+ wantConfigMaps: []corev1.ConfigMap{
+ *wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Obj(),
+ *wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.JobMode).Obj(),
+ },
+ wantOutErr: `jobs.batch "j1" created in "" mode. Switch to the correct mode to delete it
+configmaps "j1" created in "" mode. Switch to the correct mode to delete it
+jobs.batch "j2" created in "Job" mode. Switch to the correct mode to delete it
+configmaps "j2" created in "Job" mode. Switch to the correct mode to delete it
+`,
+ },
+ "should delete slurm job": {
+ args: []string{"j1"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantConfigMaps: []corev1.ConfigMap{
+ *wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantOut: "job.batch/j1 deleted\nconfigmap/j1 deleted\n",
+ },
+ "should delete slurm jobs": {
+ args: []string{"j1", "j2"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantOut: "job.batch/j1 deleted\nconfigmap/j1 deleted\njob.batch/j2 deleted\nconfigmap/j2 deleted\n",
+ },
+ "should delete only one slurm job": {
+ args: []string{"j1", "j"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantConfigMaps: []corev1.ConfigMap{
+ *wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantOut: "job.batch/j1 deleted\nconfigmap/j1 deleted\n",
+ wantOutErr: "jobs.batch \"j\" not found\nconfigmaps \"j\" not found\n",
+ },
+ "shouldn't delete slurm job with client dry run": {
+ args: []string{"j1", "--dry-run", "client"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantConfigMaps: []corev1.ConfigMap{
+ *wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ *wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantOut: "job.batch/j1 deleted (client dry run)\nconfigmap/j1 deleted (client dry run)\n",
+ },
+ "shouldn't delete slurm job with server dry run": {
+ args: []string{"j1", "--dry-run", "server"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantJobs: []batchv1.Job{
+ *wrappers.MakeJob("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ *wrappers.MakeJob("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantConfigMaps: []corev1.ConfigMap{
+ *wrappers.MakeConfigMap("j1", metav1.NamespaceDefault).Profile("p1").Mode(v1alpha1.SlurmMode).Obj(),
+ *wrappers.MakeConfigMap("j2", metav1.NamespaceDefault).Profile("p2").Mode(v1alpha1.SlurmMode).Obj(),
+ },
+ wantOut: "job.batch/j1 deleted (server dry run)\nconfigmap/j1 deleted (server dry run)\n",
+ },
+ "no args": {
+ args: []string{},
+ wantErr: "requires at least 1 arg(s), only received 0",
+ },
+ }
+ for name, tc := range testCases {
+ t.Run(name, func(t *testing.T) {
+ ns := metav1.NamespaceDefault
+ if tc.ns != "" {
+ ns = tc.ns
+ }
+
+ streams, _, out, outErr := genericiooptions.NewTestIOStreams()
+
+ clientset := k8sfake.NewSimpleClientset(tc.objs...)
+ clientset.PrependReactor("delete", "jobs", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
+ if slices.Contains(action.(kubetesting.DeleteAction).GetDeleteOptions().DryRun, metav1.DryRunAll) {
+ handled = true
+ }
+ return handled, ret, err
+ })
+ clientset.PrependReactor("delete", "configmaps", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
+ if slices.Contains(action.(kubetesting.DeleteAction).GetDeleteOptions().DryRun, metav1.DryRunAll) {
+ handled = true
+ }
+ return handled, ret, err
+ })
+
+ tcg := cmdtesting.NewTestClientGetter().
+ WithK8sClientset(clientset).
+ WithNamespace(ns)
+
+ cmd := NewSlurmCmd(tcg, streams)
+ cmd.SetOut(out)
+ cmd.SetErr(outErr)
+ cmd.SetArgs(tc.args)
+
+ gotErr := cmd.Execute()
+
+ var gotErrStr string
+ if gotErr != nil {
+ gotErrStr = gotErr.Error()
+ }
+
+ if diff := cmp.Diff(tc.wantErr, gotErrStr); diff != "" {
+ t.Errorf("Unexpected error (-want/+got)\n%s", diff)
+ }
+
+ if gotErr != nil {
+ return
+ }
+
+ gotOut := out.String()
+ if diff := cmp.Diff(tc.wantOut, gotOut); diff != "" {
+ t.Errorf("Unexpected output (-want/+got)\n%s", diff)
+ }
+
+ gotOutErr := outErr.String()
+ if diff := cmp.Diff(tc.wantOutErr, gotOutErr); diff != "" {
+ t.Errorf("Unexpected error output (-want/+got)\n%s", diff)
+ }
+
+ ctx := context.Background()
+
+ gotJobList, err := clientset.BatchV1().Jobs(tc.ns).List(ctx, metav1.ListOptions{})
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ if diff := cmp.Diff(tc.wantJobs, gotJobList.Items); diff != "" {
+ t.Errorf("Unexpected jobs (-want/+got)\n%s", diff)
+ }
+
+ gotConfigMapList, err := clientset.CoreV1().ConfigMaps(tc.ns).List(ctx, metav1.ListOptions{})
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ if diff := cmp.Diff(tc.wantConfigMaps, gotConfigMapList.Items); diff != "" {
+ t.Errorf("Unexpected jobs (-want/+got)\n%s", diff)
+ }
+ })
+ }
+}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/describe/describe.go b/cmd/experimental/kjobctl/pkg/cmd/describe/describe.go
index 5856e29d3c6..476cb85ec8a 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/describe/describe.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/describe/describe.go
@@ -17,33 +17,44 @@ limitations under the License.
package describe
import (
+ "context"
"fmt"
+ "slices"
"strings"
"github.com/spf13/cobra"
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+ "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/resource"
+ "k8s.io/client-go/kubernetes"
+ "k8s.io/kubectl/pkg/util/templates"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
)
-const (
- jobExample = ` # Describe a task with job mode
- kjobctl describe job sample-job
-
- # Describe a task with job mode
- kjobctl describe job/sample-job
-
- # Describe all tasks with job mode
- kjobctl describe job
-
- # Describe tasks by label name=myLabel
- kjobctl describe job -l name=myLabel`
+var (
+ jobExample = templates.Examples(`
+ # Describe a task with job mode
+ kjobctl describe job sample-job
+
+ # Describe a task with job mode
+ kjobctl describe job/sample-job
+
+ # Describe all tasks with job mode
+ kjobctl describe job
+
+ # Describe tasks by label name=myLabel
+ kjobctl describe job -l name=myLabel
+ `)
)
const (
@@ -66,6 +77,8 @@ type DescribeOptions struct {
ResourceGVK schema.GroupVersionKind
ResourceBuilder *resource.Builder
+ Clientset kubernetes.Interface
+
genericiooptions.IOStreams
}
@@ -93,7 +106,7 @@ func NewDescribeCmd(clientGetter util.ClientGetter, streams genericiooptions.IOS
return err
}
- return o.Run()
+ return o.Run(cmd.Context())
},
}
@@ -131,6 +144,11 @@ func (o *DescribeOptions) Complete(clientGetter util.ClientGetter, args []string
o.ResourceBuilder = clientGetter.NewResourceBuilder()
+ o.Clientset, err = clientGetter.K8sClientset()
+ if err != nil {
+ return err
+ }
+
return nil
}
@@ -163,7 +181,7 @@ func (o *DescribeOptions) parseArgs(args []string) error {
return nil
}
-func (o *DescribeOptions) Run() error {
+func (o *DescribeOptions) Run(ctx context.Context) error {
builder := o.customizeResourceBuilder()
r := builder.Do()
@@ -175,6 +193,22 @@ func (o *DescribeOptions) Run() error {
return err
}
+ if strings.EqualFold(o.ModeName, string(v1alpha1.SlurmMode)) {
+ configMapsAsInfos, err := o.getConfigMaps(ctx)
+ if err != nil {
+ return err
+ }
+
+ infos = append(infos, configMapsAsInfos...)
+ }
+
+ // In Slurm mode, configMaps are created with the same name as the jobs they are mounted on.
+ // Since the first half of the slice contains jobs and the second half contains configMaps,
+ // sorting objects by name will interleave jobs with their corresponding configMap.
+ slices.SortFunc(infos, func(a, b *resource.Info) int {
+ return strings.Compare(a.Name, b.Name)
+ })
+
allErrs := []error{}
errs := sets.NewString()
first := true
@@ -261,3 +295,58 @@ func (o *DescribeOptions) customizeResourceBuilder() *resource.Builder {
return builder.Flatten()
}
+
+func (o *DescribeOptions) getConfigMaps(ctx context.Context) ([]*resource.Info, error) {
+ infos := make([]*resource.Info, 0)
+
+ if o.argsFormat == modeTaskArgsFormat || o.argsFormat == modeSlashTaskArgsFormat {
+ cm, err := o.Clientset.CoreV1().ConfigMaps(o.Namespace).Get(ctx, o.TaskName, metav1.GetOptions{})
+ if err != nil {
+ return nil, err
+ }
+
+ info, err := configMapToInfo(cm)
+ if err != nil {
+ return nil, err
+ }
+
+ infos = append(infos, info)
+ } else {
+ cmList, err := o.Clientset.CoreV1().ConfigMaps(o.Namespace).List(ctx, metav1.ListOptions{
+ LabelSelector: fmt.Sprintf("%s,%s=%s", constants.ProfileLabel, constants.ModeLabel, v1alpha1.SlurmMode),
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ for _, cm := range cmList.Items {
+ info, err := configMapToInfo(&cm)
+ if err != nil {
+ return nil, err
+ }
+
+ infos = append(infos, info)
+ }
+ }
+
+ return infos, nil
+}
+
+func configMapToInfo(cm *corev1.ConfigMap) (*resource.Info, error) {
+ u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(cm)
+ if err != nil {
+ return nil, err
+ }
+
+ obj := &unstructured.Unstructured{Object: u}
+ return &resource.Info{
+ Mapping: &meta.RESTMapping{
+ GroupVersionKind: schema.GroupVersionKind{
+ Version: "v1",
+ Kind: "ConfigMap",
+ },
+ },
+ Name: obj.GetName(),
+ Object: obj,
+ }, nil
+}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/describe/describe_printer.go b/cmd/experimental/kjobctl/pkg/cmd/describe/describe_printer.go
index c8250c0cdda..06f0477d195 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/describe/describe_printer.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/describe/describe_printer.go
@@ -19,6 +19,7 @@ package describe
import (
"fmt"
"io"
+ "strconv"
"time"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
@@ -30,6 +31,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/duration"
describehelper "k8s.io/kubectl/pkg/describe"
+ "k8s.io/utils/ptr"
)
// ResourceDescriber generates output for the named resource or an error
@@ -39,7 +41,7 @@ type ResourceDescriber interface {
Describe(object *unstructured.Unstructured) (output string, err error)
}
-// NewResourceDescriber Describer returns a Describer for displaying the specified RESTMapping type or an error.
+// NewResourceDescriber returns a Describer for displaying the specified RESTMapping type or an error.
func NewResourceDescriber(mapping *meta.RESTMapping) (ResourceDescriber, error) {
if describer, ok := DescriberFor(mapping.GroupVersionKind.GroupKind()); ok {
return describer, nil
@@ -52,9 +54,11 @@ func NewResourceDescriber(mapping *meta.RESTMapping) (ResourceDescriber, error)
// Kubernetes types.
func DescriberFor(kind schema.GroupKind) (ResourceDescriber, bool) {
describers := map[schema.GroupKind]ResourceDescriber{
- {Group: batchv1.GroupName, Kind: "Job"}: &JobDescriber{},
- {Group: corev1.GroupName, Kind: "Pod"}: &PodDescriber{},
- {Group: rayv1.GroupVersion.Group, Kind: "RayJob"}: &RayJobDescriber{},
+ {Group: batchv1.GroupName, Kind: "Job"}: &JobDescriber{},
+ {Group: corev1.GroupName, Kind: "Pod"}: &PodDescriber{},
+ {Group: rayv1.GroupVersion.Group, Kind: "RayJob"}: &RayJobDescriber{},
+ {Group: rayv1.GroupVersion.Group, Kind: "RayCluster"}: &RayClusterDescriber{},
+ {Group: corev1.GroupName, Kind: "ConfigMap"}: &ConfigMapDescriber{},
}
f, ok := describers[kind]
@@ -224,3 +228,108 @@ func describeRayJob(rayJob *rayv1.RayJob) (string, error) {
return nil
})
}
+
+// RayClusterDescriber generates information about a ray cluster.
+type RayClusterDescriber struct{}
+
+func (d *RayClusterDescriber) Describe(object *unstructured.Unstructured) (string, error) {
+ rayCluster := &rayv1.RayCluster{}
+ err := runtime.DefaultUnstructuredConverter.FromUnstructured(object.UnstructuredContent(), rayCluster)
+ if err != nil {
+ return "", err
+ }
+
+ return describeRayCluster(rayCluster)
+}
+
+func describeRayCluster(rayCluster *rayv1.RayCluster) (string, error) {
+ return tabbedString(func(out io.Writer) error {
+ w := describehelper.NewPrefixWriter(out)
+
+ w.Write(IndentLevelZero, "Name:\t%s\n", rayCluster.Name)
+ w.Write(IndentLevelZero, "Namespace:\t%s\n", rayCluster.Namespace)
+
+ printLabelsMultiline(w, "Labels", rayCluster.Labels)
+
+ w.Write(IndentLevelZero, "Suspend:\t%t\n", ptr.Deref(rayCluster.Spec.Suspend, false))
+ w.Write(IndentLevelZero, "State:\t%s\n", string(rayCluster.Status.State))
+ if len(rayCluster.Status.Reason) > 0 {
+ w.Write(IndentLevelZero, "Reason:\t%s\n", rayCluster.Status.Reason)
+ }
+
+ w.Write(IndentLevelZero, "Desired CPU:\t%s\n", rayCluster.Status.DesiredCPU.String())
+ w.Write(IndentLevelZero, "Desired GPU:\t%s\n", rayCluster.Status.DesiredGPU.String())
+ w.Write(IndentLevelZero, "Desired Memory:\t%s\n", rayCluster.Status.DesiredMemory.String())
+ w.Write(IndentLevelZero, "Desired TPU:\t%s\n", rayCluster.Status.DesiredTPU.String())
+
+ w.Write(IndentLevelZero, "Ready Worker Replicas:\t%d\n", rayCluster.Status.ReadyWorkerReplicas)
+ w.Write(IndentLevelZero, "Available Worker Replicas:\t%d\n", rayCluster.Status.AvailableWorkerReplicas)
+ w.Write(IndentLevelZero, "Desired Worker Replicas:\t%d\n", rayCluster.Status.DesiredWorkerReplicas)
+ w.Write(IndentLevelZero, "Min Worker Replicas:\t%d\n", rayCluster.Status.MinWorkerReplicas)
+ w.Write(IndentLevelZero, "Max Worker Replicas:\t%d\n", rayCluster.Status.MaxWorkerReplicas)
+
+ w.Write(IndentLevelZero, "Head Group:\n")
+ headGroupWriter := describehelper.NewNestedPrefixWriter(w, 1)
+ printLabelsMultiline(headGroupWriter, "Start Params", rayCluster.Spec.HeadGroupSpec.RayStartParams)
+ describePodTemplate(&rayCluster.Spec.HeadGroupSpec.Template, headGroupWriter)
+
+ w.Write(IndentLevelZero, "Worker Groups:\n")
+ for _, wg := range rayCluster.Spec.WorkerGroupSpecs {
+ w.Write(IndentLevelOne, fmt.Sprintf("%s:\n", wg.GroupName))
+ workerGroupWriter := describehelper.NewNestedPrefixWriter(w, 2)
+ if wg.Replicas != nil {
+ workerGroupWriter.Write(IndentLevelZero, "Replicas:\t%d\n", *wg.Replicas)
+ }
+ if wg.MinReplicas != nil {
+ workerGroupWriter.Write(IndentLevelZero, "Min Replicas:\t%d\n", *wg.MinReplicas)
+ }
+ if wg.MaxReplicas != nil {
+ workerGroupWriter.Write(IndentLevelZero, "Max Replicas:\t%d\n", *wg.MaxReplicas)
+ }
+ printLabelsMultiline(workerGroupWriter, "Start Params", wg.RayStartParams)
+ describePodTemplate(&wg.Template, workerGroupWriter)
+ }
+
+ return nil
+ })
+}
+
+// ConfigMapDescriber generates information about a configMap.
+type ConfigMapDescriber struct{}
+
+func (d *ConfigMapDescriber) Describe(object *unstructured.Unstructured) (string, error) {
+ configMap := &corev1.ConfigMap{}
+ err := runtime.DefaultUnstructuredConverter.FromUnstructured(object.UnstructuredContent(), configMap)
+ if err != nil {
+ return "", err
+ }
+
+ return describeConfigMap(configMap)
+}
+
+func describeConfigMap(configMap *corev1.ConfigMap) (string, error) {
+ return tabbedString(func(out io.Writer) error {
+ w := describehelper.NewPrefixWriter(out)
+
+ w.Write(IndentLevelZero, "Name:\t%s\n", configMap.Name)
+ w.Write(IndentLevelZero, "Namespace:\t%s\n", configMap.Namespace)
+ printLabelsMultiline(w, "Labels", configMap.Labels)
+
+ w.Write(IndentLevelZero, "\nData\n====\n")
+ sortedKeys := sortMapKeys(configMap.Data)
+ for _, k := range sortedKeys {
+ w.Write(IndentLevelZero, "%s:\n----\n", k)
+ w.Write(IndentLevelZero, "%s\n", configMap.Data[k])
+ w.Write(IndentLevelZero, "\n")
+ }
+
+ w.Write(IndentLevelZero, "\nBinaryData\n====\n")
+ sortedKeys = sortMapKeys(configMap.BinaryData)
+ for _, k := range sortedKeys {
+ w.Write(IndentLevelZero, "%s: %s bytes\n", k, strconv.Itoa(len(configMap.BinaryData[k])))
+ }
+ w.Write(IndentLevelZero, "\n")
+
+ return nil
+ })
+}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/describe/describe_test.go b/cmd/experimental/kjobctl/pkg/cmd/describe/describe_test.go
index 9f9458b63ea..28b64e54321 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/describe/describe_test.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/describe/describe_test.go
@@ -36,22 +36,25 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/resource"
+ k8sfake "k8s.io/client-go/kubernetes/fake"
restfake "k8s.io/client-go/rest/fake"
"k8s.io/utils/ptr"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
)
func TestDescribeCmd(t *testing.T) {
testCases := map[string]struct {
- args []string
- argsFormat int
- objs []runtime.Object
- mapperKinds []schema.GroupVersionKind
- wantOut string
- wantOutErr string
- wantErr error
+ args []string
+ argsFormat int
+ objs []runtime.Object
+ withK8sClientSet bool
+ mapperKinds []schema.GroupVersionKind
+ wantOut string
+ wantOutErr string
+ wantErr error
}{
"shouldn't describe none kjobctl owned jobs": {
args: []string{"job", "sample-job-8c7zt"},
@@ -98,6 +101,240 @@ Pod Template:
Environment:
Mounts:
Volumes:
+`,
+ },
+ "describe slurm with 'mode task' format": {
+ args: []string{"slurm", "sample-job-8c7zt"},
+ argsFormat: modeTaskArgsFormat,
+ mapperKinds: []schema.GroupVersionKind{
+ batchv1.SchemeGroupVersion.WithKind("Job"),
+ corev1.SchemeGroupVersion.WithKind("ConfigMap"),
+ },
+ withK8sClientSet: true,
+ objs: []runtime.Object{
+ getSampleJob("sample-job-8c7zt"),
+ wrappers.MakeConfigMap("sample-job-8c7zt", "default").
+ Profile("profile").
+ Mode(v1alpha1.SlurmMode).
+ Data(map[string]string{
+ "script": "#!/bin/bash\nsleep 300",
+ "entrypoint.sh": `#!/usr/bin/bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# External variables
+# JOB_COMPLETION_INDEX - completion index of the job.
+# JOB_CONTAINER_INDEX - container index in the container template.
+
+# ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
+declare -A array_indexes=(["0"]="0") # Requires bash v4+
+
+container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
+container_indexes=(${container_indexes//,/ })
+
+if [[ ! -v container_indexes[${JOB_CONTAINER_INDEX}] ]];
+then
+exit 0
+fi
+
+SBATCH_ARRAY_INX=
+SBATCH_GPUS_PER_TASK=
+SBATCH_MEM_PER_CPU=
+SBATCH_MEM_PER_GPU=
+SBATCH_OUTPUT=
+SBATCH_ERROR=
+SBATCH_INPUT=
+SBATCH_JOB_NAME=
+SBATCH_PARTITION=
+
+export SLURM_ARRAY_JOB_ID=1 # Job array’s master job ID number.
+export SLURM_ARRAY_TASK_COUNT=1 # Total number of tasks in a job array.
+export SLURM_ARRAY_TASK_MAX=0 # Job array’s maximum ID (index) number.
+export SLURM_ARRAY_TASK_MIN=0 # Job array’s minimum ID (index) number.
+export SLURM_TASKS_PER_NODE=1 # Number of tasks to be initiated on each node.
+export SLURM_CPUS_PER_TASK= # Number of CPUs per task.
+export SLURM_CPUS_ON_NODE= # Number of CPUs on the allocated node (actually pod).
+export SLURM_JOB_CPUS_PER_NODE= # Count of processors available to the job on this node.
+export SLURM_CPUS_PER_GPU= # Number of CPUs requested per allocated GPU.
+export SLURM_MEM_PER_CPU= # Memory per CPU. Same as --mem-per-cpu .
+export SLURM_MEM_PER_GPU= # Memory per GPU.
+export SLURM_MEM_PER_NODE= # Memory per node. Same as --mem.
+export SLURM_GPUS=0 # Number of GPUs requested (in total).
+export SLURM_NTASKS=1 # Same as -n, –ntasks. The number of tasks.
+export SLURM_NTASKS_PER_NODE=1 # Number of tasks requested per node.
+export SLURM_NPROCS=$SLURM_NTASKS # Same as -n, --ntasks. See $SLURM_NTASKS.
+export SLURM_NNODES=1 # Total number of nodes (actually pods) in the job’s resource allocation.
+export SLURM_SUBMIT_DIR=/slurm # The path of the job submission directory.
+export SLURM_SUBMIT_HOST=$HOSTNAME # The hostname of the node used for job submission.
+
+export SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * SLURM_TASKS_PER_NODE + JOB_CONTAINER_INDEX + SLURM_ARRAY_JOB_ID )) # The Job ID.
+export SLURM_JOBID=$SLURM_JOB_ID # Deprecated. Same as $SLURM_JOB_ID
+export SLURM_ARRAY_TASK_ID=${container_indexes[${JOB_CONTAINER_INDEX}]} # Task ID.
+
+unmask_filename () {
+replaced="$1"
+
+if [[ "$replaced" == "\\"* ]]; then
+replaced="${replaced//\\/}"
+echo "${replaced}"
+return 0
+fi
+
+replaced=$(echo "$replaced" | sed -E "s/(%)(%A)/\1\n\2/g;:a s/(^|[^\n])%A/\1$SLURM_ARRAY_JOB_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%a)/\1\n\2/g;:a s/(^|[^\n])%a/\1$SLURM_ARRAY_TASK_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%j)/\1\n\2/g;:a s/(^|[^\n])%j/\1$SLURM_JOB_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%N)/\1\n\2/g;:a s/(^|[^\n])%N/\1$HOSTNAME/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%n)/\1\n\2/g;:a s/(^|[^\n])%n/\1$JOB_COMPLETION_INDEX/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%t)/\1\n\2/g;:a s/(^|[^\n])%t/\1$SLURM_ARRAY_TASK_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%u)/\1\n\2/g;:a s/(^|[^\n])%u/\1$USER_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%x)/\1\n\2/g;:a s/(^|[^\n])%x/\1$SBATCH_JOB_NAME/;ta;s/\n//g")
+
+replaced="${replaced//%%/%}"
+
+echo "$replaced"
+}
+
+input_file=$(unmask_filename "$SBATCH_INPUT")
+output_file=$(unmask_filename "$SBATCH_OUTPUT")
+error_path=$(unmask_filename "$SBATCH_ERROR")
+
+/slurm/script
+`,
+ }).
+ Obj(),
+ },
+ wantOut: `Name: sample-job-8c7zt
+Namespace: default
+Labels: kjobctl.x-k8s.io/profile=sample-profile
+Parallelism: 3
+Completions: 2
+Start Time: Mon, 01 Jan 2024 00:00:00 +0000
+Completed At: Mon, 01 Jan 2024 00:00:33 +0000
+Duration: 33s
+Pods Statuses: 0 Active / 2 Succeeded / 0 Failed
+Pod Template:
+ Containers:
+ sample-container:
+ Port:
+ Host Port:
+ Command:
+ sleep
+ 15s
+ Args:
+ 30s
+ Requests:
+ cpu: 1
+ memory: 200Mi
+ Environment:
+ Mounts:
+ Volumes:
+
+
+Name: sample-job-8c7zt
+Namespace: default
+Labels: kjobctl.x-k8s.io/mode=Slurm
+ kjobctl.x-k8s.io/profile=profile
+
+Data
+====
+entrypoint.sh:
+----
+#!/usr/bin/bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# External variables
+# JOB_COMPLETION_INDEX - completion index of the job.
+# JOB_CONTAINER_INDEX - container index in the container template.
+
+# ["COMPLETION_INDEX"]="CONTAINER_INDEX_1,CONTAINER_INDEX_2"
+declare -A array_indexes=(["0"]="0") # Requires bash v4+
+
+container_indexes=${array_indexes[${JOB_COMPLETION_INDEX}]}
+container_indexes=(${container_indexes//,/ })
+
+if [[ ! -v container_indexes[${JOB_CONTAINER_INDEX}] ]];
+then
+exit 0
+fi
+
+SBATCH_ARRAY_INX=
+SBATCH_GPUS_PER_TASK=
+SBATCH_MEM_PER_CPU=
+SBATCH_MEM_PER_GPU=
+SBATCH_OUTPUT=
+SBATCH_ERROR=
+SBATCH_INPUT=
+SBATCH_JOB_NAME=
+SBATCH_PARTITION=
+
+export SLURM_ARRAY_JOB_ID=1 # Job array’s master job ID number.
+export SLURM_ARRAY_TASK_COUNT=1 # Total number of tasks in a job array.
+export SLURM_ARRAY_TASK_MAX=0 # Job array’s maximum ID (index) number.
+export SLURM_ARRAY_TASK_MIN=0 # Job array’s minimum ID (index) number.
+export SLURM_TASKS_PER_NODE=1 # Number of tasks to be initiated on each node.
+export SLURM_CPUS_PER_TASK= # Number of CPUs per task.
+export SLURM_CPUS_ON_NODE= # Number of CPUs on the allocated node (actually pod).
+export SLURM_JOB_CPUS_PER_NODE= # Count of processors available to the job on this node.
+export SLURM_CPUS_PER_GPU= # Number of CPUs requested per allocated GPU.
+export SLURM_MEM_PER_CPU= # Memory per CPU. Same as --mem-per-cpu .
+export SLURM_MEM_PER_GPU= # Memory per GPU.
+export SLURM_MEM_PER_NODE= # Memory per node. Same as --mem.
+export SLURM_GPUS=0 # Number of GPUs requested (in total).
+export SLURM_NTASKS=1 # Same as -n, –ntasks. The number of tasks.
+export SLURM_NTASKS_PER_NODE=1 # Number of tasks requested per node.
+export SLURM_NPROCS=$SLURM_NTASKS # Same as -n, --ntasks. See $SLURM_NTASKS.
+export SLURM_NNODES=1 # Total number of nodes (actually pods) in the job’s resource allocation.
+export SLURM_SUBMIT_DIR=/slurm # The path of the job submission directory.
+export SLURM_SUBMIT_HOST=$HOSTNAME # The hostname of the node used for job submission.
+
+export SLURM_JOB_ID=$(( JOB_COMPLETION_INDEX * SLURM_TASKS_PER_NODE + JOB_CONTAINER_INDEX + SLURM_ARRAY_JOB_ID )) # The Job ID.
+export SLURM_JOBID=$SLURM_JOB_ID # Deprecated. Same as $SLURM_JOB_ID
+export SLURM_ARRAY_TASK_ID=${container_indexes[${JOB_CONTAINER_INDEX}]} # Task ID.
+
+unmask_filename () {
+replaced="$1"
+
+if [[ "$replaced" == "\\"* ]]; then
+replaced="${replaced//\\/}"
+echo "${replaced}"
+return 0
+fi
+
+replaced=$(echo "$replaced" | sed -E "s/(%)(%A)/\1\n\2/g;:a s/(^|[^\n])%A/\1$SLURM_ARRAY_JOB_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%a)/\1\n\2/g;:a s/(^|[^\n])%a/\1$SLURM_ARRAY_TASK_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%j)/\1\n\2/g;:a s/(^|[^\n])%j/\1$SLURM_JOB_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%N)/\1\n\2/g;:a s/(^|[^\n])%N/\1$HOSTNAME/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%n)/\1\n\2/g;:a s/(^|[^\n])%n/\1$JOB_COMPLETION_INDEX/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%t)/\1\n\2/g;:a s/(^|[^\n])%t/\1$SLURM_ARRAY_TASK_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%u)/\1\n\2/g;:a s/(^|[^\n])%u/\1$USER_ID/;ta;s/\n//g")
+replaced=$(echo "$replaced" | sed -E "s/(%)(%x)/\1\n\2/g;:a s/(^|[^\n])%x/\1$SBATCH_JOB_NAME/;ta;s/\n//g")
+
+replaced="${replaced//%%/%}"
+
+echo "$replaced"
+}
+
+input_file=$(unmask_filename "$SBATCH_INPUT")
+output_file=$(unmask_filename "$SBATCH_OUTPUT")
+error_path=$(unmask_filename "$SBATCH_ERROR")
+
+/slurm/script
+
+
+script:
+----
+#!/bin/bash
+sleep 300
+
+
+BinaryData
+====
+
`,
},
"describe specific task with 'mode slash task' format": {
@@ -328,6 +565,109 @@ Ray Cluster Status:
Desired GPU: 0
Desired Memory: 0
Desired TPU: 0
+`,
+ },
+ "describe ray cluster with 'mode task' format": {
+ args: []string{"raycluster", "sample-ray-cluster"},
+ argsFormat: modeTaskArgsFormat,
+ mapperKinds: []schema.GroupVersionKind{
+ rayv1.SchemeGroupVersion.WithKind("RayCluster"),
+ },
+ objs: []runtime.Object{
+ wrappers.MakeRayCluster("sample-ray-job", metav1.NamespaceDefault).
+ Profile("my-profile").
+ LocalQueue("lq").
+ State(rayv1.Failed).
+ Reason("Reason message").
+ DesiredCPU(apiresource.MustParse("1")).
+ DesiredGPU(apiresource.MustParse("5")).
+ DesiredMemory(apiresource.MustParse("2Gi")).
+ DesiredTPU(apiresource.MustParse("10")).
+ ReadyWorkerReplicas(1).
+ AvailableWorkerReplicas(1).
+ DesiredWorkerReplicas(1).
+ MinWorkerReplicas(1).
+ MaxWorkerReplicas(5).
+ Spec(
+ *wrappers.MakeRayClusterSpec().
+ HeadGroupSpec(rayv1.HeadGroupSpec{
+ RayStartParams: map[string]string{"p1": "v1", "p2": "v2"},
+ Template: corev1.PodTemplateSpec{
+ Spec: corev1.PodSpec{
+ Containers: []corev1.Container{
+ *wrappers.MakeContainer("ray-head", "rayproject/ray:2.9.0").
+ WithEnvVar(corev1.EnvVar{Name: "TASK_NAME", Value: "sample-interactive"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "sample-volume", MountPath: "/sample"}).
+ Obj(),
+ },
+ },
+ },
+ }).
+ WithWorkerGroupSpec(
+ *wrappers.MakeWorkerGroupSpec("group1").
+ Replicas(1).
+ MinReplicas(1).
+ MaxReplicas(5).
+ RayStartParams(map[string]string{"p1": "v1", "p2": "v2"}).
+ WithContainer(
+ *wrappers.MakeContainer("ray-worker", "rayproject/ray:2.9.0").
+ WithEnvVar(corev1.EnvVar{Name: "TASK_NAME", Value: "sample-interactive"}).
+ WithVolumeMount(corev1.VolumeMount{Name: "sample-volume", MountPath: "/sample"}).
+ Obj(),
+ ).
+ Obj(),
+ ).
+ Suspend(true).
+ Obj(),
+ ).
+ Obj(),
+ },
+ wantOut: `Name: sample-ray-job
+Namespace: default
+Labels: kjobctl.x-k8s.io/profile=my-profile
+ kueue.x-k8s.io/queue-name=lq
+Suspend: true
+State: failed
+Reason: Reason message
+Desired CPU: 1
+Desired GPU: 5
+Desired Memory: 2Gi
+Desired TPU: 10
+Ready Worker Replicas: 1
+Available Worker Replicas: 1
+Desired Worker Replicas: 1
+Min Worker Replicas: 1
+Max Worker Replicas: 5
+Head Group:
+ Start Params: p1=v1
+ p2=v2
+ Pod Template:
+ Containers:
+ ray-head:
+ Port:
+ Host Port:
+ Environment:
+ TASK_NAME: sample-interactive
+ Mounts:
+ /sample from sample-volume (rw)
+ Volumes:
+Worker Groups:
+ group1:
+ Replicas: 1
+ Min Replicas: 1
+ Max Replicas: 5
+ Start Params: p1=v1
+ p2=v2
+ Pod Template:
+ Containers:
+ ray-worker:
+ Port:
+ Host Port:
+ Environment:
+ TASK_NAME: sample-interactive
+ Mounts:
+ /sample from sample-volume (rw)
+ Volumes:
`,
},
}
@@ -338,6 +678,9 @@ Ray Cluster Status:
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
tcg := cmdtesting.NewTestClientGetter()
+ if tc.withK8sClientSet {
+ tcg.WithK8sClientset(k8sfake.NewSimpleClientset(tc.objs...))
+ }
if len(tc.mapperKinds) != 0 {
mapper := meta.NewDefaultRESTMapper([]schema.GroupVersion{})
diff --git a/cmd/experimental/kjobctl/pkg/cmd/describe/helpers.go b/cmd/experimental/kjobctl/pkg/cmd/describe/helpers.go
index a8218cba0d1..5ace6175bd6 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/describe/helpers.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/describe/helpers.go
@@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
-
package describe
import (
@@ -21,6 +20,7 @@ import (
"errors"
"fmt"
"io"
+ "slices"
"sort"
"strconv"
"strings"
@@ -68,6 +68,10 @@ func resourceFor(mode string) string {
return "pod"
}
+ if strings.EqualFold(mode, string(v1alpha1.SlurmMode)) {
+ return "job"
+ }
+
return strings.ToLower(mode)
}
@@ -95,6 +99,17 @@ func gvkFor(mapper meta.RESTMapper, resource string) (schema.GroupVersionKind, e
return gvk, err
}
+func sortMapKeys[T any](m map[string]T) []string {
+ keys := make([]string, 0, len(m))
+ for k := range m {
+ keys = append(keys, k)
+ }
+
+ slices.Sort(keys)
+
+ return keys
+}
+
// below functions copied from https://github.com/kubernetes/kubectl/blob/master/pkg/describe/describe.go
func tabbedString(f func(io.Writer) error) (string, error) {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list.go b/cmd/experimental/kjobctl/pkg/cmd/list/list.go
index c8c5b1821d0..79394c9690e 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list.go
@@ -19,14 +19,17 @@ package list
import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
)
-const (
- listExample = ` # List Job
- kjobctl list job`
+var (
+ listExample = templates.Examples(`
+ # List Job
+ kjobctl list job
+ `)
)
func NewListCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams, clock clock.Clock) *cobra.Command {
@@ -41,6 +44,7 @@ func NewListCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStrea
cmd.AddCommand(NewInteractiveCmd(clientGetter, streams, clock))
cmd.AddCommand(NewRayJobCmd(clientGetter, streams, clock))
cmd.AddCommand(NewRayClusterCmd(clientGetter, streams, clock))
+ cmd.AddCommand(NewSlurmCmd(clientGetter, streams, clock))
return cmd
}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive.go
index 0111ba8fd09..fade0ac638e 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive.go
@@ -27,20 +27,23 @@ import (
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/client-go/kubernetes/scheme"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/completion"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
-const (
- interactiveExample = ` # List Interactive
- kjobctl list interactive
+var (
+ interactiveExample = templates.Examples(`
+ # List Interactive
+ kjobctl list interactive
- # List Interactive with profile filter
- kjobctl list interactive --profile my-profile`
+ # List Interactive with profile filter
+ kjobctl list interactive --profile my-profile
+ `)
)
type InteractiveOptions struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive_printer.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive_printer.go
index b83bddb0f62..475d118d5fd 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive_printer.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_interactive_printer.go
@@ -26,9 +26,9 @@ import (
"k8s.io/apimachinery/pkg/util/duration"
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
type listInteractivePrinter struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_job.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_job.go
index 57578b15542..7d6343804bf 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_job.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_job.go
@@ -27,20 +27,24 @@ import (
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/client-go/kubernetes/scheme"
batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/completion"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
-const (
- jobExample = ` # List Job
- kjobctl list job
+var (
+ jobExample = templates.Examples(`
+ # List Job
+ kjobctl list job
- # List Job with profile filter
- kjobctl list job --profile my-profile`
+ # List Job with profile filter
+ kjobctl list job --profile my-profile
+ `)
)
type JobOptions struct {
@@ -165,6 +169,9 @@ func (o *JobOptions) Run(ctx context.Context) error {
} else {
opts.LabelSelector = constants.ProfileLabel
}
+
+ opts.LabelSelector = fmt.Sprintf("%s,%s=%s", opts.LabelSelector, constants.ModeLabel, v1alpha1.JobMode)
+
if len(o.LocalQueueFilter) > 0 {
opts.LabelSelector = fmt.Sprintf("%s,%s=%s", opts.LabelSelector, kueueconstants.QueueLabel, o.LocalQueueFilter)
}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_job_printer.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_job_printer.go
index 155cc172586..41ae59a3a11 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_job_printer.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_job_printer.go
@@ -29,9 +29,9 @@ import (
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/utils/clock"
"k8s.io/utils/ptr"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
type listJobPrinter struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_job_test.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_job_test.go
index 5b972ea8bdd..e4bc324c839 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_job_test.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_job_test.go
@@ -32,6 +32,7 @@ import (
kubetesting "k8s.io/client-go/testing"
testingclock "k8s.io/utils/clock/testing"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
)
@@ -52,6 +53,7 @@ func TestJobCmd(t *testing.T) {
objs: []runtime.Object{
wrappers.MakeJob("j1", "ns1").
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -70,6 +72,33 @@ func TestJobCmd(t *testing.T) {
},
wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print only Job mode jobs": {
+ ns: "ns1",
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", "ns1").
+ Profile("profile1").
+ Mode(v1alpha1.JobMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", "ns2").
+ LocalQueue("lq2").
+ Mode(v1alpha1.SlurmMode).
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
`,
},
"should print job list with namespace filter": {
@@ -77,6 +106,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", "ns1").
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -86,6 +116,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", "ns2").
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -103,6 +134,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", metav1.NamespaceDefault).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -112,6 +144,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", metav1.NamespaceDefault).
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -129,6 +162,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", metav1.NamespaceDefault).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -138,6 +172,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", metav1.NamespaceDefault).
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -155,6 +190,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", metav1.NamespaceDefault).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
LocalQueue("lq1").
Completions(3).
@@ -165,6 +201,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", metav1.NamespaceDefault).
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
LocalQueue("lq2").
Completions(3).
@@ -183,6 +220,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", metav1.NamespaceDefault).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -192,6 +230,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", metav1.NamespaceDefault).
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
LocalQueue("lq2").
Completions(3).
@@ -210,6 +249,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", metav1.NamespaceDefault).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Label("foo", "bar").
Completions(3).
@@ -220,6 +260,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", metav1.NamespaceDefault).
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -237,6 +278,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", metav1.NamespaceDefault).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Label("foo", "bar").
Completions(3).
@@ -247,6 +289,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", metav1.NamespaceDefault).
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -264,6 +307,7 @@ j1 profile1 lq1 3/3 60m 60m
objs: []runtime.Object{
wrappers.MakeJob("j1", metav1.NamespaceDefault).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -273,6 +317,7 @@ j1 profile1 lq1 3/3 60m 60m
Obj(),
wrappers.MakeJob("j2", metav1.NamespaceDefault).
Profile("profile2").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq2").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster.go
index 554f0876f3a..9bf7b2e5548 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster.go
@@ -27,20 +27,23 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/completion"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
-const (
- rayClusterExample = ` # List RayCluster
- kjobctl list raycluster
+var (
+ rayClusterExample = templates.Examples(`
+ # List RayCluster
+ kjobctl list raycluster
- # List RayCluster with profile filter
- kjobctl list raycluster --profile my-profile`
+ # List RayCluster with profile filter
+ kjobctl list raycluster --profile my-profile
+ `)
)
type RayClusterOptions struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster_printer.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster_printer.go
index 3e87a083e78..6b4cc24fa99 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster_printer.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_cluster_printer.go
@@ -26,9 +26,9 @@ import (
"k8s.io/apimachinery/pkg/util/duration"
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
type listRayClusterPrinter struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job.go
index ded782627e0..7c08304d981 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job.go
@@ -27,20 +27,23 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/completion"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
-const (
- rayJobExample = ` # List RayJob
- kjobctl list rayjob
+var (
+ rayJobExample = templates.Examples(`
+ # List RayJob
+ kjobctl list rayjob
- # List RayJob with profile filter
- kjobctl list rayjob --profile my-profile`
+ # List RayJob with profile filter
+ kjobctl list rayjob --profile my-profile
+ `)
)
type RayJobOptions struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job_printer.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job_printer.go
index 2bf140830b9..006ad24860c 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job_printer.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_ray_job_printer.go
@@ -27,9 +27,9 @@ import (
"k8s.io/apimachinery/pkg/util/duration"
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
type listRayJobPrinter struct {
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_slurm.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_slurm.go
new file mode 100644
index 00000000000..5ac6756dae1
--- /dev/null
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_slurm.go
@@ -0,0 +1,223 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package list
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/spf13/cobra"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/cli-runtime/pkg/genericclioptions"
+ "k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/client-go/kubernetes/scheme"
+ batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1"
+ "k8s.io/kubectl/pkg/util/templates"
+ "k8s.io/utils/clock"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/completion"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
+)
+
+var (
+ slurmExample = templates.Examples(`
+ # List Slurm
+ kjobctl list slurm
+
+ # List Slurm with profile filter
+ kjobctl list slurm --profile my-profile
+ `)
+)
+
+type SlurmOptions struct {
+ Clock clock.Clock
+ PrintFlags *genericclioptions.PrintFlags
+
+ Limit int64
+ AllNamespaces bool
+ Namespace string
+ ProfileFilter string
+ LocalQueueFilter string
+ FieldSelector string
+ LabelSelector string
+
+ Client batchv1.BatchV1Interface
+
+ genericiooptions.IOStreams
+}
+
+func NewSlurmOptions(streams genericiooptions.IOStreams, clock clock.Clock) *SlurmOptions {
+ return &SlurmOptions{
+ PrintFlags: genericclioptions.NewPrintFlags("").WithTypeSetter(scheme.Scheme),
+ IOStreams: streams,
+ Clock: clock,
+ }
+}
+
+func NewSlurmCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams, clock clock.Clock) *cobra.Command {
+ o := NewSlurmOptions(streams, clock)
+
+ cmd := &cobra.Command{
+ Use: "slurm" +
+ " [--profile PROFILE_NAME]" +
+ " [--localqueue LOCALQUEUE_NAME]" +
+ " [--selector key1=value1]" +
+ " [--field-selector key1=value1]" +
+ " [--all-namespaces]",
+ DisableFlagsInUseLine: true,
+ Short: "List Slurm",
+ Example: slurmExample,
+ RunE: func(cmd *cobra.Command, _ []string) error {
+ cmd.SilenceUsage = true
+ err := o.Complete(clientGetter)
+ if err != nil {
+ return err
+ }
+ return o.Run(cmd.Context())
+ },
+ }
+
+ o.PrintFlags.AddFlags(cmd)
+
+ util.AddAllNamespacesFlagVar(cmd, &o.AllNamespaces)
+ util.AddFieldSelectorFlagVar(cmd, &o.FieldSelector)
+ util.AddLabelSelectorFlagVar(cmd, &o.LabelSelector)
+ util.AddProfileFlagVar(cmd, &o.ProfileFilter)
+ util.AddLocalQueueFlagVar(cmd, &o.LocalQueueFilter)
+
+ cobra.CheckErr(cmd.RegisterFlagCompletionFunc("profile", completion.ApplicationProfileNameFunc(clientGetter)))
+ cobra.CheckErr(cmd.RegisterFlagCompletionFunc("localqueue", completion.LocalQueueNameFunc(clientGetter)))
+
+ return cmd
+}
+
+// Complete completes all the required options
+func (o *SlurmOptions) Complete(clientGetter util.ClientGetter) error {
+ var err error
+
+ o.Limit, err = listRequestLimit()
+ if err != nil {
+ return err
+ }
+
+ o.Namespace, _, err = clientGetter.ToRawKubeConfigLoader().Namespace()
+ if err != nil {
+ return err
+ }
+
+ clientset, err := clientGetter.K8sClientset()
+ if err != nil {
+ return err
+ }
+
+ o.Client = clientset.BatchV1()
+
+ return nil
+}
+
+func (o *SlurmOptions) ToPrinter(headers bool) (printers.ResourcePrinterFunc, error) {
+ if !o.PrintFlags.OutputFlagSpecified() {
+ printer := newJobTablePrinter().
+ WithNamespace(o.AllNamespaces).
+ WithHeaders(headers).
+ WithClock(o.Clock)
+ return printer.PrintObj, nil
+ }
+
+ printer, err := o.PrintFlags.ToPrinter()
+ if err != nil {
+ return nil, err
+ }
+
+ return printer.PrintObj, nil
+}
+
+// Run performs the list operation.
+func (o *SlurmOptions) Run(ctx context.Context) error {
+ var totalCount int
+
+ namespace := o.Namespace
+ if o.AllNamespaces {
+ namespace = ""
+ }
+
+ opts := metav1.ListOptions{
+ FieldSelector: o.FieldSelector,
+ Limit: o.Limit,
+ }
+
+ if len(o.ProfileFilter) > 0 {
+ opts.LabelSelector = fmt.Sprintf("%s=%s", constants.ProfileLabel, o.ProfileFilter)
+ } else {
+ opts.LabelSelector = constants.ProfileLabel
+ }
+
+ opts.LabelSelector = fmt.Sprintf("%s,%s=%s", opts.LabelSelector, constants.ModeLabel, v1alpha1.SlurmMode)
+
+ if len(o.LocalQueueFilter) > 0 {
+ opts.LabelSelector = fmt.Sprintf("%s,%s=%s", opts.LabelSelector, kueueconstants.QueueLabel, o.LocalQueueFilter)
+ }
+ if len(o.LabelSelector) > 0 {
+ opts.LabelSelector = fmt.Sprintf("%s,%s", opts.LabelSelector, o.LabelSelector)
+ }
+
+ tabWriter := printers.GetNewTabWriter(o.Out)
+
+ for {
+ headers := totalCount == 0
+
+ list, err := o.Client.Jobs(namespace).List(ctx, opts)
+ if err != nil {
+ return err
+ }
+
+ totalCount += len(list.Items)
+
+ printer, err := o.ToPrinter(headers)
+ if err != nil {
+ return err
+ }
+
+ if err := printer.PrintObj(list, tabWriter); err != nil {
+ return err
+ }
+
+ if list.Continue != "" {
+ opts.Continue = list.Continue
+ continue
+ }
+
+ if totalCount == 0 {
+ if !o.AllNamespaces {
+ fmt.Fprintf(o.ErrOut, "No resources found in %s namespace.\n", o.Namespace)
+ } else {
+ fmt.Fprintln(o.ErrOut, "No resources found")
+ }
+ return nil
+ }
+
+ if err := tabWriter.Flush(); err != nil {
+ return err
+ }
+
+ return nil
+ }
+}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_slurm_test.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_slurm_test.go
new file mode 100644
index 00000000000..0bfc8144b4e
--- /dev/null
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_slurm_test.go
@@ -0,0 +1,389 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package list
+
+import (
+ "fmt"
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ batchv1 "k8s.io/api/batch/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/client-go/kubernetes/fake"
+ kubetesting "k8s.io/client-go/testing"
+ testingclock "k8s.io/utils/clock/testing"
+
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
+ cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
+)
+
+func TestSlurmCmd(t *testing.T) {
+ testStartTime := time.Now()
+
+ testCases := map[string]struct {
+ ns string
+ objs []runtime.Object
+ args []string
+ wantOut string
+ wantOutErr string
+ wantErr error
+ }{
+ "should print only kjobctl jobs": {
+ ns: "ns1",
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", "ns1").
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", "ns2").
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print only Slurm mode jobs": {
+ ns: "ns1",
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", "ns1").
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", "ns2").
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with namespace filter": {
+ ns: "ns1",
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", "ns1").
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", "ns2").
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with profile filter": {
+ args: []string{"--profile", "profile1"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with profile filter (short flag)": {
+ args: []string{"-p", "profile1"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with localqueue filter": {
+ args: []string{"--localqueue", "lq1"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with localqueue filter (short flag)": {
+ args: []string{"-q", "lq1"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with label selector filter": {
+ args: []string{"--selector", "foo=bar"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Label("foo", "bar").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with label selector filter (short flag)": {
+ args: []string{"-l", "foo=bar"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Label("foo", "bar").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with field selector filter": {
+ args: []string{"--field-selector", "metadata.name=j1"},
+ objs: []runtime.Object{
+ wrappers.MakeJob("j1", metav1.NamespaceDefault).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", metav1.NamespaceDefault).
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq2").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 lq1 3/3 60m 60m
+`,
+ },
+ "should print not found error": {
+ wantOutErr: fmt.Sprintf("No resources found in %s namespace.\n", metav1.NamespaceDefault),
+ },
+ "should print not found error with all-namespaces filter": {
+ args: []string{"-A"},
+ wantOutErr: "No resources found\n",
+ },
+ }
+ for name, tc := range testCases {
+ t.Run(name, func(t *testing.T) {
+ streams, _, out, outErr := genericiooptions.NewTestIOStreams()
+
+ clientset := fake.NewSimpleClientset(tc.objs...)
+ clientset.PrependReactor("list", "jobs", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
+ listAction := action.(kubetesting.ListActionImpl)
+ fieldsSelector := listAction.GetListRestrictions().Fields
+
+ obj, err := clientset.Tracker().List(listAction.GetResource(), listAction.GetKind(), listAction.Namespace)
+ jobList := obj.(*batchv1.JobList)
+
+ filtered := make([]batchv1.Job, 0, len(jobList.Items))
+ for _, item := range jobList.Items {
+ fieldsSet := fields.Set{
+ "metadata.name": item.Name,
+ }
+ if fieldsSelector.Matches(fieldsSet) {
+ filtered = append(filtered, item)
+ }
+ }
+ jobList.Items = filtered
+ return true, jobList, err
+ })
+
+ tcg := cmdtesting.NewTestClientGetter().WithK8sClientset(clientset)
+ if len(tc.ns) > 0 {
+ tcg.WithNamespace(tc.ns)
+ }
+
+ cmd := NewSlurmCmd(tcg, streams, testingclock.NewFakeClock(testStartTime))
+ cmd.SetArgs(tc.args)
+
+ gotErr := cmd.Execute()
+ if diff := cmp.Diff(tc.wantErr, gotErr, cmpopts.EquateErrors()); diff != "" {
+ t.Errorf("Unexpected error (-want/+got)\n%s", diff)
+ }
+
+ gotOut := out.String()
+ if diff := cmp.Diff(tc.wantOut, gotOut); diff != "" {
+ t.Errorf("Unexpected output (-want/+got)\n%s", diff)
+ }
+
+ gotOutErr := outErr.String()
+ if diff := cmp.Diff(tc.wantOutErr, gotOutErr); diff != "" {
+ t.Errorf("Unexpected output (-want/+got)\n%s", diff)
+ }
+ })
+ }
+}
diff --git a/cmd/experimental/kjobctl/pkg/cmd/list/list_test.go b/cmd/experimental/kjobctl/pkg/cmd/list/list_test.go
index f77037e8210..f7002188730 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/list/list_test.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/list/list_test.go
@@ -32,6 +32,7 @@ import (
k8sfake "k8s.io/client-go/kubernetes/fake"
testingclock "k8s.io/utils/clock/testing"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
cmdtesting "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/testing"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
)
@@ -53,6 +54,7 @@ func TestListCmd(t *testing.T) {
k8sObjs: []runtime.Object{
wrappers.MakeJob("j1", "ns1").
Profile("profile1").
+ Mode(v1alpha1.JobMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
@@ -62,6 +64,36 @@ func TestListCmd(t *testing.T) {
Obj(),
wrappers.MakeJob("j2", "ns2").
Profile("profile2").
+ Mode(v1alpha1.JobMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ },
+ wantOut: `NAMESPACE NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+ns1 j1 profile1 lq1 3/3 60m 60m
+ns2 j2 profile2 lq1 3/3 60m 60m
+`,
+ },
+ "should print slurm job list with all namespaces": {
+ args: []string{"slurm", "--all-namespaces"},
+ k8sObjs: []runtime.Object{
+ wrappers.MakeJob("j1", "ns1").
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ LocalQueue("lq1").
+ Completions(3).
+ CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ StartTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ CompletionTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
+ Succeeded(3).
+ Obj(),
+ wrappers.MakeJob("j2", "ns2").
+ Profile("profile2").
+ Mode(v1alpha1.SlurmMode).
LocalQueue("lq1").
Completions(3).
CreationTimestamp(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
diff --git a/cmd/experimental/kjobctl/pkg/cmd/printcrds/embed/manifest.gz b/cmd/experimental/kjobctl/pkg/cmd/printcrds/embed/manifest.gz
index e9659c8fbd2..8b9e98e165c 100644
Binary files a/cmd/experimental/kjobctl/pkg/cmd/printcrds/embed/manifest.gz and b/cmd/experimental/kjobctl/pkg/cmd/printcrds/embed/manifest.gz differ
diff --git a/cmd/experimental/kjobctl/pkg/cmd/printcrds/printcrds.go b/cmd/experimental/kjobctl/pkg/cmd/printcrds/printcrds.go
index 00552bcdd8f..06f9a5e908e 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/printcrds/printcrds.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/printcrds/printcrds.go
@@ -19,19 +19,22 @@ package printcrds
import (
"bytes"
"compress/gzip"
- _ "embed"
"io"
"github.com/spf13/cobra"
+ "k8s.io/kubectl/pkg/util/templates"
+
+ _ "embed"
)
-const (
- crdsExample = ` # Install or update the kjobctl CRDs
- kjobctl printcrds | kubectl apply --server-side -f -
+var (
+ crdsExample = templates.Examples(`
+ # Install or update the kjobctl CRDs
+ kjobctl printcrds | kubectl apply --server-side -f -
- # Remove the kjobctl CRDs
- kjobctl printcrds | kubectl delete --ignore-not-found=true -f -
- `
+ # Remove the kjobctl CRDs
+ kjobctl printcrds | kubectl delete --ignore-not-found=true -f -
+ `)
)
//go:embed embed/manifest.gz
diff --git a/cmd/experimental/kjobctl/pkg/cmd/testing/fake.go b/cmd/experimental/kjobctl/pkg/cmd/testing/fake.go
index 18eca4ac860..2be6e8bfc32 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/testing/fake.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/testing/fake.go
@@ -29,8 +29,8 @@ import (
"k8s.io/client-go/rest"
"k8s.io/client-go/restmapper"
"k8s.io/client-go/tools/clientcmd"
-
kueueversioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
+
kjobctlversioned "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned"
kjobctlfake "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned/fake"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/util"
@@ -135,12 +135,12 @@ func (cg *TestClientGetter) DynamicClient() (dynamic.Interface, error) {
return cg.dynamicClient, nil
}
-func (f *TestClientGetter) NewResourceBuilder() *resource.Builder {
+func (cg *TestClientGetter) NewResourceBuilder() *resource.Builder {
return resource.NewFakeBuilder(
func(version schema.GroupVersion) (resource.RESTClient, error) {
- return f.restClient, nil
+ return cg.restClient, nil
},
- f.ToRESTMapper,
+ cg.ToRESTMapper,
func() (restmapper.CategoryExpander, error) {
return resource.FakeCategoryExpander, nil
},
diff --git a/cmd/experimental/kjobctl/pkg/cmd/util/client_getter.go b/cmd/experimental/kjobctl/pkg/cmd/util/client_getter.go
index 6b484fc5620..e97d6535679 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/util/client_getter.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/util/client_getter.go
@@ -18,14 +18,16 @@ package util
import (
rayversioned "github.com/ray-project/kuberay/ray-operator/pkg/client/clientset/versioned"
+ "k8s.io/apimachinery/pkg/runtime"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/resource"
"k8s.io/client-go/dynamic"
k8s "k8s.io/client-go/kubernetes"
- _ "k8s.io/client-go/plugin/pkg/client/auth"
-
kueueversioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
+
kjobctlversioned "sigs.k8s.io/kueue/cmd/experimental/kjobctl/client-go/clientset/versioned"
+
+ _ "k8s.io/client-go/plugin/pkg/client/auth"
)
type ClientGetter interface {
@@ -57,6 +59,7 @@ func (cg *clientGetterImpl) K8sClientset() (k8s.Interface, error) {
return nil, err
}
+ config.ContentType = runtime.ContentTypeProtobuf
clientset, err := k8s.NewForConfig(config)
if err != nil {
return nil, err
diff --git a/cmd/experimental/kjobctl/pkg/cmd/util/helpers.go b/cmd/experimental/kjobctl/pkg/cmd/util/helpers.go
index 30630f556f6..4dc6d3d0d2f 100644
--- a/cmd/experimental/kjobctl/pkg/cmd/util/helpers.go
+++ b/cmd/experimental/kjobctl/pkg/cmd/util/helpers.go
@@ -17,9 +17,8 @@ limitations under the License.
package util
import (
- "k8s.io/klog/v2"
-
"github.com/spf13/cobra"
+ "k8s.io/klog/v2"
)
func AddFieldSelectorFlagVar(cmd *cobra.Command, p *string) {
diff --git a/cmd/experimental/kjobctl/pkg/constants/constants.go b/cmd/experimental/kjobctl/pkg/constants/constants.go
index 68c22f3f9db..a243442e470 100644
--- a/cmd/experimental/kjobctl/pkg/constants/constants.go
+++ b/cmd/experimental/kjobctl/pkg/constants/constants.go
@@ -18,6 +18,7 @@ package constants
const (
ProfileLabel = "kjobctl.x-k8s.io/profile"
+ ModeLabel = "kjobctl.x-k8s.io/mode"
)
const (
diff --git a/cmd/experimental/kjobctl/pkg/parser/slurm.go b/cmd/experimental/kjobctl/pkg/parser/slurm.go
index 09ffc08267c..a568b91a3b6 100644
--- a/cmd/experimental/kjobctl/pkg/parser/slurm.go
+++ b/cmd/experimental/kjobctl/pkg/parser/slurm.go
@@ -40,6 +40,7 @@ type ParsedSlurmFlags struct {
Array string
CpusPerTask *resource.Quantity
GpusPerTask map[string]*resource.Quantity
+ MemPerNode *resource.Quantity
MemPerTask *resource.Quantity
MemPerCPU *resource.Quantity
MemPerGPU *resource.Quantity
@@ -96,6 +97,12 @@ func SlurmFlags(script string, ignoreUnknown bool) (ParsedSlurmFlags, error) {
flags.Input = val
case "J", string(v1alpha1.JobNameFlag):
flags.JobName = val
+ case string(v1alpha1.MemPerNodeFlag):
+ memPerNode, err := resource.ParseQuantity(val)
+ if err != nil {
+ return flags, fmt.Errorf("cannot parse '%s': %w", val, err)
+ }
+ flags.MemPerNode = ptr.To(memPerNode)
case string(v1alpha1.MemPerCPUFlag):
memPerCPU, err := resource.ParseQuantity(val)
if err != nil {
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/configmap_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/configmap_wrappers.go
index 2c9ffe597e5..e73e4e28213 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/configmap_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/configmap_wrappers.go
@@ -19,9 +19,10 @@ package wrappers
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
// ConfigMapWrapper wraps a ConfigMap.
@@ -45,11 +46,22 @@ func (w *ConfigMapWrapper) Obj() *corev1.ConfigMap {
return &w.ConfigMap
}
+// WithOwnerReference adds the owner reference.
+func (w *ConfigMapWrapper) WithOwnerReference(ref metav1.OwnerReference) *ConfigMapWrapper {
+ w.OwnerReferences = append(w.OwnerReferences, ref)
+ return w
+}
+
// Profile sets the profile label.
func (w *ConfigMapWrapper) Profile(v string) *ConfigMapWrapper {
return w.Label(constants.ProfileLabel, v)
}
+// Mode sets the profile label.
+func (w *ConfigMapWrapper) Mode(v v1alpha1.ApplicationProfileMode) *ConfigMapWrapper {
+ return w.Label(constants.ModeLabel, string(v))
+}
+
// LocalQueue sets the localqueue label.
func (w *ConfigMapWrapper) LocalQueue(v string) *ConfigMapWrapper {
return w.Label(kueueconstants.QueueLabel, v)
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/container_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/container_wrappers.go
index b22d4e60f76..4d434a55a88 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/container_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/container_wrappers.go
@@ -68,3 +68,15 @@ func (c *ContainerWrapper) WithVolumeMount(volumeMount corev1.VolumeMount) *Cont
c.Container.VolumeMounts = append(c.Container.VolumeMounts, volumeMount)
return c
}
+
+// TTY set tty=true.
+func (c *ContainerWrapper) TTY() *ContainerWrapper {
+ c.Container.TTY = true
+ return c
+}
+
+// Stdin set stdin=true.
+func (c *ContainerWrapper) Stdin() *ContainerWrapper {
+ c.Container.Stdin = true
+ return c
+}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/job_template_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/job_template_wrappers.go
index fbd1704de2e..ef82ac3cca4 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/job_template_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/job_template_wrappers.go
@@ -47,19 +47,19 @@ func (j *JobTemplateWrapper) Obj() *v1alpha1.JobTemplate {
// Label sets the label key and value.
func (j *JobTemplateWrapper) Label(key, value string) *JobTemplateWrapper {
- if j.Labels == nil {
- j.Labels = make(map[string]string)
+ if j.Template.ObjectMeta.Labels == nil {
+ j.Template.ObjectMeta.Labels = make(map[string]string)
}
- j.ObjectMeta.Labels[key] = value
+ j.Template.ObjectMeta.Labels[key] = value
return j
}
// Annotation sets the label key and value.
func (j *JobTemplateWrapper) Annotation(key, value string) *JobTemplateWrapper {
- if j.Annotations == nil {
- j.Annotations = make(map[string]string)
+ if j.Template.ObjectMeta.Annotations == nil {
+ j.Template.ObjectMeta.Annotations = make(map[string]string)
}
- j.ObjectMeta.Annotations[key] = value
+ j.Template.ObjectMeta.Annotations[key] = value
return j
}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/job_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/job_wrappers.go
index b202e7623cc..9c36b951455 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/job_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/job_wrappers.go
@@ -24,9 +24,10 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
// JobWrapper wraps a Job.
@@ -68,6 +69,12 @@ func (j *JobWrapper) CompletionMode(completionMode batchv1.CompletionMode) *JobW
return j
}
+// Subdomain updates pod template subdomain.
+func (j *JobWrapper) Subdomain(subdomain string) *JobWrapper {
+ j.Job.Spec.Template.Spec.Subdomain = subdomain
+ return j
+}
+
// Parallelism updates job parallelism.
func (j *JobWrapper) Parallelism(v int32) *JobWrapper {
j.Job.Spec.Parallelism = ptr.To(v)
@@ -79,6 +86,16 @@ func (j *JobWrapper) Profile(v string) *JobWrapper {
return j.Label(constants.ProfileLabel, v)
}
+// Priority sets the workload priority class label.
+func (j *JobWrapper) Priority(v string) *JobWrapper {
+ return j.Label(kueueconstants.WorkloadPriorityClassLabel, v)
+}
+
+// Mode sets the profile label.
+func (j *JobWrapper) Mode(v v1alpha1.ApplicationProfileMode) *JobWrapper {
+ return j.Label(constants.ModeLabel, string(v))
+}
+
// LocalQueue sets the localqueue label.
func (j *JobWrapper) LocalQueue(v string) *JobWrapper {
return j.Label(kueueconstants.QueueLabel, v)
@@ -108,6 +125,12 @@ func (j *JobWrapper) WithContainer(container corev1.Container) *JobWrapper {
return j
}
+// WithInitContainer add init container on the pod template.
+func (j *JobWrapper) WithInitContainer(initContainer corev1.Container) *JobWrapper {
+ j.Job.Spec.Template.Spec.InitContainers = append(j.Job.Spec.Template.Spec.InitContainers, initContainer)
+ return j
+}
+
// WithVolume add volume.
func (j *JobWrapper) WithVolume(volume corev1.Volume) *JobWrapper {
j.Job.Spec.Template.Spec.Volumes = append(j.Job.Spec.Template.Spec.Volumes, volume)
@@ -116,10 +139,6 @@ func (j *JobWrapper) WithVolume(volume corev1.Volume) *JobWrapper {
// WithEnvVar add env var to the container template.
func (j *JobWrapper) WithEnvVar(envVar corev1.EnvVar) *JobWrapper {
- for index := range j.Job.Spec.Template.Spec.InitContainers {
- j.Job.Spec.Template.Spec.InitContainers[index].Env =
- append(j.Job.Spec.Template.Spec.InitContainers[index].Env, envVar)
- }
for index := range j.Job.Spec.Template.Spec.Containers {
j.Job.Spec.Template.Spec.Containers[index].Env =
append(j.Job.Spec.Template.Spec.Containers[index].Env, envVar)
@@ -129,10 +148,6 @@ func (j *JobWrapper) WithEnvVar(envVar corev1.EnvVar) *JobWrapper {
// WithEnvVarIndexValue add env var to the container template with index value.
func (j *JobWrapper) WithEnvVarIndexValue(name string) *JobWrapper {
- for index := range j.Job.Spec.Template.Spec.InitContainers {
- j.Job.Spec.Template.Spec.InitContainers[index].Env = append(j.Job.Spec.Template.Spec.InitContainers[index].Env,
- corev1.EnvVar{Name: name, Value: strconv.Itoa(index)})
- }
for index := range j.Job.Spec.Template.Spec.Containers {
j.Job.Spec.Template.Spec.Containers[index].Env = append(j.Job.Spec.Template.Spec.Containers[index].Env,
corev1.EnvVar{Name: name, Value: strconv.Itoa(index)})
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_template_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_template_wrappers.go
index d76381ef254..8be66833cb5 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_template_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_template_wrappers.go
@@ -48,19 +48,19 @@ func (p *PodTemplateWrapper) Clone() *PodTemplateWrapper {
// Label sets the label key and value.
func (p *PodTemplateWrapper) Label(key, value string) *PodTemplateWrapper {
- if p.Labels == nil {
- p.Labels = make(map[string]string)
+ if p.Template.ObjectMeta.Labels == nil {
+ p.Template.ObjectMeta.Labels = make(map[string]string)
}
- p.ObjectMeta.Labels[key] = value
+ p.Template.ObjectMeta.Labels[key] = value
return p
}
// Annotation sets the label key and value.
func (p *PodTemplateWrapper) Annotation(key, value string) *PodTemplateWrapper {
- if p.Annotations == nil {
- p.Annotations = make(map[string]string)
+ if p.Template.ObjectMeta.Annotations == nil {
+ p.Template.ObjectMeta.Annotations = make(map[string]string)
}
- p.ObjectMeta.Annotations[key] = value
+ p.Template.ObjectMeta.Annotations[key] = value
return p
}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_wrappers.go
index b910e7622db..f05c6369cc9 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/pod_wrappers.go
@@ -21,9 +21,10 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
// PodWrapper wraps a Pod.
@@ -55,6 +56,11 @@ func (j *PodWrapper) Profile(v string) *PodWrapper {
return j.Label(constants.ProfileLabel, v)
}
+// Mode sets the profile label.
+func (j *PodWrapper) Mode(v v1alpha1.ApplicationProfileMode) *PodWrapper {
+ return j.Label(constants.ModeLabel, string(v))
+}
+
// LocalQueue sets the localqueue label.
func (j *PodWrapper) LocalQueue(v string) *PodWrapper {
return j.Label(kueueconstants.QueueLabel, v)
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_spec_wrapper.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_spec_wrapper.go
index 4be5a187c91..1d247798730 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_spec_wrapper.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_spec_wrapper.go
@@ -19,6 +19,7 @@ package wrappers
import (
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
corev1 "k8s.io/api/core/v1"
+ "k8s.io/utils/ptr"
)
// RayClusterSpecWrapper wraps a RayClusterSpec.
@@ -183,3 +184,9 @@ func (w *RayClusterSpecWrapper) MaxReplicas(groupName string, maxReplicas int32)
return w
}
+
+// Suspend set suspend.
+func (w *RayClusterSpecWrapper) Suspend(suspend bool) *RayClusterSpecWrapper {
+ w.RayClusterSpec.Suspend = ptr.To(suspend)
+ return w
+}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_template_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_template_wrappers.go
index 256315db7ba..bc3459dad73 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_template_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_template_wrappers.go
@@ -52,19 +52,19 @@ func (w *RayClusterTemplateWrapper) Clone() *RayClusterTemplateWrapper {
// Label sets the label key and value.
func (w *RayClusterTemplateWrapper) Label(key, value string) *RayClusterTemplateWrapper {
- if w.Labels == nil {
- w.Labels = make(map[string]string)
+ if w.Template.ObjectMeta.Labels == nil {
+ w.Template.ObjectMeta.Labels = make(map[string]string)
}
- w.ObjectMeta.Labels[key] = value
+ w.Template.ObjectMeta.Labels[key] = value
return w
}
// Annotation sets the label key and value.
func (w *RayClusterTemplateWrapper) Annotation(key, value string) *RayClusterTemplateWrapper {
- if w.Annotations == nil {
- w.Annotations = make(map[string]string)
+ if w.Template.ObjectMeta.Annotations == nil {
+ w.Template.ObjectMeta.Annotations = make(map[string]string)
}
- w.ObjectMeta.Annotations[key] = value
+ w.Template.ObjectMeta.Annotations[key] = value
return w
}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_wrappers.go
index 1c76f1d6565..60072127a25 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_cluster_wrappers.go
@@ -22,9 +22,10 @@ import (
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
// RayClusterWrapper wraps a RayCluster.
@@ -65,6 +66,11 @@ func (j *RayClusterWrapper) Profile(v string) *RayClusterWrapper {
return j.Label(constants.ProfileLabel, v)
}
+// Mode sets the profile label.
+func (j *RayClusterWrapper) Mode(v v1alpha1.ApplicationProfileMode) *RayClusterWrapper {
+ return j.Label(constants.ModeLabel, string(v))
+}
+
// LocalQueue sets the localqueue label.
func (j *RayClusterWrapper) LocalQueue(v string) *RayClusterWrapper {
return j.Label(kueueconstants.QueueLabel, v)
@@ -106,6 +112,12 @@ func (j *RayClusterWrapper) DesiredWorkerReplicas(desiredWorkerReplicas int32) *
return j
}
+// ReadyWorkerReplicas set ReadyWorkerReplicas.
+func (j *RayClusterWrapper) ReadyWorkerReplicas(readyWorkerReplicas int32) *RayClusterWrapper {
+ j.RayCluster.Status.ReadyWorkerReplicas = readyWorkerReplicas
+ return j
+}
+
// AvailableWorkerReplicas set AvailableWorkerReplicas.
func (j *RayClusterWrapper) AvailableWorkerReplicas(availableWorkerReplicas int32) *RayClusterWrapper {
j.RayCluster.Status.AvailableWorkerReplicas = availableWorkerReplicas
@@ -130,8 +142,32 @@ func (j *RayClusterWrapper) DesiredGPU(desiredGPU resource.Quantity) *RayCluster
return j
}
+// DesiredTPU set DesiredTPU.
+func (j *RayClusterWrapper) DesiredTPU(desiredTPU resource.Quantity) *RayClusterWrapper {
+ j.RayCluster.Status.DesiredTPU = desiredTPU
+ return j
+}
+
+// MinWorkerReplicas set MinWorkerReplicas.
+func (j *RayClusterWrapper) MinWorkerReplicas(minWorkerReplicas int32) *RayClusterWrapper {
+ j.RayCluster.Status.MinWorkerReplicas = minWorkerReplicas
+ return j
+}
+
+// MaxWorkerReplicas set MaxWorkerReplicas.
+func (j *RayClusterWrapper) MaxWorkerReplicas(maxWorkerReplicas int32) *RayClusterWrapper {
+ j.RayCluster.Status.MaxWorkerReplicas = maxWorkerReplicas
+ return j
+}
+
// State set State.
func (j *RayClusterWrapper) State(state rayv1.ClusterState) *RayClusterWrapper {
j.RayCluster.Status.State = state
return j
}
+
+// Reason set Reason.
+func (j *RayClusterWrapper) Reason(reason string) *RayClusterWrapper {
+ j.RayCluster.Status.Reason = reason
+ return j
+}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_template_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_template_wrappers.go
index 1ea37c42628..cacd4e09aba 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_template_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_template_wrappers.go
@@ -52,19 +52,19 @@ func (w *RayJobTemplateWrapper) Clone() *RayJobTemplateWrapper {
// Label sets the label key and value.
func (w *RayJobTemplateWrapper) Label(key, value string) *RayJobTemplateWrapper {
- if w.Labels == nil {
- w.Labels = make(map[string]string)
+ if w.Template.ObjectMeta.Labels == nil {
+ w.Template.ObjectMeta.Labels = make(map[string]string)
}
- w.ObjectMeta.Labels[key] = value
+ w.Template.ObjectMeta.Labels[key] = value
return w
}
// Annotation sets the label key and value.
func (w *RayJobTemplateWrapper) Annotation(key, value string) *RayJobTemplateWrapper {
- if w.Annotations == nil {
- w.Annotations = make(map[string]string)
+ if w.Template.ObjectMeta.Annotations == nil {
+ w.Template.ObjectMeta.Annotations = make(map[string]string)
}
- w.ObjectMeta.Annotations[key] = value
+ w.Template.ObjectMeta.Annotations[key] = value
return w
}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_wrappers.go
index 055d06c6fa8..d93ff4f0847 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_wrappers.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/ray_job_wrappers.go
@@ -23,9 +23,10 @@ import (
rayutil "github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
// RayJobWrapper wraps a RayJob.
@@ -66,6 +67,11 @@ func (j *RayJobWrapper) Profile(v string) *RayJobWrapper {
return j.Label(constants.ProfileLabel, v)
}
+// Mode sets the profile label.
+func (j *RayJobWrapper) Mode(v v1alpha1.ApplicationProfileMode) *RayJobWrapper {
+ return j.Label(constants.ModeLabel, string(v))
+}
+
// LocalQueue sets the localqueue label.
func (j *RayJobWrapper) LocalQueue(v string) *RayJobWrapper {
return j.Label(kueueconstants.QueueLabel, v)
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/service_wrappers.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/service_wrappers.go
new file mode 100644
index 00000000000..8a2abba24ae
--- /dev/null
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/service_wrappers.go
@@ -0,0 +1,92 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package wrappers
+
+import (
+ corev1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
+
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
+)
+
+// ServiceWrapper wraps a Service.
+type ServiceWrapper struct{ corev1.Service }
+
+// MakeService creates a wrapper for a Service
+func MakeService(name, ns string) *ServiceWrapper {
+ return &ServiceWrapper{
+ corev1.Service{
+ TypeMeta: metav1.TypeMeta{Kind: "Service", APIVersion: "v1"},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: name,
+ Namespace: ns,
+ },
+ },
+ }
+}
+
+// Obj returns the inner Service.
+func (w *ServiceWrapper) Obj() *corev1.Service {
+ return &w.Service
+}
+
+// Profile sets the profile label.
+func (w *ServiceWrapper) Profile(v string) *ServiceWrapper {
+ return w.Label(constants.ProfileLabel, v)
+}
+
+// Mode sets the mode label.
+func (w *ServiceWrapper) Mode(v v1alpha1.ApplicationProfileMode) *ServiceWrapper {
+ return w.Label(constants.ModeLabel, string(v))
+}
+
+// LocalQueue sets the localqueue label.
+func (w *ServiceWrapper) LocalQueue(v string) *ServiceWrapper {
+ return w.Label(kueueconstants.QueueLabel, v)
+}
+
+// Label sets the label key and value.
+func (w *ServiceWrapper) Label(key, value string) *ServiceWrapper {
+ if w.Labels == nil {
+ w.Labels = make(map[string]string)
+ }
+ w.ObjectMeta.Labels[key] = value
+ return w
+}
+
+// ClusterIP sets clusterIP.
+func (w *ServiceWrapper) ClusterIP(clusterIP string) *ServiceWrapper {
+ w.Service.Spec.ClusterIP = clusterIP
+ return w
+}
+
+// Selector sets the selector key and value.
+func (w *ServiceWrapper) Selector(key, value string) *ServiceWrapper {
+ if w.Service.Spec.Selector == nil {
+ w.Service.Spec.Selector = make(map[string]string)
+ }
+ w.Service.Spec.Selector[key] = value
+ return w
+}
+
+// WithOwnerReference adds the owner reference.
+func (w *ServiceWrapper) WithOwnerReference(ref metav1.OwnerReference) *ServiceWrapper {
+ w.OwnerReferences = append(w.OwnerReferences, ref)
+ return w
+}
diff --git a/cmd/experimental/kjobctl/pkg/testing/wrappers/worker_group_spec_wrapper.go b/cmd/experimental/kjobctl/pkg/testing/wrappers/worker_group_spec_wrapper.go
index 88b8d7c8e7c..23f4c3dd394 100644
--- a/cmd/experimental/kjobctl/pkg/testing/wrappers/worker_group_spec_wrapper.go
+++ b/cmd/experimental/kjobctl/pkg/testing/wrappers/worker_group_spec_wrapper.go
@@ -86,3 +86,9 @@ func (w *WorkerGroupSpecWrapper) MaxReplicas(maxReplicas int32) *WorkerGroupSpec
w.WorkerGroupSpec.MaxReplicas = &maxReplicas
return w
}
+
+// RayStartParams set rayStartParams on WorkerGroupSpec.
+func (w *WorkerGroupSpecWrapper) RayStartParams(rayStartParams map[string]string) *WorkerGroupSpecWrapper {
+ w.WorkerGroupSpec.RayStartParams = rayStartParams
+ return w
+}
diff --git a/cmd/experimental/kjobctl/test/integration/kjobctl/create_test.go b/cmd/experimental/kjobctl/test/integration/kjobctl/create_test.go
index ccc1f770b6c..e6e75432795 100644
--- a/cmd/experimental/kjobctl/test/integration/kjobctl/create_test.go
+++ b/cmd/experimental/kjobctl/test/integration/kjobctl/create_test.go
@@ -30,13 +30,13 @@ import (
testingclock "k8s.io/utils/clock/testing"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
+ kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/constants"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/test/util"
- kueueconstants "sigs.k8s.io/kueue/pkg/controller/constants"
)
var _ = ginkgo.Describe("Kjobctl Create", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
@@ -94,6 +94,7 @@ var _ = ginkgo.Describe("Kjobctl Create", ginkgo.Ordered, ginkgo.ContinueOnFailu
"--completions", "3",
"--request", "cpu=100m,memory=4Gi",
"--localqueue", "lq1",
+ "--skip-localqueue-validation",
})
err := kjobctlCmd.Execute()
diff --git a/cmd/experimental/kjobctl/test/integration/kjobctl/list_test.go b/cmd/experimental/kjobctl/test/integration/kjobctl/list_test.go
index 6925878f0eb..cae7e9c8809 100644
--- a/cmd/experimental/kjobctl/test/integration/kjobctl/list_test.go
+++ b/cmd/experimental/kjobctl/test/integration/kjobctl/list_test.go
@@ -31,6 +31,7 @@ import (
"k8s.io/cli-runtime/pkg/genericiooptions"
testingclock "k8s.io/utils/clock/testing"
+ "sigs.k8s.io/kueue/cmd/experimental/kjobctl/apis/v1alpha1"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/cmd/list"
"sigs.k8s.io/kueue/cmd/experimental/kjobctl/pkg/testing/wrappers"
@@ -60,6 +61,7 @@ var _ = ginkgo.Describe("Kjobctl List", ginkgo.Ordered, ginkgo.ContinueOnFailure
ginkgo.JustBeforeEach(func() {
j1 = wrappers.MakeJob("j1", ns.Name).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
Completions(3).
WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
RestartPolicy(corev1.RestartPolicyOnFailure).
@@ -68,6 +70,7 @@ var _ = ginkgo.Describe("Kjobctl List", ginkgo.Ordered, ginkgo.ContinueOnFailure
j2 = wrappers.MakeJob("j2", ns.Name).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
Completions(3).
WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
RestartPolicy(corev1.RestartPolicyOnFailure).
@@ -76,6 +79,7 @@ var _ = ginkgo.Describe("Kjobctl List", ginkgo.Ordered, ginkgo.ContinueOnFailure
j3 = wrappers.MakeJob("very-long-job-name", ns.Name).
Profile("profile1").
+ Mode(v1alpha1.JobMode).
Completions(3).
WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
RestartPolicy(corev1.RestartPolicyOnFailure).
@@ -277,4 +281,66 @@ very-long-ray-cluster-name profile1 0 0
)))
})
})
+
+ ginkgo.When("List Slurm Jobs", func() {
+ var (
+ j1 *batchv1.Job
+ j2 *batchv1.Job
+ j3 *batchv1.Job
+ )
+
+ ginkgo.JustBeforeEach(func() {
+ j1 = wrappers.MakeJob("j1", ns.Name).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ Completions(3).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
+ RestartPolicy(corev1.RestartPolicyOnFailure).
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, j1)).To(gomega.Succeed())
+
+ j2 = wrappers.MakeJob("j2", ns.Name).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ Completions(3).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
+ RestartPolicy(corev1.RestartPolicyOnFailure).
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, j2)).To(gomega.Succeed())
+
+ j3 = wrappers.MakeJob("very-long-job-name", ns.Name).
+ Profile("profile1").
+ Mode(v1alpha1.SlurmMode).
+ Completions(3).
+ WithContainer(*wrappers.MakeContainer("c1", "sleep").Obj()).
+ RestartPolicy(corev1.RestartPolicyOnFailure).
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, j3)).To(gomega.Succeed())
+ })
+
+ // Simple client set that are using on unit tests not allow paging.
+ ginkgo.It("Should print slurm jobs list with paging", func() {
+ streams, _, output, errOutput := genericiooptions.NewTestIOStreams()
+ configFlags := CreateConfigFlagsWithRestConfig(cfg, streams)
+ executeTime := time.Now()
+ kjobctl := cmd.NewKjobctlCmd(cmd.KjobctlOptions{ConfigFlags: configFlags, IOStreams: streams,
+ Clock: testingclock.NewFakeClock(executeTime)})
+
+ os.Setenv(list.KjobctlListRequestLimitEnvName, "1")
+ kjobctl.SetArgs([]string{"list", "slurm", "--namespace", ns.Name})
+ err := kjobctl.Execute()
+
+ gomega.Expect(err).NotTo(gomega.HaveOccurred(), "%s: %s", err, output)
+ gomega.Expect(errOutput.String()).Should(gomega.BeEmpty())
+ gomega.Expect(output.String()).Should(gomega.Equal(fmt.Sprintf(`NAME PROFILE LOCAL QUEUE COMPLETIONS DURATION AGE
+j1 profile1 0/3 %s
+j2 profile1 0/3 %s
+very-long-job-name profile1 0/3 %s
+`,
+ duration.HumanDuration(executeTime.Sub(j1.CreationTimestamp.Time)),
+ duration.HumanDuration(executeTime.Sub(j2.CreationTimestamp.Time)),
+ duration.HumanDuration(executeTime.Sub(j3.CreationTimestamp.Time)),
+ )))
+ })
+ })
})
diff --git a/cmd/experimental/podtaintstolerations/go.mod b/cmd/experimental/podtaintstolerations/go.mod
index 401bc254036..da826178e69 100644
--- a/cmd/experimental/podtaintstolerations/go.mod
+++ b/cmd/experimental/podtaintstolerations/go.mod
@@ -3,30 +3,15 @@ module podtaintstolerations
go 1.20
require (
- github.com/go-logr/logr v1.2.4
- github.com/google/go-cmp v0.5.9
- github.com/kubeflow/common v0.4.7
- github.com/kubeflow/mpi-operator v0.4.0
- github.com/kubeflow/training-operator v1.7.0-rc.0
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.10
- github.com/open-policy-agent/cert-controller v0.8.0
- github.com/prometheus/client_golang v1.16.0
- github.com/prometheus/client_model v0.4.0
- github.com/ray-project/kuberay/ray-operator v0.0.0-20230613204710-aeed3cdcbdcc
go.uber.org/zap v1.25.0
k8s.io/api v0.27.5
k8s.io/apimachinery v0.27.5
- k8s.io/apiserver v0.27.5
k8s.io/client-go v0.27.5
- k8s.io/code-generator v0.27.5
- k8s.io/component-base v0.27.5
- k8s.io/component-helpers v0.27.5
- k8s.io/klog/v2 v2.100.1
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.15.0
- sigs.k8s.io/jobset v0.2.2
- sigs.k8s.io/structured-merge-diff/v4 v4.3.0
+ sigs.k8s.io/kueue v0.4.1
)
require (
@@ -38,6 +23,7 @@ require (
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
+ github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
@@ -47,6 +33,7 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect
github.com/google/uuid v1.3.0 // indirect
@@ -59,13 +46,12 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
- github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.11.0 // indirect
@@ -80,9 +66,11 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.27.4 // indirect
- k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
+ k8s.io/apiserver v0.27.5 // indirect
+ k8s.io/component-base v0.27.5 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
- sigs.k8s.io/kueue v0.4.1 // indirect
+ sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/cmd/experimental/podtaintstolerations/go.sum b/cmd/experimental/podtaintstolerations/go.sum
index fbd6134c8b9..bff192fa26d 100644
--- a/cmd/experimental/podtaintstolerations/go.sum
+++ b/cmd/experimental/podtaintstolerations/go.sum
@@ -39,7 +39,6 @@ github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -86,7 +85,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20230323073829-e72429f035bd h1:r8yyd+DJDmsUhGrRBxH5Pj7KeFK5l+Y3FsgT8keqKtk=
@@ -113,11 +111,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubeflow/common v0.4.7 h1:zz6QS4k2u2FY838M/FjOtwjJq39MRZVZcvPahRYL97M=
-github.com/kubeflow/common v0.4.7/go.mod h1:43MAof/uhpJA2C0urynqatE3oKFQc7m2HLmJty7waqY=
github.com/kubeflow/mpi-operator v0.4.0 h1:PS4jLoMuRyrk/DHuYkI0D46sQQYpQt375HjOV4KVMFs=
-github.com/kubeflow/mpi-operator v0.4.0/go.mod h1:/A4mTy/RYh2UIgaGUiXUaW70eThjsogu80WbbcZpuMg=
-github.com/kubeflow/training-operator v1.7.0-rc.0 h1:FsOxEKg23XyGD2rgO06rIobdDOqtsP6R6o9ust8Jwi8=
-github.com/kubeflow/training-operator v1.7.0-rc.0/go.mod h1:BZCLX1h06wY3YSeSZZcGYAqI9/nVi7isVCRkfgZe9nE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
@@ -133,9 +127,6 @@ github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI
github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
-github.com/open-policy-agent/cert-controller v0.8.0 h1:pao3WCLsKGz5dSWSlNUFrNFQdXtVTQ3lVDgk2IelH34=
-github.com/open-policy-agent/cert-controller v0.8.0/go.mod h1:alotCQRwX4M6VEwEgO53FB6nGLSlvah6L0pWxSRslIk=
-github.com/open-policy-agent/frameworks/constraint v0.0.0-20230411224310-3f237e2710fa h1:1r6gnPhbsswSIem/Fa11fKo/MhjijzvqSxWIu+3HQeY=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -151,11 +142,8 @@ github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/ray-project/kuberay/ray-operator v0.0.0-20230613204710-aeed3cdcbdcc h1:CnnZaXpwO5kYXet1K06sHzU+exg0g4wjW0gIKxCUlp0=
-github.com/ray-project/kuberay/ray-operator v0.0.0-20230613204710-aeed3cdcbdcc/go.mod h1:2auArgwD9dXXJz1oc7SqQ4U/rHdpwnrBwG98kr8OWXA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
-github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
-github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
@@ -169,8 +157,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
@@ -179,8 +167,6 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
-go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
@@ -201,7 +187,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
-golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -237,7 +222,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -259,7 +243,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
@@ -329,32 +312,22 @@ k8s.io/apiserver v0.27.5 h1:HUP50yjA+X8YiXzxaz6hpFc7cfsx17bAreOZKbpChLo=
k8s.io/apiserver v0.27.5/go.mod h1:HYUembDZJMisyctQRJzQFxRKEGzL+IKeD2UdTcy4OIM=
k8s.io/client-go v0.27.5 h1:sH/fkqzk35kuf0GPx+dZuN7fhEswBSAVCrWFq3E1km0=
k8s.io/client-go v0.27.5/go.mod h1:u+IKnqPZSPw51snIMKiIAV8LQQ+hya5bvxpOOPTUXPI=
-k8s.io/code-generator v0.27.5 h1:LhcKmQrCwJCL2zGDvY7bT6G56C1yFxPEv/fXicYUHD0=
-k8s.io/code-generator v0.27.5/go.mod h1:DPung1sI5vBgn4AGKtlPRQAyagj/ir/4jI55ipZHVww=
k8s.io/component-base v0.27.5 h1:IXo80yOVx7qXG2g1loPpo2g1HUK3CnxNpq9LtGmXAmM=
k8s.io/component-base v0.27.5/go.mod h1:AGJyFHmaxplY4C4lu18UrJBNHcxdv0o6jOL/+HcC0S0=
-k8s.io/component-helpers v0.27.5 h1:V966SPo7cVdxkKs0tfuHao7GNSM8H+krlg3rKGiKjeo=
-k8s.io/component-helpers v0.27.5/go.mod h1:DysJsLaHI3yPgDi1KF7dROTf7gm7BPQgxIbuXYd8sQk=
-k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08=
-k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
-k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-aggregator v0.27.2 h1:jfHoPip+qN/fn3OcrYs8/xMuVYvkJHKo0H0DYciqdns=
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU=
sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
-sigs.k8s.io/jobset v0.2.2 h1:Q4gsvvDsCv9c3c1RTVmJUeT6Eq3V4lAz2U/HXgnQpYc=
-sigs.k8s.io/jobset v0.2.2/go.mod h1:TtoXVVVihyYvZoefYtpVDeLzJVI9wsPHEB8b9xTgex4=
+sigs.k8s.io/jobset v0.2.0 h1:f23L31QZM5c/5NdDtObdZ439gQ4At/+g690pPCvPbj0=
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/kueue v0.4.1 h1:qFUVHs/zyqEcqfQ3IfKO5xbjzIM18lKcyr8Ku9gTREE=
sigs.k8s.io/kueue v0.4.1/go.mod h1:NwenpoTff0l634tlrXS45khrhcZJMmANdqafYP0PukM=
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk=
sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
-sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
diff --git a/cmd/kueue/main.go b/cmd/kueue/main.go
index 3fbe6b873ce..b986e6bfdb6 100644
--- a/cmd/kueue/main.go
+++ b/cmd/kueue/main.go
@@ -23,11 +23,6 @@ import (
"net/http"
"os"
- // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
- // to ensure that exec-entrypoint and run can make use of them.
- _ "k8s.io/client-go/plugin/pkg/client/auth"
- "k8s.io/client-go/util/flowcontrol"
-
zaplog "go.uber.org/zap"
"go.uber.org/zap/zapcore"
corev1 "k8s.io/api/core/v1"
@@ -39,6 +34,7 @@ import (
"k8s.io/client-go/discovery"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
+ "k8s.io/client-go/util/flowcontrol"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
@@ -67,6 +63,9 @@ import (
"sigs.k8s.io/kueue/pkg/visibility"
"sigs.k8s.io/kueue/pkg/webhooks"
+ // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
+ // to ensure that exec-entrypoint and run can make use of them.
+ _ "k8s.io/client-go/plugin/pkg/client/auth"
// Ensure linking of the job controllers.
_ "sigs.k8s.io/kueue/pkg/controller/jobs"
)
diff --git a/hack/internal/tools/kueuectl-docs/generators/doc.go b/cmd/kueuectl-docs/generators/doc.go
similarity index 100%
rename from hack/internal/tools/kueuectl-docs/generators/doc.go
rename to cmd/kueuectl-docs/generators/doc.go
diff --git a/hack/internal/tools/kueuectl-docs/main.go b/cmd/kueuectl-docs/main.go
similarity index 95%
rename from hack/internal/tools/kueuectl-docs/main.go
rename to cmd/kueuectl-docs/main.go
index 73db6b1d750..fdd31064c9d 100644
--- a/hack/internal/tools/kueuectl-docs/main.go
+++ b/cmd/kueuectl-docs/main.go
@@ -24,8 +24,8 @@ import (
"github.com/spf13/pflag"
cliflag "k8s.io/component-base/cli/flag"
+ "sigs.k8s.io/kueue/cmd/kueuectl-docs/generators"
"sigs.k8s.io/kueue/cmd/kueuectl/app"
- "sigs.k8s.io/kueue/internal/tools/kueuectl-docs/generators"
)
func main() {
diff --git a/hack/internal/tools/kueuectl-docs/templates/main.html b/cmd/kueuectl-docs/templates/main.html
similarity index 87%
rename from hack/internal/tools/kueuectl-docs/templates/main.html
rename to cmd/kueuectl-docs/templates/main.html
index f19de0f694e..e1babc553d3 100644
--- a/hack/internal/tools/kueuectl-docs/templates/main.html
+++ b/cmd/kueuectl-docs/templates/main.html
@@ -7,7 +7,7 @@
{{ html ``}}
## Synopsis
diff --git a/hack/internal/tools/kueuectl-docs/templates/options.html b/cmd/kueuectl-docs/templates/options.html
similarity index 100%
rename from hack/internal/tools/kueuectl-docs/templates/options.html
rename to cmd/kueuectl-docs/templates/options.html
diff --git a/cmd/kueuectl/app/cmd.go b/cmd/kueuectl/app/cmd.go
index a9c821dd6e1..ffb4235d2d9 100644
--- a/cmd/kueuectl/app/cmd.go
+++ b/cmd/kueuectl/app/cmd.go
@@ -17,7 +17,6 @@ limitations under the License.
package app
import (
- "fmt"
"os"
"github.com/spf13/cobra"
@@ -80,15 +79,8 @@ func NewKueuectlCmd(o KueuectlOptions) *cobra.Command {
cmd.AddCommand(resume.NewResumeCmd(clientGetter, o.IOStreams))
cmd.AddCommand(stop.NewStopCmd(clientGetter, o.IOStreams))
cmd.AddCommand(list.NewListCmd(clientGetter, o.IOStreams, o.Clock))
+ cmd.AddCommand(passthrough.NewCommands(clientGetter, o.IOStreams)...)
cmd.AddCommand(version.NewVersionCmd(clientGetter, o.IOStreams))
- pCommands, err := passthrough.NewCommands()
- if err != nil {
- // we can still use the other commands, jut push an warning
- fmt.Println(err)
- } else {
- cmd.AddCommand(pCommands...)
- }
-
return cmd
}
diff --git a/cmd/kueuectl/app/completion/completion.go b/cmd/kueuectl/app/completion/completion.go
index 19bd0fe5186..714e8f0167c 100644
--- a/cmd/kueuectl/app/completion/completion.go
+++ b/cmd/kueuectl/app/completion/completion.go
@@ -17,6 +17,7 @@ limitations under the License.
package completion
import (
+ "slices"
"strings"
"github.com/spf13/cobra"
@@ -100,10 +101,6 @@ func UsersFunc(clientGetter util.ClientGetter) func(*cobra.Command, []string, st
func WorkloadNameFunc(clientGetter util.ClientGetter, activeStatus *bool) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- if len(args) > 0 {
- return nil, cobra.ShellCompDirectiveNoFileComp
- }
-
clientSet, err := clientGetter.KueueClientSet()
if err != nil {
return []string{}, cobra.ShellCompDirectiveError
@@ -129,9 +126,11 @@ func WorkloadNameFunc(clientGetter util.ClientGetter, activeStatus *bool) func(*
list.Items = filteredItems
}
- validArgs := make([]string, len(list.Items))
- for i, wl := range list.Items {
- validArgs[i] = wl.Name
+ var validArgs []string
+ for _, wl := range list.Items {
+ if !slices.Contains(args, wl.Name) {
+ validArgs = append(validArgs, wl.Name)
+ }
}
return validArgs, cobra.ShellCompDirectiveNoFileComp
diff --git a/cmd/kueuectl/app/completion/completion_test.go b/cmd/kueuectl/app/completion/completion_test.go
index bf57ddba581..3454f493059 100644
--- a/cmd/kueuectl/app/completion/completion_test.go
+++ b/cmd/kueuectl/app/completion/completion_test.go
@@ -67,26 +67,24 @@ func TestWorkloadNameCompletionFunc(t *testing.T) {
wantNames: []string{"wl2"},
wantDirective: cobra.ShellCompDirectiveNoFileComp,
},
- "shouldn't return workload names because only one argument can be passed": {
+ "should filter workload names": {
objs: []runtime.Object{
utiltesting.MakeWorkload("wl1", metav1.NamespaceDefault).Active(true).Obj(),
utiltesting.MakeWorkload("wl2", metav1.NamespaceDefault).Active(false).Obj(),
},
args: []string{"wl2"},
+ wantNames: []string{"wl1"},
wantDirective: cobra.ShellCompDirectiveNoFileComp,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
- tf := cmdtesting.NewTestClientGetter()
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(fake.NewSimpleClientset(tc.objs...))
if len(tc.ns) > 0 {
- tf.WithNamespace(tc.ns)
+ tcg.WithNamespace(tc.ns)
}
- clientset := fake.NewSimpleClientset(tc.objs...)
- tf.KueueClientset = clientset
-
- complFn := WorkloadNameFunc(tf, tc.status)
+ complFn := WorkloadNameFunc(tcg, tc.status)
names, directive := complFn(&cobra.Command{}, tc.args, tc.toComplete)
if diff := cmp.Diff(tc.wantNames, names); diff != "" {
t.Errorf("Unexpected names (-want/+got)\n%s", diff)
@@ -150,15 +148,12 @@ func TestClusterQueueNameCompletionFunc(t *testing.T) {
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
- tf := cmdtesting.NewTestClientGetter()
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(fake.NewSimpleClientset(tc.objs...))
if len(tc.ns) > 0 {
- tf.WithNamespace(tc.ns)
+ tcg.WithNamespace(tc.ns)
}
- clientset := fake.NewSimpleClientset(tc.objs...)
- tf.KueueClientset = clientset
-
- complFn := ClusterQueueNameFunc(tf, tc.status)
+ complFn := ClusterQueueNameFunc(tcg, tc.status)
names, directive := complFn(&cobra.Command{}, tc.args, tc.toComplete)
if diff := cmp.Diff(tc.wantNames, names); diff != "" {
t.Errorf("Unexpected names (-want/+got)\n%s", diff)
@@ -221,15 +216,12 @@ func TestLocalQueueNameCompletionFunc(t *testing.T) {
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
- tf := cmdtesting.NewTestClientGetter()
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(fake.NewSimpleClientset(tc.objs...))
if len(tc.ns) > 0 {
- tf.WithNamespace(tc.ns)
+ tcg.WithNamespace(tc.ns)
}
- clientset := fake.NewSimpleClientset(tc.objs...)
- tf.KueueClientset = clientset
-
- complFn := LocalQueueNameFunc(tf, tc.status)
+ complFn := LocalQueueNameFunc(tcg, tc.status)
names, directive := complFn(&cobra.Command{}, tc.args, tc.toComplete)
if diff := cmp.Diff(tc.wantNames, names); diff != "" {
t.Errorf("Unexpected names (-want/+got)\n%s", diff)
diff --git a/cmd/kueuectl/app/create/create.go b/cmd/kueuectl/app/create/create.go
index cc0939cb913..1fa5443c543 100644
--- a/cmd/kueuectl/app/create/create.go
+++ b/cmd/kueuectl/app/create/create.go
@@ -19,13 +19,16 @@ package create
import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- createExample = ` # Create local queue
- kueuectl create localqueue my-local-queue -c my-cluster-queue`
+var (
+ createExample = templates.Examples(`
+ # Create local queue
+ kueuectl create localqueue my-local-queue -c my-cluster-queue
+ `)
)
func NewCreateCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
diff --git a/cmd/kueuectl/app/create/create_clusterqueue.go b/cmd/kueuectl/app/create/create_clusterqueue.go
index 4f7ecabbf14..d4d5ddd3000 100644
--- a/cmd/kueuectl/app/create/create_clusterqueue.go
+++ b/cmd/kueuectl/app/create/create_clusterqueue.go
@@ -30,6 +30,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
@@ -40,27 +41,6 @@ import (
)
const (
- cqLong = `Creates a ClusterQueue with the given name.`
- cqExample = ` # Create a ClusterQueue
- kueuectl create clusterqueue my-cluster-queue
-
- # Create a ClusterQueue with cohort, namespace selector and other details
- kueuectl create clusterqueue my-cluster-queue \
- --cohort cohortname \
- --queuing-strategy StrictFIFO \
- --namespace-selector fooX=barX,fooY=barY \
- --reclaim-within-cohort Any \
- --preemption-within-cluster-queue LowerPriority
-
- # Create a ClusterQueue with nominal quota and one resource flavor named alpha
- kueuectl create clusterqueue my-cluster-queue --nominal-quota "alpha:cpu=9;memory=36Gi"
-
- # Create a ClusterQueue with multiple resource flavors named alpha and beta
- kueuectl create clusterqueue my-cluster-queue \
- --cohort cohortname \
- --nominal-quota "alpha:cpu=9;memory=36Gi;nvidia.com/gpu=10,beta:cpu=18;memory=72Gi;nvidia.com/gpu=20" \
- --borrowing-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2" \
- --lending-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2"`
cohort = "cohort"
queuingStrategy = "queuing-strategy"
namespaceSelector = "namespace-selector"
@@ -71,6 +51,32 @@ const (
lendingLimit = "lending-limit"
)
+var (
+ cqLong = templates.LongDesc(`Creates a ClusterQueue with the given name.`)
+ cqExample = templates.Examples(`
+ # Create a ClusterQueue
+ kueuectl create clusterqueue my-cluster-queue
+
+ # Create a ClusterQueue with cohort, namespace selector and other details
+ kueuectl create clusterqueue my-cluster-queue \
+ --cohort cohortname \
+ --queuing-strategy StrictFIFO \
+ --namespace-selector fooX=barX,fooY=barY \
+ --reclaim-within-cohort Any \
+ --preemption-within-cluster-queue LowerPriority
+
+ # Create a ClusterQueue with nominal quota and one resource flavor named alpha
+ kueuectl create clusterqueue my-cluster-queue --nominal-quota "alpha:cpu=9;memory=36Gi"
+
+ # Create a ClusterQueue with multiple resource flavors named alpha and beta
+ kueuectl create clusterqueue my-cluster-queue \
+ --cohort cohortname \
+ --nominal-quota "alpha:cpu=9;memory=36Gi;nvidia.com/gpu=10,beta:cpu=18;memory=72Gi;nvidia.com/gpu=20" \
+ --borrowing-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2" \
+ --lending-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2"
+ `)
+)
+
var (
errResourceQuotaNotFound = errors.New("resource quota not found")
errInvalidFlavor = errors.New("invalid flavor")
diff --git a/cmd/kueuectl/app/create/create_localqueue.go b/cmd/kueuectl/app/create/create_localqueue.go
index 9ee8911f628..d005942dc93 100644
--- a/cmd/kueuectl/app/create/create_localqueue.go
+++ b/cmd/kueuectl/app/create/create_localqueue.go
@@ -25,6 +25,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -33,13 +34,15 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- lqLong = `Create a local queue with the given name in the specified namespace.`
- lqExample = ` # Create a local queue
- kueuectl create localqueue my-local-queue -c my-cluster-queue
+var (
+ lqLong = templates.LongDesc(`Create a local queue with the given name in the specified namespace.`)
+ lqExample = templates.Examples(`
+ # Create a local queue
+ kueuectl create localqueue my-local-queue -c my-cluster-queue
- # Create a local queue with unknown cluster queue
- kueuectl create localqueue my-local-queue -c my-cluster-queue -i`
+ # Create a local queue with unknown cluster queue
+ kueuectl create localqueue my-local-queue -c my-cluster-queue -i
+ `)
)
type LocalQueueOptions struct {
diff --git a/cmd/kueuectl/app/create/create_resourceflavor.go b/cmd/kueuectl/app/create/create_resourceflavor.go
index f630f83165b..1824fa34888 100644
--- a/cmd/kueuectl/app/create/create_resourceflavor.go
+++ b/cmd/kueuectl/app/create/create_resourceflavor.go
@@ -30,6 +30,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -37,22 +38,24 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- rfLong = `Create a resource flavor with the given name.`
- rfExample = ` # Create a resource flavor
- kueuectl create resourceflavor my-resource-flavor
+var (
+ rfLong = templates.LongDesc(`Create a resource flavor with the given name.`)
+ rfExample = templates.Examples(`
+ # Create a resource flavor
+ kueuectl create resourceflavor my-resource-flavor
- # Create a resource flavor with labels
- kueuectl create resourceflavor my-resource-flavor \
- --node-labels beta.kubernetes.io/arch=arm64,beta.kubernetes.io/os=linux
+ # Create a resource flavor with labels
+ kueuectl create resourceflavor my-resource-flavor \
+ --node-labels beta.kubernetes.io/arch=arm64,beta.kubernetes.io/os=linux
-# Create a resource flavor with node taints
- kueuectl create resourceflavor my-resource-flavor \
- --node-taints key1=value:NoSchedule,key2:NoExecute
+ # Create a resource flavor with node taints
+ kueuectl create resourceflavor my-resource-flavor \
+ --node-taints key1=value:NoSchedule,key2:NoExecute
-# Create a resource flavor with tolerations
- kueuectl create resourceflavor my-resource-flavor \
- --tolerations key1=value:NoSchedule,key2:NoExecute,key3=value,key4,:PreferNoSchedule`
+ # Create a resource flavor with tolerations
+ kueuectl create resourceflavor my-resource-flavor \
+ --tolerations key1=value:NoSchedule,key2:NoExecute,key3=value,key4,:PreferNoSchedule
+ `)
nodeLabelsFlagName = "node-labels"
nodeTaintsFlagName = "node-taints"
tolerationsFlagName = "tolerations"
diff --git a/cmd/kueuectl/app/create/create_resourceflavor_test.go b/cmd/kueuectl/app/create/create_resourceflavor_test.go
index a5e3c214103..95903f9dc22 100644
--- a/cmd/kueuectl/app/create/create_resourceflavor_test.go
+++ b/cmd/kueuectl/app/create/create_resourceflavor_test.go
@@ -28,6 +28,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/kueuectl/app/testing"
)
@@ -249,6 +250,7 @@ func TestResourceFlavorCmd(t *testing.T) {
"shouldn't create resource flavor with dry-run client": {
rfName: "rf",
args: []string{"--dry-run", "client"},
+ wantRf: &v1beta1.ResourceFlavor{},
wantOut: "resourceflavor.kueue.x-k8s.io/rf created (client dry run)\n",
},
"should create resource flavor": {
@@ -322,9 +324,10 @@ func TestResourceFlavorCmd(t *testing.T) {
t.Run(name, func(t *testing.T) {
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
- tf := cmdtesting.NewTestClientGetter()
+ clientset := fake.NewSimpleClientset()
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(clientset)
- cmd := NewResourceFlavorCmd(tf, streams)
+ cmd := NewResourceFlavorCmd(tcg, streams)
cmd.SetOut(out)
cmd.SetErr(outErr)
cmd.SetArgs(append([]string{tc.rfName}, tc.args...))
@@ -355,7 +358,7 @@ func TestResourceFlavorCmd(t *testing.T) {
t.Errorf("Unexpected output (-want/+got)\n%s", diff)
}
- gotRf, err := tf.KueueClientset.KueueV1beta1().ResourceFlavors().Get(context.Background(), tc.rfName, metav1.GetOptions{})
+ gotRf, err := clientset.KueueV1beta1().ResourceFlavors().Get(context.Background(), tc.rfName, metav1.GetOptions{})
if client.IgnoreNotFound(err) != nil {
t.Error(err)
return
diff --git a/cmd/kueuectl/app/delete/delete_workload.go b/cmd/kueuectl/app/delete/delete_workload.go
new file mode 100644
index 00000000000..c9352da8ed7
--- /dev/null
+++ b/cmd/kueuectl/app/delete/delete_workload.go
@@ -0,0 +1,376 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package delete
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "strings"
+
+ "github.com/spf13/cobra"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/cli-runtime/pkg/genericclioptions"
+ "k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/client-go/dynamic"
+ "k8s.io/kubectl/pkg/util/templates"
+ "k8s.io/utils/ptr"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+
+ "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
+ kueuev1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1beta1"
+ "sigs.k8s.io/kueue/cmd/kueuectl/app/completion"
+ "sigs.k8s.io/kueue/cmd/kueuectl/app/util"
+)
+
+var (
+ wlExample = templates.Examples(`
+ # Delete the Workload
+ kueuectl delete workload my-workload
+ `)
+ wlLong = templates.LongDesc(`
+ If the Workload has associated Jobs, the command will prompt for deletion approval
+ of the affected Jobs, and delete them. The Workload will then be asynchronously
+ deleted by the garbage collector. If there are no associated Jobs, the command will
+ directly delete the Workload.
+ `)
+)
+
+type WorkloadOptions struct {
+ PrintFlags *genericclioptions.PrintFlags
+
+ Names []string
+ Namespace string
+ AllNamespaces bool
+ Confirmed bool
+ DeleteAll bool
+
+ DryRunStrategy util.DryRunStrategy
+
+ Client kueuev1beta1.KueueV1beta1Interface
+ DynamicClient dynamic.Interface
+ RestMapper meta.RESTMapper
+
+ PrintObj printers.ResourcePrinterFunc
+
+ genericiooptions.IOStreams
+}
+
+func NewWorkloadOptions(streams genericiooptions.IOStreams) *WorkloadOptions {
+ return &WorkloadOptions{
+ PrintFlags: genericclioptions.NewPrintFlags("deleted").WithTypeSetter(scheme.Scheme),
+ IOStreams: streams,
+ }
+}
+
+func NewWorkloadCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
+ o := NewWorkloadOptions(streams)
+
+ cmd := &cobra.Command{
+ Use: "workload NAME [--yes] [--all] [--dry-run STRATEGY]",
+ DisableFlagsInUseLine: true,
+ Aliases: []string{"wl"},
+ Short: "Delete the given Workload and its corresponding Job",
+ Long: wlLong,
+ Example: wlExample,
+ ValidArgsFunction: completion.WorkloadNameFunc(clientGetter, ptr.To(true)),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ cmd.SilenceUsage = true
+
+ err := o.Complete(clientGetter, cmd, args)
+ if err != nil {
+ return err
+ }
+
+ return o.Run(cmd.Context())
+ },
+ }
+
+ cmd.Flags().BoolVarP(&o.Confirmed, "yes", "y", false, "Automatic yes to the prompt for deleting the Workload.")
+ cmd.Flags().BoolVar(&o.DeleteAll, "all", false, "Delete all Workloads, in the specified namespace.")
+
+ util.AddAllNamespacesFlagVar(cmd, &o.AllNamespaces)
+ util.AddDryRunFlag(cmd)
+
+ return cmd
+}
+
+// Complete completes all the required options
+func (o *WorkloadOptions) Complete(clientGetter util.ClientGetter, cmd *cobra.Command, args []string) error {
+ o.Names = args
+
+ if !o.DeleteAll && len(o.Names) == 0 {
+ return errors.New("requires at least 1 arg(s), only received 0")
+ }
+
+ if o.DeleteAll && len(o.Names) > 0 {
+ return errors.New("name cannot be provided when a selector is specified")
+ }
+
+ if o.AllNamespaces && len(o.Names) > 0 {
+ return errors.New("a resource cannot be retrieved by name across all namespaces")
+ }
+
+ var err error
+
+ o.Namespace, _, err = clientGetter.ToRawKubeConfigLoader().Namespace()
+ if err != nil {
+ return err
+ }
+
+ o.DryRunStrategy, err = util.GetDryRunStrategy(cmd)
+ if err != nil {
+ return err
+ }
+
+ err = util.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
+ if err != nil {
+ return err
+ }
+
+ printer, err := o.PrintFlags.ToPrinter()
+ if err != nil {
+ return err
+ }
+
+ o.PrintObj = printer.PrintObj
+
+ clientset, err := clientGetter.KueueClientSet()
+ if err != nil {
+ return err
+ }
+
+ o.Client = clientset.KueueV1beta1()
+
+ o.DynamicClient, err = clientGetter.DynamicClient()
+ if err != nil {
+ return err
+ }
+
+ o.RestMapper, err = clientGetter.ToRESTMapper()
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+type GroupVersionResourceName struct {
+ schema.GroupVersionResource
+ Name string
+}
+
+func (g GroupVersionResourceName) String() string {
+ return strings.Join([]string{g.GroupResource().String(), g.Name}, "/")
+}
+
+func GroupVersionResourceWithName(gvr schema.GroupVersionResource, name string) GroupVersionResourceName {
+ return GroupVersionResourceName{GroupVersionResource: gvr, Name: name}
+}
+
+// Run delete a resource
+func (o *WorkloadOptions) Run(ctx context.Context) error {
+ var (
+ workloads []*v1beta1.Workload
+ haveAssociatedResources bool
+ err error
+ )
+
+ if o.DeleteAll {
+ workloads, haveAssociatedResources, err = o.getAllWorkloads(ctx)
+ } else {
+ workloads, haveAssociatedResources, err = o.getWorkloads(ctx)
+ }
+ if err != nil {
+ return err
+ }
+
+ if len(workloads) == 0 {
+ return nil
+ }
+
+ workloadResources, err := o.getWorkloadResources(workloads)
+ if err != nil {
+ return err
+ }
+
+ if o.DryRunStrategy == util.DryRunNone && !o.Confirmed && haveAssociatedResources {
+ var confirmationMessage string
+ if o.DeleteAll {
+ confirmationMessage = "This operation will also delete the jobs associated with these workloads.\n"
+ } else {
+ confirmationMessage = o.generateConfirmationMessage(workloadResources)
+ }
+
+ if !o.confirmation(confirmationMessage) {
+ fmt.Fprintf(o.Out, "Deletion is canceled\n")
+ return nil
+ }
+ }
+
+ if err := o.deleteWorkloads(ctx, workloadResources); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (o *WorkloadOptions) getAllWorkloads(ctx context.Context) ([]*v1beta1.Workload, bool, error) {
+ var namespace string
+ if !o.AllNamespaces {
+ namespace = o.Namespace
+ }
+
+ list, err := o.Client.Workloads(namespace).List(ctx, metav1.ListOptions{})
+ if err != nil {
+ return nil, false, err
+ }
+
+ var haveAssociatedWorkloads bool
+
+ workloads := make([]*v1beta1.Workload, 0, len(list.Items))
+ for index := range list.Items {
+ wl := &list.Items[index]
+ workloads = append(workloads, wl)
+ if len(wl.OwnerReferences) > 0 {
+ haveAssociatedWorkloads = true
+ }
+ }
+
+ return workloads, haveAssociatedWorkloads, nil
+}
+
+func (o *WorkloadOptions) getWorkloads(ctx context.Context) ([]*v1beta1.Workload, bool, error) {
+ var haveAssociatedWorkloads bool
+
+ workloads := make([]*v1beta1.Workload, 0, len(o.Names))
+
+ for _, name := range o.Names {
+ wl, err := o.Client.Workloads(o.Namespace).Get(ctx, name, metav1.GetOptions{})
+ if client.IgnoreNotFound(err) != nil {
+ return nil, false, err
+ }
+ if err != nil {
+ fmt.Fprintln(o.ErrOut, err)
+ continue
+ }
+
+ workloads = append(workloads, wl)
+ if len(wl.OwnerReferences) > 0 {
+ haveAssociatedWorkloads = true
+ }
+ }
+
+ return workloads, haveAssociatedWorkloads, nil
+}
+
+func (o *WorkloadOptions) getWorkloadResources(workloads []*v1beta1.Workload) (map[*v1beta1.Workload][]GroupVersionResourceName, error) {
+ workloadResources := make(map[*v1beta1.Workload][]GroupVersionResourceName, len(workloads))
+
+ for _, wl := range workloads {
+ workloadResources[wl] = make([]GroupVersionResourceName, 0, len(wl.OwnerReferences))
+
+ for _, or := range wl.OwnerReferences {
+ gv, err := schema.ParseGroupVersion(or.APIVersion)
+ if err != nil {
+ return nil, err
+ }
+
+ mapping, err := o.RestMapper.RESTMapping(gv.WithKind(or.Kind).GroupKind(), gv.Version)
+ if err != nil {
+ return nil, err
+ }
+
+ workloadResources[wl] = append(workloadResources[wl], GroupVersionResourceWithName(mapping.Resource, or.Name))
+ }
+ }
+
+ return workloadResources, nil
+}
+
+func (o *WorkloadOptions) generateConfirmationMessage(workloadResources map[*v1beta1.Workload][]GroupVersionResourceName) string {
+ associatedResources := make([]string, 0, len(workloadResources))
+
+ for wl, resources := range workloadResources {
+ names := make([]string, 0, len(resources))
+ for _, resource := range resources {
+ names = append(names, resource.String())
+ }
+
+ if len(names) > 0 {
+ associatedResource := fmt.Sprintf(" - %s associated with the %s/%s workload\n", strings.Join(names, ", "), wl.Namespace, wl.Name)
+ associatedResources = append(associatedResources, associatedResource)
+ }
+ }
+
+ if len(associatedResources) == 0 {
+ return ""
+ }
+
+ return fmt.Sprintf("This operation will also delete:\n%s", strings.Join(associatedResources, "\n"))
+}
+
+func (o *WorkloadOptions) confirmation(message string) bool {
+ fmt.Fprint(o.Out, message, "Do you want to proceed (y/n)? ")
+
+ var input string
+
+ _, err := fmt.Fscan(o.In, &input)
+ if err != nil {
+ return false
+ }
+
+ return strings.EqualFold(input, "y")
+}
+
+func (o *WorkloadOptions) deleteWorkloads(ctx context.Context, workloadNameResources map[*v1beta1.Workload][]GroupVersionResourceName) error {
+ for wl, nrs := range workloadNameResources {
+ deleteOptions := metav1.DeleteOptions{}
+
+ if o.DryRunStrategy == util.DryRunServer {
+ deleteOptions.DryRun = []string{metav1.DryRunAll}
+ }
+
+ for _, nr := range nrs {
+ if o.DryRunStrategy != util.DryRunClient {
+ if err := o.DynamicClient.Resource(nr.GroupVersionResource).Namespace(wl.Namespace).
+ Delete(ctx, nr.Name, deleteOptions); client.IgnoreNotFound(err) != nil {
+ return err
+ }
+ }
+ printWithDryRunStrategy(o.Out, nr.String(), o.DryRunStrategy)
+ }
+
+ // Remove workload only if we don't have corresponding Job(s).
+ if len(nrs) == 0 {
+ if o.DryRunStrategy != util.DryRunClient {
+ if err := o.Client.Workloads(wl.Namespace).Delete(ctx, wl.Name, deleteOptions); client.IgnoreNotFound(err) != nil {
+ return err
+ }
+ }
+ if err := o.PrintObj(wl, o.Out); err != nil {
+ return err
+ }
+ }
+ }
+
+ return nil
+}
diff --git a/cmd/kueuectl/app/delete/delete_workload_test.go b/cmd/kueuectl/app/delete/delete_workload_test.go
new file mode 100644
index 00000000000..fcbbf9ae740
--- /dev/null
+++ b/cmd/kueuectl/app/delete/delete_workload_test.go
@@ -0,0 +1,388 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package delete
+
+import (
+ "context"
+ "slices"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ bactchv1 "k8s.io/api/batch/v1"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/cli-runtime/pkg/genericiooptions"
+ dynamicfake "k8s.io/client-go/dynamic/fake"
+ k8sscheme "k8s.io/client-go/kubernetes/scheme"
+ kubetesting "k8s.io/client-go/testing"
+
+ "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/client-go/clientset/versioned/fake"
+ cmdtesting "sigs.k8s.io/kueue/cmd/kueuectl/app/testing"
+ testingworkload "sigs.k8s.io/kueue/pkg/util/testing"
+)
+
+func TestWorkloadCmd(t *testing.T) {
+ jobGVK := schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"}
+
+ testCases := map[string]struct {
+ ns string
+ args []string
+ input string
+ workloads []runtime.Object
+ jobs []runtime.Object
+ gvk schema.GroupVersionKind
+ wantWorkloads []v1beta1.Workload
+ wantJobList runtime.Object
+ ignoreOut bool
+ wantOut string
+ wantOutErr string
+ wantErr string
+ }{
+ "no arguments": {
+ args: []string{},
+ wantErr: "requires at least 1 arg(s), only received 0",
+ },
+ "shouldn't delete a workload and its corresponding job without confirmation": {
+ args: []string{"wl1"},
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ wantOut: `This operation will also delete:
+ - jobs.batch/j1 associated with the default/wl1 workload
+Do you want to proceed (y/n)? Deletion is canceled
+`,
+ },
+ "should delete just a workload without confirmation because there is no associated job requiring it": {
+ args: []string{"wl2"},
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ testingworkload.MakeWorkload("wl2", metav1.NamespaceDefault).Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault},
+ },
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ wantOut: "workload.kueue.x-k8s.io/wl2 deleted\n",
+ },
+ "shouldn't delete a workload because it is not found": {
+ args: []string{"wl2"},
+ wantOutErr: "workloads.kueue.x-k8s.io \"wl2\" not found\n",
+ },
+ "should delete jobs corresponding to the workload with confirmation": {
+ args: []string{"wl1"},
+ input: "y\n",
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ testingworkload.MakeWorkload("wl2", metav1.NamespaceDefault).Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ *testingworkload.MakeWorkload("wl2", metav1.NamespaceDefault).Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ wantOut: `This operation will also delete:
+ - jobs.batch/j1 associated with the default/wl1 workload
+Do you want to proceed (y/n)? jobs.batch/j1 deleted
+`,
+ },
+ "should delete jobs corresponding to the workload with yes flag": {
+ args: []string{"wl1", "--yes"},
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ testingworkload.MakeWorkload("wl2", metav1.NamespaceDefault).Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ *testingworkload.MakeWorkload("wl2", metav1.NamespaceDefault).Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ wantOut: "jobs.batch/j1 deleted\n",
+ },
+ "should delete all jobs corresponding to the workloads and any workloads without corresponding jobs in default namespace": {
+ args: []string{"--all", "--yes"},
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ testingworkload.MakeWorkload("wl2", metav1.NamespaceDefault).Obj(),
+ testingworkload.MakeWorkload("wl3", "test").Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ *testingworkload.MakeWorkload("wl3", "test").Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ // We do not know in which order the result will be displayed.
+ ignoreOut: true,
+ },
+ "should delete all jobs corresponding to the workloads and any workloads without corresponding jobs in all namespaces": {
+ args: []string{"--all", "-y", "-A"},
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ testingworkload.MakeWorkload("wl2", metav1.NamespaceDefault).Obj(),
+ testingworkload.MakeWorkload("wl3", "test").Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j2", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ // We do not know in which order the result will be displayed.
+ ignoreOut: true,
+ },
+ "shouldn't delete the jobs corresponding to the workloads jobs when using client dry-run flag": {
+ args: []string{"wl1", "--dry-run", "client"},
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ wantOut: "jobs.batch/j1 deleted (client dry run)\n",
+ },
+ "shouldn't delete the jobs corresponding to the workloads jobs when using server dry-run flag": {
+ args: []string{"wl1", "--dry-run", "server"},
+ workloads: []runtime.Object{
+ testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ jobs: []runtime.Object{
+ &bactchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault}},
+ },
+ gvk: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
+ wantWorkloads: []v1beta1.Workload{
+ *testingworkload.MakeWorkload("wl1", metav1.NamespaceDefault).OwnerReference(jobGVK, "j1", "").Obj(),
+ },
+ wantJobList: &bactchv1.JobList{
+ TypeMeta: metav1.TypeMeta{Kind: "JobList", APIVersion: "batch/v1"},
+ Items: []bactchv1.Job{
+ {
+ TypeMeta: metav1.TypeMeta{Kind: "Job", APIVersion: "batch/v1"},
+ ObjectMeta: metav1.ObjectMeta{Name: "j1", Namespace: metav1.NamespaceDefault},
+ },
+ },
+ },
+ wantOut: "jobs.batch/j1 deleted (server dry run)\n",
+ },
+ }
+ for name, tc := range testCases {
+ t.Run(name, func(t *testing.T) {
+ ns := metav1.NamespaceDefault
+ if tc.ns != "" {
+ ns = tc.ns
+ }
+
+ streams, in, out, outErr := genericiooptions.NewTestIOStreams()
+ clientset := fake.NewSimpleClientset(tc.workloads...)
+ clientset.PrependReactor("delete", "workloads", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
+ if slices.Contains(action.(kubetesting.DeleteAction).GetDeleteOptions().DryRun, metav1.DryRunAll) {
+ handled = true
+ }
+ return handled, ret, err
+ })
+
+ dynamicClient := dynamicfake.NewSimpleDynamicClient(k8sscheme.Scheme, tc.jobs...)
+ restMapper := meta.NewDefaultRESTMapper([]schema.GroupVersion{})
+ var (
+ mapping *meta.RESTMapping
+ err error
+ )
+ if !tc.gvk.Empty() {
+ restMapper.Add(tc.gvk, meta.RESTScopeNamespace)
+ mapping, err = restMapper.RESTMapping(tc.gvk.GroupKind(), tc.gvk.Version)
+ if err != nil {
+ t.Fatal(err)
+ }
+ dynamicClient.PrependReactor("delete", mapping.Resource.Resource, func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
+ // SimpleDynamicClient still don't have DryRun option on delete Reactor.
+ if slices.Contains(tc.args, "--dry-run") {
+ handled = true
+ }
+ return handled, ret, err
+ })
+ }
+
+ tcg := cmdtesting.NewTestClientGetter().
+ WithNamespace(ns).
+ WithKueueClientset(clientset).
+ WithDynamicClient(dynamicClient).
+ WithRESTMapper(restMapper)
+
+ cmd := NewWorkloadCmd(tcg, streams)
+ cmd.SetIn(in)
+ cmd.SetOut(out)
+ cmd.SetErr(outErr)
+ cmd.SetArgs(tc.args)
+
+ in.WriteString(tc.input)
+
+ gotErr := cmd.Execute()
+ var gotErrStr string
+ if gotErr != nil {
+ gotErrStr = gotErr.Error()
+ }
+
+ if diff := cmp.Diff(tc.wantErr, gotErrStr); diff != "" {
+ t.Errorf("Unexpected error (-want/+got)\n%s", diff)
+ }
+
+ if gotErr != nil {
+ return
+ }
+
+ if !tc.ignoreOut {
+ gotOut := out.String()
+ if diff := cmp.Diff(tc.wantOut, gotOut); diff != "" {
+ t.Errorf("Unexpected output (-want/+got)\n%s", diff)
+ }
+ }
+
+ gotOutErr := outErr.String()
+ if diff := cmp.Diff(tc.wantOutErr, gotOutErr); diff != "" {
+ t.Errorf("Unexpected error output (-want/+got)\n%s", diff)
+ }
+
+ gotWorkloadList, err := clientset.KueueV1beta1().Workloads(tc.ns).List(context.Background(), metav1.ListOptions{})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if diff := cmp.Diff(tc.wantWorkloads, gotWorkloadList.Items); diff != "" {
+ t.Errorf("Unexpected error output (-want/+got)\n%s", diff)
+ }
+
+ if tc.wantJobList == nil {
+ return
+ }
+
+ unstructured, err := dynamicClient.Resource(mapping.Resource).Namespace(metav1.NamespaceDefault).
+ List(context.Background(), metav1.ListOptions{})
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ gotList := tc.wantJobList.DeepCopyObject()
+
+ err = runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured.UnstructuredContent(), gotList)
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ if diff := cmp.Diff(tc.wantJobList, gotList); diff != "" {
+ t.Errorf("Unexpected list for %s (-want/+got)\n%s", tc.gvk.String(), diff)
+ }
+ })
+ }
+}
diff --git a/cmd/kueuectl/app/delete/helpers.go b/cmd/kueuectl/app/delete/helpers.go
new file mode 100644
index 00000000000..152506739ed
--- /dev/null
+++ b/cmd/kueuectl/app/delete/helpers.go
@@ -0,0 +1,35 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package delete
+
+import (
+ "fmt"
+ "io"
+
+ "sigs.k8s.io/kueue/cmd/kueuectl/app/util"
+)
+
+func printWithDryRunStrategy(out io.Writer, name string, dryRunStrategy util.DryRunStrategy) {
+ switch dryRunStrategy {
+ case util.DryRunClient:
+ fmt.Fprintf(out, "%s deleted (client dry run)\n", name)
+ case util.DryRunServer:
+ fmt.Fprintf(out, "%s deleted (server dry run)\n", name)
+ default:
+ fmt.Fprintf(out, "%s deleted\n", name)
+ }
+}
diff --git a/cmd/kueuectl/app/list/helpers.go b/cmd/kueuectl/app/list/helpers.go
index c41a652dd05..42ff8c8af44 100644
--- a/cmd/kueuectl/app/list/helpers.go
+++ b/cmd/kueuectl/app/list/helpers.go
@@ -61,11 +61,6 @@ func addLabelSelectorFlagVar(cmd *cobra.Command, p *string) {
"Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.")
}
-func addAllNamespacesFlagVar(cmd *cobra.Command, p *bool) {
- cmd.Flags().BoolVarP(p, "all-namespaces", "A", false,
- "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.")
-}
-
func addClusterQueueFilterFlagVar(cmd *cobra.Command, p *string) {
cmd.Flags().StringVarP(p, "clusterqueue", "c", "",
"Filter by cluster queue name which is associated with the resource.")
diff --git a/cmd/kueuectl/app/list/list.go b/cmd/kueuectl/app/list/list.go
index 6dc4f210273..85c42f87531 100644
--- a/cmd/kueuectl/app/list/list.go
+++ b/cmd/kueuectl/app/list/list.go
@@ -19,14 +19,17 @@ package list
import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- listExample = ` # List LocalQueue
- kueuectl list localqueue`
+var (
+ listExample = templates.Examples(`
+ # List LocalQueue
+ kueuectl list localqueue
+ `)
)
func NewListCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams, clock clock.Clock) *cobra.Command {
diff --git a/cmd/kueuectl/app/list/list_clusterqueue.go b/cmd/kueuectl/app/list/list_clusterqueue.go
index 824bde73c73..7950f042c1c 100644
--- a/cmd/kueuectl/app/list/list_clusterqueue.go
+++ b/cmd/kueuectl/app/list/list_clusterqueue.go
@@ -27,6 +27,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
@@ -35,11 +36,15 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- cqShort = `List ClusterQueues`
- cqLong = `Lists all ClusterQueues, potentially limiting output to those that are active/inactive and matching the label selector.`
- cqExample = ` # List ClusterQueue
- kueuectl list clusterqueue`
+var (
+ cqLong = templates.LongDesc(`
+ Lists all ClusterQueues, potentially limiting output to those
+ that are active/inactive and matching the label selector.
+ `)
+ cqExample = templates.Examples(`
+ # List ClusterQueue
+ kueuectl list clusterqueue
+ `)
)
type ClusterQueueOptions struct {
@@ -76,7 +81,7 @@ func NewClusterQueueCmd(clientGetter util.ClientGetter, streams genericiooptions
Use: "clusterqueue [--selector key1=value1] [--field-selector key1=value1] [--active=true|false]",
DisableFlagsInUseLine: true,
Aliases: []string{"cq"},
- Short: cqShort,
+ Short: "List ClusterQueues",
Long: cqLong,
Example: cqExample,
RunE: func(cmd *cobra.Command, args []string) error {
diff --git a/cmd/kueuectl/app/list/list_clusterqueue_test.go b/cmd/kueuectl/app/list/list_clusterqueue_test.go
index 6255f823020..f7cb7096829 100644
--- a/cmd/kueuectl/app/list/list_clusterqueue_test.go
+++ b/cmd/kueuectl/app/list/list_clusterqueue_test.go
@@ -144,10 +144,9 @@ cq1 cohort1 1 2 true 60m
t.Run(name, func(t *testing.T) {
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
- tf := cmdtesting.NewTestClientGetter()
- tf.KueueClientset = fake.NewSimpleClientset(tc.objs...)
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(fake.NewSimpleClientset(tc.objs...))
- cmd := NewClusterQueueCmd(tf, streams, testingclock.NewFakeClock(testStartTime))
+ cmd := NewClusterQueueCmd(tcg, streams, testingclock.NewFakeClock(testStartTime))
cmd.SetArgs(tc.args)
gotErr := cmd.Execute()
diff --git a/cmd/kueuectl/app/list/list_localqueue.go b/cmd/kueuectl/app/list/list_localqueue.go
index f9e1976fb1c..bd699185a18 100644
--- a/cmd/kueuectl/app/list/list_localqueue.go
+++ b/cmd/kueuectl/app/list/list_localqueue.go
@@ -25,6 +25,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
@@ -34,12 +35,16 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- lqLong = `Lists LocalQueues that match the given criteria: point to a specific CQ,
-being active/inactive, belonging to the specified namespace, matching
-the label selector or the field selector.`
- lqExample = ` # List LocalQueue
- kueuectl list localqueue`
+var (
+ lqLong = templates.LongDesc(`
+ Lists LocalQueues that match the given criteria: point to a specific CQ,
+ being active/inactive, belonging to the specified namespace, matching
+ the label selector or the field selector.
+ `)
+ lqExample = templates.Examples(`
+ # List LocalQueue
+ kueuectl list localqueue
+ `)
)
type LocalQueueOptions struct {
@@ -89,7 +94,7 @@ func NewLocalQueueCmd(clientGetter util.ClientGetter, streams genericiooptions.I
o.PrintFlags.AddFlags(cmd)
- addAllNamespacesFlagVar(cmd, &o.AllNamespaces)
+ util.AddAllNamespacesFlagVar(cmd, &o.AllNamespaces)
addFieldSelectorFlagVar(cmd, &o.FieldSelector)
addLabelSelectorFlagVar(cmd, &o.LabelSelector)
addClusterQueueFilterFlagVar(cmd, &o.ClusterQueueFilter)
diff --git a/cmd/kueuectl/app/list/list_localqueue_test.go b/cmd/kueuectl/app/list/list_localqueue_test.go
index b039a2e4202..e1884e77208 100644
--- a/cmd/kueuectl/app/list/list_localqueue_test.go
+++ b/cmd/kueuectl/app/list/list_localqueue_test.go
@@ -202,14 +202,12 @@ lq1 cq1 1 1 60m
t.Run(name, func(t *testing.T) {
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
- tf := cmdtesting.NewTestClientGetter()
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(fake.NewSimpleClientset(tc.objs...))
if len(tc.ns) > 0 {
- tf.WithNamespace(tc.ns)
+ tcg.WithNamespace(tc.ns)
}
- tf.KueueClientset = fake.NewSimpleClientset(tc.objs...)
-
- cmd := NewLocalQueueCmd(tf, streams, testingclock.NewFakeClock(testStartTime))
+ cmd := NewLocalQueueCmd(tcg, streams, testingclock.NewFakeClock(testStartTime))
cmd.SetArgs(tc.args)
gotErr := cmd.Execute()
diff --git a/cmd/kueuectl/app/list/list_pods.go b/cmd/kueuectl/app/list/list_pods.go
index 532cad7c95f..607fc818a66 100644
--- a/cmd/kueuectl/app/list/list_pods.go
+++ b/cmd/kueuectl/app/list/list_pods.go
@@ -34,6 +34,7 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
kubectlget "k8s.io/kubectl/pkg/cmd/get"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
@@ -43,18 +44,22 @@ import (
_ "sigs.k8s.io/kueue/pkg/controller/jobs"
)
-const (
- podLong = `Lists all pods that matches the given criteria: should be part of the specified Job kind,
-belonging to the specified namespace, matching the label selector or the field selector.
-
-The --for=pod/pod-name option allows to find pods from the same pod group as the specified pod, including that pod itself.
-`
- podExample = `
- # List Pods for the Job
- kueuectl list pods --for job/job-name
-
- # List Pods for the Pod group
- kueuectl list pods --for pod/pod-name`
+var (
+ podLong = templates.LongDesc(`
+ Lists all pods that matches the given criteria: should be part
+ of the specified Job kind, belonging to the specified namespace,
+ matching the label selector or the field selector.)
+
+ The --for=pod/pod-name option allows to find pods from the same
+ pod group as the specified pod, including that pod itself.
+ `)
+ podExample = templates.Examples(`
+ # List Pods for the Job
+ kueuectl list pods --for job/job-name
+
+ # List Pods for the Pod group
+ kueuectl list pods --for pod/pod-name
+ `)
)
type PodOptions struct {
@@ -112,7 +117,7 @@ func NewPodCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStream
o.PrintFlags.AddFlags(cmd)
- addAllNamespacesFlagVar(cmd, &o.AllNamespaces)
+ util.AddAllNamespacesFlagVar(cmd, &o.AllNamespaces)
addFieldSelectorFlagVar(cmd, &o.FieldSelector)
addLabelSelectorFlagVar(cmd, &o.LabelSelector)
addForObjectFlagVar(cmd, &o.UserSpecifiedForObject)
@@ -228,6 +233,9 @@ func (o *PodOptions) getPodLabelSelector() (string, error) {
return "", nil
}
+ if cbs.NewJob == nil {
+ return "", nil
+ }
genericJob := cbs.NewJob()
jobWithPodLabelSelector, ok := genericJob.(jobframework.JobWithPodLabelSelector)
diff --git a/cmd/kueuectl/app/list/list_pods_test.go b/cmd/kueuectl/app/list/list_pods_test.go
index 195ecb28c17..b9272c49896 100644
--- a/cmd/kueuectl/app/list/list_pods_test.go
+++ b/cmd/kueuectl/app/list/list_pods_test.go
@@ -31,9 +31,6 @@ import (
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
rayutils "github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
-
- kueuecmdtesting "sigs.k8s.io/kueue/cmd/kueuectl/app/testing"
-
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
@@ -45,8 +42,9 @@ import (
"k8s.io/cli-runtime/pkg/resource"
restfake "k8s.io/client-go/rest/fake"
"k8s.io/utils/strings/slices"
-
jobsetapi "sigs.k8s.io/jobset/api/jobset/v1alpha2"
+
+ kueuecmdtesting "sigs.k8s.io/kueue/cmd/kueuectl/app/testing"
)
type podTestCase struct {
@@ -747,10 +745,6 @@ valid-pod-1 1/1 Running 0
return m
}()
- tf := kueuecmdtesting.NewTestClientGetter()
- tf.WithNamespace(metav1.NamespaceDefault)
- tf.WithRESTMapper(mapper)
-
scheme, err := buildTestRuntimeScheme()
if err != nil {
t.Errorf("Unexpected error\n%s", err)
@@ -758,12 +752,17 @@ valid-pod-1 1/1 Running 0
codec := serializer.NewCodecFactory(scheme).LegacyCodec(scheme.PrioritizedVersionsAllGroups()...)
- tf.UnstructuredClient, err = mockRESTClient(codec, tc)
+ restClient, err := mockRESTClient(codec, tc)
if err != nil {
t.Fatal(err)
}
- cmd := NewPodCmd(tf, streams)
+ tcg := kueuecmdtesting.NewTestClientGetter().
+ WithNamespace(metav1.NamespaceDefault).
+ WithRESTMapper(mapper).
+ WithRESTClient(restClient)
+
+ cmd := NewPodCmd(tcg, streams)
cmd.SetArgs(tc.args)
gotErr := cmd.Execute()
diff --git a/cmd/kueuectl/app/list/list_resourceflavor.go b/cmd/kueuectl/app/list/list_resourceflavor.go
index c2a9fa7f7df..93fba45c36b 100644
--- a/cmd/kueuectl/app/list/list_resourceflavor.go
+++ b/cmd/kueuectl/app/list/list_resourceflavor.go
@@ -25,6 +25,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
"sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
@@ -32,9 +33,11 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- rfExample = ` # List ResourceFlavor
- kueuectl list resourceflavor`
+var (
+ rfExample = templates.Examples(`
+ # List ResourceFlavor
+ kueuectl list resourceflavor
+ `)
)
type ResourceFlavorOptions struct {
diff --git a/cmd/kueuectl/app/list/list_resourceflavor_test.go b/cmd/kueuectl/app/list/list_resourceflavor_test.go
index 1570c7c93b7..a91ec29cffd 100644
--- a/cmd/kueuectl/app/list/list_resourceflavor_test.go
+++ b/cmd/kueuectl/app/list/list_resourceflavor_test.go
@@ -112,10 +112,9 @@ rf1 60m
t.Run(name, func(t *testing.T) {
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
- tf := cmdtesting.NewTestClientGetter()
- tf.KueueClientset = fake.NewSimpleClientset(tc.objs...)
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(fake.NewSimpleClientset(tc.objs...))
- cmd := NewResourceFlavorCmd(tf, streams, testingclock.NewFakeClock(testStartTime))
+ cmd := NewResourceFlavorCmd(tcg, streams, testingclock.NewFakeClock(testStartTime))
cmd.SetOut(out)
cmd.SetErr(outErr)
cmd.SetArgs(tc.args)
diff --git a/cmd/kueuectl/app/list/list_test.go b/cmd/kueuectl/app/list/list_test.go
index d3be6a017a8..538526de734 100644
--- a/cmd/kueuectl/app/list/list_test.go
+++ b/cmd/kueuectl/app/list/list_test.go
@@ -125,9 +125,9 @@ cq2 cohort2 0 0 false 120m
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAMESPACE NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-ns1 wl1 j1 lq1 cq1 PENDING 60m
-ns2 wl2 j2 lq2 cq2 PENDING 120m
+ wantOut: `NAMESPACE NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+ns1 wl1 j1 lq1 cq1 PENDING 60m
+ns2 wl2 j2 lq2 cq2 PENDING 120m
`,
},
"should print workload list with all namespaces (short command and flag)": {
@@ -148,9 +148,9 @@ ns2 wl2 j2 lq2 cq2 PENDING
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAMESPACE NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-ns1 wl1 j1 lq1 cq1 PENDING 60m
-ns2 wl2 j2 lq2 cq2 PENDING 120m
+ wantOut: `NAMESPACE NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+ns1 wl1 j1 lq1 cq1 PENDING 60m
+ns2 wl2 j2 lq2 cq2 PENDING 120m
`,
},
}
@@ -158,15 +158,14 @@ ns2 wl2 j2 lq2 cq2 PENDING
t.Run(name, func(t *testing.T) {
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
- tf := cmdtesting.NewTestClientGetter()
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(fake.NewSimpleClientset(tc.objs...))
if len(tc.ns) > 0 {
- tf.WithNamespace(tc.ns)
+ tcg.WithNamespace(tc.ns)
}
- tf.KueueClientset = fake.NewSimpleClientset(tc.objs...)
fc := testingclock.NewFakeClock(testStartTime)
- cmd := NewListCmd(tf, streams, fc)
+ cmd := NewListCmd(tcg, streams, fc)
cmd.SetArgs(tc.args)
gotErr := cmd.Execute()
diff --git a/cmd/kueuectl/app/list/list_workload.go b/cmd/kueuectl/app/list/list_workload.go
index 432e9d025d4..ed23e126033 100644
--- a/cmd/kueuectl/app/list/list_workload.go
+++ b/cmd/kueuectl/app/list/list_workload.go
@@ -31,11 +31,12 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/clock"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
- "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
clientset "sigs.k8s.io/kueue/client-go/clientset/versioned"
"sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
"sigs.k8s.io/kueue/cmd/kueuectl/app/completion"
@@ -44,10 +45,12 @@ import (
"sigs.k8s.io/kueue/pkg/workload"
)
-const (
- wlLong = `Lists Workloads that match the provided criteria.`
- wlExample = ` # List Workload
- kueuectl list workload`
+var (
+ wlLong = templates.LongDesc(`Lists Workloads that match the provided criteria.`)
+ wlExample = templates.Examples(`
+ # List Workload
+ kueuectl list workload
+ `)
)
const (
@@ -112,7 +115,7 @@ func NewWorkloadCmd(clientGetter util.ClientGetter, streams genericiooptions.IOS
o.PrintFlags.AddFlags(cmd)
- addAllNamespacesFlagVar(cmd, &o.AllNamespaces)
+ util.AddAllNamespacesFlagVar(cmd, &o.AllNamespaces)
addFieldSelectorFlagVar(cmd, &o.FieldSelector)
addLabelSelectorFlagVar(cmd, &o.LabelSelector)
addClusterQueueFilterFlagVar(cmd, &o.ClusterQueueFilter)
@@ -128,7 +131,10 @@ func NewWorkloadCmd(clientGetter util.ClientGetter, streams genericiooptions.IOS
}
func getWorkloadStatuses(cmd *cobra.Command) (sets.Set[int], error) {
- var statusesFlags = util.FlagStringArray(cmd, "status")
+ statusesFlags, err := cmd.Flags().GetStringArray("status")
+ if err != nil {
+ return nil, err
+ }
statuses := sets.New[int]()
@@ -424,11 +430,11 @@ func (o *WorkloadOptions) localQueues(ctx context.Context, list *v1beta1.Workloa
return localQueues, nil
}
-func (o *WorkloadOptions) pendingWorkloads(ctx context.Context, list *v1beta1.WorkloadList, localQueues map[string]*v1beta1.LocalQueue) (map[string]*v1alpha1.PendingWorkload, error) {
+func (o *WorkloadOptions) pendingWorkloads(ctx context.Context, list *v1beta1.WorkloadList, localQueues map[string]*v1beta1.LocalQueue) (map[string]*visibility.PendingWorkload, error) {
var err error
- pendingWorkloads := make(map[string]*v1alpha1.PendingWorkload)
- pendingWorkloadsSummaries := make(map[string]*v1alpha1.PendingWorkloadsSummary)
+ pendingWorkloads := make(map[string]*visibility.PendingWorkload)
+ pendingWorkloadsSummaries := make(map[string]*visibility.PendingWorkloadsSummary)
for _, wl := range list.Items {
if !workloadPending(&wl) {
@@ -445,7 +451,7 @@ func (o *WorkloadOptions) pendingWorkloads(ctx context.Context, list *v1beta1.Wo
}
pendingWorkloadsSummary, ok := pendingWorkloadsSummaries[clusterQueueName]
if !ok {
- pendingWorkloadsSummary, err = o.ClientSet.VisibilityV1alpha1().ClusterQueues().
+ pendingWorkloadsSummary, err = o.ClientSet.VisibilityV1beta1().ClusterQueues().
GetPendingWorkloadsSummary(ctx, clusterQueueName, metav1.GetOptions{})
if client.IgnoreNotFound(err) != nil {
return nil, err
diff --git a/cmd/kueuectl/app/list/list_workload_printer.go b/cmd/kueuectl/app/list/list_workload_printer.go
index fa3956790c4..c7e0b4c6ee5 100644
--- a/cmd/kueuectl/app/list/list_workload_printer.go
+++ b/cmd/kueuectl/app/list/list_workload_printer.go
@@ -22,6 +22,7 @@ import (
"io"
"strings"
+ apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/duration"
@@ -30,7 +31,7 @@ import (
"k8s.io/utils/clock"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
- "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
"sigs.k8s.io/kueue/pkg/workload"
)
@@ -38,14 +39,14 @@ const crdTypeMaxLength = 20
type listWorkloadResources struct {
localQueues map[string]*v1beta1.LocalQueue
- pendingWorkloads map[string]*v1alpha1.PendingWorkload
+ pendingWorkloads map[string]*visibility.PendingWorkload
apiResourceLists map[string]*metav1.APIResourceList
}
func newListWorkloadResources() *listWorkloadResources {
return &listWorkloadResources{
localQueues: make(map[string]*v1beta1.LocalQueue),
- pendingWorkloads: make(map[string]*v1alpha1.PendingWorkload),
+ pendingWorkloads: make(map[string]*visibility.PendingWorkload),
apiResourceLists: make(map[string]*metav1.APIResourceList),
}
}
@@ -75,6 +76,7 @@ func (p *listWorkloadPrinter) PrintObj(obj runtime.Object, out io.Writer) error
{Name: "ClusterQueue", Type: "string"},
{Name: "Status", Type: "string"},
{Name: "Position in Queue", Type: "string"},
+ {Name: "Exec Time", Type: "string"},
{Name: "Age", Type: "string"},
},
Rows: p.printWorkloadList(list),
@@ -138,6 +140,19 @@ func (p *listWorkloadPrinter) printWorkload(wl *v1beta1.Workload) metav1.TableRo
positionInQueue = fmt.Sprintf("%d", pendingWorkload.PositionInLocalQueue)
}
+ var execTime string
+ if admittedCond := apimeta.FindStatusCondition(wl.Status.Conditions, v1beta1.WorkloadAdmitted); admittedCond != nil &&
+ admittedCond.Status == metav1.ConditionTrue {
+ finishedTime := p.clock.Now()
+
+ if finishedCond := apimeta.FindStatusCondition(wl.Status.Conditions, v1beta1.WorkloadFinished); finishedCond != nil &&
+ finishedCond.Status == metav1.ConditionTrue {
+ finishedTime = finishedCond.LastTransitionTime.Time
+ }
+
+ execTime = duration.HumanDuration(finishedTime.Sub(admittedCond.LastTransitionTime.Time))
+ }
+
row.Cells = []any{
wl.Name,
strings.Join(p.crdTypes(wl), ", "),
@@ -146,6 +161,7 @@ func (p *listWorkloadPrinter) printWorkload(wl *v1beta1.Workload) metav1.TableRo
clusterQueueName,
strings.ToUpper(workload.Status(wl)),
positionInQueue,
+ execTime,
duration.HumanDuration(p.clock.Since(wl.CreationTimestamp.Time)),
}
diff --git a/cmd/kueuectl/app/list/list_workload_test.go b/cmd/kueuectl/app/list/list_workload_test.go
index eb70833f9c6..b437656afe4 100644
--- a/cmd/kueuectl/app/list/list_workload_test.go
+++ b/cmd/kueuectl/app/list/list_workload_test.go
@@ -44,7 +44,7 @@ import (
testingclock "k8s.io/utils/clock/testing"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
- "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
"sigs.k8s.io/kueue/client-go/clientset/versioned/fake"
cmdtesting "sigs.k8s.io/kueue/cmd/kueuectl/app/testing"
"sigs.k8s.io/kueue/pkg/controller/constants"
@@ -57,7 +57,7 @@ func TestWorkloadCmd(t *testing.T) {
testCases := map[string]struct {
ns string
apiResourceLists []*metav1.APIResourceList
- pendingWorkloads []v1alpha1.PendingWorkload
+ pendingWorkloads []visibility.PendingWorkload
objs []runtime.Object
args []string
mapperKinds []schema.GroupVersionKind
@@ -84,8 +84,8 @@ func TestWorkloadCmd(t *testing.T) {
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with localqueue filter": {
@@ -106,8 +106,8 @@ wl1 j1 lq1 cq1 PENDING
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with localqueue filter (short flag)": {
@@ -128,8 +128,8 @@ wl1 j1 lq1 cq1 PENDING
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with clusterqueue filter": {
@@ -150,8 +150,8 @@ wl1 j1 lq1 cq1 PENDING
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with clusterqueue filter (short flag)": {
@@ -172,8 +172,8 @@ wl1 j1 lq1 cq1 PENDING
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with all status flag": {
@@ -194,29 +194,71 @@ wl1 j1 lq1 cq1 PENDING
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadAdmitted,
- Status: metav1.ConditionTrue,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
},
}...).
Obj(),
utiltesting.MakeWorkload("wl3", metav1.NamespaceDefault).
- OwnerReference(batchv1.SchemeGroupVersion.WithKind("Job"), "j3", "test-uid").
+ OwnerReference(rayv1.GroupVersion.WithKind("RayJob"), "j3", "test-uid").
Queue("lq3").
Active(true).
Admission(utiltesting.MakeAdmission("cq3").Obj()).
+ Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
+ Conditions([]metav1.Condition{
+ {
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionFalse,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
+ },
+ }...).
+ Obj(),
+ utiltesting.MakeWorkload("wl4", metav1.NamespaceDefault).
+ OwnerReference(batchv1.SchemeGroupVersion.WithKind("Job"), "j4", "test-uid").
+ Queue("lq4").
+ Active(true).
+ Admission(utiltesting.MakeAdmission("cq4").Obj()).
Creation(testStartTime.Add(-3 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadFinished,
- Status: metav1.ConditionTrue,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)),
+ },
+ {
+ Type: kueue.WorkloadFinished,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
+ },
+ }...).
+ Obj(),
+ utiltesting.MakeWorkload("wl5", metav1.NamespaceDefault).
+ OwnerReference(batchv1.SchemeGroupVersion.WithKind("Job"), "j5", "test-uid").
+ Queue("lq5").
+ Active(true).
+ Admission(utiltesting.MakeAdmission("cq5").Obj()).
+ Creation(testStartTime.Add(-3 * time.Hour).Truncate(time.Second)).
+ Conditions([]metav1.Condition{
+ {
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)),
+ },
+ {
+ Type: kueue.WorkloadFinished,
+ Status: metav1.ConditionFalse,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
},
}...).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
-wl2 j2 lq2 cq2 ADMITTED 120m
-wl3 j3 lq3 cq3 FINISHED 3h
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
+wl2 j2 lq2 cq2 ADMITTED 60m 120m
+wl3 j3 lq3 cq3 PENDING 120m
+wl4 j4 lq4 cq4 FINISHED 60m 3h
+wl5 j5 lq5 cq5 ADMITTED 120m 3h
`,
},
"should print workload list with only admitted and finished status flags": {
@@ -237,8 +279,9 @@ wl3 j3 lq3 cq3 FINISHED
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadAdmitted,
- Status: metav1.ConditionTrue,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
},
}...).
Obj(),
@@ -250,15 +293,21 @@ wl3 j3 lq3 cq3 FINISHED
Creation(testStartTime.Add(-3 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadFinished,
- Status: metav1.ConditionTrue,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)),
+ },
+ {
+ Type: kueue.WorkloadFinished,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
},
}...).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl2 j2 lq2 cq2 ADMITTED 120m
-wl3 j3 lq3 cq3 FINISHED 3h
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl2 j2 lq2 cq2 ADMITTED 60m 120m
+wl3 j3 lq3 cq3 FINISHED 60m 3h
`,
},
"should print workload list with only pending filter": {
@@ -285,8 +334,8 @@ wl3 j3 lq3 cq3 FINISHED
}...).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with only quotareserved filter": {
@@ -319,8 +368,8 @@ wl1 j1 lq1 cq1 PENDING
}...).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 QUOTARESERVED 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 QUOTARESERVED 60m
`,
},
"should print workload list with only admitted filter": {
@@ -334,8 +383,9 @@ wl1 j1 lq1 cq1 QUOTARESERVED
Creation(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadAdmitted,
- Status: metav1.ConditionTrue,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
},
}...).
Obj(),
@@ -347,14 +397,15 @@ wl1 j1 lq1 cq1 QUOTARESERVED
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadAdmitted,
- Status: metav1.ConditionFalse,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionFalse,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
},
}...).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 ADMITTED 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 ADMITTED 60m 60m
`,
},
"should print workload list with only finished status filter": {
@@ -368,8 +419,14 @@ wl1 j1 lq1 cq1 ADMITTED
Creation(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadFinished,
- Status: metav1.ConditionTrue,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
+ },
+ {
+ Type: kueue.WorkloadFinished,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Truncate(time.Second)),
},
}...).
Obj(),
@@ -381,14 +438,20 @@ wl1 j1 lq1 cq1 ADMITTED
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Conditions([]metav1.Condition{
{
- Type: kueue.WorkloadFinished,
- Status: metav1.ConditionFalse,
+ Type: kueue.WorkloadAdmitted,
+ Status: metav1.ConditionTrue,
+ LastTransitionTime: metav1.NewTime(testStartTime.Add(-1 * time.Hour).Truncate(time.Second)),
+ },
+ {
+ Type: kueue.WorkloadFinished,
+ Status: metav1.ConditionFalse,
+ LastTransitionTime: metav1.NewTime(testStartTime.Truncate(time.Second)),
},
}...).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 FINISHED 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 FINISHED 60m 60m
`,
},
"should print workload list with label selector filter": {
@@ -411,8 +474,8 @@ wl1 j1 lq1 cq1 FINISHED
Label("key", "value2").
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with label selector filter (short flag)": {
@@ -435,8 +498,8 @@ wl1 j1 lq1 cq1 PENDING
Label("key", "value2").
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 60m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 60m
`,
},
"should print workload list with Job types": {
@@ -494,10 +557,10 @@ wl1 j1 lq1 cq1 PENDING
Creation(testStartTime.Add(-3 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 job j1 lq1 cq1 PENDING 60m
-wl2 rayjob.ray.io j2 lq2 cq2 PENDING 120m
-wl3 pytorchjob.kubeflow.... j3 lq3 cq3 PENDING 3h
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 job j1 lq1 cq1 PENDING 60m
+wl2 rayjob.ray.io j2 lq2 cq2 PENDING 120m
+wl3 pytorchjob.kubeflow.... j3 lq3 cq3 PENDING 3h
`,
},
"should print workload list with resource filter": {
@@ -553,8 +616,8 @@ wl3 pytorchjob.kubeflow.... j3 lq3 cq3 PENDING
},
},
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 job.batch job-test lq1 cq1 PENDING 120m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 job.batch job-test lq1 cq1 PENDING 120m
`,
},
"should print workload list with resource filter and composable jobs": {
@@ -619,8 +682,8 @@ wl1 job.batch job-test lq1 cq1 PENDING
},
},
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl2 pod pod-test-1 lq2 cq2 PENDING 3h
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl2 pod pod-test-1 lq2 cq2 PENDING 3h
`,
},
"should print workload list with custom resource filter": {
@@ -687,8 +750,8 @@ wl2 pod pod-test-1 lq2 cq2 PENDING
},
},
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 rayjob.ray.io job-test lq1 cq1 PENDING 120m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 rayjob.ray.io job-test lq1 cq1 PENDING 120m
`,
},
"should print workload list with full resource filter": {
@@ -755,12 +818,12 @@ wl1 rayjob.ray.io job-test lq1 cq1 PENDING
},
},
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 rayjob.ray.io job-test lq1 cq1 PENDING 120m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 rayjob.ray.io job-test lq1 cq1 PENDING 120m
`,
},
"should print workload list with position in queue": {
- pendingWorkloads: []v1alpha1.PendingWorkload{
+ pendingWorkloads: []visibility.PendingWorkload{
{
ObjectMeta: metav1.ObjectMeta{
Name: "wl1",
@@ -798,9 +861,9 @@ wl1 rayjob.ray.io job-test lq1 cq1 PENDING
Creation(testStartTime.Add(-2 * time.Hour).Truncate(time.Second)).
Obj(),
},
- wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 j1 lq1 cq1 PENDING 12 60m
-wl2 j2 lq2 cq2 PENDING 22 120m
+ wantOut: `NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 j1 lq1 cq1 PENDING 12 60m
+wl2 j2 lq2 cq2 PENDING 22 120m
`,
},
"should print not found error": {
@@ -815,9 +878,11 @@ wl2 j2 lq2 cq2 PENDING 22
t.Run(name, func(t *testing.T) {
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
- tf := cmdtesting.NewTestClientGetter()
+ clientset := fake.NewSimpleClientset(tc.objs...)
+
+ tcg := cmdtesting.NewTestClientGetter().WithKueueClientset(clientset)
if len(tc.ns) > 0 {
- tf.WithNamespace(tc.ns)
+ tcg.WithNamespace(tc.ns)
}
if len(tc.mapperKinds) != 0 {
@@ -825,7 +890,7 @@ wl2 j2 lq2 cq2 PENDING 22
for _, k := range tc.mapperKinds {
mapper.Add(k, meta.RESTScopeNamespace)
}
- tf.WithRESTMapper(mapper)
+ tcg.WithRESTMapper(mapper)
}
if len(tc.job) != 0 {
@@ -842,37 +907,27 @@ wl2 j2 lq2 cq2 PENDING 22
codec := serializer.NewCodecFactory(scheme).LegacyCodec(scheme.PrioritizedVersionsAllGroups()...)
- tf.UnstructuredClient = &restfake.RESTClient{
+ tcg.WithRESTClient(&restfake.RESTClient{
NegotiatedSerializer: resource.UnstructuredPlusDefaultContentConfig().NegotiatedSerializer,
Resp: &http.Response{
StatusCode: http.StatusOK,
Body: io.NopCloser(bytes.NewReader([]byte(runtime.EncodeOrDie(codec, tc.job[0])))),
},
- }
+ })
}
- clientset := fake.NewSimpleClientset(tc.objs...)
-
// `SimpleClientset` not allow to add `PendingWorkloadsSummary` objects,
// because of `PendingWorkload` resources not implement `runtime.Object`.
// Default `Reaction` handle all verbs and resources, so need to add on
// head of chain.
- clientset.Fake.ReactionChain = append([]kubetesting.Reactor{
- &kubetesting.SimpleReactor{
- Verb: "get",
- Resource: "clusterqueues",
- Reaction: func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
- obj := &v1alpha1.PendingWorkloadsSummary{Items: tc.pendingWorkloads}
- return true, obj, err
- },
- },
- }, clientset.Fake.ReactionChain...)
-
- tf.KueueClientset = clientset
- tf.KueueClientset.Discovery().(*fakediscovery.FakeDiscovery).Resources = tc.apiResourceLists
+ clientset.PrependReactor("get", "clusterqueues", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) {
+ obj := &visibility.PendingWorkloadsSummary{Items: tc.pendingWorkloads}
+ return true, obj, err
+ })
+ clientset.Discovery().(*fakediscovery.FakeDiscovery).Resources = tc.apiResourceLists
fc := testingclock.NewFakeClock(testStartTime)
- cmd := NewWorkloadCmd(tf, streams, fc)
+ cmd := NewWorkloadCmd(tcg, streams, fc)
cmd.SetArgs(tc.args)
gotErr := cmd.Execute()
diff --git a/cmd/kueuectl/app/passthrough/passthrough.go b/cmd/kueuectl/app/passthrough/passthrough.go
index df332e215ef..d792c29556f 100644
--- a/cmd/kueuectl/app/passthrough/passthrough.go
+++ b/cmd/kueuectl/app/passthrough/passthrough.go
@@ -23,57 +23,82 @@ import (
"syscall"
"github.com/spf13/cobra"
+ "k8s.io/cli-runtime/pkg/genericiooptions"
+
+ "sigs.k8s.io/kueue/cmd/kueuectl/app/delete"
+ "sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
+type passThroughCommand struct {
+ name string
+ short string
+}
+
type passThroughType struct {
name string
aliases []string
}
var (
- passThroughCmds = []string{"get", "delete", "edit", "describe", "patch"}
+ passThroughCommands = []passThroughCommand{
+ {name: "get", short: "Display a resource"},
+ {name: "delete", short: "Delete a resource"},
+ {name: "edit", short: "Edit a resource on the server"},
+ {name: "describe", short: "Show details of a resource"},
+ {name: "patch", short: "Update fields of a resource"},
+ }
+
passThroughTypes = []passThroughType{
{name: "workload", aliases: []string{"wl"}},
{name: "clusterqueue", aliases: []string{"cq"}},
{name: "localqueue", aliases: []string{"lq"}},
- {name: "resourceflavor", aliases: []string{"rf"}}}
-)
-
-func NewCommands() ([]*cobra.Command, error) {
- kubectlPath, err := exec.LookPath("kubectl")
- if err != nil {
- return nil, fmt.Errorf("pass-through commands are not available: %w, PATH=%q", err, os.Getenv("PATH"))
+ {name: "resourceflavor", aliases: []string{"rf"}},
}
+)
- commands := make([]*cobra.Command, len(passThroughCmds))
- for i, pCmd := range passThroughCmds {
- commands[i] = newCmd(kubectlPath, pCmd, passThroughTypes)
+func NewCommands(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) []*cobra.Command {
+ commands := make([]*cobra.Command, len(passThroughCommands))
+ for i, ptCmd := range passThroughCommands {
+ commands[i] = newCommand(clientGetter, streams, ptCmd, passThroughTypes)
}
- return commands, nil
+ return commands
}
-func newCmd(kubectlPath string, command string, ptTypes []passThroughType) *cobra.Command {
+func newCommand(
+ clientGetter util.ClientGetter,
+ streams genericiooptions.IOStreams,
+ command passThroughCommand,
+ ptTypes []passThroughType,
+) *cobra.Command {
cmd := &cobra.Command{
- Use: command,
- Short: fmt.Sprintf("Pass-through %q to kubectl", command),
+ Use: fmt.Sprintf("%s [command]", command.name),
+ Short: command.short,
}
-
for _, ptType := range ptTypes {
- cmd.AddCommand(newSubcommand(kubectlPath, command, ptType))
+ if command.name == "delete" && ptType.name == "workload" {
+ cmd.AddCommand(delete.NewWorkloadCmd(clientGetter, streams))
+ } else {
+ cmd.AddCommand(newSubcommand(command, ptType))
+ }
}
return cmd
}
-func newSubcommand(kubectlPath string, command string, ptType passThroughType) *cobra.Command {
+func newSubcommand(command passThroughCommand, ptType passThroughType) *cobra.Command {
cmd := &cobra.Command{
Use: ptType.name,
Aliases: ptType.aliases,
- Short: fmt.Sprintf("Pass-through \"%s %s\" to kubectl", command, ptType),
+ Short: fmt.Sprintf("Pass-through \"%s %s\" to kubectl", command.name, ptType.name),
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
RunE: func(cmd *cobra.Command, _ []string) error {
cmd.SilenceUsage = true
+ kubectlPath, err := exec.LookPath("kubectl")
+ if err != nil {
+ return fmt.Errorf("pass-through command are not available: %w, PATH=%q", err, os.Getenv("PATH"))
+ }
+
// prepare the args
args := os.Args
args[0] = kubectlPath
diff --git a/cmd/kueuectl/app/resume/resume.go b/cmd/kueuectl/app/resume/resume.go
index a4123816098..9377069c197 100644
--- a/cmd/kueuectl/app/resume/resume.go
+++ b/cmd/kueuectl/app/resume/resume.go
@@ -19,13 +19,16 @@ package resume
import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- resumeExample = ` # Resume the workload
- kueuectl resume workload my-workload`
+var (
+ resumeExample = templates.Examples(`
+ # Resume the workload
+ kueuectl resume workload my-workload
+ `)
)
func NewResumeCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
diff --git a/cmd/kueuectl/app/resume/resume_clusterqueue.go b/cmd/kueuectl/app/resume/resume_clusterqueue.go
index e08fa70dc63..11df0e85dd9 100644
--- a/cmd/kueuectl/app/resume/resume_clusterqueue.go
+++ b/cmd/kueuectl/app/resume/resume_clusterqueue.go
@@ -25,6 +25,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -35,10 +36,12 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- cqLong = `Resumes the previously held ClusterQueue.`
- cqExample = ` # Resume the clusterqueue
- kueuectl resume clusterqueue my-clusterqueue`
+var (
+ cqLong = templates.LongDesc(`Resumes the previously held ClusterQueue.`)
+ cqExample = templates.Examples(`
+ # Resume the clusterqueue
+ kueuectl resume clusterqueue my-clusterqueue
+ `)
)
type ClusterQueueOptions struct {
diff --git a/cmd/kueuectl/app/resume/resume_localqueue.go b/cmd/kueuectl/app/resume/resume_localqueue.go
index 6c66b0a4b68..eb31d4f17b5 100644
--- a/cmd/kueuectl/app/resume/resume_localqueue.go
+++ b/cmd/kueuectl/app/resume/resume_localqueue.go
@@ -25,6 +25,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -35,10 +36,12 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- lqLong = `Resumes the previously held LocalQueue.`
- lqExample = ` # Resume the localqueue
- kueuectl resume localqueue my-localqueue`
+var (
+ lqLong = templates.LongDesc(`Resumes the previously held LocalQueue.`)
+ lqExample = templates.Examples(`
+ # Resume the localqueue
+ kueuectl resume localqueue my-localqueue
+ `)
)
type LocalQueueOptions struct {
diff --git a/cmd/kueuectl/app/resume/resume_workload.go b/cmd/kueuectl/app/resume/resume_workload.go
index 207a96ff17d..60dddcdc70c 100644
--- a/cmd/kueuectl/app/resume/resume_workload.go
+++ b/cmd/kueuectl/app/resume/resume_workload.go
@@ -19,6 +19,7 @@ package resume
import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/kueue/cmd/kueuectl/app/completion"
@@ -26,10 +27,12 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- wlLong = `Resumes the Workload, allowing its admission according to regular ClusterQueue rules.`
- wlExample = ` # Resume the workload
- kueuectl resume workload my-workload`
+var (
+ wlLong = templates.LongDesc(`Resumes the Workload, allowing its admission according to regular ClusterQueue rules.`)
+ wlExample = templates.Examples(`
+ # Resume the workload
+ kueuectl resume workload my-workload
+ `)
)
func NewWorkloadCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
diff --git a/cmd/kueuectl/app/stop/stop.go b/cmd/kueuectl/app/stop/stop.go
index 095569ccc75..0527d2523f6 100644
--- a/cmd/kueuectl/app/stop/stop.go
+++ b/cmd/kueuectl/app/stop/stop.go
@@ -19,13 +19,16 @@ package stop
import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- stopExample = ` # Stop the workload
- kueuectl stop workload my-workload`
+var (
+ stopExample = templates.Examples(`
+ # Stop the workload
+ kueuectl stop workload my-workload
+ `)
)
func NewStopCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
diff --git a/cmd/kueuectl/app/stop/stop_clusterqueue.go b/cmd/kueuectl/app/stop/stop_clusterqueue.go
index d7a4095afdb..2de314e6e81 100644
--- a/cmd/kueuectl/app/stop/stop_clusterqueue.go
+++ b/cmd/kueuectl/app/stop/stop_clusterqueue.go
@@ -25,6 +25,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -35,10 +36,12 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- cqLong = `Puts the given ClusterQueue on hold.`
- cqExample = ` # Stop the clusterqueue
- kueuectl stop clusterqueue my-clusterqueue`
+var (
+ cqLong = templates.LongDesc(`Puts the given ClusterQueue on hold.`)
+ cqExample = templates.Examples(`
+ # Stop the clusterqueue
+ kueuectl stop clusterqueue my-clusterqueue
+ `)
)
type ClusterQueueOptions struct {
diff --git a/cmd/kueuectl/app/stop/stop_localqueue.go b/cmd/kueuectl/app/stop/stop_localqueue.go
index 2e84b788d35..432725ed223 100644
--- a/cmd/kueuectl/app/stop/stop_localqueue.go
+++ b/cmd/kueuectl/app/stop/stop_localqueue.go
@@ -25,6 +25,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/cli-runtime/pkg/printers"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -35,10 +36,12 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- lqLong = `Puts the given LocalQueue on hold.`
- lqExample = ` # Stop the localqueue
- kueuectl stop localqueue my-localqueue`
+var (
+ lqLong = templates.LongDesc(`Puts the given LocalQueue on hold.`)
+ lqExample = templates.Examples(`
+ # Stop the localqueue
+ kueuectl stop localqueue my-localqueue
+ `)
)
type LocalQueueOptions struct {
diff --git a/cmd/kueuectl/app/stop/stop_workload.go b/cmd/kueuectl/app/stop/stop_workload.go
index e855fb65af6..e1a0685ce82 100644
--- a/cmd/kueuectl/app/stop/stop_workload.go
+++ b/cmd/kueuectl/app/stop/stop_workload.go
@@ -19,6 +19,7 @@ package stop
import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
+ "k8s.io/kubectl/pkg/util/templates"
"k8s.io/utils/ptr"
"sigs.k8s.io/kueue/cmd/kueuectl/app/completion"
@@ -26,12 +27,16 @@ import (
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
)
-const (
- wlLong = `Puts the given Workload on hold. The Workload will not be admitted and
+var (
+ wlLong = templates.LongDesc(`
+Puts the given Workload on hold. The Workload will not be admitted and
if it is already admitted it will be put back to queue just as if it
-was preempted (using .spec.active field).`
- wlExample = ` # Stop the workload
- kueuectl stop workload my-workload`
+was preempted (using .spec.active field).
+`)
+ wlExample = templates.Examples(`
+ # Stop the workload
+ kueuectl stop workload my-workload
+ `)
)
func NewWorkloadCmd(clientGetter util.ClientGetter, streams genericiooptions.IOStreams) *cobra.Command {
diff --git a/cmd/kueuectl/app/testing/fake.go b/cmd/kueuectl/app/testing/fake.go
index d147a0fa917..9ca9507403b 100644
--- a/cmd/kueuectl/app/testing/fake.go
+++ b/cmd/kueuectl/app/testing/fake.go
@@ -22,6 +22,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/resource"
+ "k8s.io/client-go/dynamic"
k8s "k8s.io/client-go/kubernetes"
k8sfake "k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/restmapper"
@@ -35,9 +36,10 @@ import (
type TestClientGetter struct {
util.ClientGetter
- KueueClientset versioned.Interface
- K8sClientset k8s.Interface
- UnstructuredClient resource.RESTClient
+ kueueClientset versioned.Interface
+ k8sClientset k8s.Interface
+ restClient resource.RESTClient
+ dynamicClient dynamic.Interface
configFlags *genericclioptions.TestConfigFlags
}
@@ -51,36 +53,60 @@ func NewTestClientGetter() *TestClientGetter {
WithNamespace(metav1.NamespaceDefault)
return &TestClientGetter{
ClientGetter: util.NewClientGetter(configFlags),
- KueueClientset: kueuefake.NewSimpleClientset(),
- K8sClientset: k8sfake.NewSimpleClientset(),
+ kueueClientset: kueuefake.NewSimpleClientset(),
+ k8sClientset: k8sfake.NewSimpleClientset(),
configFlags: configFlags,
}
}
-func (f *TestClientGetter) WithNamespace(ns string) *TestClientGetter {
- f.configFlags.WithNamespace(ns)
- return f
+func (cg *TestClientGetter) WithNamespace(ns string) *TestClientGetter {
+ cg.configFlags.WithNamespace(ns)
+ return cg
}
-func (f *TestClientGetter) WithRESTMapper(mapper meta.RESTMapper) *TestClientGetter {
- f.configFlags.WithRESTMapper(mapper)
- return f
+func (cg *TestClientGetter) WithRESTMapper(mapper meta.RESTMapper) *TestClientGetter {
+ cg.configFlags.WithRESTMapper(mapper)
+ return cg
}
-func (f *TestClientGetter) KueueClientSet() (versioned.Interface, error) {
- return f.KueueClientset, nil
+func (cg *TestClientGetter) WithKueueClientset(clientset versioned.Interface) *TestClientGetter {
+ cg.kueueClientset = clientset
+ return cg
}
-func (f *TestClientGetter) K8sClientSet() (k8s.Interface, error) {
- return f.K8sClientset, nil
+func (cg *TestClientGetter) KueueClientSet() (versioned.Interface, error) {
+ return cg.kueueClientset, nil
}
-func (f *TestClientGetter) NewResourceBuilder() *resource.Builder {
+func (cg *TestClientGetter) WithK8sClientset(clientset k8s.Interface) *TestClientGetter {
+ cg.k8sClientset = clientset
+ return cg
+}
+
+func (cg *TestClientGetter) K8sClientSet() (k8s.Interface, error) {
+ return cg.k8sClientset, nil
+}
+
+func (cg *TestClientGetter) WithRESTClient(restClient resource.RESTClient) *TestClientGetter {
+ cg.restClient = restClient
+ return cg
+}
+
+func (cg *TestClientGetter) WithDynamicClient(dynamicClient dynamic.Interface) *TestClientGetter {
+ cg.dynamicClient = dynamicClient
+ return cg
+}
+
+func (cg *TestClientGetter) DynamicClient() (dynamic.Interface, error) {
+ return cg.dynamicClient, nil
+}
+
+func (cg *TestClientGetter) NewResourceBuilder() *resource.Builder {
return resource.NewFakeBuilder(
func(version schema.GroupVersion) (resource.RESTClient, error) {
- return f.UnstructuredClient, nil
+ return cg.restClient, nil
},
- f.ToRESTMapper,
+ cg.ToRESTMapper,
func() (restmapper.CategoryExpander, error) {
return resource.FakeCategoryExpander, nil
},
diff --git a/cmd/kueuectl/app/util/client_getter.go b/cmd/kueuectl/app/util/client_getter.go
index 6044711e02f..fb9e87419fa 100644
--- a/cmd/kueuectl/app/util/client_getter.go
+++ b/cmd/kueuectl/app/util/client_getter.go
@@ -17,12 +17,15 @@ limitations under the License.
package util
import (
+ "k8s.io/apimachinery/pkg/runtime"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/resource"
+ "k8s.io/client-go/dynamic"
k8s "k8s.io/client-go/kubernetes"
- _ "k8s.io/client-go/plugin/pkg/client/auth"
"sigs.k8s.io/kueue/client-go/clientset/versioned"
+
+ _ "k8s.io/client-go/plugin/pkg/client/auth"
)
type ClientGetter interface {
@@ -30,6 +33,7 @@ type ClientGetter interface {
KueueClientSet() (versioned.Interface, error)
K8sClientSet() (k8s.Interface, error)
+ DynamicClient() (dynamic.Interface, error)
NewResourceBuilder() *resource.Builder
}
@@ -45,8 +49,8 @@ func NewClientGetter(clientGetter genericclioptions.RESTClientGetter) ClientGett
}
}
-func (f *clientGetterImpl) KueueClientSet() (versioned.Interface, error) {
- config, err := f.ToRESTConfig()
+func (cg *clientGetterImpl) KueueClientSet() (versioned.Interface, error) {
+ config, err := cg.ToRESTConfig()
if err != nil {
return nil, err
}
@@ -59,12 +63,13 @@ func (f *clientGetterImpl) KueueClientSet() (versioned.Interface, error) {
return clientset, nil
}
-func (f *clientGetterImpl) K8sClientSet() (k8s.Interface, error) {
- config, err := f.ToRESTConfig()
+func (cg *clientGetterImpl) K8sClientSet() (k8s.Interface, error) {
+ config, err := cg.ToRESTConfig()
if err != nil {
return nil, err
}
+ config.ContentType = runtime.ContentTypeProtobuf
clientset, err := k8s.NewForConfig(config)
if err != nil {
return nil, err
@@ -73,6 +78,20 @@ func (f *clientGetterImpl) K8sClientSet() (k8s.Interface, error) {
return clientset, nil
}
-func (f *clientGetterImpl) NewResourceBuilder() *resource.Builder {
- return resource.NewBuilder(f.RESTClientGetter)
+func (cg *clientGetterImpl) DynamicClient() (dynamic.Interface, error) {
+ config, err := cg.ToRESTConfig()
+ if err != nil {
+ return nil, err
+ }
+
+ dynamicClient, err := dynamic.NewForConfig(config)
+ if err != nil {
+ return nil, err
+ }
+
+ return dynamicClient, nil
+}
+
+func (cg *clientGetterImpl) NewResourceBuilder() *resource.Builder {
+ return resource.NewBuilder(cg.RESTClientGetter)
}
diff --git a/cmd/kueuectl/app/util/dry_run.go b/cmd/kueuectl/app/util/dry_run.go
index 5546705ebcc..9dc35178dad 100644
--- a/cmd/kueuectl/app/util/dry_run.go
+++ b/cmd/kueuectl/app/util/dry_run.go
@@ -56,7 +56,10 @@ func AddDryRunFlag(cmd *cobra.Command) {
}
func GetDryRunStrategy(cmd *cobra.Command) (DryRunStrategy, error) {
- var dryRunFlag = FlagString(cmd, "dry-run")
+ dryRunFlag, err := cmd.Flags().GetString("dry-run")
+ if err != nil {
+ return DryRunNone, err
+ }
switch dryRunFlag {
case "client":
return DryRunClient, nil
diff --git a/cmd/kueuectl/app/util/helpers.go b/cmd/kueuectl/app/util/helpers.go
index f72bc18e658..fe0c39aad0c 100644
--- a/cmd/kueuectl/app/util/helpers.go
+++ b/cmd/kueuectl/app/util/helpers.go
@@ -16,23 +16,9 @@ limitations under the License.
package util
-import (
- "github.com/spf13/cobra"
- "k8s.io/klog/v2"
-)
+import "github.com/spf13/cobra"
-func FlagString(cmd *cobra.Command, flag string) string {
- s, err := cmd.Flags().GetString(flag)
- if err != nil {
- klog.Fatalf("error accessing flag %s for command %s: %v", flag, cmd.Name(), err)
- }
- return s
-}
-
-func FlagStringArray(cmd *cobra.Command, flag string) []string {
- s, err := cmd.Flags().GetStringArray(flag)
- if err != nil {
- klog.Fatalf("error accessing flag %s for command %s: %v", flag, cmd.Name(), err)
- }
- return s
+func AddAllNamespacesFlagVar(cmd *cobra.Command, p *bool) {
+ cmd.Flags().BoolVarP(p, "all-namespaces", "A", false,
+ "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.")
}
diff --git a/cmd/kueuectl/app/version/version.go b/cmd/kueuectl/app/version/version.go
index 6551b9adcd0..074d20ce02f 100644
--- a/cmd/kueuectl/app/version/version.go
+++ b/cmd/kueuectl/app/version/version.go
@@ -24,6 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericiooptions"
k8s "k8s.io/client-go/kubernetes"
+ "k8s.io/kubectl/pkg/util/templates"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/kueue/cmd/kueuectl/app/util"
@@ -36,9 +37,11 @@ const (
kueueContainerName = "manager"
)
-const (
- versionExample = ` # Prints the client version and the kueue controller manager image, if installed
- kueuectl version`
+var (
+ versionExample = templates.Examples(`
+ # Prints the client version and the kueue controller manager image, if installed
+ kueuectl version
+ `)
)
// VersionOptions is a struct to support version command
diff --git a/cmd/kueuectl/app/version/version_test.go b/cmd/kueuectl/app/version/version_test.go
index 7c95a61080d..1718ae1a33d 100644
--- a/cmd/kueuectl/app/version/version_test.go
+++ b/cmd/kueuectl/app/version/version_test.go
@@ -72,12 +72,12 @@ Kueue Controller Manager Image: registry.k8s.io/kueue/kueue:v0.0.0
t.Run(name, func(t *testing.T) {
streams, _, out, outErr := genericiooptions.NewTestIOStreams()
- tf := cmdtesting.NewTestClientGetter()
+ tcg := cmdtesting.NewTestClientGetter()
if tc.deployment != nil {
- tf.K8sClientset = k8sfake.NewSimpleClientset(tc.deployment)
+ tcg.WithK8sClientset(k8sfake.NewSimpleClientset(tc.deployment))
}
- cmd := NewVersionCmd(tf, streams)
+ cmd := NewVersionCmd(tcg, streams)
cmd.SetArgs(tc.args)
gotErr := cmd.Execute()
diff --git a/config/alpha-enabled/kustomization.yaml b/config/alpha-enabled/kustomization.yaml
index ad4c4899e3e..21e4b163d9a 100644
--- a/config/alpha-enabled/kustomization.yaml
+++ b/config/alpha-enabled/kustomization.yaml
@@ -3,7 +3,6 @@
# Use default settings as a base.
resources:
- ../default
-- ../visibility
patches:
# Modify feature gates to enable AllAlpha=true
diff --git a/config/components/crd/bases/kueue.x-k8s.io_admissionchecks.yaml b/config/components/crd/bases/kueue.x-k8s.io_admissionchecks.yaml
index 9717ddc01fe..ed20eaa6db0 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_admissionchecks.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_admissionchecks.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: admissionchecks.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -75,10 +75,10 @@ spec:
retryDelayMinutes:
default: 15
description: |-
- RetryDelayMinutes **deprecated** specifies how long to keep the workload suspended after
+ RetryDelayMinutes specifies how long to keep the workload suspended after
a failed check (after it transitioned to False). When the delay period has passed, the check
state goes to "Unknown". The default is 15 min.
- The default is 15 min.
+ Deprecated: retryDelayMinutes has already been deprecated since v0.8 and will be removed in v1beta2.
format: int64
type: integer
required:
@@ -92,16 +92,8 @@ spec:
conditions hold the latest available observations of the AdmissionCheck
current state.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -142,12 +134,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/config/components/crd/bases/kueue.x-k8s.io_clusterqueues.yaml b/config/components/crd/bases/kueue.x-k8s.io_clusterqueues.yaml
index 821b21dbe51..dbc85d123bf 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_clusterqueues.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_clusterqueues.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: clusterqueues.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -102,7 +102,6 @@ spec:
cohort that this ClusterQueue belongs to. CQs that belong to the
same cohort can borrow unused resources from each other.
-
A CQ can be a member of a single borrowing cohort. A workload submitted
to a queue referencing this CQ can borrow quota from any CQ in the cohort.
Only quota for the [resource, flavor] pairs listed in the CQ can be
@@ -110,11 +109,9 @@ spec:
If empty, this ClusterQueue cannot borrow from any other ClusterQueue and
vice versa.
-
A cohort is a name that links CQs together, but it doesn't reference any
object.
-
Validation of a cohort name is equivalent to that of object names:
subdomain in DNS (RFC 1123).
maxLength: 253
@@ -154,7 +151,6 @@ spec:
whenCanBorrow determines whether a workload should try the next flavor
before borrowing in current flavor. The possible values are:
-
- `Borrow` (default): allocate in current flavor if borrowing
is possible.
- `TryNextFlavor`: try next flavor even if the current
@@ -169,7 +165,6 @@ spec:
whenCanPreempt determines whether a workload should try the next flavor
before borrowing in current flavor. The possible values are:
-
- `Preempt`: allocate in current flavor if it's possible to preempt some workloads.
- `TryNextFlavor` (default): try next flavor even if there are enough
candidates for preemption in the current flavor.
@@ -235,10 +230,8 @@ spec:
preemption describes policies to preempt Workloads from this ClusterQueue
or the ClusterQueue's cohort.
-
Preemption can happen in two scenarios:
-
- When a Workload fits within the nominal quota of the ClusterQueue, but
the quota is currently borrowed by other ClusterQueues in the cohort.
Preempting Workloads in other ClusterQueues allows this ClusterQueue to
@@ -246,7 +239,6 @@ spec:
- When a Workload doesn't fit within the nominal quota of the ClusterQueue
and there are admitted Workloads in the ClusterQueue with lower priority.
-
The preemption algorithm tries to find a minimal set of Workloads to
preempt to accomomdate the pending Workload, preempting Workloads with
lower priority first.
@@ -288,7 +280,6 @@ spec:
Workloads from other ClusterQueues in the cohort that are using more than
their nominal quota. The possible values are:
-
- `Never` (default): do not preempt Workloads in the cohort.
- `LowerPriority`: if the pending Workload fits within the nominal
quota of its ClusterQueue, only preempt Workloads in the cohort that have
@@ -308,7 +299,6 @@ spec:
within the nominal quota for its ClusterQueue, can preempt active Workloads in
the ClusterQueue. The possible values are:
-
- `Never` (default): do not preempt Workloads in the ClusterQueue.
- `LowerPriority`: only preempt Workloads in the ClusterQueue that have
lower priority than the pending Workload.
@@ -332,7 +322,6 @@ spec:
across the queues in this ClusterQueue.
Current Supported Strategies:
-
- StrictFIFO: workloads are ordered strictly by creation time.
Older workloads that can't be admitted will block admitting newer
workloads even if they fit available quota.
@@ -439,7 +428,6 @@ spec:
should account for resources that can be provided by a component such as
Kubernetes cluster-autoscaler.
-
If the ClusterQueue belongs to a cohort, the sum of the quotas for each
(flavor, resource) combination defines the maximum quantity that can be
allocated by a ClusterQueue in the cohort.
@@ -482,10 +470,8 @@ spec:
stopPolicy - if set to a value different from None, the ClusterQueue is considered Inactive, no new reservation being
made.
-
Depending on its value, its associated workloads will:
-
- None - Workloads are admitted
- HoldAndDrain - Admitted workloads are evicted and Reserving workloads will cancel the reservation.
- Hold - Admitted workloads will run to completion and Reserving workloads will cancel the reservation.
@@ -513,16 +499,8 @@ spec:
conditions hold the latest available observations of the ClusterQueue
current state.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -563,12 +541,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -718,6 +691,9 @@ spec:
description: |-
PendingWorkloadsStatus contains the information exposed about the current
status of the pending workloads in the cluster queue.
+ Deprecated: This field will be removed on v1beta2, use VisibilityOnDemand
+ (https://kueue.sigs.k8s.io/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/)
+ instead.
properties:
clusterQueuePendingWorkload:
description: Head contains the list of top pending workloads.
diff --git a/config/components/crd/bases/kueue.x-k8s.io_cohorts.yaml b/config/components/crd/bases/kueue.x-k8s.io_cohorts.yaml
index f680c1b237c..7df76d9eb09 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_cohorts.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_cohorts.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: cohorts.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -17,7 +17,10 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
- description: Cohort is the Schema for the cohorts API
+ description: |-
+ Cohort is the Schema for the cohorts API. Using Hierarchical
+ Cohorts (any Cohort which has a parent) with Fair Sharing
+ results in undefined behavior in 0.9
properties:
apiVersion:
description: |-
@@ -47,7 +50,6 @@ spec:
2) References a non-existent Cohort. We use default Cohort (no borrowing/lending limits).
3) References an existent Cohort.
-
If a cycle is created, we disable all members of the
Cohort, including ClusterQueues, until the cycle is
removed. We prevent further admission while the cycle
@@ -64,15 +66,12 @@ spec:
of one ResourceGroup. There may be up to 16 ResourceGroups
within a Cohort.
-
BorrowingLimit limits how much members of this Cohort
subtree can borrow from the parent subtree.
-
LendingLimit limits how much members of this Cohort subtree
can lend to the parent subtree.
-
Borrowing and Lending limits must only be set when the
Cohort has a parent. Otherwise, the Cohort create/update
will be rejected by the webhook.
@@ -165,7 +164,6 @@ spec:
should account for resources that can be provided by a component such as
Kubernetes cluster-autoscaler.
-
If the ClusterQueue belongs to a cohort, the sum of the quotas for each
(flavor, resource) combination defines the maximum quantity that can be
allocated by a ClusterQueue in the cohort.
@@ -208,16 +206,8 @@ spec:
properties:
conditions:
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -258,12 +248,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/config/components/crd/bases/kueue.x-k8s.io_localqueues.yaml b/config/components/crd/bases/kueue.x-k8s.io_localqueues.yaml
index 74c64365a00..9e8398df0cb 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_localqueues.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_localqueues.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: localqueues.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -71,10 +71,8 @@ spec:
stopPolicy - if set to a value different from None, the LocalQueue is considered Inactive,
no new reservation being made.
-
Depending on its value, its associated workloads will:
-
- None - Workloads are admitted
- HoldAndDrain - Admitted workloads are evicted and Reserving workloads will cancel the reservation.
- Hold - Admitted workloads will run to completion and Reserving workloads will cancel the reservation.
@@ -98,16 +96,8 @@ spec:
Conditions hold the latest available observations of the LocalQueue
current state.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -148,12 +138,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/config/components/crd/bases/kueue.x-k8s.io_multikueueclusters.yaml b/config/components/crd/bases/kueue.x-k8s.io_multikueueclusters.yaml
index 31072631063..5b3153d734c 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_multikueueclusters.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_multikueueclusters.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: multikueueclusters.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -14,7 +14,7 @@ spec:
singular: multikueuecluster
scope: Cluster
versions:
- - name: v1alpha1
+ - name: v1beta1
schema:
openAPIV3Schema:
description: MultiKueueCluster is the Schema for the multikueue API
@@ -45,7 +45,6 @@ spec:
description: |-
Location of the KubeConfig.
-
If LocationType is Secret then Location is the name of the secret inside the namespace in
which the kueue controller manager is running. The config should be stored in the "kubeconfig" key.
type: string
@@ -67,16 +66,8 @@ spec:
properties:
conditions:
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -117,12 +108,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/config/components/crd/bases/kueue.x-k8s.io_multikueueconfigs.yaml b/config/components/crd/bases/kueue.x-k8s.io_multikueueconfigs.yaml
index d9fc822987a..21bf0f35473 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_multikueueconfigs.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_multikueueconfigs.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: multikueueconfigs.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -14,7 +14,7 @@ spec:
singular: multikueueconfig
scope: Cluster
versions:
- - name: v1alpha1
+ - name: v1beta1
schema:
openAPIV3Schema:
description: MultiKueueConfig is the Schema for the multikueue API
diff --git a/config/components/crd/bases/kueue.x-k8s.io_provisioningrequestconfigs.yaml b/config/components/crd/bases/kueue.x-k8s.io_provisioningrequestconfigs.yaml
index 578c87c994b..a2885a29a19 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_provisioningrequestconfigs.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_provisioningrequestconfigs.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: provisioningrequestconfigs.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -45,14 +45,11 @@ spec:
description: |-
managedResources contains the list of resources managed by the autoscaling.
-
If empty, all resources are considered managed.
-
If not empty, the ProvisioningRequest will contain only the podsets that are
requesting at least one of them.
-
If none of the workloads podsets is requesting at least a managed resource,
the workload is considered ready.
items:
diff --git a/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml b/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml
index d2ac7521755..a2d6a34ef02 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: resourceflavors.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -56,7 +56,6 @@ spec:
nodeLabels should be injected into the pods of the Workload by the
controller that integrates with the Workload object.
-
nodeLabels can be up to 8 elements.
maxProperties: 8
type: object
@@ -68,11 +67,9 @@ spec:
Workloads' podsets must have tolerations for these nodeTaints in order to
get assigned this ResourceFlavor during admission.
-
An example of a nodeTaint is
cloud.provider.com/preemptible="true":NoSchedule
-
nodeTaints can be up to 8 elements.
items:
description: |-
@@ -114,11 +111,9 @@ spec:
tolerations are extra tolerations that will be added to the pods admitted in
the quota associated with this resource flavor.
-
An example of a toleration is
cloud.provider.com/preemptible="true":NoSchedule
-
tolerations can be up to 8 elements.
items:
description: |-
diff --git a/config/components/crd/bases/kueue.x-k8s.io_workloadpriorityclasses.yaml b/config/components/crd/bases/kueue.x-k8s.io_workloadpriorityclasses.yaml
index 3de203acaf2..99049dee95c 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_workloadpriorityclasses.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_workloadpriorityclasses.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: workloadpriorityclasses.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
diff --git a/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml b/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml
index f7716c36763..e7907469e12 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.15.0
+ controller-gen.kubebuilder.io/version: v0.16.4
name: workloads.kueue.x-k8s.io
spec:
group: kueue.x-k8s.io
@@ -69,11 +69,9 @@ spec:
Changing active from true to false will evict any running workloads.
Possible values are:
-
- false: indicates that a workload should never be admitted and evicts running workloads
- true: indicates that a workload can be evaluated for admission into it's respective queue.
-
Defaults to true
type: boolean
podSets:
@@ -95,14 +93,11 @@ spec:
minCount is the minimum number of pods for the spec acceptable
if the workload supports partial admission.
-
If not provided, partial admission for the current PodSet is not
enabled.
-
Only one podSet within the workload can use this.
-
This is an alpha field and requires enabling PartialAdmission feature gate.
format: int32
minimum: 1
@@ -117,15 +112,12 @@ spec:
description: |-
template is the Pod template.
-
The only allowed fields in template.metadata are labels and annotations.
-
If requests are omitted for a container or initContainer,
they default to the limits if they are explicitly specified for the
container or initContainer.
-
During admission, the rules in nodeSelector and
nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution that match
the keys in the nodeLabels from the ResourceFlavors considered for this
@@ -456,7 +448,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -471,7 +463,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -641,7 +633,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -656,7 +648,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -825,7 +817,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -840,7 +832,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1010,7 +1002,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1025,7 +1017,7 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1193,9 +1185,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -1266,9 +1256,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -1308,9 +1296,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -1333,9 +1319,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -1639,11 +1623,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -1856,11 +1840,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2010,11 +1994,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -2026,6 +2008,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -2149,7 +2137,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -2231,7 +2219,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -2315,11 +2302,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -2537,10 +2524,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -2548,11 +2533,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -2661,7 +2644,6 @@ spec:
removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
Pod to exceed its resource allocation.
-
To add an ephemeral container, use the ephemeralcontainers subresource of an existing
Pod. Ephemeral containers may not be removed or restarted.
properties:
@@ -2735,9 +2717,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2808,9 +2788,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -2850,9 +2828,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -2875,9 +2851,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -3175,11 +3149,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3382,11 +3356,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3535,11 +3509,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -3551,6 +3523,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -3662,7 +3640,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -3744,7 +3722,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -3822,11 +3799,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -3965,7 +3942,6 @@ spec:
The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
If not set then the ephemeral container uses the namespaces configured in the Pod spec.
-
The container runtime must implement support for this feature. If the runtime does not
support namespace targeting then the result of setting this field is undefined.
type: string
@@ -4054,10 +4030,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -4065,11 +4039,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -4181,9 +4153,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -4280,9 +4250,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -4353,9 +4321,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the
@@ -4395,9 +4361,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the ConfigMap
@@ -4420,9 +4384,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret
@@ -4726,11 +4688,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -4943,11 +4905,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5097,11 +5059,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one
@@ -5113,6 +5073,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
+ type: string
required:
- name
type: object
@@ -5236,7 +5202,7 @@ spec:
procMount:
description: |-
procMount denotes the type of proc mount to use for the containers.
- The default is DefaultProcMount which uses the container runtime defaults for
+ The default value is Default which uses the container runtime defaults for
readonly paths and masked paths.
This requires the ProcMountType feature flag to be enabled.
Note that this field cannot be set when spec.os.name is windows.
@@ -5318,7 +5284,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -5402,11 +5367,11 @@ spec:
format: int32
type: integer
service:
+ default: ""
description: |-
Service is the name of the service to place in the gRPC HealthCheckRequest
(see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
-
If this is not specified, the default behavior is defined by gRPC.
type: string
required:
@@ -5624,10 +5589,8 @@ spec:
RecursiveReadOnly specifies whether read-only mounts should be handled
recursively.
-
If ReadOnly is false, this field has no meaning and must be unspecified.
-
If ReadOnly is true, and this field is set to Disabled, the mount is not made
recursively read-only. If this field is set to IfPossible, the mount is made
recursively read-only, if it is supported by the container runtime. If this
@@ -5635,11 +5598,9 @@ spec:
supported by the container runtime, otherwise the pod will not be started and
an error will be generated to indicate the reason.
-
If this field is set to IfPossible or Enabled, MountPropagation must be set to
None (or be unspecified, which defaults to None).
-
If this field is not specified, it is treated as an equivalent of Disabled.
type: string
subPath:
@@ -5678,9 +5639,11 @@ spec:
x-kubernetes-list-type: map
nodeName:
description: |-
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- the scheduler simply schedules this pod onto that node, assuming that it fits resource
- requirements.
+ NodeName indicates in which node this pod is scheduled.
+ If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
type: string
nodeSelector:
additionalProperties:
@@ -5696,11 +5659,9 @@ spec:
Specifies the OS of the containers in the pod.
Some pod and container fields are restricted if this is set.
-
If the OS field is set to linux, the following fields must be unset:
-securityContext.windowsOptions
-
If the OS field is set to windows, following fields must be unset:
- spec.hostPID
- spec.hostIPC
@@ -5715,6 +5676,7 @@ spec:
- spec.securityContext.runAsUser
- spec.securityContext.runAsGroup
- spec.securityContext.supplementalGroups
+ - spec.securityContext.supplementalGroupsPolicy
- spec.containers[*].securityContext.appArmorProfile
- spec.containers[*].securityContext.seLinuxOptions
- spec.containers[*].securityContext.seccompProfile
@@ -5802,15 +5764,16 @@ spec:
will be made available to those containers which consume them
by name.
-
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
-
This field is immutable.
items:
description: |-
- PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+ PodResourceClaim references exactly one ResourceClaim, either directly
+ or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+ for the pod.
+
It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
Containers that need access to the ResourceClaim reference it with this name.
properties:
@@ -5819,33 +5782,32 @@ spec:
Name uniquely identifies this resource claim inside the pod.
This must be a DNS_LABEL.
type: string
- source:
- description: Source describes where to find the
- ResourceClaim.
- properties:
- resourceClaimName:
- description: |-
- ResourceClaimName is the name of a ResourceClaim object in the same
- namespace as this pod.
- type: string
- resourceClaimTemplateName:
- description: |-
- ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- object in the same namespace as this pod.
+ resourceClaimName:
+ description: |-
+ ResourceClaimName is the name of a ResourceClaim object in the same
+ namespace as this pod.
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
+ resourceClaimTemplateName:
+ description: |-
+ ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ object in the same namespace as this pod.
- The template will be used to create a new ResourceClaim, which will
- be bound to this pod. When this pod is deleted, the ResourceClaim
- will also be deleted. The pod name and resource name, along with a
- generated component, will be used to form a unique name for the
- ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ The template will be used to create a new ResourceClaim, which will
+ be bound to this pod. When this pod is deleted, the ResourceClaim
+ will also be deleted. The pod name and resource name, along with a
+ generated component, will be used to form a unique name for the
+ ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ This field is immutable and no changes will be made to the
+ corresponding ResourceClaim by the control plane after creating the
+ ResourceClaim.
- This field is immutable and no changes will be made to the
- corresponding ResourceClaim by the control plane after creating the
- ResourceClaim.
- type: string
- type: object
+ Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ be set.
+ type: string
required:
- name
type: object
@@ -5879,7 +5841,6 @@ spec:
If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
scheduler will not attempt to schedule the pod.
-
SchedulingGates can only be set at pod creation time, and be removed only afterwards.
items:
description: PodSchedulingGate is associated to a
@@ -5931,12 +5892,10 @@ spec:
Some volume types allow the Kubelet to change the ownership of that volume
to be owned by the pod:
-
1. The owning GID will be the FSGroup
2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3. The permission bits are OR'd with rw-rw----
-
If unset, the Kubelet will not modify the ownership and permissions of any volume.
Note that this field cannot be set when spec.os.name is windows.
format: int64
@@ -6023,7 +5982,6 @@ spec:
type indicates which kind of seccomp profile will be applied.
Valid options are:
-
Localhost - a profile defined in a file on the node should be used.
RuntimeDefault - the container runtime default profile should be used.
Unconfined - no profile should be applied.
@@ -6033,18 +5991,28 @@ spec:
type: object
supplementalGroups:
description: |-
- A list of groups applied to the first process run in each container, in addition
- to the container's primary GID, the fsGroup (if specified), and group memberships
- defined in the container image for the uid of the container process. If unspecified,
- no additional groups are added to any container. Note that group memberships
- defined in the container image for the uid of the container process are still effective,
- even if they are not included in this list.
+ A list of groups applied to the first process run in each container, in
+ addition to the container's primary GID and fsGroup (if specified). If
+ the SupplementalGroupsPolicy feature is enabled, the
+ supplementalGroupsPolicy field determines whether these are in addition
+ to or instead of any group memberships defined in the container image.
+ If unspecified, no additional groups are added, though group memberships
+ defined in the container image may still be used, depending on the
+ supplementalGroupsPolicy field.
Note that this field cannot be set when spec.os.name is windows.
items:
format: int64
type: integer
type: array
x-kubernetes-list-type: atomic
+ supplementalGroupsPolicy:
+ description: |-
+ Defines how supplemental groups of the first container processes are calculated.
+ Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ and the container runtime must implement support for this feature.
+ Note that this field cannot be set when spec.os.name is windows.
+ type: string
sysctls:
description: |-
Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
@@ -6252,7 +6220,6 @@ spec:
Keys that don't exist in the incoming pod labels will
be ignored. A null or empty list means only match against labelSelector.
-
This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
items:
type: string
@@ -6292,7 +6259,6 @@ spec:
Valid values are integers greater than 0.
When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
-
For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
labelSelector spread as 2/2/2:
| zone1 | zone2 | zone3 |
@@ -6310,7 +6276,6 @@ spec:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
-
If this value is nil, the behavior is equivalent to the Honor policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -6322,7 +6287,6 @@ spec:
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.
-
If this value is nil, the behavior is equivalent to the Ignore policy.
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
type: string
@@ -6391,7 +6355,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -6432,6 +6395,7 @@ spec:
in the blob storage
type: string
fsType:
+ default: ext4
description: |-
fsType is Filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -6445,6 +6409,7 @@ spec:
availability set). defaults to shared'
type: string
readOnly:
+ default: false
description: |-
readOnly Defaults to false (read/write). ReadOnly here will force
the ReadOnly setting in VolumeMounts.
@@ -6516,9 +6481,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6560,9 +6523,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6635,9 +6596,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether the
@@ -6676,9 +6635,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -6822,7 +6779,6 @@ spec:
The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
and deleted when the pod is removed.
-
Use this if:
a) the volume is only needed while the pod runs,
b) features of normal volumes like restoring from snapshot or capacity
@@ -6833,17 +6789,14 @@ spec:
information on the connection between this volume type
and PersistentVolumeClaim).
-
Use PersistentVolumeClaim or one of the vendor-specific
APIs for volumes that persist for longer than the lifecycle
of an individual pod.
-
Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
be used that way - see the documentation of the driver for
more information.
-
A pod can use both types of ephemeral volumes and
persistent volumes at the same time.
properties:
@@ -6857,7 +6810,6 @@ spec:
entry. Pod validation will reject the pod if the concatenated name
is not valid for a PVC (for example, too long).
-
An existing PVC with that name that is not owned by the pod
will *not* be used for the pod to avoid using an unrelated
volume by mistake. Starting the pod is then blocked until
@@ -6867,11 +6819,9 @@ spec:
this should not be necessary, but it may be useful when
manually reconstructing a broken cluster.
-
This field is read-only and no changes will be made by Kubernetes
to the PVC after it has been created.
-
Required, must not be nil.
properties:
metadata:
@@ -7093,7 +7043,7 @@ spec:
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
type: string
volumeMode:
description: |-
@@ -7120,7 +7070,6 @@ spec:
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
lun:
description: 'lun is Optional: FC target lun
@@ -7189,9 +7138,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7226,7 +7173,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
partition:
description: |-
@@ -7307,9 +7253,6 @@ spec:
used for system agents or other privileged things that are allowed
to see the host machine. Most containers will NOT need this.
More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
- ---
- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not
- mount host directories as read/write.
properties:
path:
description: |-
@@ -7326,6 +7269,41 @@ spec:
required:
- path
type: object
+ image:
+ description: |-
+ image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ The volume is resolved at pod startup depending on which PullPolicy value is provided:
+
+ - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+
+ The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ The volume will be mounted read-only (ro) and non-executable files (noexec).
+ Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ properties:
+ pullPolicy:
+ description: |-
+ Policy for pulling OCI objects. Possible values are:
+ Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ type: string
+ reference:
+ description: |-
+ Required: Image or artifact reference to be used.
+ Behaves in the same way as pod.spec.containers[*].image.
+ Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ More info: https://kubernetes.io/docs/concepts/containers/images
+ This field is optional to allow higher level config management to default or override
+ container images in workload controllers like Deployments and StatefulSets.
+ type: string
+ type: object
iscsi:
description: |-
iscsi represents an ISCSI Disk resource that is attached to a
@@ -7346,7 +7324,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
initiatorName:
description: |-
@@ -7359,6 +7336,7 @@ spec:
Name.
type: string
iscsiInterface:
+ default: default
description: |-
iscsiInterface is the interface Name that uses an iSCSI transport.
Defaults to 'default' (tcp).
@@ -7392,9 +7370,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -7514,25 +7490,24 @@ spec:
format: int32
type: integer
sources:
- description: sources is the list of volume
- projections
+ description: |-
+ sources is the list of volume projections. Each entry in this list
+ handles one source.
items:
- description: Projection that may be projected
- along with other supported volume types
+ description: |-
+ Projection that may be projected along with other supported volume types.
+ Exactly one of these fields must be set.
properties:
clusterTrustBundle:
description: |-
ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
of ClusterTrustBundle objects in an auto-updating file.
-
Alpha, gated by the ClusterTrustBundleProjection feature gate.
-
ClusterTrustBundle objects can either be selected by name, or by the
combination of signer name and a label selector.
-
Kubelet performs aggressive normalization of the PEM contents written
into the pod filesystem. Esoteric PEM features such as inter-block
comments and block headers are stripped. Certificates are deduplicated.
@@ -7669,9 +7644,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional specify whether
@@ -7820,9 +7793,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: optional field specify
@@ -7914,7 +7885,6 @@ spec:
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
- TODO: how do we prevent errors in the filesystem from compromising the machine
type: string
image:
description: |-
@@ -7922,6 +7892,7 @@ spec:
More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
type: string
keyring:
+ default: /etc/ceph/keyring
description: |-
keyring is the path to key ring for RBDUser.
Default is /etc/ceph/keyring.
@@ -7936,6 +7907,7 @@ spec:
type: array
x-kubernetes-list-type: atomic
pool:
+ default: rbd
description: |-
pool is the rados pool name.
Default is rbd.
@@ -7961,13 +7933,12 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
user:
+ default: admin
description: |-
user is the rados user name.
Default is admin.
@@ -7982,6 +7953,7 @@ spec:
volume attached and mounted on Kubernetes nodes.
properties:
fsType:
+ default: xfs
description: |-
fsType is the filesystem type to mount.
Must be a filesystem type supported by the host operating system.
@@ -8014,9 +7986,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8026,6 +7996,7 @@ spec:
false
type: boolean
storageMode:
+ default: ThinProvisioned
description: |-
storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
Default is ThinProvisioned.
@@ -8140,9 +8111,7 @@ spec:
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
- TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
@@ -8312,7 +8281,6 @@ spec:
description: |-
resourceUsage keeps track of the total resources all the pods in the podset need to run.
-
Beside what is provided in podSet's specs, this calculation takes into account
the LimitRange defaults and RuntimeClass overheads at the moment of admission.
This field will not change in case of quota reclaim.
@@ -8464,25 +8432,15 @@ spec:
conditions hold the latest available observations of the Workload
current state.
-
The type of the condition could be:
-
- Admitted: the Workload was admitted through a ClusterQueue.
- Finished: the associated workload finished running (failed or succeeded).
- PodsReady: at least `.spec.podSets[*].count` Pods are ready or have
succeeded.
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource.\n---\nThis struct is intended for
- direct use as an array at the field path .status.conditions. For
- example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
- observations of a foo's current state.\n\t // Known .status.conditions.type
- are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
- +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
- \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
- patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
- \ // other fields\n\t}"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -8523,12 +8481,7 @@ spec:
- Unknown
type: string
type:
- description: |-
- type of condition in CamelCase or in foo.example.com/CamelCase.
- ---
- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
- useful (see .node.status.conditions), the ability to deconflict is important.
- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
diff --git a/config/components/crd/kustomization.yaml b/config/components/crd/kustomization.yaml
index e2f85f1088d..b87cb805af3 100644
--- a/config/components/crd/kustomization.yaml
+++ b/config/components/crd/kustomization.yaml
@@ -4,6 +4,7 @@
resources:
- bases/kueue.x-k8s.io_localqueues.yaml
- bases/kueue.x-k8s.io_clusterqueues.yaml
+- bases/kueue.x-k8s.io_cohorts.yaml
- bases/kueue.x-k8s.io_workloads.yaml
- bases/kueue.x-k8s.io_resourceflavors.yaml
- bases/kueue.x-k8s.io_admissionchecks.yaml
diff --git a/config/components/manager/controller_manager_config.yaml b/config/components/manager/controller_manager_config.yaml
index c0a9f597315..866d3939dc4 100644
--- a/config/components/manager/controller_manager_config.yaml
+++ b/config/components/manager/controller_manager_config.yaml
@@ -16,6 +16,7 @@ controller:
Pod: 5
Workload.kueue.x-k8s.io: 5
LocalQueue.kueue.x-k8s.io: 1
+ Cohort.kueue.x-k8s.io: 1
ClusterQueue.kueue.x-k8s.io: 1
ResourceFlavor.kueue.x-k8s.io: 1
clientConnection:
diff --git a/config/components/rbac/role.yaml b/config/components/rbac/role.yaml
index 4296c83b704..d708ec07992 100644
--- a/config/components/rbac/role.yaml
+++ b/config/components/rbac/role.yaml
@@ -17,13 +17,6 @@ rules:
- ""
resources:
- limitranges
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - ""
- resources:
- namespaces
verbs:
- get
@@ -78,6 +71,7 @@ rules:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
+ - validatingwebhookconfigurations
verbs:
- get
- list
@@ -86,11 +80,11 @@ rules:
- apiGroups:
- admissionregistration.k8s.io
resources:
- - validatingwebhookconfigurations
+ - validatingadmissionpolicies
+ - validatingadmissionpolicybindings
verbs:
- get
- list
- - update
- watch
- apiGroups:
- autoscaling.x-k8s.io
@@ -124,13 +118,6 @@ rules:
- batch
resources:
- jobs/finalizers
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - batch
- resources:
- jobs/status
verbs:
- get
@@ -140,6 +127,7 @@ rules:
- flowcontrol.apiserver.k8s.io
resources:
- flowschemas
+ - prioritylevelconfigurations
verbs:
- list
- watch
@@ -149,13 +137,6 @@ rules:
- flowschemas/status
verbs:
- patch
-- apiGroups:
- - flowcontrol.apiserver.k8s.io
- resources:
- - prioritylevelconfigurations
- verbs:
- - list
- - watch
- apiGroups:
- jobset.x-k8s.io
resources:
@@ -185,30 +166,11 @@ rules:
- kubeflow.org
resources:
- mpijobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - kubeflow.org
- resources:
- - mpijobs/finalizers
- verbs:
- - get
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - mpijobs/status
- verbs:
- - get
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- mxjobs
+ - paddlejobs
+ - pytorchjobs
+ - tfjobs
+ - xgboostjobs
verbs:
- get
- list
@@ -218,105 +180,12 @@ rules:
- apiGroups:
- kubeflow.org
resources:
+ - mpijobs/finalizers
- mxjobs/finalizers
- verbs:
- - get
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- mxjobs/status
- verbs:
- - get
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - paddlejobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - kubeflow.org
- resources:
- paddlejobs/finalizers
- verbs:
- - get
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - paddlejobs/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - pytorchjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - kubeflow.org
- resources:
- pytorchjobs/finalizers
- verbs:
- - get
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - pytorchjobs/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - tfjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - kubeflow.org
- resources:
- tfjobs/finalizers
- verbs:
- - get
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - tfjobs/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - kubeflow.org
- resources:
- - xgboostjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - kubeflow.org
- resources:
- xgboostjobs/finalizers
verbs:
- get
@@ -324,6 +193,10 @@ rules:
- apiGroups:
- kubeflow.org
resources:
+ - mpijobs/status
+ - paddlejobs/status
+ - pytorchjobs/status
+ - tfjobs/status
- xgboostjobs/status
verbs:
- get
@@ -333,58 +206,10 @@ rules:
- kueue.x-k8s.io
resources:
- admissionchecks
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - admissionchecks/finalizers
- verbs:
- - update
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - admissionchecks/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- clusterqueues
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - clusterqueues/finalizers
- verbs:
- - update
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - clusterqueues/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - kueue.x-k8s.io
- resources:
+ - cohorts
- localqueues
+ - workloads
verbs:
- create
- delete
@@ -396,29 +221,21 @@ rules:
- apiGroups:
- kueue.x-k8s.io
resources:
+ - admissionchecks/finalizers
+ - clusterqueues/finalizers
- localqueues/finalizers
+ - resourceflavors/finalizers
+ - workloads/finalizers
verbs:
- update
- apiGroups:
- kueue.x-k8s.io
resources:
+ - admissionchecks/status
+ - clusterqueues/status
- localqueues/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - multikueueclusters
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- multikueueclusters/status
+ - workloads/status
verbs:
- get
- patch
@@ -426,38 +243,9 @@ rules:
- apiGroups:
- kueue.x-k8s.io
resources:
+ - multikueueclusters
- multikueueconfigs
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- provisioningrequestconfigs
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - resourceflavors
- verbs:
- - delete
- - get
- - list
- - update
- - watch
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - resourceflavors/finalizers
- verbs:
- - update
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- workloadpriorityclasses
verbs:
- get
@@ -466,29 +254,13 @@ rules:
- apiGroups:
- kueue.x-k8s.io
resources:
- - workloads
+ - resourceflavors
verbs:
- - create
- delete
- get
- list
- - patch
- update
- watch
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - workloads/finalizers
- verbs:
- - update
-- apiGroups:
- - kueue.x-k8s.io
- resources:
- - workloads/status
- verbs:
- - get
- - patch
- - update
- apiGroups:
- node.k8s.io
resources:
@@ -501,6 +273,7 @@ rules:
- ray.io
resources:
- rayclusters
+ - rayjobs
verbs:
- get
- list
@@ -511,36 +284,8 @@ rules:
- ray.io
resources:
- rayclusters/finalizers
- verbs:
- - get
- - update
-- apiGroups:
- - ray.io
- resources:
- rayclusters/status
- verbs:
- - get
- - update
-- apiGroups:
- - ray.io
- resources:
- - rayjobs
- verbs:
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - ray.io
- resources:
- rayjobs/finalizers
- verbs:
- - get
- - update
-- apiGroups:
- - ray.io
- resources:
- rayjobs/status
verbs:
- get
diff --git a/config/components/visibility-apf/flowschema.yaml b/config/components/visibility-apf/flowschema.yaml
new file mode 100644
index 00000000000..091cb310595
--- /dev/null
+++ b/config/components/visibility-apf/flowschema.yaml
@@ -0,0 +1,29 @@
+apiVersion: flowcontrol.apiserver.k8s.io/v1
+kind: FlowSchema
+metadata:
+ name: visibility
+ namespace: system
+spec:
+ distinguisherMethod:
+ type: ByUser
+ matchingPrecedence: 9000
+ priorityLevelConfiguration:
+ name: kueue-visibility
+ rules:
+ - resourceRules:
+ - apiGroups:
+ - 'visibility.kueue.x-k8s.io'
+ clusterScope: true
+ namespaces:
+ - '*'
+ resources:
+ - '*'
+ verbs:
+ - '*'
+ subjects:
+ - group:
+ name: system:unauthenticated
+ kind: Group
+ - group:
+ name: system:authenticated
+ kind: Group
diff --git a/config/components/visibility-apf/kustomization.yaml b/config/components/visibility-apf/kustomization.yaml
new file mode 100644
index 00000000000..40d982fc913
--- /dev/null
+++ b/config/components/visibility-apf/kustomization.yaml
@@ -0,0 +1,3 @@
+resources:
+- flowschema.yaml
+- prioritylevelconfigurations.yaml
diff --git a/config/components/visibility-apf/prioritylevelconfigurations.yaml b/config/components/visibility-apf/prioritylevelconfigurations.yaml
new file mode 100644
index 00000000000..d8faf5fb674
--- /dev/null
+++ b/config/components/visibility-apf/prioritylevelconfigurations.yaml
@@ -0,0 +1,16 @@
+apiVersion: flowcontrol.apiserver.k8s.io/v1
+kind: PriorityLevelConfiguration
+metadata:
+ name: visibility
+ namespace: system
+spec:
+ limited:
+ lendablePercent: 90
+ limitResponse:
+ queuing:
+ handSize: 4
+ queueLengthLimit: 50
+ queues: 16
+ type: Queue
+ nominalConcurrencyShares: 10
+ type: Limited
\ No newline at end of file
diff --git a/config/components/visibility/apiservice.yaml b/config/components/visibility/apiservice_v1alpha1.yaml
similarity index 92%
rename from config/components/visibility/apiservice.yaml
rename to config/components/visibility/apiservice_v1alpha1.yaml
index 9b2060c1f6e..054ea07d629 100644
--- a/config/components/visibility/apiservice.yaml
+++ b/config/components/visibility/apiservice_v1alpha1.yaml
@@ -10,4 +10,4 @@ spec:
name: visibility-server
namespace: kueue-system
version: v1alpha1
- versionPriority: 100
+ versionPriority: 100
\ No newline at end of file
diff --git a/config/components/visibility/apiservice_v1beta1.yaml b/config/components/visibility/apiservice_v1beta1.yaml
new file mode 100644
index 00000000000..1dc275ab478
--- /dev/null
+++ b/config/components/visibility/apiservice_v1beta1.yaml
@@ -0,0 +1,13 @@
+apiVersion: apiregistration.k8s.io/v1
+kind: APIService
+metadata:
+ name: v1beta1.visibility.kueue.x-k8s.io
+spec:
+ group: visibility.kueue.x-k8s.io
+ groupPriorityMinimum: 100
+ insecureSkipTLSVerify: true
+ service:
+ name: visibility-server
+ namespace: kueue-system
+ version: v1beta1
+ versionPriority: 100
\ No newline at end of file
diff --git a/config/components/visibility/kustomization.yaml b/config/components/visibility/kustomization.yaml
index ad7f432243d..9b130042ed1 100644
--- a/config/components/visibility/kustomization.yaml
+++ b/config/components/visibility/kustomization.yaml
@@ -1,4 +1,5 @@
resources:
-- apiservice.yaml
+- apiservice_v1alpha1.yaml
+- apiservice_v1beta1.yaml
- role_binding.yaml
- service.yaml
diff --git a/config/components/webhook/kustomization.yaml b/config/components/webhook/kustomization.yaml
index 1c17012696c..1139c55aab3 100644
--- a/config/components/webhook/kustomization.yaml
+++ b/config/components/webhook/kustomization.yaml
@@ -20,6 +20,14 @@ patches:
values:
- kube-system
- kueue-system
+ - name: mdeployment.kb.io
+ namespaceSelector:
+ matchExpressions:
+ - key: kubernetes.io/metadata.name
+ operator: NotIn
+ values:
+ - kube-system
+ - kueue-system
- patch: |-
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
@@ -34,3 +42,11 @@ patches:
values:
- kube-system
- kueue-system
+ - name: vdeployment.kb.io
+ namespaceSelector:
+ matchExpressions:
+ - key: kubernetes.io/metadata.name
+ operator: NotIn
+ values:
+ - kube-system
+ - kueue-system
diff --git a/config/components/webhook/manifests.yaml b/config/components/webhook/manifests.yaml
index 37ec2afb5eb..8424f0e6746 100644
--- a/config/components/webhook/manifests.yaml
+++ b/config/components/webhook/manifests.yaml
@@ -4,6 +4,25 @@ kind: MutatingWebhookConfiguration
metadata:
name: mutating-webhook-configuration
webhooks:
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /mutate-apps-v1-deployment
+ failurePolicy: Fail
+ name: mdeployment.kb.io
+ rules:
+ - apiGroups:
+ - apps
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ resources:
+ - deployments
+ sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
@@ -213,25 +232,6 @@ webhooks:
resources:
- rayjobs
sideEffects: None
-- admissionReviewVersions:
- - v1
- clientConfig:
- service:
- name: webhook-service
- namespace: system
- path: /mutate-apps-v1-deployment
- failurePolicy: Fail
- name: mdeployment.kb.io
- rules:
- - apiGroups:
- - apps
- apiVersions:
- - v1
- operations:
- - CREATE
- resources:
- - deployments
- sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
@@ -295,6 +295,26 @@ kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
webhooks:
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /validate-apps-v1-deployment
+ failurePolicy: Fail
+ name: vdeployment.kb.io
+ rules:
+ - apiGroups:
+ - apps
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - deployments
+ sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
@@ -521,19 +541,19 @@ webhooks:
service:
name: webhook-service
namespace: system
- path: /validate-apps-v1-deployment
+ path: /validate-kueue-x-k8s-io-v1beta1-clusterqueue
failurePolicy: Fail
- name: vdeployment.kb.io
+ name: vclusterqueue.kb.io
rules:
- apiGroups:
- - apps
+ - kueue.x-k8s.io
apiVersions:
- - v1
+ - v1beta1
operations:
- CREATE
- UPDATE
resources:
- - deployments
+ - clusterqueues
sideEffects: None
- admissionReviewVersions:
- v1
@@ -541,19 +561,19 @@ webhooks:
service:
name: webhook-service
namespace: system
- path: /validate-kueue-x-k8s-io-v1beta1-clusterqueue
+ path: /validate-kueue-x-k8s-io-v1alpha1-cohort
failurePolicy: Fail
- name: vclusterqueue.kb.io
+ name: vcohort.kb.io
rules:
- apiGroups:
- kueue.x-k8s.io
apiVersions:
- - v1beta1
+ - v1alpha1
operations:
- CREATE
- UPDATE
resources:
- - clusterqueues
+ - cohorts
sideEffects: None
- admissionReviewVersions:
- v1
diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml
index 5a802548154..b68f4b227ed 100644
--- a/config/default/kustomization.yaml
+++ b/config/default/kustomization.yaml
@@ -8,21 +8,21 @@ namespace: kueue-system
# field above.
namePrefix: kueue-
-# Labels to add to all resources and selectors.
-commonLabels:
- control-plane: controller-manager
-
labels:
- - pairs:
+ - pairs:
app.kubernetes.io/name: kueue
app.kubernetes.io/component: controller
includeTemplates: true
+ - pairs:
+ control-plane: controller-manager
+ includeSelectors: true
resources:
- ../components/crd
- ../components/rbac
- ../components/manager
- ../components/internalcert
+- ../components/visibility
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# ../components/crd/kustomization.yaml
- ../components/webhook
@@ -31,6 +31,10 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../components/prometheus
+transformers:
+# Sets the namespace for the role binding as kube-system instead of default kueue-system
+- role_binding_visibility_transformer.yaml
+
patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
diff --git a/config/visibility/role_binding_visibility_transformer.yaml b/config/default/role_binding_visibility_transformer.yaml
similarity index 100%
rename from config/visibility/role_binding_visibility_transformer.yaml
rename to config/default/role_binding_visibility_transformer.yaml
diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml
index de0f95dd796..0f4c12851ab 100644
--- a/config/prometheus/kustomization.yaml
+++ b/config/prometheus/kustomization.yaml
@@ -6,11 +6,11 @@ namePrefix: kueue-
resources:
- ../components/prometheus
-commonLabels:
- control-plane: controller-manager
-
labels:
- pairs:
app.kubernetes.io/name: kueue
app.kubernetes.io/component: controller
includeTemplates: true
+ - pairs:
+ control-plane: controller-manager
+ includeSelectors: true
diff --git a/config/visibility-apf/1_28/kustomization.yaml b/config/visibility-apf/1_28/kustomization.yaml
new file mode 100644
index 00000000000..23832e5e175
--- /dev/null
+++ b/config/visibility-apf/1_28/kustomization.yaml
@@ -0,0 +1,19 @@
+# This overlay builds the APF components for Kubernetes version 1.28 to be used in combination
+# with other overlays.
+
+resources:
+- ../default/
+
+patches:
+ - target:
+ kind: FlowSchema
+ patch: |
+ - op: replace
+ path: /apiVersion
+ value: flowcontrol.apiserver.k8s.io/v1beta3
+ - target:
+ kind: PriorityLevelConfiguration
+ patch: |
+ - op: replace
+ path: /apiVersion
+ value: flowcontrol.apiserver.k8s.io/v1beta3
\ No newline at end of file
diff --git a/config/visibility-apf/default/kustomization.yaml b/config/visibility-apf/default/kustomization.yaml
new file mode 100644
index 00000000000..914c81bdfd5
--- /dev/null
+++ b/config/visibility-apf/default/kustomization.yaml
@@ -0,0 +1,14 @@
+# This overlay builds the APF components to be used in combination
+# with other overlays.
+
+namespace: kueue-system
+namePrefix: kueue-
+
+labels:
+ - pairs:
+ app.kubernetes.io/name: kueue
+ app.kubernetes.io/component: controller
+ control-plane: controller-manager
+
+resources:
+ - ../../components/visibility-apf/
\ No newline at end of file
diff --git a/config/visibility/kustomization.yaml b/config/visibility/kustomization.yaml
deleted file mode 100644
index 21f11c3b92c..00000000000
--- a/config/visibility/kustomization.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-# This overlay builds the visibility component to be used in combination
-# with other overlays.
-
-namespace: kueue-system
-namePrefix: kueue-
-
-commonLabels:
- control-plane: controller-manager
-
-labels:
- - pairs:
- app.kubernetes.io/name: kueue
- app.kubernetes.io/component: controller
- includeTemplates: true
-
-resources:
-- ../components/visibility
-
-transformers:
-# Sets the namespace for the role binding as kube-system instead of default kueue-system
-- role_binding_visibility_transformer.yaml
\ No newline at end of file
diff --git a/go.mod b/go.mod
index c25e879ba91..fedcf8d2de5 100644
--- a/go.mod
+++ b/go.mod
@@ -1,36 +1,38 @@
module sigs.k8s.io/kueue
-go 1.22.6
+go 1.23
require (
github.com/fsnotify/fsnotify v1.7.0
github.com/go-logr/logr v1.4.2
github.com/google/go-cmp v0.6.0
github.com/kubeflow/mpi-operator v0.5.0
- github.com/kubeflow/training-operator v1.8.0
+ github.com/kubeflow/training-operator v1.8.1
github.com/onsi/ginkgo/v2 v2.20.2
github.com/onsi/gomega v1.34.2
- github.com/open-policy-agent/cert-controller v0.10.1
- github.com/prometheus/client_golang v1.20.2
+ github.com/open-policy-agent/cert-controller v0.11.0
+ github.com/prometheus/client_golang v1.20.4
github.com/prometheus/client_model v0.6.1
- github.com/ray-project/kuberay/ray-operator v1.2.1
+ github.com/ray-project/kuberay/ray-operator v1.2.2
github.com/spf13/cobra v1.8.1
+ github.com/spf13/pflag v1.0.5
go.uber.org/zap v1.27.0
- k8s.io/api v0.30.4
- k8s.io/apimachinery v0.30.4
- k8s.io/apiserver v0.29.8
- k8s.io/autoscaler/cluster-autoscaler/apis v0.0.0-20240325113845-0130d33747bb
- k8s.io/cli-runtime v0.29.8
- k8s.io/client-go v0.29.8
- k8s.io/component-base v0.29.8
- k8s.io/component-helpers v0.29.8
+ gomodules.xyz/jsonpatch/v2 v2.4.0
+ k8s.io/api v0.31.1
+ k8s.io/apimachinery v0.31.1
+ k8s.io/apiserver v0.31.1
+ k8s.io/autoscaler/cluster-autoscaler/apis v0.0.0-20240813092541-aec7b75bb683
+ k8s.io/cli-runtime v0.31.1
+ k8s.io/client-go v0.31.1
+ k8s.io/component-base v0.31.1
+ k8s.io/component-helpers v0.31.1
k8s.io/klog/v2 v2.130.1
- k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b
- k8s.io/kubectl v0.29.8
- k8s.io/metrics v0.29.8
- k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
- sigs.k8s.io/controller-runtime v0.17.5
- sigs.k8s.io/jobset v0.5.2
+ k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f
+ k8s.io/kubectl v0.31.1
+ k8s.io/metrics v0.31.1
+ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
+ sigs.k8s.io/controller-runtime v0.19.0
+ sigs.k8s.io/jobset v0.6.0
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
sigs.k8s.io/yaml v1.4.0
)
@@ -39,7 +41,7 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
- github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1 // indirect
+ github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
@@ -48,13 +50,12 @@ require (
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
- github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
- github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
- github.com/fvbommel/sortorder v1.1.0 // indirect
+ github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
@@ -66,7 +67,7 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.0.1 // indirect
- github.com/google/cel-go v0.17.7 // indirect
+ github.com/google/cel-go v0.20.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
@@ -85,8 +86,8 @@ require (
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
- github.com/moby/spdystream v0.2.0 // indirect
- github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
+ github.com/moby/spdystream v0.4.0 // indirect
+ github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
@@ -96,26 +97,24 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/common v0.57.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
- github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
- github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
+ github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
- go.etcd.io/etcd/api/v3 v3.5.11 // indirect
+ go.etcd.io/etcd/api/v3 v3.5.14 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect
- go.etcd.io/etcd/client/v3 v3.5.11 // indirect
- go.etcd.io/etcd/server/v3 v3.5.11 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 // indirect
- go.opentelemetry.io/otel v1.20.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect
- go.opentelemetry.io/otel/metric v1.20.0 // indirect
- go.opentelemetry.io/otel/sdk v1.20.0 // indirect
- go.opentelemetry.io/otel/trace v1.20.0 // indirect
- go.opentelemetry.io/proto/otlp v1.0.0 // indirect
+ go.etcd.io/etcd/client/v3 v3.5.14 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
+ go.opentelemetry.io/otel v1.28.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
+ go.opentelemetry.io/otel/metric v1.28.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.28.0 // indirect
+ go.opentelemetry.io/otel/trace v1.28.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
@@ -130,23 +129,22 @@ require (
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.24.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
- google.golang.org/grpc v1.64.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
+ google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
+ gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.29.6 // indirect
- k8s.io/code-generator v0.29.8 // indirect
- k8s.io/gengo v0.0.0-20240404160639-a0386bf69313 // indirect
- k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 // indirect
- k8s.io/kms v0.29.8 // indirect
+ k8s.io/apiextensions-apiserver v0.31.1 // indirect
+ k8s.io/code-generator v0.31.1 // indirect
+ k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59 // indirect
+ k8s.io/kms v0.31.1 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
- sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect
- sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
+ sigs.k8s.io/kustomize/api v0.17.3 // indirect
+ sigs.k8s.io/kustomize/kyaml v0.17.2 // indirect
)
diff --git a/go.sum b/go.sum
index 0486a3a9507..3873fd15983 100644
--- a/go.sum
+++ b/go.sum
@@ -1,8 +1,4 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY=
-cloud.google.com/go/compute v1.27.0 h1:EGawh2RUnfHT5g8f/FX3Ds6KZuIBC77hZoDrBvEZw94=
-cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
-cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -10,8 +6,8 @@ github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
-github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1 h1:X8MJ0fnN5FPdcGF5Ij2/OW+HgiJrRg3AfHAx1PJtIzM=
-github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
+github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
+github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
@@ -31,8 +27,6 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc=
-github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
@@ -41,16 +35,15 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=
-github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew=
github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls=
github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
@@ -61,11 +54,10 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
-github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw=
-github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
+github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
+github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
-github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
@@ -102,8 +94,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
-github.com/google/cel-go v0.17.7 h1:6ebJFzu1xO2n7TLtN+UBqShGBhlD85bhvglh5DpcfqQ=
-github.com/google/cel-go v0.17.7/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY=
+github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84=
+github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -116,7 +108,6 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
@@ -125,7 +116,6 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
@@ -154,17 +144,14 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
-github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubeflow/mpi-operator v0.5.0 h1:XvBwyXXQ9103DNMa22sxsaQlaktvaT2LY/g0UniGn5U=
github.com/kubeflow/mpi-operator v0.5.0/go.mod h1:SeZQJW8KJxSTWD++eQYKRFpoDg1v8yrdC6fjx2/3mG0=
-github.com/kubeflow/training-operator v1.8.0 h1:cHXIz7BV3Ayp7W5Rqe20/ukmVEzraI+O/XRYKBHQcrg=
-github.com/kubeflow/training-operator v1.8.0/go.mod h1:T6I15h1S09ncH5C6St/QEC7Dy6dpHZA5sPFo+VoJAvE=
+github.com/kubeflow/training-operator v1.8.1 h1:mVvoBSCInbMBX0gGSn4+Ihj3ycwoLO1iEAw+0qPhQfc=
+github.com/kubeflow/training-operator v1.8.1/go.mod h1:T6I15h1S09ncH5C6St/QEC7Dy6dpHZA5sPFo+VoJAvE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
@@ -173,10 +160,10 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
-github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
-github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
-github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA=
-github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
+github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8=
+github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
+github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
+github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -192,18 +179,19 @@ github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4
github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag=
github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
-github.com/open-policy-agent/cert-controller v0.10.1 h1:RXSYoyn8FdCenWecRP//UV5nbVfmstNpj4kHQFkvPK4=
-github.com/open-policy-agent/cert-controller v0.10.1/go.mod h1:4uRbBLY5DsPOog+a9pqk3JLxuuhrWsbUedQW65HcLTI=
+github.com/open-policy-agent/cert-controller v0.11.0 h1:zXaXeaS4eRAZXhUH5SxWqky681Y2KWjQv/z3X8iMcaQ=
+github.com/open-policy-agent/cert-controller v0.11.0/go.mod h1:456gr2XKHzxDOjxJZUST5rLIX8olrHkBUymy49FZzps=
github.com/open-policy-agent/frameworks/constraint v0.0.0-20230822235116-f0b62fe1e4c4 h1:5dum5SLEz+95JDLkMls7Z7IDPjvSq3UhJSFe4f5einQ=
github.com/open-policy-agent/frameworks/constraint v0.0.0-20230822235116-f0b62fe1e4c4/go.mod h1:54/KzLMvA5ndBVpm7B1OjLeV0cUtTLTz2bZ2OtydLpU=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg=
-github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
+github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
@@ -211,14 +199,14 @@ github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVho
github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
-github.com/ray-project/kuberay/ray-operator v1.2.1 h1:H7ofodGclghsU2TxbDHs+gvqvsOp5DJ/vAPGySL1DIE=
-github.com/ray-project/kuberay/ray-operator v1.2.1/go.mod h1:osTiIyaDoWi5IN1f0tOOtZ4TzVf+5kJXZor8VFvcEiI=
+github.com/ray-project/kuberay/ray-operator v1.2.2 h1:wj4qe9SmJfD1ubgEaVPuAsnU/WFDvremzR8j3JslBdk=
+github.com/ray-project/kuberay/ray-operator v1.2.2/go.mod h1:osTiIyaDoWi5IN1f0tOOtZ4TzVf+5kJXZor8VFvcEiI=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
-github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
+github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
+github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
@@ -243,46 +231,48 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
+github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
+github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
-go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
-go.etcd.io/etcd/api/v3 v3.5.11 h1:B54KwXbWDHyD3XYAwprxNzTe7vlhR69LuBgZnMVvS7E=
-go.etcd.io/etcd/api/v3 v3.5.11/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4=
+go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI=
+go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE=
+go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0=
+go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU=
go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ=
go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI=
-go.etcd.io/etcd/client/v2 v2.305.11 h1:ZqdKLNJnWpE3bUaaj3XZ5xWyCi+7Vspgk9E0hlIBguE=
-go.etcd.io/etcd/client/v2 v2.305.11/go.mod h1:vX2j5tMynwOateY6BfVmLol3gYOIkbhqjs/BqRsdIOw=
-go.etcd.io/etcd/client/v3 v3.5.11 h1:ajWtgoNSZJ1gmS8k+icvPtqsqEav+iUorF7b0qozgUU=
-go.etcd.io/etcd/client/v3 v3.5.11/go.mod h1:a6xQUEqFJ8vztO1agJh/KQKOMfFI8og52ZconzcDJwE=
-go.etcd.io/etcd/pkg/v3 v3.5.11 h1:U5+/mZh+jps8VRWv7+xPiK1tC1hRBOBYdn7zCqtWyOY=
-go.etcd.io/etcd/pkg/v3 v3.5.11/go.mod h1:bLfwo6YEgpOAMBZJsZg5AiSS+mxNTRJi15Dvp9kKW68=
-go.etcd.io/etcd/raft/v3 v3.5.11 h1:eeimaNIT9DjV4bdLSy4FjLQ/KGSAiG1L5T1nTf5VoZg=
-go.etcd.io/etcd/raft/v3 v3.5.11/go.mod h1:Tp7kZJVtWJWLiMCPrgkimiOB5ZYi8YM93onQihpG724=
-go.etcd.io/etcd/server/v3 v3.5.11 h1:FEa0ImvoXdIPa81/vZUKpnJ74fpQ5ZivseoIKMPzfpg=
-go.etcd.io/etcd/server/v3 v3.5.11/go.mod h1:CS0+TwcuRlhg1I5CpA3YlisOcoqJB1h1GMRgje75uDs=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 h1:1eHu3/pUSWaOgltNK3WJFaywKsTIr/PwvHyDmi0lQA0=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0/go.mod h1:HyABWq60Uy1kjJSa2BVOxUVao8Cdick5AWSKPutqy6U=
-go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc=
-go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0=
-go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA=
-go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM=
-go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM=
-go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0=
-go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ=
-go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU=
-go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
-go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
+go.etcd.io/etcd/client/v2 v2.305.13 h1:RWfV1SX5jTU0lbCvpVQe3iPQeAHETWdOTb6pxhd77C8=
+go.etcd.io/etcd/client/v2 v2.305.13/go.mod h1:iQnL7fepbiomdXMb3om1rHq96htNNGv2sJkEcZGDRRg=
+go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg=
+go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk=
+go.etcd.io/etcd/pkg/v3 v3.5.13 h1:st9bDWNsKkBNpP4PR1MvM/9NqUPfvYZx/YXegsYEH8M=
+go.etcd.io/etcd/pkg/v3 v3.5.13/go.mod h1:N+4PLrp7agI/Viy+dUYpX7iRtSPvKq+w8Y14d1vX+m0=
+go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA=
+go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw=
+go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok=
+go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
+go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
+go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ=
+go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
+go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
+go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
+go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
+go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
+go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
+go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
+go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY=
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
@@ -352,7 +342,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
@@ -372,13 +361,13 @@ google.golang.org/genproto v0.0.0-20240528184218-531527333157 h1:u7WMYrIrVvs0TF5
google.golang.org/genproto v0.0.0-20240528184218-531527333157/go.mod h1:ubQlAQnzejB8uZzszhrTCU2Fyp6Vi7ZE5nn0c3W8+qQ=
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
-google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
+google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
+google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -390,9 +379,10 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
+gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
@@ -405,59 +395,55 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-k8s.io/api v0.30.4 h1:XASIELmW8w8q0i1Y4124LqPoWMycLjyQti/fdYHYjCs=
-k8s.io/api v0.30.4/go.mod h1:ZqniWRKu7WIeLijbbzetF4U9qZ03cg5IRwl8YVs8mX0=
-k8s.io/apiextensions-apiserver v0.29.6 h1:tUu1N6Zt9GT8KVcPF5aGDqfISz1mveM4yFh7eL5bxmE=
-k8s.io/apiextensions-apiserver v0.29.6/go.mod h1:iw1EbwZat08I219qrQKoFMHGo7J9KxPqMpVKxCbNbCs=
-k8s.io/apimachinery v0.30.4 h1:5QHQI2tInzr8LsT4kU/2+fSeibH1eIHswNx480cqIoY=
-k8s.io/apimachinery v0.30.4/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
-k8s.io/apiserver v0.29.8 h1:A1PA+cmSPm2zevCesT+Qsc1NWeucbz88mERd5TA7Ho4=
-k8s.io/apiserver v0.29.8/go.mod h1:jrKeEcCNY0K/lVlZ4gITRVYx5L0pPxj+cOR2MHTAOo0=
-k8s.io/autoscaler/cluster-autoscaler/apis v0.0.0-20240325113845-0130d33747bb h1:ycQ/tSpcJEUHHx0pv6MXdq4NcRflCvFX6SMwmKROiis=
-k8s.io/autoscaler/cluster-autoscaler/apis v0.0.0-20240325113845-0130d33747bb/go.mod h1:LPhCVj3E5Lp9W6HGVlW664m/X+KN2firfF3wtBBji54=
-k8s.io/cli-runtime v0.29.8 h1:kVErAPf1v7MOwNO6rBYnf2i4kQ2668Y9pHGO5C1/wSo=
-k8s.io/cli-runtime v0.29.8/go.mod h1:c00Fk85K05DtEknMAi1t7ao1MR4nmQ9YlvC+QluvNoY=
-k8s.io/client-go v0.29.8 h1:QMRKcIzqE/qawknXcsi51GdIAYN8UP39S/M5KnFu/J0=
-k8s.io/client-go v0.29.8/go.mod h1:ZzrAAVrqO2jVXMb8My/jTke8n0a/mIynnA3y/1y1UB0=
-k8s.io/code-generator v0.29.8 h1:RQ6kM269HlPvmX4BDyjwPwCzsV6Gqa+rtmE96t9csbg=
-k8s.io/code-generator v0.29.8/go.mod h1:7TYnI0dYItL2cKuhhgPSuF3WED9uMdELgbVXFfn/joE=
-k8s.io/component-base v0.29.8 h1:4LJ94/eOJpDFZFbGbRH4CEyk29a7PZr8noVe9tBJUUY=
-k8s.io/component-base v0.29.8/go.mod h1:FYOQSsKgh9/+FNleq8m6cXH2Cq8fNiUnJzDROowLaqU=
-k8s.io/component-helpers v0.29.8 h1:lSS7dHAwQE68HBLi7e2dwvnkOWTni0NCzvBO8g62tmI=
-k8s.io/component-helpers v0.29.8/go.mod h1:vSJpyj7Amkw+1+nNp81It6vLRAuLQx8FHz3q1vb5wUI=
-k8s.io/gengo v0.0.0-20240404160639-a0386bf69313 h1:wBIDZID8ju9pwOiLlV22YYKjFGtiNSWgHf5CnKLRUuM=
-k8s.io/gengo v0.0.0-20240404160639-a0386bf69313/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
-k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 h1:bKcdZJOPICVmIIuaM9+MXmapE94dn5AYv5ODs1jA43o=
-k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
-k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
+k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
+k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
+k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
+k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
+k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
+k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
+k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c=
+k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM=
+k8s.io/autoscaler/cluster-autoscaler/apis v0.0.0-20240813092541-aec7b75bb683 h1:G9rrQ7dJ1E1u3QazftRTuidaZW0XUzxERV/Uo9zeU/4=
+k8s.io/autoscaler/cluster-autoscaler/apis v0.0.0-20240813092541-aec7b75bb683/go.mod h1:VJdfvO7iPTPM/zc5zjFFvIH3zXZKPAEItzRAB/gZrwA=
+k8s.io/cli-runtime v0.31.1 h1:/ZmKhmZ6hNqDM+yf9s3Y4KEYakNXUn5sod2LWGGwCuk=
+k8s.io/cli-runtime v0.31.1/go.mod h1:pKv1cDIaq7ehWGuXQ+A//1OIF+7DI+xudXtExMCbe9U=
+k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
+k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
+k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs=
+k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs=
+k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8=
+k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w=
+k8s.io/component-helpers v0.31.1 h1:5hZUf3747atdgtR3gPntrG35rC2CkK7rYq2KUraz6Os=
+k8s.io/component-helpers v0.31.1/go.mod h1:ye0Gi8KzFNTfpIuzvVDtxJQMP/0Owkukf1vGf22Hl6U=
+k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59 h1:PfhT3P5Y7psqhl0D77Rj2B7RH77eid/wBttxlMTxXag=
+k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kms v0.29.8 h1:Seff+4ut5lkPSFDbsEgJ6NfQRdgRuKO0zqKrCMVWEhY=
-k8s.io/kms v0.29.8/go.mod h1:vWVImKkJd+1BQY4tBwdfSwjQBiLrnbNtHADcDEDQFtk=
-k8s.io/kube-aggregator v0.28.1 h1:rvG4llYnQKHjj6YjjoBPEJxfD1uH0DJwkrJTNKGAaCs=
-k8s.io/kube-aggregator v0.28.1/go.mod h1:JaLizMe+AECSpO2OmrWVsvnG0V3dX1RpW+Wq/QHbu18=
-k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b h1:Q9xmGWBvOGd8UJyccgpYlLosk/JlfP3xQLNkQlHJeXw=
-k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
-k8s.io/kubectl v0.29.8 h1:JuMEjC+dCSWwF3Z4L22MFE7TvdOZn5bZ/qcNkQUz9J0=
-k8s.io/kubectl v0.29.8/go.mod h1:x9o1S8AqTk+/C+e8EaRRhQLw5w0Jadd+4S/vsEAVA4c=
-k8s.io/metrics v0.29.8 h1:GviK3dMTPEu/o9nwCAt4MGgT+tZe/3SPRevQo3/jUUo=
-k8s.io/metrics v0.29.8/go.mod h1:so/CsvfD27YPLUi1BQBdidYDi7dzZvns9P88oO2L6jA=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/kms v0.31.1 h1:cGLyV3cIwb0ovpP/jtyIe2mEuQ/MkbhmeBF2IYCA9Io=
+k8s.io/kms v0.31.1/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94=
+k8s.io/kube-aggregator v0.30.3 h1:hy5zfQ7p6BuJgc/XtGp3GBh2MPfOj6b1n3raKKMHOQE=
+k8s.io/kube-aggregator v0.30.3/go.mod h1:2SP0IckvQoOwwZN8lmtWUnTZTgIpwOWvidWtxyqLwuk=
+k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f h1:bnWtxXWdAl5bVOCEPoNdvMkyj6cTW3zxHuwKIakuV9w=
+k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f/go.mod h1:G0W3eI9gG219NHRq3h5uQaRBl4pj4ZpwzRP5ti8y770=
+k8s.io/kubectl v0.31.1 h1:ih4JQJHxsEggFqDJEHSOdJ69ZxZftgeZvYo7M/cpp24=
+k8s.io/kubectl v0.31.1/go.mod h1:aNuQoR43W6MLAtXQ/Bu4GDmoHlbhHKuyD49lmTC8eJM=
+k8s.io/metrics v0.31.1 h1:h4I4dakgh/zKflWYAOQhwf0EXaqy8LxAIyE/GBvxqRc=
+k8s.io/metrics v0.31.1/go.mod h1:JuH1S9tJiH9q1VCY0yzSCawi7kzNLsDzlWDJN4xR+iA=
+k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
+k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
-sigs.k8s.io/controller-runtime v0.17.5 h1:1FI9Lm7NiOOmBsgTV36/s2XrEFXnO2C4sbg/Zme72Rw=
-sigs.k8s.io/controller-runtime v0.17.5/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY=
-sigs.k8s.io/jobset v0.5.2 h1:276q5Pi/ErLYj+GQ0ydEXR6tx3LwBhEzHLQv+k8bYF4=
-sigs.k8s.io/jobset v0.5.2/go.mod h1:Vg99rj/6OoGvy1uvywGEHOcVLCWWJYkJtisKqdWzcFw=
+sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q=
+sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4=
+sigs.k8s.io/jobset v0.6.0 h1:s5laI2rXo4CZ/I/GvG9aRlWwUnGntrV7MMtPNC1UtoU=
+sigs.k8s.io/jobset v0.6.0/go.mod h1:lOpd2X6PFNiz03N4g1NipmDH5G1Ck53Yz2CRy8zaxt8=
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/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=
-sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag=
+sigs.k8s.io/kustomize/api v0.17.3 h1:6GCuHSsxq7fN5yhF2XrC+AAr8gxQwhexgHflOAD/JJU=
+sigs.k8s.io/kustomize/api v0.17.3/go.mod h1:TuDH4mdx7jTfK61SQ/j1QZM/QWR+5rmEiNjvYlhzFhc=
+sigs.k8s.io/kustomize/kyaml v0.17.2 h1:+AzvoJUY0kq4QAhH/ydPHHMRLijtUKiyVyh7fOSshr0=
+sigs.k8s.io/kustomize/kyaml v0.17.2/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
-sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
diff --git a/hack/e2e-common.sh b/hack/e2e-common.sh
index 850e17f098b..dbeb5ef2065 100644
--- a/hack/e2e-common.sh
+++ b/hack/e2e-common.sh
@@ -19,14 +19,24 @@ export GINKGO="$ROOT_DIR"/bin/ginkgo
export KIND="$ROOT_DIR"/bin/kind
export YQ="$ROOT_DIR"/bin/yq
+export KIND_VERSION="${E2E_KIND_VERSION/"kindest/node:v"/}"
+
export JOBSET_MANIFEST="https://github.com/kubernetes-sigs/jobset/releases/download/${JOBSET_VERSION}/manifests.yaml"
export JOBSET_IMAGE=registry.k8s.io/jobset/jobset:${JOBSET_VERSION}
export JOBSET_CRDS=${ROOT_DIR}/dep-crds/jobset-operator/
-export KUBEFLOW_MANIFEST="https://github.com/kubeflow/training-operator/manifests/overlays/standalone?ref=${KUBEFLOW_VERSION}"
-#no matching semver tag unfortunately
-export KUBEFLOW_IMAGE=kubeflow/training-operator:v1-855e096
-export KUBEFLOW_CRDS=${ROOT_DIR}/dep-crds/training-operator/
+export KUBEFLOW_MANIFEST_MANAGER=${ROOT_DIR}/test/e2e/config/multikueue/manager
+export KUBEFLOW_MANIFEST_WORKER=${ROOT_DIR}/test/e2e/config/multikueue/worker
+KUBEFLOW_IMAGE_VERSION=$($KUSTOMIZE build "$KUBEFLOW_MANIFEST_WORKER" | $YQ e 'select(.kind == "Deployment") | .spec.template.spec.containers[0].image | split(":") | .[1]')
+export KUBEFLOW_IMAGE_VERSION
+export KUBEFLOW_IMAGE=kubeflow/training-operator:${KUBEFLOW_IMAGE_VERSION}
+
+export KUBEFLOW_MPI_MANIFEST="https://raw.githubusercontent.com/kubeflow/mpi-operator/${KUBEFLOW_MPI_VERSION}/deploy/v2beta1/mpi-operator.yaml"
+export KUBEFLOW_MPI_IMAGE=mpioperator/mpi-operator:${KUBEFLOW_MPI_VERSION/#v}
+export KUBEFLOW_MPI_CRD=${ROOT_DIR}/dep-crds/mpi-operator/kubeflow.org_mpijobs.yaml
+
+# sleep image to use for testing.
+export E2E_TEST_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0@sha256:8d91ddf9f145b66475efda1a1b52269be542292891b5de2a7fad944052bab6ea
# $1 - cluster name
function cluster_cleanup {
@@ -49,7 +59,12 @@ function cluster_create {
# $1 cluster
function cluster_kind_load {
- cluster_kind_load_image "$1" "$E2E_TEST_IMAGE"
+ e2e_test_sleep_image_without_sha=${E2E_TEST_IMAGE%%@*}
+ # We can load image by a digest but we cannot reference it by the digest that we pulled.
+ # For more information https://github.com/kubernetes-sigs/kind/issues/2394#issuecomment-888713831.
+ # Manually create tag for image with digest which is already pulled
+ docker tag $E2E_TEST_IMAGE "$e2e_test_sleep_image_without_sha"
+ cluster_kind_load_image "$1" "${e2e_test_sleep_image_without_sha}"
cluster_kind_load_image "$1" "$IMAGE_TAG"
}
@@ -62,7 +77,11 @@ function cluster_kind_load_image {
# $1 cluster
function cluster_kueue_deploy {
kubectl config use-context "kind-${1}"
- kubectl apply --server-side -k test/e2e/config
+ if [ "${KIND_VERSION%.*}" = "1.28" ]; then
+ kubectl apply --server-side -k test/e2e/config/1_28
+ else
+ kubectl apply --server-side -k test/e2e/config/default
+ fi
}
#$1 - cluster name
@@ -74,9 +93,16 @@ function install_jobset {
#$1 - cluster name
function install_kubeflow {
- cluster_kind_load_image "${1}" ${KUBEFLOW_IMAGE}
+ cluster_kind_load_image "${1}" "${KUBEFLOW_IMAGE}"
+ kubectl config use-context "kind-${1}"
+ kubectl apply -k "${KUBEFLOW_MANIFEST_WORKER}"
+}
+
+#$1 - cluster name
+function install_mpi {
+ cluster_kind_load_image "${1}" "${KUBEFLOW_MPI_IMAGE/#v}"
kubectl config use-context "kind-${1}"
- kubectl apply -k "${KUBEFLOW_MANIFEST}"
+ kubectl apply --server-side -f "${KUBEFLOW_MPI_MANIFEST}"
}
INITIAL_IMAGE=$($YQ '.images[] | select(.name == "controller") | [.newName, .newTag] | join(":")' config/components/manager/kustomization.yaml)
diff --git a/hack/e2e-test.sh b/hack/e2e-test.sh
index 05a313ef466..d4281d6cee8 100755
--- a/hack/e2e-test.sh
+++ b/hack/e2e-test.sh
@@ -20,7 +20,6 @@ set -o pipefail
SOURCE_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
ROOT_DIR="$SOURCE_DIR/.."
-export E2E_TEST_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
# shellcheck source=hack/e2e-common.sh
source "${SOURCE_DIR}/e2e-common.sh"
@@ -50,7 +49,7 @@ function startup {
function kind_load {
if [ "$CREATE_KIND_CLUSTER" == 'true' ]
then
- docker pull $E2E_TEST_IMAGE
+ docker pull "$E2E_TEST_IMAGE"
cluster_kind_load "$KIND_CLUSTER_NAME"
fi
docker pull "registry.k8s.io/jobset/jobset:$JOBSET_VERSION"
@@ -67,4 +66,4 @@ startup
kind_load
kueue_deploy
# shellcheck disable=SC2086
-$GINKGO $GINKGO_ARGS --junit-report=junit.xml --output-dir="$ARTIFACTS" -v ./test/e2e/singlecluster/...
+$GINKGO $GINKGO_ARGS --junit-report=junit.xml --json-report=e2e.json --output-dir="$ARTIFACTS" -v ./test/e2e/singlecluster/...
diff --git a/hack/internal/tools/ginkgo-top/ginkgo-top.go b/hack/internal/tools/ginkgo-top/ginkgo-top.go
new file mode 100644
index 00000000000..f5136da52bf
--- /dev/null
+++ b/hack/internal/tools/ginkgo-top/ginkgo-top.go
@@ -0,0 +1,102 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package main
+
+import (
+ "cmp"
+ "encoding/json"
+ "flag"
+ "fmt"
+ "os"
+ "slices"
+ "time"
+
+ gtypes "github.com/onsi/ginkgo/v2/types"
+ "gopkg.in/yaml.v3"
+)
+
+type SpecDescription struct {
+ Suite string
+ ContainerHierarchy []string
+ Name string
+ Duration time.Duration
+ Events []Event
+}
+
+type Event struct {
+ Message string
+ Location string
+ Duration time.Duration
+}
+
+var (
+ reportPath = flag.String("i", "ginkgo.json", "input file name")
+ maxCount = flag.Uint("maxCount", 0, "maximum number of items")
+ withEvents = flag.Bool("withEvents", true, "show events")
+)
+
+func main() {
+ flag.Parse()
+ reprtData, err := os.ReadFile(*reportPath)
+ if err != nil {
+ panic(err)
+ }
+
+ report := []gtypes.Report{}
+ err = json.Unmarshal(reprtData, &report)
+ if err != nil {
+ panic(err)
+ }
+
+ flattenSpecs := []SpecDescription{}
+ for _, r := range report {
+ for _, s := range r.SpecReports {
+ sd := SpecDescription{
+ Suite: r.SuiteDescription,
+ ContainerHierarchy: s.ContainerHierarchyTexts,
+ Name: s.LeafNodeText,
+ Duration: s.RunTime,
+ }
+ if *withEvents {
+ for _, ev := range s.SpecEvents {
+ if ev.Duration > 0 {
+ event := Event{
+ Location: ev.CodeLocation.String(),
+ Message: fmt.Sprintf("%s (%s)", ev.Message, ev.NodeType),
+ Duration: ev.Duration,
+ }
+ sd.Events = append(sd.Events, event)
+ }
+ }
+ slices.SortFunc(sd.Events, func(a, b Event) int {
+ return cmp.Compare(b.Duration, a.Duration)
+ })
+ }
+ flattenSpecs = append(flattenSpecs, sd)
+ }
+ }
+ slices.SortFunc(flattenSpecs, func(a, b SpecDescription) int {
+ return cmp.Compare(b.Duration, a.Duration)
+ })
+
+ yout := yaml.NewEncoder(os.Stdout)
+ if *maxCount > 0 {
+ yout.Encode(flattenSpecs[:min(int(*maxCount), len(flattenSpecs))])
+ } else {
+ yout.Encode(flattenSpecs)
+ }
+}
diff --git a/hack/internal/tools/go.mod b/hack/internal/tools/go.mod
index 7e8b18b12f2..1111595aabd 100644
--- a/hack/internal/tools/go.mod
+++ b/hack/internal/tools/go.mod
@@ -1,68 +1,56 @@
module sigs.k8s.io/kueue/internal/tools
-go 1.22.6
+go 1.23
require (
- github.com/gohugoio/hugo v0.133.1
- github.com/golangci/golangci-lint v1.60.3
+ github.com/gohugoio/hugo v0.135.0
+ github.com/golangci/golangci-lint v1.61.0
github.com/mikefarah/yq/v4 v4.44.3
github.com/onsi/ginkgo/v2 v2.20.2
- github.com/spf13/cobra v1.8.1
- github.com/spf13/pflag v1.0.5
+ gopkg.in/yaml.v3 v3.0.1
gotest.tools/gotestsum v1.12.0
- helm.sh/helm/v3 v3.15.4
- k8s.io/code-generator v0.30.4
- k8s.io/component-base v0.30.4
- sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240605185440-12cc8d59fabe
- sigs.k8s.io/controller-tools v0.15.0
+ helm.sh/helm/v3 v3.16.2
+ k8s.io/code-generator v0.31.1
+ sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240813183042-b901db121e1f
+ sigs.k8s.io/controller-tools v0.16.4
sigs.k8s.io/kind v0.24.0
- sigs.k8s.io/kueue v0.0.0-00010101000000-000000000000
- sigs.k8s.io/kustomize/kustomize/v5 v5.4.3
+ sigs.k8s.io/kustomize/kustomize/v5 v5.5.0
sigs.k8s.io/mdtoc v1.4.0
)
-replace sigs.k8s.io/kueue => ../../..
-
require (
+ dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
- github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
- github.com/Masterminds/semver/v3 v3.2.1 // indirect
- github.com/Masterminds/sprig/v3 v3.2.3 // indirect
+ github.com/Masterminds/semver/v3 v3.3.0 // indirect
+ github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/a8m/envsubst v1.4.2 // indirect
github.com/alecthomas/assert/v2 v2.7.0 // indirect
github.com/alecthomas/participle/v2 v2.1.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
- github.com/beorn7/perks v1.0.1 // indirect
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
- github.com/cespare/xxhash/v2 v2.3.0 // indirect
- github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect
- github.com/cyphar/filepath-securejoin v0.2.4 // indirect
+ github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/elliotchance/orderedmap v1.6.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
- github.com/evanphx/json-patch v5.9.0+incompatible // indirect
- github.com/evanphx/json-patch/v5 v5.9.0 // indirect
- github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/fvbommel/sortorder v1.1.0 // indirect
+ github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
- github.com/gobuffalo/flect v1.0.2 // indirect
+ github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/goccy/go-yaml v1.12.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0 // indirect
github.com/google/btree v1.0.1 // indirect
@@ -72,87 +60,70 @@ require (
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
- github.com/gorilla/websocket v1.5.3 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
- github.com/huandu/xstrings v1.4.0 // indirect
+ github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.17.9 // indirect
- github.com/kubeflow/mpi-operator v0.5.0 // indirect
- github.com/kubeflow/training-operator v1.8.0 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mmarkdown/mmark v2.0.40+incompatible // indirect
- github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
- github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
- github.com/pelletier/go-toml/v2 v2.2.2 // indirect
+ github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.20.2 // indirect
- github.com/prometheus/client_model v0.6.1 // indirect
- github.com/prometheus/common v0.57.0 // indirect
- github.com/prometheus/procfs v0.15.1 // indirect
- github.com/ray-project/kuberay/ray-operator v1.2.1 // indirect
- github.com/russross/blackfriday/v2 v2.1.0 // indirect
- github.com/shopspring/decimal v1.3.1 // indirect
- github.com/sirupsen/logrus v1.9.3 // indirect
+ github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
+ github.com/spf13/cobra v1.8.1 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ github.com/x448/float16 v0.8.4 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/yuin/gopher-lua v1.1.1 // indirect
- go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
- golang.org/x/crypto v0.26.0 // indirect
- golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
- golang.org/x/mod v0.20.0 // indirect
- golang.org/x/net v0.28.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/crypto v0.28.0 // indirect
+ golang.org/x/mod v0.21.0 // indirect
+ golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/term v0.23.0 // indirect
- golang.org/x/text v0.17.0 // indirect
+ golang.org/x/sys v0.26.0 // indirect
+ golang.org/x/term v0.25.0 // indirect
+ golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.6.0 // indirect
- golang.org/x/tools v0.24.0 // indirect
+ golang.org/x/tools v0.26.0 // indirect
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
- gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/api v0.30.4 // indirect
- k8s.io/apiextensions-apiserver v0.30.3 // indirect
- k8s.io/apimachinery v0.30.4 // indirect
- k8s.io/apiserver v0.30.4 // indirect
- k8s.io/cli-runtime v0.30.4 // indirect
- k8s.io/client-go v0.30.4 // indirect
- k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 // indirect
+ k8s.io/api v0.31.1 // indirect
+ k8s.io/apiextensions-apiserver v0.31.1 // indirect
+ k8s.io/apimachinery v0.31.1 // indirect
+ k8s.io/apiserver v0.31.1 // indirect
+ k8s.io/cli-runtime v0.31.1 // indirect
+ k8s.io/client-go v0.31.1 // indirect
+ k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
- k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b // indirect
- k8s.io/kubectl v0.30.4 // indirect
- k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect
- sigs.k8s.io/controller-runtime v0.18.4 // indirect
- sigs.k8s.io/jobset v0.5.2 // indirect
+ k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f // indirect
+ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
- sigs.k8s.io/kustomize/api v0.17.3 // indirect
- sigs.k8s.io/kustomize/kyaml v0.17.2 // indirect
+ sigs.k8s.io/kustomize/api v0.18.0 // indirect
+ sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect
sigs.k8s.io/release-utils v0.8.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
diff --git a/hack/internal/tools/go.sum b/hack/internal/tools/go.sum
index 9ce608275ab..8d86c86ed0e 100644
--- a/hack/internal/tools/go.sum
+++ b/hack/internal/tools/go.sum
@@ -1,18 +1,15 @@
-cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
+dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
-github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
-github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
-github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
-github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
-github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
-github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA=
-github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
+github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
+github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
+github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs=
+github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0=
github.com/a8m/envsubst v1.4.2 h1:4yWIHXOLEJHQEFd4UjrWDrYeYlV7ncFWJOCBRLOZHQg=
github.com/a8m/envsubst v1.4.2/go.mod h1:MVUTQNGQ3tsjOOtKCNd+fl8RzhsXcDvvAEzkhGtlsbY=
github.com/alecthomas/assert/v2 v2.7.0 h1:QtqSACNS3tF7oasA8CU6A6sXZSBDqnm7RfpLl9bZqbE=
@@ -21,32 +18,19 @@ github.com/alecthomas/participle/v2 v2.1.1 h1:hrjKESvSqGHzRb4yW1ciisFJ4p3MGYih6i
github.com/alecthomas/participle/v2 v2.1.1/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
-github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
-github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
-github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
-github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE=
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
-github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
-github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk=
-github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA=
-github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
-github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL2kskAlV9ckgEsNQXscjIaLiOYiZ75d4e94E6dcQ=
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
-github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
-github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
+github.com/cyphar/filepath-securejoin v0.3.1 h1:1V7cHiaW+C+39wEfpH6XlLBQo3j/PciWFrgfCLS8XrE=
+github.com/cyphar/filepath-securejoin v0.3.1/go.mod h1:F7i41x/9cBF7lzCrVsYs9fuzwRZm4NQsGTBdpp6mETc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
@@ -59,14 +43,6 @@ github.com/elliotchance/orderedmap v1.6.0 h1:xjn+kbbKXeDq6v9RVE+WYwRbYfAZKvlWfcJ
github.com/elliotchance/orderedmap v1.6.0/go.mod h1:wsDwEaX5jEoyhbs7x93zk2H/qv0zwuhg4inXhDkYqys=
github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls=
-github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
-github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
-github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
-github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM=
-github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
@@ -75,8 +51,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
-github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw=
-github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
+github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
+github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
@@ -95,11 +71,10 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
-github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
-github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
-github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
+github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4=
+github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
@@ -108,36 +83,18 @@ github.com/goccy/go-yaml v1.12.0 h1:/1WHjnMsI1dlIBQutrvSMGZRQufVO3asrHfTwfACoPM=
github.com/goccy/go-yaml v1.12.0/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/gohugoio/hugo v0.133.1 h1:b9mDQu3HjKWJTSTGFQO1zL0IaOG7tiBfdHVValq1Z0Q=
-github.com/gohugoio/hugo v0.133.1/go.mod h1:WcKqZK0xjiEbhr20RGFmWAFnCxNCYEE4XhFa+pv6IMA=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
-github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
-github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
-github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
-github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
-github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/gohugoio/hugo v0.135.0 h1:W8YBMOl362dV5sQSgWmow/T/Gv27VSRb7/v9sMfEOu8=
+github.com/gohugoio/hugo v0.135.0/go.mod h1:+XfL6LOjML/nLB9CfhjkhVyHgIQ5s9NdsboPUdNbLz0=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
-github.com/golangci/golangci-lint v1.60.3 h1:l38A5de24ZeDlcFF+EB7m3W5joPD99/hS5SIHJPyZa0=
-github.com/golangci/golangci-lint v1.60.3/go.mod h1:J4vOpcjzRI+lDL2DKNGBZVB3EQSBfCBCMpaydWLtJNo=
+github.com/golangci/golangci-lint v1.61.0 h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8=
+github.com/golangci/golangci-lint v1.61.0/go.mod h1:e4lztIrJJgLPhWvFPDkhiMwEFRrWlmFbrZea3FsJyN8=
github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0 h1:4gjrh/PN2MuWCCElk8/I4OCKRKWCCo2zEct3VKCbibU=
github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
-github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -148,26 +105,18 @@ github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSF
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
-github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
-github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
-github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
-github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
-github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
-github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
+github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
+github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/jarcoal/httpmock v1.2.0 h1:gSvTxxFR/MEMfsGrvRbdfpRUMBStovlSRLw0Ep1bwwc=
-github.com/jarcoal/httpmock v1.2.0/go.mod h1:oCoTsnAz4+UoOUIf5lJOWV2QQIW5UoeUI6aM2YnWAZk=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@@ -176,18 +125,10 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
-github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/kubeflow/mpi-operator v0.5.0 h1:XvBwyXXQ9103DNMa22sxsaQlaktvaT2LY/g0UniGn5U=
-github.com/kubeflow/mpi-operator v0.5.0/go.mod h1:SeZQJW8KJxSTWD++eQYKRFpoDg1v8yrdC6fjx2/3mG0=
-github.com/kubeflow/training-operator v1.8.0 h1:cHXIz7BV3Ayp7W5Rqe20/ukmVEzraI+O/XRYKBHQcrg=
-github.com/kubeflow/training-operator v1.8.0/go.mod h1:T6I15h1S09ncH5C6St/QEC7Dy6dpHZA5sPFo+VoJAvE=
-github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
-github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
@@ -205,18 +146,12 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mikefarah/yq/v4 v4.44.3 h1:3zxHntH67maSHr6ynCjM44htw7LZNINmTzYn3tM2t+I=
github.com/mikefarah/yq/v4 v4.44.3/go.mod h1:1pm9sJoyZLDql3OqgklvRCkD0XIIHMZV38jKZgAuxwY=
-github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
-github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
-github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mmarkdown/mmark v2.0.40+incompatible h1:vMeUeDzBK3H+/mU0oMVfMuhSXJlIA+DE/DMPQNAj5C4=
github.com/mmarkdown/mmark v2.0.40+incompatible/go.mod h1:Uvmoz7tvsWpr7bMVxIpqZPyN3FbOtzDmnsJDFp7ltJs=
-github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
-github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -228,8 +163,6 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
-github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
@@ -238,8 +171,8 @@ github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4
github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag=
github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
-github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
-github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
+github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
+github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
@@ -249,32 +182,16 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg=
-github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
-github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
-github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
-github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY=
-github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
-github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
-github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
-github.com/ray-project/kuberay/ray-operator v1.2.1 h1:H7ofodGclghsU2TxbDHs+gvqvsOp5DJ/vAPGySL1DIE=
-github.com/ray-project/kuberay/ray-operator v1.2.1/go.mod h1:osTiIyaDoWi5IN1f0tOOtZ4TzVf+5kJXZor8VFvcEiI=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
-github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
-github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
-github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
-github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
-github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
+github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
-github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
@@ -286,16 +203,15 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
+github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
@@ -310,8 +226,6 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
-go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY=
-go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -323,19 +237,12 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
-golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
-golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
-golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
-golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
-golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
+golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -345,12 +252,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
-golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
+golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -358,20 +261,16 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
-golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
+golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -381,7 +280,6 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -389,11 +287,9 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -403,22 +299,20 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
+golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
-golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
-golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
+golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
+golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
@@ -428,15 +322,11 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
+golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
+golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
-golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
@@ -446,32 +336,14 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=
-golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
-golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
+golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk=
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
-gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
-gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
-google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
-google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
-google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
-google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
-google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -485,9 +357,7 @@ gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@@ -497,54 +367,44 @@ gotest.tools/gotestsum v1.12.0 h1:CmwtaGDkHxrZm4Ib0Vob89MTfpc3GrEFMJKovliPwGk=
gotest.tools/gotestsum v1.12.0/go.mod h1:fAvqkSptospfSbQw26CTYzNwnsE/ztqLeyhP0h67ARY=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
-helm.sh/helm/v3 v3.15.4 h1:UFHd6oZ1IN3FsUZ7XNhOQDyQ2QYknBNWRHH57e9cbHY=
-helm.sh/helm/v3 v3.15.4/go.mod h1:phOwlxqGSgppCY/ysWBNRhG3MtnpsttOzxaTK+Mt40E=
-honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-k8s.io/api v0.30.4 h1:XASIELmW8w8q0i1Y4124LqPoWMycLjyQti/fdYHYjCs=
-k8s.io/api v0.30.4/go.mod h1:ZqniWRKu7WIeLijbbzetF4U9qZ03cg5IRwl8YVs8mX0=
-k8s.io/apiextensions-apiserver v0.30.3 h1:oChu5li2vsZHx2IvnGP3ah8Nj3KyqG3kRSaKmijhB9U=
-k8s.io/apiextensions-apiserver v0.30.3/go.mod h1:uhXxYDkMAvl6CJw4lrDN4CPbONkF3+XL9cacCT44kV4=
-k8s.io/apimachinery v0.30.4 h1:5QHQI2tInzr8LsT4kU/2+fSeibH1eIHswNx480cqIoY=
-k8s.io/apimachinery v0.30.4/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
-k8s.io/apiserver v0.30.4 h1:rHkGJhxd+m4jILrgkenwSmG4X0QXk6ecGuybzS/PQak=
-k8s.io/apiserver v0.30.4/go.mod h1:oyGAj9B9/0+I9huJyf4/8SMBF2mNh2bTMlu7703dkH8=
-k8s.io/cli-runtime v0.30.4 h1:3iDwgInzWaMh3lrDY8JDj1D6c60agHSv2hy3O/a2a0U=
-k8s.io/cli-runtime v0.30.4/go.mod h1:O9Rf0F9x0zeMCcBQEIQxzd4zvxoqfhZZgDAet4hhBPs=
-k8s.io/client-go v0.30.4 h1:eculUe+HPQoPbixfwmaSZGsKcOf7D288tH6hDAdd+wY=
-k8s.io/client-go v0.30.4/go.mod h1:IBS0R/Mt0LHkNHF4E6n+SUDPG7+m2po6RZU7YHeOpzc=
-k8s.io/code-generator v0.30.4 h1:1J2AcpPNBGh/NH9+m4TDh8Yj+mSbM+JyQhH0QdIMwmE=
-k8s.io/code-generator v0.30.4/go.mod h1:Dd8gxOr5ieh9yHCLKnIkKDmk1H2glH8nYCAqwFogD2M=
-k8s.io/component-base v0.30.4 h1:FlgKqazIkIIxpLA4wFXsiPiDllJn9fhsN3G4TeX7T7U=
-k8s.io/component-base v0.30.4/go.mod h1:Qd3h+OJxV/LrnriXG/E15ZK83dzd306qJHW9+87S5ls=
-k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 h1:bKcdZJOPICVmIIuaM9+MXmapE94dn5AYv5ODs1jA43o=
-k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
+helm.sh/helm/v3 v3.16.2 h1:Y9v7ry+ubQmi+cb5zw1Llx8OKHU9Hk9NQ/+P+LGBe2o=
+helm.sh/helm/v3 v3.16.2/go.mod h1:SyTXgKBjNqi2NPsHCW5dDAsHqvGIu0kdNYNH9gQaw70=
+k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
+k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
+k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
+k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
+k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
+k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
+k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c=
+k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM=
+k8s.io/cli-runtime v0.31.1 h1:/ZmKhmZ6hNqDM+yf9s3Y4KEYakNXUn5sod2LWGGwCuk=
+k8s.io/cli-runtime v0.31.1/go.mod h1:pKv1cDIaq7ehWGuXQ+A//1OIF+7DI+xudXtExMCbe9U=
+k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
+k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
+k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs=
+k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs=
+k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59 h1:PfhT3P5Y7psqhl0D77Rj2B7RH77eid/wBttxlMTxXag=
+k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b h1:Q9xmGWBvOGd8UJyccgpYlLosk/JlfP3xQLNkQlHJeXw=
-k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
-k8s.io/kubectl v0.30.4 h1:jU+6WSvcSgzs07H624RA2L79FnqppyV6BKI+dHWDzyo=
-k8s.io/kubectl v0.30.4/go.mod h1:4KnGCshO4fFxd/tncWcbKH3Nj9wtoFYwMYPj8CUnduE=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
-k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
-sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
-sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240605185440-12cc8d59fabe h1:fPapvQwJ+A7I2Vm56JkEWJ4VsGQq4d6B1tL9DSdn+xA=
-sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240605185440-12cc8d59fabe/go.mod h1:4+4tM2Es0ycqPedATtzPer5RTrUq3Xab59BYogt0mCE=
-sigs.k8s.io/controller-tools v0.15.0 h1:4dxdABXGDhIa68Fiwaif0vcu32xfwmgQ+w8p+5CxoAI=
-sigs.k8s.io/controller-tools v0.15.0/go.mod h1:8zUSS2T8Hx0APCNRhJWbS3CAQEbIxLa07khzh7pZmXM=
-sigs.k8s.io/jobset v0.5.2 h1:276q5Pi/ErLYj+GQ0ydEXR6tx3LwBhEzHLQv+k8bYF4=
-sigs.k8s.io/jobset v0.5.2/go.mod h1:Vg99rj/6OoGvy1uvywGEHOcVLCWWJYkJtisKqdWzcFw=
+k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f h1:bnWtxXWdAl5bVOCEPoNdvMkyj6cTW3zxHuwKIakuV9w=
+k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f/go.mod h1:G0W3eI9gG219NHRq3h5uQaRBl4pj4ZpwzRP5ti8y770=
+k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
+k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240813183042-b901db121e1f h1:RIqUbZQO5yizUt9nozxQdzyLRD1sG6s2oi/QZrlg/hs=
+sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240813183042-b901db121e1f/go.mod h1:IaDsO8xSPRxRG1/rm9CP7+jPmj0nMNAuNi/yiHnLX8k=
+sigs.k8s.io/controller-tools v0.16.4 h1:VXmar78eDXbx1by/H09ikEq1hiq3bqInxuV3lMr3GmQ=
+sigs.k8s.io/controller-tools v0.16.4/go.mod h1:kcsZyYMXiOFuBhofSPtkB90zTSxVRxVVyvtKQcx3q1A=
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/kind v0.24.0 h1:g4y4eu0qa+SCeKESLpESgMmVFBebL0BDa6f777OIWrg=
sigs.k8s.io/kind v0.24.0/go.mod h1:t7ueEpzPYJvHA8aeLtI52rtFftNgUYUaCwvxjk7phfw=
-sigs.k8s.io/kustomize/api v0.17.3 h1:6GCuHSsxq7fN5yhF2XrC+AAr8gxQwhexgHflOAD/JJU=
-sigs.k8s.io/kustomize/api v0.17.3/go.mod h1:TuDH4mdx7jTfK61SQ/j1QZM/QWR+5rmEiNjvYlhzFhc=
-sigs.k8s.io/kustomize/kustomize/v5 v5.4.3 h1:SJMDq/0HYNTFPgmlBuxsGzdBB6furxhwHKHEfzBbvSw=
-sigs.k8s.io/kustomize/kustomize/v5 v5.4.3/go.mod h1:vhSLBp3H7wx0oeh/hE7CMQVNft42plZxUqxhvVZxb8Q=
-sigs.k8s.io/kustomize/kyaml v0.17.2 h1:+AzvoJUY0kq4QAhH/ydPHHMRLijtUKiyVyh7fOSshr0=
-sigs.k8s.io/kustomize/kyaml v0.17.2/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
+sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo=
+sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U=
+sigs.k8s.io/kustomize/kustomize/v5 v5.5.0 h1:o1mtt6vpxsxDYaZKrw3BnEtc+pAjLz7UffnIvHNbvW0=
+sigs.k8s.io/kustomize/kustomize/v5 v5.5.0/go.mod h1:AeFCmgCrXzmvjWWaeZCyBp6XzG1Y0w1svYus8GhJEOE=
+sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E=
+sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo=
sigs.k8s.io/mdtoc v1.4.0 h1:2pDEwJSjoVrGr5BPkG+LoLkYLKvgtGYurrBY8ul3SxQ=
sigs.k8s.io/mdtoc v1.4.0/go.mod h1:KVnRRtK1rX9aQ95qF0rt3x2ytTxf3r7W7N41H+0KF0k=
sigs.k8s.io/release-utils v0.8.3 h1:KtOtA4qDmzJyeQ2zkDsFVI25+NViwms/o5eL2NftFdA=
diff --git a/hack/multikueue-e2e-test.sh b/hack/multikueue-e2e-test.sh
index 0d470bbb891..0d51346a65f 100755
--- a/hack/multikueue-e2e-test.sh
+++ b/hack/multikueue-e2e-test.sh
@@ -20,7 +20,6 @@ set -o pipefail
SOURCE_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
ROOT_DIR="$SOURCE_DIR/.."
-export E2E_TEST_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
export MANAGER_KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME}-manager
export WORKER1_KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME}-worker1
export WORKER2_KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME}-worker2
@@ -41,6 +40,8 @@ function cleanup {
fi
#do the image restore here for the case when an error happened during deploy
restore_managers_image
+ # Remove the `newTag` for the `kubeflow/training-operator` to revert to the default version
+ $YQ eval 'del(.images[] | select(.name == "kubeflow/training-operator").newTag)' -i "$KUBEFLOW_MANIFEST_MANAGER/kustomization.yaml"
}
@@ -50,8 +51,7 @@ function startup {
if [ ! -d "$ARTIFACTS" ]; then
mkdir -p "$ARTIFACTS"
fi
-
- KIND_VERSION=${E2E_KIND_VERSION/"kindest/node:v"/}
+
MANAGER_KIND_CONFIG="${SOURCE_DIR}/multikueue/manager-cluster.kind-${KIND_VERSION}.yaml"
if [ ! -f "$MANAGER_KIND_CONFIG" ]; then
MANAGER_KIND_CONFIG="${SOURCE_DIR}/multikueue/manager-cluster.kind.yaml"
@@ -67,7 +67,7 @@ function startup {
function kind_load {
if [ "$CREATE_KIND_CLUSTER" == 'true' ]
then
- docker pull $E2E_TEST_IMAGE
+ docker pull "$E2E_TEST_IMAGE"
cluster_kind_load "$MANAGER_KIND_CLUSTER_NAME"
cluster_kind_load "$WORKER1_KIND_CLUSTER_NAME"
cluster_kind_load "$WORKER2_KIND_CLUSTER_NAME"
@@ -80,16 +80,27 @@ function kind_load {
install_jobset "$WORKER2_KIND_CLUSTER_NAME"
# KUBEFLOW SETUP
+ # In order for MPI-operator and Training-operator to work on the same cluster it is required that:
+ # 1. 'kubeflow.org_mpijobs.yaml' is removed from base/crds/kustomization.yaml - https://github.com/kubeflow/training-operator/issues/1930
+ # 2. Training-operator deployment is modified to enable all kubeflow jobs except for mpi - https://github.com/kubeflow/training-operator/issues/1777
+
+ # Modify the `newTag` for the `kubeflow/training-operator` to use the one training-operator version
+ $YQ eval '(.images[] | select(.name == "kubeflow/training-operator").newTag) = env(KUBEFLOW_IMAGE_VERSION)' -i "$KUBEFLOW_MANIFEST_MANAGER/kustomization.yaml"
# MANAGER
# Only install the CRDs and not the controller to be able to
# have Kubeflow Jobs admitted without execution in the manager cluster.
kubectl config use-context "kind-${MANAGER_KIND_CLUSTER_NAME}"
- kubectl apply -k "${KUBEFLOW_CRDS}"
+ kubectl apply -k "${KUBEFLOW_MANIFEST_MANAGER}"
+ ## MPI
+ kubectl apply --server-side -f "${KUBEFLOW_MPI_CRD}"
# WORKERS
- docker pull kubeflow/training-operator:v1-855e096
+ docker pull "${KUBEFLOW_IMAGE}"
+ docker pull "${KUBEFLOW_MPI_IMAGE}"
install_kubeflow "$WORKER1_KIND_CLUSTER_NAME"
install_kubeflow "$WORKER2_KIND_CLUSTER_NAME"
+ install_mpi "$WORKER1_KIND_CLUSTER_NAME"
+ install_mpi "$WORKER2_KIND_CLUSTER_NAME"
fi
}
@@ -108,4 +119,4 @@ kind_load
kueue_deploy
# shellcheck disable=SC2086
-$GINKGO $GINKGO_ARGS --junit-report=junit.xml --output-dir="$ARTIFACTS" -v ./test/e2e/multikueue/...
+$GINKGO $GINKGO_ARGS --junit-report=junit.xml --json-report=e2e.json --output-dir="$ARTIFACTS" -v ./test/e2e/multikueue/...
diff --git a/hack/performance-retry.sh b/hack/performance-retry.sh
new file mode 100755
index 00000000000..c81e2b32cbb
--- /dev/null
+++ b/hack/performance-retry.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+# Copyright 2024 The Kubernetes Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+if [[ "$#" -lt 1 ]]; then
+ echo "Usage: ${0} "
+ exit 1
+fi
+
+
+for i in $(seq 1 "$1"); do
+ echo "Try ${i}"
+ err=0
+ make test-performance-scheduler-once || err=$?
+ if [ $err -eq 0 ]; then
+ break
+ else
+ if [ "$i" -lt "$1" ]; then
+ mv "${ARTIFACTS}/junit.xml" "${ARTIFACTS}/junit-fail-${i}.xml" || echo "Unable to back-up ${ARTIFACTS}/junit.xml"
+ mv "${ARTIFACTS}/run-performance-scheduler" "${ARTIFACTS}/run-performance-scheduler-fail-${i}" || echo "Unable to back-up ${ARTIFACTS}/run-performance-scheduler"
+ else
+ exit $err
+ fi
+ fi
+done
diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh
index 386aa49caa3..d24cf9e2193 100755
--- a/hack/update-codegen.sh
+++ b/hack/update-codegen.sh
@@ -21,40 +21,31 @@ set -o pipefail
GO_CMD=${1:-go}
CURRENT_DIR=$(dirname "${BASH_SOURCE[0]}")
KUEUE_ROOT=$(realpath "${CURRENT_DIR}/..")
-CODEGEN_PKG=$($GO_CMD list -m -mod=readonly -f "{{.Dir}}" k8s.io/code-generator)
-cd "${CURRENT_DIR}/.."
+KUEUE_PKG="sigs.k8s.io/kueue"
+CODEGEN_PKG=$(cd "${TOOLS_DIR}"; $GO_CMD list -m -mod=readonly -f "{{.Dir}}" k8s.io/code-generator)
+
+cd "$CURRENT_DIR/.."
# shellcheck source=/dev/null
source "${CODEGEN_PKG}/kube_codegen.sh"
-# TODO: remove the workaround when the issue is solved in the code-generator
-# (https://github.com/kubernetes/code-generator/issues/165).
-# Here, we create the soft link named "sigs.k8s.io" to the parent directory of
-# Kueue to ensure the layout required by the kube_codegen.sh script.
-ln -s .. sigs.k8s.io
-trap "rm sigs.k8s.io" EXIT
-
# Generating conversion and defaults functions
kube::codegen::gen_helpers \
- --input-pkg-root sigs.k8s.io/kueue/apis \
- --output-base "${KUEUE_ROOT}" \
- --boilerplate "${KUEUE_ROOT}/hack/boilerplate.go.txt"
+ --boilerplate "${KUEUE_ROOT}/hack/boilerplate.go.txt" \
+ "${KUEUE_ROOT}/apis"
# Generating OpenAPI for Kueue API extensions
kube::codegen::gen_openapi \
- --input-pkg-root sigs.k8s.io/kueue/apis/visibility \
- --output-pkg-root sigs.k8s.io/kueue/apis/visibility/v1alpha1 \
- --output-base "${KUEUE_ROOT}" \
+ --boilerplate "${KUEUE_ROOT}/hack/boilerplate.go.txt" \
+ --output-dir "${KUEUE_ROOT}/apis/visibility/openapi" \
+ --output-pkg "${KUEUE_PKG}/apis/visibility/openapi" \
--update-report \
- --boilerplate "${KUEUE_ROOT}/hack/boilerplate.go.txt"
+ "${KUEUE_ROOT}/apis/visibility"
kube::codegen::gen_client \
- --input-pkg-root sigs.k8s.io/kueue/apis \
- --output-pkg-root sigs.k8s.io/kueue/client-go \
- --output-base "${KUEUE_ROOT}" \
--boilerplate "${KUEUE_ROOT}/hack/boilerplate.go.txt" \
+ --output-dir "${KUEUE_ROOT}/client-go" \
+ --output-pkg "${KUEUE_PKG}/client-go" \
--with-watch \
- --with-applyconfig
-
-# We need to clean up the go.mod file since code-generator adds temporary library to the go.mod file.
-"${GO_CMD}" mod tidy
+ --with-applyconfig \
+ "${KUEUE_ROOT}/apis"
diff --git a/hack/update-helm.sh b/hack/update-helm.sh
index 1a3a3b749e2..10a3ef97773 100755
--- a/hack/update-helm.sh
+++ b/hack/update-helm.sh
@@ -23,11 +23,13 @@ SRC_CRD_DIR=config/components/crd/bases
SRC_RBAC_DIR=config/components/rbac
SRC_WEBHOOK_DIR=config/components/webhook
SRC_VISIBILITY_DIR=config/components/visibility
+SRC_VISIBILITY_APF_DIR=config/components/visibility-apf
DEST_CRD_DIR=charts/kueue/templates/crd
DEST_RBAC_DIR=charts/kueue/templates/rbac
DEST_WEBHOOK_DIR=charts/kueue/templates/webhook
DEST_VISIBILITY_DIR=charts/kueue/templates/visibility
+DEST_VISIBILITY_APF_DIR=charts/kueue/templates/visibility-apf
YQ=./bin/yq
SED=${SED:-/usr/bin/sed}
@@ -48,6 +50,8 @@ find $SRC_RBAC_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_RBAC_D
find $SRC_WEBHOOK_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_WEBHOOK_DIR \;
# shellcheck disable=SC2086
find $SRC_VISIBILITY_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_VISIBILITY_DIR \;
+# shellcheck disable=SC2086
+find $SRC_VISIBILITY_APF_DIR -name "*.yaml" $EXCLUDE_FILES_ARGS -exec cp "{}" $DEST_VISIBILITY_APF_DIR \;
$YQ -N -s '.kind' ${DEST_WEBHOOK_DIR}/manifests.yaml
rm ${DEST_WEBHOOK_DIR}/manifests.yaml
files=("MutatingWebhookConfiguration.yml" "ValidatingWebhookConfiguration.yml")
@@ -97,6 +101,8 @@ EOF
search_webhook_pod_mutate=" path: /mutate--v1-pod"
search_webhook_pod_validate=" path: /validate--v1-pod"
+search_webhook_deployment_mutate=" path: /mutate-apps-v1-deployment"
+search_webhook_deployment_validate=" path: /validate-apps-v1-deployment"
search_mutate_webhook_annotations=' name: '\''{{ include "kueue.fullname" . }}-mutating-webhook-configuration'\'''
search_validate_webhook_annotations=' name: '\''{{ include "kueue.fullname" . }}-validating-webhook-configuration'\'''
add_webhook_line=$(
@@ -156,6 +162,41 @@ add_webhook_pod_validate=$(
EOF
)
+add_webhook_deployment_mutate=$(
+ cat <<'EOF'
+ {{- if has "deployment" $integrationsConfig.frameworks }}
+ failurePolicy: Fail
+ {{- else }}
+ failurePolicy: Ignore
+ {{- end }}
+ name: mdeployment.kb.io
+ namespaceSelector:
+ matchExpressions:
+ - key: kubernetes.io/metadata.name
+ operator: NotIn
+ values:
+ - kube-system
+ - '{{ .Release.Namespace }}'
+EOF
+)
+add_webhook_deployment_validate=$(
+ cat <<'EOF'
+ {{- if has "deployment" $integrationsConfig.frameworks }}
+ failurePolicy: Fail
+ {{- else }}
+ failurePolicy: Ignore
+ {{- end }}
+ name: vdeployment.kb.io
+ namespaceSelector:
+ matchExpressions:
+ - key: kubernetes.io/metadata.name
+ operator: NotIn
+ values:
+ - kube-system
+ - '{{ .Release.Namespace }}'
+EOF
+)
+
# Add certmanager and webhook values in the YAML files
for output_file in "${DEST_CRD_DIR}"/*.yaml; do
input_file="${output_file%.yaml}.yaml.test"
@@ -257,6 +298,14 @@ for output_file in "${new_files[@]}"; do
count=$((count+2))
echo "$add_webhook_pod_validate" >>"$output_file"
fi
+ if [[ $line == "$search_webhook_deployment_mutate" ]]; then
+ count=$((count+2))
+ echo "$add_webhook_deployment_mutate" >>"$output_file"
+ fi
+ if [[ $line == "$search_webhook_deployment_validate" ]]; then
+ count=$((count+2))
+ echo "$add_webhook_deployment_validate" >>"$output_file"
+ fi
done < "$input_file"
rm "$input_file"
done
@@ -270,9 +319,9 @@ rm ${DEST_WEBHOOK_DIR}/MutatingWebhookConfiguration.yml ${DEST_WEBHOOK_DIR}/Vali
# Add visibility files, replace names, namespaces in helm format
for output_file in "${DEST_VISIBILITY_DIR}"/*.yaml; do
- # The name of the v1alpha1.visibility.kueue.x-k8s.io APIService needs to remain unchanged.
+ # The name of the v1alpha1.visibility.kueue.x-k8s.io and v1beta1.visibility.kueue.x-k8s.io APIService needs to remain unchanged.
if [ "$(< "$output_file" $YQ '.metadata | has("name")')" = "true" ] &&
- [ "$(< "$output_file" $YQ '.metadata.name | (. == "v1alpha1*")')" = "false" ]; then
+ [ "$(< "$output_file" $YQ '.metadata.name | (. == "v1alpha1*" or . == "v1beta1*")')" = "false" ]; then
$YQ -N -i '.metadata.name |= "{{ include \"kueue.fullname\" . }}-" + .' "$output_file"
fi
# The namespace of the visibility-server-auth-reader rolebinding needs to remain unchanged.
@@ -295,13 +344,20 @@ for output_file in "${DEST_VISIBILITY_DIR}"/*.yaml; do
selector:
{{- include "kueue.selectorLabels" . | nindent 4 }}
EOT
- fi
- $SED -i '/^metadata:.*/a\ labels:\n {{- include "kueue.labels" . | nindent 4 }}' "$output_file"
+ fi
+ $SED -i '/^metadata:.*/a\ labels:\n {{- include "kueue.labels" . | nindent 4 }}' "$output_file"
+done
+# Replace flowcontrol version on visibility-apf directory
+for output_file in "${DEST_VISIBILITY_APF_DIR}"/*.yaml; do
+ $YQ -N -i '.apiVersion = "flowcontrol.apiserver.k8s.io/{{ and (eq .Capabilities.KubeVersion.Major \"1\") (eq .Capabilities.KubeVersion.Minor \"28\") | ternary \"v1beta3\" \"v1\" }}"' "$output_file"
+ $YQ -N -i '.metadata.name |= "{{ include \"kueue.fullname\" . }}-" + .' "$output_file"
+ $YQ -N -i '.metadata.namespace = "{{ .Release.Namespace }}"' "$output_file"
+ $SED -i '/^metadata:.*/a\ labels:\n {{- include "kueue.labels" . | nindent 4 }}' "$output_file"
{
- echo '{{- if include "kueue.isFeatureGateEnabled" (dict "List" .Values.controllerManager.featureGates "Feature" "VisibilityOnDemand") }}'
- cat "$output_file"
- echo "{{- end }}"
+ echo '{{- if .Values.enableVisibilityAPF }}'
+ cat "$output_file"
+ echo "{{- end }}"
} > "${output_file}.tmp"
mv "${output_file}.tmp" "${output_file}"
done
diff --git a/keps/168-2-pending-workloads-visibility/README.md b/keps/168-2-pending-workloads-visibility/README.md
index f90f456be66..a3b4cb8a18c 100644
--- a/keps/168-2-pending-workloads-visibility/README.md
+++ b/keps/168-2-pending-workloads-visibility/README.md
@@ -47,6 +47,8 @@ tags, and then generate with `hack/update-toc.sh`.
- [Integration tests](#integration-tests)
- [E2E tests](#e2e-tests)
- [Graduation Criteria](#graduation-criteria)
+ - [Alpha](#alpha)
+ - [Beta](#beta)
- [GA](#ga)
- [Implementation History](#implementation-history)
- [Drawbacks](#drawbacks)
@@ -257,17 +259,22 @@ We plan on adding sanity e2e tests, and RBAC e2e tests. The e2e RBAC tests shoul
### Graduation Criteria
-First iteration (0.6):
+#### Alpha
- Release the new API in alpha. This allows us to adjust the API according to users' and reviewers' feedback,
- Release it with a feature gate.
-Second iteration (0.7):
+#### Beta
+First iteration (0.9):
- Release the API in beta and guarantee backwards compatibility,
-- Reconsider introducing a throttling mechanism based on user and review feedback,
-- Consider introducing FlowScheme and PriorityLevelConfiguration to allow admins to easily tune API priorities.
+- Merge the visibility-api.yaml into the main manifests.yaml,
+- Create separate manifests for both FlowSchema and PriorityLevelConfiguration in versions v1 and v1beta3.
+
+Second iteration (0.10):
+- Merge the FlowSchema and PriorityLevelConfiguration v1 manifests into the installation manifests once the latest Kubernetes version (1.28) no longer supports v1,
+- Drop the alpha API version.
#### GA
-The feature can graduate to GA after addressing feedback for at least 1 release. We will then drop the feature gate.
+- Reconsider introducing a throttling mechanism.
## Implementation History
diff --git a/keps/168-2-pending-workloads-visibility/kep.yaml b/keps/168-2-pending-workloads-visibility/kep.yaml
index 88b8c1138ed..8c7c846acfe 100644
--- a/keps/168-2-pending-workloads-visibility/kep.yaml
+++ b/keps/168-2-pending-workloads-visibility/kep.yaml
@@ -14,17 +14,17 @@ replaces:
- "/keps/168-pending-workloads-visibility"
# The target maturity stage in the current dev cycle for this KEP.
-stage: alpha
+stage: beta
# The most recent milestone for which work toward delivery of this KEP has been
# done. This can be the current (upcoming) milestone, if it is being actively
# worked on.
-latest-milestone: "v0.6"
+latest-milestone: "v0.9"
# The milestone at which this feature was, or is targeted to be, at each stage.
milestone:
alpha: "v0.6"
- beta: "v0.7"
+ beta: "v0.9"
stable:
# The following PRR answers are required at alpha release
diff --git a/keps/168-pending-workloads-visibility/README.md b/keps/168-pending-workloads-visibility/README.md
index bfb3dc08d49..c7d82e8fee4 100644
--- a/keps/168-pending-workloads-visibility/README.md
+++ b/keps/168-pending-workloads-visibility/README.md
@@ -43,8 +43,8 @@ tags, and then generate with `hack/update-toc.sh`.
- [Unit Tests](#unit-tests)
- [Integration tests](#integration-tests)
- [Graduation Criteria](#graduation-criteria)
- - [Beta](#beta)
- - [Stable](#stable)
+ - [Alpha](#alpha)
+ - [Deprecation](#deprecation)
- [Implementation History](#implementation-history)
- [Drawbacks](#drawbacks)
- [Alternatives](#alternatives)
@@ -515,7 +515,7 @@ After the implementation PR is merged, add the names of the tests here.
### Graduation Criteria
-#### Beta
+#### Alpha
First iteration (0.5):
@@ -530,9 +530,19 @@ Third iteration (0.7):
- reevaluate the need for exposing positions and support if needed
-#### Stable
+#### Deprecation
-- drop the feature gate
+We deprecate the feature, and going to remove it in feature versions of the API,
+in favor of monitoring pending workloads using the [on-demand visibility API](https://kueue.sigs.k8s.io/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/).
+
+First iteration (0.9):
+
+- deprecate the QueueVisibility feature gate and corresponding API.
+
+Second iteration (v1beta2):
+
+- remove the QueueVisibility feature gate,
+- remove PendingWorkloadsStatus field from ClusterQueue object and QueueVisibility field from Config object on bumping the API version.
+- [Summary](#summary)
+- [Motivation](#motivation)
+ - [Goals](#goals)
+ - [Non-Goals](#non-goals)
+- [Proposal](#proposal)
+ - [User Stories](#user-stories)
+ - [Story 1](#story-1)
+ - [Story 2](#story-2)
+ - [Story 3](#story-3)
+ - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
+ - [Integration support](#integration-support)
+ - [Job](#job)
+ - [JobSet](#jobset)
+ - [Support for the "auto" mode](#support-for-the-auto-mode)
+ - [PodSetAssignment is per lowest-topology level](#podsetassignment-is-per-lowest-topology-level)
+ - [Risks and Mitigations](#risks-and-mitigations)
+ - [Non-exclusive use of nodes](#non-exclusive-use-of-nodes)
+ - [Node topology changes](#node-topology-changes)
+ - [Race condition when accounting for DaemonSet pods](#race-condition-when-accounting-for-daemonset-pods)
+- [Design Details](#design-details)
+ - [Hierarchy representation](#hierarchy-representation)
+ - [Admin-facing API](#admin-facing-api)
+ - [User-facing API](#user-facing-api)
+ - [Validation](#validation)
+ - [Internal APIs](#internal-apis)
+ - [Computing the assignment](#computing-the-assignment)
+ - [Enforcing the assignment](#enforcing-the-assignment)
+ - [Test Plan](#test-plan)
+ - [Prerequisite testing updates](#prerequisite-testing-updates)
+ - [Unit Tests](#unit-tests)
+ - [Integration tests](#integration-tests)
+ - [Graduation Criteria](#graduation-criteria)
+ - [Alpha:](#alpha)
+ - [Beta](#beta)
+ - [Stable](#stable)
+- [Implementation History](#implementation-history)
+- [Drawbacks](#drawbacks)
+- [Alternatives](#alternatives)
+ - [Account usage by watching DaemonSet pods](#account-usage-by-watching-daemonset-pods)
+ - [Use label for workload](#use-label-for-workload)
+ - [Implement it in ClusterAutoscaler or kube-scheduler](#implement-it-in-clusterautoscaler-or-kube-scheduler)
+ - [Support for ReplicatedJobs in JobSet](#support-for-replicatedjobs-in-jobset)
+
+
+## Summary
+
+This KEP introduces a mechanism, called Topology Aware Scheduling (TAS), to
+facilitate Job scheduling in Kueue by leveraging the information about the
+hierarchical organization of a data center.
+
+First, we start by observing that data centers have organizational units (like
+racks and blocks). VMs running within the same organizational unit have better
+network bandwidth than VMs on different units. Second, the units form
+a hierarchical structure - there are multiple nodes within a rack, and there are
+multiple racks within a block. We say that nods placed in different racks are
+more distant than nodes placed within the same rack. Similarly, nodes placed in
+different blocks are more distant than two nodes within the same block.
+
+Based on these observations we propose a convention to expose the information
+about the node placement in a data center hierarchy using node labels.
+
+We also propose a set of APIs for Kueue administrators and users to utilize this
+information in order to optimize the network throughput between the pods.
+
+## Motivation
+
+It is common that AI / ML workloads require a significant amount of pod-to-pod
+communication to make progress. Thus, it is important, for runtime and overall
+cost, to make sure there is a high throughput network connection between the
+running pods.
+
+For example, some workloads may run twice slower if there is a pod placed on
+a node which belongs to a different block. However, currently the end user of
+Kueue has no way to "required" that all pods of its workload run within the same
+block.
+
+### Goals
+
+- allow a user to express that a workload can schedule only if all of its pods
+ can be placed on nodes which are close together (within the same level of
+ hierarchy)
+- allow a user to express that a workload prefers to schedule all of its pods
+ within the same level of hierarchy, but automatically relax the constraint if
+ not possible.
+
+### Non-Goals
+
+- support MultiKueue at the management cluster
+- support Cluster Autoscaler (ProvisioningRequest in particular)
+
+The above features might be pursued in the future in follow up KEPs.
+
+## Proposal
+
+* Introduce convention to represent the topological hierarchy as node labels
+* Provide API to configure the list of node labels representing levels in the
+ hierarchy per Resource Flavor
+* Introduce a set of Job annotations which allow to describe requirements for
+ TAS
+
+### User Stories
+
+#### Story 1
+
+As an ML researcher I run AI training workloads which require exchanging huge
+amounts of data between the worker Pods. I use k8s Jobs.
+
+A) The workloads take twice longer and are twice more expensive when there are
+pods running in different data center racks. I don't want to start my workload
+if the pods cannot be placed within the same rack.
+
+B) I would like to optimize the runtime of the workloads, by placing the pods as
+close to another as possible, ideally within a single rack, but I'm ok running
+the workload on nodes scattered across data center if placing all pods within
+the same hierarchy rack is not possible at the given time.
+
+#### Story 2
+
+Similar to [Story 1](#story-1), but I would like to run my Workloads using
+JobSet with multiple ReplicatedJob instances per worker
+([`replicas>0`](https://github.com/kubernetes-sigs/jobset/blob/d7c1dadd55906dec1d1275bcb7b73f08d1fa509f/api/jobset/v1alpha2/jobset_types.go#L227)).
+
+To achieve optimal performance I need to ensure that every ReplicatedJob
+instance is contained within a "rack".
+
+Note: not planned for [Alpha](#alpha), to be evaluated for [Beta](#beta).
+
+#### Story 3
+
+Similar to [Story 3](#story-3), but I use multi-template Jobs (JobSet, MPIJob,
+TFJob) and Pods belonging to different templates also need to exchange sizable
+amount of data, impacting the execution time. I would like to be able to
+indicate that (1) all worker Pods are contained within a "rack", but also all
+Pods in the workload are contained within a "block".
+
+Note: not planned for [Alpha](#alpha), to be evaluated for [Beta](#beta).
+
+### Notes/Constraints/Caveats (Optional)
+
+#### Integration support
+
+In the alpha iteration we aim to support Job & JobSet. If other integrations
+follow naturally we may as well support them in alpha.
+
+##### Job
+
+**Example**:
+
+```yaml
+apiVersion: batch/v1
+kind: Job
+metadata:
+ namespace: tas-example-job
+ labels:
+ kueue.x-k8s.io/queue-name: user-queue
+spec:
+ parallelism: 10
+ completions: 10
+ template:
+ metadata:
+ annotations:
+ kueue.x-k8s.io/podset-required-topology: cloud.provider.com/topology-rack
+ spec:
+ containers:
+ - name: worker
+ image: gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
+ args: ["300s"]
+ resources:
+ requests:
+ cpu: "4"
+ restartPolicy: Never
+```
+
+In this example we indicate that all Pods created by the Job should be contained
+within the same "rack".
+
+##### JobSet
+
+One complication we noticed for JobSet is that the proposed design assumes
+injecting the dedicated scheduling gate, called `kueue.x-k8s.io/topology` into
+the PodTemplate. This required a JobSet fix which is released in 0.6
+(see [PR](https://github.com/kubernetes-sigs/jobset/pull/623)).
+
+**Example**:
+
+```yaml
+apiVersion: jobset.x-k8s.io/v1alpha2
+kind: JobSet
+metadata:
+ name: tas-example-jobset
+ labels:
+ kueue.x-k8s.io/queue-name: user-queue
+spec:
+ replicatedJobs:
+ - name: leader
+ replicas: 1
+ template:
+ spec:
+ completions: 1
+ parallelism: 1
+ template:
+ metadata:
+ annotations:
+ kueue.x-k8s.io/podset-required-topology: cloud.provider.com/topology-rack
+ spec:
+ containers:
+ - name: leader
+ image: gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
+ args: ["300s"]
+ - name: workers
+ replicas: 2
+ template:
+ spec:
+ completions: 2
+ parallelism: 2
+ template:
+ metadata:
+ annotations:
+ kueue.x-k8s.io/podset-preferred-topology: cloud.provider.com/topology-rack
+ spec:
+ containers:
+ - name: worker
+ image: gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
+ args: ["100s"]
+```
+
+In this example we say that the PodSet corresponding to the leader requires
+the "rack" topology domain (there is only one such Pod, so the requirement
+is satisfied trivially). The PodSet corresponding to the worker only
+prefers the "rack" topology domain, so it may fallback to "block".
+
+#### Support for the "auto" mode
+
+We are considering introducing the "auto" mode where the user does not need to
+specify the level by node label value, but the lowest level is selected
+automatically.
+
+One approach is to accept "auto" as a specific value for the "preferred" and
+"required" annotations. However, we are going to defer this for Beta or GA based
+on the users' feedback.
+
+#### PodSetAssignment is per lowest-topology level
+
+Assigning the lowest-topology level is to prevent the following race conditions.
+
+For example, there is a topology with one block: "block1" and with three racks:
+"rack1", "rack2", "rack3". Now, a user sends "workload1" which requiring "block"
+topology, and it fits within two racks. Let's assume Kueue only assigned
+nodeSelector to match for "block1" on admission. Then, kube-scheduler binds the
+Pods to "rack1" and "rack2". In the meanwhile, there is "workload2" admitted,
+requiring "rack". It gets assigned to "rack1", but cannot be scheduled since the
+nodes of "rack1" are already in use.
+
+### Risks and Mitigations
+
+#### Non-exclusive use of nodes
+
+The TAS feature assumes exclusive use of the nodes, that is all pods running on
+the nodes come from workloads assigned to the same TAS Resource Flavor. This can
+be achieved by admins by using a distinct label corresponding to a node group
+meant for TAS.
+
+In order to reduce the risk of such misconfiguration we require every TAS
+Resource Flavor to have at least one label.
+
+#### Node topology changes
+
+A node can be removed during runtime of a workload, and the replacement for the
+pod running on this node may not be able to find a replacement matching the
+TopologyAssignment. In that case the workload may not be able to progress.
+
+First, note that the issue also exists for regular workloads, but for TAS
+workloads, given the additional constraints, it might be harder to find a
+replacement node.
+
+In order to mitigate this risk we propose to extend the waitForPodsReady
+mechanism with a new timeout, called replacement timeout, which defines the
+timeout for all pods to be ready again. The time is computed since the last
+transition to the `PodsReady=false`, more details in the
+[KEP PR](https://github.com/kubernetes-sigs/kueue/pull/2737). This mechanism
+will also be helpful for regular workloads.
+
+A more involving approach would be to recompute the TopologyAdmission, however,
+until now we don't modify the workload's admission while the workload is
+scheduled, so it would require extra investigation and effort. We will consider
+this before graduation to GA based on investigation if feasible and feedback
+from users.
+
+#### Race condition when accounting for DaemonSet pods
+
+There is a risk that workloads are scheduled before the DaemonSet pods are
+accounted by TAS.
+
+We consider this risk as not that relevant for alpha as the TAS workloads are
+expected to mostly consume accelerators (like TPUs and GPUs), so they are not
+expected to compete for resources with DaemonSet pods.
+
+One way to mitigate the risk is to implement tracking for DaemonSets
+(see [Account usage by watching DaemonSet pods](#account-usage-by-watching-daemonset-pods)).
+We will re-evaluate the need for Beta or GA based on the users' feedback.
+
+## Design Details
+
+### Hierarchy representation
+
+We propose the model for representing the hierarchy of nodes within a data center
+by using node labels. We assume the node labels are set up by a cloud provider,
+or set up manually by administrators of on-premise clusters.
+
+Additionally, we assume that every node used for TAS has a set of the labels
+which identifies uniquely its location in the tree structure. We do not assume
+global uniqueness of labels on each level, i.e. there could be two nodes with
+the same "rack" label, but in different "blocks".
+
+For example, this is a representation of the dataset hierarchy;
+
+| node | cloud.provider.com/topology-block | cloud.provider.com/topology-rack |
+|:------:|:----------------------------------:|:--------------------------------:|
+| node-1 | block-1 | rack-1 |
+| node-2 | block-1 | rack-2 |
+| node-3 | block-2 | rack-1 |
+| node-4 | block-2 | rack-3 |
+
+Note that, there is a pair of nodes, node-1 and node-3, with the same value of
+the "cloud.provider.com/topology-rack" label, but in different blocks.
+
+### Admin-facing API
+
+```golang
+// ResourceFlavorSpec defines the desired state of the ResourceFlavor
+type ResourceFlavorSpec struct {
+ ...
+
+ // TopologyName indicates the name of the topology for the ResourceFlavor.
+ // When specified, it enables scraping of the topology information from the
+ // nodes matching to the Resource Flavor node labels.
+ //
+ // +optional
+ TopologyName *string `json:"topologyName,omitempty"`
+}
+
+// TopologySpec defines the desired state of Topology
+type TopologySpec struct {
+ // Levels defines the levels of topology.
+ //
+ // +listType=atomic
+ // +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:MaxItems=5
+ Levels []TopologyLevel `json:"levels,omitempty"`
+}
+
+// TopologyLevel defines the desired state of TopologyLevel
+type TopologyLevel struct {
+ // NodeLabel indicates the name of the node label for a specific topology
+ // level. Examples:
+ // - cloud.provider.com/topology-block
+ // - cloud.provider.com/topology-rack
+ //
+ // +required
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=316
+ // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
+ NodeLabel string `json:"nodeLabel,omitempty"`
+}
+```
+
+Example TAS Resource Flavor & Topology configuration:
+
+```yaml
+kind: ResourceFlavor
+metadata:
+ name: "tas-flavor"
+spec:
+ nodeLabels:
+ "cloud.provider.com/node-group: tas"
+ topologyName: default
+---
+kind: Topology
+metadata:
+ name: "default"
+spec:
+ levels:
+ - nodeLabel: cloud.provider.com/topology-block
+ - nodeLabel: cloud.provider.com/topology-rack
+```
+
+### User-facing API
+
+The user will need to point the workload to the ClusterQueue with the TAS
+ResourceFlavor. Additionally, the user specifies the annotations at the
+PodTemplate level:
+
+```golang
+const (
+
+ // This annotation indicates that a PodSet requires Topology Aware Scheduling,
+ // and running all pods on nodes closely connected within the same level of
+ // hierarchy is a strong requirement for scheduling the workload.
+ PodSetRequiredTopologyAnnotation = "kueue.x-k8s.io/podset-required-topology"
+
+ // This annotation indicates that a PodSet requires Topology Aware Scheduling,
+ // but running all pods without the same topology level is a preference rather
+ // than requirement.
+ //
+ // The levels are evaluated one-by-one going up from the level indicated by
+ // the annotation. If the PodSet cannot fit within a given topology domain
+ // then the next topology level up is checked. If the PodSet cannot fit
+ // at the highest topology level, then it gets admitted as distributed
+ // among multiple topology domains.
+ PodSetPreferredTopologyAnnotation = "kueue.x-k8s.io/podset-preferred-topology"
+)
+```
+
+### Validation
+
+The validations at the creation time:
+- the ResourceFlavor defining `TopologyAwareScheduling` needs to have at least
+ one node label
+
+We introduce the following validations (post-creation time, workload violating
+the rules is deactivated):
+- the value of `kueue.x-k8s.io/podset-required-topology` is one of the labels
+ specified in the topology node labels
+- the value of `kueue.x-k8s.io/podset-preferred-topology` is one of the labels
+ specified in the topology node labels
+- if "podset-required-topology" or "podset-preferred-topology" is specified for
+ one PodTemplate, then one of them is specified for every PodTemplate in the
+ Job spec.
+
+### Internal APIs
+
+We extend the `Workload` structure to reflect the topology request at the
+Job level.
+
+```golang
+type PodSet struct {
+ ...
+ // TopologyRequest defines the topology requested for the corresponding PodSet.
+ // +optional
+ TopologyRequest *PodSetTopologyRequest `json:"topologyRequest,omitempty"`
+}
+
+type PodSetTopologyRequest struct {
+ // Policy defines the policy used for TAS. Possible values are:
+ // - Preferred set when `kueue.x-k8s.io/podset-preferred-topology` annotation is set on the Job
+ // - Required set when `kueue.x-k8s.io/podset-required-topology` annotation is set on the Job
+ Policy TopologyRequestPolicy `json:"policy"`
+
+ // Level indicated by the `kueue.x-k8s.io/podset-preferred-topology` or
+ // `kueue.x-k8s.io/podset-required-topology` annotation
+ Level string `json:"level"`
+}
+```
+
+We extend the `PodSetAssignment` structure to keep track of the number of pods
+at each topology level to the specific subset of nodes.
+
+```golang
+type PodSetAssignment struct {
+ ...
+
+ // TopologyAssignment indicates the resources assigned per topology level
+ // +optional
+ TopologyAssignment *TopologyAssignment `json:"topologyAssignment,omitempty"`
+}
+
+type TopologyAssignment struct {
+ // Groups contains the list of assignments split into groups corresponding
+ // to the same topology domain at the lowest level of the hierarchy.
+ // +required
+ // +listType=atomic
+ // +kubebuilder:validation:MinItems=1
+ Groups []TopologyAssignmentGroup `json:"groups"`
+}
+
+type TopologyAssignmentGroup struct {
+ // NodeLabels constitutes the nodeSelector for a given slice of pods. It
+ // defines values for all labels configured in the Topology.Levels.
+ // +kubebuilder:validation:MinItems=1
+ NodeLabels map[string]string `json:"nodeLabels"`
+
+ // Count indicates the number of pods in a given TopologyAssignmentGroup.
+ // +required
+ Count int32 `json:"count"`
+}
+```
+
+Kueue uses the `kueue.x-k8s.io/topology` scheduling gate to delay the
+`nodeSelector` assignment, because different pods in the same PodSet may have
+different values:
+
+```golang
+const (
+ // TopologySchedulingGate is used to delay topology assignment for pods
+ // once all the pods are created.
+ TopologySchedulingGate = "kueue.x-k8s.io/topology"
+
+ // WorkloadAnnotation indicates the name of the workload assigned.
+ WorkloadAnnotation = "kueue.x-k8s.io/workload"
+
+ // PodSetLabel indicates the name of the PodSet in the workload
+ PodSeLabel = "kueue.x-k8s.io/podset"
+)
+```
+
+The above API does not support [Story 2](#story-2). We will defer the support
+for [Beta](#beta). The initial approach for the design is left in the
+[Support for ReplicatedJobs in JobSet](#support-for-replicatedjobs-in-jobset)
+section.
+
+### Computing the assignment
+
+The extended PodSet assignment is set on admitting the workload. In order to
+compute the assignment Kueue caches the information about the node allocatable
+capacity and the current usage by other workloads in this resource flavor.
+
+The information about the allocatable capacity is scraped from nodes based on
+the `status.allocatable` field.
+
+The cached information about the used resources is updated whenever a workload
+is admitted, suspended, resumed or finished. Additionally, we scrape the usage
+information from all non-TAS pods bound to the TAS nodes - this is done to
+account for Pods not created by Workloads not managed by Kueue (such as
+DaemonSet pods).
+
+The available capacity for TAS nodes is then computed as a difference between
+the allocatable space and current usage.
+
+For a given PodSet Kueue:
+- when the `podset-required-topology` is used, then Kueue tries to find any value of the
+ level label which can accommodate all the pods. If there is no such value, then
+ the workload keeps waiting in the queue.
+- when the `podset-preferred-topology` is used, then Kueue tries to find a level
+ at which the PodSet fully fits within a topology domain corresponding to the
+ level. Kueue starts the search from the specified level, but if the PodSet
+ does not fit, then it tries higher levels in the hierarchy.
+
+### Enforcing the assignment
+
+When the workload has the PodSet assignments and is about to start we modify the
+corresponding PodTemplates in the Job object to inject the
+`kueue.x-k8s.io/topology` scheduling gate. Note that the assignment always
+includes the lowest level of the topology (see
+[PodSetAssignment is per lowest-topology level](#podsetassignment-is-per-lowest-topology-level)).
+
+Then, there is a new component, called `TopologyUngater`, which is a Workload
+reconciler which lists all pods for a given TAS PodSet, and ensures that the
+pods in the expected number are un-gated to a given value.
+
+Along with the scheduling gate, to each pod template the
+`kueue.x-k8s.io/workload` and `kueue.x-k8s.io/podset` labels / annotations are
+added to facilitate quick lookup (List request) for all pods corresponding to
+the workload (and more specifically PodSetAssignment) by `TopologyAssigner`.
+
+The TopologyUngater watches for pod events which trigger the reconciliation
+loop. The reconciliations are batched by 1s periods to make sure multiple
+created pods at the similar time don't trigger too many reconciliations.
+
+In order to prevent ungating more pods as expected for a PodSet we consider to
+use the expectations mechanism. The expectations are set for when we are about
+to ungate a Pod. The expectation is fulfilled if the Pod is observed as ungated
+or the ungating request fails. We hold ungating if there are pending ungatings
+within the PodSet.
+
+### Test Plan
+
+[x] I/we understand the owners of the involved components may require updates to
+existing tests to make this code solid enough prior to committing the changes
+necessary to implement this enhancement.
+
+##### Prerequisite testing updates
+
+#### Unit Tests
+
+We add integration tests for the following scenarios:
+- a new node is added making workload admission possible
+- the PodSet assignment is computed successfully for `podset-required-topology`
+- the PodSet assignment cannot be computed for `podset-required-topology`
+- the PodSet assignment is computed successfully for `podset-preferred-topology`
+ across multiple values
+- the PodSet assignment cannot be computed for `podset-preferred-topology`
+- the schedulingGate is added to the pod template
+
+#### Integration tests
+
+We are going to add the integration tests to make sure the implementation is
+well covered. In particular, the following scenarios need coverage:
+- adding new nodes
+- PodSet assignment for `podset-preferred-topology` and `podset-required-topology`
+- Job's pod template has the "topology" scheduling gate injected
+- un-gate pods by with the "topology" scheduling gate
+- the Workload can be suspended and unsuspended
+
+### Graduation Criteria
+
+#### Alpha:
+
+- support for all built-in integrations: Job and JobSet
+- support single-level hierarchy
+- support TAS with minimal cross to other features (no cohorts, no preemption,
+ no reclaimable pods)
+
+The new validations which are for MVP, but likely will be relaxed in the future:
+- ClusterQueue is marked inactive if it contains a TAS ResourceFlavor and
+ belongs to a cohort
+- ClusterQueue is marked inactive if it contains a TAS ResourceFlavor and
+ enables preemptions
+- ClusterQueue is marked inactive if it contains a TAS ResourceFlavor and uses
+ MultiKueue admission check
+- ClusterQueue is marked inactive if it contains a TAS ResourceFlavor and uses
+ ProvisioningRequest admission check
+
+#### Beta
+
+- support for all other integrations
+- support multi-level hierarchy
+- support replacement timeout in WaitForPodsReady
+- re-evaluate accounting for used resources by watching DaemonSets
+- re-evaluate the need for the "auto" mode which does not require a user to
+ specify the hierarchy name, but just selects the lowest one
+- re-evaluate the need to support for "preferred/required" preferences at the
+ ReplicatedJob level (see [Story 2](#story-2))
+- re-evaluate the need to support for "preferred/required" preferences at the
+ Workload level (see [Story 3](#story-3))
+
+#### Stable
+
+Consider the following improvements and implement if feasible:
+- put pods with consecutive indexes of an IndexedJob on close nodes
+- support the following features: reclaimable, pods, cohorts preemption
+ within cluster queue
+- support re-computing the TopologyAssignment while the workload
+ is running
+- perform full scheduling simulation rather than just capacity counting
+ (including pod affinities and anti-affinities)
+
+## Implementation History
+
+- 2024-07-25 - PR merged [Allow mutating schedulingGates when the Jobset is suspended](Allow mutating schedulingGates when the Jobset is suspended)
+- 2024-07-30 - this KEP
+
+
+## Drawbacks
+
+Tracking of nodes by Kueue will increase its code complexity and memory
+consumption.
+
+## Alternatives
+
+### Account usage by watching DaemonSet pods
+
+The idea is to account for DaemonSet pods by tracking the DaemonSets rather than
+their Pods. This can prevent the [race condition](Race condition when accounting
+for DaemonSet pods) risk.
+
+**Reasons for discarding/deferring**
+
+When accounting for the the DaemonSets we would need to verify their selectors
+would allow match a node in question.
+
+This is a complication which may not be necessary for MVP since the workloads
+will mostly expected to consume accelerators (GPUs and TPUs).
+
+We will consider this for Beta or GA based on the users' feedback.
+
+### Use label for workload
+
+We considered using the `kueue.x-k8s.io/workload` label rather than annotation.
+
+**Reasons for discarding/deferring**
+
+Currently workloads can have names which exceed the maximal length for a label.
+So, we would need to shorten the maximal workload name by reducing the const
+`maxPrefixLength` in `workload_names.go`. However, we can also facilitate
+fast lookups based on labels if we index the workloads.
+
+### Implement it in ClusterAutoscaler or kube-scheduler
+
+This feature requires tracking of the nodes to reconstruct the nodes capacity
+for all topology domains, and this is a novelty in Kueue which didn't do that,
+leaving the features requiring knowledge about Nodes to kube-scheduler or
+Cluster Autoscaler.
+
+**Reasons for discarding/deferring**
+
+kube-scheduler:
+- scheduler does not have ability to do what `TopologyUngater` does, it is
+ lower-level of abstraction
+- the topology information is not represented in the core k8s, and scheduler
+ wouldn't read the information from CRDs
+- kube-scheduler doesn't do PodGroup level scheduling or preemption which is
+ required
+
+ClusterAutoscaler:
+- Isn't focused on scheduling or preemption; its responsibility is to provision
+ new Nodes
+- Operates at the level of individual Pods rather than Jobs or PodGroups
+
+Also, both of the components don't have a concept of quota, which we want to be
+supported with this feature. So, if Kueue admits a Job with "required: rack"
+just based on quota, the Pods might be created, but the components wouldn't
+be able to schedule the Pods if there is not enough capacity in the topology
+domain.
+
+### Support for ReplicatedJobs in JobSet
+
+This is needed to support [Story 2](#story-2).
+
+Currently, in the PodSet we just keep the number of Pods created for a given
+PodTemplate. So, without any extra work for JobSet, if JobSet has more than one
+ReplicatedJob its Pods could thus be assigned by TAS to different topology
+domains, making the assignment suboptimal.
+
+Below is the "backup" of the API discussed to support assignments per an
+instance of a ReplicatedJob:
+
+```golang
+type PodSet struct {
+ ...
+
+ // ReplicatedJobCount indicates the number of replicated Jobs being span by
+ // the PodSet. Each replicated Job is assumed to have the same number of Pods
+ // with the same template.
+ // Default: 1
+ ReplicatedJobCount *int32
+
+ // ReplicatedJobKeyLabel specifies the name of the label which indicates
+ // the specific Job instance among ReplicatedJobs.
+ ReplicatedJobKeyLabel *string
+
+ // ReplicatedJobLabelValue specifies the value of the label indicated by
+ // ReplicatedJobKeyLabel for a specific replicated Job.
+ ReplicatedJobLabelValue *string
+}
+```
+
+In case of JobSet `ReplicatedJobKeyLabel` could be either
+`jobset.sigs.k8s.io/job-index` or `jobset.sigs.k8s.io/replicatedjob-name` as
+both will uniquely identify a specific Job among the set of ReplicatedJob.
+
+```golang
+type PodSetAssignment struct {
+
+ // ReplicatedJobKey indicates the key of the Pod label which is used to
+ // specify a specific Job among a set of ReplicatedJobs.
+ ReplicatedJobKey *string
+}
+```
+We the compute then assignments per ReplicatedJobs, rather than the entire
+PodSet. The computed assignments are represented as instances of
+`PodSetAssignment` with specific `TopologyAssignment`.
+
+Finally, the `PodSetUngater` ungates pods per ReplicatedJob assignment.
+
+**Reasons for discarding/deferring**
+
+Supporting the level of a replica requires more APIs, refactoring of how Kueue
+operates. This could significantly delay the delivery of the first version
+of the feature. As explained in the
+[comment](https://github.com/kubernetes-sigs/kueue/pull/2725#discussion_r1758513294)
+we prefer to start with the PodSet level as simpler.
diff --git a/keps/2724-topology-aware-schedling/kep.yaml b/keps/2724-topology-aware-schedling/kep.yaml
new file mode 100644
index 00000000000..5c810fcd8dc
--- /dev/null
+++ b/keps/2724-topology-aware-schedling/kep.yaml
@@ -0,0 +1,38 @@
+title: Topology Aware Scheduling
+kep-number: 2724
+authors:
+ - "@mimowo"
+ - "@mwielgus"
+status: provisional
+creation-date: 2023-07-30
+reviewers:
+ - "@pbundyra"
+ - "@alculquicondor"
+ - "@tenzen-y"
+approvers:
+ - "@alculquicondor"
+ - "@tenzen-y"
+
+# The target maturity stage in the current dev cycle for this KEP.
+stage: alpha
+
+# The most recent milestone for which work toward delivery of this KEP has been
+# done. This can be the current (upcoming) milestone, if it is being actively
+# worked on.
+latest-milestone: "v0.9"
+
+# The milestone at which this feature was, or is targeted to be, at each stage.
+milestone:
+ alpha: "v0.9"
+ beta:
+ stable:
+
+# The following PRR answers are required at alpha release
+# List the feature gate name and the components for which it must be enabled
+feature-gates:
+ - name: TopologyAwareScheduling
+disable-supported: true
+
+# The following PRR answers are required at beta release
+#metrics:
+# - my_feature_metric
\ No newline at end of file
diff --git a/keps/2937-resource-transformer/README.md b/keps/2937-resource-transformer/README.md
new file mode 100644
index 00000000000..ae0ab95e6b8
--- /dev/null
+++ b/keps/2937-resource-transformer/README.md
@@ -0,0 +1,619 @@
+# KEP-2937: Configurable Resource Transformers
+
+
+- [Summary](#summary)
+- [Motivation](#motivation)
+ - [Goals](#goals)
+ - [Non-Goals](#non-goals)
+- [Proposal](#proposal)
+ - [User Stories (Optional)](#user-stories-optional)
+ - [Story 1](#story-1)
+ - [Story 1A - Using Replace with MIG](#story-1a---using-replace-with-mig)
+ - [Story 1B - Using Retain with MIG](#story-1b---using-retain-with-mig)
+ - [Story 2](#story-2)
+- [Design Details](#design-details)
+ - [Specifying the Transformation](#specifying-the-transformation)
+ - [Observability](#observability)
+ - [Test Plan](#test-plan)
+ - [Prerequisite testing updates](#prerequisite-testing-updates)
+ - [Unit Tests](#unit-tests)
+ - [Integration tests](#integration-tests)
+ - [Graduation Criteria](#graduation-criteria)
+- [Implementation History](#implementation-history)
+- [Drawbacks](#drawbacks)
+- [Alternatives](#alternatives)
+ - [ClusterQueue Scoped](#clusterqueue-scoped)
+ - [ResourceFlavor Scoped](#resourceflavor-scoped)
+ - [Workload Scoped](#workload-scoped)
+
+
+## Summary
+
+This KEP introduces a mechanism that enables cluster admins to customize
+how the resource requests and limits of a Job are translated into
+the resource requirements of its corresponding Workload. This enables
+the admission and quota calculations done by ClusterQueues to be performed
+on an abstracted and/or transformed set of resources without impacting
+the actual resource requests/limits that the Pods created by the Workload
+will present to the Kubernetes Scheduler when the Workload is admitted by
+a ClusterQueue.
+
+## Motivation
+
+Kueue currently performs a direct and mostly non-configurable mapping of the resource
+requests/limits of a Job into the resource requests of the Job's Workload.
+The only supported configuration is the ability to ignore resources that match
+a global `execludedResourcePrefixes` list.
+This direct mapping results in two significant limitations that limit the expressivity
+of Kueue's resource and quota mechanisms:
+1. Only resources that are explicitly listed in a Jobs requests/limits can
+be used in Kueue's quota calculations and admission decisions.
+2. For a Job to be admissible by a ClusterQueue, the ClusterQueue must have
+ResourceGroups whose CoveredResources include all non-excluded resources requested by the Job.
+
+Injecting a more configurable transformation function into this mapping
+will enable Kueue to support simpler and more powerful definitions of resource quotas.
+
+### Goals
+
+* Establish a mechanism that enables limited transformations on resources
+ to be specified via external configuration.
+
+### Non-Goals
+
+* Supporting complex numerical transformations of resource quantities
+* Supporting transformations that take multiple input resources
+* Performing any mutation of the resource requests/limits of Jobs
+* Ensuring that a Workload's resource requests is updated if the set of
+configured transformations functions changes after its resource requests are computed.
+
+## Proposal
+
+* Add a configuration mechanism that enables a cluster admin to specify a `ResourceTransformation`.
+* Extend `workload.NewInfo` to apply the resource mapping when computing the resources
+needed to admit the workload immediately after it applies `dropExcludedResources`.
+* Extend the `Status` field of Workload to make the transformed resources directly observable.
+
+### User Stories (Optional)
+
+In the user stories below, we use a 4-tuple (InputResourceName, OutputResourceName, OutputQuantity, Replace/Retain)
+to express a resource transformation operation. In the actual implementation, this transformation would
+be encoded as an entry in a `ResourceTransformation` which would be created by a cluster admin.
+
+#### Story 1
+
+This KEP will improve Kueue's ability to manage families of closely related
+extended resources without creating overly complex ResourceGroups in its
+ClusterQueues. A motivating example is managing quotas for the various
+MIG resources created by the NVIDIA GPU Operator using the mixed strategy
+(see [MIG Mixed Strategy][mig]).
+In the mixed strategy, instead of there being a single `nvidia.com/gpu` extended resource,
+there is a proliferation of extended resource of the form `nvidia.com/mig-1g.5gb`, `nvidia.com/mig-2g.10gb`,
+`nvidia.com/mig-4g.20gb`, and so on. For quota management purposes, we would like to abstract
+these into a single primary extended resource `example.com/accelerator-memory`.
+
+##### Story 1A - Using Replace with MIG
+
+If an operator such as [InstaSlice][instaslice] is deployed
+that is capable of dynamically managing the MIG partitions available on the cluster,
+the cluster admin may desire to completely elide the details of different MIG variants
+from their quota management.
+
+To do this, the cluster admin could register the following transformations:
+* (`nvidia.com/mig-1g.5gb`, `example.com/accelerator-memory`, `5Gi`, `replace`)
+* (`nvidia.com/mig-2g.10gb`, `example.com/accelerator-memory`, `10Gi`, `replace`)
+* (`nvidia.com/mig-4g.20gb`, `example.com/accelerator-memory`, `20Gi`, `replace`)
+* (`nvidia.com/mig-7g.40gb`, `example.com/accelerator-memory`, `40Gi`, `replace`)
+
+In this scenario, the covered resources in a ClusterQueue would only need
+to include `example.com/accelerator-memory`
+and would not need to assign redundant and potentially confusing quotas to every MIG variant.
+
+As a concrete example, consider a submitted Job requesting the resources below:
+```yaml
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+ memory: 100M
+ cpu: 1
+```
+this would yield a Workload with an effective request of:
+```yaml
+ example.com/accelerator-memory: 20G
+ memory: 100M
+ cpu: 1
+```
+and could be admitted to the `default-flavor` of a ClusterQueue with the ResourceGroup below:
+```yaml
+...
+ - coveredResources: ["cpu", "memory", "example.com/accelerator-memory"]
+ flavors:
+ - name: default-flavor
+ resources:
+ - name: "cpu"
+ nominalQuota: 8
+ - name: "memory"
+ nominalQuota: 500G
+ - name: example.com/accelerator-memory
+ nominalQuota: 80G
+```
+
+To compare, to achieve the identical effective quotas without `replace` the covered
+resource stanza of each ClusterQueue would need to be:
+```yaml
+...
+ - coveredResources: ["cpu", "memory", "example.com/accelerator-memory", "nvidia.com/mig-1g.5gb", "nvidia.com/mig-2g.10gb", "nvidia.com/mig-4g.20gb", "nvidia.com/mig-7g.40gb"]
+ flavors:
+ - name: default-flavor
+ resources:
+ - name: "cpu"
+ nominalQuota: 8
+ - name: "memory"
+ nominalQuota: 500G
+ - name: example.com/accelerator-memory
+ nominalQuota: 200G
+ - name: nvidia.com/mig-1g.5gb
+ nominalQuota: 40 # 200G/5g
+ - name: nvidia.com/mig-2g.10gb
+ nominalQuota: 20 # 200G/10g
+ - name: nvidia.com/mig-4g.20gb
+ nominalQuota: 10 # 200G/20g
+ - name: nvidia.com/mig-7g.40gb
+ nominalQuota: 5 # 200G/40g
+```
+
+##### Story 1B - Using Retain with MIG
+
+However, some cluster admins may desire to use `retain` for MIG resources to exercise
+finer grained control over the use of MIG partitions.
+To do this, the cluster admin could register the following transformations:
+* (`nvidia.com/mig-1g.5gb`, `example.com/accelerator-memory`, `5Gi`, `retain`)
+* (`nvidia.com/mig-2g.10gb`, `example.com/accelerator-memory`, `10Gi`, `retain`)
+* (`nvidia.com/mig-4g.20gb`, `example.com/accelerator-memory`, `20Gi`, `retain`)
+* (`nvidia.com/mig-7g.40gb`, `example.com/accelerator-memory`, `40Gi`, `retain`)
+
+A Job requesting the resources below:
+```yaml
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+ memory: 100M
+ cpu: 1
+```
+would yield a Workload with an effective resource request of:
+```yaml
+ example.com/accelerator-memory: 20G
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+ memory: 100M
+ cpu: 1
+```
+
+Below is an example ResourceGroup that the cluster admin could define that
+prevents the usage of `7g.40gb` partitions by not listing them in the covered-resources
+and puts a tighter quota on `4g.20gb` partitions than would be implied by the `accelerator-memory` quota:
+```yaml
+ - coveredResources: ["cpu", "memory", "example.com/accelerator-memory"]
+ flavors:
+ - name: default-flavor
+ resources:
+ - name: "cpu"
+ nominalQuota: 8
+ - name: "memory"
+ nominalQuota: 500G
+ - name: example.com/accelerator-memory
+ nominalQuota: 200G
+ - name: nvidia.com/mig-1g.5gb
+ nominalQuota: 40 # 200G/5g
+ - name: nvidia.com/mig-2g.10gb
+ nominalQuota: 20 # 200G/10g
+ - name: nvidia.com/mig-4g.20gb
+ nominalQuota: 4 # less than the 10 that would be allowed by the accelerator-memory quota
+ borrowingLimit: 0
+```
+
+[mig]: https://docs.nvidia.com/datacenter/cloud-native/kubernetes/latest/index.html#the-mixed-strategy
+[instaslice]: https://github.com/openshift/instaslice-operator
+
+#### Story 2
+
+This KEP would allow Kueue to augment a Job's resource requests
+for quota purposes with additional resources that are not actually
+available in the Nodes of the cluster. For example, it could be used to
+define quotas in terms of a fictional currency `example.com/credits`
+to give "costs" to various resources. This could be used to approximate
+the monetary cost of different cloud resources and thus apply a "budget" to a team.
+We'd expect in this usage pattern that `retain` would be used so that the
+transformed resource list is just augmented with the computed `credits` resource.
+Most likely `credits` would be in a separate ResourceGroup than the "real" resources (similar to the
+[example of a ClusterQueue with software licenses](https://kueue.sigs.k8s.io/docs/concepts/cluster_queue/#resource-groups))
+and the `borrowingLimit` and `lendingLimit` for
+`credits` would be set to `0` to enforce the intended fiscal constraint.
+
+For example:
+* (`foo.com/gpu`, `example.com/credits`, `10`, `retain`)
+* (`cpu`, `example.com/credits`, `1`, `retain`)
+
+```yaml
+ - coveredResources: ["cpu", "memory", "foo.com/gpu"]
+ flavors:
+ - name: "spot"
+ resources:
+ - name: "cpu"
+ nominalQuota: 10
+ - name: "memory"
+ nominalQuota: 36Gi
+ - name: "foo.com/gpu"
+ nominalQuota: 40
+ - name: "on-demand"
+ resources:
+ - name: "cpu"
+ nominalQuota: 18
+ - name: "memory"
+ nominalQuota: 72Gi
+ - name: "foo.com/gpu"
+ nominalQuota: 100
+ - coveredResources: ["example.com/credits"]
+ flavors:
+ - name: "team1-budget"
+ resources:
+ - name: "example.com/credits"
+ nominalQuota: 750
+ borrowingLimit: 0
+ lendingLimit: 0
+```
+
+With the single global `ResourceTransformation` proposed in this KEP, this use case may
+be of limited applicability. It would benefit from finer-grained
+[alternatives](#alternatives) that would for example `cpu` allocated from
+the `spot` flavor to cost fewer credits than when allocated from the `on-demand` flavor.
+
+## Design Details
+
+Since Kueue's workload.Info struct is already a well-defined
+place where resource filtering is being applied to compute the effective resource
+request from a Workload's PodSpec, the core of the implementation is
+straightforward and follows from how `excludedResourcePrefixes` are already processed.
+
+The non-trivial design issues are how to configure the transformations,
+the possible granularity of that configuration, and how to maximize observability
+of the effective resources requested by a Workload.
+
+### Specifying the Transformation
+
+In this KEP we propose to support a global set of resource transformations that would
+be applied to all Workloads. A `ResourceTransformation` instance would be added to Kueue's
+`Configuration` API as part of the existing `Resources` struct.
+More [flexible alternatives](#alternatives) were considered, but left as possible
+future extensions.
+
+The definitions below would be added to Kueue's `Configuration` types
+```go
+type Resources struct {
+ // ExcludedResourcePrefixes defines which resources should be ignored by Kueue
+ ExcludeResourcePrefixes []string `json:"excludeResourcePrefixes,omitempty"`
+
+ // Transformations defines how to transform PodSpec resources into Workload resource requests.
+ // +listType=map
+ // +listMapKey=input
+ Transformations []ResourceTransformation `json:"transformations,omitempty"`
+}
+
+type ResourceTransformationStrategy string
+
+const Retain ResourceTransformationStrategy = "Retain"
+const Replace ResourceTransformationStrategy = "Replace"
+
+type ResourceTransformation struct {
+ // Name of the input resource
+ Input corev1.ResourceName `json:"input"`
+
+ // Whether the input resource should be replaced or retained
+ // +kubebuilder:default="Retain"
+ Strategy ResourceTransformationStrategy `json:"strategy"`
+
+ // Output resources and quantities per unit of input resource
+ Outputs corev1.ResourceList `json:"outputs,omitempty"`
+}
+```
+Given these types, the following list of 4-tuples
+
+* (`nvidia.com/mig-1g.5gb`, `example.com/accelerator-memory`, `5Gi`, `replace`)
+* (`nvidia.com/mig-2g.10gb`, `example.com/accelerator-memory`, `10Gi`, `replace`)
+* (`nvidia.com/mig-4g.20gb`, `example.com/accelerator-memory`, `20Gi`, `replace`)
+* (`nvidia.com/mig-1g.5gb`, `example.com/credits`, `10`, `replace`)
+* (`nvidia.com/mig-2g.10gb`, `example.com/credits`, `15`, `replace`)
+* (`nvidia.com/mig-4g.20gb`, `example.com/credits`, `30`, `replace`)
+* (`cpu`, `example.com/credits`, `1`, `retain`)
+
+would be represented in yaml when embedded in the Kueue Configuration object as
+```yaml
+resources:
+ transformations:
+ - input: nvidia.com/mig-1g.5gb:
+ strategy: Replace
+ outputs:
+ example.com/accelerator-memory: 5G
+ example.com/credits: 10
+ - input: nvidia.com/mig-2g.10gb
+ strategy: Replace
+ outputs:
+ example.com/accelerator-memory: 10G
+ example.com/credits: 15
+ - input: nvidia.com/mig-4g.20gb:
+ strategy: Replace
+ outputs:
+ example.com/accelerator-memory: 20G
+ example.com/credits: 30
+ - cpu:
+ strategy: Retain
+ outputs:
+ example.com/credits: 1
+```
+
+### Observability
+
+Let's return to the first user story with MIG and look in more detail at how it works.
+The transformation matrix is:
+```yaml
+resources:
+ transformations:
+ - input: nvidia.com/mig-1g.5gb:
+ strategy: Replace
+ outputs:
+ example.com/accelerator-memory: 5G
+ - input: nvidia.com/mig-2g.10gb:
+ strategy: Replace
+ outputs:
+ example.com/accelerator-memory: 10G
+ - input: nvidia.com/mig-4g.20gb:
+ strategy: Replace
+ outputs:
+ example.com/accelerator-memory: 20G
+ - input: nvidia.com/mig-7g.40gb:
+ strategy: Replace
+ outputs:
+ example.com/accelerator-memory: 40G
+```
+
+We define a ClusterQueue with the covered resources below:
+```yaml
+...
+ - coveredResources: ["cpu", "memory", "example.com/accelerator-memory"]
+ flavors:
+ - name: default-flavor
+ resources:
+ - name: "cpu"
+ nominalQuota: 8
+ - name: "memory"
+ nominalQuota: 500G
+ - name: example.com/accelerator-memory
+ nominalQuota: 80G
+```
+
+The user submits a single Pod Job to this ClusterQueue with the resource requests/limits:
+```yaml
+ resources:
+ requests:
+ cpu: 1
+ memory: 100G
+ limits:
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+```
+
+When the Job is admitted, the transformed resources appear in the Workload's Status as shown below:
+```yaml
+Status:
+ Admission:
+ Cluster Queue: cluster-queue
+ Pod Set Assignments:
+ Count: 1
+ Flavors:
+ Cpu: default-flavor
+ example.com/accelerator-memory: default-flavor
+ Memory: default-flavor
+ Name: main
+ Resource Usage:
+ Cpu: 1
+ example.com/accelerator-memory: 20G
+ Memory: 97656250Ki
+```
+and in the ClusterQueue Status we would see:
+```yaml
+Status:
+ Admitted Workloads: 1
+ Conditions:
+ Last Transition Time: 2024-09-19T14:20:13Z
+ Message: Can admit new workloads
+ Observed Generation: 3
+ Reason: Ready
+ Status: True
+ Type: Active
+ Flavors Reservation:
+ Name: default-flavor
+ Resources:
+ Borrowed: 0
+ Name: cpu
+ Total: 1
+ Borrowed: 0
+ Name: example.com/accelerator-memory
+ Total: 20G
+ Borrowed: 0
+ Name: memory
+ Total: 97656250Ki
+ Flavors Usage:
+ Name: default-flavor
+ Resources:
+ Borrowed: 0
+ Name: cpu
+ Total: 1
+ Borrowed: 0
+ Name: example.com/accelerator-memory
+ Total: 20G
+ Borrowed: 0
+ Name: memory
+ Total: 97656250Ki
+ Pending Workloads: 0
+ Reserving Workloads: 1
+```
+
+After enough Workloads are admitted that there is queuing,
+then the detailed status message in the `QuotaReserved` condition
+of the Workload will indicate the resource(s) with insufficient quota, but the
+actual transformed resource request is not observable.
+```yaml
+Spec:
+ Active: true
+ Pod Sets:
+ Count: 1
+ Name: main
+ Template:
+ Metadata:
+ Spec:
+ Containers:
+ ...
+ Resources:
+ Limits:
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+ Requests:
+ Cpu: 1
+ Memory: 100G
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+...
+Status:
+ Conditions:
+ Last Transition Time: 2024-09-19T14:59:01Z
+ Message: couldn't assign flavors to pod set main: insufficient unused quota for example.com/accelerator-memory in flavor default-flavor, 20G more needed
+ Observed Generation: 1
+ Reason: Pending
+ Status: False
+ Type: QuotaReserved
+```
+
+We could improve the observability by extending the Workload Status with a ResourceRequests
+field that would contain a copy of the `TotalRequests` field of the controller-internal `workload.Info`
+struct. If we did this, we would instead see something like the below for a non-admitted Workload:
+```yaml
+Spec:
+ Active: true
+ Pod Sets:
+ Count: 1
+ Name: main
+ Template:
+ Metadata:
+ Spec:
+ Containers:
+ ...
+ Resources:
+ Limits:
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+ Requests:
+ Cpu: 1
+ Memory: 100G
+ nvidia.com/mig-1g.5gb: 2
+ nvidia.com/mig-2g.10gb: 1
+...
+Status:
+ Conditions:
+ Last Transition Time: 2024-09-19T14:59:01Z
+ Message: couldn't assign flavors to pod set main: insufficient unused quota for example.com/accelerator-memory in flavor default-flavor, 20G more needed
+ Observed Generation: 1
+ Reason: Pending
+ Status: False
+ Type: QuotaReserved
+ ResourceRequests:
+ Name: main
+ Resource Request:
+ Cpu: 1
+ example.com/accelerator-memory: 20G
+ Memory: 97656250Ki
+```
+
+### Test Plan
+
+[x] I/we understand the owners of the involved components may require updates to
+existing tests to make this code solid enough prior to committing the changes necessary
+to implement this enhancement.
+
+##### Prerequisite testing updates
+
+None
+
+#### Unit Tests
+
+Unit tests of the helper function invoked from `workload.NewInfo` will be added.
+
+Unit tests of loading the `ResourceTransformation` from a `Configuration` will be added.
+
+#### Integration tests
+
+Because resource mappings are configured during manager startup, we need to run
+an entire integration test suite with a non-empty resource transformation if we want to
+do any integration testing with resource transformations. I'd propose to extend
+`test/integration/controller/core` by adding a resource transformation to the manager that
+maps from a synthetic extended resource to both `cpu` and `credits`. We'd then add a
+`test/integration/controller/core/resource_transform_test.go` that would define a cluster
+queue with a resource group that covers `cpu` and `credit` and run a few quota and queuing
+tests against it.
+
+### Graduation Criteria
+
+## Implementation History
+
+## Drawbacks
+
+Adds an additional dimension of configuration that needs to be documented
+and maintained.
+
+The existing `excludedResoucePrefixes` already meant that Kueue's
+view of a Workload's resource request diverged from that of the
+Kubernetes scheduler. However, this KEP allows significantly larger
+divergences which puts additional pressure on ensuring the transformed
+resource requests are observable to end users and cluster admins.
+
+## Alternatives
+
+A monolithic `ResourceTransformation` that is only read during operator startup
+and cannot be selectively applied to Workloads may be overly limiting.
+More flexible options could be supported by promoting `ResourceTransformation`
+to a top-level cluster-scoped API object. A cluster admin could
+then define multiple `ResourceTransformation` instances and refer to them by name
+in fields of other objects.
+
+One advantage (and complexity) shared by all these alternatives is that
+they enable resource mappings to be changed without requiring a restart of
+the Kueue manager. This comes at the implementation complexity of watching
+for changes to `ResourceTransformation` instances and propagating them appropriately.
+
+In all of these options, we would add either a `resourceMappingName` (`string`)
+or a `resourceMappingNames` (`[]string`) field to an existing
+API object. In the later case, the named mappings would be combined
+to construct a composite `ResourceTransformation` which would be stored as a new field in
+the `Status` field of the API object. If the merging process detects an inconsistent mapping
+(for example the named mappings specify both `Retain` and `Replace` for the
+same `input`), then an error would be reported via the `Conditions` of the API object's `Status`.
+
+### ClusterQueue Scoped
+
+A relatively simple option is to extend ClusterQueue with a `resourceMappingName(s)` field.
+The logic of applying a resource mapping in `workload.NewInfo` is unchanged; the only difference
+is that the resource mapping comes from the ClusterQueue's Status instead of from global `InfoOption`.
+
+### ResourceFlavor Scoped
+
+In the GitHub discussion of this KEP, we considered extended `ResourceFlavor` with a `resourceMappingName(s)` field.
+This implementation looks significantly harder, as it would mean structural changes
+in how flavor assignment is done. In particular, we do not know the effective resource
+request until we apply the transformation, but flavor assignment is done on a resource-by-resource
+outer loop based on which ResourceGroup covers the requested resource. Therefore it is not
+clear where or how a ResourceFlavor scoped `ResourceTransformation` would be applied.
+
+### Workload Scoped
+
+The finest-grained option would be to support custom mapping on individual workloads.
+This could be done by using an annotation to allow the user to specify a per-workload
+resource mapping to be applied by Kueue (most likely in or around `workload.AdjustResources`).
+The implementation of this (especially if restricted to an annotation that named a single mapping) would be
+straightforward, but it is too fine-grained to be a good fit for any of the user stories discussed so far.
diff --git a/keps/2937-resource-transformer/kep.yaml b/keps/2937-resource-transformer/kep.yaml
new file mode 100644
index 00000000000..a92d06c44b4
--- /dev/null
+++ b/keps/2937-resource-transformer/kep.yaml
@@ -0,0 +1,30 @@
+title: Configurable Resource Transformers
+kep-number: 2937
+authors:
+ - "@dgrove-oss"
+status: implementable
+creation-date: 2024-09-06
+reviewers:
+ - "@alculquicondor"
+ - "@mimowo"
+ - "@tenzen-y"
+approvers:
+ - "@mimowo"
+
+# The target maturity stage in the current dev cycle for this KEP.
+stage: beta
+
+# The most recent milestone for which work toward delivery of this KEP has been
+# done. This can be the current (upcoming) milestone, if it is being actively
+# worked on.
+latest-milestone: "v0.9"
+
+# The milestone at which this feature was, or is targeted to be, at each stage.
+milestone:
+ alpha: "v0.9"
+
+# The following PRR answers are required at alpha release
+# List the feature gate name and the components for which it must be enabled
+feature-gates:
+ - name: ConfigurableResourceTransformations
+disable-supported: true
diff --git a/keps/3122-expose-flavors-in-localqueue-status/README.md b/keps/3122-expose-flavors-in-localqueue-status/README.md
new file mode 100644
index 00000000000..8e9f233cc2f
--- /dev/null
+++ b/keps/3122-expose-flavors-in-localqueue-status/README.md
@@ -0,0 +1,192 @@
+# KEP-3122: Expose Flavors in LocalQueue Status
+
+
+- [Summary](#summary)
+- [Motivation](#motivation)
+ - [Goals](#goals)
+ - [Non-Goals](#non-goals)
+- [Proposal](#proposal)
+ - [User Stories (Optional)](#user-stories-optional)
+ - [Story 1](#story-1)
+ - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
+ - [Risks and Mitigations](#risks-and-mitigations)
+- [Design Details](#design-details)
+ - [API](#api)
+ - [Implementation overview](#implementation-overview)
+ - [Future works](#future-works)
+ - [Test Plan](#test-plan)
+ - [Prerequisite testing updates](#prerequisite-testing-updates)
+ - [Unit Tests](#unit-tests)
+ - [Integration tests](#integration-tests)
+ - [Graduation Criteria](#graduation-criteria)
+- [Implementation History](#implementation-history)
+- [Drawbacks](#drawbacks)
+- [Alternatives](#alternatives)
+
+
+## Summary
+
+This KEP introduces a new status field in LocalQueue, allowing users to see
+all currently available ResourceFlavors in the LocalQueue.
+
+## Motivation
+
+Currently, users without RBAC access to ResourceFlavors cannot view the list
+of available flavors. Depending on the RBAC rules, users might also lack read
+access to ClusterQueues. Providing users with information about the available
+flavors is useful, as it gives them an idea of the capabilities provided by
+a LocalQueue (e.g., a flavor might include newer GPUs).
+
+### Goals
+
+- Provide a possibility to see all currently available ResourceFlavors in
+ the LocalQueue.
+
+### Non-Goals
+
+- Verify that the ResourceFlavors exist and show only the existing flavors.
+- The stopPolicies are never considered in the LocalQueue flavors status field.
+
+## Proposal
+
+Introduce a new status field `flavors` in LocalQueue
+that will be updated when ClusterQueue flavors are modified.
+
+### User Stories (Optional)
+
+#### Story 1
+
+As a user I want to see the list of all ResourceFlavors available in each LocalQueue
+due to the RBAC configuration for ClusterQueue in my cluster I cannot inspect the
+ClusterQueue objects directly, only LocalQueues.
+
+### Notes/Constraints/Caveats (Optional)
+
+### Risks and Mitigations
+
+Risk: Increased size of the status object due to adding 16 resource flavors
+to the LocalQueue.
+
+Mitigation: The number of available flavor names is limited to 16, so this
+additional field does not significantly impact performance.
+
+## Design Details
+
+### API
+
+Create `Flavor` API object:
+
+```go
+type Flavor struct {
+ // name of the flavor.
+ Name ResourceFlavorReference `json:"name"`
+
+ // resources used in the flavor.
+ // +listType=set
+ // +kubebuilder:validation:MaxItems=16
+ // +optional
+ Resources []string `json:"resources,omitempty"`
+
+ // nodeLabels are labels that associate the ResourceFlavor with Nodes that
+ // have the same labels.
+ // +mapType=atomic
+ // +kubebuilder:validation:MaxProperties=8
+ // +optional
+ NodeLabels map[string]string `json:"nodeLabels,omitempty"`
+
+ // nodeTaints are taints that the nodes associated with this ResourceFlavor
+ // have.
+ // +listType=atomic
+ // +kubebuilder:validation:MaxItems=8
+ // +optional
+ NodeTaints []corev1.Taint `json:"nodeTaints,omitempty"`
+}
+```
+
+Modify `LocalQueueStatus` API object:
+
+```go
+// LocalQueueStatus defines the observed state of LocalQueue
+type LocalQueueStatus struct {
+ ...
+ // flavors lists all currently available ResourceFlavors in specified ClusterQueue.
+ //
+ // +listType=map
+ // +listMapKey=name
+ // +kubebuilder:validation:MaxItems=16
+ // +optional
+ Flavors []Flavor `json:"flavors,omitempty"`
+}
+```
+
+### Implementation overview
+
+Modify `LocalQueueUsageStats` object:
+
+```go
+type LocalQueueUsageStats struct {
+ ...
+ Flavors []kueue.ResourceFlavorReference
+}
+```
+
+Get available `Flavors` from `cqImpl.ResourceGroups` in `cache.LocalQueueUsage(...)`
+method and update `Flavors` field on `UpdateStatusIfChanged(...)`
+on each LocalQueue reconcile when it was updated.
+
+### Future works
+
+In the future, we can also add the `availableCoveredResources` field. This field allows
+batch users to understand which resources may be available for the LocalQueue.
+
+
+### Test Plan
+
+
+
+[x] I/we understand the owners of the involved components may require updates to
+existing tests to make this code solid enough prior to committing the changes necessary
+to implement this enhancement.
+
+##### Prerequisite testing updates
+
+
+
+None.
+
+#### Unit Tests
+
+Existing unit tests should be updated to tests whether the new data are correctly
+passed and applied on CRD.
+
+#### Integration tests
+
+Existing integration tests should be updated to tests whether the new data are correctly
+passed and applied on CRD.
+
+Additionally, add an integration test case to check that Flavors are updated after
+forcefully removing the ClusterQueue while ignoring validations.
+
+### Graduation Criteria
+
+We will graduate this feature to stable together with the whole LocalQueue API.
+
+## Implementation History
+
+2024-10-02 KEP
+
+## Drawbacks
+
+## Alternatives
\ No newline at end of file
diff --git a/keps/3122-expose-flavors-in-localqueue-status/kep.yaml b/keps/3122-expose-flavors-in-localqueue-status/kep.yaml
new file mode 100644
index 00000000000..ecb385990b2
--- /dev/null
+++ b/keps/3122-expose-flavors-in-localqueue-status/kep.yaml
@@ -0,0 +1,31 @@
+title: Expose Flavors in LocalQueue Status
+kep-number: 3122
+authors:
+ - "@mbobrovskyi"
+status: implementable
+creation-date: 2024-10-02
+reviewers:
+ - "@mimowo"
+ - "@alculquicondor"
+ - "@tenzen-y"
+approvers:
+ - "@mimowo"
+ - "@alculquicondor"
+ - "@tenzen-y"
+
+# The target maturity stage in the current dev cycle for this KEP.
+stage: beta
+
+# The most recent milestone for which work toward delivery of this KEP has been
+# done. This can be the current (upcoming) milestone, if it is being actively
+# worked on.
+latest-milestone: "v0.9"
+
+# The milestone at which this feature was, or is targeted to be, at each stage.
+milestone:
+ beta: "v0.9"
+
+# List the feature gate name and the components for which it must be enabled
+feature-gates:
+ - name: ExposeFlavorsInLocalQueue
+disable-supported: true
diff --git a/keps/349-all-or-nothing/README.md b/keps/349-all-or-nothing/README.md
index 90e5f8ec418..f4410d1a7ae 100644
--- a/keps/349-all-or-nothing/README.md
+++ b/keps/349-all-or-nothing/README.md
@@ -194,7 +194,10 @@ We extend the global Kueue Configuration API to introduce the new fields:
// Configuration is the Schema for the kueueconfigurations API
type Configuration struct {
...
- // WaitForPodsReady is configuration for waitForPodsReady
+ // WaitForPodsReady is configuration to provide a time-based all-or-nothing
+ // scheduling semantics for Jobs, by ensuring all pods are ready (running
+ // and passing the readiness probe) within the specified time. If the timeout
+ // is exceeded, then the workload is evicted.
WaitForPodsReady *WaitForPodsReady `json:"waitForPodsReady,omitempty"`
}
@@ -207,16 +210,73 @@ type WaitForPodsReady struct {
// it defaults to false.
Enable *bool `json:"enable,omitempty"`
- // timeoutSeconds defines optional time duration in seconds, relative to the
- // job.status.StartTime, it can take an admitted workload to reach
- // the PodsReady condition.
- // After exceeding the timeout the corresponding job gets suspended again
- // and moved to the ClusterQueue's inadmissibleWorkloads list. The timeout is
- // enforced only if waitForPodsReady.enable=true. If unspecified, it defaults to 5min.
+ // Timeout defines the time for an admitted workload to reach the
+ // PodsReady=true condition. When the timeout is exceeded, the workload
+ // evicted and requeued in the same cluster queue.
+ // Defaults to 5min.
// +optional
- TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"`
+ Timeout *metav1.Duration `json:"timeout,omitempty"`
+
+ // BlockAdmission when true, cluster queue will block admissions for all
+ // subsequent jobs until the jobs reach the PodsReady=true condition.
+ // This setting is only honored when `Enable` is set to true.
+ BlockAdmission *bool `json:"blockAdmission,omitempty"`
+
+ // RequeuingStrategy defines the strategy for requeuing a Workload.
+ // +optional
+ RequeuingStrategy *RequeuingStrategy `json:"requeuingStrategy,omitempty"`
+}
+
+type RequeuingStrategy struct {
+ // Timestamp defines the timestamp used for re-queuing a Workload
+ // that was evicted due to Pod readiness. The possible values are:
+ //
+ // - `Eviction` (default) indicates from Workload `Evicted` condition with `PodsReadyTimeout` reason.
+ // - `Creation` indicates from Workload .metadata.creationTimestamp.
+ //
+ // +optional
+ Timestamp *RequeuingTimestamp `json:"timestamp,omitempty"`
+
+ // BackoffLimitCount defines the maximum number of re-queuing retries.
+ // Once the number is reached, the workload is deactivated (`.spec.activate`=`false`).
+ // When it is null, the workloads will repeatedly and endless re-queueing.
+ //
+ // Every backoff duration is about "b*2^(n-1)+Rand" where:
+ // - "b" represents the base set by "BackoffBaseSeconds" parameter,
+ // - "n" represents the "workloadStatus.requeueState.count",
+ // - "Rand" represents the random jitter.
+ // During this time, the workload is taken as an inadmissible and
+ // other workloads will have a chance to be admitted.
+ // By default, the consecutive requeue delays are around: (60s, 120s, 240s, ...).
+ //
+ // Defaults to null.
+ // +optional
+ BackoffLimitCount *int32 `json:"backoffLimitCount,omitempty"`
+
+ // BackoffBaseSeconds defines the base for the exponential backoff for
+ // re-queuing an evicted workload.
+ //
+ // Defaults to 60.
+ // +optional
+ BackoffBaseSeconds *int32 `json:"backoffBaseSeconds,omitempty"`
+
+ // BackoffMaxSeconds defines the maximum backoff time to re-queue an evicted workload.
+ //
+ // Defaults to 3600.
+ // +optional
+ BackoffMaxSeconds *int32 `json:"backoffMaxSeconds,omitempty"`
}
+type RequeuingTimestamp string
+
+const (
+ // CreationTimestamp timestamp (from Workload .metadata.creationTimestamp).
+ CreationTimestamp RequeuingTimestamp = "Creation"
+
+ // EvictionTimestamp timestamp (from Workload .status.conditions).
+ EvictionTimestamp RequeuingTimestamp = "Eviction"
+)
+
```
### PodsReady workload condition
diff --git a/keps/79-hierarchical-cohorts/README.md b/keps/79-hierarchical-cohorts/README.md
index 3a935d1557a..3f69e3e88a8 100644
--- a/keps/79-hierarchical-cohorts/README.md
+++ b/keps/79-hierarchical-cohorts/README.md
@@ -9,6 +9,7 @@
- [User Stories (Optional)](#user-stories-optional)
- [Story 1](#story-1)
- [Story 2](#story-2)
+ - [Notes](#notes)
- [Risks and Mitigations](#risks-and-mitigations)
- [Design Details](#design-details)
- [Test Plan](#test-plan)
@@ -91,6 +92,22 @@ borrow unused capacity from any of the organizations.
With this proposal, the cohorts for organizations will set borrowingLimit to 0. Top level Cohort will
contain all of these Cohorts, plus the "special" ClusterQueue, with borrowingLimit set to infinity.
+### Notes
+
+As Cohorts do not have finalizers, Cohort's deletion will be processed
+immediately. If this Cohort is referenced by any Cohorts or ClusterQueues, the
+deleted Cohort will still exist in Kueue, but will no longer provide any
+resources of its own nor have a parent Cohort.
+
+This immediate deletion could result the tree suddenly losing capacity, which,
+depending on configuration, may result in preemptions. Fixing this is
+not as simple as just adding finalizers - non-deletions (nodes changing parents
+or resources) may trigger this capacity loss as well. We may consider
+preventing a node from making a change which would result invalid balances -
+perhaps by requiring cordoning or draining some part of the tree before the
+change is executed. This requires further consideration and will not be included
+in the initial implementation.
+
### Risks and Mitigations
* Users may create a cycle in the Cohort hierarchy - Kueue will stop all new admissions within
@@ -246,4 +263,4 @@ and quotas it may be hard for users to keep them under control.
## Alternatives
-* https://github.com/kubernetes-sigs/kueue/pull/1093 - Hierarchical ClusterQueues.
\ No newline at end of file
+* https://github.com/kubernetes-sigs/kueue/pull/1093 - Hierarchical ClusterQueues.
diff --git a/keps/993-two-phase-admission/README.md b/keps/993-two-phase-admission/README.md
index b8f44c0c199..904de73b763 100644
--- a/keps/993-two-phase-admission/README.md
+++ b/keps/993-two-phase-admission/README.md
@@ -17,6 +17,7 @@
- [Unit Tests](#unit-tests)
- [Integration tests](#integration-tests)
- [Graduation Criteria](#graduation-criteria)
+ - [Deprecation](#deprecation)
- [Implementation History](#implementation-history)
- [Drawbacks](#drawbacks)
- [Alternatives](#alternatives)
@@ -154,12 +155,6 @@ type AdmissionCheckSpec struct {
// not a K8S pod or deployment name. Cannot be empty.
ControllerName string `json:"controllerName"`
- // How long to keep the workload suspended
- // after a failed check (after it transitioned to False).
- // After that the check state goes to "Unknown".
- // The default is 15 min.
- RetryDelayMinutes *int64 `json:"retryDelayMinutes,omitempty"`
-
// A reference to the additional parameters for the check.
Parameters *AdmissionCheckParametersReference `json:"parameters,omitempty"`
@@ -277,6 +272,16 @@ The tests should cover:
### Graduation Criteria
+#### Deprecation
+
+We deprecate the RetryDelayMinutes, and going to remove it in feature versions of the API.
+
+First iteration (0.8):
+ - deprecate the RetryDelayMinutes field on API.
+
+Second iteration (v1beta2):
+ - remove the RetryDelayMinutes field from AdmissionCheckSpec object on bumping the API version.
+
## Implementation History
## Drawbacks
diff --git a/keps/993-two-phase-admission/kep.yaml b/keps/993-two-phase-admission/kep.yaml
index 2d840c9e970..aec6916c687 100644
--- a/keps/993-two-phase-admission/kep.yaml
+++ b/keps/993-two-phase-admission/kep.yaml
@@ -2,7 +2,7 @@ title: Two Stage Admission Process
kep-number: 993
authors:
- "@mwielgus"
-status: draft
+status: implementable
creation-date: 2023-07-18
reviewers:
- "@kerthcet"
@@ -16,7 +16,7 @@ stage: beta
# The most recent milestone for which work toward delivery of this KEP has been
# done. This can be the current (upcoming) milestone, if it is being actively
# worked on.
-latest-milestone: "v0.5"
+latest-milestone: "v0.8"
# The milestone at which this feature was, or is targeted to be, at each stage.
milestone:
diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go
index f431e80704c..b28e81b1cd5 100644
--- a/pkg/cache/cache.go
+++ b/pkg/cache/cache.go
@@ -133,7 +133,7 @@ func (c *Cache) newClusterQueue(cq *kueue.ClusterQueue) (*clusterQueue, error) {
}
c.hm.AddClusterQueue(cqImpl)
c.hm.UpdateClusterQueueEdge(cq.Name, cq.Spec.Cohort)
- if err := cqImpl.updateClusterQueue(cq, c.resourceFlavors, c.admissionChecks, nil); err != nil {
+ if err := cqImpl.updateClusterQueue(c.hm.CycleChecker, cq, c.resourceFlavors, c.admissionChecks, nil); err != nil {
return nil, err
}
@@ -375,7 +375,7 @@ func (c *Cache) UpdateClusterQueue(cq *kueue.ClusterQueue) error {
}
oldParent := cqImpl.Parent()
c.hm.UpdateClusterQueueEdge(cq.Name, cq.Spec.Cohort)
- if err := cqImpl.updateClusterQueue(cq, c.resourceFlavors, c.admissionChecks, oldParent); err != nil {
+ if err := cqImpl.updateClusterQueue(c.hm.CycleChecker, cq, c.resourceFlavors, c.admissionChecks, oldParent); err != nil {
return err
}
for _, qImpl := range cqImpl.localQueues {
@@ -398,23 +398,25 @@ func (c *Cache) DeleteClusterQueue(cq *kueue.ClusterQueue) {
metrics.ClearCacheMetrics(cq.Name)
}
-func (c *Cache) AddCohort(apiCohort *kueuealpha.Cohort) {
+func (c *Cache) AddOrUpdateCohort(apiCohort *kueuealpha.Cohort) error {
c.Lock()
defer c.Unlock()
- cohort := newCohort(apiCohort.Name)
- c.hm.AddCohort(cohort)
- cohort.updateCohort(apiCohort)
+ c.hm.AddCohort(apiCohort.Name)
+ cohort := c.hm.Cohorts[apiCohort.Name]
+ oldParent := cohort.Parent()
+ c.hm.UpdateCohortEdge(apiCohort.Name, apiCohort.Spec.Parent)
+ return cohort.updateCohort(c.hm.CycleChecker, apiCohort, oldParent)
}
-func (c *Cache) DeleteCohort(apiCohort *kueuealpha.Cohort) {
+func (c *Cache) DeleteCohort(cohortName string) {
c.Lock()
defer c.Unlock()
- c.hm.DeleteCohort(apiCohort.Name)
+ c.hm.DeleteCohort(cohortName)
// If the cohort still exists after deletion, it means
// that it has one or more children referencing it.
// We need to run update algorithm.
- if cohort, ok := c.hm.Cohorts[apiCohort.Name]; ok {
+ if cohort, ok := c.hm.Cohorts[cohortName]; ok {
updateCohortResourceNode(cohort)
}
}
diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go
index c8f205b7a1e..8293ee559a7 100644
--- a/pkg/cache/cache_test.go
+++ b/pkg/cache/cache_test.go
@@ -108,7 +108,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
wantClusterQueues: map[string]*clusterQueue{
"a": {
Name: "a",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -126,7 +126,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"c": {
Name: "c",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 3,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -144,7 +144,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"e": {
Name: "e",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: pending,
@@ -234,7 +234,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
wantClusterQueues: map[string]*clusterQueue{
"a": {
Name: "a",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
FlavorFungibility: defaultFlavorFungibility,
NamespaceSelector: labels.Nothing(),
Status: active,
@@ -252,7 +252,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"c": {
Name: "c",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 3,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -270,7 +270,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"e": {
Name: "e",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: pending,
@@ -335,7 +335,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
wantClusterQueues: map[string]*clusterQueue{
"a": {
Name: "a",
- AllocatableResourceGeneration: 2,
+ AllocatableResourceGeneration: 4,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -344,7 +344,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"b": {
Name: "b",
- AllocatableResourceGeneration: 2,
+ AllocatableResourceGeneration: 3,
NamespaceSelector: labels.Everything(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -353,7 +353,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"c": {
Name: "c",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 5,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -371,7 +371,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"e": {
Name: "e",
- AllocatableResourceGeneration: 2,
+ AllocatableResourceGeneration: 4,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -380,7 +380,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"f": {
Name: "f",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 3,
NamespaceSelector: labels.Nothing(),
Status: active,
Preemption: defaultPreemption,
@@ -509,7 +509,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
wantClusterQueues: map[string]*clusterQueue{
"a": {
Name: "a",
- AllocatableResourceGeneration: 2,
+ AllocatableResourceGeneration: 4,
FlavorFungibility: defaultFlavorFungibility,
Status: active,
Preemption: defaultPreemption,
@@ -518,7 +518,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"b": {
Name: "b",
- AllocatableResourceGeneration: 2,
+ AllocatableResourceGeneration: 3,
FlavorFungibility: defaultFlavorFungibility,
Status: active,
Preemption: defaultPreemption,
@@ -527,7 +527,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"c": {
Name: "c",
- AllocatableResourceGeneration: 2,
+ AllocatableResourceGeneration: 4,
FlavorFungibility: defaultFlavorFungibility,
Status: active,
Preemption: defaultPreemption,
@@ -567,7 +567,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"c": {
Name: "c",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 3,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -576,7 +576,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"e": {
Name: "e",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: pending,
@@ -616,7 +616,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
wantClusterQueues: map[string]*clusterQueue{
"a": {
Name: "a",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -634,7 +634,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"c": {
Name: "c",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 3,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -652,7 +652,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
},
"e": {
Name: "e",
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
NamespaceSelector: labels.Nothing(),
FlavorFungibility: defaultFlavorFungibility,
Status: active,
@@ -1055,8 +1055,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
name: "create cohort",
operation: func(cache *Cache) error {
cohort := utiltesting.MakeCohort("cohort").Obj()
- cache.AddCohort(cohort)
- return nil
+ return cache.AddOrUpdateCohort(cohort)
},
wantCohorts: map[string]sets.Set[string]{
"cohort": nil,
@@ -1066,8 +1065,8 @@ func TestCacheClusterQueueOperations(t *testing.T) {
name: "create and delete cohort",
operation: func(cache *Cache) error {
cohort := utiltesting.MakeCohort("cohort").Obj()
- cache.AddCohort(cohort)
- cache.DeleteCohort(cohort)
+ _ = cache.AddOrUpdateCohort(cohort)
+ cache.DeleteCohort(cohort.Name)
return nil
},
wantCohorts: nil,
@@ -1076,11 +1075,11 @@ func TestCacheClusterQueueOperations(t *testing.T) {
name: "cohort remains after deletion when child exists",
operation: func(cache *Cache) error {
cohort := utiltesting.MakeCohort("cohort").Obj()
- cache.AddCohort(cohort)
+ _ = cache.AddOrUpdateCohort(cohort)
_ = cache.AddClusterQueue(context.Background(),
utiltesting.MakeClusterQueue("cq").Cohort("cohort").Obj())
- cache.DeleteCohort(cohort)
+ cache.DeleteCohort(cohort.Name)
return nil
},
wantClusterQueues: map[string]*clusterQueue{
@@ -1089,7 +1088,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
NamespaceSelector: labels.Everything(),
Status: active,
Preemption: defaultPreemption,
- AllocatableResourceGeneration: 1,
+ AllocatableResourceGeneration: 2,
FlavorFungibility: defaultFlavorFungibility,
FairWeight: oneQuantity,
},
@@ -1103,7 +1102,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
if tc.disableLendingLimit {
- defer features.SetFeatureGateDuringTest(t, features.LendingLimit, false)()
+ features.SetFeatureGateDuringTest(t, features.LendingLimit, false)
}
cache := New(utiltesting.NewFakeClient(tc.clientObjects...))
if err := tc.operation(cache); err != nil {
@@ -1952,6 +1951,80 @@ func TestClusterQueueUsage(t *testing.T) {
},
wantAdmittedWorkloads: 1,
},
+ "clusterQueue with cohort; partial admission": {
+ clusterQueue: cq,
+ workloads: []kueue.Workload{
+ *utiltesting.MakeWorkload("partial-one", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).Request(corev1.ResourceCPU, "2").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("foo").Assignment(corev1.ResourceCPU, "default", "4000m").AssignmentPodCount(2).Obj()).
+ Admitted(true).
+ Obj(),
+ *utiltesting.MakeWorkload("partial-two", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).Request(corev1.ResourceCPU, "2").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("foo").Assignment(corev1.ResourceCPU, "default", "4000m").AssignmentPodCount(2).Obj()).
+ Obj(),
+ },
+ wantReservedResources: []kueue.FlavorUsage{
+ {
+ Name: "default",
+ Resources: []kueue.ResourceUsage{{
+ Name: corev1.ResourceCPU,
+ Total: resource.MustParse("8"),
+ }},
+ },
+ {
+ Name: "model_a",
+ Resources: []kueue.ResourceUsage{{
+ Name: "example.com/gpu",
+ }},
+ },
+ {
+ Name: "model_b",
+ Resources: []kueue.ResourceUsage{{
+ Name: "example.com/gpu",
+ }},
+ },
+ {
+ Name: "interconnect_a",
+ Resources: []kueue.ResourceUsage{
+ {Name: "example.com/vf-0"},
+ {Name: "example.com/vf-1"},
+ {Name: "example.com/vf-2"},
+ },
+ },
+ },
+ wantReservingWorkloads: 2,
+ wantUsedResources: []kueue.FlavorUsage{
+ {
+ Name: "default",
+ Resources: []kueue.ResourceUsage{{
+ Name: corev1.ResourceCPU,
+ Total: resource.MustParse("4"),
+ }},
+ },
+ {
+ Name: "model_a",
+ Resources: []kueue.ResourceUsage{{
+ Name: "example.com/gpu",
+ }},
+ },
+ {
+ Name: "model_b",
+ Resources: []kueue.ResourceUsage{{
+ Name: "example.com/gpu",
+ }},
+ },
+ {
+ Name: "interconnect_a",
+ Resources: []kueue.ResourceUsage{
+ {Name: "example.com/vf-0"},
+ {Name: "example.com/vf-1"},
+ {Name: "example.com/vf-2"},
+ },
+ },
+ },
+ wantAdmittedWorkloads: 1,
+ },
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
@@ -3281,15 +3354,15 @@ func TestClusterQueueReadiness(t *testing.T) {
clusterQueueName: "queue1",
wantStatus: metav1.ConditionFalse,
wantReason: "FlavorNotFound",
- wantMessage: "Can't admit new workloads: FlavorNotFound",
+ wantMessage: "Can't admit new workloads: references missing ResourceFlavor(s): [flavor1].",
},
"check not found": {
clusterQueues: []*kueue.ClusterQueue{baseQueue},
resourceFlavors: []*kueue.ResourceFlavor{baseFlavor},
clusterQueueName: "queue1",
wantStatus: metav1.ConditionFalse,
- wantReason: "CheckNotFoundOrInactive",
- wantMessage: "Can't admit new workloads: CheckNotFoundOrInactive",
+ wantReason: "AdmissionCheckNotFound",
+ wantMessage: "Can't admit new workloads: references missing AdmissionCheck(s): [check1].",
},
"check inactive": {
clusterQueues: []*kueue.ClusterQueue{baseQueue},
@@ -3297,15 +3370,15 @@ func TestClusterQueueReadiness(t *testing.T) {
admissionChecks: []*kueue.AdmissionCheck{utiltesting.MakeAdmissionCheck("check1").Obj()},
clusterQueueName: "queue1",
wantStatus: metav1.ConditionFalse,
- wantReason: "CheckNotFoundOrInactive",
- wantMessage: "Can't admit new workloads: CheckNotFoundOrInactive",
+ wantReason: "AdmissionCheckInactive",
+ wantMessage: "Can't admit new workloads: references inactive AdmissionCheck(s): [check1].",
},
"flavor and check not found": {
clusterQueues: []*kueue.ClusterQueue{baseQueue},
clusterQueueName: "queue1",
wantStatus: metav1.ConditionFalse,
wantReason: "FlavorNotFound",
- wantMessage: "Can't admit new workloads: FlavorNotFound, CheckNotFoundOrInactive",
+ wantMessage: "Can't admit new workloads: references missing ResourceFlavor(s): [flavor1], references missing AdmissionCheck(s): [check1].",
},
"terminating": {
clusterQueues: []*kueue.ClusterQueue{baseQueue},
@@ -3333,7 +3406,7 @@ func TestClusterQueueReadiness(t *testing.T) {
clusterQueueName: "queue1",
wantStatus: metav1.ConditionFalse,
wantReason: "Stopped",
- wantMessage: "Can't admit new workloads: Stopped",
+ wantMessage: "Can't admit new workloads: is stopped.",
},
}
@@ -3378,3 +3451,314 @@ func TestClusterQueueReadiness(t *testing.T) {
})
}
}
+
+func TestCohortCycles(t *testing.T) {
+ t.Run("self cycle", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ cohort := utiltesting.MakeCohort("cohort").Parent("cohort").Obj()
+ if err := cache.AddOrUpdateCohort(cohort); err == nil {
+ t.Fatal("Expected failure when cycle")
+ }
+ })
+ t.Run("simple cycle", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ cohortA := utiltesting.MakeCohort("cohort-a").Parent("cohort-b").Obj()
+ cohortB := utiltesting.MakeCohort("cohort-b").Parent("cohort-c").Obj()
+ cohortC := utiltesting.MakeCohort("cohort-c").Parent("cohort-a").Obj()
+ if err := cache.AddOrUpdateCohort(cohortA); err != nil {
+ t.Fatal("Expected success as no cycle yet")
+ }
+ if err := cache.AddOrUpdateCohort(cohortB); err != nil {
+ t.Fatal("Expected success as no cycle yet")
+ }
+ if err := cache.AddOrUpdateCohort(cohortC); err == nil {
+ t.Fatal("Expected failure when cycle")
+ }
+ })
+ t.Run("clusterqueue add and update return error when cohort has cycle", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ ctx := context.Background()
+ cohortA := utiltesting.MakeCohort("cohort-a").Parent("cohort-b").Obj()
+ if err := cache.AddOrUpdateCohort(cohortA); err != nil {
+ t.Fatal("Expected success as no cycle yet")
+ }
+ cohortB := utiltesting.MakeCohort("cohort-b").Parent("cohort-c").Obj()
+ if err := cache.AddOrUpdateCohort(cohortB); err != nil {
+ t.Fatal("Expected success as no cycle yet")
+ }
+ cohortC := utiltesting.MakeCohort("cohort-c").Parent("cohort-a").Obj()
+ if err := cache.AddOrUpdateCohort(cohortC); err == nil {
+ t.Fatal("Expected failure when cycle")
+ }
+
+ // Error when creating CQ with parent Cohort-A
+ cq := utiltesting.MakeClusterQueue("cq").Cohort("cohort-a").Obj()
+ if err := cache.AddClusterQueue(ctx, cq); err == nil {
+ t.Fatal("Expected failure when adding cq to cohort with cycle")
+ }
+
+ // Error when updating CQ with parent Cohort-B
+ cq = utiltesting.MakeClusterQueue("cq").Cohort("cohort-b").Obj()
+ if err := cache.UpdateClusterQueue(cq); err == nil {
+ t.Fatal("Expected failure when updating cq to cohort with cycle")
+ }
+
+ // Delete Cohort C, breaking cycle
+ cache.DeleteCohort("cohort-c")
+
+ // Update succeeds
+ cq = utiltesting.MakeClusterQueue("cq").Cohort("cohort-b").Obj()
+ if err := cache.UpdateClusterQueue(cq); err != nil {
+ t.Fatal("Expected success")
+ }
+ })
+
+ t.Run("clusterqueue leaving cohort with cycle successfully updates new cohort", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ ctx := context.Background()
+ cycleCohort := utiltesting.MakeCohort("cycle").Parent("cycle").Obj()
+ if err := cache.AddOrUpdateCohort(cycleCohort); err == nil {
+ t.Fatal("Expected failure")
+ }
+
+ cohort := utiltesting.MakeCohort("cohort").
+ ResourceGroup(utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "10").FlavorQuotas).Obj()
+ if err := cache.AddOrUpdateCohort(cohort); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ // Error when creating cq with parent that has cycle
+ cq := utiltesting.MakeClusterQueue("cq").
+ ResourceGroup(utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "5").FlavorQuotas).
+ Cohort("cycle").Obj()
+ if err := cache.AddClusterQueue(ctx, cq); err == nil {
+ t.Fatal("Expected failure")
+ }
+
+ // Successfully updated to cohort without cycle
+ cq.Spec.Cohort = "cohort"
+ if err := cache.UpdateClusterQueue(cq); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ // cohort's SubtreeQuota contains resources from cq.
+ gotResource := cache.hm.Cohorts["cohort"].getResourceNode()
+ wantResource := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 15_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantResource, gotResource); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ })
+
+ t.Run("clusterqueue joining cohort with cycle successfully updates old cohort", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ ctx := context.Background()
+ cycleCohort := utiltesting.MakeCohort("cycle").Parent("cycle").Obj()
+ if err := cache.AddOrUpdateCohort(cycleCohort); err == nil {
+ t.Fatal("Expected failure")
+ }
+ cohort := utiltesting.MakeCohort("cohort").
+ ResourceGroup(utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "10").FlavorQuotas).Obj()
+ if err := cache.AddOrUpdateCohort(cohort); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ // Add CQ to cohort
+ cq := utiltesting.MakeClusterQueue("cq").
+ ResourceGroup(utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "5").FlavorQuotas).
+ Cohort("cohort").Obj()
+ if err := cache.AddClusterQueue(ctx, cq); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ // cohort's SubtreeQuota contains resources from cq
+ gotResource := cache.hm.Cohorts["cohort"].getResourceNode()
+ wantResource := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 15_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantResource, gotResource); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+
+ // Updated to cycle
+ cq.Spec.Cohort = "cycle"
+ if err := cache.UpdateClusterQueue(cq); err == nil {
+ t.Fatal("Expected failure")
+ }
+
+ // Cohort's SubtreeQuota no longer contains resources from CQ.
+ gotResource = cache.hm.Cohorts["cohort"].getResourceNode()
+ wantResource = ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantResource, gotResource); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ })
+
+ t.Run("cohort switching cohorts updates both cohort trees", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ root1 := utiltesting.MakeCohort("root1").Obj()
+ root2 := utiltesting.MakeCohort("root2").Obj()
+ if err := cache.AddOrUpdateCohort(root1); err != nil {
+ t.Fatal("Expected success")
+ }
+ if err := cache.AddOrUpdateCohort(root2); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ cohort := utiltesting.MakeCohort("cohort").Parent("root1").
+ ResourceGroup(utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "10").FlavorQuotas).Obj()
+ if err := cache.AddOrUpdateCohort(cohort); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ // before move
+ {
+ wantRoot1 := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{},
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ wantRoot2 := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{},
+ SubtreeQuota: resources.FlavorResourceQuantities{},
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantRoot1, cache.hm.Cohorts["root1"].getResourceNode()); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ if diff := cmp.Diff(wantRoot2, cache.hm.Cohorts["root2"].getResourceNode()); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ }
+ cohort.Spec.Parent = "root2"
+ if err := cache.AddOrUpdateCohort(cohort); err != nil {
+ t.Fatal("Expected success")
+ }
+ // after move
+ {
+ wantRoot1 := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{},
+ SubtreeQuota: resources.FlavorResourceQuantities{},
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ wantRoot2 := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{},
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantRoot1, cache.hm.Cohorts["root1"].getResourceNode()); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ if diff := cmp.Diff(wantRoot2, cache.hm.Cohorts["root2"].getResourceNode()); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ }
+ })
+
+ t.Run("cohort leaving cohort with cycle successfully updates new cohort", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ cycleRoot := utiltesting.MakeCohort("cycle-root").Parent("cycle-root").Obj()
+ if err := cache.AddOrUpdateCohort(cycleRoot); err == nil {
+ t.Fatal("Expected failure")
+ }
+ root := utiltesting.MakeCohort("root").Obj()
+ if err := cache.AddOrUpdateCohort(root); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ cohort := utiltesting.MakeCohort("cohort").Parent("cycle-root").
+ ResourceGroup(utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "10").FlavorQuotas).Obj()
+ if err := cache.AddOrUpdateCohort(cohort); err == nil {
+ t.Fatal("Expected failure")
+ }
+
+ cohort.Spec.Parent = "root"
+ if err := cache.AddOrUpdateCohort(cohort); err != nil {
+ t.Fatal("Expected success")
+ }
+ wantRoot := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{},
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantRoot, cache.hm.Cohorts["root"].getResourceNode()); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ })
+
+ t.Run("cohort joining cohort with cycle successfully updates old cohort", func(t *testing.T) {
+ cache := New(utiltesting.NewFakeClient())
+ cycleRoot := utiltesting.MakeCohort("cycle-root").Parent("cycle-root").Obj()
+ if err := cache.AddOrUpdateCohort(cycleRoot); err == nil {
+ t.Fatal("Expected failure")
+ }
+ root := utiltesting.MakeCohort("root").Obj()
+ if err := cache.AddOrUpdateCohort(root); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ cohort := utiltesting.MakeCohort("cohort").Parent("root").
+ ResourceGroup(utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "10").FlavorQuotas).Obj()
+ if err := cache.AddOrUpdateCohort(cohort); err != nil {
+ t.Fatal("Expected success")
+ }
+
+ // before move
+ {
+ wantRoot := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{},
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantRoot, cache.hm.Cohorts["root"].getResourceNode()); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ }
+
+ cohort.Spec.Parent = "cycle-root"
+ if err := cache.AddOrUpdateCohort(cohort); err == nil {
+ t.Fatal("Expected failure")
+ }
+
+ // after move
+ {
+ wantRoot := ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{},
+ SubtreeQuota: resources.FlavorResourceQuantities{},
+ Usage: resources.FlavorResourceQuantities{},
+ }
+ if diff := cmp.Diff(wantRoot, cache.hm.Cohorts["root"].getResourceNode()); diff != "" {
+ t.Errorf("Unexpected resource (-want,+got):\n%s", diff)
+ }
+ }
+ })
+}
diff --git a/pkg/cache/clusterqueue.go b/pkg/cache/clusterqueue.go
index 61fa63b436c..f0f94a1851e 100644
--- a/pkg/cache/clusterqueue.go
+++ b/pkg/cache/clusterqueue.go
@@ -18,7 +18,10 @@ package cache
import (
"errors"
+ "fmt"
+ "maps"
"math"
+ "slices"
"strings"
corev1 "k8s.io/api/core/v1"
@@ -35,6 +38,8 @@ import (
"sigs.k8s.io/kueue/pkg/metrics"
"sigs.k8s.io/kueue/pkg/resources"
utilac "sigs.k8s.io/kueue/pkg/util/admissioncheck"
+ "sigs.k8s.io/kueue/pkg/util/api"
+ utilmaps "sigs.k8s.io/kueue/pkg/util/maps"
"sigs.k8s.io/kueue/pkg/workload"
)
@@ -65,15 +70,16 @@ type clusterQueue struct {
AdmittedUsage resources.FlavorResourceQuantities
// localQueues by (namespace/name).
- localQueues map[string]*queue
- podsReadyTracking bool
- hasMissingFlavors bool
- hasMissingOrInactiveAdmissionChecks bool
- hasMultipleSingleInstanceControllersChecks bool
- hasFlavorIndependentAdmissionCheckAppliedPerFlavor bool
- admittedWorkloadsCount int
- isStopped bool
- workloadInfoOptions []workload.InfoOption
+ localQueues map[string]*queue
+ podsReadyTracking bool
+ missingFlavors []kueue.ResourceFlavorReference
+ missingAdmissionChecks []string
+ inactiveAdmissionChecks []string
+ multipleSingleInstanceControllersChecks map[string][]string // key = controllerName
+ flavorIndependentAdmissionCheckAppliedPerFlavor []string
+ admittedWorkloadsCount int
+ isStopped bool
+ workloadInfoOptions []workload.InfoOption
resourceNode ResourceNode
hierarchy.ClusterQueue[*cohort]
@@ -132,15 +138,17 @@ var defaultPreemption = kueue.ClusterQueuePreemption{
var defaultFlavorFungibility = kueue.FlavorFungibility{WhenCanBorrow: kueue.Borrow, WhenCanPreempt: kueue.TryNextFlavor}
-func (c *clusterQueue) updateClusterQueue(in *kueue.ClusterQueue, resourceFlavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor, admissionChecks map[string]AdmissionCheck, oldParent *cohort) error {
+func (c *clusterQueue) updateClusterQueue(cycleChecker hierarchy.CycleChecker, in *kueue.ClusterQueue, resourceFlavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor, admissionChecks map[string]AdmissionCheck, oldParent *cohort) error {
if c.updateQuotasAndResourceGroups(in.Spec.ResourceGroups) || oldParent != c.Parent() {
- c.AllocatableResourceGeneration += 1
if oldParent != nil && oldParent != c.Parent() {
- updateCohortResourceNode(oldParent)
+ // ignore error when old Cohort has cycle.
+ _ = updateCohortTreeResources(oldParent, cycleChecker)
}
if c.HasParent() {
// clusterQueue will be updated as part of tree update.
- updateCohortResourceNode(c.Parent())
+ if err := updateCohortTreeResources(c.Parent(), cycleChecker); err != nil {
+ return err
+ }
} else {
// since ClusterQueue has no parent, it won't be updated
// as part of tree update.
@@ -217,7 +225,12 @@ func (c *clusterQueue) updateQuotasAndResourceGroups(in []kueue.ResourceGroup) b
func (c *clusterQueue) updateQueueStatus() {
status := active
- if c.hasMissingFlavors || c.hasMissingOrInactiveAdmissionChecks || c.isStopped || c.hasMultipleSingleInstanceControllersChecks || c.hasFlavorIndependentAdmissionCheckAppliedPerFlavor {
+ if c.isStopped ||
+ len(c.missingFlavors) > 0 ||
+ len(c.missingAdmissionChecks) > 0 ||
+ len(c.inactiveAdmissionChecks) > 0 ||
+ len(c.multipleSingleInstanceControllersChecks) > 0 ||
+ len(c.flavorIndependentAdmissionCheckAppliedPerFlavor) > 0 {
status = pending
}
if c.Status == terminating {
@@ -232,45 +245,56 @@ func (c *clusterQueue) updateQueueStatus() {
func (c *clusterQueue) inactiveReason() (string, string) {
switch c.Status {
case terminating:
- return "Terminating", "Can't admit new workloads; clusterQueue is terminating"
+ return kueue.ClusterQueueActiveReasonTerminating, "Can't admit new workloads; clusterQueue is terminating"
case pending:
reasons := make([]string, 0, 3)
+ messages := make([]string, 0, 3)
if c.isStopped {
- reasons = append(reasons, "Stopped")
+ reasons = append(reasons, kueue.ClusterQueueActiveReasonStopped)
+ messages = append(messages, "is stopped")
}
- if c.hasMissingFlavors {
- reasons = append(reasons, "FlavorNotFound")
+ if len(c.missingFlavors) > 0 {
+ reasons = append(reasons, kueue.ClusterQueueActiveReasonFlavorNotFound)
+ messages = append(messages, fmt.Sprintf("references missing ResourceFlavor(s): %v", c.missingFlavors))
}
- if c.hasMissingOrInactiveAdmissionChecks {
- reasons = append(reasons, "CheckNotFoundOrInactive")
+ if len(c.missingAdmissionChecks) > 0 {
+ reasons = append(reasons, kueue.ClusterQueueActiveReasonAdmissionCheckNotFound)
+ messages = append(messages, fmt.Sprintf("references missing AdmissionCheck(s): %v", c.missingAdmissionChecks))
}
-
- if c.hasMultipleSingleInstanceControllersChecks {
- reasons = append(reasons, "MultipleSingleInstanceControllerChecks")
+ if len(c.inactiveAdmissionChecks) > 0 {
+ reasons = append(reasons, kueue.ClusterQueueActiveReasonAdmissionCheckInactive)
+ messages = append(messages, fmt.Sprintf("references inactive AdmissionCheck(s): %v", c.inactiveAdmissionChecks))
+ }
+ if len(c.multipleSingleInstanceControllersChecks) > 0 {
+ reasons = append(reasons, kueue.ClusterQueueActiveReasonMultipleSingleInstanceControllerAdmissionChecks)
+ for _, controller := range utilmaps.SortedKeys(c.multipleSingleInstanceControllersChecks) {
+ messages = append(messages, fmt.Sprintf("only one AdmissionCheck of %v can be referenced for controller %q", c.multipleSingleInstanceControllersChecks[controller], controller))
+ }
}
- if c.hasFlavorIndependentAdmissionCheckAppliedPerFlavor {
- reasons = append(reasons, "FlavorIndependentAdmissionCheckAppliedPerFlavor")
+ if len(c.flavorIndependentAdmissionCheckAppliedPerFlavor) > 0 {
+ reasons = append(reasons, kueue.ClusterQueueActiveReasonFlavorIndependentAdmissionCheckAppliedPerFlavor)
+ messages = append(messages, fmt.Sprintf("AdmissionCheck(s): %v cannot be set at flavor level", c.flavorIndependentAdmissionCheckAppliedPerFlavor))
}
if len(reasons) == 0 {
- return "Unknown", "Can't admit new workloads."
+ return kueue.ClusterQueueActiveReasonUnknown, "Can't admit new workloads."
}
- return reasons[0], strings.Join([]string{"Can't admit new workloads:", strings.Join(reasons, ", ")}, " ")
+ return reasons[0], api.TruncateConditionMessage(strings.Join([]string{"Can't admit new workloads: ", strings.Join(messages, ", "), "."}, ""))
}
- return "Ready", "Can admit new flavors"
+ return kueue.ClusterQueueActiveReasonReady, "Can admit new workloads"
}
// UpdateWithFlavors updates a ClusterQueue based on the passed ResourceFlavors set.
// Exported only for testing.
func (c *clusterQueue) UpdateWithFlavors(flavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor) {
- c.hasMissingFlavors = c.updateLabelKeys(flavors)
+ c.updateLabelKeys(flavors)
c.updateQueueStatus()
}
-func (c *clusterQueue) updateLabelKeys(flavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor) bool {
- var flavorNotFound bool
+func (c *clusterQueue) updateLabelKeys(flavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor) {
+ c.missingFlavors = nil
for i := range c.ResourceGroups {
rg := &c.ResourceGroups[i]
if len(rg.Flavors) == 0 {
@@ -284,7 +308,7 @@ func (c *clusterQueue) updateLabelKeys(flavors map[kueue.ResourceFlavorReference
keys.Insert(k)
}
} else {
- flavorNotFound = true
+ c.missingFlavors = append(c.missingFlavors, fName)
}
}
@@ -292,53 +316,65 @@ func (c *clusterQueue) updateLabelKeys(flavors map[kueue.ResourceFlavorReference
rg.LabelKeys = keys
}
}
-
- return flavorNotFound
}
// updateWithAdmissionChecks updates a ClusterQueue based on the passed AdmissionChecks set.
func (c *clusterQueue) updateWithAdmissionChecks(checks map[string]AdmissionCheck) {
- hasMissing := false
- hasSpecificChecks := false
- checksPerController := make(map[string]int, len(c.AdmissionChecks))
+ checksPerController := make(map[string][]string, len(c.AdmissionChecks))
singleInstanceControllers := sets.New[string]()
+ var missing []string
+ var inactive []string
+ var flavorIndependentCheckOnFlavors []string
for acName, flavors := range c.AdmissionChecks {
if ac, found := checks[acName]; !found {
- hasMissing = true
+ missing = append(missing, acName)
} else {
if !ac.Active {
- hasMissing = true
+ inactive = append(inactive, acName)
}
- checksPerController[ac.Controller]++
+ checksPerController[ac.Controller] = append(checksPerController[ac.Controller], acName)
if ac.SingleInstanceInClusterQueue {
singleInstanceControllers.Insert(ac.Controller)
}
if ac.FlavorIndependent && flavors.Len() != 0 {
- hasSpecificChecks = true
+ flavorIndependentCheckOnFlavors = append(flavorIndependentCheckOnFlavors, acName)
}
}
}
+ // sort the lists since c.AdmissionChecks is a map
+ slices.Sort(missing)
+ slices.Sort(inactive)
+ slices.Sort(flavorIndependentCheckOnFlavors)
+
update := false
- if hasMissing != c.hasMissingOrInactiveAdmissionChecks {
- c.hasMissingOrInactiveAdmissionChecks = hasMissing
+ if !slices.Equal(c.missingAdmissionChecks, missing) {
+ c.missingAdmissionChecks = missing
update = true
}
- hasMultipleSICC := false
- for controller, checks := range checksPerController {
- if singleInstanceControllers.Has(controller) && checks > 1 {
- hasMultipleSICC = true
- }
+ if !slices.Equal(c.inactiveAdmissionChecks, inactive) {
+ c.inactiveAdmissionChecks = inactive
+ update = true
+ }
+
+ // remove the controllers which don't have more then one AC or are not single instance.
+ maps.DeleteFunc(checksPerController, func(controller string, acs []string) bool {
+ return len(acs) < 2 || !singleInstanceControllers.Has(controller)
+ })
+
+ // sort the remaining set
+ for c := range checksPerController {
+ slices.Sort(checksPerController[c])
}
- if c.hasMultipleSingleInstanceControllersChecks != hasMultipleSICC {
- c.hasMultipleSingleInstanceControllersChecks = hasMultipleSICC
+ if !maps.EqualFunc(checksPerController, c.multipleSingleInstanceControllersChecks, slices.Equal) {
+ c.multipleSingleInstanceControllersChecks = checksPerController
update = true
}
- if c.hasFlavorIndependentAdmissionCheckAppliedPerFlavor != hasSpecificChecks {
- c.hasFlavorIndependentAdmissionCheckAppliedPerFlavor = hasSpecificChecks
+ if !slices.Equal(c.flavorIndependentAdmissionCheckAppliedPerFlavor, flavorIndependentCheckOnFlavors) {
+ c.flavorIndependentAdmissionCheckAppliedPerFlavor = flavorIndependentCheckOnFlavors
update = true
}
diff --git a/pkg/cache/clusterqueue_snapshot.go b/pkg/cache/clusterqueue_snapshot.go
index b081cee98b1..2e4e75a1c01 100644
--- a/pkg/cache/clusterqueue_snapshot.go
+++ b/pkg/cache/clusterqueue_snapshot.go
@@ -23,6 +23,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/hierarchy"
"sigs.k8s.io/kueue/pkg/metrics"
"sigs.k8s.io/kueue/pkg/resources"
"sigs.k8s.io/kueue/pkg/workload"
@@ -30,7 +31,6 @@ import (
type ClusterQueueSnapshot struct {
Name string
- Cohort *CohortSnapshot
ResourceGroups []ResourceGroup
Workloads map[string]*workload.Info
WorkloadsNotReady sets.Set[string]
@@ -48,6 +48,7 @@ type ClusterQueueSnapshot struct {
AllocatableResourceGeneration int64
ResourceNode ResourceNode
+ hierarchy.ClusterQueue[*CohortSnapshot]
}
// RGByResource returns the ResourceGroup which contains capacity
@@ -96,9 +97,10 @@ func (c *ClusterQueueSnapshot) BorrowingWith(fr resources.FlavorResource, val in
// Available returns the current capacity available, before preempting
// any workloads. Includes local capacity and capacity borrowed from
-// Cohort.
+// Cohort. When the ClusterQueue/Cohort is in debt, Available
+// will return 0.
func (c *ClusterQueueSnapshot) Available(fr resources.FlavorResource) int64 {
- return available(c, fr, true)
+ return max(0, available(c, fr, true))
}
// PotentialAvailable returns the largest workload this ClusterQueue could
@@ -108,17 +110,9 @@ func (c *ClusterQueueSnapshot) PotentialAvailable(fr resources.FlavorResource) i
return potentialAvailable(c, fr)
}
-func (c *ClusterQueueSnapshot) Parent() *CohortSnapshot {
- return c.Cohort
-}
-
// The methods below implement several interfaces. See
// dominantResourceShareNode, resourceGroupNode, and netQuotaNode.
-func (c *ClusterQueueSnapshot) HasParent() bool {
- return c.Cohort != nil
-}
-
func (c *ClusterQueueSnapshot) fairWeight() *resource.Quantity {
return &c.FairWeight
}
@@ -135,6 +129,10 @@ func (c *ClusterQueueSnapshot) parentResources() ResourceNode {
return c.Parent().ResourceNode
}
+func (c *ClusterQueueSnapshot) GetName() string {
+ return c.Name
+}
+
// The methods below implement hierarchicalResourceNode interface.
func (c *ClusterQueueSnapshot) getResourceNode() ResourceNode {
diff --git a/pkg/cache/clusterqueue_test.go b/pkg/cache/clusterqueue_test.go
index a3aebb54316..0a3a641376b 100644
--- a/pkg/cache/clusterqueue_test.go
+++ b/pkg/cache/clusterqueue_test.go
@@ -370,7 +370,7 @@ func TestFitInCohort(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
if tc.disableLendingLimit {
- defer features.SetFeatureGateDuringTest(t, features.LendingLimit, false)()
+ features.SetFeatureGateDuringTest(t, features.LendingLimit, false)
}
cache := New(utiltesting.NewFakeClient())
@@ -502,6 +502,7 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
admissionChecks map[string]AdmissionCheck
wantStatus metrics.ClusterQueueStatus
wantReason string
+ wantMessage string
}{
{
name: "Pending clusterQueue updated valid AC list",
@@ -521,8 +522,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller3",
},
},
- wantStatus: active,
- wantReason: "Ready",
+ wantStatus: active,
+ wantReason: "Ready",
+ wantMessage: "Can admit new workloads",
},
{
name: "Pending clusterQueue with an AC strategy updated valid AC list",
@@ -542,8 +544,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller3",
},
},
- wantStatus: active,
- wantReason: "Ready",
+ wantStatus: active,
+ wantReason: "Ready",
+ wantMessage: "Can admit new workloads",
},
{
name: "Active clusterQueue updated with not found AC",
@@ -559,8 +562,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller2",
},
},
- wantStatus: pending,
- wantReason: "CheckNotFoundOrInactive",
+ wantStatus: pending,
+ wantReason: "AdmissionCheckNotFound",
+ wantMessage: "Can't admit new workloads: references missing AdmissionCheck(s): [check3].",
},
{
name: "Active clusterQueue with an AC strategy updated with not found AC",
@@ -576,8 +580,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller2",
},
},
- wantStatus: pending,
- wantReason: "CheckNotFoundOrInactive",
+ wantStatus: pending,
+ wantReason: "AdmissionCheckNotFound",
+ wantMessage: "Can't admit new workloads: references missing AdmissionCheck(s): [check3].",
},
{
name: "Active clusterQueue updated with inactive AC",
@@ -597,8 +602,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller3",
},
},
- wantStatus: pending,
- wantReason: "CheckNotFoundOrInactive",
+ wantStatus: pending,
+ wantReason: "AdmissionCheckInactive",
+ wantMessage: "Can't admit new workloads: references inactive AdmissionCheck(s): [check3].",
},
{
name: "Active clusterQueue with an AC strategy updated with inactive AC",
@@ -618,8 +624,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller3",
},
},
- wantStatus: pending,
- wantReason: "CheckNotFoundOrInactive",
+ wantStatus: pending,
+ wantReason: "AdmissionCheckInactive",
+ wantMessage: "Can't admit new workloads: references inactive AdmissionCheck(s): [check3].",
},
{
name: "Active clusterQueue updated with duplicate single instance AC Controller",
@@ -641,8 +648,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
SingleInstanceInClusterQueue: true,
},
},
- wantStatus: pending,
- wantReason: "MultipleSingleInstanceControllerChecks",
+ wantStatus: pending,
+ wantReason: "MultipleSingleInstanceControllerAdmissionChecks",
+ wantMessage: `Can't admit new workloads: only one AdmissionCheck of [check2 check3] can be referenced for controller "controller2".`,
},
{
name: "Active clusterQueue with an AC strategy updated with duplicate single instance AC Controller",
@@ -664,8 +672,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
SingleInstanceInClusterQueue: true,
},
},
- wantStatus: pending,
- wantReason: "MultipleSingleInstanceControllerChecks",
+ wantStatus: pending,
+ wantReason: "MultipleSingleInstanceControllerAdmissionChecks",
+ wantMessage: `Can't admit new workloads: only one AdmissionCheck of [check2 check3] can be referenced for controller "controller2".`,
},
{
name: "Active clusterQueue with a FlavorIndependent AC applied per ResourceFlavor",
@@ -678,8 +687,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
FlavorIndependent: true,
},
},
- wantStatus: pending,
- wantReason: "FlavorIndependentAdmissionCheckAppliedPerFlavor",
+ wantStatus: pending,
+ wantReason: "FlavorIndependentAdmissionCheckAppliedPerFlavor",
+ wantMessage: "Can't admit new workloads: AdmissionCheck(s): [check1] cannot be set at flavor level.",
},
{
name: "Terminating clusterQueue updated with valid AC list",
@@ -699,8 +709,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller3",
},
},
- wantStatus: terminating,
- wantReason: "Terminating",
+ wantStatus: terminating,
+ wantReason: "Terminating",
+ wantMessage: "Can't admit new workloads; clusterQueue is terminating",
},
{
name: "Terminating clusterQueue with an AC strategy updated with valid AC list",
@@ -720,8 +731,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller3",
},
},
- wantStatus: terminating,
- wantReason: "Terminating",
+ wantStatus: terminating,
+ wantReason: "Terminating",
+ wantMessage: "Can't admit new workloads; clusterQueue is terminating",
},
{
name: "Terminating clusterQueue updated with not found AC",
@@ -737,8 +749,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller2",
},
},
- wantStatus: terminating,
- wantReason: "Terminating",
+ wantStatus: terminating,
+ wantReason: "Terminating",
+ wantMessage: "Can't admit new workloads; clusterQueue is terminating",
},
{
name: "Terminating clusterQueue with an AC strategy updated with not found AC",
@@ -754,8 +767,9 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
Controller: "controller2",
},
},
- wantStatus: terminating,
- wantReason: "Terminating",
+ wantStatus: terminating,
+ wantReason: "Terminating",
+ wantMessage: "Can't admit new workloads; clusterQueue is terminating",
},
}
@@ -771,13 +785,15 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
// Align the admission check related internals to the desired Status.
if tc.cqStatus == active {
- cq.hasMultipleSingleInstanceControllersChecks = false
- cq.hasMissingOrInactiveAdmissionChecks = false
- cq.hasFlavorIndependentAdmissionCheckAppliedPerFlavor = false
+ cq.multipleSingleInstanceControllersChecks = nil
+ cq.missingAdmissionChecks = nil
+ cq.inactiveAdmissionChecks = nil
+ cq.flavorIndependentAdmissionCheckAppliedPerFlavor = nil
} else {
- cq.hasMultipleSingleInstanceControllersChecks = true
- cq.hasMissingOrInactiveAdmissionChecks = true
- cq.hasFlavorIndependentAdmissionCheckAppliedPerFlavor = true
+ cq.multipleSingleInstanceControllersChecks = map[string][]string{"c1": {"ac1", "ac2"}}
+ cq.missingAdmissionChecks = []string{"missing-ac"}
+ cq.inactiveAdmissionChecks = []string{"inactive-ac"}
+ cq.flavorIndependentAdmissionCheckAppliedPerFlavor = []string{"not-on-flavor"}
}
cq.updateWithAdmissionChecks(tc.admissionChecks)
@@ -785,10 +801,13 @@ func TestClusterQueueUpdateWithAdmissionCheck(t *testing.T) {
t.Errorf("got different status, want: %v, got: %v", tc.wantStatus, cq.Status)
}
- gotReason, _ := cq.inactiveReason()
+ gotReason, gotMessage := cq.inactiveReason()
if diff := cmp.Diff(tc.wantReason, gotReason); diff != "" {
t.Errorf("Unexpected inactiveReason (-want,+got):\n%s", diff)
}
+ if diff := cmp.Diff(tc.wantMessage, gotMessage); diff != "" {
+ t.Errorf("Unexpected inactiveMessage (-want,+got):\n%s", diff)
+ }
})
}
}
diff --git a/pkg/cache/cohort.go b/pkg/cache/cohort.go
index d88929dae29..81c02bbad85 100644
--- a/pkg/cache/cohort.go
+++ b/pkg/cache/cohort.go
@@ -37,15 +37,26 @@ func newCohort(name string) *cohort {
}
}
-func (c *cohort) updateCohort(apiCohort *kueuealpha.Cohort) {
+func (c *cohort) updateCohort(cycleChecker hierarchy.CycleChecker, apiCohort *kueuealpha.Cohort, oldParent *cohort) error {
c.resourceNode.Quotas = createResourceQuotas(apiCohort.Spec.ResourceGroups)
- updateCohortResourceNode(c)
+ if oldParent != nil && oldParent != c.Parent() {
+ // ignore error when old Cohort has cycle.
+ _ = updateCohortTreeResources(oldParent, cycleChecker)
+ }
+ return updateCohortTreeResources(c, cycleChecker)
}
func (c *cohort) GetName() string {
return c.Name
}
+func (c *cohort) getRootUnsafe() *cohort {
+ if !c.HasParent() {
+ return c
+ }
+ return c.Parent().getRootUnsafe()
+}
+
// implements hierarchicalResourceNode interface.
func (c *cohort) getResourceNode() ResourceNode {
@@ -55,3 +66,9 @@ func (c *cohort) getResourceNode() ResourceNode {
func (c *cohort) parentHRN() hierarchicalResourceNode {
return c.Parent()
}
+
+// implement hierarchy.CycleCheckable interface
+
+func (c *cohort) CCParent() hierarchy.CycleCheckable {
+ return c.Parent()
+}
diff --git a/pkg/cache/cohort_snapshot.go b/pkg/cache/cohort_snapshot.go
index 31d09efedb7..43cdfadbd23 100644
--- a/pkg/cache/cohort_snapshot.go
+++ b/pkg/cache/cohort_snapshot.go
@@ -16,31 +16,25 @@ limitations under the License.
package cache
-import (
- "k8s.io/apimachinery/pkg/util/sets"
-)
+import "sigs.k8s.io/kueue/pkg/hierarchy"
type CohortSnapshot struct {
- Name string
- Members sets.Set[*ClusterQueueSnapshot]
+ Name string
ResourceNode ResourceNode
+ hierarchy.Cohort[*ClusterQueueSnapshot, *CohortSnapshot]
+}
- // AllocatableResourceGeneration equals to
- // the sum of allocatable generation among its members.
- AllocatableResourceGeneration int64
+func (c *CohortSnapshot) GetName() string {
+ return c.Name
}
// The methods below implement hierarchicalResourceNode interface.
-func (c *CohortSnapshot) HasParent() bool {
- return false
-}
-
func (c *CohortSnapshot) getResourceNode() ResourceNode {
return c.ResourceNode
}
func (c *CohortSnapshot) parentHRN() hierarchicalResourceNode {
- return nil
+ return c.Parent()
}
diff --git a/pkg/cache/resource_node.go b/pkg/cache/resource_node.go
index a9f893b19f0..4f83819ef14 100644
--- a/pkg/cache/resource_node.go
+++ b/pkg/cache/resource_node.go
@@ -17,10 +17,12 @@ limitations under the License.
package cache
import (
+ "errors"
"maps"
corev1 "k8s.io/api/core/v1"
+ "sigs.k8s.io/kueue/pkg/hierarchy"
"sigs.k8s.io/kueue/pkg/resources"
)
@@ -154,12 +156,28 @@ func (r ResourceNode) calculateLendable() map[corev1.ResourceName]int64 {
}
func updateClusterQueueResourceNode(cq *clusterQueue) {
+ cq.AllocatableResourceGeneration += 1
cq.resourceNode.SubtreeQuota = make(resources.FlavorResourceQuantities, len(cq.resourceNode.Quotas))
for fr, quota := range cq.resourceNode.Quotas {
cq.resourceNode.SubtreeQuota[fr] = quota.Nominal
}
}
+// updateCohortTreeResources traverses the Cohort tree from the root
+// to accumulate SubtreeQuota and Usage. It returns an error if the
+// provided Cohort has a cycle.
+func updateCohortTreeResources(cohort *cohort, cycleChecker hierarchy.CycleChecker) error {
+ if cycleChecker.HasCycle(cohort) {
+ return errors.New("cohort has a cycle")
+ }
+ updateCohortResourceNode(cohort.getRootUnsafe())
+ return nil
+}
+
+// updateCohortResourceNode traverses the Cohort tree to accumulate
+// SubtreeQuota and Usage. It should usually be called via
+// updateCohortTree, which starts at the root and includes
+// a cycle check.
func updateCohortResourceNode(cohort *cohort) {
cohort.resourceNode.SubtreeQuota = make(resources.FlavorResourceQuantities, len(cohort.resourceNode.SubtreeQuota))
cohort.resourceNode.Usage = make(resources.FlavorResourceQuantities, len(cohort.resourceNode.Usage))
@@ -167,13 +185,21 @@ func updateCohortResourceNode(cohort *cohort) {
for fr, quota := range cohort.resourceNode.Quotas {
cohort.resourceNode.SubtreeQuota[fr] = quota.Nominal
}
+ for _, child := range cohort.ChildCohorts() {
+ updateCohortResourceNode(child)
+ accumulateFromChild(cohort, child)
+ }
for _, child := range cohort.ChildCQs() {
updateClusterQueueResourceNode(child)
- for fr, childQuota := range child.resourceNode.SubtreeQuota {
- cohort.resourceNode.SubtreeQuota[fr] += childQuota - child.resourceNode.guaranteedQuota(fr)
- }
- for fr, childUsage := range child.resourceNode.Usage {
- cohort.resourceNode.Usage[fr] += max(0, childUsage-child.resourceNode.guaranteedQuota(fr))
- }
+ accumulateFromChild(cohort, child)
+ }
+}
+
+func accumulateFromChild(parent *cohort, child hierarchicalResourceNode) {
+ for fr, childQuota := range child.getResourceNode().SubtreeQuota {
+ parent.resourceNode.SubtreeQuota[fr] += childQuota - child.getResourceNode().guaranteedQuota(fr)
+ }
+ for fr, childUsage := range child.getResourceNode().Usage {
+ parent.resourceNode.Usage[fr] += max(0, childUsage-child.getResourceNode().guaranteedQuota(fr))
}
}
diff --git a/pkg/cache/resource_test.go b/pkg/cache/resource_test.go
new file mode 100644
index 00000000000..44fb0d553b5
--- /dev/null
+++ b/pkg/cache/resource_test.go
@@ -0,0 +1,449 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package cache
+
+import (
+ "context"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/resources"
+ utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
+)
+
+func TestAvailable(t *testing.T) {
+ cases := map[string]struct {
+ cohorts []kueuealpha.Cohort
+ clusterQueues []kueue.ClusterQueue
+ usage map[string]resources.FlavorResourceQuantities
+ wantAvailable map[string]resources.FlavorResourceQuantities
+ wantPotentiallyAvailable map[string]resources.FlavorResourceQuantities
+ }{
+ "base cqs": {
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("cq1").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "0").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("cq2").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "5").Obj(),
+ *utiltesting.MakeFlavorQuotas("blue").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ },
+ usage: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 1000},
+ "cq2": {
+ {Flavor: "red", Resource: "cpu"}: 2_500,
+ {Flavor: "blue", Resource: "cpu"}: 1_000,
+ },
+ },
+ wantAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 0},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 2_500, {Flavor: "blue", Resource: "cpu"}: 9_000},
+ },
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 0},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 5_000, {Flavor: "blue", Resource: "cpu"}: 10_000},
+ },
+ },
+ "cqs with cohort": {
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("cq1").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("cq2").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "", "9").Obj(),
+ ).ClusterQueue,
+ },
+ cohorts: []kueuealpha.Cohort{
+ utiltesting.MakeCohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).Cohort,
+ },
+ usage: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 1000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 500},
+ },
+ wantAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 28_000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 28_500},
+ },
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 29_000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 30_000},
+ },
+ },
+ "cq borrows from cohort": {
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("cq1").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ },
+ cohorts: []kueuealpha.Cohort{
+ utiltesting.MakeCohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).Cohort,
+ },
+ usage: map[string]resources.FlavorResourceQuantities{"cq1": {{Flavor: "red", Resource: "cpu"}: 11_000}},
+ wantAvailable: map[string]resources.FlavorResourceQuantities{"cq1": {{Flavor: "red", Resource: "cpu"}: 9_000}},
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{"cq1": {{Flavor: "red", Resource: "cpu"}: 20_000}},
+ },
+ "cq oversubscription spills into cohort": {
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("cq1").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("cq2").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "0", "0").Obj(),
+ ).ClusterQueue,
+ },
+ cohorts: []kueuealpha.Cohort{
+ utiltesting.MakeCohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).Cohort,
+ },
+ usage: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 31_000},
+ },
+ wantAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 0},
+ // even though cq2 doesn't borrow/lend
+ // resources from Cohort, the
+ // misbehaving cq1's usage spills into
+ // its available, to prevent
+ // overadmission for (red,cpu) within
+ // the CohortTree.
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 0},
+ },
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 20_000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 10_000},
+ },
+ },
+ "lending and borrowing limits respected": {
+ // cohort has 40 (red, cpu) total
+ // cq1 can access 35 = 40 - 5 reserved
+ // cq2 can access 12, due to borrowing limit
+ // cq3 can access 40, as there are no restrictions.
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("cq1").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("cq2").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "2").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("cq3").
+ Cohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "", "5").Obj(),
+ ).ClusterQueue,
+ },
+ cohorts: []kueuealpha.Cohort{
+ utiltesting.MakeCohort("cohort").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).Cohort,
+ },
+ usage: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 20_000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 10_000},
+ "cq3": {{Flavor: "red", Resource: "cpu"}: 6_000},
+ },
+ wantAvailable: map[string]resources.FlavorResourceQuantities{
+ // cq1 uses 20k, cq2 uses 10k, and
+ // cq3 uses 1k (not counting first 5k
+ // in guaranteedQuota), resulting in
+ // 4k left of potential 35k.
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 4_000},
+ // cq2 has access to only 2k of the
+ // remaining 4k due to its borrowing
+ // limit.
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 2_000},
+ // 40k - (20k + 10k + 6k) = 4k
+ "cq3": {{Flavor: "red", Resource: "cpu"}: 4_000},
+ },
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 35_000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 12_000},
+ "cq3": {{Flavor: "red", Resource: "cpu"}: 40_000},
+ },
+ },
+ "hierarchical cohort": {
+ // root
+ // / \
+ // left right
+ // / \
+ // cq1 cq2
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("cq1").
+ Cohort("left").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("cq2").
+ Cohort("right").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "", "0").Obj(),
+ ).ClusterQueue,
+ },
+ cohorts: []kueuealpha.Cohort{
+ utiltesting.MakeCohort("root").Cohort,
+ utiltesting.MakeCohort("left").
+ Parent("root").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).Cohort,
+ utiltesting.MakeCohort("right").
+ Parent("root").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).Cohort,
+ },
+ usage: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 10_000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 5_000},
+ },
+ wantAvailable: map[string]resources.FlavorResourceQuantities{
+ // 30k available - 10k usage.
+ // no capacity/usage from right subtree
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 20_000},
+ // 40k available - 15k usage.
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 25_000},
+ },
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{
+ "cq1": {{Flavor: "red", Resource: "cpu"}: 30_000},
+ "cq2": {{Flavor: "red", Resource: "cpu"}: 40_000},
+ },
+ },
+ "hierarchical cohort respects borrowing limit": {
+ // root
+ // 5 \
+ // left right -- right-cq
+ // / 5
+ // left-cq1 left-cq2
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("left-cq1").
+ Cohort("left").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("left-cq2").
+ Cohort("left").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "5").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("right-cq").
+ Cohort("right").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ },
+ cohorts: []kueuealpha.Cohort{
+ utiltesting.MakeCohort("root").Cohort,
+ utiltesting.MakeCohort("left").
+ Parent("root").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "5").Obj(),
+ ).Cohort,
+ utiltesting.MakeCohort("right").
+ Parent("root").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).Cohort,
+ },
+ wantAvailable: map[string]resources.FlavorResourceQuantities{
+ // 30k in "left" subtree + 5k limit above tree
+ "left-cq1": {{Flavor: "red", Resource: "cpu"}: 35_000},
+ // 10k + 5k lending limit
+ "left-cq2": {{Flavor: "red", Resource: "cpu"}: 15_000},
+ // all 50k in "root" subtree
+ "right-cq": {{Flavor: "red", Resource: "cpu"}: 50_000},
+ },
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{
+ "left-cq1": {{Flavor: "red", Resource: "cpu"}: 35_000},
+ "left-cq2": {{Flavor: "red", Resource: "cpu"}: 15_000},
+ "right-cq": {{Flavor: "red", Resource: "cpu"}: 50_000},
+ },
+ },
+ "hierarchical cohort respects lending limit": {
+ // root -- root-cq
+ // 5 \
+ // left right -- right-cq
+ // 5 \
+ // left-cq1 left-cq2
+ clusterQueues: []kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("left-cq1").
+ Cohort("left").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10", "", "5").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("left-cq2").
+ Cohort("left").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("right-cq").
+ Cohort("right").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "0").Obj(),
+ ).ClusterQueue,
+ utiltesting.MakeClusterQueue("root-cq").
+ Cohort("root").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "0").Obj(),
+ ).ClusterQueue,
+ },
+ cohorts: []kueuealpha.Cohort{
+ utiltesting.MakeCohort("root").Cohort,
+ utiltesting.MakeCohort("left").
+ Parent("root").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "0", "", "5").Obj(),
+ ).Cohort,
+ utiltesting.MakeCohort("right").
+ Parent("root").
+ ResourceGroup(
+ *utiltesting.MakeFlavorQuotas("red").Resource("cpu", "0").Obj(),
+ ).Cohort,
+ },
+ wantAvailable: map[string]resources.FlavorResourceQuantities{
+ "left-cq1": {{Flavor: "red", Resource: "cpu"}: 20_000},
+ // only 5k of left-cq1's resources are available,
+ // plus 10k of its own.
+ "left-cq2": {{Flavor: "red", Resource: "cpu"}: 15_000},
+ // 5k lending limit from left to root.
+ "right-cq": {{Flavor: "red", Resource: "cpu"}: 5_000},
+ "root-cq": {{Flavor: "red", Resource: "cpu"}: 5_000},
+ },
+ wantPotentiallyAvailable: map[string]resources.FlavorResourceQuantities{
+ "left-cq1": {{Flavor: "red", Resource: "cpu"}: 20_000},
+ "left-cq2": {{Flavor: "red", Resource: "cpu"}: 15_000},
+ "right-cq": {{Flavor: "red", Resource: "cpu"}: 5_000},
+ "root-cq": {{Flavor: "red", Resource: "cpu"}: 5_000},
+ },
+ },
+ }
+
+ for name, tc := range cases {
+ t.Run(name, func(t *testing.T) {
+ ctx := context.Background()
+ cache := New(utiltesting.NewFakeClient())
+ cache.AddOrUpdateResourceFlavor(utiltesting.MakeResourceFlavor("red").Obj())
+ cache.AddOrUpdateResourceFlavor(utiltesting.MakeResourceFlavor("blue").Obj())
+ for _, cq := range tc.clusterQueues {
+ _ = cache.AddClusterQueue(ctx, &cq)
+ }
+ for _, cohort := range tc.cohorts {
+ _ = cache.AddOrUpdateCohort(&cohort)
+ }
+
+ snapshot := cache.Snapshot()
+
+ // before adding usage
+ {
+ gotAvailable := make(map[string]resources.FlavorResourceQuantities, len(snapshot.ClusterQueues))
+ gotPotentiallyAvailable := make(map[string]resources.FlavorResourceQuantities, len(snapshot.ClusterQueues))
+ for _, cq := range snapshot.ClusterQueues {
+ numFrs := flavorResourceCount(cq.ResourceGroups)
+ gotAvailable[cq.Name] = make(resources.FlavorResourceQuantities, numFrs)
+ gotPotentiallyAvailable[cq.Name] = make(resources.FlavorResourceQuantities, numFrs)
+ for _, fr := range flavorResources(cq) {
+ gotAvailable[cq.Name][fr] = cq.Available(fr)
+ gotPotentiallyAvailable[cq.Name][fr] = potentialAvailable(cq, fr)
+ }
+ }
+ // before adding usage, available == potentiallyAvailable
+ if diff := cmp.Diff(tc.wantPotentiallyAvailable, gotAvailable); diff != "" {
+ t.Errorf("unexpected available (-want/+got):\n%s", diff)
+ }
+ if diff := cmp.Diff(tc.wantPotentiallyAvailable, gotPotentiallyAvailable); diff != "" {
+ t.Errorf("unexpected potentially available (-want/+got):\n%s", diff)
+ }
+ }
+
+ // add usage
+ {
+ for cqName, usage := range tc.usage {
+ snapshot.ClusterQueues[cqName].AddUsage(usage)
+ }
+ gotAvailable := make(map[string]resources.FlavorResourceQuantities, len(snapshot.ClusterQueues))
+ gotPotentiallyAvailable := make(map[string]resources.FlavorResourceQuantities, len(snapshot.ClusterQueues))
+ for _, cq := range snapshot.ClusterQueues {
+ numFrs := flavorResourceCount(cq.ResourceGroups)
+ gotAvailable[cq.Name] = make(resources.FlavorResourceQuantities, numFrs)
+ gotPotentiallyAvailable[cq.Name] = make(resources.FlavorResourceQuantities, numFrs)
+ for _, fr := range flavorResources(cq) {
+ gotAvailable[cq.Name][fr] = cq.Available(fr)
+ gotPotentiallyAvailable[cq.Name][fr] = potentialAvailable(cq, fr)
+ }
+ }
+ if diff := cmp.Diff(tc.wantAvailable, gotAvailable); diff != "" {
+ t.Errorf("unexpected available (-want/+got):\n%s", diff)
+ }
+ if diff := cmp.Diff(tc.wantPotentiallyAvailable, gotPotentiallyAvailable); diff != "" {
+ t.Errorf("unexpected potentially available (-want/+got):\n%s", diff)
+ }
+ }
+
+ // remove usage
+ {
+ for cqName, usage := range tc.usage {
+ snapshot.ClusterQueues[cqName].removeUsage(usage)
+ }
+ gotAvailable := make(map[string]resources.FlavorResourceQuantities, len(snapshot.ClusterQueues))
+ gotPotentiallyAvailable := make(map[string]resources.FlavorResourceQuantities, len(snapshot.ClusterQueues))
+ for _, cq := range snapshot.ClusterQueues {
+ numFrs := flavorResourceCount(cq.ResourceGroups)
+ gotAvailable[cq.Name] = make(resources.FlavorResourceQuantities, numFrs)
+ gotPotentiallyAvailable[cq.Name] = make(resources.FlavorResourceQuantities, numFrs)
+ for _, fr := range flavorResources(cq) {
+ gotAvailable[cq.Name][fr] = cq.Available(fr)
+ gotPotentiallyAvailable[cq.Name][fr] = potentialAvailable(cq, fr)
+ }
+ }
+ // once again, available == potentiallyAvailable
+ if diff := cmp.Diff(tc.wantPotentiallyAvailable, gotAvailable); diff != "" {
+ t.Errorf("unexpected available (-want/+got):\n%s", diff)
+ }
+ if diff := cmp.Diff(tc.wantPotentiallyAvailable, gotPotentiallyAvailable); diff != "" {
+ t.Errorf("unexpected potentiallyAvailable (-want/+got):\n%s", diff)
+ }
+ }
+ })
+ }
+}
diff --git a/pkg/cache/snapshot.go b/pkg/cache/snapshot.go
index 152019297e2..2ecd181f1db 100644
--- a/pkg/cache/snapshot.go
+++ b/pkg/cache/snapshot.go
@@ -24,12 +24,13 @@ import (
"k8s.io/klog/v2"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/hierarchy"
utilmaps "sigs.k8s.io/kueue/pkg/util/maps"
"sigs.k8s.io/kueue/pkg/workload"
)
type Snapshot struct {
- ClusterQueues map[string]*ClusterQueueSnapshot
+ hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]
ResourceFlavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor
InactiveClusterQueueSets sets.Set[string]
}
@@ -51,12 +52,10 @@ func (s *Snapshot) AddWorkload(wl *workload.Info) {
}
func (s *Snapshot) Log(log logr.Logger) {
- cohorts := make(map[string]*CohortSnapshot)
for name, cq := range s.ClusterQueues {
cohortName := ""
- if cq.Cohort != nil {
- cohortName = cq.Cohort.Name
- cohorts[cohortName] = cq.Cohort
+ if cq.HasParent() {
+ cohortName = cq.Parent().Name
}
log.Info("Found ClusterQueue",
@@ -67,7 +66,7 @@ func (s *Snapshot) Log(log logr.Logger) {
"workloads", utilmaps.Keys(cq.Workloads),
)
}
- for name, cohort := range cohorts {
+ for name, cohort := range s.Cohorts {
log.Info("Found cohort",
"cohort", name,
"resources", cohort.ResourceNode.SubtreeQuota,
@@ -81,30 +80,40 @@ func (c *Cache) Snapshot() Snapshot {
defer c.RUnlock()
snap := Snapshot{
- ClusterQueues: make(map[string]*ClusterQueueSnapshot, len(c.hm.ClusterQueues)),
+ Manager: hierarchy.NewManager(newCohortSnapshot),
ResourceFlavors: make(map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor, len(c.resourceFlavors)),
InactiveClusterQueueSets: sets.New[string](),
}
+ for _, cohort := range c.hm.Cohorts {
+ if c.hm.CycleChecker.HasCycle(cohort) {
+ continue
+ }
+ snap.AddCohort(cohort.Name)
+ snap.Cohorts[cohort.Name].ResourceNode = cohort.resourceNode.Clone()
+ if cohort.HasParent() {
+ snap.UpdateCohortEdge(cohort.Name, cohort.Parent().Name)
+ }
+ }
for _, cq := range c.hm.ClusterQueues {
- if !cq.Active() {
+ if !cq.Active() || (cq.HasParent() && c.hm.CycleChecker.HasCycle(cq.Parent())) {
snap.InactiveClusterQueueSets.Insert(cq.Name)
continue
}
- snap.ClusterQueues[cq.Name] = cq.snapshot()
+ snap.AddClusterQueue(snapshotClusterQueue(cq))
+ if cq.HasParent() {
+ snap.UpdateClusterQueueEdge(cq.Name, cq.Parent().Name)
+ }
}
for name, rf := range c.resourceFlavors {
// Shallow copy is enough
snap.ResourceFlavors[name] = rf
}
- for _, cohort := range c.hm.Cohorts {
- cohort.snapshotInto(snap.ClusterQueues)
- }
return snap
}
-// snapshot creates a copy of ClusterQueue that includes references to immutable
-// objects and deep copies of changing ones. A reference to the cohort is not included.
-func (c *clusterQueue) snapshot() *ClusterQueueSnapshot {
+// snapshotClusterQueue creates a copy of ClusterQueue that includes
+// references to immutable objects and deep copies of changing ones.
+func snapshotClusterQueue(c *clusterQueue) *ClusterQueueSnapshot {
cc := &ClusterQueueSnapshot{
Name: c.Name,
ResourceGroups: make([]ResourceGroup, len(c.ResourceGroups)),
@@ -124,19 +133,9 @@ func (c *clusterQueue) snapshot() *ClusterQueueSnapshot {
return cc
}
-func (c *cohort) snapshotInto(cqs map[string]*ClusterQueueSnapshot) {
- cohortSnap := &CohortSnapshot{
- Name: c.Name,
- Members: make(sets.Set[*ClusterQueueSnapshot], len(c.ChildCQs())),
- ResourceNode: c.resourceNode.Clone(),
- }
- cohortSnap.AllocatableResourceGeneration = 0
- for _, cq := range c.ChildCQs() {
- if cq.Active() {
- cqSnap := cqs[cq.Name]
- cqSnap.Cohort = cohortSnap
- cohortSnap.Members.Insert(cqSnap)
- cohortSnap.AllocatableResourceGeneration += cqSnap.AllocatableResourceGeneration
- }
+func newCohortSnapshot(name string) *CohortSnapshot {
+ return &CohortSnapshot{
+ Name: name,
+ Cohort: hierarchy.NewCohort[*ClusterQueueSnapshot, *CohortSnapshot](),
}
}
diff --git a/pkg/cache/snapshot_test.go b/pkg/cache/snapshot_test.go
index 6ff00dae523..7d8e0ff8365 100644
--- a/pkg/cache/snapshot_test.go
+++ b/pkg/cache/snapshot_test.go
@@ -32,6 +32,7 @@ import (
kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/features"
+ "sigs.k8s.io/kueue/pkg/hierarchy"
"sigs.k8s.io/kueue/pkg/resources"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
"sigs.k8s.io/kueue/pkg/workload"
@@ -39,7 +40,10 @@ import (
var snapCmpOpts = []cmp.Option{
cmpopts.EquateEmpty(),
- cmpopts.IgnoreFields(CohortSnapshot{}, "Members"), // avoid recursion.
+ cmpopts.IgnoreUnexported(hierarchy.Cohort[*ClusterQueueSnapshot, *CohortSnapshot]{}),
+ cmpopts.IgnoreUnexported(hierarchy.ClusterQueue[*CohortSnapshot]{}),
+ cmpopts.IgnoreUnexported(hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{}),
+ cmpopts.IgnoreUnexported(hierarchy.CycleChecker{}),
cmpopts.IgnoreFields(metav1.Condition{}, "LastTransitionTime"),
}
@@ -65,34 +69,36 @@ func TestSnapshot(t *testing.T) {
ReserveQuota(&kueue.Admission{ClusterQueue: "b"}).Obj(),
},
wantSnapshot: Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "a": {
- Name: "a",
- NamespaceSelector: labels.Everything(),
- Status: active,
- FlavorFungibility: defaultFlavorFungibility,
- AllocatableResourceGeneration: 1,
- Workloads: map[string]*workload.Info{
- "/alpha": workload.NewInfo(
- utiltesting.MakeWorkload("alpha", "").
- ReserveQuota(&kueue.Admission{ClusterQueue: "a"}).Obj()),
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "a": {
+ Name: "a",
+ NamespaceSelector: labels.Everything(),
+ Status: active,
+ FlavorFungibility: defaultFlavorFungibility,
+ AllocatableResourceGeneration: 1,
+ Workloads: map[string]*workload.Info{
+ "/alpha": workload.NewInfo(
+ utiltesting.MakeWorkload("alpha", "").
+ ReserveQuota(&kueue.Admission{ClusterQueue: "a"}).Obj()),
+ },
+ Preemption: defaultPreemption,
+ FairWeight: oneQuantity,
},
- Preemption: defaultPreemption,
- FairWeight: oneQuantity,
- },
- "b": {
- Name: "b",
- NamespaceSelector: labels.Everything(),
- Status: active,
- FlavorFungibility: defaultFlavorFungibility,
- AllocatableResourceGeneration: 1,
- Workloads: map[string]*workload.Info{
- "/beta": workload.NewInfo(
- utiltesting.MakeWorkload("beta", "").
- ReserveQuota(&kueue.Admission{ClusterQueue: "b"}).Obj()),
+ "b": {
+ Name: "b",
+ NamespaceSelector: labels.Everything(),
+ Status: active,
+ FlavorFungibility: defaultFlavorFungibility,
+ AllocatableResourceGeneration: 1,
+ Workloads: map[string]*workload.Info{
+ "/beta": workload.NewInfo(
+ utiltesting.MakeWorkload("beta", "").
+ ReserveQuota(&kueue.Admission{ClusterQueue: "b"}).Obj()),
+ },
+ Preemption: defaultPreemption,
+ FairWeight: oneQuantity,
},
- Preemption: defaultPreemption,
- FairWeight: oneQuantity,
},
},
},
@@ -121,7 +127,9 @@ func TestSnapshot(t *testing.T) {
utiltesting.MakeResourceFlavor("default").Obj(),
},
wantSnapshot: Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{},
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ ClusterQueues: map[string]*ClusterQueueSnapshot{},
+ },
ResourceFlavors: map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor{
"demand": utiltesting.MakeResourceFlavor("demand").
NodeLabel("a", "b").
@@ -203,8 +211,7 @@ func TestSnapshot(t *testing.T) {
},
wantSnapshot: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "borrowing",
- AllocatableResourceGeneration: 2,
+ Name: "borrowing",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "demand", Resource: corev1.ResourceCPU}: 10_000,
@@ -219,130 +226,133 @@ func TestSnapshot(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "a": {
- Name: "a",
- Cohort: cohort,
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"demand", "spot"},
- LabelKeys: sets.New("instance"),
- },
- },
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "demand", Resource: corev1.ResourceCPU}: {Nominal: 100_000},
- {Flavor: "spot", Resource: corev1.ResourceCPU}: {Nominal: 200_000},
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "demand", Resource: "cpu"}: 100_000,
- {Flavor: "spot", Resource: "cpu"}: 200_000,
- },
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "demand", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
- FlavorFungibility: defaultFlavorFungibility,
- Workloads: map[string]*workload.Info{
- "/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "2").Obj()).
- ReserveQuota(utiltesting.MakeAdmission("a", "main").
- Assignment(corev1.ResourceCPU, "demand", "10000m").
- AssignmentPodCount(5).
- Obj()).
- Obj()),
- },
- Preemption: defaultPreemption,
- FairWeight: oneQuantity,
- NamespaceSelector: labels.Everything(),
- Status: active,
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "borrowing": cohort,
},
- "b": {
- Name: "b",
- Cohort: cohort,
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"spot"},
- LabelKeys: sets.New("instance"),
- },
- {
- CoveredResources: sets.New[corev1.ResourceName]("example.com/gpu"),
- Flavors: []kueue.ResourceFlavorReference{"default"},
- },
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "a": {
+ Name: "a",
+ AllocatableResourceGeneration: 2,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"demand", "spot"},
+ LabelKeys: sets.New("instance"),
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "demand", Resource: corev1.ResourceCPU}: {Nominal: 100_000},
+ {Flavor: "spot", Resource: corev1.ResourceCPU}: {Nominal: 200_000},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "demand", Resource: "cpu"}: 100_000,
+ {Flavor: "spot", Resource: "cpu"}: 200_000,
+ },
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "demand", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ Workloads: map[string]*workload.Info{
+ "/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "2").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("a", "main").
+ Assignment(corev1.ResourceCPU, "demand", "10000m").
+ AssignmentPodCount(5).
+ Obj()).
+ Obj()),
+ },
+ Preemption: defaultPreemption,
+ FairWeight: oneQuantity,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "spot", Resource: corev1.ResourceCPU}: {Nominal: 100_000},
- {Flavor: "default", Resource: "example.com/gpu"}: {Nominal: 50},
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "spot", Resource: "cpu"}: 100_000,
- {Flavor: "default", Resource: "example.com/gpu"}: 50,
- },
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "spot", Resource: corev1.ResourceCPU}: 10_000,
- {Flavor: "default", Resource: "example.com/gpu"}: 15,
- },
+ "b": {
+ Name: "b",
+ AllocatableResourceGeneration: 1,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"spot"},
+ LabelKeys: sets.New("instance"),
+ },
+ {
+ CoveredResources: sets.New[corev1.ResourceName]("example.com/gpu"),
+ Flavors: []kueue.ResourceFlavorReference{"default"},
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "spot", Resource: corev1.ResourceCPU}: {Nominal: 100_000},
+ {Flavor: "default", Resource: "example.com/gpu"}: {Nominal: 50},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "spot", Resource: "cpu"}: 100_000,
+ {Flavor: "default", Resource: "example.com/gpu"}: 50,
+ },
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "spot", Resource: corev1.ResourceCPU}: 10_000,
+ {Flavor: "default", Resource: "example.com/gpu"}: 15,
+ },
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ Workloads: map[string]*workload.Info{
+ "/beta": workload.NewInfo(utiltesting.MakeWorkload("beta", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "1").
+ Request("example.com/gpu", "2").
+ Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("b", "main").
+ Assignment(corev1.ResourceCPU, "spot", "5000m").
+ Assignment("example.com/gpu", "default", "10").
+ AssignmentPodCount(5).
+ Obj()).
+ Obj()),
+ "/gamma": workload.NewInfo(utiltesting.MakeWorkload("gamma", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "1").
+ Request("example.com/gpu", "1").
+ Obj(),
+ ).
+ ReserveQuota(utiltesting.MakeAdmission("b", "main").
+ Assignment(corev1.ResourceCPU, "spot", "5000m").
+ Assignment("example.com/gpu", "default", "5").
+ AssignmentPodCount(5).
+ Obj()).
+ Obj()),
+ },
+ Preemption: defaultPreemption,
+ FairWeight: oneQuantity,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- FlavorFungibility: defaultFlavorFungibility,
- Workloads: map[string]*workload.Info{
- "/beta": workload.NewInfo(utiltesting.MakeWorkload("beta", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "1").
- Request("example.com/gpu", "2").
- Obj()).
- ReserveQuota(utiltesting.MakeAdmission("b", "main").
- Assignment(corev1.ResourceCPU, "spot", "5000m").
- Assignment("example.com/gpu", "default", "10").
- AssignmentPodCount(5).
- Obj()).
- Obj()),
- "/gamma": workload.NewInfo(utiltesting.MakeWorkload("gamma", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "1").
- Request("example.com/gpu", "1").
- Obj(),
- ).
- ReserveQuota(utiltesting.MakeAdmission("b", "main").
- Assignment(corev1.ResourceCPU, "spot", "5000m").
- Assignment("example.com/gpu", "default", "5").
- AssignmentPodCount(5).
- Obj()).
- Obj()),
+ "c": {
+ Name: "c",
+ AllocatableResourceGeneration: 1,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"default"},
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: {Nominal: 100_000},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: "cpu"}: 100_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ Preemption: defaultPreemption,
+ FairWeight: oneQuantity,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- Preemption: defaultPreemption,
- FairWeight: oneQuantity,
- NamespaceSelector: labels.Everything(),
- Status: active,
- },
- "c": {
- Name: "c",
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"default"},
- },
- },
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "default", Resource: corev1.ResourceCPU}: {Nominal: 100_000},
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: "cpu"}: 100_000,
- },
- Usage: resources.FlavorResourceQuantities{},
- },
- FlavorFungibility: defaultFlavorFungibility,
- Preemption: defaultPreemption,
- FairWeight: oneQuantity,
- NamespaceSelector: labels.Everything(),
- Status: active,
},
},
ResourceFlavors: map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor{
@@ -362,19 +372,21 @@ func TestSnapshot(t *testing.T) {
}).Obj(),
},
wantSnapshot: Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "with-preemption": {
- Name: "with-preemption",
- NamespaceSelector: labels.Everything(),
- AllocatableResourceGeneration: 1,
- Status: active,
- Workloads: map[string]*workload.Info{},
- FlavorFungibility: defaultFlavorFungibility,
- Preemption: kueue.ClusterQueuePreemption{
- ReclaimWithinCohort: kueue.PreemptionPolicyAny,
- WithinClusterQueue: kueue.PreemptionPolicyLowerPriority,
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "with-preemption": {
+ Name: "with-preemption",
+ NamespaceSelector: labels.Everything(),
+ AllocatableResourceGeneration: 1,
+ Status: active,
+ Workloads: map[string]*workload.Info{},
+ FlavorFungibility: defaultFlavorFungibility,
+ Preemption: kueue.ClusterQueuePreemption{
+ ReclaimWithinCohort: kueue.PreemptionPolicyAny,
+ WithinClusterQueue: kueue.PreemptionPolicyLowerPriority,
+ },
+ FairWeight: oneQuantity,
},
- FairWeight: oneQuantity,
},
},
},
@@ -384,16 +396,18 @@ func TestSnapshot(t *testing.T) {
utiltesting.MakeClusterQueue("with-preemption").FairWeight(resource.MustParse("3")).Obj(),
},
wantSnapshot: Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "with-preemption": {
- Name: "with-preemption",
- NamespaceSelector: labels.Everything(),
- AllocatableResourceGeneration: 1,
- Status: active,
- Workloads: map[string]*workload.Info{},
- FlavorFungibility: defaultFlavorFungibility,
- Preemption: defaultPreemption,
- FairWeight: resource.MustParse("3"),
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "with-preemption": {
+ Name: "with-preemption",
+ NamespaceSelector: labels.Everything(),
+ AllocatableResourceGeneration: 1,
+ Status: active,
+ Workloads: map[string]*workload.Info{},
+ FlavorFungibility: defaultFlavorFungibility,
+ Preemption: defaultPreemption,
+ FairWeight: resource.MustParse("3"),
+ },
},
},
},
@@ -445,8 +459,7 @@ func TestSnapshot(t *testing.T) {
},
wantSnapshot: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lending",
- AllocatableResourceGeneration: 2,
+ Name: "lending",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
@@ -458,88 +471,91 @@ func TestSnapshot(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "a": {
- Name: "a",
- Cohort: cohort,
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
- LabelKeys: sets.New("arch"),
- },
- },
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](5_000)},
- {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](10_000)},
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
- {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
- },
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: 15_000,
- {Flavor: "x86", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- Workloads: map[string]*workload.Info{
- "/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "2").Obj()).
- ReserveQuota(utiltesting.MakeAdmission("a", "main").
- Assignment(corev1.ResourceCPU, "arm", "10000m").
- AssignmentPodCount(5).Obj()).
- Obj()),
- "/beta": workload.NewInfo(utiltesting.MakeWorkload("beta", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "1").Obj()).
- ReserveQuota(utiltesting.MakeAdmission("a", "main").
- Assignment(corev1.ResourceCPU, "arm", "5000m").
- AssignmentPodCount(5).Obj()).
- Obj()),
- "/gamma": workload.NewInfo(utiltesting.MakeWorkload("gamma", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "2").Obj()).
- ReserveQuota(utiltesting.MakeAdmission("a", "main").
- Assignment(corev1.ResourceCPU, "x86", "10000m").
- AssignmentPodCount(5).Obj()).
- Obj()),
- },
- Preemption: defaultPreemption,
- NamespaceSelector: labels.Everything(),
- Status: active,
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lending": cohort,
},
- "b": {
- Name: "b",
- Cohort: cohort,
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
- LabelKeys: sets.New("arch"),
- },
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "a": {
+ Name: "a",
+ AllocatableResourceGeneration: 2,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
+ LabelKeys: sets.New("arch"),
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](5_000)},
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](10_000)},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
+ },
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 15_000,
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ Workloads: map[string]*workload.Info{
+ "/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "2").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("a", "main").
+ Assignment(corev1.ResourceCPU, "arm", "10000m").
+ AssignmentPodCount(5).Obj()).
+ Obj()),
+ "/beta": workload.NewInfo(utiltesting.MakeWorkload("beta", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "1").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("a", "main").
+ Assignment(corev1.ResourceCPU, "arm", "5000m").
+ AssignmentPodCount(5).Obj()).
+ Obj()),
+ "/gamma": workload.NewInfo(utiltesting.MakeWorkload("gamma", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "2").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("a", "main").
+ Assignment(corev1.ResourceCPU, "x86", "10000m").
+ AssignmentPodCount(5).Obj()).
+ Obj()),
+ },
+ Preemption: defaultPreemption,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](5_000)},
- {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](10_000)},
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
- {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
- },
- Usage: resources.FlavorResourceQuantities{},
+ "b": {
+ Name: "b",
+ AllocatableResourceGeneration: 1,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
+ LabelKeys: sets.New("arch"),
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](5_000)},
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](10_000)},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
+ },
+ Usage: resources.FlavorResourceQuantities{},
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ Preemption: defaultPreemption,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- Preemption: defaultPreemption,
- NamespaceSelector: labels.Everything(),
- Status: active,
},
},
ResourceFlavors: map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor{
@@ -597,8 +613,7 @@ func TestSnapshot(t *testing.T) {
},
wantSnapshot: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lending",
- AllocatableResourceGeneration: 2,
+ Name: "lending",
ResourceNode: ResourceNode{
SubtreeQuota: resources.FlavorResourceQuantities{
{Flavor: "arm", Resource: corev1.ResourceCPU}: 20_000,
@@ -611,87 +626,90 @@ func TestSnapshot(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "a": {
- Name: "a",
- Cohort: cohort,
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
- LabelKeys: sets.New("arch"),
- },
- },
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: nil},
- {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: nil},
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
- {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
- },
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: 15_000,
- {Flavor: "x86", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- Workloads: map[string]*workload.Info{
- "/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "2").Obj()).
- ReserveQuota(utiltesting.MakeAdmission("a", "main").
- Assignment(corev1.ResourceCPU, "arm", "10000m").
- AssignmentPodCount(5).Obj()).
- Obj()),
- "/beta": workload.NewInfo(utiltesting.MakeWorkload("beta", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "1").Obj()).
- ReserveQuota(utiltesting.MakeAdmission("a", "main").
- Assignment(corev1.ResourceCPU, "arm", "5000m").
- AssignmentPodCount(5).Obj()).
- Obj()),
- "/gamma": workload.NewInfo(utiltesting.MakeWorkload("gamma", "").
- PodSets(*utiltesting.MakePodSet("main", 5).
- Request(corev1.ResourceCPU, "2").Obj()).
- ReserveQuota(utiltesting.MakeAdmission("a", "main").
- Assignment(corev1.ResourceCPU, "x86", "10000m").
- AssignmentPodCount(5).Obj()).
- Obj()),
- },
- Preemption: defaultPreemption,
- NamespaceSelector: labels.Everything(),
- Status: active,
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lending": cohort,
},
- "b": {
- Name: "b",
- Cohort: cohort,
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
- LabelKeys: sets.New("arch"),
- },
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "a": {
+ Name: "a",
+ AllocatableResourceGeneration: 2,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
+ LabelKeys: sets.New("arch"),
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: nil},
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: nil},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
+ },
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 15_000,
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ Workloads: map[string]*workload.Info{
+ "/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "2").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("a", "main").
+ Assignment(corev1.ResourceCPU, "arm", "10000m").
+ AssignmentPodCount(5).Obj()).
+ Obj()),
+ "/beta": workload.NewInfo(utiltesting.MakeWorkload("beta", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "1").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("a", "main").
+ Assignment(corev1.ResourceCPU, "arm", "5000m").
+ AssignmentPodCount(5).Obj()).
+ Obj()),
+ "/gamma": workload.NewInfo(utiltesting.MakeWorkload("gamma", "").
+ PodSets(*utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "2").Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("a", "main").
+ Assignment(corev1.ResourceCPU, "x86", "10000m").
+ AssignmentPodCount(5).Obj()).
+ Obj()),
+ },
+ Preemption: defaultPreemption,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: nil},
- {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: nil},
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
- {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
- },
+ "b": {
+ Name: "b",
+ AllocatableResourceGeneration: 1,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
+ LabelKeys: sets.New("arch"),
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: nil},
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 20_000, BorrowingLimit: nil, LendingLimit: nil},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 10_000,
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: 20_000,
+ },
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ Preemption: defaultPreemption,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- Preemption: defaultPreemption,
- NamespaceSelector: labels.Everything(),
- Status: active,
},
},
ResourceFlavors: map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor{
@@ -727,34 +745,37 @@ func TestSnapshot(t *testing.T) {
).Obj(),
},
wantSnapshot: Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "cq": {
- Name: "cq",
- AllocatableResourceGeneration: 1,
- ResourceGroups: []ResourceGroup{
- {
- CoveredResources: sets.New(corev1.ResourceCPU),
- Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
- },
- },
- ResourceNode: ResourceNode{
- Quotas: map[resources.FlavorResource]ResourceQuota{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 7_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](3_000)},
- {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 5_000, BorrowingLimit: nil, LendingLimit: nil},
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "cq": {
+ Name: "cq",
+ AllocatableResourceGeneration: 2,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"arm", "x86"},
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "arm", Resource: corev1.ResourceCPU}: 7_000,
- {Flavor: "x86", Resource: corev1.ResourceCPU}: 5_000,
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 7_000, BorrowingLimit: nil, LendingLimit: ptr.To[int64](3_000)},
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: {Nominal: 5_000, BorrowingLimit: nil, LendingLimit: nil},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 7_000,
+ {Flavor: "x86", Resource: corev1.ResourceCPU}: 5_000,
+ },
},
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ Preemption: defaultPreemption,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
},
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- Preemption: defaultPreemption,
- NamespaceSelector: labels.Everything(),
- Status: active,
- Cohort: &CohortSnapshot{
- Name: "cohort",
- AllocatableResourceGeneration: 1,
+ },
+ Cohorts: map[string]*CohortSnapshot{
+ "cohort": {
+ Name: "cohort",
ResourceNode: ResourceNode{
Quotas: map[resources.FlavorResource]ResourceQuota{
{Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 10_000, BorrowingLimit: nil, LendingLimit: nil},
@@ -777,12 +798,88 @@ func TestSnapshot(t *testing.T) {
},
},
},
+ "cohorts with cycles and their cqs excluded from snapshot": {
+ rfs: []*kueue.ResourceFlavor{
+ utiltesting.MakeResourceFlavor("arm").Obj(),
+ },
+ cohorts: []*kueuealpha.Cohort{
+ utiltesting.MakeCohort("autocycle").Parent("autocycle").Obj(),
+ utiltesting.MakeCohort("cycle-a").Parent("cycle-b").Obj(),
+ utiltesting.MakeCohort("cycle-b").Parent("cycle-a").Obj(),
+ utiltesting.MakeCohort("nocycle").Obj(),
+ },
+ cqs: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue("cq-autocycle").
+ Cohort("autocycle").
+ ResourceGroup(
+ utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "0").FlavorQuotas,
+ ).Obj(),
+ utiltesting.MakeClusterQueue("cq-a").
+ Cohort("cycle-a").
+ ResourceGroup(
+ utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "0").FlavorQuotas,
+ ).Obj(),
+ utiltesting.MakeClusterQueue("cq-b").
+ Cohort("cycle-b").
+ ResourceGroup(
+ utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "0").FlavorQuotas,
+ ).Obj(),
+ utiltesting.MakeClusterQueue("cq-nocycle").
+ Cohort("nocycle").
+ ResourceGroup(
+ utiltesting.MakeFlavorQuotas("arm").Resource(corev1.ResourceCPU, "0").FlavorQuotas,
+ ).Obj(),
+ },
+ wantSnapshot: Snapshot{
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "cq-nocycle": {
+ Name: "cq-nocycle",
+ AllocatableResourceGeneration: 2,
+ ResourceGroups: []ResourceGroup{
+ {
+ CoveredResources: sets.New(corev1.ResourceCPU),
+ Flavors: []kueue.ResourceFlavorReference{"arm"},
+ },
+ },
+ ResourceNode: ResourceNode{
+ Quotas: map[resources.FlavorResource]ResourceQuota{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: {Nominal: 0},
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 0,
+ },
+ },
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ Preemption: defaultPreemption,
+ NamespaceSelector: labels.Everything(),
+ Status: active,
+ },
+ },
+ Cohorts: map[string]*CohortSnapshot{
+ "nocycle": {
+ Name: "nocycle",
+ ResourceNode: ResourceNode{
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "arm", Resource: corev1.ResourceCPU}: 0,
+ },
+ },
+ },
+ },
+ },
+ InactiveClusterQueueSets: sets.New("cq-autocycle", "cq-a", "cq-b"),
+ ResourceFlavors: map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor{
+ "arm": utiltesting.MakeResourceFlavor("arm").Obj(),
+ },
+ },
+ },
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
if tc.disableLendingLimit {
- defer features.SetFeatureGateDuringTest(t, features.LendingLimit, false)()
+ features.SetFeatureGateDuringTest(t, features.LendingLimit, false)
}
cache := New(utiltesting.NewFakeClient())
for _, cq := range tc.cqs {
@@ -793,7 +890,7 @@ func TestSnapshot(t *testing.T) {
}
}
for _, cohort := range tc.cohorts {
- cache.AddCohort(cohort)
+ _ = cache.AddOrUpdateCohort(cohort)
}
for _, rf := range tc.rfs {
cache.AddOrUpdateResourceFlavor(rf)
@@ -885,7 +982,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
}
}
initialSnapshot := cqCache.Snapshot()
- initialCohortResources := initialSnapshot.ClusterQueues["c1"].Cohort.ResourceNode.SubtreeQuota
+ initialCohortResources := initialSnapshot.ClusterQueues["c1"].Parent().ResourceNode.SubtreeQuota
cases := map[string]struct {
remove []string
add []string
@@ -900,8 +997,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
remove: []string{"/c1-cpu", "/c1-memory-alpha", "/c1-memory-beta", "/c2-cpu-1", "/c2-cpu-2"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "cohort",
- AllocatableResourceGeneration: 2,
+ Name: "cohort",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -912,42 +1008,44 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "c1": {
- Name: "c1",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["c1"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
- {Flavor: "alpha", Resource: corev1.ResourceMemory}: 0,
- {Flavor: "beta", Resource: corev1.ResourceMemory}: 0,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
- {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
- {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "cohort": cohort,
},
- "c2": {
- Name: "c2",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["c2"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "c1": {
+ Name: "c1",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["c1"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ {Flavor: "alpha", Resource: corev1.ResourceMemory}: 0,
+ {Flavor: "beta", Resource: corev1.ResourceMemory}: 0,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
+ {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
+ "c2": {
+ Name: "c2",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["c2"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ AllocatableResourceGeneration: 1,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
},
},
},
@@ -959,8 +1057,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
remove: []string{"/c1-cpu"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "cohort",
- AllocatableResourceGeneration: 2,
+ Name: "cohort",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 2_000,
@@ -971,48 +1068,50 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "c1": {
- Name: "c1",
- Cohort: cohort,
- Workloads: map[string]*workload.Info{
- "/c1-memory-alpha": nil,
- "/c1-memory-beta": nil,
- },
- AllocatableResourceGeneration: 1,
- ResourceGroups: cqCache.hm.ClusterQueues["c1"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
- {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi,
- {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
- {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
- {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "cohort": cohort,
},
- "c2": {
- Name: "c2",
- Cohort: cohort,
- Workloads: map[string]*workload.Info{
- "/c2-cpu-1": nil,
- "/c2-cpu-2": nil,
- },
- ResourceGroups: cqCache.hm.ClusterQueues["c2"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 2_000,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "c1": {
+ Name: "c1",
+ Workloads: map[string]*workload.Info{
+ "/c1-memory-alpha": nil,
+ "/c1-memory-beta": nil,
+ },
+ ResourceGroups: cqCache.hm.ClusterQueues["c1"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi,
+ {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
+ {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
+ "c2": {
+ Name: "c2",
+ Workloads: map[string]*workload.Info{
+ "/c2-cpu-1": nil,
+ "/c2-cpu-2": nil,
+ },
+ ResourceGroups: cqCache.hm.ClusterQueues["c2"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ AllocatableResourceGeneration: 1,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 2_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
},
},
},
@@ -1024,8 +1123,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
remove: []string{"/c1-memory-alpha"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "cohort",
- AllocatableResourceGeneration: 2,
+ Name: "cohort",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 3_000,
@@ -1036,48 +1134,49 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "c1": {
- Name: "c1",
- Cohort: cohort,
- Workloads: map[string]*workload.Info{
- "/c1-memory-alpha": nil,
- "/c1-memory-beta": nil,
- },
- AllocatableResourceGeneration: 1,
- ResourceGroups: cqCache.hm.ClusterQueues["c1"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
- {Flavor: "alpha", Resource: corev1.ResourceMemory}: 0,
- {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
- {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
- {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "cohort": cohort,
},
- "c2": {
- Name: "c2",
- Cohort: cohort,
- Workloads: map[string]*workload.Info{
- "/c2-cpu-1": nil,
- "/c2-cpu-2": nil,
- },
- AllocatableResourceGeneration: 1,
- ResourceGroups: cqCache.hm.ClusterQueues["c2"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 2_000,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "c1": {
+ Name: "c1",
+ Workloads: map[string]*workload.Info{
+ "/c1-memory-alpha": nil,
+ "/c1-memory-beta": nil,
+ },
+ ResourceGroups: cqCache.hm.ClusterQueues["c1"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
+ {Flavor: "alpha", Resource: corev1.ResourceMemory}: 0,
+ {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ {Flavor: "alpha", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
+ {Flavor: "beta", Resource: corev1.ResourceMemory}: utiltesting.Gi * 6,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
+ "c2": {
+ Name: "c2",
+ Workloads: map[string]*workload.Info{
+ "/c2-cpu-1": nil,
+ "/c2-cpu-2": nil,
+ },
+ ResourceGroups: cqCache.hm.ClusterQueues["c2"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 2_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
},
},
},
@@ -1087,7 +1186,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
},
}
cmpOpts := append(snapCmpOpts,
- cmpopts.IgnoreFields(ClusterQueueSnapshot{}, "NamespaceSelector", "Preemption", "Status"),
+ cmpopts.IgnoreFields(ClusterQueueSnapshot{}, "NamespaceSelector", "Preemption", "Status", "AllocatableResourceGeneration"),
cmpopts.IgnoreFields(ResourceNode{}, "Quotas"),
cmpopts.IgnoreFields(Snapshot{}, "ResourceFlavors"),
cmpopts.IgnoreTypes(&workload.Info{}))
@@ -1171,7 +1270,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
}
}
initialSnapshot := cqCache.Snapshot()
- initialCohortResources := initialSnapshot.ClusterQueues["lend-a"].Cohort.ResourceNode.SubtreeQuota
+ initialCohortResources := initialSnapshot.ClusterQueues["lend-a"].Parent().ResourceNode.SubtreeQuota
cases := map[string]struct {
remove []string
add []string
@@ -1186,8 +1285,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
remove: []string{"/lend-a-1", "/lend-a-2", "/lend-a-3", "/lend-b-1"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lend",
- AllocatableResourceGeneration: 2,
+ Name: "lend",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1196,38 +1294,39 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "lend-a": {
- Name: "lend-a",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lend": cohort,
},
- "lend-b": {
- Name: "lend-b",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "lend-a": {
+ Name: "lend-a",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ "lend-b": {
+ Name: "lend-b",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
},
},
@@ -1239,8 +1338,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
remove: []string{"/lend-a-2"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lend",
- AllocatableResourceGeneration: 2,
+ Name: "lend",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
@@ -1249,38 +1347,40 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "lend-a": {
- Name: "lend-a",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 7_000,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lend": cohort,
},
- "lend-b": {
- Name: "lend-b",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 4_000,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "lend-a": {
+ Name: "lend-a",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 7_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ "lend-b": {
+ Name: "lend-b",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ AllocatableResourceGeneration: 1,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 4_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
},
},
@@ -1292,8 +1392,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
remove: []string{"/lend-a-1", "/lend-a-2"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lend",
- AllocatableResourceGeneration: 2,
+ Name: "lend",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1302,38 +1401,40 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "lend-a": {
- Name: "lend-a",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lend": cohort,
},
- "lend-b": {
- Name: "lend-b",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 4_000,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "lend-a": {
+ Name: "lend-a",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ "lend-b": {
+ Name: "lend-b",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ AllocatableResourceGeneration: 1,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 4_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
},
},
@@ -1345,8 +1446,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
remove: []string{"/lend-a-2", "/lend-a-3"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lend",
- AllocatableResourceGeneration: 2,
+ Name: "lend",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1355,38 +1455,40 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "lend-a": {
- Name: "lend-a",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lend": cohort,
},
- "lend-b": {
- Name: "lend-b",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 4_000,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "lend-a": {
+ Name: "lend-a",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ "lend-b": {
+ Name: "lend-b",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ AllocatableResourceGeneration: 1,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 4_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
},
},
@@ -1399,8 +1501,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
add: []string{"/lend-a-1"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lend",
- AllocatableResourceGeneration: 2,
+ Name: "lend",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1409,38 +1510,40 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "lend-a": {
- Name: "lend-a",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lend": cohort,
},
- "lend-b": {
- Name: "lend-b",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "lend-a": {
+ Name: "lend-a",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ "lend-b": {
+ Name: "lend-b",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ AllocatableResourceGeneration: 1,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
},
},
@@ -1453,8 +1556,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
add: []string{"/lend-a-3"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lend",
- AllocatableResourceGeneration: 2,
+ Name: "lend",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1463,38 +1565,39 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "lend-a": {
- Name: "lend-a",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lend": cohort,
},
- "lend-b": {
- Name: "lend-b",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "lend-a": {
+ Name: "lend-a",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ "lend-b": {
+ Name: "lend-b",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
},
},
@@ -1507,8 +1610,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
add: []string{"/lend-a-2"},
want: func() Snapshot {
cohort := &CohortSnapshot{
- Name: "lend",
- AllocatableResourceGeneration: 2,
+ Name: "lend",
ResourceNode: ResourceNode{
Usage: resources.FlavorResourceQuantities{
{Flavor: "default", Resource: corev1.ResourceCPU}: 3_000,
@@ -1517,38 +1619,40 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
return Snapshot{
- ClusterQueues: map[string]*ClusterQueueSnapshot{
- "lend-a": {
- Name: "lend-a",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 9_000,
- },
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
- },
- },
+ Manager: hierarchy.Manager[*ClusterQueueSnapshot, *CohortSnapshot]{
+ Cohorts: map[string]*CohortSnapshot{
+ "lend": cohort,
},
- "lend-b": {
- Name: "lend-b",
- Cohort: cohort,
- Workloads: make(map[string]*workload.Info),
- ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
- FlavorFungibility: defaultFlavorFungibility,
- FairWeight: oneQuantity,
- AllocatableResourceGeneration: 1,
- ResourceNode: ResourceNode{
- Usage: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ ClusterQueues: map[string]*ClusterQueueSnapshot{
+ "lend-a": {
+ Name: "lend-a",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-a"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 9_000,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
- SubtreeQuota: resources.FlavorResourceQuantities{
- {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
+ "lend-b": {
+ Name: "lend-b",
+ Workloads: make(map[string]*workload.Info),
+ ResourceGroups: cqCache.hm.ClusterQueues["lend-b"].ResourceGroups,
+ FlavorFungibility: defaultFlavorFungibility,
+ FairWeight: oneQuantity,
+ AllocatableResourceGeneration: 1,
+ ResourceNode: ResourceNode{
+ Usage: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 0,
+ },
+ SubtreeQuota: resources.FlavorResourceQuantities{
+ {Flavor: "default", Resource: corev1.ResourceCPU}: 10_000,
+ },
},
},
},
@@ -1558,7 +1662,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
},
}
cmpOpts := append(snapCmpOpts,
- cmpopts.IgnoreFields(ClusterQueueSnapshot{}, "NamespaceSelector", "Preemption", "Status"),
+ cmpopts.IgnoreFields(ClusterQueueSnapshot{}, "NamespaceSelector", "Preemption", "Status", "AllocatableResourceGeneration"),
cmpopts.IgnoreFields(ResourceNode{}, "Quotas"),
cmpopts.IgnoreFields(Snapshot{}, "ResourceFlavors"),
cmpopts.IgnoreTypes(&workload.Info{}))
diff --git a/pkg/config/config.go b/pkg/config/config.go
index df1d73353fa..ecc6a1eae2e 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -127,6 +127,12 @@ func addLeaderElectionTo(o *ctrl.Options, cfg *configapi.Configuration) {
if o.RetryPeriod == nil && !equality.Semantic.DeepEqual(cfg.LeaderElection.RetryPeriod, metav1.Duration{}) {
o.RetryPeriod = &cfg.LeaderElection.RetryPeriod.Duration
}
+
+ if o.LeaderElection {
+ // When the manager is terminated, the leader manager voluntarily steps down
+ // from the leader role as soon as possible.
+ o.LeaderElectionReleaseOnCancel = true
+ }
}
func Encode(scheme *runtime.Scheme, cfg *configapi.Configuration) (string, error) {
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index 8fccb240228..c9d9f10edc8 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -19,6 +19,7 @@ package config
import (
"errors"
"io/fs"
+ "net"
"os"
"path/filepath"
"testing"
@@ -38,8 +39,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook"
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
- _ "sigs.k8s.io/kueue/pkg/controller/jobs"
"sigs.k8s.io/kueue/pkg/controller/jobs/job"
+
+ _ "sigs.k8s.io/kueue/pkg/controller/jobs"
)
func TestLoad(t *testing.T) {
@@ -303,12 +305,13 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- LeaderElection: true,
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: true,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: configapi.DefaultWebhookPort,
@@ -326,6 +329,7 @@ webhook:
cmpopts.IgnoreUnexported(ctrl.Options{}),
cmpopts.IgnoreUnexported(webhook.DefaultServer{}),
cmpopts.IgnoreUnexported(ctrlcache.Options{}),
+ cmpopts.IgnoreUnexported(net.ListenConfig{}),
cmpopts.IgnoreFields(ctrl.Options{}, "Scheme", "Logger"),
}
@@ -392,12 +396,13 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- LeaderElection: true,
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: true,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: configapi.DefaultWebhookPort,
@@ -467,12 +472,13 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: ":38080",
},
- LeaderElection: true,
- LeaderElectionID: "test-id",
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: true,
+ LeaderElectionID: "test-id",
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: 9444,
@@ -538,18 +544,18 @@ webhook:
QueueVisibility: defaultQueueVisibility,
MultiKueue: defaultMultiKueue,
},
-
wantOptions: ctrl.Options{
HealthProbeBindAddress: configapi.DefaultHealthProbeBindAddress,
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
- LeaderElection: false,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: false,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: false,
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: configapi.DefaultWebhookPort,
@@ -589,12 +595,13 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- LeaderElection: true,
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: true,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: configapi.DefaultWebhookPort,
@@ -649,14 +656,15 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- PprofBindAddress: ":8083",
- LeaderElection: true,
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionNamespace: "namespace",
- LeaderElectionResourceLock: "lock",
- LeaseDuration: ptr.To(time.Second * 100),
- RenewDeadline: ptr.To(time.Second * 15),
- RetryPeriod: ptr.To(time.Second * 30),
+ PprofBindAddress: ":8083",
+ LeaderElection: true,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionNamespace: "namespace",
+ LeaderElectionResourceLock: "lock",
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(time.Second * 100),
+ RenewDeadline: ptr.To(time.Second * 15),
+ RetryPeriod: ptr.To(time.Second * 30),
Controller: runtimeconfig.Controller{
GroupKindConcurrency: map[string]int{
"workload": 5,
@@ -710,12 +718,13 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- LeaderElection: true,
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: true,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: configapi.DefaultWebhookPort,
@@ -749,12 +758,13 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- LeaderElection: true,
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: true,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: configapi.DefaultWebhookPort,
@@ -807,12 +817,13 @@ webhook:
Metrics: metricsserver.Options{
BindAddress: configapi.DefaultMetricsBindAddress,
},
- LeaderElection: true,
- LeaderElectionID: configapi.DefaultLeaderElectionID,
- LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
- LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
- RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
- RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
+ LeaderElection: true,
+ LeaderElectionID: configapi.DefaultLeaderElectionID,
+ LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
+ LeaderElectionReleaseOnCancel: true,
+ LeaseDuration: ptr.To(configapi.DefaultLeaderElectionLeaseDuration),
+ RenewDeadline: ptr.To(configapi.DefaultLeaderElectionRenewDeadline),
+ RetryPeriod: ptr.To(configapi.DefaultLeaderElectionRetryPeriod),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: configapi.DefaultWebhookPort,
diff --git a/pkg/controller/admissionchecks/multikueue/admissioncheck.go b/pkg/controller/admissionchecks/multikueue/admissioncheck.go
index 7af98a71a4c..b563e21586b 100644
--- a/pkg/controller/admissionchecks/multikueue/admissioncheck.go
+++ b/pkg/controller/admissionchecks/multikueue/admissioncheck.go
@@ -33,7 +33,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/util/admissioncheck"
)
@@ -45,10 +44,10 @@ const (
FlavorIndependentCheckMessage = "admission check cannot be applied at ResourceFlavor level"
)
-type multiKueueStoreHelper = admissioncheck.ConfigHelper[*kueuealpha.MultiKueueConfig, kueuealpha.MultiKueueConfig]
+type multiKueueStoreHelper = admissioncheck.ConfigHelper[*kueue.MultiKueueConfig, kueue.MultiKueueConfig]
func newMultiKueueStoreHelper(c client.Client) (*multiKueueStoreHelper, error) {
- return admissioncheck.NewConfigHelper[*kueuealpha.MultiKueueConfig](c)
+ return admissioncheck.NewConfigHelper[*kueue.MultiKueueConfig](c)
}
// ACReconciler implements the reconciler for all the admission checks controlled by multikueue.
@@ -64,7 +63,7 @@ var _ reconcile.Reconciler = (*ACReconciler)(nil)
func (a *ACReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
log := ctrl.LoggerFrom(ctx)
ac := &kueue.AdmissionCheck{}
- if err := a.client.Get(ctx, req.NamespacedName, ac); err != nil || ac.Spec.ControllerName != kueuealpha.MultiKueueControllerName {
+ if err := a.client.Get(ctx, req.NamespacedName, ac); err != nil || ac.Spec.ControllerName != kueue.MultiKueueControllerName {
return reconcile.Result{}, client.IgnoreNotFound(err)
}
@@ -87,7 +86,7 @@ func (a *ACReconciler) Reconcile(ctx context.Context, req reconcile.Request) (re
var inactiveClusters []string
// check the status of the clusters
for _, clusterName := range cfg.Spec.Clusters {
- cluster := &kueuealpha.MultiKueueCluster{}
+ cluster := &kueue.MultiKueueCluster{}
err := a.client.Get(ctx, types.NamespacedName{Name: clusterName}, cluster)
if client.IgnoreNotFound(err) != nil {
log.Error(err, "reading cluster", "multiKueueCluster", clusterName)
@@ -96,7 +95,7 @@ func (a *ACReconciler) Reconcile(ctx context.Context, req reconcile.Request) (re
if err != nil {
missingClusters = append(missingClusters, clusterName)
- } else if !apimeta.IsStatusConditionTrue(cluster.Status.Conditions, kueuealpha.MultiKueueClusterActive) {
+ } else if !apimeta.IsStatusConditionTrue(cluster.Status.Conditions, kueue.MultiKueueClusterActive) {
inactiveClusters = append(inactiveClusters, clusterName)
}
}
@@ -175,9 +174,10 @@ func newACReconciler(c client.Client, helper *multiKueueStoreHelper) *ACReconcil
func (a *ACReconciler) setupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
+ Named("multikueue-admissioncheck").
For(&kueue.AdmissionCheck{}).
- Watches(&kueuealpha.MultiKueueConfig{}, &mkConfigHandler{client: a.client}).
- Watches(&kueuealpha.MultiKueueCluster{}, &mkClusterHandler{client: a.client}).
+ Watches(&kueue.MultiKueueConfig{}, &mkConfigHandler{client: a.client}).
+ Watches(&kueue.MultiKueueCluster{}, &mkClusterHandler{client: a.client}).
Complete(a)
}
@@ -187,8 +187,8 @@ type mkConfigHandler struct {
var _ handler.EventHandler = (*mkConfigHandler)(nil)
-func (m *mkConfigHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.RateLimitingInterface) {
- mkc, isMKC := event.Object.(*kueuealpha.MultiKueueConfig)
+func (m *mkConfigHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ mkc, isMKC := event.Object.(*kueue.MultiKueueConfig)
if !isMKC {
return
}
@@ -198,9 +198,9 @@ func (m *mkConfigHandler) Create(ctx context.Context, event event.CreateEvent, q
}
}
-func (m *mkConfigHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.RateLimitingInterface) {
- oldMKC, isOldMKC := event.ObjectOld.(*kueuealpha.MultiKueueConfig)
- newMKC, isNewMKC := event.ObjectNew.(*kueuealpha.MultiKueueConfig)
+func (m *mkConfigHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ oldMKC, isOldMKC := event.ObjectOld.(*kueue.MultiKueueConfig)
+ newMKC, isNewMKC := event.ObjectNew.(*kueue.MultiKueueConfig)
if !isOldMKC || !isNewMKC || equality.Semantic.DeepEqual(oldMKC.Spec.Clusters, newMKC.Spec.Clusters) {
return
}
@@ -210,8 +210,8 @@ func (m *mkConfigHandler) Update(ctx context.Context, event event.UpdateEvent, q
}
}
-func (m *mkConfigHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.RateLimitingInterface) {
- mkc, isMKC := event.Object.(*kueuealpha.MultiKueueConfig)
+func (m *mkConfigHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ mkc, isMKC := event.Object.(*kueue.MultiKueueConfig)
if !isMKC {
return
}
@@ -221,8 +221,8 @@ func (m *mkConfigHandler) Delete(ctx context.Context, event event.DeleteEvent, q
}
}
-func (m *mkConfigHandler) Generic(ctx context.Context, event event.GenericEvent, q workqueue.RateLimitingInterface) {
- mkc, isMKC := event.Object.(*kueuealpha.MultiKueueConfig)
+func (m *mkConfigHandler) Generic(ctx context.Context, event event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ mkc, isMKC := event.Object.(*kueue.MultiKueueConfig)
if !isMKC {
return
}
@@ -232,7 +232,7 @@ func (m *mkConfigHandler) Generic(ctx context.Context, event event.GenericEvent,
}
}
-func queueReconcileForConfigUsers(ctx context.Context, config string, c client.Client, q workqueue.RateLimitingInterface) error {
+func queueReconcileForConfigUsers(ctx context.Context, config string, c client.Client, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error {
users := &kueue.AdmissionCheckList{}
if err := c.List(ctx, users, client.MatchingFields{AdmissionCheckUsingConfigKey: config}); err != nil {
@@ -257,8 +257,8 @@ type mkClusterHandler struct {
var _ handler.EventHandler = (*mkClusterHandler)(nil)
-func (m *mkClusterHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.RateLimitingInterface) {
- mkc, isMKC := event.Object.(*kueuealpha.MultiKueueCluster)
+func (m *mkClusterHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ mkc, isMKC := event.Object.(*kueue.MultiKueueCluster)
if !isMKC {
return
}
@@ -268,15 +268,15 @@ func (m *mkClusterHandler) Create(ctx context.Context, event event.CreateEvent,
}
}
-func (m *mkClusterHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.RateLimitingInterface) {
- oldMKC, isOldMKC := event.ObjectOld.(*kueuealpha.MultiKueueCluster)
- newMKC, isNewMKC := event.ObjectNew.(*kueuealpha.MultiKueueCluster)
+func (m *mkClusterHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ oldMKC, isOldMKC := event.ObjectOld.(*kueue.MultiKueueCluster)
+ newMKC, isNewMKC := event.ObjectNew.(*kueue.MultiKueueCluster)
if !isOldMKC || !isNewMKC {
return
}
- oldActive := apimeta.FindStatusCondition(oldMKC.Status.Conditions, kueuealpha.MultiKueueClusterActive)
- newActive := apimeta.FindStatusCondition(newMKC.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ oldActive := apimeta.FindStatusCondition(oldMKC.Status.Conditions, kueue.MultiKueueClusterActive)
+ newActive := apimeta.FindStatusCondition(newMKC.Status.Conditions, kueue.MultiKueueClusterActive)
if !cmpConditionState(oldActive, newActive) {
if err := m.queue(ctx, newMKC, q); err != nil {
ctrl.LoggerFrom(ctx).V(2).Error(err, "Failure on update event", "multiKueueCluster", klog.KObj(oldMKC))
@@ -284,8 +284,8 @@ func (m *mkClusterHandler) Update(ctx context.Context, event event.UpdateEvent,
}
}
-func (m *mkClusterHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.RateLimitingInterface) {
- mkc, isMKC := event.Object.(*kueuealpha.MultiKueueCluster)
+func (m *mkClusterHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ mkc, isMKC := event.Object.(*kueue.MultiKueueCluster)
if !isMKC {
return
}
@@ -295,8 +295,8 @@ func (m *mkClusterHandler) Delete(ctx context.Context, event event.DeleteEvent,
}
}
-func (m *mkClusterHandler) Generic(ctx context.Context, event event.GenericEvent, q workqueue.RateLimitingInterface) {
- mkc, isMKC := event.Object.(*kueuealpha.MultiKueueCluster)
+func (m *mkClusterHandler) Generic(ctx context.Context, event event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
+ mkc, isMKC := event.Object.(*kueue.MultiKueueCluster)
if !isMKC {
return
}
@@ -306,8 +306,8 @@ func (m *mkClusterHandler) Generic(ctx context.Context, event event.GenericEvent
}
}
-func (m *mkClusterHandler) queue(ctx context.Context, cluster *kueuealpha.MultiKueueCluster, q workqueue.RateLimitingInterface) error {
- users := &kueuealpha.MultiKueueConfigList{}
+func (m *mkClusterHandler) queue(ctx context.Context, cluster *kueue.MultiKueueCluster, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error {
+ users := &kueue.MultiKueueConfigList{}
if err := m.client.List(ctx, users, client.MatchingFields{UsingMultiKueueClusters: cluster.Name}); err != nil {
return err
}
diff --git a/pkg/controller/admissionchecks/multikueue/admissioncheck_test.go b/pkg/controller/admissionchecks/multikueue/admissioncheck_test.go
index b0f8ae7fb39..34536bdca00 100644
--- a/pkg/controller/admissionchecks/multikueue/admissioncheck_test.go
+++ b/pkg/controller/admissionchecks/multikueue/admissioncheck_test.go
@@ -25,7 +25,6 @@ import (
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
)
@@ -33,9 +32,9 @@ import (
func TestReconcile(t *testing.T) {
cases := map[string]struct {
checks []kueue.AdmissionCheck
- clusters []kueuealpha.MultiKueueCluster
+ clusters []kueue.MultiKueueCluster
reconcileFor string
- configs []kueuealpha.MultiKueueConfig
+ configs []kueue.MultiKueueConfig
wantChecks []kueue.AdmissionCheck
wantError error
@@ -47,15 +46,15 @@ func TestReconcile(t *testing.T) {
reconcileFor: "ac1",
checks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
Generation(1).
Obj(),
},
wantChecks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
SingleInstanceInClusterQueue(true, SingleInstanceReason, SingleInstanceMessage, 1).
ApplyToAllFlavors(true, FlavorIndependentCheckReason, FlavorIndependentCheckMessage, 1).
Condition(metav1.Condition{
@@ -85,18 +84,18 @@ func TestReconcile(t *testing.T) {
reconcileFor: "ac1",
checks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
Generation(1).
Obj(),
},
- configs: []kueuealpha.MultiKueueConfig{
+ configs: []kueue.MultiKueueConfig{
*utiltesting.MakeMultiKueueConfig("config1").Clusters("worker1").Obj(),
},
wantChecks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
SingleInstanceInClusterQueue(true, SingleInstanceReason, SingleInstanceMessage, 1).
ApplyToAllFlavors(true, FlavorIndependentCheckReason, FlavorIndependentCheckMessage, 1).
Condition(metav1.Condition{
@@ -113,23 +112,23 @@ func TestReconcile(t *testing.T) {
reconcileFor: "ac1",
checks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
Generation(1).
Obj(),
},
- configs: []kueuealpha.MultiKueueConfig{
+ configs: []kueue.MultiKueueConfig{
*utiltesting.MakeMultiKueueConfig("config1").Clusters("worker1").Obj(),
},
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
Active(metav1.ConditionFalse, "ByTest", "by test", 1).
Obj(),
},
wantChecks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
SingleInstanceInClusterQueue(true, SingleInstanceReason, SingleInstanceMessage, 1).
ApplyToAllFlavors(true, FlavorIndependentCheckReason, FlavorIndependentCheckMessage, 1).
Condition(metav1.Condition{
@@ -146,15 +145,15 @@ func TestReconcile(t *testing.T) {
reconcileFor: "ac1",
checks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
Generation(1).
Obj(),
},
- configs: []kueuealpha.MultiKueueConfig{
+ configs: []kueue.MultiKueueConfig{
*utiltesting.MakeMultiKueueConfig("config1").Clusters("worker1", "worker2", "worker3").Obj(),
},
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
Active(metav1.ConditionFalse, "ByTest", "by test", 1).
Obj(),
@@ -164,8 +163,8 @@ func TestReconcile(t *testing.T) {
},
wantChecks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
SingleInstanceInClusterQueue(true, SingleInstanceReason, SingleInstanceMessage, 1).
ApplyToAllFlavors(true, FlavorIndependentCheckReason, FlavorIndependentCheckMessage, 1).
Condition(metav1.Condition{
@@ -182,15 +181,15 @@ func TestReconcile(t *testing.T) {
reconcileFor: "ac1",
checks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
Generation(1).
Obj(),
},
- configs: []kueuealpha.MultiKueueConfig{
+ configs: []kueue.MultiKueueConfig{
*utiltesting.MakeMultiKueueConfig("config1").Clusters("worker1", "worker2", "worker3").Obj(),
},
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
Active(metav1.ConditionFalse, "ByTest", "by test", 1).
Obj(),
@@ -200,8 +199,8 @@ func TestReconcile(t *testing.T) {
},
wantChecks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
SingleInstanceInClusterQueue(true, SingleInstanceReason, SingleInstanceMessage, 1).
ApplyToAllFlavors(true, FlavorIndependentCheckReason, FlavorIndependentCheckMessage, 1).
Condition(metav1.Condition{
@@ -218,23 +217,23 @@ func TestReconcile(t *testing.T) {
reconcileFor: "ac1",
checks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
Generation(1).
Obj(),
},
- configs: []kueuealpha.MultiKueueConfig{
+ configs: []kueue.MultiKueueConfig{
*utiltesting.MakeMultiKueueConfig("config1").Clusters("worker1").Obj(),
},
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
Active(metav1.ConditionTrue, "ByTest", "by test", 1).
Obj(),
},
wantChecks: []kueue.AdmissionCheck{
*utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
SingleInstanceInClusterQueue(true, SingleInstanceReason, SingleInstanceMessage, 1).
ApplyToAllFlavors(true, FlavorIndependentCheckReason, FlavorIndependentCheckMessage, 1).
Condition(metav1.Condition{
@@ -255,8 +254,8 @@ func TestReconcile(t *testing.T) {
builder = builder.WithLists(
&kueue.AdmissionCheckList{Items: tc.checks},
- &kueuealpha.MultiKueueConfigList{Items: tc.configs},
- &kueuealpha.MultiKueueClusterList{Items: tc.clusters},
+ &kueue.MultiKueueConfigList{Items: tc.configs},
+ &kueue.MultiKueueClusterList{Items: tc.clusters},
)
for _, ac := range tc.checks {
diff --git a/pkg/controller/admissionchecks/multikueue/fswatch.go b/pkg/controller/admissionchecks/multikueue/fswatch.go
index 8cd99b3fe56..579cd2457e3 100644
--- a/pkg/controller/admissionchecks/multikueue/fswatch.go
+++ b/pkg/controller/admissionchecks/multikueue/fswatch.go
@@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/manager"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
)
var (
@@ -105,7 +105,7 @@ func (w *KubeConfigFSWatcher) clustersForPath(path string) []string {
func (w *KubeConfigFSWatcher) notifyPathWrite(path string) {
for _, c := range w.clustersForPath(path) {
- w.reconcile <- event.GenericEvent{Object: &kueuealpha.MultiKueueCluster{ObjectMeta: metav1.ObjectMeta{Name: c}}}
+ w.reconcile <- event.GenericEvent{Object: &kueue.MultiKueueCluster{ObjectMeta: metav1.ObjectMeta{Name: c}}}
}
}
diff --git a/pkg/controller/admissionchecks/multikueue/indexer.go b/pkg/controller/admissionchecks/multikueue/indexer.go
index c02488a4dd5..7cb5f632358 100644
--- a/pkg/controller/admissionchecks/multikueue/indexer.go
+++ b/pkg/controller/admissionchecks/multikueue/indexer.go
@@ -23,7 +23,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/util/admissioncheck"
)
@@ -35,12 +34,12 @@ const (
)
var (
- configGVK = kueuealpha.GroupVersion.WithKind("MultiKueueConfig")
+ configGVK = kueue.GroupVersion.WithKind("MultiKueueConfig")
)
func getIndexUsingKubeConfigs(configNamespace string) func(obj client.Object) []string {
return func(obj client.Object) []string {
- cluster, isCluster := obj.(*kueuealpha.MultiKueueCluster)
+ cluster, isCluster := obj.(*kueue.MultiKueueCluster)
if !isCluster {
return nil
}
@@ -49,7 +48,7 @@ func getIndexUsingKubeConfigs(configNamespace string) func(obj client.Object) []
}
func indexUsingMultiKueueClusters(obj client.Object) []string {
- config, isConfig := obj.(*kueuealpha.MultiKueueConfig)
+ config, isConfig := obj.(*kueue.MultiKueueConfig)
if !isConfig {
return nil
}
@@ -57,13 +56,13 @@ func indexUsingMultiKueueClusters(obj client.Object) []string {
}
func SetupIndexer(ctx context.Context, indexer client.FieldIndexer, configNamespace string) error {
- if err := indexer.IndexField(ctx, &kueuealpha.MultiKueueCluster{}, UsingKubeConfigs, getIndexUsingKubeConfigs(configNamespace)); err != nil {
+ if err := indexer.IndexField(ctx, &kueue.MultiKueueCluster{}, UsingKubeConfigs, getIndexUsingKubeConfigs(configNamespace)); err != nil {
return fmt.Errorf("setting index on clusters using kubeconfig: %w", err)
}
- if err := indexer.IndexField(ctx, &kueuealpha.MultiKueueConfig{}, UsingMultiKueueClusters, indexUsingMultiKueueClusters); err != nil {
+ if err := indexer.IndexField(ctx, &kueue.MultiKueueConfig{}, UsingMultiKueueClusters, indexUsingMultiKueueClusters); err != nil {
return fmt.Errorf("setting index on configs using clusters: %w", err)
}
- if err := indexer.IndexField(ctx, &kueue.AdmissionCheck{}, AdmissionCheckUsingConfigKey, admissioncheck.IndexerByConfigFunction(kueuealpha.MultiKueueControllerName, configGVK)); err != nil {
+ if err := indexer.IndexField(ctx, &kueue.AdmissionCheck{}, AdmissionCheckUsingConfigKey, admissioncheck.IndexerByConfigFunction(kueue.MultiKueueControllerName, configGVK)); err != nil {
return fmt.Errorf("setting index on admission checks config: %w", err)
}
return nil
diff --git a/pkg/controller/admissionchecks/multikueue/indexer_test.go b/pkg/controller/admissionchecks/multikueue/indexer_test.go
index cbd5c40bf2b..69e7d04fde4 100644
--- a/pkg/controller/admissionchecks/multikueue/indexer_test.go
+++ b/pkg/controller/admissionchecks/multikueue/indexer_test.go
@@ -30,7 +30,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/util/slices"
@@ -45,7 +44,7 @@ func getClientBuilder() (*fake.ClientBuilder, context.Context) {
scheme := runtime.NewScheme()
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(kueue.AddToScheme(scheme))
- utilruntime.Must(kueuealpha.AddToScheme(scheme))
+ utilruntime.Must(kueue.AddToScheme(scheme))
utilruntime.Must(jobframework.ForEachIntegration(func(_ string, cb jobframework.IntegrationCallbacks) error {
if cb.MultiKueueAdapter != nil && cb.AddToScheme != nil {
@@ -66,7 +65,7 @@ func getClientBuilder() (*fake.ClientBuilder, context.Context) {
func TestListMultiKueueClustersUsingKubeConfig(t *testing.T) {
cases := map[string]struct {
- clusters []*kueuealpha.MultiKueueCluster
+ clusters []*kueue.MultiKueueCluster
filter client.ListOption
wantListError error
wantList []string
@@ -75,22 +74,22 @@ func TestListMultiKueueClustersUsingKubeConfig(t *testing.T) {
filter: client.MatchingFields{UsingKubeConfigs: TestNamespace + "/secret1"},
},
"single cluster, single match": {
- clusters: []*kueuealpha.MultiKueueCluster{
- utiltesting.MakeMultiKueueCluster("cluster1").KubeConfig(kueuealpha.SecretLocationType, "secret1").Obj(),
+ clusters: []*kueue.MultiKueueCluster{
+ utiltesting.MakeMultiKueueCluster("cluster1").KubeConfig(kueue.SecretLocationType, "secret1").Obj(),
},
filter: client.MatchingFields{UsingKubeConfigs: TestNamespace + "/secret1"},
wantList: []string{"cluster1"},
},
"single cluster, no match": {
- clusters: []*kueuealpha.MultiKueueCluster{
- utiltesting.MakeMultiKueueCluster("cluster2").KubeConfig(kueuealpha.SecretLocationType, "secret2").Obj(),
+ clusters: []*kueue.MultiKueueCluster{
+ utiltesting.MakeMultiKueueCluster("cluster2").KubeConfig(kueue.SecretLocationType, "secret2").Obj(),
},
filter: client.MatchingFields{UsingKubeConfigs: TestNamespace + "/secret1"},
},
"multiple clusters, single match": {
- clusters: []*kueuealpha.MultiKueueCluster{
- utiltesting.MakeMultiKueueCluster("cluster1").KubeConfig(kueuealpha.SecretLocationType, "secret1").Obj(),
- utiltesting.MakeMultiKueueCluster("cluster2").KubeConfig(kueuealpha.SecretLocationType, "secret2").Obj(),
+ clusters: []*kueue.MultiKueueCluster{
+ utiltesting.MakeMultiKueueCluster("cluster1").KubeConfig(kueue.SecretLocationType, "secret1").Obj(),
+ utiltesting.MakeMultiKueueCluster("cluster2").KubeConfig(kueue.SecretLocationType, "secret2").Obj(),
},
filter: client.MatchingFields{UsingKubeConfigs: TestNamespace + "/secret1"},
wantList: []string{"cluster1"},
@@ -106,14 +105,14 @@ func TestListMultiKueueClustersUsingKubeConfig(t *testing.T) {
}
}
- lst := &kueuealpha.MultiKueueClusterList{}
+ lst := &kueue.MultiKueueClusterList{}
gotListErr := k8sclient.List(ctx, lst, tc.filter)
if diff := cmp.Diff(tc.wantListError, gotListErr); diff != "" {
t.Errorf("unexpected list error (-want/+got):\n%s", diff)
}
- gotList := slices.Map(lst.Items, func(mkc *kueuealpha.MultiKueueCluster) string { return mkc.Name })
+ gotList := slices.Map(lst.Items, func(mkc *kueue.MultiKueueCluster) string { return mkc.Name })
if diff := cmp.Diff(tc.wantList, gotList, cmpopts.EquateEmpty(), cmpopts.SortSlices(func(a, b string) bool { return a < b })); diff != "" {
t.Errorf("unexpected list (-want/+got):\n%s", diff)
}
@@ -123,7 +122,7 @@ func TestListMultiKueueClustersUsingKubeConfig(t *testing.T) {
func TestListMultiKueueConfigsUsingMultiKueueClusters(t *testing.T) {
cases := map[string]struct {
- configs []*kueuealpha.MultiKueueConfig
+ configs []*kueue.MultiKueueConfig
filter client.ListOption
wantListError error
wantList []string
@@ -132,20 +131,20 @@ func TestListMultiKueueConfigsUsingMultiKueueClusters(t *testing.T) {
filter: client.MatchingFields{UsingMultiKueueClusters: "cluster1"},
},
"single config, single match": {
- configs: []*kueuealpha.MultiKueueConfig{
+ configs: []*kueue.MultiKueueConfig{
utiltesting.MakeMultiKueueConfig("config1").Clusters("cluster1", "cluster2").Obj(),
},
filter: client.MatchingFields{UsingMultiKueueClusters: "cluster2"},
wantList: []string{"config1"},
},
"single config, no match": {
- configs: []*kueuealpha.MultiKueueConfig{
+ configs: []*kueue.MultiKueueConfig{
utiltesting.MakeMultiKueueConfig("config2").Clusters("cluster2").Obj(),
},
filter: client.MatchingFields{UsingMultiKueueClusters: "cluster1"},
},
"multiple configs, single match": {
- configs: []*kueuealpha.MultiKueueConfig{
+ configs: []*kueue.MultiKueueConfig{
utiltesting.MakeMultiKueueConfig("config1").Clusters("cluster1", "cluster2").Obj(),
utiltesting.MakeMultiKueueConfig("config2").Clusters("cluster2").Obj(),
},
@@ -163,14 +162,14 @@ func TestListMultiKueueConfigsUsingMultiKueueClusters(t *testing.T) {
}
}
- lst := &kueuealpha.MultiKueueConfigList{}
+ lst := &kueue.MultiKueueConfigList{}
gotListErr := k8sclient.List(ctx, lst, tc.filter)
if diff := cmp.Diff(tc.wantListError, gotListErr); diff != "" {
t.Errorf("unexpected list error (-want/+got):\n%s", diff)
}
- gotList := slices.Map(lst.Items, func(mkc *kueuealpha.MultiKueueConfig) string { return mkc.Name })
+ gotList := slices.Map(lst.Items, func(mkc *kueue.MultiKueueConfig) string { return mkc.Name })
if diff := cmp.Diff(tc.wantList, gotList, cmpopts.EquateEmpty(), cmpopts.SortSlices(func(a, b string) bool { return a < b })); diff != "" {
t.Errorf("unexpected list (-want/+got):\n%s", diff)
}
diff --git a/pkg/controller/admissionchecks/multikueue/multikueuecluster.go b/pkg/controller/admissionchecks/multikueue/multikueuecluster.go
index 67a530bff9b..f3ba484c55b 100644
--- a/pkg/controller/admissionchecks/multikueue/multikueuecluster.go
+++ b/pkg/controller/admissionchecks/multikueue/multikueuecluster.go
@@ -48,7 +48,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/util/maps"
@@ -186,7 +185,7 @@ func (rc *remoteClient) setConfig(watchCtx context.Context, kubeconfig []byte) (
func (rc *remoteClient) startWatcher(ctx context.Context, kind string, w jobframework.MultiKueueWatcher) error {
log := ctrl.LoggerFrom(ctx).WithValues("watchKind", kind)
- newWatcher, err := rc.client.Watch(ctx, w.GetEmptyList(), client.MatchingLabels{kueuealpha.MultiKueueOriginLabel: rc.origin})
+ newWatcher, err := rc.client.Watch(ctx, w.GetEmptyList(), client.MatchingLabels{kueue.MultiKueueOriginLabel: rc.origin})
if err != nil {
return err
}
@@ -241,7 +240,7 @@ func (rc *remoteClient) queueWorkloadEvent(ctx context.Context, wlKey types.Name
}
func (rc *remoteClient) queueWatchEndedEvent(ctx context.Context) {
- cluster := &kueuealpha.MultiKueueCluster{}
+ cluster := &kueue.MultiKueueCluster{}
if err := rc.localClient.Get(ctx, types.NamespacedName{Name: rc.clusterName}, cluster); err == nil {
rc.watchEndedCh <- event.GenericEvent{Object: cluster}
} else {
@@ -261,7 +260,7 @@ func (rc *remoteClient) runGC(ctx context.Context) {
}
lst := &kueue.WorkloadList{}
- err := rc.client.List(ctx, lst, client.MatchingLabels{kueuealpha.MultiKueueOriginLabel: rc.origin})
+ err := rc.client.List(ctx, lst, client.MatchingLabels{kueue.MultiKueueOriginLabel: rc.origin})
if err != nil {
log.Error(err, "Listing remote workloads")
return
@@ -388,7 +387,7 @@ func (c *clustersReconciler) controllerFor(acName string) (*remoteClient, bool)
}
func (c *clustersReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
- cluster := &kueuealpha.MultiKueueCluster{}
+ cluster := &kueue.MultiKueueCluster{}
log := ctrl.LoggerFrom(ctx)
err := c.localClient.Get(ctx, req.NamespacedName, cluster)
@@ -425,8 +424,8 @@ func (c *clustersReconciler) Reconcile(ctx context.Context, req reconcile.Reques
return reconcile.Result{}, c.updateStatus(ctx, cluster, true, "Active", "Connected")
}
-func (c *clustersReconciler) getKubeConfig(ctx context.Context, ref *kueuealpha.KubeConfig) ([]byte, bool, error) {
- if ref.LocationType == kueuealpha.SecretLocationType {
+func (c *clustersReconciler) getKubeConfig(ctx context.Context, ref *kueue.KubeConfig) ([]byte, bool, error) {
+ if ref.LocationType == kueue.SecretLocationType {
return c.getKubeConfigFromSecret(ctx, ref.Location)
}
// Otherwise it's path
@@ -444,9 +443,9 @@ func (c *clustersReconciler) getKubeConfigFromSecret(ctx context.Context, secret
return nil, !apierrors.IsNotFound(err), err
}
- kconfigBytes, found := sec.Data[kueuealpha.MultiKueueConfigSecretKey]
+ kconfigBytes, found := sec.Data[kueue.MultiKueueConfigSecretKey]
if !found {
- return nil, false, fmt.Errorf("key %q not found in secret %q", kueuealpha.MultiKueueConfigSecretKey, secretName)
+ return nil, false, fmt.Errorf("key %q not found in secret %q", kueue.MultiKueueConfigSecretKey, secretName)
}
return kconfigBytes, false, nil
@@ -457,9 +456,9 @@ func (c *clustersReconciler) getKubeConfigFromPath(path string) ([]byte, bool, e
return content, false, err
}
-func (c *clustersReconciler) updateStatus(ctx context.Context, cluster *kueuealpha.MultiKueueCluster, active bool, reason, message string) error {
+func (c *clustersReconciler) updateStatus(ctx context.Context, cluster *kueue.MultiKueueCluster, active bool, reason, message string) error {
newCondition := metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionFalse,
Reason: reason,
Message: message,
@@ -470,7 +469,7 @@ func (c *clustersReconciler) updateStatus(ctx context.Context, cluster *kueuealp
}
// if the condition is up-to-date
- oldCondition := apimeta.FindStatusCondition(cluster.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ oldCondition := apimeta.FindStatusCondition(cluster.Status.Conditions, kueue.MultiKueueClusterActive)
if cmpConditionState(oldCondition, &newCondition) {
return nil
}
@@ -531,7 +530,7 @@ func (c *clustersReconciler) setupWithManager(mgr ctrl.Manager) error {
}
syncHndl := handler.Funcs{
- GenericFunc: func(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+ GenericFunc: func(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
q.Add(reconcile.Request{NamespacedName: types.NamespacedName{
Name: e.Object.GetName(),
}})
@@ -539,7 +538,7 @@ func (c *clustersReconciler) setupWithManager(mgr ctrl.Manager) error {
}
fsWatcherHndl := handler.Funcs{
- GenericFunc: func(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+ GenericFunc: func(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
// batch the events
q.AddAfter(reconcile.Request{NamespacedName: types.NamespacedName{
Name: e.Object.GetName(),
@@ -550,8 +549,8 @@ func (c *clustersReconciler) setupWithManager(mgr ctrl.Manager) error {
filterLog := mgr.GetLogger().WithName("MultiKueueCluster filter")
filter := predicate.Funcs{
CreateFunc: func(ce event.CreateEvent) bool {
- if cluster, isCluster := ce.Object.(*kueuealpha.MultiKueueCluster); isCluster {
- if cluster.Spec.KubeConfig.LocationType == kueuealpha.PathLocationType {
+ if cluster, isCluster := ce.Object.(*kueue.MultiKueueCluster); isCluster {
+ if cluster.Spec.KubeConfig.LocationType == kueue.PathLocationType {
err := c.fsWatcher.AddOrUpdate(cluster.Name, cluster.Spec.KubeConfig.Location)
if err != nil {
filterLog.Error(err, "AddOrUpdate FS watch", "cluster", klog.KObj(cluster))
@@ -561,20 +560,20 @@ func (c *clustersReconciler) setupWithManager(mgr ctrl.Manager) error {
return true
},
UpdateFunc: func(ue event.UpdateEvent) bool {
- clusterNew, isClusterNew := ue.ObjectNew.(*kueuealpha.MultiKueueCluster)
- clusterOld, isClusterOld := ue.ObjectOld.(*kueuealpha.MultiKueueCluster)
+ clusterNew, isClusterNew := ue.ObjectNew.(*kueue.MultiKueueCluster)
+ clusterOld, isClusterOld := ue.ObjectOld.(*kueue.MultiKueueCluster)
if !isClusterNew || !isClusterOld {
return true
}
- if clusterNew.Spec.KubeConfig.LocationType == kueuealpha.SecretLocationType && clusterOld.Spec.KubeConfig.LocationType == kueuealpha.PathLocationType {
+ if clusterNew.Spec.KubeConfig.LocationType == kueue.SecretLocationType && clusterOld.Spec.KubeConfig.LocationType == kueue.PathLocationType {
err := c.fsWatcher.Remove(clusterOld.Name)
if err != nil {
filterLog.Error(err, "Remove FS watch", "cluster", klog.KObj(clusterOld))
}
}
- if clusterNew.Spec.KubeConfig.LocationType == kueuealpha.PathLocationType {
+ if clusterNew.Spec.KubeConfig.LocationType == kueue.PathLocationType {
err := c.fsWatcher.AddOrUpdate(clusterNew.Name, clusterNew.Spec.KubeConfig.Location)
if err != nil {
filterLog.Error(err, "AddOrUpdate FS watch", "cluster", klog.KObj(clusterNew))
@@ -583,8 +582,8 @@ func (c *clustersReconciler) setupWithManager(mgr ctrl.Manager) error {
return true
},
DeleteFunc: func(de event.DeleteEvent) bool {
- if cluster, isCluster := de.Object.(*kueuealpha.MultiKueueCluster); isCluster {
- if cluster.Spec.KubeConfig.LocationType == kueuealpha.PathLocationType {
+ if cluster, isCluster := de.Object.(*kueue.MultiKueueCluster); isCluster {
+ if cluster.Spec.KubeConfig.LocationType == kueue.PathLocationType {
err := c.fsWatcher.Remove(cluster.Name)
if err != nil {
filterLog.Error(err, "Remove FS watch", "cluster", klog.KObj(cluster))
@@ -596,10 +595,10 @@ func (c *clustersReconciler) setupWithManager(mgr ctrl.Manager) error {
}
return ctrl.NewControllerManagedBy(mgr).
- For(&kueuealpha.MultiKueueCluster{}).
+ For(&kueue.MultiKueueCluster{}).
Watches(&corev1.Secret{}, &secretHandler{client: c.localClient}).
- WatchesRawSource(&source.Channel{Source: c.watchEndedCh}, syncHndl).
- WatchesRawSource(&source.Channel{Source: c.fsWatcher.reconcile}, fsWatcherHndl).
+ WatchesRawSource(source.Channel(c.watchEndedCh, syncHndl)).
+ WatchesRawSource(source.Channel(c.fsWatcher.reconcile, fsWatcherHndl)).
WithEventFilter(filter).
Complete(c)
}
@@ -610,7 +609,7 @@ type secretHandler struct {
var _ handler.EventHandler = (*secretHandler)(nil)
-func (s *secretHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.RateLimitingInterface) {
+func (s *secretHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
secret, isSecret := event.Object.(*corev1.Secret)
if !isSecret {
ctrl.LoggerFrom(ctx).V(5).Error(errors.New("not a secret"), "Failure on create event")
@@ -621,7 +620,7 @@ func (s *secretHandler) Create(ctx context.Context, event event.CreateEvent, q w
}
}
-func (s *secretHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.RateLimitingInterface) {
+func (s *secretHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
secret, isSecret := event.ObjectNew.(*corev1.Secret)
if !isSecret {
ctrl.LoggerFrom(ctx).V(5).Error(errors.New("not a secret"), "Failure on update event")
@@ -632,7 +631,7 @@ func (s *secretHandler) Update(ctx context.Context, event event.UpdateEvent, q w
}
}
-func (s *secretHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.RateLimitingInterface) {
+func (s *secretHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
secret, isSecret := event.Object.(*corev1.Secret)
if !isSecret {
ctrl.LoggerFrom(ctx).V(5).Error(errors.New("not a secret"), "Failure on delete event")
@@ -643,7 +642,7 @@ func (s *secretHandler) Delete(ctx context.Context, event event.DeleteEvent, q w
}
}
-func (s *secretHandler) Generic(ctx context.Context, event event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (s *secretHandler) Generic(ctx context.Context, event event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
secret, isSecret := event.Object.(*corev1.Secret)
if !isSecret {
ctrl.LoggerFrom(ctx).V(5).Error(errors.New("not a secret"), "Failure on generic event")
@@ -654,8 +653,8 @@ func (s *secretHandler) Generic(ctx context.Context, event event.GenericEvent, q
}
}
-func (s *secretHandler) queue(ctx context.Context, secret *corev1.Secret, q workqueue.RateLimitingInterface) error {
- users := &kueuealpha.MultiKueueClusterList{}
+func (s *secretHandler) queue(ctx context.Context, secret *corev1.Secret, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error {
+ users := &kueue.MultiKueueClusterList{}
if err := s.client.List(ctx, users, client.MatchingFields{UsingKubeConfigs: strings.Join([]string{secret.Namespace, secret.Name}, "/")}); err != nil {
return err
}
diff --git a/pkg/controller/admissionchecks/multikueue/multikueuecluster_test.go b/pkg/controller/admissionchecks/multikueue/multikueuecluster_test.go
index aeec619a202..92f625abb59 100644
--- a/pkg/controller/admissionchecks/multikueue/multikueuecluster_test.go
+++ b/pkg/controller/admissionchecks/multikueue/multikueuecluster_test.go
@@ -33,13 +33,13 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
- _ "sigs.k8s.io/kueue/pkg/controller/jobs"
"sigs.k8s.io/kueue/pkg/util/slices"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
+
+ _ "sigs.k8s.io/kueue/pkg/controller/jobs"
)
var (
@@ -89,7 +89,7 @@ func makeTestSecret(name string, kubeconfig string) corev1.Secret {
Namespace: TestNamespace,
},
Data: map[string][]byte{
- kueuealpha.MultiKueueConfigSecretKey: []byte(kubeconfig),
+ kueue.MultiKueueConfigSecretKey: []byte(kubeconfig),
},
}
}
@@ -101,28 +101,28 @@ func TestUpdateConfig(t *testing.T) {
cases := map[string]struct {
reconcileFor string
remoteClients map[string]*remoteClient
- clusters []kueuealpha.MultiKueueCluster
+ clusters []kueue.MultiKueueCluster
secrets []corev1.Secret
wantRemoteClients map[string]*remoteClient
- wantClusters []kueuealpha.MultiKueueCluster
+ wantClusters []kueue.MultiKueueCluster
wantRequeueAfter time.Duration
wantCancelCalled int
}{
"new valid client is added": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Generation(1).
Obj(),
},
secrets: []corev1.Secret{
makeTestSecret("worker1", "worker1 kubeconfig"),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionTrue, "Active", "Connected", 1).
Generation(1).
Obj(),
@@ -135,9 +135,9 @@ func TestUpdateConfig(t *testing.T) {
},
"update client with valid secret config": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Generation(1).
Obj(),
},
@@ -147,9 +147,9 @@ func TestUpdateConfig(t *testing.T) {
remoteClients: map[string]*remoteClient{
"worker1": newTestClient("worker1 old kubeconfig", cancelCalled),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionTrue, "Active", "Connected", 1).
Generation(1).
Obj(),
@@ -163,18 +163,18 @@ func TestUpdateConfig(t *testing.T) {
},
"update client with valid path config": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.PathLocationType, "testdata/worker1KubeConfig").
+ KubeConfig(kueue.PathLocationType, "testdata/worker1KubeConfig").
Generation(1).
Obj(),
},
remoteClients: map[string]*remoteClient{
"worker1": newTestClient("worker1 old kubeconfig", cancelCalled),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.PathLocationType, "testdata/worker1KubeConfig").
+ KubeConfig(kueue.PathLocationType, "testdata/worker1KubeConfig").
Active(metav1.ConditionTrue, "Active", "Connected", 1).
Generation(1).
Obj(),
@@ -188,9 +188,9 @@ func TestUpdateConfig(t *testing.T) {
},
"update client with invalid secret config": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Generation(1).
Obj(),
},
@@ -203,9 +203,9 @@ func TestUpdateConfig(t *testing.T) {
wantRemoteClients: map[string]*remoteClient{
"worker1": newTestClient("invalid", nil),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionFalse, "ClientConnectionFailed", "invalid kubeconfig", 1).
Generation(1).
Obj(),
@@ -214,18 +214,18 @@ func TestUpdateConfig(t *testing.T) {
},
"update client with invalid path config": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.PathLocationType, "").
+ KubeConfig(kueue.PathLocationType, "").
Generation(1).
Obj(),
},
remoteClients: map[string]*remoteClient{
"worker1": newTestClient("worker1 old kubeconfig", cancelCalled),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.PathLocationType, "").
+ KubeConfig(kueue.PathLocationType, "").
Active(metav1.ConditionFalse, "BadConfig", "open : no such file or directory", 1).
Generation(1).
Obj(),
@@ -234,9 +234,9 @@ func TestUpdateConfig(t *testing.T) {
},
"missing cluster is removed": {
reconcileFor: "worker2",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Generation(1).
Obj(),
},
@@ -244,9 +244,9 @@ func TestUpdateConfig(t *testing.T) {
"worker1": newTestClient("worker1 kubeconfig", cancelCalled),
"worker2": newTestClient("worker2 kubeconfig", cancelCalled),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Generation(1).
Obj(),
},
@@ -259,9 +259,9 @@ func TestUpdateConfig(t *testing.T) {
},
"update client config, nowatch": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Generation(1).
Obj(),
},
@@ -274,9 +274,9 @@ func TestUpdateConfig(t *testing.T) {
wantRemoteClients: map[string]*remoteClient{
"worker1": setReconnectState(newTestClient("nowatch", nil), 1),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionFalse, "ClientConnectionFailed", "client cannot watch", 1).
Generation(1).
Obj(),
@@ -286,9 +286,9 @@ func TestUpdateConfig(t *testing.T) {
},
"update client config, nowatch 3rd try": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionFalse, "ClientConnectionFailed", "client cannot watch", 1).
Generation(1).
Obj(),
@@ -302,9 +302,9 @@ func TestUpdateConfig(t *testing.T) {
wantRemoteClients: map[string]*remoteClient{
"worker1": setReconnectState(newTestClient("nowatch", nil), 3),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionFalse, "ClientConnectionFailed", "client cannot watch", 1).
Generation(1).
Obj(),
@@ -314,9 +314,9 @@ func TestUpdateConfig(t *testing.T) {
},
"failed attempts are set to 0 on successful connection": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionFalse, "ClientConnectionFailed", "client cannot watch", 1).
Generation(1).
Obj(),
@@ -330,9 +330,9 @@ func TestUpdateConfig(t *testing.T) {
wantRemoteClients: map[string]*remoteClient{
"worker1": newTestClient("good config", nil),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionTrue, "Active", "Connected", 1).
Generation(1).
Obj(),
@@ -341,9 +341,9 @@ func TestUpdateConfig(t *testing.T) {
},
"failed attempts are set to 0 on config change": {
reconcileFor: "worker1",
- clusters: []kueuealpha.MultiKueueCluster{
+ clusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionFalse, "ClientConnectionFailed", "client cannot watch", 1).
Generation(1).
Obj(),
@@ -357,9 +357,9 @@ func TestUpdateConfig(t *testing.T) {
wantRemoteClients: map[string]*remoteClient{
"worker1": newTestClient("invalid", nil),
},
- wantClusters: []kueuealpha.MultiKueueCluster{
+ wantClusters: []kueue.MultiKueueCluster{
*utiltesting.MakeMultiKueueCluster("worker1").
- KubeConfig(kueuealpha.SecretLocationType, "worker1").
+ KubeConfig(kueue.SecretLocationType, "worker1").
Active(metav1.ConditionFalse, "ClientConnectionFailed", "invalid kubeconfig", 1).
Generation(1).
Obj(),
@@ -371,13 +371,14 @@ func TestUpdateConfig(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
builder, ctx := getClientBuilder()
- builder = builder.WithLists(&kueuealpha.MultiKueueClusterList{Items: tc.clusters})
+ builder = builder.WithLists(&kueue.MultiKueueClusterList{Items: tc.clusters})
builder = builder.WithLists(&corev1.SecretList{Items: tc.secrets})
- builder = builder.WithStatusSubresource(slices.Map(tc.clusters, func(c *kueuealpha.MultiKueueCluster) client.Object { return c })...)
+ builder = builder.WithStatusSubresource(slices.Map(tc.clusters, func(c *kueue.MultiKueueCluster) client.Object { return c })...)
c := builder.Build()
adapters, _ := jobframework.GetMultiKueueAdapters()
reconciler := newClustersReconciler(c, TestNamespace, 0, defaultOrigin, nil, adapters)
+ //nolint:fatcontext
reconciler.rootContext = ctx
if len(tc.remoteClients) > 0 {
@@ -399,7 +400,7 @@ func TestUpdateConfig(t *testing.T) {
t.Errorf("unexpected watch cancel call count want: %d, got: %d", tc.wantCancelCalled, cancelCalledCount)
}
- lst := &kueuealpha.MultiKueueClusterList{}
+ lst := &kueue.MultiKueueClusterList{}
gotErr = c.List(ctx, lst)
if gotErr != nil {
t.Errorf("unexpected list clusters error: %s", gotErr)
@@ -444,7 +445,7 @@ func TestRemoteClientGC(t *testing.T) {
},
workersWorkloads: []kueue.Workload{
*baseWlBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
managersJobs: []batchv1.Job{
@@ -457,7 +458,7 @@ func TestRemoteClientGC(t *testing.T) {
},
wantWorkersWorkloads: []kueue.Workload{
*baseWlBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
wantWorkersJobs: []batchv1.Job{
@@ -468,7 +469,7 @@ func TestRemoteClientGC(t *testing.T) {
"missing worker workloads are deleted": {
workersWorkloads: []kueue.Workload{
*baseWlBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
managersJobs: []batchv1.Job{
@@ -480,14 +481,14 @@ func TestRemoteClientGC(t *testing.T) {
workersWorkloads: []kueue.Workload{
*baseWlBuilder.Clone().
ControllerReference(batchv1.SchemeGroupVersion.WithKind("NptAJob"), "job1", "test-uuid").
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
},
"missing worker workloads and their owner jobs are deleted": {
workersWorkloads: []kueue.Workload{
*baseWlBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
managersJobs: []batchv1.Job{
@@ -502,7 +503,7 @@ func TestRemoteClientGC(t *testing.T) {
"unrelated workers and jobs are not deleted": {
workersWorkloads: []kueue.Workload{
*baseWlBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, "other-gc-key").
+ Label(kueue.MultiKueueOriginLabel, "other-gc-key").
Obj(),
},
workersJobs: []batchv1.Job{
@@ -511,7 +512,7 @@ func TestRemoteClientGC(t *testing.T) {
},
wantWorkersWorkloads: []kueue.Workload{
*baseWlBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, "other-gc-key").
+ Label(kueue.MultiKueueOriginLabel, "other-gc-key").
Obj(),
},
wantWorkersJobs: []batchv1.Job{
diff --git a/pkg/controller/admissionchecks/multikueue/workload.go b/pkg/controller/admissionchecks/multikueue/workload.go
index 0f360fd3149..1d3f5dd738f 100644
--- a/pkg/controller/admissionchecks/multikueue/workload.go
+++ b/pkg/controller/admissionchecks/multikueue/workload.go
@@ -36,7 +36,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/util/admissioncheck"
@@ -215,7 +214,7 @@ func (w *wlReconciler) updateACS(ctx context.Context, wl *kueue.Workload, acs *k
acs.LastTransitionTime = metav1.NewTime(time.Now())
wlPatch := workload.BaseSSAWorkload(wl)
workload.SetAdmissionCheckState(&wlPatch.Status.AdmissionChecks, *acs)
- return w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueuealpha.MultiKueueControllerName), client.ForceOwnership)
+ return w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueue.MultiKueueControllerName), client.ForceOwnership)
}
func (w *wlReconciler) remoteClientsForAC(ctx context.Context, acName string) (map[string]*remoteClient, error) {
@@ -239,7 +238,7 @@ func (w *wlReconciler) remoteClientsForAC(ctx context.Context, acName string) (m
}
func (w *wlReconciler) multikueueAC(ctx context.Context, local *kueue.Workload) (*kueue.AdmissionCheckState, error) {
- relevantChecks, err := admissioncheck.FilterForController(ctx, w.client, local.Status.AdmissionChecks, kueuealpha.MultiKueueControllerName)
+ relevantChecks, err := admissioncheck.FilterForController(ctx, w.client, local.Status.AdmissionChecks, kueue.MultiKueueControllerName)
if err != nil {
return nil, err
}
@@ -332,7 +331,7 @@ func (w *wlReconciler) reconcileGroup(ctx context.Context, group *wlGroup) (reco
Reason: remoteFinishedCond.Reason,
Message: remoteFinishedCond.Message,
})
- return reconcile.Result{}, w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueuealpha.MultiKueueControllerName+"-finish"), client.ForceOwnership)
+ return reconcile.Result{}, w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueue.MultiKueueControllerName+"-finish"), client.ForceOwnership)
}
// 2. delete all workloads that are out of sync or are not in the chosen worker
@@ -380,7 +379,7 @@ func (w *wlReconciler) reconcileGroup(ctx context.Context, group *wlGroup) (reco
wlPatch := workload.BaseSSAWorkload(group.local)
workload.SetAdmissionCheckState(&wlPatch.Status.AdmissionChecks, *acs)
- err := w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueuealpha.MultiKueueControllerName), client.ForceOwnership)
+ err := w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueue.MultiKueueControllerName), client.ForceOwnership)
if err != nil {
return reconcile.Result{}, err
}
@@ -399,7 +398,7 @@ func (w *wlReconciler) reconcileGroup(ctx context.Context, group *wlGroup) (reco
acs.LastTransitionTime = metav1.NewTime(time.Now())
wlPatch := workload.BaseSSAWorkload(group.local)
workload.SetAdmissionCheckState(&wlPatch.Status.AdmissionChecks, *acs)
- return reconcile.Result{}, w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueuealpha.MultiKueueControllerName), client.ForceOwnership)
+ return reconcile.Result{}, w.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(kueue.MultiKueueControllerName), client.ForceOwnership)
}
}
@@ -453,7 +452,7 @@ func newWlReconciler(c client.Client, helper *multiKueueStoreHelper, cRec *clust
func (w *wlReconciler) setupWithManager(mgr ctrl.Manager) error {
syncHndl := handler.Funcs{
- GenericFunc: func(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+ GenericFunc: func(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
q.AddAfter(reconcile.Request{NamespacedName: types.NamespacedName{
Namespace: e.Object.GetNamespace(),
Name: e.Object.GetName(),
@@ -462,8 +461,9 @@ func (w *wlReconciler) setupWithManager(mgr ctrl.Manager) error {
}
return ctrl.NewControllerManagedBy(mgr).
+ Named("multikueue-workload").
For(&kueue.Workload{}).
- WatchesRawSource(&source.Channel{Source: w.clusters.wlUpdateCh}, syncHndl).
+ WatchesRawSource(source.Channel(w.clusters.wlUpdateCh, syncHndl)).
WithEventFilter(w).
Complete(w)
}
@@ -474,7 +474,7 @@ func cloneForCreate(orig *kueue.Workload, origin string) *kueue.Workload {
if remoteWl.Labels == nil {
remoteWl.Labels = make(map[string]string)
}
- remoteWl.Labels[kueuealpha.MultiKueueOriginLabel] = origin
+ remoteWl.Labels[kueue.MultiKueueOriginLabel] = origin
orig.Spec.DeepCopyInto(&remoteWl.Spec)
return remoteWl
}
diff --git a/pkg/controller/admissionchecks/multikueue/workload_test.go b/pkg/controller/admissionchecks/multikueue/workload_test.go
index 12c0c5817e9..e02c4f9c311 100644
--- a/pkg/controller/admissionchecks/multikueue/workload_test.go
+++ b/pkg/controller/admissionchecks/multikueue/workload_test.go
@@ -33,7 +33,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
@@ -61,7 +60,7 @@ func TestWlReconcile(t *testing.T) {
baseWorkloadBuilder := utiltesting.MakeWorkload("wl1", TestNamespace)
baseJobBuilder := testingjob.MakeJob("job1", TestNamespace)
- baseJobManagedByKueueBuilder := baseJobBuilder.Clone().ManagedBy(kueuealpha.MultiKueueControllerName)
+ baseJobManagedByKueueBuilder := baseJobBuilder.Clone().ManagedBy(kueue.MultiKueueControllerName)
cases := map[string]struct {
reconcileFor string
@@ -105,14 +104,14 @@ func TestWlReconcile(t *testing.T) {
},
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
worker1Jobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
},
@@ -238,7 +237,7 @@ func TestWlReconcile(t *testing.T) {
},
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
wantManagersJobs: []batchv1.Job{*baseJobManagedByKueueBuilder.Clone().Obj()},
@@ -261,7 +260,7 @@ func TestWlReconcile(t *testing.T) {
},
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
wantManagersJobs: []batchv1.Job{*baseJobBuilder.Clone().Obj()},
@@ -295,7 +294,7 @@ func TestWlReconcile(t *testing.T) {
},
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
wantError: errFake,
@@ -312,7 +311,7 @@ func TestWlReconcile(t *testing.T) {
},
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
useSecondWorker: true,
@@ -327,13 +326,13 @@ func TestWlReconcile(t *testing.T) {
},
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
wantWorker2Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
},
@@ -402,7 +401,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
useSecondWorker: true,
@@ -428,14 +427,14 @@ func TestWlReconcile(t *testing.T) {
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
wantWorker1Jobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
},
@@ -457,7 +456,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
useSecondWorker: true,
@@ -483,14 +482,14 @@ func TestWlReconcile(t *testing.T) {
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
wantWorker1Jobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
Obj(),
},
},
@@ -521,7 +520,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
@@ -544,7 +543,7 @@ func TestWlReconcile(t *testing.T) {
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
@@ -583,7 +582,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
@@ -604,7 +603,7 @@ func TestWlReconcile(t *testing.T) {
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
@@ -642,7 +641,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Condition(metav1.Condition{Type: kueue.WorkloadFinished, Status: metav1.ConditionTrue, Reason: "ByTest", Message: "by test"}).
Obj(),
@@ -667,7 +666,7 @@ func TestWlReconcile(t *testing.T) {
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Condition(metav1.Condition{Type: kueue.WorkloadFinished, Status: metav1.ConditionTrue, Reason: "ByTest", Message: "by test"}).
Obj(),
@@ -707,7 +706,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Condition(metav1.Condition{Type: kueue.WorkloadFinished, Status: metav1.ConditionTrue, Reason: "ByTest", Message: "by test"}).
Obj(),
@@ -732,7 +731,7 @@ func TestWlReconcile(t *testing.T) {
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Condition(metav1.Condition{Type: kueue.WorkloadFinished, Status: metav1.ConditionTrue, Reason: "ByTest", Message: "by test"}).
Obj(),
@@ -774,7 +773,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Condition(metav1.Condition{Type: kueue.WorkloadFinished, Status: metav1.ConditionTrue, Reason: "ByTest", Message: "by test"}).
Obj(),
@@ -906,7 +905,7 @@ func TestWlReconcile(t *testing.T) {
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
@@ -935,7 +934,7 @@ func TestWlReconcile(t *testing.T) {
},
worker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
QuotaReservedTime(time.Now().Add(-time.Hour)). // one hour ago
Obj(),
@@ -948,7 +947,7 @@ func TestWlReconcile(t *testing.T) {
useSecondWorker: true,
worker2Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
QuotaReservedTime(time.Now().Add(-time.Minute)). // one minute ago
Obj(),
@@ -974,7 +973,7 @@ func TestWlReconcile(t *testing.T) {
},
wantWorker1Workloads: []kueue.Workload{
*baseWorkloadBuilder.Clone().
- Label(kueuealpha.MultiKueueOriginLabel, defaultOrigin).
+ Label(kueue.MultiKueueOriginLabel, defaultOrigin).
ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
Obj(),
},
@@ -988,7 +987,7 @@ func TestWlReconcile(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
- defer features.SetFeatureGateDuringTest(t, features.MultiKueueBatchJobWithManagedBy, !tc.withoutJobManagedBy)()
+ features.SetFeatureGateDuringTest(t, features.MultiKueueBatchJobWithManagedBy, !tc.withoutJobManagedBy)
managerBuilder, ctx := getClientBuilder()
managerBuilder = managerBuilder.WithInterceptorFuncs(interceptor.Funcs{SubResourcePatch: utiltesting.TreatSSAAsStrategicMerge})
@@ -1001,8 +1000,8 @@ func TestWlReconcile(t *testing.T) {
managerBuilder = managerBuilder.WithStatusSubresource(slices.Map(tc.managersJobs, func(w *batchv1.Job) client.Object { return w })...)
managerBuilder = managerBuilder.WithObjects(
utiltesting.MakeMultiKueueConfig("config1").Clusters(workerClusters...).Obj(),
- utiltesting.MakeAdmissionCheck("ac1").ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "config1").
+ utiltesting.MakeAdmissionCheck("ac1").ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "config1").
Obj(),
)
diff --git a/pkg/controller/admissionchecks/provisioning/controller.go b/pkg/controller/admissionchecks/provisioning/controller.go
index 056409b20fb..2abf529ad4c 100644
--- a/pkg/controller/admissionchecks/provisioning/controller.go
+++ b/pkg/controller/admissionchecks/provisioning/controller.go
@@ -237,7 +237,8 @@ func (c *Controller) syncOwnedProvisionRequest(ctx context.Context, wl *kueue.Wo
if !c.reqIsNeeded(wl, prc) {
continue
}
- if ac := workload.FindAdmissionCheck(wl.Status.AdmissionChecks, checkName); ac != nil && ac.State == kueue.CheckStateReady {
+ ac := workload.FindAdmissionCheck(wl.Status.AdmissionChecks, checkName)
+ if ac != nil && ac.State == kueue.CheckStateReady {
log.V(2).Info("Skip syncing of the ProvReq for admission check which is Ready", "workload", klog.KObj(wl), "admissionCheck", checkName)
continue
}
@@ -302,6 +303,11 @@ func (c *Controller) syncOwnedProvisionRequest(ctx context.Context, wl *kueue.Wo
}
if err := c.client.Create(ctx, req); err != nil {
+ msg := fmt.Sprintf("Error creating ProvisioningRequest %q: %v", requestName, err)
+ ac.Message = api.TruncateConditionMessage(msg)
+ workload.SetAdmissionCheckState(&wl.Status.AdmissionChecks, *ac)
+
+ c.record.Eventf(wl, corev1.EventTypeWarning, "FailedCreate", api.TruncateEventMessage(msg))
return nil, err
}
c.record.Eventf(wl, corev1.EventTypeNormal, "ProvisioningRequestCreated", "Created ProvisioningRequest: %q", req.Name)
@@ -613,7 +619,7 @@ type acHandler struct {
var _ handler.EventHandler = (*acHandler)(nil)
-func (a *acHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.RateLimitingInterface) {
+func (a *acHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
ac, isAc := event.Object.(*kueue.AdmissionCheck)
if !isAc {
return
@@ -627,7 +633,7 @@ func (a *acHandler) Create(ctx context.Context, event event.CreateEvent, q workq
}
}
-func (a *acHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.RateLimitingInterface) {
+func (a *acHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
oldAc, isOldAc := event.ObjectOld.(*kueue.AdmissionCheck)
newAc, isNewAc := event.ObjectNew.(*kueue.AdmissionCheck)
if !isNewAc || !isOldAc {
@@ -642,7 +648,7 @@ func (a *acHandler) Update(ctx context.Context, event event.UpdateEvent, q workq
}
}
-func (a *acHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.RateLimitingInterface) {
+func (a *acHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
ac, isAc := event.Object.(*kueue.AdmissionCheck)
if !isAc {
return
@@ -656,11 +662,11 @@ func (a *acHandler) Delete(ctx context.Context, event event.DeleteEvent, q workq
}
}
-func (a *acHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) {
+func (a *acHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
// nothing to do for now
}
-func (a *acHandler) reconcileWorkloadsUsing(ctx context.Context, check string, q workqueue.RateLimitingInterface) error {
+func (a *acHandler) reconcileWorkloadsUsing(ctx context.Context, check string, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error {
list := &kueue.WorkloadList{}
if err := a.client.List(ctx, list, client.MatchingFields{WorkloadsWithAdmissionCheckKey: check}); client.IgnoreNotFound(err) != nil {
return err
@@ -682,12 +688,12 @@ func (a *acHandler) reconcileWorkloadsUsing(ctx context.Context, check string, q
type prcHandler struct {
client client.Client
- acHandlerOverride func(ctx context.Context, config string, q workqueue.RateLimitingInterface) error
+ acHandlerOverride func(ctx context.Context, config string, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error
}
var _ handler.EventHandler = (*prcHandler)(nil)
-func (p *prcHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.RateLimitingInterface) {
+func (p *prcHandler) Create(ctx context.Context, event event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
prc, isPRC := event.Object.(*kueue.ProvisioningRequestConfig)
if !isPRC {
return
@@ -698,7 +704,7 @@ func (p *prcHandler) Create(ctx context.Context, event event.CreateEvent, q work
}
}
-func (p *prcHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.RateLimitingInterface) {
+func (p *prcHandler) Update(ctx context.Context, event event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
oldPRC, isOldPRC := event.ObjectOld.(*kueue.ProvisioningRequestConfig)
newPRC, isNewPRC := event.ObjectNew.(*kueue.ProvisioningRequestConfig)
if !isNewPRC || !isOldPRC {
@@ -713,7 +719,7 @@ func (p *prcHandler) Update(ctx context.Context, event event.UpdateEvent, q work
}
}
-func (p *prcHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.RateLimitingInterface) {
+func (p *prcHandler) Delete(ctx context.Context, event event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
prc, isPRC := event.Object.(*kueue.ProvisioningRequestConfig)
if !isPRC {
return
@@ -724,11 +730,11 @@ func (p *prcHandler) Delete(ctx context.Context, event event.DeleteEvent, q work
}
}
-func (p *prcHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) {
+func (p *prcHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
// nothing to do for now
}
-func (p *prcHandler) reconcileWorkloadsUsing(ctx context.Context, config string, q workqueue.RateLimitingInterface) error {
+func (p *prcHandler) reconcileWorkloadsUsing(ctx context.Context, config string, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error {
list := &kueue.AdmissionCheckList{}
if err := p.client.List(ctx, list, client.MatchingFields{AdmissionCheckUsingConfigKey: config}); client.IgnoreNotFound(err) != nil {
return err
@@ -760,6 +766,7 @@ func (c *Controller) SetupWithManager(mgr ctrl.Manager) error {
acHandlerOverride: ach.reconcileWorkloadsUsing,
}
err := ctrl.NewControllerManagedBy(mgr).
+ Named("provisioning-workload").
For(&kueue.Workload{}).
Owns(&autoscaling.ProvisioningRequest{}).
Watches(&kueue.AdmissionCheck{}, ach).
@@ -778,6 +785,7 @@ func (c *Controller) SetupWithManager(mgr ctrl.Manager) error {
}
return ctrl.NewControllerManagedBy(mgr).
+ Named("provisioning-admissioncheck").
For(&kueue.AdmissionCheck{}).
Watches(&kueue.ProvisioningRequestConfig{}, prcACh).
Complete(acReconciler)
diff --git a/pkg/controller/admissionchecks/provisioning/controller_test.go b/pkg/controller/admissionchecks/provisioning/controller_test.go
index 070c1ac3b47..2e44260615f 100644
--- a/pkg/controller/admissionchecks/provisioning/controller_test.go
+++ b/pkg/controller/admissionchecks/provisioning/controller_test.go
@@ -17,6 +17,8 @@ limitations under the License.
package provisioning
import (
+ "context"
+ "errors"
"testing"
"time"
@@ -40,6 +42,8 @@ import (
"sigs.k8s.io/kueue/pkg/workload"
)
+var errInvalidProvisioningRequest = errors.New("invalid ProvisioningRequest error")
+
var (
wlCmpOptions = []cmp.Option{
cmpopts.EquateEmpty(),
@@ -1171,6 +1175,29 @@ func TestReconcile(t *testing.T) {
Obj(),
},
},
+ "when invalid provisioning request": {
+ workload: utiltesting.MakeWorkload("wl", TestNamespace).
+ Annotations(map[string]string{
+ "provreq.kueue.x-k8s.io/ValidUntilSeconds": "0",
+ "invalid-provreq-prefix/Foo1": "Bar1",
+ "another-invalid-provreq-prefix/Foo2": "Bar2"}).
+ AdmissionChecks(kueue.AdmissionCheckState{
+ Name: "check1",
+ State: kueue.CheckStatePending}).
+ ReserveQuota(utiltesting.MakeAdmission("q1").Obj()).
+ Obj(),
+ checks: []kueue.AdmissionCheck{*baseCheck.DeepCopy()},
+ configs: []kueue.ProvisioningRequestConfig{{ObjectMeta: metav1.ObjectMeta{Name: "config1"}}},
+ wantReconcileError: errInvalidProvisioningRequest,
+ wantEvents: []utiltesting.EventRecord{
+ {
+ Key: client.ObjectKeyFromObject(baseWorkload),
+ EventType: corev1.EventTypeWarning,
+ Reason: "FailedCreate",
+ Message: `Error creating ProvisioningRequest "wl-check1-1": invalid ProvisioningRequest error`,
+ },
+ },
+ },
}
for name, tc := range cases {
@@ -1178,6 +1205,14 @@ func TestReconcile(t *testing.T) {
builder, ctx := getClientBuilder()
builder = builder.WithInterceptorFuncs(interceptor.Funcs{SubResourcePatch: utiltesting.TreatSSAAsStrategicMerge})
+ if tc.wantReconcileError != nil {
+ builder = builder.WithInterceptorFuncs(
+ interceptor.Funcs{
+ Create: func(ctx context.Context, client client.WithWatch, obj client.Object, opts ...client.CreateOption) error {
+ return tc.wantReconcileError
+ }})
+ }
+
builder = builder.WithObjects(tc.workload)
builder = builder.WithStatusSubresource(tc.workload)
@@ -1207,7 +1242,7 @@ func TestReconcile(t *testing.T) {
},
}
_, gotReconcileError := controller.Reconcile(ctx, req)
- if diff := cmp.Diff(tc.wantReconcileError, gotReconcileError); diff != "" {
+ if diff := cmp.Diff(tc.wantReconcileError, gotReconcileError, cmpopts.EquateErrors()); diff != "" {
t.Errorf("unexpected reconcile error (-want/+got):\n%s", diff)
}
diff --git a/pkg/controller/core/admissioncheck_controller.go b/pkg/controller/core/admissioncheck_controller.go
index 67c81d8f323..20c03fa69bb 100644
--- a/pkg/controller/core/admissioncheck_controller.go
+++ b/pkg/controller/core/admissioncheck_controller.go
@@ -190,16 +190,16 @@ type acCqHandler struct {
cache *cache.Cache
}
-func (h *acCqHandler) Create(context.Context, event.CreateEvent, workqueue.RateLimitingInterface) {
+func (h *acCqHandler) Create(context.Context, event.CreateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *acCqHandler) Update(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
+func (h *acCqHandler) Update(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *acCqHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *acCqHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *acCqHandler) Generic(ctx context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (h *acCqHandler) Generic(ctx context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
cq := e.Object.(*kueue.ClusterQueue)
log := log.FromContext(ctx).WithValues("clusterQueue", klog.KObj(cq))
log.V(6).Info("Cluster queue generic event")
@@ -224,7 +224,7 @@ func (r *AdmissionCheckReconciler) SetupWithManager(mgr ctrl.Manager, cfg *confi
return ctrl.NewControllerManagedBy(mgr).
For(&kueue.AdmissionCheck{}).
WithOptions(controller.Options{NeedLeaderElection: ptr.To(false)}).
- WatchesRawSource(&source.Channel{Source: r.cqUpdateCh}, &handler).
+ WatchesRawSource(source.Channel(r.cqUpdateCh, &handler)).
WithEventFilter(r).
Complete(WithLeadingManager(mgr, r, &kueue.AdmissionCheck{}, cfg))
}
diff --git a/pkg/controller/core/clusterqueue_controller.go b/pkg/controller/core/clusterqueue_controller.go
index afdf5701331..719f4caceda 100644
--- a/pkg/controller/core/clusterqueue_controller.go
+++ b/pkg/controller/core/clusterqueue_controller.go
@@ -63,7 +63,7 @@ type ClusterQueueReconciler struct {
log logr.Logger
qManager *queue.Manager
cache *cache.Cache
- snapshotsQueue workqueue.Interface
+ snapshotsQueue workqueue.TypedInterface[string]
wlUpdateCh chan event.GenericEvent
rfUpdateCh chan event.GenericEvent
acUpdateCh chan event.GenericEvent
@@ -137,7 +137,7 @@ func NewClusterQueueReconciler(
log: ctrl.Log.WithName("cluster-queue-reconciler"),
qManager: qMgr,
cache: cache,
- snapshotsQueue: workqueue.New(),
+ snapshotsQueue: workqueue.NewTyped[string](),
wlUpdateCh: make(chan event.GenericEvent, updateChBuffer),
rfUpdateCh: make(chan event.GenericEvent, updateChBuffer),
acUpdateCh: make(chan event.GenericEvent, updateChBuffer),
@@ -452,16 +452,16 @@ type cqWorkloadHandler struct {
qManager *queue.Manager
}
-func (h *cqWorkloadHandler) Create(context.Context, event.CreateEvent, workqueue.RateLimitingInterface) {
+func (h *cqWorkloadHandler) Create(context.Context, event.CreateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqWorkloadHandler) Update(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
+func (h *cqWorkloadHandler) Update(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqWorkloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *cqWorkloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqWorkloadHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (h *cqWorkloadHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
w := e.Object.(*kueue.Workload)
req := h.requestForWorkloadClusterQueue(w)
if req != nil {
@@ -493,10 +493,10 @@ type cqNamespaceHandler struct {
cache *cache.Cache
}
-func (h *cqNamespaceHandler) Create(_ context.Context, _ event.CreateEvent, _ workqueue.RateLimitingInterface) {
+func (h *cqNamespaceHandler) Create(_ context.Context, _ event.CreateEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqNamespaceHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) {
+func (h *cqNamespaceHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
oldNs := e.ObjectOld.(*corev1.Namespace)
oldMatchingCqs := h.cache.MatchingClusterQueues(oldNs.Labels)
newNs := e.ObjectNew.(*corev1.Namespace)
@@ -510,26 +510,26 @@ func (h *cqNamespaceHandler) Update(ctx context.Context, e event.UpdateEvent, _
h.qManager.QueueInadmissibleWorkloads(ctx, cqs)
}
-func (h *cqNamespaceHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *cqNamespaceHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqNamespaceHandler) Generic(context.Context, event.GenericEvent, workqueue.RateLimitingInterface) {
+func (h *cqNamespaceHandler) Generic(context.Context, event.GenericEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
type cqResourceFlavorHandler struct {
cache *cache.Cache
}
-func (h *cqResourceFlavorHandler) Create(context.Context, event.CreateEvent, workqueue.RateLimitingInterface) {
+func (h *cqResourceFlavorHandler) Create(context.Context, event.CreateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqResourceFlavorHandler) Update(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
+func (h *cqResourceFlavorHandler) Update(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqResourceFlavorHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *cqResourceFlavorHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqResourceFlavorHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (h *cqResourceFlavorHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
rf, ok := e.Object.(*kueue.ResourceFlavor)
if !ok {
return
@@ -554,16 +554,16 @@ type cqSnapshotHandler struct {
queueVisibilityUpdateInterval time.Duration
}
-func (h *cqAdmissionCheckHandler) Create(context.Context, event.CreateEvent, workqueue.RateLimitingInterface) {
+func (h *cqAdmissionCheckHandler) Create(context.Context, event.CreateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqAdmissionCheckHandler) Update(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
+func (h *cqAdmissionCheckHandler) Update(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqAdmissionCheckHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *cqAdmissionCheckHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqAdmissionCheckHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (h *cqAdmissionCheckHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
ac, isAc := e.Object.(*kueue.AdmissionCheck)
if !isAc {
return
@@ -580,16 +580,16 @@ func (h *cqAdmissionCheckHandler) Generic(_ context.Context, e event.GenericEven
}
}
-func (h *cqSnapshotHandler) Create(context.Context, event.CreateEvent, workqueue.RateLimitingInterface) {
+func (h *cqSnapshotHandler) Create(context.Context, event.CreateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqSnapshotHandler) Update(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
+func (h *cqSnapshotHandler) Update(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqSnapshotHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *cqSnapshotHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqSnapshotHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (h *cqSnapshotHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
cq, isCq := e.Object.(*kueue.ClusterQueue)
if !isCq {
return
@@ -629,10 +629,10 @@ func (r *ClusterQueueReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.
For(&kueue.ClusterQueue{}).
WithOptions(controller.Options{NeedLeaderElection: ptr.To(false)}).
Watches(&corev1.Namespace{}, &nsHandler).
- WatchesRawSource(&source.Channel{Source: r.wlUpdateCh}, &wHandler).
- WatchesRawSource(&source.Channel{Source: r.rfUpdateCh}, &rfHandler).
- WatchesRawSource(&source.Channel{Source: r.acUpdateCh}, &acHandler).
- WatchesRawSource(&source.Channel{Source: r.snapUpdateCh}, &snapHandler).
+ WatchesRawSource(source.Channel(r.wlUpdateCh, &wHandler)).
+ WatchesRawSource(source.Channel(r.rfUpdateCh, &rfHandler)).
+ WatchesRawSource(source.Channel(r.acUpdateCh, &acHandler)).
+ WatchesRawSource(source.Channel(r.snapUpdateCh, &snapHandler)).
WithEventFilter(r).
Complete(WithLeadingManager(mgr, r, &kueue.ClusterQueue{}, cfg))
}
@@ -739,19 +739,18 @@ func (r *ClusterQueueReconciler) takeSnapshot(ctx context.Context) {
func (r *ClusterQueueReconciler) processNextSnapshot(ctx context.Context) bool {
log := ctrl.LoggerFrom(ctx).WithName("processNextSnapshot")
- key, quit := r.snapshotsQueue.Get()
+ cqName, quit := r.snapshotsQueue.Get()
if quit {
return false
}
startTime := time.Now()
defer func() {
- log.V(5).Info("Finished snapshot job", "key", key, "elapsed", time.Since(startTime))
+ log.V(5).Info("Finished snapshot job", "clusterQueue", klog.KRef("", cqName), "elapsed", time.Since(startTime))
}()
- defer r.snapshotsQueue.Done(key)
+ defer r.snapshotsQueue.Done(cqName)
- cqName := key.(string)
if r.qManager.UpdateSnapshot(cqName, r.queueVisibilityClusterQueuesMaxCount) {
log.V(5).Info("Triggering CQ update due to snapshot change", "clusterQueue", klog.KRef("", cqName))
r.snapUpdateCh <- event.GenericEvent{Object: &kueue.ClusterQueue{
diff --git a/pkg/controller/core/clusterqueue_controller_test.go b/pkg/controller/core/clusterqueue_controller_test.go
index 56311d8426f..e13d149d037 100644
--- a/pkg/controller/core/clusterqueue_controller_test.go
+++ b/pkg/controller/core/clusterqueue_controller_test.go
@@ -559,8 +559,9 @@ func TestClusterQueuePendingWorkloadsStatus(t *testing.T) {
},
}
for name, tc := range testCases {
- defer features.SetFeatureGateDuringTest(t, features.QueueVisibility, tc.enableQueueVisibility)()
t.Run(name, func(t *testing.T) {
+ features.SetFeatureGateDuringTest(t, features.QueueVisibility, tc.enableQueueVisibility)
+
cq := utiltesting.MakeClusterQueue(cqName).
QueueingStrategy(kueue.StrictFIFO).Obj()
lq := utiltesting.MakeLocalQueue(lqName, "").
diff --git a/pkg/controller/core/cohort_controller.go b/pkg/controller/core/cohort_controller.go
new file mode 100644
index 00000000000..168afb03f6a
--- /dev/null
+++ b/pkg/controller/core/cohort_controller.go
@@ -0,0 +1,112 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package core
+
+import (
+ "context"
+
+ "github.com/go-logr/logr"
+ "k8s.io/apimachinery/pkg/api/equality"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/klog/v2"
+ "k8s.io/utils/ptr"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/controller"
+ "sigs.k8s.io/controller-runtime/pkg/event"
+
+ config "sigs.k8s.io/kueue/apis/config/v1beta1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ "sigs.k8s.io/kueue/pkg/cache"
+ "sigs.k8s.io/kueue/pkg/queue"
+)
+
+// CohortReconciler is responsible for synchronizing the in-memory
+// representation of Cohorts in cache.Cache and queue.Manager with
+// Cohort Kubernetes objects.
+type CohortReconciler struct {
+ client client.Client
+ log logr.Logger
+ cache *cache.Cache
+ qManager *queue.Manager
+}
+
+func NewCohortReconciler(client client.Client, cache *cache.Cache, qManager *queue.Manager) CohortReconciler {
+ return CohortReconciler{client, ctrl.Log.WithName("cohort-reconciler"), cache, qManager}
+}
+
+func (r *CohortReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Configuration) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&kueue.Cohort{}).
+ WithOptions(controller.Options{NeedLeaderElection: ptr.To(false)}).
+ WithEventFilter(r).
+ Complete(WithLeadingManager(mgr, r, &kueue.Cohort{}, cfg))
+}
+
+func (r *CohortReconciler) Create(e event.CreateEvent) bool {
+ return true
+}
+
+func (r *CohortReconciler) Update(e event.UpdateEvent) bool {
+ oldCohort, ok := e.ObjectOld.(*kueue.Cohort)
+ if !ok {
+ return false
+ }
+ newCohort, ok := e.ObjectNew.(*kueue.Cohort)
+ if !ok {
+ return false
+ }
+ log := r.log.WithValues("cohort", klog.KObj(newCohort))
+ if equality.Semantic.DeepEqual(oldCohort.Spec.ResourceGroups, newCohort.Spec.ResourceGroups) &&
+ oldCohort.Spec.Parent == newCohort.Spec.Parent {
+ log.V(2).Info("Skip Cohort update event as Cohort unchanged")
+ return false
+ }
+ log.V(2).Info("Processing Cohort update event")
+ return true
+}
+
+func (r *CohortReconciler) Delete(e event.DeleteEvent) bool {
+ return true
+}
+
+func (r *CohortReconciler) Generic(e event.GenericEvent) bool {
+ return true
+}
+
+//+kubebuilder:rbac:groups=kueue.x-k8s.io,resources=cohorts,verbs=get;list;watch;create;update;patch;delete
+
+func (r *CohortReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ log := ctrl.LoggerFrom(ctx).WithValues("cohort", req.Name)
+ log.V(2).Info("Reconciling Cohort")
+ var cohort kueue.Cohort
+ if err := r.client.Get(ctx, req.NamespacedName, &cohort); err != nil {
+ if apierrors.IsNotFound(err) {
+ log.V(2).Info("Cohort is being deleted")
+ r.cache.DeleteCohort(req.NamespacedName.Name)
+ r.qManager.DeleteCohort(req.NamespacedName.Name)
+ }
+ return ctrl.Result{}, client.IgnoreNotFound(err)
+ }
+
+ log.V(2).Info("Cohort is being created or updated", "resources", cohort.Spec.ResourceGroups)
+ if err := r.cache.AddOrUpdateCohort(&cohort); err != nil {
+ log.V(2).Error(err, "Error adding or updating cohort in the cache")
+ }
+ r.qManager.AddOrUpdateCohort(ctx, &cohort)
+ return ctrl.Result{}, nil
+}
diff --git a/pkg/controller/core/cohort_controller_test.go b/pkg/controller/core/cohort_controller_test.go
new file mode 100644
index 00000000000..825653ffcab
--- /dev/null
+++ b/pkg/controller/core/cohort_controller_test.go
@@ -0,0 +1,326 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package core
+
+import (
+ "context"
+ "errors"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/client/interceptor"
+ "sigs.k8s.io/controller-runtime/pkg/event"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ "sigs.k8s.io/kueue/pkg/cache"
+ "sigs.k8s.io/kueue/pkg/queue"
+ "sigs.k8s.io/kueue/pkg/resources"
+ utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
+)
+
+func TestCohortReconcileCohortNotFoundDelete(t *testing.T) {
+ cl := utiltesting.NewClientBuilder().Build()
+ ctx := context.Background()
+ cache := cache.New(cl)
+ qManager := queue.NewManager(cl, cache)
+ reconciler := NewCohortReconciler(cl, cache, qManager)
+
+ cohort := utiltesting.MakeCohort("cohort").Obj()
+ _ = cache.AddOrUpdateCohort(cohort)
+ qManager.AddOrUpdateCohort(ctx, cohort)
+ if _, ok := cache.Snapshot().Cohorts["cohort"]; !ok {
+ t.Fatal("expected Cohort in snapshot")
+ }
+
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohort)},
+ ); err != nil {
+ t.Fatal("unexpected error")
+ }
+
+ if _, ok := cache.Snapshot().Cohorts["cohort"]; ok {
+ t.Fatal("unexpected Cohort in snapshot")
+ }
+}
+
+func TestCohortReconcileCohortNotFoundIdempotentDelete(t *testing.T) {
+ cl := utiltesting.NewClientBuilder().
+ Build()
+ ctx := context.Background()
+ cache := cache.New(cl)
+ qManager := queue.NewManager(cl, cache)
+ reconciler := NewCohortReconciler(cl, cache, qManager)
+
+ if _, ok := cache.Snapshot().Cohorts["cohort"]; ok {
+ t.Fatal("unexpected Cohort in snapshot")
+ }
+
+ cohort := utiltesting.MakeCohort("cohort").Obj()
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohort)},
+ ); err != nil {
+ t.Fatal("unexpected error")
+ }
+
+ if _, ok := cache.Snapshot().Cohorts["cohort"]; ok {
+ t.Fatal("unexpected Cohort in snapshot")
+ }
+}
+
+func TestCohortReconcileCycleNoError(t *testing.T) {
+ cohortA := utiltesting.MakeCohort("cohort-a").Parent("cohort-b").Obj()
+ cohortB := utiltesting.MakeCohort("cohort-b").Parent("cohort-a").Obj()
+ cl := utiltesting.NewClientBuilder().
+ WithObjects(cohortA, cohortB).
+ Build()
+ ctx := context.Background()
+ cache := cache.New(cl)
+ qManager := queue.NewManager(cl, cache)
+ reconciler := NewCohortReconciler(cl, cache, qManager)
+
+ // no cycle when creating first cohort
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohortA)},
+ ); err != nil {
+ t.Fatal("unexpected error")
+ }
+
+ // cycle added, no error
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohortB)},
+ ); err != nil {
+ t.Fatal("unexpected error when adding cycle", err)
+ }
+
+ // remove cycle, no error
+ if err := cl.Get(ctx, client.ObjectKeyFromObject(cohortB), cohortB); err != nil {
+ t.Fatal("unexpected error")
+ }
+ cohortB.Spec.Parent = "cohort-c"
+ if err := cl.Update(ctx, cohortB); err != nil {
+ t.Fatal("unexpected error updating cohort", err)
+ }
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohortB)},
+ ); err != nil {
+ t.Fatal("unexpected error")
+ }
+}
+
+func TestCohortReconcileErrorOtherThanNotFoundNotDeleted(t *testing.T) {
+ ctx := context.Background()
+ funcs := interceptor.Funcs{
+ Get: func(ctx context.Context, client client.WithWatch, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error {
+ return errors.New("error")
+ },
+ }
+ cl := utiltesting.NewClientBuilder().WithInterceptorFuncs(funcs).Build()
+
+ cache := cache.New(cl)
+ qManager := queue.NewManager(cl, cache)
+ reconciler := NewCohortReconciler(cl, cache, qManager)
+ cohort := utiltesting.MakeCohort("cohort").Obj()
+ _ = cache.AddOrUpdateCohort(cohort)
+ qManager.AddOrUpdateCohort(ctx, cohort)
+ if _, ok := cache.Snapshot().Cohorts["cohort"]; !ok {
+ t.Fatal("expected Cohort in snapshot")
+ }
+
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohort)},
+ ); err == nil {
+ t.Fatal("expected error")
+ }
+
+ if _, ok := cache.Snapshot().Cohorts["cohort"]; !ok {
+ t.Fatal("expected Cohort in snapshot")
+ }
+}
+
+func TestCohortReconcileLifecycle(t *testing.T) {
+ ctx := context.Background()
+ cohort := utiltesting.MakeCohort("cohort").ResourceGroup(
+ utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").FlavorQuotas,
+ ).Obj()
+ cl := utiltesting.NewClientBuilder().WithObjects(cohort).Build()
+ cache := cache.New(cl)
+ qManager := queue.NewManager(cl, cache)
+ reconciler := NewCohortReconciler(cl, cache, qManager)
+
+ // create
+ {
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohort)},
+ ); err != nil {
+ t.Fatal("unexpected error")
+ }
+
+ cohortSnap, ok := cache.Snapshot().Cohorts["cohort"]
+ if !ok {
+ t.Fatal("expected Cohort in snapshot")
+ }
+
+ wantQuotas := resources.FlavorResourceQuantities{
+ {Flavor: "red", Resource: "cpu"}: 10_000,
+ }
+ if diff := cmp.Diff(wantQuotas, cohortSnap.ResourceNode.SubtreeQuota); diff != "" {
+ t.Fatalf("unexpected quota (-want +got) %s", diff)
+ }
+ }
+
+ // update
+ {
+ if err := cl.Get(ctx, client.ObjectKeyFromObject(cohort), cohort); err != nil {
+ t.Fatal("unexpected error")
+ }
+ cohort.Spec.ResourceGroups[0] = utiltesting.ResourceGroup(
+ utiltesting.MakeFlavorQuotas("red").Resource("cpu", "5").FlavorQuotas,
+ )
+ if err := cl.Update(ctx, cohort); err != nil {
+ t.Fatal("unexpected error updating cohort", err)
+ }
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohort)},
+ ); err != nil {
+ t.Fatal("unexpected error")
+ }
+
+ cohortSnap, ok := cache.Snapshot().Cohorts["cohort"]
+ if !ok {
+ t.Fatal("expected Cohort in snapshot")
+ }
+
+ wantQuotas := resources.FlavorResourceQuantities{
+ {Flavor: "red", Resource: "cpu"}: 5_000,
+ }
+ if diff := cmp.Diff(wantQuotas, cohortSnap.ResourceNode.SubtreeQuota); diff != "" {
+ t.Fatalf("unexpected quota (-want +got) %s", diff)
+ }
+ }
+
+ // delete
+ {
+ if err := cl.Delete(ctx, cohort); err != nil {
+ t.Fatal("unexpected error during deletion")
+ }
+ if _, err := reconciler.Reconcile(
+ ctx,
+ reconcile.Request{NamespacedName: client.ObjectKeyFromObject(cohort)},
+ ); err != nil {
+ t.Fatal("unexpected error")
+ }
+
+ if _, ok := cache.Snapshot().Cohorts["cohort"]; ok {
+ t.Fatal("unexpected Cohort in snapshot")
+ }
+ }
+}
+
+func TestCohortReconcilerFilters(t *testing.T) {
+ cl := utiltesting.NewClientBuilder().
+ Build()
+ cache := cache.New(cl)
+ qManager := queue.NewManager(cl, cache)
+ reconciler := NewCohortReconciler(cl, cache, qManager)
+
+ t.Run("delete returns true", func(t *testing.T) {
+ if !reconciler.Delete(event.DeleteEvent{}) {
+ t.Fatal("expected delete to return true")
+ }
+ })
+
+ t.Run("create returns true", func(t *testing.T) {
+ if !reconciler.Create(event.CreateEvent{}) {
+ t.Fatal("expected create to return true")
+ }
+ })
+
+ t.Run("generic returns true", func(t *testing.T) {
+ if !reconciler.Generic(event.GenericEvent{}) {
+ t.Fatal("expected generic to return true")
+ }
+ })
+
+ cases := map[string]struct {
+ old client.Object
+ new client.Object
+ want bool
+ }{
+ "old wrong type returns false": {
+ old: utiltesting.MakeClusterQueue("cq").Obj(),
+ new: utiltesting.MakeCohort("cohort").Obj(),
+ want: false,
+ },
+ "new wrong type returns false": {
+ old: utiltesting.MakeCohort("cohort").Obj(),
+ new: utiltesting.MakeClusterQueue("cq").Obj(),
+ want: false,
+ },
+ "unchanged returns false": {
+ old: utiltesting.MakeCohort("cohort").ResourceGroup(
+ utiltesting.MakeFlavorQuotas("red").Resource("cpu", "5").FlavorQuotas,
+ ).Obj(),
+ new: utiltesting.MakeCohort("cohort").ResourceGroup(
+ utiltesting.MakeFlavorQuotas("red").Resource("cpu", "5").FlavorQuotas,
+ ).Obj(),
+ want: false,
+ },
+ "changed resource returns true": {
+ old: utiltesting.MakeCohort("cohort").ResourceGroup(
+ utiltesting.MakeFlavorQuotas("red").Resource("cpu", "5").FlavorQuotas,
+ ).Obj(),
+ new: utiltesting.MakeCohort("cohort").ResourceGroup(
+ utiltesting.MakeFlavorQuotas("red").Resource("cpu", "10").FlavorQuotas,
+ ).Obj(),
+ want: true,
+ },
+ "adding parent returns true": {
+ old: utiltesting.MakeCohort("cohort").Obj(),
+ new: utiltesting.MakeCohort("cohort").Parent("parent").Obj(),
+ want: true,
+ },
+ "changing parent returns true": {
+ old: utiltesting.MakeCohort("cohort").Parent("old").Obj(),
+ new: utiltesting.MakeCohort("cohort").Parent("new").Obj(),
+ want: true,
+ },
+ "deleting parent returns true": {
+ old: utiltesting.MakeCohort("cohort").Parent("parent").Obj(),
+ new: utiltesting.MakeCohort("cohort").Obj(),
+ want: true,
+ },
+ }
+ for name, tc := range cases {
+ t.Run(name, func(t *testing.T) {
+ event := event.UpdateEvent{
+ ObjectOld: tc.old,
+ ObjectNew: tc.new,
+ }
+ if reconciler.Update(event) != tc.want {
+ t.Fatalf("expected %v, got %v", tc.want, !tc.want)
+ }
+ })
+ }
+}
diff --git a/pkg/controller/core/core.go b/pkg/controller/core/core.go
index cb24eab9d7b..cc7a48a7b4c 100644
--- a/pkg/controller/core/core.go
+++ b/pkg/controller/core/core.go
@@ -71,6 +71,11 @@ func SetupControllers(mgr ctrl.Manager, qManager *queue.Manager, cc *cache.Cache
return "ClusterQueue", err
}
+ cohortRec := NewCohortReconciler(mgr.GetClient(), cc, qManager)
+ if err := cohortRec.SetupWithManager(mgr, cfg); err != nil {
+ return "Cohort", err
+ }
+
if err := NewWorkloadReconciler(mgr.GetClient(), qManager, cc,
mgr.GetEventRecorderFor(constants.WorkloadControllerName),
WithWorkloadUpdateWatchers(qRec, cqRec),
diff --git a/pkg/controller/core/localqueue_controller.go b/pkg/controller/core/localqueue_controller.go
index df17859dad5..fada128c348 100644
--- a/pkg/controller/core/localqueue_controller.go
+++ b/pkg/controller/core/localqueue_controller.go
@@ -206,16 +206,16 @@ func (r *LocalQueueReconciler) Generic(e event.GenericEvent) bool {
// receive events.
type qWorkloadHandler struct{}
-func (h *qWorkloadHandler) Create(context.Context, event.CreateEvent, workqueue.RateLimitingInterface) {
+func (h *qWorkloadHandler) Create(context.Context, event.CreateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *qWorkloadHandler) Update(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
+func (h *qWorkloadHandler) Update(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *qWorkloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *qWorkloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *qWorkloadHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (h *qWorkloadHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
w := e.Object.(*kueue.Workload)
if w.Name == "" {
return
@@ -235,7 +235,7 @@ type qCQHandler struct {
client client.Client
}
-func (h *qCQHandler) Create(ctx context.Context, e event.CreateEvent, wq workqueue.RateLimitingInterface) {
+func (h *qCQHandler) Create(ctx context.Context, e event.CreateEvent, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
cq, ok := e.Object.(*kueue.ClusterQueue)
if !ok {
return
@@ -243,7 +243,7 @@ func (h *qCQHandler) Create(ctx context.Context, e event.CreateEvent, wq workque
h.addLocalQueueToWorkQueue(ctx, cq, wq)
}
-func (h *qCQHandler) Update(ctx context.Context, e event.UpdateEvent, wq workqueue.RateLimitingInterface) {
+func (h *qCQHandler) Update(ctx context.Context, e event.UpdateEvent, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
newCq, ok := e.ObjectNew.(*kueue.ClusterQueue)
if !ok {
return
@@ -260,7 +260,7 @@ func (h *qCQHandler) Update(ctx context.Context, e event.UpdateEvent, wq workque
h.addLocalQueueToWorkQueue(ctx, newCq, wq)
}
-func (h *qCQHandler) Delete(ctx context.Context, e event.DeleteEvent, wq workqueue.RateLimitingInterface) {
+func (h *qCQHandler) Delete(ctx context.Context, e event.DeleteEvent, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
cq, ok := e.Object.(*kueue.ClusterQueue)
if !ok {
return
@@ -268,10 +268,10 @@ func (h *qCQHandler) Delete(ctx context.Context, e event.DeleteEvent, wq workque
h.addLocalQueueToWorkQueue(ctx, cq, wq)
}
-func (h *qCQHandler) Generic(context.Context, event.GenericEvent, workqueue.RateLimitingInterface) {
+func (h *qCQHandler) Generic(context.Context, event.GenericEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *qCQHandler) addLocalQueueToWorkQueue(ctx context.Context, cq *kueue.ClusterQueue, wq workqueue.RateLimitingInterface) {
+func (h *qCQHandler) addLocalQueueToWorkQueue(ctx context.Context, cq *kueue.ClusterQueue, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
log := ctrl.LoggerFrom(ctx).WithValues("clusterQueue", klog.KObj(cq))
ctx = ctrl.LoggerInto(ctx, log)
@@ -294,7 +294,7 @@ func (r *LocalQueueReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Co
return ctrl.NewControllerManagedBy(mgr).
For(&kueue.LocalQueue{}).
WithOptions(controller.Options{NeedLeaderElection: ptr.To(false)}).
- WatchesRawSource(&source.Channel{Source: r.wlUpdateCh}, &qWorkloadHandler{}).
+ WatchesRawSource(source.Channel(r.wlUpdateCh, &qWorkloadHandler{})).
Watches(&kueue.ClusterQueue{}, &queueCQHandler).
WithEventFilter(r).
Complete(WithLeadingManager(mgr, r, &kueue.LocalQueue{}, cfg))
diff --git a/pkg/controller/core/resourceflavor_controller.go b/pkg/controller/core/resourceflavor_controller.go
index 969802ddf84..7a3a18f5a74 100644
--- a/pkg/controller/core/resourceflavor_controller.go
+++ b/pkg/controller/core/resourceflavor_controller.go
@@ -218,20 +218,20 @@ type cqHandler struct {
cache *cache.Cache
}
-func (h *cqHandler) Create(context.Context, event.CreateEvent, workqueue.RateLimitingInterface) {
+func (h *cqHandler) Create(context.Context, event.CreateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqHandler) Update(context.Context, event.UpdateEvent, workqueue.RateLimitingInterface) {
+func (h *cqHandler) Update(context.Context, event.UpdateEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *cqHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *cqHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
// Generic accepts update/delete events from clusterQueue via channel.
// For update events, we only check the old obj to see whether old resourceFlavors
// are still in use since new resourceFlavors are always in use.
// For delete events, we check the original obj since new obj is nil.
-func (h *cqHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
+func (h *cqHandler) Generic(_ context.Context, e event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
cq := e.Object.(*kueue.ClusterQueue)
if cq.Name == "" {
return
@@ -259,7 +259,7 @@ func (r *ResourceFlavorReconciler) SetupWithManager(mgr ctrl.Manager, cfg *confi
return ctrl.NewControllerManagedBy(mgr).
For(&kueue.ResourceFlavor{}).
WithOptions(controller.Options{NeedLeaderElection: ptr.To(false)}).
- WatchesRawSource(&source.Channel{Source: r.cqUpdateCh}, &handler).
+ WatchesRawSource(source.Channel(r.cqUpdateCh, &handler)).
WithEventFilter(r).
Complete(WithLeadingManager(mgr, r, &kueue.ResourceFlavor{}, cfg))
}
diff --git a/pkg/controller/core/workload_controller.go b/pkg/controller/core/workload_controller.go
index 052076189e2..642312555d7 100644
--- a/pkg/controller/core/workload_controller.go
+++ b/pkg/controller/core/workload_controller.go
@@ -805,31 +805,31 @@ type resourceUpdatesHandler struct {
r *WorkloadReconciler
}
-func (h *resourceUpdatesHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
+func (h *resourceUpdatesHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
log := ctrl.LoggerFrom(ctx).WithValues("kind", e.Object.GetObjectKind())
ctx = ctrl.LoggerInto(ctx, log)
log.V(5).Info("Create event")
h.handle(ctx, e.Object, q)
}
-func (h *resourceUpdatesHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
+func (h *resourceUpdatesHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
log := ctrl.LoggerFrom(ctx).WithValues("kind", e.ObjectNew.GetObjectKind())
ctx = ctrl.LoggerInto(ctx, log)
log.V(5).Info("Update event")
h.handle(ctx, e.ObjectNew, q)
}
-func (h *resourceUpdatesHandler) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface) {
+func (h *resourceUpdatesHandler) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
log := ctrl.LoggerFrom(ctx).WithValues("kind", e.Object.GetObjectKind())
ctx = ctrl.LoggerInto(ctx, log)
log.V(5).Info("Delete event")
h.handle(ctx, e.Object, q)
}
-func (h *resourceUpdatesHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) {
+func (h *resourceUpdatesHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *resourceUpdatesHandler) handle(ctx context.Context, obj client.Object, q workqueue.RateLimitingInterface) {
+func (h *resourceUpdatesHandler) handle(ctx context.Context, obj client.Object, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
switch v := obj.(type) {
case *corev1.LimitRange:
log := ctrl.LoggerFrom(ctx).WithValues("limitRange", klog.KObj(v))
@@ -844,7 +844,7 @@ func (h *resourceUpdatesHandler) handle(ctx context.Context, obj client.Object,
}
}
-func (h *resourceUpdatesHandler) queueReconcileForPending(ctx context.Context, _ workqueue.RateLimitingInterface, opts ...client.ListOption) {
+func (h *resourceUpdatesHandler) queueReconcileForPending(ctx context.Context, _ workqueue.TypedRateLimitingInterface[reconcile.Request], opts ...client.ListOption) {
log := ctrl.LoggerFrom(ctx)
lst := kueue.WorkloadList{}
opts = append(opts, client.MatchingFields{indexer.WorkloadQuotaReservedKey: string(metav1.ConditionFalse)})
@@ -871,7 +871,7 @@ type workloadQueueHandler struct {
var _ handler.EventHandler = (*workloadQueueHandler)(nil)
// Create is called in response to a create event.
-func (w *workloadQueueHandler) Create(ctx context.Context, ev event.CreateEvent, wq workqueue.RateLimitingInterface) {
+func (w *workloadQueueHandler) Create(ctx context.Context, ev event.CreateEvent, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
if cq, isCq := ev.Object.(*kueue.ClusterQueue); isCq {
log := ctrl.LoggerFrom(ctx).WithValues("clusterQueue", klog.KObj(cq))
ctx = ctrl.LoggerInto(ctx, log)
@@ -886,7 +886,7 @@ func (w *workloadQueueHandler) Create(ctx context.Context, ev event.CreateEvent,
}
// Update is called in response to an update event.
-func (w *workloadQueueHandler) Update(ctx context.Context, ev event.UpdateEvent, wq workqueue.RateLimitingInterface) {
+func (w *workloadQueueHandler) Update(ctx context.Context, ev event.UpdateEvent, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
oldCq, oldIsCq := ev.ObjectOld.(*kueue.ClusterQueue)
newCq, newIsCq := ev.ObjectNew.(*kueue.ClusterQueue)
if oldIsCq && newIsCq {
@@ -917,7 +917,7 @@ func (w *workloadQueueHandler) Update(ctx context.Context, ev event.UpdateEvent,
}
// Delete is called in response to a delete event.
-func (w *workloadQueueHandler) Delete(ctx context.Context, ev event.DeleteEvent, wq workqueue.RateLimitingInterface) {
+func (w *workloadQueueHandler) Delete(ctx context.Context, ev event.DeleteEvent, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
if cq, isCq := ev.Object.(*kueue.ClusterQueue); isCq {
w.queueReconcileForWorkloadsOfClusterQueue(ctx, cq.Name, wq)
return
@@ -931,11 +931,11 @@ func (w *workloadQueueHandler) Delete(ctx context.Context, ev event.DeleteEvent,
// Generic is called in response to an event of an unknown type or a synthetic event triggered as a cron or
// external trigger request.
-func (w *workloadQueueHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) {
+func (w *workloadQueueHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
// nothing to do here
}
-func (w *workloadQueueHandler) queueReconcileForWorkloadsOfClusterQueue(ctx context.Context, cqName string, wq workqueue.RateLimitingInterface) {
+func (w *workloadQueueHandler) queueReconcileForWorkloadsOfClusterQueue(ctx context.Context, cqName string, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
log := ctrl.LoggerFrom(ctx)
lst := kueue.LocalQueueList{}
err := w.r.client.List(ctx, &lst, client.MatchingFields{indexer.QueueClusterQueueKey: cqName})
@@ -949,7 +949,7 @@ func (w *workloadQueueHandler) queueReconcileForWorkloadsOfClusterQueue(ctx cont
}
}
-func (w *workloadQueueHandler) queueReconcileForWorkloadsOfLocalQueue(ctx context.Context, lq *kueue.LocalQueue, wq workqueue.RateLimitingInterface) {
+func (w *workloadQueueHandler) queueReconcileForWorkloadsOfLocalQueue(ctx context.Context, lq *kueue.LocalQueue, wq workqueue.TypedRateLimitingInterface[reconcile.Request]) {
log := ctrl.LoggerFrom(ctx)
lst := kueue.WorkloadList{}
err := w.r.client.List(ctx, &lst, &client.ListOptions{Namespace: lq.Namespace}, client.MatchingFields{indexer.WorkloadQueueKey: lq.Name})
diff --git a/pkg/controller/jobframework/base_webhook.go b/pkg/controller/jobframework/base_webhook.go
new file mode 100644
index 00000000000..7cba3e0d1b3
--- /dev/null
+++ b/pkg/controller/jobframework/base_webhook.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package jobframework
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/util/validation/field"
+ "k8s.io/klog/v2"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+
+ "sigs.k8s.io/kueue/pkg/controller/jobframework/webhook"
+)
+
+// BaseWebhook applies basic defaulting and validation for jobs.
+type BaseWebhook struct {
+ ManageJobsWithoutQueueName bool
+ FromObject func(runtime.Object) GenericJob
+}
+
+func BaseWebhookFactory(job GenericJob, fromObject func(runtime.Object) GenericJob) func(ctrl.Manager, ...Option) error {
+ return func(mgr ctrl.Manager, opts ...Option) error {
+ options := ProcessOptions(opts...)
+ wh := &BaseWebhook{
+ ManageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
+ FromObject: fromObject,
+ }
+ return webhook.WebhookManagedBy(mgr).
+ For(job.Object()).
+ WithMutationHandler(webhook.WithLosslessDefaulter(mgr.GetScheme(), job.Object(), wh)).
+ WithValidator(wh).
+ Complete()
+ }
+}
+
+var _ admission.CustomDefaulter = &BaseWebhook{}
+
+// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
+func (w *BaseWebhook) Default(ctx context.Context, obj runtime.Object) error {
+ job := w.FromObject(obj)
+ log := ctrl.LoggerFrom(ctx)
+ log.V(5).Info("Applying defaults", "job", klog.KObj(job.Object()))
+ ApplyDefaultForSuspend(job, w.ManageJobsWithoutQueueName)
+ return nil
+}
+
+var _ admission.CustomValidator = &BaseWebhook{}
+
+// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
+func (w *BaseWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
+ job := w.FromObject(obj)
+ log := ctrl.LoggerFrom(ctx)
+ log.V(5).Info("Validating create", "job", klog.KObj(job.Object()))
+ return nil, validateCreate(job).ToAggregate()
+}
+
+func validateCreate(job GenericJob) field.ErrorList {
+ return ValidateJobOnCreate(job)
+}
+
+// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
+func (w *BaseWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
+ oldJob := w.FromObject(oldObj)
+ newJob := w.FromObject(newObj)
+ log := ctrl.LoggerFrom(ctx).WithName("mxjob-webhook")
+ log.Info("Validating update", "job", klog.KObj(newJob.Object()))
+ allErrs := ValidateJobOnUpdate(oldJob, newJob)
+ return nil, allErrs.ToAggregate()
+}
+
+// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
+func (w *BaseWebhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
+ return nil, nil
+}
diff --git a/pkg/controller/jobs/mpijob/mpijob_webhook_test.go b/pkg/controller/jobframework/base_webhook_test.go
similarity index 71%
rename from pkg/controller/jobs/mpijob/mpijob_webhook_test.go
rename to pkg/controller/jobframework/base_webhook_test.go
index e6e9a06ec8b..ec1b310dd74 100644
--- a/pkg/controller/jobs/mpijob/mpijob_webhook_test.go
+++ b/pkg/controller/jobframework/base_webhook_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2023 The Kubernetes Authors.
+Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,23 +14,30 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package mpijob
+package jobframework_test
import (
"context"
"testing"
"github.com/google/go-cmp/cmp"
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/mpijob"
testingutil "sigs.k8s.io/kueue/pkg/util/testingjobs/mpijob"
)
-func TestDefault(t *testing.T) {
+func toMPIJob(o runtime.Object) jobframework.GenericJob {
+ return (*mpijob.MPIJob)(o.(*kfmpi.MPIJob))
+}
+
+func TestBaseWebhookDefault(t *testing.T) {
testcases := map[string]struct {
- job *kubeflow.MPIJob
+ job *kfmpi.MPIJob
manageJobsWithoutQueueName bool
- want *kubeflow.MPIJob
+ want *kfmpi.MPIJob
}{
"update the suspend field with 'manageJobsWithoutQueueName=false'": {
job: testingutil.MakeMPIJob("job", "default").Queue("queue").Suspend(false).Obj(),
@@ -44,7 +51,10 @@ func TestDefault(t *testing.T) {
}
for name, tc := range testcases {
t.Run(name, func(t *testing.T) {
- w := &MPIJobWebhook{manageJobsWithoutQueueName: tc.manageJobsWithoutQueueName}
+ w := &jobframework.BaseWebhook{
+ ManageJobsWithoutQueueName: tc.manageJobsWithoutQueueName,
+ FromObject: toMPIJob,
+ }
if err := w.Default(context.Background(), tc.job); err != nil {
t.Errorf("set defaults to a kubeflow/mpijob by a Defaulter")
}
diff --git a/pkg/controller/jobframework/integrationmanager.go b/pkg/controller/jobframework/integrationmanager.go
index d08b1c10302..8d703f95ea5 100644
--- a/pkg/controller/jobframework/integrationmanager.go
+++ b/pkg/controller/jobframework/integrationmanager.go
@@ -56,6 +56,9 @@ type ReconcilerFactory func(client client.Client, record record.EventRecorder, o
type IntegrationCallbacks struct {
// NewJob creates a new instance of job
NewJob func() GenericJob
+ // GVK holds the schema information for the job
+ // (this callback is optional)
+ GVK schema.GroupVersionKind
// NewReconciler creates a new reconciler
NewReconciler ReconcilerFactory
// SetupWebhook sets up the framework's webhook with the controllers manager
@@ -265,13 +268,21 @@ func GetIntegration(name string) (IntegrationCallbacks, bool) {
func GetIntegrationByGVK(gvk schema.GroupVersionKind) (IntegrationCallbacks, bool) {
for _, name := range manager.getList() {
integration, ok := GetIntegration(name)
- if ok && gvk == integration.NewJob().GVK() {
+ if ok && matchingGVK(integration, gvk) {
return integration, true
}
}
return IntegrationCallbacks{}, false
}
+func matchingGVK(integration IntegrationCallbacks, gvk schema.GroupVersionKind) bool {
+ if integration.NewJob != nil {
+ return gvk == integration.NewJob().GVK()
+ } else {
+ return gvk == integration.GVK
+ }
+}
+
// GetIntegrationsList returns the list of currently registered frameworks.
func GetIntegrationsList() []string {
return manager.getList()
diff --git a/pkg/controller/jobframework/noop_webhook.go b/pkg/controller/jobframework/noop_webhook.go
index 889b50262f5..f6353ca5665 100644
--- a/pkg/controller/jobframework/noop_webhook.go
+++ b/pkg/controller/jobframework/noop_webhook.go
@@ -24,11 +24,11 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
-type webhook struct {
+type noopWebhook struct {
}
func setupNoopWebhook(mgr ctrl.Manager, apiType runtime.Object) error {
- wh := &webhook{}
+ wh := &noopWebhook{}
return ctrl.NewWebhookManagedBy(mgr).
For(apiType).
WithDefaulter(wh).
@@ -37,21 +37,21 @@ func setupNoopWebhook(mgr ctrl.Manager, apiType runtime.Object) error {
}
// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
-func (w *webhook) Default(context.Context, runtime.Object) error {
+func (w *noopWebhook) Default(context.Context, runtime.Object) error {
return nil
}
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *webhook) ValidateCreate(context.Context, runtime.Object) (admission.Warnings, error) {
+func (w *noopWebhook) ValidateCreate(context.Context, runtime.Object) (admission.Warnings, error) {
return nil, nil
}
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *webhook) ValidateUpdate(context.Context, runtime.Object, runtime.Object) (admission.Warnings, error) {
+func (w *noopWebhook) ValidateUpdate(context.Context, runtime.Object, runtime.Object) (admission.Warnings, error) {
return nil, nil
}
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *webhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
+func (w *noopWebhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
return nil, nil
}
diff --git a/pkg/controller/jobframework/reconciler.go b/pkg/controller/jobframework/reconciler.go
index 6e4b02aee81..3a021501712 100644
--- a/pkg/controller/jobframework/reconciler.go
+++ b/pkg/controller/jobframework/reconciler.go
@@ -39,6 +39,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/cache"
"sigs.k8s.io/kueue/pkg/constants"
@@ -973,7 +974,10 @@ func getPodSetsInfoFromStatus(ctx context.Context, c client.Client, w *kueue.Wor
if err != nil {
return nil, err
}
-
+ if features.Enabled(features.TopologyAwareScheduling) {
+ info.Labels[kueuealpha.PodSetLabel] = podSetFlavor.Name
+ info.Annotations[kueuealpha.WorkloadAnnotation] = w.Name
+ }
for _, admissionCheck := range w.Status.AdmissionChecks {
for _, podSetUpdate := range admissionCheck.PodSetUpdates {
if podSetUpdate.Name == info.Name {
diff --git a/pkg/controller/jobframework/reconciler_test.go b/pkg/controller/jobframework/reconciler_test.go
index e2d1b6ffb12..3c54a4b51b8 100644
--- a/pkg/controller/jobframework/reconciler_test.go
+++ b/pkg/controller/jobframework/reconciler_test.go
@@ -22,19 +22,20 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
- _ "sigs.k8s.io/kueue/pkg/controller/jobs"
"sigs.k8s.io/kueue/pkg/util/kubeversion"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
testingmpijob "sigs.k8s.io/kueue/pkg/util/testingjobs/mpijob"
+ _ "sigs.k8s.io/kueue/pkg/controller/jobs"
+
. "sigs.k8s.io/kueue/pkg/controller/jobframework"
)
@@ -59,7 +60,7 @@ func TestIsParentJobManaged(t *testing.T) {
},
"child job has ownerReference with known non-existing workload owner": {
job: testingjob.MakeJob(childJobName, jobNamespace).
- OwnerReference(parentJobName, kubeflow.SchemeGroupVersionKind).
+ OwnerReference(parentJobName, kfmpi.SchemeGroupVersionKind).
Obj(),
wantErr: ErrWorkloadOwnerNotFound,
},
@@ -69,7 +70,7 @@ func TestIsParentJobManaged(t *testing.T) {
Queue("test-q").
Obj(),
job: testingjob.MakeJob(childJobName, jobNamespace).
- OwnerReference(parentJobName, kubeflow.SchemeGroupVersionKind).
+ OwnerReference(parentJobName, kfmpi.SchemeGroupVersionKind).
Obj(),
wantManaged: true,
},
@@ -78,14 +79,14 @@ func TestIsParentJobManaged(t *testing.T) {
UID(parentJobName).
Obj(),
job: testingjob.MakeJob(childJobName, jobNamespace).
- OwnerReference(parentJobName, kubeflow.SchemeGroupVersionKind).
+ OwnerReference(parentJobName, kfmpi.SchemeGroupVersionKind).
Obj(),
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
t.Cleanup(EnableIntegrationsForTest(t, "kubeflow.org/mpijob"))
- builder := utiltesting.NewClientBuilder(kubeflow.AddToScheme)
+ builder := utiltesting.NewClientBuilder(kfmpi.AddToScheme)
if tc.parentJob != nil {
builder = builder.WithObjects(tc.parentJob)
}
diff --git a/pkg/controller/jobframework/setup.go b/pkg/controller/jobframework/setup.go
index 1645162ced4..104284e3c56 100644
--- a/pkg/controller/jobframework/setup.go
+++ b/pkg/controller/jobframework/setup.go
@@ -121,7 +121,7 @@ func (m *integrationManager) setupControllerAndWebhook(mgr ctrl.Manager, name st
}
func waitForAPI(ctx context.Context, mgr ctrl.Manager, log logr.Logger, gvk schema.GroupVersionKind, action func()) {
- rateLimiter := workqueue.NewItemExponentialFailureRateLimiter(baseBackoffWaitForIntegration, maxBackoffWaitForIntegration)
+ rateLimiter := workqueue.NewTypedItemExponentialFailureRateLimiter[string](baseBackoffWaitForIntegration, maxBackoffWaitForIntegration)
item := gvk.String()
for {
err := restMappingExists(mgr, gvk)
diff --git a/pkg/controller/jobframework/setup_test.go b/pkg/controller/jobframework/setup_test.go
index 69f6e5cf083..988db4d4085 100644
--- a/pkg/controller/jobframework/setup_test.go
+++ b/pkg/controller/jobframework/setup_test.go
@@ -26,7 +26,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
batchv1 "k8s.io/api/batch/v1"
@@ -58,7 +58,7 @@ func TestSetupControllers(t *testing.T) {
"kubeflow.org/mpijob": {
NewReconciler: testNewReconciler,
SetupWebhook: testSetupWebhook,
- JobType: &kubeflow.MPIJob{},
+ JobType: &kfmpi.MPIJob{},
SetupIndexes: testSetupIndexes,
AddToScheme: testAddToScheme,
CanSupportIntegration: testCanSupportIntegration,
@@ -98,7 +98,7 @@ func TestSetupControllers(t *testing.T) {
},
mapperGVKs: []schema.GroupVersionKind{
batchv1.SchemeGroupVersion.WithKind("Job"),
- kubeflow.SchemeGroupVersionKind,
+ kfmpi.SchemeGroupVersionKind,
},
wantEnabledIntegrations: []string{"batch/job", "kubeflow.org/mpijob"},
},
@@ -117,7 +117,7 @@ func TestSetupControllers(t *testing.T) {
},
mapperGVKs: []schema.GroupVersionKind{
batchv1.SchemeGroupVersion.WithKind("Job"),
- kubeflow.SchemeGroupVersionKind,
+ kfmpi.SchemeGroupVersionKind,
// Not including RayCluster
},
delayedGVKs: []*schema.GroupVersionKind{
@@ -137,7 +137,7 @@ func TestSetupControllers(t *testing.T) {
}
ctx, logger := utiltesting.ContextWithLog(t)
- k8sClient := utiltesting.NewClientBuilder(jobset.AddToScheme, kubeflow.AddToScheme, kftraining.AddToScheme, rayv1.AddToScheme).Build()
+ k8sClient := utiltesting.NewClientBuilder(jobset.AddToScheme, kfmpi.AddToScheme, kftraining.AddToScheme, rayv1.AddToScheme).Build()
mgrOpts := ctrlmgr.Options{
Scheme: k8sClient.Scheme(),
@@ -245,16 +245,16 @@ func TestSetupIndexes(t *testing.T) {
"kubeflow.org/mpijob is disabled in the configAPI": {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("alpha-wl", testNamespace).
- ControllerReference(kubeflow.SchemeGroupVersionKind, "alpha", "mpijob").
+ ControllerReference(kfmpi.SchemeGroupVersionKind, "alpha", "mpijob").
Obj(),
*utiltesting.MakeWorkload("beta-wl", testNamespace).
- ControllerReference(kubeflow.SchemeGroupVersionKind, "beta", "mpijob").
+ ControllerReference(kfmpi.SchemeGroupVersionKind, "beta", "mpijob").
Obj(),
},
opts: []Option{
WithEnabledFrameworks([]string{"batch/job"}),
},
- filter: client.MatchingFields{GetOwnerKey(kubeflow.SchemeGroupVersionKind): "alpha"},
+ filter: client.MatchingFields{GetOwnerKey(kfmpi.SchemeGroupVersionKind): "alpha"},
wantFieldMatcherError: true,
},
}
diff --git a/pkg/controller/jobframework/validation.go b/pkg/controller/jobframework/validation.go
index 6478648c876..da355f35a0d 100644
--- a/pkg/controller/jobframework/validation.go
+++ b/pkg/controller/jobframework/validation.go
@@ -20,6 +20,7 @@ import (
"fmt"
"strings"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
batchv1 "k8s.io/api/batch/v1"
apivalidation "k8s.io/apimachinery/pkg/api/validation"
@@ -42,7 +43,8 @@ var (
kftraining.SchemeGroupVersion.WithKind(kftraining.TFJobKind).String(),
kftraining.SchemeGroupVersion.WithKind(kftraining.PaddleJobKind).String(),
kftraining.SchemeGroupVersion.WithKind(kftraining.PyTorchJobKind).String(),
- kftraining.SchemeGroupVersion.WithKind(kftraining.XGBoostJobKind).String())
+ kftraining.SchemeGroupVersion.WithKind(kftraining.XGBoostJobKind).String(),
+ kfmpi.SchemeGroupVersion.WithKind(kfmpi.Kind).String())
)
// ValidateJobOnCreate encapsulates all GenericJob validations that must be performed on a Create operation
diff --git a/pkg/controller/jobframework/webhook/builder.go b/pkg/controller/jobframework/webhook/builder.go
new file mode 100644
index 00000000000..d61574214ed
--- /dev/null
+++ b/pkg/controller/jobframework/webhook/builder.go
@@ -0,0 +1,262 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package webhook
+
+import (
+ "errors"
+ "net/http"
+ "net/url"
+ "strings"
+
+ "github.com/go-logr/logr"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/client-go/rest"
+ "k8s.io/klog/v2"
+ "sigs.k8s.io/controller-runtime/pkg/client/apiutil"
+ "sigs.k8s.io/controller-runtime/pkg/manager"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/conversion"
+)
+
+// This code is copied from https://github.com/kubernetes-sigs/controller-runtime/blob/896f6ded750155f9ecfdf4d8e10a26fc3fb78384/pkg/builder/webhook.go
+// with one modification to get full control of the construction of patches:
+// replacing CustomDefaulter with an admission.Handler.
+// TODO(#3137): remove this file
+
+// WebhookBuilder builds a Webhook.
+type WebhookBuilder struct {
+ apiType runtime.Object
+ mutationHandler admission.Handler
+ customValidator admission.CustomValidator
+ gvk schema.GroupVersionKind
+ mgr manager.Manager
+ config *rest.Config
+ recoverPanic *bool
+ logConstructor func(base logr.Logger, req *admission.Request) logr.Logger
+ err error
+}
+
+// WebhookManagedBy returns a new webhook builder.
+func WebhookManagedBy(m manager.Manager) *WebhookBuilder {
+ return &WebhookBuilder{mgr: m}
+}
+
+// TODO(droot): update the GoDoc for conversion.
+
+// For takes a runtime.Object which should be a CR.
+// If the given object implements the admission.Defaulter interface, a MutatingWebhook will be wired for this type.
+// If the given object implements the admission.Validator interface, a ValidatingWebhook will be wired for this type.
+func (blder *WebhookBuilder) For(apiType runtime.Object) *WebhookBuilder {
+ if blder.apiType != nil {
+ blder.err = errors.New("For(...) should only be called once, could not assign multiple objects for webhook registration")
+ }
+ blder.apiType = apiType
+ return blder
+}
+
+// WithDefaulter takes an admission.CustomDefaulter interface, a MutatingWebhook will be wired for this type.
+func (blder *WebhookBuilder) WithMutationHandler(h admission.Handler) *WebhookBuilder {
+ blder.mutationHandler = h
+ return blder
+}
+
+// WithValidator takes a admission.CustomValidator interface, a ValidatingWebhook will be wired for this type.
+func (blder *WebhookBuilder) WithValidator(validator admission.CustomValidator) *WebhookBuilder {
+ blder.customValidator = validator
+ return blder
+}
+
+// WithLogConstructor overrides the webhook's LogConstructor.
+func (blder *WebhookBuilder) WithLogConstructor(logConstructor func(base logr.Logger, req *admission.Request) logr.Logger) *WebhookBuilder {
+ blder.logConstructor = logConstructor
+ return blder
+}
+
+// RecoverPanic indicates whether panics caused by the webhook should be recovered.
+// Defaults to true.
+func (blder *WebhookBuilder) RecoverPanic(recoverPanic bool) *WebhookBuilder {
+ blder.recoverPanic = &recoverPanic
+ return blder
+}
+
+// Complete builds the webhook.
+func (blder *WebhookBuilder) Complete() error {
+ // Set the Config
+ blder.loadRestConfig()
+
+ // Configure the default LogConstructor
+ blder.setLogConstructor()
+
+ // Set the Webhook if needed
+ return blder.registerWebhooks()
+}
+
+func (blder *WebhookBuilder) loadRestConfig() {
+ if blder.config == nil {
+ blder.config = blder.mgr.GetConfig()
+ }
+}
+
+func (blder *WebhookBuilder) setLogConstructor() {
+ if blder.logConstructor == nil {
+ blder.logConstructor = func(base logr.Logger, req *admission.Request) logr.Logger {
+ log := base.WithValues(
+ "webhookGroup", blder.gvk.Group,
+ "webhookKind", blder.gvk.Kind,
+ )
+ if req != nil {
+ return log.WithValues(
+ blder.gvk.Kind, klog.KRef(req.Namespace, req.Name),
+ "namespace", req.Namespace, "name", req.Name,
+ "resource", req.Resource, "user", req.UserInfo.Username,
+ "requestID", req.UID,
+ )
+ }
+ return log
+ }
+ }
+}
+
+func (blder *WebhookBuilder) registerWebhooks() error {
+ typ, err := blder.getType()
+ if err != nil {
+ return err
+ }
+
+ blder.gvk, err = apiutil.GVKForObject(typ, blder.mgr.GetScheme())
+ if err != nil {
+ return err
+ }
+
+ // Register webhook(s) for type
+ blder.registerDefaultingWebhook()
+ blder.registerValidatingWebhook()
+
+ err = blder.registerConversionWebhook()
+ if err != nil {
+ return err
+ }
+ return blder.err
+}
+
+// registerDefaultingWebhook registers a defaulting webhook if necessary.
+func (blder *WebhookBuilder) registerDefaultingWebhook() {
+ mwh := blder.getDefaultingWebhook()
+ if mwh != nil {
+ mwh.LogConstructor = blder.logConstructor
+ path := generateMutatePath(blder.gvk)
+
+ // Checking if the path is already registered.
+ // If so, just skip it.
+ if !blder.isAlreadyHandled(path) {
+ log := blder.mgr.GetLogger()
+ log.Info("Registering a mutating webhook",
+ "GVK", blder.gvk,
+ "path", path)
+ blder.mgr.GetWebhookServer().Register(path, mwh)
+ }
+ }
+}
+
+func (blder *WebhookBuilder) getDefaultingWebhook() *admission.Webhook {
+ if handler := blder.mutationHandler; handler != nil {
+ w := &admission.Webhook{
+ Handler: handler,
+ }
+ if blder.recoverPanic != nil {
+ w = w.WithRecoverPanic(*blder.recoverPanic)
+ }
+ return w
+ }
+ return nil
+}
+
+// registerValidatingWebhook registers a validating webhook if necessary.
+func (blder *WebhookBuilder) registerValidatingWebhook() {
+ vwh := blder.getValidatingWebhook()
+ if vwh != nil {
+ vwh.LogConstructor = blder.logConstructor
+ path := generateValidatePath(blder.gvk)
+
+ // Checking if the path is already registered.
+ // If so, just skip it.
+ if !blder.isAlreadyHandled(path) {
+ log := blder.mgr.GetLogger()
+ log.Info("Registering a validating webhook",
+ "GVK", blder.gvk,
+ "path", path)
+ blder.mgr.GetWebhookServer().Register(path, vwh)
+ }
+ }
+}
+
+func (blder *WebhookBuilder) getValidatingWebhook() *admission.Webhook {
+ if validator := blder.customValidator; validator != nil {
+ w := admission.WithCustomValidator(blder.mgr.GetScheme(), blder.apiType, validator)
+ if blder.recoverPanic != nil {
+ w = w.WithRecoverPanic(*blder.recoverPanic)
+ }
+ return w
+ }
+ return nil
+}
+
+func (blder *WebhookBuilder) registerConversionWebhook() error {
+ log := blder.mgr.GetLogger()
+ ok, err := conversion.IsConvertible(blder.mgr.GetScheme(), blder.apiType)
+ if err != nil {
+ log.Error(err, "conversion check failed", "GVK", blder.gvk)
+ return err
+ }
+ if ok {
+ if !blder.isAlreadyHandled("/convert") {
+ blder.mgr.GetWebhookServer().Register("/convert", conversion.NewWebhookHandler(blder.mgr.GetScheme()))
+ }
+ log.Info("Conversion webhook enabled", "GVK", blder.gvk)
+ }
+
+ return nil
+}
+
+func (blder *WebhookBuilder) getType() (runtime.Object, error) {
+ if blder.apiType != nil {
+ return blder.apiType, nil
+ }
+ return nil, errors.New("For() must be called with a valid object")
+}
+
+func (blder *WebhookBuilder) isAlreadyHandled(path string) bool {
+ if blder.mgr.GetWebhookServer().WebhookMux() == nil {
+ return false
+ }
+ h, p := blder.mgr.GetWebhookServer().WebhookMux().Handler(&http.Request{URL: &url.URL{Path: path}})
+ if p == path && h != nil {
+ return true
+ }
+ return false
+}
+
+func generateMutatePath(gvk schema.GroupVersionKind) string {
+ return "/mutate-" + strings.ReplaceAll(gvk.Group, ".", "-") + "-" +
+ gvk.Version + "-" + strings.ToLower(gvk.Kind)
+}
+
+func generateValidatePath(gvk schema.GroupVersionKind) string {
+ return "/validate-" + strings.ReplaceAll(gvk.Group, ".", "-") + "-" +
+ gvk.Version + "-" + strings.ToLower(gvk.Kind)
+}
diff --git a/pkg/controller/jobframework/webhook/defaulter.go b/pkg/controller/jobframework/webhook/defaulter.go
new file mode 100644
index 00000000000..d61ce682891
--- /dev/null
+++ b/pkg/controller/jobframework/webhook/defaulter.go
@@ -0,0 +1,60 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package webhook
+
+import (
+ "context"
+
+ jsonpatch "gomodules.xyz/jsonpatch/v2"
+ "k8s.io/apimachinery/pkg/runtime"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+// WithLosslessDefaulter creates a new Handler for a CustomDefaulter interface that **drops** remove operations,
+// which are typically the result of new API fields not present in Kueue libraries.
+func WithLosslessDefaulter(scheme *runtime.Scheme, obj runtime.Object, defaulter admission.CustomDefaulter) admission.Handler {
+ return &losslessDefaulter{
+ Handler: admission.WithCustomDefaulter(scheme, obj, defaulter).Handler,
+ }
+}
+
+type losslessDefaulter struct {
+ admission.Handler
+}
+
+// Handle handles admission requests, **dropping** remove operations from patches produced by controller-runtime.
+// The controller-runtime handler works by creating a jsondiff from the raw object and the marshalled
+// version of the object modified by the defaulter. This generates "remove" operations for fields
+// that are not present in the go types, which can occur when Kueue libraries are behind the latest
+// released CRDs.
+// Dropping the "remove" operations is safe because Kueue's job mutators never remove fields.
+func (h *losslessDefaulter) Handle(ctx context.Context, req admission.Request) admission.Response {
+ response := h.Handler.Handle(ctx, req)
+ if response.Allowed {
+ var patches []jsonpatch.Operation
+ for _, p := range response.Patches {
+ if p.Operation != "remove" {
+ patches = append(patches, p)
+ }
+ }
+ if len(patches) == 0 {
+ response.PatchType = nil
+ }
+ response.Patches = patches
+ }
+ return response
+}
diff --git a/pkg/controller/jobframework/webhook/defaulter_test.go b/pkg/controller/jobframework/webhook/defaulter_test.go
new file mode 100644
index 00000000000..d7e8b1fc535
--- /dev/null
+++ b/pkg/controller/jobframework/webhook/defaulter_test.go
@@ -0,0 +1,99 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package webhook
+
+import (
+ "context"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ jsonpatch "gomodules.xyz/jsonpatch/v2"
+ admissionv1 "k8s.io/api/admission/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+var (
+ testResourceKind = "TestResource"
+ testResourceGVK = schema.GroupVersionKind{Group: "foo.test.org", Version: "v1", Kind: testResourceKind}
+)
+
+type TestResource struct {
+ Foo string `json:"foo,omitempty"`
+}
+
+func (d *TestResource) GetObjectKind() schema.ObjectKind { return d }
+func (d *TestResource) DeepCopyObject() runtime.Object {
+ return &TestResource{
+ Foo: d.Foo,
+ }
+}
+
+func (d *TestResource) GroupVersionKind() schema.GroupVersionKind {
+ return testResourceGVK
+}
+
+func (d *TestResource) SetGroupVersionKind(gvk schema.GroupVersionKind) {}
+
+type TestCustomDefaulter struct{}
+
+func (*TestCustomDefaulter) Default(ctx context.Context, obj runtime.Object) error {
+ d := obj.(*TestResource)
+ if d.Foo == "" {
+ d.Foo = "bar"
+ }
+ return nil
+}
+
+func TestLossLessDefaulter(t *testing.T) {
+ sch := runtime.NewScheme()
+ builder := scheme.Builder{GroupVersion: testResourceGVK.GroupVersion()}
+ builder.Register(&TestResource{})
+ if err := builder.AddToScheme(sch); err != nil {
+ t.Fatalf("Couldn't add types to scheme: %v", err)
+ }
+
+ handler := WithLosslessDefaulter(sch, &TestResource{}, &TestCustomDefaulter{})
+
+ req := admission.Request{
+ AdmissionRequest: admissionv1.AdmissionRequest{
+ Kind: metav1.GroupVersionKind(testResourceGVK),
+ Object: runtime.RawExtension{
+ // This raw object has a field not defined in the go type.
+ // controller-runtime CustomDefaulter would have added a remove operation for it.
+ Raw: []byte(`{"baz": "qux"}`),
+ },
+ },
+ }
+ resp := handler.Handle(context.Background(), req)
+ if !resp.Allowed {
+ t.Errorf("Response not allowed")
+ }
+ wantPatches := []jsonpatch.Operation{
+ {
+ Operation: "add",
+ Path: "/foo",
+ Value: "bar",
+ },
+ }
+ if diff := cmp.Diff(wantPatches, resp.Patches); diff != "" {
+ t.Errorf("Unexpected patches (-want, +got): %s", diff)
+ }
+}
diff --git a/pkg/controller/jobs/deployment/deployment_controller.go b/pkg/controller/jobs/deployment/deployment_controller.go
index 7dc50eff3f8..df3a1393059 100644
--- a/pkg/controller/jobs/deployment/deployment_controller.go
+++ b/pkg/controller/jobs/deployment/deployment_controller.go
@@ -40,6 +40,7 @@ func init() {
utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
NewReconciler: jobframework.NewNoopReconcilerFactory(gvk),
+ GVK: gvk,
SetupWebhook: SetupWebhook,
JobType: &appsv1.Deployment{},
AddToScheme: appsv1.AddToScheme,
diff --git a/pkg/controller/jobs/deployment/deployment_webhook.go b/pkg/controller/jobs/deployment/deployment_webhook.go
index ab4fef58fa6..a39c6377659 100644
--- a/pkg/controller/jobs/deployment/deployment_webhook.go
+++ b/pkg/controller/jobs/deployment/deployment_webhook.go
@@ -26,11 +26,11 @@ import (
"k8s.io/klog/v2"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework/webhook"
)
type Webhook struct {
@@ -44,16 +44,17 @@ func SetupWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
client: mgr.GetClient(),
manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
}
- return ctrl.NewWebhookManagedBy(mgr).
- For(&appsv1.Deployment{}).
- WithDefaulter(wh).
+ obj := &appsv1.Deployment{}
+ return webhook.WebhookManagedBy(mgr).
+ For(obj).
+ WithMutationHandler(webhook.WithLosslessDefaulter(mgr.GetScheme(), obj, wh)).
WithValidator(wh).
Complete()
}
// +kubebuilder:webhook:path=/mutate-apps-v1-deployment,mutating=true,failurePolicy=fail,sideEffects=None,groups="apps",resources=deployments,verbs=create,versions=v1,name=mdeployment.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomDefaulter = &Webhook{}
+var _ admission.CustomDefaulter = &Webhook{}
func (wh *Webhook) Default(ctx context.Context, obj runtime.Object) error {
d := fromObject(obj)
@@ -73,7 +74,7 @@ func (wh *Webhook) Default(ctx context.Context, obj runtime.Object) error {
// +kubebuilder:webhook:path=/validate-apps-v1-deployment,mutating=false,failurePolicy=fail,sideEffects=None,groups="apps",resources=deployments,verbs=create;update,versions=v1,name=vdeployment.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomValidator = &Webhook{}
+var _ admission.CustomValidator = &Webhook{}
func (wh *Webhook) ValidateCreate(context.Context, runtime.Object) (warnings admission.Warnings, err error) {
return nil, nil
diff --git a/pkg/controller/jobs/job/job_controller.go b/pkg/controller/jobs/job/job_controller.go
index 5790a58d7c9..04486075065 100644
--- a/pkg/controller/jobs/job/job_controller.go
+++ b/pkg/controller/jobs/job/job_controller.go
@@ -95,23 +95,23 @@ type parentWorkloadHandler struct {
client client.Client
}
-func (h *parentWorkloadHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
+func (h *parentWorkloadHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
h.queueReconcileForChildJob(ctx, e.Object, q)
}
-func (h *parentWorkloadHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
+func (h *parentWorkloadHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
h.queueReconcileForChildJob(ctx, e.ObjectNew, q)
}
-func (h *parentWorkloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *parentWorkloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *parentWorkloadHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) {
+func (h *parentWorkloadHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
// queueReconcileForChildJob queues reconciliation of the child jobs (jobs with the
// parent-workload annotation) in reaction to the parent-workload events.
-func (h *parentWorkloadHandler) queueReconcileForChildJob(ctx context.Context, object client.Object, q workqueue.RateLimitingInterface) {
+func (h *parentWorkloadHandler) queueReconcileForChildJob(ctx context.Context, object client.Object, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
w, ok := object.(*kueue.Workload)
if !ok {
return
diff --git a/pkg/controller/jobs/job/job_controller_test.go b/pkg/controller/jobs/job/job_controller_test.go
index 15bae696beb..9d6138fb84e 100644
--- a/pkg/controller/jobs/job/job_controller_test.go
+++ b/pkg/controller/jobs/job/job_controller_test.go
@@ -33,10 +33,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/constants"
controllerconsts "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/features"
"sigs.k8s.io/kueue/pkg/podset"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
utiltestingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
@@ -416,6 +418,8 @@ func TestReconciler(t *testing.T) {
PriorityValue(200)
cases := map[string]struct {
+ enableTopologyAwareScheduling bool
+
reconcilerOptions []jobframework.Option
job batchv1.Job
workloads []kueue.Workload
@@ -426,6 +430,36 @@ func TestReconciler(t *testing.T) {
wantEvents []utiltesting.EventRecord
wantErr error
}{
+ "PodSet label and Workload annotation are set when Job is starting; TopologyAwareScheduling enabled": {
+ enableTopologyAwareScheduling: true,
+ reconcilerOptions: []jobframework.Option{
+ jobframework.WithManageJobsWithoutQueueName(true),
+ },
+ job: *baseJobWrapper.DeepCopy(),
+ wantJob: *baseJobWrapper.Clone().
+ Suspend(false).
+ PodLabel(kueuealpha.PodSetLabel, kueue.DefaultPodSetName).
+ PodAnnotation(kueuealpha.WorkloadAnnotation, "wl").
+ Obj(),
+ workloads: []kueue.Workload{
+ *baseWorkloadWrapper.Clone().
+ Admitted(true).
+ Obj(),
+ },
+ wantWorkloads: []kueue.Workload{
+ *baseWorkloadWrapper.Clone().
+ Admitted(true).
+ Obj(),
+ },
+ wantEvents: []utiltesting.EventRecord{
+ {
+ Key: types.NamespacedName{Name: "job", Namespace: "ns"},
+ EventType: "Normal",
+ Reason: "Started",
+ Message: "Admitted by clusterQueue cq",
+ },
+ },
+ },
"when workload is created, it has its owner ProvReq annotations": {
job: *baseJobWrapper.Clone().
SetAnnotation(controllerconsts.ProvReqAnnotationPrefix+"test-annotation", "test-val").
@@ -2713,6 +2747,7 @@ func TestReconciler(t *testing.T) {
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
+ features.SetFeatureGateDuringTest(t, features.TopologyAwareScheduling, tc.enableTopologyAwareScheduling)
ctx, _ := utiltesting.ContextWithLog(t)
clientBuilder := utiltesting.NewClientBuilder().WithInterceptorFuncs(interceptor.Funcs{SubResourcePatch: utiltesting.TreatSSAAsStrategicMerge})
if err := SetupIndexes(ctx, utiltesting.AsIndexer(clientBuilder)); err != nil {
diff --git a/pkg/controller/jobs/job/job_multikueue_adapter.go b/pkg/controller/jobs/job/job_multikueue_adapter.go
index 3d00b5a3805..a2b254dca37 100644
--- a/pkg/controller/jobs/job/job_multikueue_adapter.go
+++ b/pkg/controller/jobs/job/job_multikueue_adapter.go
@@ -30,7 +30,7 @@ import (
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/features"
@@ -97,7 +97,7 @@ func (b *multikueueAdapter) SyncJob(ctx context.Context, localClient client.Clie
remoteJob.Labels = map[string]string{}
}
remoteJob.Labels[constants.PrebuiltWorkloadLabel] = workloadName
- remoteJob.Labels[kueuealpha.MultiKueueOriginLabel] = origin
+ remoteJob.Labels[kueue.MultiKueueOriginLabel] = origin
if features.Enabled(features.MultiKueueBatchJobWithManagedBy) {
// clear the managedBy enables the batch/Job controller to take over
@@ -131,8 +131,8 @@ func (b *multikueueAdapter) IsJobManagedByKueue(ctx context.Context, c client.Cl
return false, "", err
}
jobControllerName := ptr.Deref(job.Spec.ManagedBy, "")
- if jobControllerName != kueuealpha.MultiKueueControllerName {
- return false, fmt.Sprintf("Expecting spec.managedBy to be %q not %q", kueuealpha.MultiKueueControllerName, jobControllerName), nil
+ if jobControllerName != kueue.MultiKueueControllerName {
+ return false, fmt.Sprintf("Expecting spec.managedBy to be %q not %q", kueue.MultiKueueControllerName, jobControllerName), nil
}
return true, "", nil
}
diff --git a/pkg/controller/jobs/job/job_multikueue_adapter_test.go b/pkg/controller/jobs/job/job_multikueue_adapter_test.go
index d8477df1e16..1b8d8637748 100644
--- a/pkg/controller/jobs/job/job_multikueue_adapter_test.go
+++ b/pkg/controller/jobs/job/job_multikueue_adapter_test.go
@@ -30,7 +30,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/features"
"sigs.k8s.io/kueue/pkg/util/slices"
@@ -49,7 +49,7 @@ func TestMultikueueAdapter(t *testing.T) {
}
baseJobBuilder := utiltestingjob.MakeJob("job1", TestNamespace)
- baseJobManagedByKueueBuilder := baseJobBuilder.Clone().ManagedBy(kueuealpha.MultiKueueControllerName)
+ baseJobManagedByKueueBuilder := baseJobBuilder.Clone().ManagedBy(kueue.MultiKueueControllerName)
cases := map[string]struct {
managersJobs []batchv1.Job
@@ -77,7 +77,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
},
@@ -88,7 +88,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Active(2).
Obj(),
},
@@ -102,7 +102,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Active(2).
Obj(),
},
@@ -114,7 +114,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Condition(batchv1.JobCondition{Type: batchv1.JobComplete, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -130,7 +130,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Condition(batchv1.JobCondition{Type: batchv1.JobComplete, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -142,7 +142,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Active(2).
Obj(),
},
@@ -157,7 +157,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Active(2).
Obj(),
},
@@ -169,7 +169,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Condition(batchv1.JobCondition{Type: batchv1.JobComplete, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -186,7 +186,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Condition(batchv1.JobCondition{Type: batchv1.JobComplete, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -195,7 +195,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerJobs: []batchv1.Job{
*baseJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Active(2).
Obj(),
},
@@ -258,7 +258,7 @@ func TestMultikueueAdapter(t *testing.T) {
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
- defer features.SetFeatureGateDuringTest(t, features.MultiKueueBatchJobWithManagedBy, !tc.withoutJobManagedBy)()
+ features.SetFeatureGateDuringTest(t, features.MultiKueueBatchJobWithManagedBy, !tc.withoutJobManagedBy)
managerBuilder := utiltesting.NewClientBuilder().WithInterceptorFuncs(interceptor.Funcs{SubResourcePatch: utiltesting.TreatSSAAsStrategicMerge})
managerBuilder = managerBuilder.WithLists(&batchv1.JobList{Items: tc.managersJobs})
managerBuilder = managerBuilder.WithStatusSubresource(slices.Map(tc.managersJobs, func(w *batchv1.Job) client.Object { return w })...)
diff --git a/pkg/controller/jobs/job/job_webhook.go b/pkg/controller/jobs/job/job_webhook.go
index ec48fbdd5cf..5d9ebf4f45e 100644
--- a/pkg/controller/jobs/job/job_webhook.go
+++ b/pkg/controller/jobs/job/job_webhook.go
@@ -28,13 +28,13 @@ import (
"k8s.io/klog/v2"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
- "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/cache"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework/webhook"
"sigs.k8s.io/kueue/pkg/features"
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/util/kubeversion"
@@ -61,16 +61,17 @@ func SetupWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
queues: options.Queues,
cache: options.Cache,
}
- return ctrl.NewWebhookManagedBy(mgr).
- For(&batchv1.Job{}).
- WithDefaulter(wh).
+ obj := &batchv1.Job{}
+ return webhook.WebhookManagedBy(mgr).
+ For(obj).
+ WithMutationHandler(webhook.WithLosslessDefaulter(mgr.GetScheme(), obj, wh)).
WithValidator(wh).
Complete()
}
// +kubebuilder:webhook:path=/mutate-batch-v1-job,mutating=true,failurePolicy=fail,sideEffects=None,groups=batch,resources=jobs,verbs=create,versions=v1,name=mjob.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomDefaulter = &JobWebhook{}
+var _ admission.CustomDefaulter = &JobWebhook{}
// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (w *JobWebhook) Default(ctx context.Context, obj runtime.Object) error {
@@ -91,9 +92,9 @@ func (w *JobWebhook) Default(ctx context.Context, obj runtime.Object) error {
return nil
}
for _, admissionCheck := range w.cache.AdmissionChecksForClusterQueue(clusterQueueName) {
- if admissionCheck.Controller == v1alpha1.MultiKueueControllerName {
- log.V(5).Info("Defaulting ManagedBy", "job", klog.KObj(job), "oldManagedBy", job.Spec.ManagedBy, "managedBy", v1alpha1.MultiKueueControllerName)
- job.Spec.ManagedBy = ptr.To(v1alpha1.MultiKueueControllerName)
+ if admissionCheck.Controller == kueue.MultiKueueControllerName {
+ log.V(5).Info("Defaulting ManagedBy", "job", klog.KObj(job), "oldManagedBy", job.Spec.ManagedBy, "managedBy", kueue.MultiKueueControllerName)
+ job.Spec.ManagedBy = ptr.To(kueue.MultiKueueControllerName)
return nil
}
}
@@ -109,7 +110,7 @@ func canDefaultManagedBy(jobSpecManagedBy *string) bool {
// +kubebuilder:webhook:path=/validate-batch-v1-job,mutating=false,failurePolicy=fail,sideEffects=None,groups=batch,resources=jobs,verbs=create;update,versions=v1,name=vjob.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomValidator = &JobWebhook{}
+var _ admission.CustomValidator = &JobWebhook{}
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
func (w *JobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
@@ -123,6 +124,7 @@ func (w *JobWebhook) validateCreate(job *Job) field.ErrorList {
var allErrs field.ErrorList
allErrs = append(allErrs, jobframework.ValidateJobOnCreate(job)...)
allErrs = append(allErrs, w.validatePartialAdmissionCreate(job)...)
+ allErrs = append(allErrs, w.validateSyncCompletionCreate(job)...)
return allErrs
}
@@ -136,6 +138,11 @@ func (w *JobWebhook) validatePartialAdmissionCreate(job *Job) field.ErrorList {
allErrs = append(allErrs, field.Invalid(minPodsCountAnnotationsPath, v, fmt.Sprintf("should be between 0 and %d", job.podsCount()-1)))
}
}
+ return allErrs
+}
+
+func (w *JobWebhook) validateSyncCompletionCreate(job *Job) field.ErrorList {
+ var allErrs field.ErrorList
if strVal, found := job.Annotations[JobCompletionsEqualParallelismAnnotation]; found {
enabled, err := strconv.ParseBool(strVal)
if err != nil {
@@ -169,7 +176,12 @@ func (w *JobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.
}
func (w *JobWebhook) validateUpdate(oldJob, newJob *Job) field.ErrorList {
- allErrs := w.validateCreate(newJob)
+ var allErrs field.ErrorList
+ allErrs = append(allErrs, jobframework.ValidateJobOnCreate(newJob)...)
+ if newJob.Annotations[JobMinParallelismAnnotation] != oldJob.Annotations[JobMinParallelismAnnotation] {
+ allErrs = append(allErrs, w.validatePartialAdmissionCreate(newJob)...)
+ }
+ allErrs = append(allErrs, w.validateSyncCompletionCreate(newJob)...)
allErrs = append(allErrs, jobframework.ValidateJobOnUpdate(oldJob, newJob)...)
allErrs = append(allErrs, validatePartialAdmissionUpdate(oldJob, newJob)...)
return allErrs
@@ -178,7 +190,7 @@ func (w *JobWebhook) validateUpdate(oldJob, newJob *Job) field.ErrorList {
func validatePartialAdmissionUpdate(oldJob, newJob *Job) field.ErrorList {
var allErrs field.ErrorList
if _, found := oldJob.Annotations[JobMinParallelismAnnotation]; found {
- if !oldJob.IsSuspended() && ptr.Deref(oldJob.Spec.Parallelism, 1) != ptr.Deref(newJob.Spec.Parallelism, 1) {
+ if !ptr.Deref(oldJob.Spec.Suspend, false) && ptr.Deref(oldJob.Spec.Parallelism, 1) != ptr.Deref(newJob.Spec.Parallelism, 1) {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "parallelism"), "cannot change when partial admission is enabled and the job is not suspended"))
}
}
diff --git a/pkg/controller/jobs/job/job_webhook_test.go b/pkg/controller/jobs/job/job_webhook_test.go
index ecd74096a08..af3fe3bb733 100644
--- a/pkg/controller/jobs/job/job_webhook_test.go
+++ b/pkg/controller/jobs/job/job_webhook_test.go
@@ -32,7 +32,6 @@ import (
fakeclient "k8s.io/client-go/kubernetes/fake"
"k8s.io/utils/ptr"
- "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/cache"
"sigs.k8s.io/kueue/pkg/controller/constants"
@@ -314,6 +313,7 @@ func TestValidateUpdate(t *testing.T) {
Parallelism(4).
Completions(6).
SetAnnotation(JobMinParallelismAnnotation, "3").
+ SetAnnotation(StoppingAnnotation, "true").
Obj(),
newJob: testingutil.MakeJob("job", "default").
Parallelism(5).
@@ -400,6 +400,36 @@ func TestValidateUpdate(t *testing.T) {
Obj(),
wantErr: nil,
},
+ {
+ name: "can update the kueue.x-k8s.io/job-min-parallelism annotation",
+ oldJob: testingutil.MakeJob("job", "default").
+ Parallelism(4).
+ Completions(6).
+ SetAnnotation(JobMinParallelismAnnotation, "3").
+ Obj(),
+ newJob: testingutil.MakeJob("job", "default").
+ Parallelism(4).
+ Completions(6).
+ SetAnnotation(JobMinParallelismAnnotation, "2").
+ Obj(),
+ wantErr: nil,
+ },
+ {
+ name: "validates kueue.x-k8s.io/job-min-parallelism annotation value (bad format)",
+ oldJob: testingutil.MakeJob("job", "default").
+ Parallelism(4).
+ Completions(6).
+ SetAnnotation(JobMinParallelismAnnotation, "3").
+ Obj(),
+ newJob: testingutil.MakeJob("job", "default").
+ Parallelism(4).
+ Completions(6).
+ SetAnnotation(JobMinParallelismAnnotation, "NaN").
+ Obj(),
+ wantErr: field.ErrorList{
+ field.Invalid(minPodsCountAnnotationsPath, "NaN", "strconv.Atoi: parsing \"NaN\": invalid syntax"),
+ },
+ },
}
for _, tc := range testcases {
@@ -459,12 +489,12 @@ func TestDefault(t *testing.T) {
Obj(),
},
admissionCheck: utiltesting.MakeAdmissionCheck("admission-check").
- ControllerName(v1alpha1.MultiKueueControllerName).
+ ControllerName(kueue.MultiKueueControllerName).
Active(metav1.ConditionTrue).
Obj(),
want: testingutil.MakeJob("job", "default").
Queue("local-queue").
- ManagedBy(v1alpha1.MultiKueueControllerName).
+ ManagedBy(kueue.MultiKueueControllerName).
Obj(),
multiKueueEnabled: true,
multiKueueBatchJobWithManagedByEnabled: true,
@@ -486,7 +516,7 @@ func TestDefault(t *testing.T) {
Obj(),
},
admissionCheck: utiltesting.MakeAdmissionCheck("admission-check").
- ControllerName(v1alpha1.MultiKueueControllerName).
+ ControllerName(kueue.MultiKueueControllerName).
Active(metav1.ConditionTrue).
Obj(),
want: testingutil.MakeJob("job", "default").
@@ -510,8 +540,8 @@ func TestDefault(t *testing.T) {
}
for name, tc := range testcases {
t.Run(name, func(t *testing.T) {
- defer features.SetFeatureGateDuringTest(t, features.MultiKueue, tc.multiKueueEnabled)()
- defer features.SetFeatureGateDuringTest(t, features.MultiKueueBatchJobWithManagedBy, tc.multiKueueBatchJobWithManagedByEnabled)()
+ features.SetFeatureGateDuringTest(t, features.MultiKueue, tc.multiKueueEnabled)
+ features.SetFeatureGateDuringTest(t, features.MultiKueueBatchJobWithManagedBy, tc.multiKueueBatchJobWithManagedByEnabled)
ctx, _ := utiltesting.ContextWithLog(t)
diff --git a/pkg/controller/jobs/jobs.go b/pkg/controller/jobs/jobs.go
index c2b075050ba..ba6c0ccc454 100644
--- a/pkg/controller/jobs/jobs.go
+++ b/pkg/controller/jobs/jobs.go
@@ -18,6 +18,7 @@ package jobs
// Reference the job framework integration packages to ensure linking.
import (
+ _ "sigs.k8s.io/kueue/pkg/controller/jobs/deployment"
_ "sigs.k8s.io/kueue/pkg/controller/jobs/job"
_ "sigs.k8s.io/kueue/pkg/controller/jobs/jobset"
_ "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs"
diff --git a/pkg/controller/jobs/jobset/jobset_multikueue_adapter.go b/pkg/controller/jobs/jobset/jobset_multikueue_adapter.go
index 895b6ca0399..b7bea35b1cc 100644
--- a/pkg/controller/jobs/jobset/jobset_multikueue_adapter.go
+++ b/pkg/controller/jobs/jobset/jobset_multikueue_adapter.go
@@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
jobset "sigs.k8s.io/jobset/api/jobset/v1alpha2"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/util/api"
@@ -71,7 +71,7 @@ func (b *multikueueAdapter) SyncJob(ctx context.Context, localClient client.Clie
remoteJob.Labels = map[string]string{}
}
remoteJob.Labels[constants.PrebuiltWorkloadLabel] = workloadName
- remoteJob.Labels[kueuealpha.MultiKueueOriginLabel] = origin
+ remoteJob.Labels[kueue.MultiKueueOriginLabel] = origin
// clear the managedBy enables the JobSet controller to take over
remoteJob.Spec.ManagedBy = nil
@@ -99,8 +99,8 @@ func (b *multikueueAdapter) IsJobManagedByKueue(ctx context.Context, c client.Cl
return false, "", err
}
jobsetControllerName := ptr.Deref(js.Spec.ManagedBy, "")
- if jobsetControllerName != kueuealpha.MultiKueueControllerName {
- return false, fmt.Sprintf("Expecting spec.managedBy to be %q not %q", kueuealpha.MultiKueueControllerName, jobsetControllerName), nil
+ if jobsetControllerName != kueue.MultiKueueControllerName {
+ return false, fmt.Sprintf("Expecting spec.managedBy to be %q not %q", kueue.MultiKueueControllerName, jobsetControllerName), nil
}
return true, "", nil
}
diff --git a/pkg/controller/jobs/jobset/jobset_multikueue_adapter_test.go b/pkg/controller/jobs/jobset/jobset_multikueue_adapter_test.go
index 78fc264af56..68b74a2b602 100644
--- a/pkg/controller/jobs/jobset/jobset_multikueue_adapter_test.go
+++ b/pkg/controller/jobs/jobset/jobset_multikueue_adapter_test.go
@@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
jobsetapi "sigs.k8s.io/jobset/api/jobset/v1alpha2"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/util/slices"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
@@ -47,7 +47,7 @@ func TestMultikueueAdapter(t *testing.T) {
}
baseJobSetBuilder := utiltestingjobset.MakeJobSet("jobset1", TestNamespace)
- baseJobSetManagedByKueueBuilder := baseJobSetBuilder.DeepCopy().ManagedBy(kueuealpha.MultiKueueControllerName)
+ baseJobSetManagedByKueueBuilder := baseJobSetBuilder.DeepCopy().ManagedBy(kueue.MultiKueueControllerName)
cases := map[string]struct {
managersJobSets []jobsetapi.JobSet
@@ -74,7 +74,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerJobSets: []jobsetapi.JobSet{
*baseJobSetBuilder.DeepCopy().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
},
@@ -85,7 +85,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerJobSets: []jobsetapi.JobSet{
*baseJobSetBuilder.DeepCopy().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
JobsStatus(
jobsetapi.ReplicatedJobStatus{
Name: "replicated-job-1",
@@ -123,7 +123,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerJobSets: []jobsetapi.JobSet{
*baseJobSetBuilder.DeepCopy().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
JobsStatus(
jobsetapi.ReplicatedJobStatus{
Name: "replicated-job-1",
@@ -143,7 +143,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerJobSets: []jobsetapi.JobSet{
*baseJobSetBuilder.DeepCopy().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
JobsStatus(
jobsetapi.ReplicatedJobStatus{
Name: "replicated-job-1",
diff --git a/pkg/controller/jobs/jobset/jobset_webhook.go b/pkg/controller/jobs/jobset/jobset_webhook.go
index b51627a142c..761227308cd 100644
--- a/pkg/controller/jobs/jobset/jobset_webhook.go
+++ b/pkg/controller/jobs/jobset/jobset_webhook.go
@@ -23,14 +23,14 @@ import (
"k8s.io/klog/v2"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
jobsetapi "sigs.k8s.io/jobset/api/jobset/v1alpha2"
- "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/cache"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework/webhook"
"sigs.k8s.io/kueue/pkg/features"
"sigs.k8s.io/kueue/pkg/queue"
)
@@ -49,16 +49,17 @@ func SetupJobSetWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
queues: options.Queues,
cache: options.Cache,
}
- return ctrl.NewWebhookManagedBy(mgr).
- For(&jobsetapi.JobSet{}).
- WithDefaulter(wh).
+ obj := &jobsetapi.JobSet{}
+ return webhook.WebhookManagedBy(mgr).
+ For(obj).
+ WithMutationHandler(webhook.WithLosslessDefaulter(mgr.GetScheme(), obj, wh)).
WithValidator(wh).
Complete()
}
// +kubebuilder:webhook:path=/mutate-jobset-x-k8s-io-v1alpha2-jobset,mutating=true,failurePolicy=fail,sideEffects=None,groups=jobset.x-k8s.io,resources=jobsets,verbs=create,versions=v1alpha2,name=mjobset.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomDefaulter = &JobSetWebhook{}
+var _ admission.CustomDefaulter = &JobSetWebhook{}
// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (w *JobSetWebhook) Default(ctx context.Context, obj runtime.Object) error {
@@ -79,9 +80,9 @@ func (w *JobSetWebhook) Default(ctx context.Context, obj runtime.Object) error {
return nil
}
for _, admissionCheck := range w.cache.AdmissionChecksForClusterQueue(clusterQueueName) {
- if admissionCheck.Controller == v1alpha1.MultiKueueControllerName {
- log.V(5).Info("Defaulting ManagedBy", "jobset", klog.KObj(jobSet), "oldManagedBy", jobSet.Spec.ManagedBy, "managedBy", v1alpha1.MultiKueueControllerName)
- jobSet.Spec.ManagedBy = ptr.To(v1alpha1.MultiKueueControllerName)
+ if admissionCheck.Controller == kueue.MultiKueueControllerName {
+ log.V(5).Info("Defaulting ManagedBy", "jobset", klog.KObj(jobSet), "oldManagedBy", jobSet.Spec.ManagedBy, "managedBy", kueue.MultiKueueControllerName)
+ jobSet.Spec.ManagedBy = ptr.To(kueue.MultiKueueControllerName)
return nil
}
}
@@ -97,7 +98,7 @@ func canDefaultManagedBy(jobSetSpecManagedBy *string) bool {
// +kubebuilder:webhook:path=/validate-jobset-x-k8s-io-v1alpha2-jobset,mutating=false,failurePolicy=fail,sideEffects=None,groups=jobset.x-k8s.io,resources=jobsets,verbs=create;update,versions=v1alpha2,name=vjobset.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomValidator = &JobSetWebhook{}
+var _ admission.CustomValidator = &JobSetWebhook{}
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
func (w *JobSetWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
diff --git a/pkg/controller/jobs/jobset/jobset_webhook_test.go b/pkg/controller/jobs/jobset/jobset_webhook_test.go
index 28459c0b40a..20b8b8c177a 100644
--- a/pkg/controller/jobs/jobset/jobset_webhook_test.go
+++ b/pkg/controller/jobs/jobset/jobset_webhook_test.go
@@ -29,7 +29,6 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
jobset "sigs.k8s.io/jobset/api/jobset/v1alpha2"
- "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/cache"
"sigs.k8s.io/kueue/pkg/controller/constants"
@@ -118,11 +117,11 @@ func TestDefault(t *testing.T) {
Obj(),
},
admissionCheck: utiltesting.MakeAdmissionCheck("admission-check").
- ControllerName(v1alpha1.MultiKueueControllerName).
+ ControllerName(kueue.MultiKueueControllerName).
Active(metav1.ConditionTrue).
Obj(),
multiKueueEnabled: true,
- wantManagedBy: ptr.To(v1alpha1.MultiKueueControllerName),
+ wantManagedBy: ptr.To(kueue.MultiKueueControllerName),
},
{
name: "TestDefault_WithQueueLabel",
@@ -145,11 +144,11 @@ func TestDefault(t *testing.T) {
Obj(),
},
admissionCheck: utiltesting.MakeAdmissionCheck("admission-check").
- ControllerName(v1alpha1.MultiKueueControllerName).
+ ControllerName(kueue.MultiKueueControllerName).
Active(metav1.ConditionTrue).
Obj(),
multiKueueEnabled: true,
- wantManagedBy: ptr.To(v1alpha1.MultiKueueControllerName),
+ wantManagedBy: ptr.To(kueue.MultiKueueControllerName),
},
{
name: "TestDefault_WithoutQueueLabel",
@@ -225,7 +224,7 @@ func TestDefault(t *testing.T) {
Obj(),
},
admissionCheck: utiltesting.MakeAdmissionCheck("admission-check").
- ControllerName(v1alpha1.MultiKueueControllerName).
+ ControllerName(kueue.MultiKueueControllerName).
Active(metav1.ConditionTrue).
Obj(),
multiKueueEnabled: false,
@@ -255,7 +254,7 @@ func TestDefault(t *testing.T) {
Obj(),
},
admissionCheck: utiltesting.MakeAdmissionCheck("admission-check").
- ControllerName(v1alpha1.MultiKueueControllerName).
+ ControllerName(kueue.MultiKueueControllerName).
Active(metav1.ConditionTrue).
Obj(),
multiKueueEnabled: true,
@@ -287,7 +286,7 @@ func TestDefault(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
- defer features.SetFeatureGateDuringTest(t, features.MultiKueue, tc.multiKueueEnabled)()
+ features.SetFeatureGateDuringTest(t, features.MultiKueue, tc.multiKueueEnabled)
ctx, _ := utiltesting.ContextWithLog(t)
diff --git a/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_controller.go b/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_controller.go
index ce52319e11a..1e159bb005d 100644
--- a/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_controller.go
+++ b/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_controller.go
@@ -36,8 +36,18 @@ import (
var (
gvk = kftraining.SchemeGroupVersion.WithKind(kftraining.MXJobKind)
FrameworkName = "kubeflow.org/mxjob"
+
+ SetupMXJobWebhook = jobframework.BaseWebhookFactory(
+ NewJob(),
+ func(o runtime.Object) jobframework.GenericJob {
+ return fromObject(o)
+ },
+ )
)
+// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-mxjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mxjobs,verbs=create,versions=v1,name=mmxjob.kb.io,admissionReviewVersions=v1
+// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-mxjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mxjobs,verbs=create;update,versions=v1,name=vmxjob.kb.io,admissionReviewVersions=v1
+
func init() {
utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
diff --git a/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook.go b/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook.go
deleted file mode 100644
index 14237a41473..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package mxjob
-
-import (
- "context"
-
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/klog/v2"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
-
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
-)
-
-type MXJobWebhook struct {
- manageJobsWithoutQueueName bool
-}
-
-// SetupMXJobWebhook configures the webhook for kubeflow MXJob.
-func SetupMXJobWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
- options := jobframework.ProcessOptions(opts...)
- wh := &MXJobWebhook{
- manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
- }
- return ctrl.NewWebhookManagedBy(mgr).
- For(&kftraining.MXJob{}).
- WithDefaulter(wh).
- WithValidator(wh).
- Complete()
-}
-
-// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-mxjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mxjobs,verbs=create,versions=v1,name=mmxjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomDefaulter = &MXJobWebhook{}
-
-// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
-func (w *MXJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("mxjob-webhook")
- log.V(5).Info("Applying defaults", "mxjob", klog.KObj(job.Object()))
- jobframework.ApplyDefaultForSuspend(job, w.manageJobsWithoutQueueName)
- return nil
-}
-
-// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-mxjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mxjobs,verbs=create;update,versions=v1,name=vmxjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomValidator = &MXJobWebhook{}
-
-// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *MXJobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("mxjob-webhook")
- log.V(5).Info("Validating create", "mxjob", klog.KObj(job.Object()))
- return nil, validateCreate(job).ToAggregate()
-}
-
-func validateCreate(job jobframework.GenericJob) field.ErrorList {
- return jobframework.ValidateJobOnCreate(job)
-}
-
-// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *MXJobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
- oldJob := fromObject(oldObj)
- newJob := fromObject(newObj)
- log := ctrl.LoggerFrom(ctx).WithName("mxjob-webhook")
- log.Info("Validating update", "mxjob", klog.KObj(newJob.Object()))
- allErrs := jobframework.ValidateJobOnUpdate(oldJob, newJob)
- return nil, allErrs.ToAggregate()
-}
-
-// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *MXJobWebhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
- return nil, nil
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook_test.go b/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook_test.go
deleted file mode 100644
index 40336f0c548..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package mxjob
-
-import (
- "context"
- "testing"
-
- "github.com/google/go-cmp/cmp"
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
-
- testingutil "sigs.k8s.io/kueue/pkg/util/testingjobs/mxjob"
-)
-
-func TestDefault(t *testing.T) {
- testcases := map[string]struct {
- job *kftraining.MXJob
- manageJobsWithoutQueueName bool
- want *kftraining.MXJob
- }{
- "update the suspend field with 'manageJobsWithoutQueueName=false'": {
- job: testingutil.MakeMXJob("job", "default").Queue("queue").Suspend(false).Obj(),
- want: testingutil.MakeMXJob("job", "default").Queue("queue").Obj(),
- },
- "update the suspend field 'manageJobsWithoutQueueName=true'": {
- job: testingutil.MakeMXJob("job", "default").Suspend(false).Obj(),
- manageJobsWithoutQueueName: true,
- want: testingutil.MakeMXJob("job", "default").Obj(),
- },
- }
- for name, tc := range testcases {
- t.Run(name, func(t *testing.T) {
- w := &MXJobWebhook{manageJobsWithoutQueueName: tc.manageJobsWithoutQueueName}
- if err := w.Default(context.Background(), tc.job); err != nil {
- t.Errorf("set defaults to a kubeflow.org/mxjob by a Defaulter")
- }
- if diff := cmp.Diff(tc.want, tc.job); len(diff) != 0 {
- t.Errorf("Default() mismatch (-want,+got):\n%s", diff)
- }
- })
- }
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_controller.go b/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_controller.go
index 7d3e78d822c..80db4bf6632 100644
--- a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_controller.go
+++ b/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_controller.go
@@ -36,8 +36,18 @@ import (
var (
gvk = kftraining.SchemeGroupVersion.WithKind(kftraining.PaddleJobKind)
FrameworkName = "kubeflow.org/paddlejob"
+
+ SetupPaddleJobWebhook = jobframework.BaseWebhookFactory(
+ NewJob(),
+ func(o runtime.Object) jobframework.GenericJob {
+ return fromObject(o)
+ },
+ )
)
+// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-paddlejob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=paddlejobs,verbs=create,versions=v1,name=mpaddlejob.kb.io,admissionReviewVersions=v1
+// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-paddlejob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=paddlejobs,verbs=create;update,versions=v1,name=vpaddlejob.kb.io,admissionReviewVersions=v1
+
func init() {
utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
diff --git a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_multikueue_adapter_test.go b/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_multikueue_adapter_test.go
index d896d989b46..fb479f9aefe 100644
--- a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_multikueue_adapter_test.go
+++ b/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_multikueue_adapter_test.go
@@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/kubeflowjob"
@@ -75,7 +75,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerPaddleJobs: []kftraining.PaddleJob{
*paddleJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
},
@@ -86,7 +86,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerPaddleJobs: []kftraining.PaddleJob{
*paddleJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -102,7 +102,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerPaddleJobs: []kftraining.PaddleJob{
*paddleJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -111,7 +111,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerPaddleJobs: []kftraining.PaddleJob{
*paddleJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
operation: func(ctx context.Context, adapter jobframework.MultiKueueAdapter, managerClient, workerClient client.Client) error {
diff --git a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_webhook.go b/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_webhook.go
deleted file mode 100644
index f4f523119f2..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_webhook.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package paddlejob
-
-import (
- "context"
-
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/klog/v2"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
-
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
-)
-
-type PaddleJobWebhook struct {
- manageJobsWithoutQueueName bool
-}
-
-// SetupPaddleJobWebhook configures the webhook for kubeflow PaddleJob.
-func SetupPaddleJobWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
- options := jobframework.ProcessOptions(opts...)
- wh := &PaddleJobWebhook{
- manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
- }
- return ctrl.NewWebhookManagedBy(mgr).
- For(&kftraining.PaddleJob{}).
- WithDefaulter(wh).
- WithValidator(wh).
- Complete()
-}
-
-// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-paddlejob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=paddlejobs,verbs=create,versions=v1,name=mpaddlejob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomDefaulter = &PaddleJobWebhook{}
-
-// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
-func (w *PaddleJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("paddlejob-webhook")
- log.V(5).Info("Applying defaults", "paddlejob", klog.KObj(job.Object()))
- jobframework.ApplyDefaultForSuspend(job, w.manageJobsWithoutQueueName)
- return nil
-}
-
-// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-paddlejob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=paddlejobs,verbs=create;update,versions=v1,name=vpaddlejob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomValidator = &PaddleJobWebhook{}
-
-// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *PaddleJobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("paddlejob-webhook")
- log.Info("Validating create", "paddlejob", klog.KObj(job.Object()))
- return nil, validateCreate(job).ToAggregate()
-}
-
-func validateCreate(job jobframework.GenericJob) field.ErrorList {
- return jobframework.ValidateJobOnCreate(job)
-}
-
-// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *PaddleJobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
- oldJob := fromObject(oldObj)
- newJob := fromObject(newObj)
- log := ctrl.LoggerFrom(ctx).WithName("paddlejob-webhook")
- log.Info("Validating update", "paddlejob", klog.KObj(newJob.Object()))
- allErrs := jobframework.ValidateJobOnUpdate(oldJob, newJob)
- return nil, allErrs.ToAggregate()
-}
-
-// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *PaddleJobWebhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
- return nil, nil
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_webhook_test.go b/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_webhook_test.go
deleted file mode 100644
index 3470aab27e9..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_webhook_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package paddlejob
-
-import (
- "context"
- "testing"
-
- "github.com/google/go-cmp/cmp"
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
-
- testingutil "sigs.k8s.io/kueue/pkg/util/testingjobs/paddlejob"
-)
-
-func TestDefault(t *testing.T) {
- testcases := map[string]struct {
- job *kftraining.PaddleJob
- manageJobsWithoutQueueName bool
- want *kftraining.PaddleJob
- }{
- "update the suspend field with 'manageJobsWithoutQueueName=false'": {
- job: testingutil.MakePaddleJob("job", "default").Queue("queue").Suspend(false).Obj(),
- want: testingutil.MakePaddleJob("job", "default").Queue("queue").Obj(),
- },
- "update the suspend field 'manageJobsWithoutQueueName=true'": {
- job: testingutil.MakePaddleJob("job", "default").Suspend(false).Obj(),
- manageJobsWithoutQueueName: true,
- want: testingutil.MakePaddleJob("job", "default").Obj(),
- },
- }
- for name, tc := range testcases {
- t.Run(name, func(t *testing.T) {
- w := &PaddleJobWebhook{manageJobsWithoutQueueName: tc.manageJobsWithoutQueueName}
- if err := w.Default(context.Background(), tc.job); err != nil {
- t.Errorf("set defaults to a kubeflow.org/paddlejob by a Defaulter")
- }
- if diff := cmp.Diff(tc.want, tc.job); len(diff) != 0 {
- t.Errorf("Default() mismatch (-want,+got):\n%s", diff)
- }
- })
- }
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorch_multikueue_adapter_test.go b/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorch_multikueue_adapter_test.go
index baed632397e..87f10fadbdc 100644
--- a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorch_multikueue_adapter_test.go
+++ b/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorch_multikueue_adapter_test.go
@@ -26,11 +26,10 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
-
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/kubeflowjob"
@@ -75,7 +74,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerPyTorchJobs: []kftraining.PyTorchJob{
*pyTorchJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
},
@@ -86,7 +85,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerPyTorchJobs: []kftraining.PyTorchJob{
*pyTorchJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -102,7 +101,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerPyTorchJobs: []kftraining.PyTorchJob{
*pyTorchJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -111,7 +110,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerPyTorchJobs: []kftraining.PyTorchJob{
*pyTorchJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
operation: func(ctx context.Context, adapter jobframework.MultiKueueAdapter, managerClient, workerClient client.Client) error {
diff --git a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_controller.go b/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_controller.go
index e3a11f42f43..a51f6cf40f1 100644
--- a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_controller.go
+++ b/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_controller.go
@@ -36,8 +36,18 @@ import (
var (
gvk = kftraining.SchemeGroupVersion.WithKind(kftraining.PyTorchJobKind)
FrameworkName = "kubeflow.org/pytorchjob"
+
+ SetupPyTorchJobWebhook = jobframework.BaseWebhookFactory(
+ NewJob(),
+ func(o runtime.Object) jobframework.GenericJob {
+ return fromObject(o)
+ },
+ )
)
+// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-pytorchjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=pytorchjobs,verbs=create,versions=v1,name=mpytorchjob.kb.io,admissionReviewVersions=v1
+// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-pytorchjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=pytorchjobs,verbs=create;update,versions=v1,name=vpytorchjob.kb.io,admissionReviewVersions=v1
+
func init() {
utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
diff --git a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_webhook.go b/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_webhook.go
deleted file mode 100644
index 5f2afa9a6ee..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_webhook.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package pytorchjob
-
-import (
- "context"
-
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/klog/v2"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
-
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
-)
-
-type PyTorchJobWebhook struct {
- manageJobsWithoutQueueName bool
-}
-
-// SetupPyTorchJobWebhook configures the webhook for kubeflow PyTorchJob.
-func SetupPyTorchJobWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
- options := jobframework.ProcessOptions(opts...)
- wh := &PyTorchJobWebhook{
- manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
- }
- return ctrl.NewWebhookManagedBy(mgr).
- For(&kftraining.PyTorchJob{}).
- WithDefaulter(wh).
- WithValidator(wh).
- Complete()
-}
-
-// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-pytorchjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=pytorchjobs,verbs=create,versions=v1,name=mpytorchjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomDefaulter = &PyTorchJobWebhook{}
-
-// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
-func (w *PyTorchJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("pytorchjob-webhook")
- log.V(5).Info("Applying defaults", "pytorchjob", klog.KObj(job.Object()))
- jobframework.ApplyDefaultForSuspend(job, w.manageJobsWithoutQueueName)
- return nil
-}
-
-// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-pytorchjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=pytorchjobs,verbs=create;update,versions=v1,name=vpytorchjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomValidator = &PyTorchJobWebhook{}
-
-// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *PyTorchJobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("pytorchjob-webhook")
- log.Info("Validating create", "pytorchjob", klog.KObj(job.Object()))
- return nil, validateCreate(job).ToAggregate()
-}
-
-func validateCreate(job jobframework.GenericJob) field.ErrorList {
- return jobframework.ValidateJobOnCreate(job)
-}
-
-// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *PyTorchJobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
- oldJob := fromObject(oldObj)
- newJob := fromObject(newObj)
- log := ctrl.LoggerFrom(ctx).WithName("pytorchjob-webhook")
- log.Info("Validating update", "pytorchjob", klog.KObj(newJob.Object()))
- allErrs := jobframework.ValidateJobOnUpdate(oldJob, newJob)
- return nil, allErrs.ToAggregate()
-}
-
-// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *PyTorchJobWebhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
- return nil, nil
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_webhook_test.go b/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_webhook_test.go
deleted file mode 100644
index 0e57c0d0700..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_webhook_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package pytorchjob
-
-import (
- "context"
- "testing"
-
- "github.com/google/go-cmp/cmp"
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
-
- testingutil "sigs.k8s.io/kueue/pkg/util/testingjobs/pytorchjob"
-)
-
-func TestDefault(t *testing.T) {
- testcases := map[string]struct {
- job *kftraining.PyTorchJob
- manageJobsWithoutQueueName bool
- want *kftraining.PyTorchJob
- }{
- "update the suspend field with 'manageJobsWithoutQueueName=false'": {
- job: testingutil.MakePyTorchJob("job", "default").Queue("queue").Suspend(false).Obj(),
- want: testingutil.MakePyTorchJob("job", "default").Queue("queue").Obj(),
- },
- "update the suspend field 'manageJobsWithoutQueueName=true'": {
- job: testingutil.MakePyTorchJob("job", "default").Suspend(false).Obj(),
- manageJobsWithoutQueueName: true,
- want: testingutil.MakePyTorchJob("job", "default").Obj(),
- },
- }
- for name, tc := range testcases {
- t.Run(name, func(t *testing.T) {
- w := &PyTorchJobWebhook{manageJobsWithoutQueueName: tc.manageJobsWithoutQueueName}
- if err := w.Default(context.Background(), tc.job); err != nil {
- t.Errorf("set defaults to a kubeflow.org/pytorchjob by a Defaulter")
- }
- if diff := cmp.Diff(tc.want, tc.job); len(diff) != 0 {
- t.Errorf("Default() mismatch (-want,+got):\n%s", diff)
- }
- })
- }
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_controller.go b/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_controller.go
index 0b3d9bf715e..2ac630f5ee9 100644
--- a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_controller.go
+++ b/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_controller.go
@@ -36,8 +36,18 @@ import (
var (
gvk = kftraining.SchemeGroupVersion.WithKind(kftraining.TFJobKind)
FrameworkName = "kubeflow.org/tfjob"
+
+ SetupTFJobWebhook = jobframework.BaseWebhookFactory(
+ NewJob(),
+ func(o runtime.Object) jobframework.GenericJob {
+ return fromObject(o)
+ },
+ )
)
+// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-tfjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=tfjobs,verbs=create,versions=v1,name=mtfjob.kb.io,admissionReviewVersions=v1
+// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-tfjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=tfjobs,verbs=create;update,versions=v1,name=vtfjob.kb.io,admissionReviewVersions=v1
+
func init() {
utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
diff --git a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_multikueue_adapter_test.go b/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_multikueue_adapter_test.go
index d50de8e7619..c352b75a612 100644
--- a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_multikueue_adapter_test.go
+++ b/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_multikueue_adapter_test.go
@@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/kubeflowjob"
@@ -74,7 +74,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerTFJobs: []kftraining.TFJob{
*tfJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
},
@@ -85,7 +85,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerTFJobs: []kftraining.TFJob{
*tfJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -101,7 +101,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerTFJobs: []kftraining.TFJob{
*tfJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -110,7 +110,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerTFJobs: []kftraining.TFJob{
*tfJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
operation: func(ctx context.Context, adapter jobframework.MultiKueueAdapter, managerClient, workerClient client.Client) error {
diff --git a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_webhook.go b/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_webhook.go
deleted file mode 100644
index bd5e1aa82bc..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_webhook.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package tfjob
-
-import (
- "context"
-
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/klog/v2"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
-
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
-)
-
-type TFJobWebhook struct {
- manageJobsWithoutQueueName bool
-}
-
-// SetupTFJobWebhook configures the webhook for kubeflow TFJob.
-func SetupTFJobWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
- options := jobframework.ProcessOptions(opts...)
- wh := &TFJobWebhook{
- manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
- }
- return ctrl.NewWebhookManagedBy(mgr).
- For(&kftraining.TFJob{}).
- WithDefaulter(wh).
- WithValidator(wh).
- Complete()
-}
-
-// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-tfjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=tfjobs,verbs=create,versions=v1,name=mtfjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomDefaulter = &TFJobWebhook{}
-
-// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
-func (w *TFJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("tfjob-webhook")
- log.V(5).Info("Applying defaults", "tfjob", klog.KObj(job.Object()))
- jobframework.ApplyDefaultForSuspend(job, w.manageJobsWithoutQueueName)
- return nil
-}
-
-// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-tfjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=tfjobs,verbs=create;update,versions=v1,name=vtfjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomValidator = &TFJobWebhook{}
-
-// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *TFJobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("tfjob-webhook")
- log.V(5).Info("Validating create", "tfjob", klog.KObj(job.Object()))
- return nil, validateCreate(job).ToAggregate()
-}
-
-func validateCreate(job jobframework.GenericJob) field.ErrorList {
- return jobframework.ValidateJobOnCreate(job)
-}
-
-// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *TFJobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
- oldJob := fromObject(oldObj)
- newJob := fromObject(newObj)
- log := ctrl.LoggerFrom(ctx).WithName("tfjob-webhook")
- log.Info("Validating update", "tfjob", klog.KObj(newJob.Object()))
- allErrs := jobframework.ValidateJobOnUpdate(oldJob, newJob)
- return nil, allErrs.ToAggregate()
-}
-
-// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *TFJobWebhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
- return nil, nil
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_webhook_test.go b/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_webhook_test.go
deleted file mode 100644
index d4ee6d62845..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_webhook_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package tfjob
-
-import (
- "context"
- "testing"
-
- "github.com/google/go-cmp/cmp"
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
-
- testingutil "sigs.k8s.io/kueue/pkg/util/testingjobs/tfjob"
-)
-
-func TestDefault(t *testing.T) {
- testcases := map[string]struct {
- job *kftraining.TFJob
- manageJobsWithoutQueueName bool
- want *kftraining.TFJob
- }{
- "update the suspend field with 'manageJobsWithoutQueueName=false'": {
- job: testingutil.MakeTFJob("job", "default").Queue("queue").Suspend(false).Obj(),
- want: testingutil.MakeTFJob("job", "default").Queue("queue").Obj(),
- },
- "update the suspend field 'manageJobsWithoutQueueName=true'": {
- job: testingutil.MakeTFJob("job", "default").Suspend(false).Obj(),
- manageJobsWithoutQueueName: true,
- want: testingutil.MakeTFJob("job", "default").Obj(),
- },
- }
- for name, tc := range testcases {
- t.Run(name, func(t *testing.T) {
- w := &TFJobWebhook{manageJobsWithoutQueueName: tc.manageJobsWithoutQueueName}
- if err := w.Default(context.Background(), tc.job); err != nil {
- t.Errorf("set defaults to a kubeflow.org/tfjob by a Defaulter")
- }
- if diff := cmp.Diff(tc.want, tc.job); len(diff) != 0 {
- t.Errorf("Default() mismatch (-want,+got):\n%s", diff)
- }
- })
- }
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_controller.go b/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_controller.go
index 84c1a59f075..f8169f3f1d2 100644
--- a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_controller.go
+++ b/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_controller.go
@@ -36,8 +36,18 @@ import (
var (
gvk = kftraining.SchemeGroupVersion.WithKind(kftraining.XGBoostJobKind)
FrameworkName = "kubeflow.org/xgboostjob"
+
+ SetupXGBoostJobWebhook = jobframework.BaseWebhookFactory(
+ NewJob(),
+ func(o runtime.Object) jobframework.GenericJob {
+ return fromObject(o)
+ },
+ )
)
+// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-xgboostjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=xgboostjobs,verbs=create,versions=v1,name=mxgboostjob.kb.io,admissionReviewVersions=v1
+// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-xgboostjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=xgboostjobs,verbs=create;update,versions=v1,name=vxgboostjob.kb.io,admissionReviewVersions=v1
+
func init() {
utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
diff --git a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_multikueue_adapter_test.go b/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_multikueue_adapter_test.go
index a0084482a30..1731c9f4a67 100644
--- a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_multikueue_adapter_test.go
+++ b/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_multikueue_adapter_test.go
@@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
"sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/kubeflowjob"
@@ -74,7 +74,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerXGBoostJobs: []kftraining.XGBoostJob{
*xgboostJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
},
@@ -85,7 +85,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerXGBoostJobs: []kftraining.XGBoostJob{
*xgboostJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -101,7 +101,7 @@ func TestMultikueueAdapter(t *testing.T) {
wantWorkerXGBoostJobs: []kftraining.XGBoostJob{
*xgboostJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
StatusConditions(kftraining.JobCondition{Type: kftraining.JobSucceeded, Status: corev1.ConditionTrue}).
Obj(),
},
@@ -110,7 +110,7 @@ func TestMultikueueAdapter(t *testing.T) {
workerXGBoostJobs: []kftraining.XGBoostJob{
*xgboostJobBuilder.Clone().
Label(constants.PrebuiltWorkloadLabel, "wl1").
- Label(kueuealpha.MultiKueueOriginLabel, "origin1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
Obj(),
},
operation: func(ctx context.Context, adapter jobframework.MultiKueueAdapter, managerClient, workerClient client.Client) error {
diff --git a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_webhook.go b/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_webhook.go
deleted file mode 100644
index c083f8c1856..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_webhook.go
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package xgboostjob
-
-import (
- "context"
-
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/klog/v2"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
-
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
-)
-
-type XGBoostJobWebhook struct {
- manageJobsWithoutQueueName bool
-}
-
-func SetupXGBoostJobWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
- options := jobframework.ProcessOptions(opts...)
- wh := &XGBoostJobWebhook{
- manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
- }
- return ctrl.NewWebhookManagedBy(mgr).
- For(&kftraining.XGBoostJob{}).
- WithDefaulter(wh).
- WithValidator(wh).
- Complete()
-}
-
-// +kubebuilder:webhook:path=/mutate-kubeflow-org-v1-xgboostjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=xgboostjobs,verbs=create,versions=v1,name=mxgboostjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomDefaulter = &XGBoostJobWebhook{}
-
-// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
-func (w *XGBoostJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("xgboostjob-webhook")
- log.V(5).Info("Applying defaults", "xgboostjob", klog.KObj(job.Object()))
- jobframework.ApplyDefaultForSuspend(job, w.manageJobsWithoutQueueName)
- return nil
-}
-
-// +kubebuilder:webhook:path=/validate-kubeflow-org-v1-xgboostjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=xgboostjobs,verbs=create;update,versions=v1,name=vxgboostjob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomValidator = &XGBoostJobWebhook{}
-
-// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *XGBoostJobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("xgboostjob-webhook")
- log.Info("Validating create", "xgboostjob", klog.KObj(job.Object()))
- return nil, validateCreate(job).ToAggregate()
-}
-
-func validateCreate(job jobframework.GenericJob) field.ErrorList {
- return jobframework.ValidateJobOnCreate(job)
-}
-
-// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *XGBoostJobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
- oldJob := fromObject(oldObj)
- newJob := fromObject(newObj)
- log := ctrl.LoggerFrom(ctx).WithName("xgboostjob-webhook")
- log.Info("Validating update", "xgboostjob", klog.KObj(newJob.Object()))
- allErrs := jobframework.ValidateJobOnUpdate(oldJob, newJob)
- return nil, allErrs.ToAggregate()
-}
-
-// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *XGBoostJobWebhook) ValidateDelete(context.Context, runtime.Object) (admission.Warnings, error) {
- return nil, nil
-}
diff --git a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_webhook_test.go b/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_webhook_test.go
deleted file mode 100644
index 8aa8edb5f5b..00000000000
--- a/pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_webhook_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package xgboostjob
-
-import (
- "context"
- "testing"
-
- "github.com/google/go-cmp/cmp"
- kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
-
- testingutil "sigs.k8s.io/kueue/pkg/util/testingjobs/xgboostjob"
-)
-
-func TestDefault(t *testing.T) {
- testcases := map[string]struct {
- job *kftraining.XGBoostJob
- manageJobsWithoutQueueName bool
- want *kftraining.XGBoostJob
- }{
- "update the suspend field with 'manageJobsWithoutQueueName=false'": {
- job: testingutil.MakeXGBoostJob("job", "default").Queue("queue").Suspend(false).Obj(),
- want: testingutil.MakeXGBoostJob("job", "default").Queue("queue").Obj(),
- },
- "update the suspend field 'manageJobsWithoutQueueName=true'": {
- job: testingutil.MakeXGBoostJob("job", "default").Suspend(false).Obj(),
- manageJobsWithoutQueueName: true,
- want: testingutil.MakeXGBoostJob("job", "default").Obj(),
- },
- }
- for name, tc := range testcases {
- t.Run(name, func(t *testing.T) {
- w := &XGBoostJobWebhook{manageJobsWithoutQueueName: tc.manageJobsWithoutQueueName}
- if err := w.Default(context.Background(), tc.job); err != nil {
- t.Errorf("set defaults to a kubeflow.org/xgboostjob by a Defaulter")
- }
- if diff := cmp.Diff(tc.want, tc.job); len(diff) != 0 {
- t.Errorf("Default() mismatch (-want,+got):\n%s", diff)
- }
- })
- }
-}
diff --git a/pkg/controller/jobs/kubeflow/kubeflowjob/kubeflowjob_multikueue_adapter.go b/pkg/controller/jobs/kubeflow/kubeflowjob/kubeflowjob_multikueue_adapter.go
index f422524848e..6e138537990 100644
--- a/pkg/controller/jobs/kubeflow/kubeflowjob/kubeflowjob_multikueue_adapter.go
+++ b/pkg/controller/jobs/kubeflow/kubeflowjob/kubeflowjob_multikueue_adapter.go
@@ -25,10 +25,9 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2"
-
"sigs.k8s.io/controller-runtime/pkg/client"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
clientutil "sigs.k8s.io/kueue/pkg/util/client"
@@ -113,7 +112,7 @@ func (a adapter[PtrT, T]) SyncJob(
labels = make(map[string]string, 2)
}
labels[constants.PrebuiltWorkloadLabel] = workloadName
- labels[kueuealpha.MultiKueueOriginLabel] = origin
+ labels[kueue.MultiKueueOriginLabel] = origin
remoteJob.SetLabels(labels)
return remoteClient.Create(ctx, remoteJob)
diff --git a/pkg/controller/jobs/mpijob/mpijob_controller.go b/pkg/controller/jobs/mpijob/mpijob_controller.go
index 2dc7113d763..b222d70eaee 100644
--- a/pkg/controller/jobs/mpijob/mpijob_controller.go
+++ b/pkg/controller/jobs/mpijob/mpijob_controller.go
@@ -21,7 +21,7 @@ import (
"fmt"
"strings"
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -37,27 +37,33 @@ import (
)
var (
- gvk = kubeflow.SchemeGroupVersionKind
+ gvk = kfmpi.SchemeGroupVersionKind
FrameworkName = "kubeflow.org/mpijob"
+
+ SetupMPIJobWebhook = jobframework.BaseWebhookFactory(NewJob(), fromObject)
)
+// +kubebuilder:webhook:path=/mutate-kubeflow-org-v2beta1-mpijob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mpijobs,verbs=create,versions=v2beta1,name=mmpijob.kb.io,admissionReviewVersions=v1
+// +kubebuilder:webhook:path=/validate-kubeflow-org-v2beta1-mpijob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mpijobs,verbs=create;update,versions=v2beta1,name=vmpijob.kb.io,admissionReviewVersions=v1
+
func init() {
utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
NewJob: NewJob,
NewReconciler: NewReconciler,
SetupWebhook: SetupMPIJobWebhook,
- JobType: &kubeflow.MPIJob{},
- AddToScheme: kubeflow.AddToScheme,
+ JobType: &kfmpi.MPIJob{},
+ AddToScheme: kfmpi.AddToScheme,
IsManagingObjectsOwner: isMPIJob,
+ MultiKueueAdapter: &multikueueAdapter{},
}))
}
// +kubebuilder:rbac:groups=scheduling.k8s.io,resources=priorityclasses,verbs=list;get;watch
// +kubebuilder:rbac:groups="",resources=events,verbs=create;watch;update;patch
// +kubebuilder:rbac:groups=kubeflow.org,resources=mpijobs,verbs=get;list;watch;update;patch
-// +kubebuilder:rbac:groups=kubeflow.org,resources=mpijobs/status,verbs=get;update
+// +kubebuilder:rbac:groups=kubeflow.org,resources=mpijobs/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=kubeflow.org,resources=mpijobs/finalizers,verbs=get;update
// +kubebuilder:rbac:groups=kueue.x-k8s.io,resources=workloads,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=kueue.x-k8s.io,resources=workloads/status,verbs=get;update;patch
@@ -72,20 +78,20 @@ func NewJob() jobframework.GenericJob {
var NewReconciler = jobframework.NewGenericReconcilerFactory(NewJob)
func isMPIJob(owner *metav1.OwnerReference) bool {
- return owner.Kind == "MPIJob" && strings.HasPrefix(owner.APIVersion, "kubeflow.org/v2")
+ return owner.Kind == "MPIJob" && strings.HasPrefix(owner.APIVersion, kfmpi.SchemeGroupVersion.Group)
}
-type MPIJob kubeflow.MPIJob
+type MPIJob kfmpi.MPIJob
var _ jobframework.GenericJob = (*MPIJob)(nil)
var _ jobframework.JobWithPriorityClass = (*MPIJob)(nil)
func (j *MPIJob) Object() client.Object {
- return (*kubeflow.MPIJob)(j)
+ return (*kfmpi.MPIJob)(j)
}
-func fromObject(o runtime.Object) *MPIJob {
- return (*MPIJob)(o.(*kubeflow.MPIJob))
+func fromObject(o runtime.Object) jobframework.GenericJob {
+ return (*MPIJob)(o.(*kfmpi.MPIJob))
}
func (j *MPIJob) IsSuspended() bool {
@@ -110,7 +116,7 @@ func (j *MPIJob) GVK() schema.GroupVersionKind {
}
func (j *MPIJob) PodLabelSelector() string {
- return fmt.Sprintf("%s=%s,%s=%s", kubeflow.JobNameLabel, j.Name, kubeflow.OperatorNameLabel, kubeflow.OperatorName)
+ return fmt.Sprintf("%s=%s,%s=%s", kfmpi.JobNameLabel, j.Name, kfmpi.OperatorNameLabel, kfmpi.OperatorName)
}
func (j *MPIJob) PodSets() []kueue.PodSet {
@@ -160,8 +166,8 @@ func (j *MPIJob) RestorePodSetsInfo(podSetsInfo []podset.PodSetInfo) bool {
func (j *MPIJob) Finished() (message string, success, finished bool) {
for _, c := range j.Status.Conditions {
- if (c.Type == kubeflow.JobSucceeded || c.Type == kubeflow.JobFailed) && c.Status == corev1.ConditionTrue {
- return c.Message, c.Type != kubeflow.JobFailed, true
+ if (c.Type == kfmpi.JobSucceeded || c.Type == kfmpi.JobFailed) && c.Status == corev1.ConditionTrue {
+ return c.Message, c.Type != kfmpi.JobFailed, true
}
}
@@ -178,9 +184,9 @@ func (j *MPIJob) Finished() (message string, success, finished bool) {
func (j *MPIJob) PriorityClass() string {
if j.Spec.RunPolicy.SchedulingPolicy != nil && len(j.Spec.RunPolicy.SchedulingPolicy.PriorityClass) != 0 {
return j.Spec.RunPolicy.SchedulingPolicy.PriorityClass
- } else if l := j.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher]; l != nil && len(l.Template.Spec.PriorityClassName) != 0 {
+ } else if l := j.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher]; l != nil && len(l.Template.Spec.PriorityClassName) != 0 {
return l.Template.Spec.PriorityClassName
- } else if w := j.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker]; w != nil && len(w.Template.Spec.PriorityClassName) != 0 {
+ } else if w := j.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker]; w != nil && len(w.Template.Spec.PriorityClassName) != 0 {
return w.Template.Spec.PriorityClassName
}
return ""
@@ -188,7 +194,7 @@ func (j *MPIJob) PriorityClass() string {
func (j *MPIJob) PodsReady() bool {
for _, c := range j.Status.Conditions {
- if c.Type == kubeflow.JobRunning && c.Status == corev1.ConditionTrue {
+ if c.Type == kfmpi.JobRunning && c.Status == corev1.ConditionTrue {
return true
}
}
@@ -199,18 +205,18 @@ func SetupIndexes(ctx context.Context, indexer client.FieldIndexer) error {
return jobframework.SetupWorkloadOwnerIndex(ctx, indexer, gvk)
}
-func orderedReplicaTypes(jobSpec *kubeflow.MPIJobSpec) []kubeflow.MPIReplicaType {
- var result []kubeflow.MPIReplicaType
- if _, ok := jobSpec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher]; ok {
- result = append(result, kubeflow.MPIReplicaTypeLauncher)
+func orderedReplicaTypes(jobSpec *kfmpi.MPIJobSpec) []kfmpi.MPIReplicaType {
+ var result []kfmpi.MPIReplicaType
+ if _, ok := jobSpec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher]; ok {
+ result = append(result, kfmpi.MPIReplicaTypeLauncher)
}
- if _, ok := jobSpec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker]; ok {
- result = append(result, kubeflow.MPIReplicaTypeWorker)
+ if _, ok := jobSpec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker]; ok {
+ result = append(result, kfmpi.MPIReplicaTypeWorker)
}
return result
}
-func podsCount(jobSpec *kubeflow.MPIJobSpec, mpiReplicaType kubeflow.MPIReplicaType) int32 {
+func podsCount(jobSpec *kfmpi.MPIJobSpec, mpiReplicaType kfmpi.MPIReplicaType) int32 {
return ptr.Deref(jobSpec.MPIReplicaSpecs[mpiReplicaType].Replicas, 1)
}
diff --git a/pkg/controller/jobs/mpijob/mpijob_controller_test.go b/pkg/controller/jobs/mpijob/mpijob_controller_test.go
index a051520921a..095c4d869a7 100644
--- a/pkg/controller/jobs/mpijob/mpijob_controller_test.go
+++ b/pkg/controller/jobs/mpijob/mpijob_controller_test.go
@@ -21,7 +21,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/record"
@@ -37,30 +37,30 @@ import (
func TestCalcPriorityClassName(t *testing.T) {
testcases := map[string]struct {
- job kubeflow.MPIJob
+ job kfmpi.MPIJob
wantPriorityClassName string
}{
"none priority class name specified": {
- job: kubeflow.MPIJob{},
+ job: kfmpi.MPIJob{},
wantPriorityClassName: "",
},
"priority specified at runPolicy and replicas; use priority in runPolicy": {
- job: kubeflow.MPIJob{
- Spec: kubeflow.MPIJobSpec{
- RunPolicy: kubeflow.RunPolicy{
- SchedulingPolicy: &kubeflow.SchedulingPolicy{
+ job: kfmpi.MPIJob{
+ Spec: kfmpi.MPIJobSpec{
+ RunPolicy: kfmpi.RunPolicy{
+ SchedulingPolicy: &kfmpi.SchedulingPolicy{
PriorityClass: "scheduling-priority",
},
},
- MPIReplicaSpecs: map[kubeflow.MPIReplicaType]*kubeflow.ReplicaSpec{
- kubeflow.MPIReplicaTypeLauncher: {
+ MPIReplicaSpecs: map[kfmpi.MPIReplicaType]*kfmpi.ReplicaSpec{
+ kfmpi.MPIReplicaTypeLauncher: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
PriorityClassName: "launcher-priority",
},
},
},
- kubeflow.MPIReplicaTypeWorker: {
+ kfmpi.MPIReplicaTypeWorker: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
PriorityClassName: "worker-priority",
@@ -73,13 +73,13 @@ func TestCalcPriorityClassName(t *testing.T) {
wantPriorityClassName: "scheduling-priority",
},
"runPolicy present, but without priority; fallback to launcher": {
- job: kubeflow.MPIJob{
- Spec: kubeflow.MPIJobSpec{
- RunPolicy: kubeflow.RunPolicy{
- SchedulingPolicy: &kubeflow.SchedulingPolicy{},
+ job: kfmpi.MPIJob{
+ Spec: kfmpi.MPIJobSpec{
+ RunPolicy: kfmpi.RunPolicy{
+ SchedulingPolicy: &kfmpi.SchedulingPolicy{},
},
- MPIReplicaSpecs: map[kubeflow.MPIReplicaType]*kubeflow.ReplicaSpec{
- kubeflow.MPIReplicaTypeLauncher: {
+ MPIReplicaSpecs: map[kfmpi.MPIReplicaType]*kfmpi.ReplicaSpec{
+ kfmpi.MPIReplicaTypeLauncher: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
PriorityClassName: "launcher-priority",
@@ -92,17 +92,17 @@ func TestCalcPriorityClassName(t *testing.T) {
wantPriorityClassName: "launcher-priority",
},
"specified on launcher takes precedence over worker": {
- job: kubeflow.MPIJob{
- Spec: kubeflow.MPIJobSpec{
- MPIReplicaSpecs: map[kubeflow.MPIReplicaType]*kubeflow.ReplicaSpec{
- kubeflow.MPIReplicaTypeLauncher: {
+ job: kfmpi.MPIJob{
+ Spec: kfmpi.MPIJobSpec{
+ MPIReplicaSpecs: map[kfmpi.MPIReplicaType]*kfmpi.ReplicaSpec{
+ kfmpi.MPIReplicaTypeLauncher: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
PriorityClassName: "launcher-priority",
},
},
},
- kubeflow.MPIReplicaTypeWorker: {
+ kfmpi.MPIReplicaTypeWorker: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
PriorityClassName: "worker-priority",
@@ -115,15 +115,15 @@ func TestCalcPriorityClassName(t *testing.T) {
wantPriorityClassName: "launcher-priority",
},
"launcher present, but without priority; fallback to worker": {
- job: kubeflow.MPIJob{
- Spec: kubeflow.MPIJobSpec{
- MPIReplicaSpecs: map[kubeflow.MPIReplicaType]*kubeflow.ReplicaSpec{
- kubeflow.MPIReplicaTypeLauncher: {
+ job: kfmpi.MPIJob{
+ Spec: kfmpi.MPIJobSpec{
+ MPIReplicaSpecs: map[kfmpi.MPIReplicaType]*kfmpi.ReplicaSpec{
+ kfmpi.MPIReplicaTypeLauncher: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{},
},
},
- kubeflow.MPIReplicaTypeWorker: {
+ kfmpi.MPIReplicaTypeWorker: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
PriorityClassName: "worker-priority",
@@ -136,11 +136,11 @@ func TestCalcPriorityClassName(t *testing.T) {
wantPriorityClassName: "worker-priority",
},
"specified on worker only": {
- job: kubeflow.MPIJob{
- Spec: kubeflow.MPIJobSpec{
- MPIReplicaSpecs: map[kubeflow.MPIReplicaType]*kubeflow.ReplicaSpec{
- kubeflow.MPIReplicaTypeLauncher: {},
- kubeflow.MPIReplicaTypeWorker: {
+ job: kfmpi.MPIJob{
+ Spec: kfmpi.MPIJobSpec{
+ MPIReplicaSpecs: map[kfmpi.MPIReplicaType]*kfmpi.ReplicaSpec{
+ kfmpi.MPIReplicaTypeLauncher: {},
+ kfmpi.MPIReplicaTypeWorker: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
PriorityClassName: "worker-priority",
@@ -153,11 +153,11 @@ func TestCalcPriorityClassName(t *testing.T) {
wantPriorityClassName: "worker-priority",
},
"worker present, but without priority; fallback to empty": {
- job: kubeflow.MPIJob{
- Spec: kubeflow.MPIJobSpec{
- MPIReplicaSpecs: map[kubeflow.MPIReplicaType]*kubeflow.ReplicaSpec{
- kubeflow.MPIReplicaTypeLauncher: {},
- kubeflow.MPIReplicaTypeWorker: {
+ job: kfmpi.MPIJob{
+ Spec: kfmpi.MPIJobSpec{
+ MPIReplicaSpecs: map[kfmpi.MPIReplicaType]*kfmpi.ReplicaSpec{
+ kfmpi.MPIReplicaTypeLauncher: {},
+ kfmpi.MPIReplicaTypeWorker: {
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{},
},
@@ -183,7 +183,7 @@ func TestCalcPriorityClassName(t *testing.T) {
var (
jobCmpOpts = []cmp.Option{
cmpopts.EquateEmpty(),
- cmpopts.IgnoreFields(kubeflow.MPIJob{}, "TypeMeta", "ObjectMeta"),
+ cmpopts.IgnoreFields(kfmpi.MPIJob{}, "TypeMeta", "ObjectMeta"),
}
workloadCmpOpts = []cmp.Option{
cmpopts.EquateEmpty(),
@@ -201,9 +201,9 @@ func TestReconciler(t *testing.T) {
PriorityValue(200)
cases := map[string]struct {
reconcilerOptions []jobframework.Option
- job *kubeflow.MPIJob
+ job *kfmpi.MPIJob
priorityClasses []client.Object
- wantJob *kubeflow.MPIJob
+ wantJob *kfmpi.MPIJob
wantWorkloads []kueue.Workload
wantErr error
}{
@@ -211,8 +211,8 @@ func TestReconciler(t *testing.T) {
reconcilerOptions: []jobframework.Option{
jobframework.WithManageJobsWithoutQueueName(true),
},
- job: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).Obj(),
- wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).Obj(),
+ job: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).Obj(),
+ wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).Obj(),
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("mpijob", "ns").
PodSets(
@@ -226,11 +226,11 @@ func TestReconciler(t *testing.T) {
reconcilerOptions: []jobframework.Option{
jobframework.WithManageJobsWithoutQueueName(true),
},
- job: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).WorkloadPriorityClass("test-wpc").Obj(),
+ job: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).WorkloadPriorityClass("test-wpc").Obj(),
priorityClasses: []client.Object{
baseWPCWrapper.Obj(),
},
- wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).WorkloadPriorityClass("test-wpc").Obj(),
+ wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).WorkloadPriorityClass("test-wpc").Obj(),
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("mpijob", "ns").
PodSets(
@@ -245,11 +245,11 @@ func TestReconciler(t *testing.T) {
reconcilerOptions: []jobframework.Option{
jobframework.WithManageJobsWithoutQueueName(true),
},
- job: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).PriorityClass("test-pc").Obj(),
+ job: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).PriorityClass("test-pc").Obj(),
priorityClasses: []client.Object{
basePCWrapper.Obj(),
},
- wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).PriorityClass("test-pc").Obj(),
+ wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).PriorityClass("test-pc").Obj(),
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("mpijob", "ns").
PodSets(
@@ -264,12 +264,12 @@ func TestReconciler(t *testing.T) {
reconcilerOptions: []jobframework.Option{
jobframework.WithManageJobsWithoutQueueName(true),
},
- job: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).
+ job: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).
WorkloadPriorityClass("test-wpc").PriorityClass("test-pc").Obj(),
priorityClasses: []client.Object{
basePCWrapper.Obj(), baseWPCWrapper.Obj(),
},
- wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").Parallelism(2).
+ wantJob: testingmpijob.MakeMPIJob("mpijob", "ns").GenericLauncherAndWorker().Parallelism(2).
WorkloadPriorityClass("test-wpc").PriorityClass("test-pc").Obj(),
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("mpijob", "ns").
@@ -286,7 +286,7 @@ func TestReconciler(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
ctx, _ := utiltesting.ContextWithLog(t)
- clientBuilder := utiltesting.NewClientBuilder(kubeflow.AddToScheme)
+ clientBuilder := utiltesting.NewClientBuilder(kfmpi.AddToScheme)
if err := SetupIndexes(ctx, utiltesting.AsIndexer(clientBuilder)); err != nil {
t.Fatalf("Could not setup indexes: %v", err)
}
@@ -303,7 +303,7 @@ func TestReconciler(t *testing.T) {
t.Errorf("Reconcile returned error (-want,+got):\n%s", diff)
}
- var gotMpiJob kubeflow.MPIJob
+ var gotMpiJob kfmpi.MPIJob
if err := kClient.Get(ctx, jobKey, &gotMpiJob); err != nil {
t.Fatalf("Could not get Job after reconcile: %v", err)
}
diff --git a/pkg/controller/jobs/mpijob/mpijob_multikueue_adapter.go b/pkg/controller/jobs/mpijob/mpijob_multikueue_adapter.go
new file mode 100644
index 00000000000..483fcb0ce77
--- /dev/null
+++ b/pkg/controller/jobs/mpijob/mpijob_multikueue_adapter.go
@@ -0,0 +1,115 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package mpijob
+
+import (
+ "context"
+ "errors"
+ "fmt"
+
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/klog/v2"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/util/api"
+ clientutil "sigs.k8s.io/kueue/pkg/util/client"
+)
+
+type multikueueAdapter struct{}
+
+var _ jobframework.MultiKueueAdapter = (*multikueueAdapter)(nil)
+
+func (b *multikueueAdapter) SyncJob(ctx context.Context, localClient client.Client, remoteClient client.Client, key types.NamespacedName, workloadName, origin string) error {
+ localJob := kfmpi.MPIJob{}
+ err := localClient.Get(ctx, key, &localJob)
+ if err != nil {
+ return err
+ }
+
+ remoteJob := kfmpi.MPIJob{}
+ err = remoteClient.Get(ctx, key, &remoteJob)
+ if client.IgnoreNotFound(err) != nil {
+ return err
+ }
+
+ // if the remote exists, just copy the status
+ if err == nil {
+ return clientutil.PatchStatus(ctx, localClient, &localJob, func() (bool, error) {
+ localJob.Status = remoteJob.Status
+ return true, nil
+ })
+ }
+
+ remoteJob = kfmpi.MPIJob{
+ ObjectMeta: api.CloneObjectMetaForCreation(&localJob.ObjectMeta),
+ Spec: *localJob.Spec.DeepCopy(),
+ }
+
+ // add the prebuilt workload
+ if remoteJob.Labels == nil {
+ remoteJob.Labels = make(map[string]string, 2)
+ }
+ remoteJob.Labels[constants.PrebuiltWorkloadLabel] = workloadName
+ remoteJob.Labels[kueue.MultiKueueOriginLabel] = origin
+
+ return remoteClient.Create(ctx, &remoteJob)
+}
+
+func (b *multikueueAdapter) DeleteRemoteObject(ctx context.Context, remoteClient client.Client, key types.NamespacedName) error {
+ job := kfmpi.MPIJob{}
+ job.SetName(key.Name)
+ job.SetNamespace(key.Namespace)
+ return client.IgnoreNotFound(remoteClient.Delete(ctx, &job))
+}
+
+func (b *multikueueAdapter) KeepAdmissionCheckPending() bool {
+ return false
+}
+
+func (b *multikueueAdapter) IsJobManagedByKueue(context.Context, client.Client, types.NamespacedName) (bool, string, error) {
+ return true, "", nil
+}
+
+func (b *multikueueAdapter) GVK() schema.GroupVersionKind {
+ return gvk
+}
+
+var _ jobframework.MultiKueueWatcher = (*multikueueAdapter)(nil)
+
+func (*multikueueAdapter) GetEmptyList() client.ObjectList {
+ return &kfmpi.MPIJobList{}
+}
+
+func (*multikueueAdapter) WorkloadKeyFor(o runtime.Object) (types.NamespacedName, error) {
+ job, isJob := o.(*kfmpi.MPIJob)
+ if !isJob {
+ return types.NamespacedName{}, errors.New("not a mpijob")
+ }
+
+ prebuiltWl, hasPrebuiltWorkload := job.Labels[constants.PrebuiltWorkloadLabel]
+ if !hasPrebuiltWorkload {
+ return types.NamespacedName{}, fmt.Errorf("no prebuilt workload found for mpijob: %s", klog.KObj(job))
+ }
+
+ return types.NamespacedName{Name: prebuiltWl, Namespace: job.Namespace}, nil
+}
diff --git a/pkg/controller/jobs/mpijob/mpijob_multikueue_adapter_test.go b/pkg/controller/jobs/mpijob/mpijob_multikueue_adapter_test.go
new file mode 100644
index 00000000000..fce02d791d2
--- /dev/null
+++ b/pkg/controller/jobs/mpijob/mpijob_multikueue_adapter_test.go
@@ -0,0 +1,160 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package mpijob
+
+import (
+ "context"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ corev1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/client/interceptor"
+
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/pkg/util/slices"
+ utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
+ utiltestingmpijob "sigs.k8s.io/kueue/pkg/util/testingjobs/mpijob"
+)
+
+const (
+ TestNamespace = "ns"
+)
+
+func TestMultikueueAdapter(t *testing.T) {
+ objCheckOpts := []cmp.Option{
+ cmpopts.IgnoreFields(metav1.ObjectMeta{}, "ResourceVersion"),
+ cmpopts.EquateEmpty(),
+ }
+
+ mpiJobBuilder := utiltestingmpijob.MakeMPIJob("mpijob1", TestNamespace)
+
+ cases := map[string]struct {
+ managersJobSets []kfmpi.MPIJob
+ workerJobSets []kfmpi.MPIJob
+
+ operation func(ctx context.Context, adapter *multikueueAdapter, managerClient, workerClient client.Client) error
+
+ wantError error
+ wantManagersJobSets []kfmpi.MPIJob
+ wantWorkerJobSets []kfmpi.MPIJob
+ }{
+
+ "sync creates missing remote mpijob": {
+ managersJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.DeepCopy(),
+ },
+ operation: func(ctx context.Context, adapter *multikueueAdapter, managerClient, workerClient client.Client) error {
+ return adapter.SyncJob(ctx, managerClient, workerClient, types.NamespacedName{Name: "mpijob1", Namespace: TestNamespace}, "wl1", "origin1")
+ },
+
+ wantManagersJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.DeepCopy(),
+ },
+ wantWorkerJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.Clone().
+ Label(constants.PrebuiltWorkloadLabel, "wl1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
+ Obj(),
+ },
+ },
+ "sync status from remote mpijob": {
+ managersJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.DeepCopy(),
+ },
+ workerJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.Clone().
+ Label(constants.PrebuiltWorkloadLabel, "wl1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
+ StatusConditions(kfmpi.JobCondition{Type: kfmpi.JobSucceeded, Status: corev1.ConditionTrue}).
+ Obj(),
+ },
+ operation: func(ctx context.Context, adapter *multikueueAdapter, managerClient, workerClient client.Client) error {
+ return adapter.SyncJob(ctx, managerClient, workerClient, types.NamespacedName{Name: "mpijob1", Namespace: TestNamespace}, "wl1", "origin1")
+ },
+
+ wantManagersJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.Clone().
+ StatusConditions(kfmpi.JobCondition{Type: kfmpi.JobSucceeded, Status: corev1.ConditionTrue}).
+ Obj(),
+ },
+ wantWorkerJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.Clone().
+ Label(constants.PrebuiltWorkloadLabel, "wl1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
+ StatusConditions(kfmpi.JobCondition{Type: kfmpi.JobSucceeded, Status: corev1.ConditionTrue}).
+ Obj(),
+ },
+ },
+ "remote mpijob is deleted": {
+ workerJobSets: []kfmpi.MPIJob{
+ *mpiJobBuilder.Clone().
+ Label(constants.PrebuiltWorkloadLabel, "wl1").
+ Label(kueue.MultiKueueOriginLabel, "origin1").
+ Obj(),
+ },
+ operation: func(ctx context.Context, adapter *multikueueAdapter, managerClient, workerClient client.Client) error {
+ return adapter.DeleteRemoteObject(ctx, workerClient, types.NamespacedName{Name: "mpijob1", Namespace: TestNamespace})
+ },
+ },
+ }
+ for name, tc := range cases {
+ t.Run(name, func(t *testing.T) {
+ managerBuilder := utiltesting.NewClientBuilder(kfmpi.AddToScheme).WithInterceptorFuncs(interceptor.Funcs{SubResourcePatch: utiltesting.TreatSSAAsStrategicMerge})
+ managerBuilder = managerBuilder.WithLists(&kfmpi.MPIJobList{Items: tc.managersJobSets})
+ managerBuilder = managerBuilder.WithStatusSubresource(slices.Map(tc.managersJobSets, func(w *kfmpi.MPIJob) client.Object { return w })...)
+ managerClient := managerBuilder.Build()
+
+ workerBuilder := utiltesting.NewClientBuilder(kfmpi.AddToScheme).WithInterceptorFuncs(interceptor.Funcs{SubResourcePatch: utiltesting.TreatSSAAsStrategicMerge})
+ workerBuilder = workerBuilder.WithLists(&kfmpi.MPIJobList{Items: tc.workerJobSets})
+ workerClient := workerBuilder.Build()
+
+ ctx, _ := utiltesting.ContextWithLog(t)
+
+ adapter := &multikueueAdapter{}
+
+ gotErr := tc.operation(ctx, adapter, managerClient, workerClient)
+
+ if diff := cmp.Diff(tc.wantError, gotErr, cmpopts.EquateErrors()); diff != "" {
+ t.Errorf("unexpected error (-want/+got):\n%s", diff)
+ }
+
+ gotManagersJobSets := &kfmpi.MPIJobList{}
+ if err := managerClient.List(ctx, gotManagersJobSets); err != nil {
+ t.Errorf("unexpected list manager's mpijobs error %s", err)
+ } else {
+ if diff := cmp.Diff(tc.wantManagersJobSets, gotManagersJobSets.Items, objCheckOpts...); diff != "" {
+ t.Errorf("unexpected manager's mpijobs (-want/+got):\n%s", diff)
+ }
+ }
+
+ gotWorkerJobSets := &kfmpi.MPIJobList{}
+ if err := workerClient.List(ctx, gotWorkerJobSets); err != nil {
+ t.Errorf("unexpected list worker's mpijobs error %s", err)
+ } else {
+ if diff := cmp.Diff(tc.wantWorkerJobSets, gotWorkerJobSets.Items, objCheckOpts...); diff != "" {
+ t.Errorf("unexpected worker's mpijobs (-want/+got):\n%s", diff)
+ }
+ }
+ })
+ }
+}
diff --git a/pkg/controller/jobs/mpijob/mpijob_webhook.go b/pkg/controller/jobs/mpijob/mpijob_webhook.go
deleted file mode 100644
index f3167b3efd0..00000000000
--- a/pkg/controller/jobs/mpijob/mpijob_webhook.go
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package mpijob
-
-import (
- "context"
-
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/klog/v2"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
- "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
-
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
-)
-
-type MPIJobWebhook struct {
- manageJobsWithoutQueueName bool
-}
-
-// SetupMPIJobWebhook configures the webhook for kubeflow MPIJob.
-func SetupMPIJobWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
- options := jobframework.ProcessOptions(opts...)
- wh := &MPIJobWebhook{
- manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
- }
- return ctrl.NewWebhookManagedBy(mgr).
- For(&kubeflow.MPIJob{}).
- WithDefaulter(wh).
- WithValidator(wh).
- Complete()
-}
-
-// +kubebuilder:webhook:path=/mutate-kubeflow-org-v2beta1-mpijob,mutating=true,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mpijobs,verbs=create,versions=v2beta1,name=mmpijob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomDefaulter = &MPIJobWebhook{}
-
-// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
-func (w *MPIJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("mpijob-webhook")
- log.V(5).Info("Applying defaults", "job", klog.KObj(job))
-
- jobframework.ApplyDefaultForSuspend(job, w.manageJobsWithoutQueueName)
- return nil
-}
-
-// +kubebuilder:webhook:path=/validate-kubeflow-org-v2beta1-mpijob,mutating=false,failurePolicy=fail,sideEffects=None,groups=kubeflow.org,resources=mpijobs,verbs=create;update,versions=v2beta1,name=vmpijob.kb.io,admissionReviewVersions=v1
-
-var _ webhook.CustomValidator = &MPIJobWebhook{}
-
-// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *MPIJobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
- job := fromObject(obj)
- log := ctrl.LoggerFrom(ctx).WithName("mpijob-webhook")
- log.Info("Validating create", "job", klog.KObj(job))
- return nil, validateCreate(job).ToAggregate()
-}
-
-func validateCreate(job jobframework.GenericJob) field.ErrorList {
- return jobframework.ValidateJobOnCreate(job)
-}
-
-// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *MPIJobWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
- oldJob := fromObject(oldObj)
- newJob := fromObject(newObj)
- log := ctrl.LoggerFrom(ctx).WithName("mpijob-webhook")
- log.Info("Validating update", "job", klog.KObj(newJob))
- allErrs := jobframework.ValidateJobOnUpdate(oldJob, newJob)
- return nil, allErrs.ToAggregate()
-}
-
-// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
-func (w *MPIJobWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
- return nil, nil
-}
diff --git a/pkg/controller/jobs/pod/event_handlers.go b/pkg/controller/jobs/pod/event_handlers.go
index 5ae39f5506c..62b02826b9c 100644
--- a/pkg/controller/jobs/pod/event_handlers.go
+++ b/pkg/controller/jobs/pod/event_handlers.go
@@ -65,15 +65,15 @@ type podEventHandler struct {
cleanedUpPodsExpectations *expectationsStore
}
-func (h *podEventHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
+func (h *podEventHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
h.queueReconcileForPod(ctx, e.Object, q)
}
-func (h *podEventHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
+func (h *podEventHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
h.queueReconcileForPod(ctx, e.ObjectNew, q)
}
-func (h *podEventHandler) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface) {
+func (h *podEventHandler) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
p, ok := e.Object.(*corev1.Pod)
if !ok {
return
@@ -92,10 +92,10 @@ func (h *podEventHandler) Delete(ctx context.Context, e event.DeleteEvent, q wor
q.Add(reconcileRequestForPod(p))
}
-func (h *podEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) {
+func (h *podEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *podEventHandler) queueReconcileForPod(ctx context.Context, object client.Object, q workqueue.RateLimitingInterface) {
+func (h *podEventHandler) queueReconcileForPod(ctx context.Context, object client.Object, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
p, ok := object.(*corev1.Pod)
if !ok {
return
@@ -116,21 +116,21 @@ func (h *podEventHandler) queueReconcileForPod(ctx context.Context, object clien
type workloadHandler struct{}
-func (h *workloadHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
+func (h *workloadHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
h.queueReconcileForChildPod(ctx, e.Object, q)
}
-func (h *workloadHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
+func (h *workloadHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
h.queueReconcileForChildPod(ctx, e.ObjectNew, q)
}
-func (h *workloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.RateLimitingInterface) {
+func (h *workloadHandler) Delete(context.Context, event.DeleteEvent, workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *workloadHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) {
+func (h *workloadHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
}
-func (h *workloadHandler) queueReconcileForChildPod(ctx context.Context, object client.Object, q workqueue.RateLimitingInterface) {
+func (h *workloadHandler) queueReconcileForChildPod(ctx context.Context, object client.Object, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
w, ok := object.(*kueue.Workload)
if !ok {
return
diff --git a/pkg/controller/jobs/pod/pod_controller.go b/pkg/controller/jobs/pod/pod_controller.go
index 7ca33b12b94..0ee17b65e1c 100644
--- a/pkg/controller/jobs/pod/pod_controller.go
+++ b/pkg/controller/jobs/pod/pod_controller.go
@@ -56,13 +56,13 @@ import (
"sigs.k8s.io/kueue/pkg/util/kubeversion"
"sigs.k8s.io/kueue/pkg/util/maps"
"sigs.k8s.io/kueue/pkg/util/parallelize"
+ utilpod "sigs.k8s.io/kueue/pkg/util/pod"
utilslices "sigs.k8s.io/kueue/pkg/util/slices"
)
const (
SchedulingGateName = "kueue.x-k8s.io/admission"
FrameworkName = "pod"
- gateNotFound = -1
ConditionTypeTerminationTarget = "TerminationTarget"
errMsgIncorrectGroupRoleCount = "pod group can't include more than 8 roles"
IsGroupWorkloadAnnotationKey = "kueue.x-k8s.io/is-group-workload"
@@ -126,6 +126,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
concurrency := mgr.GetControllerOptions().GroupKindConcurrency[gvk.GroupKind().String()]
ctrl.Log.V(3).Info("Setting up Pod reconciler", "concurrency", concurrency)
return ctrl.NewControllerManagedBy(mgr).
+ Named("pod").
Watches(&corev1.Pod{}, &podEventHandler{cleanedUpPodsExpectations: r.expectationsStore}).Named("v1_pod").
Watches(&kueue.Workload{}, &workloadHandler{}).
WithOptions(controller.Options{
@@ -176,23 +177,12 @@ func (p *Pod) Object() client.Object {
return &p.pod
}
-// gateIndex returns the index of the Kueue scheduling gate for corev1.Pod.
-// If the scheduling gate is not found, returns -1.
-func gateIndex(p *corev1.Pod) int {
- for i := range p.Spec.SchedulingGates {
- if p.Spec.SchedulingGates[i].Name == SchedulingGateName {
- return i
- }
- }
- return gateNotFound
-}
-
func isPodTerminated(p *corev1.Pod) bool {
return p.Status.Phase == corev1.PodFailed || p.Status.Phase == corev1.PodSucceeded
}
func podSuspended(p *corev1.Pod) bool {
- return isPodTerminated(p) || gateIndex(p) != gateNotFound
+ return isPodTerminated(p) || isGated(p)
}
func isUnretriablePod(pod corev1.Pod) bool {
@@ -237,18 +227,6 @@ func (p *Pod) Suspend() {
// Not implemented because this is not called when JobWithCustomStop is implemented.
}
-// ungatePod removes the kueue scheduling gate from the pod.
-// Returns true if the pod has been ungated and false otherwise.
-func ungatePod(pod *corev1.Pod) bool {
- idx := gateIndex(pod)
- if idx != gateNotFound {
- pod.Spec.SchedulingGates = append(pod.Spec.SchedulingGates[:idx], pod.Spec.SchedulingGates[idx+1:]...)
- return true
- }
-
- return false
-}
-
// Run will inject the node affinity and podSet counts extracting from workload to job and unsuspend it.
func (p *Pod) Run(ctx context.Context, c client.Client, podSetsInfo []podset.PodSetInfo, recorder record.EventRecorder, msg string) error {
log := ctrl.LoggerFrom(ctx)
@@ -258,12 +236,12 @@ func (p *Pod) Run(ctx context.Context, c client.Client, podSetsInfo []podset.Pod
return fmt.Errorf("%w: expecting 1 pod set got %d", podset.ErrInvalidPodsetInfo, len(podSetsInfo))
}
- if gateIndex(&p.pod) == gateNotFound {
+ if !isGated(&p.pod) {
return nil
}
if err := clientutil.Patch(ctx, c, &p.pod, true, func() (bool, error) {
- ungatePod(&p.pod)
+ ungate(&p.pod)
return true, podset.Merge(&p.pod.ObjectMeta, &p.pod.Spec, podSetsInfo[0])
}); err != nil {
return err
@@ -279,12 +257,12 @@ func (p *Pod) Run(ctx context.Context, c client.Client, podSetsInfo []podset.Pod
return parallelize.Until(ctx, len(p.list.Items), func(i int) error {
pod := &p.list.Items[i]
- if gateIndex(pod) == gateNotFound {
+ if !isGated(pod) {
return nil
}
if err := clientutil.Patch(ctx, c, pod, true, func() (bool, error) {
- ungatePod(pod)
+ ungate(pod)
roleHash, err := getRoleHash(*pod)
if err != nil {
@@ -666,9 +644,34 @@ func (p *Pod) Load(ctx context.Context, c client.Client, key *types.NamespacedNa
}
func (p *Pod) constructGroupPodSets() ([]kueue.PodSet, error) {
+ if _, useFastAdmission := p.pod.GetAnnotations()[GroupFastAdmissionAnnotation]; useFastAdmission {
+ tc, err := p.groupTotalCount()
+ if err != nil {
+ return nil, err
+ }
+ return constructGroupPodSetsFast(p, tc)
+ }
return constructGroupPodSets(p.list.Items)
}
+func constructGroupPodSetsFast(p *Pod, groupTotalCount int) ([]kueue.PodSet, error) {
+ for _, podInGroup := range p.list.Items {
+ if !isPodRunnableOrSucceeded(&podInGroup) {
+ continue
+ }
+ roleHash, err := getRoleHash(podInGroup)
+ if err != nil {
+ return nil, fmt.Errorf("failed to calculate pod role hash: %w", err)
+ }
+ podSets := FromObject(&podInGroup).PodSets()
+ podSets[0].Name = roleHash
+ podSets[0].Count = int32(groupTotalCount)
+ return podSets, nil
+ }
+
+ return nil, errors.New("failed to find a runnable pod in the group")
+}
+
func constructGroupPodSets(pods []corev1.Pod) ([]kueue.PodSet, error) {
var resultPodSets []kueue.PodSet
@@ -712,8 +715,9 @@ func (p *Pod) validatePodGroupMetadata(r record.EventRecorder, activePods []core
return err
}
originalQueue := jobframework.QueueName(p)
+ _, useFastAdmission := p.pod.GetAnnotations()[GroupFastAdmissionAnnotation]
- if len(activePods) < groupTotalCount {
+ if !useFastAdmission && len(activePods) < groupTotalCount {
errMsg := fmt.Sprintf("'%s' group has fewer runnable pods than expected", podGroupName(p.pod))
r.Eventf(p.Object(), corev1.EventTypeWarning, jobframework.ReasonErrWorkloadCompose, errMsg)
return jobframework.UnretryableError(errMsg)
@@ -827,8 +831,8 @@ func sortActivePods(activePods []corev1.Pod) {
if iFin != jFin {
return iFin
}
- iGated := gateIndex(pi) != gateNotFound
- jGated := gateIndex(pj) != gateNotFound
+ iGated := isGated(pi)
+ jGated := isGated(pj)
// Prefer to keep pods that aren't gated.
if iGated != jGated {
return !iGated
@@ -1327,3 +1331,15 @@ func IsPodOwnerManagedByKueue(p *Pod) bool {
func GetWorkloadNameForPod(podName string, podUID types.UID) string {
return jobframework.GetWorkloadNameForOwnerWithGVK(podName, podUID, gvk)
}
+
+func isGated(pod *corev1.Pod) bool {
+ return utilpod.HasGate(pod, SchedulingGateName)
+}
+
+func ungate(pod *corev1.Pod) bool {
+ return utilpod.Ungate(pod, SchedulingGateName)
+}
+
+func gate(pod *corev1.Pod) bool {
+ return utilpod.Gate(pod, SchedulingGateName)
+}
diff --git a/pkg/controller/jobs/pod/pod_controller_test.go b/pkg/controller/jobs/pod/pod_controller_test.go
index 13d0131a708..4a6f7945213 100644
--- a/pkg/controller/jobs/pod/pod_controller_test.go
+++ b/pkg/controller/jobs/pod/pod_controller_test.go
@@ -41,11 +41,12 @@ import (
"sigs.k8s.io/kueue/pkg/constants"
controllerconsts "sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
- _ "sigs.k8s.io/kueue/pkg/controller/jobs/job"
- _ "sigs.k8s.io/kueue/pkg/controller/jobs/raycluster"
"sigs.k8s.io/kueue/pkg/podset"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
testingpod "sigs.k8s.io/kueue/pkg/util/testingjobs/pod"
+
+ _ "sigs.k8s.io/kueue/pkg/controller/jobs/job"
+ _ "sigs.k8s.io/kueue/pkg/controller/jobs/raycluster"
)
func TestPodsReady(t *testing.T) {
@@ -151,6 +152,8 @@ func TestReconciler(t *testing.T) {
now := time.Now()
+ podUID := "dc85db45"
+
testCases := map[string]struct {
reconcileKey *types.NamespacedName
initObjects []client.Object
@@ -597,7 +600,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -621,6 +624,60 @@ func TestReconciler(t *testing.T) {
},
},
},
+ "workload is composed and created for the pod group with fast admission": {
+ pods: []corev1.Pod{
+ *basePodWrapper.
+ Clone().
+ Label(constants.ManagedByKueueLabel, "true").
+ KueueFinalizer().
+ KueueSchedulingGate().
+ Annotation(controllerconsts.ProvReqAnnotationPrefix+"test-annotation", "test-val").
+ Annotation("invalid-provreq-prefix/test-annotation-2", "test-val-2").
+ Group("test-group").
+ GroupTotalCount("3").
+ Annotation(GroupFastAdmissionAnnotation, "true").
+ Obj(),
+ },
+ wantPods: []corev1.Pod{
+ // Other pods are created on second reconcile
+ *basePodWrapper.
+ Clone().
+ Label(constants.ManagedByKueueLabel, "true").
+ KueueFinalizer().
+ KueueSchedulingGate().
+ Annotation(controllerconsts.ProvReqAnnotationPrefix+"test-annotation", "test-val").
+ Annotation("invalid-provreq-prefix/test-annotation-2", "test-val-2").
+ Group("test-group").
+ GroupTotalCount("3").
+ Annotation(GroupFastAdmissionAnnotation, "true").
+ Obj(),
+ },
+ wantWorkloads: []kueue.Workload{
+ *utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
+ PodSets(
+ *utiltesting.MakePodSet(podUID, 3).
+ Request(corev1.ResourceCPU, "1").
+ SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
+ Obj(),
+ ).
+ Queue("user-queue").
+ Priority(0).
+ OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
+ Annotations(map[string]string{
+ "kueue.x-k8s.io/is-group-workload": "true",
+ controllerconsts.ProvReqAnnotationPrefix + "test-annotation": "test-val"}).
+ Obj(),
+ },
+ workloadCmpOpts: defaultWorkloadCmpOpts,
+ wantEvents: []utiltesting.EventRecord{
+ {
+ Key: types.NamespacedName{Name: "pod", Namespace: "ns"},
+ EventType: "Normal",
+ Reason: "CreatedWorkload",
+ Message: "Created Workload: ns/test-group",
+ },
+ },
+ },
"workload is found for the pod group": {
pods: []corev1.Pod{
*basePodWrapper.
@@ -663,7 +720,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -677,7 +734,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -734,11 +791,11 @@ func TestReconciler(t *testing.T) {
},
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
- PodSets(*utiltesting.MakePodSet("dc85db45", 2).Request(corev1.ResourceCPU, "1").Obj()).
+ PodSets(*utiltesting.MakePodSet(podUID, 2).Request(corev1.ResourceCPU, "1").Obj()).
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
ReserveQuota(
- utiltesting.MakeAdmission("cq", "dc85db45").
+ utiltesting.MakeAdmission("cq", podUID).
Assignment(corev1.ResourceCPU, "unit-test-flavor", "2").
AssignmentPodCount(2).
Obj(),
@@ -748,11 +805,11 @@ func TestReconciler(t *testing.T) {
},
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
- PodSets(*utiltesting.MakePodSet("dc85db45", 2).Request(corev1.ResourceCPU, "1").Obj()).
+ PodSets(*utiltesting.MakePodSet(podUID, 2).Request(corev1.ResourceCPU, "1").Obj()).
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
ReserveQuota(
- utiltesting.MakeAdmission("cq", "dc85db45").
+ utiltesting.MakeAdmission("cq", podUID).
Assignment(corev1.ResourceCPU, "unit-test-flavor", "2").
AssignmentPodCount(2).
Obj(),
@@ -817,7 +874,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -831,7 +888,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -840,7 +897,7 @@ func TestReconciler(t *testing.T) {
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
Admitted(true).
- ReclaimablePods(kueue.ReclaimablePod{Name: "dc85db45", Count: 1}).
+ ReclaimablePods(kueue.ReclaimablePod{Name: podUID, Count: 1}).
Obj(),
},
workloadCmpOpts: defaultWorkloadCmpOpts,
@@ -885,7 +942,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -899,7 +956,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -944,7 +1001,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -963,7 +1020,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1026,7 +1083,7 @@ func TestReconciler(t *testing.T) {
},
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
- PodSets(*utiltesting.MakePodSet("dc85db45", 2).Request(corev1.ResourceCPU, "1").Obj()).
+ PodSets(*utiltesting.MakePodSet(podUID, 2).Request(corev1.ResourceCPU, "1").Obj()).
Queue("test-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
@@ -1041,7 +1098,7 @@ func TestReconciler(t *testing.T) {
},
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
- PodSets(*utiltesting.MakePodSet("dc85db45", 2).Request(corev1.ResourceCPU, "1").Obj()).
+ PodSets(*utiltesting.MakePodSet(podUID, 2).Request(corev1.ResourceCPU, "1").Obj()).
Queue("test-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
@@ -1080,7 +1137,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1105,7 +1162,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1209,7 +1266,7 @@ func TestReconciler(t *testing.T) {
wantPods: []corev1.Pod{},
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
- PodSets(*utiltesting.MakePodSet("dc85db45", 2).Request(corev1.ResourceCPU, "1").Obj()).
+ PodSets(*utiltesting.MakePodSet(podUID, 2).Request(corev1.ResourceCPU, "1").Obj()).
ControllerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
ControllerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
Queue("test-queue").
@@ -1280,14 +1337,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(1).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(1).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: WorkloadWaitingForReplacementPods,
@@ -1300,14 +1357,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(1).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(1).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: WorkloadWaitingForReplacementPods,
@@ -1368,17 +1425,17 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(3).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(3).Obj()).
Admitted(true).
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod3", "test-uid").
- ReclaimablePods(kueue.ReclaimablePod{Name: "dc85db45", Count: 1}).
+ ReclaimablePods(kueue.ReclaimablePod{Name: podUID, Count: 1}).
Obj(),
},
wantPods: []corev1.Pod{
@@ -1419,14 +1476,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(3).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(3).Obj()).
ReclaimablePods(kueue.ReclaimablePod{
- Name: "dc85db45",
+ Name: podUID,
Count: 1,
}).
Admitted(true).
@@ -1434,7 +1491,7 @@ func TestReconciler(t *testing.T) {
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod3", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "replacement", "test-uid").
- ReclaimablePods(kueue.ReclaimablePod{Name: "dc85db45", Count: 1}).
+ ReclaimablePods(kueue.ReclaimablePod{Name: podUID, Count: 1}).
Obj(),
},
workloadCmpOpts: defaultWorkloadCmpOpts,
@@ -1510,7 +1567,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1525,7 +1582,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1579,7 +1636,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1606,7 +1663,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1658,7 +1715,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1685,7 +1742,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1793,7 +1850,7 @@ func TestReconciler(t *testing.T) {
},
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
- PodSets(*utiltesting.MakePodSet("dc85db45", 2).Request(corev1.ResourceCPU, "1").NodeName("test-node").Obj()).
+ PodSets(*utiltesting.MakePodSet(podUID, 2).Request(corev1.ResourceCPU, "1").NodeName("test-node").Obj()).
Queue("test-queue").
Priority(0).
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod", "test-uid").
@@ -1854,7 +1911,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1874,7 +1931,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1920,7 +1977,7 @@ func TestReconciler(t *testing.T) {
*utiltesting.MakePodSet("absent-pod-role", 1).
Request(corev1.ResourceCPU, "1").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -1942,7 +1999,7 @@ func TestReconciler(t *testing.T) {
*utiltesting.MakePodSet("absent-pod-role", 1).
Request(corev1.ResourceCPU, "1").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2044,7 +2101,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Request(corev1.ResourceCPU, "1").
Obj(),
@@ -2181,7 +2238,7 @@ func TestReconciler(t *testing.T) {
Request(corev1.ResourceCPU, "1").
Request(corev1.ResourceMemory, "1Gi").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2206,7 +2263,7 @@ func TestReconciler(t *testing.T) {
Request(corev1.ResourceCPU, "1").
Request(corev1.ResourceMemory, "1Gi").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2308,7 +2365,7 @@ func TestReconciler(t *testing.T) {
Request(corev1.ResourceCPU, "1").
Request(corev1.ResourceMemory, "1Gi").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2333,7 +2390,7 @@ func TestReconciler(t *testing.T) {
Request(corev1.ResourceCPU, "1").
Request(corev1.ResourceMemory, "1Gi").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2391,7 +2448,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -2474,7 +2531,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2487,7 +2544,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2546,7 +2603,7 @@ func TestReconciler(t *testing.T) {
*utiltesting.MakePodSet("aaf269e6", 1).
Request(corev1.ResourceCPU, "1").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2568,7 +2625,7 @@ func TestReconciler(t *testing.T) {
*utiltesting.MakePodSet("aaf269e6", 1).
Request(corev1.ResourceCPU, "1").
Obj(),
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2664,7 +2721,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2676,7 +2733,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2745,7 +2802,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2760,7 +2817,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2833,7 +2890,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 1).
+ *utiltesting.MakePodSet(podUID, 1).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -2962,7 +3019,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -2982,7 +3039,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3080,7 +3137,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3107,7 +3164,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3177,7 +3234,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3201,7 +3258,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 3).
+ *utiltesting.MakePodSet(podUID, 3).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3363,7 +3420,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 4).
+ *utiltesting.MakePodSet(podUID, 4).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3385,7 +3442,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 4).
+ *utiltesting.MakePodSet(podUID, 4).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3486,7 +3543,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3500,7 +3557,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3599,7 +3656,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 4).
+ *utiltesting.MakePodSet(podUID, 4).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3619,7 +3676,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 4).
+ *utiltesting.MakePodSet(podUID, 4).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3720,7 +3777,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -3891,7 +3948,7 @@ func TestReconciler(t *testing.T) {
Message: "Not admitted, ETA: 2024-02-22T10:36:40Z.",
}).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -3918,7 +3975,7 @@ func TestReconciler(t *testing.T) {
Message: "Not admitted, ETA: 2024-02-22T10:36:40Z.",
}).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
SchedulingGates(corev1.PodSchedulingGate{Name: "kueue.x-k8s.io/admission"}).
Obj(),
@@ -3985,7 +4042,7 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -3993,7 +4050,7 @@ func TestReconciler(t *testing.T) {
Priority(0).
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Obj(),
},
@@ -4021,7 +4078,7 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
@@ -4030,7 +4087,7 @@ func TestReconciler(t *testing.T) {
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "replacement", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Obj(),
},
@@ -4076,14 +4133,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Obj(),
},
@@ -4112,14 +4169,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Obj(),
},
@@ -4151,14 +4208,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Obj(),
},
@@ -4187,14 +4244,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: WorkloadWaitingForReplacementPods,
@@ -4233,14 +4290,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Obj(),
},
@@ -4270,14 +4327,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: WorkloadWaitingForReplacementPods,
@@ -4316,14 +4373,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
@@ -4359,14 +4416,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
@@ -4413,14 +4470,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
@@ -4461,14 +4518,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
@@ -4512,14 +4569,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
@@ -4562,14 +4619,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
@@ -4615,14 +4672,14 @@ func TestReconciler(t *testing.T) {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: WorkloadWaitingForReplacementPods,
@@ -4657,14 +4714,14 @@ func TestReconciler(t *testing.T) {
wantWorkloads: []kueue.Workload{
*utiltesting.MakeWorkload("test-group", "ns").Finalizers(kueue.ResourceInUseFinalizerName).
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
Queue("user-queue").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod1", "test-uid").
OwnerReference(corev1.SchemeGroupVersion.WithKind("Pod"), "pod2", "test-uid").
- ReserveQuota(utiltesting.MakeAdmission("cq", "dc85db45").AssignmentPodCount(2).Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("cq", podUID).AssignmentPodCount(2).Obj()).
Admitted(true).
Condition(metav1.Condition{
Type: WorkloadWaitingForReplacementPods,
@@ -4958,6 +5015,8 @@ func TestReconciler_DeletePodAfterTransientErrorsOnUpdateOrDeleteOps(t *testing.
ctx, _ := utiltesting.ContextWithLog(t)
var triggerUpdateErr, triggerDeleteErr bool
+ podUID := "dc85db45"
+
basePodWrapper := testingpod.MakePod("pod", "ns").
UID("test-uid").
Queue("user-queue").
@@ -4995,7 +5054,7 @@ func TestReconciler_DeletePodAfterTransientErrorsOnUpdateOrDeleteOps(t *testing.
wl := *utiltesting.MakeWorkload("test-group", "ns").
PodSets(
- *utiltesting.MakePodSet("dc85db45", 2).
+ *utiltesting.MakePodSet(podUID, 2).
Request(corev1.ResourceCPU, "1").
Obj(),
).
diff --git a/pkg/controller/jobs/pod/pod_webhook.go b/pkg/controller/jobs/pod/pod_webhook.go
index f805169fd8b..8927000cc97 100644
--- a/pkg/controller/jobs/pod/pod_webhook.go
+++ b/pkg/controller/jobs/pod/pod_webhook.go
@@ -31,22 +31,23 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
"sigs.k8s.io/kueue/pkg/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework/webhook"
)
const (
- ManagedLabelKey = constants.ManagedByKueueLabel
- ManagedLabelValue = "true"
- PodFinalizer = ManagedLabelKey
- GroupNameLabel = "kueue.x-k8s.io/pod-group-name"
- GroupTotalCountAnnotation = "kueue.x-k8s.io/pod-group-total-count"
- RoleHashAnnotation = "kueue.x-k8s.io/role-hash"
- RetriableInGroupAnnotation = "kueue.x-k8s.io/retriable-in-group"
+ ManagedLabelKey = constants.ManagedByKueueLabel
+ ManagedLabelValue = "true"
+ PodFinalizer = ManagedLabelKey
+ GroupNameLabel = "kueue.x-k8s.io/pod-group-name"
+ GroupTotalCountAnnotation = "kueue.x-k8s.io/pod-group-total-count"
+ GroupFastAdmissionAnnotation = "kueue.x-k8s.io/pod-group-fast-admission"
+ RoleHashAnnotation = "kueue.x-k8s.io/role-hash"
+ RetriableInGroupAnnotation = "kueue.x-k8s.io/retriable-in-group"
)
var (
@@ -80,9 +81,10 @@ func SetupWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
namespaceSelector: podOpts.NamespaceSelector,
podSelector: podOpts.PodSelector,
}
- return ctrl.NewWebhookManagedBy(mgr).
- For(&corev1.Pod{}).
- WithDefaulter(wh).
+ obj := &corev1.Pod{}
+ return webhook.WebhookManagedBy(mgr).
+ For(obj).
+ WithMutationHandler(webhook.WithLosslessDefaulter(mgr.GetScheme(), obj, wh)).
WithValidator(wh).
Complete()
}
@@ -102,7 +104,7 @@ func getPodOptions(integrationOpts map[string]any) (*configapi.PodIntegrationOpt
// +kubebuilder:webhook:path=/mutate--v1-pod,mutating=true,failurePolicy=fail,sideEffects=None,groups="",resources=pods,verbs=create,versions=v1,name=mpod.kb.io,admissionReviewVersions=v1
// +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch
-var _ webhook.CustomDefaulter = &PodWebhook{}
+var _ admission.CustomDefaulter = &PodWebhook{}
func containersShape(containers []corev1.Container) (result []map[string]interface{}) {
for _, c := range containers {
@@ -177,10 +179,7 @@ func (w *PodWebhook) Default(ctx context.Context, obj runtime.Object) error {
}
pod.pod.Labels[ManagedLabelKey] = ManagedLabelValue
- if gateIndex(&pod.pod) == gateNotFound {
- log.V(5).Info("Adding gate")
- pod.pod.Spec.SchedulingGates = append(pod.pod.Spec.SchedulingGates, corev1.PodSchedulingGate{Name: SchedulingGateName})
- }
+ gate(&pod.pod)
if podGroupName(pod.pod) != "" {
if err := pod.addRoleHash(); err != nil {
@@ -196,7 +195,7 @@ func (w *PodWebhook) Default(ctx context.Context, obj runtime.Object) error {
// +kubebuilder:webhook:path=/validate--v1-pod,mutating=false,failurePolicy=fail,sideEffects=None,groups="",resources=pods,verbs=create;update,versions=v1,name=vpod.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomValidator = &PodWebhook{}
+var _ admission.CustomValidator = &PodWebhook{}
func (w *PodWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
var warnings admission.Warnings
diff --git a/pkg/controller/jobs/pod/pod_webhook_test.go b/pkg/controller/jobs/pod/pod_webhook_test.go
index b3b007753d9..2cdebe9be89 100644
--- a/pkg/controller/jobs/pod/pod_webhook_test.go
+++ b/pkg/controller/jobs/pod/pod_webhook_test.go
@@ -33,11 +33,12 @@ import (
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
"sigs.k8s.io/kueue/pkg/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
+ testingpod "sigs.k8s.io/kueue/pkg/util/testingjobs/pod"
+
_ "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs"
_ "sigs.k8s.io/kueue/pkg/controller/jobs/mpijob"
_ "sigs.k8s.io/kueue/pkg/controller/jobs/raycluster"
- utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
- testingpod "sigs.k8s.io/kueue/pkg/util/testingjobs/pod"
)
func TestDefault(t *testing.T) {
diff --git a/pkg/controller/jobs/raycluster/raycluster_webhook.go b/pkg/controller/jobs/raycluster/raycluster_webhook.go
index 2976ca57dc4..2545c5116c4 100644
--- a/pkg/controller/jobs/raycluster/raycluster_webhook.go
+++ b/pkg/controller/jobs/raycluster/raycluster_webhook.go
@@ -22,12 +22,11 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"
-
ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework/webhook"
)
type RayClusterWebhook struct {
@@ -43,16 +42,17 @@ func SetupRayClusterWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error
wh := &RayClusterWebhook{
manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
}
- return ctrl.NewWebhookManagedBy(mgr).
- For(&rayv1.RayCluster{}).
- WithDefaulter(wh).
+ obj := &rayv1.RayCluster{}
+ return webhook.WebhookManagedBy(mgr).
+ For(obj).
+ WithMutationHandler(webhook.WithLosslessDefaulter(mgr.GetScheme(), obj, wh)).
WithValidator(wh).
Complete()
}
// +kubebuilder:webhook:path=/mutate-ray-io-v1-raycluster,mutating=true,failurePolicy=fail,sideEffects=None,groups=ray.io,resources=rayclusters,verbs=create,versions=v1,name=mraycluster.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomDefaulter = &RayClusterWebhook{}
+var _ admission.CustomDefaulter = &RayClusterWebhook{}
// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (w *RayClusterWebhook) Default(ctx context.Context, obj runtime.Object) error {
@@ -65,7 +65,7 @@ func (w *RayClusterWebhook) Default(ctx context.Context, obj runtime.Object) err
// +kubebuilder:webhook:path=/validate-ray-io-v1-raycluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=ray.io,resources=rayclusters,verbs=create;update,versions=v1,name=vraycluster.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomValidator = &RayClusterWebhook{}
+var _ admission.CustomValidator = &RayClusterWebhook{}
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
func (w *RayClusterWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
diff --git a/pkg/controller/jobs/rayjob/rayjob_controller.go b/pkg/controller/jobs/rayjob/rayjob_controller.go
index b23bb82662c..c8ef905a8c7 100644
--- a/pkg/controller/jobs/rayjob/rayjob_controller.go
+++ b/pkg/controller/jobs/rayjob/rayjob_controller.go
@@ -175,8 +175,8 @@ func (j *RayJob) RestorePodSetsInfo(podSetsInfo []podset.PodSetInfo) bool {
func (j *RayJob) Finished() (message string, success, finished bool) {
message = j.Status.Message
- success = j.Status.JobStatus != rayv1.JobStatusFailed
- finished = j.Status.JobStatus == rayv1.JobStatusFailed || j.Status.JobStatus == rayv1.JobStatusSucceeded
+ success = j.Status.JobStatus == rayv1.JobStatusSucceeded
+ finished = j.Status.JobDeploymentStatus == rayv1.JobDeploymentStatusFailed || j.Status.JobDeploymentStatus == rayv1.JobDeploymentStatusComplete
return message, success, finished
}
diff --git a/pkg/controller/jobs/rayjob/rayjob_controller_test.go b/pkg/controller/jobs/rayjob/rayjob_controller_test.go
index d16aafc97c9..60763c8a280 100644
--- a/pkg/controller/jobs/rayjob/rayjob_controller_test.go
+++ b/pkg/controller/jobs/rayjob/rayjob_controller_test.go
@@ -268,3 +268,78 @@ func TestNodeSelectors(t *testing.T) {
})
}
}
+
+func Test_RayJobFinished(t *testing.T) {
+ testcases := []struct {
+ name string
+ status rayv1.RayJobStatus
+ expectedSuccess bool
+ expectedFinished bool
+ }{
+ {
+ name: "jobStatus=Running, jobDeploymentStatus=Running",
+ status: rayv1.RayJobStatus{
+ JobStatus: rayv1.JobStatusRunning,
+ JobDeploymentStatus: rayv1.JobDeploymentStatusRunning,
+ },
+ expectedSuccess: false,
+ expectedFinished: false,
+ },
+ {
+ name: "jobStatus=Succeeded, jobDeploymentStatus=Complete",
+ status: rayv1.RayJobStatus{
+ JobStatus: rayv1.JobStatusSucceeded,
+ JobDeploymentStatus: rayv1.JobDeploymentStatusComplete,
+ },
+ expectedSuccess: true,
+ expectedFinished: true,
+ },
+ {
+ name: "jobStatus=Failed, jobDeploymentStatus=Complete",
+ status: rayv1.RayJobStatus{
+ JobStatus: rayv1.JobStatusFailed,
+ JobDeploymentStatus: rayv1.JobDeploymentStatusComplete,
+ },
+ expectedSuccess: false,
+ expectedFinished: true,
+ },
+ {
+ name: "jobStatus=Failed, jobDeploymentStatus=Failed",
+ status: rayv1.RayJobStatus{
+ JobStatus: rayv1.JobStatusFailed,
+ JobDeploymentStatus: rayv1.JobDeploymentStatusFailed,
+ },
+ expectedSuccess: false,
+ expectedFinished: true,
+ },
+ {
+ name: "jobStatus=Running, jobDeploymentStatus=Failed (when activeDeadlineSeconds is exceeded)",
+ status: rayv1.RayJobStatus{
+ JobStatus: rayv1.JobStatusRunning,
+ JobDeploymentStatus: rayv1.JobDeploymentStatusFailed,
+ },
+ expectedSuccess: false,
+ expectedFinished: true,
+ },
+ }
+
+ for _, testcase := range testcases {
+ t.Run(testcase.name, func(t *testing.T) {
+ rayJob := testingrayutil.MakeJob("job", "ns").Obj()
+ rayJob.Status = testcase.status
+
+ _, success, finished := ((*RayJob)(rayJob)).Finished()
+ if success != testcase.expectedSuccess {
+ t.Logf("actual success: %v", success)
+ t.Logf("expected success: %v", testcase.expectedSuccess)
+ t.Error("unexpected result for 'success'")
+ }
+
+ if finished != testcase.expectedFinished {
+ t.Logf("actual finished: %v", finished)
+ t.Logf("expected finished: %v", testcase.expectedFinished)
+ t.Error("unexpected result for 'finished'")
+ }
+ })
+ }
+}
diff --git a/pkg/controller/jobs/rayjob/rayjob_webhook.go b/pkg/controller/jobs/rayjob/rayjob_webhook.go
index 2c53cdc7d41..e143011d28d 100644
--- a/pkg/controller/jobs/rayjob/rayjob_webhook.go
+++ b/pkg/controller/jobs/rayjob/rayjob_webhook.go
@@ -25,12 +25,11 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"
-
ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework/webhook"
)
type RayJobWebhook struct {
@@ -43,16 +42,17 @@ func SetupRayJobWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error {
wh := &RayJobWebhook{
manageJobsWithoutQueueName: options.ManageJobsWithoutQueueName,
}
- return ctrl.NewWebhookManagedBy(mgr).
- For(&rayv1.RayJob{}).
- WithDefaulter(wh).
+ obj := &rayv1.RayJob{}
+ return webhook.WebhookManagedBy(mgr).
+ For(obj).
+ WithMutationHandler(webhook.WithLosslessDefaulter(mgr.GetScheme(), obj, wh)).
WithValidator(wh).
Complete()
}
// +kubebuilder:webhook:path=/mutate-ray-io-v1-rayjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=ray.io,resources=rayjobs,verbs=create,versions=v1,name=mrayjob.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomDefaulter = &RayJobWebhook{}
+var _ admission.CustomDefaulter = &RayJobWebhook{}
// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (w *RayJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
@@ -65,7 +65,7 @@ func (w *RayJobWebhook) Default(ctx context.Context, obj runtime.Object) error {
// +kubebuilder:webhook:path=/validate-ray-io-v1-rayjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=ray.io,resources=rayjobs,verbs=create;update,versions=v1,name=vrayjob.kb.io,admissionReviewVersions=v1
-var _ webhook.CustomValidator = &RayJobWebhook{}
+var _ admission.CustomValidator = &RayJobWebhook{}
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
func (w *RayJobWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go
index 7ce4e0e3647..d952be2e489 100644
--- a/pkg/features/kube_features.go
+++ b/pkg/features/kube_features.go
@@ -39,6 +39,7 @@ const (
// owner: @stuton
// kep: https://github.com/kubernetes-sigs/kueue/tree/main/keps/168-pending-workloads-visibility
// alpha: v0.5
+ // Deprecated: v0.9
//
// Enables queue visibility.
QueueVisibility featuregate.Feature = "QueueVisibility"
@@ -60,6 +61,7 @@ const (
// owner: @pbundyra
// kep: https://github.com/kubernetes-sigs/kueue/pull/1300
// alpha: v0.6
+ // beta: v0.9
//
// Enables Kueue visibility on demand
VisibilityOnDemand featuregate.Feature = "VisibilityOnDemand"
@@ -74,6 +76,7 @@ const (
// owner: @trasc
// kep: https://github.com/kubernetes-sigs/kueue/tree/main/keps/693-multikueue
// alpha: v0.6
+ // beta: v0.9
//
// Enables MultiKueue support.
MultiKueue featuregate.Feature = "MultiKueue"
@@ -99,6 +102,13 @@ const (
// Enable more than one workload sharing flavors to preempt within a Cohort,
// as long as the preemption targets don't overlap.
MultiplePreemptions featuregate.Feature = "MultiplePreemptions"
+
+ // owner: @mimowo
+ // alpha: v0.9
+ //
+ // Enable Topology Aware Scheduling allowing to optimize placement of Pods
+ // to put them on closely located nodes (e.g. within the same rack or block).
+ TopologyAwareScheduling featuregate.Feature = "TopologyAwareScheduling"
)
func init() {
@@ -116,16 +126,17 @@ var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
QueueVisibility: {Default: false, PreRelease: featuregate.Alpha},
FlavorFungibility: {Default: true, PreRelease: featuregate.Beta},
ProvisioningACC: {Default: true, PreRelease: featuregate.Beta},
- VisibilityOnDemand: {Default: false, PreRelease: featuregate.Alpha},
+ VisibilityOnDemand: {Default: true, PreRelease: featuregate.Beta},
PrioritySortingWithinCohort: {Default: true, PreRelease: featuregate.Beta},
- MultiKueue: {Default: false, PreRelease: featuregate.Alpha},
+ MultiKueue: {Default: true, PreRelease: featuregate.Beta},
LendingLimit: {Default: true, PreRelease: featuregate.Beta},
MultiKueueBatchJobWithManagedBy: {Default: false, PreRelease: featuregate.Alpha},
MultiplePreemptions: {Default: true, PreRelease: featuregate.Beta},
+ TopologyAwareScheduling: {Default: false, PreRelease: featuregate.Alpha},
}
-func SetFeatureGateDuringTest(tb testing.TB, f featuregate.Feature, value bool) func() {
- return featuregatetesting.SetFeatureGateDuringTest(tb, utilfeature.DefaultFeatureGate, f, value)
+func SetFeatureGateDuringTest(tb testing.TB, f featuregate.Feature, value bool) {
+ featuregatetesting.SetFeatureGateDuringTest(tb, utilfeature.DefaultFeatureGate, f, value)
}
// Enabled is helper for `utilfeature.DefaultFeatureGate.Enabled()`
diff --git a/pkg/features/kube_features_test.go b/pkg/features/kube_features_test.go
index ab7f8a31969..99a1273c37c 100644
--- a/pkg/features/kube_features_test.go
+++ b/pkg/features/kube_features_test.go
@@ -24,7 +24,7 @@ import (
)
func TestFeatureGate(t *testing.T) {
- defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, QueueVisibility, true)()
+ featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, QueueVisibility, true)
if !utilfeature.DefaultFeatureGate.Enabled(PartialAdmission) {
t.Error("feature gate should be enabled")
diff --git a/pkg/hierarchy/cohort.go b/pkg/hierarchy/cohort.go
index 15d0ce91b25..8eb6ce33371 100644
--- a/pkg/hierarchy/cohort.go
+++ b/pkg/hierarchy/cohort.go
@@ -18,32 +18,54 @@ package hierarchy
import "k8s.io/apimachinery/pkg/util/sets"
+//lint:ignore U1000 due to https://github.com/dominikh/go-tools/issues/1602.
type Cohort[CQ, C nodeBase] struct {
- childCqs sets.Set[CQ]
+ parent C
+ childCohorts sets.Set[C]
+ childCqs sets.Set[CQ]
// Indicates whether this Cohort is backed
// by an API object.
explicit bool
}
func (c *Cohort[CQ, C]) Parent() C {
- var zero C
- return zero
+ return c.parent
}
func (c *Cohort[CQ, C]) HasParent() bool {
- return false
+ var zero C
+ return c.Parent() != zero
}
func (c *Cohort[CQ, C]) ChildCQs() []CQ {
return c.childCqs.UnsortedList()
}
+func (c *Cohort[CQ, C]) ChildCohorts() []C {
+ return c.childCohorts.UnsortedList()
+}
+
func NewCohort[CQ, C nodeBase]() Cohort[CQ, C] {
- return Cohort[CQ, C]{childCqs: sets.New[CQ]()}
+ return Cohort[CQ, C]{
+ childCohorts: sets.New[C](),
+ childCqs: sets.New[CQ](),
+ }
}
// implement cohortNode interface
+func (c *Cohort[CQ, C]) setParent(cohort C) {
+ c.parent = cohort
+}
+
+func (c *Cohort[CQ, C]) insertCohortChild(cohort C) {
+ c.childCohorts.Insert(cohort)
+}
+
+func (c *Cohort[CQ, C]) deleteCohortChild(cohort C) {
+ c.childCohorts.Delete(cohort)
+}
+
func (c *Cohort[CQ, C]) insertClusterQueue(cq CQ) {
c.childCqs.Insert(cq)
}
@@ -52,8 +74,8 @@ func (c *Cohort[CQ, C]) deleteClusterQueue(cq CQ) {
c.childCqs.Delete(cq)
}
-func (c *Cohort[CQ, C]) childCount() int {
- return c.childCqs.Len()
+func (c *Cohort[CQ, C]) hasChildren() bool {
+ return c.childCqs.Len()+c.childCohorts.Len() > 0
}
func (c *Cohort[CQ, C]) isExplicit() bool {
diff --git a/pkg/hierarchy/cycle.go b/pkg/hierarchy/cycle.go
new file mode 100644
index 00000000000..3d97684b3d6
--- /dev/null
+++ b/pkg/hierarchy/cycle.go
@@ -0,0 +1,42 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package hierarchy
+
+// cycleChecker checks for cycles in Cohorts, while memoizing the
+// result.
+type CycleChecker struct {
+ cycles map[string]bool
+}
+
+type CycleCheckable interface {
+ GetName() string
+ HasParent() bool
+ CCParent() CycleCheckable
+}
+
+func (c *CycleChecker) HasCycle(cohort CycleCheckable) bool {
+ if cycle, seen := c.cycles[cohort.GetName()]; seen {
+ return cycle
+ }
+ if !cohort.HasParent() {
+ c.cycles[cohort.GetName()] = false
+ return c.cycles[cohort.GetName()]
+ }
+ c.cycles[cohort.GetName()] = true
+ c.cycles[cohort.GetName()] = c.HasCycle(cohort.CCParent())
+ return c.cycles[cohort.GetName()]
+}
diff --git a/pkg/hierarchy/manager.go b/pkg/hierarchy/manager.go
index b7b4f29406e..a3231ed8d05 100644
--- a/pkg/hierarchy/manager.go
+++ b/pkg/hierarchy/manager.go
@@ -18,93 +18,132 @@ package hierarchy
// Manager stores Cohorts and ClusterQueues, and maintains the edges
// between them.
-type Manager[CQ clusterQueueNode[C], C cohortNode[CQ]] struct {
+type Manager[CQ clusterQueueNode[C], C cohortNode[CQ, C]] struct {
Cohorts map[string]C
ClusterQueues map[string]CQ
cohortFactory func(string) C
+ CycleChecker CycleChecker
}
// NewManager creates a new Manager. A newCohort function must
// be provided to instantiate Cohorts in the case that a
// ClusterQueue references a Cohort not backed by an API object.
-func NewManager[CQ clusterQueueNode[C], C cohortNode[CQ]](newCohort func(string) C) Manager[CQ, C] {
+func NewManager[CQ clusterQueueNode[C], C cohortNode[CQ, C]](newCohort func(string) C) Manager[CQ, C] {
return Manager[CQ, C]{
make(map[string]C),
make(map[string]CQ),
newCohort,
+ CycleChecker{make(map[string]bool)},
}
}
-func (c *Manager[CQ, C]) AddClusterQueue(cq CQ) {
- c.ClusterQueues[cq.GetName()] = cq
+func (m *Manager[CQ, C]) AddClusterQueue(cq CQ) {
+ m.ClusterQueues[cq.GetName()] = cq
}
-func (c *Manager[CQ, C]) UpdateClusterQueueEdge(name, parentName string) {
- cq := c.ClusterQueues[name]
- c.unwireClusterQueue(cq)
+func (m *Manager[CQ, C]) UpdateClusterQueueEdge(name, parentName string) {
+ cq := m.ClusterQueues[name]
+ m.detachClusterQueueFromParent(cq)
if parentName != "" {
- parent := c.getOrCreateCohort(parentName)
+ parent := m.getOrCreateCohort(parentName)
parent.insertClusterQueue(cq)
cq.setParent(parent)
}
}
-func (c *Manager[CQ, C]) DeleteClusterQueue(name string) {
- if cq, ok := c.ClusterQueues[name]; ok {
- c.unwireClusterQueue(cq)
- delete(c.ClusterQueues, name)
+func (m *Manager[CQ, C]) DeleteClusterQueue(name string) {
+ if cq, ok := m.ClusterQueues[name]; ok {
+ m.detachClusterQueueFromParent(cq)
+ delete(m.ClusterQueues, name)
}
}
-func (c *Manager[CQ, C]) AddCohort(cohort C) {
- cohort.markExplicit()
- if oldCohort, ok := c.Cohorts[cohort.GetName()]; ok {
- c.rewireChildren(oldCohort, cohort)
+func (m *Manager[CQ, C]) AddCohort(cohortName string) {
+ oldCohort, ok := m.Cohorts[cohortName]
+ if ok && oldCohort.isExplicit() {
+ return
+ }
+ if !ok {
+ m.Cohorts[cohortName] = m.cohortFactory(cohortName)
+ }
+ m.Cohorts[cohortName].markExplicit()
+}
+
+func (m *Manager[CQ, C]) UpdateCohortEdge(name, parentName string) {
+ m.resetCycleChecker()
+ cohort := m.Cohorts[name]
+ m.detachCohortFromParent(cohort)
+ if parentName != "" {
+ parent := m.getOrCreateCohort(parentName)
+ parent.insertCohortChild(cohort)
+ cohort.setParent(parent)
}
- c.Cohorts[cohort.GetName()] = cohort
}
-func (c *Manager[CQ, C]) DeleteCohort(name string) {
- cohort, ok := c.Cohorts[name]
- delete(c.Cohorts, name)
- if !ok || cohort.childCount() == 0 {
+func (m *Manager[CQ, C]) DeleteCohort(name string) {
+ m.resetCycleChecker()
+ cohort, ok := m.Cohorts[name]
+ if !ok {
+ return
+ }
+ delete(m.Cohorts, name)
+ m.detachCohortFromParent(cohort)
+ if !cohort.hasChildren() {
return
}
- implicitCohort := c.cohortFactory(name)
- c.Cohorts[implicitCohort.GetName()] = implicitCohort
- c.rewireChildren(cohort, implicitCohort)
+ implicitCohort := m.cohortFactory(name)
+ m.Cohorts[implicitCohort.GetName()] = implicitCohort
+ m.transferChildren(cohort, implicitCohort)
}
-// rewireChildren is used when we are changing a Cohort
-// from an implicit to an explicit Cohort, or vice-versa.
-func (c *Manager[CQ, C]) rewireChildren(old, new C) {
+// transferChildren is used when we are changing a Cohort
+// from an explicit to an implicit Cohort.
+func (m *Manager[CQ, C]) transferChildren(old, new C) {
for _, cq := range old.ChildCQs() {
cq.setParent(new)
new.insertClusterQueue(cq)
}
+ for _, childCohort := range old.ChildCohorts() {
+ childCohort.setParent(new)
+ new.insertCohortChild(childCohort)
+ }
}
-func (c *Manager[CQ, C]) unwireClusterQueue(cq CQ) {
+func (m *Manager[CQ, C]) detachClusterQueueFromParent(cq CQ) {
if cq.HasParent() {
parent := cq.Parent()
parent.deleteClusterQueue(cq)
- c.cleanupCohort(parent)
+ m.cleanupCohort(parent)
var zero C
cq.setParent(zero)
}
}
-func (c *Manager[CQ, C]) getOrCreateCohort(cohortName string) C {
- if _, ok := c.Cohorts[cohortName]; !ok {
- c.Cohorts[cohortName] = c.cohortFactory(cohortName)
+func (m *Manager[CQ, C]) detachCohortFromParent(cohort C) {
+ if cohort.HasParent() {
+ parent := cohort.Parent()
+ parent.deleteCohortChild(cohort)
+ m.cleanupCohort(parent)
+ var zero C
+ cohort.setParent(zero)
}
- return c.Cohorts[cohortName]
}
-func (c *Manager[CQ, C]) cleanupCohort(cohort C) {
- if !cohort.isExplicit() && cohort.childCount() == 0 {
- delete(c.Cohorts, cohort.GetName())
+func (m *Manager[CQ, C]) getOrCreateCohort(cohortName string) C {
+ if _, ok := m.Cohorts[cohortName]; !ok {
+ m.Cohorts[cohortName] = m.cohortFactory(cohortName)
}
+ return m.Cohorts[cohortName]
+}
+
+func (m *Manager[CQ, C]) cleanupCohort(cohort C) {
+ if !cohort.isExplicit() && !cohort.hasChildren() {
+ delete(m.Cohorts, cohort.GetName())
+ }
+}
+
+func (m *Manager[CQ, C]) resetCycleChecker() {
+ m.CycleChecker = CycleChecker{make(map[string]bool, len(m.Cohorts))}
}
type nodeBase interface {
@@ -119,10 +158,17 @@ type clusterQueueNode[C nodeBase] interface {
nodeBase
}
-type cohortNode[CQ nodeBase] interface {
+type cohortNode[CQ, C nodeBase] interface {
+ Parent() C
+ HasParent() bool
+ setParent(C)
+ insertCohortChild(C)
+ deleteCohortChild(C)
+ ChildCohorts() []C
+
insertClusterQueue(CQ)
deleteClusterQueue(CQ)
- childCount() int
+ hasChildren() bool
ChildCQs() []CQ
isExplicit() bool
markExplicit()
diff --git a/pkg/hierarchy/manager_test.go b/pkg/hierarchy/manager_test.go
index 3c902fcac00..55ad311b44c 100644
--- a/pkg/hierarchy/manager_test.go
+++ b/pkg/hierarchy/manager_test.go
@@ -26,22 +26,23 @@ import (
func TestManager(t *testing.T) {
type M = Manager[*testClusterQueue, *testCohort]
- type cqEdge struct {
- cq string
- cohort string
+ type edge struct {
+ child string
+ parent string
}
opts := []cmp.Option{
cmpopts.EquateEmpty(),
- cmpopts.SortSlices(func(a, b cqEdge) bool {
- return a.cq < b.cq
+ cmpopts.SortSlices(func(a, b edge) bool {
+ return a.child < b.child
}),
- cmp.AllowUnexported(cqEdge{}),
+ cmp.AllowUnexported(edge{}),
}
tests := map[string]struct {
- operations func(M)
- wantCqs sets.Set[string]
- wantCohorts sets.Set[string]
- wantCqEdge []cqEdge
+ operations func(M)
+ wantCqs sets.Set[string]
+ wantCohorts sets.Set[string]
+ wantCqEdge []edge
+ wantCohortEdge []edge
}{
"create queues": {
operations: func(m M) {
@@ -77,7 +78,7 @@ func TestManager(t *testing.T) {
"cohort-a",
"cohort-b",
),
- wantCqEdge: []cqEdge{
+ wantCqEdge: []edge{
{"queue1", "cohort-a"},
{"queue2", "cohort-a"},
{"queue3", "cohort-b"},
@@ -95,12 +96,12 @@ func TestManager(t *testing.T) {
},
wantCqs: sets.New("queue1", "queue2"),
wantCohorts: sets.New("cohort-b", "cohort-c"),
- wantCqEdge: []cqEdge{
+ wantCqEdge: []edge{
{"queue1", "cohort-b"},
{"queue2", "cohort-c"},
},
},
- "updating idempotent": {
+ "updating cqs idempotent": {
operations: func(m M) {
m.AddClusterQueue(newCq("queue1"))
m.AddClusterQueue(newCq("queue2"))
@@ -111,16 +112,31 @@ func TestManager(t *testing.T) {
m.UpdateClusterQueueEdge("queue2", "cohort-c")
m.UpdateClusterQueueEdge("queue1", "cohort-b")
m.UpdateClusterQueueEdge("queue2", "cohort-c")
- m.UpdateClusterQueueEdge("queue2", "cohort-c")
- m.UpdateClusterQueueEdge("queue1", "cohort-b")
},
wantCqs: sets.New("queue1", "queue2"),
wantCohorts: sets.New("cohort-b", "cohort-c"),
- wantCqEdge: []cqEdge{
+ wantCqEdge: []edge{
{"queue1", "cohort-b"},
{"queue2", "cohort-c"},
},
},
+ "updating cohort idempotent": {
+ operations: func(m M) {
+ m.AddCohort("cohort")
+ m.UpdateCohortEdge("cohort", "root")
+ m.UpdateCohortEdge("cohort", "newroot")
+ m.UpdateCohortEdge("cohort", "newroot")
+ },
+ wantCohorts: sets.New("cohort", "newroot"),
+ wantCohortEdge: []edge{{"cohort", "newroot"}},
+ },
+ "adding cohort idempotent": {
+ operations: func(m M) {
+ m.AddCohort("cohort")
+ m.AddCohort("cohort")
+ },
+ wantCohorts: sets.New("cohort"),
+ },
"delete cohorts": {
operations: func(m M) {
m.AddClusterQueue(newCq("queue1"))
@@ -150,7 +166,7 @@ func TestManager(t *testing.T) {
},
wantCqs: sets.New[string](),
},
- "cohort remains as long as one of its children remains": {
+ "cohort remains as long as one of its child cqs remains": {
operations: func(m M) {
m.AddClusterQueue(newCq("queue1"))
m.AddClusterQueue(newCq("queue2"))
@@ -164,17 +180,31 @@ func TestManager(t *testing.T) {
},
wantCqs: sets.New("queue1"),
wantCohorts: sets.New("cohort"),
- wantCqEdge: []cqEdge{{"queue1", "cohort"}},
+ wantCqEdge: []edge{{"queue1", "cohort"}},
+ },
+ "cohort remains as long as one of its child cohorts remains": {
+ operations: func(m M) {
+ m.AddCohort("cohort1")
+ m.AddCohort("cohort2")
+ m.AddCohort("cohort3")
+ m.UpdateCohortEdge("cohort1", "root")
+ m.UpdateCohortEdge("cohort2", "root")
+ m.UpdateCohortEdge("cohort3", "root")
+ m.DeleteCohort("cohort2")
+ m.DeleteCohort("cohort3")
+ },
+ wantCohorts: sets.New("cohort1", "root"),
+ wantCohortEdge: []edge{{"cohort1", "root"}},
},
"explicit cohort": {
operations: func(m M) {
- m.AddCohort(newCohort("cohort"))
+ m.AddCohort("cohort")
},
wantCohorts: sets.New("cohort"),
},
"delete explicit cohort": {
operations: func(m M) {
- m.AddCohort(newCohort("cohort"))
+ m.AddCohort("cohort")
m.DeleteCohort("cohort")
},
wantCohorts: sets.New[string](),
@@ -182,7 +212,7 @@ func TestManager(t *testing.T) {
"delete explicit cohort idempotent": {
operations: func(m M) {
m.DeleteCohort("cohort")
- m.AddCohort(newCohort("cohort"))
+ m.AddCohort("cohort")
m.DeleteCohort("cohort")
m.DeleteCohort("cohort")
},
@@ -192,25 +222,25 @@ func TestManager(t *testing.T) {
operations: func(m M) {
m.AddClusterQueue(newCq("queue"))
m.UpdateClusterQueueEdge("queue", "cohort")
- m.AddCohort(newCohort("cohort"))
+ m.AddCohort("cohort")
m.DeleteClusterQueue("queue")
},
wantCohorts: sets.New("cohort"),
},
"explicit cohort downgraded to implicit cohort": {
operations: func(m M) {
- m.AddCohort(newCohort("cohort"))
+ m.AddCohort("cohort")
m.AddClusterQueue(newCq("queue"))
m.UpdateClusterQueueEdge("queue", "cohort")
m.DeleteCohort("cohort")
},
wantCohorts: sets.New("cohort"),
wantCqs: sets.New("queue"),
- wantCqEdge: []cqEdge{{"queue", "cohort"}},
+ wantCqEdge: []edge{{"queue", "cohort"}},
},
"cohort upgraded to explicit then downgraded to implicit then deleted": {
operations: func(m M) {
- m.AddCohort(newCohort("cohort"))
+ m.AddCohort("cohort")
m.AddClusterQueue(newCq("queue"))
m.UpdateClusterQueueEdge("queue", "cohort")
m.DeleteCohort("cohort")
@@ -218,7 +248,75 @@ func TestManager(t *testing.T) {
},
wantCohorts: sets.New[string](),
wantCqs: sets.New[string](),
- wantCqEdge: []cqEdge{},
+ wantCqEdge: []edge{},
+ },
+ "hierarchical cohorts": {
+ // root
+ // / \
+ // left right
+ // / \
+ // left-left right-right
+ operations: func(m M) {
+ m.AddCohort("root")
+ m.AddCohort("left")
+ m.AddCohort("right")
+ m.AddCohort("left-left")
+ m.AddCohort("right-right")
+ m.UpdateCohortEdge("left", "root")
+ m.UpdateCohortEdge("right", "root")
+ m.UpdateCohortEdge("left-left", "left")
+ m.UpdateCohortEdge("right-right", "right")
+
+ m.AddClusterQueue(newCq("cq"))
+ m.UpdateClusterQueueEdge("cq", "right-right")
+ },
+ wantCqs: sets.New("cq"),
+ wantCqEdge: []edge{
+ {"cq", "right-right"},
+ },
+ wantCohorts: sets.New("root", "left", "right", "left-left", "right-right"),
+ wantCohortEdge: []edge{
+ {"left", "root"},
+ {"right", "root"},
+ {"left-left", "left"},
+ {"right-right", "right"},
+ },
+ },
+ "delete node in middle of hierarchy": {
+ // Before: fully connected
+ //
+ // root
+ // / \
+ // left right
+ // / \
+ // left-left right-right
+ //
+ // After: left is an implicit Cohort
+ //
+ // root
+ // \
+ // left right
+ // / \
+ // left-left right-right
+ operations: func(m M) {
+ m.AddCohort("root")
+ m.AddCohort("left")
+ m.AddCohort("right")
+ m.AddCohort("left-left")
+ m.AddCohort("right-right")
+ m.UpdateCohortEdge("left", "root")
+ m.UpdateCohortEdge("right", "root")
+ m.UpdateCohortEdge("left-left", "left")
+ m.UpdateCohortEdge("right-right", "right")
+
+ m.DeleteCohort("left")
+ },
+ wantCohorts: sets.New("root", "left", "right", "left-left", "right-right"),
+ wantCohortEdge: []edge{
+ {"right", "root"},
+ {"left-left", "left"},
+ {"right-right", "right"},
+ },
},
}
@@ -228,11 +326,11 @@ func TestManager(t *testing.T) {
tc.operations(mgr)
t.Run("verify clusterqueues", func(t *testing.T) {
gotCqs := sets.New[string]()
- gotEdges := make([]cqEdge, 0, len(tc.wantCqEdge))
+ gotEdges := make([]edge, 0, len(tc.wantCqEdge))
for _, cq := range mgr.ClusterQueues {
gotCqs.Insert(cq.GetName())
if cq.HasParent() {
- gotEdges = append(gotEdges, cqEdge{cq.GetName(), cq.Parent().GetName()})
+ gotEdges = append(gotEdges, edge{cq.GetName(), cq.Parent().GetName()})
}
}
if diff := cmp.Diff(tc.wantCqs, gotCqs); diff != "" {
@@ -244,24 +342,157 @@ func TestManager(t *testing.T) {
})
t.Run("verify cohorts", func(t *testing.T) {
gotCohorts := sets.New[string]()
- gotEdges := make([]cqEdge, 0, len(tc.wantCqEdge))
+ gotCqEdges := make([]edge, 0, len(tc.wantCqEdge))
+ gotCohortChildEdges := make([]edge, 0, len(tc.wantCohortEdge))
+ gotCohortParentEdges := make([]edge, 0, len(tc.wantCohortEdge))
for _, cohort := range mgr.Cohorts {
gotCohorts.Insert(cohort.GetName())
for _, cq := range cohort.ChildCQs() {
- gotEdges = append(gotEdges, cqEdge{cq.GetName(), cohort.GetName()})
+ gotCqEdges = append(gotCqEdges, edge{cq.GetName(), cohort.GetName()})
+ }
+ for _, childCohort := range cohort.ChildCohorts() {
+ gotCohortChildEdges = append(gotCohortChildEdges, edge{childCohort.GetName(), cohort.GetName()})
+ }
+ if cohort.HasParent() {
+ gotCohortParentEdges = append(gotCohortParentEdges, edge{cohort.GetName(), cohort.Parent().GetName()})
}
}
if diff := cmp.Diff(tc.wantCohorts, gotCohorts); diff != "" {
t.Fatalf("Unexpected cohorts -want +got %s", diff)
}
- if diff := cmp.Diff(tc.wantCqEdge, gotEdges, opts...); diff != "" {
- t.Fatalf("Unexpected Cohort->CQ edges -want +got %s", diff)
+ if diff := cmp.Diff(tc.wantCqEdge, gotCqEdges, opts...); diff != "" {
+ t.Fatalf("Unexpected CQ<-Cohort edges -want +got %s", diff)
+ }
+ if diff := cmp.Diff(tc.wantCohortEdge, gotCohortChildEdges, opts...); diff != "" {
+ t.Fatalf("Unexpected Cohort<-Cohort edges -want +got %s", diff)
+ }
+ if diff := cmp.Diff(tc.wantCohortEdge, gotCohortParentEdges, opts...); diff != "" {
+ t.Fatalf("Unexpected Cohort->Cohort edges -want +got %s", diff)
}
})
})
}
}
+func TestCycles(t *testing.T) {
+ type M = Manager[*testClusterQueue, *testCohort]
+ cases := map[string]struct {
+ operations func(M)
+ wantCycles map[string]bool
+ }{
+ "no cycles": {
+ operations: func(m M) {
+ m.AddCohort("root")
+ m.AddCohort("left")
+ m.AddCohort("right")
+ m.UpdateCohortEdge("left", "root")
+ m.UpdateCohortEdge("right", "root")
+ },
+ wantCycles: map[string]bool{
+ "root": false,
+ "left": false,
+ "right": false,
+ },
+ },
+ "self-cycle": {
+ operations: func(m M) {
+ m.AddCohort("root")
+ m.UpdateCohortEdge("root", "root")
+ },
+ wantCycles: map[string]bool{
+ "root": true,
+ },
+ },
+ "remove self-cycle": {
+ operations: func(m M) {
+ m.AddCohort("root")
+ m.UpdateCohortEdge("root", "root")
+ // we call HasCycle to test invalidation
+ m.CycleChecker.HasCycle(m.Cohorts["root"])
+ m.UpdateCohortEdge("root", "")
+ },
+ wantCycles: map[string]bool{
+ "root": false,
+ },
+ },
+ "cycle": {
+ operations: func(m M) {
+ m.AddCohort("cohort-a")
+ m.AddCohort("cohort-b")
+ m.UpdateCohortEdge("cohort-a", "cohort-b")
+ m.UpdateCohortEdge("cohort-b", "cohort-a")
+ },
+ wantCycles: map[string]bool{
+ "cohort-a": true,
+ "cohort-b": true,
+ },
+ },
+ "remove cycle via edge update": {
+ operations: func(m M) {
+ m.AddCohort("cohort-a")
+ m.AddCohort("cohort-b")
+ m.UpdateCohortEdge("cohort-a", "cohort-b")
+ m.UpdateCohortEdge("cohort-b", "cohort-a")
+
+ // we call HasCycle to test invalidation
+ m.CycleChecker.HasCycle(m.Cohorts["cohort-a"])
+
+ m.UpdateCohortEdge("cohort-a", "cohort-c")
+ },
+ wantCycles: map[string]bool{
+ "cohort-a": false,
+ "cohort-b": false,
+ "cohort-c": false,
+ },
+ },
+ "remove cycle via edge deletion": {
+ operations: func(m M) {
+ m.AddCohort("cohort-a")
+ m.AddCohort("cohort-b")
+ m.UpdateCohortEdge("cohort-a", "cohort-b")
+ m.UpdateCohortEdge("cohort-b", "cohort-a")
+ m.CycleChecker.HasCycle(m.Cohorts["cohort-a"])
+
+ m.UpdateCohortEdge("cohort-a", "")
+ },
+ wantCycles: map[string]bool{
+ "cohort-a": false,
+ "cohort-b": false,
+ },
+ },
+ "remove cycle via node deletion": {
+ operations: func(m M) {
+ m.AddCohort("cohort-a")
+ m.AddCohort("cohort-b")
+ m.UpdateCohortEdge("cohort-a", "cohort-b")
+ m.UpdateCohortEdge("cohort-b", "cohort-a")
+ m.CycleChecker.HasCycle(m.Cohorts["cohort-a"])
+ m.DeleteCohort("cohort-b")
+ },
+ wantCycles: map[string]bool{
+ "cohort-a": false,
+ "cohort-b": false,
+ },
+ },
+ }
+
+ for name, tc := range cases {
+ t.Run(name, func(t *testing.T) {
+ mgr := NewManager(newCohort)
+ tc.operations(mgr)
+ for _, cohort := range mgr.Cohorts {
+ got := mgr.CycleChecker.HasCycle(cohort)
+ if got != tc.wantCycles[cohort.GetName()] {
+ t.Errorf("-want +got: %v %v", tc.wantCycles[cohort.GetName()], got)
+ }
+ }
+ if diff := cmp.Diff(mgr.CycleChecker.cycles, tc.wantCycles); diff != "" {
+ t.Errorf("-want +got: %v", diff)
+ }
+ })
+ }
+}
+
type testCohort struct {
name string
Cohort[*testClusterQueue, *testCohort]
@@ -278,6 +509,10 @@ func (t *testCohort) GetName() string {
return t.name
}
+func (t *testCohort) CCParent() CycleCheckable {
+ return t.Parent()
+}
+
type testClusterQueue struct {
name string
ClusterQueue[*testCohort]
diff --git a/pkg/queue/cohort.go b/pkg/queue/cohort.go
index 2ac0ebb90f2..5885b7e4754 100644
--- a/pkg/queue/cohort.go
+++ b/pkg/queue/cohort.go
@@ -35,3 +35,15 @@ func newCohort(name string) *cohort {
func (c *cohort) GetName() string {
return c.Name
}
+
+// CCParent satisfies the CycleCheckable interface.
+func (c *cohort) CCParent() hierarchy.CycleCheckable {
+ return c.Parent()
+}
+
+func (c *cohort) getRootUnsafe() *cohort {
+ if !c.HasParent() {
+ return c
+ }
+ return c.Parent().getRootUnsafe()
+}
diff --git a/pkg/queue/manager.go b/pkg/queue/manager.go
index d6b9d7ea7b2..a36ee73f52b 100644
--- a/pkg/queue/manager.go
+++ b/pkg/queue/manager.go
@@ -29,6 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
config "sigs.k8s.io/kueue/apis/config/v1beta1"
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
utilindexer "sigs.k8s.io/kueue/pkg/controller/core/indexer"
"sigs.k8s.io/kueue/pkg/hierarchy"
@@ -109,6 +110,22 @@ func NewManager(client client.Client, checker StatusChecker, opts ...Option) *Ma
return m
}
+func (m *Manager) AddOrUpdateCohort(ctx context.Context, cohort *kueuealpha.Cohort) {
+ m.Lock()
+ defer m.Unlock()
+ m.hm.AddCohort(cohort.Name)
+ m.hm.UpdateCohortEdge(cohort.Name, cohort.Spec.Parent)
+ if m.requeueWorkloadsCohort(ctx, m.hm.Cohorts[cohort.Name]) {
+ m.Broadcast()
+ }
+}
+
+func (m *Manager) DeleteCohort(cohortName string) {
+ m.Lock()
+ defer m.Unlock()
+ m.hm.DeleteCohort(cohortName)
+}
+
func (m *Manager) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) error {
m.Lock()
defer m.Unlock()
@@ -139,7 +156,7 @@ func (m *Manager) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) e
}
}
- queued := m.queueAllInadmissibleWorkloadsInCohort(ctx, cqImpl)
+ queued := m.requeueWorkloadsCQ(ctx, cqImpl)
m.reportPendingWorkloads(cq.Name, cqImpl)
if queued || addedWorkloads {
m.Broadcast()
@@ -164,7 +181,7 @@ func (m *Manager) UpdateClusterQueue(ctx context.Context, cq *kueue.ClusterQueue
// TODO(#8): Selectively move workloads based on the exact event.
// If any workload becomes admissible or the queue becomes active.
- if (specUpdated && m.queueAllInadmissibleWorkloadsInCohort(ctx, cqImpl)) || (!oldActive && cqImpl.Active()) {
+ if (specUpdated && m.requeueWorkloadsCQ(ctx, cqImpl)) || (!oldActive && cqImpl.Active()) {
m.reportPendingWorkloads(cq.Name, cqImpl)
m.Broadcast()
}
@@ -394,7 +411,7 @@ func (m *Manager) QueueAssociatedInadmissibleWorkloadsAfter(ctx context.Context,
return
}
- if m.queueAllInadmissibleWorkloadsInCohort(ctx, cq) {
+ if m.requeueWorkloadsCQ(ctx, cq) {
m.Broadcast()
}
}
@@ -415,7 +432,7 @@ func (m *Manager) QueueInadmissibleWorkloads(ctx context.Context, cqNames sets.S
if !exists {
continue
}
- if m.queueAllInadmissibleWorkloadsInCohort(ctx, cq) {
+ if m.requeueWorkloadsCQ(ctx, cq) {
queued = true
}
}
@@ -425,25 +442,55 @@ func (m *Manager) QueueInadmissibleWorkloads(ctx context.Context, cqNames sets.S
}
}
-// queueAllInadmissibleWorkloadsInCohort moves all workloads in the same
+// requeueWorkloadsCQ moves all workloads in the same
// cohort with this ClusterQueue from inadmissibleWorkloads to heap. If the
// cohort of this ClusterQueue is empty, it just moves all workloads in this
// ClusterQueue. If at least one workload is moved, returns true, otherwise
// returns false.
// The events listed below could make workloads in the same cohort admissible.
-// Then queueAllInadmissibleWorkloadsInCohort need to be invoked.
+// Then requeueWorkloadsCQ need to be invoked.
// 1. delete events for any admitted workload in the cohort.
// 2. add events of any cluster queue in the cohort.
// 3. update events of any cluster queue in the cohort.
-func (m *Manager) queueAllInadmissibleWorkloadsInCohort(ctx context.Context, cq *ClusterQueue) bool {
- if !cq.HasParent() {
- return cq.QueueInadmissibleWorkloads(ctx, m.client)
+// 4. update of cohort.
+//
+// WARNING: must hold a read-lock on the manager when calling,
+// or otherwise risk encountering an infinite loop if a Cohort
+// cycle is introduced.
+func (m *Manager) requeueWorkloadsCQ(ctx context.Context, cq *ClusterQueue) bool {
+ if cq.HasParent() {
+ return m.requeueWorkloadsCohort(ctx, cq.Parent())
+ }
+ return cq.QueueInadmissibleWorkloads(ctx, m.client)
+}
+
+// moveWorkloadsCohorts checks for a cycle, the moves all inadmissible
+// workloads in the Cohort tree. If a cycle exists, or no workloads were
+// moved, it returns false.
+//
+// WARNING: must hold a read-lock on the manager when calling,
+// or otherwise risk encountering an infinite loop if a Cohort
+// cycle is introduced.
+func (m *Manager) requeueWorkloadsCohort(ctx context.Context, cohort *cohort) bool {
+ log := ctrl.LoggerFrom(ctx)
+
+ if m.hm.CycleChecker.HasCycle(cohort) {
+ log.V(2).Info("Attempted to move workloads from Cohort which has cycle", "cohort", cohort.GetName())
+ return false
}
+ root := cohort.getRootUnsafe()
+ log.V(2).Info("Attempting to move workloads", "cohort", cohort.Name, "root", root.Name)
+ return requeueWorkloadsCohortSubtree(ctx, m, root)
+}
+func requeueWorkloadsCohortSubtree(ctx context.Context, m *Manager, cohort *cohort) bool {
queued := false
- for _, clusterQueue := range cq.Parent().ChildCQs() {
+ for _, clusterQueue := range cohort.ChildCQs() {
queued = clusterQueue.QueueInadmissibleWorkloads(ctx, m.client) || queued
}
+ for _, childCohort := range cohort.ChildCohorts() {
+ queued = requeueWorkloadsCohortSubtree(ctx, m, childCohort) || queued
+ }
return queued
}
diff --git a/pkg/queue/manager_test.go b/pkg/queue/manager_test.go
index 3b2e82e02f9..0f9ce9d4bac 100644
--- a/pkg/queue/manager_test.go
+++ b/pkg/queue/manager_test.go
@@ -32,6 +32,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"sigs.k8s.io/controller-runtime/pkg/client"
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
"sigs.k8s.io/kueue/pkg/workload"
@@ -150,6 +151,8 @@ func TestUpdateClusterQueue(t *testing.T) {
if err := manager.AddClusterQueue(ctx, cq); err != nil {
t.Fatalf("Failed adding clusterQueue %s: %v", cq.Name, err)
}
+ // Increase the popCycle to ensure that the workload will be added as inadmissible.
+ manager.getClusterQueue(cq.Name).popCycle++
}
for _, q := range queues {
if err := manager.AddLocalQueue(ctx, q); err != nil {
@@ -164,6 +167,20 @@ func TestUpdateClusterQueue(t *testing.T) {
manager.RequeueWorkload(ctx, workload.NewInfo(w), RequeueReasonGeneric)
}
+ // Verify that all workloads are marked as inadmissible after creation.
+ inadmissibleWorkloads := manager.DumpInadmissible()
+ wantInadmissibleWorkloads := map[string][]string{
+ "cq1": {"default/a"},
+ "cq2": {"default/b"},
+ }
+ if diff := cmp.Diff(wantInadmissibleWorkloads, inadmissibleWorkloads); diff != "" {
+ t.Errorf("Unexpected set of inadmissible workloads (-want +got):\n%s", diff)
+ }
+ activeWorkloads := manager.Dump()
+ if diff := cmp.Diff(map[string][]string(nil), activeWorkloads); diff != "" {
+ t.Errorf("Unexpected active workloads (-want +got):\n%s", diff)
+ }
+
// Put cq2 in the same cohort as cq1.
clusterQueues[1].Spec.Cohort = clusterQueues[0].Spec.Cohort
if err := manager.UpdateClusterQueue(ctx, clusterQueues[1], true); err != nil {
@@ -184,8 +201,12 @@ func TestUpdateClusterQueue(t *testing.T) {
t.Errorf("Unexpected ClusterQueues in cohorts (-want,+got):\n%s", diff)
}
- // Verify all workloads are active after the update.
- activeWorkloads := manager.Dump()
+ // Verify that all workloads are active after the update.
+ inadmissibleWorkloads = manager.DumpInadmissible()
+ if diff := cmp.Diff(map[string][]string(nil), inadmissibleWorkloads); diff != "" {
+ t.Errorf("Unexpected set of inadmissible workloads (-want +got):\n%s", diff)
+ }
+ activeWorkloads = manager.Dump()
wantActiveWorkloads := map[string][]string{
"cq1": {"default/a"},
"cq2": {"default/b"},
@@ -195,6 +216,44 @@ func TestUpdateClusterQueue(t *testing.T) {
}
}
+func TestRequeueWorkloadsCohortCycle(t *testing.T) {
+ cohorts := []*kueuealpha.Cohort{
+ utiltesting.MakeCohort("cohort-a").Parent("cohort-b").Obj(),
+ utiltesting.MakeCohort("cohort-b").Parent("cohort-c").Obj(),
+ utiltesting.MakeCohort("cohort-c").Parent("cohort-a").Obj(),
+ }
+ cq := utiltesting.MakeClusterQueue("cq1").Cohort("cohort-a").Obj()
+ lq := utiltesting.MakeLocalQueue("foo", defaultNamespace).ClusterQueue("cq1").Obj()
+ wl := utiltesting.MakeWorkload("a", defaultNamespace).Queue("foo").Creation(time.Now()).Obj()
+ // Setup.
+ ctx := context.Background()
+ cl := utiltesting.NewFakeClient(
+ &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: defaultNamespace}},
+ )
+ manager := NewManager(cl, nil)
+ for _, cohort := range cohorts {
+ manager.AddOrUpdateCohort(ctx, cohort)
+ }
+ if err := manager.AddClusterQueue(ctx, cq); err != nil {
+ t.Fatalf("Failed adding clusterQueue %s: %v", cq.Name, err)
+ }
+ if err := manager.AddLocalQueue(ctx, lq); err != nil {
+ t.Fatalf("Failed adding queue %s: %v", lq.Name, err)
+ }
+ if err := cl.Create(ctx, wl); err != nil {
+ t.Fatalf("Failed adding workload to client: %v", err)
+ }
+ // This test will pass with the removal of this line.
+ // Update once we find a solution to #3066.
+ manager.RequeueWorkload(ctx, workload.NewInfo(wl), RequeueReasonGeneric)
+
+ // This method is where we do a cycle check. We call it to ensure
+ // it behaves properly when a cycle exists
+ if manager.requeueWorkloadsCohort(ctx, manager.hm.Cohorts["cohort-a"]) {
+ t.Fatal("Expected moveWorkloadsCohort to return false")
+ }
+}
+
// TestClusterQueueToActive tests that managers cond gets a broadcast when
// a cluster queue becomes active.
func TestClusterQueueToActive(t *testing.T) {
diff --git a/pkg/scheduler/flavorassigner/flavorassigner.go b/pkg/scheduler/flavorassigner/flavorassigner.go
index b5e606522bc..470907e0f9d 100644
--- a/pkg/scheduler/flavorassigner/flavorassigner.go
+++ b/pkg/scheduler/flavorassigner/flavorassigner.go
@@ -106,11 +106,18 @@ func (a *Assignment) ToAPI() []kueue.PodSetAssignment {
return psFlavors
}
+// TotalRequestsFor - returns the total quota needs of the wl, taking into account the potential
+// scaling needed in case of partial admission.
func (a *Assignment) TotalRequestsFor(wl *workload.Info) resources.FlavorResourceQuantities {
usage := make(resources.FlavorResourceQuantities)
for i, ps := range wl.TotalRequests {
+ // in case of partial admission scale down the quantity
+ aps := a.PodSets[i]
+ if aps.Count != ps.Count {
+ ps = *ps.ScaledTo(aps.Count)
+ }
for res, q := range ps.Requests {
- flv := a.PodSets[i].Flavors[res].Name
+ flv := aps.Flavors[res].Name
usage[resources.FlavorResource{Flavor: flv, Resource: res}] += q
}
}
@@ -287,8 +294,7 @@ func New(wl *workload.Info, cq *cache.ClusterQueueSnapshot, resourceFlavors map[
}
func lastAssignmentOutdated(wl *workload.Info, cq *cache.ClusterQueueSnapshot) bool {
- return cq.AllocatableResourceGeneration > wl.LastAssignment.ClusterQueueGeneration ||
- (cq.Cohort != nil && cq.Cohort.AllocatableResourceGeneration > wl.LastAssignment.CohortGeneration)
+ return cq.AllocatableResourceGeneration > wl.LastAssignment.ClusterQueueGeneration
}
// Assign assigns a flavor to each of the resources requested in each pod set.
@@ -302,12 +308,6 @@ func (a *FlavorAssigner) Assign(log logr.Logger, counts []int32) Assignment {
"cq.AllocatableResourceGeneration", a.cq.AllocatableResourceGeneration,
"wl.LastAssignment.ClusterQueueGeneration", a.wl.LastAssignment.ClusterQueueGeneration,
}
- if a.cq.Cohort != nil {
- keysValues = append(keysValues,
- "cq.Cohort.AllocatableResourceGeneration", a.cq.Cohort.AllocatableResourceGeneration,
- "wl.LastAssignment.CohortGeneration", a.wl.LastAssignment.CohortGeneration,
- )
- }
logV.Info("Clearing Workload's last assignment because it was outdated", keysValues...)
}
a.wl.LastAssignment = nil
@@ -330,13 +330,9 @@ func (a *FlavorAssigner) assignFlavors(log logr.Logger, requests []workload.PodS
Usage: make(resources.FlavorResourceQuantities),
LastState: workload.AssignmentClusterQueueState{
LastTriedFlavorIdx: make([]map[corev1.ResourceName]int, 0, len(requests)),
- CohortGeneration: 0,
ClusterQueueGeneration: a.cq.AllocatableResourceGeneration,
},
}
- if a.cq.Cohort != nil {
- assignment.LastState.CohortGeneration = a.cq.Cohort.AllocatableResourceGeneration
- }
for i, podSet := range requests {
if a.cq.RGByResource(corev1.ResourcePods) != nil {
@@ -624,7 +620,7 @@ func (a *FlavorAssigner) fitsResourceQuota(log logr.Logger, fr resources.FlavorR
lackQuantity := resources.ResourceQuantity(fr.Resource, lack)
msg := fmt.Sprintf("insufficient unused quota in cohort for %s in flavor %s, %s more needed", fr.Resource, fr.Flavor, &lackQuantity)
- if a.cq.Cohort == nil {
+ if !a.cq.HasParent() {
if mode == noFit {
msg = fmt.Sprintf("insufficient quota for %s in flavor %s in ClusterQueue", fr.Resource, fr.Flavor)
} else {
diff --git a/pkg/scheduler/flavorassigner/flavorassigner_test.go b/pkg/scheduler/flavorassigner/flavorassigner_test.go
index 8e9bb123e8b..966620bb4bd 100644
--- a/pkg/scheduler/flavorassigner/flavorassigner_test.go
+++ b/pkg/scheduler/flavorassigner/flavorassigner_test.go
@@ -1925,7 +1925,7 @@ func TestAssignFlavors(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
if tc.disableLendingLimit {
- defer features.SetFeatureGateDuringTest(t, features.LendingLimit, false)()
+ features.SetFeatureGateDuringTest(t, features.LendingLimit, false)
}
log := testr.NewWithOptions(t, testr.Options{
Verbosity: 2,
@@ -1954,11 +1954,11 @@ func TestAssignFlavors(t *testing.T) {
}
if tc.cohortResources != nil {
- if clusterQueue.Cohort == nil {
+ if !clusterQueue.HasParent() {
t.Fatalf("Test case has cohort resources, but cluster queue doesn't have cohort")
}
- clusterQueue.Cohort.ResourceNode.Usage = tc.cohortResources.usage
- clusterQueue.Cohort.ResourceNode.SubtreeQuota = tc.cohortResources.requestableResources
+ clusterQueue.Parent().ResourceNode.Usage = tc.cohortResources.usage
+ clusterQueue.Parent().ResourceNode.SubtreeQuota = tc.cohortResources.requestableResources
}
clusterQueue.ResourceNode.Usage = tc.clusterQueueUsage
@@ -2269,43 +2269,20 @@ func TestLastAssignmentOutdated(t *testing.T) {
},
},
cq: &cache.ClusterQueueSnapshot{
- Cohort: nil,
AllocatableResourceGeneration: 1,
},
},
want: true,
},
- {
- name: "Cohort allocatableResourceIncreasedGen increased",
- args: args{
- wl: &workload.Info{
- LastAssignment: &workload.AssignmentClusterQueueState{
- ClusterQueueGeneration: 0,
- CohortGeneration: 0,
- },
- },
- cq: &cache.ClusterQueueSnapshot{
- Cohort: &cache.CohortSnapshot{
- AllocatableResourceGeneration: 1,
- },
- AllocatableResourceGeneration: 0,
- },
- },
- want: true,
- },
{
name: "AllocatableResourceGeneration not increased",
args: args{
wl: &workload.Info{
LastAssignment: &workload.AssignmentClusterQueueState{
ClusterQueueGeneration: 0,
- CohortGeneration: 0,
},
},
cq: &cache.ClusterQueueSnapshot{
- Cohort: &cache.CohortSnapshot{
- AllocatableResourceGeneration: 0,
- },
AllocatableResourceGeneration: 0,
},
},
diff --git a/pkg/scheduler/preemption/preemption.go b/pkg/scheduler/preemption/preemption.go
index f370afa5775..3b061c7cdd1 100644
--- a/pkg/scheduler/preemption/preemption.go
+++ b/pkg/scheduler/preemption/preemption.go
@@ -510,9 +510,9 @@ func (p *Preemptor) findCandidates(wl *kueue.Workload, cq *cache.ClusterQueueSna
}
}
- if cq.Cohort != nil && cq.Preemption.ReclaimWithinCohort != kueue.PreemptionPolicyNever {
+ if cq.HasParent() && cq.Preemption.ReclaimWithinCohort != kueue.PreemptionPolicyNever {
onlyLowerPriority := cq.Preemption.ReclaimWithinCohort != kueue.PreemptionPolicyAny
- for cohortCQ := range cq.Cohort.Members {
+ for _, cohortCQ := range cq.Parent().ChildCQs() {
if cq == cohortCQ || !cqIsBorrowing(cohortCQ, frsNeedPreemption) {
// Can't reclaim quota from itself or ClusterQueues that are not borrowing.
continue
@@ -532,7 +532,7 @@ func (p *Preemptor) findCandidates(wl *kueue.Workload, cq *cache.ClusterQueueSna
}
func cqIsBorrowing(cq *cache.ClusterQueueSnapshot, frsNeedPreemption sets.Set[resources.FlavorResource]) bool {
- if cq.Cohort == nil {
+ if !cq.HasParent() {
return false
}
for fr := range frsNeedPreemption {
diff --git a/pkg/scheduler/preemption/preemption_test.go b/pkg/scheduler/preemption/preemption_test.go
index 7a4ba86964c..76bb43fc330 100644
--- a/pkg/scheduler/preemption/preemption_test.go
+++ b/pkg/scheduler/preemption/preemption_test.go
@@ -41,6 +41,7 @@ import (
"sigs.k8s.io/kueue/pkg/cache"
"sigs.k8s.io/kueue/pkg/constants"
"sigs.k8s.io/kueue/pkg/features"
+ "sigs.k8s.io/kueue/pkg/hierarchy"
"sigs.k8s.io/kueue/pkg/scheduler/flavorassigner"
"sigs.k8s.io/kueue/pkg/util/slices"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
@@ -49,8 +50,10 @@ import (
var snapCmpOpts = []cmp.Option{
cmpopts.EquateEmpty(),
- cmpopts.IgnoreUnexported(cache.ClusterQueueSnapshot{}),
- cmpopts.IgnoreFields(cache.CohortSnapshot{}, "AllocatableResourceGeneration"),
+ cmpopts.IgnoreUnexported(hierarchy.Cohort[*cache.ClusterQueueSnapshot, *cache.CohortSnapshot]{}),
+ cmpopts.IgnoreUnexported(hierarchy.ClusterQueue[*cache.CohortSnapshot]{}),
+ cmpopts.IgnoreUnexported(hierarchy.Manager[*cache.ClusterQueueSnapshot, *cache.CohortSnapshot]{}),
+ cmpopts.IgnoreUnexported(hierarchy.CycleChecker{}),
cmpopts.IgnoreFields(cache.ClusterQueueSnapshot{}, "AllocatableResourceGeneration"),
cmp.Transformer("Cohort.Members", func(s sets.Set[*cache.ClusterQueueSnapshot]) sets.Set[string] {
result := make(sets.Set[string], len(s))
@@ -911,6 +914,7 @@ func TestPreemption(t *testing.T) {
Mode: flavorassigner.Preempt,
},
},
+ Count: 1,
},
{
Name: "workers",
@@ -920,6 +924,7 @@ func TestPreemption(t *testing.T) {
Mode: flavorassigner.Preempt,
},
},
+ Count: 2,
},
},
},
@@ -1420,7 +1425,7 @@ func TestPreemption(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
if tc.disableLendingLimit {
- defer features.SetFeatureGateDuringTest(t, features.LendingLimit, false)()
+ features.SetFeatureGateDuringTest(t, features.LendingLimit, false)
}
ctx, log := utiltesting.ContextWithLog(t)
cl := utiltesting.NewClientBuilder().
@@ -2044,6 +2049,7 @@ func singlePodSetAssignment(assignments flavorassigner.ResourceAssignment) flavo
PodSets: []flavorassigner.PodSetAssignment{{
Name: kueue.DefaultPodSetName,
Flavors: assignments,
+ Count: 1,
}},
}
}
diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go
index ff34f795651..8a5f05bc2d9 100644
--- a/pkg/scheduler/scheduler.go
+++ b/pkg/scheduler/scheduler.go
@@ -273,17 +273,17 @@ func (s *Scheduler) schedule(ctx context.Context) wait.SpeedSignal {
}
preemptedWorkloads.Insert(pendingPreemptions...)
cq.AddUsage(usage)
- } else if cq.Cohort != nil {
- sum := cycleCohortsUsage.totalUsageForCommonFlavorResources(cq.Cohort.Name, e.assignment.Usage)
+ } else if cq.HasParent() {
+ sum := cycleCohortsUsage.totalUsageForCommonFlavorResources(cq.Parent().Name, e.assignment.Usage)
// Check whether there was an assignment in this cycle that could render the next assignments invalid:
// - If the workload no longer fits in the cohort.
// - If there was another assignment in the cohort, then the preemption calculation is no longer valid.
- if cycleCohortsUsage.hasCommonFlavorResources(cq.Cohort.Name, e.assignment.Usage) {
+ if cycleCohortsUsage.hasCommonFlavorResources(cq.Parent().Name, e.assignment.Usage) {
if mode == flavorassigner.Fit && !cq.FitInCohort(sum) {
setSkipped(e, "Workload no longer fits after processing another workload")
continue
}
- if mode == flavorassigner.Preempt && cycleCohortsSkipPreemption.Has(cq.Cohort.Name) {
+ if mode == flavorassigner.Preempt && cycleCohortsSkipPreemption.Has(cq.Parent().Name) {
setSkipped(e, "Workload skipped because its preemption calculations were invalidated by another workload")
skippedPreemptions[cq.Name]++
continue
@@ -291,7 +291,7 @@ func (s *Scheduler) schedule(ctx context.Context) wait.SpeedSignal {
}
// Even if the workload will not be admitted after this point, due to preemption pending or other failures,
// we should still account for its usage.
- cycleCohortsUsage.add(cq.Cohort.Name, resourcesToReserve(e, cq))
+ cycleCohortsUsage.add(cq.Parent().Name, resourcesToReserve(e, cq))
}
if e.assignment.RepresentativeMode() != flavorassigner.Fit {
if len(e.preemptionTargets) != 0 {
@@ -305,8 +305,8 @@ func (s *Scheduler) schedule(ctx context.Context) wait.SpeedSignal {
e.inadmissibleMsg += fmt.Sprintf(". Pending the preemption of %d workload(s)", preempted)
e.requeueReason = queue.RequeueReasonPendingPreemption
}
- if cq.Cohort != nil {
- cycleCohortsSkipPreemption.Insert(cq.Cohort.Name)
+ if cq.HasParent() {
+ cycleCohortsSkipPreemption.Insert(cq.Parent().Name)
}
} else {
log.V(2).Info("Workload requires preemption, but there are no candidate workloads allowed for preemption", "preemption", cq.Preemption)
@@ -329,8 +329,8 @@ func (s *Scheduler) schedule(ctx context.Context) wait.SpeedSignal {
if err := s.admit(ctx, e, cq); err != nil {
e.inadmissibleMsg = fmt.Sprintf("Failed to admit workload: %v", err)
}
- if cq.Cohort != nil {
- cycleCohortsSkipPreemption.Insert(cq.Cohort.Name)
+ if cq.HasParent() {
+ cycleCohortsSkipPreemption.Insert(cq.Parent().Name)
}
}
@@ -489,9 +489,12 @@ func (s *Scheduler) getAssignments(log logr.Logger, wl *workload.Info, snap *cac
if wl.CanBePartiallyAdmitted() {
reducer := flavorassigner.NewPodSetReducer(wl.Obj.Spec.PodSets, func(nextCounts []int32) (*partialAssignment, bool) {
assignment := flvAssigner.Assign(log, nextCounts)
- if assignment.RepresentativeMode() == flavorassigner.Fit {
+ mode := assignment.RepresentativeMode()
+ if mode == flavorassigner.Fit {
return &partialAssignment{assignment: assignment}, true
- } else if assignment.RepresentativeMode() == flavorassigner.Preempt {
+ }
+
+ if mode == flavorassigner.Preempt {
preemptionTargets := s.preemptor.GetTargets(log, *wl, assignment, snap)
if len(preemptionTargets) > 0 {
return &partialAssignment{assignment: assignment, preemptionTargets: preemptionTargets}, true
diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go
index 8d5a90e4957..5ac027fbf36 100644
--- a/pkg/scheduler/scheduler_test.go
+++ b/pkg/scheduler/scheduler_test.go
@@ -67,11 +67,11 @@ type multiplePreemptionsCompatibility int
func (mode multiplePreemptionsCompatibility) runTest(baseName string, t *testing.T, f func(t *testing.T)) {
if mode == Both || mode == Legacy {
- defer features.SetFeatureGateDuringTest(t, features.MultiplePreemptions, false)()
+ features.SetFeatureGateDuringTest(t, features.MultiplePreemptions, false)
t.Run(baseName+" LegacyMode", f)
}
if mode == Both || mode == MultiplePremptions {
- defer features.SetFeatureGateDuringTest(t, features.MultiplePreemptions, true)()
+ features.SetFeatureGateDuringTest(t, features.MultiplePreemptions, true)
t.Run(baseName+" MultiplePreemptionsMode", f)
}
}
@@ -1264,6 +1264,46 @@ func TestSchedule(t *testing.T) {
"eng-beta": {"eng-beta/new"},
},
},
+ "partial admission single variable pod set, preempt with partial admission": {
+ workloads: []kueue.Workload{
+ *utiltesting.MakeWorkload("new", "eng-beta").
+ Queue("main").
+ Priority(4).
+ PodSets(*utiltesting.MakePodSet("one", 30).
+ SetMinimumCount(10).
+ Request("example.com/gpu", "1").
+ Obj()).
+ Obj(),
+ *utiltesting.MakeWorkload("old", "eng-beta").
+ Priority(-4).
+ PodSets(*utiltesting.MakePodSet("one", 10).
+ Request("example.com/gpu", "1").
+ Obj()).
+ ReserveQuota(utiltesting.MakeAdmission("eng-beta", "one").Assignment("example.com/gpu", "model-a", "10").AssignmentPodCount(10).Obj()).
+ Obj(),
+ },
+ wantAssignments: map[string]kueue.Admission{
+ "eng-beta/old": {
+ ClusterQueue: "eng-beta",
+ PodSetAssignments: []kueue.PodSetAssignment{
+ {
+ Name: "one",
+ Flavors: map[corev1.ResourceName]kueue.ResourceFlavorReference{
+ "example.com/gpu": "model-a",
+ },
+ ResourceUsage: corev1.ResourceList{
+ "example.com/gpu": resource.MustParse("10"),
+ },
+ Count: ptr.To[int32](10),
+ },
+ },
+ },
+ },
+ wantPreempted: sets.New("eng-beta/old"),
+ wantLeft: map[string][]string{
+ "eng-beta": {"eng-beta/new"},
+ },
+ },
"partial admission multiple variable pod sets": {
workloads: []kueue.Workload{
*utiltesting.MakeWorkload("new", "sales").
@@ -2563,10 +2603,10 @@ func TestSchedule(t *testing.T) {
tc.multiplePreemptions.runTest(name, t, func(t *testing.T) {
metrics.AdmissionCyclePreemptionSkips.Reset()
if tc.disableLendingLimit {
- defer features.SetFeatureGateDuringTest(t, features.LendingLimit, false)()
+ features.SetFeatureGateDuringTest(t, features.LendingLimit, false)
}
if tc.disablePartialAdmission {
- defer features.SetFeatureGateDuringTest(t, features.PartialAdmission, false)()
+ features.SetFeatureGateDuringTest(t, features.PartialAdmission, false)
}
ctx, _ := utiltesting.ContextWithLog(t)
@@ -2958,7 +2998,7 @@ func TestEntryOrdering(t *testing.T) {
},
} {
t.Run(tc.name, func(t *testing.T) {
- t.Cleanup(features.SetFeatureGateDuringTest(t, features.PrioritySortingWithinCohort, tc.prioritySorting))
+ features.SetFeatureGateDuringTest(t, features.PrioritySortingWithinCohort, tc.prioritySorting)
sort.Sort(entryOrdering{
entries: tc.input,
workloadOrdering: tc.workloadOrdering},
diff --git a/pkg/util/cert/cert.go b/pkg/util/cert/cert.go
index d63a3d65290..3c3ee16d571 100644
--- a/pkg/util/cert/cert.go
+++ b/pkg/util/cert/cert.go
@@ -38,6 +38,8 @@ const (
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;update
// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=mutatingwebhookconfigurations,verbs=get;list;watch;update
// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=validatingwebhookconfigurations,verbs=get;list;watch;update
+// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=validatingadmissionpolicies,verbs=get;list;watch
+// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=validatingadmissionpolicybindings,verbs=get;list;watch
// ManageCerts creates all certs for webhooks. This function is called from main.go.
func ManageCerts(mgr ctrl.Manager, cfg config.Configuration, setupFinished chan struct{}) error {
diff --git a/pkg/util/kubeversion/kubeversion_test.go b/pkg/util/kubeversion/kubeversion_test.go
index 8fbeca6fc17..256dd050121 100644
--- a/pkg/util/kubeversion/kubeversion_test.go
+++ b/pkg/util/kubeversion/kubeversion_test.go
@@ -25,7 +25,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
versionutil "k8s.io/apimachinery/pkg/util/version"
"k8s.io/apimachinery/pkg/version"
-
fakediscovery "k8s.io/client-go/discovery/fake"
fakeclientset "k8s.io/client-go/kubernetes/fake"
kubetesting "k8s.io/client-go/testing"
diff --git a/pkg/util/maps/maps.go b/pkg/util/maps/maps.go
index d50b3a5d164..e1dd8122ef8 100644
--- a/pkg/util/maps/maps.go
+++ b/pkg/util/maps/maps.go
@@ -17,8 +17,10 @@ limitations under the License.
package maps
import (
+ "cmp"
"fmt"
"maps"
+ "slices"
"sync"
"k8s.io/apimachinery/pkg/util/sets"
@@ -96,6 +98,13 @@ func Keys[K comparable, V any, M ~map[K]V](m M) []K {
return ret
}
+// SortedKeys returns a slice containing the sorted m keys
+func SortedKeys[K cmp.Ordered, V any, M ~map[K]V](m M) []K {
+ ret := Keys(m)
+ slices.Sort(ret)
+ return ret
+}
+
// Values returns the values of the map m.
// The values will be in an indeterminate order.
func Values[M ~map[K]V, K comparable, V any](m M) []V {
diff --git a/pkg/util/pod/pod.go b/pkg/util/pod/pod.go
new file mode 100644
index 00000000000..5a996ca45b2
--- /dev/null
+++ b/pkg/util/pod/pod.go
@@ -0,0 +1,58 @@
+/*
+CCopyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package pod
+
+import (
+ "slices"
+
+ corev1 "k8s.io/api/core/v1"
+)
+
+// HasGate checks if the pod has a scheduling gate with a specified name.
+func HasGate(pod *corev1.Pod, gateName string) bool {
+ return gateIndex(pod, gateName) >= 0
+}
+
+// Ungate removes scheduling gate from the Pod if present.
+// Returns true if the pod has been updated and false otherwise.
+func Ungate(pod *corev1.Pod, gateName string) bool {
+ if idx := gateIndex(pod, gateName); idx >= 0 {
+ pod.Spec.SchedulingGates = slices.Delete(pod.Spec.SchedulingGates, idx, idx+1)
+ return true
+ }
+ return false
+}
+
+// Gate adds scheduling gate from the Pod if present.
+// Returns true if the pod has been updated and false otherwise.
+func Gate(pod *corev1.Pod, gateName string) bool {
+ if !HasGate(pod, gateName) {
+ pod.Spec.SchedulingGates = append(pod.Spec.SchedulingGates, corev1.PodSchedulingGate{
+ Name: gateName,
+ })
+ return true
+ }
+ return false
+}
+
+// gateIndex returns the index of the Kueue scheduling gate for corev1.Pod.
+// If the scheduling gate is not found, returns -1.
+func gateIndex(p *corev1.Pod, gateName string) int {
+ return slices.IndexFunc(p.Spec.SchedulingGates, func(g corev1.PodSchedulingGate) bool {
+ return g.Name == gateName
+ })
+}
diff --git a/pkg/util/pod/pod_test.go b/pkg/util/pod/pod_test.go
new file mode 100644
index 00000000000..41126ba13f4
--- /dev/null
+++ b/pkg/util/pod/pod_test.go
@@ -0,0 +1,199 @@
+/*
+CCopyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package pod
+
+import (
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ corev1 "k8s.io/api/core/v1"
+)
+
+func TestHasGate(t *testing.T) {
+ testCases := map[string]struct {
+ gateName string
+ pod corev1.Pod
+ want bool
+ }{
+ "scheduling gate present": {
+ gateName: "example.com/gate",
+ pod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate",
+ },
+ },
+ },
+ },
+ want: true,
+ },
+ "another gate present": {
+ gateName: "example.com/gate",
+ pod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate2",
+ },
+ },
+ },
+ },
+ want: false,
+ },
+ "no scheduling gates": {
+ pod: corev1.Pod{},
+ want: false,
+ },
+ }
+
+ for desc, tc := range testCases {
+ t.Run(desc, func(t *testing.T) {
+ got := HasGate(&tc.pod, tc.gateName)
+ if got != tc.want {
+ t.Errorf("Unexpected result: want=%v, got=%v", tc.want, got)
+ }
+ })
+ }
+}
+
+func TestUngate(t *testing.T) {
+ testCases := map[string]struct {
+ gateName string
+ pod corev1.Pod
+ wantPod corev1.Pod
+ want bool
+ }{
+ "ungate when scheduling gate present": {
+ gateName: "example.com/gate",
+ pod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate",
+ },
+ },
+ },
+ },
+ wantPod: corev1.Pod{},
+ want: true,
+ },
+ "ungate when scheduling gate missing": {
+ gateName: "example.com/gate",
+ pod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate2",
+ },
+ },
+ },
+ },
+ wantPod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate2",
+ },
+ },
+ },
+ },
+ want: false,
+ },
+ }
+ for desc, tc := range testCases {
+ t.Run(desc, func(t *testing.T) {
+ got := Ungate(&tc.pod, tc.gateName)
+ if got != tc.want {
+ t.Errorf("Unexpected result: want=%v, got=%v", tc.want, got)
+ }
+ if diff := cmp.Diff(tc.wantPod.Spec.SchedulingGates, tc.pod.Spec.SchedulingGates, cmpopts.EquateEmpty()); diff != "" {
+ t.Errorf("Unexpected scheduling gates\ndiff=%s", diff)
+ }
+ })
+ }
+}
+
+func TestGate(t *testing.T) {
+ testCases := map[string]struct {
+ gateName string
+ pod corev1.Pod
+ wantPod corev1.Pod
+ want bool
+ }{
+ "gate when scheduling gate present": {
+ gateName: "example.com/gate",
+ pod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate",
+ },
+ },
+ },
+ },
+ wantPod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate",
+ },
+ },
+ },
+ },
+ want: false,
+ },
+ "gate when scheduling gate missing": {
+ gateName: "example.com/gate",
+ pod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate2",
+ },
+ },
+ },
+ },
+ wantPod: corev1.Pod{
+ Spec: corev1.PodSpec{
+ SchedulingGates: []corev1.PodSchedulingGate{
+ {
+ Name: "example.com/gate2",
+ },
+ {
+ Name: "example.com/gate",
+ },
+ },
+ },
+ },
+ want: true,
+ },
+ }
+
+ for desc, tc := range testCases {
+ t.Run(desc, func(t *testing.T) {
+ got := Gate(&tc.pod, tc.gateName)
+ if got != tc.want {
+ t.Errorf("Unexpected result: want=%v, got=%v", tc.want, got)
+ }
+ if diff := cmp.Diff(tc.wantPod.Spec.SchedulingGates, tc.pod.Spec.SchedulingGates); diff != "" {
+ t.Errorf("Unexpected scheduling gates\ndiff=%s", diff)
+ }
+ })
+ }
+}
diff --git a/pkg/util/testing/client.go b/pkg/util/testing/client.go
index 1f30355b746..df84cd1d146 100644
--- a/pkg/util/testing/client.go
+++ b/pkg/util/testing/client.go
@@ -31,6 +31,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/core/indexer"
)
@@ -47,6 +48,7 @@ func NewClientBuilder(addToSchemes ...func(s *runtime.Scheme) error) *fake.Clien
scheme := runtime.NewScheme()
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(kueue.AddToScheme(scheme))
+ utilruntime.Must(kueuealpha.AddToScheme(scheme))
for i := range addToSchemes {
utilruntime.Must(addToSchemes[i](scheme))
}
diff --git a/pkg/util/testing/core.go b/pkg/util/testing/core.go
index e33b5e1d728..e22ddd87bd1 100644
--- a/pkg/util/testing/core.go
+++ b/pkg/util/testing/core.go
@@ -18,12 +18,11 @@ package testing
import (
"context"
- "errors"
"fmt"
corev1 "k8s.io/api/core/v1"
- eventsv1 "k8s.io/api/events/v1"
"k8s.io/apimachinery/pkg/api/resource"
+ "k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
)
@@ -47,26 +46,24 @@ func SingleContainerForRequest(request map[corev1.ResourceName]string) []corev1.
}
}
-// CheckLatestEvent will return true if the latest event is as you want.
-func CheckLatestEvent(ctx context.Context, k8sClient client.Client,
- eventReason string,
- eventType string, eventNote string) (bool, error) {
- events := &eventsv1.EventList{}
- if err := k8sClient.List(ctx, events, &client.ListOptions{}); err != nil {
+// CheckEventRecordedFor checks if an event identified by eventReason, eventType, eventNote
+// was recorded for the object indentified by ref.
+func CheckEventRecordedFor(ctx context.Context, k8sClient client.Client,
+ eventReason string, eventType string, eventMessage string,
+ ref types.NamespacedName) (bool, error) {
+ events := &corev1.EventList{}
+ if err := k8sClient.List(ctx, events, client.InNamespace(ref.Namespace)); err != nil {
return false, err
}
- length := len(events.Items)
- if length == 0 {
- return false, errors.New("no events currently exist")
- }
-
- item := events.Items[length-1]
- if item.Reason == eventReason && item.Type == eventType && item.Note == eventNote {
- return true, nil
+ for i := range events.Items {
+ item := &events.Items[i]
+ if item.InvolvedObject.Name == ref.Name && item.Reason == eventReason && item.Type == eventType && item.Message == eventMessage {
+ return true, nil
+ }
}
-
- return false, fmt.Errorf("mismatch with the latest event: got r:%v t:%v n:%v, reg %v", item.Reason, item.Type, item.Note, item.Regarding)
+ return false, fmt.Errorf("event not found after checking %d events, eventReason: %s , eventType: %s, eventMessage: %s, namespace: %s ",
+ len(events.Items), eventReason, eventType, eventMessage, ref.Namespace)
}
// HasEventAppeared returns if an event has been emitted
diff --git a/pkg/util/testing/wrappers.go b/pkg/util/testing/wrappers.go
index 74c7eb0e67a..7d8cdc288fb 100644
--- a/pkg/util/testing/wrappers.go
+++ b/pkg/util/testing/wrappers.go
@@ -600,9 +600,14 @@ func (c *CohortWrapper) Obj() *kueuealpha.Cohort {
return &c.Cohort
}
+func (c *CohortWrapper) Parent(parentName string) *CohortWrapper {
+ c.Cohort.Spec.Parent = parentName
+ return c
+}
+
// ResourceGroup adds a ResourceGroup with flavors.
func (c *CohortWrapper) ResourceGroup(flavors ...kueue.FlavorQuotas) *CohortWrapper {
- c.Spec.ResourceGroups = append(c.Spec.ResourceGroups, createResourceGroup(flavors...))
+ c.Spec.ResourceGroups = append(c.Spec.ResourceGroups, ResourceGroup(flavors...))
return c
}
@@ -646,7 +651,8 @@ func (c *ClusterQueueWrapper) AdmissionCheckStrategy(acs ...kueue.AdmissionCheck
return c
}
-func createResourceGroup(flavors ...kueue.FlavorQuotas) kueue.ResourceGroup {
+// ResourceGroup creates a ResourceGroup with the given FlavorQuotas.
+func ResourceGroup(flavors ...kueue.FlavorQuotas) kueue.ResourceGroup {
rg := kueue.ResourceGroup{
Flavors: flavors,
}
@@ -672,7 +678,7 @@ func createResourceGroup(flavors ...kueue.FlavorQuotas) kueue.ResourceGroup {
// ResourceGroup adds a ResourceGroup with flavors.
func (c *ClusterQueueWrapper) ResourceGroup(flavors ...kueue.FlavorQuotas) *ClusterQueueWrapper {
- c.Spec.ResourceGroups = append(c.Spec.ResourceGroups, createResourceGroup(flavors...))
+ c.Spec.ResourceGroups = append(c.Spec.ResourceGroups, ResourceGroup(flavors...))
return c
}
@@ -1102,12 +1108,12 @@ func (p *WorkloadPriorityClassWrapper) Obj() *kueue.WorkloadPriorityClass {
}
type MultiKueueConfigWrapper struct {
- kueuealpha.MultiKueueConfig
+ kueue.MultiKueueConfig
}
func MakeMultiKueueConfig(name string) *MultiKueueConfigWrapper {
return &MultiKueueConfigWrapper{
- MultiKueueConfig: kueuealpha.MultiKueueConfig{
+ MultiKueueConfig: kueue.MultiKueueConfig{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
@@ -1115,7 +1121,7 @@ func MakeMultiKueueConfig(name string) *MultiKueueConfigWrapper {
}
}
-func (mkc *MultiKueueConfigWrapper) Obj() *kueuealpha.MultiKueueConfig {
+func (mkc *MultiKueueConfigWrapper) Obj() *kueue.MultiKueueConfig {
return &mkc.MultiKueueConfig
}
@@ -1125,12 +1131,12 @@ func (mkc *MultiKueueConfigWrapper) Clusters(clusters ...string) *MultiKueueConf
}
type MultiKueueClusterWrapper struct {
- kueuealpha.MultiKueueCluster
+ kueue.MultiKueueCluster
}
func MakeMultiKueueCluster(name string) *MultiKueueClusterWrapper {
return &MultiKueueClusterWrapper{
- MultiKueueCluster: kueuealpha.MultiKueueCluster{
+ MultiKueueCluster: kueue.MultiKueueCluster{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
@@ -1138,12 +1144,12 @@ func MakeMultiKueueCluster(name string) *MultiKueueClusterWrapper {
}
}
-func (mkc *MultiKueueClusterWrapper) Obj() *kueuealpha.MultiKueueCluster {
+func (mkc *MultiKueueClusterWrapper) Obj() *kueue.MultiKueueCluster {
return &mkc.MultiKueueCluster
}
-func (mkc *MultiKueueClusterWrapper) KubeConfig(locationType kueuealpha.LocationType, location string) *MultiKueueClusterWrapper {
- mkc.Spec.KubeConfig = kueuealpha.KubeConfig{
+func (mkc *MultiKueueClusterWrapper) KubeConfig(locationType kueue.LocationType, location string) *MultiKueueClusterWrapper {
+ mkc.Spec.KubeConfig = kueue.KubeConfig{
Location: location,
LocationType: locationType,
}
@@ -1152,7 +1158,7 @@ func (mkc *MultiKueueClusterWrapper) KubeConfig(locationType kueuealpha.Location
func (mkc *MultiKueueClusterWrapper) Active(state metav1.ConditionStatus, reason, message string, generation int64) *MultiKueueClusterWrapper {
cond := metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: state,
Reason: reason,
Message: message,
diff --git a/pkg/util/testingjobs/mpijob/wrappers_mpijob.go b/pkg/util/testingjobs/mpijob/wrappers_mpijob.go
index 42be69ce492..22939f1761c 100644
--- a/pkg/util/testingjobs/mpijob/wrappers_mpijob.go
+++ b/pkg/util/testingjobs/mpijob/wrappers_mpijob.go
@@ -17,7 +17,7 @@ limitations under the License.
package testing
import (
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -28,64 +28,105 @@ import (
)
// MPIJobWrapper wraps a Job.
-type MPIJobWrapper struct{ kubeflow.MPIJob }
+type MPIJobWrapper struct{ kfmpi.MPIJob }
// MakeMPIJob creates a wrapper for a suspended job with a single container and parallelism=1.
func MakeMPIJob(name, ns string) *MPIJobWrapper {
- return &MPIJobWrapper{kubeflow.MPIJob{
+ return &MPIJobWrapper{kfmpi.MPIJob{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: ns,
Annotations: make(map[string]string, 1),
},
- Spec: kubeflow.MPIJobSpec{
- RunPolicy: kubeflow.RunPolicy{
+ Spec: kfmpi.MPIJobSpec{
+ RunPolicy: kfmpi.RunPolicy{
Suspend: ptr.To(true),
},
- MPIReplicaSpecs: map[kubeflow.MPIReplicaType]*kubeflow.ReplicaSpec{
- kubeflow.MPIReplicaTypeLauncher: {
- Replicas: ptr.To[int32](1),
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- RestartPolicy: corev1.RestartPolicyNever,
- Containers: []corev1.Container{
- {
- Name: "c",
- Image: "pause",
- Command: []string{},
- Resources: corev1.ResourceRequirements{Requests: corev1.ResourceList{}},
- },
- },
- NodeSelector: map[string]string{},
- },
+ MPIReplicaSpecs: make(map[kfmpi.MPIReplicaType]*kfmpi.ReplicaSpec),
+ },
+ },
+ }
+}
+
+type MPIJobReplicaSpecRequirement struct {
+ ReplicaType kfmpi.MPIReplicaType
+ ReplicaCount int32
+ Annotations map[string]string
+ RestartPolicy corev1.RestartPolicy
+}
+
+func (j *MPIJobWrapper) MPIJobReplicaSpecs(replicaSpecs ...MPIJobReplicaSpecRequirement) *MPIJobWrapper {
+ j = j.GenericLauncherAndWorker()
+ for _, rs := range replicaSpecs {
+ j.Spec.MPIReplicaSpecs[rs.ReplicaType].Replicas = ptr.To[int32](rs.ReplicaCount)
+ j.Spec.MPIReplicaSpecs[rs.ReplicaType].Template.Spec.RestartPolicy = rs.RestartPolicy
+
+ if rs.Annotations != nil {
+ j.Spec.MPIReplicaSpecs[rs.ReplicaType].Template.ObjectMeta.Annotations = rs.Annotations
+ }
+ }
+
+ return j
+}
+
+func (j *MPIJobWrapper) GenericLauncherAndWorker() *MPIJobWrapper {
+ j.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher] = &kfmpi.ReplicaSpec{
+ Replicas: ptr.To[int32](1),
+ Template: corev1.PodTemplateSpec{
+ Spec: corev1.PodSpec{
+ RestartPolicy: corev1.RestartPolicyNever,
+ Containers: []corev1.Container{
+ {
+ Name: "mpijob",
+ Image: "pause",
+ Command: []string{},
+ Resources: corev1.ResourceRequirements{Requests: corev1.ResourceList{}},
},
},
- kubeflow.MPIReplicaTypeWorker: {
- Replicas: ptr.To[int32](1),
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- RestartPolicy: corev1.RestartPolicyNever,
- Containers: []corev1.Container{
- {
- Name: "c",
- Image: "pause",
- Command: []string{},
- Resources: corev1.ResourceRequirements{Requests: corev1.ResourceList{}},
- },
- },
- NodeSelector: map[string]string{},
- },
+ NodeSelector: map[string]string{},
+ },
+ },
+ }
+
+ j.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker] = &kfmpi.ReplicaSpec{
+ Replicas: ptr.To[int32](1),
+ Template: corev1.PodTemplateSpec{
+ Spec: corev1.PodSpec{
+ RestartPolicy: corev1.RestartPolicyNever,
+ Containers: []corev1.Container{
+ {
+ Name: "mpijob",
+ Image: "pause",
+ Command: []string{},
+ Resources: corev1.ResourceRequirements{Requests: corev1.ResourceList{}},
},
},
+ NodeSelector: map[string]string{},
},
},
- }}
+ }
+
+ return j
+}
+
+// Clone returns deep copy of the MPIJobWrapper.
+func (j *MPIJobWrapper) Clone() *MPIJobWrapper {
+ return &MPIJobWrapper{MPIJob: *j.DeepCopy()}
+}
+
+// Label sets the label key and value
+func (j *MPIJobWrapper) Label(key, value string) *MPIJobWrapper {
+ if j.Labels == nil {
+ j.Labels = make(map[string]string, 1)
+ }
+ j.Labels[key] = value
+ return j
}
// PriorityClass updates job priorityclass.
func (j *MPIJobWrapper) PriorityClass(pc string) *MPIJobWrapper {
if j.Spec.RunPolicy.SchedulingPolicy == nil {
- j.Spec.RunPolicy.SchedulingPolicy = &kubeflow.SchedulingPolicy{}
+ j.Spec.RunPolicy.SchedulingPolicy = &kfmpi.SchedulingPolicy{}
}
j.Spec.RunPolicy.SchedulingPolicy.PriorityClass = pc
return j
@@ -101,7 +142,7 @@ func (j *MPIJobWrapper) WorkloadPriorityClass(wpc string) *MPIJobWrapper {
}
// Obj returns the inner Job.
-func (j *MPIJobWrapper) Obj() *kubeflow.MPIJob {
+func (j *MPIJobWrapper) Obj() *kfmpi.MPIJob {
return &j.MPIJob
}
@@ -115,14 +156,14 @@ func (j *MPIJobWrapper) Queue(queue string) *MPIJobWrapper {
}
// Request adds a resource request to the default container.
-func (j *MPIJobWrapper) Request(replicaType kubeflow.MPIReplicaType, r corev1.ResourceName, v string) *MPIJobWrapper {
+func (j *MPIJobWrapper) Request(replicaType kfmpi.MPIReplicaType, r corev1.ResourceName, v string) *MPIJobWrapper {
j.Spec.MPIReplicaSpecs[replicaType].Template.Spec.Containers[0].Resources.Requests[r] = resource.MustParse(v)
return j
}
// Parallelism updates job parallelism.
func (j *MPIJobWrapper) Parallelism(p int32) *MPIJobWrapper {
- j.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Replicas = ptr.To(p)
+ j.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Replicas = ptr.To(p)
return j
}
@@ -139,7 +180,7 @@ func (j *MPIJobWrapper) UID(uid string) *MPIJobWrapper {
}
// PodAnnotation sets annotation at the pod template level
-func (j *MPIJobWrapper) PodAnnotation(replicaType kubeflow.MPIReplicaType, k, v string) *MPIJobWrapper {
+func (j *MPIJobWrapper) PodAnnotation(replicaType kfmpi.MPIReplicaType, k, v string) *MPIJobWrapper {
if j.Spec.MPIReplicaSpecs[replicaType].Template.Annotations == nil {
j.Spec.MPIReplicaSpecs[replicaType].Template.Annotations = make(map[string]string)
}
@@ -148,7 +189,7 @@ func (j *MPIJobWrapper) PodAnnotation(replicaType kubeflow.MPIReplicaType, k, v
}
// PodLabel sets label at the pod template level
-func (j *MPIJobWrapper) PodLabel(replicaType kubeflow.MPIReplicaType, k, v string) *MPIJobWrapper {
+func (j *MPIJobWrapper) PodLabel(replicaType kfmpi.MPIReplicaType, k, v string) *MPIJobWrapper {
if j.Spec.MPIReplicaSpecs[replicaType].Template.Labels == nil {
j.Spec.MPIReplicaSpecs[replicaType].Template.Labels = make(map[string]string)
}
@@ -161,3 +202,15 @@ func (j *MPIJobWrapper) Generation(num int64) *MPIJobWrapper {
j.ObjectMeta.Generation = num
return j
}
+
+// StatusConditions adds a condition
+func (j *MPIJobWrapper) StatusConditions(c kfmpi.JobCondition) *MPIJobWrapper {
+ j.Status.Conditions = append(j.Status.Conditions, c)
+ return j
+}
+
+func (j *MPIJobWrapper) Image(replicaType kfmpi.MPIReplicaType, image string, args []string) *MPIJobWrapper {
+ j.Spec.MPIReplicaSpecs[replicaType].Template.Spec.Containers[0].Image = image
+ j.Spec.MPIReplicaSpecs[replicaType].Template.Spec.Containers[0].Args = args
+ return j
+}
diff --git a/pkg/visibility/api/install.go b/pkg/visibility/api/install.go
index ffb6527e2cd..134ad6a7fd6 100644
--- a/pkg/visibility/api/install.go
+++ b/pkg/visibility/api/install.go
@@ -1,16 +1,18 @@
-// Copyright 2023 The Kubernetes Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
package api
@@ -20,42 +22,32 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
- "k8s.io/apiserver/pkg/registry/rest"
genericapiserver "k8s.io/apiserver/pkg/server"
- "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
"sigs.k8s.io/kueue/pkg/queue"
- apirest "sigs.k8s.io/kueue/pkg/visibility/api/rest"
+ apiv1alpha1 "sigs.k8s.io/kueue/pkg/visibility/api/v1alpha1"
+ apiv1beta1 "sigs.k8s.io/kueue/pkg/visibility/api/v1beta1"
)
var (
- Scheme = runtime.NewScheme()
-
- Codecs = serializer.NewCodecFactory(Scheme)
-
+ Scheme = runtime.NewScheme()
+ Codecs = serializer.NewCodecFactory(Scheme)
ParameterCodec = runtime.NewParameterCodec(Scheme)
)
func init() {
- utilruntime.Must(v1alpha1.AddToScheme(Scheme))
- utilruntime.Must(Scheme.SetVersionPriority(v1alpha1.GroupVersion))
+ utilruntime.Must(visibilityv1alpha1.AddToScheme(Scheme))
+ utilruntime.Must(visibilityv1beta1.AddToScheme(Scheme))
+ utilruntime.Must(Scheme.SetVersionPriority(visibilityv1alpha1.GroupVersion, visibilityv1beta1.GroupVersion))
metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
}
-// Install installs API scheme defined in apis/v1alpha1 and registers storage
+// Install installs API scheme and registers storages
func Install(server *genericapiserver.GenericAPIServer, kueueMgr *queue.Manager) error {
- apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(v1alpha1.GroupVersion.Group, Scheme, ParameterCodec, Codecs)
- pendingWorkloadsInCqREST := apirest.NewPendingWorkloadsInCqREST(kueueMgr)
- cqREST := apirest.NewCqREST()
- pendingWorkloadsInLqREST := apirest.NewPendingWorkloadsInLqREST(kueueMgr)
- lqREST := apirest.NewLqREST()
-
- visibilityServerResources := map[string]rest.Storage{
- "clusterqueues": cqREST,
- "clusterqueues/pendingworkloads": pendingWorkloadsInCqREST,
- "localqueues": lqREST,
- "localqueues/pendingworkloads": pendingWorkloadsInLqREST,
- }
- apiGroupInfo.VersionedResourcesStorageMap[v1alpha1.GroupVersion.Version] = visibilityServerResources
+ apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(visibilityv1beta1.GroupVersion.Group, Scheme, ParameterCodec, Codecs)
+ apiGroupInfo.VersionedResourcesStorageMap[visibilityv1alpha1.GroupVersion.Version] = apiv1alpha1.NewStorage(kueueMgr)
+ apiGroupInfo.VersionedResourcesStorageMap[visibilityv1beta1.GroupVersion.Version] = apiv1beta1.NewStorage(kueueMgr)
return server.InstallAPIGroups(&apiGroupInfo)
}
diff --git a/pkg/visibility/api/rest/cluster_queue.go b/pkg/visibility/api/v1alpha1/cluster_queue.go
similarity index 98%
rename from pkg/visibility/api/rest/cluster_queue.go
rename to pkg/visibility/api/v1alpha1/cluster_queue.go
index c32e759d138..e497f10d488 100644
--- a/pkg/visibility/api/rest/cluster_queue.go
+++ b/pkg/visibility/api/v1alpha1/cluster_queue.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime"
diff --git a/pkg/visibility/api/rest/local_queue.go b/pkg/visibility/api/v1alpha1/local_queue.go
similarity index 98%
rename from pkg/visibility/api/rest/local_queue.go
rename to pkg/visibility/api/v1alpha1/local_queue.go
index 1b024611e21..0da686bb6ac 100644
--- a/pkg/visibility/api/rest/local_queue.go
+++ b/pkg/visibility/api/v1alpha1/local_queue.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime"
diff --git a/pkg/visibility/api/rest/pending_workloads_cq.go b/pkg/visibility/api/v1alpha1/pending_workloads_cq.go
similarity index 99%
rename from pkg/visibility/api/rest/pending_workloads_cq.go
rename to pkg/visibility/api/v1alpha1/pending_workloads_cq.go
index 8c803210914..f73bad4c0ee 100644
--- a/pkg/visibility/api/rest/pending_workloads_cq.go
+++ b/pkg/visibility/api/v1alpha1/pending_workloads_cq.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
"context"
diff --git a/pkg/visibility/api/rest/pending_workloads_cq_test.go b/pkg/visibility/api/v1alpha1/pending_workloads_cq_test.go
similarity index 99%
rename from pkg/visibility/api/rest/pending_workloads_cq_test.go
rename to pkg/visibility/api/v1alpha1/pending_workloads_cq_test.go
index 8b970501cef..e464b597c79 100644
--- a/pkg/visibility/api/rest/pending_workloads_cq_test.go
+++ b/pkg/visibility/api/v1alpha1/pending_workloads_cq_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
"context"
diff --git a/pkg/visibility/api/rest/pending_workloads_lq.go b/pkg/visibility/api/v1alpha1/pending_workloads_lq.go
similarity index 99%
rename from pkg/visibility/api/rest/pending_workloads_lq.go
rename to pkg/visibility/api/v1alpha1/pending_workloads_lq.go
index 9be4e747794..16c7f79dd42 100644
--- a/pkg/visibility/api/rest/pending_workloads_lq.go
+++ b/pkg/visibility/api/v1alpha1/pending_workloads_lq.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
"context"
diff --git a/pkg/visibility/api/rest/pending_workloads_lq_test.go b/pkg/visibility/api/v1alpha1/pending_workloads_lq_test.go
similarity index 99%
rename from pkg/visibility/api/rest/pending_workloads_lq_test.go
rename to pkg/visibility/api/v1alpha1/pending_workloads_lq_test.go
index fa453cdee47..056b6cc48db 100644
--- a/pkg/visibility/api/rest/pending_workloads_lq_test.go
+++ b/pkg/visibility/api/v1alpha1/pending_workloads_lq_test.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
"context"
diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/doc.go b/pkg/visibility/api/v1alpha1/storage.go
similarity index 54%
rename from vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/doc.go
rename to pkg/visibility/api/v1alpha1/storage.go
index 8fdf14d39ad..a509125e941 100644
--- a/vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/doc.go
+++ b/pkg/visibility/api/v1alpha1/storage.go
@@ -1,5 +1,5 @@
/*
-Copyright 2020 The Kubernetes Authors.
+Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,9 +14,19 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// Package v1alpha1 provides the ControllerManagerConfiguration used for
-// configuring ctrl.Manager
-// +kubebuilder:object:generate=true
-//
-// Deprecated: The component config package has been deprecated and will be removed in a future release. Users should migrate to their own config implementation, please share feedback in https://github.com/kubernetes-sigs/controller-runtime/issues/895.
package v1alpha1
+
+import (
+ "k8s.io/apiserver/pkg/registry/rest"
+
+ "sigs.k8s.io/kueue/pkg/queue"
+)
+
+func NewStorage(mgr *queue.Manager) map[string]rest.Storage {
+ return map[string]rest.Storage{
+ "clusterqueues": NewCqREST(),
+ "clusterqueues/pendingworkloads": NewPendingWorkloadsInCqREST(mgr),
+ "localqueues": NewLqREST(),
+ "localqueues/pendingworkloads": NewPendingWorkloadsInLqREST(mgr),
+ }
+}
diff --git a/pkg/visibility/api/rest/test_utils.go b/pkg/visibility/api/v1alpha1/test_utils.go
similarity index 98%
rename from pkg/visibility/api/rest/test_utils.go
rename to pkg/visibility/api/v1alpha1/test_utils.go
index 4a69b1fe937..d752d379074 100644
--- a/pkg/visibility/api/rest/test_utils.go
+++ b/pkg/visibility/api/v1alpha1/test_utils.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
visibility "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
diff --git a/pkg/visibility/api/rest/utils.go b/pkg/visibility/api/v1alpha1/utils.go
similarity index 98%
rename from pkg/visibility/api/rest/utils.go
rename to pkg/visibility/api/v1alpha1/utils.go
index 81b73a7c100..1c98372460d 100644
--- a/pkg/visibility/api/rest/utils.go
+++ b/pkg/visibility/api/v1alpha1/utils.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package rest
+package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/visibility/api/v1beta1/cluster_queue.go b/pkg/visibility/api/v1beta1/cluster_queue.go
new file mode 100644
index 00000000000..e269da377c3
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/cluster_queue.go
@@ -0,0 +1,55 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apiserver/pkg/registry/rest"
+
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+)
+
+// CqREST type is used only to install clusterqueues/ resource, so we can install clusterqueues/pending_workloads subresource.
+// It implements the necessary interfaces for genericapiserver but does not provide any actual functionalities.
+type CqREST struct{}
+
+// Those interfaces are necessary for genericapiserver to work properly
+var _ rest.Storage = &CqREST{}
+var _ rest.Scoper = &CqREST{}
+var _ rest.SingularNameProvider = &CqREST{}
+
+func NewCqREST() *CqREST {
+ return &CqREST{}
+}
+
+// New implements rest.Storage interface
+func (m *CqREST) New() runtime.Object {
+ return &visibility.PendingWorkloadsSummary{}
+}
+
+// Destroy implements rest.Storage interface
+func (m *CqREST) Destroy() {}
+
+// NamespaceScoped implements rest.Scoper interface
+func (m *CqREST) NamespaceScoped() bool {
+ return false
+}
+
+// GetSingularName implements rest.SingularNameProvider interface
+func (m *CqREST) GetSingularName() string {
+ return "clusterqueue"
+}
diff --git a/pkg/visibility/api/v1beta1/local_queue.go b/pkg/visibility/api/v1beta1/local_queue.go
new file mode 100644
index 00000000000..4437278ea88
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/local_queue.go
@@ -0,0 +1,55 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apiserver/pkg/registry/rest"
+
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+)
+
+// LqREST type is used only to install localqueues/ resource, so we can install localqueues/pending_workloads subresource.
+// It implements the necessary interfaces for genericapiserver but does not provide any actual functionalities.
+type LqREST struct{}
+
+// Those interfaces are necessary for genericapiserver to work properly
+var _ rest.Storage = &LqREST{}
+var _ rest.Scoper = &LqREST{}
+var _ rest.SingularNameProvider = &LqREST{}
+
+func NewLqREST() *LqREST {
+ return &LqREST{}
+}
+
+// New implements rest.Storage interface
+func (m *LqREST) New() runtime.Object {
+ return &visibility.PendingWorkloadsSummary{}
+}
+
+// Destroy implements rest.Storage interface
+func (m *LqREST) Destroy() {}
+
+// NamespaceScoped implements rest.Scoper interface
+func (m *LqREST) NamespaceScoped() bool {
+ return true
+}
+
+// GetSingularName implements rest.SingularNameProvider interface
+func (m *LqREST) GetSingularName() string {
+ return "localqueue"
+}
diff --git a/pkg/visibility/api/v1beta1/pending_workloads_cq.go b/pkg/visibility/api/v1beta1/pending_workloads_cq.go
new file mode 100644
index 00000000000..7672819e953
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/pending_workloads_cq.go
@@ -0,0 +1,104 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/go-logr/logr"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apiserver/pkg/registry/rest"
+ ctrl "sigs.k8s.io/controller-runtime"
+
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ "sigs.k8s.io/kueue/pkg/constants"
+ "sigs.k8s.io/kueue/pkg/queue"
+
+ _ "k8s.io/metrics/pkg/apis/metrics/install"
+)
+
+type pendingWorkloadsInCqREST struct {
+ queueMgr *queue.Manager
+ log logr.Logger
+}
+
+var _ rest.Storage = &pendingWorkloadsInCqREST{}
+var _ rest.GetterWithOptions = &pendingWorkloadsInCqREST{}
+var _ rest.Scoper = &pendingWorkloadsInCqREST{}
+
+func NewPendingWorkloadsInCqREST(kueueMgr *queue.Manager) *pendingWorkloadsInCqREST {
+ return &pendingWorkloadsInCqREST{
+ queueMgr: kueueMgr,
+ log: ctrl.Log.WithName("pending-workload-in-cq"),
+ }
+}
+
+// New implements rest.Storage interface
+func (m *pendingWorkloadsInCqREST) New() runtime.Object {
+ return &visibility.PendingWorkloadsSummary{}
+}
+
+// Destroy implements rest.Storage interface
+func (m *pendingWorkloadsInCqREST) Destroy() {}
+
+// Get implements rest.GetterWithOptions interface
+// It fetches information about pending workloads and returns according to query params
+func (m *pendingWorkloadsInCqREST) Get(_ context.Context, name string, opts runtime.Object) (runtime.Object, error) {
+ pendingWorkloadOpts, ok := opts.(*visibility.PendingWorkloadOptions)
+ if !ok {
+ return nil, fmt.Errorf("invalid options object: %#v", opts)
+ }
+ limit := pendingWorkloadOpts.Limit
+ offset := pendingWorkloadOpts.Offset
+
+ wls := make([]visibility.PendingWorkload, 0, limit)
+ pendingWorkloadsInfo := m.queueMgr.PendingWorkloadsInfo(name)
+ if pendingWorkloadsInfo == nil {
+ return nil, errors.NewNotFound(visibility.Resource("clusterqueue"), name)
+ }
+
+ localQueuePositions := make(map[string]int32, 0)
+
+ for index := 0; index < int(offset+limit) && index < len(pendingWorkloadsInfo); index++ {
+ // Update positions in LocalQueue
+ wlInfo := pendingWorkloadsInfo[index]
+ queueName := wlInfo.Obj.Spec.QueueName
+ positionInLocalQueue := localQueuePositions[queueName]
+ localQueuePositions[queueName]++
+
+ if index >= int(offset) {
+ // Add a workload to results
+ wls = append(wls, *newPendingWorkload(wlInfo, positionInLocalQueue, index))
+ }
+ }
+ return &visibility.PendingWorkloadsSummary{Items: wls}, nil
+}
+
+// NewGetOptions creates a new options object
+func (m *pendingWorkloadsInCqREST) NewGetOptions() (runtime.Object, bool, string) {
+ // If no query parameters were passed the generated defaults function are not executed so it's necessary to set default values here as well
+ return &visibility.PendingWorkloadOptions{
+ Limit: constants.DefaultPendingWorkloadsLimit,
+ }, false, ""
+}
+
+// NamespaceScoped implements rest.Scoper interface
+func (m *pendingWorkloadsInCqREST) NamespaceScoped() bool {
+ return false
+}
diff --git a/pkg/visibility/api/v1beta1/pending_workloads_cq_test.go b/pkg/visibility/api/v1beta1/pending_workloads_cq_test.go
new file mode 100644
index 00000000000..6128f65fc56
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/pending_workloads_cq_test.go
@@ -0,0 +1,360 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ "sigs.k8s.io/kueue/pkg/constants"
+ "sigs.k8s.io/kueue/pkg/queue"
+ utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
+)
+
+func TestPendingWorkloadsInCQ(t *testing.T) {
+ const (
+ nsName = "foo"
+ cqNameA = "cqA"
+ cqNameB = "cqB"
+ lqNameA = "lqA"
+ lqNameB = "lqB"
+ lowPrio = 50
+ highPrio = 100
+ )
+
+ var (
+ defaultQueryParams = &visibility.PendingWorkloadOptions{
+ Offset: 0,
+ Limit: constants.DefaultPendingWorkloadsLimit,
+ }
+ )
+
+ scheme := runtime.NewScheme()
+ if err := kueue.AddToScheme(scheme); err != nil {
+ t.Fatalf("Failed adding kueue scheme: %s", err)
+ }
+ if err := visibility.AddToScheme(scheme); err != nil {
+ t.Fatalf("Failed adding kueue scheme: %s", err)
+ }
+
+ now := time.Now()
+ cases := map[string]struct {
+ clusterQueues []*kueue.ClusterQueue
+ queues []*kueue.LocalQueue
+ workloads []*kueue.Workload
+ req *req
+ wantResp *resp
+ wantErrMatch func(error) bool
+ }{
+ "single ClusterQueue and single LocalQueue setup with two workloads and default query parameters": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsName).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsName).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsName).Queue(lqNameA).Priority(lowPrio).Creation(now).Obj(),
+ },
+ req: &req{
+ queueName: cqNameA,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "a",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: lowPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ }},
+ },
+ },
+ "single ClusterQueue and two LocalQueue setup with four workloads and default query parameters": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsName).ClusterQueue(cqNameA).Obj(),
+ utiltesting.MakeLocalQueue(lqNameB, nsName).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("lqA-high-prio", nsName).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqA-low-prio", nsName).Queue(lqNameA).Priority(lowPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqB-high-prio", nsName).Queue(lqNameB).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("lqB-low-prio", nsName).Queue(lqNameB).Priority(lowPrio).Creation(now.Add(time.Second)).Obj(),
+ },
+ req: &req{
+ queueName: cqNameA,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqA-high-prio",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqB-high-prio",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameB,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqA-low-prio",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: lowPrio,
+ PositionInClusterQueue: 2,
+ PositionInLocalQueue: 1,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqB-low-prio",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameB,
+ Priority: lowPrio,
+ PositionInClusterQueue: 3,
+ PositionInLocalQueue: 1,
+ }},
+ },
+ },
+ "limit query parameter set": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsName).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsName).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsName).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("c", nsName).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second * 2)).Obj(),
+ },
+ req: &req{
+ queueName: cqNameA,
+ queryParams: &visibility.PendingWorkloadOptions{
+ Limit: 2,
+ },
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "a",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ }},
+ },
+ },
+ "offset query parameter set": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsName).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsName).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsName).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("c", nsName).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second * 2)).Obj(),
+ },
+ req: &req{
+ queueName: cqNameA,
+ queryParams: &visibility.PendingWorkloadOptions{
+ Offset: 1,
+ Limit: constants.DefaultPendingWorkloadsLimit,
+ },
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "c",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second * 2)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 2,
+ PositionInLocalQueue: 2,
+ }},
+ },
+ },
+ "limit offset query parameters set": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsName).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsName).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsName).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("c", nsName).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second * 2)).Obj(),
+ },
+ req: &req{
+ queueName: cqNameA,
+ queryParams: &visibility.PendingWorkloadOptions{
+ Offset: 1,
+ Limit: 1,
+ },
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsName,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ }},
+ },
+ },
+ "empty cluster queue": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ req: &req{
+ queueName: cqNameA,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{},
+ },
+ "nonexistent queue name": {
+ req: &req{
+ queueName: "nonexistent-queue",
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantErr: errors.NewNotFound(visibility.Resource("clusterqueue"), "nonexistent-queue"),
+ },
+ wantErrMatch: errors.IsNotFound,
+ },
+ }
+ for name, tc := range cases {
+ t.Run(name, func(t *testing.T) {
+ manager := queue.NewManager(utiltesting.NewFakeClient(), nil)
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ go manager.CleanUpOnContext(ctx)
+ pendingWorkloadsInCqRest := NewPendingWorkloadsInCqREST(manager)
+ for _, cq := range tc.clusterQueues {
+ if err := manager.AddClusterQueue(ctx, cq); err != nil {
+ t.Fatalf("Adding cluster queue %s: %v", cq.Name, err)
+ }
+ }
+ for _, q := range tc.queues {
+ if err := manager.AddLocalQueue(ctx, q); err != nil {
+ t.Fatalf("Adding queue %q: %v", q.Name, err)
+ }
+ }
+ for _, w := range tc.workloads {
+ manager.AddOrUpdateWorkload(w)
+ }
+
+ info, err := pendingWorkloadsInCqRest.Get(ctx, tc.req.queueName, tc.req.queryParams)
+ switch {
+ case tc.wantErrMatch != nil:
+ if !tc.wantErrMatch(err) {
+ t.Errorf("Error differs: (-want,+got):\n%s", cmp.Diff(tc.wantResp.wantErr.Error(), err.Error()))
+ }
+ case err != nil:
+ t.Error(err)
+ default:
+ pendingWorkloadsInfo := info.(*visibility.PendingWorkloadsSummary)
+ if diff := cmp.Diff(tc.wantResp.wantPendingWorkloads, pendingWorkloadsInfo.Items, cmpopts.EquateEmpty()); diff != "" {
+ t.Errorf("Pending workloads differ: (-want,+got):\n%s", diff)
+ }
+ }
+ })
+ }
+}
diff --git a/pkg/visibility/api/v1beta1/pending_workloads_lq.go b/pkg/visibility/api/v1beta1/pending_workloads_lq.go
new file mode 100644
index 00000000000..bd3018eb701
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/pending_workloads_lq.go
@@ -0,0 +1,107 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/go-logr/logr"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/runtime"
+ genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
+ "k8s.io/apiserver/pkg/registry/rest"
+ ctrl "sigs.k8s.io/controller-runtime"
+
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ "sigs.k8s.io/kueue/pkg/constants"
+ "sigs.k8s.io/kueue/pkg/queue"
+
+ _ "k8s.io/metrics/pkg/apis/metrics/install"
+)
+
+type pendingWorkloadsInLqREST struct {
+ queueMgr *queue.Manager
+ log logr.Logger
+}
+
+var _ rest.Storage = &pendingWorkloadsInLqREST{}
+var _ rest.GetterWithOptions = &pendingWorkloadsInLqREST{}
+var _ rest.Scoper = &pendingWorkloadsInLqREST{}
+
+func NewPendingWorkloadsInLqREST(kueueMgr *queue.Manager) *pendingWorkloadsInLqREST {
+ return &pendingWorkloadsInLqREST{
+ queueMgr: kueueMgr,
+ log: ctrl.Log.WithName("pending-workload-in-lq"),
+ }
+}
+
+// New implements rest.Storage interface
+func (m *pendingWorkloadsInLqREST) New() runtime.Object {
+ return &visibility.PendingWorkloadsSummary{}
+}
+
+// Destroy implements rest.Storage interface
+func (m *pendingWorkloadsInLqREST) Destroy() {}
+
+// Get implements rest.GetterWithOptions interface
+// It fetches information about pending workloads and returns according to query params
+func (m *pendingWorkloadsInLqREST) Get(ctx context.Context, name string, opts runtime.Object) (runtime.Object, error) {
+ pendingWorkloadOpts, ok := opts.(*visibility.PendingWorkloadOptions)
+ if !ok {
+ return nil, fmt.Errorf("invalid options object: %#v", opts)
+ }
+ limit := pendingWorkloadOpts.Limit
+ offset := pendingWorkloadOpts.Offset
+
+ namespace := genericapirequest.NamespaceValue(ctx)
+ cqName, ok := m.queueMgr.ClusterQueueFromLocalQueue(queue.QueueKey(namespace, name))
+ if !ok {
+ return nil, errors.NewNotFound(visibility.Resource("localqueue"), name)
+ }
+
+ wls := make([]visibility.PendingWorkload, 0, limit)
+ skippedWls := 0
+ for index, wlInfo := range m.queueMgr.PendingWorkloadsInfo(cqName) {
+ if len(wls) >= int(limit) {
+ break
+ }
+ if wlInfo.Obj.Spec.QueueName == name {
+ if skippedWls < int(offset) {
+ skippedWls++
+ } else {
+ // Add a workload to results
+ wls = append(wls, *newPendingWorkload(wlInfo, int32(len(wls)+int(offset)), index))
+ }
+ }
+ }
+
+ return &visibility.PendingWorkloadsSummary{Items: wls}, nil
+}
+
+// NewGetOptions creates a new options object
+func (m *pendingWorkloadsInLqREST) NewGetOptions() (runtime.Object, bool, string) {
+ // If no query parameters were passed the generated defaults function are not executed so it's necessary to set default values here as well
+ return &visibility.PendingWorkloadOptions{
+ Limit: constants.DefaultPendingWorkloadsLimit,
+ }, false, ""
+}
+
+// NamespaceScoped implements rest.Scoper interface
+func (m *pendingWorkloadsInLqREST) NamespaceScoped() bool {
+ return true
+}
diff --git a/pkg/visibility/api/v1beta1/pending_workloads_lq_test.go b/pkg/visibility/api/v1beta1/pending_workloads_lq_test.go
new file mode 100644
index 00000000000..54c2bdadb04
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/pending_workloads_lq_test.go
@@ -0,0 +1,477 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apiserver/pkg/endpoints/request"
+
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ "sigs.k8s.io/kueue/pkg/constants"
+ "sigs.k8s.io/kueue/pkg/queue"
+ utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
+)
+
+func TestPendingWorkloadsInLQ(t *testing.T) {
+ const (
+ nsNameA = "nsA"
+ nsNameB = "nsB"
+ cqNameA = "cqA"
+ cqNameB = "cqB"
+ lqNameA = "lqA"
+ lqNameB = "lqB"
+ lowPrio = 50
+ highPrio = 100
+ )
+
+ defaultQueryParams := &visibility.PendingWorkloadOptions{
+ Offset: 0,
+ Limit: constants.DefaultPendingWorkloadsLimit,
+ }
+
+ scheme := runtime.NewScheme()
+ if err := kueue.AddToScheme(scheme); err != nil {
+ t.Fatalf("Failed adding kueue scheme: %s", err)
+ }
+ if err := visibility.AddToScheme(scheme); err != nil {
+ t.Fatalf("Failed adding kueue scheme: %s", err)
+ }
+
+ now := time.Now()
+ cases := map[string]struct {
+ clusterQueues []*kueue.ClusterQueue
+ queues []*kueue.LocalQueue
+ workloads []*kueue.Workload
+ req *req
+ wantResp *resp
+ wantErrMatch func(error) bool
+ }{
+ "single ClusterQueue and single LocalQueue setup with two workloads and default query parameters": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsNameA).Queue(lqNameA).Priority(lowPrio).Creation(now).Obj(),
+ },
+ req: &req{
+ nsName: nsNameA,
+ queueName: lqNameA,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "a",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: lowPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ }},
+ },
+ },
+ "single ClusterQueue and two LocalQueue setup with four workloads and default query parameters; LocalQueue A request": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ utiltesting.MakeLocalQueue(lqNameB, nsNameA).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("lqA-high-prio", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqA-low-prio", nsNameA).Queue(lqNameA).Priority(lowPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqB-high-prio", nsNameA).Queue(lqNameB).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("lqB-low-prio", nsNameA).Queue(lqNameB).Priority(lowPrio).Creation(now.Add(time.Second)).Obj(),
+ },
+ req: &req{
+ nsName: nsNameA,
+ queueName: lqNameA,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqA-high-prio",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqA-low-prio",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: lowPrio,
+ PositionInClusterQueue: 2,
+ PositionInLocalQueue: 1,
+ }},
+ },
+ },
+ "single ClusterQueue and two LocalQueue setup with four workloads and default query parameters; LocalQueue B request": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ utiltesting.MakeLocalQueue(lqNameB, nsNameA).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("lqA-high-prio", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqA-low-prio", nsNameA).Queue(lqNameA).Priority(lowPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqB-high-prio", nsNameA).Queue(lqNameB).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("lqB-low-prio", nsNameA).Queue(lqNameB).Priority(lowPrio).Creation(now.Add(time.Second)).Obj(),
+ },
+ req: &req{
+ nsName: nsNameA,
+ queueName: lqNameB,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqB-high-prio",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameB,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqB-low-prio",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameB,
+ Priority: lowPrio,
+ PositionInClusterQueue: 3,
+ PositionInLocalQueue: 1,
+ },
+ },
+ },
+ },
+ "two Namespaces, two ClusterQueue and two LocalQueue setup with four workloads and default query parameters, LocalQueue A request": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ utiltesting.MakeClusterQueue(cqNameB).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ utiltesting.MakeLocalQueue(lqNameB, nsNameB).ClusterQueue(cqNameB).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("lqA-high-prio", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqA-low-prio", nsNameA).Queue(lqNameA).Priority(lowPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqB-high-prio", nsNameB).Queue(lqNameB).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("lqB-low-prio", nsNameB).Queue(lqNameB).Priority(lowPrio).Creation(now.Add(time.Second)).Obj(),
+ },
+ req: &req{
+ nsName: nsNameA,
+ queueName: lqNameA,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqA-high-prio",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqA-low-prio",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: lowPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ },
+ },
+ },
+ },
+ "two Namespaces, two ClusterQueue and two LocalQueue setup with four workloads and default query parameters, LocalQueue B request": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ utiltesting.MakeClusterQueue(cqNameB).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ utiltesting.MakeLocalQueue(lqNameB, nsNameB).ClusterQueue(cqNameB).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("lqA-high-prio", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqA-low-prio", nsNameA).Queue(lqNameA).Priority(lowPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("lqB-high-prio", nsNameB).Queue(lqNameB).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("lqB-low-prio", nsNameB).Queue(lqNameB).Priority(lowPrio).Creation(now.Add(time.Second)).Obj(),
+ },
+ req: &req{
+ nsName: nsNameB,
+ queueName: lqNameB,
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqB-high-prio",
+ Namespace: nsNameB,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameB,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "lqB-low-prio",
+ Namespace: nsNameB,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameB,
+ Priority: lowPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ },
+ },
+ },
+ },
+ "limit query parameter set": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("c", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second * 2)).Obj(),
+ },
+ req: &req{
+ nsName: nsNameA,
+ queueName: lqNameA,
+ queryParams: &visibility.PendingWorkloadOptions{
+ Limit: 2,
+ },
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "a",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 0,
+ PositionInLocalQueue: 0,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ },
+ },
+ },
+ },
+ "offset query parameter set": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("c", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second * 2)).Obj(),
+ },
+ req: &req{
+ nsName: nsNameA,
+ queueName: lqNameA,
+ queryParams: &visibility.PendingWorkloadOptions{
+ Offset: 1,
+ Limit: constants.DefaultPendingWorkloadsLimit,
+ },
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ },
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "c",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second * 2)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 2,
+ PositionInLocalQueue: 2,
+ },
+ },
+ },
+ },
+ "limit and offset query parameters set": {
+ clusterQueues: []*kueue.ClusterQueue{
+ utiltesting.MakeClusterQueue(cqNameA).Obj(),
+ },
+ queues: []*kueue.LocalQueue{
+ utiltesting.MakeLocalQueue(lqNameA, nsNameA).ClusterQueue(cqNameA).Obj(),
+ },
+ workloads: []*kueue.Workload{
+ utiltesting.MakeWorkload("a", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now).Obj(),
+ utiltesting.MakeWorkload("b", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second)).Obj(),
+ utiltesting.MakeWorkload("c", nsNameA).Queue(lqNameA).Priority(highPrio).Creation(now.Add(time.Second * 2)).Obj(),
+ },
+ req: &req{
+ nsName: nsNameA,
+ queueName: lqNameA,
+ queryParams: &visibility.PendingWorkloadOptions{
+ Offset: 1,
+ Limit: 1,
+ },
+ },
+ wantResp: &resp{
+ wantPendingWorkloads: []visibility.PendingWorkload{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "b",
+ Namespace: nsNameA,
+ CreationTimestamp: metav1.NewTime(now.Add(time.Second)),
+ },
+ LocalQueueName: lqNameA,
+ Priority: highPrio,
+ PositionInClusterQueue: 1,
+ PositionInLocalQueue: 1,
+ },
+ },
+ },
+ },
+ "nonexistent queue name": {
+ req: &req{
+ queueName: "nonexistent-queue",
+ queryParams: defaultQueryParams,
+ },
+ wantResp: &resp{
+ wantErr: errors.NewNotFound(visibility.Resource("localqueue"), "invalid-name"),
+ },
+ wantErrMatch: errors.IsNotFound,
+ },
+ }
+ for name, tc := range cases {
+ t.Run(name, func(t *testing.T) {
+ manager := queue.NewManager(utiltesting.NewFakeClient(), nil)
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ go manager.CleanUpOnContext(ctx)
+ pendingWorkloadsInLqRest := NewPendingWorkloadsInLqREST(manager)
+ for _, cq := range tc.clusterQueues {
+ if err := manager.AddClusterQueue(ctx, cq); err != nil {
+ t.Fatalf("Adding cluster queue %s: %v", cq.Name, err)
+ }
+ }
+ for _, q := range tc.queues {
+ if err := manager.AddLocalQueue(ctx, q); err != nil {
+ t.Fatalf("Adding queue %q: %v", q.Name, err)
+ }
+ }
+ for _, w := range tc.workloads {
+ manager.AddOrUpdateWorkload(w)
+ }
+
+ ctx = request.WithNamespace(ctx, tc.req.nsName)
+ info, err := pendingWorkloadsInLqRest.Get(ctx, tc.req.queueName, tc.req.queryParams)
+ switch {
+ case tc.wantErrMatch != nil:
+ if !tc.wantErrMatch(err) {
+ t.Errorf("Error differs: (-want,+got):\n%s", cmp.Diff(tc.wantResp.wantErr.Error(), err.Error()))
+ }
+ case err != nil:
+ t.Error(err)
+ default:
+ pendingWorkloadsInfo := info.(*visibility.PendingWorkloadsSummary)
+ if diff := cmp.Diff(tc.wantResp.wantPendingWorkloads, pendingWorkloadsInfo.Items, cmpopts.EquateEmpty()); diff != "" {
+ t.Errorf("Pending workloads differ: (-want,+got):\n%s", diff)
+ }
+ }
+ })
+ }
+}
diff --git a/pkg/visibility/api/v1beta1/storage.go b/pkg/visibility/api/v1beta1/storage.go
new file mode 100644
index 00000000000..58e1a4db033
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/storage.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "k8s.io/apiserver/pkg/registry/rest"
+
+ "sigs.k8s.io/kueue/pkg/queue"
+)
+
+func NewStorage(mgr *queue.Manager) map[string]rest.Storage {
+ return map[string]rest.Storage{
+ "clusterqueues": NewCqREST(),
+ "clusterqueues/pendingworkloads": NewPendingWorkloadsInCqREST(mgr),
+ "localqueues": NewLqREST(),
+ "localqueues/pendingworkloads": NewPendingWorkloadsInLqREST(mgr),
+ }
+}
diff --git a/pkg/visibility/api/v1beta1/test_utils.go b/pkg/visibility/api/v1beta1/test_utils.go
new file mode 100644
index 00000000000..b0c5047e19a
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/test_utils.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+)
+
+type req struct {
+ nsName string
+ queueName string
+ queryParams *visibility.PendingWorkloadOptions
+}
+
+type resp struct {
+ wantErr error
+ wantPendingWorkloads []visibility.PendingWorkload
+}
diff --git a/pkg/visibility/api/v1beta1/utils.go b/pkg/visibility/api/v1beta1/utils.go
new file mode 100644
index 00000000000..5974d8e7c00
--- /dev/null
+++ b/pkg/visibility/api/v1beta1/utils.go
@@ -0,0 +1,48 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ "sigs.k8s.io/kueue/pkg/workload"
+)
+
+func newPendingWorkload(wlInfo *workload.Info, positionInLq int32, positionInCq int) *visibility.PendingWorkload {
+ ownerReferences := make([]metav1.OwnerReference, 0, len(wlInfo.Obj.OwnerReferences))
+ for _, ref := range wlInfo.Obj.OwnerReferences {
+ ownerReferences = append(ownerReferences, metav1.OwnerReference{
+ APIVersion: ref.APIVersion,
+ Kind: ref.Kind,
+ Name: ref.Name,
+ UID: ref.UID,
+ })
+ }
+ return &visibility.PendingWorkload{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: wlInfo.Obj.Name,
+ Namespace: wlInfo.Obj.Namespace,
+ OwnerReferences: ownerReferences,
+ CreationTimestamp: wlInfo.Obj.CreationTimestamp,
+ },
+ PositionInClusterQueue: int32(positionInCq),
+ Priority: *wlInfo.Obj.Spec.Priority,
+ LocalQueueName: wlInfo.Obj.Spec.QueueName,
+ PositionInLocalQueue: positionInLq,
+ }
+}
diff --git a/pkg/visibility/server.go b/pkg/visibility/server.go
index 7f5338c185f..ec1e755a3e8 100644
--- a/pkg/visibility/server.go
+++ b/pkg/visibility/server.go
@@ -1,16 +1,18 @@
-// Copyright 2023 The Kubernetes Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
package visibility
@@ -21,17 +23,20 @@ import (
"os"
"strings"
- "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
- generatedopenapi "sigs.k8s.io/kueue/apis/visibility/v1alpha1/openapi"
- "sigs.k8s.io/kueue/pkg/queue"
- "sigs.k8s.io/kueue/pkg/visibility/api"
-
openapinamer "k8s.io/apiserver/pkg/endpoints/openapi"
genericapiserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
+ utilversion "k8s.io/apiserver/pkg/util/version"
"k8s.io/client-go/pkg/version"
- _ "k8s.io/component-base/metrics/prometheus/restclient" // for client-go metrics registration
ctrl "sigs.k8s.io/controller-runtime"
+
+ generatedopenapi "sigs.k8s.io/kueue/apis/visibility/openapi"
+ visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
+ "sigs.k8s.io/kueue/pkg/queue"
+ "sigs.k8s.io/kueue/pkg/visibility/api"
+
+ _ "k8s.io/component-base/metrics/prometheus/restclient" // for client-go metrics registration
)
var (
@@ -57,18 +62,21 @@ func CreateAndStartVisibilityServer(ctx context.Context, kueueMgr *queue.Manager
}
if err := api.Install(visibilityServer, kueueMgr); err != nil {
- setupLog.Error(err, "Unable to install visibility.kueue.x-k8s.io/v1alpha1 API")
+ setupLog.Error(err, "Unable to install visibility.kueue.x-k8s.io API")
os.Exit(1)
}
- if err := visibilityServer.PrepareRun().Run(ctx.Done()); err != nil {
+ if err := visibilityServer.PrepareRun().RunWithContext(ctx); err != nil {
setupLog.Error(err, "Error running visibility server")
os.Exit(1)
}
}
func applyVisibilityServerOptions(config *genericapiserver.RecommendedConfig) error {
- o := genericoptions.NewRecommendedOptions("", api.Codecs.LegacyCodec(v1alpha1.SchemeGroupVersion))
+ o := genericoptions.NewRecommendedOptions("", api.Codecs.LegacyCodec(
+ visibilityv1alpha1.SchemeGroupVersion,
+ visibilityv1beta1.SchemeGroupVersion,
+ ))
o.Etcd = nil
o.SecureServing.BindPort = 8082
// The directory where TLS certs will be created
@@ -82,15 +90,16 @@ func applyVisibilityServerOptions(config *genericapiserver.RecommendedConfig) er
func newVisibilityServerConfig() *genericapiserver.RecommendedConfig {
c := genericapiserver.NewRecommendedConfig(api.Codecs)
- versionGet := version.Get()
- c.Config.Version = &versionGet
+ versionInfo := version.Get()
+ version := strings.Split(versionInfo.String(), "-")[0]
// enable OpenAPI schemas
+ c.Config.EffectiveVersion = utilversion.NewEffectiveVersion(version)
c.Config.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
c.Config.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
c.Config.OpenAPIConfig.Info.Title = "Kueue visibility-server"
c.Config.OpenAPIV3Config.Info.Title = "Kueue visibility-server"
- c.Config.OpenAPIConfig.Info.Version = strings.Split(c.Config.Version.String(), "-")[0]
- c.Config.OpenAPIV3Config.Info.Version = strings.Split(c.Config.Version.String(), "-")[0]
+ c.Config.OpenAPIConfig.Info.Version = version
+ c.Config.OpenAPIV3Config.Info.Version = version
c.EnableMetrics = true
diff --git a/pkg/webhooks/clusterqueue_webhook.go b/pkg/webhooks/clusterqueue_webhook.go
index ae6474b995d..e3c5f21f695 100644
--- a/pkg/webhooks/clusterqueue_webhook.go
+++ b/pkg/webhooks/clusterqueue_webhook.go
@@ -82,11 +82,10 @@ func (w *ClusterQueueWebhook) ValidateCreate(ctx context.Context, obj runtime.Ob
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
func (w *ClusterQueueWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
newCQ := newObj.(*kueue.ClusterQueue)
- oldCQ := oldObj.(*kueue.ClusterQueue)
log := ctrl.LoggerFrom(ctx).WithName("clusterqueue-webhook")
log.V(5).Info("Validating update", "clusterQueue", klog.KObj(newCQ))
- allErrs := ValidateClusterQueueUpdate(newCQ, oldCQ)
+ allErrs := ValidateClusterQueueUpdate(newCQ)
return nil, allErrs.ToAggregate()
}
@@ -99,7 +98,11 @@ func ValidateClusterQueue(cq *kueue.ClusterQueue) field.ErrorList {
path := field.NewPath("spec")
var allErrs field.ErrorList
- allErrs = append(allErrs, validateResourceGroups(cq.Spec.ResourceGroups, cq.Spec.Cohort, path.Child("resourceGroups"))...)
+ config := validationConfig{
+ hasParent: cq.Spec.Cohort != "",
+ enforceNominalGreaterThanLending: true,
+ }
+ allErrs = append(allErrs, validateResourceGroups(cq.Spec.ResourceGroups, config, path.Child("resourceGroups"))...)
allErrs = append(allErrs,
validation.ValidateLabelSelector(cq.Spec.NamespaceSelector, validation.LabelSelectorValidationOptions{}, path.Child("namespaceSelector"))...)
allErrs = append(allErrs, validateCQAdmissionChecks(&cq.Spec, path)...)
@@ -112,10 +115,8 @@ func ValidateClusterQueue(cq *kueue.ClusterQueue) field.ErrorList {
return allErrs
}
-func ValidateClusterQueueUpdate(newObj, _ *kueue.ClusterQueue) field.ErrorList {
- var allErrs field.ErrorList
- allErrs = append(allErrs, ValidateClusterQueue(newObj)...)
- return allErrs
+func ValidateClusterQueueUpdate(newObj *kueue.ClusterQueue) field.ErrorList {
+ return ValidateClusterQueue(newObj)
}
func validatePreemption(preemption *kueue.ClusterQueuePreemption, path *field.Path) field.ErrorList {
@@ -137,7 +138,7 @@ func validateCQAdmissionChecks(spec *kueue.ClusterQueueSpec, path *field.Path) f
return allErrs
}
-func validateResourceGroups(resourceGroups []kueue.ResourceGroup, cohort string, path *field.Path) field.ErrorList {
+func validateResourceGroups(resourceGroups []kueue.ResourceGroup, config validationConfig, path *field.Path) field.ErrorList {
var allErrs field.ErrorList
seenResources := sets.New[corev1.ResourceName]()
seenFlavors := sets.New[kueue.ResourceFlavorReference]()
@@ -155,7 +156,7 @@ func validateResourceGroups(resourceGroups []kueue.ResourceGroup, cohort string,
}
for j, fqs := range rg.Flavors {
path := path.Child("flavors").Index(j)
- allErrs = append(allErrs, validateFlavorQuotas(fqs, rg.CoveredResources, cohort, path)...)
+ allErrs = append(allErrs, validateFlavorQuotas(fqs, rg.CoveredResources, config, path)...)
if seenFlavors.Has(fqs.Name) {
allErrs = append(allErrs, field.Duplicate(path.Child("name"), fqs.Name))
} else {
@@ -166,7 +167,7 @@ func validateResourceGroups(resourceGroups []kueue.ResourceGroup, cohort string,
return allErrs
}
-func validateFlavorQuotas(flavorQuotas kueue.FlavorQuotas, coveredResources []corev1.ResourceName, cohort string, path *field.Path) field.ErrorList {
+func validateFlavorQuotas(flavorQuotas kueue.FlavorQuotas, coveredResources []corev1.ResourceName, config validationConfig, path *field.Path) field.ErrorList {
var allErrs field.ErrorList
for i, rq := range flavorQuotas.Resources {
@@ -180,13 +181,14 @@ func validateFlavorQuotas(flavorQuotas kueue.FlavorQuotas, coveredResources []co
allErrs = append(allErrs, validateResourceQuantity(rq.NominalQuota, path.Child("nominalQuota"))...)
if rq.BorrowingLimit != nil {
borrowingLimitPath := path.Child("borrowingLimit")
+ allErrs = append(allErrs, validateLimit(*rq.BorrowingLimit, config, borrowingLimitPath)...)
allErrs = append(allErrs, validateResourceQuantity(*rq.BorrowingLimit, borrowingLimitPath)...)
}
if features.Enabled(features.LendingLimit) && rq.LendingLimit != nil {
lendingLimitPath := path.Child("lendingLimit")
allErrs = append(allErrs, validateResourceQuantity(*rq.LendingLimit, lendingLimitPath)...)
- allErrs = append(allErrs, validateLimit(*rq.LendingLimit, cohort, lendingLimitPath)...)
- allErrs = append(allErrs, validateLendingLimit(*rq.LendingLimit, rq.NominalQuota, lendingLimitPath)...)
+ allErrs = append(allErrs, validateLimit(*rq.LendingLimit, config, lendingLimitPath)...)
+ allErrs = append(allErrs, validateLendingLimit(*rq.LendingLimit, rq.NominalQuota, config, lendingLimitPath)...)
}
}
return allErrs
@@ -202,18 +204,18 @@ func validateResourceQuantity(value resource.Quantity, fldPath *field.Path) fiel
}
// validateLimit enforces that BorrowingLimit or LendingLimit must be nil when cohort is empty
-func validateLimit(limit resource.Quantity, cohort string, fldPath *field.Path) field.ErrorList {
+func validateLimit(limit resource.Quantity, config validationConfig, fldPath *field.Path) field.ErrorList {
var allErrs field.ErrorList
- if len(cohort) == 0 {
+ if !config.hasParent {
allErrs = append(allErrs, field.Invalid(fldPath, limit.String(), limitIsEmptyErrorMsg))
}
return allErrs
}
// validateLendingLimit enforces that LendingLimit is not greater than NominalQuota
-func validateLendingLimit(lend, nominal resource.Quantity, fldPath *field.Path) field.ErrorList {
+func validateLendingLimit(lend, nominal resource.Quantity, config validationConfig, fldPath *field.Path) field.ErrorList {
var allErrs field.ErrorList
- if lend.Cmp(nominal) > 0 {
+ if config.enforceNominalGreaterThanLending && lend.Cmp(nominal) > 0 {
allErrs = append(allErrs, field.Invalid(fldPath, lend.String(), lendingLimitErrorMsg))
}
return allErrs
diff --git a/pkg/webhooks/clusterqueue_webhook_test.go b/pkg/webhooks/clusterqueue_webhook_test.go
index 19732b08cce..e0a1b8942ec 100644
--- a/pkg/webhooks/clusterqueue_webhook_test.go
+++ b/pkg/webhooks/clusterqueue_webhook_test.go
@@ -328,7 +328,7 @@ func TestValidateClusterQueue(t *testing.T) {
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
if tc.disableLendingLimit {
- defer features.SetFeatureGateDuringTest(t, features.LendingLimit, false)()
+ features.SetFeatureGateDuringTest(t, features.LendingLimit, false)
}
gotErr := ValidateClusterQueue(tc.clusterQueue)
if diff := cmp.Diff(tc.wantErr, gotErr, cmpopts.IgnoreFields(field.Error{}, "Detail", "BadValue")); diff != "" {
@@ -361,7 +361,7 @@ func TestValidateClusterQueueUpdate(t *testing.T) {
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
- gotErr := ValidateClusterQueueUpdate(tc.newClusterQueue, tc.oldClusterQueue)
+ gotErr := ValidateClusterQueueUpdate(tc.newClusterQueue)
if diff := cmp.Diff(tc.wantErr, gotErr, cmpopts.IgnoreFields(field.Error{}, "Detail", "BadValue")); diff != "" {
t.Errorf("ValidateResources() mismatch (-want +got):\n%s", diff)
}
diff --git a/pkg/webhooks/cohort_webhook.go b/pkg/webhooks/cohort_webhook.go
new file mode 100644
index 00000000000..5146eb398f6
--- /dev/null
+++ b/pkg/webhooks/cohort_webhook.go
@@ -0,0 +1,77 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package webhooks
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/util/validation/field"
+ "k8s.io/klog/v2"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+)
+
+type CohortWebhook struct{}
+
+func setupWebhookForCohort(mgr ctrl.Manager) error {
+ return ctrl.NewWebhookManagedBy(mgr).
+ For(&kueuealpha.Cohort{}).
+ WithValidator(&CohortWebhook{}).
+ Complete()
+}
+
+func (w *CohortWebhook) Default(ctx context.Context, obj runtime.Object) error {
+ return nil
+}
+
+//+kubebuilder:webhook:path=/validate-kueue-x-k8s-io-v1alpha1-cohort,mutating=false,failurePolicy=fail,sideEffects=None,groups=kueue.x-k8s.io,resources=cohorts,verbs=create;update,versions=v1alpha1,name=vcohort.kb.io,admissionReviewVersions=v1
+
+var _ webhook.CustomValidator = &CohortWebhook{}
+
+// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
+func (w *CohortWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
+ cohort := obj.(*kueuealpha.Cohort)
+ log := ctrl.LoggerFrom(ctx).WithName("cohort-webhook")
+ log.V(5).Info("Validating Cohort create", "cohort", klog.KObj(cohort))
+ return nil, validateCohort(cohort).ToAggregate()
+}
+
+// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
+func (w *CohortWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
+ cohort := newObj.(*kueuealpha.Cohort)
+ log := ctrl.LoggerFrom(ctx).WithName("cohort-webhook")
+ log.V(5).Info("Validating Cohort update", "cohort", klog.KObj(cohort))
+ return nil, validateCohort(cohort).ToAggregate()
+}
+
+// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
+func (w *CohortWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {
+ return nil, nil
+}
+
+func validateCohort(cohort *kueuealpha.Cohort) field.ErrorList {
+ path := field.NewPath("spec")
+ config := validationConfig{
+ hasParent: cohort.Spec.Parent != "",
+ enforceNominalGreaterThanLending: false,
+ }
+ return validateResourceGroups(cohort.Spec.ResourceGroups, config, path.Child("resourceGroups"))
+}
diff --git a/pkg/webhooks/common.go b/pkg/webhooks/common.go
index 703cb3fe75e..dcea7b45f22 100644
--- a/pkg/webhooks/common.go
+++ b/pkg/webhooks/common.go
@@ -29,3 +29,8 @@ func validateResourceName(name corev1.ResourceName, fldPath *field.Path) field.E
}
return allErrs
}
+
+type validationConfig struct {
+ hasParent bool
+ enforceNominalGreaterThanLending bool
+}
diff --git a/pkg/webhooks/webhooks.go b/pkg/webhooks/webhooks.go
index 5e172c573b4..6ac550dd244 100644
--- a/pkg/webhooks/webhooks.go
+++ b/pkg/webhooks/webhooks.go
@@ -16,7 +16,9 @@ limitations under the License.
package webhooks
-import ctrl "sigs.k8s.io/controller-runtime"
+import (
+ ctrl "sigs.k8s.io/controller-runtime"
+)
// Setup sets up the webhooks for core controllers. It returns the name of the
// webhook that failed to create and an error, if any.
@@ -33,5 +35,9 @@ func Setup(mgr ctrl.Manager) (string, error) {
return "ClusterQueue", err
}
+ if err := setupWebhookForCohort(mgr); err != nil {
+ return "Cohort", err
+ }
+
return "", nil
}
diff --git a/pkg/workload/workload.go b/pkg/workload/workload.go
index 3b40a6589df..0d9ab2ab4ed 100644
--- a/pkg/workload/workload.go
+++ b/pkg/workload/workload.go
@@ -43,6 +43,7 @@ import (
"sigs.k8s.io/kueue/pkg/util/api"
"sigs.k8s.io/kueue/pkg/util/limitrange"
utilmaps "sigs.k8s.io/kueue/pkg/util/maps"
+ utilslices "sigs.k8s.io/kueue/pkg/util/slices"
)
const (
@@ -78,7 +79,6 @@ func Status(w *kueue.Workload) string {
type AssignmentClusterQueueState struct {
LastTriedFlavorIdx []map[corev1.ResourceName]int
- CohortGeneration int64
ClusterQueueGeneration int64
}
@@ -100,7 +100,6 @@ func WithExcludedResourcePrefixes(n []string) InfoOption {
func (s *AssignmentClusterQueueState) Clone() *AssignmentClusterQueueState {
c := AssignmentClusterQueueState{
LastTriedFlavorIdx: make([]map[corev1.ResourceName]int, len(s.LastTriedFlavorIdx)),
- CohortGeneration: s.CohortGeneration,
ClusterQueueGeneration: s.ClusterQueueGeneration,
}
for ps, flavorIdx := range s.LastTriedFlavorIdx {
@@ -170,9 +169,11 @@ func (psr *PodSetResources) ScaledTo(newCount int32) *PodSetResources {
Flavors: maps.Clone(psr.Flavors),
}
- scaleDown(ret.Requests, int64(ret.Count))
- scaleUp(ret.Requests, int64(newCount))
- ret.Count = newCount
+ if psr.Count != 0 && psr.Count != newCount {
+ scaleDown(ret.Requests, int64(ret.Count))
+ scaleUp(ret.Requests, int64(newCount))
+ ret.Count = newCount
+ }
return ret
}
@@ -256,21 +257,15 @@ func QueueKey(w *kueue.Workload) string {
}
func reclaimableCounts(wl *kueue.Workload) map[string]int32 {
- ret := make(map[string]int32, len(wl.Status.ReclaimablePods))
- for i := range wl.Status.ReclaimablePods {
- reclaimInfo := &wl.Status.ReclaimablePods[i]
- ret[reclaimInfo.Name] = reclaimInfo.Count
- }
- return ret
+ return utilslices.ToMap(wl.Status.ReclaimablePods, func(i int) (string, int32) {
+ return wl.Status.ReclaimablePods[i].Name, wl.Status.ReclaimablePods[i].Count
+ })
}
func podSetsCounts(wl *kueue.Workload) map[string]int32 {
- ret := make(map[string]int32, len(wl.Spec.PodSets))
- for i := range wl.Spec.PodSets {
- ps := &wl.Spec.PodSets[i]
- ret[ps.Name] = ps.Count
- }
- return ret
+ return utilslices.ToMap(wl.Spec.PodSets, func(i int) (string, int32) {
+ return wl.Spec.PodSets[i].Name, wl.Spec.PodSets[i].Count
+ })
}
func podSetsCountsAfterReclaim(wl *kueue.Workload) map[string]int32 {
@@ -318,12 +313,15 @@ func totalRequestsFromAdmission(wl *kueue.Workload) []PodSetResources {
Requests: resources.NewRequests(psa.ResourceUsage),
}
- if count := currentCounts[psa.Name]; count != setRes.Count {
+ // If countAfterReclaim is lower then the admission count indicates that
+ // additional pods are marked as reclaimable, and the consumption should be scaled down.
+ if countAfterReclaim := currentCounts[psa.Name]; countAfterReclaim < setRes.Count {
scaleDown(setRes.Requests, int64(setRes.Count))
- scaleUp(setRes.Requests, int64(count))
- setRes.Count = count
+ scaleUp(setRes.Requests, int64(countAfterReclaim))
+ setRes.Count = countAfterReclaim
}
-
+ // Otherwise if countAfterReclaim is higher it means that the podSet was partially admitted
+ // and the count should be preserved.
res = append(res, setRes)
}
return res
@@ -570,18 +568,9 @@ func ReclaimablePodsAreEqual(a, b []kueue.ReclaimablePod) bool {
if len(a) != len(b) {
return false
}
-
- mb := make(map[string]int32, len(b))
- for i := range b {
- mb[b[i].Name] = b[i].Count
- }
-
- for i := range a {
- if bCount, found := mb[a[i].Name]; !found || bCount != a[i].Count {
- return false
- }
- }
- return true
+ ma := utilslices.ToMap(a, func(i int) (string, int32) { return a[i].Name, a[i].Count })
+ mb := utilslices.ToMap(b, func(i int) (string, int32) { return b[i].Name, b[i].Count })
+ return maps.Equal(ma, mb)
}
// IsAdmitted returns true if the workload is admitted.
diff --git a/pkg/workload/workload_test.go b/pkg/workload/workload_test.go
index 0a9de5da282..c278aa8506e 100644
--- a/pkg/workload/workload_test.go
+++ b/pkg/workload/workload_test.go
@@ -192,6 +192,78 @@ func TestNewInfo(t *testing.T) {
},
},
},
+ "admitted with reclaim and increased reclaim": {
+ workload: *utiltesting.MakeWorkload("", "").
+ PodSets(
+ *utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "10m").
+ Request(corev1.ResourceMemory, "10Ki").
+ Obj(),
+ ).
+ ReserveQuota(
+ utiltesting.MakeAdmission("").
+ Assignment(corev1.ResourceCPU, "f1", "30m").
+ Assignment(corev1.ResourceMemory, "f1", "30Ki").
+ AssignmentPodCount(3).
+ Obj(),
+ ).
+ ReclaimablePods(
+ kueue.ReclaimablePod{
+ Name: "main",
+ Count: 3,
+ },
+ ).
+ Obj(),
+ wantInfo: Info{
+ TotalRequests: []PodSetResources{
+ {
+ Name: "main",
+ Flavors: map[corev1.ResourceName]kueue.ResourceFlavorReference{
+ corev1.ResourceCPU: "f1",
+ corev1.ResourceMemory: "f1",
+ },
+ Requests: resources.Requests{
+ corev1.ResourceCPU: 2 * 10,
+ corev1.ResourceMemory: 2 * 10 * 1024,
+ },
+ Count: 2,
+ },
+ },
+ },
+ },
+ "partially admitted": {
+ workload: *utiltesting.MakeWorkload("", "").
+ PodSets(
+ *utiltesting.MakePodSet("main", 5).
+ Request(corev1.ResourceCPU, "10m").
+ Request(corev1.ResourceMemory, "10Ki").
+ Obj(),
+ ).
+ ReserveQuota(
+ utiltesting.MakeAdmission("").
+ Assignment(corev1.ResourceCPU, "f1", "30m").
+ Assignment(corev1.ResourceMemory, "f1", "30Ki").
+ AssignmentPodCount(3).
+ Obj(),
+ ).
+ Obj(),
+ wantInfo: Info{
+ TotalRequests: []PodSetResources{
+ {
+ Name: "main",
+ Flavors: map[corev1.ResourceName]kueue.ResourceFlavorReference{
+ corev1.ResourceCPU: "f1",
+ corev1.ResourceMemory: "f1",
+ },
+ Requests: resources.Requests{
+ corev1.ResourceCPU: 3 * 10,
+ corev1.ResourceMemory: 3 * 10 * 1024,
+ },
+ Count: 3,
+ },
+ },
+ },
+ },
"filterResources": {
workload: *utiltesting.MakeWorkload("", "").
Request(corev1.ResourceCPU, "10m").
diff --git a/site/assets/scss/_styles_project.scss b/site/assets/scss/_styles_project.scss
index 4aa982d647a..edc65f757f0 100644
--- a/site/assets/scss/_styles_project.scss
+++ b/site/assets/scss/_styles_project.scss
@@ -194,7 +194,6 @@ div.feature-state-notice {
font-size: 0.95em;
font-weight: bold;
color: #000;
- background-color: #daeaf9;
}
code {
@@ -205,4 +204,12 @@ div.feature-state-notice {
margin-right: 2em;
max-width: 80%;
+
+ &.feature-deprecated {
+ > .feature-state-name::before {
+ color: #ed6a5a;
+ }
+
+ background-color: #fbe1de;
+ }
}
diff --git a/site/content/en/docs/adopters/index.md b/site/content/en/docs/adopters/index.md
index 95182ea2e8c..9e79a379c49 100644
--- a/site/content/en/docs/adopters/index.md
+++ b/site/content/en/docs/adopters/index.md
@@ -16,16 +16,16 @@ If you are using Kueue, feel free to open a pull request to add your organizatio
## Adopters
-| Organization | Type | Description | Integrations | Contact |
-|:----------------------------------------------------:|:--------:|:----------------------:|:----------------------------------:|:----------------------------------------:|
-| [CyberAgent, Inc.](https://www.cyberagent.co.jp/en/) | End User | On-premise ML Platform | batch/job kubeflow.org/mpijob | [@tenzen-y](https://github.com/tenzen-y) |
-| [DaoCloud, Inc.](https://www.daocloud.io/en/) | End User | Part of the AI Platform for managing all kinds of Jobs. | batch/job RayJob ... | [@kerthcet](https://github.com/kerthcet) |
-| [WattIQ, Inc.](https://wattiq.io) | End User | SaaS/IoT product | batch/job RayJob | [@madsenwattiq](https://github.com/madsenwattiq) |
-| [Horizon, Inc.](https://horizon.cc/) | End User | AI training platform | batch/job ... | [@GhangZh](https://github.com/GhangZh) |
-| [FAR AI](https://far.ai/) | End User | AI alignment research nonprofit | batch/job | [@rhaps0dy](https://github.com/rhaps0dy) |
-| [Shopee, Inc.](https://shopee.com/) | End User | Training/batch inference/data processes in AI platform test env | Customized job RayJob ... | [@denkensk](https://github.com/denkensk) |
-| [Mondoo, Inc.](https://mondoo.com) | End User | Helps power Mondoo's hosted security scanner | batch/job | [@jaym](https://github.com/jaym) |
-| [Google Cloud](https://cloud.google.com/) | Provider | Part of [kit for training ML workloads on TPUs][gcmldemo] | JobSet | [@mrozacki](https://github.com/mrozacki) |
-| [Onna Technologies, Inc](https://onna.com) | End User | Unstructured Data Management Platform | batch/job | [@gitcarbs](https://github.com/gitcarbs) |
+| Organization | Type | Description | Integrations | Contact |
+|:-------------------------------------------------------:|:--------:|:---------------------------------------------------------------:|:-------------------------------------:|:------------------------------------------------:|
+| [CyberAgent, Inc.](https://www.cyberagent.co.jp/en/) | End User | On-premise ML Platform | batch/job kubeflow.org/mpijob | [@tenzen-y](https://github.com/tenzen-y) |
+| [DaoCloud, Inc.](https://www.daocloud.io/en/) | End User | Part of the AI Platform for managing all kinds of Jobs. | batch/job RayJob ... | [@kerthcet](https://github.com/kerthcet) |
+| [WattIQ, Inc.](https://wattiq.io) | End User | SaaS/IoT product | batch/job RayJob | [@madsenwattiq](https://github.com/madsenwattiq) |
+| [Horizon, Inc.](https://horizon.cc/) | End User | AI training platform | batch/job ... | [@GhangZh](https://github.com/GhangZh) |
+| [FAR AI](https://far.ai/) | End User | AI alignment research nonprofit | batch/job | [@rhaps0dy](https://github.com/rhaps0dy) |
+| [Shopee, Inc.](https://shopee.com/) | End User | Training/batch inference/data processes in AI platform test env | Customized job RayJob ... | [@denkensk](https://github.com/denkensk) |
+| [Mondoo, Inc.](https://mondoo.com) | End User | Helps power Mondoo's hosted security scanner | batch/job | [@jaym](https://github.com/jaym) |
+| [Google Cloud](https://cloud.google.com/) | Provider | Part of [kit for training ML workloads on TPUs][gcmldemo] | JobSet | [@mrozacki](https://github.com/mrozacki) |
+| [Onna Technologies, Inc](https://onna.com) | End User | Unstructured Data Management Platform | batch/job | [@gitcarbs](https://github.com/gitcarbs) |
[gcmldemo]: https://cloud.google.com/blog/products/compute/the-worlds-largest-distributed-llm-training-job-on-tpu-v5e
diff --git a/site/content/en/docs/concepts/admission_check.md b/site/content/en/docs/concepts/admission_check.md
index a679229daf8..5441c877c6f 100644
--- a/site/content/en/docs/concepts/admission_check.md
+++ b/site/content/en/docs/concepts/admission_check.md
@@ -1,6 +1,6 @@
---
title: "Admission Check"
-date: 2024-13-06
+date: 2024-06-13
weight: 6
description: >
Mechanism allowing internal or external components to influence the workload's admission.
diff --git a/site/content/en/docs/concepts/cluster_queue.md b/site/content/en/docs/concepts/cluster_queue.md
index 8dbad6eedcd..fed3177654a 100644
--- a/site/content/en/docs/concepts/cluster_queue.md
+++ b/site/content/en/docs/concepts/cluster_queue.md
@@ -359,7 +359,7 @@ you can set the `.spec.resourcesGroup[*].flavors[*].resource[*].lendingLimit`
[quantity](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/) field.
{{< feature-state state="beta" for_version="v0.9" >}}
-{{% alert title="Warning" color="warning" %}}
+{{% alert title="Note" color="primary" %}}
`LendingLimit` is a Beta feature enabled by default.
diff --git a/site/content/en/docs/concepts/multikueue.md b/site/content/en/docs/concepts/multikueue.md
index b5e4d323df2..8adf9c42300 100644
--- a/site/content/en/docs/concepts/multikueue.md
+++ b/site/content/en/docs/concepts/multikueue.md
@@ -9,7 +9,7 @@ description: >
{{< feature-state state="alpha" for_version="v0.6" >}}
{{% alert title="Warning" color="warning" %}}
-MultiKueue is currently an alpha feature and disabled by default. Check the [Installation](/docs/installation/#change-the-feature-gates-configuration) guide for details on feature gate configuration.
+MultiKueue is currently a beta feature and enabled by default. Check the [Installation](/docs/installation/#change-the-feature-gates-configuration) guide for details on feature gate configuration.
{{% /alert %}}
diff --git a/site/content/en/docs/installation/_index.md b/site/content/en/docs/installation/_index.md
index e4600e880a3..1aece6e21b5 100644
--- a/site/content/en/docs/installation/_index.md
+++ b/site/content/en/docs/installation/_index.md
@@ -10,13 +10,13 @@ description: >
- [Before you begin](#before-you-begin)
- [Install a released version](#install-a-released-version)
- [Add metrics scraping for prometheus-operator](#add-metrics-scraping-for-prometheus-operator)
- - [Add visibility API to monitor pending workloads](#add-visibility-api-to-monitor-pending-workloads)
- [Uninstall](#uninstall)
- [Install a custom-configured released version](#install-a-custom-configured-released-version)
- [Install the latest development version](#install-the-latest-development-version)
- [Uninstall](#uninstall-1)
- [Build and install from source](#build-and-install-from-source)
- [Add metrics scraping for prometheus-operator](#add-metrics-scraping-for-prometheus-operator-1)
+ - [Add API Priority and Fairness configuration for the visibility API](#add-api-priority-and-fairness-configuration-for-the-visibility-api)
- [Uninstall](#uninstall-2)
- [Install via Helm](#install-via-helm)
- [Change the feature gates configuration](#change-the-feature-gates-configuration)
@@ -75,19 +75,9 @@ We can follow `https://prometheus-operator.dev/docs/prologue/quick-start/` to in
kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/prometheus.yaml
```
-### Add visibility API to monitor pending workloads
-
-{{< feature-state state="alpha" for_version="v0.6" >}}
-
-
-To add the visibility API that enables monitoring pending workloads, change [the feature gates configuration](/docs/installation/#change-the-feature-gates-configuration) and set `VisibilityOnDemand=true`, and run the following command
-
-```shell
-kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/visibility-api.yaml
-```
-
-See [the visibility API](/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand) for more details.
+### Add API Priority and Fairness configuration for the visibility API
+See [Configure API Priority and Fairness](/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/#configure-api-priority-and-fairness) for more details.
### Uninstall
@@ -243,22 +233,26 @@ spec:
The currently supported features are:
-| Feature | Default | Stage | Since | Until |
-|---------|---------|-------|-------|-------|
-| `FlavorFungibility` | `true` | Beta | 0.5 | |
-| `MultiKueue` | `false` | Alpha | 0.6 | |
-| `MultiKueueBatchJobWithManagedBy` | `false` | Alpha | 0.8 | |
-| `PartialAdmission` | `false` | Alpha | 0.4 | 0.4 |
-| `PartialAdmission` | `true` | Beta | 0.5 | |
-| `ProvisioningACC` | `false` | Alpha | 0.5 | 0.6 |
-| `ProvisioningACC` | `true` | Beta | 0.7 | |
-| `QueueVisibility` | `false` | Alpha | 0.5 | |
-| `VisibilityOnDemand` | `false` | Alpha | 0.6 | |
-| `PrioritySortingWithinCohort` | `true` | Beta | 0.6 | |
-| `LendingLimit` | `false` | Alpha | 0.6 | 0.8 |
-| `LendingLimit` | `true` | Beta | 0.9 | |
-| `MultiplePreemptions` | `false` | Alpha | 0.8 | 0.8 |
-| `MultiplePreemptions` | `true` | Beta | 0.9 | |
+| Feature | Default | Stage | Since | Until |
+|-----------------------------------|---------|------------|-------|-------|
+| `FlavorFungibility` | `true` | Beta | 0.5 | |
+| `MultiKueue` | `false` | Alpha | 0.6 | 0.8 |
+| `MultiKueue` | `true` | Beta | 0.9 | |
+| `MultiKueueBatchJobWithManagedBy` | `false` | Alpha | 0.8 | |
+| `PartialAdmission` | `false` | Alpha | 0.4 | 0.4 |
+| `PartialAdmission` | `true` | Beta | 0.5 | |
+| `ProvisioningACC` | `false` | Alpha | 0.5 | 0.6 |
+| `ProvisioningACC` | `true` | Beta | 0.7 | |
+| `QueueVisibility` | `false` | Alpha | 0.5 | 0.9 |
+| `QueueVisibility` | `false` | Deprecated | 0.9 | |
+| `VisibilityOnDemand` | `false` | Alpha | 0.6 | 0.8 |
+| `VisibilityOnDemand` | `true` | Beta | 0.9 | |
+| `PrioritySortingWithinCohort` | `true` | Beta | 0.6 | |
+| `LendingLimit` | `false` | Alpha | 0.6 | 0.8 |
+| `LendingLimit` | `true` | Beta | 0.9 | |
+| `MultiplePreemptions` | `false` | Alpha | 0.8 | 0.8 |
+| `MultiplePreemptions` | `true` | Beta | 0.9 | |
+| `TopologyAwareScheduling` | `false` | Alpha | 0.9 | |
## What's next
diff --git a/site/content/en/docs/overview/_index.md b/site/content/en/docs/overview/_index.md
index 0fe8c3f36e7..0baa7ffa980 100644
--- a/site/content/en/docs/overview/_index.md
+++ b/site/content/en/docs/overview/_index.md
@@ -43,7 +43,7 @@ A core design principle for Kueue is to avoid duplicating mature functionality i
| [MultiKueue](/docs/concepts/multikueue/) | + | + | | + | + | + | + | | | | |
| [MultiKueueBatchJobWithManagedBy](/docs/concepts/multikueue/#multikueuebatchjobwithmanagedby-enabled) | + | | | | | | | | | | |
| [PartialAdmission](/docs/tasks/run/jobs/#partial-admission) | + | | | | | | | | | | |
-| [Workload Priority Class](/docs/concepts/workload_priority_class/) | + | + | + | + | + | + | + | + | | + | + |
+| [Workload Priority Class](/docs/concepts/workload_priority_class/) | + | + | + | + | + | + | + | + | + | + | + |
| [FlavorFungibility](/docs/concepts/cluster_queue/#flavorfungibility) | + | + | + | + | + | + | + | + | + | + | + |
| [ProvisioningACC](/docs/admission-check-controllers/provisioning/) | + | + | + | + | + | + | + | + | + | + | + |
| [QueueVisibility](/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status/) | + | + | + | + | + | + | + | + | + | + | + |
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl.md
index 438f301affc..f337e311b51 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
@@ -204,12 +204,12 @@ Controls Kueue queueing manager
## See Also
* [kueuectl create](../kueuectl_create/) - Create a resource
-* [kueuectl delete](../kueuectl_delete/) - Pass-through "delete" to kubectl
-* [kueuectl describe](../kueuectl_describe/) - Pass-through "describe" to kubectl
-* [kueuectl edit](../kueuectl_edit/) - Pass-through "edit" to kubectl
-* [kueuectl get](../kueuectl_get/) - Pass-through "get" to kubectl
+* [kueuectl delete](../kueuectl_delete/) - Delete a resource
+* [kueuectl describe](../kueuectl_describe/) - Show details of a resource
+* [kueuectl edit](../kueuectl_edit/) - Edit a resource on the server
+* [kueuectl get](../kueuectl_get/) - Display a resource
* [kueuectl list](../kueuectl_list/) - Display resources
-* [kueuectl patch](../kueuectl_patch/) - Pass-through "patch" to kubectl
+* [kueuectl patch](../kueuectl_patch/) - Update fields of a resource
* [kueuectl resume](../kueuectl_resume/) - Resume the resource
* [kueuectl stop](../kueuectl_stop/) - Stop the resource
* [kueuectl version](../kueuectl_version/) - Prints the client version and the kueue controller manager image, if installed
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/_index.md
index 9c6c0438fcb..f52902e13e0 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/_index.md
@@ -7,7 +7,7 @@ no_list: true
## Synopsis
@@ -19,7 +19,7 @@ Create a resource
## Examples
```
- # Create local queue
+ # Create local queue
kueuectl create localqueue my-local-queue -c my-cluster-queue
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_clusterqueue.md
index db80abac428..b7e773399f7 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_clusterqueue.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
@@ -23,26 +23,26 @@ kueuectl create clusterqueue NAME [--cohort COHORT_NAME] [--queuing-strategy QUE
## Examples
```
- # Create a ClusterQueue
+ # Create a ClusterQueue
kueuectl create clusterqueue my-cluster-queue
# Create a ClusterQueue with cohort, namespace selector and other details
kueuectl create clusterqueue my-cluster-queue \
- --cohort cohortname \
- --queuing-strategy StrictFIFO \
- --namespace-selector fooX=barX,fooY=barY \
- --reclaim-within-cohort Any \
- --preemption-within-cluster-queue LowerPriority
+ --cohort cohortname \
+ --queuing-strategy StrictFIFO \
+ --namespace-selector fooX=barX,fooY=barY \
+ --reclaim-within-cohort Any \
+ --preemption-within-cluster-queue LowerPriority
# Create a ClusterQueue with nominal quota and one resource flavor named alpha
kueuectl create clusterqueue my-cluster-queue --nominal-quota "alpha:cpu=9;memory=36Gi"
# Create a ClusterQueue with multiple resource flavors named alpha and beta
kueuectl create clusterqueue my-cluster-queue \
- --cohort cohortname \
- --nominal-quota "alpha:cpu=9;memory=36Gi;nvidia.com/gpu=10,beta:cpu=18;memory=72Gi;nvidia.com/gpu=20" \
- --borrowing-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2" \
- --lending-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2"
+ --cohort cohortname \
+ --nominal-quota "alpha:cpu=9;memory=36Gi;nvidia.com/gpu=10,beta:cpu=18;memory=72Gi;nvidia.com/gpu=20" \
+ --borrowing-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2" \
+ --lending-limit "alpha:cpu=1;memory=1Gi;nvidia.com/gpu=1,beta:cpu=2;memory=2Gi;nvidia.com/gpu=2"
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_localqueue.md
index 1ac63c14b10..a160b84cf6f 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_localqueue.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
@@ -23,7 +23,7 @@ kueuectl create localqueue NAME -c CLUSTER_QUEUE_NAME [--ignore-unknown-cq] [--d
## Examples
```
- # Create a local queue
+ # Create a local queue
kueuectl create localqueue my-local-queue -c my-cluster-queue
# Create a local queue with unknown cluster queue
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_resourceflavor.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_resourceflavor.md
index ff79ce00478..a2ca65cda7e 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_resourceflavor.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_create/kueuectl_create_resourceflavor.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
@@ -23,20 +23,20 @@ kueuectl create resourceflavor NAME [--node-labels KEY=VALUE] [--node-taints KEY
## Examples
```
- # Create a resource flavor
+ # Create a resource flavor
kueuectl create resourceflavor my-resource-flavor
-
+
# Create a resource flavor with labels
kueuectl create resourceflavor my-resource-flavor \
- --node-labels beta.kubernetes.io/arch=arm64,beta.kubernetes.io/os=linux
-
-# Create a resource flavor with node taints
+ --node-labels beta.kubernetes.io/arch=arm64,beta.kubernetes.io/os=linux
+
+ # Create a resource flavor with node taints
kueuectl create resourceflavor my-resource-flavor \
- --node-taints key1=value:NoSchedule,key2:NoExecute
-
-# Create a resource flavor with tolerations
+ --node-taints key1=value:NoSchedule,key2:NoExecute
+
+ # Create a resource flavor with tolerations
kueuectl create resourceflavor my-resource-flavor \
- --tolerations key1=value:NoSchedule,key2:NoExecute,key3=value,key4,:PreferNoSchedule
+ --tolerations key1=value:NoSchedule,key2:NoExecute,key3=value,key4,:PreferNoSchedule
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/_index.md
index f174ed6eeaf..37b4b954f7d 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/_index.md
@@ -7,13 +7,13 @@ no_list: true
## Synopsis
-Pass-through "delete" to kubectl
+Delete a resource
## Options
@@ -216,8 +216,8 @@ Pass-through "delete" to kubectl
## See Also
* [kueuectl](../kueuectl/) - Controls Kueue queueing manager
-* [kueuectl delete clusterqueue](kueuectl_delete_clusterqueue/) - Pass-through "delete {clusterqueue [cq]}" to kubectl
-* [kueuectl delete localqueue](kueuectl_delete_localqueue/) - Pass-through "delete {localqueue [lq]}" to kubectl
-* [kueuectl delete resourceflavor](kueuectl_delete_resourceflavor/) - Pass-through "delete {resourceflavor [rf]}" to kubectl
-* [kueuectl delete workload](kueuectl_delete_workload/) - Pass-through "delete {workload [wl]}" to kubectl
+* [kueuectl delete clusterqueue](kueuectl_delete_clusterqueue/) - Pass-through "delete clusterqueue" to kubectl
+* [kueuectl delete localqueue](kueuectl_delete_localqueue/) - Pass-through "delete localqueue" to kubectl
+* [kueuectl delete resourceflavor](kueuectl_delete_resourceflavor/) - Pass-through "delete resourceflavor" to kubectl
+* [kueuectl delete workload](kueuectl_delete_workload/) - Delete the given Workload and its corresponding Job
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_clusterqueue.md
index 3ebcdab57b6..b63e0f0afc0 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_clusterqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "delete {clusterqueue [cq]}" to kubectl
+Pass-through "delete clusterqueue" to kubectl
```
kueuectl delete clusterqueue [flags]
@@ -219,5 +219,5 @@ kueuectl delete clusterqueue [flags]
## See Also
-* [kueuectl delete](../) - Pass-through "delete" to kubectl
+* [kueuectl delete](../) - Delete a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_localqueue.md
index 7036fde7542..0e6ca50db43 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_localqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "delete {localqueue [lq]}" to kubectl
+Pass-through "delete localqueue" to kubectl
```
kueuectl delete localqueue [flags]
@@ -219,5 +219,5 @@ kueuectl delete localqueue [flags]
## See Also
-* [kueuectl delete](../) - Pass-through "delete" to kubectl
+* [kueuectl delete](../) - Delete a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_resourceflavor.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_resourceflavor.md
index 76d8a8feed2..e8e6c930e4e 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_resourceflavor.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_resourceflavor.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "delete {resourceflavor [rf]}" to kubectl
+Pass-through "delete resourceflavor" to kubectl
```
kueuectl delete resourceflavor [flags]
@@ -219,5 +219,5 @@ kueuectl delete resourceflavor [flags]
## See Also
-* [kueuectl delete](../) - Pass-through "delete" to kubectl
+* [kueuectl delete](../) - Delete a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_workload.md
index 143050c71f1..7fc73be1c08 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_delete/kueuectl_delete_workload.md
@@ -7,16 +7,24 @@ no_list: false
## Synopsis
-Pass-through "delete {workload [wl]}" to kubectl
+If the Workload has associated Jobs, the command will prompt for deletion approval of the affected Jobs, and delete them. The Workload will then be asynchronously deleted by the garbage collector. If there are no associated Jobs, the command will directly delete the Workload.
```
-kueuectl delete workload [flags]
+kueuectl delete workload NAME [--yes] [--all] [--dry-run STRATEGY]
+```
+
+
+## Examples
+
+```
+ # Delete the Workload
+ kueuectl delete workload my-workload
```
@@ -29,6 +37,33 @@ kueuectl delete workload [flags]
+
+ --all |
+
+
+ |
+
+ Delete all Workloads, in the specified namespace.
+ |
+
+
+ -A, --all-namespaces |
+
+
+ |
+
+ If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
+ |
+
+
+ --dry-run string Default: "none" |
+
+
+ |
+
+ Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.
+ |
+
-h, --help |
@@ -38,6 +73,15 @@ kueuectl delete workload [flags]
help for workload
+
+ -y, --yes |
+
+
+ |
+
+ Automatic yes to the prompt for deleting the Workload.
+ |
+
@@ -219,5 +263,5 @@ kueuectl delete workload [flags]
## See Also
-* [kueuectl delete](../) - Pass-through "delete" to kubectl
+* [kueuectl delete](../) - Delete a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/_index.md
index 07bf4cd24ba..d745c9cc289 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/_index.md
@@ -7,13 +7,13 @@ no_list: true
## Synopsis
-Pass-through "describe" to kubectl
+Show details of a resource
## Options
@@ -216,8 +216,8 @@ Pass-through "describe" to kubectl
## See Also
* [kueuectl](../kueuectl/) - Controls Kueue queueing manager
-* [kueuectl describe clusterqueue](kueuectl_describe_clusterqueue/) - Pass-through "describe {clusterqueue [cq]}" to kubectl
-* [kueuectl describe localqueue](kueuectl_describe_localqueue/) - Pass-through "describe {localqueue [lq]}" to kubectl
-* [kueuectl describe resourceflavor](kueuectl_describe_resourceflavor/) - Pass-through "describe {resourceflavor [rf]}" to kubectl
-* [kueuectl describe workload](kueuectl_describe_workload/) - Pass-through "describe {workload [wl]}" to kubectl
+* [kueuectl describe clusterqueue](kueuectl_describe_clusterqueue/) - Pass-through "describe clusterqueue" to kubectl
+* [kueuectl describe localqueue](kueuectl_describe_localqueue/) - Pass-through "describe localqueue" to kubectl
+* [kueuectl describe resourceflavor](kueuectl_describe_resourceflavor/) - Pass-through "describe resourceflavor" to kubectl
+* [kueuectl describe workload](kueuectl_describe_workload/) - Pass-through "describe workload" to kubectl
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_clusterqueue.md
index 7fd882eec24..8a021ab0932 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_clusterqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "describe {clusterqueue [cq]}" to kubectl
+Pass-through "describe clusterqueue" to kubectl
```
kueuectl describe clusterqueue [flags]
@@ -219,5 +219,5 @@ kueuectl describe clusterqueue [flags]
## See Also
-* [kueuectl describe](../) - Pass-through "describe" to kubectl
+* [kueuectl describe](../) - Show details of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_localqueue.md
index 1967e7cf6de..81cba2d9edf 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_localqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "describe {localqueue [lq]}" to kubectl
+Pass-through "describe localqueue" to kubectl
```
kueuectl describe localqueue [flags]
@@ -219,5 +219,5 @@ kueuectl describe localqueue [flags]
## See Also
-* [kueuectl describe](../) - Pass-through "describe" to kubectl
+* [kueuectl describe](../) - Show details of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_resourceflavor.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_resourceflavor.md
index 9c65be54b83..df1779cfa4f 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_resourceflavor.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_resourceflavor.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "describe {resourceflavor [rf]}" to kubectl
+Pass-through "describe resourceflavor" to kubectl
```
kueuectl describe resourceflavor [flags]
@@ -219,5 +219,5 @@ kueuectl describe resourceflavor [flags]
## See Also
-* [kueuectl describe](../) - Pass-through "describe" to kubectl
+* [kueuectl describe](../) - Show details of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_workload.md
index ba2cd356bbe..fd01e1d89f0 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_describe/kueuectl_describe_workload.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "describe {workload [wl]}" to kubectl
+Pass-through "describe workload" to kubectl
```
kueuectl describe workload [flags]
@@ -219,5 +219,5 @@ kueuectl describe workload [flags]
## See Also
-* [kueuectl describe](../) - Pass-through "describe" to kubectl
+* [kueuectl describe](../) - Show details of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/_index.md
index 63e988d5d88..e6084a7dd2c 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/_index.md
@@ -7,13 +7,13 @@ no_list: true
## Synopsis
-Pass-through "edit" to kubectl
+Edit a resource on the server
## Options
@@ -216,8 +216,8 @@ Pass-through "edit" to kubectl
## See Also
* [kueuectl](../kueuectl/) - Controls Kueue queueing manager
-* [kueuectl edit clusterqueue](kueuectl_edit_clusterqueue/) - Pass-through "edit {clusterqueue [cq]}" to kubectl
-* [kueuectl edit localqueue](kueuectl_edit_localqueue/) - Pass-through "edit {localqueue [lq]}" to kubectl
-* [kueuectl edit resourceflavor](kueuectl_edit_resourceflavor/) - Pass-through "edit {resourceflavor [rf]}" to kubectl
-* [kueuectl edit workload](kueuectl_edit_workload/) - Pass-through "edit {workload [wl]}" to kubectl
+* [kueuectl edit clusterqueue](kueuectl_edit_clusterqueue/) - Pass-through "edit clusterqueue" to kubectl
+* [kueuectl edit localqueue](kueuectl_edit_localqueue/) - Pass-through "edit localqueue" to kubectl
+* [kueuectl edit resourceflavor](kueuectl_edit_resourceflavor/) - Pass-through "edit resourceflavor" to kubectl
+* [kueuectl edit workload](kueuectl_edit_workload/) - Pass-through "edit workload" to kubectl
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_clusterqueue.md
index 784af40833b..24d981ea1ea 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_clusterqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "edit {clusterqueue [cq]}" to kubectl
+Pass-through "edit clusterqueue" to kubectl
```
kueuectl edit clusterqueue [flags]
@@ -219,5 +219,5 @@ kueuectl edit clusterqueue [flags]
## See Also
-* [kueuectl edit](../) - Pass-through "edit" to kubectl
+* [kueuectl edit](../) - Edit a resource on the server
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_localqueue.md
index 26377670fca..71d159e60d7 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_localqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "edit {localqueue [lq]}" to kubectl
+Pass-through "edit localqueue" to kubectl
```
kueuectl edit localqueue [flags]
@@ -219,5 +219,5 @@ kueuectl edit localqueue [flags]
## See Also
-* [kueuectl edit](../) - Pass-through "edit" to kubectl
+* [kueuectl edit](../) - Edit a resource on the server
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_resourceflavor.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_resourceflavor.md
index 273059ff4f0..ecdd2d8c4d2 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_resourceflavor.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_resourceflavor.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "edit {resourceflavor [rf]}" to kubectl
+Pass-through "edit resourceflavor" to kubectl
```
kueuectl edit resourceflavor [flags]
@@ -219,5 +219,5 @@ kueuectl edit resourceflavor [flags]
## See Also
-* [kueuectl edit](../) - Pass-through "edit" to kubectl
+* [kueuectl edit](../) - Edit a resource on the server
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_workload.md
index 02c155d138f..a727414a823 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_edit/kueuectl_edit_workload.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "edit {workload [wl]}" to kubectl
+Pass-through "edit workload" to kubectl
```
kueuectl edit workload [flags]
@@ -219,5 +219,5 @@ kueuectl edit workload [flags]
## See Also
-* [kueuectl edit](../) - Pass-through "edit" to kubectl
+* [kueuectl edit](../) - Edit a resource on the server
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/_index.md
index 3d7a0c2fc8d..a55d665c925 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/_index.md
@@ -7,13 +7,13 @@ no_list: true
## Synopsis
-Pass-through "get" to kubectl
+Display a resource
## Options
@@ -216,8 +216,8 @@ Pass-through "get" to kubectl
## See Also
* [kueuectl](../kueuectl/) - Controls Kueue queueing manager
-* [kueuectl get clusterqueue](kueuectl_get_clusterqueue/) - Pass-through "get {clusterqueue [cq]}" to kubectl
-* [kueuectl get localqueue](kueuectl_get_localqueue/) - Pass-through "get {localqueue [lq]}" to kubectl
-* [kueuectl get resourceflavor](kueuectl_get_resourceflavor/) - Pass-through "get {resourceflavor [rf]}" to kubectl
-* [kueuectl get workload](kueuectl_get_workload/) - Pass-through "get {workload [wl]}" to kubectl
+* [kueuectl get clusterqueue](kueuectl_get_clusterqueue/) - Pass-through "get clusterqueue" to kubectl
+* [kueuectl get localqueue](kueuectl_get_localqueue/) - Pass-through "get localqueue" to kubectl
+* [kueuectl get resourceflavor](kueuectl_get_resourceflavor/) - Pass-through "get resourceflavor" to kubectl
+* [kueuectl get workload](kueuectl_get_workload/) - Pass-through "get workload" to kubectl
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_clusterqueue.md
index 0f723696404..827c5118842 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_clusterqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "get {clusterqueue [cq]}" to kubectl
+Pass-through "get clusterqueue" to kubectl
```
kueuectl get clusterqueue [flags]
@@ -219,5 +219,5 @@ kueuectl get clusterqueue [flags]
## See Also
-* [kueuectl get](../) - Pass-through "get" to kubectl
+* [kueuectl get](../) - Display a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_localqueue.md
index c2ce30ee558..460d28f06eb 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_localqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "get {localqueue [lq]}" to kubectl
+Pass-through "get localqueue" to kubectl
```
kueuectl get localqueue [flags]
@@ -219,5 +219,5 @@ kueuectl get localqueue [flags]
## See Also
-* [kueuectl get](../) - Pass-through "get" to kubectl
+* [kueuectl get](../) - Display a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_resourceflavor.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_resourceflavor.md
index c01d0e2fed9..9c8de9e75c8 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_resourceflavor.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_resourceflavor.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "get {resourceflavor [rf]}" to kubectl
+Pass-through "get resourceflavor" to kubectl
```
kueuectl get resourceflavor [flags]
@@ -219,5 +219,5 @@ kueuectl get resourceflavor [flags]
## See Also
-* [kueuectl get](../) - Pass-through "get" to kubectl
+* [kueuectl get](../) - Display a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_workload.md
index 37c2fcf756f..73e1a38c20e 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_get/kueuectl_get_workload.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "get {workload [wl]}" to kubectl
+Pass-through "get workload" to kubectl
```
kueuectl get workload [flags]
@@ -219,5 +219,5 @@ kueuectl get workload [flags]
## See Also
-* [kueuectl get](../) - Pass-through "get" to kubectl
+* [kueuectl get](../) - Display a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/_index.md
index a307addf05d..798d71b8887 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/_index.md
@@ -7,7 +7,7 @@ no_list: true
## Synopsis
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_clusterqueue.md
index 601b68fc789..d117e88f4ab 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_clusterqueue.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_localqueue.md
index 08d81932fe6..39afd2889e4 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_localqueue.md
@@ -7,15 +7,13 @@ no_list: false
## Synopsis
-Lists LocalQueues that match the given criteria: point to a specific CQ,
-being active/inactive, belonging to the specified namespace, matching
-the label selector or the field selector.
+Lists LocalQueues that match the given criteria: point to a specific CQ, being active/inactive, belonging to the specified namespace, matching the label selector or the field selector.
```
kueuectl list localqueue [-–clusterqueue CLUSTER_QUEUE_NAME] [--selector key1=value1] [--field-selector key1=value1] [--all-namespaces]
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_pods.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_pods.md
index 7e8a831b498..883ef90ded8 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_pods.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_pods.md
@@ -7,17 +7,15 @@ no_list: false
## Synopsis
-Lists all pods that matches the given criteria: should be part of the specified Job kind,
-belonging to the specified namespace, matching the label selector or the field selector.
-
-The --for=pod/pod-name option allows to find pods from the same pod group as the specified pod, including that pod itself.
+Lists all pods that matches the given criteria: should be part of the specified Job kind, belonging to the specified namespace, matching the label selector or the field selector.)
+ The --for=pod/pod-name option allows to find pods from the same pod group as the specified pod, including that pod itself.
```
kueuectl list pods --for TYPE[.API-GROUP]/NAME
@@ -27,10 +25,9 @@ kueuectl list pods --for TYPE[.API-GROUP]/NAME
## Examples
```
-
# List Pods for the Job
kueuectl list pods --for job/job-name
-
+
# List Pods for the Pod group
kueuectl list pods --for pod/pod-name
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_resourceflavor.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_resourceflavor.md
index cb7df230a74..3ecc93d5856 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_resourceflavor.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_resourceflavor.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_workload.md
index af1052510e0..62ede5b8b9d 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_list/kueuectl_list_workload.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
@@ -23,7 +23,7 @@ kueuectl list workload [--clusterqueue CLUSTER_QUEUE_NAME] [--localqueue LOCAL_Q
## Examples
```
- # List Workload
+ # List Workload
kueuectl list workload
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/_index.md
index 78cdcc9d394..a5ba4ea009c 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/_index.md
@@ -7,13 +7,13 @@ no_list: true
## Synopsis
-Pass-through "patch" to kubectl
+Update fields of a resource
## Options
@@ -216,8 +216,8 @@ Pass-through "patch" to kubectl
## See Also
* [kueuectl](../kueuectl/) - Controls Kueue queueing manager
-* [kueuectl patch clusterqueue](kueuectl_patch_clusterqueue/) - Pass-through "patch {clusterqueue [cq]}" to kubectl
-* [kueuectl patch localqueue](kueuectl_patch_localqueue/) - Pass-through "patch {localqueue [lq]}" to kubectl
-* [kueuectl patch resourceflavor](kueuectl_patch_resourceflavor/) - Pass-through "patch {resourceflavor [rf]}" to kubectl
-* [kueuectl patch workload](kueuectl_patch_workload/) - Pass-through "patch {workload [wl]}" to kubectl
+* [kueuectl patch clusterqueue](kueuectl_patch_clusterqueue/) - Pass-through "patch clusterqueue" to kubectl
+* [kueuectl patch localqueue](kueuectl_patch_localqueue/) - Pass-through "patch localqueue" to kubectl
+* [kueuectl patch resourceflavor](kueuectl_patch_resourceflavor/) - Pass-through "patch resourceflavor" to kubectl
+* [kueuectl patch workload](kueuectl_patch_workload/) - Pass-through "patch workload" to kubectl
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_clusterqueue.md
index b446727eee5..0fdd7c5c622 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_clusterqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "patch {clusterqueue [cq]}" to kubectl
+Pass-through "patch clusterqueue" to kubectl
```
kueuectl patch clusterqueue [flags]
@@ -219,5 +219,5 @@ kueuectl patch clusterqueue [flags]
## See Also
-* [kueuectl patch](../) - Pass-through "patch" to kubectl
+* [kueuectl patch](../) - Update fields of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_localqueue.md
index 9193dbeaae1..af81b94cf5e 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_localqueue.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "patch {localqueue [lq]}" to kubectl
+Pass-through "patch localqueue" to kubectl
```
kueuectl patch localqueue [flags]
@@ -219,5 +219,5 @@ kueuectl patch localqueue [flags]
## See Also
-* [kueuectl patch](../) - Pass-through "patch" to kubectl
+* [kueuectl patch](../) - Update fields of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_resourceflavor.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_resourceflavor.md
index c56210374cd..fa07133f239 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_resourceflavor.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_resourceflavor.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "patch {resourceflavor [rf]}" to kubectl
+Pass-through "patch resourceflavor" to kubectl
```
kueuectl patch resourceflavor [flags]
@@ -219,5 +219,5 @@ kueuectl patch resourceflavor [flags]
## See Also
-* [kueuectl patch](../) - Pass-through "patch" to kubectl
+* [kueuectl patch](../) - Update fields of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_workload.md
index 5b584a872ef..6c43db193d6 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_patch/kueuectl_patch_workload.md
@@ -7,13 +7,13 @@ no_list: false
## Synopsis
-Pass-through "patch {workload [wl]}" to kubectl
+Pass-through "patch workload" to kubectl
```
kueuectl patch workload [flags]
@@ -219,5 +219,5 @@ kueuectl patch workload [flags]
## See Also
-* [kueuectl patch](../) - Pass-through "patch" to kubectl
+* [kueuectl patch](../) - Update fields of a resource
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/_index.md
index f831f239a04..d2184ef52c8 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/_index.md
@@ -7,7 +7,7 @@ no_list: true
## Synopsis
@@ -19,7 +19,7 @@ Resume the resource
## Examples
```
- # Resume the workload
+ # Resume the workload
kueuectl resume workload my-workload
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_clusterqueue.md
index 3c644aeabba..82150eb3563 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_clusterqueue.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_localqueue.md
index a51444de2c5..02fca71b6e5 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_localqueue.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_workload.md
index 9f282eb8ed9..4fae4735383 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_resume/kueuectl_resume_workload.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
@@ -23,7 +23,7 @@ kueuectl resume workload NAME [--namespace NAMESPACE] [--dry-run STRATEGY]
## Examples
```
- # Resume the workload
+ # Resume the workload
kueuectl resume workload my-workload
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/_index.md
index 52711d38c70..70cea583e66 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/_index.md
@@ -7,7 +7,7 @@ no_list: true
## Synopsis
@@ -19,7 +19,7 @@ Stop the resource
## Examples
```
- # Stop the workload
+ # Stop the workload
kueuectl stop workload my-workload
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_clusterqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_clusterqueue.md
index f74fdcc9113..3b0cc566e3c 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_clusterqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_clusterqueue.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_localqueue.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_localqueue.md
index e7081beb4ab..f54672e9580 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_localqueue.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_localqueue.md
@@ -7,7 +7,7 @@ no_list: false
## Synopsis
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_workload.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_workload.md
index 2bc11b767c3..7b7cc2e0eba 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_workload.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_stop/kueuectl_stop_workload.md
@@ -7,15 +7,13 @@ no_list: false
## Synopsis
-Puts the given Workload on hold. The Workload will not be admitted and
-if it is already admitted it will be put back to queue just as if it
-was preempted (using .spec.active field).
+Puts the given Workload on hold. The Workload will not be admitted and if it is already admitted it will be put back to queue just as if it was preempted (using .spec.active field).
```
kueuectl stop workload NAME [--namespace NAMESPACE] [--dry-run STRATEGY]
@@ -25,7 +23,7 @@ kueuectl stop workload NAME [--namespace NAMESPACE] [--dry-run STRATEGY]
## Examples
```
- # Stop the workload
+ # Stop the workload
kueuectl stop workload my-workload
```
diff --git a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_version/_index.md b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_version/_index.md
index 67cae880181..c9a19a529dd 100644
--- a/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_version/_index.md
+++ b/site/content/en/docs/reference/kubectl-kueue/commands/kueuectl_version/_index.md
@@ -7,7 +7,7 @@ no_list: true
## Synopsis
diff --git a/site/content/en/docs/reference/kueue-alpha.v1alpha1.md b/site/content/en/docs/reference/kueue-alpha.v1alpha1.md
index e759b679f2d..6e571fe6d6f 100644
--- a/site/content/en/docs/reference/kueue-alpha.v1alpha1.md
+++ b/site/content/en/docs/reference/kueue-alpha.v1alpha1.md
@@ -10,70 +10,8 @@ description: Generated API reference documentation for kueue.x-k8s.io/v1alpha1.
## Resource Types
-- [MultiKueueCluster](#kueue-x-k8s-io-v1alpha1-MultiKueueCluster)
-- [MultiKueueConfig](#kueue-x-k8s-io-v1alpha1-MultiKueueConfig)
-## `MultiKueueCluster` {#kueue-x-k8s-io-v1alpha1-MultiKueueCluster}
-
-
-**Appears in:**
-
-
-
-MultiKueueCluster is the Schema for the multikueue API
-
-
-
-Field | Description |
-
-
-apiVersion string | kueue.x-k8s.io/v1alpha1 |
-kind string | MultiKueueCluster |
-
-
-spec [Required]
-MultiKueueClusterSpec
- |
-
- No description provided. |
-
-status [Required]
-MultiKueueClusterStatus
- |
-
- No description provided. |
-
-
-
-
-## `MultiKueueConfig` {#kueue-x-k8s-io-v1alpha1-MultiKueueConfig}
-
-
-**Appears in:**
-
-
-
-MultiKueueConfig is the Schema for the multikueue API
-
-
-
-Field | Description |
-
-
-apiVersion string | kueue.x-k8s.io/v1alpha1 |
-kind string | MultiKueueConfig |
-
-
-spec [Required]
-MultiKueueConfigSpec
- |
-
- No description provided. |
-
-
-
-
## `Cohort` {#kueue-x-k8s-io-v1alpha1-Cohort}
@@ -81,7 +19,9 @@ description: Generated API reference documentation for kueue.x-k8s.io/v1alpha1.
-Cohort is the Schema for the cohorts API
+Cohort is the Schema for the cohorts API. Using Hierarchical
+Cohorts (any Cohort which has a parent) with Fair Sharing
+results in undefined behavior in 0.9
@@ -183,122 +123,4 @@ will be rejected by the webhook.
-
-## `KubeConfig` {#kueue-x-k8s-io-v1alpha1-KubeConfig}
-
-
-**Appears in:**
-
-- [MultiKueueClusterSpec](#kueue-x-k8s-io-v1alpha1-MultiKueueClusterSpec)
-
-
-
-
-Field | Description |
-
-
-
-location [Required]
-string
- |
-
- Location of the KubeConfig.
-If LocationType is Secret then Location is the name of the secret inside the namespace in
-which the kueue controller manager is running. The config should be stored in the "kubeconfig" key.
- |
-
-locationType [Required]
-LocationType
- |
-
- Type of the KubeConfig location.
- |
-
-
-
-
-## `LocationType` {#kueue-x-k8s-io-v1alpha1-LocationType}
-
-(Alias of `string`)
-
-**Appears in:**
-
-- [KubeConfig](#kueue-x-k8s-io-v1alpha1-KubeConfig)
-
-
-
-
-
-## `MultiKueueClusterSpec` {#kueue-x-k8s-io-v1alpha1-MultiKueueClusterSpec}
-
-
-**Appears in:**
-
-- [MultiKueueCluster](#kueue-x-k8s-io-v1alpha1-MultiKueueCluster)
-
-
-
-
-Field | Description |
-
-
-
-kubeConfig [Required]
-KubeConfig
- |
-
- Information how to connect to the cluster.
- |
-
-
-
-
-## `MultiKueueClusterStatus` {#kueue-x-k8s-io-v1alpha1-MultiKueueClusterStatus}
-
-
-**Appears in:**
-
-- [MultiKueueCluster](#kueue-x-k8s-io-v1alpha1-MultiKueueCluster)
-
-
-
-
-
-## `MultiKueueConfigSpec` {#kueue-x-k8s-io-v1alpha1-MultiKueueConfigSpec}
-
-
-**Appears in:**
-
-- [MultiKueueConfig](#kueue-x-k8s-io-v1alpha1-MultiKueueConfig)
-
-
-MultiKueueConfigSpec defines the desired state of MultiKueueConfig
-
-
-
-Field | Description |
-
-
-
-clusters [Required]
-[]string
- |
-
- List of MultiKueueClusters names where the workloads from the ClusterQueue should be distributed.
- |
-
-
-
\ No newline at end of file
diff --git a/site/content/en/docs/reference/kueue-config.v1beta1.md b/site/content/en/docs/reference/kueue-config.v1beta1.md
index 4b61b3a9ad9..529e2d157ff 100644
--- a/site/content/en/docs/reference/kueue-config.v1beta1.md
+++ b/site/content/en/docs/reference/kueue-config.v1beta1.md
@@ -153,7 +153,10 @@ integrations (including K8S job).
fairSharing
@@ -1121,6 +1186,39 @@ There could be up to 16 resources.
+## `KubeConfig` {#kueue-x-k8s-io-v1beta1-KubeConfig}
+
+
+**Appears in:**
+
+- [MultiKueueClusterSpec](#kueue-x-k8s-io-v1beta1-MultiKueueClusterSpec)
+
+
+
+
+Field | Description |
+
+
+
+location [Required]
+string
+ |
+
+ Location of the KubeConfig.
+If LocationType is Secret then Location is the name of the secret inside the namespace in
+which the kueue controller manager is running. The config should be stored in the "kubeconfig" key.
+ |
+
+locationType [Required]
+LocationType
+ |
+
+ Type of the KubeConfig location.
+ |
+
+
+
+
## `LocalQueueFlavorUsage` {#kueue-x-k8s-io-v1beta1-LocalQueueFlavorUsage}
@@ -1289,6 +1387,91 @@ workloads assigned to this LocalQueue.
+## `LocationType` {#kueue-x-k8s-io-v1beta1-LocationType}
+
+(Alias of `string`)
+
+**Appears in:**
+
+- [KubeConfig](#kueue-x-k8s-io-v1beta1-KubeConfig)
+
+
+
+
+
+## `MultiKueueClusterSpec` {#kueue-x-k8s-io-v1beta1-MultiKueueClusterSpec}
+
+
+**Appears in:**
+
+- [MultiKueueCluster](#kueue-x-k8s-io-v1beta1-MultiKueueCluster)
+
+
+
+
+Field | Description |
+
+
+
+kubeConfig [Required]
+KubeConfig
+ |
+
+ Information how to connect to the cluster.
+ |
+
+
+
+
+## `MultiKueueClusterStatus` {#kueue-x-k8s-io-v1beta1-MultiKueueClusterStatus}
+
+
+**Appears in:**
+
+- [MultiKueueCluster](#kueue-x-k8s-io-v1beta1-MultiKueueCluster)
+
+
+
+
+
+## `MultiKueueConfigSpec` {#kueue-x-k8s-io-v1beta1-MultiKueueConfigSpec}
+
+
+**Appears in:**
+
+- [MultiKueueConfig](#kueue-x-k8s-io-v1beta1-MultiKueueConfig)
+
+
+MultiKueueConfigSpec defines the desired state of MultiKueueConfig
+
+
+
+Field | Description |
+
+
+
+clusters [Required]
+[]string
+ |
+
+ List of MultiKueueClusters names where the workloads from the ClusterQueue should be distributed.
+ |
+
+
+
+
## `Parameter` {#kueue-x-k8s-io-v1beta1-Parameter}
(Alias of `string`)
diff --git a/site/content/en/docs/reference/labels-and-annotations.md b/site/content/en/docs/reference/labels-and-annotations.md
new file mode 100644
index 00000000000..7602c929f30
--- /dev/null
+++ b/site/content/en/docs/reference/labels-and-annotations.md
@@ -0,0 +1,169 @@
+---
+title: "Labels and Annotations"
+linkTitle: "Labels and Annotations"
+date: 2024-10-09
+---
+
+This page serves as a reference for all labels and annotations in Kueue.
+
+
+### kueue.x-k8s.io/is-group-workload
+
+Type: Annotation
+
+Example: `kueue.x-k8s.io/is-group-workload: "true"`
+
+Used on: [Workload](/docs/concepts/workload/).
+
+The annotation key indicates that this workload is used for a group of Pods.
+
+
+### kueue.x-k8s.io/job-completions-equal-parallelism
+
+Type: Annotation
+
+Example: `kueue.x-k8s.io/job-completions-equal-parallelism: "true"`
+
+Used on: [batch/Job](/docs/tasks/run/jobs/).
+
+The annotation key is used to keep `completions` and `parallelism` in sync
+
+
+### kueue.x-k8s.io/job-min-parallelism
+
+Type: Annotation
+
+Example: `kueue.x-k8s.io/job-min-parallelism: "5"`
+
+Used on: [batch/Job](/docs/tasks/run/jobs/).
+
+The annotation key indicates the minimum `parallelism` acceptable for the job in the case of partial admission.
+
+
+### kueue.x-k8s.io/job-uid
+
+Type: Label
+
+Example: `kueue.x-k8s.io/job-uid: "46ef6b23-a7d9-42b1-b0f8-071bbb29a94d"`
+
+Used on: [Workload](/docs/concepts/workload/).
+
+The label key in the workload resource holds the UID of the owner job.
+
+
+### kueue.x-k8s.io/managed
+
+Type: Label
+
+Example: `kueue.x-k8s.io/managed: "true"`
+
+Used on: [Plain Pods](/docs/tasks/run/plain_pods/).
+
+The label key that indicates which pods are managed by Kueuue.
+
+
+### kueue.x-k8s.io/multikueue-origin
+
+Type: Label
+
+Example: `kueue.x-k8s.io/multikueue-origin: "true"`
+
+Used on: [MultiKueue](/docs/concepts/multikueue/).
+
+The label key is used to track the creator of MultiKueue remote objects in Worker Cluster.
+
+
+### kueue.x-k8s.io/pod-group-name
+
+Type: Label
+
+Example: `kueue.x-k8s.io/pod-group-name: "my-pod-group-name"`
+
+Used on: [Plain Pods](/docs/tasks/run/plain_pods/).
+
+The label key indicates the name of the group of Pods that should be admitted together.
+
+
+### kueue.x-k8s.io/pod-group-total-count
+
+Type: Annotation
+
+Example: `kueue.x-k8s.io/pod-group-total-count: "2"`
+
+Used on: [Plain Pods](/docs/tasks/run/plain_pods/).
+
+The annotation key is used to indicate how many Pods to expect in the group.
+
+
+### kueue.x-k8s.io/prebuilt-workload-name
+
+Type: Label
+
+Example: `kueue.x-k8s.io/prebuilt -workload-name: "my-prebuild-workload-name"`
+
+Used on: Kueue-managed Jobs.
+
+The label key of the job holds the name of the pre-built workload to be used.
+
+
+### kueue.x-k8s.io/priority-class
+
+Type: Label
+
+Example: `kueue.x-k8s.io/priority-class: "my-priority-class-name"`
+
+Used on: Kueue-managed Jobs.
+
+The label key in the workload holds the `workloadPriorityClass` name.
+This label is always mutable, as it may be useful for preemption.
+For more details, see [Workload Priority Class](/docs/concepts/workload_priority_class/).
+
+
+### kueue.x-k8s.io/queue-name
+
+Type: Label
+
+Example: `kueue.x-k8s.io/queue-name: "my-local-queue"`
+
+Used on: Kueue-managed Jobs.
+
+The label key in the workload holds the queue name.
+
+
+### kueue.x-k8s.io/queue-name (deprecated)
+
+Type: Annotation
+
+Example: `kueue.x-k8s.io/queue-name: "my-local-queue"`
+
+Used on: Kueue-managed Jobs.
+
+The annotation key in the workload holds the queue name.
+
+{{% alert title="Warning" color="warning" %}}
+Starting from `v1beta1` this annotation is deprecated.
+Please use [kueue.x-k8s.io/queue-name label](#kueuex-k8sioqueue-name) instead.
+{{% /alert %}}
+
+
+### kueue.x-k8s.io/retriable-in-group
+
+Type: Annotation
+
+Example: `kueue.x-k8s.io/retriable-in-group: "false"`
+
+Used on: [Plain Pods](/docs/tasks/run/plain_pods/).
+
+The annotation key is used to finalize the group if at least one terminated Pod (either Failed or Succeeded)
+has the `retriable-in-group: false` annotation.
+
+
+### kueue.x-k8s.io/role-hash
+
+Type: Annotation
+
+Example: `kueue.x-k8s.io/role-hash: "b54683bb"`
+
+Used on: [Plain Pods](/docs/tasks/run/plain_pods/).
+
+The annotation key is used as the name for a Workload podSet.
diff --git a/site/content/en/docs/reference/metrics.md b/site/content/en/docs/reference/metrics.md
index a2408de0e2a..58102f46158 100644
--- a/site/content/en/docs/reference/metrics.md
+++ b/site/content/en/docs/reference/metrics.md
@@ -13,34 +13,34 @@ of the system and the status of [ClusterQueues](/docs/concepts/cluster_queue).
Use the following metrics to monitor the health of the kueue controllers:
-| Metric name | Type | Description | Labels |
-| ----------- | ---- | ----------- | ------ |
-| `kueue_admission_attempts_total` | Counter | The total number of attempts to [admit](/docs/concepts#admission) workloads. Each admission attempt might try to admit more than one workload. | `result`: possible values are `success` or `inadmissible` |
-| `kueue_admission_attempt_duration_seconds` | Histogram | The latency of an admission attempt. | `result`: possible values are `success` or `inadmissible` |
+| Metric name | Type | Description | Labels |
+|--------------------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
+| `kueue_admission_attempts_total` | Counter | The total number of attempts to [admit](/docs/concepts#admission) workloads. Each admission attempt might try to admit more than one workload. | `result`: possible values are `success` or `inadmissible` |
+| `kueue_admission_attempt_duration_seconds` | Histogram | The latency of an admission attempt. | `result`: possible values are `success` or `inadmissible` |
## ClusterQueue status
Use the following metrics to monitor the status of your ClusterQueues:
-| Metric name | Type | Description | Labels |
-| ----------- | ---- | ----------- | ------ |
-| `kueue_pending_workloads` | Gauge | The number of pending workloads. | `cluster_queue`: the name of the ClusterQueue `status`: possible values are `active` or `inadmissible` |
-| `kueue_quota_reserved_workloads_total` | Counter | The total number of quota reserved workloads. | `cluster_queue`: the name of the ClusterQueue |
-| `kueue_quota_reserved_wait_time_seconds` | Histogram | The time between a workload was created or requeued until it got quota reservation. | `cluster_queue`: the name of the ClusterQueue |
-| `kueue_admitted_workloads_total` | Counter | The total number of admitted workloads. | `cluster_queue`: the name of the ClusterQueue |
-| `kueue_evicted_workloads_total` | Counter | The total number of evicted workloads. | `cluster_queue`: the name of the ClusterQueue `reason`: Possible values are `Preempted`, `PodsReadyTimeout`, `AdmissionCheck`, `ClusterQueueStopped` or `InactiveWorkload` |
-| `kueue_admission_wait_time_seconds` | Histogram | The time between a workload was created or requeued until admission. | `cluster_queue`: the name of the ClusterQueue |
-| `kueue_admission_checks_wait_time_seconds` | Histogram | The time from when a workload got the quota reservation until admission. | `cluster_queue`: the name of the ClusterQueue |
-| `kueue_admitted_active_workloads` | Gauge | The number of admitted Workloads that are active (unsuspended and not finished) | `cluster_queue`: the name of the ClusterQueue |
-| `kueue_cluster_queue_status` | Gauge | Reports the status of the ClusterQueue | `cluster_queue`: The name of the ClusterQueue `status`: Possible values are `pending`, `active` or `terminated`. For a ClusterQueue, the metric only reports a value of 1 for one of the statuses. |
+| Metric name | Type | Description | Labels |
+|--------------------------------------------|-----------|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `kueue_pending_workloads` | Gauge | The number of pending workloads. | `cluster_queue`: the name of the ClusterQueue `status`: possible values are `active` or `inadmissible` |
+| `kueue_quota_reserved_workloads_total` | Counter | The total number of quota reserved workloads. | `cluster_queue`: the name of the ClusterQueue |
+| `kueue_quota_reserved_wait_time_seconds` | Histogram | The time between a workload was created or requeued until it got quota reservation. | `cluster_queue`: the name of the ClusterQueue |
+| `kueue_admitted_workloads_total` | Counter | The total number of admitted workloads. | `cluster_queue`: the name of the ClusterQueue |
+| `kueue_evicted_workloads_total` | Counter | The total number of evicted workloads. | `cluster_queue`: the name of the ClusterQueue `reason`: Possible values are `Preempted`, `PodsReadyTimeout`, `AdmissionCheck`, `ClusterQueueStopped` or `InactiveWorkload` |
+| `kueue_admission_wait_time_seconds` | Histogram | The time between a workload was created or requeued until admission. | `cluster_queue`: the name of the ClusterQueue |
+| `kueue_admission_checks_wait_time_seconds` | Histogram | The time from when a workload got the quota reservation until admission. | `cluster_queue`: the name of the ClusterQueue |
+| `kueue_admitted_active_workloads` | Gauge | The number of admitted Workloads that are active (unsuspended and not finished) | `cluster_queue`: the name of the ClusterQueue |
+| `kueue_cluster_queue_status` | Gauge | Reports the status of the ClusterQueue | `cluster_queue`: The name of the ClusterQueue `status`: Possible values are `pending`, `active` or `terminated`. For a ClusterQueue, the metric only reports a value of 1 for one of the statuses. |
### Optional metrics
The following metrics are available only if `metrics.enableClusterQueueResources` is enabled in the [manager's configuration](/docs/installation/#install-a-custom-configured-released-version).
-| Metric name | Type | Description | Labels |
-| ----------- | ---- | ----------- | ------ |
-| `kueue_cluster_queue_resource_usage` | Gauge | Reports the ClusterQueue's total resource usage |`cohort`: The cohort in which the queue belongs `cluster_queue`: The name of the ClusterQueue `flavor`: referenced flavor `resource`: The resource name|
-| `kueue_cluster_queue_nominal_quota` | Gauge | Reports the ClusterQueue's resource quota |`cohort`: The cohort in which the queue belongs `cluster_queue`: The name of the ClusterQueue `flavor`: referenced flavor `resource`: The resource name|
-| `kueue_cluster_queue_borrowing_limit` | Gauge | Reports the ClusterQueue's resource borrowing limit |`cohort`: The cohort in which the queue belongs `cluster_queue`: The name of the ClusterQueue `flavor`: referenced flavor `resource`: The resource name|
-| `kueue_cluster_queue_weighted_share` | Gauge | Reports a value that representing the maximum of the ratios of usage above nominal quota to the lendable resources in the cohort, among all the resources provided by the ClusterQueue. |`cluster_queue`: The name of the ClusterQueue|
+| Metric name | Type | Description | Labels |
+|---------------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `kueue_cluster_queue_resource_usage` | Gauge | Reports the ClusterQueue's total resource usage | `cohort`: The cohort in which the queue belongs `cluster_queue`: The name of the ClusterQueue `flavor`: referenced flavor `resource`: The resource name |
+| `kueue_cluster_queue_nominal_quota` | Gauge | Reports the ClusterQueue's resource quota | `cohort`: The cohort in which the queue belongs `cluster_queue`: The name of the ClusterQueue `flavor`: referenced flavor `resource`: The resource name |
+| `kueue_cluster_queue_borrowing_limit` | Gauge | Reports the ClusterQueue's resource borrowing limit | `cohort`: The cohort in which the queue belongs `cluster_queue`: The name of the ClusterQueue `flavor`: referenced flavor `resource`: The resource name |
+| `kueue_cluster_queue_weighted_share` | Gauge | Reports a value that representing the maximum of the ratios of usage above nominal quota to the lendable resources in the cohort, among all the resources provided by the ClusterQueue. | `cluster_queue`: The name of the ClusterQueue |
diff --git a/site/content/en/docs/tasks/_index.md b/site/content/en/docs/tasks/_index.md
index dc11bb07fc3..5b1753d5b0f 100755
--- a/site/content/en/docs/tasks/_index.md
+++ b/site/content/en/docs/tasks/_index.md
@@ -43,6 +43,7 @@ As a batch user, you can learn how to:
- [Submit Kueue jobs from Python](run/python_jobs).
- [Run a Kueue managed plain Pod](run/plain_pods).
- [Run a Kueue managed JobSet](run/jobsets).
+- [Submit jobs to MultiKueue](run/multikueue).
### Serving user
@@ -59,6 +60,7 @@ A _platform developer_ integrates Kueue with other software and/or contributes t
As a platform developer, you can learn how to:
- [Integrate a custom Job with Kueue](dev/integrate_a_custom_job).
- [Enable pprof endpoints](dev/enabling_pprof_endpoints).
+- [Develop a custom AdmissionCheck Controller](dev/develop-acc).
## Troubleshooting
diff --git a/site/content/en/docs/tasks/dev/develop-acc.md b/site/content/en/docs/tasks/dev/develop-acc.md
new file mode 100644
index 00000000000..c9f6dda1fe4
--- /dev/null
+++ b/site/content/en/docs/tasks/dev/develop-acc.md
@@ -0,0 +1,49 @@
+---
+title: "Develop an AdmissionCheck Controller"
+date: 2024-09-03
+weight: 9
+description: >
+ Develop an AdmissionCheck Controller (ACC).
+---
+
+An Admission Check Controller, referred to as **ACC** in the rest of the doc, is a component that manages the AdmissionChecks associated with it (given by the corresponding value of `spec.controllerName`) and the workloads queued against ClusterQueues configured to use those AdmissionChecks.
+
+Read [Admission Check](/docs/concepts/admission_check/) to learn more about the mechanism from a user perspective.
+
+
+## Subcomponents
+
+The ACC can be built-in into Kueue or run in a different kubernetes controller manager and should implement reconcilers for AdmissionChecks and Workloads.
+
+### AdmissionCheck Reconciler
+
+Monitors the AdmissionChecks in the cluster and maintains the `Active` condition of those that are associated with it (by `spec.controllerName`).
+
+Optionally, it can watch custom [parameters](/docs/reference/kueue.v1beta1/#kueue-x-k8s-io-v1beta1-AdmissionCheckParametersReference) objects.
+
+The [Provisioning Admission Check Controller](/docs/admission-check-controllers/provisioning/) implements this in `pkg/controller/admissionchecks/provisioning/admissioncheck_reconciler.go`
+
+### Workload Reconciler
+
+It is in charge of maintaining the [AdmissionCheckStates](/docs/concepts/admission_check/#admissioncheckstates) of individual workloads
+based on the ACC's custom logic. It can either allow the admission, requeue or fail the workload.
+
+The [Provisioning Admission Check Controller](/docs/admission-check-controllers/provisioning/) implements this in `pkg/controller/admissionchecks/provisioning/controller.go`
+
+### Parameters Object Type
+Optionally, you can define a cluster level object type to hold the Admission Check parameters specific to your implementation.
+Users can reference instances of this object type in the AdmissionCheck definition in [spec.parameters](/docs/reference/kueue.v1beta1/#kueue-x-k8s-io-v1beta1-AdmissionCheckParametersReference).
+
+For example, the [Provisioning Admission Check Controller](/docs/admission-check-controllers/provisioning/) uses [ProvisioningRequestConfig](/docs/reference/kueue.v1beta1/#kueue-x-k8s-io-v1beta1-ProvisioningRequestConfig) for this purpose.
+
+## Utility Code
+
+`pkg/util/admissioncheck` provides helper code that can be used to interact with AdmissionCheck's parameters and more.
+
+## Examples
+
+Currently there are two ACCs implemented into kueue:
+
+- [Provisioning Admission Check Controller](/docs/admission-check-controllers/provisioning/) is implemented in `pkg/controller/admissionchecks/provisioning` and implements the Kueue's integration with [Kubernetes cluster-autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) [ProvisioningRequests](https://github.com/kubernetes/autoscaler/blob/4872bddce2bcc5b4a5f6a3d569111c11b8a2baf4/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/types.go#L41).
+- [MultiKueue](/docs/concepts/multikueue/), the Kueue's multi-cluster support is implemented as an AdmissionCheck Controller in `/pkg/controller/admissionchecks/multikueue`.
+
diff --git a/site/content/en/docs/tasks/dev/integrate_a_custom_job.md b/site/content/en/docs/tasks/dev/integrate_a_custom_job.md
index 614a7442115..ca11fdd7bb6 100644
--- a/site/content/en/docs/tasks/dev/integrate_a_custom_job.md
+++ b/site/content/en/docs/tasks/dev/integrate_a_custom_job.md
@@ -75,6 +75,22 @@ set the initial suspend status of created jobs and validate invariants.
Add testing files for both the controller and the webhook. You can check the test files in the other subfolders of `./pkg/controller/jobs/`
to learn how to implement them.
+### Developing a mutation and validation webhook
+
+Once you have implemented the `GenericJob` interface, you can register a webhook for the type by using
+the `BaseWebhookFactory` in `pkg/controller/jobframework`. This webhook ensures that a job is created
+in a suspended state and that queue names don't change when the job is admitted. You can read the
+[MPIJob](https://github.com/kubernetes-sigs/kueue/tree/main/pkg/controller/jobs/mpijob) integration as an example.
+
+For certain use cases, you might need to register a dedicated webhook. In this case, you should use
+Kueue's `LosslessDefaulter`, which ensures that the defaulter is compatible with future versions of the
+CRD, under the assumption that the defaulter does **not** remove any fields from the original object.
+You can read the [BatchJob](https://github.com/kubernetes-sigs/kueue/tree/main/pkg/controller/jobs/job)
+integration as an example for how to use a `LosslessDefaulter`.
+
+If the suggestions above are incompatible with your use case, beware of potential
+[problems when using controller-runtime's CustomDefaulter](https://groups.google.com/a/kubernetes.io/g/wg-batch/c/WAaabCuGCoY).
+
### Adjust build system
Add required dependencies to compile your code. For example, using `go get github.com/kubeflow/mpi-operator@0.4.0`.
@@ -85,31 +101,48 @@ Update the [Makefile](https://github.com/kubernetes-sigs/kueue/blob/main/Makefil
## Building an External Integration
+Building an external integration is similar to building a built-in integration, except that
+you will instantiate Kueue's `jobframework` for your CRD in a separate executable. The only
+change you will make to the primary Kueue manager is a deployment-time configuration change
+to enable it to recognize that your CRD is being managed by a Kueue-compatible manager.
+
Here are completed external integrations you can learn from:
- [AppWrapper](https://github.com/project-codeflare/appwrapper)
### Registration
-Add your framework's GroupVersionKind to `.integrations.externalFrameworks` in [controller_manager_config.yaml](
+Configure Kueue by adding your framework's GroupVersionKind to `.integrations.externalFrameworks` in [controller_manager_config.yaml](
https://kueue.sigs.k8s.io/docs/installation/#install-a-custom-configured-released-version).
-### RBAC Augmentation
+### Job Framework
-Kueue will need permission to get, list, and watch instances of your CRD.
+Make the following changes to an existing controller-runtime based manager for your CRD.
-If you are building a custom Kueue deployment, simply add a `kubebuilder:rbac` annotation to a source code file
-(for example in [integrationmanager.go](https://github.com/kubernetes-sigs/kueue/blob/main/pkg/controller/jobframework/integrationmanager.go)) and regenerate the manifests.
+Add a dependency on Kueue to your `go.mod` so you can import `jobframework` as a go library.
-If you are deploying a Kueue release, modify either
-[charts/kueue/templates/rbac/role.yaml](https://github.com/kubernetes-sigs/kueue/blob/main/charts/kueue/templates/rbac/role.yaml)
-or [config/components/rbac/role.yaml](https://github.com/kubernetes-sigs/kueue/blob/main/config/components/rbac/role.yaml)
-to add the needed permissions.
+In a new `mycrd_workload_controller.go` file, implement the `GenericJob` interface, and other optional [interfaces defined by the framework](https://github.com/kubernetes-sigs/kueue/blob/main/pkg/controller/jobframework/interface.go).
-### Job Framework
+Extend the existing webhook for your CRD to invoke Kueue's webhook helper methods:
+ - Your defaulter should invoke `jobframework.ApplyDefaultForSuspend` in [defaults.go](https://github.com/kubernetes-sigs/kueue/blob/main/pkg/controller/jobframework/defaults.go)
+ - Your validator should invoke `jobframework.ValidateJobOnCreate` and `jobframework.ValidateJobOnUpdate` in [validation.go](https://github.com/kubernetes-sigs/kueue/blob/main/pkg/controller/jobframework/validation.go)
+
+Extend your manager's startup procedure to do the following:
+ - Using the `jobframework.NewGenericReconcilerFactory` method, create an instance of Kueue's JobReconicler
+ for your CRD and register it with the controller-runtime manager.
+ - Invoke `jobframework.SetupWorkloadOwnerIndex` to create an indexer for Workloads owned by your CRD.
+
+Extend your existing RBAC Authorizations to include the privileges needed by
+Kueue's JobReconciler:
+```go
+// +kubebuilder:rbac:groups=scheduling.k8s.io,resources=priorityclasses,verbs=list;get;watch
+// +kubebuilder:rbac:groups="",resources=events,verbs=create;watch;update;patch
+// +kubebuilder:rbac:groups=kueue.x-k8s.io,resources=workloads,verbs=get;list;watch;create;update;patch;delete
+// +kubebuilder:rbac:groups=kueue.x-k8s.io,resources=workloads/status,verbs=get;update;patch
+// +kubebuilder:rbac:groups=kueue.x-k8s.io,resources=workloads/finalizers,verbs=update
+// +kubebuilder:rbac:groups=kueue.x-k8s.io,resources=resourceflavors,verbs=get;list;watch
+// +kubebuilder:rbac:groups=kueue.x-k8s.io,resources=workloadpriorityclasses,verbs=get;list;watch
-Add a dependency on Kueue to your `go.mod`, import the `jobframework` and use it as described above to
-create your controller and webhook implementations. In the `main` function of your controller, instantiate the controller-runtime manager
-and register your webhook, indexer, and controller.
+```
For a concrete example, consult these pieces of the AppWrapper controller:
- [workload_controller.go](https://github.com/project-codeflare/appwrapper/blob/main/internal/controller/workload/workload_controller.go)
diff --git a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md
index 41606895a64..715af559381 100644
--- a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md
+++ b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_in_status.md
@@ -1,6 +1,6 @@
---
title: "Pending workloads in Status"
-date: 2023-09-27
+date: 2024-09-23
weight: 3
description: >
Obtain the pending workloads in ClusterQueue and LocalQueue statuses.
@@ -28,7 +28,12 @@ QueueVisibility is an `Alpha` feature disabled by default, check the [Change the
## Monitor pending workloads
-{{< feature-state state="alpha" for_version="v0.5" >}}
+{{< feature-state state="deprecated" for_version="v0.9" >}}
+
+{{% alert title="Warning" color="warning" %}}
+This feature is deprecated and will be deleted on v1beta2.
+Please use [Pending Workloads on-demand](/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand/) instead.
+{{% /alert %}}
To install a simple setup of cluster queue, run the following command:
diff --git a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md
index d3954bd1d4d..b5b1c82cb9d 100644
--- a/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md
+++ b/site/content/en/docs/tasks/manage/monitor_pending_workloads/pending_workloads_on_demand.md
@@ -1,6 +1,6 @@
---
title: "Pending Workloads on-demand"
-date: 2023-12-05
+date: 2024-09-30
weight: 3
description: >
Monitor pending Workloads with the on-demand visibility API
@@ -22,21 +22,57 @@ Make sure the following conditions are met:
- The kubectl command-line tool has communication with your cluster.
- [Kueue is installed](/docs/installation) in version v0.6.0 or later.
-### Enable the VisibilityOnDemand feature gate
+### Configure API Priority and Fairness:
-VisibilityOnDemand is an `Alpha` feature disabled by default. To use the visibility API change [the feature gates configuration](/docs/installation/#change-the-feature-gates-configuration) and set `VisibilityOnDemand=true`.
+To install the [API Priority and Fairness](https://kubernetes.io/docs/concepts/cluster-administration/flow-control/) configuration for the visibility API apply one of the manifests, depending on your Kubernetes version:
-### Install the visibility API
+{{< tabpane lang="shell" persist=disabled >}}
+{{< tab header="Kubernetes 1.29 or newer" >}} kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/visibility-apf.yaml {{< /tab >}}
+{{< tab header="Kubernetes 1.28" >}} kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/{{< param "version" >}}/visibility-apf-1-28.yaml {{< /tab >}}
+{{< /tabpane >}}
-To install the visibility API, run the following command
+### Directly accessing the Visibility API
+
+If you want to directly access the Visibility API with a http client like
+`curl` or `wget`, or a browser, there are multiple ways you can locate and
+authenticate against the Visibility API server:
+
+#### (Recommended) Using kubectl proxy
+
+Run kubectl in proxy mode. This method is recommended, since it uses
+the stored API server location and verifies the identity of the API server using
+a self-signed certificate. No man-in-the-middle (MITM) attack is possible using
+this method.
+
+For more details, see [kubectl documentation](https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/#using-kubectl-proxy).
+
+#### Without kubectl proxy
+
+Alternatively, you can provide the location and credentials directly to the http client.
+This works with client code that is confused by proxies. To protect against man in
+the middle attacks, you'll need to import a root cert into your browser.
+
+For more details, see [kubectl documentation](https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/#without-kubectl-proxy).
+
+You then need to create `ClusterRole` and `ClusterRoleBinding` for that same (default) k8s service account
+
+{{< include "examples/visibility/cluster-role-and-binding.yaml" "yaml" >}}
+
+using a command:
```shell
-kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/$VERSION/visibility-api.yaml
+kubectl apply -f https://kueue.sigs.k8s.io/examples/admin/cluster-role-and-binding.yaml
```
## Monitor pending workloads on demand
-{{< feature-state state="stable" for_version="v0.6" >}}
+{{< feature-state state="beta" for_version="v0.9" >}}
+{{% alert title="Note" color="primary" %}}
+
+`VisibilityOnDemand` is a Beta feature enabled by default.
+
+You can disable it by setting the `VisibilityOnDemand` feature gate. Check the [Installation](/docs/installation/#change-the-feature-gates-configuration) guide for details on feature gate configuration.
+{{% /alert %}}
To install a simple setup of ClusterQueue
@@ -60,12 +96,12 @@ for i in {1..6}; do kubectl create -f https://kueue.sigs.k8s.io/examples/jobs/sa
3 of them saturate the ClusterQueue and the other 3 should be pending.
-### Cluster Queue visibility
+### Cluster Queue visibility via kubectl
To view pending workloads in ClusterQueue `cluster-queue` run the following command:
```shell
-kubectl get --raw "/apis/visibility.kueue.x-k8s.io/v1alpha1/clusterqueues/cluster-queue/pendingworkloads"
+kubectl get --raw "/apis/visibility.kueue.x-k8s.io/v1beta1/clusterqueues/cluster-queue/pendingworkloads"
```
You should get results similar to:
@@ -73,7 +109,7 @@ You should get results similar to:
```json
{
"kind": "PendingWorkloadsSummary",
- "apiVersion": "visibility.kueue.x-k8s.io/v1alpha1",
+ "apiVersion": "visibility.kueue.x-k8s.io/v1beta1",
"metadata": {
"creationTimestamp": null
},
@@ -146,7 +182,7 @@ You can pass optional query parameters:
To view only 1 pending workloads use, starting from position 1 in ClusterQueue run:
```shell
-kubectl get --raw "/apis/visibility.kueue.x-k8s.io/v1alpha1/clusterqueues/cluster-queue/pendingworkloads?limit=1&offset=1"
+kubectl get --raw "/apis/visibility.kueue.x-k8s.io/v1beta1/clusterqueues/cluster-queue/pendingworkloads?limit=1&offset=1"
```
You should get results similar to
@@ -154,7 +190,7 @@ You should get results similar to
``` json
{
"kind": "PendingWorkloadsSummary",
- "apiVersion": "visibility.kueue.x-k8s.io/v1alpha1",
+ "apiVersion": "visibility.kueue.x-k8s.io/v1beta1",
"metadata": {
"creationTimestamp": null
},
@@ -182,12 +218,93 @@ You should get results similar to
}
```
-### Local Queue visibility
+### Cluster Queue visibility via curl
+
+If you followed steps described in [Directly accessing the Visibility API](#directly-accessing-the-visibility-api) above,
+you can use curl to view pending workloads in ClusterQueue using following commands:
+
+{{< tabpane lang="shell" persist=disabled >}}
+{{< tab header="Using kubectl proxy" >}} curl http://localhost:8080/apis/visibility.kueue.x-k8s.io/v1beta1/clusterqueues/cluster-queue/pendingworkloads {{< /tab >}}
+{{< tab header="Without kubectl proxy" >}} curl -X GET $APISERVER/apis/visibility.kueue.x-k8s.io/v1beta1/clusterqueues/cluster-queue/pendingworkloads --header "Authorization: Bearer $TOKEN" --insecure {{< /tab >}}
+{{< /tabpane >}}
+
+You should get results similar to:
+
+```json
+{
+ "kind": "PendingWorkloadsSummary",
+ "apiVersion": "visibility.kueue.x-k8s.io/v1beta1",
+ "metadata": {
+ "creationTimestamp": null
+ },
+ "items": [
+ {
+ "metadata": {
+ "name": "job-sample-job-z8sc5-223e8",
+ "namespace": "default",
+ "creationTimestamp": "2024-09-29T10:58:32Z",
+ "ownerReferences": [
+ {
+ "apiVersion": "batch/v1",
+ "kind": "Job",
+ "name": "sample-job-z8sc5",
+ "uid": "7086b1bb-39b7-42e5-9f6b-ee07d0100051"
+ }
+ ]
+ },
+ "priority": 0,
+ "localQueueName": "user-queue",
+ "positionInClusterQueue": 0,
+ "positionInLocalQueue": 0
+ },
+ {
+ "metadata": {
+ "name": "job-sample-job-2mfzb-28f54",
+ "namespace": "default",
+ "creationTimestamp": "2024-09-29T10:58:32Z",
+ "ownerReferences": [
+ {
+ "apiVersion": "batch/v1",
+ "kind": "Job",
+ "name": "sample-job-2mfzb",
+ "uid": "51ae8e48-8785-4bbb-9811-f9c1f041b368"
+ }
+ ]
+ },
+ "priority": 0,
+ "localQueueName": "user-queue",
+ "positionInClusterQueue": 1,
+ "positionInLocalQueue": 1
+ },
+ {
+ "metadata": {
+ "name": "job-sample-job-dpggt-3ecac",
+ "namespace": "default",
+ "creationTimestamp": "2024-09-29T10:58:32Z",
+ "ownerReferences": [
+ {
+ "apiVersion": "batch/v1",
+ "kind": "Job",
+ "name": "sample-job-dpggt",
+ "uid": "870655da-07d5-4910-be99-7650bf89b0d2"
+ }
+ ]
+ },
+ "priority": 0,
+ "localQueueName": "user-queue",
+ "positionInClusterQueue": 2,
+ "positionInLocalQueue": 2
+ }
+ ]
+}
+```
+
+### Local Queue visibility via kubectl
Similarly to ClusterQueue, to view pending workloads in LocalQueue `user-queue` run the following command:
```shell
-kubectl get --raw /apis/visibility.kueue.x-k8s.io/v1alpha1/namespaces/default/localqueues/user-queue/pendingworkloads
+kubectl get --raw /apis/visibility.kueue.x-k8s.io/v1beta1/namespaces/default/localqueues/user-queue/pendingworkloads
```
You should get results similar to:
@@ -195,7 +312,7 @@ You should get results similar to:
``` json
{
"kind": "PendingWorkloadsSummary",
- "apiVersion": "visibility.kueue.x-k8s.io/v1alpha1",
+ "apiVersion": "visibility.kueue.x-k8s.io/v1beta1",
"metadata": {
"creationTimestamp": null
},
@@ -268,7 +385,7 @@ You can pass optional query parameters:
To view only 1 pending workloads use, starting from position 1 in LocalQueue run:
```shell
-kubectl get --raw "/apis/visibility.kueue.x-k8s.io/v1alpha1/localqueues/user-queue/pendingworkloads?limit=1&offset=1"
+kubectl get --raw "/apis/visibility.kueue.x-k8s.io/v1beta1/namespaces/default/localqueues/user-queue/pendingworkloads?limit=1&offset=1"
```
You should get results similar to
@@ -276,7 +393,7 @@ You should get results similar to
``` json
{
"kind": "PendingWorkloadsSummary",
- "apiVersion": "visibility.kueue.x-k8s.io/v1alpha1",
+ "apiVersion": "visibility.kueue.x-k8s.io/v1beta1",
"metadata": {
"creationTimestamp": null
},
@@ -303,3 +420,84 @@ You should get results similar to
]
}
```
+
+### Local Queue visibility via curl
+
+If you followed steps described in [Directly accessing the Visibility API](#directly-accessing-the-visibility-api)
+above, you can use curl to view pending workloads in LocalQueue using following commands:
+
+{{< tabpane lang="shell" persist=disabled >}}
+{{< tab header="Using kubectl proxy" >}} curl http://localhost:8080/apis/visibility.kueue.x-k8s.io/v1beta1/namespaces/default/localqueues/user-queue/pendingworkloads {{< /tab >}}
+{{< tab header="Without kubectl proxy" >}} curl -X GET $APISERVER/apis/visibility.kueue.x-k8s.io/v1beta1/namespaces/default/localqueues/user-queue/pendingworkloads --header "Authorization: Bearer $TOKEN" --insecure {{< /tab >}}
+{{< /tabpane >}}
+
+You should get results similar to:
+
+```json
+{
+ "kind": "PendingWorkloadsSummary",
+ "apiVersion": "visibility.kueue.x-k8s.io/v1beta1",
+ "metadata": {
+ "creationTimestamp": null
+ },
+ "items": [
+ {
+ "metadata": {
+ "name": "job-sample-job-z8sc5-223e8",
+ "namespace": "default",
+ "creationTimestamp": "2024-09-29T10:58:32Z",
+ "ownerReferences": [
+ {
+ "apiVersion": "batch/v1",
+ "kind": "Job",
+ "name": "sample-job-z8sc5",
+ "uid": "7086b1bb-39b7-42e5-9f6b-ee07d0100051"
+ }
+ ]
+ },
+ "priority": 0,
+ "localQueueName": "user-queue",
+ "positionInClusterQueue": 0,
+ "positionInLocalQueue": 0
+ },
+ {
+ "metadata": {
+ "name": "job-sample-job-2mfzb-28f54",
+ "namespace": "default",
+ "creationTimestamp": "2024-09-29T10:58:32Z",
+ "ownerReferences": [
+ {
+ "apiVersion": "batch/v1",
+ "kind": "Job",
+ "name": "sample-job-2mfzb",
+ "uid": "51ae8e48-8785-4bbb-9811-f9c1f041b368"
+ }
+ ]
+ },
+ "priority": 0,
+ "localQueueName": "user-queue",
+ "positionInClusterQueue": 1,
+ "positionInLocalQueue": 1
+ },
+ {
+ "metadata": {
+ "name": "job-sample-job-dpggt-3ecac",
+ "namespace": "default",
+ "creationTimestamp": "2024-09-29T10:58:32Z",
+ "ownerReferences": [
+ {
+ "apiVersion": "batch/v1",
+ "kind": "Job",
+ "name": "sample-job-dpggt",
+ "uid": "870655da-07d5-4910-be99-7650bf89b0d2"
+ }
+ ]
+ },
+ "priority": 0,
+ "localQueueName": "user-queue",
+ "positionInClusterQueue": 2,
+ "positionInLocalQueue": 2
+ }
+ ]
+}
+```
diff --git a/site/content/en/docs/tasks/manage/setup_multikueue.md b/site/content/en/docs/tasks/manage/setup_multikueue.md
index 63a65cd14da..7e4bc875196 100644
--- a/site/content/en/docs/tasks/manage/setup_multikueue.md
+++ b/site/content/en/docs/tasks/manage/setup_multikueue.md
@@ -69,13 +69,13 @@ kubectl config use-context manager-cluster
If you are using Kueue in version 0.7.0 or newer install the JobSet on the
management cluster (see [JobSet Installation](https://jobset.sigs.k8s.io/docs/installation/)
-for more details). Please install JobSet 0.5.1 or newer for MultiKueue.
+for more details). Please install JobSet 0.6.0 or newer for MultiKueue.
{{% alert title="Warning" color="warning" %}}
If you are using an older version of Kueue than 0.7.0, only install the JobSet
CRD in the management cluster. You can do this by running:
```bash
-kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/jobset/v0.5.1/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml
+kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/jobset/v0.6.0/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml
```
{{% /alert %}}
@@ -89,11 +89,6 @@ Make sure to install only the Kubeflow TFJobs CRD of version v1.7.0 or newer on
```
{{% /alert %}}
-### Enable the MultiKueue feature
-
-Enable the `MultiKueue` feature.
-Check the [Installation](/docs/installation/#change-the-feature-gates-configuration) guide for details on feature gate configuration.
-
### Create worker's Kubeconfig secret
For the next example, having the `worker1` cluster Kubeconfig stored in a file called `worker1.kubeconfig`, you can create the `worker1-secret` secret by running the following command:
diff --git a/site/content/en/docs/tasks/run/jobsets.md b/site/content/en/docs/tasks/run/jobsets.md
index a543e879cd7..14c5d58ba9f 100644
--- a/site/content/en/docs/tasks/run/jobsets.md
+++ b/site/content/en/docs/tasks/run/jobsets.md
@@ -18,7 +18,7 @@ This guide is for [batch users](/docs/tasks#batch-user) that have a basic unders
2. See [JobSet Installation](https://jobset.sigs.k8s.io/docs/installation/) for installation and configuration details of JobSet Operator.
{{% alert title="Note" color="primary" %}}
-In order to use JobSet you need to restart Kueue after the installation.
+In order to use JobSet, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
@@ -125,16 +125,12 @@ spec:
- 100s
```
-{{% alert title="Note" color="primary" %}}
-The same `jobset-sample.yaml` file from [single cluster environment](#single-cluster-environment) can be used in a [MultiKueue environment](#multikueue-environment).
-In that setup, the `spec.managedBy` field will be set to `kueue.x-k8s.io/multikueue`
-automatically, if not specified, as long as the `kueue.x-k8s.io/queue-name` annotation
-is specified and the corresponding Cluster Queue uses the Multi Kueue admission check.
-{{% /alert %}}
-
You can run this JobSet with the following commands:
```sh
# To monitor the queue and admission of the jobs, you can run this example multiple times:
kubectl create -f jobset-sample.yaml
```
+
+## Multikueue
+Check [the Multikueue](docs/tasks/run/multikueue) for details on running Jobsets in MultiKueue environment.
\ No newline at end of file
diff --git a/site/content/en/docs/tasks/run/kubeflow/mpijobs.md b/site/content/en/docs/tasks/run/kubeflow/mpijobs.md
index 7abbcbc7b50..38bcb57036e 100644
--- a/site/content/en/docs/tasks/run/kubeflow/mpijobs.md
+++ b/site/content/en/docs/tasks/run/kubeflow/mpijobs.md
@@ -19,10 +19,15 @@ Check [the MPI Operator installation guide](https://github.com/kubeflow/mpi-oper
You can [modify kueue configurations from installed releases](/docs/installation#install-a-custom-configured-released-version) to include MPIJobs as an allowed workload.
{{% alert title="Note" color="primary" %}}
-In order to use MPIJob you need to restart Kueue after the installation.
+In order to use MPIJob, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
+{{% alert title="Note" color="primary" %}}
+While using both MPI Operator and Training Operator, it is required to disable Training Operator's MPIJob option.
+Training Operator deployment needs to be modified to enable all kubeflow jobs except MPIJob, as mentioned [here](https://github.com/kubeflow/training-operator/issues/1777).
+{{% /alert %}}
+
## MPI Operator definition
### a. Queue selection
diff --git a/site/content/en/docs/tasks/run/kubeflow/mxjobs.md b/site/content/en/docs/tasks/run/kubeflow/mxjobs.md
index 61a91d7142f..dc60f08ee89 100644
--- a/site/content/en/docs/tasks/run/kubeflow/mxjobs.md
+++ b/site/content/en/docs/tasks/run/kubeflow/mxjobs.md
@@ -21,7 +21,7 @@ Note that the minimum requirement training-operator version is v1.7.0.
You can [modify kueue configurations from installed releases](/docs/installation#install-a-custom-configured-released-version) to include MXJobs as an allowed workload.
{{% alert title="Note" color="primary" %}}
-In order to use Training Operator you need to restart Kueue after the installation.
+In order to use Training Operator, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
diff --git a/site/content/en/docs/tasks/run/kubeflow/paddlejobs.md b/site/content/en/docs/tasks/run/kubeflow/paddlejobs.md
index 22ff6c64520..ca79c080ff9 100644
--- a/site/content/en/docs/tasks/run/kubeflow/paddlejobs.md
+++ b/site/content/en/docs/tasks/run/kubeflow/paddlejobs.md
@@ -21,7 +21,7 @@ Note that the minimum requirement training-operator version is v1.7.0.
You can [modify kueue configurations from installed releases](/docs/installation#install-a-custom-configured-released-version) to include PaddleJobs as an allowed workload.
{{% alert title="Note" color="primary" %}}
-In order to use Training Operator you need to restart Kueue after the installation.
+In order to use Training Operator, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
diff --git a/site/content/en/docs/tasks/run/kubeflow/pytorchjobs.md b/site/content/en/docs/tasks/run/kubeflow/pytorchjobs.md
index 72ca0a9fb28..3cb868632f9 100644
--- a/site/content/en/docs/tasks/run/kubeflow/pytorchjobs.md
+++ b/site/content/en/docs/tasks/run/kubeflow/pytorchjobs.md
@@ -21,7 +21,7 @@ Note that the minimum requirement training-operator version is v1.7.0.
You can [modify kueue configurations from installed releases](/docs/installation#install-a-custom-configured-released-version) to include PyTorchJobs as an allowed workload.
{{% alert title="Note" color="primary" %}}
-In order to use Training Operator you need to restart Kueue after the installation.
+In order to use Training Operator, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
diff --git a/site/content/en/docs/tasks/run/kubeflow/tfjobs.md b/site/content/en/docs/tasks/run/kubeflow/tfjobs.md
index cce694fff87..7d6ea7965e6 100644
--- a/site/content/en/docs/tasks/run/kubeflow/tfjobs.md
+++ b/site/content/en/docs/tasks/run/kubeflow/tfjobs.md
@@ -21,7 +21,7 @@ Note that the minimum requirement training-operator version is v1.7.0.
You can [modify kueue configurations from installed releases](/docs/installation#install-a-custom-configured-released-version) to include TFJobs as an allowed workload.
{{% alert title="Note" color="primary" %}}
-In order to use Training Operator you need to restart Kueue after the installation.
+In order to use Training Operator, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
diff --git a/site/content/en/docs/tasks/run/kubeflow/xgboostjobs.md b/site/content/en/docs/tasks/run/kubeflow/xgboostjobs.md
index 545a0e2764e..5566f4ce32c 100644
--- a/site/content/en/docs/tasks/run/kubeflow/xgboostjobs.md
+++ b/site/content/en/docs/tasks/run/kubeflow/xgboostjobs.md
@@ -21,7 +21,7 @@ Note that the minimum requirement training-operator version is v1.7.0.
You can [modify kueue configurations from installed releases](/docs/installation#install-a-custom-configured-released-version) to include XGBoostJobs as an allowed workload.
{{% alert title="Note" color="primary" %}}
-In order to use Training Operator you need to restart Kueue after the installation.
+In order to use Training Operator, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
diff --git a/site/content/en/docs/tasks/run/multikueue/_index.md b/site/content/en/docs/tasks/run/multikueue/_index.md
new file mode 100644
index 00000000000..4c164ebbe03
--- /dev/null
+++ b/site/content/en/docs/tasks/run/multikueue/_index.md
@@ -0,0 +1,12 @@
+---
+title: "Multi-cluster Job dispatching"
+linkTitle: "MultiKueue"
+weight: 8
+date: 2024-09-25
+description: >
+ Using MultiKueue environment to suport multi-cluster Job dispatching.
+---
+
+This page explains how to run tasks in MultiKueue environment for multi-cluster Job dispatching.
+
+In particular, we focus on details of running your tasks using various Job CRDs.
\ No newline at end of file
diff --git a/site/content/en/docs/tasks/run/multikueue/jobsets.md b/site/content/en/docs/tasks/run/multikueue/jobsets.md
new file mode 100644
index 00000000000..d6fbe823785
--- /dev/null
+++ b/site/content/en/docs/tasks/run/multikueue/jobsets.md
@@ -0,0 +1,22 @@
+---
+title: "Run Jobsets in MultiKueue"
+linkTitle: "Jobsets"
+weight: 2
+date: 2024-09-25
+description: >
+ Run a MultiKueue scheduled JobSet.
+---
+
+## Before you begin
+
+Check the [MultiKueue installation guide](/docs/tasks/manage/setup_multikueue) on how to properly setup MultiKueue clusters.
+
+For the ease of setup and use we recommend using at least Kueue v0.8.1 and JobSet v0.6.0 (see [JobSet Installation](https://jobset.sigs.k8s.io/docs/installation/) for more details).
+
+## Run Jobsets example
+
+Once the setup is complete you can test it by running the [`jobset-sample.yaml`](/docs/tasks/run/jobsets/#example-jobset) Job.
+
+In that setup, the `spec.managedBy` field is defaulted to `kueue.x-k8s.io/multikueue`
+automatically, if not specified, as long as the `kueue.x-k8s.io/queue-name` annotation
+is specified and the corresponding Cluster Queue uses the Multi Kueue admission check.
\ No newline at end of file
diff --git a/site/content/en/docs/tasks/run/rayclusters.md b/site/content/en/docs/tasks/run/rayclusters.md
index a55a1c5c411..72eb66e3f51 100644
--- a/site/content/en/docs/tasks/run/rayclusters.md
+++ b/site/content/en/docs/tasks/run/rayclusters.md
@@ -20,7 +20,7 @@ This guide is for [batch users](/docs/tasks#batch-user) that have a basic unders
3. See [KubeRay Installation](https://ray-project.github.io/kuberay/deploy/installation/) for installation and configuration details of KubeRay.
{{% alert title="Note" color="primary" %}}
-In order to use RayCluster you need to restart Kueue after the installation.
+In order to use RayCluster, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
diff --git a/site/content/en/docs/tasks/run/rayjobs.md b/site/content/en/docs/tasks/run/rayjobs.md
index 78488934a85..9f82375c223 100644
--- a/site/content/en/docs/tasks/run/rayjobs.md
+++ b/site/content/en/docs/tasks/run/rayjobs.md
@@ -21,7 +21,7 @@ This guide is for [batch users](/docs/tasks#batch-user) that have a basic unders
3. See [KubeRay Installation](https://ray-project.github.io/kuberay/deploy/installation/) for installation and configuration details of KubeRay.
{{% alert title="Note" color="primary" %}}
-In order to use RayJob you need to restart Kueue after the installation.
+In order to use RayJob, prior to v0.8.1, you need to restart Kueue after the installation.
You can do it by running: `kubectl delete pods -lcontrol-plane=controller-manager -nkueue-system`.
{{% /alert %}}
diff --git a/site/hugo.toml b/site/hugo.toml
index 978e8e5e987..a2656ecd419 100644
--- a/site/hugo.toml
+++ b/site/hugo.toml
@@ -90,7 +90,7 @@ ignoreFiles = []
# The major.minor version tag for the version of the docs represented in this
# branch of the repository. Used in the "version-banner" partial to display a
# version number for this doc set.
- version = "v0.8.0"
+ version = "v0.8.1"
# Flag used in the "version-banner" partial to decide whether to display a
# banner on every page indicating that this is an archived version of the docs.
diff --git a/site/static/examples/multikueue/create-multikueue-kubeconfig.sh b/site/static/examples/multikueue/create-multikueue-kubeconfig.sh
index 971d7b9d362..4ad71e36df0 100644
--- a/site/static/examples/multikueue/create-multikueue-kubeconfig.sh
+++ b/site/static/examples/multikueue/create-multikueue-kubeconfig.sh
@@ -149,6 +149,22 @@ rules:
- xgboostjobs/status
verbs:
- get
+- apiGroups:
+ - kubeflow.org
+ resources:
+ - mpijobs
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - watch
+- apiGroups:
+ - kubeflow.org
+ resources:
+ - mpijobs/status
+ verbs:
+ - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
diff --git a/site/static/examples/visibility/cluster-role-and-binding.yaml b/site/static/examples/visibility/cluster-role-and-binding.yaml
new file mode 100644
index 00000000000..e7e62892dd4
--- /dev/null
+++ b/site/static/examples/visibility/cluster-role-and-binding.yaml
@@ -0,0 +1,28 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: kueue-visibility-server-api
+rules:
+- apiGroups:
+ - "visibility.kueue.x-k8s.io"
+ resources:
+ - "clusterqueues/pendingworkloads"
+ - "localqueues/pendingworkloads"
+ verbs:
+ - get
+ - list
+ - watch
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: kueue-visibility-server-api
+ namespace: default
+subjects:
+- kind: ServiceAccount
+ name: default
+ namespace: default
+roleRef:
+ kind: ClusterRole
+ name: kueue-visibility-server-api
+ apiGroup: rbac.authorization.k8s.io
diff --git a/test/e2e/config/1_28/kustomization.yaml b/test/e2e/config/1_28/kustomization.yaml
new file mode 100644
index 00000000000..90bbf9daa14
--- /dev/null
+++ b/test/e2e/config/1_28/kustomization.yaml
@@ -0,0 +1,3 @@
+resources:
+- ../common
+- ../../../../config/visibility-apf/1_28
\ No newline at end of file
diff --git a/test/e2e/config/controller_manager_config.yaml b/test/e2e/config/common/controller_manager_config.yaml
similarity index 100%
rename from test/e2e/config/controller_manager_config.yaml
rename to test/e2e/config/common/controller_manager_config.yaml
diff --git a/test/e2e/config/kustomization.yaml b/test/e2e/config/common/kustomization.yaml
similarity index 89%
rename from test/e2e/config/kustomization.yaml
rename to test/e2e/config/common/kustomization.yaml
index 064f203d8b6..dcf86970a39 100644
--- a/test/e2e/config/kustomization.yaml
+++ b/test/e2e/config/common/kustomization.yaml
@@ -2,8 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
-- ../../../config/dev
-- ../../../config/visibility
+- ../../../../config/dev
replicas:
- name: kueue-controller-manager
diff --git a/test/e2e/config/manager_e2e_patch.yaml b/test/e2e/config/common/manager_e2e_patch.yaml
similarity index 59%
rename from test/e2e/config/manager_e2e_patch.yaml
rename to test/e2e/config/common/manager_e2e_patch.yaml
index 8de33249616..cc5a3c04e97 100644
--- a/test/e2e/config/manager_e2e_patch.yaml
+++ b/test/e2e/config/common/manager_e2e_patch.yaml
@@ -3,4 +3,4 @@
value: IfNotPresent
- op: add
path: /spec/template/spec/containers/0/args/-
- value: --feature-gates=VisibilityOnDemand=true,MultiKueue=true,MultiKueueBatchJobWithManagedBy=true
+ value: --feature-gates=MultiKueueBatchJobWithManagedBy=true
diff --git a/test/e2e/config/default/kustomization.yaml b/test/e2e/config/default/kustomization.yaml
new file mode 100644
index 00000000000..3c63144858e
--- /dev/null
+++ b/test/e2e/config/default/kustomization.yaml
@@ -0,0 +1,3 @@
+resources:
+- ../common
+- ../../../../config/visibility-apf/default
\ No newline at end of file
diff --git a/test/e2e/config/multikueue/manager/kustomization.yaml b/test/e2e/config/multikueue/manager/kustomization.yaml
new file mode 100644
index 00000000000..0e5b1219ee4
--- /dev/null
+++ b/test/e2e/config/multikueue/manager/kustomization.yaml
@@ -0,0 +1,17 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+ - ../../../../../dep-crds/training-operator/manifests/base/crds
+images:
+ - name: kubeflow/training-operator
+secretGenerator:
+ - name: training-operator-webhook-cert
+ options:
+ disableNameSuffixHash: true
+patches:
+ - path: patch_crds.yaml
+ target:
+ version: v1
+ group: apiextensions.k8s.io
+ kind: CustomResourceDefinition
+ name: mpijobs.kubeflow.org
diff --git a/test/e2e/config/multikueue/manager/patch_crds.yaml b/test/e2e/config/multikueue/manager/patch_crds.yaml
new file mode 100644
index 00000000000..85a2f63b61e
--- /dev/null
+++ b/test/e2e/config/multikueue/manager/patch_crds.yaml
@@ -0,0 +1,5 @@
+$patch: delete
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: mpijobs.kubeflow.org
\ No newline at end of file
diff --git a/test/e2e/config/multikueue/worker/kustomization.yaml b/test/e2e/config/multikueue/worker/kustomization.yaml
new file mode 100644
index 00000000000..5abe584aeb1
--- /dev/null
+++ b/test/e2e/config/multikueue/worker/kustomization.yaml
@@ -0,0 +1,18 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+ - ../../../../../dep-crds/training-operator/manifests/overlays/standalone
+patches:
+ - path: patch_crds.yaml
+ target:
+ version: v1
+ group: apiextensions.k8s.io
+ kind: CustomResourceDefinition
+ name: mpijobs.kubeflow.org
+ - path: patch_deployment.yaml
+ target:
+ version: v1
+ group: apps
+ kind: Deployment
+ name: training-operator
+
diff --git a/test/e2e/config/multikueue/worker/patch_crds.yaml b/test/e2e/config/multikueue/worker/patch_crds.yaml
new file mode 100644
index 00000000000..85a2f63b61e
--- /dev/null
+++ b/test/e2e/config/multikueue/worker/patch_crds.yaml
@@ -0,0 +1,5 @@
+$patch: delete
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: mpijobs.kubeflow.org
\ No newline at end of file
diff --git a/test/e2e/config/multikueue/worker/patch_deployment.yaml b/test/e2e/config/multikueue/worker/patch_deployment.yaml
new file mode 100644
index 00000000000..41094b690ac
--- /dev/null
+++ b/test/e2e/config/multikueue/worker/patch_deployment.yaml
@@ -0,0 +1,15 @@
+$patch: merge
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: training-operator
+spec:
+ template:
+ spec:
+ containers:
+ - name: training-operator
+ args:
+ - --enable-scheme=tfjob
+ - --enable-scheme=pytorchjob
+ - --enable-scheme=xgboostjob
+ - --enable-scheme=paddlejob
\ No newline at end of file
diff --git a/test/e2e/multikueue/e2e_test.go b/test/e2e/multikueue/e2e_test.go
index 8504a54171b..a1f5a613208 100644
--- a/test/e2e/multikueue/e2e_test.go
+++ b/test/e2e/multikueue/e2e_test.go
@@ -21,10 +21,10 @@ import (
"os/exec"
"github.com/google/go-cmp/cmp/cmpopts"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
-
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
apimeta "k8s.io/apimachinery/pkg/api/meta"
@@ -32,25 +32,19 @@ import (
"k8s.io/apimachinery/pkg/types"
versionutil "k8s.io/apimachinery/pkg/util/version"
"k8s.io/utils/ptr"
-
"sigs.k8s.io/controller-runtime/pkg/client"
jobset "sigs.k8s.io/jobset/api/jobset/v1alpha2"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
workloadjob "sigs.k8s.io/kueue/pkg/controller/jobs/job"
workloadjobset "sigs.k8s.io/kueue/pkg/controller/jobs/jobset"
- workloadpaddlejob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/paddlejob"
workloadpytorchjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/pytorchjob"
- workloadtfjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/tfjob"
- workloadxgboostjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/xgboostjob"
+ workloadmpijob "sigs.k8s.io/kueue/pkg/controller/jobs/mpijob"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
testingjobset "sigs.k8s.io/kueue/pkg/util/testingjobs/jobset"
- testingpaddlejob "sigs.k8s.io/kueue/pkg/util/testingjobs/paddlejob"
+ testingmpijob "sigs.k8s.io/kueue/pkg/util/testingjobs/mpijob"
testingpytorchjob "sigs.k8s.io/kueue/pkg/util/testingjobs/pytorchjob"
- testingtfjob "sigs.k8s.io/kueue/pkg/util/testingjobs/tfjob"
- testingxgboostjob "sigs.k8s.io/kueue/pkg/util/testingjobs/xgboostjob"
"sigs.k8s.io/kueue/pkg/workload"
"sigs.k8s.io/kueue/test/util"
)
@@ -63,9 +57,9 @@ var _ = ginkgo.Describe("MultiKueue", func() {
worker1Ns *corev1.Namespace
worker2Ns *corev1.Namespace
- workerCluster1 *kueuealpha.MultiKueueCluster
- workerCluster2 *kueuealpha.MultiKueueCluster
- multiKueueConfig *kueuealpha.MultiKueueConfig
+ workerCluster1 *kueue.MultiKueueCluster
+ workerCluster2 *kueue.MultiKueueCluster
+ multiKueueConfig *kueue.MultiKueueConfig
multiKueueAc *kueue.AdmissionCheck
managerFlavor *kueue.ResourceFlavor
managerCq *kueue.ClusterQueue
@@ -102,18 +96,18 @@ var _ = ginkgo.Describe("MultiKueue", func() {
}
gomega.Expect(k8sWorker2Client.Create(ctx, worker2Ns)).To(gomega.Succeed())
- workerCluster1 = utiltesting.MakeMultiKueueCluster("worker1").KubeConfig(kueuealpha.SecretLocationType, "multikueue1").Obj()
+ workerCluster1 = utiltesting.MakeMultiKueueCluster("worker1").KubeConfig(kueue.SecretLocationType, "multikueue1").Obj()
gomega.Expect(k8sManagerClient.Create(ctx, workerCluster1)).To(gomega.Succeed())
- workerCluster2 = utiltesting.MakeMultiKueueCluster("worker2").KubeConfig(kueuealpha.SecretLocationType, "multikueue2").Obj()
+ workerCluster2 = utiltesting.MakeMultiKueueCluster("worker2").KubeConfig(kueue.SecretLocationType, "multikueue2").Obj()
gomega.Expect(k8sManagerClient.Create(ctx, workerCluster2)).To(gomega.Succeed())
multiKueueConfig = utiltesting.MakeMultiKueueConfig("multikueueconfig").Clusters("worker1", "worker2").Obj()
gomega.Expect(k8sManagerClient.Create(ctx, multiKueueConfig)).Should(gomega.Succeed())
multiKueueAc = utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", multiKueueConfig.Name).
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", multiKueueConfig.Name).
Obj()
gomega.Expect(k8sManagerClient.Create(ctx, multiKueueAc)).Should(gomega.Succeed())
@@ -205,7 +199,7 @@ var _ = ginkgo.Describe("MultiKueue", func() {
Request("cpu", "1").
Request("memory", "2G").
// Give it the time to be observed Active in the live status update step.
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"5s"}).
+ Image(util.E2eTestSleepImage, []string{"5s"}).
Obj()
ginkgo.By("Creating the job", func() {
@@ -213,7 +207,7 @@ var _ = ginkgo.Describe("MultiKueue", func() {
gomega.Eventually(func(g gomega.Gomega) {
createdJob := &batchv1.Job{}
g.Expect(k8sManagerClient.Get(ctx, client.ObjectKeyFromObject(job), createdJob)).To(gomega.Succeed())
- g.Expect(ptr.Deref(createdJob.Spec.ManagedBy, "")).To(gomega.BeEquivalentTo(kueuealpha.MultiKueueControllerName))
+ g.Expect(ptr.Deref(createdJob.Spec.ManagedBy, "")).To(gomega.BeEquivalentTo(kueue.MultiKueueControllerName))
}, util.Timeout, util.Interval).Should(gomega.Succeed())
})
@@ -290,7 +284,7 @@ var _ = ginkgo.Describe("MultiKueue", func() {
Replicas: 2,
Parallelism: 2,
Completions: 2,
- Image: "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0",
+ Image: util.E2eTestSleepImage,
// Give it the time to be observed Active in the live status update step.
Args: []string{"5s"},
},
@@ -375,135 +369,6 @@ var _ = ginkgo.Describe("MultiKueue", func() {
util.IgnoreConditionTimestampsAndObservedGeneration)))
})
})
- ginkgo.It("Should run a kubeflow TFJob on worker if admitted", func() {
- // Since it requires 1.5 CPU, this job can only be admitted in worker 1.
- tfJob := testingtfjob.MakeTFJob("tfjob1", managerNs.Name).
- Queue(managerLq.Name).
- TFReplicaSpecs(
- testingtfjob.TFReplicaSpecRequirement{
- ReplicaType: kftraining.TFJobReplicaTypeChief,
- ReplicaCount: 1,
- RestartPolicy: "OnFailure",
- },
- testingtfjob.TFReplicaSpecRequirement{
- ReplicaType: kftraining.TFJobReplicaTypePS,
- ReplicaCount: 1,
- RestartPolicy: "Never",
- },
- testingtfjob.TFReplicaSpecRequirement{
- ReplicaType: kftraining.TFJobReplicaTypeWorker,
- ReplicaCount: 1,
- RestartPolicy: "OnFailure",
- },
- ).
- Request(kftraining.TFJobReplicaTypeChief, corev1.ResourceCPU, "0.5").
- Request(kftraining.TFJobReplicaTypeChief, corev1.ResourceMemory, "200M").
- Request(kftraining.TFJobReplicaTypePS, corev1.ResourceCPU, "0.5").
- Request(kftraining.TFJobReplicaTypePS, corev1.ResourceMemory, "200M").
- Request(kftraining.TFJobReplicaTypeWorker, corev1.ResourceCPU, "0.5").
- Request(kftraining.TFJobReplicaTypeWorker, corev1.ResourceMemory, "100M").
- Image(kftraining.TFJobReplicaTypeChief, "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
- Image(kftraining.TFJobReplicaTypePS, "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
- Image(kftraining.TFJobReplicaTypeWorker, "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
- Obj()
-
- ginkgo.By("Creating the TfJob", func() {
- gomega.Expect(k8sManagerClient.Create(ctx, tfJob)).Should(gomega.Succeed())
- })
- wlLookupKey := types.NamespacedName{Name: workloadtfjob.GetWorkloadNameForTFJob(tfJob.Name, tfJob.UID), Namespace: managerNs.Name}
-
- // the execution should be given to the worker1
- waitForJobAdmitted(wlLookupKey, multiKueueAc.Name, "worker1")
-
- ginkgo.By("Waiting for the TfJob to finish", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- createdTfJob := &kftraining.TFJob{}
- g.Expect(k8sManagerClient.Get(ctx, client.ObjectKeyFromObject(tfJob), createdTfJob)).To(gomega.Succeed())
- g.Expect(createdTfJob.Status.ReplicaStatuses[kftraining.TFJobReplicaTypeChief]).To(gomega.BeComparableTo(
- &kftraining.ReplicaStatus{
- Active: 0,
- Succeeded: 1,
- },
- util.IgnoreConditionTimestampsAndObservedGeneration))
-
- finishReasonMessage := fmt.Sprintf("TFJob %s/%s successfully completed.", tfJob.Namespace, tfJob.Name)
- checkFinishStatusCondition(g, wlLookupKey, finishReasonMessage)
- }, util.LongTimeout, util.Interval).Should(gomega.Succeed())
- })
-
- ginkgo.By("Checking no objects are left in the worker clusters and the TfJob is completed", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- workerWl := &kueue.Workload{}
- g.Expect(k8sWorker1Client.Get(ctx, wlLookupKey, workerWl)).To(utiltesting.BeNotFoundError())
- g.Expect(k8sWorker2Client.Get(ctx, wlLookupKey, workerWl)).To(utiltesting.BeNotFoundError())
- workerTfJob := &kftraining.TFJob{}
- g.Expect(k8sWorker1Client.Get(ctx, client.ObjectKeyFromObject(tfJob), workerTfJob)).To(utiltesting.BeNotFoundError())
- g.Expect(k8sWorker2Client.Get(ctx, client.ObjectKeyFromObject(tfJob), workerTfJob)).To(utiltesting.BeNotFoundError())
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
- })
- })
-
- ginkgo.It("Should run a kubeflow PaddleJob on worker if admitted", func() {
- // Since it requires 1600M memory, this job can only be admitted in worker 2.
- paddleJob := testingpaddlejob.MakePaddleJob("paddlejob1", managerNs.Name).
- Queue(managerLq.Name).
- PaddleReplicaSpecs(
- testingpaddlejob.PaddleReplicaSpecRequirement{
- ReplicaType: kftraining.PaddleJobReplicaTypeMaster,
- ReplicaCount: 1,
- RestartPolicy: "OnFailure",
- },
- testingpaddlejob.PaddleReplicaSpecRequirement{
- ReplicaType: kftraining.PaddleJobReplicaTypeWorker,
- ReplicaCount: 1,
- RestartPolicy: "OnFailure",
- },
- ).
- Request(kftraining.PaddleJobReplicaTypeMaster, corev1.ResourceCPU, "0.2").
- Request(kftraining.PaddleJobReplicaTypeMaster, corev1.ResourceMemory, "800M").
- Request(kftraining.PaddleJobReplicaTypeWorker, corev1.ResourceCPU, "0.2").
- Request(kftraining.PaddleJobReplicaTypeWorker, corev1.ResourceMemory, "800M").
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0").
- Args([]string{"1ms"}).
- Obj()
-
- ginkgo.By("Creating the PaddleJob", func() {
- gomega.Expect(k8sManagerClient.Create(ctx, paddleJob)).Should(gomega.Succeed())
- })
-
- wlLookupKey := types.NamespacedName{Name: workloadpaddlejob.GetWorkloadNameForPaddleJob(paddleJob.Name, paddleJob.UID), Namespace: managerNs.Name}
-
- // the execution should be given to the worker2
- waitForJobAdmitted(wlLookupKey, multiKueueAc.Name, "worker2")
-
- ginkgo.By("Waiting for the PaddleJob to finish", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- createdPaddleJob := &kftraining.PaddleJob{}
- g.Expect(k8sManagerClient.Get(ctx, client.ObjectKeyFromObject(paddleJob), createdPaddleJob)).To(gomega.Succeed())
- g.Expect(createdPaddleJob.Status.ReplicaStatuses[kftraining.PaddleJobReplicaTypeMaster]).To(gomega.BeComparableTo(
- &kftraining.ReplicaStatus{
- Active: 0,
- Succeeded: 1,
- Selector: fmt.Sprintf("training.kubeflow.org/job-name=%s,training.kubeflow.org/operator-name=paddlejob-controller,training.kubeflow.org/replica-type=master", createdPaddleJob.Name),
- },
- util.IgnoreConditionTimestampsAndObservedGeneration))
-
- finishReasonMessage := fmt.Sprintf("PaddleJob %s is successfully completed.", paddleJob.Name)
- checkFinishStatusCondition(g, wlLookupKey, finishReasonMessage)
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
- })
-
- ginkgo.By("Checking no objects are left in the worker clusters and the PaddleJob is completed", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- workerWl := &kueue.Workload{}
- g.Expect(k8sWorker1Client.Get(ctx, wlLookupKey, workerWl)).To(utiltesting.BeNotFoundError())
- g.Expect(k8sWorker2Client.Get(ctx, wlLookupKey, workerWl)).To(utiltesting.BeNotFoundError())
- workerPaddleJob := &kftraining.PaddleJob{}
- g.Expect(k8sWorker1Client.Get(ctx, client.ObjectKeyFromObject(paddleJob), workerPaddleJob)).To(utiltesting.BeNotFoundError())
- g.Expect(k8sWorker2Client.Get(ctx, client.ObjectKeyFromObject(paddleJob), workerPaddleJob)).To(utiltesting.BeNotFoundError())
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
- })
- })
ginkgo.It("Should run a kubeflow PyTorchJob on worker if admitted", func() {
// Since it requires 1600M of memory, this job can only be admitted in worker 2.
@@ -525,8 +390,8 @@ var _ = ginkgo.Describe("MultiKueue", func() {
Request(kftraining.PyTorchJobReplicaTypeMaster, corev1.ResourceMemory, "800M").
Request(kftraining.PyTorchJobReplicaTypeWorker, corev1.ResourceCPU, "0.5").
Request(kftraining.PyTorchJobReplicaTypeWorker, corev1.ResourceMemory, "800M").
- Image(kftraining.PyTorchJobReplicaTypeMaster, "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
- Image(kftraining.PyTorchJobReplicaTypeWorker, "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(kftraining.PyTorchJobReplicaTypeMaster, util.E2eTestSleepImage, []string{"1ms"}).
+ Image(kftraining.PyTorchJobReplicaTypeWorker, util.E2eTestSleepImage, []string{"1ms"}).
Obj()
ginkgo.By("Creating the PyTorchJob", func() {
@@ -548,7 +413,7 @@ var _ = ginkgo.Describe("MultiKueue", func() {
Succeeded: 1,
Selector: fmt.Sprintf("training.kubeflow.org/job-name=%s,training.kubeflow.org/operator-name=pytorchjob-controller,training.kubeflow.org/replica-type=master", createdPyTorchJob.Name),
},
- util.IgnoreConditionTimestampsAndObservedGeneration))
+ ))
finishReasonMessage := fmt.Sprintf("PyTorchJob %s is successfully completed.", pyTorchJob.Name)
checkFinishStatusCondition(g, wlLookupKey, finishReasonMessage)
@@ -567,65 +432,63 @@ var _ = ginkgo.Describe("MultiKueue", func() {
})
})
- ginkgo.It("Should run a kubeflow XGBoostJob on worker if admitted", func() {
- // Skipped due to known bug - https://github.com/kubeflow/training-operator/issues/1711
- ginkgo.Skip("Skipped due to state transitioning bug in training-operator")
+ ginkgo.It("Should run a MPIJob on worker if admitted", func() {
// Since it requires 1.5 CPU, this job can only be admitted in worker 1.
- xgboostJob := testingxgboostjob.MakeXGBoostJob("xgboostjob1", managerNs.Name).
+ mpijob := testingmpijob.MakeMPIJob("mpijob1", managerNs.Name).
Queue(managerLq.Name).
- XGBReplicaSpecs(
- testingxgboostjob.XGBReplicaSpecRequirement{
- ReplicaType: kftraining.XGBoostJobReplicaTypeMaster,
+ MPIJobReplicaSpecs(
+ testingmpijob.MPIJobReplicaSpecRequirement{
+ ReplicaType: kfmpi.MPIReplicaTypeLauncher,
ReplicaCount: 1,
RestartPolicy: "OnFailure",
},
- testingxgboostjob.XGBReplicaSpecRequirement{
- ReplicaType: kftraining.XGBoostJobReplicaTypeWorker,
+ testingmpijob.MPIJobReplicaSpecRequirement{
+ ReplicaType: kfmpi.MPIReplicaTypeWorker,
ReplicaCount: 1,
RestartPolicy: "OnFailure",
},
).
- Request(kftraining.XGBoostJobReplicaTypeMaster, corev1.ResourceCPU, "1").
- Request(kftraining.XGBoostJobReplicaTypeMaster, corev1.ResourceMemory, "200M").
- Request(kftraining.XGBoostJobReplicaTypeWorker, corev1.ResourceCPU, "0.5").
- Request(kftraining.XGBoostJobReplicaTypeWorker, corev1.ResourceMemory, "100M").
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0").
- Args([]string{"1ms"}).
+ Request(kfmpi.MPIReplicaTypeLauncher, corev1.ResourceCPU, "1").
+ Request(kfmpi.MPIReplicaTypeLauncher, corev1.ResourceMemory, "200M").
+ Request(kfmpi.MPIReplicaTypeWorker, corev1.ResourceCPU, "0.5").
+ Request(kfmpi.MPIReplicaTypeWorker, corev1.ResourceMemory, "100M").
+ Image(kfmpi.MPIReplicaTypeLauncher, util.E2eTestSleepImage, []string{"1ms"}).
+ Image(kfmpi.MPIReplicaTypeWorker, util.E2eTestSleepImage, []string{"1ms"}).
Obj()
- ginkgo.By("Creating the XGBoostJob", func() {
- gomega.Expect(k8sManagerClient.Create(ctx, xgboostJob)).Should(gomega.Succeed())
+ ginkgo.By("Creating the MPIJob", func() {
+ gomega.Expect(k8sManagerClient.Create(ctx, mpijob)).Should(gomega.Succeed())
})
- wlLookupKey := types.NamespacedName{Name: workloadxgboostjob.GetWorkloadNameForXGBoostJob(xgboostJob.Name, xgboostJob.UID), Namespace: managerNs.Name}
+ wlLookupKey := types.NamespacedName{Name: workloadmpijob.GetWorkloadNameForMPIJob(mpijob.Name, mpijob.UID), Namespace: managerNs.Name}
// the execution should be given to the worker1
waitForJobAdmitted(wlLookupKey, multiKueueAc.Name, "worker1")
- ginkgo.By("Waiting for the XGBoostJob to finish", func() {
+ ginkgo.By("Waiting for the MPIJob to finish", func() {
gomega.Eventually(func(g gomega.Gomega) {
- createdXGBoostJob := &kftraining.XGBoostJob{}
- g.Expect(k8sManagerClient.Get(ctx, client.ObjectKeyFromObject(xgboostJob), createdXGBoostJob)).To(gomega.Succeed())
- g.Expect(createdXGBoostJob.Status.ReplicaStatuses[kftraining.XGBoostJobReplicaTypeMaster]).To(gomega.BeComparableTo(
- &kftraining.ReplicaStatus{
+ createdMPIJob := &kfmpi.MPIJob{}
+ g.Expect(k8sManagerClient.Get(ctx, client.ObjectKeyFromObject(mpijob), createdMPIJob)).To(gomega.Succeed())
+ g.Expect(createdMPIJob.Status.ReplicaStatuses[kfmpi.MPIReplicaTypeLauncher]).To(gomega.BeComparableTo(
+ &kfmpi.ReplicaStatus{
Active: 0,
Succeeded: 1,
},
- util.IgnoreConditionTimestampsAndObservedGeneration))
+ ))
- finishReasonMessage := fmt.Sprintf("XGBoostJob %s is successfully completed.", xgboostJob.Name)
+ finishReasonMessage := fmt.Sprintf("MPIJob %s successfully completed.", client.ObjectKeyFromObject(mpijob).String())
checkFinishStatusCondition(g, wlLookupKey, finishReasonMessage)
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ }, util.LongTimeout, util.Interval).Should(gomega.Succeed())
})
- ginkgo.By("Checking no objects are left in the worker clusters and the XGBoostJob is completed", func() {
+ ginkgo.By("Checking no objects are left in the worker clusters and the MPIJob is completed", func() {
gomega.Eventually(func(g gomega.Gomega) {
workerWl := &kueue.Workload{}
g.Expect(k8sWorker1Client.Get(ctx, wlLookupKey, workerWl)).To(utiltesting.BeNotFoundError())
g.Expect(k8sWorker2Client.Get(ctx, wlLookupKey, workerWl)).To(utiltesting.BeNotFoundError())
- workerXGBoostJob := &kftraining.XGBoostJob{}
- g.Expect(k8sWorker1Client.Get(ctx, client.ObjectKeyFromObject(xgboostJob), workerXGBoostJob)).To(utiltesting.BeNotFoundError())
- g.Expect(k8sWorker2Client.Get(ctx, client.ObjectKeyFromObject(xgboostJob), workerXGBoostJob)).To(utiltesting.BeNotFoundError())
+ workerMPIJob := &kfmpi.MPIJob{}
+ g.Expect(k8sWorker1Client.Get(ctx, client.ObjectKeyFromObject(mpijob), workerMPIJob)).To(utiltesting.BeNotFoundError())
+ g.Expect(k8sWorker2Client.Get(ctx, client.ObjectKeyFromObject(mpijob), workerMPIJob)).To(utiltesting.BeNotFoundError())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
})
})
@@ -658,12 +521,12 @@ var _ = ginkgo.Describe("MultiKueue", func() {
})
ginkgo.By("Waiting for the cluster to become inactive", func() {
- readClient := &kueuealpha.MultiKueueCluster{}
+ readClient := &kueue.MultiKueueCluster{}
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sManagerClient.Get(ctx, worker1ClusterKey, readClient)).To(gomega.Succeed())
g.Expect(readClient.Status.Conditions).To(gomega.ContainElement(gomega.BeComparableTo(
metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionFalse,
Reason: "ClientConnectionFailed",
},
@@ -691,12 +554,12 @@ var _ = ginkgo.Describe("MultiKueue", func() {
})
ginkgo.By("Waiting for the cluster do become active", func() {
- readClient := &kueuealpha.MultiKueueCluster{}
+ readClient := &kueue.MultiKueueCluster{}
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sManagerClient.Get(ctx, worker1ClusterKey, readClient)).To(gomega.Succeed())
g.Expect(readClient.Status.Conditions).To(gomega.ContainElement(gomega.BeComparableTo(
metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionTrue,
Reason: "Active",
Message: "Connected",
diff --git a/test/e2e/multikueue/suite_test.go b/test/e2e/multikueue/suite_test.go
index c5a3f897f33..a6a2d4ac9b2 100644
--- a/test/e2e/multikueue/suite_test.go
+++ b/test/e2e/multikueue/suite_test.go
@@ -23,6 +23,7 @@ import (
"testing"
"time"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
@@ -95,6 +96,8 @@ func kubeconfigForMultiKueueSA(ctx context.Context, c client.Client, restConfig
policyRule(kftraining.SchemeGroupVersion.Group, "pytorchjobs/status", "get"),
policyRule(kftraining.SchemeGroupVersion.Group, "xgboostjobs", resourceVerbs...),
policyRule(kftraining.SchemeGroupVersion.Group, "xgboostjobs/status", "get"),
+ policyRule(kfmpi.SchemeGroupVersion.Group, "mpijobs", resourceVerbs...),
+ policyRule(kfmpi.SchemeGroupVersion.Group, "mpijobs/status", "get"),
},
}
err := c.Create(ctx, cr)
@@ -172,8 +175,29 @@ func kubeconfigForMultiKueueSA(ctx context.Context, c client.Client, restConfig
return clientcmd.Write(cfg)
}
+func cleanKubeconfigForMultiKueueSA(ctx context.Context, c client.Client, ns string, prefix string) error {
+ roleName := prefix + "-role"
+
+ err := c.Delete(ctx, &rbacv1.ClusterRole{ObjectMeta: metav1.ObjectMeta{Name: roleName}})
+ if client.IgnoreNotFound(err) != nil {
+ return err
+ }
+
+ err = c.Delete(ctx, &corev1.ServiceAccount{ObjectMeta: metav1.ObjectMeta{Namespace: ns, Name: prefix + "-sa"}})
+ if client.IgnoreNotFound(err) != nil {
+ return err
+ }
+
+ err = c.Delete(ctx, &rbacv1.ClusterRoleBinding{ObjectMeta: metav1.ObjectMeta{Name: prefix + "-crb"}})
+ if client.IgnoreNotFound(err) != nil {
+ return err
+ }
+
+ return nil
+}
+
func makeMultiKueueSecret(ctx context.Context, c client.Client, namespace string, name string, kubeconfig []byte) error {
- w1Secret := &corev1.Secret{
+ secret := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
Name: name,
@@ -182,7 +206,17 @@ func makeMultiKueueSecret(ctx context.Context, c client.Client, namespace string
"kubeconfig": kubeconfig,
},
}
- return c.Create(ctx, w1Secret)
+ return c.Create(ctx, secret)
+}
+
+func cleanMultiKueueSecret(ctx context.Context, c client.Client, namespace string, name string) error {
+ secret := &corev1.Secret{
+ ObjectMeta: metav1.ObjectMeta{
+ Namespace: namespace,
+ Name: name,
+ },
+ }
+ return client.IgnoreNotFound(c.Delete(ctx, secret))
}
func TestAPIs(t *testing.T) {
@@ -233,8 +267,11 @@ var _ = ginkgo.BeforeSuite(func() {
util.WaitForJobSetAvailability(ctx, k8sWorker2Client)
// there should not be a kubeflow operator in manager cluster
- util.WaitForKubeFlowAvailability(ctx, k8sWorker1Client)
- util.WaitForKubeFlowAvailability(ctx, k8sWorker2Client)
+ util.WaitForKubeFlowTrainingOperatorAvailability(ctx, k8sWorker1Client)
+ util.WaitForKubeFlowTrainingOperatorAvailability(ctx, k8sWorker2Client)
+
+ util.WaitForKubeFlowMPIOperatorAvailability(ctx, k8sWorker1Client)
+ util.WaitForKubeFlowMPIOperatorAvailability(ctx, k8sWorker2Client)
ginkgo.GinkgoLogr.Info("Kueue and JobSet operators are available in all the clusters", "waitingTime", time.Since(waitForAvailableStart))
@@ -243,3 +280,11 @@ var _ = ginkgo.BeforeSuite(func() {
managerK8SVersion, err = kubeversion.FetchServerVersion(discoveryClient)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
})
+
+var _ = ginkgo.AfterSuite(func() {
+ gomega.Expect(cleanKubeconfigForMultiKueueSA(ctx, k8sWorker1Client, "kueue-system", "mksa")).To(gomega.Succeed())
+ gomega.Expect(cleanKubeconfigForMultiKueueSA(ctx, k8sWorker2Client, "kueue-system", "mksa")).To(gomega.Succeed())
+
+ gomega.Expect(cleanMultiKueueSecret(ctx, k8sManagerClient, "kueue-system", "multikueue1")).To(gomega.Succeed())
+ gomega.Expect(cleanMultiKueueSecret(ctx, k8sManagerClient, "kueue-system", "multikueue2")).To(gomega.Succeed())
+})
diff --git a/test/e2e/singlecluster/e2e_test.go b/test/e2e/singlecluster/e2e_test.go
index 4a02ad76c11..03d441a69d4 100644
--- a/test/e2e/singlecluster/e2e_test.go
+++ b/test/e2e/singlecluster/e2e_test.go
@@ -131,7 +131,7 @@ var _ = ginkgo.Describe("Kueue", func() {
ginkgo.It("Should unsuspend a job and set nodeSelectors", func() {
// Use a binary that ends.
- sampleJob = (&testingjob.JobWrapper{Job: *sampleJob}).Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).Obj()
+ sampleJob = (&testingjob.JobWrapper{Job: *sampleJob}).Image(util.E2eTestSleepImage, []string{"1ms"}).Obj()
gomega.Expect(k8sClient.Create(ctx, sampleJob)).Should(gomega.Succeed())
createdWorkload := &kueue.Workload{}
@@ -156,7 +156,7 @@ var _ = ginkgo.Describe("Kueue", func() {
sampleJob = (&testingjob.JobWrapper{Job: *sampleJob}).
Label(constants.PrebuiltWorkloadLabel, "prebuilt-wl").
BackoffLimit(0).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"-termination-code=1", "10m"}).
+ Image(util.E2eTestSleepImage, []string{"-termination-code=1", "10m"}).
TerminationGracePeriod(1).
Obj()
testingjob.SetContainerDefaults(&sampleJob.Spec.Template.Spec.Containers[0])
@@ -289,7 +289,7 @@ var _ = ginkgo.Describe("Kueue", func() {
// Use a binary that ends.
job := testingjob.MakeJob("job", ns.Name).
Queue("main").
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Request("cpu", "500m").
Parallelism(3).
Completions(4).
@@ -365,7 +365,7 @@ var _ = ginkgo.Describe("Kueue", func() {
ginkgo.It("Should unsuspend a job only after all checks are cleared", func() {
// Use a binary that ends.
- sampleJob = (&testingjob.JobWrapper{Job: *sampleJob}).Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).Obj()
+ sampleJob = (&testingjob.JobWrapper{Job: *sampleJob}).Image(util.E2eTestSleepImage, []string{"1ms"}).Obj()
gomega.Expect(k8sClient.Create(ctx, sampleJob)).Should(gomega.Succeed())
createdWorkload := &kueue.Workload{}
diff --git a/test/e2e/singlecluster/fair_sharing_test.go b/test/e2e/singlecluster/fair_sharing_test.go
index 3ad35a42633..be2df9c7df1 100644
--- a/test/e2e/singlecluster/fair_sharing_test.go
+++ b/test/e2e/singlecluster/fair_sharing_test.go
@@ -97,7 +97,7 @@ var _ = ginkgo.Describe("Fair Sharing", ginkgo.Ordered, ginkgo.ContinueOnFailure
for i := 0; i < 4; i++ {
job := jobtesting.MakeJob(fmt.Sprintf("j%d", i+1), ns.Name).
Queue(lq1.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ns"}).
+ Image(util.E2eTestSleepImage, []string{"1ns"}).
Parallelism(3).
Completions(3).
Request("cpu", "1").
diff --git a/test/e2e/singlecluster/jobset_test.go b/test/e2e/singlecluster/jobset_test.go
index ca9460904fc..88c0cf92842 100644
--- a/test/e2e/singlecluster/jobset_test.go
+++ b/test/e2e/singlecluster/jobset_test.go
@@ -23,6 +23,8 @@ import (
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
+ "k8s.io/utils/ptr"
+ "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/jobset/pkg/constants"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
@@ -84,7 +86,7 @@ var _ = ginkgo.Describe("JobSet", func() {
Replicas: 2,
Parallelism: 2,
Completions: 2,
- Image: "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0",
+ Image: util.E2eTestSleepImage,
// Give it the time to be observed Active in the live status update step.
Args: []string{"1ms"},
},
@@ -114,4 +116,101 @@ var _ = ginkgo.Describe("JobSet", func() {
})
})
})
+
+ ginkgo.When("Using resource flavors with node selectors", func() {
+ var (
+ onDemandRF *kueue.ResourceFlavor
+ spotRF *kueue.ResourceFlavor
+ localQueue *kueue.LocalQueue
+ clusterQueue *kueue.ClusterQueue
+ )
+ ginkgo.BeforeEach(func() {
+ onDemandRF = testing.MakeResourceFlavor("on-demand").
+ NodeLabel("instance-type", "on-demand").Obj()
+ gomega.Expect(k8sClient.Create(ctx, onDemandRF)).Should(gomega.Succeed())
+ spotRF = testing.MakeResourceFlavor("spot").
+ NodeLabel("instance-type", "spot").Obj()
+ gomega.Expect(k8sClient.Create(ctx, spotRF)).Should(gomega.Succeed())
+ clusterQueue = testing.MakeClusterQueue("cluster-queue").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("on-demand").
+ Resource(corev1.ResourceCPU, "1").
+ Resource(corev1.ResourceMemory, "1Gi").
+ Obj(),
+ *testing.MakeFlavorQuotas("spot").
+ Resource(corev1.ResourceCPU, "1").
+ Resource(corev1.ResourceMemory, "1Gi").
+ Obj(),
+ ).
+ Preemption(kueue.ClusterQueuePreemption{
+ WithinClusterQueue: kueue.PreemptionPolicyLowerPriority,
+ }).
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, clusterQueue)).Should(gomega.Succeed())
+ localQueue = testing.MakeLocalQueue("main", ns.Name).ClusterQueue("cluster-queue").Obj()
+ gomega.Expect(k8sClient.Create(ctx, localQueue)).Should(gomega.Succeed())
+ })
+ ginkgo.AfterEach(func() {
+ gomega.Expect(util.DeleteAllJobsetsInNamespace(ctx, k8sClient, ns)).Should(gomega.Succeed())
+ // Force remove workloads to be sure that cluster queue can be removed.
+ gomega.Expect(util.DeleteWorkloadsInNamespace(ctx, k8sClient, ns)).Should(gomega.Succeed())
+ gomega.Expect(util.DeleteObject(ctx, k8sClient, localQueue)).Should(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandRF, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, spotRF, true)
+ })
+
+ ginkgo.It("Should allow to suspend a JobSet when injected nodeSelector", func() {
+ jobSet := testingjobset.MakeJobSet("job-set-suspend", ns.Name).
+ Queue("main").
+ ReplicatedJobs(
+ testingjobset.ReplicatedJobRequirements{
+ Name: "replicated-job-1",
+ Replicas: 1,
+ Parallelism: 1,
+ Completions: 1,
+ Image: "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0",
+ Args: []string{"60s"},
+ },
+ ).
+ Request("replicated-job-1", "cpu", "500m").
+ Request("replicated-job-1", "memory", "200M").
+ Obj()
+
+ ginkgo.By("Creating the jobSet", func() {
+ gomega.Expect(k8sClient.Create(ctx, jobSet)).Should(gomega.Succeed())
+ })
+
+ ginkgo.By("Waiting for the jobSet to be unsuspended", func() {
+ jobKey := client.ObjectKeyFromObject(jobSet)
+ gomega.Eventually(func() *bool {
+ gomega.Expect(k8sClient.Get(ctx, jobKey, jobSet)).To(gomega.Succeed())
+ return jobSet.Spec.Suspend
+ }, util.Timeout, util.Interval).Should(gomega.BeEquivalentTo(ptr.To(false)))
+ })
+
+ ginkgo.By("Verify the jobSet has nodeSelector set", func() {
+ gomega.Expect(jobSet.Spec.ReplicatedJobs[0].Template.Spec.Template.Spec.NodeSelector).To(gomega.Equal(
+ map[string]string{
+ "instance-type": "on-demand",
+ },
+ ))
+ })
+
+ ginkgo.By("Stopping the ClusterQueue to make the JobSet be stopped and suspended")
+ gomega.Eventually(func() error {
+ gomega.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(clusterQueue), clusterQueue)).To(gomega.Succeed())
+ clusterQueue.Spec.StopPolicy = ptr.To(kueue.HoldAndDrain)
+ return k8sClient.Update(ctx, clusterQueue)
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ ginkgo.By("Waiting for the jobSet to be suspended", func() {
+ jobKey := client.ObjectKeyFromObject(jobSet)
+ gomega.Eventually(func() *bool {
+ gomega.Expect(k8sClient.Get(ctx, jobKey, jobSet)).To(gomega.Succeed())
+ return jobSet.Spec.Suspend
+ }, util.Timeout, util.Interval).Should(gomega.BeEquivalentTo(ptr.To(true)))
+ })
+ })
+ })
})
diff --git a/test/e2e/singlecluster/pod_test.go b/test/e2e/singlecluster/pod_test.go
index 9d2d9429516..660e519492a 100644
--- a/test/e2e/singlecluster/pod_test.go
+++ b/test/e2e/singlecluster/pod_test.go
@@ -93,7 +93,7 @@ var _ = ginkgo.Describe("Pod groups", func() {
ginkgo.It("should admit group that fits", func() {
group := podtesting.MakePod("group", ns.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Queue(lq.Name).
Request(corev1.ResourceCPU, "1").
MakeGroup(2)
@@ -136,7 +136,7 @@ var _ = ginkgo.Describe("Pod groups", func() {
ginkgo.It("Should only admit a complete group", func() {
group := podtesting.MakePod("group", ns.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Queue(lq.Name).
Request(corev1.ResourceCPU, "1").
MakeGroup(3)
@@ -190,7 +190,7 @@ var _ = ginkgo.Describe("Pod groups", func() {
groupName := "group"
group := podtesting.MakePod(groupName, ns.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
TerminationGracePeriod(1).
Queue(lq.Name).
Request(corev1.ResourceCPU, "1").
@@ -255,8 +255,8 @@ var _ = ginkgo.Describe("Pod groups", func() {
var p corev1.Pod
g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(rep), &p)).To(gomega.Succeed())
g.Expect(p.Spec.SchedulingGates).To(gomega.BeEmpty())
- g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(group[0]), &p)).To(testing.BeNotFoundError())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
+ expectPodFinalized(ctx, k8sClient, client.ObjectKeyFromObject(group[0]))
})
ginkgo.By("Excess pod is deleted", func() {
@@ -305,7 +305,7 @@ var _ = ginkgo.Describe("Pod groups", func() {
})
group := podtesting.MakePod("group", ns.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Queue(lq.Name).
Request(corev1.ResourceCPU, "1").
MakeGroup(2)
@@ -376,7 +376,7 @@ var _ = ginkgo.Describe("Pod groups", func() {
ginkgo.It("should allow to schedule a group of diverse pods", func() {
group := podtesting.MakePod("group", ns.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Queue(lq.Name).
Request(corev1.ResourceCPU, "3").
MakeGroup(2)
@@ -433,7 +433,7 @@ var _ = ginkgo.Describe("Pod groups", func() {
})
defaultPriorityGroup := podtesting.MakePod("default-priority-group", ns.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"-termination-code=1", "10m"}).
+ Image(util.E2eTestSleepImage, []string{"-termination-code=1", "10m"}).
TerminationGracePeriod(1).
Queue(lq.Name).
Request(corev1.ResourceCPU, "2").
@@ -458,7 +458,7 @@ var _ = ginkgo.Describe("Pod groups", func() {
})
highPriorityGroup := podtesting.MakePod("high-priority-group", ns.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Queue(lq.Name).
PriorityClass("high").
Request(corev1.ResourceCPU, "1").
@@ -563,6 +563,20 @@ var _ = ginkgo.Describe("Pod groups", func() {
})
})
+func expectPodFinalized(ctx context.Context, k8sClient client.Client, pKey client.ObjectKey) {
+ gomega.EventuallyWithOffset(1, func() error {
+ var p corev1.Pod
+ err := k8sClient.Get(ctx, pKey, &p)
+ if client.IgnoreNotFound(err) != nil {
+ return err
+ }
+ if err != nil || len(p.Finalizers) == 0 {
+ return nil
+ }
+ return fmt.Errorf("pod %s is not finalized yet", pKey)
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+}
+
func expectWorkloadFinalized(ctx context.Context, k8sClient client.Client, wlKey client.ObjectKey) {
gomega.EventuallyWithOffset(1, func() error {
var wl kueue.Workload
diff --git a/test/e2e/singlecluster/suite_test.go b/test/e2e/singlecluster/suite_test.go
index 8efdd700b57..13ac780d7f7 100644
--- a/test/e2e/singlecluster/suite_test.go
+++ b/test/e2e/singlecluster/suite_test.go
@@ -29,7 +29,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
- visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1beta1"
"sigs.k8s.io/kueue/test/util"
)
@@ -37,8 +37,8 @@ var (
kueuectlPath = filepath.Join("..", "..", "..", "bin", "kubectl-kueue")
k8sClient client.WithWatch
ctx context.Context
- visibilityClient visibilityv1alpha1.VisibilityV1alpha1Interface
- impersonatedVisibilityClient visibilityv1alpha1.VisibilityV1alpha1Interface
+ visibilityClient visibilityv1beta1.VisibilityV1beta1Interface
+ impersonatedVisibilityClient visibilityv1beta1.VisibilityV1beta1Interface
)
func TestAPIs(t *testing.T) {
diff --git a/test/e2e/singlecluster/visibility_test.go b/test/e2e/singlecluster/visibility_test.go
index a6c8035ab26..9b8082c6c07 100644
--- a/test/e2e/singlecluster/visibility_test.go
+++ b/test/e2e/singlecluster/visibility_test.go
@@ -30,7 +30,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
- visibility "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
"sigs.k8s.io/kueue/pkg/util/testing"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
"sigs.k8s.io/kueue/test/util"
@@ -111,7 +111,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
ginkgo.By("Schedule a job that when admitted workload blocks the queue", func() {
blockingJob = testingjob.MakeJob("test-job-1", nsA.Name).
Queue(localQueueA.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1m"}).
+ Image(util.E2eTestSleepImage, []string{"1m"}).
Request(corev1.ResourceCPU, "1").
TerminationGracePeriod(1).
BackoffLimit(0).
@@ -151,7 +151,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
ginkgo.By("Schedule a job which is pending due to lower priority", func() {
sampleJob2 = testingjob.MakeJob("test-job-2", nsA.Name).
Queue(localQueueA.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Request(corev1.ResourceCPU, "1").
PriorityClass(lowPriorityClass.Name).
Obj()
@@ -183,7 +183,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
info, err := visibilityClient.ClusterQueues().GetPendingWorkloadsSummary(ctx, clusterQueue.Name, metav1.GetOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
return info.Items
- }, util.Timeout, util.Interval).Should(gomega.BeEmpty())
+ }, util.LongTimeout, util.Interval).Should(gomega.BeEmpty())
})
})
@@ -213,7 +213,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
for _, jobCase := range jobCases {
job := testingjob.MakeJob(jobCase.JobName, nsA.Name).
Queue(jobCase.LocalQueueName).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Request(corev1.ResourceCPU, "1").
PriorityClass(jobCase.JobPrioClassName).
Obj()
@@ -272,7 +272,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
ginkgo.By("Schedule a job which is pending due to lower priority", func() {
sampleJob2 = testingjob.MakeJob("test-job-2", nsA.Name).
Queue(localQueueA.Name).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Request(corev1.ResourceCPU, "1").
PriorityClass(lowPriorityClass.Name).
Obj()
@@ -304,7 +304,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
info, err := visibilityClient.LocalQueues(nsA.Name).GetPendingWorkloadsSummary(ctx, localQueueA.Name, metav1.GetOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
return len(info.Items)
- }, util.Timeout, util.Interval).Should(gomega.Equal(0))
+ }, util.LongTimeout, util.Interval).Should(gomega.Equal(0))
})
})
@@ -334,7 +334,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
for _, jobCase := range jobCases {
job := testingjob.MakeJob(jobCase.JobName, nsA.Name).
Queue(jobCase.LocalQueueName).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Request(corev1.ResourceCPU, "1").
PriorityClass(jobCase.JobPrioClassName).
Obj()
@@ -427,7 +427,7 @@ var _ = ginkgo.Describe("Kueue visibility server", func() {
for _, jobCase := range jobCases {
job := testingjob.MakeJob(jobCase.JobName, jobCase.nsName).
Queue(jobCase.LocalQueueName).
- Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1ms"}).
+ Image(util.E2eTestSleepImage, []string{"1ms"}).
Request(corev1.ResourceCPU, "1").
PriorityClass(jobCase.JobPrioClassName).
Obj()
diff --git a/test/integration/controller/admissionchecks/provisioning/provisioning_test.go b/test/integration/controller/admissionchecks/provisioning/provisioning_test.go
index 42a68f79bac..a979156e256 100644
--- a/test/integration/controller/admissionchecks/provisioning/provisioning_test.go
+++ b/test/integration/controller/admissionchecks/provisioning/provisioning_test.go
@@ -54,16 +54,14 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
)
ginkgo.JustBeforeEach(func() {
- fwk = &framework.Framework{CRDPath: crdPath, DepCRDPaths: depCRDPaths, WebhookPath: webhookPath}
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
+ fwk.StartManager(ctx, cfg, managerSetup(
provisioning.WithMaxRetries(maxRetries),
provisioning.WithMinBackoffSeconds(minBackoffSeconds),
))
})
ginkgo.AfterEach(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.When("A workload is using a provision admission check", func() {
@@ -72,7 +70,6 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
wlKey types.NamespacedName
provReqKey types.NamespacedName
ac *kueue.AdmissionCheck
- pendingAC *kueue.AdmissionCheck
prc *kueue.ProvisioningRequestConfig
prc2 *kueue.ProvisioningRequestConfig
rf *kueue.ResourceFlavor
@@ -129,11 +126,6 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
Obj()
gomega.Expect(k8sClient.Create(ctx, ac)).To(gomega.Succeed())
- pendingAC = testing.MakeAdmissionCheck("pending-ac").
- ControllerName("dummy-controller").
- Obj()
- gomega.Expect(k8sClient.Create(ctx, pendingAC)).To(gomega.Succeed())
-
rf = testing.MakeResourceFlavor(flavorOnDemand).NodeLabel("ns1", "ns1v").Obj()
gomega.Expect(k8sClient.Create(ctx, rf)).To(gomega.Succeed())
@@ -141,11 +133,21 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
ResourceGroup(*testing.MakeFlavorQuotas(flavorOnDemand).
Resource(resourceGPU, "5", "5").Obj()).
Cohort("cohort").
- AdmissionChecks(ac.Name, pendingAC.Name).
+ AdmissionChecks(ac.Name).
Obj()
gomega.Expect(k8sClient.Create(ctx, cq)).To(gomega.Succeed())
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(cq), cq)).Should(gomega.Succeed())
+ g.Expect(apimeta.IsStatusConditionTrue(cq.Status.Conditions, kueue.ClusterQueueActive)).To(gomega.BeTrue())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
lq = testing.MakeLocalQueue("queue", ns.Name).ClusterQueue(cq.Name).Obj()
gomega.Expect(k8sClient.Create(ctx, lq)).To(gomega.Succeed())
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(lq), lq)).Should(gomega.Succeed())
+ g.Expect(apimeta.IsStatusConditionTrue(lq.Status.Conditions, kueue.LocalQueueActive)).To(gomega.BeTrue())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
wl := testing.MakeWorkload("wl", ns.Name).
Queue(lq.Name).
PodSets(
@@ -165,7 +167,6 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
"invalid-provreq-prefix/Foo": "Bar"}).
Obj()
gomega.Expect(k8sClient.Create(ctx, wl)).To(gomega.Succeed())
- util.SetWorkloadsAdmissionCheck(ctx, k8sClient, wl, pendingAC.Name, kueue.CheckStateReady, false)
wlKey = client.ObjectKeyFromObject(wl)
provReqKey = types.NamespacedName{
@@ -204,12 +205,11 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
util.ExpectObjectToBeDeleted(ctx, k8sClient, cq, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, rf, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, ac, true)
- util.ExpectObjectToBeDeleted(ctx, k8sClient, pendingAC, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, prc2, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, prc, true)
})
- ginkgo.It("Should not create provisioning requests before quota is reserved", func() {
+ ginkgo.It("Should not create provisioning requests before quota is reserved", framework.SlowSpec, func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func() error {
err := k8sClient.Get(ctx, wlKey, &updatedWl)
@@ -228,7 +228,7 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
- ginkgo.It("Should create provisioning requests after quota is reserved and preserve it when reservation is lost", func() {
+ ginkgo.It("Should create provisioning requests after quota is reserved and preserve it when reservation is lost", framework.SlowSpec, func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func() error {
err := k8sClient.Get(ctx, wlKey, &updatedWl)
@@ -318,7 +318,7 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
- ginkgo.It("Should set the condition ready when the provision succeed", func() {
+ ginkgo.It("Should set the condition ready when the provision succeed", framework.SlowSpec, func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func() error {
err := k8sClient.Get(ctx, wlKey, &updatedWl)
@@ -425,7 +425,7 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
- ginkgo.It("Should set the condition rejected when the provision fails", func() {
+ ginkgo.It("Should set the condition rejected when the provision fails", framework.SlowSpec, func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func() error {
err := k8sClient.Get(ctx, wlKey, &updatedWl)
@@ -501,7 +501,7 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
- ginkgo.It("Should set AdmissionCheck status to Rejected, deactivate Workload, emit an event, and bump metrics when workloads is not Finished, and the ProvisioningRequest's condition is set to CapacityRevoked", func() {
+ ginkgo.It("Should set AdmissionCheck status to Rejected, deactivate Workload, emit an event, and bump metrics when workloads is not Finished, and the ProvisioningRequest's condition is set to CapacityRevoked", framework.SlowSpec, func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).Should(gomega.Succeed())
@@ -573,7 +573,7 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
- ginkgo.It("Should set AdmissionCheck status to Rejected, deactivate Workload, emit an event, and bump metrics when workloads is not Admitted, and the ProvisioningRequest's condition is set to CapacityRevoked", func() {
+ ginkgo.It("Should set AdmissionCheck status to Rejected, deactivate Workload, emit an event, and bump metrics when workloads is not Admitted, and the ProvisioningRequest's condition is set to CapacityRevoked", framework.SlowSpec, func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).Should(gomega.Succeed())
@@ -712,7 +712,7 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
- ginkgo.It("Should ignore the change if Workload is Admitted and the ProvisioningRequest's condition is set to BookingExpired", func() {
+ ginkgo.It("Should ignore the change if Workload is Admitted and the ProvisioningRequest's condition is set to BookingExpired", framework.SlowSpec, func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).Should(gomega.Succeed())
@@ -771,101 +771,6 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
- ginkgo.It("Should reject an admission check if a workload is not Admitted, the ProvisioningRequest's condition is set to BookingExpired, and there is no retries left", func() {
- ginkgo.By("Setting the admission check to the workload", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).Should(gomega.Succeed())
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
-
- util.SetWorkloadsAdmissionCheck(ctx, k8sClient, &updatedWl, ac.Name, kueue.CheckStatePending, false)
- util.SetWorkloadsAdmissionCheck(ctx, k8sClient, &updatedWl, pendingAC.Name, kueue.CheckStatePending, true)
- })
-
- ginkgo.By("Setting the quota reservation to the workload", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).Should(gomega.Succeed())
- gomega.Expect(util.SetQuotaReservation(ctx, k8sClient, &updatedWl, admission)).To(gomega.Succeed())
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
- })
-
- ginkgo.By("Setting the provisioning request as Provisioned", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, provReqKey, &createdRequest)).To(gomega.Succeed())
- apimeta.SetStatusCondition(&createdRequest.Status.Conditions, metav1.Condition{
- Type: autoscaling.Provisioned,
- Status: metav1.ConditionTrue,
- Reason: autoscaling.Provisioned,
- })
- g.Expect(k8sClient.Status().Update(ctx, &createdRequest)).Should(gomega.Succeed())
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
- })
-
- ginkgo.By("Checking if one admission check is ready, and the other is pending thus workload is not admitted", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
-
- g.Expect(updatedWl.Status.AdmissionChecks).To(gomega.ContainElement(gomega.BeComparableTo(
- kueue.AdmissionCheckState{
- Name: ac.Name,
- State: kueue.CheckStateReady,
- },
- cmpopts.IgnoreFields(kueue.AdmissionCheckState{}, "LastTransitionTime", "PodSetUpdates"))))
- g.Expect(updatedWl.Status.AdmissionChecks).To(gomega.ContainElement(gomega.BeComparableTo(
- kueue.AdmissionCheckState{
- Name: pendingAC.Name,
- State: kueue.CheckStatePending,
- },
- cmpopts.IgnoreFields(kueue.AdmissionCheckState{}, "LastTransitionTime", "PodSetUpdates"))))
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
-
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
- g.Expect(workload.IsAdmitted(&updatedWl)).To(gomega.BeFalse(), "The Workload should not be admitted")
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
- })
-
- ginkgo.By("Setting the ProvisioningRequest as BookingExpired", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, provReqKey, &createdRequest)).Should(gomega.Succeed())
- apimeta.SetStatusCondition(&createdRequest.Status.Conditions, metav1.Condition{
- Type: autoscaling.BookingExpired,
- Status: metav1.ConditionTrue,
- Reason: autoscaling.BookingExpired,
- })
- g.Expect(k8sClient.Status().Update(ctx, &createdRequest)).Should(gomega.Succeed())
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
- })
-
- ginkgo.By("Checking if workload is deactivated, has Rejected status in the status.admissionCheck[*] field, an event is emitted and a metric is increased", func() {
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
- g.Expect(updatedWl.Status.AdmissionChecks).To(gomega.ContainElement(gomega.BeComparableTo(
- kueue.AdmissionCheckState{
- Name: ac.Name,
- State: kueue.CheckStateRejected,
- },
- cmpopts.IgnoreFields(kueue.AdmissionCheckState{}, "LastTransitionTime", "PodSetUpdates"))))
- g.Expect(workload.IsActive(&updatedWl)).To(gomega.BeFalse(), "The workload should be deactivated")
-
- ok, err := testing.HasEventAppeared(ctx, k8sClient, corev1.Event{
- Reason: "AdmissionCheckRejected",
- Type: corev1.EventTypeWarning,
- Message: fmt.Sprintf("Deactivating workload because AdmissionCheck for %v was Rejected: ", ac.Name),
- })
- g.Expect(err).NotTo(gomega.HaveOccurred())
- g.Expect(ok).To(gomega.BeTrue(), "The event should have appeared")
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
-
- gomega.Eventually(func(g gomega.Gomega) {
- g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
-
- g.Expect(workload.IsEvictedByDeactivation(&updatedWl)).To(gomega.BeTrue(), "The workload should be evicted by deactivation")
- }, util.Timeout, util.Interval).Should(gomega.Succeed())
-
- util.ExpectEvictedWorkloadsTotalMetric(cq.Name, kueue.WorkloadEvictedByDeactivation, 1)
- })
- })
-
ginkgo.It("Should keep the provisioning config in sync", func() {
ginkgo.By("Setting the admission check to the workload", func() {
gomega.Eventually(func() error {
@@ -942,7 +847,7 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
if err != nil {
return err
}
- updatedAC.Spec.Parameters.Name = "prov-config2"
+ updatedAC.Spec.Parameters.Name = prc2.Name
return k8sClient.Update(ctx, updatedAC)
}, util.Timeout, util.Interval).Should(gomega.Succeed())
})
@@ -1095,6 +1000,249 @@ var _ = ginkgo.Describe("Provisioning", ginkgo.Ordered, ginkgo.ContinueOnFailure
})
})
+ ginkgo.When("A workload is using a pending provision admission check", func() {
+ var (
+ ns *corev1.Namespace
+ wlKey types.NamespacedName
+ provReqKey types.NamespacedName
+ ac *kueue.AdmissionCheck
+ pendingAC *kueue.AdmissionCheck
+ prc *kueue.ProvisioningRequestConfig
+ rf *kueue.ResourceFlavor
+ cq *kueue.ClusterQueue
+ lq *kueue.LocalQueue
+ admission *kueue.Admission
+ createdRequest autoscaling.ProvisioningRequest
+ updatedWl kueue.Workload
+ )
+
+ ginkgo.BeforeEach(func() {
+ maxRetries = 0
+ })
+
+ ginkgo.JustBeforeEach(func() {
+ ns = &corev1.Namespace{
+ ObjectMeta: metav1.ObjectMeta{
+ GenerateName: "provisioning-",
+ },
+ }
+ gomega.Expect(k8sClient.Create(ctx, ns)).To(gomega.Succeed())
+
+ prc = &kueue.ProvisioningRequestConfig{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "prov-config",
+ },
+ Spec: kueue.ProvisioningRequestConfigSpec{
+ ProvisioningClassName: "provisioning-class",
+ Parameters: map[string]kueue.Parameter{
+ "p1": "v1",
+ "p2": "v2",
+ },
+ },
+ }
+ gomega.Expect(k8sClient.Create(ctx, prc)).To(gomega.Succeed())
+
+ ac = testing.MakeAdmissionCheck("ac-prov").
+ ControllerName(provisioning.ControllerName).
+ Parameters(kueue.GroupVersion.Group, "ProvisioningRequestConfig", prc.Name).
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, ac)).To(gomega.Succeed())
+
+ pendingAC = testing.MakeAdmissionCheck("pending-ac").
+ ControllerName("dummy-controller").
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, pendingAC)).To(gomega.Succeed())
+
+ rf = testing.MakeResourceFlavor(flavorOnDemand).NodeLabel("ns1", "ns1v").Obj()
+ gomega.Expect(k8sClient.Create(ctx, rf)).To(gomega.Succeed())
+
+ cq = testing.MakeClusterQueue("cluster-queue").
+ ResourceGroup(*testing.MakeFlavorQuotas(flavorOnDemand).
+ Resource(resourceGPU, "5", "5").Obj()).
+ Cohort("cohort").
+ AdmissionChecks(ac.Name, pendingAC.Name).
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, cq)).To(gomega.Succeed())
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(cq), cq)).Should(gomega.Succeed())
+ g.Expect(cq.Status.Conditions).To(gomega.ContainElements(gomega.BeComparableTo(metav1.Condition{
+ Type: kueue.ClusterQueueActive,
+ Status: metav1.ConditionFalse,
+ Reason: "AdmissionCheckInactive",
+ Message: "Can't admit new workloads: references inactive AdmissionCheck(s): [pending-ac].",
+ }, util.IgnoreConditionTimestampsAndObservedGeneration)))
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ lq = testing.MakeLocalQueue("queue", ns.Name).ClusterQueue(cq.Name).Obj()
+ gomega.Expect(k8sClient.Create(ctx, lq)).To(gomega.Succeed())
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(lq), lq)).Should(gomega.Succeed())
+ g.Expect(lq.Status.Conditions).To(gomega.ContainElements(gomega.BeComparableTo(metav1.Condition{
+ Type: kueue.LocalQueueActive,
+ Status: metav1.ConditionFalse,
+ Reason: "ClusterQueueIsInactive",
+ Message: "Can't submit new workloads to clusterQueue",
+ }, util.IgnoreConditionTimestampsAndObservedGeneration)))
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ wl := testing.MakeWorkload("wl", ns.Name).
+ Queue(lq.Name).
+ PodSets(
+ *testing.MakePodSet("ps1", 3).
+ Request(corev1.ResourceCPU, "1").
+ Image("image").
+ Obj(),
+ *testing.MakePodSet("ps2", 6).
+ Request(corev1.ResourceCPU, "500m").
+ Request(customResourceOne, "1").
+ Limit(customResourceOne, "1").
+ Image("image").
+ Obj(),
+ ).
+ Annotations(map[string]string{
+ "provreq.kueue.x-k8s.io/ValidUntilSeconds": "0",
+ "invalid-provreq-prefix/Foo": "Bar"}).
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, wl)).To(gomega.Succeed())
+ util.SetWorkloadsAdmissionCheck(ctx, k8sClient, wl, pendingAC.Name, kueue.CheckStateReady, false)
+
+ wlKey = client.ObjectKeyFromObject(wl)
+ provReqKey = types.NamespacedName{
+ Namespace: wlKey.Namespace,
+ Name: provisioning.ProvisioningRequestName(wlKey.Name, ac.Name, 1),
+ }
+
+ admission = testing.MakeAdmission(cq.Name).
+ PodSets(
+ kueue.PodSetAssignment{
+ Name: "ps1",
+ Flavors: map[corev1.ResourceName]kueue.ResourceFlavorReference{
+ corev1.ResourceCPU: kueue.ResourceFlavorReference(rf.Name),
+ },
+ ResourceUsage: map[corev1.ResourceName]resource.Quantity{
+ corev1.ResourceCPU: resource.MustParse("3"),
+ },
+ Count: ptr.To[int32](3),
+ },
+ kueue.PodSetAssignment{
+ Name: "ps2",
+ Flavors: map[corev1.ResourceName]kueue.ResourceFlavorReference{
+ corev1.ResourceCPU: kueue.ResourceFlavorReference(rf.Name),
+ },
+ ResourceUsage: map[corev1.ResourceName]resource.Quantity{
+ corev1.ResourceCPU: resource.MustParse("2"),
+ },
+ Count: ptr.To[int32](4),
+ },
+ ).
+ Obj()
+ })
+
+ ginkgo.AfterEach(func() {
+ gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, cq, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, rf, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, ac, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, pendingAC, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, prc, true)
+ })
+
+ ginkgo.It("Should reject an admission check if a workload is not Admitted, the ProvisioningRequest's condition is set to BookingExpired, and there is no retries left", func() {
+ ginkgo.By("Setting the admission check to the workload", func() {
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).Should(gomega.Succeed())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ util.SetWorkloadsAdmissionCheck(ctx, k8sClient, &updatedWl, ac.Name, kueue.CheckStatePending, false)
+ util.SetWorkloadsAdmissionCheck(ctx, k8sClient, &updatedWl, pendingAC.Name, kueue.CheckStatePending, true)
+ })
+
+ ginkgo.By("Setting the quota reservation to the workload", func() {
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).Should(gomega.Succeed())
+ gomega.Expect(util.SetQuotaReservation(ctx, k8sClient, &updatedWl, admission)).To(gomega.Succeed())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+
+ ginkgo.By("Setting the provisioning request as Provisioned", func() {
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, provReqKey, &createdRequest)).To(gomega.Succeed())
+ apimeta.SetStatusCondition(&createdRequest.Status.Conditions, metav1.Condition{
+ Type: autoscaling.Provisioned,
+ Status: metav1.ConditionTrue,
+ Reason: autoscaling.Provisioned,
+ })
+ g.Expect(k8sClient.Status().Update(ctx, &createdRequest)).Should(gomega.Succeed())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+
+ ginkgo.By("Checking if one admission check is ready, and the other is pending thus workload is not admitted", func() {
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
+
+ g.Expect(updatedWl.Status.AdmissionChecks).To(gomega.ContainElement(gomega.BeComparableTo(
+ kueue.AdmissionCheckState{
+ Name: ac.Name,
+ State: kueue.CheckStateReady,
+ },
+ cmpopts.IgnoreFields(kueue.AdmissionCheckState{}, "LastTransitionTime", "PodSetUpdates"))))
+ g.Expect(updatedWl.Status.AdmissionChecks).To(gomega.ContainElement(gomega.BeComparableTo(
+ kueue.AdmissionCheckState{
+ Name: pendingAC.Name,
+ State: kueue.CheckStatePending,
+ },
+ cmpopts.IgnoreFields(kueue.AdmissionCheckState{}, "LastTransitionTime", "PodSetUpdates"))))
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
+ g.Expect(workload.IsAdmitted(&updatedWl)).To(gomega.BeFalse(), "The Workload should not be admitted")
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+
+ ginkgo.By("Setting the ProvisioningRequest as BookingExpired", func() {
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, provReqKey, &createdRequest)).Should(gomega.Succeed())
+ apimeta.SetStatusCondition(&createdRequest.Status.Conditions, metav1.Condition{
+ Type: autoscaling.BookingExpired,
+ Status: metav1.ConditionTrue,
+ Reason: autoscaling.BookingExpired,
+ })
+ g.Expect(k8sClient.Status().Update(ctx, &createdRequest)).Should(gomega.Succeed())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+
+ ginkgo.By("Checking if workload is deactivated, has Rejected status in the status.admissionCheck[*] field, an event is emitted and a metric is increased", func() {
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
+ g.Expect(updatedWl.Status.AdmissionChecks).To(gomega.ContainElement(gomega.BeComparableTo(
+ kueue.AdmissionCheckState{
+ Name: ac.Name,
+ State: kueue.CheckStateRejected,
+ },
+ cmpopts.IgnoreFields(kueue.AdmissionCheckState{}, "LastTransitionTime", "PodSetUpdates"))))
+ g.Expect(workload.IsActive(&updatedWl)).To(gomega.BeFalse(), "The workload should be deactivated")
+
+ ok, err := testing.HasEventAppeared(ctx, k8sClient, corev1.Event{
+ Reason: "AdmissionCheckRejected",
+ Type: corev1.EventTypeWarning,
+ Message: fmt.Sprintf("Deactivating workload because AdmissionCheck for %v was Rejected: ", ac.Name),
+ })
+ g.Expect(err).NotTo(gomega.HaveOccurred())
+ g.Expect(ok).To(gomega.BeTrue(), "The event should have appeared")
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, wlKey, &updatedWl)).To(gomega.Succeed())
+
+ g.Expect(workload.IsEvictedByDeactivation(&updatedWl)).To(gomega.BeTrue(), "The workload should be evicted by deactivation")
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ util.ExpectEvictedWorkloadsTotalMetric(cq.Name, kueue.WorkloadEvictedByDeactivation, 1)
+ })
+ })
+ })
+
ginkgo.When("A workload is using a provision admission check with retry", func() {
var (
ns *corev1.Namespace
diff --git a/test/integration/controller/admissionchecks/provisioning/suite_test.go b/test/integration/controller/admissionchecks/provisioning/suite_test.go
index faf4de97ace..50896996cd6 100644
--- a/test/integration/controller/admissionchecks/provisioning/suite_test.go
+++ b/test/integration/controller/admissionchecks/provisioning/suite_test.go
@@ -23,7 +23,6 @@ import (
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
- autoscaling "k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/autoscaling.x-k8s.io/v1beta1"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
@@ -56,6 +55,16 @@ func TestProvisioning(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{CRDPath: crdPath, DepCRDPaths: depCRDPaths, WebhookPath: webhookPath}
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...provisioning.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
err := indexer.Setup(ctx, mgr.GetFieldIndexer())
@@ -75,9 +84,6 @@ func managerSetup(opts ...provisioning.Option) framework.ManagerSetup {
failedCtrl, err := core.SetupControllers(mgr, queues, cCache, controllersCfg)
gomega.Expect(err).ToNot(gomega.HaveOccurred(), "controller", failedCtrl)
- err = autoscaling.AddToScheme(mgr.GetScheme())
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
-
err = provisioning.SetupIndexer(ctx, mgr.GetFieldIndexer())
gomega.Expect(err).NotTo(gomega.HaveOccurred())
diff --git a/test/integration/controller/core/admissioncheck_controller_test.go b/test/integration/controller/core/admissioncheck_controller_test.go
index 1577a55b813..f69005f3a5b 100644
--- a/test/integration/controller/core/admissioncheck_controller_test.go
+++ b/test/integration/controller/core/admissioncheck_controller_test.go
@@ -26,7 +26,6 @@ import (
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -36,12 +35,11 @@ var _ = ginkgo.Describe("AdmissionCheck controller", ginkgo.Ordered, ginkgo.Cont
var ns *corev1.Namespace
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
+ fwk.StartManager(ctx, cfg, managerSetup)
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/core/clusterqueue_controller_test.go b/test/integration/controller/core/clusterqueue_controller_test.go
index 8cc78519a52..cd0c020c307 100644
--- a/test/integration/controller/core/clusterqueue_controller_test.go
+++ b/test/integration/controller/core/clusterqueue_controller_test.go
@@ -84,12 +84,11 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
+ fwk.StartManager(ctx, cfg, managerSetup)
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -151,7 +150,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
util.ExpectObjectToBeDeleted(ctx, k8sClient, ac, true)
})
- ginkgo.It("Should update status and report metrics when workloads are assigned and finish", func() {
+ ginkgo.It("Should update status and report metrics when workloads are assigned and finish", framework.SlowSpec, func() {
workloads := []*kueue.Workload{
testing.MakeWorkload("one", ns.Name).Queue(localQueue.Name).
Request(corev1.ResourceCPU, "2").Request(resourceGPU, "2").Obj(),
@@ -201,7 +200,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
Reason: "FlavorNotFound",
- Message: "Can't admit new workloads: FlavorNotFound",
+ Message: "Can't admit new workloads: references missing ResourceFlavor(s): [on-demand spot model-a model-b].",
},
},
}, util.IgnoreConditionTimestampsAndObservedGeneration, ignorePendingWorkloadsStatus))
@@ -384,7 +383,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
Reason: "FlavorNotFound",
- Message: "Can't admit new workloads: FlavorNotFound",
+ Message: "Can't admit new workloads: references missing ResourceFlavor(s): [on-demand spot model-a model-b].",
},
},
}, util.IgnoreConditionTimestampsAndObservedGeneration, ignorePendingWorkloadsStatus))
@@ -410,7 +409,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
Reason: "FlavorNotFound",
- Message: "Can't admit new workloads: FlavorNotFound",
+ Message: "Can't admit new workloads: references missing ResourceFlavor(s): [on-demand spot model-a model-b].",
},
},
}, util.IgnoreConditionTimestampsAndObservedGeneration, ignorePendingWorkloadsStatus))
@@ -418,7 +417,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
util.ExpectReservingActiveWorkloadsMetric(clusterQueue, 0)
})
- ginkgo.It("Should update status when workloads have reclaimable pods", func() {
+ ginkgo.It("Should update status when workloads have reclaimable pods", framework.SlowSpec, func() {
ginkgo.By("Creating ResourceFlavors", func() {
onDemandFlavor = testing.MakeResourceFlavor(flavorOnDemand).Obj()
gomega.Expect(k8sClient.Create(ctx, onDemandFlavor)).To(gomega.Succeed())
@@ -652,7 +651,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
Reason: "FlavorNotFound",
- Message: "Can't admit new workloads: FlavorNotFound",
+ Message: "Can't admit new workloads: references missing ResourceFlavor(s): [arch-a arch-b].",
},
}, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -668,7 +667,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
Reason: "FlavorNotFound",
- Message: "Can't admit new workloads: FlavorNotFound",
+ Message: "Can't admit new workloads: references missing ResourceFlavor(s): [arch-b].",
},
}, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -706,8 +705,8 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
{
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
- Reason: "CheckNotFoundOrInactive",
- Message: "Can't admit new workloads: CheckNotFoundOrInactive",
+ Reason: "AdmissionCheckNotFound",
+ Message: "Can't admit new workloads: references missing AdmissionCheck(s): [check1 check2].",
},
}, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -723,8 +722,8 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
{
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
- Reason: "CheckNotFoundOrInactive",
- Message: "Can't admit new workloads: CheckNotFoundOrInactive",
+ Reason: "AdmissionCheckNotFound",
+ Message: "Can't admit new workloads: references missing AdmissionCheck(s): [check2].",
},
}, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -739,8 +738,8 @@ var _ = ginkgo.Describe("ClusterQueue controller", ginkgo.Ordered, ginkgo.Contin
{
Type: kueue.ClusterQueueActive,
Status: metav1.ConditionFalse,
- Reason: "CheckNotFoundOrInactive",
- Message: "Can't admit new workloads: CheckNotFoundOrInactive",
+ Reason: "AdmissionCheckInactive",
+ Message: "Can't admit new workloads: references inactive AdmissionCheck(s): [check2].",
},
}, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -840,12 +839,11 @@ var _ = ginkgo.Describe("ClusterQueue controller with queue visibility is enable
ginkgo.By("Enabling queue visibility feature", func() {
gomega.Expect(features.SetEnable(features.QueueVisibility, true)).To(gomega.Succeed())
})
- fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
+ fwk.StartManager(ctx, cfg, managerSetup)
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -888,7 +886,7 @@ var _ = ginkgo.Describe("ClusterQueue controller with queue visibility is enable
util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
})
- ginkgo.It("Should update of the pending workloads when a new workload is scheduled", func() {
+ ginkgo.It("Should update of the pending workloads when a new workload is scheduled", framework.SlowSpec, func() {
const lowPrio, midLowerPrio, midHigherPrio, highPrio = 0, 10, 20, 100
workloadsFirstBatch := []*kueue.Workload{
testing.MakeWorkload("one", ns.Name).Queue(localQueue.Name).Priority(highPrio).
diff --git a/test/integration/controller/core/localqueue_controller_test.go b/test/integration/controller/core/localqueue_controller_test.go
index 571717b0444..2394c2578d8 100644
--- a/test/integration/controller/core/localqueue_controller_test.go
+++ b/test/integration/controller/core/localqueue_controller_test.go
@@ -49,12 +49,11 @@ var _ = ginkgo.Describe("Queue controller", ginkgo.Ordered, ginkgo.ContinueOnFai
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
+ fwk.StartManager(ctx, cfg, managerSetup)
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -166,7 +165,7 @@ var _ = ginkgo.Describe("Queue controller", ginkgo.Ordered, ginkgo.ContinueOnFai
}, util.IgnoreConditionTimestampsAndObservedGeneration))
})
- ginkgo.It("Should update status when workloads are created", func() {
+ ginkgo.It("Should update status when workloads are created", framework.SlowSpec, func() {
ginkgo.By("Creating resourceFlavors")
for _, rf := range resourceFlavors {
gomega.Expect(k8sClient.Create(ctx, &rf)).To(gomega.Succeed())
diff --git a/test/integration/controller/core/resourceflavor_controller_test.go b/test/integration/controller/core/resourceflavor_controller_test.go
index d644528ea58..7824146f3e7 100644
--- a/test/integration/controller/core/resourceflavor_controller_test.go
+++ b/test/integration/controller/core/resourceflavor_controller_test.go
@@ -26,7 +26,6 @@ import (
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -36,12 +35,11 @@ var _ = ginkgo.Describe("ResourceFlavor controller", ginkgo.Ordered, ginkgo.Cont
var ns *corev1.Namespace
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
+ fwk.StartManager(ctx, cfg, managerSetup)
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/core/suite_test.go b/test/integration/controller/core/suite_test.go
index d29af161012..a815aa43798 100644
--- a/test/integration/controller/core/suite_test.go
+++ b/test/integration/controller/core/suite_test.go
@@ -53,6 +53,16 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(ctx context.Context, mgr manager.Manager) {
err := indexer.Setup(ctx, mgr.GetFieldIndexer())
gomega.Expect(err).NotTo(gomega.HaveOccurred())
diff --git a/test/integration/controller/core/workload_controller_test.go b/test/integration/controller/core/workload_controller_test.go
index 38a64f8624a..c8991bfd73b 100644
--- a/test/integration/controller/core/workload_controller_test.go
+++ b/test/integration/controller/core/workload_controller_test.go
@@ -30,7 +30,6 @@ import (
"sigs.k8s.io/kueue/pkg/util/slices"
"sigs.k8s.io/kueue/pkg/util/testing"
"sigs.k8s.io/kueue/pkg/workload"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -50,12 +49,11 @@ var _ = ginkgo.Describe("Workload controller", ginkgo.Ordered, ginkgo.ContinueOn
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
+ fwk.StartManager(ctx, cfg, managerSetup)
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/jobframework/setup/setup_controllers_test.go b/test/integration/controller/jobframework/setup/setup_controllers_test.go
new file mode 100644
index 00000000000..dbd8dca2b21
--- /dev/null
+++ b/test/integration/controller/jobframework/setup/setup_controllers_test.go
@@ -0,0 +1,133 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package job
+
+import (
+ "github.com/google/go-cmp/cmp/cmpopts"
+ "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/utils/ptr"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ jobsetapi "sigs.k8s.io/jobset/api/jobset/v1alpha2"
+
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/jobset"
+ "sigs.k8s.io/kueue/pkg/util/testing"
+ testingjobset "sigs.k8s.io/kueue/pkg/util/testingjobs/jobset"
+ "sigs.k8s.io/kueue/test/integration/framework"
+ "sigs.k8s.io/kueue/test/util"
+)
+
+var _ = ginkgo.Describe("Setup Controllers", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+ var (
+ ns *corev1.Namespace
+ flavor *kueue.ResourceFlavor
+ clusterQueue *kueue.ClusterQueue
+ localQueue *kueue.LocalQueue
+ )
+
+ ginkgo.BeforeEach(func() {
+ fwk = &framework.Framework{CRDPath: crdPath}
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithEnabledFrameworks([]string{jobset.FrameworkName})))
+
+ ns = &corev1.Namespace{
+ ObjectMeta: metav1.ObjectMeta{
+ GenerateName: "jobset-",
+ },
+ }
+ gomega.Expect(k8sClient.Create(ctx, ns)).To(gomega.Succeed())
+
+ flavor = testing.MakeResourceFlavor("on-demand").Obj()
+ gomega.Expect(k8sClient.Create(ctx, flavor)).Should(gomega.Succeed())
+
+ clusterQueue = testing.MakeClusterQueue("cluster-queue").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas(flavor.Name).
+ Resource(corev1.ResourceCPU, "5").
+ Obj(),
+ ).Obj()
+
+ gomega.Expect(k8sClient.Create(ctx, clusterQueue)).Should(gomega.Succeed())
+ localQueue = testing.MakeLocalQueue("queue", ns.Name).ClusterQueue(clusterQueue.Name).Obj()
+ })
+
+ ginkgo.AfterEach(func() {
+ gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, flavor, true)
+
+ fwk.StopManager(ctx)
+ fwk.Teardown()
+ })
+
+ ginkgo.It("Should setup controller and webhook after CRD installation", framework.SlowSpec, func() {
+ jobSet := testingjobset.MakeJobSet("jobset", ns.Name).
+ ReplicatedJobs(testingjobset.ReplicatedJobRequirements{
+ Name: "replicated-job-1",
+ Replicas: 1,
+ Parallelism: 1,
+ Completions: 1,
+ }).
+ Suspend(false).
+ Queue(localQueue.Name).
+ Obj()
+
+ ginkgo.By("Check that the JobSet CRDs are not installed", func() {
+ gomega.Expect(k8sClient.Create(ctx, jobSet)).To(gomega.BeComparableTo(&meta.NoKindMatchError{}, cmpopts.EquateErrors()))
+ })
+
+ ginkgo.By("Install the JobSet CRDs", func() {
+ options := envtest.CRDInstallOptions{
+ Paths: []string{jobsetCrdPath},
+ ErrorIfPathMissing: true,
+ CleanUpAfterUse: true,
+ }
+ _, err := envtest.InstallCRDs(cfg, options)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ })
+
+ ginkgo.By("Create a JobSet", func() {
+ gomega.Expect(k8sClient.Create(ctx, jobSet)).To(gomega.Succeed())
+ })
+
+ ginkgo.By("Check that the JobSet was created and got suspended", func() {
+ createdJobSet := &jobsetapi.JobSet{}
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, types.NamespacedName{Name: jobSet.Name, Namespace: ns.Name}, createdJobSet)).Should(gomega.Succeed())
+ g.Expect(ptr.Deref(createdJobSet.Spec.Suspend, false)).Should(gomega.BeTrue())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+
+ ginkgo.By("Check that the workload was created", func() {
+ wlLookupKey := types.NamespacedName{
+ Name: jobset.GetWorkloadNameForJobSet(jobSet.Name, jobSet.UID),
+ Namespace: ns.Name,
+ }
+ createdWorkload := &kueue.Workload{}
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, wlLookupKey, createdWorkload)).To(gomega.Succeed())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+ })
+})
diff --git a/test/integration/controller/jobframework/setup/suite_test.go b/test/integration/controller/jobframework/setup/suite_test.go
new file mode 100644
index 00000000000..ce31a7d5202
--- /dev/null
+++ b/test/integration/controller/jobframework/setup/suite_test.go
@@ -0,0 +1,58 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package job
+
+import (
+ "context"
+ "path/filepath"
+ "testing"
+
+ "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/manager"
+
+ "sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/test/integration/framework"
+)
+
+var (
+ cfg *rest.Config
+ k8sClient client.Client
+ ctx context.Context
+ fwk *framework.Framework
+ crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
+ jobsetCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "jobset-operator")
+)
+
+func TestAPIs(t *testing.T) {
+ gomega.RegisterFailHandler(ginkgo.Fail)
+
+ ginkgo.RunSpecs(t,
+ "Setup Controllers Suite",
+ )
+}
+
+func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
+ return func(ctx context.Context, mgr manager.Manager) {
+ gomega.Expect(jobframework.SetupIndexes(ctx, mgr.GetFieldIndexer(), opts...)).NotTo(gomega.HaveOccurred())
+ // The integration manager is a shared state and that after enabled a framework
+ // will remain enabled until the end of the test suite.
+ gomega.Expect(jobframework.SetupControllers(ctx, mgr, ginkgo.GinkgoLogr, opts...)).NotTo(gomega.HaveOccurred())
+ }
+}
diff --git a/test/integration/controller/jobs/deployment/suite_test.go b/test/integration/controller/jobs/deployment/suite_test.go
deleted file mode 100644
index 05e0edd797a..00000000000
--- a/test/integration/controller/jobs/deployment/suite_test.go
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Copyright 2024 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package deployment
-
-import (
- "context"
- "path/filepath"
- "testing"
-
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"
- appsv1 "k8s.io/api/apps/v1"
- "k8s.io/client-go/rest"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-
- config "sigs.k8s.io/kueue/apis/config/v1beta1"
- "sigs.k8s.io/kueue/pkg/cache"
- "sigs.k8s.io/kueue/pkg/constants"
- "sigs.k8s.io/kueue/pkg/controller/core"
- "sigs.k8s.io/kueue/pkg/controller/core/indexer"
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
- "sigs.k8s.io/kueue/pkg/controller/jobs/deployment"
- "sigs.k8s.io/kueue/pkg/queue"
- "sigs.k8s.io/kueue/pkg/util/kubeversion"
- "sigs.k8s.io/kueue/pkg/webhooks"
- "sigs.k8s.io/kueue/test/integration/framework"
-)
-
-var (
- cfg *rest.Config
- k8sClient client.Client
- serverVersionFetcher *kubeversion.ServerVersionFetcher
- ctx context.Context
- fwk *framework.Framework
- crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
-)
-
-func TestAPIs(t *testing.T) {
- gomega.RegisterFailHandler(ginkgo.Fail)
-
- ginkgo.RunSpecs(t,
- "Deployment Controller Suite",
- )
-}
-
-func managerSetup(configuration *config.Configuration, opts ...jobframework.Option) framework.ManagerSetup {
- if configuration == nil {
- configuration = &config.Configuration{}
- }
- return func(ctx context.Context, mgr manager.Manager) {
- err := indexer.Setup(ctx, mgr.GetFieldIndexer())
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
-
- err = deployment.SetupIndexes(ctx, mgr.GetFieldIndexer())
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
-
- deploymentReconcilerFactory := jobframework.NewNoopReconcilerFactory(
- appsv1.SchemeGroupVersion.WithKind("Deployment"),
- )
- deploymentReconciler := deploymentReconcilerFactory(
- mgr.GetClient(),
- mgr.GetEventRecorderFor(constants.JobControllerName),
- opts...)
- err = deploymentReconciler.SetupWithManager(mgr)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
-
- cCache := cache.New(mgr.GetClient())
- queues := queue.NewManager(mgr.GetClient(), cCache)
-
- mgr.GetScheme().Default(configuration)
-
- failedCtrl, err := core.SetupControllers(mgr, queues, cCache, configuration)
- gomega.Expect(err).ToNot(gomega.HaveOccurred(), "controller", failedCtrl)
-
- err = deployment.SetupWebhook(mgr, opts...)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- failedWebhook, err := webhooks.Setup(mgr)
- gomega.Expect(err).ToNot(gomega.HaveOccurred(), "webhook", failedWebhook)
- }
-}
diff --git a/test/integration/controller/jobs/job/job_controller_test.go b/test/integration/controller/jobs/job/job_controller_test.go
index e224861a513..259ca97b1fd 100644
--- a/test/integration/controller/jobs/job/job_controller_test.go
+++ b/test/integration/controller/jobs/job/job_controller_test.go
@@ -27,9 +27,9 @@ import (
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
+ "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -60,17 +60,13 @@ const (
var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
+ fwk.StartManager(ctx, cfg, managerSetup(
jobframework.WithManageJobsWithoutQueueName(true),
jobframework.WithLabelKeysToCopy([]string{"toCopyKey"}),
))
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -92,7 +88,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
- ginkgo.It("Should reconcile workload and job for all jobs", func() {
+ ginkgo.It("Should reconcile workload and job for all jobs", framework.SlowSpec, func() {
ginkgo.By("checking the job gets suspended when created unsuspended")
priorityClass := testing.MakePriorityClass(priorityClassName).
PriorityValue(int32(priorityValue)).Obj()
@@ -170,26 +166,25 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
},
Spec: *createdWorkload.Spec.DeepCopy(),
}
- gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, scheme.Scheme)).Should(gomega.Succeed())
+ gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, k8sClient.Scheme())).Should(gomega.Succeed())
secondWl.Spec.PodSets[0].Count += 1
gomega.Expect(k8sClient.Create(ctx, secondWl)).Should(gomega.Succeed())
- gomega.Eventually(func() error {
- wl := &kueue.Workload{}
- key := types.NamespacedName{Name: secondWl.Name, Namespace: secondWl.Namespace}
- return k8sClient.Get(ctx, key, wl)
- }, util.Timeout, util.Interval).Should(testing.BeNotFoundError())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, secondWl, false)
// check the original wl is still there
gomega.Consistently(func() error {
return k8sClient.Get(ctx, wlLookupKey, createdWorkload)
}, util.ConsistentDuration, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", workload.Key(secondWl)))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", workload.Key(secondWl)), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
ginkgo.By("checking the job is unsuspended when workload is assigned")
onDemandFlavor := testing.MakeResourceFlavor("on-demand").NodeLabel(instanceKey, "on-demand").Obj()
gomega.Expect(k8sClient.Create(ctx, onDemandFlavor)).Should(gomega.Succeed())
+ ginkgo.DeferCleanup(func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ })
spotFlavor := testing.MakeResourceFlavor("spot").NodeLabel(instanceKey, "spot").Obj()
gomega.Expect(k8sClient.Create(ctx, spotFlavor)).Should(gomega.Succeed())
clusterQueue := testing.MakeClusterQueue("cluster-queue").
@@ -210,7 +205,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
return !*createdJob.Spec.Suspend
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Expect(createdJob.Spec.Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
@@ -240,7 +235,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
len(createdJob.Spec.Template.Spec.NodeSelector) == 0
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
@@ -383,6 +378,9 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
ginkgo.By("Create a resource flavor")
defaultFlavor := testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
+ ginkgo.DeferCleanup(func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
+ })
ginkgo.By("creating the parent job")
parentJob := testingjob.MakeJob(parentJobName, ns.Name).Obj()
@@ -836,7 +834,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
})
-var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("When waitForPodsReady enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
type podsReadyTestSpec struct {
beforeJobStatus *batchv1.JobStatus
beforeCondition *metav1.Condition
@@ -851,17 +849,13 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
})
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -1098,7 +1092,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
})
-var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
onDemandFlavor *kueue.ResourceFlavor
@@ -1112,14 +1106,10 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndControllersSetup(true, nil))
+ fwk.StartManager(ctx, cfg, managerAndControllersSetup(true, nil))
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -1185,7 +1175,7 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
util.ExpectObjectToBeDeleted(ctx, k8sClient, spotUntaintedFlavor, true)
})
- ginkgo.It("Should schedule jobs as they fit in their ClusterQueue", func() {
+ ginkgo.It("Should schedule jobs as they fit in their ClusterQueue", framework.SlowSpec, func() {
ginkgo.By("creating localQueues")
prodLocalQ = testing.MakeLocalQueue("prod-queue", ns.Name).ClusterQueue(prodClusterQ.Name).Obj()
gomega.Expect(k8sClient.Create(ctx, prodLocalQ)).Should(gomega.Succeed())
@@ -1680,6 +1670,23 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
gomega.Expect(*wl.Spec.PodSets[0].MinCount).To(gomega.BeEquivalentTo(1))
})
+ ginkgo.By("checking the clusterqueue usage", func() {
+ updateCq := &kueue.ClusterQueue{}
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(prodClusterQ), updateCq)).Should(gomega.Succeed())
+ g.Expect(updateCq.Status.FlavorsUsage).To(gomega.ContainElement(kueue.FlavorUsage{
+ Name: "on-demand",
+ Resources: []kueue.ResourceUsage{
+ {
+ Name: corev1.ResourceCPU,
+ Total: resource.MustParse("4"),
+ Borrowed: resource.MustParse("0"),
+ },
+ },
+ }))
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+
ginkgo.By("delete the localQueue to prevent readmission", func() {
gomega.Expect(util.DeleteObject(ctx, k8sClient, prodLocalQ)).Should(gomega.Succeed())
})
@@ -1920,21 +1927,17 @@ var _ = ginkgo.Describe("Job controller interacting with Workload controller whe
)
ginkgo.JustBeforeEach(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- }
- cfg = fwk.Init()
waitForPodsReady := &configapi.WaitForPodsReady{
Enable: true,
BlockAdmission: ptr.To(true),
Timeout: &metav1.Duration{Duration: util.TinyTimeout},
RequeuingStrategy: &configapi.RequeuingStrategy{
Timestamp: ptr.To(configapi.EvictionTimestamp),
- BackoffBaseSeconds: ptr.To[int32](backoffBaseSeconds),
+ BackoffBaseSeconds: ptr.To(backoffBaseSeconds),
BackoffLimitCount: backoffLimitCount,
},
}
- ctx, k8sClient = fwk.RunManager(cfg, managerAndControllersSetup(
+ fwk.StartManager(ctx, cfg, managerAndControllersSetup(
false,
&configapi.Configuration{WaitForPodsReady: waitForPodsReady},
jobframework.WithWaitForPodsReady(waitForPodsReady),
@@ -1958,7 +1961,7 @@ var _ = ginkgo.Describe("Job controller interacting with Workload controller whe
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
util.ExpectObjectToBeDeleted(ctx, k8sClient, cq, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, fl, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.When("long backoffBaseSeconds", func() {
diff --git a/test/integration/controller/jobs/job/job_webhook_test.go b/test/integration/controller/jobs/job/job_webhook_test.go
deleted file mode 100644
index aa7533c8a63..00000000000
--- a/test/integration/controller/jobs/job/job_webhook_test.go
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package job
-
-import (
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"
- batchv1 "k8s.io/api/batch/v1"
- corev1 "k8s.io/api/core/v1"
- apierrors "k8s.io/apimachinery/pkg/api/errors"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/discovery"
- "k8s.io/utils/ptr"
-
- "sigs.k8s.io/kueue/pkg/controller/constants"
- "sigs.k8s.io/kueue/pkg/controller/jobframework"
- "sigs.k8s.io/kueue/pkg/controller/jobs/job"
- "sigs.k8s.io/kueue/pkg/util/kubeversion"
- testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
- "sigs.k8s.io/kueue/test/integration/framework"
- "sigs.k8s.io/kueue/test/util"
-)
-
-var _ = ginkgo.Describe("Job Webhook", func() {
- var ns *corev1.Namespace
-
- ginkgo.When("With manageJobsWithoutQueueName enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
- ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
-
- discoveryClient, err := discovery.NewDiscoveryClientForConfig(cfg)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- serverVersionFetcher = kubeversion.NewServerVersionFetcher(discoveryClient)
- err = serverVersionFetcher.FetchServerVersion()
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
-
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
- jobframework.WithManageJobsWithoutQueueName(true),
- jobframework.WithKubeServerVersion(serverVersionFetcher),
- ))
- })
- ginkgo.BeforeEach(func() {
- ns = &corev1.Namespace{
- ObjectMeta: metav1.ObjectMeta{
- GenerateName: "job-",
- },
- }
- gomega.Expect(k8sClient.Create(ctx, ns)).To(gomega.Succeed())
- })
-
- ginkgo.AfterEach(func() {
- gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
- })
- ginkgo.AfterAll(func() {
- fwk.Teardown()
- })
-
- ginkgo.It("checking the workload is not created when JobMinParallelismAnnotation is invalid", func() {
- job := testingjob.MakeJob("job-with-queue-name", ns.Name).Queue("foo").SetAnnotation(job.JobMinParallelismAnnotation, "a").Obj()
- err := k8sClient.Create(ctx, job)
- gomega.Expect(err).Should(gomega.HaveOccurred())
- gomega.Expect(apierrors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
- })
-
- ginkgo.It("Should suspend a Job even no queue name specified", func() {
- job := testingjob.MakeJob("job-without-queue-name", ns.Name).Suspend(false).Obj()
- gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
-
- lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
- createdJob := &batchv1.Job{}
- gomega.Eventually(func() bool {
- if err := k8sClient.Get(ctx, lookupKey, createdJob); err != nil {
- return false
- }
- return createdJob.Spec.Suspend != nil && *createdJob.Spec.Suspend
- }, util.Timeout, util.Interval).Should(gomega.BeTrue())
- })
-
- ginkgo.It("Should not update unsuspend Job successfully when adding queue name", func() {
- job := testingjob.MakeJob("job-without-queue-name", ns.Name).Suspend(false).Obj()
- gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
-
- lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
- createdJob := &batchv1.Job{}
- gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
-
- createdJob.Annotations = map[string]string{constants.QueueAnnotation: "queue"}
- createdJob.Spec.Suspend = ptr.To(false)
- gomega.Expect(k8sClient.Update(ctx, createdJob)).ShouldNot(gomega.Succeed())
- })
-
- ginkgo.It("Should not succeed Job when kubernetes less than 1.27 and sync completions annotation is enabled for indexed jobs", func() {
- if v := serverVersionFetcher.GetServerVersion(); v.AtLeast(kubeversion.KubeVersion1_27) {
- ginkgo.Skip("Kubernetes version is not less then 1.27. Skip test...")
- }
- j := testingjob.MakeJob("job-without-queue-name", ns.Name).
- Parallelism(5).
- Completions(5).
- SetAnnotation(job.JobCompletionsEqualParallelismAnnotation, "true").
- Indexed(true).
- Obj()
- gomega.Expect(apierrors.IsForbidden(k8sClient.Create(ctx, j))).Should(gomega.BeTrue())
- })
- })
-
- ginkgo.When("with manageJobsWithoutQueueName disabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
- ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(false)))
- })
- ginkgo.BeforeEach(func() {
- ns = &corev1.Namespace{
- ObjectMeta: metav1.ObjectMeta{
- GenerateName: "job-",
- },
- }
- gomega.Expect(k8sClient.Create(ctx, ns)).To(gomega.Succeed())
- })
- ginkgo.AfterEach(func() {
- gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
- })
- ginkgo.AfterAll(func() {
- fwk.Teardown()
- })
-
- ginkgo.It("should suspend a Job when created in unsuspend state", func() {
- job := testingjob.MakeJob("job-with-queue-name", ns.Name).Suspend(false).Queue("default").Obj()
- gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
-
- lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
- createdJob := &batchv1.Job{}
- gomega.Eventually(func() bool {
- if err := k8sClient.Get(ctx, lookupKey, createdJob); err != nil {
- return false
- }
- return createdJob.Spec.Suspend != nil && *createdJob.Spec.Suspend
- }, util.Timeout, util.Interval).Should(gomega.BeTrue())
- })
-
- ginkgo.It("should not suspend a Job when no queue name specified", func() {
- job := testingjob.MakeJob("job-without-queue-name", ns.Name).Suspend(false).Obj()
- gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
-
- lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
- createdJob := &batchv1.Job{}
- gomega.Eventually(func() bool {
- if err := k8sClient.Get(ctx, lookupKey, createdJob); err != nil {
- return false
- }
- return createdJob.Spec.Suspend != nil && !(*createdJob.Spec.Suspend)
- }, util.Timeout, util.Interval).Should(gomega.BeTrue())
- })
-
- ginkgo.It("should not update unsuspend Job successfully when changing queue name", func() {
- job := testingjob.MakeJob("job-with-queue-name", ns.Name).Queue("queue").Obj()
- gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
-
- lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
- createdJob := &batchv1.Job{}
- gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
-
- createdJob.Labels[constants.QueueLabel] = "queue2"
- createdJob.Spec.Suspend = ptr.To(false)
- gomega.Expect(k8sClient.Update(ctx, createdJob)).ShouldNot(gomega.Succeed())
- })
- })
-})
diff --git a/test/integration/controller/jobs/job/suite_test.go b/test/integration/controller/jobs/job/suite_test.go
index beb13d19a30..3e60ec7799f 100644
--- a/test/integration/controller/jobs/job/suite_test.go
+++ b/test/integration/controller/jobs/job/suite_test.go
@@ -36,18 +36,15 @@ import (
"sigs.k8s.io/kueue/pkg/controller/jobs/job"
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/scheduler"
- "sigs.k8s.io/kueue/pkg/util/kubeversion"
"sigs.k8s.io/kueue/test/integration/framework"
)
var (
- cfg *rest.Config
- k8sClient client.Client
- serverVersionFetcher *kubeversion.ServerVersionFetcher
- ctx context.Context
- fwk *framework.Framework
- crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
+ cfg *rest.Config
+ k8sClient client.Client
+ ctx context.Context
+ fwk *framework.Framework
+ crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
)
func TestAPIs(t *testing.T) {
@@ -58,6 +55,18 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := job.NewReconciler(
diff --git a/test/integration/controller/jobs/jobset/jobset_controller_test.go b/test/integration/controller/jobs/jobset/jobset_controller_test.go
index 999a5735e11..b5f4d1823fc 100644
--- a/test/integration/controller/jobs/jobset/jobset_controller_test.go
+++ b/test/integration/controller/jobs/jobset/jobset_controller_test.go
@@ -27,7 +27,6 @@ import (
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -41,7 +40,6 @@ import (
"sigs.k8s.io/kueue/pkg/util/testing"
testingjobset "sigs.k8s.io/kueue/pkg/util/testingjobs/jobset"
"sigs.k8s.io/kueue/pkg/workload"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -52,17 +50,12 @@ const (
priorityValue int32 = 10
)
-var _ = ginkgo.Describe("JobSet controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("JobSet controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{jobsetCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -170,7 +163,7 @@ var _ = ginkgo.Describe("JobSet controller", ginkgo.Ordered, ginkgo.ContinueOnFa
},
Spec: *createdWorkload.Spec.DeepCopy(),
}
- gomega.Expect(ctrl.SetControllerReference(createdJobSet, secondWl, scheme.Scheme)).Should(gomega.Succeed())
+ gomega.Expect(ctrl.SetControllerReference(createdJobSet, secondWl, k8sClient.Scheme())).Should(gomega.Succeed())
secondWl.Spec.PodSets[0].Count += 1
gomega.Expect(k8sClient.Create(ctx, secondWl)).Should(gomega.Succeed())
key := types.NamespacedName{Name: secondWl.Name, Namespace: secondWl.Namespace}
@@ -203,7 +196,7 @@ var _ = ginkgo.Describe("JobSet controller", ginkgo.Ordered, ginkgo.ContinueOnFa
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sClient.Get(ctx, lookupKey, createdJobSet)).Should(gomega.Succeed())
g.Expect(ptr.Deref(createdJobSet.Spec.Suspend, false)).Should(gomega.BeFalse())
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name), lookupKey)
g.Expect(ok).Should(gomega.BeTrue())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Expect(createdJobSet.Spec.ReplicatedJobs[0].Template.Spec.Template.Spec.NodeSelector).Should(gomega.Equal(map[string]string{instanceKey: onDemandFlavor.Name}))
@@ -221,7 +214,7 @@ var _ = ginkgo.Describe("JobSet controller", ginkgo.Ordered, ginkgo.ContinueOnFa
g.Expect(jobSet.Spec.ReplicatedJobs[0].Template.Spec.Template.Spec.NodeSelector).Should(gomega.BeEmpty())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func(g gomega.Gomega) {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()), lookupKey)
g.Expect(ok).Should(gomega.BeTrue())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
@@ -647,15 +640,10 @@ var _ = ginkgo.Describe("JobSet controller", ginkgo.Ordered, ginkgo.ContinueOnFa
var _ = ginkgo.Describe("JobSet controller for workloads when only jobs with queue are managed", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{jobsetCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup())
+ fwk.StartManager(ctx, cfg, managerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -726,12 +714,7 @@ var _ = ginkgo.Describe("JobSet controller when waitForPodsReady enabled", ginkg
var defaultFlavor = testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{jobsetCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
@@ -739,7 +722,7 @@ var _ = ginkgo.Describe("JobSet controller when waitForPodsReady enabled", ginkg
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -942,15 +925,10 @@ var _ = ginkgo.Describe("JobSet controller when waitForPodsReady enabled", ginkg
var _ = ginkgo.Describe("JobSet controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{jobsetCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
diff --git a/test/integration/controller/jobs/jobset/suite_test.go b/test/integration/controller/jobs/jobset/suite_test.go
index 2709208978f..31792aaf648 100644
--- a/test/integration/controller/jobs/jobset/suite_test.go
+++ b/test/integration/controller/jobs/jobset/suite_test.go
@@ -46,7 +46,6 @@ var (
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
jobsetCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "jobset-operator")
- webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
)
func TestAPIs(t *testing.T) {
@@ -57,6 +56,19 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{jobsetCrdPath},
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := jobset.NewReconciler(
diff --git a/test/integration/controller/jobs/kubeflow/kubeflowjob.go b/test/integration/controller/jobs/kubeflow/kubeflowjob.go
index faadf68c556..e6fc71c47f7 100644
--- a/test/integration/controller/jobs/kubeflow/kubeflowjob.go
+++ b/test/integration/controller/jobs/kubeflow/kubeflowjob.go
@@ -27,7 +27,6 @@ import (
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -106,7 +105,7 @@ func ShouldReconcileJob(ctx context.Context, k8sClient client.Client, job, creat
},
Spec: *createdWorkload.Spec.DeepCopy(),
}
- gomega.Expect(ctrl.SetControllerReference(createdJob.Object(), secondWl, scheme.Scheme)).Should(gomega.Succeed())
+ gomega.Expect(ctrl.SetControllerReference(createdJob.Object(), secondWl, k8sClient.Scheme())).Should(gomega.Succeed())
secondWl.Spec.PodSets[0].Count += 1
gomega.Expect(k8sClient.Create(ctx, secondWl)).Should(gomega.Succeed())
@@ -125,6 +124,10 @@ func ShouldReconcileJob(ctx context.Context, k8sClient client.Client, job, creat
gomega.Expect(k8sClient.Create(ctx, onDemandFlavor)).Should(gomega.Succeed())
spotFlavor := testing.MakeResourceFlavor("spot").NodeLabel(instanceKey, "spot").Obj()
gomega.Expect(k8sClient.Create(ctx, spotFlavor)).Should(gomega.Succeed())
+ defer func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, spotFlavor, true)
+ }()
clusterQueue := testing.MakeClusterQueue("cluster-queue").
ResourceGroup(
*testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "5").Obj(),
@@ -140,7 +143,7 @@ func ShouldReconcileJob(ctx context.Context, k8sClient client.Client, job, creat
return !createdJob.IsSuspended()
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
for _, psr := range podSetsResources {
@@ -167,7 +170,7 @@ func ShouldReconcileJob(ctx context.Context, k8sClient client.Client, job, creat
len(createdJob.KFJobControl.ReplicaSpecs()[ReplicaTypeWorker].Template.Spec.NodeSelector) == 0
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
diff --git a/test/integration/controller/jobs/mpijob/mpijob_controller_test.go b/test/integration/controller/jobs/mpijob/mpijob_controller_test.go
index 4e503346e40..77d53acc4f1 100644
--- a/test/integration/controller/jobs/mpijob/mpijob_controller_test.go
+++ b/test/integration/controller/jobs/mpijob/mpijob_controller_test.go
@@ -19,7 +19,7 @@ package mpijob
import (
"fmt"
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
@@ -27,7 +27,6 @@ import (
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -41,7 +40,6 @@ import (
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
testingmpijob "sigs.k8s.io/kueue/pkg/util/testingjobs/mpijob"
"sigs.k8s.io/kueue/pkg/workload"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -54,18 +52,12 @@ const (
// +kubebuilder:docs-gen:collapse=Imports
-var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mpiCrdPath},
- }
-
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(false, jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(false, jobframework.WithManageJobsWithoutQueueName(true)))
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -89,10 +81,12 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
PriorityValue(int32(priorityValue)).Obj()
gomega.Expect(k8sClient.Create(ctx, priorityClass)).Should(gomega.Succeed())
- job := testingmpijob.MakeMPIJob(jobName, ns.Name).PriorityClass(priorityClassName).Obj()
+ job := testingmpijob.MakeMPIJob(jobName, ns.Name).
+ GenericLauncherAndWorker().
+ PriorityClass(priorityClassName).Obj()
err := k8sClient.Create(ctx, job)
gomega.Expect(err).To(gomega.Succeed())
- createdJob := &kubeflow.MPIJob{}
+ createdJob := &kfmpi.MPIJob{}
gomega.Eventually(func() bool {
if err := k8sClient.Get(ctx, types.NamespacedName{Name: jobName, Namespace: ns.Name}, createdJob); err != nil {
@@ -133,7 +127,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
},
Spec: *createdWorkload.Spec.DeepCopy(),
}
- gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, scheme.Scheme)).Should(gomega.Succeed())
+ gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, k8sClient.Scheme())).Should(gomega.Succeed())
secondWl.Spec.PodSets[0].Count += 1
gomega.Expect(k8sClient.Create(ctx, secondWl)).Should(gomega.Succeed())
@@ -150,6 +144,9 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
ginkgo.By("checking the job is unsuspended when workload is assigned")
onDemandFlavor := testing.MakeResourceFlavor("on-demand").NodeLabel(instanceKey, "on-demand").Obj()
gomega.Expect(k8sClient.Create(ctx, onDemandFlavor)).Should(gomega.Succeed())
+ ginkgo.DeferCleanup(func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ })
spotFlavor := testing.MakeResourceFlavor("spot").NodeLabel(instanceKey, "spot").Obj()
gomega.Expect(k8sClient.Create(ctx, spotFlavor)).Should(gomega.Succeed())
clusterQueue := testing.MakeClusterQueue("cluster-queue").
@@ -185,13 +182,13 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
return !*createdJob.Spec.RunPolicy.Suspend
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(onDemandFlavor.Name))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(spotFlavor.Name))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(onDemandFlavor.Name))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(spotFlavor.Name))
gomega.Eventually(func() bool {
if err := k8sClient.Get(ctx, wlLookupKey, createdWorkload); err != nil {
return false
@@ -200,19 +197,20 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
ginkgo.By("checking the job gets suspended when parallelism changes and the added node selectors are removed")
- parallelism := ptr.Deref(job.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Replicas, 1)
+ parallelism := ptr.Deref(job.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Replicas, 1)
newParallelism := parallelism + 1
- createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Replicas = &newParallelism
+ createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Replicas = &newParallelism
gomega.Expect(k8sClient.Update(ctx, createdJob)).Should(gomega.Succeed())
gomega.Eventually(func() bool {
if err := k8sClient.Get(ctx, lookupKey, createdJob); err != nil {
return false
}
return createdJob.Spec.RunPolicy.Suspend != nil && *createdJob.Spec.RunPolicy.Suspend &&
- len(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template.Spec.NodeSelector) == 0
+ len(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template.Spec.NodeSelector) == 0
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()), lookupKey)
+ util.SyncAdmittedConditionForWorkloads(ctx, k8sClient, createdWorkload)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
@@ -252,10 +250,10 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
}
return !*createdJob.Spec.RunPolicy.Suspend
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(onDemandFlavor.Name))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(spotFlavor.Name))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(onDemandFlavor.Name))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(spotFlavor.Name))
gomega.Eventually(func() bool {
if err := k8sClient.Get(ctx, wlLookupKey, createdWorkload); err != nil {
return false
@@ -265,8 +263,8 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
ginkgo.By("checking the workload is finished when job is completed")
createdJob.Status.Conditions = append(createdJob.Status.Conditions,
- kubeflow.JobCondition{
- Type: kubeflow.JobSucceeded,
+ kfmpi.JobCondition{
+ Type: kfmpi.JobSucceeded,
Status: corev1.ConditionTrue,
LastTransitionTime: metav1.Now(),
})
@@ -316,11 +314,12 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
ginkgo.It("labels and annotations should be propagated from admission check to job", func() {
job := testingmpijob.MakeMPIJob(jobName, ns.Name).
+ GenericLauncherAndWorker().
Queue(localQueue.Name).
- PodAnnotation(kubeflow.MPIReplicaTypeWorker, "old-ann-key", "old-ann-value").
- PodLabel(kubeflow.MPIReplicaTypeWorker, "old-label-key", "old-label-value").
+ PodAnnotation(kfmpi.MPIReplicaTypeWorker, "old-ann-key", "old-ann-value").
+ PodLabel(kfmpi.MPIReplicaTypeWorker, "old-label-key", "old-label-value").
Obj()
- createdJob := &kubeflow.MPIJob{}
+ createdJob := &kfmpi.MPIJob{}
createdWorkload := &kueue.Workload{}
ginkgo.By("creating the job with pod labels & annotations", func() {
@@ -407,7 +406,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
ginkgo.By("verify the PodSetUpdates are propagated to the running job, for worker", func() {
- worker := createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template
+ worker := createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template
gomega.Expect(worker.Annotations).Should(gomega.HaveKeyWithValue("ann1", "ann-value1"))
gomega.Expect(worker.Annotations).Should(gomega.HaveKeyWithValue("old-ann-key", "old-ann-value"))
gomega.Expect(worker.Labels).Should(gomega.HaveKeyWithValue("label1", "label-value1"))
@@ -427,7 +426,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
ginkgo.By("verify the node selectors are propagated to the running job, for launcher", func() {
- launcher := createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template
+ launcher := createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher].Template
gomega.Expect(launcher.Spec.NodeSelector).Should(gomega.HaveKeyWithValue(instanceKey, "test-flavor"))
})
@@ -449,7 +448,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
ginkgo.By("verify the PodSetUpdates are restored for worker", func() {
- worker := createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template
+ worker := createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template
gomega.Expect(worker.Annotations).ShouldNot(gomega.HaveKey("ann1"))
gomega.Expect(worker.Annotations).Should(gomega.HaveKeyWithValue("old-ann-key", "old-ann-value"))
gomega.Expect(worker.Labels).ShouldNot(gomega.HaveKey("label1"))
@@ -459,7 +458,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
ginkgo.By("verify the PodSetUpdates are restored for launcher", func() {
- launcher := createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template
+ launcher := createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher].Template
gomega.Expect(launcher.Annotations).ShouldNot(gomega.HaveKey("ann1"))
gomega.Expect(launcher.Labels).ShouldNot(gomega.HaveKey("label1"))
gomega.Expect(launcher.Spec.NodeSelector).ShouldNot(gomega.HaveKey(instanceKey))
@@ -471,15 +470,10 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
var _ = ginkgo.Describe("Job controller for workloads when only jobs with queue are managed", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mpiCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(true))
+ fwk.StartManager(ctx, cfg, managerSetup(true))
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -503,10 +497,10 @@ var _ = ginkgo.Describe("Job controller for workloads when only jobs with queue
ginkgo.It("Should reconcile jobs only when queue is set", func() {
ginkgo.By("checking the workload is not created when queue name is not set")
- job := testingmpijob.MakeMPIJob(jobName, ns.Name).Obj()
+ job := testingmpijob.MakeMPIJob(jobName, ns.Name).GenericLauncherAndWorker().Obj()
gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
lookupKey := types.NamespacedName{Name: jobName, Namespace: ns.Name}
- createdJob := &kubeflow.MPIJob{}
+ createdJob := &kfmpi.MPIJob{}
gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
createdWorkload := &kueue.Workload{}
@@ -534,7 +528,7 @@ var _ = ginkgo.Describe("Job controller for workloads when only jobs with queue
ginkgo.By("Creating the child job")
childJob := testingjob.MakeJob(childJobName, ns.Name).
- OwnerReference(parentJobName, kubeflow.SchemeGroupVersionKind).
+ OwnerReference(parentJobName, kfmpi.SchemeGroupVersionKind).
Suspend(false).
Obj()
gomega.Expect(ctrl.SetControllerReference(parentJob, childJob, k8sClient.Scheme())).To(gomega.Succeed())
@@ -557,7 +551,7 @@ var _ = ginkgo.Describe("Job controller for workloads when only jobs with queue
ginkgo.By("Creating the child job which has ownerReference with known existing workload owner")
childJob := testingjob.MakeJob(childJobName, ns.Name).
- OwnerReference(parentJobName, kubeflow.SchemeGroupVersionKind).
+ OwnerReference(parentJobName, kfmpi.SchemeGroupVersionKind).
Suspend(false).
Obj()
gomega.Expect(ctrl.SetControllerReference(parentJob, childJob, k8sClient.Scheme())).To(gomega.Succeed())
@@ -573,9 +567,9 @@ var _ = ginkgo.Describe("Job controller for workloads when only jobs with queue
var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
type podsReadyTestSpec struct {
- beforeJobStatus *kubeflow.JobStatus
+ beforeJobStatus *kfmpi.JobStatus
beforeCondition *metav1.Condition
- jobStatus kubeflow.JobStatus
+ jobStatus kfmpi.JobStatus
suspended bool
wantCondition *metav1.Condition
}
@@ -586,19 +580,14 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mpiCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(false, jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(false, jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
})
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -616,12 +605,14 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
ginkgo.DescribeTable("Single job at different stages of progress towards completion",
func(podsReadyTestSpec podsReadyTestSpec) {
ginkgo.By("Create a job")
- job := testingmpijob.MakeMPIJob(jobName, ns.Name).Parallelism(2).Obj()
+ job := testingmpijob.MakeMPIJob(jobName, ns.Name).
+ GenericLauncherAndWorker().
+ Parallelism(2).Obj()
jobQueueName := "test-queue"
job.Annotations = map[string]string{constants.QueueAnnotation: jobQueueName}
gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
lookupKey := types.NamespacedName{Name: jobName, Namespace: ns.Name}
- createdJob := &kubeflow.MPIJob{}
+ createdJob := &kfmpi.MPIJob{}
gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
ginkgo.By("Fetch the workload created for the job")
@@ -708,10 +699,10 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
},
}),
ginkgo.Entry("Running MPIJob", podsReadyTestSpec{
- jobStatus: kubeflow.JobStatus{
- Conditions: []kubeflow.JobCondition{
+ jobStatus: kfmpi.JobStatus{
+ Conditions: []kfmpi.JobCondition{
{
- Type: kubeflow.JobRunning,
+ Type: kfmpi.JobRunning,
Status: corev1.ConditionTrue,
Reason: "Running",
},
@@ -731,10 +722,10 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
Reason: "PodsReady",
Message: "Not all pods are ready or succeeded",
},
- jobStatus: kubeflow.JobStatus{
- Conditions: []kubeflow.JobCondition{
+ jobStatus: kfmpi.JobStatus{
+ Conditions: []kfmpi.JobCondition{
{
- Type: kubeflow.JobRunning,
+ Type: kfmpi.JobRunning,
Status: corev1.ConditionTrue,
Reason: "Running",
},
@@ -748,10 +739,10 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
},
}),
ginkgo.Entry("Job suspended; PodsReady=True before", podsReadyTestSpec{
- beforeJobStatus: &kubeflow.JobStatus{
- Conditions: []kubeflow.JobCondition{
+ beforeJobStatus: &kfmpi.JobStatus{
+ Conditions: []kfmpi.JobCondition{
{
- Type: kubeflow.JobRunning,
+ Type: kfmpi.JobRunning,
Status: corev1.ConditionTrue,
Reason: "Running",
},
@@ -763,10 +754,10 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
Reason: "PodsReady",
Message: "All pods were ready or succeeded since the workload admission",
},
- jobStatus: kubeflow.JobStatus{
- Conditions: []kubeflow.JobCondition{
+ jobStatus: kfmpi.JobStatus{
+ Conditions: []kfmpi.JobCondition{
{
- Type: kubeflow.JobRunning,
+ Type: kfmpi.JobRunning,
Status: corev1.ConditionFalse,
Reason: "Suspended",
},
@@ -793,15 +784,10 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mpiCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -839,18 +825,19 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
ginkgo.By("checking a dev job starts")
job := testingmpijob.MakeMPIJob("dev-job", ns.Name).Queue(localQueue.Name).
- Request(kubeflow.MPIReplicaTypeLauncher, corev1.ResourceCPU, "3").
- Request(kubeflow.MPIReplicaTypeWorker, corev1.ResourceCPU, "4").
+ GenericLauncherAndWorker().
+ Request(kfmpi.MPIReplicaTypeLauncher, corev1.ResourceCPU, "3").
+ Request(kfmpi.MPIReplicaTypeWorker, corev1.ResourceCPU, "4").
Obj()
gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
- createdJob := &kubeflow.MPIJob{}
+ createdJob := &kfmpi.MPIJob{}
gomega.Eventually(func() *bool {
gomega.Expect(k8sClient.Get(ctx, types.NamespacedName{Name: job.Name, Namespace: job.Namespace}, createdJob)).
Should(gomega.Succeed())
return createdJob.Spec.RunPolicy.Suspend
}, util.Timeout, util.Interval).Should(gomega.Equal(ptr.To(false)))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(spotUntaintedFlavor.Name))
- gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeWorker].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(onDemandFlavor.Name))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeLauncher].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(spotUntaintedFlavor.Name))
+ gomega.Expect(createdJob.Spec.MPIReplicaSpecs[kfmpi.MPIReplicaTypeWorker].Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(onDemandFlavor.Name))
util.ExpectPendingWorkloadsMetric(clusterQueue, 0, 0)
util.ExpectReservingActiveWorkloadsMetric(clusterQueue, 1)
})
@@ -859,14 +846,15 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
ginkgo.It("Should restore the original node selectors", func() {
localQueue := testing.MakeLocalQueue("local-queue", ns.Name).ClusterQueue(clusterQueue.Name).Obj()
job := testingmpijob.MakeMPIJob(jobName, ns.Name).Queue(localQueue.Name).
- Request(kubeflow.MPIReplicaTypeLauncher, corev1.ResourceCPU, "3").
- Request(kubeflow.MPIReplicaTypeWorker, corev1.ResourceCPU, "4").
+ GenericLauncherAndWorker().
+ Request(kfmpi.MPIReplicaTypeLauncher, corev1.ResourceCPU, "3").
+ Request(kfmpi.MPIReplicaTypeWorker, corev1.ResourceCPU, "4").
Obj()
lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
- createdJob := &kubeflow.MPIJob{}
+ createdJob := &kfmpi.MPIJob{}
- nodeSelectors := func(j *kubeflow.MPIJob) map[kubeflow.MPIReplicaType]map[string]string {
- ret := map[kubeflow.MPIReplicaType]map[string]string{}
+ nodeSelectors := func(j *kfmpi.MPIJob) map[kfmpi.MPIReplicaType]map[string]string {
+ ret := map[kfmpi.MPIReplicaType]map[string]string{}
for k := range j.Spec.MPIReplicaSpecs {
ret[k] = j.Spec.MPIReplicaSpecs[k].Template.Spec.NodeSelector
}
@@ -899,7 +887,7 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
})
ginkgo.By("the node selectors should be updated", func() {
- gomega.Eventually(func() map[kubeflow.MPIReplicaType]map[string]string {
+ gomega.Eventually(func() map[kfmpi.MPIReplicaType]map[string]string {
gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
return nodeSelectors(createdJob)
}, util.Timeout, util.Interval).ShouldNot(gomega.Equal(originalNodeSelectors))
@@ -918,7 +906,7 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
})
ginkgo.By("the node selectors should be restored", func() {
- gomega.Eventually(func() map[kubeflow.MPIReplicaType]map[string]string {
+ gomega.Eventually(func() map[kfmpi.MPIReplicaType]map[string]string {
gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
return nodeSelectors(createdJob)
}, util.Timeout, util.Interval).Should(gomega.Equal(originalNodeSelectors))
diff --git a/test/integration/controller/jobs/mpijob/suite_test.go b/test/integration/controller/jobs/mpijob/suite_test.go
index 8fbcf8ac3fc..0d3f6c42b73 100644
--- a/test/integration/controller/jobs/mpijob/suite_test.go
+++ b/test/integration/controller/jobs/mpijob/suite_test.go
@@ -41,13 +41,12 @@ import (
)
var (
- cfg *rest.Config
- k8sClient client.Client
- ctx context.Context
- fwk *framework.Framework
- crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- mpiCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "mpi-operator")
- webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
+ cfg *rest.Config
+ k8sClient client.Client
+ ctx context.Context
+ fwk *framework.Framework
+ crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
+ mpiCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "mpi-operator")
)
func TestAPIs(t *testing.T) {
@@ -58,6 +57,20 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{mpiCrdPath},
+ }
+
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(setupJobManager bool, opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := mpijob.NewReconciler(
diff --git a/test/integration/controller/jobs/mxjob/mxjob_controller_test.go b/test/integration/controller/jobs/mxjob/mxjob_controller_test.go
index 742d6781485..918d0d71d1a 100644
--- a/test/integration/controller/jobs/mxjob/mxjob_controller_test.go
+++ b/test/integration/controller/jobs/mxjob/mxjob_controller_test.go
@@ -44,19 +44,14 @@ const (
// +kubebuilder:docs-gen:collapse=Imports
-var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mxnetCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
-
var (
ns *corev1.Namespace
)
@@ -93,26 +88,22 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
})
-var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
defaultFlavor = testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mxnetCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
})
+
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -231,7 +222,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
})
-var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller interacting with scheduler", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
onDemandFlavor *kueue.ResourceFlavor
@@ -241,15 +232,11 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mxnetCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/jobs/mxjob/suite_test.go b/test/integration/controller/jobs/mxjob/suite_test.go
index f29689c1b55..f2639a4a838 100644
--- a/test/integration/controller/jobs/mxjob/suite_test.go
+++ b/test/integration/controller/jobs/mxjob/suite_test.go
@@ -45,7 +45,7 @@ var (
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- mxnetCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator")
+ mxnetCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator-crds")
)
func TestAPIs(t *testing.T) {
@@ -56,6 +56,19 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{mxnetCrdPath},
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := mxjob.NewReconciler(
diff --git a/test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go b/test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go
index 452f0c1a1e7..42dc1ba30b6 100644
--- a/test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go
+++ b/test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go
@@ -28,7 +28,6 @@ import (
"sigs.k8s.io/kueue/pkg/controller/jobframework"
workloadpaddlejob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/paddlejob"
"sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/kubeflowjob"
-
"sigs.k8s.io/kueue/pkg/util/testing"
testingpaddlejob "sigs.k8s.io/kueue/pkg/util/testingjobs/paddlejob"
kftesting "sigs.k8s.io/kueue/test/integration/controller/jobs/kubeflow"
@@ -46,17 +45,13 @@ const (
// +kubebuilder:docs-gen:collapse=Imports
-var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{paddleCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -91,28 +86,23 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
})
-var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
defaultFlavor = testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{paddleCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
})
+
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
-
ginkgo.BeforeEach(func() {
ns = &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
@@ -225,7 +215,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
})
-var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller interacting with scheduler", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
onDemandFlavor *kueue.ResourceFlavor
@@ -235,15 +225,11 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{paddleCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/jobs/paddlejob/suite_test.go b/test/integration/controller/jobs/paddlejob/suite_test.go
index 754bbb93342..5264b217df7 100644
--- a/test/integration/controller/jobs/paddlejob/suite_test.go
+++ b/test/integration/controller/jobs/paddlejob/suite_test.go
@@ -45,7 +45,7 @@ var (
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- paddleCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator")
+ paddleCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator-crds")
)
func TestAPIs(t *testing.T) {
@@ -56,6 +56,19 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{paddleCrdPath},
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := paddlejob.NewReconciler(
diff --git a/test/integration/controller/jobs/pod/pod_controller_test.go b/test/integration/controller/jobs/pod/pod_controller_test.go
index b993cbcdd9a..85fdee40016 100644
--- a/test/integration/controller/jobs/pod/pod_controller_test.go
+++ b/test/integration/controller/jobs/pod/pod_controller_test.go
@@ -19,7 +19,6 @@ package pod
import (
"fmt"
"strconv"
- "time"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
@@ -43,7 +42,6 @@ import (
"sigs.k8s.io/kueue/pkg/util/testing"
testingpod "sigs.k8s.io/kueue/pkg/util/testingjobs/pod"
"sigs.k8s.io/kueue/pkg/workload"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -67,12 +65,7 @@ var _ = ginkgo.Describe("Pod controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
).Obj()
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
+ fwk.StartManager(ctx, cfg, managerSetup(
nil,
jobframework.WithManageJobsWithoutQueueName(false),
jobframework.WithKubeServerVersion(serverVersionFetcher),
@@ -96,7 +89,7 @@ var _ = ginkgo.Describe("Pod controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -194,7 +187,7 @@ var _ = ginkgo.Describe("Pod controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
util.SyncAdmittedConditionForWorkloads(ctx, k8sClient, createdWorkload)
gomega.Eventually(func(g gomega.Gomega) bool {
- ok, err := testing.CheckLatestEvent(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name))
+ ok, err := testing.CheckEventRecordedFor(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name), lookupKey)
g.Expect(err).NotTo(gomega.HaveOccurred())
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
@@ -621,6 +614,85 @@ var _ = ginkgo.Describe("Pod controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
})
+ ginkgo.It("Should ungate pods when admitted with fast admission", func() {
+ ginkgo.By("Creating pod1 and delaying creation of pod2")
+ pod1 := testingpod.MakePod("test-pod1", ns.Name).
+ Group("test-group").
+ GroupTotalCount("2").
+ Annotation(podcontroller.GroupFastAdmissionAnnotation, "true").
+ Queue("test-queue").
+ Obj()
+ pod1LookupKey := client.ObjectKeyFromObject(pod1)
+ gomega.Expect(k8sClient.Create(ctx, pod1)).Should(gomega.Succeed())
+
+ ginkgo.By("checking that workload is created for the pod group with the queue name")
+ wlLookupKey := types.NamespacedName{
+ Namespace: pod1.Namespace,
+ Name: "test-group",
+ }
+ createdWorkload := &kueue.Workload{}
+ gomega.Eventually(func() error {
+ return k8sClient.Get(ctx, wlLookupKey, createdWorkload)
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ gomega.Expect(createdWorkload.Spec.PodSets).To(gomega.HaveLen(1))
+ gomega.Expect(createdWorkload.Spec.PodSets[0].Count).To(gomega.Equal(int32(2)))
+
+ gomega.Expect(createdWorkload.Spec.QueueName).To(gomega.Equal("test-queue"), "The Workload should have .spec.queueName set")
+
+ ginkgo.By("checking that all pods in group are unsuspended when workload is admitted", func() {
+ admission := testing.MakeAdmission(clusterQueue.Name).PodSets(
+ kueue.PodSetAssignment{
+ Name: "bf90803c",
+ Flavors: map[corev1.ResourceName]kueue.ResourceFlavorReference{
+ corev1.ResourceCPU: "default",
+ },
+ Count: ptr.To[int32](2),
+ },
+ ).Obj()
+ gomega.Expect(util.SetQuotaReservation(ctx, k8sClient, createdWorkload, admission)).Should(gomega.Succeed())
+ util.SyncAdmittedConditionForWorkloads(ctx, k8sClient, createdWorkload)
+
+ util.ExpectWorkloadsToBeAdmitted(ctx, k8sClient, createdWorkload)
+
+ util.ExpectPodUnsuspendedWithNodeSelectors(ctx, k8sClient, pod1LookupKey, map[string]string{"kubernetes.io/arch": "arm64"})
+ })
+
+ pod2 := testingpod.MakePod("test-pod2", ns.Name).
+ Group("test-group").
+ GroupTotalCount("2").
+ Annotation(podcontroller.GroupFastAdmissionAnnotation, "true").
+ Queue("test-queue").
+ Obj()
+ pod2LookupKey := client.ObjectKeyFromObject(pod2)
+
+ ginkgo.By("Creating pod2 and checking that it is unsuspended", func() {
+ gomega.Expect(k8sClient.Create(ctx, pod2)).Should(gomega.Succeed())
+ util.ExpectPodUnsuspendedWithNodeSelectors(ctx, k8sClient, pod2LookupKey, map[string]string{"kubernetes.io/arch": "arm64"})
+ })
+
+ ginkgo.By("checking that pod group is finalized when all pods in the group succeed", func() {
+ util.SetPodsPhase(ctx, k8sClient, corev1.PodSucceeded, pod1)
+ util.SetPodsPhase(ctx, k8sClient, corev1.PodSucceeded, pod2)
+
+ gomega.Eventually(func() []metav1.Condition {
+ err := k8sClient.Get(ctx, wlLookupKey, createdWorkload)
+ if err != nil {
+ return nil
+ }
+ return createdWorkload.Status.Conditions
+ }, util.Timeout, util.Interval).Should(gomega.ContainElement(
+ gomega.BeComparableTo(
+ metav1.Condition{Type: kueue.WorkloadFinished, Status: metav1.ConditionTrue},
+ wlConditionCmpOpts...,
+ ),
+ ), "Expected 'Finished' workload condition")
+
+ util.ExpectPodsFinalized(ctx, k8sClient, pod1LookupKey)
+ util.ExpectPodsFinalized(ctx, k8sClient, pod2LookupKey)
+ })
+ })
+
ginkgo.It("Should keep the running pod group with the queue name if workload is evicted", func() {
ginkgo.By("Creating pods with queue name")
pod1 := testingpod.MakePod("test-pod1", ns.Name).
@@ -1092,11 +1164,8 @@ var _ = ginkgo.Describe("Pod controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
gomega.Expect(createdWorkload.Spec.QueueName).To(gomega.Equal("test-queue"), "The Workload should have .spec.queueName set")
ginkgo.By("checking that excess pod is deleted before admission", func() {
- // Make sure that at least a second passes between
- // creation of pods to avoid flaky behavior.
- time.Sleep(time.Second * 1)
-
excessPod := excessBasePod.Clone().Obj()
+ util.WaitForNextSecondAfterCreation(pod2)
gomega.Expect(k8sClient.Create(ctx, excessPod)).Should(gomega.Succeed())
util.ExpectObjectToBeDeleted(ctx, k8sClient, excessPod, false)
@@ -1385,13 +1454,8 @@ var _ = ginkgo.Describe("Pod controller interacting with scheduler", ginkgo.Orde
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
configuration := configapi.Configuration{Resources: &configapi.Resources{ExcludeResourcePrefixes: []string{"networking.example.com/"}}}
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup(
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup(
&configuration,
jobframework.WithManageJobsWithoutQueueName(false),
jobframework.WithIntegrationOptions(corev1.SchemeGroupVersion.WithKind("Pod").String(), &configapi.PodIntegrationOptions{
@@ -1419,7 +1483,7 @@ var _ = ginkgo.Describe("Pod controller interacting with scheduler", ginkgo.Orde
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, spotUntaintedFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -1637,11 +1701,6 @@ var _ = ginkgo.Describe("Pod controller interacting with Workload controller whe
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
waitForPodsReady := &configapi.WaitForPodsReady{
Enable: true,
Timeout: &metav1.Duration{Duration: util.TinyTimeout},
@@ -1651,7 +1710,7 @@ var _ = ginkgo.Describe("Pod controller interacting with Workload controller whe
BackoffBaseSeconds: ptr.To[int32](1),
},
}
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
+ fwk.StartManager(ctx, cfg, managerSetup(
&configapi.Configuration{WaitForPodsReady: waitForPodsReady},
jobframework.WithIntegrationOptions(corev1.SchemeGroupVersion.WithKind("Pod").String(), &configapi.PodIntegrationOptions{
PodSelector: &metav1.LabelSelector{},
@@ -1668,7 +1727,7 @@ var _ = ginkgo.Describe("Pod controller interacting with Workload controller whe
))
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/jobs/pod/suite_test.go b/test/integration/controller/jobs/pod/suite_test.go
index f1e4909a477..42a97977cc8 100644
--- a/test/integration/controller/jobs/pod/suite_test.go
+++ b/test/integration/controller/jobs/pod/suite_test.go
@@ -60,6 +60,19 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ WebhookPath: webhookPath,
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(configuration *config.Configuration, opts ...jobframework.Option) framework.ManagerSetup {
if configuration == nil {
configuration = &config.Configuration{}
diff --git a/test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go b/test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go
index fa02d31facb..c555c9ccbe9 100644
--- a/test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go
+++ b/test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go
@@ -37,7 +37,6 @@ import (
testingpytorchjob "sigs.k8s.io/kueue/pkg/util/testingjobs/pytorchjob"
"sigs.k8s.io/kueue/pkg/workload"
kftesting "sigs.k8s.io/kueue/test/integration/controller/jobs/kubeflow"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -53,15 +52,11 @@ const (
var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{pytorchCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -97,15 +92,11 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
var _ = ginkgo.Describe("Job controller for workloads when only jobs with queue are managed", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{pytorchCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup())
+ fwk.StartManager(ctx, cfg, managerSetup())
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -333,19 +324,15 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{pytorchCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
})
+
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -470,15 +457,11 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{pytorchCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/jobs/pytorchjob/suite_test.go b/test/integration/controller/jobs/pytorchjob/suite_test.go
index 7cf59247918..377dc2b4988 100644
--- a/test/integration/controller/jobs/pytorchjob/suite_test.go
+++ b/test/integration/controller/jobs/pytorchjob/suite_test.go
@@ -45,7 +45,7 @@ var (
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- pytorchCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator")
+ pytorchCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator-crds")
)
func TestAPIs(t *testing.T) {
@@ -56,6 +56,19 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{pytorchCrdPath},
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := pytorchjob.NewReconciler(
diff --git a/test/integration/controller/jobs/raycluster/raycluster_controller_test.go b/test/integration/controller/jobs/raycluster/raycluster_controller_test.go
index a0079389abe..bf9b25f41ec 100644
--- a/test/integration/controller/jobs/raycluster/raycluster_controller_test.go
+++ b/test/integration/controller/jobs/raycluster/raycluster_controller_test.go
@@ -23,11 +23,11 @@ import (
"github.com/onsi/gomega"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
corev1 "k8s.io/api/core/v1"
+ schedulingv1 "k8s.io/api/scheduling/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -37,12 +37,12 @@ import (
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
workloadraycluster "sigs.k8s.io/kueue/pkg/controller/jobs/raycluster"
- _ "sigs.k8s.io/kueue/pkg/controller/jobs/rayjob" // to enable the framework
"sigs.k8s.io/kueue/pkg/util/testing"
testingraycluster "sigs.k8s.io/kueue/pkg/util/testingjobs/raycluster"
testingrayjob "sigs.k8s.io/kueue/pkg/util/testingjobs/rayjob"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
+
+ _ "sigs.k8s.io/kueue/pkg/controller/jobs/rayjob" // to enable the framework
)
const (
@@ -56,16 +56,10 @@ const (
var _ = ginkgo.Describe("RayCluster controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
-
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -88,6 +82,9 @@ var _ = ginkgo.Describe("RayCluster controller", ginkgo.Ordered, ginkgo.Continue
priorityClass := testing.MakePriorityClass(priorityClassName).
PriorityValue(priorityValue).Obj()
gomega.Expect(k8sClient.Create(ctx, priorityClass)).Should(gomega.Succeed())
+ defer func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, priorityClass, true)
+ }()
job := testingraycluster.MakeCluster(jobName, ns.Name).
Suspend(false).
@@ -137,7 +134,7 @@ var _ = ginkgo.Describe("RayCluster controller", ginkgo.Ordered, ginkgo.Continue
Spec: *createdWorkload.Spec.DeepCopy(),
}
- gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, scheme.Scheme)).Should(gomega.Succeed())
+ gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, k8sClient.Scheme())).Should(gomega.Succeed())
secondWl.Spec.PodSets[0].Count += 1
gomega.Expect(k8sClient.Create(ctx, secondWl)).Should(gomega.Succeed())
@@ -156,6 +153,10 @@ var _ = ginkgo.Describe("RayCluster controller", ginkgo.Ordered, ginkgo.Continue
gomega.Expect(k8sClient.Create(ctx, onDemandFlavor)).Should(gomega.Succeed())
spotFlavor := testing.MakeResourceFlavor("spot").NodeLabel(instanceKey, "spot").Obj()
gomega.Expect(k8sClient.Create(ctx, spotFlavor)).Should(gomega.Succeed())
+ defer func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, spotFlavor, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ }()
clusterQueue := testing.MakeClusterQueue("cluster-queue").
ResourceGroup(
*testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "5").Obj(),
@@ -186,7 +187,7 @@ var _ = ginkgo.Describe("RayCluster controller", ginkgo.Ordered, ginkgo.Continue
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Expect(createdJob.Spec.HeadGroupSpec.Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
@@ -212,7 +213,7 @@ var _ = ginkgo.Describe("RayCluster controller", ginkgo.Ordered, ginkgo.Continue
return *createdJob.Spec.Suspend && len(createdJob.Spec.WorkerGroupSpecs[0].Template.Spec.NodeSelector) == 0
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
@@ -249,15 +250,10 @@ var _ = ginkgo.Describe("RayCluster controller", ginkgo.Ordered, ginkgo.Continue
var _ = ginkgo.Describe("Job controller RayCluster for workloads when only jobs with queue are managed", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup())
+ fwk.StartManager(ctx, cfg, managerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -338,12 +334,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
var defaultFlavor = testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
@@ -351,7 +342,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -515,15 +506,10 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
var _ = ginkgo.Describe("RayCluster Job controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -630,15 +616,10 @@ var _ = ginkgo.Describe("RayCluster Job controller interacting with scheduler",
var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -646,6 +627,7 @@ var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered
onDemandFlavor *kueue.ResourceFlavor
clusterQueue *kueue.ClusterQueue
localQueue *kueue.LocalQueue
+ priorityClass *schedulingv1.PriorityClass
)
ginkgo.BeforeEach(func() {
@@ -674,7 +656,7 @@ var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered
gomega.Expect(k8sClient.Create(ctx, localQueue)).Should(gomega.Succeed())
ginkgo.By("creating priority")
- priorityClass := testing.MakePriorityClass(priorityClassName).
+ priorityClass = testing.MakePriorityClass(priorityClassName).
PriorityValue(priorityValue).Obj()
gomega.Expect(k8sClient.Create(ctx, priorityClass)).Should(gomega.Succeed())
})
@@ -682,6 +664,7 @@ var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, priorityClass, true)
})
ginkgo.It("Should preempt lower priority RayClusters when resource insufficient", func() {
diff --git a/test/integration/controller/jobs/raycluster/suite_test.go b/test/integration/controller/jobs/raycluster/suite_test.go
index a4a84eb63a4..e69637c6641 100644
--- a/test/integration/controller/jobs/raycluster/suite_test.go
+++ b/test/integration/controller/jobs/raycluster/suite_test.go
@@ -37,18 +37,16 @@ import (
"sigs.k8s.io/kueue/pkg/controller/jobs/rayjob"
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/scheduler"
- "sigs.k8s.io/kueue/pkg/webhooks"
"sigs.k8s.io/kueue/test/integration/framework"
)
var (
- cfg *rest.Config
- k8sClient client.Client
- ctx context.Context
- fwk *framework.Framework
- crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- rayCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "ray-operator")
- webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
+ cfg *rest.Config
+ k8sClient client.Client
+ ctx context.Context
+ fwk *framework.Framework
+ crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
+ rayCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "ray-operator")
)
func TestAPIs(t *testing.T) {
@@ -59,6 +57,20 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{rayCrdPath},
+ }
+
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := raycluster.NewReconciler(
@@ -101,35 +113,3 @@ func managerAndSchedulerSetup(opts ...jobframework.Option) framework.ManagerSetu
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}
-
-func managerWithRayClusterAndRayJobControllersSetup(opts ...jobframework.Option) framework.ManagerSetup {
- return func(ctx context.Context, mgr manager.Manager) {
- reconciler := raycluster.NewReconciler(
- mgr.GetClient(),
- mgr.GetEventRecorderFor(constants.JobControllerName),
- opts...)
- err := indexer.Setup(ctx, mgr.GetFieldIndexer())
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = raycluster.SetupIndexes(ctx, mgr.GetFieldIndexer())
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = reconciler.SetupWithManager(mgr)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = raycluster.SetupRayClusterWebhook(mgr, opts...)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
-
- reconciler = rayjob.NewReconciler(
- mgr.GetClient(),
- mgr.GetEventRecorderFor(constants.JobControllerName),
- opts...)
- err = rayjob.SetupIndexes(ctx, mgr.GetFieldIndexer())
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = reconciler.SetupWithManager(mgr)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = rayjob.SetupRayJobWebhook(mgr, opts...)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
- jobframework.EnableIntegration(rayjob.FrameworkName)
-
- failedWebhook, err := webhooks.Setup(mgr)
- gomega.Expect(err).ToNot(gomega.HaveOccurred(), "webhook", failedWebhook)
- }
-}
diff --git a/test/integration/controller/jobs/rayjob/rayjob_controller_test.go b/test/integration/controller/jobs/rayjob/rayjob_controller_test.go
index 5a52b6cfcd8..4e43e843053 100644
--- a/test/integration/controller/jobs/rayjob/rayjob_controller_test.go
+++ b/test/integration/controller/jobs/rayjob/rayjob_controller_test.go
@@ -23,11 +23,11 @@ import (
"github.com/onsi/gomega"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
corev1 "k8s.io/api/core/v1"
+ schedulingv1 "k8s.io/api/scheduling/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
@@ -38,7 +38,6 @@ import (
workloadrayjob "sigs.k8s.io/kueue/pkg/controller/jobs/rayjob"
"sigs.k8s.io/kueue/pkg/util/testing"
testingrayjob "sigs.k8s.io/kueue/pkg/util/testingjobs/rayjob"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -65,16 +64,11 @@ func setInitStatus(name, namespace string) {
var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
-
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -97,6 +91,9 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
priorityClass := testing.MakePriorityClass(priorityClassName).
PriorityValue(priorityValue).Obj()
gomega.Expect(k8sClient.Create(ctx, priorityClass)).Should(gomega.Succeed())
+ defer func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, priorityClass, true)
+ }()
job := testingrayjob.MakeJob(jobName, ns.Name).
Suspend(false).
@@ -146,7 +143,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
},
Spec: *createdWorkload.Spec.DeepCopy(),
}
- gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, scheme.Scheme)).Should(gomega.Succeed())
+ gomega.Expect(ctrl.SetControllerReference(createdJob, secondWl, k8sClient.Scheme())).Should(gomega.Succeed())
secondWl.Spec.PodSets[0].Count += 1
gomega.Expect(k8sClient.Create(ctx, secondWl)).Should(gomega.Succeed())
@@ -165,6 +162,10 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
gomega.Expect(k8sClient.Create(ctx, onDemandFlavor)).Should(gomega.Succeed())
spotFlavor := testing.MakeResourceFlavor("spot").NodeLabel(instanceKey, "spot").Obj()
gomega.Expect(k8sClient.Create(ctx, spotFlavor)).Should(gomega.Succeed())
+ defer func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, spotFlavor, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ }()
clusterQueue := testing.MakeClusterQueue("cluster-queue").
ResourceGroup(
*testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "5").Obj(),
@@ -193,7 +194,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
return !createdJob.Spec.Suspend
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "Started", corev1.EventTypeNormal, fmt.Sprintf("Admitted by clusterQueue %v", clusterQueue.Name), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Expect(createdJob.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.NodeSelector).Should(gomega.HaveLen(1))
@@ -219,7 +220,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
return createdJob.Spec.Suspend && len(createdJob.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.NodeSelector) == 0
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
gomega.Eventually(func() bool {
- ok, _ := testing.CheckLatestEvent(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()))
+ ok, _ := testing.CheckEventRecordedFor(ctx, k8sClient, "DeletedWorkload", corev1.EventTypeNormal, fmt.Sprintf("Deleted not matching Workload: %v", wlLookupKey.String()), lookupKey)
return ok
}, util.Timeout, util.Interval).Should(gomega.BeTrue())
@@ -267,15 +268,11 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
var _ = ginkgo.Describe("Job controller for workloads when only jobs with queue are managed", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup())
+ fwk.StartManager(ctx, cfg, managerSetup())
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -334,12 +331,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
var defaultFlavor = testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
@@ -347,7 +339,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -523,15 +515,10 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -597,15 +584,10 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -613,6 +595,7 @@ var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered
onDemandFlavor *kueue.ResourceFlavor
clusterQueue *kueue.ClusterQueue
localQueue *kueue.LocalQueue
+ priorityClass *schedulingv1.PriorityClass
)
ginkgo.BeforeEach(func() {
@@ -641,7 +624,7 @@ var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered
gomega.Expect(k8sClient.Create(ctx, localQueue)).Should(gomega.Succeed())
ginkgo.By("creating priority")
- priorityClass := testing.MakePriorityClass(priorityClassName).
+ priorityClass = testing.MakePriorityClass(priorityClassName).
PriorityValue(priorityValue).Obj()
gomega.Expect(k8sClient.Create(ctx, priorityClass)).Should(gomega.Succeed())
})
@@ -649,6 +632,7 @@ var _ = ginkgo.Describe("Job controller with preemption enabled", ginkgo.Ordered
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, priorityClass, true)
})
ginkgo.It("Should preempt lower priority rayJobs when resource insufficient", func() {
diff --git a/test/integration/controller/jobs/rayjob/suite_test.go b/test/integration/controller/jobs/rayjob/suite_test.go
index f55e246012b..c59ac16141e 100644
--- a/test/integration/controller/jobs/rayjob/suite_test.go
+++ b/test/integration/controller/jobs/rayjob/suite_test.go
@@ -40,13 +40,12 @@ import (
)
var (
- cfg *rest.Config
- k8sClient client.Client
- ctx context.Context
- fwk *framework.Framework
- crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- rayCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "ray-operator")
- webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
+ cfg *rest.Config
+ k8sClient client.Client
+ ctx context.Context
+ fwk *framework.Framework
+ crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
+ rayCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "ray-operator")
)
func TestAPIs(t *testing.T) {
@@ -57,6 +56,20 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{rayCrdPath},
+ }
+
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.StopManager(ctx)
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := rayjob.NewReconciler(
diff --git a/test/integration/controller/jobs/tfjob/suite_test.go b/test/integration/controller/jobs/tfjob/suite_test.go
index 1689c80ea00..350b79bef73 100644
--- a/test/integration/controller/jobs/tfjob/suite_test.go
+++ b/test/integration/controller/jobs/tfjob/suite_test.go
@@ -45,7 +45,7 @@ var (
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- tensorflowCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator")
+ tensorflowCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator-crds")
)
func TestAPIs(t *testing.T) {
@@ -56,6 +56,19 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{tensorflowCrdPath},
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := tfjob.NewReconciler(
diff --git a/test/integration/controller/jobs/tfjob/tfjob_controller_test.go b/test/integration/controller/jobs/tfjob/tfjob_controller_test.go
index 855c9415181..2a3eac03b00 100644
--- a/test/integration/controller/jobs/tfjob/tfjob_controller_test.go
+++ b/test/integration/controller/jobs/tfjob/tfjob_controller_test.go
@@ -45,17 +45,13 @@ const (
// +kubebuilder:docs-gen:collapse=Imports
-var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{tensorflowCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -94,26 +90,22 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
})
-var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
defaultFlavor = testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{tensorflowCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
})
+
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -232,7 +224,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
})
-var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller interacting with scheduler", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
onDemandFlavor *kueue.ResourceFlavor
@@ -242,15 +234,11 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{tensorflowCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/controller/jobs/xgboostjob/suite_test.go b/test/integration/controller/jobs/xgboostjob/suite_test.go
index ca5fd57e8b2..bf7b835452f 100644
--- a/test/integration/controller/jobs/xgboostjob/suite_test.go
+++ b/test/integration/controller/jobs/xgboostjob/suite_test.go
@@ -45,7 +45,7 @@ var (
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
- xgbCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator")
+ xgbCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator-crds")
)
func TestAPIs(t *testing.T) {
@@ -56,6 +56,19 @@ func TestAPIs(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{xgbCrdPath},
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerSetup(opts ...jobframework.Option) framework.ManagerSetup {
return func(ctx context.Context, mgr manager.Manager) {
reconciler := xgboostjob.NewReconciler(
diff --git a/test/integration/controller/jobs/xgboostjob/xgboostjob_controller_test.go b/test/integration/controller/jobs/xgboostjob/xgboostjob_controller_test.go
index 7f6a9864862..7067b5f0958 100644
--- a/test/integration/controller/jobs/xgboostjob/xgboostjob_controller_test.go
+++ b/test/integration/controller/jobs/xgboostjob/xgboostjob_controller_test.go
@@ -45,17 +45,13 @@ const (
// +kubebuilder:docs-gen:collapse=Imports
-var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{xgbCrdPath},
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithManageJobsWithoutQueueName(true)))
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
var (
@@ -89,26 +85,22 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})
})
-var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
defaultFlavor = testing.MakeResourceFlavor("default").NodeLabel(instanceKey, "default").Obj()
)
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{xgbCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
+ fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithWaitForPodsReady(&configapi.WaitForPodsReady{Enable: true})))
ginkgo.By("Create a resource flavor")
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).Should(gomega.Succeed())
})
+
ginkgo.AfterAll(func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
@@ -222,7 +214,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O
)
})
-var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
+var _ = ginkgo.Describe("Job controller interacting with scheduler", framework.RedundantSpec, ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
var (
ns *corev1.Namespace
onDemandFlavor *kueue.ResourceFlavor
@@ -230,17 +222,12 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde
clusterQueue *kueue.ClusterQueue
localQueue *kueue.LocalQueue
)
-
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{xgbCrdPath},
- }
- cfg := fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup())
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup())
})
+
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.BeforeEach(func() {
diff --git a/test/integration/framework/framework.go b/test/integration/framework/framework.go
index fe50fc107b4..e33cf88066d 100644
--- a/test/integration/framework/framework.go
+++ b/test/integration/framework/framework.go
@@ -24,17 +24,22 @@ import (
"os"
"strconv"
"strings"
+ "sync"
"time"
- kubeflow "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
- "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/apimachinery/pkg/runtime"
+ autoscaling "k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/autoscaling.x-k8s.io/v1beta1"
+ clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
+ "k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
+ crconfig "sigs.k8s.io/controller-runtime/pkg/config"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/manager"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
@@ -56,60 +61,75 @@ type Framework struct {
APIServerFeatureGates []string
testEnv *envtest.Environment
cancel context.CancelFunc
+ scheme *runtime.Scheme
+
+ managerCancel context.CancelFunc
+ managerDone <-chan struct{}
}
-func (f *Framework) Init() *rest.Config {
+var setupLogger = sync.OnceFunc(func() {
ctrl.SetLogger(util.NewTestingLogger(ginkgo.GinkgoWriter, -3))
+})
- ginkgo.By("bootstrapping test environment")
- f.testEnv = &envtest.Environment{
- CRDDirectoryPaths: append(f.DepCRDPaths, f.CRDPath),
- ErrorIfCRDPathMissing: true,
- }
- if len(f.WebhookPath) > 0 {
- f.testEnv.WebhookInstallOptions.Paths = []string{f.WebhookPath}
- }
-
- if len(f.APIServerFeatureGates) > 0 {
- f.testEnv.ControlPlane.GetAPIServer().Configure().Append("feature-gates", strings.Join(f.APIServerFeatureGates, ","))
- }
-
- if level, err := strconv.Atoi(os.Getenv("API_LOG_LEVEL")); err == nil && level > 0 {
- f.testEnv.ControlPlane.GetAPIServer().Configure().Append("v", strconv.Itoa(level))
- f.testEnv.ControlPlane.GetAPIServer().Out = ginkgo.GinkgoWriter
- f.testEnv.ControlPlane.GetAPIServer().Err = ginkgo.GinkgoWriter
- }
-
- cfg, err := f.testEnv.Start()
- gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- gomega.ExpectWithOffset(1, cfg).NotTo(gomega.BeNil())
-
+func (f *Framework) Init() *rest.Config {
+ setupLogger()
+
+ var cfg *rest.Config
+ ginkgo.By("bootstrapping test environment", func() {
+ f.testEnv = &envtest.Environment{
+ CRDDirectoryPaths: append(f.DepCRDPaths, f.CRDPath),
+ ErrorIfCRDPathMissing: true,
+ }
+ if len(f.WebhookPath) > 0 {
+ f.testEnv.WebhookInstallOptions.Paths = []string{f.WebhookPath}
+ }
+
+ if len(f.APIServerFeatureGates) > 0 {
+ f.testEnv.ControlPlane.GetAPIServer().Configure().Append("feature-gates", strings.Join(f.APIServerFeatureGates, ","))
+ }
+
+ if level, err := strconv.Atoi(os.Getenv("API_LOG_LEVEL")); err == nil && level > 0 {
+ f.testEnv.ControlPlane.GetAPIServer().Configure().Append("v", strconv.Itoa(level))
+ f.testEnv.ControlPlane.GetAPIServer().Out = ginkgo.GinkgoWriter
+ f.testEnv.ControlPlane.GetAPIServer().Err = ginkgo.GinkgoWriter
+ }
+
+ var err error
+ cfg, err = f.testEnv.Start()
+ gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
+ gomega.ExpectWithOffset(1, cfg).NotTo(gomega.BeNil())
+ })
+ f.scheme = runtime.NewScheme()
+ gomega.ExpectWithOffset(1, clientgoscheme.AddToScheme(f.scheme)).NotTo(gomega.HaveOccurred())
return cfg
}
func (f *Framework) SetupClient(cfg *rest.Config) (context.Context, client.Client) {
- err := config.AddToScheme(scheme.Scheme)
+ err := config.AddToScheme(f.scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- err = kueue.AddToScheme(scheme.Scheme)
+ err = kueue.AddToScheme(f.scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- err = kueuealpha.AddToScheme(scheme.Scheme)
+ err = kueuealpha.AddToScheme(f.scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- err = kubeflow.AddToScheme(scheme.Scheme)
+ err = kfmpi.AddToScheme(f.scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- err = rayv1.AddToScheme(scheme.Scheme)
+ err = rayv1.AddToScheme(f.scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- err = jobsetapi.AddToScheme(scheme.Scheme)
+ err = jobsetapi.AddToScheme(f.scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- err = kftraining.AddToScheme(scheme.Scheme)
+ err = kftraining.AddToScheme(f.scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
- k8sClient, err := client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ err = autoscaling.AddToScheme(f.scheme)
+ gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
+
+ k8sClient, err := client.New(cfg, client.Options{Scheme: f.scheme})
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
gomega.ExpectWithOffset(1, k8sClient).NotTo(gomega.BeNil())
@@ -120,49 +140,71 @@ func (f *Framework) SetupClient(cfg *rest.Config) (context.Context, client.Clien
}
func (f *Framework) StartManager(ctx context.Context, cfg *rest.Config, managerSetup ManagerSetup) {
- webhookInstallOptions := &f.testEnv.WebhookInstallOptions
- mgrOpts := manager.Options{
- Scheme: scheme.Scheme,
- Metrics: metricsserver.Options{
- BindAddress: "0", // disable metrics to avoid conflicts between packages.
- },
- WebhookServer: webhook.NewServer(
- webhook.Options{
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- }),
- }
- mgr, err := ctrl.NewManager(cfg, mgrOpts)
- gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "failed to create manager")
-
- managerSetup(ctx, mgr)
-
- go func() {
- defer ginkgo.GinkgoRecover()
- err := mgr.Start(ctx)
- gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "failed to run manager")
- }()
-
- if len(f.WebhookPath) > 0 {
- // wait for the webhook server to get ready
- dialer := &net.Dialer{Timeout: time.Second}
- addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
- gomega.Eventually(func() error {
- conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true})
- if err != nil {
- return err
- }
- conn.Close()
- return nil
- }).Should(gomega.Succeed())
- }
+ ginkgo.By("starting the manager", func() {
+ webhookInstallOptions := &f.testEnv.WebhookInstallOptions
+ mgrOpts := manager.Options{
+ Scheme: f.scheme,
+ Metrics: metricsserver.Options{
+ BindAddress: "0", // disable metrics to avoid conflicts between packages.
+ },
+ WebhookServer: webhook.NewServer(
+ webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ Controller: crconfig.Controller{
+ SkipNameValidation: ptr.To(true),
+ },
+ }
+ mgr, err := ctrl.NewManager(cfg, mgrOpts)
+ gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "failed to create manager")
+
+ managerCtx, managerCancel := context.WithCancel(ctx)
+ managerSetup(managerCtx, mgr)
+
+ done := make(chan struct{})
+
+ f.managerCancel = managerCancel
+ f.managerDone = done
+
+ go func() {
+ defer close(done)
+ defer ginkgo.GinkgoRecover()
+ err := mgr.Start(managerCtx)
+ gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "failed to run manager")
+ }()
+
+ if len(f.WebhookPath) > 0 {
+ // wait for the webhook server to get ready
+ dialer := &net.Dialer{Timeout: time.Second}
+ addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
+ gomega.Eventually(func() error {
+ conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true})
+ if err != nil {
+ return err
+ }
+ conn.Close()
+ return nil
+ }).Should(gomega.Succeed())
+ }
+ })
}
-func (f *Framework) RunManager(cfg *rest.Config, managerSetup ManagerSetup) (context.Context, client.Client) {
- ctx, k8sClient := f.SetupClient(cfg)
- f.StartManager(ctx, cfg, managerSetup)
- return ctx, k8sClient
+func (f *Framework) StopManager(ctx context.Context) {
+ ginkgo.By("stopping the manager", func() {
+ if f.managerCancel == nil {
+ return
+ }
+
+ f.managerCancel()
+ select {
+ case <-f.managerDone:
+ ginkgo.GinkgoLogr.Info("manager stopped")
+ case <-ctx.Done():
+ ginkgo.GinkgoLogr.Info("manager stop canceled")
+ }
+ })
}
func (f *Framework) Teardown() {
@@ -173,3 +215,18 @@ func (f *Framework) Teardown() {
err := f.testEnv.Stop()
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
}
+
+var (
+ // Label used to decorate test specs that take a long time to be run and
+ // should be skipped in PR builds
+ //
+ // Initial list base on:
+ // curl https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/3054/pull-kueue-test-integration-main/1836045641336229888/artifacts/integration-top.yaml \
+ // | yq '.[] | select(.name != "") | .f.duration = .duration | .f.name = .name | .f.suite=.suite | .f | [] + .' | yq '.[0:30]' -oc
+ //
+ // taking the item which run for more then 5 sec
+ SlowSpec = ginkgo.Label("slow")
+
+ // Label used to decorate test specs that largely cover generic code covered by other specs also. (eg. Kubeflow jobs)
+ RedundantSpec = ginkgo.Label("Redundant")
+)
diff --git a/test/integration/kueuectl/list_test.go b/test/integration/kueuectl/list_test.go
index 0263050e0d0..1b30471630a 100644
--- a/test/integration/kueuectl/list_test.go
+++ b/test/integration/kueuectl/list_test.go
@@ -216,8 +216,8 @@ very-long-cluster-queue-name 0 0
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "%s: %s", err, output)
gomega.Expect(errOutput.String()).Should(gomega.BeEmpty())
- gomega.Expect(output.String()).Should(gomega.Equal(fmt.Sprintf(`NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-wl1 lq1 PENDING %s
+ gomega.Expect(output.String()).Should(gomega.Equal(fmt.Sprintf(`NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+wl1 lq1 PENDING %s
`,
duration.HumanDuration(executeTime.Sub(wl1.CreationTimestamp.Time)))))
})
@@ -235,10 +235,10 @@ wl1 lq1 PENDING
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "%s: %s", err, output)
gomega.Expect(errOutput.String()).Should(gomega.BeEmpty())
- gomega.Expect(output.String()).Should(gomega.Equal(fmt.Sprintf(`NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE AGE
-very-long-workload-name lq1 PENDING %s
-wl1 lq1 PENDING %s
-wl2 very-long-local-queue-name PENDING %s
+ gomega.Expect(output.String()).Should(gomega.Equal(fmt.Sprintf(`NAME JOB TYPE JOB NAME LOCALQUEUE CLUSTERQUEUE STATUS POSITION IN QUEUE EXEC TIME AGE
+very-long-workload-name lq1 PENDING %s
+wl1 lq1 PENDING %s
+wl2 very-long-local-queue-name PENDING %s
`,
duration.HumanDuration(executeTime.Sub(wl3.CreationTimestamp.Time)),
duration.HumanDuration(executeTime.Sub(wl1.CreationTimestamp.Time)),
diff --git a/test/integration/kueuectl/passthrough_test.go b/test/integration/kueuectl/passthrough_test.go
index e6e03972370..39c51634019 100644
--- a/test/integration/kueuectl/passthrough_test.go
+++ b/test/integration/kueuectl/passthrough_test.go
@@ -37,6 +37,14 @@ func makePassThroughWorkload(ns string) client.Object {
return testing.MakeWorkload("pass-through-wl", ns).Obj()
}
+func makePassThroughLocalQueue(ns string) client.Object {
+ return testing.MakeLocalQueue("pass-through-lq", ns).Obj()
+}
+
+func makePassThroughClusterQueue(_ string) client.Object {
+ return testing.MakeClusterQueue("pass-through-cq").Obj()
+}
+
func makePassThroughResourceFlavor(_ string) client.Object {
return testing.MakeResourceFlavor("pass-through-resource-flavor").NodeLabel("type", "small").Obj()
}
@@ -69,7 +77,7 @@ var _ = ginkgo.Describe("Kueuectl Pass-through", ginkgo.Ordered, ginkgo.Continue
})
ginkgo.DescribeTable("Pass-through commands",
- func(oType string, makeObject func(ns string) client.Object, getPath string, expectGet string, patch string, expectGetAfterPatch string) {
+ func(oType string, makeObject func(ns string) client.Object, getPath string, expectGet string, patch string, expectGetAfterPatch string, deleteArgs ...string) {
obj := makeObject(ns.Name)
gomega.Expect(k8sClient.Create(ctx, obj)).To(gomega.Succeed())
key := client.ObjectKeyFromObject(obj)
@@ -108,6 +116,7 @@ var _ = ginkgo.Describe("Kueuectl Pass-through", ginkgo.Ordered, ginkgo.Continue
ginkgo.By("Delete the object", func() {
args := append([]string{"delete"}, identityArgs...)
+ args = append(args, deleteArgs...)
cmd := exec.Command(kueuectlPath, args...)
setupEnv(cmd, kassetsPath, kubeconfigPath)
out, err := cmd.CombinedOutput()
@@ -118,8 +127,12 @@ var _ = ginkgo.Describe("Kueuectl Pass-through", ginkgo.Ordered, ginkgo.Continue
}, util.Timeout, util.Interval).Should(testing.BeNotFoundError())
})
},
- ginkgo.Entry("Workload", "workload", makePassThroughWorkload, "{.spec.active}", "'true'", `{"spec":{"active":false}}`, "'false'"),
- ginkgo.Entry("Workload(short)", "wl", makePassThroughWorkload, "{.spec.active}", "'true'", `{"spec":{"active":false}}`, "'false'"),
+ ginkgo.Entry("Workload", "workload", makePassThroughWorkload, "{.spec.active}", "'true'", `{"spec":{"active":false}}`, "'false'", "--yes"),
+ ginkgo.Entry("Workload(short)", "wl", makePassThroughWorkload, "{.spec.active}", "'true'", `{"spec":{"active":false}}`, "'false'", "--yes"),
+ ginkgo.Entry("LocalQueue", "localqueue", makePassThroughLocalQueue, "{.spec.stopPolicy}", "'None'", `{"spec":{"stopPolicy":"Hold"}}`, "'Hold'"),
+ ginkgo.Entry("LocalQueue(short)", "lq", makePassThroughLocalQueue, "{.spec.stopPolicy}", "'None'", `{"spec":{"stopPolicy":"Hold"}}`, "'Hold'"),
+ ginkgo.Entry("ClusterQueue", "clusterqueue", makePassThroughClusterQueue, "{.spec.stopPolicy}", "'None'", `{"spec":{"stopPolicy":"Hold"}}`, "'Hold'"),
+ ginkgo.Entry("ClusterQueue(short)", "cq", makePassThroughClusterQueue, "{.spec.stopPolicy}", "'None'", `{"spec":{"stopPolicy":"Hold"}}`, "'Hold'"),
ginkgo.Entry("ResourceFlavor", "resourceflavor", makePassThroughResourceFlavor, "{.spec.nodeLabels.type}", "'small'", `{"spec":{"nodeLabels":{"type":"large"}}}`, "'large'"),
ginkgo.Entry("ResourceFlavor(short)", "rf", makePassThroughResourceFlavor, "{.spec.nodeLabels.type}", "'small'", `{"spec":{"nodeLabels":{"type":"large"}}}`, "'large'"),
)
diff --git a/test/integration/kueuectl/suite_test.go b/test/integration/kueuectl/suite_test.go
index e36ff1043eb..36b02d831e7 100644
--- a/test/integration/kueuectl/suite_test.go
+++ b/test/integration/kueuectl/suite_test.go
@@ -60,7 +60,8 @@ func TestKueuectl(t *testing.T) {
var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
+ ctx, k8sClient = fwk.SetupClient(cfg)
+ fwk.StartManager(ctx, cfg, managerSetup)
kassetsPath = os.Getenv("KUBEBUILDER_ASSETS")
kueuectlPath = path.Join(os.Getenv("KUEUE_BIN"), "kubectl-kueue")
diff --git a/test/integration/multikueue/multikueue_test.go b/test/integration/multikueue/multikueue_test.go
index b347a16b247..35f8d7f4541 100644
--- a/test/integration/multikueue/multikueue_test.go
+++ b/test/integration/multikueue/multikueue_test.go
@@ -17,12 +17,14 @@ limitations under the License.
package multikueue
import (
+ "context"
"fmt"
"os"
"path/filepath"
"time"
"github.com/google/go-cmp/cmp/cmpopts"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
@@ -34,9 +36,9 @@ import (
versionutil "k8s.io/apimachinery/pkg/util/version"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/manager"
jobset "sigs.k8s.io/jobset/api/jobset/v1alpha2"
- kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/admissionchecks/multikueue"
workloadjob "sigs.k8s.io/kueue/pkg/controller/jobs/job"
@@ -45,15 +47,18 @@ import (
workloadpytorchjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/pytorchjob"
workloadtfjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/tfjob"
workloadxgboostjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/xgboostjob"
+ workloadmpijob "sigs.k8s.io/kueue/pkg/controller/jobs/mpijob"
"sigs.k8s.io/kueue/pkg/features"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
testingjobset "sigs.k8s.io/kueue/pkg/util/testingjobs/jobset"
+ testingmpijob "sigs.k8s.io/kueue/pkg/util/testingjobs/mpijob"
testingpaddlejob "sigs.k8s.io/kueue/pkg/util/testingjobs/paddlejob"
testingpytorchjob "sigs.k8s.io/kueue/pkg/util/testingjobs/pytorchjob"
testingtfjob "sigs.k8s.io/kueue/pkg/util/testingjobs/tfjob"
testingxgboostjob "sigs.k8s.io/kueue/pkg/util/testingjobs/xgboostjob"
"sigs.k8s.io/kueue/pkg/workload"
+ "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -65,9 +70,9 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
managerMultikueueSecret1 *corev1.Secret
managerMultikueueSecret2 *corev1.Secret
- workerCluster1 *kueuealpha.MultiKueueCluster
- workerCluster2 *kueuealpha.MultiKueueCluster
- managerMultiKueueConfig *kueuealpha.MultiKueueConfig
+ workerCluster1 *kueue.MultiKueueCluster
+ workerCluster2 *kueue.MultiKueueCluster
+ managerMultiKueueConfig *kueue.MultiKueueConfig
multikueueAC *kueue.AdmissionCheck
managerCq *kueue.ClusterQueue
managerLq *kueue.LocalQueue
@@ -80,11 +85,13 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
)
ginkgo.BeforeAll(func() {
- multiclusterSetup(2 * time.Second)
+ managerTestCluster.fwk.StartManager(managerTestCluster.ctx, managerTestCluster.cfg, func(ctx context.Context, mgr manager.Manager) {
+ managerAndMultiKueueSetup(ctx, mgr, 2*time.Second)
+ })
})
ginkgo.AfterAll(func() {
- multiclusterTeardown()
+ managerTestCluster.fwk.StopManager(managerTestCluster.ctx)
})
ginkgo.BeforeEach(func() {
@@ -121,7 +128,7 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
Namespace: managersConfigNamespace.Name,
},
Data: map[string][]byte{
- kueuealpha.MultiKueueConfigSecretKey: w1Kubeconfig,
+ kueue.MultiKueueConfigSecretKey: w1Kubeconfig,
},
}
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, managerMultikueueSecret1)).To(gomega.Succeed())
@@ -132,23 +139,23 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
Namespace: managersConfigNamespace.Name,
},
Data: map[string][]byte{
- kueuealpha.MultiKueueConfigSecretKey: w2Kubeconfig,
+ kueue.MultiKueueConfigSecretKey: w2Kubeconfig,
},
}
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, managerMultikueueSecret2)).To(gomega.Succeed())
- workerCluster1 = utiltesting.MakeMultiKueueCluster("worker1").KubeConfig(kueuealpha.SecretLocationType, managerMultikueueSecret1.Name).Obj()
+ workerCluster1 = utiltesting.MakeMultiKueueCluster("worker1").KubeConfig(kueue.SecretLocationType, managerMultikueueSecret1.Name).Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, workerCluster1)).To(gomega.Succeed())
- workerCluster2 = utiltesting.MakeMultiKueueCluster("worker2").KubeConfig(kueuealpha.SecretLocationType, managerMultikueueSecret2.Name).Obj()
+ workerCluster2 = utiltesting.MakeMultiKueueCluster("worker2").KubeConfig(kueue.SecretLocationType, managerMultikueueSecret2.Name).Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, workerCluster2)).To(gomega.Succeed())
managerMultiKueueConfig = utiltesting.MakeMultiKueueConfig("multikueueconfig").Clusters(workerCluster1.Name, workerCluster2.Name).Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, managerMultiKueueConfig)).Should(gomega.Succeed())
multikueueAC = utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", managerMultiKueueConfig.Name).
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", managerMultiKueueConfig.Name).
Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, multikueueAC)).Should(gomega.Succeed())
@@ -198,8 +205,8 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
ginkgo.It("Should properly manage the active condition of AdmissionChecks and MultiKueueClusters, kubeconfig provided by secret", func() {
ac := utiltesting.MakeAdmissionCheck("testing-ac").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "testing-config").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "testing-config").
Obj()
ginkgo.By("creating the admission check with missing config, it's set inactive", func() {
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, ac)).Should(gomega.Succeed())
@@ -260,18 +267,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
})
- cluster := utiltesting.MakeMultiKueueCluster("testing-cluster").KubeConfig(kueuealpha.SecretLocationType, "testing-secret").Obj()
+ cluster := utiltesting.MakeMultiKueueCluster("testing-cluster").KubeConfig(kueue.SecretLocationType, "testing-secret").Obj()
ginkgo.By("creating the cluster, its Active state is updated, the admission check's state is updated", func() {
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, cluster)).Should(gomega.Succeed())
ginkgo.DeferCleanup(func() error { return managerTestCluster.client.Delete(managerTestCluster.ctx, cluster) })
ginkgo.By("wait for the cluster's active state update", func() {
- updatedCluster := kueuealpha.MultiKueueCluster{}
+ updatedCluster := kueue.MultiKueueCluster{}
clusterKey := client.ObjectKeyFromObject(cluster)
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, clusterKey, &updatedCluster)).To(gomega.Succeed())
g.Expect(updatedCluster.Status.Conditions).To(gomega.ContainElement(gomega.BeComparableTo(metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionFalse,
Reason: "BadConfig",
Message: `Secret "testing-secret" not found`,
@@ -302,7 +309,7 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
Namespace: managersConfigNamespace.Name,
},
Data: map[string][]byte{
- kueuealpha.MultiKueueConfigSecretKey: w1Kubeconfig,
+ kueue.MultiKueueConfigSecretKey: w1Kubeconfig,
},
}
@@ -311,12 +318,12 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.DeferCleanup(func() error { return managerTestCluster.client.Delete(managerTestCluster.ctx, secret) })
ginkgo.By("wait for the cluster's active state update", func() {
- updatedCluster := kueuealpha.MultiKueueCluster{}
+ updatedCluster := kueue.MultiKueueCluster{}
clusterKey := client.ObjectKeyFromObject(cluster)
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, clusterKey, &updatedCluster)).To(gomega.Succeed())
g.Expect(updatedCluster.Status.Conditions).To(gomega.ContainElement(gomega.BeComparableTo(metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionTrue,
Reason: "Active",
Message: "Connected",
@@ -342,8 +349,8 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.It("Should properly manage the active condition of AdmissionChecks and MultiKueueClusters, kubeconfig provided by file", func() {
ac := utiltesting.MakeAdmissionCheck("testing-ac").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", "testing-config").
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", "testing-config").
Obj()
ginkgo.By("creating the admission check with missing config, it's set inactive", func() {
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, ac)).Should(gomega.Succeed())
@@ -401,18 +408,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
})
- cluster := utiltesting.MakeMultiKueueCluster("testing-cluster").KubeConfig(kueuealpha.PathLocationType, fsKubeConfig).Obj()
+ cluster := utiltesting.MakeMultiKueueCluster("testing-cluster").KubeConfig(kueue.PathLocationType, fsKubeConfig).Obj()
ginkgo.By("creating the cluster, its Active state is updated, the admission check's state is updated", func() {
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, cluster)).Should(gomega.Succeed())
ginkgo.DeferCleanup(func() error { return managerTestCluster.client.Delete(managerTestCluster.ctx, cluster) })
ginkgo.By("wait for the cluster's active state update", func() {
- updatedCluster := kueuealpha.MultiKueueCluster{}
+ updatedCluster := kueue.MultiKueueCluster{}
clusterKey := client.ObjectKeyFromObject(cluster)
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, clusterKey, &updatedCluster)).To(gomega.Succeed())
g.Expect(updatedCluster.Status.Conditions).To(gomega.ContainElement(gomega.BeComparableTo(metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionFalse,
Reason: "BadConfig",
Message: fmt.Sprintf("open %s: no such file or directory", fsKubeConfig),
@@ -441,12 +448,12 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.By("creating the kubeconfig file, the cluster and admission check become active", func() {
gomega.Expect(os.WriteFile(fsKubeConfig, w1Kubeconfig, 0666)).Should(gomega.Succeed())
ginkgo.By("wait for the cluster's active state update", func() {
- updatedCluster := kueuealpha.MultiKueueCluster{}
+ updatedCluster := kueue.MultiKueueCluster{}
clusterKey := client.ObjectKeyFromObject(cluster)
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, clusterKey, &updatedCluster)).To(gomega.Succeed())
g.Expect(updatedCluster.Status.Conditions).To(gomega.ContainElement(gomega.BeComparableTo(metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionTrue,
Reason: "Active",
Message: "Connected",
@@ -520,17 +527,28 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
ginkgo.By("finishing the worker job", func() {
+ reachedPodsReason := "Reached expected number of succeeded pods"
finishJobReason := "Job finished successfully"
gomega.Eventually(func(g gomega.Gomega) {
createdJob := batchv1.Job{}
g.Expect(worker1TestCluster.client.Get(worker1TestCluster.ctx, client.ObjectKeyFromObject(job), &createdJob)).To(gomega.Succeed())
- createdJob.Status.Conditions = append(createdJob.Status.Conditions, batchv1.JobCondition{
- Type: batchv1.JobComplete,
- Status: corev1.ConditionTrue,
- LastProbeTime: metav1.Now(),
- LastTransitionTime: metav1.Now(),
- Message: finishJobReason,
- })
+ createdJob.Status.Conditions = append(createdJob.Status.Conditions,
+ batchv1.JobCondition{
+ Type: batchv1.JobSuccessCriteriaMet,
+ Status: corev1.ConditionTrue,
+ LastProbeTime: metav1.Now(),
+ LastTransitionTime: metav1.Now(),
+ Message: reachedPodsReason,
+ },
+ batchv1.JobCondition{
+ Type: batchv1.JobComplete,
+ Status: corev1.ConditionTrue,
+ LastProbeTime: metav1.Now(),
+ LastTransitionTime: metav1.Now(),
+ Message: finishJobReason,
+ },
+ )
+ createdJob.Status.Succeeded = 1
createdJob.Status.StartTime = ptr.To(metav1.Now())
createdJob.Status.CompletionTime = ptr.To(metav1.Now())
g.Expect(worker1TestCluster.client.Status().Update(worker1TestCluster.ctx, &createdJob)).To(gomega.Succeed())
@@ -544,9 +562,9 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
if managerK8sVersion.LessThan(versionutil.MustParseSemantic("1.30.0")) {
ginkgo.Skip("the managers kubernetes version is less then 1.30")
}
- ginkgo.DeferCleanup(features.SetFeatureGateDuringTest(featuregatesT, features.MultiKueueBatchJobWithManagedBy, true))
+ features.SetFeatureGateDuringTest(ginkgo.GinkgoTB(), features.MultiKueueBatchJobWithManagedBy, true)
job := testingjob.MakeJob("job", managerNs.Name).
- ManagedBy(kueuealpha.MultiKueueControllerName).
+ ManagedBy(kueue.MultiKueueControllerName).
Queue(managerLq.Name).
Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, job)).Should(gomega.Succeed())
@@ -600,6 +618,7 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
createdJob := batchv1.Job{}
g.Expect(worker1TestCluster.client.Get(worker1TestCluster.ctx, client.ObjectKeyFromObject(job), &createdJob)).To(gomega.Succeed())
createdJob.Status.StartTime = &startTime
+ createdJob.Status.Active = 1
createdJob.Status.Ready = ptr.To[int32](1)
g.Expect(worker1TestCluster.client.Status().Update(worker1TestCluster.ctx, &createdJob)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
@@ -613,17 +632,30 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
ginkgo.By("finishing the worker job", func() {
+ reachedPodsReason := "Reached expected number of succeeded pods"
finishJobReason := "Job finished successfully"
gomega.Eventually(func(g gomega.Gomega) {
createdJob := batchv1.Job{}
g.Expect(worker1TestCluster.client.Get(worker1TestCluster.ctx, client.ObjectKeyFromObject(job), &createdJob)).To(gomega.Succeed())
- createdJob.Status.Conditions = append(createdJob.Status.Conditions, batchv1.JobCondition{
- Type: batchv1.JobComplete,
- Status: corev1.ConditionTrue,
- LastProbeTime: metav1.Now(),
- LastTransitionTime: metav1.Now(),
- Message: finishJobReason,
- })
+ createdJob.Status.Conditions = append(createdJob.Status.Conditions,
+ batchv1.JobCondition{
+ Type: batchv1.JobSuccessCriteriaMet,
+ Status: corev1.ConditionTrue,
+ LastProbeTime: metav1.Now(),
+ LastTransitionTime: metav1.Now(),
+ Message: reachedPodsReason,
+ },
+ batchv1.JobCondition{
+ Type: batchv1.JobComplete,
+ Status: corev1.ConditionTrue,
+ LastProbeTime: metav1.Now(),
+ LastTransitionTime: metav1.Now(),
+ Message: finishJobReason,
+ },
+ )
+ createdJob.Status.Active = 0
+ createdJob.Status.Ready = ptr.To[int32](0)
+ createdJob.Status.Succeeded = 1
createdJob.Status.CompletionTime = ptr.To(metav1.Now())
g.Expect(worker1TestCluster.client.Status().Update(worker1TestCluster.ctx, &createdJob)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
@@ -635,7 +667,7 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.It("Should run a jobSet on worker if admitted", func() {
jobSet := testingjobset.MakeJobSet("job-set", managerNs.Name).
Queue(managerLq.Name).
- ManagedBy(kueuealpha.MultiKueueControllerName).
+ ManagedBy(kueue.MultiKueueControllerName).
ReplicatedJobs(
testingjobset.ReplicatedJobRequirements{
Name: "replicated-job-1",
@@ -695,7 +727,7 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
})
- ginkgo.It("Should run a TFJob on worker if admitted", func() {
+ ginkgo.It("Should run a TFJob on worker if admitted", framework.RedundantSpec, func() {
tfJob := testingtfjob.MakeTFJob("tfjob1", managerNs.Name).
Queue(managerLq.Name).
TFReplicaSpecs(
@@ -788,7 +820,7 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
})
- ginkgo.It("Should run a PaddleJob on worker if admitted", func() {
+ ginkgo.It("Should run a PaddleJob on worker if admitted", framework.RedundantSpec, func() {
paddleJob := testingpaddlejob.MakePaddleJob("paddlejob1", managerNs.Name).
Queue(managerLq.Name).
PaddleReplicaSpecs(
@@ -946,8 +978,8 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
})
- ginkgo.It("Should run a XGBoostJob on worker if admitted", func() {
- xgBoostJob := testingxgboostjob.MakeXGBoostJob("pytorchjob1", managerNs.Name).
+ ginkgo.It("Should run a XGBoostJob on worker if admitted", framework.RedundantSpec, func() {
+ xgBoostJob := testingxgboostjob.MakeXGBoostJob("xgboostjob1", managerNs.Name).
Queue(managerLq.Name).
XGBReplicaSpecs(
testingxgboostjob.XGBReplicaSpecRequirement{
@@ -1026,6 +1058,84 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
})
+ ginkgo.It("Should run a MPIJob on worker if admitted", func() {
+ mpijob := testingmpijob.MakeMPIJob("mpijob1", managerNs.Name).
+ Queue(managerLq.Name).
+ MPIJobReplicaSpecs(
+ testingmpijob.MPIJobReplicaSpecRequirement{
+ ReplicaType: kfmpi.MPIReplicaTypeLauncher,
+ ReplicaCount: 1,
+ RestartPolicy: corev1.RestartPolicyOnFailure,
+ },
+ testingmpijob.MPIJobReplicaSpecRequirement{
+ ReplicaType: kfmpi.MPIReplicaTypeWorker,
+ ReplicaCount: 1,
+ RestartPolicy: corev1.RestartPolicyNever,
+ },
+ ).
+ Obj()
+ gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, mpijob)).Should(gomega.Succeed())
+
+ wlLookupKey := types.NamespacedName{Name: workloadmpijob.GetWorkloadNameForMPIJob(mpijob.Name, mpijob.UID), Namespace: managerNs.Name}
+ admission := utiltesting.MakeAdmission(managerCq.Name).PodSets(
+ kueue.PodSetAssignment{
+ Name: "launcher",
+ }, kueue.PodSetAssignment{
+ Name: "worker",
+ },
+ )
+
+ admitWorkloadAndCheckWorkerCopies(multikueueAC.Name, wlLookupKey, admission)
+
+ ginkgo.By("changing the status of the MPIJob in the worker, updates the manager's MPIJob status", func() {
+ gomega.Eventually(func(g gomega.Gomega) {
+ createdMPIJob := kfmpi.MPIJob{}
+ g.Expect(worker2TestCluster.client.Get(worker2TestCluster.ctx, client.ObjectKeyFromObject(mpijob), &createdMPIJob)).To(gomega.Succeed())
+ createdMPIJob.Status.ReplicaStatuses = map[kfmpi.MPIReplicaType]*kfmpi.ReplicaStatus{
+ kfmpi.MPIReplicaTypeLauncher: {
+ Active: 1,
+ },
+ kfmpi.MPIReplicaTypeWorker: {
+ Active: 1,
+ Succeeded: 1,
+ },
+ }
+ g.Expect(worker2TestCluster.client.Status().Update(worker2TestCluster.ctx, &createdMPIJob)).To(gomega.Succeed())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ gomega.Eventually(func(g gomega.Gomega) {
+ createdMPIJob := kfmpi.MPIJob{}
+ g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(mpijob), &createdMPIJob)).To(gomega.Succeed())
+ g.Expect(createdMPIJob.Status.ReplicaStatuses).To(gomega.Equal(
+ map[kfmpi.MPIReplicaType]*kfmpi.ReplicaStatus{
+ kfmpi.MPIReplicaTypeLauncher: {
+ Active: 1,
+ },
+ kfmpi.MPIReplicaTypeWorker: {
+ Active: 1,
+ Succeeded: 1,
+ },
+ }))
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ })
+
+ ginkgo.By("finishing the worker MPIJob, the manager's wl is marked as finished and the worker2 wl removed", func() {
+ finishJobReason := "MPIJob finished successfully"
+ gomega.Eventually(func(g gomega.Gomega) {
+ createdMPIJob := kfmpi.MPIJob{}
+ g.Expect(worker2TestCluster.client.Get(worker2TestCluster.ctx, client.ObjectKeyFromObject(mpijob), &createdMPIJob)).To(gomega.Succeed())
+ createdMPIJob.Status.Conditions = append(createdMPIJob.Status.Conditions, kfmpi.JobCondition{
+ Type: kfmpi.JobSucceeded,
+ Status: corev1.ConditionTrue,
+ Reason: "ByTest",
+ Message: finishJobReason,
+ })
+ g.Expect(worker2TestCluster.client.Status().Update(worker2TestCluster.ctx, &createdMPIJob)).To(gomega.Succeed())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+
+ waitForWorkloadToFinishAndRemoteWorkloadToBeDeleted(wlLookupKey, finishJobReason)
+ })
+ })
+
ginkgo.It("Should remove the worker's workload and job after reconnect when the managers job and workload are deleted", func() {
job := testingjob.MakeJob("job", managerNs.Name).
Queue(managerLq.Name).
@@ -1058,18 +1168,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.By("breaking the connection to worker2", func() {
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
createdCluster.Spec.KubeConfig.Location = "bad-secret"
g.Expect(managerTestCluster.client.Update(managerTestCluster.ctx, createdCluster)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
- activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueue.MultiKueueClusterActive)
g.Expect(activeCondition).To(gomega.BeComparableTo(&metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionFalse,
Reason: "BadConfig",
}, util.IgnoreConditionMessage, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -1091,18 +1201,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.By("breaking the connection to worker1", func() {
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster1), createdCluster)).To(gomega.Succeed())
createdCluster.Spec.KubeConfig.Location = "bad-secret"
g.Expect(managerTestCluster.client.Update(managerTestCluster.ctx, createdCluster)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster1), createdCluster)).To(gomega.Succeed())
- activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueue.MultiKueueClusterActive)
g.Expect(activeCondition).To(gomega.BeComparableTo(&metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionFalse,
Reason: "BadConfig",
}, util.IgnoreConditionMessage, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -1137,18 +1247,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.By("restoring the connection to worker2", func() {
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
createdCluster.Spec.KubeConfig.Location = managerMultikueueSecret2.Name
g.Expect(managerTestCluster.client.Update(managerTestCluster.ctx, createdCluster)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
- activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueue.MultiKueueClusterActive)
g.Expect(activeCondition).To(gomega.BeComparableTo(&metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionTrue,
Reason: "Active",
}, util.IgnoreConditionMessage, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -1163,18 +1273,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.By("restoring the connection to worker1", func() {
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster1), createdCluster)).To(gomega.Succeed())
createdCluster.Spec.KubeConfig.Location = managerMultikueueSecret1.Name
g.Expect(managerTestCluster.client.Update(managerTestCluster.ctx, createdCluster)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster1), createdCluster)).To(gomega.Succeed())
- activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueue.MultiKueueClusterActive)
g.Expect(activeCondition).To(gomega.BeComparableTo(&metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionTrue,
Reason: "Active",
}, util.IgnoreConditionMessage, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -1189,10 +1299,10 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
})
})
- ginkgo.It("Should requeue the workload with a delay when the connection to the admitting worker is lost", func() {
+ ginkgo.It("Should requeue the workload with a delay when the connection to the admitting worker is lost", framework.SlowSpec, func() {
jobSet := testingjobset.MakeJobSet("job-set", managerNs.Name).
Queue(managerLq.Name).
- ManagedBy(kueuealpha.MultiKueueControllerName).
+ ManagedBy(kueue.MultiKueueControllerName).
ReplicatedJobs(
testingjobset.ReplicatedJobRequirements{
Name: "replicated-job-1",
@@ -1224,18 +1334,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
var disconnectedTime time.Time
ginkgo.By("breaking the connection to worker2", func() {
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
createdCluster.Spec.KubeConfig.Location = "bad-secret"
g.Expect(managerTestCluster.client.Update(managerTestCluster.ctx, createdCluster)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
- activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueue.MultiKueueClusterActive)
g.Expect(activeCondition).To(gomega.BeComparableTo(&metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionFalse,
Reason: "BadConfig",
}, util.IgnoreConditionMessage, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -1262,18 +1372,18 @@ var _ = ginkgo.Describe("Multikueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
ginkgo.By("restoring the connection to worker2", func() {
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
createdCluster.Spec.KubeConfig.Location = managerMultikueueSecret2.Name
g.Expect(managerTestCluster.client.Update(managerTestCluster.ctx, createdCluster)).To(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())
gomega.Eventually(func(g gomega.Gomega) {
- createdCluster := &kueuealpha.MultiKueueCluster{}
+ createdCluster := &kueue.MultiKueueCluster{}
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, client.ObjectKeyFromObject(workerCluster2), createdCluster)).To(gomega.Succeed())
- activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueuealpha.MultiKueueClusterActive)
+ activeCondition := apimeta.FindStatusCondition(createdCluster.Status.Conditions, kueue.MultiKueueClusterActive)
g.Expect(activeCondition).To(gomega.BeComparableTo(&metav1.Condition{
- Type: kueuealpha.MultiKueueClusterActive,
+ Type: kueue.MultiKueueClusterActive,
Status: metav1.ConditionTrue,
Reason: "Active",
}, util.IgnoreConditionMessage, util.IgnoreConditionTimestampsAndObservedGeneration))
@@ -1298,9 +1408,9 @@ var _ = ginkgo.Describe("Multikueue no GC", ginkgo.Ordered, ginkgo.ContinueOnFai
managerMultikueueSecret1 *corev1.Secret
managerMultikueueSecret2 *corev1.Secret
- workerCluster1 *kueuealpha.MultiKueueCluster
- workerCluster2 *kueuealpha.MultiKueueCluster
- managerMultiKueueConfig *kueuealpha.MultiKueueConfig
+ workerCluster1 *kueue.MultiKueueCluster
+ workerCluster2 *kueue.MultiKueueCluster
+ managerMultiKueueConfig *kueue.MultiKueueConfig
multikueueAC *kueue.AdmissionCheck
managerCq *kueue.ClusterQueue
managerLq *kueue.LocalQueue
@@ -1313,11 +1423,13 @@ var _ = ginkgo.Describe("Multikueue no GC", ginkgo.Ordered, ginkgo.ContinueOnFai
)
ginkgo.BeforeAll(func() {
- multiclusterSetup(0)
+ managerTestCluster.fwk.StartManager(managerTestCluster.ctx, managerTestCluster.cfg, func(ctx context.Context, mgr manager.Manager) {
+ managerAndMultiKueueSetup(ctx, mgr, 0)
+ })
})
ginkgo.AfterAll(func() {
- multiclusterTeardown()
+ managerTestCluster.fwk.StopManager(managerTestCluster.ctx)
})
ginkgo.BeforeEach(func() {
@@ -1354,7 +1466,7 @@ var _ = ginkgo.Describe("Multikueue no GC", ginkgo.Ordered, ginkgo.ContinueOnFai
Namespace: managersConfigNamespace.Name,
},
Data: map[string][]byte{
- kueuealpha.MultiKueueConfigSecretKey: w1Kubeconfig,
+ kueue.MultiKueueConfigSecretKey: w1Kubeconfig,
},
}
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, managerMultikueueSecret1)).To(gomega.Succeed())
@@ -1365,23 +1477,23 @@ var _ = ginkgo.Describe("Multikueue no GC", ginkgo.Ordered, ginkgo.ContinueOnFai
Namespace: managersConfigNamespace.Name,
},
Data: map[string][]byte{
- kueuealpha.MultiKueueConfigSecretKey: w2Kubeconfig,
+ kueue.MultiKueueConfigSecretKey: w2Kubeconfig,
},
}
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, managerMultikueueSecret2)).To(gomega.Succeed())
- workerCluster1 = utiltesting.MakeMultiKueueCluster("worker1").KubeConfig(kueuealpha.SecretLocationType, managerMultikueueSecret1.Name).Obj()
+ workerCluster1 = utiltesting.MakeMultiKueueCluster("worker1").KubeConfig(kueue.SecretLocationType, managerMultikueueSecret1.Name).Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, workerCluster1)).To(gomega.Succeed())
- workerCluster2 = utiltesting.MakeMultiKueueCluster("worker2").KubeConfig(kueuealpha.SecretLocationType, managerMultikueueSecret2.Name).Obj()
+ workerCluster2 = utiltesting.MakeMultiKueueCluster("worker2").KubeConfig(kueue.SecretLocationType, managerMultikueueSecret2.Name).Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, workerCluster2)).To(gomega.Succeed())
managerMultiKueueConfig = utiltesting.MakeMultiKueueConfig("multikueueconfig").Clusters(workerCluster1.Name, workerCluster2.Name).Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, managerMultiKueueConfig)).Should(gomega.Succeed())
multikueueAC = utiltesting.MakeAdmissionCheck("ac1").
- ControllerName(kueuealpha.MultiKueueControllerName).
- Parameters(kueuealpha.GroupVersion.Group, "MultiKueueConfig", managerMultiKueueConfig.Name).
+ ControllerName(kueue.MultiKueueControllerName).
+ Parameters(kueue.GroupVersion.Group, "MultiKueueConfig", managerMultiKueueConfig.Name).
Obj()
gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, multikueueAC)).Should(gomega.Succeed())
@@ -1430,7 +1542,7 @@ var _ = ginkgo.Describe("Multikueue no GC", ginkgo.Ordered, ginkgo.ContinueOnFai
util.ExpectObjectToBeDeleted(managerTestCluster.ctx, managerTestCluster.client, managerMultikueueSecret2, true)
})
- ginkgo.It("Should remove the worker's workload and job when managers job is deleted", func() {
+ ginkgo.It("Should remove the worker's workload and job when managers job is deleted", framework.SlowSpec, func() {
job := testingjob.MakeJob("job", managerNs.Name).
Queue(managerLq.Name).
Obj()
diff --git a/test/integration/multikueue/suite_test.go b/test/integration/multikueue/suite_test.go
index 0d58df277ba..c1babb4be83 100644
--- a/test/integration/multikueue/suite_test.go
+++ b/test/integration/multikueue/suite_test.go
@@ -20,6 +20,7 @@ import (
"context"
"os"
"path/filepath"
+ "sync"
"testing"
"time"
@@ -39,12 +40,14 @@ import (
"sigs.k8s.io/kueue/pkg/controller/admissionchecks/multikueue"
"sigs.k8s.io/kueue/pkg/controller/core"
"sigs.k8s.io/kueue/pkg/controller/core/indexer"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework"
workloadjob "sigs.k8s.io/kueue/pkg/controller/jobs/job"
workloadjobset "sigs.k8s.io/kueue/pkg/controller/jobs/jobset"
workloadpaddlejob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/paddlejob"
workloadpytorchjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/pytorchjob"
workloadtfjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/tfjob"
workloadxgboostjob "sigs.k8s.io/kueue/pkg/controller/jobs/kubeflow/jobs/xgboostjob"
+ workloadmpijob "sigs.k8s.io/kueue/pkg/controller/jobs/mpijob"
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/util/kubeversion"
utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
@@ -73,29 +76,33 @@ var (
worker1TestCluster cluster
worker2TestCluster cluster
managersConfigNamespace *corev1.Namespace
- featuregatesT *testing.T
)
func TestMultiKueue(t *testing.T) {
gomega.RegisterFailHandler(ginkgo.Fail)
- featuregatesT = t
ginkgo.RunSpecs(t,
"Multikueue Suite",
)
- featuregatesT = nil
}
func createCluster(setupFnc framework.ManagerSetup, apiFeatureGates ...string) cluster {
c := cluster{}
c.fwk = &framework.Framework{
- CRDPath: filepath.Join("..", "..", "..", "config", "components", "crd", "bases"),
- WebhookPath: filepath.Join("..", "..", "..", "config", "components", "webhook"),
- DepCRDPaths: []string{filepath.Join("..", "..", "..", "dep-crds", "jobset-operator"), filepath.Join("..", "..", "..", "dep-crds", "training-operator")},
+ CRDPath: filepath.Join("..", "..", "..", "config", "components", "crd", "bases"),
+ WebhookPath: filepath.Join("..", "..", "..", "config", "components", "webhook"),
+ DepCRDPaths: []string{filepath.Join("..", "..", "..", "dep-crds", "jobset-operator"),
+ filepath.Join("..", "..", "..", "dep-crds", "training-operator-crds"),
+ filepath.Join("..", "..", "..", "dep-crds", "mpi-operator"),
+ },
APIServerFeatureGates: apiFeatureGates,
}
c.cfg = c.fwk.Init()
- c.ctx, c.client = c.fwk.RunManager(c.cfg, setupFnc)
+ c.ctx, c.client = c.fwk.SetupClient(c.cfg)
+ // skip the manager setup if setup func is not provided
+ if setupFnc != nil {
+ c.fwk.StartManager(c.ctx, c.cfg, setupFnc)
+ }
return c
}
@@ -124,7 +131,7 @@ func managerSetup(ctx context.Context, mgr manager.Manager) {
err = jobReconciler.SetupWithManager(mgr)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = workloadjob.SetupWebhook(mgr)
+ err = workloadjob.SetupWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
err = workloadjobset.SetupIndexes(ctx, mgr.GetFieldIndexer())
@@ -136,7 +143,7 @@ func managerSetup(ctx context.Context, mgr manager.Manager) {
err = jobsetReconciler.SetupWithManager(mgr)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = workloadjobset.SetupJobSetWebhook(mgr)
+ err = workloadjobset.SetupJobSetWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
err = workloadtfjob.SetupIndexes(ctx, mgr.GetFieldIndexer())
@@ -148,7 +155,7 @@ func managerSetup(ctx context.Context, mgr manager.Manager) {
err = tfjobReconciler.SetupWithManager(mgr)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = workloadtfjob.SetupTFJobWebhook(mgr)
+ err = workloadtfjob.SetupTFJobWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
err = workloadpaddlejob.SetupIndexes(ctx, mgr.GetFieldIndexer())
@@ -160,7 +167,7 @@ func managerSetup(ctx context.Context, mgr manager.Manager) {
err = paddleJobReconciler.SetupWithManager(mgr)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = workloadpaddlejob.SetupPaddleJobWebhook(mgr)
+ err = workloadpaddlejob.SetupPaddleJobWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
err = workloadpytorchjob.SetupIndexes(ctx, mgr.GetFieldIndexer())
@@ -172,7 +179,7 @@ func managerSetup(ctx context.Context, mgr manager.Manager) {
err = pyTorchJobReconciler.SetupWithManager(mgr)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = workloadpytorchjob.SetupPyTorchJobWebhook(mgr)
+ err = workloadpytorchjob.SetupPyTorchJobWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
err = workloadxgboostjob.SetupIndexes(ctx, mgr.GetFieldIndexer())
@@ -184,20 +191,25 @@ func managerSetup(ctx context.Context, mgr manager.Manager) {
err = xgboostJobReconciler.SetupWithManager(mgr)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- err = workloadxgboostjob.SetupXGBoostJobWebhook(mgr)
+ err = workloadxgboostjob.SetupXGBoostJobWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ err = workloadmpijob.SetupIndexes(ctx, mgr.GetFieldIndexer())
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ mpiJobReconciler := workloadmpijob.NewReconciler(
+ mgr.GetClient(),
+ mgr.GetEventRecorderFor(constants.JobControllerName))
+ err = mpiJobReconciler.SetupWithManager(mgr)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ err = workloadmpijob.SetupMPIJobWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
func managerAndMultiKueueSetup(ctx context.Context, mgr manager.Manager, gcInterval time.Duration) {
managerSetup(ctx, mgr)
- managersConfigNamespace = &corev1.Namespace{
- ObjectMeta: metav1.ObjectMeta{
- Name: "kueue-system",
- },
- }
- gomega.Expect(mgr.GetClient().Create(ctx, managersConfigNamespace)).To(gomega.Succeed())
-
err := multikueue.SetupIndexer(ctx, mgr.GetFieldIndexer(), managersConfigNamespace.Name)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
@@ -209,27 +221,50 @@ func managerAndMultiKueueSetup(ctx context.Context, mgr manager.Manager, gcInter
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
-func multiclusterSetup(gcInterval time.Duration) {
+var _ = ginkgo.BeforeSuite(func() {
var managerFeatureGates []string
version, err := versionutil.ParseGeneric(os.Getenv("ENVTEST_K8S_VERSION"))
if err != nil || !version.LessThan(versionutil.MustParseSemantic("1.30.0")) {
managerFeatureGates = []string{"JobManagedBy=true"}
}
- managerTestCluster = createCluster(func(ctx context.Context, mgr manager.Manager) {
- managerAndMultiKueueSetup(ctx, mgr, gcInterval)
- }, managerFeatureGates...)
- worker1TestCluster = createCluster(managerSetup)
- worker2TestCluster = createCluster(managerSetup)
+ ginkgo.By("creating the clusters", func() {
+ wg := sync.WaitGroup{}
+ wg.Add(3)
+ go func() {
+ defer wg.Done()
+ // pass nil setup since the manager for the manage cluster is different in some specs.
+ c := createCluster(nil, managerFeatureGates...)
+ managerTestCluster = c
+ }()
+ go func() {
+ defer wg.Done()
+ c := createCluster(managerSetup)
+ worker1TestCluster = c
+ }()
+ go func() {
+ defer wg.Done()
+ c := createCluster(managerSetup)
+ worker2TestCluster = c
+ }()
+ wg.Wait()
+ })
discoveryClient, err := discovery.NewDiscoveryClientForConfig(managerTestCluster.cfg)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
managerK8sVersion, err = kubeversion.FetchServerVersion(discoveryClient)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
-}
-func multiclusterTeardown() {
+ managersConfigNamespace = &corev1.Namespace{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "kueue-system",
+ },
+ }
+ gomega.Expect(managerTestCluster.client.Create(managerTestCluster.ctx, managersConfigNamespace)).To(gomega.Succeed())
+})
+
+var _ = ginkgo.AfterSuite(func() {
managerTestCluster.fwk.Teardown()
worker1TestCluster.fwk.Teardown()
worker2TestCluster.fwk.Teardown()
-}
+})
diff --git a/test/integration/scheduler/fairsharing/fair_sharing_test.go b/test/integration/scheduler/fairsharing/fair_sharing_test.go
index cb98cfc4ce9..7d59ea1ab57 100644
--- a/test/integration/scheduler/fairsharing/fair_sharing_test.go
+++ b/test/integration/scheduler/fairsharing/fair_sharing_test.go
@@ -18,7 +18,6 @@ package fairsharing
import (
"fmt"
- "time"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
@@ -32,6 +31,7 @@ import (
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/util/testing"
"sigs.k8s.io/kueue/pkg/workload"
+ "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -98,7 +98,7 @@ var _ = ginkgo.Describe("Scheduler", func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, cqShared, true)
})
- ginkgo.It("Admits workloads respecting fair share", func() {
+ ginkgo.It("Admits workloads respecting fair share", framework.SlowSpec, func() {
ginkgo.By("Saturating cq-a")
aWorkloads := make([]*kueue.Workload, 10)
@@ -115,8 +115,7 @@ var _ = ginkgo.Describe("Scheduler", func() {
util.ExpectClusterQueueWeightedShareMetric(cqShared, 0)
ginkgo.By("Creating newer workloads in cq-b")
- // Ensure workloads in cqB have a newer timestamp.
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(aWorkloads[len(aWorkloads)-1])
bWorkloads := make([]*kueue.Workload, 5)
for i := range bWorkloads {
bWorkloads[i] = testing.MakeWorkload(fmt.Sprintf("b-%d", i), ns.Name).
@@ -236,7 +235,7 @@ var _ = ginkgo.Describe("Scheduler", func() {
gomega.Expect(util.DeleteObject(ctx, k8sClient, cqC)).To(gomega.Succeed())
})
- ginkgo.It("Admits workloads respecting fair share", func() {
+ ginkgo.It("Admits workloads respecting fair share", framework.SlowSpec, func() {
ginkgo.By("Saturating cq-a")
aWorkloads := make([]*kueue.Workload, 10)
diff --git a/test/integration/scheduler/fairsharing/suite_test.go b/test/integration/scheduler/fairsharing/suite_test.go
index c10492e97db..555c7a7b1b2 100644
--- a/test/integration/scheduler/fairsharing/suite_test.go
+++ b/test/integration/scheduler/fairsharing/suite_test.go
@@ -60,7 +60,8 @@ var _ = ginkgo.BeforeSuite(func() {
WebhookPath: filepath.Join("..", "..", "..", "..", "config", "components", "webhook"),
}
cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup)
+ ctx, k8sClient = fwk.SetupClient(cfg)
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup)
})
var _ = ginkgo.AfterSuite(func() {
diff --git a/test/integration/scheduler/podsready/scheduler_test.go b/test/integration/scheduler/podsready/scheduler_test.go
index b9a84f02015..04d39141287 100644
--- a/test/integration/scheduler/podsready/scheduler_test.go
+++ b/test/integration/scheduler/podsready/scheduler_test.go
@@ -17,7 +17,6 @@ limitations under the License.
package podsready
import (
- "path/filepath"
"time"
"github.com/google/go-cmp/cmp/cmpopts"
@@ -70,11 +69,6 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
)
ginkgo.JustBeforeEach(func() {
- fwk = &framework.Framework{
- CRDPath: filepath.Join("..", "..", "..", "..", "config", "components", "crd", "bases"),
- WebhookPath: filepath.Join("..", "..", "..", "..", "config", "components", "webhook"),
- }
- cfg = fwk.Init()
configuration := &config.Configuration{
WaitForPodsReady: &config.WaitForPodsReady{
Enable: true,
@@ -87,7 +81,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
},
},
}
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup(configuration))
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup(configuration))
defaultFlavor = testing.MakeResourceFlavor("default").Obj()
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).To(gomega.Succeed())
@@ -104,12 +98,20 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
ResourceGroup(*testing.MakeFlavorQuotas("default").Resource(corev1.ResourceCPU, "5").Obj()).
Obj()
gomega.Expect(k8sClient.Create(ctx, prodClusterQ)).Should(gomega.Succeed())
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(prodClusterQ), prodClusterQ)).Should(gomega.Succeed())
+ g.Expect(apimeta.IsStatusConditionTrue(prodClusterQ.Status.Conditions, kueue.ClusterQueueActive)).To(gomega.BeTrue())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
devClusterQ = testing.MakeClusterQueue("dev-cq").
Cohort("all").
ResourceGroup(*testing.MakeFlavorQuotas("default").Resource(corev1.ResourceCPU, "5").Obj()).
Obj()
gomega.Expect(k8sClient.Create(ctx, devClusterQ)).Should(gomega.Succeed())
+ gomega.Eventually(func(g gomega.Gomega) {
+ g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(devClusterQ), devClusterQ)).Should(gomega.Succeed())
+ g.Expect(apimeta.IsStatusConditionTrue(devClusterQ.Status.Conditions, kueue.ClusterQueueActive)).To(gomega.BeTrue())
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
prodQueue = testing.MakeLocalQueue("prod-queue", ns.Name).ClusterQueue(prodClusterQ.Name).Obj()
gomega.Expect(k8sClient.Create(ctx, prodQueue)).Should(gomega.Succeed())
@@ -122,7 +124,8 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
util.ExpectObjectToBeDeleted(ctx, k8sClient, prodClusterQ, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, devClusterQ, true)
- fwk.Teardown()
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
+ fwk.StopManager(ctx)
// Reset values that are changed by tests.
podsReadyTimeout = defaultPodsReadyTimeout
@@ -161,9 +164,10 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
ginkgo.By("checking the first prod workload gets admitted while the second is waiting")
prodWl := testing.MakeWorkload("prod-wl", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "2").Obj()
gomega.Expect(k8sClient.Create(ctx, prodWl)).Should(gomega.Succeed())
+ util.ExpectWorkloadsToHaveQuotaReservation(ctx, k8sClient, prodClusterQ.Name, prodWl)
+
devWl := testing.MakeWorkload("dev-wl", ns.Name).Queue(devQueue.Name).Request(corev1.ResourceCPU, "2").Obj()
gomega.Expect(k8sClient.Create(ctx, devWl)).Should(gomega.Succeed())
- util.ExpectWorkloadsToHaveQuotaReservation(ctx, k8sClient, prodClusterQ.Name, prodWl)
util.ExpectWorkloadsToBeWaiting(ctx, k8sClient, devWl)
ginkgo.By("delete the first workload and verify the second workload is admitted")
@@ -171,13 +175,12 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
util.ExpectWorkloadsToHaveQuotaReservation(ctx, k8sClient, devClusterQ.Name, devWl)
})
- ginkgo.It("Should block admission of one new workload if two are considered in the same scheduling cycle", func() {
+ ginkgo.It("Should block admission of one new workload if two are considered in the same scheduling cycle", framework.SlowSpec, func() {
ginkgo.By("creating two workloads but delaying cluster queue creation which has enough capacity")
prodWl := testing.MakeWorkload("prod-wl", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "11").Obj()
gomega.Expect(k8sClient.Create(ctx, prodWl)).Should(gomega.Succeed())
- // wait a second to ensure the CreationTimestamps differ and scheduler picks the first created to be admitted
- time.Sleep(time.Second)
devWl := testing.MakeWorkload("dev-wl", ns.Name).Queue(devQueue.Name).Request(corev1.ResourceCPU, "11").Obj()
+ util.WaitForNextSecondAfterCreation(prodWl)
gomega.Expect(k8sClient.Create(ctx, devWl)).Should(gomega.Succeed())
util.ExpectWorkloadsToBePending(ctx, k8sClient, prodWl, devWl)
@@ -190,7 +193,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
Obj()
gomega.Expect(k8sClient.Create(ctx, testCQ)).Should(gomega.Succeed())
defer func() {
- gomega.Expect(util.DeleteObject(ctx, k8sClient, testCQ)).Should(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, testCQ, true)
}()
ginkgo.By("verifying that the first created workload is admitted and the second workload is waiting as the first one has PodsReady=False")
@@ -205,7 +208,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
requeueingBackoffLimitCount = ptr.To[int32](2)
})
- ginkgo.It("Should requeue a workload which exceeded the timeout to reach PodsReady=True", func() {
+ ginkgo.It("Should requeue a workload which exceeded the timeout to reach PodsReady=True", framework.SlowSpec, func() {
const lowPrio, highPrio = 0, 100
ginkgo.By("create the 'prod1' workload")
@@ -253,7 +256,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
// To avoid flakiness, we don't verify if the workload has a QuotaReserved=false with pending reason here.
})
- ginkgo.It("Should re-admit a timed out workload and deactivate a workload exceeded the re-queue count limit. After that re-activating a workload", func() {
+ ginkgo.It("Should re-admit a timed out workload and deactivate a workload exceeded the re-queue count limit. After that re-activating a workload", framework.SlowSpec, func() {
ginkgo.By("create the 'prod' workload")
prodWl := testing.MakeWorkload("prod", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "2").Obj()
gomega.Expect(k8sClient.Create(ctx, prodWl)).Should(gomega.Succeed())
@@ -329,9 +332,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
ginkgo.By("create the 'prod' workload")
prodWl := testing.MakeWorkload("prod", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "2").Obj()
gomega.Expect(k8sClient.Create(ctx, prodWl)).Should(gomega.Succeed())
-
- ginkgo.By("create the 'dev' workload after a second")
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(prodWl)
devWl := testing.MakeWorkload("dev", ns.Name).Queue(devQueue.Name).Request(corev1.ResourceCPU, "2").Obj()
gomega.Expect(k8sClient.Create(ctx, devWl)).Should(gomega.Succeed())
@@ -414,7 +415,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
})
})
- ginkgo.It("Should move the evicted workload at the end of the queue", func() {
+ ginkgo.It("Should move the evicted workload at the end of the queue", framework.SlowSpec, func() {
// We wait 1 second between each workload creation calls. Therefore, we need to add this time to timeout.
podsReadyTimeout = util.TinyTimeout + 2*time.Second
requeueingBackoffLimitCount = ptr.To[int32](2)
@@ -428,12 +429,10 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
wl3 := testing.MakeWorkload("prod3", ns.Name).Queue(localQueueName).Request(corev1.ResourceCPU, "5").Obj()
ginkgo.By("create the workloads", func() {
- // since metav1.Time has only second resolution, wait one second between
- // create calls to avoid any potential creation timestamp collision
gomega.Expect(k8sClient.Create(ctx, wl1)).Should(gomega.Succeed())
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(wl1)
gomega.Expect(k8sClient.Create(ctx, wl2)).Should(gomega.Succeed())
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(wl2)
gomega.Expect(k8sClient.Create(ctx, wl3)).Should(gomega.Succeed())
})
@@ -508,19 +507,17 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReady", func() {
gomega.Expect(util.DeleteObject(ctx, k8sClient, standaloneQueue)).Should(gomega.Succeed())
})
- ginkgo.It("Should prioritize workloads submitted earlier", func() {
+ ginkgo.It("Should prioritize workloads submitted earlier", framework.SlowSpec, func() {
// the workloads are created with a 1 cpu resource requirement to ensure only one can fit at a given time
wl1 := testing.MakeWorkload("wl-1", ns.Name).Queue(standaloneQueue.Name).Request(corev1.ResourceCPU, "1").Obj()
wl2 := testing.MakeWorkload("wl-2", ns.Name).Queue(standaloneQueue.Name).Request(corev1.ResourceCPU, "1").Obj()
wl3 := testing.MakeWorkload("wl-3", ns.Name).Queue(standaloneQueue.Name).Request(corev1.ResourceCPU, "1").Obj()
ginkgo.By("create the workloads", func() {
- // since metav1.Time has only second resolution, wait one second between
- // create calls to avoid any potential creation timestamp collision
gomega.Expect(k8sClient.Create(ctx, wl1)).Should(gomega.Succeed())
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(wl1)
gomega.Expect(k8sClient.Create(ctx, wl2)).Should(gomega.Succeed())
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(wl2)
gomega.Expect(k8sClient.Create(ctx, wl3)).Should(gomega.Succeed())
})
@@ -568,11 +565,6 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReadyNonblockingMode", func() {
)
ginkgo.JustBeforeEach(func() {
- fwk = &framework.Framework{
- CRDPath: filepath.Join("..", "..", "..", "..", "config", "components", "crd", "bases"),
- WebhookPath: filepath.Join("..", "..", "..", "..", "config", "components", "webhook"),
- }
- cfg = fwk.Init()
configuration := &config.Configuration{
WaitForPodsReady: &config.WaitForPodsReady{
Enable: true,
@@ -585,7 +577,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReadyNonblockingMode", func() {
},
},
}
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup(configuration))
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup(configuration))
defaultFlavor = testing.MakeResourceFlavor("default").Obj()
gomega.Expect(k8sClient.Create(ctx, defaultFlavor)).To(gomega.Succeed())
@@ -620,7 +612,8 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReadyNonblockingMode", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
util.ExpectObjectToBeDeleted(ctx, k8sClient, prodClusterQ, true)
util.ExpectObjectToBeDeleted(ctx, k8sClient, devClusterQ, true)
- fwk.Teardown()
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, defaultFlavor, true)
+ fwk.StopManager(ctx)
// Reset values that are changed by tests.
podsReadyTimeout = defaultPodsReadyTimeout
@@ -650,7 +643,7 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReadyNonblockingMode", func() {
Obj()
gomega.Expect(k8sClient.Create(ctx, testCQ)).Should(gomega.Succeed())
defer func() {
- gomega.Expect(util.DeleteObject(ctx, k8sClient, testCQ)).Should(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, testCQ, true)
}()
ginkgo.By("verifying that the first created workload is admitted and the second workload is admitted as the blockAdmission is false")
@@ -719,19 +712,17 @@ var _ = ginkgo.Describe("SchedulerWithWaitForPodsReadyNonblockingMode", func() {
gomega.Expect(util.DeleteObject(ctx, k8sClient, standaloneQueue)).Should(gomega.Succeed())
})
- ginkgo.It("Should keep the evicted workload at the front of the queue", func() {
+ ginkgo.It("Should keep the evicted workload at the front of the queue", framework.SlowSpec, func() {
// the workloads are created with a 1 cpu resource requirement to ensure only one can fit at a given time
wl1 := testing.MakeWorkload("wl-1", ns.Name).Queue(standaloneQueue.Name).Request(corev1.ResourceCPU, "1").Obj()
wl2 := testing.MakeWorkload("wl-2", ns.Name).Queue(standaloneQueue.Name).Request(corev1.ResourceCPU, "1").Obj()
wl3 := testing.MakeWorkload("wl-3", ns.Name).Queue(standaloneQueue.Name).Request(corev1.ResourceCPU, "1").Obj()
ginkgo.By("create the workloads", func() {
- // since metav1.Time has only second resolution, wait one second between
- // create calls to avoid any potential creation timestamp collision
gomega.Expect(k8sClient.Create(ctx, wl1)).Should(gomega.Succeed())
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(wl1)
gomega.Expect(k8sClient.Create(ctx, wl2)).Should(gomega.Succeed())
- time.Sleep(time.Second)
+ util.WaitForNextSecondAfterCreation(wl2)
gomega.Expect(k8sClient.Create(ctx, wl3)).Should(gomega.Succeed())
})
diff --git a/test/integration/scheduler/podsready/suite_test.go b/test/integration/scheduler/podsready/suite_test.go
index f964c14adad..446ebd7ab3c 100644
--- a/test/integration/scheduler/podsready/suite_test.go
+++ b/test/integration/scheduler/podsready/suite_test.go
@@ -18,6 +18,7 @@ package podsready
import (
"context"
+ "path/filepath"
"testing"
"github.com/onsi/ginkgo/v2"
@@ -53,6 +54,19 @@ func TestSchedulerWithWaitForPodsReady(t *testing.T) {
)
}
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: filepath.Join("..", "..", "..", "..", "config", "components", "crd", "bases"),
+ WebhookPath: filepath.Join("..", "..", "..", "..", "config", "components", "webhook"),
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
func managerAndSchedulerSetup(configuration *config.Configuration) framework.ManagerSetup {
if configuration == nil {
configuration = &config.Configuration{}
diff --git a/test/integration/scheduler/preemption_test.go b/test/integration/scheduler/preemption_test.go
index 50c305935f7..20ebc6324c1 100644
--- a/test/integration/scheduler/preemption_test.go
+++ b/test/integration/scheduler/preemption_test.go
@@ -18,7 +18,6 @@ package scheduler
import (
"fmt"
- "time"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/onsi/ginkgo/v2"
@@ -167,10 +166,7 @@ var _ = ginkgo.Describe("Preemption", func() {
gomega.Expect(k8sClient.Create(ctx, wl3)).To(gomega.Succeed())
util.ExpectWorkloadsToBePending(ctx, k8sClient, wl3)
-
- ginkgo.By("Waiting one second, to ensure that the new workload has a later creation time")
- time.Sleep(time.Second)
-
+ util.WaitForNextSecondAfterCreation(wl3)
ginkgo.By("Creating a new Workload")
wl4 := testing.MakeWorkload("wl-4", ns.Name).
Queue(q.Name).
diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go
index 11317933470..d3aaa05961e 100644
--- a/test/integration/scheduler/scheduler_test.go
+++ b/test/integration/scheduler/scheduler_test.go
@@ -29,12 +29,14 @@ import (
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/pkg/controller/core"
"sigs.k8s.io/kueue/pkg/features"
"sigs.k8s.io/kueue/pkg/metrics"
"sigs.k8s.io/kueue/pkg/util/testing"
"sigs.k8s.io/kueue/pkg/workload"
+ "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -229,7 +231,7 @@ var _ = ginkgo.Describe("Scheduler", func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, spotUntaintedFlavor, true)
})
- ginkgo.It("Should admit workloads as they fit in their ClusterQueue", func() {
+ ginkgo.It("Should admit workloads as they fit in their ClusterQueue", framework.SlowSpec, func() {
ginkgo.By("checking the first prod workload gets admitted")
prodWl1 := testing.MakeWorkload("prod-wl1", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "2").Obj()
gomega.Expect(k8sClient.Create(ctx, prodWl1)).Should(gomega.Succeed())
@@ -1407,6 +1409,142 @@ var _ = ginkgo.Describe("Scheduler", func() {
})
})
+ ginkgo.When("Cohort provides resources directly", func() {
+ var (
+ cq *kueue.ClusterQueue
+ cohort *kueuealpha.Cohort
+ wl *kueue.Workload
+ )
+
+ ginkgo.BeforeEach(func() {
+ gomega.Expect(k8sClient.Create(ctx, onDemandFlavor)).Should(gomega.Succeed())
+ })
+
+ ginkgo.AfterEach(func() {
+ gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, cq, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, cohort, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, wl, true)
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandFlavor, true)
+ })
+
+ ginkgo.It("Should admit workload using resources borrowed from cohort", func() {
+ cq = testing.MakeClusterQueue("clusterqueue").
+ Cohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "0").Obj(),
+ ).Obj()
+ queue := testing.MakeLocalQueue("queue", ns.Name).ClusterQueue(cq.Name).Obj()
+ gomega.Expect(k8sClient.Create(ctx, cq)).Should(gomega.Succeed())
+ gomega.Expect(k8sClient.Create(ctx, queue)).Should(gomega.Succeed())
+
+ ginkgo.By("workload not admitted when Cohort doesn't provide any resources")
+ wl = testing.MakeWorkload("wl", ns.Name).Queue(queue.Name).
+ Request(corev1.ResourceCPU, "10").Obj()
+ gomega.Expect(k8sClient.Create(ctx, wl)).Should(gomega.Succeed())
+ util.ExpectWorkloadsToBePending(ctx, k8sClient, wl)
+ util.ExpectAdmittedWorkloadsTotalMetric(cq, 0)
+
+ ginkgo.By("workload not admitted when Cohort provides too few resources")
+ cohort = testing.MakeCohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "5").Obj(),
+ ).Obj()
+ gomega.Expect(k8sClient.Create(ctx, cohort)).Should(gomega.Succeed())
+ util.ExpectWorkloadsToBePending(ctx, k8sClient, wl)
+ util.ExpectAdmittedWorkloadsTotalMetric(cq, 0)
+
+ ginkgo.By("workload admitted when Cohort updated to provide sufficient resources")
+ gomega.Eventually(func() error {
+ _ = k8sClient.Get(ctx, types.NamespacedName{Name: cohort.Name}, cohort)
+ cohort.Spec.ResourceGroups[0].Flavors[0].Resources[0].NominalQuota = resource.MustParse("10")
+ return k8sClient.Update(ctx, cohort)
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ expectAdmission := testing.MakeAdmission(cq.Name).Assignment(corev1.ResourceCPU, "on-demand", "10").Obj()
+ util.ExpectWorkloadToBeAdmittedAs(ctx, k8sClient, wl, expectAdmission)
+ util.ExpectPendingWorkloadsMetric(cq, 0, 0)
+ util.ExpectAdmittedWorkloadsTotalMetric(cq, 1)
+ })
+
+ ginkgo.It("Should admit workload when cq switches into cohort with capacity", func() {
+ cq = testing.MakeClusterQueue("clusterqueue").
+ Cohort("impecunious-cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "0").Obj(),
+ ).Obj()
+ queue := testing.MakeLocalQueue("queue", ns.Name).ClusterQueue(cq.Name).Obj()
+ gomega.Expect(k8sClient.Create(ctx, cq)).Should(gomega.Succeed())
+ gomega.Expect(k8sClient.Create(ctx, queue)).Should(gomega.Succeed())
+
+ ginkgo.By("workload not admitted")
+ wl = testing.MakeWorkload("wl", ns.Name).Queue(queue.Name).
+ Request(corev1.ResourceCPU, "10").Obj()
+ gomega.Expect(k8sClient.Create(ctx, wl)).Should(gomega.Succeed())
+ util.ExpectWorkloadsToBePending(ctx, k8sClient, wl)
+ util.ExpectAdmittedWorkloadsTotalMetric(cq, 0)
+
+ ginkgo.By("cohort created")
+ cohort = testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "10").Obj()).Obj()
+ gomega.Expect(k8sClient.Create(ctx, cohort)).Should(gomega.Succeed())
+
+ ginkgo.By("cq switches and workload admitted")
+ gomega.Eventually(func() error {
+ _ = k8sClient.Get(ctx, types.NamespacedName{Name: cq.Name}, cq)
+ cq.Spec.Cohort = "cohort"
+ return k8sClient.Update(ctx, cq)
+ }, util.Timeout, util.Interval).Should(gomega.Succeed())
+ expectAdmission := testing.MakeAdmission(cq.Name).Assignment(corev1.ResourceCPU, "on-demand", "10").Obj()
+ util.ExpectWorkloadToBeAdmittedAs(ctx, k8sClient, wl, expectAdmission)
+ util.ExpectPendingWorkloadsMetric(cq, 0, 0)
+ util.ExpectAdmittedWorkloadsTotalMetric(cq, 1)
+ })
+ ginkgo.It("Long distance resource allows workload to be scheduled", func() {
+ cq = testing.MakeClusterQueue("cq").
+ Cohort("left").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "0").Obj(),
+ ).Obj()
+ queue := testing.MakeLocalQueue("queue", ns.Name).ClusterQueue(cq.Name).Obj()
+ gomega.Expect(k8sClient.Create(ctx, cq)).Should(gomega.Succeed())
+ gomega.Expect(k8sClient.Create(ctx, queue)).Should(gomega.Succeed())
+
+ ginkgo.By("cohorts created")
+ cohortRight := testing.MakeCohort("left").Parent("root").Obj()
+ cohortLeft := testing.MakeCohort("right").Parent("root").Obj()
+ gomega.Expect(k8sClient.Create(ctx, cohortLeft)).Should(gomega.Succeed())
+ gomega.Expect(k8sClient.Create(ctx, cohortRight)).Should(gomega.Succeed())
+
+ // root
+ // / \
+ // left right
+ // /
+ // cq
+ ginkgo.By("workload not admitted")
+ wl = testing.MakeWorkload("wl", ns.Name).Queue(queue.Name).
+ Request(corev1.ResourceCPU, "10").Obj()
+ gomega.Expect(k8sClient.Create(ctx, wl)).Should(gomega.Succeed())
+ util.ExpectWorkloadsToBePending(ctx, k8sClient, wl)
+ util.ExpectAdmittedWorkloadsTotalMetric(cq, 0)
+
+ // root
+ // / \
+ // left right
+ // / \
+ // cq bank
+ ginkgo.By("cohort with resources created and workload admitted")
+ cohortBank := testing.MakeCohort("bank").Parent("right").
+ ResourceGroup(
+ testing.MakeFlavorQuotas("on-demand").Resource(corev1.ResourceCPU, "10").FlavorQuotas,
+ ).Obj()
+ gomega.Expect(k8sClient.Create(ctx, cohortBank)).Should(gomega.Succeed())
+ expectAdmission := testing.MakeAdmission(cq.Name).Assignment(corev1.ResourceCPU, "on-demand", "10").Obj()
+ util.ExpectWorkloadToBeAdmittedAs(ctx, k8sClient, wl, expectAdmission)
+ util.ExpectPendingWorkloadsMetric(cq, 0, 0)
+ util.ExpectAdmittedWorkloadsTotalMetric(cq, 1)
+ })
+ })
+
ginkgo.When("Using cohorts for sharing with LendingLimit", func() {
var (
prodCQ *kueue.ClusterQueue
@@ -2334,7 +2472,7 @@ var _ = ginkgo.Describe("Scheduler", func() {
Type: kueue.WorkloadQuotaReserved,
Status: metav1.ConditionFalse,
Reason: "Pending",
- Message: "couldn't assign flavors to pod set main: insufficient unused quota in cohort for memory in flavor on-demand, 2Gi more needed",
+ Message: "couldn't assign flavors to pod set main: insufficient unused quota in cohort for memory in flavor on-demand, 1Gi more needed",
}, util.IgnoreConditionTimestampsAndObservedGeneration),
))
}, util.Timeout, util.Interval).Should(gomega.Succeed())
diff --git a/test/integration/scheduler/suite_test.go b/test/integration/scheduler/suite_test.go
index 803985c22a8..086d2dc82fc 100644
--- a/test/integration/scheduler/suite_test.go
+++ b/test/integration/scheduler/suite_test.go
@@ -60,7 +60,8 @@ var _ = ginkgo.BeforeSuite(func() {
WebhookPath: filepath.Join("..", "..", "..", "config", "components", "webhook"),
}
cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup)
+ ctx, k8sClient = fwk.SetupClient(cfg)
+ fwk.StartManager(ctx, cfg, managerAndSchedulerSetup)
})
var _ = ginkgo.AfterSuite(func() {
diff --git a/test/integration/scheduler/workload_controller_test.go b/test/integration/scheduler/workload_controller_test.go
index 36b4273e48f..ddb336cf376 100644
--- a/test/integration/scheduler/workload_controller_test.go
+++ b/test/integration/scheduler/workload_controller_test.go
@@ -31,6 +31,7 @@ import (
"sigs.k8s.io/kueue/pkg/util/slices"
"sigs.k8s.io/kueue/pkg/util/testing"
"sigs.k8s.io/kueue/pkg/workload"
+ "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -129,7 +130,7 @@ var _ = ginkgo.Describe("Workload controller with scheduler", func() {
util.ExpectObjectToBeDeleted(ctx, k8sClient, flavor2, true)
})
- ginkgo.It("the workload should have appropriate AdditionalChecks added", func() {
+ ginkgo.It("the workload should have appropriate AdditionalChecks added", framework.SlowSpec, func() {
wl := testing.MakeWorkload("wl", ns.Name).
Queue("queue").
Request(resourceGPU, "3").
diff --git a/test/integration/webhook/admissioncheck_test.go b/test/integration/webhook/core/admissioncheck_test.go
similarity index 99%
rename from test/integration/webhook/admissioncheck_test.go
rename to test/integration/webhook/core/admissioncheck_test.go
index 5c54fbcf2e5..e80c49def1f 100644
--- a/test/integration/webhook/admissioncheck_test.go
+++ b/test/integration/webhook/core/admissioncheck_test.go
@@ -1,4 +1,4 @@
-package webhook
+package core
import (
"github.com/google/go-cmp/cmp/cmpopts"
diff --git a/test/integration/webhook/clusterqueue_test.go b/test/integration/webhook/core/clusterqueue_test.go
similarity index 99%
rename from test/integration/webhook/clusterqueue_test.go
rename to test/integration/webhook/core/clusterqueue_test.go
index 7290cd9dcf1..36e75a1a720 100644
--- a/test/integration/webhook/clusterqueue_test.go
+++ b/test/integration/webhook/core/clusterqueue_test.go
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package webhook
+package core
import (
"fmt"
diff --git a/test/integration/webhook/core/cohort_test.go b/test/integration/webhook/core/cohort_test.go
new file mode 100644
index 00000000000..0c7f199fbae
--- /dev/null
+++ b/test/integration/webhook/core/cohort_test.go
@@ -0,0 +1,362 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package core
+
+import (
+ "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/util/testing"
+ "sigs.k8s.io/kueue/test/util"
+)
+
+var _ = ginkgo.Describe("Cohort Webhook", func() {
+ ginkgo.When("Creating a Cohort", func() {
+ ginkgo.DescribeTable("Validate Cohort on creation", func(cohort *kueuealpha.Cohort, errorType int) {
+ err := k8sClient.Create(ctx, cohort)
+ if err == nil {
+ defer func() {
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, cohort, true)
+ }()
+ }
+ switch errorType {
+ case isForbidden:
+ gomega.Expect(err).Should(gomega.HaveOccurred())
+ gomega.Expect(errors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
+ case isInvalid:
+ gomega.Expect(err).Should(gomega.HaveOccurred())
+ gomega.Expect(err).Should(testing.BeAPIError(testing.InvalidError), "error: %v", err)
+ default:
+ gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
+ }
+ },
+ ginkgo.Entry("Should disallow empty name",
+ testing.MakeCohort("").Obj(),
+ isInvalid),
+ ginkgo.Entry("Should allow default Cohort",
+ testing.MakeCohort("cohort").Obj(),
+ isValid),
+ ginkgo.Entry("Should allow valid parent name",
+ testing.MakeCohort("cohort").Parent("prod").Obj(),
+ isValid),
+ ginkgo.Entry("Should reject invalid parent name",
+ testing.MakeCohort("cohort").Parent("@prod").Obj(),
+ isInvalid),
+ ginkgo.Entry("ResourceGroup should have at least one flavor",
+ testing.MakeCohort("cohort").ResourceGroup().Obj(),
+ isInvalid),
+ ginkgo.Entry("FlavorQuota should have at least one resource",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("foo").Obj()).
+ Obj(),
+ isInvalid),
+ ginkgo.Entry("Should reject invalid flavor name",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("@x86").Resource("cpu", "5").Obj()).
+ Obj(),
+ isInvalid),
+ ginkgo.Entry("Should allow valid resource name",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("x86").Resource("@cpu", "5").Obj()).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should reject too many flavors in resource group",
+ testing.MakeCohort("cohort").ResourceGroup(
+ testing.MakeFlavorQuotas("f0").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f1").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f2").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f3").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f4").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f5").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f6").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f7").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f8").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f9").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f10").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f11").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f12").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f13").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f14").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f15").Resource("cpu").FlavorQuotas,
+ testing.MakeFlavorQuotas("f16").Resource("cpu").FlavorQuotas).Obj(),
+ isInvalid),
+ ginkgo.Entry("Should reject too many resources in resource group",
+ testing.MakeCohort("cohort").ResourceGroup(
+ testing.MakeFlavorQuotas("flavor").
+ Resource("cpu0").
+ Resource("cpu1").
+ Resource("cpu2").
+ Resource("cpu3").
+ Resource("cpu4").
+ Resource("cpu5").
+ Resource("cpu6").
+ Resource("cpu7").
+ Resource("cpu8").
+ Resource("cpu9").
+ Resource("cpu10").
+ Resource("cpu11").
+ Resource("cpu12").
+ Resource("cpu13").
+ Resource("cpu14").
+ Resource("cpu15").
+ Resource("cpu16").FlavorQuotas).Obj(),
+ isInvalid),
+ ginkgo.Entry("Should allow resource with valid name",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("default").Resource("cpu").Obj()).
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should reject resource with invalid name",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("default").Resource("@cpu").Obj()).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should allow extended resources with valid name",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("default").Resource("example.com/gpu").Obj()).
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should allow flavor with valid name",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("x86").Resource("cpu").Obj()).
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should reject flavor with invalid name",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("x_86").Resource("cpu").Obj()).
+ Obj(),
+ isInvalid),
+ ginkgo.Entry("Should reject negative nominal quota",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("x86").Resource("cpu", "-1").Obj()).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should reject negative borrowing limit",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("x86").Resource("cpu", "1", "-1").Obj()).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should reject negative lending limit",
+ testing.MakeCohort("cohort").
+ ResourceGroup(*testing.MakeFlavorQuotas("x86").Resource("cpu", "1", "", "-1").Obj()).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should reject borrowingLimit when no parent",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("x86").Resource("cpu", "1", "1").Obj()).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should allow borrowingLimit 0 when parent exists",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("x86").Resource("cpu", "1", "0").Obj()).
+ Parent("parent").
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should allow borrowingLimit when parent exists",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("x86").Resource("cpu", "1", "1").Obj()).
+ Parent("parent").
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should reject lendingLimit when no parent",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ testing.MakeFlavorQuotas("x86").
+ ResourceQuotaWrapper("cpu").NominalQuota("1").LendingLimit("1").Append().
+ FlavorQuotas,
+ ).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should allow lendingLimit when parent exists",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ testing.MakeFlavorQuotas("x86").
+ ResourceQuotaWrapper("cpu").NominalQuota("1").LendingLimit("1").Append().
+ FlavorQuotas,
+ ).
+ Parent("parent").
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should allow lendingLimit 0 when parent exists",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ testing.MakeFlavorQuotas("x86").
+ ResourceQuotaWrapper("cpu").NominalQuota("0").LendingLimit("0").Append().
+ FlavorQuotas,
+ ).
+ Parent("parent").
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should allow lending limit to exceed nominal quota",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ testing.MakeFlavorQuotas("x86").
+ ResourceQuotaWrapper("cpu").NominalQuota("3").LendingLimit("5").Append().
+ FlavorQuotas,
+ ).
+ Parent("parent").
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should allow multiple resource groups",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("alpha").
+ Resource("cpu", "0").
+ Resource("memory", "0").
+ Obj(),
+ *testing.MakeFlavorQuotas("beta").
+ Resource("cpu", "0").
+ Resource("memory", "0").
+ Obj(),
+ ).
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("gamma").
+ Resource("example.com/gpu", "0").
+ Obj(),
+ *testing.MakeFlavorQuotas("omega").
+ Resource("example.com/gpu", "0").
+ Obj(),
+ ).
+ Obj(),
+ isValid),
+ ginkgo.Entry("Should reject resources in a flavor in different order",
+ &kueuealpha.Cohort{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "cohort",
+ },
+ Spec: kueuealpha.CohortSpec{
+ ResourceGroups: []kueue.ResourceGroup{
+ {
+ CoveredResources: []corev1.ResourceName{"cpu", "memory"},
+ Flavors: []kueue.FlavorQuotas{
+ *testing.MakeFlavorQuotas("alpha").
+ Resource("cpu", "0").
+ Resource("memory", "0").
+ Obj(),
+ *testing.MakeFlavorQuotas("beta").
+ Resource("memory", "0").
+ Resource("cpu", "0").
+ Obj(),
+ },
+ },
+ },
+ },
+ },
+ isForbidden),
+ ginkgo.Entry("Should reject missing resources in a flavor",
+ &kueuealpha.Cohort{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "cohort",
+ },
+ Spec: kueuealpha.CohortSpec{
+ ResourceGroups: []kueue.ResourceGroup{
+ {
+ CoveredResources: []corev1.ResourceName{"cpu", "memory"},
+ Flavors: []kueue.FlavorQuotas{
+ *testing.MakeFlavorQuotas("alpha").
+ Resource("cpu", "0").
+ Obj(),
+ },
+ },
+ },
+ },
+ },
+ isInvalid),
+ ginkgo.Entry("Should reject resource not defined in resource group",
+ &kueuealpha.Cohort{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "cohort",
+ },
+ Spec: kueuealpha.CohortSpec{
+ ResourceGroups: []kueue.ResourceGroup{
+ {
+ CoveredResources: []corev1.ResourceName{"cpu"},
+ Flavors: []kueue.FlavorQuotas{
+ *testing.MakeFlavorQuotas("alpha").
+ Resource("cpu", "0").
+ Resource("memory", "0").
+ Obj(),
+ },
+ },
+ },
+ },
+ },
+ isInvalid),
+ ginkgo.Entry("Should reject resource in more than one resource group",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("alpha").
+ Resource("cpu", "0").
+ Resource("memory", "0").
+ Obj(),
+ ).
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("beta").
+ Resource("memory", "0").
+ Obj(),
+ ).
+ Obj(),
+ isForbidden),
+ ginkgo.Entry("Should reject flavor in more than one resource group",
+ testing.MakeCohort("cohort").
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("alpha").Resource("cpu").Obj(),
+ *testing.MakeFlavorQuotas("beta").Resource("cpu").Obj(),
+ ).
+ ResourceGroup(
+ *testing.MakeFlavorQuotas("beta").Resource("memory").Obj(),
+ ).
+ Obj(),
+ isForbidden),
+ )
+ })
+
+ ginkgo.When("Updating a Cohort", func() {
+ ginkgo.It("Should update parent", func() {
+ cohort := testing.MakeCohort("cohort").Obj()
+ gomega.Expect(k8sClient.Create(ctx, cohort)).Should(gomega.Succeed())
+
+ updated := cohort.DeepCopy()
+ updated.Spec.Parent = "cohort2"
+
+ gomega.Expect(k8sClient.Update(ctx, updated)).Should(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, cohort, true)
+ })
+ ginkgo.It("Should reject invalid parent", func() {
+ cohort := testing.MakeCohort("cohort").Obj()
+ gomega.Expect(k8sClient.Create(ctx, cohort)).Should(gomega.Succeed())
+
+ updated := cohort.DeepCopy()
+ updated.Spec.Parent = "@cohort2"
+
+ gomega.Expect(k8sClient.Update(ctx, updated)).ShouldNot(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, cohort, true)
+ })
+ ginkgo.It("Should reject negative borrowing limit", func() {
+ cohort := testing.MakeCohort("cohort").
+ ResourceGroup(testing.MakeFlavorQuotas("x86").Resource("cpu", "-1").FlavorQuotas).Cohort
+
+ gomega.Expect(k8sClient.Create(ctx, &cohort)).ShouldNot(gomega.Succeed())
+ util.ExpectObjectToBeDeleted(ctx, k8sClient, &cohort, true)
+ })
+ })
+})
diff --git a/test/integration/webhook/localqueue_test.go b/test/integration/webhook/core/localqueue_test.go
similarity index 99%
rename from test/integration/webhook/localqueue_test.go
rename to test/integration/webhook/core/localqueue_test.go
index c78794f6b10..a07a37ac356 100644
--- a/test/integration/webhook/localqueue_test.go
+++ b/test/integration/webhook/core/localqueue_test.go
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package webhook
+package core
import (
"github.com/onsi/ginkgo/v2"
diff --git a/test/integration/webhook/resourceflavor_test.go b/test/integration/webhook/core/resourceflavor_test.go
similarity index 99%
rename from test/integration/webhook/resourceflavor_test.go
rename to test/integration/webhook/core/resourceflavor_test.go
index f58acc45dc1..f7199da823c 100644
--- a/test/integration/webhook/resourceflavor_test.go
+++ b/test/integration/webhook/core/resourceflavor_test.go
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package webhook
+package core
import (
"fmt"
diff --git a/test/integration/webhook/suite_test.go b/test/integration/webhook/core/suite_test.go
similarity index 85%
rename from test/integration/webhook/suite_test.go
rename to test/integration/webhook/core/suite_test.go
index b2573d36a6c..752a14b747f 100644
--- a/test/integration/webhook/suite_test.go
+++ b/test/integration/webhook/core/suite_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package webhook
+package core
import (
"context"
@@ -46,17 +46,18 @@ var (
func TestAPIs(t *testing.T) {
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(t,
- "Webhook Suite",
+ "Core Webhook Suite",
)
}
var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
- CRDPath: filepath.Join("..", "..", "..", "config", "components", "crd", "bases"),
- WebhookPath: filepath.Join("..", "..", "..", "config", "components", "webhook"),
+ CRDPath: filepath.Join("..", "..", "..", "..", "config", "components", "crd", "bases"),
+ WebhookPath: filepath.Join("..", "..", "..", "..", "config", "components", "webhook"),
}
cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, func(ctx context.Context, mgr manager.Manager) {
+ ctx, k8sClient = fwk.SetupClient(cfg)
+ fwk.StartManager(ctx, cfg, func(ctx context.Context, mgr manager.Manager) {
err := indexer.Setup(ctx, mgr.GetFieldIndexer())
gomega.Expect(err).NotTo(gomega.HaveOccurred())
diff --git a/test/integration/webhook/workload_test.go b/test/integration/webhook/core/workload_test.go
similarity index 99%
rename from test/integration/webhook/workload_test.go
rename to test/integration/webhook/core/workload_test.go
index 7374519b9f3..cdaab940de7 100644
--- a/test/integration/webhook/workload_test.go
+++ b/test/integration/webhook/core/workload_test.go
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package webhook
+package core
import (
"fmt"
diff --git a/test/integration/controller/jobs/deployment/deployment_webhook_test.go b/test/integration/webhook/jobs/deployment_webhook_test.go
similarity index 94%
rename from test/integration/controller/jobs/deployment/deployment_webhook_test.go
rename to test/integration/webhook/jobs/deployment_webhook_test.go
index 5fd36750f9a..534262f0791 100644
--- a/test/integration/controller/jobs/deployment/deployment_webhook_test.go
+++ b/test/integration/webhook/jobs/deployment_webhook_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package deployment
+package jobs
import (
"github.com/onsi/ginkgo/v2"
@@ -28,31 +28,24 @@ import (
"sigs.k8s.io/kueue/pkg/controller/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/deployment"
"sigs.k8s.io/kueue/pkg/util/kubeversion"
testingdeployment "sigs.k8s.io/kueue/pkg/util/testingjobs/deployment"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
var _ = ginkgo.Describe("Deployment Webhook", func() {
var ns *corev1.Namespace
-
ginkgo.When("with pod integration enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
-
discoveryClient, err := discovery.NewDiscoveryClientForConfig(cfg)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
serverVersionFetcher = kubeversion.NewServerVersionFetcher(discoveryClient)
err = serverVersionFetcher.FetchServerVersion()
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
- nil,
+ fwk.StartManager(ctx, cfg, managerSetup(
+ deployment.SetupWebhook,
jobframework.WithManageJobsWithoutQueueName(false),
jobframework.WithKubeServerVersion(serverVersionFetcher),
))
@@ -70,7 +63,7 @@ var _ = ginkgo.Describe("Deployment Webhook", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.When("The queue-name label is set", func() {
diff --git a/test/integration/webhook/jobs/job_webhook_test.go b/test/integration/webhook/jobs/job_webhook_test.go
new file mode 100644
index 00000000000..f73d5a591cf
--- /dev/null
+++ b/test/integration/webhook/jobs/job_webhook_test.go
@@ -0,0 +1,234 @@
+/*
+Copyright 2022 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package jobs
+
+import (
+ "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+ batchv1 "k8s.io/api/batch/v1"
+ corev1 "k8s.io/api/core/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/client-go/discovery"
+ "k8s.io/utils/ptr"
+
+ "sigs.k8s.io/kueue/pkg/controller/constants"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/job"
+ "sigs.k8s.io/kueue/pkg/util/kubeversion"
+ testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/job"
+ "sigs.k8s.io/kueue/test/util"
+)
+
+var _ = ginkgo.Describe("Job Webhook With manageJobsWithoutQueueName enabled", ginkgo.Ordered, func() {
+ var ns *corev1.Namespace
+ ginkgo.BeforeAll(func() {
+ discoveryClient, err := discovery.NewDiscoveryClientForConfig(cfg)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ serverVersionFetcher = kubeversion.NewServerVersionFetcher(discoveryClient)
+ err = serverVersionFetcher.FetchServerVersion()
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ fwk.StartManager(ctx, cfg, managerSetup(
+ job.SetupWebhook,
+ jobframework.WithManageJobsWithoutQueueName(true),
+ jobframework.WithKubeServerVersion(serverVersionFetcher),
+ ))
+ })
+ ginkgo.BeforeEach(func() {
+ ns = &corev1.Namespace{
+ ObjectMeta: metav1.ObjectMeta{
+ GenerateName: "job-",
+ },
+ }
+ gomega.Expect(k8sClient.Create(ctx, ns)).To(gomega.Succeed())
+ })
+
+ ginkgo.AfterEach(func() {
+ gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
+ })
+ ginkgo.AfterAll(func() {
+ fwk.StopManager(ctx)
+ })
+
+ ginkgo.It("checking the workload is not created when JobMinParallelismAnnotation is invalid", func() {
+ job := testingjob.MakeJob("job-with-queue-name", ns.Name).Queue("foo").SetAnnotation(job.JobMinParallelismAnnotation, "a").Obj()
+ err := k8sClient.Create(ctx, job)
+ gomega.Expect(err).Should(gomega.HaveOccurred())
+ gomega.Expect(apierrors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
+ })
+
+ ginkgo.It("Should suspend a Job even no queue name specified", func() {
+ job := testingjob.MakeJob("job-without-queue-name", ns.Name).Suspend(false).Obj()
+ gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
+ createdJob := &batchv1.Job{}
+ gomega.Eventually(func() bool {
+ if err := k8sClient.Get(ctx, lookupKey, createdJob); err != nil {
+ return false
+ }
+ return createdJob.Spec.Suspend != nil && *createdJob.Spec.Suspend
+ }, util.Timeout, util.Interval).Should(gomega.BeTrue())
+ })
+
+ ginkgo.It("Should not update unsuspend Job successfully when adding queue name", func() {
+ job := testingjob.MakeJob("job-without-queue-name", ns.Name).Suspend(false).Obj()
+ gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
+ createdJob := &batchv1.Job{}
+ gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
+
+ createdJob.Annotations = map[string]string{constants.QueueAnnotation: "queue"}
+ createdJob.Spec.Suspend = ptr.To(false)
+ gomega.Expect(k8sClient.Update(ctx, createdJob)).ShouldNot(gomega.Succeed())
+ })
+
+ ginkgo.It("Should not succeed Job when kubernetes less than 1.27 and sync completions annotation is enabled for indexed jobs", func() {
+ if v := serverVersionFetcher.GetServerVersion(); v.AtLeast(kubeversion.KubeVersion1_27) {
+ ginkgo.Skip("Kubernetes version is not less then 1.27. Skip test...")
+ }
+ j := testingjob.MakeJob("job-without-queue-name", ns.Name).
+ Parallelism(5).
+ Completions(5).
+ SetAnnotation(job.JobCompletionsEqualParallelismAnnotation, "true").
+ Indexed(true).
+ Obj()
+ gomega.Expect(apierrors.IsForbidden(k8sClient.Create(ctx, j))).Should(gomega.BeTrue())
+ })
+})
+
+var _ = ginkgo.Describe("Job Webhook with manageJobsWithoutQueueName disabled", ginkgo.Ordered, func() {
+ var ns *corev1.Namespace
+ ginkgo.BeforeAll(func() {
+ fwk.StartManager(ctx, cfg, managerSetup(job.SetupWebhook, jobframework.WithManageJobsWithoutQueueName(false)))
+ })
+ ginkgo.BeforeEach(func() {
+ ns = &corev1.Namespace{
+ ObjectMeta: metav1.ObjectMeta{
+ GenerateName: "job-",
+ },
+ }
+ gomega.Expect(k8sClient.Create(ctx, ns)).To(gomega.Succeed())
+ })
+ ginkgo.AfterEach(func() {
+ gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
+ })
+ ginkgo.AfterAll(func() {
+ fwk.StopManager(ctx)
+ })
+
+ ginkgo.It("should suspend a Job when created in unsuspend state", func() {
+ job := testingjob.MakeJob("job-with-queue-name", ns.Name).Suspend(false).Queue("default").Obj()
+ gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
+ createdJob := &batchv1.Job{}
+ gomega.Eventually(func() bool {
+ if err := k8sClient.Get(ctx, lookupKey, createdJob); err != nil {
+ return false
+ }
+ return createdJob.Spec.Suspend != nil && *createdJob.Spec.Suspend
+ }, util.Timeout, util.Interval).Should(gomega.BeTrue())
+ })
+
+ ginkgo.It("should not suspend a Job when no queue name specified", func() {
+ job := testingjob.MakeJob("job-without-queue-name", ns.Name).Suspend(false).Obj()
+ gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
+ createdJob := &batchv1.Job{}
+ gomega.Eventually(func() bool {
+ if err := k8sClient.Get(ctx, lookupKey, createdJob); err != nil {
+ return false
+ }
+ return createdJob.Spec.Suspend != nil && !(*createdJob.Spec.Suspend)
+ }, util.Timeout, util.Interval).Should(gomega.BeTrue())
+ })
+
+ ginkgo.It("should not update unsuspend Job successfully when changing queue name", func() {
+ job := testingjob.MakeJob("job-with-queue-name", ns.Name).Queue("queue").Obj()
+ gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
+ createdJob := &batchv1.Job{}
+ gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
+
+ createdJob.Labels[constants.QueueLabel] = "queue2"
+ createdJob.Spec.Suspend = ptr.To(false)
+ gomega.Expect(k8sClient.Update(ctx, createdJob)).ShouldNot(gomega.Succeed())
+ })
+
+ ginkgo.It("should allow unsuspending a partially admissible job with its minimum parallelism", func() {
+ job := testingjob.MakeJob("job-with-queue-name", ns.Name).Queue("queue").
+ Parallelism(6).
+ Completions(6).
+ SetAnnotation(job.JobMinParallelismAnnotation, "4").
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
+ createdJob := &batchv1.Job{}
+ gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
+
+ createdJob.Spec.Parallelism = ptr.To[int32](4)
+ createdJob.Spec.Suspend = ptr.To(false)
+ gomega.Expect(k8sClient.Update(ctx, createdJob)).Should(gomega.Succeed())
+ })
+
+ ginkgo.It("should allow unsuspending a partially admissible job with a parallelism lower then minimum", func() {
+ // This can happen if the job:
+ // 1. Is admitted
+ // 2. Makes progress and increments the reclaimable counts
+ // 3. Is evicted
+ // 4. Is re-admitted (the parallelism being less then min due to reclaim)
+ job := testingjob.MakeJob("job-with-queue-name", ns.Name).Queue("queue").
+ Parallelism(6).
+ Completions(6).
+ SetAnnotation(job.JobMinParallelismAnnotation, "4").
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, job)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: job.Name, Namespace: job.Namespace}
+ createdJob := &batchv1.Job{}
+ gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob)).Should(gomega.Succeed())
+
+ createdJob.Spec.Parallelism = ptr.To[int32](3)
+ createdJob.Spec.Suspend = ptr.To(false)
+ gomega.Expect(k8sClient.Update(ctx, createdJob)).Should(gomega.Succeed())
+ })
+
+ ginkgo.It("should allow restoring parallelism", func() {
+ originalJob := testingjob.MakeJob("job-with-queue-name", ns.Name).Queue("queue").
+ Parallelism(3).
+ Completions(6).
+ SetAnnotation(job.StoppingAnnotation, "true").
+ SetAnnotation(job.JobMinParallelismAnnotation, "2").
+ Obj()
+ gomega.Expect(k8sClient.Create(ctx, originalJob)).Should(gomega.Succeed())
+
+ lookupKey := types.NamespacedName{Name: originalJob.Name, Namespace: originalJob.Namespace}
+ updatedJob := &batchv1.Job{}
+ gomega.Expect(k8sClient.Get(ctx, lookupKey, updatedJob)).Should(gomega.Succeed())
+
+ updatedJob.Spec.Parallelism = ptr.To[int32](6)
+ delete(updatedJob.Annotations, job.StoppingAnnotation)
+ gomega.Expect(k8sClient.Update(ctx, updatedJob)).Should(gomega.Succeed())
+ })
+})
diff --git a/test/integration/controller/jobs/jobset/jobset_webhook_test.go b/test/integration/webhook/jobs/jobset_webhook_test.go
similarity index 82%
rename from test/integration/controller/jobs/jobset/jobset_webhook_test.go
rename to test/integration/webhook/jobs/jobset_webhook_test.go
index 9362423425a..da4b179f475 100644
--- a/test/integration/controller/jobs/jobset/jobset_webhook_test.go
+++ b/test/integration/webhook/jobs/jobset_webhook_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package jobset
+package jobs
import (
"github.com/onsi/ginkgo/v2"
@@ -23,8 +23,8 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/jobset"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/jobset"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -33,13 +33,7 @@ var _ = ginkgo.Describe("JobSet Webhook", func() {
ginkgo.When("with manageJobsWithoutQueueName disabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{jobsetCrdPath},
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup())
+ fwk.StartManager(ctx, cfg, managerSetup(jobset.SetupJobSetWebhook))
})
ginkgo.BeforeEach(func() {
ns = &corev1.Namespace{
@@ -53,11 +47,11 @@ var _ = ginkgo.Describe("JobSet Webhook", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.It("the creation doesn't succeed if the queue name is invalid", func() {
- job := testingjob.MakeJobSet(jobSetName, ns.Name).Queue("indexed_job").Obj()
+ job := testingjob.MakeJobSet("jobset", ns.Name).Queue("indexed_job").Obj()
err := k8sClient.Create(ctx, job)
gomega.Expect(err).Should(gomega.HaveOccurred())
gomega.Expect(apierrors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
diff --git a/test/integration/controller/jobs/mpijob/mpijob_webhook_test.go b/test/integration/webhook/jobs/mpijob_webhook_test.go
similarity index 71%
rename from test/integration/controller/jobs/mpijob/mpijob_webhook_test.go
rename to test/integration/webhook/jobs/mpijob_webhook_test.go
index 292f02fa7d2..40a7b746082 100644
--- a/test/integration/controller/jobs/mpijob/mpijob_webhook_test.go
+++ b/test/integration/webhook/jobs/mpijob_webhook_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package mpijob
+package jobs
import (
"github.com/onsi/ginkgo/v2"
@@ -23,24 +23,21 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/mpijob"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/mpijob"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
-var _ = ginkgo.Describe("MPIJob Webhook", func() {
+var _ = ginkgo.Describe("MPIJob Webhook", ginkgo.Ordered, func() {
var ns *corev1.Namespace
+ ginkgo.BeforeAll(func() {
+ fwk.StartManager(ctx, cfg, managerSetup(mpijob.SetupMPIJobWebhook))
+ })
+ ginkgo.AfterAll(func() {
+ fwk.StopManager(ctx)
+ })
- ginkgo.When("With manageJobsWithoutQueueName disabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
- ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{mpiCrdPath},
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(false))
- })
+ ginkgo.When("With manageJobsWithoutQueueName disabled", func() {
ginkgo.BeforeEach(func() {
ns = &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
@@ -53,12 +50,9 @@ var _ = ginkgo.Describe("MPIJob Webhook", func() {
ginkgo.AfterEach(func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
- ginkgo.AfterAll(func() {
- fwk.Teardown()
- })
ginkgo.It("the creation doesn't succeed if the queue name is invalid", func() {
- job := testingjob.MakeMPIJob(jobName, ns.Name).Queue("indexed_job").Obj()
+ job := testingjob.MakeMPIJob("job", ns.Name).Queue("indexed_job").Obj()
err := k8sClient.Create(ctx, job)
gomega.Expect(err).Should(gomega.HaveOccurred())
gomega.Expect(apierrors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
diff --git a/test/integration/controller/jobs/pod/pod_webhook_test.go b/test/integration/webhook/jobs/pod_webhook_test.go
similarity index 95%
rename from test/integration/controller/jobs/pod/pod_webhook_test.go
rename to test/integration/webhook/jobs/pod_webhook_test.go
index 860a451292a..b7e0c582045 100644
--- a/test/integration/controller/jobs/pod/pod_webhook_test.go
+++ b/test/integration/webhook/jobs/pod_webhook_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package pod
+package jobs
import (
"github.com/onsi/ginkgo/v2"
@@ -27,9 +27,9 @@ import (
configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
"sigs.k8s.io/kueue/pkg/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/pod"
"sigs.k8s.io/kueue/pkg/util/kubeversion"
testingpod "sigs.k8s.io/kueue/pkg/util/testingjobs/pod"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -38,20 +38,14 @@ var _ = ginkgo.Describe("Pod Webhook", func() {
ginkgo.When("with manageJobsWithoutQueueName disabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
-
discoveryClient, err := discovery.NewDiscoveryClientForConfig(cfg)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
serverVersionFetcher = kubeversion.NewServerVersionFetcher(discoveryClient)
err = serverVersionFetcher.FetchServerVersion()
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
- nil,
+ fwk.StartManager(ctx, cfg, managerSetup(
+ pod.SetupWebhook,
jobframework.WithManageJobsWithoutQueueName(false),
jobframework.WithKubeServerVersion(serverVersionFetcher),
jobframework.WithIntegrationOptions(corev1.SchemeGroupVersion.WithKind("Pod").String(), &configapi.PodIntegrationOptions{
@@ -81,7 +75,7 @@ var _ = ginkgo.Describe("Pod Webhook", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.When("The queue-name label is set", func() {
@@ -179,20 +173,14 @@ var _ = ginkgo.Describe("Pod Webhook", func() {
ginkgo.When("with manageJobsWithoutQueueName enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
-
discoveryClient, err := discovery.NewDiscoveryClientForConfig(cfg)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
serverVersionFetcher = kubeversion.NewServerVersionFetcher(discoveryClient)
err = serverVersionFetcher.FetchServerVersion()
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup(
- nil,
+ fwk.StartManager(ctx, cfg, managerSetup(
+ pod.SetupWebhook,
jobframework.WithManageJobsWithoutQueueName(true),
jobframework.WithKubeServerVersion(serverVersionFetcher),
jobframework.WithIntegrationOptions(corev1.SchemeGroupVersion.WithKind("Pod").String(), &configapi.PodIntegrationOptions{
@@ -222,7 +210,7 @@ var _ = ginkgo.Describe("Pod Webhook", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.When("The queue-name label is not set", func() {
diff --git a/test/integration/controller/jobs/raycluster/raycluster_webhook_test.go b/test/integration/webhook/jobs/raycluster_webhook_test.go
similarity index 73%
rename from test/integration/controller/jobs/raycluster/raycluster_webhook_test.go
rename to test/integration/webhook/jobs/raycluster_webhook_test.go
index ecb98b8e5a8..e9f30eaabde 100644
--- a/test/integration/controller/jobs/raycluster/raycluster_webhook_test.go
+++ b/test/integration/webhook/jobs/raycluster_webhook_test.go
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package raycluster
+package jobs
import (
"github.com/onsi/ginkgo/v2"
@@ -26,12 +26,15 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
+ "sigs.k8s.io/kueue/pkg/constants"
+ "sigs.k8s.io/kueue/pkg/controller/core/indexer"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/raycluster"
workloadrayjob "sigs.k8s.io/kueue/pkg/controller/jobs/rayjob"
"sigs.k8s.io/kueue/pkg/util/testing"
testingraycluster "sigs.k8s.io/kueue/pkg/util/testingjobs/raycluster"
testingrayjob "sigs.k8s.io/kueue/pkg/util/testingjobs/rayjob"
- "sigs.k8s.io/kueue/test/integration/framework"
+ "sigs.k8s.io/kueue/pkg/webhooks"
"sigs.k8s.io/kueue/test/util"
)
@@ -40,13 +43,7 @@ var _ = ginkgo.Describe("RayCluster Webhook", func() {
ginkgo.When("With manageJobsWithoutQueueName disabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup())
+ fwk.StartManager(ctx, cfg, managerSetup(raycluster.SetupRayClusterWebhook))
})
ginkgo.BeforeEach(func() {
ns = &corev1.Namespace{
@@ -61,11 +58,11 @@ var _ = ginkgo.Describe("RayCluster Webhook", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.It("the creation doesn't succeed if the queue name is invalid", func() {
- job := testingraycluster.MakeCluster(jobName, ns.Name).Queue("indexed_job").Obj()
+ job := testingraycluster.MakeCluster("raycluster", ns.Name).Queue("indexed_job").Obj()
err := k8sClient.Create(ctx, job)
gomega.Expect(err).Should(gomega.HaveOccurred())
gomega.Expect(apierrors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
@@ -74,13 +71,37 @@ var _ = ginkgo.Describe("RayCluster Webhook", func() {
ginkgo.When("With manageJobsWithoutQueueName enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerWithRayClusterAndRayJobControllersSetup(jobframework.WithManageJobsWithoutQueueName(true)))
+ fwk.StartManager(ctx, cfg, managerSetup(func(mgr ctrl.Manager, opts ...jobframework.Option) error {
+ reconciler := raycluster.NewReconciler(
+ mgr.GetClient(),
+ mgr.GetEventRecorderFor(constants.JobControllerName),
+ opts...)
+ err := indexer.Setup(ctx, mgr.GetFieldIndexer())
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ err = raycluster.SetupIndexes(ctx, mgr.GetFieldIndexer())
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ err = reconciler.SetupWithManager(mgr)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ err = raycluster.SetupRayClusterWebhook(mgr, opts...)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ reconciler = workloadrayjob.NewReconciler(
+ mgr.GetClient(),
+ mgr.GetEventRecorderFor(constants.JobControllerName),
+ opts...)
+ err = workloadrayjob.SetupIndexes(ctx, mgr.GetFieldIndexer())
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ err = reconciler.SetupWithManager(mgr)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ err = workloadrayjob.SetupRayJobWebhook(mgr, opts...)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ jobframework.EnableIntegration(workloadrayjob.FrameworkName)
+
+ failedWebhook, err := webhooks.Setup(mgr)
+ gomega.Expect(err).ToNot(gomega.HaveOccurred(), "webhook", failedWebhook)
+
+ return nil
+ }, jobframework.WithManageJobsWithoutQueueName(true)))
})
ginkgo.BeforeEach(func() {
ns = &corev1.Namespace{
@@ -95,7 +116,7 @@ var _ = ginkgo.Describe("RayCluster Webhook", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.It("Should not suspend a cluster if the parent's workload exist and is admitted", func() {
@@ -139,7 +160,7 @@ var _ = ginkgo.Describe("RayCluster Webhook", func() {
gomega.Expect(k8sClient.Get(ctx, wlLookupKey, createdWorkload)).To(gomega.Succeed())
ginkgo.By("Creating the child cluster")
- childCluster := testingraycluster.MakeCluster(jobName, ns.Name).
+ childCluster := testingraycluster.MakeCluster("raycluster", ns.Name).
Suspend(false).
Obj()
gomega.Expect(ctrl.SetControllerReference(parentJob, childCluster, k8sClient.Scheme())).To(gomega.Succeed())
diff --git a/test/integration/controller/jobs/rayjob/rayjob_webhook_test.go b/test/integration/webhook/jobs/rayjob_webhook_test.go
similarity index 83%
rename from test/integration/controller/jobs/rayjob/rayjob_webhook_test.go
rename to test/integration/webhook/jobs/rayjob_webhook_test.go
index 4eeca38f049..886d4b1baa0 100644
--- a/test/integration/controller/jobs/rayjob/rayjob_webhook_test.go
+++ b/test/integration/webhook/jobs/rayjob_webhook_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package rayjob
+package jobs
import (
"github.com/onsi/ginkgo/v2"
@@ -23,8 +23,8 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/rayjob"
testingjob "sigs.k8s.io/kueue/pkg/util/testingjobs/rayjob"
- "sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)
@@ -33,13 +33,7 @@ var _ = ginkgo.Describe("RayJob Webhook", func() {
ginkgo.When("With manageJobsWithoutQueueName disabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
- fwk = &framework.Framework{
- CRDPath: crdPath,
- DepCRDPaths: []string{rayCrdPath},
- WebhookPath: webhookPath,
- }
- cfg = fwk.Init()
- ctx, k8sClient = fwk.RunManager(cfg, managerSetup())
+ fwk.StartManager(ctx, cfg, managerSetup(rayjob.SetupRayJobWebhook))
})
ginkgo.BeforeEach(func() {
ns = &corev1.Namespace{
@@ -54,18 +48,18 @@ var _ = ginkgo.Describe("RayJob Webhook", func() {
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed())
})
ginkgo.AfterAll(func() {
- fwk.Teardown()
+ fwk.StopManager(ctx)
})
ginkgo.It("the creation doesn't succeed if the queue name is invalid", func() {
- job := testingjob.MakeJob(jobName, ns.Name).Queue("indexed_job").Obj()
+ job := testingjob.MakeJob("rayjob", ns.Name).Queue("indexed_job").Obj()
err := k8sClient.Create(ctx, job)
gomega.Expect(err).Should(gomega.HaveOccurred())
gomega.Expect(apierrors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
})
ginkgo.It("invalid configuration shutdown after job finishes", func() {
- job := testingjob.MakeJob(jobName, ns.Name).
+ job := testingjob.MakeJob("rayjob", ns.Name).
Queue("queue-name").
ShutdownAfterJobFinishes(false).
Obj()
diff --git a/test/integration/webhook/jobs/suite_test.go b/test/integration/webhook/jobs/suite_test.go
new file mode 100644
index 00000000000..efc0a9c3307
--- /dev/null
+++ b/test/integration/webhook/jobs/suite_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2021 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package jobs
+
+import (
+ "context"
+ "path/filepath"
+ "testing"
+
+ "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+ "k8s.io/client-go/rest"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/manager"
+
+ "sigs.k8s.io/kueue/pkg/cache"
+ "sigs.k8s.io/kueue/pkg/controller/jobframework"
+ "sigs.k8s.io/kueue/pkg/controller/jobs/job"
+ "sigs.k8s.io/kueue/pkg/queue"
+ "sigs.k8s.io/kueue/pkg/util/kubeversion"
+ "sigs.k8s.io/kueue/test/integration/framework"
+)
+
+var (
+ cfg *rest.Config
+ k8sClient client.Client
+ serverVersionFetcher *kubeversion.ServerVersionFetcher
+ ctx context.Context
+ fwk *framework.Framework
+ crdPath = filepath.Join("..", "..", "..", "..", "config", "components", "crd", "bases")
+ webhookPath = filepath.Join("..", "..", "..", "..", "config", "components", "webhook")
+ mpiCrdPath = filepath.Join("..", "..", "..", "..", "dep-crds", "mpi-operator")
+ jobsetCrdPath = filepath.Join("..", "..", "..", "..", "dep-crds", "jobset-operator")
+ rayCrdPath = filepath.Join("..", "..", "..", "..", "dep-crds", "ray-operator")
+)
+
+func TestAPIs(t *testing.T) {
+ gomega.RegisterFailHandler(ginkgo.Fail)
+
+ ginkgo.RunSpecs(t,
+ "Jobs Webhook Suite",
+ )
+}
+
+var _ = ginkgo.BeforeSuite(func() {
+ fwk = &framework.Framework{
+ CRDPath: crdPath,
+ DepCRDPaths: []string{jobsetCrdPath, mpiCrdPath, rayCrdPath},
+ WebhookPath: webhookPath,
+ }
+ cfg = fwk.Init()
+ ctx, k8sClient = fwk.SetupClient(cfg)
+})
+
+var _ = ginkgo.AfterSuite(func() {
+ fwk.Teardown()
+})
+
+func managerSetup(setup func(ctrl.Manager, ...jobframework.Option) error, opts ...jobframework.Option) framework.ManagerSetup {
+ return func(ctx context.Context, mgr manager.Manager) {
+ cCache := cache.New(mgr.GetClient())
+ queues := queue.NewManager(mgr.GetClient(), cCache)
+ opts = append(opts, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
+
+ err := setup(mgr, opts...)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ jobframework.EnableIntegration(job.FrameworkName)
+ }
+}
diff --git a/test/performance/scheduler/minimalkueue/main.go b/test/performance/scheduler/minimalkueue/main.go
index 34ef89188af..55837572376 100644
--- a/test/performance/scheduler/minimalkueue/main.go
+++ b/test/performance/scheduler/minimalkueue/main.go
@@ -30,6 +30,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
crconfig "sigs.k8s.io/controller-runtime/pkg/config"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
@@ -112,6 +113,7 @@ func mainWithExitCode() int {
options := ctrl.Options{
Scheme: scheme,
Controller: crconfig.Controller{
+ SkipNameValidation: ptr.To(true),
GroupKindConcurrency: map[string]int{
kueue.GroupVersion.WithKind("Workload").GroupKind().String(): 5,
kueue.GroupVersion.WithKind("LocalQueue").GroupKind().String(): 1,
diff --git a/test/performance/scheduler/runner/controller/controller.go b/test/performance/scheduler/runner/controller/controller.go
index 10b14924402..5fca0bf9a11 100644
--- a/test/performance/scheduler/runner/controller/controller.go
+++ b/test/performance/scheduler/runner/controller/controller.go
@@ -158,12 +158,12 @@ func NewReconciler(c client.Client, r *recorder.Recorder) *reconciler {
func (r *reconciler) SetupWithManager(mgr ctrl.Manager) error {
cqHandler := handler.Funcs{
- CreateFunc: func(_ context.Context, ev event.CreateEvent, _ workqueue.RateLimitingInterface) {
+ CreateFunc: func(_ context.Context, ev event.CreateEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
if cq, isCq := ev.Object.(*kueue.ClusterQueue); isCq {
r.recorder.RecordCQState(cq)
}
},
- UpdateFunc: func(_ context.Context, ev event.UpdateEvent, _ workqueue.RateLimitingInterface) {
+ UpdateFunc: func(_ context.Context, ev event.UpdateEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
if cq, isCq := ev.ObjectNew.(*kueue.ClusterQueue); isCq {
r.recorder.RecordCQState(cq)
}
diff --git a/test/performance/scheduler/runner/main.go b/test/performance/scheduler/runner/main.go
index 7953af56418..bef7ab555d4 100644
--- a/test/performance/scheduler/runner/main.go
+++ b/test/performance/scheduler/runner/main.go
@@ -388,6 +388,7 @@ func runManager(ctx context.Context, cfg *rest.Config, errCh chan<- error, wg *s
options := ctrl.Options{
Scheme: scheme,
Controller: crconfig.Controller{
+ SkipNameValidation: ptr.To(true),
GroupKindConcurrency: map[string]int{
kueue.GroupVersion.WithKind("Workload").GroupKind().String(): 5,
},
diff --git a/test/util/e2e.go b/test/util/e2e.go
index f4dc7a81dca..426bb6f44a2 100644
--- a/test/util/e2e.go
+++ b/test/util/e2e.go
@@ -6,6 +6,7 @@ import (
"os"
"github.com/google/go-cmp/cmp/cmpopts"
+ kfmpi "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
kftraining "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
@@ -19,9 +20,14 @@ import (
kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
- visibility "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibility "sigs.k8s.io/kueue/apis/visibility/v1beta1"
kueueclientset "sigs.k8s.io/kueue/client-go/clientset/versioned"
- visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1alpha1"
+ visibilityv1beta1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/visibility/v1beta1"
+)
+
+const (
+ // E2eTestSleepImage is the image used for testing.
+ E2eTestSleepImage = "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0@sha256:8d91ddf9f145b66475efda1a1b52269be542292891b5de2a7fad944052bab6ea"
)
func CreateClientUsingCluster(kContext string) (client.WithWatch, *rest.Config) {
@@ -47,12 +53,15 @@ func CreateClientUsingCluster(kContext string) (client.WithWatch, *rest.Config)
err = kftraining.AddToScheme(scheme.Scheme)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
+ err = kfmpi.AddToScheme(scheme.Scheme)
+ gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
+
client, err := client.NewWithWatch(cfg, client.Options{Scheme: scheme.Scheme})
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
return client, cfg
}
-func CreateVisibilityClient(user string) visibilityv1alpha1.VisibilityV1alpha1Interface {
+func CreateVisibilityClient(user string) visibilityv1beta1.VisibilityV1beta1Interface {
cfg, err := config.GetConfigWithContext("")
if err != nil {
fmt.Printf("unable to get kubeconfig: %s", err)
@@ -69,7 +78,7 @@ func CreateVisibilityClient(user string) visibilityv1alpha1.VisibilityV1alpha1In
fmt.Printf("unable to create kueue clientset: %s", err)
os.Exit(1)
}
- visibilityClient := kueueClient.VisibilityV1alpha1()
+ visibilityClient := kueueClient.VisibilityV1beta1()
return visibilityClient
}
@@ -108,7 +117,12 @@ func WaitForJobSetAvailability(ctx context.Context, k8sClient client.Client) {
waitForOperatorAvailability(ctx, k8sClient, jcmKey)
}
-func WaitForKubeFlowAvailability(ctx context.Context, k8sClient client.Client) {
+func WaitForKubeFlowTrainingOperatorAvailability(ctx context.Context, k8sClient client.Client) {
kftoKey := types.NamespacedName{Namespace: "kubeflow", Name: "training-operator"}
waitForOperatorAvailability(ctx, k8sClient, kftoKey)
}
+
+func WaitForKubeFlowMPIOperatorAvailability(ctx context.Context, k8sClient client.Client) {
+ kftoKey := types.NamespacedName{Namespace: "mpi-operator", Name: "mpi-operator"}
+ waitForOperatorAvailability(ctx, k8sClient, kftoKey)
+}
diff --git a/test/util/util.go b/test/util/util.go
index dcedcfa0329..cfa81fba50d 100644
--- a/test/util/util.go
+++ b/test/util/util.go
@@ -729,3 +729,10 @@ func NewTestingLogger(writer io.Writer, level int) logr.Logger {
zap.Level(zapcore.Level(level)),
opts)
}
+
+// WaitForNextSecondAfterCreation wait time between the start of the next second
+// after creationTimestamp and the current time to ensure that the new
+// created object has a later creation time.
+func WaitForNextSecondAfterCreation(obj client.Object) {
+ time.Sleep(time.Until(obj.GetCreationTimestamp().Add(time.Second)))
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/LICENSE b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/LICENSE
deleted file mode 100644
index 52cf18e425e..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright 2021 The ANTLR Project
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/antlrdoc.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/antlrdoc.go
deleted file mode 100644
index ab51212676f..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/antlrdoc.go
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-Package antlr implements the Go version of the ANTLR 4 runtime.
-
-# The ANTLR Tool
-
-ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing,
-or translating structured text or binary files. It's widely used to build languages, tools, and frameworks.
-From a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface
-(or visitor) that makes it easy to respond to the recognition of phrases of interest.
-
-# Code Generation
-
-ANTLR supports the generation of code in a number of [target languages], and the generated code is supported by a
-runtime library, written specifically to support the generated code in the target language. This library is the
-runtime for the Go target.
-
-To generate code for the go target, it is generally recommended to place the source grammar files in a package of
-their own, and use the `.sh` script method of generating code, using the go generate directive. In that same directory
-it is usual, though not required, to place the antlr tool that should be used to generate the code. That does mean
-that the antlr tool JAR file will be checked in to your source code control though, so you are free to use any other
-way of specifying the version of the ANTLR tool to use, such as aliasing in `.zshrc` or equivalent, or a profile in
-your IDE, or configuration in your CI system.
-
-Here is a general template for an ANTLR based recognizer in Go:
-
- .
- ├── myproject
- ├── parser
- │ ├── mygrammar.g4
- │ ├── antlr-4.12.0-complete.jar
- │ ├── error_listeners.go
- │ ├── generate.go
- │ ├── generate.sh
- ├── go.mod
- ├── go.sum
- ├── main.go
- └── main_test.go
-
-Make sure that the package statement in your grammar file(s) reflects the go package they exist in.
-The generate.go file then looks like this:
-
- package parser
-
- //go:generate ./generate.sh
-
-And the generate.sh file will look similar to this:
-
- #!/bin/sh
-
- alias antlr4='java -Xmx500M -cp "./antlr4-4.12.0-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
- antlr4 -Dlanguage=Go -no-visitor -package parser *.g4
-
-depending on whether you want visitors or listeners or any other ANTLR options.
-
-From the command line at the root of your package “myproject” you can then simply issue the command:
-
- go generate ./...
-
-# Copyright Notice
-
-Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-
-Use of this file is governed by the BSD 3-clause license, which can be found in the [LICENSE.txt] file in the project root.
-
-[target languages]: https://github.com/antlr/antlr4/tree/master/runtime
-[LICENSE.txt]: https://github.com/antlr/antlr4/blob/master/LICENSE.txt
-*/
-package antlr
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config.go
deleted file mode 100644
index 7619fa172ed..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config.go
+++ /dev/null
@@ -1,303 +0,0 @@
-// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-// Use of this file is governed by the BSD 3-clause license that
-// can be found in the LICENSE.txt file in the project root.
-
-package antlr
-
-import (
- "fmt"
-)
-
-// ATNConfig is a tuple: (ATN state, predicted alt, syntactic, semantic
-// context). The syntactic context is a graph-structured stack node whose
-// path(s) to the root is the rule invocation(s) chain used to arrive at the
-// state. The semantic context is the tree of semantic predicates encountered
-// before reaching an ATN state.
-type ATNConfig interface {
- Equals(o Collectable[ATNConfig]) bool
- Hash() int
-
- GetState() ATNState
- GetAlt() int
- GetSemanticContext() SemanticContext
-
- GetContext() PredictionContext
- SetContext(PredictionContext)
-
- GetReachesIntoOuterContext() int
- SetReachesIntoOuterContext(int)
-
- String() string
-
- getPrecedenceFilterSuppressed() bool
- setPrecedenceFilterSuppressed(bool)
-}
-
-type BaseATNConfig struct {
- precedenceFilterSuppressed bool
- state ATNState
- alt int
- context PredictionContext
- semanticContext SemanticContext
- reachesIntoOuterContext int
-}
-
-func NewBaseATNConfig7(old *BaseATNConfig) ATNConfig { // TODO: Dup
- return &BaseATNConfig{
- state: old.state,
- alt: old.alt,
- context: old.context,
- semanticContext: old.semanticContext,
- reachesIntoOuterContext: old.reachesIntoOuterContext,
- }
-}
-
-func NewBaseATNConfig6(state ATNState, alt int, context PredictionContext) *BaseATNConfig {
- return NewBaseATNConfig5(state, alt, context, SemanticContextNone)
-}
-
-func NewBaseATNConfig5(state ATNState, alt int, context PredictionContext, semanticContext SemanticContext) *BaseATNConfig {
- if semanticContext == nil {
- panic("semanticContext cannot be nil") // TODO: Necessary?
- }
-
- return &BaseATNConfig{state: state, alt: alt, context: context, semanticContext: semanticContext}
-}
-
-func NewBaseATNConfig4(c ATNConfig, state ATNState) *BaseATNConfig {
- return NewBaseATNConfig(c, state, c.GetContext(), c.GetSemanticContext())
-}
-
-func NewBaseATNConfig3(c ATNConfig, state ATNState, semanticContext SemanticContext) *BaseATNConfig {
- return NewBaseATNConfig(c, state, c.GetContext(), semanticContext)
-}
-
-func NewBaseATNConfig2(c ATNConfig, semanticContext SemanticContext) *BaseATNConfig {
- return NewBaseATNConfig(c, c.GetState(), c.GetContext(), semanticContext)
-}
-
-func NewBaseATNConfig1(c ATNConfig, state ATNState, context PredictionContext) *BaseATNConfig {
- return NewBaseATNConfig(c, state, context, c.GetSemanticContext())
-}
-
-func NewBaseATNConfig(c ATNConfig, state ATNState, context PredictionContext, semanticContext SemanticContext) *BaseATNConfig {
- if semanticContext == nil {
- panic("semanticContext cannot be nil")
- }
-
- return &BaseATNConfig{
- state: state,
- alt: c.GetAlt(),
- context: context,
- semanticContext: semanticContext,
- reachesIntoOuterContext: c.GetReachesIntoOuterContext(),
- precedenceFilterSuppressed: c.getPrecedenceFilterSuppressed(),
- }
-}
-
-func (b *BaseATNConfig) getPrecedenceFilterSuppressed() bool {
- return b.precedenceFilterSuppressed
-}
-
-func (b *BaseATNConfig) setPrecedenceFilterSuppressed(v bool) {
- b.precedenceFilterSuppressed = v
-}
-
-func (b *BaseATNConfig) GetState() ATNState {
- return b.state
-}
-
-func (b *BaseATNConfig) GetAlt() int {
- return b.alt
-}
-
-func (b *BaseATNConfig) SetContext(v PredictionContext) {
- b.context = v
-}
-func (b *BaseATNConfig) GetContext() PredictionContext {
- return b.context
-}
-
-func (b *BaseATNConfig) GetSemanticContext() SemanticContext {
- return b.semanticContext
-}
-
-func (b *BaseATNConfig) GetReachesIntoOuterContext() int {
- return b.reachesIntoOuterContext
-}
-
-func (b *BaseATNConfig) SetReachesIntoOuterContext(v int) {
- b.reachesIntoOuterContext = v
-}
-
-// Equals is the default comparison function for an ATNConfig when no specialist implementation is required
-// for a collection.
-//
-// An ATN configuration is equal to another if both have the same state, they
-// predict the same alternative, and syntactic/semantic contexts are the same.
-func (b *BaseATNConfig) Equals(o Collectable[ATNConfig]) bool {
- if b == o {
- return true
- } else if o == nil {
- return false
- }
-
- var other, ok = o.(*BaseATNConfig)
-
- if !ok {
- return false
- }
-
- var equal bool
-
- if b.context == nil {
- equal = other.context == nil
- } else {
- equal = b.context.Equals(other.context)
- }
-
- var (
- nums = b.state.GetStateNumber() == other.state.GetStateNumber()
- alts = b.alt == other.alt
- cons = b.semanticContext.Equals(other.semanticContext)
- sups = b.precedenceFilterSuppressed == other.precedenceFilterSuppressed
- )
-
- return nums && alts && cons && sups && equal
-}
-
-// Hash is the default hash function for BaseATNConfig, when no specialist hash function
-// is required for a collection
-func (b *BaseATNConfig) Hash() int {
- var c int
- if b.context != nil {
- c = b.context.Hash()
- }
-
- h := murmurInit(7)
- h = murmurUpdate(h, b.state.GetStateNumber())
- h = murmurUpdate(h, b.alt)
- h = murmurUpdate(h, c)
- h = murmurUpdate(h, b.semanticContext.Hash())
- return murmurFinish(h, 4)
-}
-
-func (b *BaseATNConfig) String() string {
- var s1, s2, s3 string
-
- if b.context != nil {
- s1 = ",[" + fmt.Sprint(b.context) + "]"
- }
-
- if b.semanticContext != SemanticContextNone {
- s2 = "," + fmt.Sprint(b.semanticContext)
- }
-
- if b.reachesIntoOuterContext > 0 {
- s3 = ",up=" + fmt.Sprint(b.reachesIntoOuterContext)
- }
-
- return fmt.Sprintf("(%v,%v%v%v%v)", b.state, b.alt, s1, s2, s3)
-}
-
-type LexerATNConfig struct {
- *BaseATNConfig
- lexerActionExecutor *LexerActionExecutor
- passedThroughNonGreedyDecision bool
-}
-
-func NewLexerATNConfig6(state ATNState, alt int, context PredictionContext) *LexerATNConfig {
- return &LexerATNConfig{BaseATNConfig: NewBaseATNConfig5(state, alt, context, SemanticContextNone)}
-}
-
-func NewLexerATNConfig5(state ATNState, alt int, context PredictionContext, lexerActionExecutor *LexerActionExecutor) *LexerATNConfig {
- return &LexerATNConfig{
- BaseATNConfig: NewBaseATNConfig5(state, alt, context, SemanticContextNone),
- lexerActionExecutor: lexerActionExecutor,
- }
-}
-
-func NewLexerATNConfig4(c *LexerATNConfig, state ATNState) *LexerATNConfig {
- return &LexerATNConfig{
- BaseATNConfig: NewBaseATNConfig(c, state, c.GetContext(), c.GetSemanticContext()),
- lexerActionExecutor: c.lexerActionExecutor,
- passedThroughNonGreedyDecision: checkNonGreedyDecision(c, state),
- }
-}
-
-func NewLexerATNConfig3(c *LexerATNConfig, state ATNState, lexerActionExecutor *LexerActionExecutor) *LexerATNConfig {
- return &LexerATNConfig{
- BaseATNConfig: NewBaseATNConfig(c, state, c.GetContext(), c.GetSemanticContext()),
- lexerActionExecutor: lexerActionExecutor,
- passedThroughNonGreedyDecision: checkNonGreedyDecision(c, state),
- }
-}
-
-func NewLexerATNConfig2(c *LexerATNConfig, state ATNState, context PredictionContext) *LexerATNConfig {
- return &LexerATNConfig{
- BaseATNConfig: NewBaseATNConfig(c, state, context, c.GetSemanticContext()),
- lexerActionExecutor: c.lexerActionExecutor,
- passedThroughNonGreedyDecision: checkNonGreedyDecision(c, state),
- }
-}
-
-func NewLexerATNConfig1(state ATNState, alt int, context PredictionContext) *LexerATNConfig {
- return &LexerATNConfig{BaseATNConfig: NewBaseATNConfig5(state, alt, context, SemanticContextNone)}
-}
-
-// Hash is the default hash function for LexerATNConfig objects, it can be used directly or via
-// the default comparator [ObjEqComparator].
-func (l *LexerATNConfig) Hash() int {
- var f int
- if l.passedThroughNonGreedyDecision {
- f = 1
- } else {
- f = 0
- }
- h := murmurInit(7)
- h = murmurUpdate(h, l.state.GetStateNumber())
- h = murmurUpdate(h, l.alt)
- h = murmurUpdate(h, l.context.Hash())
- h = murmurUpdate(h, l.semanticContext.Hash())
- h = murmurUpdate(h, f)
- h = murmurUpdate(h, l.lexerActionExecutor.Hash())
- h = murmurFinish(h, 6)
- return h
-}
-
-// Equals is the default comparison function for LexerATNConfig objects, it can be used directly or via
-// the default comparator [ObjEqComparator].
-func (l *LexerATNConfig) Equals(other Collectable[ATNConfig]) bool {
- if l == other {
- return true
- }
- var othert, ok = other.(*LexerATNConfig)
-
- if l == other {
- return true
- } else if !ok {
- return false
- } else if l.passedThroughNonGreedyDecision != othert.passedThroughNonGreedyDecision {
- return false
- }
-
- var b bool
-
- if l.lexerActionExecutor != nil {
- b = !l.lexerActionExecutor.Equals(othert.lexerActionExecutor)
- } else {
- b = othert.lexerActionExecutor != nil
- }
-
- if b {
- return false
- }
-
- return l.BaseATNConfig.Equals(othert.BaseATNConfig)
-}
-
-func checkNonGreedyDecision(source *LexerATNConfig, target ATNState) bool {
- var ds, ok = target.(DecisionState)
-
- return source.passedThroughNonGreedyDecision || (ok && ds.getNonGreedy())
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config_set.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config_set.go
deleted file mode 100644
index 43e9b33f3bd..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config_set.go
+++ /dev/null
@@ -1,441 +0,0 @@
-// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-// Use of this file is governed by the BSD 3-clause license that
-// can be found in the LICENSE.txt file in the project root.
-
-package antlr
-
-import (
- "fmt"
-)
-
-type ATNConfigSet interface {
- Hash() int
- Equals(o Collectable[ATNConfig]) bool
- Add(ATNConfig, *DoubleDict) bool
- AddAll([]ATNConfig) bool
-
- GetStates() *JStore[ATNState, Comparator[ATNState]]
- GetPredicates() []SemanticContext
- GetItems() []ATNConfig
-
- OptimizeConfigs(interpreter *BaseATNSimulator)
-
- Length() int
- IsEmpty() bool
- Contains(ATNConfig) bool
- ContainsFast(ATNConfig) bool
- Clear()
- String() string
-
- HasSemanticContext() bool
- SetHasSemanticContext(v bool)
-
- ReadOnly() bool
- SetReadOnly(bool)
-
- GetConflictingAlts() *BitSet
- SetConflictingAlts(*BitSet)
-
- Alts() *BitSet
-
- FullContext() bool
-
- GetUniqueAlt() int
- SetUniqueAlt(int)
-
- GetDipsIntoOuterContext() bool
- SetDipsIntoOuterContext(bool)
-}
-
-// BaseATNConfigSet is a specialized set of ATNConfig that tracks information
-// about its elements and can combine similar configurations using a
-// graph-structured stack.
-type BaseATNConfigSet struct {
- cachedHash int
-
- // configLookup is used to determine whether two BaseATNConfigSets are equal. We
- // need all configurations with the same (s, i, _, semctx) to be equal. A key
- // effectively doubles the number of objects associated with ATNConfigs. All
- // keys are hashed by (s, i, _, pi), not including the context. Wiped out when
- // read-only because a set becomes a DFA state.
- configLookup *JStore[ATNConfig, Comparator[ATNConfig]]
-
- // configs is the added elements.
- configs []ATNConfig
-
- // TODO: These fields make me pretty uncomfortable, but it is nice to pack up
- // info together because it saves recomputation. Can we track conflicts as they
- // are added to save scanning configs later?
- conflictingAlts *BitSet
-
- // dipsIntoOuterContext is used by parsers and lexers. In a lexer, it indicates
- // we hit a pred while computing a closure operation. Do not make a DFA state
- // from the BaseATNConfigSet in this case. TODO: How is this used by parsers?
- dipsIntoOuterContext bool
-
- // fullCtx is whether it is part of a full context LL prediction. Used to
- // determine how to merge $. It is a wildcard with SLL, but not for an LL
- // context merge.
- fullCtx bool
-
- // Used in parser and lexer. In lexer, it indicates we hit a pred
- // while computing a closure operation. Don't make a DFA state from a.
- hasSemanticContext bool
-
- // readOnly is whether it is read-only. Do not
- // allow any code to manipulate the set if true because DFA states will point at
- // sets and those must not change. It not, protect other fields; conflictingAlts
- // in particular, which is assigned after readOnly.
- readOnly bool
-
- // TODO: These fields make me pretty uncomfortable, but it is nice to pack up
- // info together because it saves recomputation. Can we track conflicts as they
- // are added to save scanning configs later?
- uniqueAlt int
-}
-
-func (b *BaseATNConfigSet) Alts() *BitSet {
- alts := NewBitSet()
- for _, it := range b.configs {
- alts.add(it.GetAlt())
- }
- return alts
-}
-
-func NewBaseATNConfigSet(fullCtx bool) *BaseATNConfigSet {
- return &BaseATNConfigSet{
- cachedHash: -1,
- configLookup: NewJStore[ATNConfig, Comparator[ATNConfig]](aConfCompInst),
- fullCtx: fullCtx,
- }
-}
-
-// Add merges contexts with existing configs for (s, i, pi, _), where s is the
-// ATNConfig.state, i is the ATNConfig.alt, and pi is the
-// ATNConfig.semanticContext. We use (s,i,pi) as the key. Updates
-// dipsIntoOuterContext and hasSemanticContext when necessary.
-func (b *BaseATNConfigSet) Add(config ATNConfig, mergeCache *DoubleDict) bool {
- if b.readOnly {
- panic("set is read-only")
- }
-
- if config.GetSemanticContext() != SemanticContextNone {
- b.hasSemanticContext = true
- }
-
- if config.GetReachesIntoOuterContext() > 0 {
- b.dipsIntoOuterContext = true
- }
-
- existing, present := b.configLookup.Put(config)
-
- // The config was not already in the set
- //
- if !present {
- b.cachedHash = -1
- b.configs = append(b.configs, config) // Track order here
- return true
- }
-
- // Merge a previous (s, i, pi, _) with it and save the result
- rootIsWildcard := !b.fullCtx
- merged := merge(existing.GetContext(), config.GetContext(), rootIsWildcard, mergeCache)
-
- // No need to check for existing.context because config.context is in the cache,
- // since the only way to create new graphs is the "call rule" and here. We cache
- // at both places.
- existing.SetReachesIntoOuterContext(intMax(existing.GetReachesIntoOuterContext(), config.GetReachesIntoOuterContext()))
-
- // Preserve the precedence filter suppression during the merge
- if config.getPrecedenceFilterSuppressed() {
- existing.setPrecedenceFilterSuppressed(true)
- }
-
- // Replace the context because there is no need to do alt mapping
- existing.SetContext(merged)
-
- return true
-}
-
-func (b *BaseATNConfigSet) GetStates() *JStore[ATNState, Comparator[ATNState]] {
-
- // states uses the standard comparator provided by the ATNState instance
- //
- states := NewJStore[ATNState, Comparator[ATNState]](aStateEqInst)
-
- for i := 0; i < len(b.configs); i++ {
- states.Put(b.configs[i].GetState())
- }
-
- return states
-}
-
-func (b *BaseATNConfigSet) HasSemanticContext() bool {
- return b.hasSemanticContext
-}
-
-func (b *BaseATNConfigSet) SetHasSemanticContext(v bool) {
- b.hasSemanticContext = v
-}
-
-func (b *BaseATNConfigSet) GetPredicates() []SemanticContext {
- preds := make([]SemanticContext, 0)
-
- for i := 0; i < len(b.configs); i++ {
- c := b.configs[i].GetSemanticContext()
-
- if c != SemanticContextNone {
- preds = append(preds, c)
- }
- }
-
- return preds
-}
-
-func (b *BaseATNConfigSet) GetItems() []ATNConfig {
- return b.configs
-}
-
-func (b *BaseATNConfigSet) OptimizeConfigs(interpreter *BaseATNSimulator) {
- if b.readOnly {
- panic("set is read-only")
- }
-
- if b.configLookup.Len() == 0 {
- return
- }
-
- for i := 0; i < len(b.configs); i++ {
- config := b.configs[i]
-
- config.SetContext(interpreter.getCachedContext(config.GetContext()))
- }
-}
-
-func (b *BaseATNConfigSet) AddAll(coll []ATNConfig) bool {
- for i := 0; i < len(coll); i++ {
- b.Add(coll[i], nil)
- }
-
- return false
-}
-
-// Compare is a hack function just to verify that adding DFAstares to the known
-// set works, so long as comparison of ATNConfigSet s works. For that to work, we
-// need to make sure that the set of ATNConfigs in two sets are equivalent. We can't
-// know the order, so we do this inefficient hack. If this proves the point, then
-// we can change the config set to a better structure.
-func (b *BaseATNConfigSet) Compare(bs *BaseATNConfigSet) bool {
- if len(b.configs) != len(bs.configs) {
- return false
- }
-
- for _, c := range b.configs {
- found := false
- for _, c2 := range bs.configs {
- if c.Equals(c2) {
- found = true
- break
- }
- }
-
- if !found {
- return false
- }
-
- }
- return true
-}
-
-func (b *BaseATNConfigSet) Equals(other Collectable[ATNConfig]) bool {
- if b == other {
- return true
- } else if _, ok := other.(*BaseATNConfigSet); !ok {
- return false
- }
-
- other2 := other.(*BaseATNConfigSet)
-
- return b.configs != nil &&
- b.fullCtx == other2.fullCtx &&
- b.uniqueAlt == other2.uniqueAlt &&
- b.conflictingAlts == other2.conflictingAlts &&
- b.hasSemanticContext == other2.hasSemanticContext &&
- b.dipsIntoOuterContext == other2.dipsIntoOuterContext &&
- b.Compare(other2)
-}
-
-func (b *BaseATNConfigSet) Hash() int {
- if b.readOnly {
- if b.cachedHash == -1 {
- b.cachedHash = b.hashCodeConfigs()
- }
-
- return b.cachedHash
- }
-
- return b.hashCodeConfigs()
-}
-
-func (b *BaseATNConfigSet) hashCodeConfigs() int {
- h := 1
- for _, config := range b.configs {
- h = 31*h + config.Hash()
- }
- return h
-}
-
-func (b *BaseATNConfigSet) Length() int {
- return len(b.configs)
-}
-
-func (b *BaseATNConfigSet) IsEmpty() bool {
- return len(b.configs) == 0
-}
-
-func (b *BaseATNConfigSet) Contains(item ATNConfig) bool {
- if b.configLookup == nil {
- panic("not implemented for read-only sets")
- }
-
- return b.configLookup.Contains(item)
-}
-
-func (b *BaseATNConfigSet) ContainsFast(item ATNConfig) bool {
- if b.configLookup == nil {
- panic("not implemented for read-only sets")
- }
-
- return b.configLookup.Contains(item) // TODO: containsFast is not implemented for Set
-}
-
-func (b *BaseATNConfigSet) Clear() {
- if b.readOnly {
- panic("set is read-only")
- }
-
- b.configs = make([]ATNConfig, 0)
- b.cachedHash = -1
- b.configLookup = NewJStore[ATNConfig, Comparator[ATNConfig]](atnConfCompInst)
-}
-
-func (b *BaseATNConfigSet) FullContext() bool {
- return b.fullCtx
-}
-
-func (b *BaseATNConfigSet) GetDipsIntoOuterContext() bool {
- return b.dipsIntoOuterContext
-}
-
-func (b *BaseATNConfigSet) SetDipsIntoOuterContext(v bool) {
- b.dipsIntoOuterContext = v
-}
-
-func (b *BaseATNConfigSet) GetUniqueAlt() int {
- return b.uniqueAlt
-}
-
-func (b *BaseATNConfigSet) SetUniqueAlt(v int) {
- b.uniqueAlt = v
-}
-
-func (b *BaseATNConfigSet) GetConflictingAlts() *BitSet {
- return b.conflictingAlts
-}
-
-func (b *BaseATNConfigSet) SetConflictingAlts(v *BitSet) {
- b.conflictingAlts = v
-}
-
-func (b *BaseATNConfigSet) ReadOnly() bool {
- return b.readOnly
-}
-
-func (b *BaseATNConfigSet) SetReadOnly(readOnly bool) {
- b.readOnly = readOnly
-
- if readOnly {
- b.configLookup = nil // Read only, so no need for the lookup cache
- }
-}
-
-func (b *BaseATNConfigSet) String() string {
- s := "["
-
- for i, c := range b.configs {
- s += c.String()
-
- if i != len(b.configs)-1 {
- s += ", "
- }
- }
-
- s += "]"
-
- if b.hasSemanticContext {
- s += ",hasSemanticContext=" + fmt.Sprint(b.hasSemanticContext)
- }
-
- if b.uniqueAlt != ATNInvalidAltNumber {
- s += ",uniqueAlt=" + fmt.Sprint(b.uniqueAlt)
- }
-
- if b.conflictingAlts != nil {
- s += ",conflictingAlts=" + b.conflictingAlts.String()
- }
-
- if b.dipsIntoOuterContext {
- s += ",dipsIntoOuterContext"
- }
-
- return s
-}
-
-type OrderedATNConfigSet struct {
- *BaseATNConfigSet
-}
-
-func NewOrderedATNConfigSet() *OrderedATNConfigSet {
- b := NewBaseATNConfigSet(false)
-
- // This set uses the standard Hash() and Equals() from ATNConfig
- b.configLookup = NewJStore[ATNConfig, Comparator[ATNConfig]](aConfEqInst)
-
- return &OrderedATNConfigSet{BaseATNConfigSet: b}
-}
-
-func hashATNConfig(i interface{}) int {
- o := i.(ATNConfig)
- hash := 7
- hash = 31*hash + o.GetState().GetStateNumber()
- hash = 31*hash + o.GetAlt()
- hash = 31*hash + o.GetSemanticContext().Hash()
- return hash
-}
-
-func equalATNConfigs(a, b interface{}) bool {
- if a == nil || b == nil {
- return false
- }
-
- if a == b {
- return true
- }
-
- var ai, ok = a.(ATNConfig)
- var bi, ok1 = b.(ATNConfig)
-
- if !ok || !ok1 {
- return false
- }
-
- if ai.GetState().GetStateNumber() != bi.GetState().GetStateNumber() {
- return false
- }
-
- if ai.GetAlt() != bi.GetAlt() {
- return false
- }
-
- return ai.GetSemanticContext().Equals(bi.GetSemanticContext())
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/input_stream.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/input_stream.go
deleted file mode 100644
index a8b889cedb9..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/input_stream.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-// Use of this file is governed by the BSD 3-clause license that
-// can be found in the LICENSE.txt file in the project root.
-
-package antlr
-
-type InputStream struct {
- name string
- index int
- data []rune
- size int
-}
-
-func NewInputStream(data string) *InputStream {
-
- is := new(InputStream)
-
- is.name = ""
- is.index = 0
- is.data = []rune(data)
- is.size = len(is.data) // number of runes
-
- return is
-}
-
-func (is *InputStream) reset() {
- is.index = 0
-}
-
-func (is *InputStream) Consume() {
- if is.index >= is.size {
- // assert is.LA(1) == TokenEOF
- panic("cannot consume EOF")
- }
- is.index++
-}
-
-func (is *InputStream) LA(offset int) int {
-
- if offset == 0 {
- return 0 // nil
- }
- if offset < 0 {
- offset++ // e.g., translate LA(-1) to use offset=0
- }
- pos := is.index + offset - 1
-
- if pos < 0 || pos >= is.size { // invalid
- return TokenEOF
- }
-
- return int(is.data[pos])
-}
-
-func (is *InputStream) LT(offset int) int {
- return is.LA(offset)
-}
-
-func (is *InputStream) Index() int {
- return is.index
-}
-
-func (is *InputStream) Size() int {
- return is.size
-}
-
-// mark/release do nothing we have entire buffer
-func (is *InputStream) Mark() int {
- return -1
-}
-
-func (is *InputStream) Release(marker int) {
-}
-
-func (is *InputStream) Seek(index int) {
- if index <= is.index {
- is.index = index // just jump don't update stream state (line,...)
- return
- }
- // seek forward
- is.index = intMin(index, is.size)
-}
-
-func (is *InputStream) GetText(start int, stop int) string {
- if stop >= is.size {
- stop = is.size - 1
- }
- if start >= is.size {
- return ""
- }
-
- return string(is.data[start : stop+1])
-}
-
-func (is *InputStream) GetTextFromTokens(start, stop Token) string {
- if start != nil && stop != nil {
- return is.GetTextFromInterval(NewInterval(start.GetTokenIndex(), stop.GetTokenIndex()))
- }
-
- return ""
-}
-
-func (is *InputStream) GetTextFromInterval(i *Interval) string {
- return is.GetText(i.Start, i.Stop)
-}
-
-func (*InputStream) GetSourceName() string {
- return "Obtained from string"
-}
-
-func (is *InputStream) String() string {
- return string(is.data)
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/jcollect.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/jcollect.go
deleted file mode 100644
index e5a74f0c6c4..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/jcollect.go
+++ /dev/null
@@ -1,198 +0,0 @@
-package antlr
-
-// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-// Use of this file is governed by the BSD 3-clause license that
-// can be found in the LICENSE.txt file in the project root.
-
-import (
- "sort"
-)
-
-// Collectable is an interface that a struct should implement if it is to be
-// usable as a key in these collections.
-type Collectable[T any] interface {
- Hash() int
- Equals(other Collectable[T]) bool
-}
-
-type Comparator[T any] interface {
- Hash1(o T) int
- Equals2(T, T) bool
-}
-
-// JStore implements a container that allows the use of a struct to calculate the key
-// for a collection of values akin to map. This is not meant to be a full-blown HashMap but just
-// serve the needs of the ANTLR Go runtime.
-//
-// For ease of porting the logic of the runtime from the master target (Java), this collection
-// operates in a similar way to Java, in that it can use any struct that supplies a Hash() and Equals()
-// function as the key. The values are stored in a standard go map which internally is a form of hashmap
-// itself, the key for the go map is the hash supplied by the key object. The collection is able to deal with
-// hash conflicts by using a simple slice of values associated with the hash code indexed bucket. That isn't
-// particularly efficient, but it is simple, and it works. As this is specifically for the ANTLR runtime, and
-// we understand the requirements, then this is fine - this is not a general purpose collection.
-type JStore[T any, C Comparator[T]] struct {
- store map[int][]T
- len int
- comparator Comparator[T]
-}
-
-func NewJStore[T any, C Comparator[T]](comparator Comparator[T]) *JStore[T, C] {
-
- if comparator == nil {
- panic("comparator cannot be nil")
- }
-
- s := &JStore[T, C]{
- store: make(map[int][]T, 1),
- comparator: comparator,
- }
- return s
-}
-
-// Put will store given value in the collection. Note that the key for storage is generated from
-// the value itself - this is specifically because that is what ANTLR needs - this would not be useful
-// as any kind of general collection.
-//
-// If the key has a hash conflict, then the value will be added to the slice of values associated with the
-// hash, unless the value is already in the slice, in which case the existing value is returned. Value equivalence is
-// tested by calling the equals() method on the key.
-//
-// # If the given value is already present in the store, then the existing value is returned as v and exists is set to true
-//
-// If the given value is not present in the store, then the value is added to the store and returned as v and exists is set to false.
-func (s *JStore[T, C]) Put(value T) (v T, exists bool) { //nolint:ireturn
-
- kh := s.comparator.Hash1(value)
-
- for _, v1 := range s.store[kh] {
- if s.comparator.Equals2(value, v1) {
- return v1, true
- }
- }
- s.store[kh] = append(s.store[kh], value)
- s.len++
- return value, false
-}
-
-// Get will return the value associated with the key - the type of the key is the same type as the value
-// which would not generally be useful, but this is a specific thing for ANTLR where the key is
-// generated using the object we are going to store.
-func (s *JStore[T, C]) Get(key T) (T, bool) { //nolint:ireturn
-
- kh := s.comparator.Hash1(key)
-
- for _, v := range s.store[kh] {
- if s.comparator.Equals2(key, v) {
- return v, true
- }
- }
- return key, false
-}
-
-// Contains returns true if the given key is present in the store
-func (s *JStore[T, C]) Contains(key T) bool { //nolint:ireturn
-
- _, present := s.Get(key)
- return present
-}
-
-func (s *JStore[T, C]) SortedSlice(less func(i, j T) bool) []T {
- vs := make([]T, 0, len(s.store))
- for _, v := range s.store {
- vs = append(vs, v...)
- }
- sort.Slice(vs, func(i, j int) bool {
- return less(vs[i], vs[j])
- })
-
- return vs
-}
-
-func (s *JStore[T, C]) Each(f func(T) bool) {
- for _, e := range s.store {
- for _, v := range e {
- f(v)
- }
- }
-}
-
-func (s *JStore[T, C]) Len() int {
- return s.len
-}
-
-func (s *JStore[T, C]) Values() []T {
- vs := make([]T, 0, len(s.store))
- for _, e := range s.store {
- for _, v := range e {
- vs = append(vs, v)
- }
- }
- return vs
-}
-
-type entry[K, V any] struct {
- key K
- val V
-}
-
-type JMap[K, V any, C Comparator[K]] struct {
- store map[int][]*entry[K, V]
- len int
- comparator Comparator[K]
-}
-
-func NewJMap[K, V any, C Comparator[K]](comparator Comparator[K]) *JMap[K, V, C] {
- return &JMap[K, V, C]{
- store: make(map[int][]*entry[K, V], 1),
- comparator: comparator,
- }
-}
-
-func (m *JMap[K, V, C]) Put(key K, val V) {
- kh := m.comparator.Hash1(key)
-
- m.store[kh] = append(m.store[kh], &entry[K, V]{key, val})
- m.len++
-}
-
-func (m *JMap[K, V, C]) Values() []V {
- vs := make([]V, 0, len(m.store))
- for _, e := range m.store {
- for _, v := range e {
- vs = append(vs, v.val)
- }
- }
- return vs
-}
-
-func (m *JMap[K, V, C]) Get(key K) (V, bool) {
-
- var none V
- kh := m.comparator.Hash1(key)
- for _, e := range m.store[kh] {
- if m.comparator.Equals2(e.key, key) {
- return e.val, true
- }
- }
- return none, false
-}
-
-func (m *JMap[K, V, C]) Len() int {
- return len(m.store)
-}
-
-func (m *JMap[K, V, C]) Delete(key K) {
- kh := m.comparator.Hash1(key)
- for i, e := range m.store[kh] {
- if m.comparator.Equals2(e.key, key) {
- m.store[kh] = append(m.store[kh][:i], m.store[kh][i+1:]...)
- m.len--
- return
- }
- }
-}
-
-func (m *JMap[K, V, C]) Clear() {
- m.store = make(map[int][]*entry[K, V])
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_context.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_context.go
deleted file mode 100644
index ba62af36108..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_context.go
+++ /dev/null
@@ -1,806 +0,0 @@
-// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-// Use of this file is governed by the BSD 3-clause license that
-// can be found in the LICENSE.txt file in the project root.
-
-package antlr
-
-import (
- "fmt"
- "golang.org/x/exp/slices"
- "strconv"
-)
-
-// Represents {@code $} in local context prediction, which means wildcard.
-// {@code//+x =//}.
-// /
-const (
- BasePredictionContextEmptyReturnState = 0x7FFFFFFF
-)
-
-// Represents {@code $} in an array in full context mode, when {@code $}
-// doesn't mean wildcard: {@code $ + x = [$,x]}. Here,
-// {@code $} = {@link //EmptyReturnState}.
-// /
-
-var (
- BasePredictionContextglobalNodeCount = 1
- BasePredictionContextid = BasePredictionContextglobalNodeCount
-)
-
-type PredictionContext interface {
- Hash() int
- Equals(interface{}) bool
- GetParent(int) PredictionContext
- getReturnState(int) int
- length() int
- isEmpty() bool
- hasEmptyPath() bool
- String() string
-}
-
-type BasePredictionContext struct {
- cachedHash int
-}
-
-func NewBasePredictionContext(cachedHash int) *BasePredictionContext {
- pc := new(BasePredictionContext)
- pc.cachedHash = cachedHash
-
- return pc
-}
-
-func (b *BasePredictionContext) isEmpty() bool {
- return false
-}
-
-func calculateHash(parent PredictionContext, returnState int) int {
- h := murmurInit(1)
- h = murmurUpdate(h, parent.Hash())
- h = murmurUpdate(h, returnState)
- return murmurFinish(h, 2)
-}
-
-var _emptyPredictionContextHash int
-
-func init() {
- _emptyPredictionContextHash = murmurInit(1)
- _emptyPredictionContextHash = murmurFinish(_emptyPredictionContextHash, 0)
-}
-
-func calculateEmptyHash() int {
- return _emptyPredictionContextHash
-}
-
-// Used to cache {@link BasePredictionContext} objects. Its used for the shared
-// context cash associated with contexts in DFA states. This cache
-// can be used for both lexers and parsers.
-
-type PredictionContextCache struct {
- cache map[PredictionContext]PredictionContext
-}
-
-func NewPredictionContextCache() *PredictionContextCache {
- t := new(PredictionContextCache)
- t.cache = make(map[PredictionContext]PredictionContext)
- return t
-}
-
-// Add a context to the cache and return it. If the context already exists,
-// return that one instead and do not add a Newcontext to the cache.
-// Protect shared cache from unsafe thread access.
-func (p *PredictionContextCache) add(ctx PredictionContext) PredictionContext {
- if ctx == BasePredictionContextEMPTY {
- return BasePredictionContextEMPTY
- }
- existing := p.cache[ctx]
- if existing != nil {
- return existing
- }
- p.cache[ctx] = ctx
- return ctx
-}
-
-func (p *PredictionContextCache) Get(ctx PredictionContext) PredictionContext {
- return p.cache[ctx]
-}
-
-func (p *PredictionContextCache) length() int {
- return len(p.cache)
-}
-
-type SingletonPredictionContext interface {
- PredictionContext
-}
-
-type BaseSingletonPredictionContext struct {
- *BasePredictionContext
-
- parentCtx PredictionContext
- returnState int
-}
-
-func NewBaseSingletonPredictionContext(parent PredictionContext, returnState int) *BaseSingletonPredictionContext {
- var cachedHash int
- if parent != nil {
- cachedHash = calculateHash(parent, returnState)
- } else {
- cachedHash = calculateEmptyHash()
- }
-
- s := new(BaseSingletonPredictionContext)
- s.BasePredictionContext = NewBasePredictionContext(cachedHash)
-
- s.parentCtx = parent
- s.returnState = returnState
-
- return s
-}
-
-func SingletonBasePredictionContextCreate(parent PredictionContext, returnState int) PredictionContext {
- if returnState == BasePredictionContextEmptyReturnState && parent == nil {
- // someone can pass in the bits of an array ctx that mean $
- return BasePredictionContextEMPTY
- }
-
- return NewBaseSingletonPredictionContext(parent, returnState)
-}
-
-func (b *BaseSingletonPredictionContext) length() int {
- return 1
-}
-
-func (b *BaseSingletonPredictionContext) GetParent(index int) PredictionContext {
- return b.parentCtx
-}
-
-func (b *BaseSingletonPredictionContext) getReturnState(index int) int {
- return b.returnState
-}
-
-func (b *BaseSingletonPredictionContext) hasEmptyPath() bool {
- return b.returnState == BasePredictionContextEmptyReturnState
-}
-
-func (b *BaseSingletonPredictionContext) Hash() int {
- return b.cachedHash
-}
-
-func (b *BaseSingletonPredictionContext) Equals(other interface{}) bool {
- if b == other {
- return true
- }
- if _, ok := other.(*BaseSingletonPredictionContext); !ok {
- return false
- }
-
- otherP := other.(*BaseSingletonPredictionContext)
-
- if b.returnState != otherP.getReturnState(0) {
- return false
- }
- if b.parentCtx == nil {
- return otherP.parentCtx == nil
- }
-
- return b.parentCtx.Equals(otherP.parentCtx)
-}
-
-func (b *BaseSingletonPredictionContext) String() string {
- var up string
-
- if b.parentCtx == nil {
- up = ""
- } else {
- up = b.parentCtx.String()
- }
-
- if len(up) == 0 {
- if b.returnState == BasePredictionContextEmptyReturnState {
- return "$"
- }
-
- return strconv.Itoa(b.returnState)
- }
-
- return strconv.Itoa(b.returnState) + " " + up
-}
-
-var BasePredictionContextEMPTY = NewEmptyPredictionContext()
-
-type EmptyPredictionContext struct {
- *BaseSingletonPredictionContext
-}
-
-func NewEmptyPredictionContext() *EmptyPredictionContext {
-
- p := new(EmptyPredictionContext)
-
- p.BaseSingletonPredictionContext = NewBaseSingletonPredictionContext(nil, BasePredictionContextEmptyReturnState)
- p.cachedHash = calculateEmptyHash()
- return p
-}
-
-func (e *EmptyPredictionContext) isEmpty() bool {
- return true
-}
-
-func (e *EmptyPredictionContext) GetParent(index int) PredictionContext {
- return nil
-}
-
-func (e *EmptyPredictionContext) getReturnState(index int) int {
- return e.returnState
-}
-
-func (e *EmptyPredictionContext) Hash() int {
- return e.cachedHash
-}
-
-func (e *EmptyPredictionContext) Equals(other interface{}) bool {
- return e == other
-}
-
-func (e *EmptyPredictionContext) String() string {
- return "$"
-}
-
-type ArrayPredictionContext struct {
- *BasePredictionContext
-
- parents []PredictionContext
- returnStates []int
-}
-
-func NewArrayPredictionContext(parents []PredictionContext, returnStates []int) *ArrayPredictionContext {
- // Parent can be nil only if full ctx mode and we make an array
- // from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using
- // nil parent and
- // returnState == {@link //EmptyReturnState}.
- hash := murmurInit(1)
-
- for _, parent := range parents {
- hash = murmurUpdate(hash, parent.Hash())
- }
-
- for _, returnState := range returnStates {
- hash = murmurUpdate(hash, returnState)
- }
-
- hash = murmurFinish(hash, len(parents)<<1)
-
- c := new(ArrayPredictionContext)
- c.BasePredictionContext = NewBasePredictionContext(hash)
-
- c.parents = parents
- c.returnStates = returnStates
-
- return c
-}
-
-func (a *ArrayPredictionContext) GetReturnStates() []int {
- return a.returnStates
-}
-
-func (a *ArrayPredictionContext) hasEmptyPath() bool {
- return a.getReturnState(a.length()-1) == BasePredictionContextEmptyReturnState
-}
-
-func (a *ArrayPredictionContext) isEmpty() bool {
- // since EmptyReturnState can only appear in the last position, we
- // don't need to verify that size==1
- return a.returnStates[0] == BasePredictionContextEmptyReturnState
-}
-
-func (a *ArrayPredictionContext) length() int {
- return len(a.returnStates)
-}
-
-func (a *ArrayPredictionContext) GetParent(index int) PredictionContext {
- return a.parents[index]
-}
-
-func (a *ArrayPredictionContext) getReturnState(index int) int {
- return a.returnStates[index]
-}
-
-// Equals is the default comparison function for ArrayPredictionContext when no specialized
-// implementation is needed for a collection
-func (a *ArrayPredictionContext) Equals(o interface{}) bool {
- if a == o {
- return true
- }
- other, ok := o.(*ArrayPredictionContext)
- if !ok {
- return false
- }
- if a.cachedHash != other.Hash() {
- return false // can't be same if hash is different
- }
-
- // Must compare the actual array elements and not just the array address
- //
- return slices.Equal(a.returnStates, other.returnStates) &&
- slices.EqualFunc(a.parents, other.parents, func(x, y PredictionContext) bool {
- return x.Equals(y)
- })
-}
-
-// Hash is the default hash function for ArrayPredictionContext when no specialized
-// implementation is needed for a collection
-func (a *ArrayPredictionContext) Hash() int {
- return a.BasePredictionContext.cachedHash
-}
-
-func (a *ArrayPredictionContext) String() string {
- if a.isEmpty() {
- return "[]"
- }
-
- s := "["
- for i := 0; i < len(a.returnStates); i++ {
- if i > 0 {
- s = s + ", "
- }
- if a.returnStates[i] == BasePredictionContextEmptyReturnState {
- s = s + "$"
- continue
- }
- s = s + strconv.Itoa(a.returnStates[i])
- if a.parents[i] != nil {
- s = s + " " + a.parents[i].String()
- } else {
- s = s + "nil"
- }
- }
-
- return s + "]"
-}
-
-// Convert a {@link RuleContext} tree to a {@link BasePredictionContext} graph.
-// Return {@link //EMPTY} if {@code outerContext} is empty or nil.
-// /
-func predictionContextFromRuleContext(a *ATN, outerContext RuleContext) PredictionContext {
- if outerContext == nil {
- outerContext = ParserRuleContextEmpty
- }
- // if we are in RuleContext of start rule, s, then BasePredictionContext
- // is EMPTY. Nobody called us. (if we are empty, return empty)
- if outerContext.GetParent() == nil || outerContext == ParserRuleContextEmpty {
- return BasePredictionContextEMPTY
- }
- // If we have a parent, convert it to a BasePredictionContext graph
- parent := predictionContextFromRuleContext(a, outerContext.GetParent().(RuleContext))
- state := a.states[outerContext.GetInvokingState()]
- transition := state.GetTransitions()[0]
-
- return SingletonBasePredictionContextCreate(parent, transition.(*RuleTransition).followState.GetStateNumber())
-}
-
-func merge(a, b PredictionContext, rootIsWildcard bool, mergeCache *DoubleDict) PredictionContext {
-
- // Share same graph if both same
- //
- if a == b || a.Equals(b) {
- return a
- }
-
- // In Java, EmptyPredictionContext inherits from SingletonPredictionContext, and so the test
- // in java for SingletonPredictionContext will succeed and a new ArrayPredictionContext will be created
- // from it.
- // In go, EmptyPredictionContext does not equate to SingletonPredictionContext and so that conversion
- // will fail. We need to test for both Empty and Singleton and create an ArrayPredictionContext from
- // either of them.
-
- ac, ok1 := a.(*BaseSingletonPredictionContext)
- bc, ok2 := b.(*BaseSingletonPredictionContext)
-
- if ok1 && ok2 {
- return mergeSingletons(ac, bc, rootIsWildcard, mergeCache)
- }
- // At least one of a or b is array
- // If one is $ and rootIsWildcard, return $ as// wildcard
- if rootIsWildcard {
- if _, ok := a.(*EmptyPredictionContext); ok {
- return a
- }
- if _, ok := b.(*EmptyPredictionContext); ok {
- return b
- }
- }
-
- // Convert Singleton or Empty so both are arrays to normalize - We should not use the existing parameters
- // here.
- //
- // TODO: I think that maybe the Prediction Context structs should be redone as there is a chance we will see this mess again - maybe redo the logic here
-
- var arp, arb *ArrayPredictionContext
- var ok bool
- if arp, ok = a.(*ArrayPredictionContext); ok {
- } else if _, ok = a.(*BaseSingletonPredictionContext); ok {
- arp = NewArrayPredictionContext([]PredictionContext{a.GetParent(0)}, []int{a.getReturnState(0)})
- } else if _, ok = a.(*EmptyPredictionContext); ok {
- arp = NewArrayPredictionContext([]PredictionContext{}, []int{})
- }
-
- if arb, ok = b.(*ArrayPredictionContext); ok {
- } else if _, ok = b.(*BaseSingletonPredictionContext); ok {
- arb = NewArrayPredictionContext([]PredictionContext{b.GetParent(0)}, []int{b.getReturnState(0)})
- } else if _, ok = b.(*EmptyPredictionContext); ok {
- arb = NewArrayPredictionContext([]PredictionContext{}, []int{})
- }
-
- // Both arp and arb
- return mergeArrays(arp, arb, rootIsWildcard, mergeCache)
-}
-
-// Merge two {@link SingletonBasePredictionContext} instances.
-//
-// Stack tops equal, parents merge is same return left graph.
-//
-//
-// Same stack top, parents differ merge parents giving array node, then
-// remainders of those graphs. A Newroot node is created to point to the
-// merged parents.
-//
-//
-// Different stack tops pointing to same parent. Make array node for the
-// root where both element in the root point to the same (original)
-// parent.
-//
-//
-// Different stack tops pointing to different parents. Make array node for
-// the root where each element points to the corresponding original
-// parent.
-//
-//
-// @param a the first {@link SingletonBasePredictionContext}
-// @param b the second {@link SingletonBasePredictionContext}
-// @param rootIsWildcard {@code true} if this is a local-context merge,
-// otherwise false to indicate a full-context merge
-// @param mergeCache
-// /
-func mergeSingletons(a, b *BaseSingletonPredictionContext, rootIsWildcard bool, mergeCache *DoubleDict) PredictionContext {
- if mergeCache != nil {
- previous := mergeCache.Get(a.Hash(), b.Hash())
- if previous != nil {
- return previous.(PredictionContext)
- }
- previous = mergeCache.Get(b.Hash(), a.Hash())
- if previous != nil {
- return previous.(PredictionContext)
- }
- }
-
- rootMerge := mergeRoot(a, b, rootIsWildcard)
- if rootMerge != nil {
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), rootMerge)
- }
- return rootMerge
- }
- if a.returnState == b.returnState {
- parent := merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache)
- // if parent is same as existing a or b parent or reduced to a parent,
- // return it
- if parent == a.parentCtx {
- return a // ax + bx = ax, if a=b
- }
- if parent == b.parentCtx {
- return b // ax + bx = bx, if a=b
- }
- // else: ax + ay = a'[x,y]
- // merge parents x and y, giving array node with x,y then remainders
- // of those graphs. dup a, a' points at merged array
- // Newjoined parent so create Newsingleton pointing to it, a'
- spc := SingletonBasePredictionContextCreate(parent, a.returnState)
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), spc)
- }
- return spc
- }
- // a != b payloads differ
- // see if we can collapse parents due to $+x parents if local ctx
- var singleParent PredictionContext
- if a == b || (a.parentCtx != nil && a.parentCtx == b.parentCtx) { // ax +
- // bx =
- // [a,b]x
- singleParent = a.parentCtx
- }
- if singleParent != nil { // parents are same
- // sort payloads and use same parent
- payloads := []int{a.returnState, b.returnState}
- if a.returnState > b.returnState {
- payloads[0] = b.returnState
- payloads[1] = a.returnState
- }
- parents := []PredictionContext{singleParent, singleParent}
- apc := NewArrayPredictionContext(parents, payloads)
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), apc)
- }
- return apc
- }
- // parents differ and can't merge them. Just pack together
- // into array can't merge.
- // ax + by = [ax,by]
- payloads := []int{a.returnState, b.returnState}
- parents := []PredictionContext{a.parentCtx, b.parentCtx}
- if a.returnState > b.returnState { // sort by payload
- payloads[0] = b.returnState
- payloads[1] = a.returnState
- parents = []PredictionContext{b.parentCtx, a.parentCtx}
- }
- apc := NewArrayPredictionContext(parents, payloads)
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), apc)
- }
- return apc
-}
-
-// Handle case where at least one of {@code a} or {@code b} is
-// {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used
-// to represent {@link //EMPTY}.
-//
-// Local-Context Merges
-//
-// These local-context merge operations are used when {@code rootIsWildcard}
-// is true.
-//
-// {@link //EMPTY} is superset of any graph return {@link //EMPTY}.
-//
-//
-// {@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is
-// {@code //EMPTY} return left graph.
-//
-//
-// Special case of last merge if local context.
-//
-//
-// Full-Context Merges
-//
-// These full-context merge operations are used when {@code rootIsWildcard}
-// is false.
-//
-//
-//
-// Must keep all contexts {@link //EMPTY} in array is a special value (and
-// nil parent).
-//
-//
-//
-//
-// @param a the first {@link SingletonBasePredictionContext}
-// @param b the second {@link SingletonBasePredictionContext}
-// @param rootIsWildcard {@code true} if this is a local-context merge,
-// otherwise false to indicate a full-context merge
-// /
-func mergeRoot(a, b SingletonPredictionContext, rootIsWildcard bool) PredictionContext {
- if rootIsWildcard {
- if a == BasePredictionContextEMPTY {
- return BasePredictionContextEMPTY // // + b =//
- }
- if b == BasePredictionContextEMPTY {
- return BasePredictionContextEMPTY // a +// =//
- }
- } else {
- if a == BasePredictionContextEMPTY && b == BasePredictionContextEMPTY {
- return BasePredictionContextEMPTY // $ + $ = $
- } else if a == BasePredictionContextEMPTY { // $ + x = [$,x]
- payloads := []int{b.getReturnState(-1), BasePredictionContextEmptyReturnState}
- parents := []PredictionContext{b.GetParent(-1), nil}
- return NewArrayPredictionContext(parents, payloads)
- } else if b == BasePredictionContextEMPTY { // x + $ = [$,x] ($ is always first if present)
- payloads := []int{a.getReturnState(-1), BasePredictionContextEmptyReturnState}
- parents := []PredictionContext{a.GetParent(-1), nil}
- return NewArrayPredictionContext(parents, payloads)
- }
- }
- return nil
-}
-
-// Merge two {@link ArrayBasePredictionContext} instances.
-//
-// Different tops, different parents.
-//
-//
-// Shared top, same parents.
-//
-//
-// Shared top, different parents.
-//
-//
-// Shared top, all shared parents.
-//
-//
-// Equal tops, merge parents and reduce top to
-// {@link SingletonBasePredictionContext}.
-//
-// /
-func mergeArrays(a, b *ArrayPredictionContext, rootIsWildcard bool, mergeCache *DoubleDict) PredictionContext {
- if mergeCache != nil {
- previous := mergeCache.Get(a.Hash(), b.Hash())
- if previous != nil {
- if ParserATNSimulatorTraceATNSim {
- fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> previous")
- }
- return previous.(PredictionContext)
- }
- previous = mergeCache.Get(b.Hash(), a.Hash())
- if previous != nil {
- if ParserATNSimulatorTraceATNSim {
- fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> previous")
- }
- return previous.(PredictionContext)
- }
- }
- // merge sorted payloads a + b => M
- i := 0 // walks a
- j := 0 // walks b
- k := 0 // walks target M array
-
- mergedReturnStates := make([]int, len(a.returnStates)+len(b.returnStates))
- mergedParents := make([]PredictionContext, len(a.returnStates)+len(b.returnStates))
- // walk and merge to yield mergedParents, mergedReturnStates
- for i < len(a.returnStates) && j < len(b.returnStates) {
- aParent := a.parents[i]
- bParent := b.parents[j]
- if a.returnStates[i] == b.returnStates[j] {
- // same payload (stack tops are equal), must yield merged singleton
- payload := a.returnStates[i]
- // $+$ = $
- bothDollars := payload == BasePredictionContextEmptyReturnState && aParent == nil && bParent == nil
- axAX := aParent != nil && bParent != nil && aParent == bParent // ax+ax
- // ->
- // ax
- if bothDollars || axAX {
- mergedParents[k] = aParent // choose left
- mergedReturnStates[k] = payload
- } else { // ax+ay -> a'[x,y]
- mergedParent := merge(aParent, bParent, rootIsWildcard, mergeCache)
- mergedParents[k] = mergedParent
- mergedReturnStates[k] = payload
- }
- i++ // hop over left one as usual
- j++ // but also Skip one in right side since we merge
- } else if a.returnStates[i] < b.returnStates[j] { // copy a[i] to M
- mergedParents[k] = aParent
- mergedReturnStates[k] = a.returnStates[i]
- i++
- } else { // b > a, copy b[j] to M
- mergedParents[k] = bParent
- mergedReturnStates[k] = b.returnStates[j]
- j++
- }
- k++
- }
- // copy over any payloads remaining in either array
- if i < len(a.returnStates) {
- for p := i; p < len(a.returnStates); p++ {
- mergedParents[k] = a.parents[p]
- mergedReturnStates[k] = a.returnStates[p]
- k++
- }
- } else {
- for p := j; p < len(b.returnStates); p++ {
- mergedParents[k] = b.parents[p]
- mergedReturnStates[k] = b.returnStates[p]
- k++
- }
- }
- // trim merged if we combined a few that had same stack tops
- if k < len(mergedParents) { // write index < last position trim
- if k == 1 { // for just one merged element, return singleton top
- pc := SingletonBasePredictionContextCreate(mergedParents[0], mergedReturnStates[0])
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), pc)
- }
- return pc
- }
- mergedParents = mergedParents[0:k]
- mergedReturnStates = mergedReturnStates[0:k]
- }
-
- M := NewArrayPredictionContext(mergedParents, mergedReturnStates)
-
- // if we created same array as a or b, return that instead
- // TODO: track whether this is possible above during merge sort for speed
- // TODO: In go, I do not think we can just do M == xx as M is a brand new allocation. This could be causing allocation problems
- if M == a {
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), a)
- }
- if ParserATNSimulatorTraceATNSim {
- fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> a")
- }
- return a
- }
- if M == b {
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), b)
- }
- if ParserATNSimulatorTraceATNSim {
- fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> b")
- }
- return b
- }
- combineCommonParents(mergedParents)
-
- if mergeCache != nil {
- mergeCache.set(a.Hash(), b.Hash(), M)
- }
- if ParserATNSimulatorTraceATNSim {
- fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> " + M.String())
- }
- return M
-}
-
-// Make pass over all M {@code parents} merge any {@code equals()}
-// ones.
-// /
-func combineCommonParents(parents []PredictionContext) {
- uniqueParents := make(map[PredictionContext]PredictionContext)
-
- for p := 0; p < len(parents); p++ {
- parent := parents[p]
- if uniqueParents[parent] == nil {
- uniqueParents[parent] = parent
- }
- }
- for q := 0; q < len(parents); q++ {
- parents[q] = uniqueParents[parents[q]]
- }
-}
-
-func getCachedBasePredictionContext(context PredictionContext, contextCache *PredictionContextCache, visited map[PredictionContext]PredictionContext) PredictionContext {
-
- if context.isEmpty() {
- return context
- }
- existing := visited[context]
- if existing != nil {
- return existing
- }
- existing = contextCache.Get(context)
- if existing != nil {
- visited[context] = existing
- return existing
- }
- changed := false
- parents := make([]PredictionContext, context.length())
- for i := 0; i < len(parents); i++ {
- parent := getCachedBasePredictionContext(context.GetParent(i), contextCache, visited)
- if changed || parent != context.GetParent(i) {
- if !changed {
- parents = make([]PredictionContext, context.length())
- for j := 0; j < context.length(); j++ {
- parents[j] = context.GetParent(j)
- }
- changed = true
- }
- parents[i] = parent
- }
- }
- if !changed {
- contextCache.add(context)
- visited[context] = context
- return context
- }
- var updated PredictionContext
- if len(parents) == 0 {
- updated = BasePredictionContextEMPTY
- } else if len(parents) == 1 {
- updated = SingletonBasePredictionContextCreate(parents[0], context.getReturnState(0))
- } else {
- updated = NewArrayPredictionContext(parents, context.(*ArrayPredictionContext).GetReturnStates())
- }
- contextCache.add(updated)
- visited[updated] = updated
- visited[context] = updated
-
- return updated
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_mode.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_mode.go
deleted file mode 100644
index 7b9b72fab1e..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_mode.go
+++ /dev/null
@@ -1,529 +0,0 @@
-// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-// Use of this file is governed by the BSD 3-clause license that
-// can be found in the LICENSE.txt file in the project root.
-
-package antlr
-
-// This enumeration defines the prediction modes available in ANTLR 4 along with
-// utility methods for analyzing configuration sets for conflicts and/or
-// ambiguities.
-
-const (
- //
- // The SLL(*) prediction mode. This prediction mode ignores the current
- // parser context when making predictions. This is the fastest prediction
- // mode, and provides correct results for many grammars. This prediction
- // mode is more powerful than the prediction mode provided by ANTLR 3, but
- // may result in syntax errors for grammar and input combinations which are
- // not SLL.
- //
- //
- // When using this prediction mode, the parser will either return a correct
- // parse tree (i.e. the same parse tree that would be returned with the
- // {@link //LL} prediction mode), or it will Report a syntax error. If a
- // syntax error is encountered when using the {@link //SLL} prediction mode,
- // it may be due to either an actual syntax error in the input or indicate
- // that the particular combination of grammar and input requires the more
- // powerful {@link //LL} prediction abilities to complete successfully.
- //
- //
- // This prediction mode does not provide any guarantees for prediction
- // behavior for syntactically-incorrect inputs.
- //
- PredictionModeSLL = 0
- //
- // The LL(*) prediction mode. This prediction mode allows the current parser
- // context to be used for resolving SLL conflicts that occur during
- // prediction. This is the fastest prediction mode that guarantees correct
- // parse results for all combinations of grammars with syntactically correct
- // inputs.
- //
- //
- // When using this prediction mode, the parser will make correct decisions
- // for all syntactically-correct grammar and input combinations. However, in
- // cases where the grammar is truly ambiguous this prediction mode might not
- // Report a precise answer for exactly which alternatives are
- // ambiguous.
- //
- //
- // This prediction mode does not provide any guarantees for prediction
- // behavior for syntactically-incorrect inputs.
- //
- PredictionModeLL = 1
- //
- // The LL(*) prediction mode with exact ambiguity detection. In addition to
- // the correctness guarantees provided by the {@link //LL} prediction mode,
- // this prediction mode instructs the prediction algorithm to determine the
- // complete and exact set of ambiguous alternatives for every ambiguous
- // decision encountered while parsing.
- //
- //
- // This prediction mode may be used for diagnosing ambiguities during
- // grammar development. Due to the performance overhead of calculating sets
- // of ambiguous alternatives, this prediction mode should be avoided when
- // the exact results are not necessary.
- //
- //
- // This prediction mode does not provide any guarantees for prediction
- // behavior for syntactically-incorrect inputs.
- //
- PredictionModeLLExactAmbigDetection = 2
-)
-
-// Computes the SLL prediction termination condition.
-//
-//
-// This method computes the SLL prediction termination condition for both of
-// the following cases.
-//
-//
-// - The usual SLL+LL fallback upon SLL conflict
-// - Pure SLL without LL fallback
-//
-//
-// COMBINED SLL+LL PARSING
-//
-// When LL-fallback is enabled upon SLL conflict, correct predictions are
-// ensured regardless of how the termination condition is computed by this
-// method. Due to the substantially higher cost of LL prediction, the
-// prediction should only fall back to LL when the additional lookahead
-// cannot lead to a unique SLL prediction.
-//
-// Assuming combined SLL+LL parsing, an SLL configuration set with only
-// conflicting subsets should fall back to full LL, even if the
-// configuration sets don't resolve to the same alternative (e.g.
-// {@code {1,2}} and {@code {3,4}}. If there is at least one non-conflicting
-// configuration, SLL could continue with the hopes that more lookahead will
-// resolve via one of those non-conflicting configurations.
-//
-// Here's the prediction termination rule them: SLL (for SLL+LL parsing)
-// stops when it sees only conflicting configuration subsets. In contrast,
-// full LL keeps going when there is uncertainty.
-//
-// HEURISTIC
-//
-// As a heuristic, we stop prediction when we see any conflicting subset
-// unless we see a state that only has one alternative associated with it.
-// The single-alt-state thing lets prediction continue upon rules like
-// (otherwise, it would admit defeat too soon):
-//
-// {@code [12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) ” }
-//
-// When the ATN simulation reaches the state before {@code ”}, it has a
-// DFA state that looks like: {@code [12|1|[], 6|2|[], 12|2|[]]}. Naturally
-// {@code 12|1|[]} and {@code 12|2|[]} conflict, but we cannot stop
-// processing this node because alternative to has another way to continue,
-// via {@code [6|2|[]]}.
-//
-// It also let's us continue for this rule:
-//
-// {@code [1|1|[], 1|2|[], 8|3|[]] a : A | A | A B }
-//
-// After Matching input A, we reach the stop state for rule A, state 1.
-// State 8 is the state right before B. Clearly alternatives 1 and 2
-// conflict and no amount of further lookahead will separate the two.
-// However, alternative 3 will be able to continue and so we do not stop
-// working on this state. In the previous example, we're concerned with
-// states associated with the conflicting alternatives. Here alt 3 is not
-// associated with the conflicting configs, but since we can continue
-// looking for input reasonably, don't declare the state done.
-//
-// PURE SLL PARSING
-//
-// To handle pure SLL parsing, all we have to do is make sure that we
-// combine stack contexts for configurations that differ only by semantic
-// predicate. From there, we can do the usual SLL termination heuristic.
-//
-// PREDICATES IN SLL+LL PARSING
-//
-// SLL decisions don't evaluate predicates until after they reach DFA stop
-// states because they need to create the DFA cache that works in all
-// semantic situations. In contrast, full LL evaluates predicates collected
-// during start state computation so it can ignore predicates thereafter.
-// This means that SLL termination detection can totally ignore semantic
-// predicates.
-//
-// Implementation-wise, {@link ATNConfigSet} combines stack contexts but not
-// semantic predicate contexts so we might see two configurations like the
-// following.
-//
-// {@code (s, 1, x, {}), (s, 1, x', {p})}
-//
-// Before testing these configurations against others, we have to merge
-// {@code x} and {@code x'} (without modifying the existing configurations).
-// For example, we test {@code (x+x')==x”} when looking for conflicts in
-// the following configurations.
-//
-// {@code (s, 1, x, {}), (s, 1, x', {p}), (s, 2, x”, {})}
-//
-// If the configuration set has predicates (as indicated by
-// {@link ATNConfigSet//hasSemanticContext}), this algorithm makes a copy of
-// the configurations to strip out all of the predicates so that a standard
-// {@link ATNConfigSet} will merge everything ignoring predicates.
-func PredictionModehasSLLConflictTerminatingPrediction(mode int, configs ATNConfigSet) bool {
- // Configs in rule stop states indicate reaching the end of the decision
- // rule (local context) or end of start rule (full context). If all
- // configs meet this condition, then none of the configurations is able
- // to Match additional input so we terminate prediction.
- //
- if PredictionModeallConfigsInRuleStopStates(configs) {
- return true
- }
- // pure SLL mode parsing
- if mode == PredictionModeSLL {
- // Don't bother with combining configs from different semantic
- // contexts if we can fail over to full LL costs more time
- // since we'll often fail over anyway.
- if configs.HasSemanticContext() {
- // dup configs, tossing out semantic predicates
- dup := NewBaseATNConfigSet(false)
- for _, c := range configs.GetItems() {
-
- // NewBaseATNConfig({semanticContext:}, c)
- c = NewBaseATNConfig2(c, SemanticContextNone)
- dup.Add(c, nil)
- }
- configs = dup
- }
- // now we have combined contexts for configs with dissimilar preds
- }
- // pure SLL or combined SLL+LL mode parsing
- altsets := PredictionModegetConflictingAltSubsets(configs)
- return PredictionModehasConflictingAltSet(altsets) && !PredictionModehasStateAssociatedWithOneAlt(configs)
-}
-
-// Checks if any configuration in {@code configs} is in a
-// {@link RuleStopState}. Configurations meeting this condition have reached
-// the end of the decision rule (local context) or end of start rule (full
-// context).
-//
-// @param configs the configuration set to test
-// @return {@code true} if any configuration in {@code configs} is in a
-// {@link RuleStopState}, otherwise {@code false}
-func PredictionModehasConfigInRuleStopState(configs ATNConfigSet) bool {
- for _, c := range configs.GetItems() {
- if _, ok := c.GetState().(*RuleStopState); ok {
- return true
- }
- }
- return false
-}
-
-// Checks if all configurations in {@code configs} are in a
-// {@link RuleStopState}. Configurations meeting this condition have reached
-// the end of the decision rule (local context) or end of start rule (full
-// context).
-//
-// @param configs the configuration set to test
-// @return {@code true} if all configurations in {@code configs} are in a
-// {@link RuleStopState}, otherwise {@code false}
-func PredictionModeallConfigsInRuleStopStates(configs ATNConfigSet) bool {
-
- for _, c := range configs.GetItems() {
- if _, ok := c.GetState().(*RuleStopState); !ok {
- return false
- }
- }
- return true
-}
-
-// Full LL prediction termination.
-//
-// Can we stop looking ahead during ATN simulation or is there some
-// uncertainty as to which alternative we will ultimately pick, after
-// consuming more input? Even if there are partial conflicts, we might know
-// that everything is going to resolve to the same minimum alternative. That
-// means we can stop since no more lookahead will change that fact. On the
-// other hand, there might be multiple conflicts that resolve to different
-// minimums. That means we need more look ahead to decide which of those
-// alternatives we should predict.
-//
-// The basic idea is to split the set of configurations {@code C}, into
-// conflicting subsets {@code (s, _, ctx, _)} and singleton subsets with
-// non-conflicting configurations. Two configurations conflict if they have
-// identical {@link ATNConfig//state} and {@link ATNConfig//context} values
-// but different {@link ATNConfig//alt} value, e.g. {@code (s, i, ctx, _)}
-// and {@code (s, j, ctx, _)} for {@code i!=j}.
-//
-// Reduce these configuration subsets to the set of possible alternatives.
-// You can compute the alternative subsets in one pass as follows:
-//
-// {@code A_s,ctx = {i | (s, i, ctx, _)}} for each configuration in
-// {@code C} holding {@code s} and {@code ctx} fixed.
-//
-// Or in pseudo-code, for each configuration {@code c} in {@code C}:
-//
-//
-// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not
-// alt and not pred
-//
-//
-// The values in {@code map} are the set of {@code A_s,ctx} sets.
-//
-// If {@code |A_s,ctx|=1} then there is no conflict associated with
-// {@code s} and {@code ctx}.
-//
-// Reduce the subsets to singletons by choosing a minimum of each subset. If
-// the union of these alternative subsets is a singleton, then no amount of
-// more lookahead will help us. We will always pick that alternative. If,
-// however, there is more than one alternative, then we are uncertain which
-// alternative to predict and must continue looking for resolution. We may
-// or may not discover an ambiguity in the future, even if there are no
-// conflicting subsets this round.
-//
-// The biggest sin is to terminate early because it means we've made a
-// decision but were uncertain as to the eventual outcome. We haven't used
-// enough lookahead. On the other hand, announcing a conflict too late is no
-// big deal you will still have the conflict. It's just inefficient. It
-// might even look until the end of file.
-//
-// No special consideration for semantic predicates is required because
-// predicates are evaluated on-the-fly for full LL prediction, ensuring that
-// no configuration contains a semantic context during the termination
-// check.
-//
-// CONFLICTING CONFIGS
-//
-// Two configurations {@code (s, i, x)} and {@code (s, j, x')}, conflict
-// when {@code i!=j} but {@code x=x'}. Because we merge all
-// {@code (s, i, _)} configurations together, that means that there are at
-// most {@code n} configurations associated with state {@code s} for
-// {@code n} possible alternatives in the decision. The merged stacks
-// complicate the comparison of configuration contexts {@code x} and
-// {@code x'}. Sam checks to see if one is a subset of the other by calling
-// merge and checking to see if the merged result is either {@code x} or
-// {@code x'}. If the {@code x} associated with lowest alternative {@code i}
-// is the superset, then {@code i} is the only possible prediction since the
-// others resolve to {@code min(i)} as well. However, if {@code x} is
-// associated with {@code j>i} then at least one stack configuration for
-// {@code j} is not in conflict with alternative {@code i}. The algorithm
-// should keep going, looking for more lookahead due to the uncertainty.
-//
-// For simplicity, I'm doing a equality check between {@code x} and
-// {@code x'} that lets the algorithm continue to consume lookahead longer
-// than necessary. The reason I like the equality is of course the
-// simplicity but also because that is the test you need to detect the
-// alternatives that are actually in conflict.
-//
-// CONTINUE/STOP RULE
-//
-// Continue if union of resolved alternative sets from non-conflicting and
-// conflicting alternative subsets has more than one alternative. We are
-// uncertain about which alternative to predict.
-//
-// The complete set of alternatives, {@code [i for (_,i,_)]}, tells us which
-// alternatives are still in the running for the amount of input we've
-// consumed at this point. The conflicting sets let us to strip away
-// configurations that won't lead to more states because we resolve
-// conflicts to the configuration with a minimum alternate for the
-// conflicting set.
-//
-// CASES
-//
-//
-//
-// - no conflicts and more than 1 alternative in set => continue
-//
-// - {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s, 3, z)},
-// {@code (s', 1, y)}, {@code (s', 2, y)} yields non-conflicting set
-// {@code {3}} U conflicting sets {@code min({1,2})} U {@code min({1,2})} =
-// {@code {1,3}} => continue
-//
-//
-// - {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 1, y)},
-// {@code (s', 2, y)}, {@code (s”, 1, z)} yields non-conflicting set
-// {@code {1}} U conflicting sets {@code min({1,2})} U {@code min({1,2})} =
-// {@code {1}} => stop and predict 1
-//
-// - {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 1, y)},
-// {@code (s', 2, y)} yields conflicting, reduced sets {@code {1}} U
-// {@code {1}} = {@code {1}} => stop and predict 1, can announce
-// ambiguity {@code {1,2}}
-//
-// - {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 2, y)},
-// {@code (s', 3, y)} yields conflicting, reduced sets {@code {1}} U
-// {@code {2}} = {@code {1,2}} => continue
-//
-// - {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 3, y)},
-// {@code (s', 4, y)} yields conflicting, reduced sets {@code {1}} U
-// {@code {3}} = {@code {1,3}} => continue
-//
-//
-//
-// EXACT AMBIGUITY DETECTION
-//
-// If all states Report the same conflicting set of alternatives, then we
-// know we have the exact ambiguity set.
-//
-// |A_i|>1 and
-// A_i = A_j for all i, j.
-//
-// In other words, we continue examining lookahead until all {@code A_i}
-// have more than one alternative and all {@code A_i} are the same. If
-// {@code A={{1,2}, {1,3}}}, then regular LL prediction would terminate
-// because the resolved set is {@code {1}}. To determine what the real
-// ambiguity is, we have to know whether the ambiguity is between one and
-// two or one and three so we keep going. We can only stop prediction when
-// we need exact ambiguity detection when the sets look like
-// {@code A={{1,2}}} or {@code {{1,2},{1,2}}}, etc...
-func PredictionModeresolvesToJustOneViableAlt(altsets []*BitSet) int {
- return PredictionModegetSingleViableAlt(altsets)
-}
-
-// Determines if every alternative subset in {@code altsets} contains more
-// than one alternative.
-//
-// @param altsets a collection of alternative subsets
-// @return {@code true} if every {@link BitSet} in {@code altsets} has
-// {@link BitSet//cardinality cardinality} > 1, otherwise {@code false}
-func PredictionModeallSubsetsConflict(altsets []*BitSet) bool {
- return !PredictionModehasNonConflictingAltSet(altsets)
-}
-
-// Determines if any single alternative subset in {@code altsets} contains
-// exactly one alternative.
-//
-// @param altsets a collection of alternative subsets
-// @return {@code true} if {@code altsets} contains a {@link BitSet} with
-// {@link BitSet//cardinality cardinality} 1, otherwise {@code false}
-func PredictionModehasNonConflictingAltSet(altsets []*BitSet) bool {
- for i := 0; i < len(altsets); i++ {
- alts := altsets[i]
- if alts.length() == 1 {
- return true
- }
- }
- return false
-}
-
-// Determines if any single alternative subset in {@code altsets} contains
-// more than one alternative.
-//
-// @param altsets a collection of alternative subsets
-// @return {@code true} if {@code altsets} contains a {@link BitSet} with
-// {@link BitSet//cardinality cardinality} > 1, otherwise {@code false}
-func PredictionModehasConflictingAltSet(altsets []*BitSet) bool {
- for i := 0; i < len(altsets); i++ {
- alts := altsets[i]
- if alts.length() > 1 {
- return true
- }
- }
- return false
-}
-
-// Determines if every alternative subset in {@code altsets} is equivalent.
-//
-// @param altsets a collection of alternative subsets
-// @return {@code true} if every member of {@code altsets} is equal to the
-// others, otherwise {@code false}
-func PredictionModeallSubsetsEqual(altsets []*BitSet) bool {
- var first *BitSet
-
- for i := 0; i < len(altsets); i++ {
- alts := altsets[i]
- if first == nil {
- first = alts
- } else if alts != first {
- return false
- }
- }
-
- return true
-}
-
-// Returns the unique alternative predicted by all alternative subsets in
-// {@code altsets}. If no such alternative exists, this method returns
-// {@link ATN//INVALID_ALT_NUMBER}.
-//
-// @param altsets a collection of alternative subsets
-func PredictionModegetUniqueAlt(altsets []*BitSet) int {
- all := PredictionModeGetAlts(altsets)
- if all.length() == 1 {
- return all.minValue()
- }
-
- return ATNInvalidAltNumber
-}
-
-// Gets the complete set of represented alternatives for a collection of
-// alternative subsets. This method returns the union of each {@link BitSet}
-// in {@code altsets}.
-//
-// @param altsets a collection of alternative subsets
-// @return the set of represented alternatives in {@code altsets}
-func PredictionModeGetAlts(altsets []*BitSet) *BitSet {
- all := NewBitSet()
- for _, alts := range altsets {
- all.or(alts)
- }
- return all
-}
-
-// PredictionModegetConflictingAltSubsets gets the conflicting alt subsets from a configuration set.
-// For each configuration {@code c} in {@code configs}:
-//
-//
-// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not
-// alt and not pred
-//
-func PredictionModegetConflictingAltSubsets(configs ATNConfigSet) []*BitSet {
- configToAlts := NewJMap[ATNConfig, *BitSet, *ATNAltConfigComparator[ATNConfig]](atnAltCfgEqInst)
-
- for _, c := range configs.GetItems() {
-
- alts, ok := configToAlts.Get(c)
- if !ok {
- alts = NewBitSet()
- configToAlts.Put(c, alts)
- }
- alts.add(c.GetAlt())
- }
-
- return configToAlts.Values()
-}
-
-// PredictionModeGetStateToAltMap gets a map from state to alt subset from a configuration set. For each
-// configuration {@code c} in {@code configs}:
-//
-//
-// map[c.{@link ATNConfig//state state}] U= c.{@link ATNConfig//alt alt}
-//
-func PredictionModeGetStateToAltMap(configs ATNConfigSet) *AltDict {
- m := NewAltDict()
-
- for _, c := range configs.GetItems() {
- alts := m.Get(c.GetState().String())
- if alts == nil {
- alts = NewBitSet()
- m.put(c.GetState().String(), alts)
- }
- alts.(*BitSet).add(c.GetAlt())
- }
- return m
-}
-
-func PredictionModehasStateAssociatedWithOneAlt(configs ATNConfigSet) bool {
- values := PredictionModeGetStateToAltMap(configs).values()
- for i := 0; i < len(values); i++ {
- if values[i].(*BitSet).length() == 1 {
- return true
- }
- }
- return false
-}
-
-func PredictionModegetSingleViableAlt(altsets []*BitSet) int {
- result := ATNInvalidAltNumber
-
- for i := 0; i < len(altsets); i++ {
- alts := altsets[i]
- minAlt := alts.minValue()
- if result == ATNInvalidAltNumber {
- result = minAlt
- } else if result != minAlt { // more than 1 viable alt
- return ATNInvalidAltNumber
- }
- }
- return result
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/rule_context.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/rule_context.go
deleted file mode 100644
index 210699ba234..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/rule_context.go
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
-// Use of this file is governed by the BSD 3-clause license that
-// can be found in the LICENSE.txt file in the project root.
-
-package antlr
-
-// A rule context is a record of a single rule invocation. It knows
-// which context invoked it, if any. If there is no parent context, then
-// naturally the invoking state is not valid. The parent link
-// provides a chain upwards from the current rule invocation to the root
-// of the invocation tree, forming a stack. We actually carry no
-// information about the rule associated with b context (except
-// when parsing). We keep only the state number of the invoking state from
-// the ATN submachine that invoked b. Contrast b with the s
-// pointer inside ParserRuleContext that tracks the current state
-// being "executed" for the current rule.
-//
-// The parent contexts are useful for computing lookahead sets and
-// getting error information.
-//
-// These objects are used during parsing and prediction.
-// For the special case of parsers, we use the subclass
-// ParserRuleContext.
-//
-// @see ParserRuleContext
-//
-
-type RuleContext interface {
- RuleNode
-
- GetInvokingState() int
- SetInvokingState(int)
-
- GetRuleIndex() int
- IsEmpty() bool
-
- GetAltNumber() int
- SetAltNumber(altNumber int)
-
- String([]string, RuleContext) string
-}
-
-type BaseRuleContext struct {
- parentCtx RuleContext
- invokingState int
- RuleIndex int
-}
-
-func NewBaseRuleContext(parent RuleContext, invokingState int) *BaseRuleContext {
-
- rn := new(BaseRuleContext)
-
- // What context invoked b rule?
- rn.parentCtx = parent
-
- // What state invoked the rule associated with b context?
- // The "return address" is the followState of invokingState
- // If parent is nil, b should be -1.
- if parent == nil {
- rn.invokingState = -1
- } else {
- rn.invokingState = invokingState
- }
-
- return rn
-}
-
-func (b *BaseRuleContext) GetBaseRuleContext() *BaseRuleContext {
- return b
-}
-
-func (b *BaseRuleContext) SetParent(v Tree) {
- if v == nil {
- b.parentCtx = nil
- } else {
- b.parentCtx = v.(RuleContext)
- }
-}
-
-func (b *BaseRuleContext) GetInvokingState() int {
- return b.invokingState
-}
-
-func (b *BaseRuleContext) SetInvokingState(t int) {
- b.invokingState = t
-}
-
-func (b *BaseRuleContext) GetRuleIndex() int {
- return b.RuleIndex
-}
-
-func (b *BaseRuleContext) GetAltNumber() int {
- return ATNInvalidAltNumber
-}
-
-func (b *BaseRuleContext) SetAltNumber(altNumber int) {}
-
-// A context is empty if there is no invoking state meaning nobody call
-// current context.
-func (b *BaseRuleContext) IsEmpty() bool {
- return b.invokingState == -1
-}
-
-// Return the combined text of all child nodes. This method only considers
-// tokens which have been added to the parse tree.
-//
-// Since tokens on hidden channels (e.g. whitespace or comments) are not
-// added to the parse trees, they will not appear in the output of b
-// method.
-//
-
-func (b *BaseRuleContext) GetParent() Tree {
- return b.parentCtx
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/utils_set.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/utils_set.go
deleted file mode 100644
index c9bd6751e3a..00000000000
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/utils_set.go
+++ /dev/null
@@ -1,235 +0,0 @@
-package antlr
-
-import "math"
-
-const (
- _initalCapacity = 16
- _initalBucketCapacity = 8
- _loadFactor = 0.75
-)
-
-type Set interface {
- Add(value interface{}) (added interface{})
- Len() int
- Get(value interface{}) (found interface{})
- Contains(value interface{}) bool
- Values() []interface{}
- Each(f func(interface{}) bool)
-}
-
-type array2DHashSet struct {
- buckets [][]Collectable[any]
- hashcodeFunction func(interface{}) int
- equalsFunction func(Collectable[any], Collectable[any]) bool
-
- n int // How many elements in set
- threshold int // when to expand
-
- currentPrime int // jump by 4 primes each expand or whatever
- initialBucketCapacity int
-}
-
-func (as *array2DHashSet) Each(f func(interface{}) bool) {
- if as.Len() < 1 {
- return
- }
-
- for _, bucket := range as.buckets {
- for _, o := range bucket {
- if o == nil {
- break
- }
- if !f(o) {
- return
- }
- }
- }
-}
-
-func (as *array2DHashSet) Values() []interface{} {
- if as.Len() < 1 {
- return nil
- }
-
- values := make([]interface{}, 0, as.Len())
- as.Each(func(i interface{}) bool {
- values = append(values, i)
- return true
- })
- return values
-}
-
-func (as *array2DHashSet) Contains(value Collectable[any]) bool {
- return as.Get(value) != nil
-}
-
-func (as *array2DHashSet) Add(value Collectable[any]) interface{} {
- if as.n > as.threshold {
- as.expand()
- }
- return as.innerAdd(value)
-}
-
-func (as *array2DHashSet) expand() {
- old := as.buckets
-
- as.currentPrime += 4
-
- var (
- newCapacity = len(as.buckets) << 1
- newTable = as.createBuckets(newCapacity)
- newBucketLengths = make([]int, len(newTable))
- )
-
- as.buckets = newTable
- as.threshold = int(float64(newCapacity) * _loadFactor)
-
- for _, bucket := range old {
- if bucket == nil {
- continue
- }
-
- for _, o := range bucket {
- if o == nil {
- break
- }
-
- b := as.getBuckets(o)
- bucketLength := newBucketLengths[b]
- var newBucket []Collectable[any]
- if bucketLength == 0 {
- // new bucket
- newBucket = as.createBucket(as.initialBucketCapacity)
- newTable[b] = newBucket
- } else {
- newBucket = newTable[b]
- if bucketLength == len(newBucket) {
- // expand
- newBucketCopy := make([]Collectable[any], len(newBucket)<<1)
- copy(newBucketCopy[:bucketLength], newBucket)
- newBucket = newBucketCopy
- newTable[b] = newBucket
- }
- }
-
- newBucket[bucketLength] = o
- newBucketLengths[b]++
- }
- }
-}
-
-func (as *array2DHashSet) Len() int {
- return as.n
-}
-
-func (as *array2DHashSet) Get(o Collectable[any]) interface{} {
- if o == nil {
- return nil
- }
-
- b := as.getBuckets(o)
- bucket := as.buckets[b]
- if bucket == nil { // no bucket
- return nil
- }
-
- for _, e := range bucket {
- if e == nil {
- return nil // empty slot; not there
- }
- if as.equalsFunction(e, o) {
- return e
- }
- }
-
- return nil
-}
-
-func (as *array2DHashSet) innerAdd(o Collectable[any]) interface{} {
- b := as.getBuckets(o)
-
- bucket := as.buckets[b]
-
- // new bucket
- if bucket == nil {
- bucket = as.createBucket(as.initialBucketCapacity)
- bucket[0] = o
-
- as.buckets[b] = bucket
- as.n++
- return o
- }
-
- // look for it in bucket
- for i := 0; i < len(bucket); i++ {
- existing := bucket[i]
- if existing == nil { // empty slot; not there, add.
- bucket[i] = o
- as.n++
- return o
- }
-
- if as.equalsFunction(existing, o) { // found existing, quit
- return existing
- }
- }
-
- // full bucket, expand and add to end
- oldLength := len(bucket)
- bucketCopy := make([]Collectable[any], oldLength<<1)
- copy(bucketCopy[:oldLength], bucket)
- bucket = bucketCopy
- as.buckets[b] = bucket
- bucket[oldLength] = o
- as.n++
- return o
-}
-
-func (as *array2DHashSet) getBuckets(value Collectable[any]) int {
- hash := as.hashcodeFunction(value)
- return hash & (len(as.buckets) - 1)
-}
-
-func (as *array2DHashSet) createBuckets(cap int) [][]Collectable[any] {
- return make([][]Collectable[any], cap)
-}
-
-func (as *array2DHashSet) createBucket(cap int) []Collectable[any] {
- return make([]Collectable[any], cap)
-}
-
-func newArray2DHashSetWithCap(
- hashcodeFunction func(interface{}) int,
- equalsFunction func(Collectable[any], Collectable[any]) bool,
- initCap int,
- initBucketCap int,
-) *array2DHashSet {
- if hashcodeFunction == nil {
- hashcodeFunction = standardHashFunction
- }
-
- if equalsFunction == nil {
- equalsFunction = standardEqualsFunction
- }
-
- ret := &array2DHashSet{
- hashcodeFunction: hashcodeFunction,
- equalsFunction: equalsFunction,
-
- n: 0,
- threshold: int(math.Floor(_initalCapacity * _loadFactor)),
-
- currentPrime: 1,
- initialBucketCapacity: initBucketCap,
- }
-
- ret.buckets = ret.createBuckets(initCap)
- return ret
-}
-
-func newArray2DHashSet(
- hashcodeFunction func(interface{}) int,
- equalsFunction func(Collectable[any], Collectable[any]) bool,
-) *array2DHashSet {
- return newArray2DHashSetWithCap(hashcodeFunction, equalsFunction, _initalCapacity, _initalBucketCapacity)
-}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/.gitignore b/vendor/github.com/antlr4-go/antlr/v4/.gitignore
new file mode 100644
index 00000000000..38ea34ff513
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/.gitignore
@@ -0,0 +1,18 @@
+### Go template
+
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+
+# Test binary, built with `go test -c`
+*.test
+
+
+# Go workspace file
+go.work
+
+# No Goland stuff in this repo
+.idea
diff --git a/vendor/github.com/antlr4-go/antlr/v4/LICENSE b/vendor/github.com/antlr4-go/antlr/v4/LICENSE
new file mode 100644
index 00000000000..a22292eb5ae
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2023 The ANTLR Project. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+3. Neither name of copyright holders nor the names of its contributors
+may be used to endorse or promote products derived from this software
+without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/antlr4-go/antlr/v4/README.md b/vendor/github.com/antlr4-go/antlr/v4/README.md
new file mode 100644
index 00000000000..03e5b83eb1b
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/README.md
@@ -0,0 +1,54 @@
+[![Go Report Card](https://goreportcard.com/badge/github.com/antlr4-go/antlr?style=flat-square)](https://goreportcard.com/report/github.com/antlr4-go/antlr)
+[![PkgGoDev](https://pkg.go.dev/badge/github.com/github.com/antlr4-go/antlr)](https://pkg.go.dev/github.com/antlr4-go/antlr)
+[![Release](https://img.shields.io/github/v/release/antlr4-go/antlr?sort=semver&style=flat-square)](https://github.com/antlr4-go/antlr/releases/latest)
+[![Release](https://img.shields.io/github/go-mod/go-version/antlr4-go/antlr?style=flat-square)](https://github.com/antlr4-go/antlr/releases/latest)
+[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=flat-square)](https://github.com/antlr4-go/antlr/commit-activity)
+[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
+[![GitHub stars](https://img.shields.io/github/stars/antlr4-go/antlr?style=flat-square&label=Star&maxAge=2592000)](https://GitHub.com/Naereen/StrapDown.js/stargazers/)
+# ANTLR4 Go Runtime Module Repo
+
+IMPORTANT: Please submit PRs via a clone of the https://github.com/antlr/antlr4 repo, and not here.
+
+ - Do not submit PRs or any change requests to this repo
+ - This repo is read only and is updated by the ANTLR team to create a new release of the Go Runtime for ANTLR
+ - This repo contains the Go runtime that your generated projects should import
+
+## Introduction
+
+This repo contains the official modules for the Go Runtime for ANTLR. It is a copy of the runtime maintained
+at: https://github.com/antlr/antlr4/tree/master/runtime/Go/antlr and is automatically updated by the ANTLR team to create
+the official Go runtime release only. No development work is carried out in this repo and PRs are not accepted here.
+
+The dev branch of this repo is kept in sync with the dev branch of the main ANTLR repo and is updated periodically.
+
+### Why?
+
+The `go get` command is unable to retrieve the Go runtime when it is embedded so
+deeply in the main repo. A `go get` against the `antlr/antlr4` repo, while retrieving the correct source code for the runtime,
+does not correctly resolve tags and will create a reference in your `go.mod` file that is unclear, will not upgrade smoothly and
+causes confusion.
+
+For instance, the current Go runtime release, which is tagged with v4.13.0 in `antlr/antlr4` is retrieved by go get as:
+
+```sh
+require (
+ github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc
+)
+```
+
+Where you would expect to see:
+
+```sh
+require (
+ github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.13.0
+)
+```
+
+The decision was taken to create a separate org in a separate repo to hold the official Go runtime for ANTLR and
+from whence users can expect `go get` to behave as expected.
+
+
+# Documentation
+Please read the official documentation at: https://github.com/antlr/antlr4/blob/master/doc/index.md for tips on
+migrating existing projects to use the new module location and for information on how to use the Go runtime in
+general.
diff --git a/vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go b/vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go
new file mode 100644
index 00000000000..3bb4fd7c4e0
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go
@@ -0,0 +1,102 @@
+/*
+Package antlr implements the Go version of the ANTLR 4 runtime.
+
+# The ANTLR Tool
+
+ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing,
+or translating structured text or binary files. It's widely used to build languages, tools, and frameworks.
+From a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface
+(or visitor) that makes it easy to respond to the recognition of phrases of interest.
+
+# Go Runtime
+
+At version 4.11.x and prior, the Go runtime was not properly versioned for go modules. After this point, the runtime
+source code to be imported was held in the `runtime/Go/antlr/v4` directory, and the go.mod file was updated to reflect the version of
+ANTLR4 that it is compatible with (I.E. uses the /v4 path).
+
+However, this was found to be problematic, as it meant that with the runtime embedded so far underneath the root
+of the repo, the `go get` and related commands could not properly resolve the location of the go runtime source code.
+This meant that the reference to the runtime in your `go.mod` file would refer to the correct source code, but would not
+list the release tag such as @4.12.0 - this was confusing, to say the least.
+
+As of 4.12.1, the runtime is now available as a go module in its own repo, and can be imported as `github.com/antlr4-go/antlr`
+(the go get command should also be used with this path). See the main documentation for the ANTLR4 project for more information,
+which is available at [ANTLR docs]. The documentation for using the Go runtime is available at [Go runtime docs].
+
+This means that if you are using the source code without modules, you should also use the source code in the [new repo].
+Though we highly recommend that you use go modules, as they are now idiomatic for Go.
+
+I am aware that this change will prove Hyrum's Law, but am prepared to live with it for the common good.
+
+Go runtime author: [Jim Idle] jimi@idle.ws
+
+# Code Generation
+
+ANTLR supports the generation of code in a number of [target languages], and the generated code is supported by a
+runtime library, written specifically to support the generated code in the target language. This library is the
+runtime for the Go target.
+
+To generate code for the go target, it is generally recommended to place the source grammar files in a package of
+their own, and use the `.sh` script method of generating code, using the go generate directive. In that same directory
+it is usual, though not required, to place the antlr tool that should be used to generate the code. That does mean
+that the antlr tool JAR file will be checked in to your source code control though, so you are, of course, free to use any other
+way of specifying the version of the ANTLR tool to use, such as aliasing in `.zshrc` or equivalent, or a profile in
+your IDE, or configuration in your CI system. Checking in the jar does mean that it is easy to reproduce the build as
+it was at any point in its history.
+
+Here is a general/recommended template for an ANTLR based recognizer in Go:
+
+ .
+ ├── parser
+ │ ├── mygrammar.g4
+ │ ├── antlr-4.12.1-complete.jar
+ │ ├── generate.go
+ │ └── generate.sh
+ ├── parsing - generated code goes here
+ │ └── error_listeners.go
+ ├── go.mod
+ ├── go.sum
+ ├── main.go
+ └── main_test.go
+
+Make sure that the package statement in your grammar file(s) reflects the go package the generated code will exist in.
+
+The generate.go file then looks like this:
+
+ package parser
+
+ //go:generate ./generate.sh
+
+And the generate.sh file will look similar to this:
+
+ #!/bin/sh
+
+ alias antlr4='java -Xmx500M -cp "./antlr4-4.12.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
+ antlr4 -Dlanguage=Go -no-visitor -package parsing *.g4
+
+depending on whether you want visitors or listeners or any other ANTLR options. Not that another option here
+is to generate the code into a
+
+From the command line at the root of your source package (location of go.mo)d) you can then simply issue the command:
+
+ go generate ./...
+
+Which will generate the code for the parser, and place it in the parsing package. You can then use the generated code
+by importing the parsing package.
+
+There are no hard and fast rules on this. It is just a recommendation. You can generate the code in any way and to anywhere you like.
+
+# Copyright Notice
+
+Copyright (c) 2012-2023 The ANTLR Project. All rights reserved.
+
+Use of this file is governed by the BSD 3-clause license, which can be found in the [LICENSE.txt] file in the project root.
+
+[target languages]: https://github.com/antlr/antlr4/tree/master/runtime
+[LICENSE.txt]: https://github.com/antlr/antlr4/blob/master/LICENSE.txt
+[ANTLR docs]: https://github.com/antlr/antlr4/blob/master/doc/index.md
+[new repo]: https://github.com/antlr4-go/antlr
+[Jim Idle]: https://github.com/jimidle
+[Go runtime docs]: https://github.com/antlr/antlr4/blob/master/doc/go-target.md
+*/
+package antlr
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn.go b/vendor/github.com/antlr4-go/antlr/v4/atn.go
similarity index 94%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn.go
rename to vendor/github.com/antlr4-go/antlr/v4/atn.go
index 98010d2e6e6..cdeefed2478 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/atn.go
@@ -20,10 +20,11 @@ var ATNInvalidAltNumber int
// [ALL(*)]: https://www.antlr.org/papers/allstar-techreport.pdf
// [Recursive Transition Network]: https://en.wikipedia.org/wiki/Recursive_transition_network
type ATN struct {
- // DecisionToState is the decision points for all rules, subrules, optional
- // blocks, ()+, ()*, etc. Each subrule/rule is a decision point, and we must track them so we
+
+ // DecisionToState is the decision points for all rules, sub-rules, optional
+ // blocks, ()+, ()*, etc. Each sub-rule/rule is a decision point, and we must track them, so we
// can go back later and build DFA predictors for them. This includes
- // all the rules, subrules, optional blocks, ()+, ()* etc...
+ // all the rules, sub-rules, optional blocks, ()+, ()* etc...
DecisionToState []DecisionState
// grammarType is the ATN type and is used for deserializing ATNs from strings.
@@ -51,6 +52,8 @@ type ATN struct {
// specified, and otherwise is nil.
ruleToTokenType []int
+ // ATNStates is a list of all states in the ATN, ordered by state number.
+ //
states []ATNState
mu sync.Mutex
diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_config.go b/vendor/github.com/antlr4-go/antlr/v4/atn_config.go
new file mode 100644
index 00000000000..a83f25d3492
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/atn_config.go
@@ -0,0 +1,335 @@
+// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+)
+
+const (
+ lexerConfig = iota // Indicates that this ATNConfig is for a lexer
+ parserConfig // Indicates that this ATNConfig is for a parser
+)
+
+// ATNConfig is a tuple: (ATN state, predicted alt, syntactic, semantic
+// context). The syntactic context is a graph-structured stack node whose
+// path(s) to the root is the rule invocation(s) chain used to arrive in the
+// state. The semantic context is the tree of semantic predicates encountered
+// before reaching an ATN state.
+type ATNConfig struct {
+ precedenceFilterSuppressed bool
+ state ATNState
+ alt int
+ context *PredictionContext
+ semanticContext SemanticContext
+ reachesIntoOuterContext int
+ cType int // lexerConfig or parserConfig
+ lexerActionExecutor *LexerActionExecutor
+ passedThroughNonGreedyDecision bool
+}
+
+// NewATNConfig6 creates a new ATNConfig instance given a state, alt and context only
+func NewATNConfig6(state ATNState, alt int, context *PredictionContext) *ATNConfig {
+ return NewATNConfig5(state, alt, context, SemanticContextNone)
+}
+
+// NewATNConfig5 creates a new ATNConfig instance given a state, alt, context and semantic context
+func NewATNConfig5(state ATNState, alt int, context *PredictionContext, semanticContext SemanticContext) *ATNConfig {
+ if semanticContext == nil {
+ panic("semanticContext cannot be nil") // TODO: Necessary?
+ }
+
+ pac := &ATNConfig{}
+ pac.state = state
+ pac.alt = alt
+ pac.context = context
+ pac.semanticContext = semanticContext
+ pac.cType = parserConfig
+ return pac
+}
+
+// NewATNConfig4 creates a new ATNConfig instance given an existing config, and a state only
+func NewATNConfig4(c *ATNConfig, state ATNState) *ATNConfig {
+ return NewATNConfig(c, state, c.GetContext(), c.GetSemanticContext())
+}
+
+// NewATNConfig3 creates a new ATNConfig instance given an existing config, a state and a semantic context
+func NewATNConfig3(c *ATNConfig, state ATNState, semanticContext SemanticContext) *ATNConfig {
+ return NewATNConfig(c, state, c.GetContext(), semanticContext)
+}
+
+// NewATNConfig2 creates a new ATNConfig instance given an existing config, and a context only
+func NewATNConfig2(c *ATNConfig, semanticContext SemanticContext) *ATNConfig {
+ return NewATNConfig(c, c.GetState(), c.GetContext(), semanticContext)
+}
+
+// NewATNConfig1 creates a new ATNConfig instance given an existing config, a state, and a context only
+func NewATNConfig1(c *ATNConfig, state ATNState, context *PredictionContext) *ATNConfig {
+ return NewATNConfig(c, state, context, c.GetSemanticContext())
+}
+
+// NewATNConfig creates a new ATNConfig instance given an existing config, a state, a context and a semantic context, other 'constructors'
+// are just wrappers around this one.
+func NewATNConfig(c *ATNConfig, state ATNState, context *PredictionContext, semanticContext SemanticContext) *ATNConfig {
+ if semanticContext == nil {
+ panic("semanticContext cannot be nil") // TODO: Remove this - probably put here for some bug that is now fixed
+ }
+ b := &ATNConfig{}
+ b.InitATNConfig(c, state, c.GetAlt(), context, semanticContext)
+ b.cType = parserConfig
+ return b
+}
+
+func (a *ATNConfig) InitATNConfig(c *ATNConfig, state ATNState, alt int, context *PredictionContext, semanticContext SemanticContext) {
+
+ a.state = state
+ a.alt = alt
+ a.context = context
+ a.semanticContext = semanticContext
+ a.reachesIntoOuterContext = c.GetReachesIntoOuterContext()
+ a.precedenceFilterSuppressed = c.getPrecedenceFilterSuppressed()
+}
+
+func (a *ATNConfig) getPrecedenceFilterSuppressed() bool {
+ return a.precedenceFilterSuppressed
+}
+
+func (a *ATNConfig) setPrecedenceFilterSuppressed(v bool) {
+ a.precedenceFilterSuppressed = v
+}
+
+// GetState returns the ATN state associated with this configuration
+func (a *ATNConfig) GetState() ATNState {
+ return a.state
+}
+
+// GetAlt returns the alternative associated with this configuration
+func (a *ATNConfig) GetAlt() int {
+ return a.alt
+}
+
+// SetContext sets the rule invocation stack associated with this configuration
+func (a *ATNConfig) SetContext(v *PredictionContext) {
+ a.context = v
+}
+
+// GetContext returns the rule invocation stack associated with this configuration
+func (a *ATNConfig) GetContext() *PredictionContext {
+ return a.context
+}
+
+// GetSemanticContext returns the semantic context associated with this configuration
+func (a *ATNConfig) GetSemanticContext() SemanticContext {
+ return a.semanticContext
+}
+
+// GetReachesIntoOuterContext returns the count of references to an outer context from this configuration
+func (a *ATNConfig) GetReachesIntoOuterContext() int {
+ return a.reachesIntoOuterContext
+}
+
+// SetReachesIntoOuterContext sets the count of references to an outer context from this configuration
+func (a *ATNConfig) SetReachesIntoOuterContext(v int) {
+ a.reachesIntoOuterContext = v
+}
+
+// Equals is the default comparison function for an ATNConfig when no specialist implementation is required
+// for a collection.
+//
+// An ATN configuration is equal to another if both have the same state, they
+// predict the same alternative, and syntactic/semantic contexts are the same.
+func (a *ATNConfig) Equals(o Collectable[*ATNConfig]) bool {
+ switch a.cType {
+ case lexerConfig:
+ return a.LEquals(o)
+ case parserConfig:
+ return a.PEquals(o)
+ default:
+ panic("Invalid ATNConfig type")
+ }
+}
+
+// PEquals is the default comparison function for a Parser ATNConfig when no specialist implementation is required
+// for a collection.
+//
+// An ATN configuration is equal to another if both have the same state, they
+// predict the same alternative, and syntactic/semantic contexts are the same.
+func (a *ATNConfig) PEquals(o Collectable[*ATNConfig]) bool {
+ var other, ok = o.(*ATNConfig)
+
+ if !ok {
+ return false
+ }
+ if a == other {
+ return true
+ } else if other == nil {
+ return false
+ }
+
+ var equal bool
+
+ if a.context == nil {
+ equal = other.context == nil
+ } else {
+ equal = a.context.Equals(other.context)
+ }
+
+ var (
+ nums = a.state.GetStateNumber() == other.state.GetStateNumber()
+ alts = a.alt == other.alt
+ cons = a.semanticContext.Equals(other.semanticContext)
+ sups = a.precedenceFilterSuppressed == other.precedenceFilterSuppressed
+ )
+
+ return nums && alts && cons && sups && equal
+}
+
+// Hash is the default hash function for a parser ATNConfig, when no specialist hash function
+// is required for a collection
+func (a *ATNConfig) Hash() int {
+ switch a.cType {
+ case lexerConfig:
+ return a.LHash()
+ case parserConfig:
+ return a.PHash()
+ default:
+ panic("Invalid ATNConfig type")
+ }
+}
+
+// PHash is the default hash function for a parser ATNConfig, when no specialist hash function
+// is required for a collection
+func (a *ATNConfig) PHash() int {
+ var c int
+ if a.context != nil {
+ c = a.context.Hash()
+ }
+
+ h := murmurInit(7)
+ h = murmurUpdate(h, a.state.GetStateNumber())
+ h = murmurUpdate(h, a.alt)
+ h = murmurUpdate(h, c)
+ h = murmurUpdate(h, a.semanticContext.Hash())
+ return murmurFinish(h, 4)
+}
+
+// String returns a string representation of the ATNConfig, usually used for debugging purposes
+func (a *ATNConfig) String() string {
+ var s1, s2, s3 string
+
+ if a.context != nil {
+ s1 = ",[" + fmt.Sprint(a.context) + "]"
+ }
+
+ if a.semanticContext != SemanticContextNone {
+ s2 = "," + fmt.Sprint(a.semanticContext)
+ }
+
+ if a.reachesIntoOuterContext > 0 {
+ s3 = ",up=" + fmt.Sprint(a.reachesIntoOuterContext)
+ }
+
+ return fmt.Sprintf("(%v,%v%v%v%v)", a.state, a.alt, s1, s2, s3)
+}
+
+func NewLexerATNConfig6(state ATNState, alt int, context *PredictionContext) *ATNConfig {
+ lac := &ATNConfig{}
+ lac.state = state
+ lac.alt = alt
+ lac.context = context
+ lac.semanticContext = SemanticContextNone
+ lac.cType = lexerConfig
+ return lac
+}
+
+func NewLexerATNConfig4(c *ATNConfig, state ATNState) *ATNConfig {
+ lac := &ATNConfig{}
+ lac.lexerActionExecutor = c.lexerActionExecutor
+ lac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state)
+ lac.InitATNConfig(c, state, c.GetAlt(), c.GetContext(), c.GetSemanticContext())
+ lac.cType = lexerConfig
+ return lac
+}
+
+func NewLexerATNConfig3(c *ATNConfig, state ATNState, lexerActionExecutor *LexerActionExecutor) *ATNConfig {
+ lac := &ATNConfig{}
+ lac.lexerActionExecutor = lexerActionExecutor
+ lac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state)
+ lac.InitATNConfig(c, state, c.GetAlt(), c.GetContext(), c.GetSemanticContext())
+ lac.cType = lexerConfig
+ return lac
+}
+
+func NewLexerATNConfig2(c *ATNConfig, state ATNState, context *PredictionContext) *ATNConfig {
+ lac := &ATNConfig{}
+ lac.lexerActionExecutor = c.lexerActionExecutor
+ lac.passedThroughNonGreedyDecision = checkNonGreedyDecision(c, state)
+ lac.InitATNConfig(c, state, c.GetAlt(), context, c.GetSemanticContext())
+ lac.cType = lexerConfig
+ return lac
+}
+
+//goland:noinspection GoUnusedExportedFunction
+func NewLexerATNConfig1(state ATNState, alt int, context *PredictionContext) *ATNConfig {
+ lac := &ATNConfig{}
+ lac.state = state
+ lac.alt = alt
+ lac.context = context
+ lac.semanticContext = SemanticContextNone
+ lac.cType = lexerConfig
+ return lac
+}
+
+// LHash is the default hash function for Lexer ATNConfig objects, it can be used directly or via
+// the default comparator [ObjEqComparator].
+func (a *ATNConfig) LHash() int {
+ var f int
+ if a.passedThroughNonGreedyDecision {
+ f = 1
+ } else {
+ f = 0
+ }
+ h := murmurInit(7)
+ h = murmurUpdate(h, a.state.GetStateNumber())
+ h = murmurUpdate(h, a.alt)
+ h = murmurUpdate(h, a.context.Hash())
+ h = murmurUpdate(h, a.semanticContext.Hash())
+ h = murmurUpdate(h, f)
+ h = murmurUpdate(h, a.lexerActionExecutor.Hash())
+ h = murmurFinish(h, 6)
+ return h
+}
+
+// LEquals is the default comparison function for Lexer ATNConfig objects, it can be used directly or via
+// the default comparator [ObjEqComparator].
+func (a *ATNConfig) LEquals(other Collectable[*ATNConfig]) bool {
+ var otherT, ok = other.(*ATNConfig)
+ if !ok {
+ return false
+ } else if a == otherT {
+ return true
+ } else if a.passedThroughNonGreedyDecision != otherT.passedThroughNonGreedyDecision {
+ return false
+ }
+
+ switch {
+ case a.lexerActionExecutor == nil && otherT.lexerActionExecutor == nil:
+ return true
+ case a.lexerActionExecutor != nil && otherT.lexerActionExecutor != nil:
+ if !a.lexerActionExecutor.Equals(otherT.lexerActionExecutor) {
+ return false
+ }
+ default:
+ return false // One but not both, are nil
+ }
+
+ return a.PEquals(otherT)
+}
+
+func checkNonGreedyDecision(source *ATNConfig, target ATNState) bool {
+ var ds, ok = target.(DecisionState)
+
+ return source.passedThroughNonGreedyDecision || (ok && ds.getNonGreedy())
+}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go b/vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go
new file mode 100644
index 00000000000..52dbaf8064f
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go
@@ -0,0 +1,301 @@
+// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+)
+
+// ATNConfigSet is a specialized set of ATNConfig that tracks information
+// about its elements and can combine similar configurations using a
+// graph-structured stack.
+type ATNConfigSet struct {
+ cachedHash int
+
+ // configLookup is used to determine whether two ATNConfigSets are equal. We
+ // need all configurations with the same (s, i, _, semctx) to be equal. A key
+ // effectively doubles the number of objects associated with ATNConfigs. All
+ // keys are hashed by (s, i, _, pi), not including the context. Wiped out when
+ // read-only because a set becomes a DFA state.
+ configLookup *JStore[*ATNConfig, Comparator[*ATNConfig]]
+
+ // configs is the added elements that did not match an existing key in configLookup
+ configs []*ATNConfig
+
+ // TODO: These fields make me pretty uncomfortable, but it is nice to pack up
+ // info together because it saves re-computation. Can we track conflicts as they
+ // are added to save scanning configs later?
+ conflictingAlts *BitSet
+
+ // dipsIntoOuterContext is used by parsers and lexers. In a lexer, it indicates
+ // we hit a pred while computing a closure operation. Do not make a DFA state
+ // from the ATNConfigSet in this case. TODO: How is this used by parsers?
+ dipsIntoOuterContext bool
+
+ // fullCtx is whether it is part of a full context LL prediction. Used to
+ // determine how to merge $. It is a wildcard with SLL, but not for an LL
+ // context merge.
+ fullCtx bool
+
+ // Used in parser and lexer. In lexer, it indicates we hit a pred
+ // while computing a closure operation. Don't make a DFA state from this set.
+ hasSemanticContext bool
+
+ // readOnly is whether it is read-only. Do not
+ // allow any code to manipulate the set if true because DFA states will point at
+ // sets and those must not change. It not, protect other fields; conflictingAlts
+ // in particular, which is assigned after readOnly.
+ readOnly bool
+
+ // TODO: These fields make me pretty uncomfortable, but it is nice to pack up
+ // info together because it saves re-computation. Can we track conflicts as they
+ // are added to save scanning configs later?
+ uniqueAlt int
+}
+
+// Alts returns the combined set of alts for all the configurations in this set.
+func (b *ATNConfigSet) Alts() *BitSet {
+ alts := NewBitSet()
+ for _, it := range b.configs {
+ alts.add(it.GetAlt())
+ }
+ return alts
+}
+
+// NewATNConfigSet creates a new ATNConfigSet instance.
+func NewATNConfigSet(fullCtx bool) *ATNConfigSet {
+ return &ATNConfigSet{
+ cachedHash: -1,
+ configLookup: NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfCompInst, ATNConfigLookupCollection, "NewATNConfigSet()"),
+ fullCtx: fullCtx,
+ }
+}
+
+// Add merges contexts with existing configs for (s, i, pi, _),
+// where 's' is the ATNConfig.state, 'i' is the ATNConfig.alt, and
+// 'pi' is the [ATNConfig].semanticContext.
+//
+// We use (s,i,pi) as the key.
+// Updates dipsIntoOuterContext and hasSemanticContext when necessary.
+func (b *ATNConfigSet) Add(config *ATNConfig, mergeCache *JPCMap) bool {
+ if b.readOnly {
+ panic("set is read-only")
+ }
+
+ if config.GetSemanticContext() != SemanticContextNone {
+ b.hasSemanticContext = true
+ }
+
+ if config.GetReachesIntoOuterContext() > 0 {
+ b.dipsIntoOuterContext = true
+ }
+
+ existing, present := b.configLookup.Put(config)
+
+ // The config was not already in the set
+ //
+ if !present {
+ b.cachedHash = -1
+ b.configs = append(b.configs, config) // Track order here
+ return true
+ }
+
+ // Merge a previous (s, i, pi, _) with it and save the result
+ rootIsWildcard := !b.fullCtx
+ merged := merge(existing.GetContext(), config.GetContext(), rootIsWildcard, mergeCache)
+
+ // No need to check for existing.context because config.context is in the cache,
+ // since the only way to create new graphs is the "call rule" and here. We cache
+ // at both places.
+ existing.SetReachesIntoOuterContext(intMax(existing.GetReachesIntoOuterContext(), config.GetReachesIntoOuterContext()))
+
+ // Preserve the precedence filter suppression during the merge
+ if config.getPrecedenceFilterSuppressed() {
+ existing.setPrecedenceFilterSuppressed(true)
+ }
+
+ // Replace the context because there is no need to do alt mapping
+ existing.SetContext(merged)
+
+ return true
+}
+
+// GetStates returns the set of states represented by all configurations in this config set
+func (b *ATNConfigSet) GetStates() *JStore[ATNState, Comparator[ATNState]] {
+
+ // states uses the standard comparator and Hash() provided by the ATNState instance
+ //
+ states := NewJStore[ATNState, Comparator[ATNState]](aStateEqInst, ATNStateCollection, "ATNConfigSet.GetStates()")
+
+ for i := 0; i < len(b.configs); i++ {
+ states.Put(b.configs[i].GetState())
+ }
+
+ return states
+}
+
+func (b *ATNConfigSet) GetPredicates() []SemanticContext {
+ predicates := make([]SemanticContext, 0)
+
+ for i := 0; i < len(b.configs); i++ {
+ c := b.configs[i].GetSemanticContext()
+
+ if c != SemanticContextNone {
+ predicates = append(predicates, c)
+ }
+ }
+
+ return predicates
+}
+
+func (b *ATNConfigSet) OptimizeConfigs(interpreter *BaseATNSimulator) {
+ if b.readOnly {
+ panic("set is read-only")
+ }
+
+ // Empty indicate no optimization is possible
+ if b.configLookup == nil || b.configLookup.Len() == 0 {
+ return
+ }
+
+ for i := 0; i < len(b.configs); i++ {
+ config := b.configs[i]
+ config.SetContext(interpreter.getCachedContext(config.GetContext()))
+ }
+}
+
+func (b *ATNConfigSet) AddAll(coll []*ATNConfig) bool {
+ for i := 0; i < len(coll); i++ {
+ b.Add(coll[i], nil)
+ }
+
+ return false
+}
+
+// Compare The configs are only equal if they are in the same order and their Equals function returns true.
+// Java uses ArrayList.equals(), which requires the same order.
+func (b *ATNConfigSet) Compare(bs *ATNConfigSet) bool {
+ if len(b.configs) != len(bs.configs) {
+ return false
+ }
+ for i := 0; i < len(b.configs); i++ {
+ if !b.configs[i].Equals(bs.configs[i]) {
+ return false
+ }
+ }
+
+ return true
+}
+
+func (b *ATNConfigSet) Equals(other Collectable[ATNConfig]) bool {
+ if b == other {
+ return true
+ } else if _, ok := other.(*ATNConfigSet); !ok {
+ return false
+ }
+
+ other2 := other.(*ATNConfigSet)
+ var eca bool
+ switch {
+ case b.conflictingAlts == nil && other2.conflictingAlts == nil:
+ eca = true
+ case b.conflictingAlts != nil && other2.conflictingAlts != nil:
+ eca = b.conflictingAlts.equals(other2.conflictingAlts)
+ }
+ return b.configs != nil &&
+ b.fullCtx == other2.fullCtx &&
+ b.uniqueAlt == other2.uniqueAlt &&
+ eca &&
+ b.hasSemanticContext == other2.hasSemanticContext &&
+ b.dipsIntoOuterContext == other2.dipsIntoOuterContext &&
+ b.Compare(other2)
+}
+
+func (b *ATNConfigSet) Hash() int {
+ if b.readOnly {
+ if b.cachedHash == -1 {
+ b.cachedHash = b.hashCodeConfigs()
+ }
+
+ return b.cachedHash
+ }
+
+ return b.hashCodeConfigs()
+}
+
+func (b *ATNConfigSet) hashCodeConfigs() int {
+ h := 1
+ for _, config := range b.configs {
+ h = 31*h + config.Hash()
+ }
+ return h
+}
+
+func (b *ATNConfigSet) Contains(item *ATNConfig) bool {
+ if b.readOnly {
+ panic("not implemented for read-only sets")
+ }
+ if b.configLookup == nil {
+ return false
+ }
+ return b.configLookup.Contains(item)
+}
+
+func (b *ATNConfigSet) ContainsFast(item *ATNConfig) bool {
+ return b.Contains(item)
+}
+
+func (b *ATNConfigSet) Clear() {
+ if b.readOnly {
+ panic("set is read-only")
+ }
+ b.configs = make([]*ATNConfig, 0)
+ b.cachedHash = -1
+ b.configLookup = NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfCompInst, ATNConfigLookupCollection, "NewATNConfigSet()")
+}
+
+func (b *ATNConfigSet) String() string {
+
+ s := "["
+
+ for i, c := range b.configs {
+ s += c.String()
+
+ if i != len(b.configs)-1 {
+ s += ", "
+ }
+ }
+
+ s += "]"
+
+ if b.hasSemanticContext {
+ s += ",hasSemanticContext=" + fmt.Sprint(b.hasSemanticContext)
+ }
+
+ if b.uniqueAlt != ATNInvalidAltNumber {
+ s += ",uniqueAlt=" + fmt.Sprint(b.uniqueAlt)
+ }
+
+ if b.conflictingAlts != nil {
+ s += ",conflictingAlts=" + b.conflictingAlts.String()
+ }
+
+ if b.dipsIntoOuterContext {
+ s += ",dipsIntoOuterContext"
+ }
+
+ return s
+}
+
+// NewOrderedATNConfigSet creates a config set with a slightly different Hash/Equal pair
+// for use in lexers.
+func NewOrderedATNConfigSet() *ATNConfigSet {
+ return &ATNConfigSet{
+ cachedHash: -1,
+ // This set uses the standard Hash() and Equals() from ATNConfig
+ configLookup: NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ATNConfigCollection, "ATNConfigSet.NewOrderedATNConfigSet()"),
+ fullCtx: false,
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_deserialization_options.go b/vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go
similarity index 86%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_deserialization_options.go
rename to vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go
index 3c975ec7bfd..bdb30b36229 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_deserialization_options.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/atn_deserialization_options.go
@@ -20,7 +20,7 @@ func (opts *ATNDeserializationOptions) ReadOnly() bool {
func (opts *ATNDeserializationOptions) SetReadOnly(readOnly bool) {
if opts.readOnly {
- panic(errors.New("Cannot mutate read only ATNDeserializationOptions"))
+ panic(errors.New("cannot mutate read only ATNDeserializationOptions"))
}
opts.readOnly = readOnly
}
@@ -31,7 +31,7 @@ func (opts *ATNDeserializationOptions) VerifyATN() bool {
func (opts *ATNDeserializationOptions) SetVerifyATN(verifyATN bool) {
if opts.readOnly {
- panic(errors.New("Cannot mutate read only ATNDeserializationOptions"))
+ panic(errors.New("cannot mutate read only ATNDeserializationOptions"))
}
opts.verifyATN = verifyATN
}
@@ -42,11 +42,12 @@ func (opts *ATNDeserializationOptions) GenerateRuleBypassTransitions() bool {
func (opts *ATNDeserializationOptions) SetGenerateRuleBypassTransitions(generateRuleBypassTransitions bool) {
if opts.readOnly {
- panic(errors.New("Cannot mutate read only ATNDeserializationOptions"))
+ panic(errors.New("cannot mutate read only ATNDeserializationOptions"))
}
opts.generateRuleBypassTransitions = generateRuleBypassTransitions
}
+//goland:noinspection GoUnusedExportedFunction
func DefaultATNDeserializationOptions() *ATNDeserializationOptions {
return NewATNDeserializationOptions(&defaultATNDeserializationOptions)
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_deserializer.go b/vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go
similarity index 97%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_deserializer.go
rename to vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go
index 3888856b4b6..2dcb9ae11b6 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_deserializer.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/atn_deserializer.go
@@ -35,6 +35,7 @@ func NewATNDeserializer(options *ATNDeserializationOptions) *ATNDeserializer {
return &ATNDeserializer{options: options}
}
+//goland:noinspection GoUnusedFunction
func stringInSlice(a string, list []string) int {
for i, b := range list {
if b == a {
@@ -193,7 +194,7 @@ func (a *ATNDeserializer) readModes(atn *ATN) {
}
}
-func (a *ATNDeserializer) readSets(atn *ATN, sets []*IntervalSet) []*IntervalSet {
+func (a *ATNDeserializer) readSets(_ *ATN, sets []*IntervalSet) []*IntervalSet {
m := a.readInt()
// Preallocate the needed capacity.
@@ -350,7 +351,7 @@ func (a *ATNDeserializer) generateRuleBypassTransition(atn *ATN, idx int) {
bypassStart.endState = bypassStop
- atn.defineDecisionState(bypassStart.BaseDecisionState)
+ atn.defineDecisionState(&bypassStart.BaseDecisionState)
bypassStop.startState = bypassStart
@@ -450,7 +451,7 @@ func (a *ATNDeserializer) markPrecedenceDecisions(atn *ATN) {
continue
}
- // We analyze the ATN to determine if a ATN decision state is the
+ // We analyze the [ATN] to determine if an ATN decision state is the
// decision for the closure block that determines whether a
// precedence rule should continue or complete.
if atn.ruleToStartState[state.GetRuleIndex()].isPrecedenceRule {
@@ -553,7 +554,7 @@ func (a *ATNDeserializer) readInt() int {
return int(v) // data is 32 bits but int is at least that big
}
-func (a *ATNDeserializer) edgeFactory(atn *ATN, typeIndex, src, trg, arg1, arg2, arg3 int, sets []*IntervalSet) Transition {
+func (a *ATNDeserializer) edgeFactory(atn *ATN, typeIndex, _, trg, arg1, arg2, arg3 int, sets []*IntervalSet) Transition {
target := atn.states[trg]
switch typeIndex {
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_simulator.go b/vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go
similarity index 66%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_simulator.go
rename to vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go
index 41529115fa6..afe6c9f809a 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_simulator.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/atn_simulator.go
@@ -4,7 +4,7 @@
package antlr
-var ATNSimulatorError = NewDFAState(0x7FFFFFFF, NewBaseATNConfigSet(false))
+var ATNSimulatorError = NewDFAState(0x7FFFFFFF, NewATNConfigSet(false))
type IATNSimulator interface {
SharedContextCache() *PredictionContextCache
@@ -18,22 +18,13 @@ type BaseATNSimulator struct {
decisionToDFA []*DFA
}
-func NewBaseATNSimulator(atn *ATN, sharedContextCache *PredictionContextCache) *BaseATNSimulator {
- b := new(BaseATNSimulator)
-
- b.atn = atn
- b.sharedContextCache = sharedContextCache
-
- return b
-}
-
-func (b *BaseATNSimulator) getCachedContext(context PredictionContext) PredictionContext {
+func (b *BaseATNSimulator) getCachedContext(context *PredictionContext) *PredictionContext {
if b.sharedContextCache == nil {
return context
}
- visited := make(map[PredictionContext]PredictionContext)
-
+ //visited := NewJMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionVisitedCollection, "Visit map in getCachedContext()")
+ visited := NewVisitRecord()
return getCachedBasePredictionContext(context, b.sharedContextCache, visited)
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_state.go b/vendor/github.com/antlr4-go/antlr/v4/atn_state.go
similarity index 65%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_state.go
rename to vendor/github.com/antlr4-go/antlr/v4/atn_state.go
index 1f2a56bc311..2ae5807cdb8 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_state.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/atn_state.go
@@ -4,7 +4,11 @@
package antlr
-import "strconv"
+import (
+ "fmt"
+ "os"
+ "strconv"
+)
// Constants for serialization.
const (
@@ -25,6 +29,7 @@ const (
ATNStateInvalidStateNumber = -1
)
+//goland:noinspection GoUnusedGlobalVariable
var ATNStateInitialNumTransitions = 4
type ATNState interface {
@@ -73,7 +78,7 @@ type BaseATNState struct {
transitions []Transition
}
-func NewBaseATNState() *BaseATNState {
+func NewATNState() *BaseATNState {
return &BaseATNState{stateNumber: ATNStateInvalidStateNumber, stateType: ATNStateInvalidType}
}
@@ -148,27 +153,46 @@ func (as *BaseATNState) AddTransition(trans Transition, index int) {
if len(as.transitions) == 0 {
as.epsilonOnlyTransitions = trans.getIsEpsilon()
} else if as.epsilonOnlyTransitions != trans.getIsEpsilon() {
+ _, _ = fmt.Fprintf(os.Stdin, "ATN state %d has both epsilon and non-epsilon transitions.\n", as.stateNumber)
as.epsilonOnlyTransitions = false
}
+ // TODO: Check code for already present compared to the Java equivalent
+ //alreadyPresent := false
+ //for _, t := range as.transitions {
+ // if t.getTarget().GetStateNumber() == trans.getTarget().GetStateNumber() {
+ // if t.getLabel() != nil && trans.getLabel() != nil && trans.getLabel().Equals(t.getLabel()) {
+ // alreadyPresent = true
+ // break
+ // }
+ // } else if t.getIsEpsilon() && trans.getIsEpsilon() {
+ // alreadyPresent = true
+ // break
+ // }
+ //}
+ //if !alreadyPresent {
if index == -1 {
as.transitions = append(as.transitions, trans)
} else {
as.transitions = append(as.transitions[:index], append([]Transition{trans}, as.transitions[index:]...)...)
// TODO: as.transitions.splice(index, 1, trans)
}
+ //} else {
+ // _, _ = fmt.Fprintf(os.Stderr, "Transition already present in state %d\n", as.stateNumber)
+ //}
}
type BasicState struct {
- *BaseATNState
+ BaseATNState
}
func NewBasicState() *BasicState {
- b := NewBaseATNState()
-
- b.stateType = ATNStateBasic
-
- return &BasicState{BaseATNState: b}
+ return &BasicState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateBasic,
+ },
+ }
}
type DecisionState interface {
@@ -182,13 +206,19 @@ type DecisionState interface {
}
type BaseDecisionState struct {
- *BaseATNState
+ BaseATNState
decision int
nonGreedy bool
}
func NewBaseDecisionState() *BaseDecisionState {
- return &BaseDecisionState{BaseATNState: NewBaseATNState(), decision: -1}
+ return &BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateBasic,
+ },
+ decision: -1,
+ }
}
func (s *BaseDecisionState) getDecision() int {
@@ -216,12 +246,20 @@ type BlockStartState interface {
// BaseBlockStartState is the start of a regular (...) block.
type BaseBlockStartState struct {
- *BaseDecisionState
+ BaseDecisionState
endState *BlockEndState
}
func NewBlockStartState() *BaseBlockStartState {
- return &BaseBlockStartState{BaseDecisionState: NewBaseDecisionState()}
+ return &BaseBlockStartState{
+ BaseDecisionState: BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateBasic,
+ },
+ decision: -1,
+ },
+ }
}
func (s *BaseBlockStartState) getEndState() *BlockEndState {
@@ -233,31 +271,38 @@ func (s *BaseBlockStartState) setEndState(b *BlockEndState) {
}
type BasicBlockStartState struct {
- *BaseBlockStartState
+ BaseBlockStartState
}
func NewBasicBlockStartState() *BasicBlockStartState {
- b := NewBlockStartState()
-
- b.stateType = ATNStateBlockStart
-
- return &BasicBlockStartState{BaseBlockStartState: b}
+ return &BasicBlockStartState{
+ BaseBlockStartState: BaseBlockStartState{
+ BaseDecisionState: BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateBlockStart,
+ },
+ },
+ },
+ }
}
var _ BlockStartState = &BasicBlockStartState{}
// BlockEndState is a terminal node of a simple (a|b|c) block.
type BlockEndState struct {
- *BaseATNState
+ BaseATNState
startState ATNState
}
func NewBlockEndState() *BlockEndState {
- b := NewBaseATNState()
-
- b.stateType = ATNStateBlockEnd
-
- return &BlockEndState{BaseATNState: b}
+ return &BlockEndState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateBlockEnd,
+ },
+ startState: nil,
+ }
}
// RuleStopState is the last node in the ATN for a rule, unless that rule is the
@@ -265,43 +310,48 @@ func NewBlockEndState() *BlockEndState {
// encode references to all calls to this rule to compute FOLLOW sets for error
// handling.
type RuleStopState struct {
- *BaseATNState
+ BaseATNState
}
func NewRuleStopState() *RuleStopState {
- b := NewBaseATNState()
-
- b.stateType = ATNStateRuleStop
-
- return &RuleStopState{BaseATNState: b}
+ return &RuleStopState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateRuleStop,
+ },
+ }
}
type RuleStartState struct {
- *BaseATNState
+ BaseATNState
stopState ATNState
isPrecedenceRule bool
}
func NewRuleStartState() *RuleStartState {
- b := NewBaseATNState()
-
- b.stateType = ATNStateRuleStart
-
- return &RuleStartState{BaseATNState: b}
+ return &RuleStartState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateRuleStart,
+ },
+ }
}
// PlusLoopbackState is a decision state for A+ and (A|B)+. It has two
// transitions: one to the loop back to start of the block, and one to exit.
type PlusLoopbackState struct {
- *BaseDecisionState
+ BaseDecisionState
}
func NewPlusLoopbackState() *PlusLoopbackState {
- b := NewBaseDecisionState()
-
- b.stateType = ATNStatePlusLoopBack
-
- return &PlusLoopbackState{BaseDecisionState: b}
+ return &PlusLoopbackState{
+ BaseDecisionState: BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStatePlusLoopBack,
+ },
+ },
+ }
}
// PlusBlockStartState is the start of a (A|B|...)+ loop. Technically it is a
@@ -309,85 +359,103 @@ func NewPlusLoopbackState() *PlusLoopbackState {
// it is included for completeness. In reality, PlusLoopbackState is the real
// decision-making node for A+.
type PlusBlockStartState struct {
- *BaseBlockStartState
+ BaseBlockStartState
loopBackState ATNState
}
func NewPlusBlockStartState() *PlusBlockStartState {
- b := NewBlockStartState()
-
- b.stateType = ATNStatePlusBlockStart
-
- return &PlusBlockStartState{BaseBlockStartState: b}
+ return &PlusBlockStartState{
+ BaseBlockStartState: BaseBlockStartState{
+ BaseDecisionState: BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStatePlusBlockStart,
+ },
+ },
+ },
+ }
}
var _ BlockStartState = &PlusBlockStartState{}
// StarBlockStartState is the block that begins a closure loop.
type StarBlockStartState struct {
- *BaseBlockStartState
+ BaseBlockStartState
}
func NewStarBlockStartState() *StarBlockStartState {
- b := NewBlockStartState()
-
- b.stateType = ATNStateStarBlockStart
-
- return &StarBlockStartState{BaseBlockStartState: b}
+ return &StarBlockStartState{
+ BaseBlockStartState: BaseBlockStartState{
+ BaseDecisionState: BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateStarBlockStart,
+ },
+ },
+ },
+ }
}
var _ BlockStartState = &StarBlockStartState{}
type StarLoopbackState struct {
- *BaseATNState
+ BaseATNState
}
func NewStarLoopbackState() *StarLoopbackState {
- b := NewBaseATNState()
-
- b.stateType = ATNStateStarLoopBack
-
- return &StarLoopbackState{BaseATNState: b}
+ return &StarLoopbackState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateStarLoopBack,
+ },
+ }
}
type StarLoopEntryState struct {
- *BaseDecisionState
+ BaseDecisionState
loopBackState ATNState
precedenceRuleDecision bool
}
func NewStarLoopEntryState() *StarLoopEntryState {
- b := NewBaseDecisionState()
-
- b.stateType = ATNStateStarLoopEntry
-
// False precedenceRuleDecision indicates whether s state can benefit from a precedence DFA during SLL decision making.
- return &StarLoopEntryState{BaseDecisionState: b}
+ return &StarLoopEntryState{
+ BaseDecisionState: BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateStarLoopEntry,
+ },
+ },
+ }
}
// LoopEndState marks the end of a * or + loop.
type LoopEndState struct {
- *BaseATNState
+ BaseATNState
loopBackState ATNState
}
func NewLoopEndState() *LoopEndState {
- b := NewBaseATNState()
-
- b.stateType = ATNStateLoopEnd
-
- return &LoopEndState{BaseATNState: b}
+ return &LoopEndState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateLoopEnd,
+ },
+ }
}
// TokensStartState is the Tokens rule start state linking to each lexer rule start state.
type TokensStartState struct {
- *BaseDecisionState
+ BaseDecisionState
}
func NewTokensStartState() *TokensStartState {
- b := NewBaseDecisionState()
-
- b.stateType = ATNStateTokenStart
-
- return &TokensStartState{BaseDecisionState: b}
+ return &TokensStartState{
+ BaseDecisionState: BaseDecisionState{
+ BaseATNState: BaseATNState{
+ stateNumber: ATNStateInvalidStateNumber,
+ stateType: ATNStateTokenStart,
+ },
+ },
+ }
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_type.go b/vendor/github.com/antlr4-go/antlr/v4/atn_type.go
similarity index 100%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_type.go
rename to vendor/github.com/antlr4-go/antlr/v4/atn_type.go
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/char_stream.go b/vendor/github.com/antlr4-go/antlr/v4/char_stream.go
similarity index 89%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/char_stream.go
rename to vendor/github.com/antlr4-go/antlr/v4/char_stream.go
index c33f0adb5e1..bd8127b6b54 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/char_stream.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/char_stream.go
@@ -8,5 +8,5 @@ type CharStream interface {
IntStream
GetText(int, int) string
GetTextFromTokens(start, end Token) string
- GetTextFromInterval(*Interval) string
+ GetTextFromInterval(Interval) string
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/common_token_factory.go b/vendor/github.com/antlr4-go/antlr/v4/common_token_factory.go
similarity index 100%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/common_token_factory.go
rename to vendor/github.com/antlr4-go/antlr/v4/common_token_factory.go
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/common_token_stream.go b/vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go
similarity index 88%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/common_token_stream.go
rename to vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go
index c6c9485a20a..b75da9df08e 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/common_token_stream.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/common_token_stream.go
@@ -28,22 +28,24 @@ type CommonTokenStream struct {
// trivial with bt field.
fetchedEOF bool
- // index indexs into tokens of the current token (next token to consume).
+ // index into [tokens] of the current token (next token to consume).
// tokens[p] should be LT(1). It is set to -1 when the stream is first
// constructed or when SetTokenSource is called, indicating that the first token
// has not yet been fetched from the token source. For additional information,
- // see the documentation of IntStream for a description of initializing methods.
+ // see the documentation of [IntStream] for a description of initializing methods.
index int
- // tokenSource is the TokenSource from which tokens for the bt stream are
+ // tokenSource is the [TokenSource] from which tokens for the bt stream are
// fetched.
tokenSource TokenSource
- // tokens is all tokens fetched from the token source. The list is considered a
+ // tokens contains all tokens fetched from the token source. The list is considered a
// complete view of the input once fetchedEOF is set to true.
tokens []Token
}
+// NewCommonTokenStream creates a new CommonTokenStream instance using the supplied lexer to produce
+// tokens and will pull tokens from the given lexer channel.
func NewCommonTokenStream(lexer Lexer, channel int) *CommonTokenStream {
return &CommonTokenStream{
channel: channel,
@@ -53,6 +55,7 @@ func NewCommonTokenStream(lexer Lexer, channel int) *CommonTokenStream {
}
}
+// GetAllTokens returns all tokens currently pulled from the token source.
func (c *CommonTokenStream) GetAllTokens() []Token {
return c.tokens
}
@@ -61,9 +64,11 @@ func (c *CommonTokenStream) Mark() int {
return 0
}
-func (c *CommonTokenStream) Release(marker int) {}
+func (c *CommonTokenStream) Release(_ int) {}
-func (c *CommonTokenStream) reset() {
+func (c *CommonTokenStream) Reset() {
+ c.fetchedEOF = false
+ c.tokens = make([]Token, 0)
c.Seek(0)
}
@@ -107,7 +112,7 @@ func (c *CommonTokenStream) Consume() {
// Sync makes sure index i in tokens has a token and returns true if a token is
// located at index i and otherwise false.
func (c *CommonTokenStream) Sync(i int) bool {
- n := i - len(c.tokens) + 1 // TODO: How many more elements do we need?
+ n := i - len(c.tokens) + 1 // How many more elements do we need?
if n > 0 {
fetched := c.fetch(n)
@@ -193,12 +198,13 @@ func (c *CommonTokenStream) SetTokenSource(tokenSource TokenSource) {
c.tokenSource = tokenSource
c.tokens = make([]Token, 0)
c.index = -1
+ c.fetchedEOF = false
}
// NextTokenOnChannel returns the index of the next token on channel given a
// starting index. Returns i if tokens[i] is on channel. Returns -1 if there are
-// no tokens on channel between i and EOF.
-func (c *CommonTokenStream) NextTokenOnChannel(i, channel int) int {
+// no tokens on channel between 'i' and [TokenEOF].
+func (c *CommonTokenStream) NextTokenOnChannel(i, _ int) int {
c.Sync(i)
if i >= len(c.tokens) {
@@ -244,7 +250,7 @@ func (c *CommonTokenStream) GetHiddenTokensToRight(tokenIndex, channel int) []To
nextOnChannel := c.NextTokenOnChannel(tokenIndex+1, LexerDefaultTokenChannel)
from := tokenIndex + 1
- // If no onchannel to the right, then nextOnChannel == -1, so set to to last token
+ // If no onChannel to the right, then nextOnChannel == -1, so set 'to' to the last token
var to int
if nextOnChannel == -1 {
@@ -314,7 +320,8 @@ func (c *CommonTokenStream) Index() int {
}
func (c *CommonTokenStream) GetAllText() string {
- return c.GetTextFromInterval(nil)
+ c.Fill()
+ return c.GetTextFromInterval(NewInterval(0, len(c.tokens)-1))
}
func (c *CommonTokenStream) GetTextFromTokens(start, end Token) string {
@@ -329,15 +336,9 @@ func (c *CommonTokenStream) GetTextFromRuleContext(interval RuleContext) string
return c.GetTextFromInterval(interval.GetSourceInterval())
}
-func (c *CommonTokenStream) GetTextFromInterval(interval *Interval) string {
+func (c *CommonTokenStream) GetTextFromInterval(interval Interval) string {
c.lazyInit()
-
- if interval == nil {
- c.Fill()
- interval = NewInterval(0, len(c.tokens)-1)
- } else {
- c.Sync(interval.Stop)
- }
+ c.Sync(interval.Stop)
start := interval.Start
stop := interval.Stop
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/comparators.go b/vendor/github.com/antlr4-go/antlr/v4/comparators.go
similarity index 82%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/comparators.go
rename to vendor/github.com/antlr4-go/antlr/v4/comparators.go
index 9ea3200536a..7467e9b43db 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/comparators.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/comparators.go
@@ -18,17 +18,20 @@ package antlr
// type safety and avoid having to implement this for every type that we want to perform comparison on.
//
// This comparator works by using the standard Hash() and Equals() methods of the type T that is being compared. Which
-// allows us to use it in any collection instance that does nto require a special hash or equals implementation.
+// allows us to use it in any collection instance that does not require a special hash or equals implementation.
type ObjEqComparator[T Collectable[T]] struct{}
var (
- aStateEqInst = &ObjEqComparator[ATNState]{}
- aConfEqInst = &ObjEqComparator[ATNConfig]{}
- aConfCompInst = &ATNConfigComparator[ATNConfig]{}
- atnConfCompInst = &BaseATNConfigComparator[ATNConfig]{}
+ aStateEqInst = &ObjEqComparator[ATNState]{}
+ aConfEqInst = &ObjEqComparator[*ATNConfig]{}
+
+ // aConfCompInst is the comparator used for the ATNConfigSet for the configLookup cache
+ aConfCompInst = &ATNConfigComparator[*ATNConfig]{}
+ atnConfCompInst = &BaseATNConfigComparator[*ATNConfig]{}
dfaStateEqInst = &ObjEqComparator[*DFAState]{}
semctxEqInst = &ObjEqComparator[SemanticContext]{}
- atnAltCfgEqInst = &ATNAltConfigComparator[ATNConfig]{}
+ atnAltCfgEqInst = &ATNAltConfigComparator[*ATNConfig]{}
+ pContextEqInst = &ObjEqComparator[*PredictionContext]{}
)
// Equals2 delegates to the Equals() method of type T
@@ -44,14 +47,14 @@ func (c *ObjEqComparator[T]) Hash1(o T) int {
type SemCComparator[T Collectable[T]] struct{}
-// ATNConfigComparator is used as the compartor for the configLookup field of an ATNConfigSet
+// ATNConfigComparator is used as the comparator for the configLookup field of an ATNConfigSet
// and has a custom Equals() and Hash() implementation, because equality is not based on the
// standard Hash() and Equals() methods of the ATNConfig type.
type ATNConfigComparator[T Collectable[T]] struct {
}
// Equals2 is a custom comparator for ATNConfigs specifically for configLookup
-func (c *ATNConfigComparator[T]) Equals2(o1, o2 ATNConfig) bool {
+func (c *ATNConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool {
// Same pointer, must be equal, even if both nil
//
@@ -72,7 +75,8 @@ func (c *ATNConfigComparator[T]) Equals2(o1, o2 ATNConfig) bool {
}
// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup
-func (c *ATNConfigComparator[T]) Hash1(o ATNConfig) int {
+func (c *ATNConfigComparator[T]) Hash1(o *ATNConfig) int {
+
hash := 7
hash = 31*hash + o.GetState().GetStateNumber()
hash = 31*hash + o.GetAlt()
@@ -85,7 +89,7 @@ type ATNAltConfigComparator[T Collectable[T]] struct {
}
// Equals2 is a custom comparator for ATNConfigs specifically for configLookup
-func (c *ATNAltConfigComparator[T]) Equals2(o1, o2 ATNConfig) bool {
+func (c *ATNAltConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool {
// Same pointer, must be equal, even if both nil
//
@@ -105,21 +109,21 @@ func (c *ATNAltConfigComparator[T]) Equals2(o1, o2 ATNConfig) bool {
}
// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup
-func (c *ATNAltConfigComparator[T]) Hash1(o ATNConfig) int {
+func (c *ATNAltConfigComparator[T]) Hash1(o *ATNConfig) int {
h := murmurInit(7)
h = murmurUpdate(h, o.GetState().GetStateNumber())
h = murmurUpdate(h, o.GetContext().Hash())
return murmurFinish(h, 2)
}
-// BaseATNConfigComparator is used as the comparator for the configLookup field of a BaseATNConfigSet
+// BaseATNConfigComparator is used as the comparator for the configLookup field of a ATNConfigSet
// and has a custom Equals() and Hash() implementation, because equality is not based on the
// standard Hash() and Equals() methods of the ATNConfig type.
type BaseATNConfigComparator[T Collectable[T]] struct {
}
// Equals2 is a custom comparator for ATNConfigs specifically for baseATNConfigSet
-func (c *BaseATNConfigComparator[T]) Equals2(o1, o2 ATNConfig) bool {
+func (c *BaseATNConfigComparator[T]) Equals2(o1, o2 *ATNConfig) bool {
// Same pointer, must be equal, even if both nil
//
@@ -141,7 +145,6 @@ func (c *BaseATNConfigComparator[T]) Equals2(o1, o2 ATNConfig) bool {
// Hash1 is custom hash implementation for ATNConfigs specifically for configLookup, but in fact just
// delegates to the standard Hash() method of the ATNConfig type.
-func (c *BaseATNConfigComparator[T]) Hash1(o ATNConfig) int {
-
+func (c *BaseATNConfigComparator[T]) Hash1(o *ATNConfig) int {
return o.Hash()
}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/configuration.go b/vendor/github.com/antlr4-go/antlr/v4/configuration.go
new file mode 100644
index 00000000000..c2b724514d4
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/configuration.go
@@ -0,0 +1,214 @@
+package antlr
+
+type runtimeConfiguration struct {
+ statsTraceStacks bool
+ lexerATNSimulatorDebug bool
+ lexerATNSimulatorDFADebug bool
+ parserATNSimulatorDebug bool
+ parserATNSimulatorTraceATNSim bool
+ parserATNSimulatorDFADebug bool
+ parserATNSimulatorRetryDebug bool
+ lRLoopEntryBranchOpt bool
+ memoryManager bool
+}
+
+// Global runtime configuration
+var runtimeConfig = runtimeConfiguration{
+ lRLoopEntryBranchOpt: true,
+}
+
+type runtimeOption func(*runtimeConfiguration) error
+
+// ConfigureRuntime allows the runtime to be configured globally setting things like trace and statistics options.
+// It uses the functional options pattern for go. This is a package global function as it operates on the runtime
+// configuration regardless of the instantiation of anything higher up such as a parser or lexer. Generally this is
+// used for debugging/tracing/statistics options, which are usually used by the runtime maintainers (or rather the
+// only maintainer). However, it is possible that you might want to use this to set a global option concerning the
+// memory allocation type used by the runtime such as sync.Pool or not.
+//
+// The options are applied in the order they are passed in, so the last option will override any previous options.
+//
+// For example, if you want to turn on the collection create point stack flag to true, you can do:
+//
+// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(true))
+//
+// If you want to turn it off, you can do:
+//
+// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(false))
+func ConfigureRuntime(options ...runtimeOption) error {
+ for _, option := range options {
+ err := option(&runtimeConfig)
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// WithStatsTraceStacks sets the global flag indicating whether to collect stack traces at the create-point of
+// certain structs, such as collections, or the use point of certain methods such as Put().
+// Because this can be expensive, it is turned off by default. However, it
+// can be useful to track down exactly where memory is being created and used.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithStatsTraceStacks(false))
+func WithStatsTraceStacks(trace bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.statsTraceStacks = trace
+ return nil
+ }
+}
+
+// WithLexerATNSimulatorDebug sets the global flag indicating whether to log debug information from the lexer [ATN]
+// simulator. This is useful for debugging lexer issues by comparing the output with the Java runtime. Only useful
+// to the runtime maintainers.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDebug(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDebug(false))
+func WithLexerATNSimulatorDebug(debug bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.lexerATNSimulatorDebug = debug
+ return nil
+ }
+}
+
+// WithLexerATNSimulatorDFADebug sets the global flag indicating whether to log debug information from the lexer [ATN] [DFA]
+// simulator. This is useful for debugging lexer issues by comparing the output with the Java runtime. Only useful
+// to the runtime maintainers.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDFADebug(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithLexerATNSimulatorDFADebug(false))
+func WithLexerATNSimulatorDFADebug(debug bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.lexerATNSimulatorDFADebug = debug
+ return nil
+ }
+}
+
+// WithParserATNSimulatorDebug sets the global flag indicating whether to log debug information from the parser [ATN]
+// simulator. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful
+// to the runtime maintainers.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDebug(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDebug(false))
+func WithParserATNSimulatorDebug(debug bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.parserATNSimulatorDebug = debug
+ return nil
+ }
+}
+
+// WithParserATNSimulatorTraceATNSim sets the global flag indicating whether to log trace information from the parser [ATN] simulator
+// [DFA]. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful
+// to the runtime maintainers.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorTraceATNSim(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorTraceATNSim(false))
+func WithParserATNSimulatorTraceATNSim(trace bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.parserATNSimulatorTraceATNSim = trace
+ return nil
+ }
+}
+
+// WithParserATNSimulatorDFADebug sets the global flag indicating whether to log debug information from the parser [ATN] [DFA]
+// simulator. This is useful for debugging parser issues by comparing the output with the Java runtime. Only useful
+// to the runtime maintainers.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDFADebug(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorDFADebug(false))
+func WithParserATNSimulatorDFADebug(debug bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.parserATNSimulatorDFADebug = debug
+ return nil
+ }
+}
+
+// WithParserATNSimulatorRetryDebug sets the global flag indicating whether to log debug information from the parser [ATN] [DFA]
+// simulator when retrying a decision. This is useful for debugging parser issues by comparing the output with the Java runtime.
+// Only useful to the runtime maintainers.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorRetryDebug(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithParserATNSimulatorRetryDebug(false))
+func WithParserATNSimulatorRetryDebug(debug bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.parserATNSimulatorRetryDebug = debug
+ return nil
+ }
+}
+
+// WithLRLoopEntryBranchOpt sets the global flag indicating whether let recursive loop operations should be
+// optimized or not. This is useful for debugging parser issues by comparing the output with the Java runtime.
+// It turns off the functionality of [canDropLoopEntryEdgeInLeftRecursiveRule] in [ParserATNSimulator].
+//
+// Note that default is to use this optimization.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithLRLoopEntryBranchOpt(true))
+//
+// You can turn it off at any time using:
+//
+// antlr.ConfigureRuntime(antlr.WithLRLoopEntryBranchOpt(false))
+func WithLRLoopEntryBranchOpt(off bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.lRLoopEntryBranchOpt = off
+ return nil
+ }
+}
+
+// WithMemoryManager sets the global flag indicating whether to use the memory manager or not. This is useful
+// for poorly constructed grammars that create a lot of garbage. It turns on the functionality of [memoryManager], which
+// will intercept garbage collection and cause available memory to be reused. At the end of the day, this is no substitute
+// for fixing your grammar by ridding yourself of extreme ambiguity. BUt if you are just trying to reuse an opensource
+// grammar, this may help make it more practical.
+//
+// Note that default is to use normal Go memory allocation and not pool memory.
+//
+// Use:
+//
+// antlr.ConfigureRuntime(antlr.WithMemoryManager(true))
+//
+// Note that if you turn this on, you should probably leave it on. You should use only one memory strategy or the other
+// and should remember to nil out any references to the parser or lexer when you are done with them.
+func WithMemoryManager(use bool) runtimeOption {
+ return func(config *runtimeConfiguration) error {
+ config.memoryManager = use
+ return nil
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa.go b/vendor/github.com/antlr4-go/antlr/v4/dfa.go
similarity index 76%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa.go
rename to vendor/github.com/antlr4-go/antlr/v4/dfa.go
index bfd43e1f731..6b63eb1589b 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/dfa.go
@@ -4,6 +4,8 @@
package antlr
+// DFA represents the Deterministic Finite Automaton used by the recognizer, including all the states it can
+// reach and the transitions between them.
type DFA struct {
// atnStartState is the ATN state in which this was created
atnStartState DecisionState
@@ -12,10 +14,9 @@ type DFA struct {
// states is all the DFA states. Use Map to get the old state back; Set can only
// indicate whether it is there. Go maps implement key hash collisions and so on and are very
- // good, but the DFAState is an object and can't be used directly as the key as it can in say JAva
+ // good, but the DFAState is an object and can't be used directly as the key as it can in say Java
// amd C#, whereby if the hashcode is the same for two objects, then Equals() is called against them
- // to see if they really are the same object.
- //
+ // to see if they really are the same object. Hence, we have our own map storage.
//
states *JStore[*DFAState, *ObjEqComparator[*DFAState]]
@@ -32,11 +33,11 @@ func NewDFA(atnStartState DecisionState, decision int) *DFA {
dfa := &DFA{
atnStartState: atnStartState,
decision: decision,
- states: NewJStore[*DFAState, *ObjEqComparator[*DFAState]](dfaStateEqInst),
+ states: nil, // Lazy initialize
}
if s, ok := atnStartState.(*StarLoopEntryState); ok && s.precedenceRuleDecision {
dfa.precedenceDfa = true
- dfa.s0 = NewDFAState(-1, NewBaseATNConfigSet(false))
+ dfa.s0 = NewDFAState(-1, NewATNConfigSet(false))
dfa.s0.isAcceptState = false
dfa.s0.requiresFullContext = false
}
@@ -95,12 +96,11 @@ func (d *DFA) getPrecedenceDfa() bool {
// true or nil otherwise, and d.precedenceDfa is updated.
func (d *DFA) setPrecedenceDfa(precedenceDfa bool) {
if d.getPrecedenceDfa() != precedenceDfa {
- d.states = NewJStore[*DFAState, *ObjEqComparator[*DFAState]](dfaStateEqInst)
+ d.states = nil // Lazy initialize
d.numstates = 0
if precedenceDfa {
- precedenceState := NewDFAState(-1, NewBaseATNConfigSet(false))
-
+ precedenceState := NewDFAState(-1, NewATNConfigSet(false))
precedenceState.setEdges(make([]*DFAState, 0))
precedenceState.isAcceptState = false
precedenceState.requiresFullContext = false
@@ -113,6 +113,31 @@ func (d *DFA) setPrecedenceDfa(precedenceDfa bool) {
}
}
+// Len returns the number of states in d. We use this instead of accessing states directly so that we can implement lazy
+// instantiation of the states JMap.
+func (d *DFA) Len() int {
+ if d.states == nil {
+ return 0
+ }
+ return d.states.Len()
+}
+
+// Get returns a state that matches s if it is present in the DFA state set. We defer to this
+// function instead of accessing states directly so that we can implement lazy instantiation of the states JMap.
+func (d *DFA) Get(s *DFAState) (*DFAState, bool) {
+ if d.states == nil {
+ return nil, false
+ }
+ return d.states.Get(s)
+}
+
+func (d *DFA) Put(s *DFAState) (*DFAState, bool) {
+ if d.states == nil {
+ d.states = NewJStore[*DFAState, *ObjEqComparator[*DFAState]](dfaStateEqInst, DFAStateCollection, "DFA via DFA.Put")
+ }
+ return d.states.Put(s)
+}
+
func (d *DFA) getS0() *DFAState {
return d.s0
}
@@ -121,9 +146,11 @@ func (d *DFA) setS0(s *DFAState) {
d.s0 = s
}
-// sortedStates returns the states in d sorted by their state number.
+// sortedStates returns the states in d sorted by their state number, or an empty set if d.states is nil.
func (d *DFA) sortedStates() []*DFAState {
-
+ if d.states == nil {
+ return []*DFAState{}
+ }
vs := d.states.SortedSlice(func(i, j *DFAState) bool {
return i.stateNumber < j.stateNumber
})
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa_serializer.go b/vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go
similarity index 97%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa_serializer.go
rename to vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go
index 84d0a31e536..0e11009899c 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa_serializer.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/dfa_serializer.go
@@ -10,7 +10,7 @@ import (
"strings"
)
-// DFASerializer is a DFA walker that knows how to dump them to serialized
+// DFASerializer is a DFA walker that knows how to dump the DFA states to serialized
// strings.
type DFASerializer struct {
dfa *DFA
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa_state.go b/vendor/github.com/antlr4-go/antlr/v4/dfa_state.go
similarity index 81%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa_state.go
rename to vendor/github.com/antlr4-go/antlr/v4/dfa_state.go
index c90dec55c86..6541430745f 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/dfa_state.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/dfa_state.go
@@ -22,30 +22,31 @@ func (p *PredPrediction) String() string {
return "(" + fmt.Sprint(p.pred) + ", " + fmt.Sprint(p.alt) + ")"
}
-// DFAState represents a set of possible ATN configurations. As Aho, Sethi,
+// DFAState represents a set of possible [ATN] configurations. As Aho, Sethi,
// Ullman p. 117 says: "The DFA uses its state to keep track of all possible
// states the ATN can be in after reading each input symbol. That is to say,
-// after reading input a1a2..an, the DFA is in a state that represents the
+// after reading input a1, a2,..an, the DFA is in a state that represents the
// subset T of the states of the ATN that are reachable from the ATN's start
-// state along some path labeled a1a2..an." In conventional NFA-to-DFA
-// conversion, therefore, the subset T would be a bitset representing the set of
-// states the ATN could be in. We need to track the alt predicted by each state
+// state along some path labeled a1a2..an."
+//
+// In conventional NFA-to-DFA conversion, therefore, the subset T would be a bitset representing the set of
+// states the [ATN] could be in. We need to track the alt predicted by each state
// as well, however. More importantly, we need to maintain a stack of states,
// tracking the closure operations as they jump from rule to rule, emulating
// rule invocations (method calls). I have to add a stack to simulate the proper
// lookahead sequences for the underlying LL grammar from which the ATN was
// derived.
//
-// I use a set of ATNConfig objects, not simple states. An ATNConfig is both a
-// state (ala normal conversion) and a RuleContext describing the chain of rules
+// I use a set of [ATNConfig] objects, not simple states. An [ATNConfig] is both a
+// state (ala normal conversion) and a [RuleContext] describing the chain of rules
// (if any) followed to arrive at that state.
//
-// A DFAState may have multiple references to a particular state, but with
-// different ATN contexts (with same or different alts) meaning that state was
+// A [DFAState] may have multiple references to a particular state, but with
+// different [ATN] contexts (with same or different alts) meaning that state was
// reached via a different set of rule invocations.
type DFAState struct {
stateNumber int
- configs ATNConfigSet
+ configs *ATNConfigSet
// edges elements point to the target of the symbol. Shift up by 1 so (-1)
// Token.EOF maps to the first element.
@@ -53,7 +54,7 @@ type DFAState struct {
isAcceptState bool
- // prediction is the ttype we match or alt we predict if the state is accept.
+ // prediction is the 'ttype' we match or alt we predict if the state is 'accept'.
// Set to ATN.INVALID_ALT_NUMBER when predicates != nil or
// requiresFullContext.
prediction int
@@ -81,9 +82,9 @@ type DFAState struct {
predicates []*PredPrediction
}
-func NewDFAState(stateNumber int, configs ATNConfigSet) *DFAState {
+func NewDFAState(stateNumber int, configs *ATNConfigSet) *DFAState {
if configs == nil {
- configs = NewBaseATNConfigSet(false)
+ configs = NewATNConfigSet(false)
}
return &DFAState{configs: configs, stateNumber: stateNumber}
@@ -94,7 +95,7 @@ func (d *DFAState) GetAltSet() []int {
var alts []int
if d.configs != nil {
- for _, c := range d.configs.GetItems() {
+ for _, c := range d.configs.configs {
alts = append(alts, c.GetAlt())
}
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/diagnostic_error_listener.go b/vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go
similarity index 92%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/diagnostic_error_listener.go
rename to vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go
index c55bcc19b2c..bd2cd8bc3a8 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/diagnostic_error_listener.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/diagnostic_error_listener.go
@@ -33,6 +33,7 @@ type DiagnosticErrorListener struct {
exactOnly bool
}
+//goland:noinspection GoUnusedExportedFunction
func NewDiagnosticErrorListener(exactOnly bool) *DiagnosticErrorListener {
n := new(DiagnosticErrorListener)
@@ -42,7 +43,7 @@ func NewDiagnosticErrorListener(exactOnly bool) *DiagnosticErrorListener {
return n
}
-func (d *DiagnosticErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
+func (d *DiagnosticErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet) {
if d.exactOnly && !exact {
return
}
@@ -55,7 +56,7 @@ func (d *DiagnosticErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, s
recognizer.NotifyErrorListeners(msg, nil, nil)
}
-func (d *DiagnosticErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet) {
+func (d *DiagnosticErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, _ *BitSet, _ *ATNConfigSet) {
msg := "reportAttemptingFullContext d=" +
d.getDecisionDescription(recognizer, dfa) +
@@ -64,7 +65,7 @@ func (d *DiagnosticErrorListener) ReportAttemptingFullContext(recognizer Parser,
recognizer.NotifyErrorListeners(msg, nil, nil)
}
-func (d *DiagnosticErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet) {
+func (d *DiagnosticErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, _ int, _ *ATNConfigSet) {
msg := "reportContextSensitivity d=" +
d.getDecisionDescription(recognizer, dfa) +
", input='" +
@@ -96,12 +97,12 @@ func (d *DiagnosticErrorListener) getDecisionDescription(recognizer Parser, dfa
// @param configs The conflicting or ambiguous configuration set.
// @return Returns {@code ReportedAlts} if it is not {@code nil}, otherwise
// returns the set of alternatives represented in {@code configs}.
-func (d *DiagnosticErrorListener) getConflictingAlts(ReportedAlts *BitSet, set ATNConfigSet) *BitSet {
+func (d *DiagnosticErrorListener) getConflictingAlts(ReportedAlts *BitSet, set *ATNConfigSet) *BitSet {
if ReportedAlts != nil {
return ReportedAlts
}
result := NewBitSet()
- for _, c := range set.GetItems() {
+ for _, c := range set.configs {
result.add(c.GetAlt())
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/error_listener.go b/vendor/github.com/antlr4-go/antlr/v4/error_listener.go
similarity index 62%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/error_listener.go
rename to vendor/github.com/antlr4-go/antlr/v4/error_listener.go
index f679f0dcd5e..21a0216434e 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/error_listener.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/error_listener.go
@@ -16,28 +16,29 @@ import (
type ErrorListener interface {
SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException)
- ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet)
- ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet)
- ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet)
+ ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet)
+ ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs *ATNConfigSet)
+ ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs *ATNConfigSet)
}
type DefaultErrorListener struct {
}
+//goland:noinspection GoUnusedExportedFunction
func NewDefaultErrorListener() *DefaultErrorListener {
return new(DefaultErrorListener)
}
-func (d *DefaultErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) {
+func (d *DefaultErrorListener) SyntaxError(_ Recognizer, _ interface{}, _, _ int, _ string, _ RecognitionException) {
}
-func (d *DefaultErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
+func (d *DefaultErrorListener) ReportAmbiguity(_ Parser, _ *DFA, _, _ int, _ bool, _ *BitSet, _ *ATNConfigSet) {
}
-func (d *DefaultErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet) {
+func (d *DefaultErrorListener) ReportAttemptingFullContext(_ Parser, _ *DFA, _, _ int, _ *BitSet, _ *ATNConfigSet) {
}
-func (d *DefaultErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet) {
+func (d *DefaultErrorListener) ReportContextSensitivity(_ Parser, _ *DFA, _, _, _ int, _ *ATNConfigSet) {
}
type ConsoleErrorListener struct {
@@ -48,21 +49,16 @@ func NewConsoleErrorListener() *ConsoleErrorListener {
return new(ConsoleErrorListener)
}
-// Provides a default instance of {@link ConsoleErrorListener}.
+// ConsoleErrorListenerINSTANCE provides a default instance of {@link ConsoleErrorListener}.
var ConsoleErrorListenerINSTANCE = NewConsoleErrorListener()
-// {@inheritDoc}
+// SyntaxError prints messages to System.err containing the
+// values of line, charPositionInLine, and msg using
+// the following format:
//
-//
-// This implementation prints messages to {@link System//err} containing the
-// values of {@code line}, {@code charPositionInLine}, and {@code msg} using
-// the following format.
-//
-//
-// line line:charPositionInLine msg
-//
-func (c *ConsoleErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) {
- fmt.Fprintln(os.Stderr, "line "+strconv.Itoa(line)+":"+strconv.Itoa(column)+" "+msg)
+// line :
+func (c *ConsoleErrorListener) SyntaxError(_ Recognizer, _ interface{}, line, column int, msg string, _ RecognitionException) {
+ _, _ = fmt.Fprintln(os.Stderr, "line "+strconv.Itoa(line)+":"+strconv.Itoa(column)+" "+msg)
}
type ProxyErrorListener struct {
@@ -85,19 +81,19 @@ func (p *ProxyErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol
}
}
-func (p *ProxyErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
+func (p *ProxyErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs *ATNConfigSet) {
for _, d := range p.delegates {
d.ReportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs)
}
}
-func (p *ProxyErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet) {
+func (p *ProxyErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs *ATNConfigSet) {
for _, d := range p.delegates {
d.ReportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs)
}
}
-func (p *ProxyErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet) {
+func (p *ProxyErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs *ATNConfigSet) {
for _, d := range p.delegates {
d.ReportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs)
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/error_strategy.go b/vendor/github.com/antlr4-go/antlr/v4/error_strategy.go
similarity index 58%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/error_strategy.go
rename to vendor/github.com/antlr4-go/antlr/v4/error_strategy.go
index 5c0a637ba4a..9db2be1c748 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/error_strategy.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/error_strategy.go
@@ -21,8 +21,8 @@ type ErrorStrategy interface {
ReportMatch(Parser)
}
-// This is the default implementation of {@link ANTLRErrorStrategy} used for
-// error Reporting and recovery in ANTLR parsers.
+// DefaultErrorStrategy is the default implementation of ANTLRErrorStrategy used for
+// error reporting and recovery in ANTLR parsers.
type DefaultErrorStrategy struct {
errorRecoveryMode bool
lastErrorIndex int
@@ -46,7 +46,7 @@ func NewDefaultErrorStrategy() *DefaultErrorStrategy {
// The index into the input stream where the last error occurred.
// This is used to prevent infinite loops where an error is found
// but no token is consumed during recovery...another error is found,
- // ad nauseum. This is a failsafe mechanism to guarantee that at least
+ // ad nauseam. This is a failsafe mechanism to guarantee that at least
// one token/tree node is consumed for two errors.
//
d.lastErrorIndex = -1
@@ -62,50 +62,37 @@ func (d *DefaultErrorStrategy) reset(recognizer Parser) {
// This method is called to enter error recovery mode when a recognition
// exception is Reported.
-//
-// @param recognizer the parser instance
-func (d *DefaultErrorStrategy) beginErrorCondition(recognizer Parser) {
+func (d *DefaultErrorStrategy) beginErrorCondition(_ Parser) {
d.errorRecoveryMode = true
}
-func (d *DefaultErrorStrategy) InErrorRecoveryMode(recognizer Parser) bool {
+func (d *DefaultErrorStrategy) InErrorRecoveryMode(_ Parser) bool {
return d.errorRecoveryMode
}
// This method is called to leave error recovery mode after recovering from
// a recognition exception.
-//
-// @param recognizer
-func (d *DefaultErrorStrategy) endErrorCondition(recognizer Parser) {
+func (d *DefaultErrorStrategy) endErrorCondition(_ Parser) {
d.errorRecoveryMode = false
d.lastErrorStates = nil
d.lastErrorIndex = -1
}
-// {@inheritDoc}
-//
-// The default implementation simply calls {@link //endErrorCondition}.
+// ReportMatch is the default implementation of error matching and simply calls endErrorCondition.
func (d *DefaultErrorStrategy) ReportMatch(recognizer Parser) {
d.endErrorCondition(recognizer)
}
-// {@inheritDoc}
-//
-// The default implementation returns immediately if the handler is already
-// in error recovery mode. Otherwise, it calls {@link //beginErrorCondition}
-// and dispatches the Reporting task based on the runtime type of {@code e}
-// according to the following table.
-//
-//
-// - {@link NoViableAltException}: Dispatches the call to
-// {@link //ReportNoViableAlternative}
-// - {@link InputMisMatchException}: Dispatches the call to
-// {@link //ReportInputMisMatch}
-// - {@link FailedPredicateException}: Dispatches the call to
-// {@link //ReportFailedPredicate}
-// - All other types: calls {@link Parser//NotifyErrorListeners} to Report
-// the exception
-//
+// ReportError is the default implementation of error reporting.
+// It returns immediately if the handler is already
+// in error recovery mode. Otherwise, it calls [beginErrorCondition]
+// and dispatches the Reporting task based on the runtime type of e
+// according to the following table.
+//
+// [NoViableAltException] : Dispatches the call to [ReportNoViableAlternative]
+// [InputMisMatchException] : Dispatches the call to [ReportInputMisMatch]
+// [FailedPredicateException] : Dispatches the call to [ReportFailedPredicate]
+// All other types : Calls [NotifyErrorListeners] to Report the exception
func (d *DefaultErrorStrategy) ReportError(recognizer Parser, e RecognitionException) {
// if we've already Reported an error and have not Matched a token
// yet successfully, don't Report any errors.
@@ -128,12 +115,10 @@ func (d *DefaultErrorStrategy) ReportError(recognizer Parser, e RecognitionExcep
}
}
-// {@inheritDoc}
-//
-// The default implementation reSynchronizes the parser by consuming tokens
-// until we find one in the reSynchronization set--loosely the set of tokens
-// that can follow the current rule.
-func (d *DefaultErrorStrategy) Recover(recognizer Parser, e RecognitionException) {
+// Recover is the default recovery implementation.
+// It reSynchronizes the parser by consuming tokens until we find one in the reSynchronization set -
+// loosely the set of tokens that can follow the current rule.
+func (d *DefaultErrorStrategy) Recover(recognizer Parser, _ RecognitionException) {
if d.lastErrorIndex == recognizer.GetInputStream().Index() &&
d.lastErrorStates != nil && d.lastErrorStates.contains(recognizer.GetState()) {
@@ -148,54 +133,58 @@ func (d *DefaultErrorStrategy) Recover(recognizer Parser, e RecognitionException
d.lastErrorStates = NewIntervalSet()
}
d.lastErrorStates.addOne(recognizer.GetState())
- followSet := d.getErrorRecoverySet(recognizer)
+ followSet := d.GetErrorRecoverySet(recognizer)
d.consumeUntil(recognizer, followSet)
}
-// The default implementation of {@link ANTLRErrorStrategy//Sync} makes sure
-// that the current lookahead symbol is consistent with what were expecting
-// at d point in the ATN. You can call d anytime but ANTLR only
-// generates code to check before subrules/loops and each iteration.
+// Sync is the default implementation of error strategy synchronization.
+//
+// This Sync makes sure that the current lookahead symbol is consistent with what were expecting
+// at this point in the [ATN]. You can call this anytime but ANTLR only
+// generates code to check before sub-rules/loops and each iteration.
//
-// Implements Jim Idle's magic Sync mechanism in closures and optional
-// subrules. E.g.,
+// Implements [Jim Idle]'s magic Sync mechanism in closures and optional
+// sub-rules. E.g.:
//
-//
-// a : Sync ( stuff Sync )*
-// Sync : {consume to what can follow Sync}
-//
+// a : Sync ( stuff Sync )*
+// Sync : {consume to what can follow Sync}
//
-// At the start of a sub rule upon error, {@link //Sync} performs single
+// At the start of a sub-rule upon error, Sync performs single
// token deletion, if possible. If it can't do that, it bails on the current
// rule and uses the default error recovery, which consumes until the
// reSynchronization set of the current rule.
//
-// If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block
-// with an empty alternative), then the expected set includes what follows
-// the subrule.
+// If the sub-rule is optional
+//
+// ({@code (...)?}, {@code (...)*},
//
-// During loop iteration, it consumes until it sees a token that can start a
-// sub rule or what follows loop. Yes, that is pretty aggressive. We opt to
-// stay in the loop as long as possible.
+// or a block with an empty alternative), then the expected set includes what follows
+// the sub-rule.
//
-// ORIGINS
+// During loop iteration, it consumes until it sees a token that can start a
+// sub-rule or what follows loop. Yes, that is pretty aggressive. We opt to
+// stay in the loop as long as possible.
//
-// Previous versions of ANTLR did a poor job of their recovery within loops.
+// # Origins
+//
+// Previous versions of ANTLR did a poor job of their recovery within loops.
// A single mismatch token or missing token would force the parser to bail
-// out of the entire rules surrounding the loop. So, for rule
+// out of the entire rules surrounding the loop. So, for rule:
//
-//
-// classfunc : 'class' ID '{' member* '}'
-//
+// classfunc : 'class' ID '{' member* '}'
//
// input with an extra token between members would force the parser to
// consume until it found the next class definition rather than the next
// member definition of the current class.
//
-// This functionality cost a little bit of effort because the parser has to
-// compare token set at the start of the loop and at each iteration. If for
-// some reason speed is suffering for you, you can turn off d
-// functionality by simply overriding d method as a blank { }.
+// This functionality cost a bit of effort because the parser has to
+// compare the token set at the start of the loop and at each iteration. If for
+// some reason speed is suffering for you, you can turn off this
+// functionality by simply overriding this method as empty:
+//
+// { }
+//
+// [Jim Idle]: https://github.com/jimidle
func (d *DefaultErrorStrategy) Sync(recognizer Parser) {
// If already recovering, don't try to Sync
if d.InErrorRecoveryMode(recognizer) {
@@ -217,25 +206,21 @@ func (d *DefaultErrorStrategy) Sync(recognizer Parser) {
if d.SingleTokenDeletion(recognizer) != nil {
return
}
- panic(NewInputMisMatchException(recognizer))
+ recognizer.SetError(NewInputMisMatchException(recognizer))
case ATNStatePlusLoopBack, ATNStateStarLoopBack:
d.ReportUnwantedToken(recognizer)
expecting := NewIntervalSet()
expecting.addSet(recognizer.GetExpectedTokens())
- whatFollowsLoopIterationOrRule := expecting.addSet(d.getErrorRecoverySet(recognizer))
+ whatFollowsLoopIterationOrRule := expecting.addSet(d.GetErrorRecoverySet(recognizer))
d.consumeUntil(recognizer, whatFollowsLoopIterationOrRule)
default:
// do nothing if we can't identify the exact kind of ATN state
}
}
-// This is called by {@link //ReportError} when the exception is a
-// {@link NoViableAltException}.
-//
-// @see //ReportError
+// ReportNoViableAlternative is called by [ReportError] when the exception is a [NoViableAltException].
//
-// @param recognizer the parser instance
-// @param e the recognition exception
+// See also [ReportError]
func (d *DefaultErrorStrategy) ReportNoViableAlternative(recognizer Parser, e *NoViableAltException) {
tokens := recognizer.GetTokenStream()
var input string
@@ -252,48 +237,38 @@ func (d *DefaultErrorStrategy) ReportNoViableAlternative(recognizer Parser, e *N
recognizer.NotifyErrorListeners(msg, e.offendingToken, e)
}
-// This is called by {@link //ReportError} when the exception is an
-// {@link InputMisMatchException}.
+// ReportInputMisMatch is called by [ReportError] when the exception is an [InputMisMatchException]
//
-// @see //ReportError
-//
-// @param recognizer the parser instance
-// @param e the recognition exception
-func (this *DefaultErrorStrategy) ReportInputMisMatch(recognizer Parser, e *InputMisMatchException) {
- msg := "mismatched input " + this.GetTokenErrorDisplay(e.offendingToken) +
+// See also: [ReportError]
+func (d *DefaultErrorStrategy) ReportInputMisMatch(recognizer Parser, e *InputMisMatchException) {
+ msg := "mismatched input " + d.GetTokenErrorDisplay(e.offendingToken) +
" expecting " + e.getExpectedTokens().StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false)
recognizer.NotifyErrorListeners(msg, e.offendingToken, e)
}
-// This is called by {@link //ReportError} when the exception is a
-// {@link FailedPredicateException}.
-//
-// @see //ReportError
+// ReportFailedPredicate is called by [ReportError] when the exception is a [FailedPredicateException].
//
-// @param recognizer the parser instance
-// @param e the recognition exception
+// See also: [ReportError]
func (d *DefaultErrorStrategy) ReportFailedPredicate(recognizer Parser, e *FailedPredicateException) {
ruleName := recognizer.GetRuleNames()[recognizer.GetParserRuleContext().GetRuleIndex()]
msg := "rule " + ruleName + " " + e.message
recognizer.NotifyErrorListeners(msg, e.offendingToken, e)
}
-// This method is called to Report a syntax error which requires the removal
+// ReportUnwantedToken is called to report a syntax error that requires the removal
// of a token from the input stream. At the time d method is called, the
-// erroneous symbol is current {@code LT(1)} symbol and has not yet been
-// removed from the input stream. When d method returns,
-// {@code recognizer} is in error recovery mode.
+// erroneous symbol is the current LT(1) symbol and has not yet been
+// removed from the input stream. When this method returns,
+// recognizer is in error recovery mode.
//
-// This method is called when {@link //singleTokenDeletion} identifies
+// This method is called when singleTokenDeletion identifies
// single-token deletion as a viable recovery strategy for a mismatched
-// input error.
+// input error.
//
-// The default implementation simply returns if the handler is already in
-// error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to
+// The default implementation simply returns if the handler is already in
+// error recovery mode. Otherwise, it calls beginErrorCondition to
// enter error recovery mode, followed by calling
-// {@link Parser//NotifyErrorListeners}.
-//
-// @param recognizer the parser instance
+// [NotifyErrorListeners]
func (d *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) {
if d.InErrorRecoveryMode(recognizer) {
return
@@ -307,21 +282,18 @@ func (d *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) {
recognizer.NotifyErrorListeners(msg, t, nil)
}
-// This method is called to Report a syntax error which requires the
-// insertion of a missing token into the input stream. At the time d
-// method is called, the missing token has not yet been inserted. When d
-// method returns, {@code recognizer} is in error recovery mode.
+// ReportMissingToken is called to report a syntax error which requires the
+// insertion of a missing token into the input stream. At the time this
+// method is called, the missing token has not yet been inserted. When this
+// method returns, recognizer is in error recovery mode.
//
-// This method is called when {@link //singleTokenInsertion} identifies
+// This method is called when singleTokenInsertion identifies
// single-token insertion as a viable recovery strategy for a mismatched
-// input error.
+// input error.
//
-// The default implementation simply returns if the handler is already in
-// error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to
-// enter error recovery mode, followed by calling
-// {@link Parser//NotifyErrorListeners}.
-//
-// @param recognizer the parser instance
+// The default implementation simply returns if the handler is already in
+// error recovery mode. Otherwise, it calls beginErrorCondition to
+// enter error recovery mode, followed by calling [NotifyErrorListeners]
func (d *DefaultErrorStrategy) ReportMissingToken(recognizer Parser) {
if d.InErrorRecoveryMode(recognizer) {
return
@@ -334,54 +306,48 @@ func (d *DefaultErrorStrategy) ReportMissingToken(recognizer Parser) {
recognizer.NotifyErrorListeners(msg, t, nil)
}
-// The default implementation attempts to recover from the mismatched input
+// The RecoverInline default implementation attempts to recover from the mismatched input
// by using single token insertion and deletion as described below. If the
-// recovery attempt fails, d method panics an
-// {@link InputMisMatchException}.
+// recovery attempt fails, this method panics with [InputMisMatchException}.
+// TODO: Not sure that panic() is the right thing to do here - JI
//
-// EXTRA TOKEN (single token deletion)
+// # EXTRA TOKEN (single token deletion)
//
-// {@code LA(1)} is not what we are looking for. If {@code LA(2)} has the
-// right token, however, then assume {@code LA(1)} is some extra spurious
+// LA(1) is not what we are looking for. If LA(2) has the
+// right token, however, then assume LA(1) is some extra spurious
// token and delete it. Then consume and return the next token (which was
-// the {@code LA(2)} token) as the successful result of the Match operation.
+// the LA(2) token) as the successful result of the Match operation.
//
-// This recovery strategy is implemented by {@link
-// //singleTokenDeletion}.
+// # This recovery strategy is implemented by singleTokenDeletion
//
-// MISSING TOKEN (single token insertion)
+// # MISSING TOKEN (single token insertion)
//
-// If current token (at {@code LA(1)}) is consistent with what could come
-// after the expected {@code LA(1)} token, then assume the token is missing
-// and use the parser's {@link TokenFactory} to create it on the fly. The
-// "insertion" is performed by returning the created token as the successful
-// result of the Match operation.
+// If current token -at LA(1) - is consistent with what could come
+// after the expected LA(1) token, then assume the token is missing
+// and use the parser's [TokenFactory] to create it on the fly. The
+// “insertion” is performed by returning the created token as the successful
+// result of the Match operation.
//
-// This recovery strategy is implemented by {@link
-// //singleTokenInsertion}.
+// This recovery strategy is implemented by [SingleTokenInsertion].
//
-// EXAMPLE
+// # Example
//
-// For example, Input {@code i=(3} is clearly missing the {@code ')'}. When
-// the parser returns from the nested call to {@code expr}, it will have
-// call chain:
+// For example, Input i=(3 is clearly missing the ')'. When
+// the parser returns from the nested call to expr, it will have
+// call the chain:
//
-//
-// stat &rarr expr &rarr atom
-//
+// stat → expr → atom
//
-// and it will be trying to Match the {@code ')'} at d point in the
+// and it will be trying to Match the ')' at this point in the
// derivation:
//
-//
-// => ID '=' '(' INT ')' ('+' atom)* ”
-// ^
-//
+// : ID '=' '(' INT ')' ('+' atom)* ';'
+// ^
//
-// The attempt to Match {@code ')'} will fail when it sees {@code ”} and
-// call {@link //recoverInline}. To recover, it sees that {@code LA(1)==”}
-// is in the set of tokens that can follow the {@code ')'} token reference
-// in rule {@code atom}. It can assume that you forgot the {@code ')'}.
+// The attempt to [Match] ')' will fail when it sees ';' and
+// call [RecoverInline]. To recover, it sees that LA(1)==';'
+// is in the set of tokens that can follow the ')' token reference
+// in rule atom. It can assume that you forgot the ')'.
func (d *DefaultErrorStrategy) RecoverInline(recognizer Parser) Token {
// SINGLE TOKEN DELETION
MatchedSymbol := d.SingleTokenDeletion(recognizer)
@@ -396,24 +362,24 @@ func (d *DefaultErrorStrategy) RecoverInline(recognizer Parser) Token {
return d.GetMissingSymbol(recognizer)
}
// even that didn't work must panic the exception
- panic(NewInputMisMatchException(recognizer))
+ recognizer.SetError(NewInputMisMatchException(recognizer))
+ return nil
}
-// This method implements the single-token insertion inline error recovery
-// strategy. It is called by {@link //recoverInline} if the single-token
+// SingleTokenInsertion implements the single-token insertion inline error recovery
+// strategy. It is called by [RecoverInline] if the single-token
// deletion strategy fails to recover from the mismatched input. If this
// method returns {@code true}, {@code recognizer} will be in error recovery
// mode.
//
-// This method determines whether or not single-token insertion is viable by
-// checking if the {@code LA(1)} input symbol could be successfully Matched
-// if it were instead the {@code LA(2)} symbol. If d method returns
+// This method determines whether single-token insertion is viable by
+// checking if the LA(1) input symbol could be successfully Matched
+// if it were instead the LA(2) symbol. If this method returns
// {@code true}, the caller is responsible for creating and inserting a
-// token with the correct type to produce d behavior.
+// token with the correct type to produce this behavior.
//
-// @param recognizer the parser instance
-// @return {@code true} if single-token insertion is a viable recovery
-// strategy for the current mismatched input, otherwise {@code false}
+// This func returns true if single-token insertion is a viable recovery
+// strategy for the current mismatched input.
func (d *DefaultErrorStrategy) SingleTokenInsertion(recognizer Parser) bool {
currentSymbolType := recognizer.GetTokenStream().LA(1)
// if current token is consistent with what could come after current
@@ -431,23 +397,21 @@ func (d *DefaultErrorStrategy) SingleTokenInsertion(recognizer Parser) bool {
return false
}
-// This method implements the single-token deletion inline error recovery
-// strategy. It is called by {@link //recoverInline} to attempt to recover
+// SingleTokenDeletion implements the single-token deletion inline error recovery
+// strategy. It is called by [RecoverInline] to attempt to recover
// from mismatched input. If this method returns nil, the parser and error
// handler state will not have changed. If this method returns non-nil,
-// {@code recognizer} will not be in error recovery mode since the
+// recognizer will not be in error recovery mode since the
// returned token was a successful Match.
//
-// If the single-token deletion is successful, d method calls
-// {@link //ReportUnwantedToken} to Report the error, followed by
-// {@link Parser//consume} to actually "delete" the extraneous token. Then,
-// before returning {@link //ReportMatch} is called to signal a successful
-// Match.
+// If the single-token deletion is successful, this method calls
+// [ReportUnwantedToken] to Report the error, followed by
+// [Consume] to actually “delete” the extraneous token. Then,
+// before returning, [ReportMatch] is called to signal a successful
+// Match.
//
-// @param recognizer the parser instance
-// @return the successfully Matched {@link Token} instance if single-token
-// deletion successfully recovers from the mismatched input, otherwise
-// {@code nil}
+// The func returns the successfully Matched [Token] instance if single-token
+// deletion successfully recovers from the mismatched input, otherwise nil.
func (d *DefaultErrorStrategy) SingleTokenDeletion(recognizer Parser) Token {
NextTokenType := recognizer.GetTokenStream().LA(2)
expecting := d.GetExpectedTokens(recognizer)
@@ -467,24 +431,28 @@ func (d *DefaultErrorStrategy) SingleTokenDeletion(recognizer Parser) Token {
return nil
}
-// Conjure up a missing token during error recovery.
+// GetMissingSymbol conjures up a missing token during error recovery.
//
// The recognizer attempts to recover from single missing
// symbols. But, actions might refer to that missing symbol.
-// For example, x=ID {f($x)}. The action clearly assumes
+// For example:
+//
+// x=ID {f($x)}.
+//
+// The action clearly assumes
// that there has been an identifier Matched previously and that
// $x points at that token. If that token is missing, but
// the next token in the stream is what we want we assume that
-// d token is missing and we keep going. Because we
+// this token is missing, and we keep going. Because we
// have to return some token to replace the missing token,
// we have to conjure one up. This method gives the user control
// over the tokens returned for missing tokens. Mostly,
// you will want to create something special for identifier
// tokens. For literals such as '{' and ',', the default
// action in the parser or tree parser works. It simply creates
-// a CommonToken of the appropriate type. The text will be the token.
-// If you change what tokens must be created by the lexer,
-// override d method to create the appropriate tokens.
+// a [CommonToken] of the appropriate type. The text will be the token name.
+// If you need to change which tokens must be created by the lexer,
+// override this method to create the appropriate tokens.
func (d *DefaultErrorStrategy) GetMissingSymbol(recognizer Parser) Token {
currentSymbol := recognizer.GetCurrentToken()
expecting := d.GetExpectedTokens(recognizer)
@@ -498,7 +466,7 @@ func (d *DefaultErrorStrategy) GetMissingSymbol(recognizer Parser) Token {
if expectedTokenType > 0 && expectedTokenType < len(ln) {
tokenText = ""
} else {
- tokenText = "" // TODO matches the JS impl
+ tokenText = "" // TODO: matches the JS impl
}
}
current := currentSymbol
@@ -516,13 +484,13 @@ func (d *DefaultErrorStrategy) GetExpectedTokens(recognizer Parser) *IntervalSet
return recognizer.GetExpectedTokens()
}
-// How should a token be displayed in an error message? The default
-// is to display just the text, but during development you might
-// want to have a lot of information spit out. Override in that case
-// to use t.String() (which, for CommonToken, dumps everything about
+// GetTokenErrorDisplay determines how a token should be displayed in an error message.
+// The default is to display just the text, but during development you might
+// want to have a lot of information spit out. Override this func in that case
+// to use t.String() (which, for [CommonToken], dumps everything about
// the token). This is better than forcing you to override a method in
// your token objects because you don't have to go modify your lexer
-// so that it creates a NewJava type.
+// so that it creates a new type.
func (d *DefaultErrorStrategy) GetTokenErrorDisplay(t Token) string {
if t == nil {
return ""
@@ -545,52 +513,57 @@ func (d *DefaultErrorStrategy) escapeWSAndQuote(s string) string {
return "'" + s + "'"
}
-// Compute the error recovery set for the current rule. During
+// GetErrorRecoverySet computes the error recovery set for the current rule. During
// rule invocation, the parser pushes the set of tokens that can
-// follow that rule reference on the stack d amounts to
+// follow that rule reference on the stack. This amounts to
// computing FIRST of what follows the rule reference in the
// enclosing rule. See LinearApproximator.FIRST().
+//
// This local follow set only includes tokens
// from within the rule i.e., the FIRST computation done by
// ANTLR stops at the end of a rule.
//
-// # EXAMPLE
+// # Example
//
// When you find a "no viable alt exception", the input is not
// consistent with any of the alternatives for rule r. The best
// thing to do is to consume tokens until you see something that
-// can legally follow a call to r//or* any rule that called r.
+// can legally follow a call to r or any rule that called r.
// You don't want the exact set of viable next tokens because the
// input might just be missing a token--you might consume the
// rest of the input looking for one of the missing tokens.
//
-// Consider grammar:
+// Consider the grammar:
+//
+// a : '[' b ']'
+// | '(' b ')'
+// ;
//
-// a : '[' b ']'
-// | '(' b ')'
+// b : c '^' INT
+// ;
//
-// b : c '^' INT
-// c : ID
-// | INT
+// c : ID
+// | INT
+// ;
//
// At each rule invocation, the set of tokens that could follow
// that rule is pushed on a stack. Here are the various
// context-sensitive follow sets:
//
-// FOLLOW(b1_in_a) = FIRST(']') = ']'
-// FOLLOW(b2_in_a) = FIRST(')') = ')'
-// FOLLOW(c_in_b) = FIRST('^') = '^'
+// FOLLOW(b1_in_a) = FIRST(']') = ']'
+// FOLLOW(b2_in_a) = FIRST(')') = ')'
+// FOLLOW(c_in_b) = FIRST('^') = '^'
//
-// Upon erroneous input "[]", the call chain is
+// Upon erroneous input “[]”, the call chain is
//
-// a -> b -> c
+// a → b → c
//
// and, hence, the follow context stack is:
//
-// depth follow set start of rule execution
-// 0 a (from main())
-// 1 ']' b
-// 2 '^' c
+// Depth Follow set Start of rule execution
+// 0 a (from main())
+// 1 ']' b
+// 2 '^' c
//
// Notice that ')' is not included, because b would have to have
// been called from a different context in rule a for ')' to be
@@ -598,11 +571,14 @@ func (d *DefaultErrorStrategy) escapeWSAndQuote(s string) string {
//
// For error recovery, we cannot consider FOLLOW(c)
// (context-sensitive or otherwise). We need the combined set of
-// all context-sensitive FOLLOW sets--the set of all tokens that
+// all context-sensitive FOLLOW sets - the set of all tokens that
// could follow any reference in the call chain. We need to
// reSync to one of those tokens. Note that FOLLOW(c)='^' and if
// we reSync'd to that token, we'd consume until EOF. We need to
-// Sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}.
+// Sync to context-sensitive FOLLOWs for a, b, and c:
+//
+// {']','^'}
+//
// In this case, for input "[]", LA(1) is ']' and in the set, so we would
// not consume anything. After printing an error, rule c would
// return normally. Rule b would not find the required '^' though.
@@ -620,22 +596,19 @@ func (d *DefaultErrorStrategy) escapeWSAndQuote(s string) string {
//
// ANTLR's error recovery mechanism is based upon original ideas:
//
-// "Algorithms + Data Structures = Programs" by Niklaus Wirth
-//
-// and
-//
-// "A note on error recovery in recursive descent parsers":
-// http://portal.acm.org/citation.cfm?id=947902.947905
+// [Algorithms + Data Structures = Programs] by Niklaus Wirth and
+// [A note on error recovery in recursive descent parsers].
//
-// Later, Josef Grosch had some good ideas:
+// Later, Josef Grosch had some good ideas in [Efficient and Comfortable Error Recovery in Recursive Descent
+// Parsers]
//
-// "Efficient and Comfortable Error Recovery in Recursive Descent
-// Parsers":
-// ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip
+// Like Grosch I implement context-sensitive FOLLOW sets that are combined at run-time upon error to avoid overhead
+// during parsing. Later, the runtime Sync was improved for loops/sub-rules see [Sync] docs
//
-// Like Grosch I implement context-sensitive FOLLOW sets that are combined
-// at run-time upon error to avoid overhead during parsing.
-func (d *DefaultErrorStrategy) getErrorRecoverySet(recognizer Parser) *IntervalSet {
+// [A note on error recovery in recursive descent parsers]: http://portal.acm.org/citation.cfm?id=947902.947905
+// [Algorithms + Data Structures = Programs]: https://t.ly/5QzgE
+// [Efficient and Comfortable Error Recovery in Recursive Descent Parsers]: ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip
+func (d *DefaultErrorStrategy) GetErrorRecoverySet(recognizer Parser) *IntervalSet {
atn := recognizer.GetInterpreter().atn
ctx := recognizer.GetParserRuleContext()
recoverSet := NewIntervalSet()
@@ -660,40 +633,36 @@ func (d *DefaultErrorStrategy) consumeUntil(recognizer Parser, set *IntervalSet)
}
}
-//
-// This implementation of {@link ANTLRErrorStrategy} responds to syntax errors
+// The BailErrorStrategy implementation of ANTLRErrorStrategy responds to syntax errors
// by immediately canceling the parse operation with a
-// {@link ParseCancellationException}. The implementation ensures that the
-// {@link ParserRuleContext//exception} field is set for all parse tree nodes
+// [ParseCancellationException]. The implementation ensures that the
+// [ParserRuleContext//exception] field is set for all parse tree nodes
// that were not completed prior to encountering the error.
//
-//
-// This error strategy is useful in the following scenarios.
+// This error strategy is useful in the following scenarios.
//
-//
-// - Two-stage parsing: This error strategy allows the first
-// stage of two-stage parsing to immediately terminate if an error is
-// encountered, and immediately fall back to the second stage. In addition to
-// avoiding wasted work by attempting to recover from errors here, the empty
-// implementation of {@link BailErrorStrategy//Sync} improves the performance of
-// the first stage.
-// - Silent validation: When syntax errors are not being
-// Reported or logged, and the parse result is simply ignored if errors occur,
-// the {@link BailErrorStrategy} avoids wasting work on recovering from errors
-// when the result will be ignored either way.
-//
+// - Two-stage parsing: This error strategy allows the first
+// stage of two-stage parsing to immediately terminate if an error is
+// encountered, and immediately fall back to the second stage. In addition to
+// avoiding wasted work by attempting to recover from errors here, the empty
+// implementation of [BailErrorStrategy.Sync] improves the performance of
+// the first stage.
//
-//
-// {@code myparser.setErrorHandler(NewBailErrorStrategy())}
+// - Silent validation: When syntax errors are not being
+// Reported or logged, and the parse result is simply ignored if errors occur,
+// the [BailErrorStrategy] avoids wasting work on recovering from errors
+// when the result will be ignored either way.
//
-// @see Parser//setErrorHandler(ANTLRErrorStrategy)
-
+// myparser.SetErrorHandler(NewBailErrorStrategy())
+//
+// See also: [Parser.SetErrorHandler(ANTLRErrorStrategy)]
type BailErrorStrategy struct {
*DefaultErrorStrategy
}
var _ ErrorStrategy = &BailErrorStrategy{}
+//goland:noinspection GoUnusedExportedFunction
func NewBailErrorStrategy() *BailErrorStrategy {
b := new(BailErrorStrategy)
@@ -703,10 +672,10 @@ func NewBailErrorStrategy() *BailErrorStrategy {
return b
}
-// Instead of recovering from exception {@code e}, re-panic it wrapped
-// in a {@link ParseCancellationException} so it is not caught by the
-// rule func catches. Use {@link Exception//getCause()} to get the
-// original {@link RecognitionException}.
+// Recover Instead of recovering from exception e, re-panic it wrapped
+// in a [ParseCancellationException] so it is not caught by the
+// rule func catches. Use Exception.GetCause() to get the
+// original [RecognitionException].
func (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) {
context := recognizer.GetParserRuleContext()
for context != nil {
@@ -717,10 +686,10 @@ func (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) {
context = nil
}
}
- panic(NewParseCancellationException()) // TODO we don't emit e properly
+ recognizer.SetError(NewParseCancellationException()) // TODO: we don't emit e properly
}
-// Make sure we don't attempt to recover inline if the parser
+// RecoverInline makes sure we don't attempt to recover inline if the parser
// successfully recovers, it won't panic an exception.
func (b *BailErrorStrategy) RecoverInline(recognizer Parser) Token {
b.Recover(recognizer, NewInputMisMatchException(recognizer))
@@ -728,7 +697,6 @@ func (b *BailErrorStrategy) RecoverInline(recognizer Parser) Token {
return nil
}
-// Make sure we don't attempt to recover from problems in subrules.//
-func (b *BailErrorStrategy) Sync(recognizer Parser) {
- // pass
+// Sync makes sure we don't attempt to recover from problems in sub-rules.
+func (b *BailErrorStrategy) Sync(_ Parser) {
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/errors.go b/vendor/github.com/antlr4-go/antlr/v4/errors.go
similarity index 73%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/errors.go
rename to vendor/github.com/antlr4-go/antlr/v4/errors.go
index 3954c137829..8f0f2f601fd 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/errors.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/errors.go
@@ -35,7 +35,7 @@ func NewBaseRecognitionException(message string, recognizer Recognizer, input In
// } else {
// stack := NewError().stack
// }
- // TODO may be able to use - "runtime" func Stack(buf []byte, all bool) int
+ // TODO: may be able to use - "runtime" func Stack(buf []byte, all bool) int
t := new(BaseRecognitionException)
@@ -43,15 +43,17 @@ func NewBaseRecognitionException(message string, recognizer Recognizer, input In
t.recognizer = recognizer
t.input = input
t.ctx = ctx
- // The current {@link Token} when an error occurred. Since not all streams
+
+ // The current Token when an error occurred. Since not all streams
// support accessing symbols by index, we have to track the {@link Token}
// instance itself.
+ //
t.offendingToken = nil
+
// Get the ATN state number the parser was in at the time the error
- // occurred. For {@link NoViableAltException} and
- // {@link LexerNoViableAltException} exceptions, this is the
- // {@link DecisionState} number. For others, it is the state whose outgoing
- // edge we couldn't Match.
+ // occurred. For NoViableAltException and LexerNoViableAltException exceptions, this is the
+ // DecisionState number. For others, it is the state whose outgoing edge we couldn't Match.
+ //
t.offendingState = -1
if t.recognizer != nil {
t.offendingState = t.recognizer.GetState()
@@ -74,15 +76,15 @@ func (b *BaseRecognitionException) GetInputStream() IntStream {
// If the state number is not known, b method returns -1.
-// Gets the set of input symbols which could potentially follow the
-// previously Matched symbol at the time b exception was panicn.
+// getExpectedTokens gets the set of input symbols which could potentially follow the
+// previously Matched symbol at the time this exception was raised.
//
-// If the set of expected tokens is not known and could not be computed,
-// b method returns {@code nil}.
+// If the set of expected tokens is not known and could not be computed,
+// this method returns nil.
//
-// @return The set of token types that could potentially follow the current
-// state in the ATN, or {@code nil} if the information is not available.
-// /
+// The func returns the set of token types that could potentially follow the current
+// state in the {ATN}, or nil if the information is not available.
+
func (b *BaseRecognitionException) getExpectedTokens() *IntervalSet {
if b.recognizer != nil {
return b.recognizer.GetATN().getExpectedTokens(b.offendingState, b.ctx)
@@ -99,10 +101,10 @@ type LexerNoViableAltException struct {
*BaseRecognitionException
startIndex int
- deadEndConfigs ATNConfigSet
+ deadEndConfigs *ATNConfigSet
}
-func NewLexerNoViableAltException(lexer Lexer, input CharStream, startIndex int, deadEndConfigs ATNConfigSet) *LexerNoViableAltException {
+func NewLexerNoViableAltException(lexer Lexer, input CharStream, startIndex int, deadEndConfigs *ATNConfigSet) *LexerNoViableAltException {
l := new(LexerNoViableAltException)
@@ -128,14 +130,16 @@ type NoViableAltException struct {
startToken Token
offendingToken Token
ctx ParserRuleContext
- deadEndConfigs ATNConfigSet
+ deadEndConfigs *ATNConfigSet
}
-// Indicates that the parser could not decide which of two or more paths
+// NewNoViableAltException creates an exception indicating that the parser could not decide which of two or more paths
// to take based upon the remaining input. It tracks the starting token
// of the offending input and also knows where the parser was
-// in the various paths when the error. Reported by ReportNoViableAlternative()
-func NewNoViableAltException(recognizer Parser, input TokenStream, startToken Token, offendingToken Token, deadEndConfigs ATNConfigSet, ctx ParserRuleContext) *NoViableAltException {
+// in the various paths when the error.
+//
+// Reported by [ReportNoViableAlternative]
+func NewNoViableAltException(recognizer Parser, input TokenStream, startToken Token, offendingToken Token, deadEndConfigs *ATNConfigSet, ctx ParserRuleContext) *NoViableAltException {
if ctx == nil {
ctx = recognizer.GetParserRuleContext()
@@ -157,12 +161,14 @@ func NewNoViableAltException(recognizer Parser, input TokenStream, startToken To
n.BaseRecognitionException = NewBaseRecognitionException("", recognizer, input, ctx)
// Which configurations did we try at input.Index() that couldn't Match
- // input.LT(1)?//
+ // input.LT(1)
n.deadEndConfigs = deadEndConfigs
+
// The token object at the start index the input stream might
- // not be buffering tokens so get a reference to it. (At the
- // time the error occurred, of course the stream needs to keep a
- // buffer all of the tokens but later we might not have access to those.)
+ // not be buffering tokens so get a reference to it.
+ //
+ // At the time the error occurred, of course the stream needs to keep a
+ // buffer of all the tokens, but later we might not have access to those.
n.startToken = startToken
n.offendingToken = offendingToken
@@ -173,7 +179,7 @@ type InputMisMatchException struct {
*BaseRecognitionException
}
-// This signifies any kind of mismatched input exceptions such as
+// NewInputMisMatchException creates an exception that signifies any kind of mismatched input exceptions such as
// when the current input does not Match the expected token.
func NewInputMisMatchException(recognizer Parser) *InputMisMatchException {
@@ -186,11 +192,10 @@ func NewInputMisMatchException(recognizer Parser) *InputMisMatchException {
}
-// A semantic predicate failed during validation. Validation of predicates
+// FailedPredicateException indicates that a semantic predicate failed during validation. Validation of predicates
// occurs when normally parsing the alternative just like Matching a token.
// Disambiguating predicate evaluation occurs when we test a predicate during
// prediction.
-
type FailedPredicateException struct {
*BaseRecognitionException
@@ -199,6 +204,7 @@ type FailedPredicateException struct {
predicate string
}
+//goland:noinspection GoUnusedExportedFunction
func NewFailedPredicateException(recognizer Parser, predicate string, message string) *FailedPredicateException {
f := new(FailedPredicateException)
@@ -231,6 +237,21 @@ func (f *FailedPredicateException) formatMessage(predicate, message string) stri
type ParseCancellationException struct {
}
+func (p ParseCancellationException) GetOffendingToken() Token {
+ //TODO implement me
+ panic("implement me")
+}
+
+func (p ParseCancellationException) GetMessage() string {
+ //TODO implement me
+ panic("implement me")
+}
+
+func (p ParseCancellationException) GetInputStream() IntStream {
+ //TODO implement me
+ panic("implement me")
+}
+
func NewParseCancellationException() *ParseCancellationException {
// Error.call(this)
// Error.captureStackTrace(this, ParseCancellationException)
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/file_stream.go b/vendor/github.com/antlr4-go/antlr/v4/file_stream.go
similarity index 52%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/file_stream.go
rename to vendor/github.com/antlr4-go/antlr/v4/file_stream.go
index bd6ad5efe3d..5f65f809be5 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/file_stream.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/file_stream.go
@@ -5,8 +5,7 @@
package antlr
import (
- "bytes"
- "io"
+ "bufio"
"os"
)
@@ -14,34 +13,53 @@ import (
// when you construct the object.
type FileStream struct {
- *InputStream
-
+ InputStream
filename string
}
+//goland:noinspection GoUnusedExportedFunction
func NewFileStream(fileName string) (*FileStream, error) {
- buf := bytes.NewBuffer(nil)
-
f, err := os.Open(fileName)
if err != nil {
return nil, err
}
- defer f.Close()
- _, err = io.Copy(buf, f)
+
+ defer func(f *os.File) {
+ errF := f.Close()
+ if errF != nil {
+ }
+ }(f)
+
+ reader := bufio.NewReader(f)
+ fInfo, err := f.Stat()
if err != nil {
return nil, err
}
- fs := new(FileStream)
-
- fs.filename = fileName
- s := string(buf.Bytes())
+ fs := &FileStream{
+ InputStream: InputStream{
+ index: 0,
+ name: fileName,
+ },
+ filename: fileName,
+ }
- fs.InputStream = NewInputStream(s)
+ // Pre-build the buffer and read runes efficiently
+ //
+ fs.data = make([]rune, 0, fInfo.Size())
+ for {
+ r, _, err := reader.ReadRune()
+ if err != nil {
+ break
+ }
+ fs.data = append(fs.data, r)
+ }
+ fs.size = len(fs.data) // Size in runes
+ // All done.
+ //
return fs, nil
-
}
func (f *FileStream) GetSourceName() string {
diff --git a/vendor/github.com/antlr4-go/antlr/v4/input_stream.go b/vendor/github.com/antlr4-go/antlr/v4/input_stream.go
new file mode 100644
index 00000000000..b737fe85fbd
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/input_stream.go
@@ -0,0 +1,157 @@
+// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "bufio"
+ "io"
+)
+
+type InputStream struct {
+ name string
+ index int
+ data []rune
+ size int
+}
+
+// NewIoStream creates a new input stream from the given io.Reader reader.
+// Note that the reader is read completely into memory and so it must actually
+// have a stopping point - you cannot pass in a reader on an open-ended source such
+// as a socket for instance.
+func NewIoStream(reader io.Reader) *InputStream {
+
+ rReader := bufio.NewReader(reader)
+
+ is := &InputStream{
+ name: "",
+ index: 0,
+ }
+
+ // Pre-build the buffer and read runes reasonably efficiently given that
+ // we don't exactly know how big the input is.
+ //
+ is.data = make([]rune, 0, 512)
+ for {
+ r, _, err := rReader.ReadRune()
+ if err != nil {
+ break
+ }
+ is.data = append(is.data, r)
+ }
+ is.size = len(is.data) // number of runes
+ return is
+}
+
+// NewInputStream creates a new input stream from the given string
+func NewInputStream(data string) *InputStream {
+
+ is := &InputStream{
+ name: "",
+ index: 0,
+ data: []rune(data), // This is actually the most efficient way
+ }
+ is.size = len(is.data) // number of runes, but we could also use len(data), which is efficient too
+ return is
+}
+
+func (is *InputStream) reset() {
+ is.index = 0
+}
+
+// Consume moves the input pointer to the next character in the input stream
+func (is *InputStream) Consume() {
+ if is.index >= is.size {
+ // assert is.LA(1) == TokenEOF
+ panic("cannot consume EOF")
+ }
+ is.index++
+}
+
+// LA returns the character at the given offset from the start of the input stream
+func (is *InputStream) LA(offset int) int {
+
+ if offset == 0 {
+ return 0 // nil
+ }
+ if offset < 0 {
+ offset++ // e.g., translate LA(-1) to use offset=0
+ }
+ pos := is.index + offset - 1
+
+ if pos < 0 || pos >= is.size { // invalid
+ return TokenEOF
+ }
+
+ return int(is.data[pos])
+}
+
+// LT returns the character at the given offset from the start of the input stream
+func (is *InputStream) LT(offset int) int {
+ return is.LA(offset)
+}
+
+// Index returns the current offset in to the input stream
+func (is *InputStream) Index() int {
+ return is.index
+}
+
+// Size returns the total number of characters in the input stream
+func (is *InputStream) Size() int {
+ return is.size
+}
+
+// Mark does nothing here as we have entire buffer
+func (is *InputStream) Mark() int {
+ return -1
+}
+
+// Release does nothing here as we have entire buffer
+func (is *InputStream) Release(_ int) {
+}
+
+// Seek the input point to the provided index offset
+func (is *InputStream) Seek(index int) {
+ if index <= is.index {
+ is.index = index // just jump don't update stream state (line,...)
+ return
+ }
+ // seek forward
+ is.index = intMin(index, is.size)
+}
+
+// GetText returns the text from the input stream from the start to the stop index
+func (is *InputStream) GetText(start int, stop int) string {
+ if stop >= is.size {
+ stop = is.size - 1
+ }
+ if start >= is.size {
+ return ""
+ }
+
+ return string(is.data[start : stop+1])
+}
+
+// GetTextFromTokens returns the text from the input stream from the first character of the start token to the last
+// character of the stop token
+func (is *InputStream) GetTextFromTokens(start, stop Token) string {
+ if start != nil && stop != nil {
+ return is.GetTextFromInterval(NewInterval(start.GetTokenIndex(), stop.GetTokenIndex()))
+ }
+
+ return ""
+}
+
+func (is *InputStream) GetTextFromInterval(i Interval) string {
+ return is.GetText(i.Start, i.Stop)
+}
+
+func (*InputStream) GetSourceName() string {
+ return ""
+}
+
+// String returns the entire input stream as a string
+func (is *InputStream) String() string {
+ return string(is.data)
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/int_stream.go b/vendor/github.com/antlr4-go/antlr/v4/int_stream.go
similarity index 100%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/int_stream.go
rename to vendor/github.com/antlr4-go/antlr/v4/int_stream.go
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/interval_set.go b/vendor/github.com/antlr4-go/antlr/v4/interval_set.go
similarity index 82%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/interval_set.go
rename to vendor/github.com/antlr4-go/antlr/v4/interval_set.go
index c1e155e8180..cc5066067a2 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/interval_set.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/interval_set.go
@@ -14,20 +14,21 @@ type Interval struct {
Stop int
}
-/* stop is not included! */
-func NewInterval(start, stop int) *Interval {
- i := new(Interval)
-
- i.Start = start
- i.Stop = stop
- return i
+// NewInterval creates a new interval with the given start and stop values.
+func NewInterval(start, stop int) Interval {
+ return Interval{
+ Start: start,
+ Stop: stop,
+ }
}
-func (i *Interval) Contains(item int) bool {
+// Contains returns true if the given item is contained within the interval.
+func (i Interval) Contains(item int) bool {
return item >= i.Start && item < i.Stop
}
-func (i *Interval) String() string {
+// String generates a string representation of the interval.
+func (i Interval) String() string {
if i.Start == i.Stop-1 {
return strconv.Itoa(i.Start)
}
@@ -35,15 +36,18 @@ func (i *Interval) String() string {
return strconv.Itoa(i.Start) + ".." + strconv.Itoa(i.Stop-1)
}
-func (i *Interval) length() int {
+// Length returns the length of the interval.
+func (i Interval) Length() int {
return i.Stop - i.Start
}
+// IntervalSet represents a collection of [Intervals], which may be read-only.
type IntervalSet struct {
- intervals []*Interval
+ intervals []Interval
readOnly bool
}
+// NewIntervalSet creates a new empty, writable, interval set.
func NewIntervalSet() *IntervalSet {
i := new(IntervalSet)
@@ -54,6 +58,20 @@ func NewIntervalSet() *IntervalSet {
return i
}
+func (i *IntervalSet) Equals(other *IntervalSet) bool {
+ if len(i.intervals) != len(other.intervals) {
+ return false
+ }
+
+ for k, v := range i.intervals {
+ if v.Start != other.intervals[k].Start || v.Stop != other.intervals[k].Stop {
+ return false
+ }
+ }
+
+ return true
+}
+
func (i *IntervalSet) first() int {
if len(i.intervals) == 0 {
return TokenInvalidType
@@ -70,16 +88,16 @@ func (i *IntervalSet) addRange(l, h int) {
i.addInterval(NewInterval(l, h+1))
}
-func (i *IntervalSet) addInterval(v *Interval) {
+func (i *IntervalSet) addInterval(v Interval) {
if i.intervals == nil {
- i.intervals = make([]*Interval, 0)
+ i.intervals = make([]Interval, 0)
i.intervals = append(i.intervals, v)
} else {
// find insert pos
for k, interval := range i.intervals {
// distinct range -> insert
if v.Stop < interval.Start {
- i.intervals = append(i.intervals[0:k], append([]*Interval{v}, i.intervals[k:]...)...)
+ i.intervals = append(i.intervals[0:k], append([]Interval{v}, i.intervals[k:]...)...)
return
} else if v.Stop == interval.Start {
i.intervals[k].Start = v.Start
@@ -139,16 +157,16 @@ func (i *IntervalSet) contains(item int) bool {
}
func (i *IntervalSet) length() int {
- len := 0
+ iLen := 0
for _, v := range i.intervals {
- len += v.length()
+ iLen += v.Length()
}
- return len
+ return iLen
}
-func (i *IntervalSet) removeRange(v *Interval) {
+func (i *IntervalSet) removeRange(v Interval) {
if v.Start == v.Stop-1 {
i.removeOne(v.Start)
} else if i.intervals != nil {
@@ -162,7 +180,7 @@ func (i *IntervalSet) removeRange(v *Interval) {
i.intervals[k] = NewInterval(ni.Start, v.Start)
x := NewInterval(v.Stop, ni.Stop)
// i.intervals.splice(k, 0, x)
- i.intervals = append(i.intervals[0:k], append([]*Interval{x}, i.intervals[k:]...)...)
+ i.intervals = append(i.intervals[0:k], append([]Interval{x}, i.intervals[k:]...)...)
return
} else if v.Start <= ni.Start && v.Stop >= ni.Stop {
// i.intervals.splice(k, 1)
@@ -199,7 +217,7 @@ func (i *IntervalSet) removeOne(v int) {
x := NewInterval(ki.Start, v)
ki.Start = v + 1
// i.intervals.splice(k, 0, x)
- i.intervals = append(i.intervals[0:k], append([]*Interval{x}, i.intervals[k:]...)...)
+ i.intervals = append(i.intervals[0:k], append([]Interval{x}, i.intervals[k:]...)...)
return
}
}
@@ -223,7 +241,7 @@ func (i *IntervalSet) StringVerbose(literalNames []string, symbolicNames []strin
return i.toIndexString()
}
-func (i *IntervalSet) GetIntervals() []*Interval {
+func (i *IntervalSet) GetIntervals() []Interval {
return i.intervals
}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/jcollect.go b/vendor/github.com/antlr4-go/antlr/v4/jcollect.go
new file mode 100644
index 00000000000..ceccd96d258
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/jcollect.go
@@ -0,0 +1,685 @@
+package antlr
+
+// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+import (
+ "container/list"
+ "runtime/debug"
+ "sort"
+ "sync"
+)
+
+// Collectable is an interface that a struct should implement if it is to be
+// usable as a key in these collections.
+type Collectable[T any] interface {
+ Hash() int
+ Equals(other Collectable[T]) bool
+}
+
+type Comparator[T any] interface {
+ Hash1(o T) int
+ Equals2(T, T) bool
+}
+
+type CollectionSource int
+type CollectionDescriptor struct {
+ SybolicName string
+ Description string
+}
+
+const (
+ UnknownCollection CollectionSource = iota
+ ATNConfigLookupCollection
+ ATNStateCollection
+ DFAStateCollection
+ ATNConfigCollection
+ PredictionContextCollection
+ SemanticContextCollection
+ ClosureBusyCollection
+ PredictionVisitedCollection
+ MergeCacheCollection
+ PredictionContextCacheCollection
+ AltSetCollection
+ ReachSetCollection
+)
+
+var CollectionDescriptors = map[CollectionSource]CollectionDescriptor{
+ UnknownCollection: {
+ SybolicName: "UnknownCollection",
+ Description: "Unknown collection type. Only used if the target author thought it was an unimportant collection.",
+ },
+ ATNConfigCollection: {
+ SybolicName: "ATNConfigCollection",
+ Description: "ATNConfig collection. Used to store the ATNConfigs for a particular state in the ATN." +
+ "For instance, it is used to store the results of the closure() operation in the ATN.",
+ },
+ ATNConfigLookupCollection: {
+ SybolicName: "ATNConfigLookupCollection",
+ Description: "ATNConfigLookup collection. Used to store the ATNConfigs for a particular state in the ATN." +
+ "This is used to prevent duplicating equivalent states in an ATNConfigurationSet.",
+ },
+ ATNStateCollection: {
+ SybolicName: "ATNStateCollection",
+ Description: "ATNState collection. This is used to store the states of the ATN.",
+ },
+ DFAStateCollection: {
+ SybolicName: "DFAStateCollection",
+ Description: "DFAState collection. This is used to store the states of the DFA.",
+ },
+ PredictionContextCollection: {
+ SybolicName: "PredictionContextCollection",
+ Description: "PredictionContext collection. This is used to store the prediction contexts of the ATN and cache computes.",
+ },
+ SemanticContextCollection: {
+ SybolicName: "SemanticContextCollection",
+ Description: "SemanticContext collection. This is used to store the semantic contexts of the ATN.",
+ },
+ ClosureBusyCollection: {
+ SybolicName: "ClosureBusyCollection",
+ Description: "ClosureBusy collection. This is used to check and prevent infinite recursion right recursive rules." +
+ "It stores ATNConfigs that are currently being processed in the closure() operation.",
+ },
+ PredictionVisitedCollection: {
+ SybolicName: "PredictionVisitedCollection",
+ Description: "A map that records whether we have visited a particular context when searching through cached entries.",
+ },
+ MergeCacheCollection: {
+ SybolicName: "MergeCacheCollection",
+ Description: "A map that records whether we have already merged two particular contexts and can save effort by not repeating it.",
+ },
+ PredictionContextCacheCollection: {
+ SybolicName: "PredictionContextCacheCollection",
+ Description: "A map that records whether we have already created a particular context and can save effort by not computing it again.",
+ },
+ AltSetCollection: {
+ SybolicName: "AltSetCollection",
+ Description: "Used to eliminate duplicate alternatives in an ATN config set.",
+ },
+ ReachSetCollection: {
+ SybolicName: "ReachSetCollection",
+ Description: "Used as merge cache to prevent us needing to compute the merge of two states if we have already done it.",
+ },
+}
+
+// JStore implements a container that allows the use of a struct to calculate the key
+// for a collection of values akin to map. This is not meant to be a full-blown HashMap but just
+// serve the needs of the ANTLR Go runtime.
+//
+// For ease of porting the logic of the runtime from the master target (Java), this collection
+// operates in a similar way to Java, in that it can use any struct that supplies a Hash() and Equals()
+// function as the key. The values are stored in a standard go map which internally is a form of hashmap
+// itself, the key for the go map is the hash supplied by the key object. The collection is able to deal with
+// hash conflicts by using a simple slice of values associated with the hash code indexed bucket. That isn't
+// particularly efficient, but it is simple, and it works. As this is specifically for the ANTLR runtime, and
+// we understand the requirements, then this is fine - this is not a general purpose collection.
+type JStore[T any, C Comparator[T]] struct {
+ store map[int][]T
+ len int
+ comparator Comparator[T]
+ stats *JStatRec
+}
+
+func NewJStore[T any, C Comparator[T]](comparator Comparator[T], cType CollectionSource, desc string) *JStore[T, C] {
+
+ if comparator == nil {
+ panic("comparator cannot be nil")
+ }
+
+ s := &JStore[T, C]{
+ store: make(map[int][]T, 1),
+ comparator: comparator,
+ }
+ if collectStats {
+ s.stats = &JStatRec{
+ Source: cType,
+ Description: desc,
+ }
+
+ // Track where we created it from if we are being asked to do so
+ if runtimeConfig.statsTraceStacks {
+ s.stats.CreateStack = debug.Stack()
+ }
+ Statistics.AddJStatRec(s.stats)
+ }
+ return s
+}
+
+// Put will store given value in the collection. Note that the key for storage is generated from
+// the value itself - this is specifically because that is what ANTLR needs - this would not be useful
+// as any kind of general collection.
+//
+// If the key has a hash conflict, then the value will be added to the slice of values associated with the
+// hash, unless the value is already in the slice, in which case the existing value is returned. Value equivalence is
+// tested by calling the equals() method on the key.
+//
+// # If the given value is already present in the store, then the existing value is returned as v and exists is set to true
+//
+// If the given value is not present in the store, then the value is added to the store and returned as v and exists is set to false.
+func (s *JStore[T, C]) Put(value T) (v T, exists bool) {
+
+ if collectStats {
+ s.stats.Puts++
+ }
+ kh := s.comparator.Hash1(value)
+
+ var hClash bool
+ for _, v1 := range s.store[kh] {
+ hClash = true
+ if s.comparator.Equals2(value, v1) {
+ if collectStats {
+ s.stats.PutHits++
+ s.stats.PutHashConflicts++
+ }
+ return v1, true
+ }
+ if collectStats {
+ s.stats.PutMisses++
+ }
+ }
+ if collectStats && hClash {
+ s.stats.PutHashConflicts++
+ }
+ s.store[kh] = append(s.store[kh], value)
+
+ if collectStats {
+ if len(s.store[kh]) > s.stats.MaxSlotSize {
+ s.stats.MaxSlotSize = len(s.store[kh])
+ }
+ }
+ s.len++
+ if collectStats {
+ s.stats.CurSize = s.len
+ if s.len > s.stats.MaxSize {
+ s.stats.MaxSize = s.len
+ }
+ }
+ return value, false
+}
+
+// Get will return the value associated with the key - the type of the key is the same type as the value
+// which would not generally be useful, but this is a specific thing for ANTLR where the key is
+// generated using the object we are going to store.
+func (s *JStore[T, C]) Get(key T) (T, bool) {
+ if collectStats {
+ s.stats.Gets++
+ }
+ kh := s.comparator.Hash1(key)
+ var hClash bool
+ for _, v := range s.store[kh] {
+ hClash = true
+ if s.comparator.Equals2(key, v) {
+ if collectStats {
+ s.stats.GetHits++
+ s.stats.GetHashConflicts++
+ }
+ return v, true
+ }
+ if collectStats {
+ s.stats.GetMisses++
+ }
+ }
+ if collectStats {
+ if hClash {
+ s.stats.GetHashConflicts++
+ }
+ s.stats.GetNoEnt++
+ }
+ return key, false
+}
+
+// Contains returns true if the given key is present in the store
+func (s *JStore[T, C]) Contains(key T) bool {
+ _, present := s.Get(key)
+ return present
+}
+
+func (s *JStore[T, C]) SortedSlice(less func(i, j T) bool) []T {
+ vs := make([]T, 0, len(s.store))
+ for _, v := range s.store {
+ vs = append(vs, v...)
+ }
+ sort.Slice(vs, func(i, j int) bool {
+ return less(vs[i], vs[j])
+ })
+
+ return vs
+}
+
+func (s *JStore[T, C]) Each(f func(T) bool) {
+ for _, e := range s.store {
+ for _, v := range e {
+ f(v)
+ }
+ }
+}
+
+func (s *JStore[T, C]) Len() int {
+ return s.len
+}
+
+func (s *JStore[T, C]) Values() []T {
+ vs := make([]T, 0, len(s.store))
+ for _, e := range s.store {
+ vs = append(vs, e...)
+ }
+ return vs
+}
+
+type entry[K, V any] struct {
+ key K
+ val V
+}
+
+type JMap[K, V any, C Comparator[K]] struct {
+ store map[int][]*entry[K, V]
+ len int
+ comparator Comparator[K]
+ stats *JStatRec
+}
+
+func NewJMap[K, V any, C Comparator[K]](comparator Comparator[K], cType CollectionSource, desc string) *JMap[K, V, C] {
+ m := &JMap[K, V, C]{
+ store: make(map[int][]*entry[K, V], 1),
+ comparator: comparator,
+ }
+ if collectStats {
+ m.stats = &JStatRec{
+ Source: cType,
+ Description: desc,
+ }
+ // Track where we created it from if we are being asked to do so
+ if runtimeConfig.statsTraceStacks {
+ m.stats.CreateStack = debug.Stack()
+ }
+ Statistics.AddJStatRec(m.stats)
+ }
+ return m
+}
+
+func (m *JMap[K, V, C]) Put(key K, val V) (V, bool) {
+ if collectStats {
+ m.stats.Puts++
+ }
+ kh := m.comparator.Hash1(key)
+
+ var hClash bool
+ for _, e := range m.store[kh] {
+ hClash = true
+ if m.comparator.Equals2(e.key, key) {
+ if collectStats {
+ m.stats.PutHits++
+ m.stats.PutHashConflicts++
+ }
+ return e.val, true
+ }
+ if collectStats {
+ m.stats.PutMisses++
+ }
+ }
+ if collectStats {
+ if hClash {
+ m.stats.PutHashConflicts++
+ }
+ }
+ m.store[kh] = append(m.store[kh], &entry[K, V]{key, val})
+ if collectStats {
+ if len(m.store[kh]) > m.stats.MaxSlotSize {
+ m.stats.MaxSlotSize = len(m.store[kh])
+ }
+ }
+ m.len++
+ if collectStats {
+ m.stats.CurSize = m.len
+ if m.len > m.stats.MaxSize {
+ m.stats.MaxSize = m.len
+ }
+ }
+ return val, false
+}
+
+func (m *JMap[K, V, C]) Values() []V {
+ vs := make([]V, 0, len(m.store))
+ for _, e := range m.store {
+ for _, v := range e {
+ vs = append(vs, v.val)
+ }
+ }
+ return vs
+}
+
+func (m *JMap[K, V, C]) Get(key K) (V, bool) {
+ if collectStats {
+ m.stats.Gets++
+ }
+ var none V
+ kh := m.comparator.Hash1(key)
+ var hClash bool
+ for _, e := range m.store[kh] {
+ hClash = true
+ if m.comparator.Equals2(e.key, key) {
+ if collectStats {
+ m.stats.GetHits++
+ m.stats.GetHashConflicts++
+ }
+ return e.val, true
+ }
+ if collectStats {
+ m.stats.GetMisses++
+ }
+ }
+ if collectStats {
+ if hClash {
+ m.stats.GetHashConflicts++
+ }
+ m.stats.GetNoEnt++
+ }
+ return none, false
+}
+
+func (m *JMap[K, V, C]) Len() int {
+ return m.len
+}
+
+func (m *JMap[K, V, C]) Delete(key K) {
+ kh := m.comparator.Hash1(key)
+ for i, e := range m.store[kh] {
+ if m.comparator.Equals2(e.key, key) {
+ m.store[kh] = append(m.store[kh][:i], m.store[kh][i+1:]...)
+ m.len--
+ return
+ }
+ }
+}
+
+func (m *JMap[K, V, C]) Clear() {
+ m.store = make(map[int][]*entry[K, V])
+}
+
+type JPCMap struct {
+ store *JMap[*PredictionContext, *JMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]], *ObjEqComparator[*PredictionContext]]
+ size int
+ stats *JStatRec
+}
+
+func NewJPCMap(cType CollectionSource, desc string) *JPCMap {
+ m := &JPCMap{
+ store: NewJMap[*PredictionContext, *JMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]], *ObjEqComparator[*PredictionContext]](pContextEqInst, cType, desc),
+ }
+ if collectStats {
+ m.stats = &JStatRec{
+ Source: cType,
+ Description: desc,
+ }
+ // Track where we created it from if we are being asked to do so
+ if runtimeConfig.statsTraceStacks {
+ m.stats.CreateStack = debug.Stack()
+ }
+ Statistics.AddJStatRec(m.stats)
+ }
+ return m
+}
+
+func (pcm *JPCMap) Get(k1, k2 *PredictionContext) (*PredictionContext, bool) {
+ if collectStats {
+ pcm.stats.Gets++
+ }
+ // Do we have a map stored by k1?
+ //
+ m2, present := pcm.store.Get(k1)
+ if present {
+ if collectStats {
+ pcm.stats.GetHits++
+ }
+ // We found a map of values corresponding to k1, so now we need to look up k2 in that map
+ //
+ return m2.Get(k2)
+ }
+ if collectStats {
+ pcm.stats.GetMisses++
+ }
+ return nil, false
+}
+
+func (pcm *JPCMap) Put(k1, k2, v *PredictionContext) {
+
+ if collectStats {
+ pcm.stats.Puts++
+ }
+ // First does a map already exist for k1?
+ //
+ if m2, present := pcm.store.Get(k1); present {
+ if collectStats {
+ pcm.stats.PutHits++
+ }
+ _, present = m2.Put(k2, v)
+ if !present {
+ pcm.size++
+ if collectStats {
+ pcm.stats.CurSize = pcm.size
+ if pcm.size > pcm.stats.MaxSize {
+ pcm.stats.MaxSize = pcm.size
+ }
+ }
+ }
+ } else {
+ // No map found for k1, so we create it, add in our value, then store is
+ //
+ if collectStats {
+ pcm.stats.PutMisses++
+ m2 = NewJMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]](pContextEqInst, pcm.stats.Source, pcm.stats.Description+" map entry")
+ } else {
+ m2 = NewJMap[*PredictionContext, *PredictionContext, *ObjEqComparator[*PredictionContext]](pContextEqInst, PredictionContextCacheCollection, "map entry")
+ }
+
+ m2.Put(k2, v)
+ pcm.store.Put(k1, m2)
+ pcm.size++
+ }
+}
+
+type JPCMap2 struct {
+ store map[int][]JPCEntry
+ size int
+ stats *JStatRec
+}
+
+type JPCEntry struct {
+ k1, k2, v *PredictionContext
+}
+
+func NewJPCMap2(cType CollectionSource, desc string) *JPCMap2 {
+ m := &JPCMap2{
+ store: make(map[int][]JPCEntry, 1000),
+ }
+ if collectStats {
+ m.stats = &JStatRec{
+ Source: cType,
+ Description: desc,
+ }
+ // Track where we created it from if we are being asked to do so
+ if runtimeConfig.statsTraceStacks {
+ m.stats.CreateStack = debug.Stack()
+ }
+ Statistics.AddJStatRec(m.stats)
+ }
+ return m
+}
+
+func dHash(k1, k2 *PredictionContext) int {
+ return k1.cachedHash*31 + k2.cachedHash
+}
+
+func (pcm *JPCMap2) Get(k1, k2 *PredictionContext) (*PredictionContext, bool) {
+ if collectStats {
+ pcm.stats.Gets++
+ }
+
+ h := dHash(k1, k2)
+ var hClash bool
+ for _, e := range pcm.store[h] {
+ hClash = true
+ if e.k1.Equals(k1) && e.k2.Equals(k2) {
+ if collectStats {
+ pcm.stats.GetHits++
+ pcm.stats.GetHashConflicts++
+ }
+ return e.v, true
+ }
+ if collectStats {
+ pcm.stats.GetMisses++
+ }
+ }
+ if collectStats {
+ if hClash {
+ pcm.stats.GetHashConflicts++
+ }
+ pcm.stats.GetNoEnt++
+ }
+ return nil, false
+}
+
+func (pcm *JPCMap2) Put(k1, k2, v *PredictionContext) (*PredictionContext, bool) {
+ if collectStats {
+ pcm.stats.Puts++
+ }
+ h := dHash(k1, k2)
+ var hClash bool
+ for _, e := range pcm.store[h] {
+ hClash = true
+ if e.k1.Equals(k1) && e.k2.Equals(k2) {
+ if collectStats {
+ pcm.stats.PutHits++
+ pcm.stats.PutHashConflicts++
+ }
+ return e.v, true
+ }
+ if collectStats {
+ pcm.stats.PutMisses++
+ }
+ }
+ if collectStats {
+ if hClash {
+ pcm.stats.PutHashConflicts++
+ }
+ }
+ pcm.store[h] = append(pcm.store[h], JPCEntry{k1, k2, v})
+ pcm.size++
+ if collectStats {
+ pcm.stats.CurSize = pcm.size
+ if pcm.size > pcm.stats.MaxSize {
+ pcm.stats.MaxSize = pcm.size
+ }
+ }
+ return nil, false
+}
+
+type VisitEntry struct {
+ k *PredictionContext
+ v *PredictionContext
+}
+type VisitRecord struct {
+ store map[*PredictionContext]*PredictionContext
+ len int
+ stats *JStatRec
+}
+
+type VisitList struct {
+ cache *list.List
+ lock sync.RWMutex
+}
+
+var visitListPool = VisitList{
+ cache: list.New(),
+ lock: sync.RWMutex{},
+}
+
+// NewVisitRecord returns a new VisitRecord instance from the pool if available.
+// Note that this "map" uses a pointer as a key because we are emulating the behavior of
+// IdentityHashMap in Java, which uses the `==` operator to compare whether the keys are equal,
+// which means is the key the same reference to an object rather than is it .equals() to another
+// object.
+func NewVisitRecord() *VisitRecord {
+ visitListPool.lock.Lock()
+ el := visitListPool.cache.Front()
+ defer visitListPool.lock.Unlock()
+ var vr *VisitRecord
+ if el == nil {
+ vr = &VisitRecord{
+ store: make(map[*PredictionContext]*PredictionContext),
+ }
+ if collectStats {
+ vr.stats = &JStatRec{
+ Source: PredictionContextCacheCollection,
+ Description: "VisitRecord",
+ }
+ // Track where we created it from if we are being asked to do so
+ if runtimeConfig.statsTraceStacks {
+ vr.stats.CreateStack = debug.Stack()
+ }
+ }
+ } else {
+ vr = el.Value.(*VisitRecord)
+ visitListPool.cache.Remove(el)
+ vr.store = make(map[*PredictionContext]*PredictionContext)
+ }
+ if collectStats {
+ Statistics.AddJStatRec(vr.stats)
+ }
+ return vr
+}
+
+func (vr *VisitRecord) Release() {
+ vr.len = 0
+ vr.store = nil
+ if collectStats {
+ vr.stats.MaxSize = 0
+ vr.stats.CurSize = 0
+ vr.stats.Gets = 0
+ vr.stats.GetHits = 0
+ vr.stats.GetMisses = 0
+ vr.stats.GetHashConflicts = 0
+ vr.stats.GetNoEnt = 0
+ vr.stats.Puts = 0
+ vr.stats.PutHits = 0
+ vr.stats.PutMisses = 0
+ vr.stats.PutHashConflicts = 0
+ vr.stats.MaxSlotSize = 0
+ }
+ visitListPool.lock.Lock()
+ visitListPool.cache.PushBack(vr)
+ visitListPool.lock.Unlock()
+}
+
+func (vr *VisitRecord) Get(k *PredictionContext) (*PredictionContext, bool) {
+ if collectStats {
+ vr.stats.Gets++
+ }
+ v := vr.store[k]
+ if v != nil {
+ if collectStats {
+ vr.stats.GetHits++
+ }
+ return v, true
+ }
+ if collectStats {
+ vr.stats.GetNoEnt++
+ }
+ return nil, false
+}
+
+func (vr *VisitRecord) Put(k, v *PredictionContext) (*PredictionContext, bool) {
+ if collectStats {
+ vr.stats.Puts++
+ }
+ vr.store[k] = v
+ vr.len++
+ if collectStats {
+ vr.stats.CurSize = vr.len
+ if vr.len > vr.stats.MaxSize {
+ vr.stats.MaxSize = vr.len
+ }
+ }
+ return v, false
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer.go b/vendor/github.com/antlr4-go/antlr/v4/lexer.go
similarity index 78%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer.go
rename to vendor/github.com/antlr4-go/antlr/v4/lexer.go
index 6533f051645..3c7896a9183 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/lexer.go
@@ -69,7 +69,7 @@ func NewBaseLexer(input CharStream) *BaseLexer {
// create a single token. NextToken will return l object after
// Matching lexer rule(s). If you subclass to allow multiple token
// emissions, then set l to the last token to be Matched or
- // something nonnil so that the auto token emit mechanism will not
+ // something non nil so that the auto token emit mechanism will not
// emit another token.
lexer.token = nil
@@ -111,6 +111,7 @@ const (
LexerSkip = -3
)
+//goland:noinspection GoUnusedConst
const (
LexerDefaultTokenChannel = TokenDefaultChannel
LexerHidden = TokenHiddenChannel
@@ -118,7 +119,7 @@ const (
LexerMaxCharValue = 0x10FFFF
)
-func (b *BaseLexer) reset() {
+func (b *BaseLexer) Reset() {
// wack Lexer state variables
if b.input != nil {
b.input.Seek(0) // rewind the input
@@ -176,7 +177,7 @@ func (b *BaseLexer) safeMatch() (ret int) {
return b.Interpreter.Match(b.input, b.mode)
}
-// Return a token from l source i.e., Match a token on the char stream.
+// NextToken returns a token from the lexer input source i.e., Match a token on the source char stream.
func (b *BaseLexer) NextToken() Token {
if b.input == nil {
panic("NextToken requires a non-nil input stream.")
@@ -205,9 +206,8 @@ func (b *BaseLexer) NextToken() Token {
continueOuter := false
for {
b.thetype = TokenInvalidType
- ttype := LexerSkip
- ttype = b.safeMatch()
+ ttype := b.safeMatch()
if b.input.LA(1) == TokenEOF {
b.hitEOF = true
@@ -234,12 +234,11 @@ func (b *BaseLexer) NextToken() Token {
}
}
-// Instruct the lexer to Skip creating a token for current lexer rule
-// and look for another token. NextToken() knows to keep looking when
-// a lexer rule finishes with token set to SKIPTOKEN. Recall that
+// Skip instructs the lexer to Skip creating a token for current lexer rule
+// and look for another token. [NextToken] knows to keep looking when
+// a lexer rule finishes with token set to [SKIPTOKEN]. Recall that
// if token==nil at end of any token rule, it creates one for you
// and emits it.
-// /
func (b *BaseLexer) Skip() {
b.thetype = LexerSkip
}
@@ -248,23 +247,29 @@ func (b *BaseLexer) More() {
b.thetype = LexerMore
}
+// SetMode changes the lexer to a new mode. The lexer will use this mode from hereon in and the rules for that mode
+// will be in force.
func (b *BaseLexer) SetMode(m int) {
b.mode = m
}
+// PushMode saves the current lexer mode so that it can be restored later. See [PopMode], then sets the
+// current lexer mode to the supplied mode m.
func (b *BaseLexer) PushMode(m int) {
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("pushMode " + strconv.Itoa(m))
}
b.modeStack.Push(b.mode)
b.mode = m
}
+// PopMode restores the lexer mode saved by a call to [PushMode]. It is a panic error if there is no saved mode to
+// return to.
func (b *BaseLexer) PopMode() int {
if len(b.modeStack) == 0 {
panic("Empty Stack")
}
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("popMode back to " + fmt.Sprint(b.modeStack[0:len(b.modeStack)-1]))
}
i, _ := b.modeStack.Pop()
@@ -280,7 +285,7 @@ func (b *BaseLexer) inputStream() CharStream {
func (b *BaseLexer) SetInputStream(input CharStream) {
b.input = nil
b.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input}
- b.reset()
+ b.Reset()
b.input = input
b.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input}
}
@@ -289,20 +294,19 @@ func (b *BaseLexer) GetTokenSourceCharStreamPair() *TokenSourceCharStreamPair {
return b.tokenFactorySourcePair
}
-// By default does not support multiple emits per NextToken invocation
-// for efficiency reasons. Subclass and override l method, NextToken,
-// and GetToken (to push tokens into a list and pull from that list
-// rather than a single variable as l implementation does).
-// /
+// EmitToken by default does not support multiple emits per [NextToken] invocation
+// for efficiency reasons. Subclass and override this func, [NextToken],
+// and [GetToken] (to push tokens into a list and pull from that list
+// rather than a single variable as this implementation does).
func (b *BaseLexer) EmitToken(token Token) {
b.token = token
}
-// The standard method called to automatically emit a token at the
+// Emit is the standard method called to automatically emit a token at the
// outermost lexical rule. The token object should point into the
// char buffer start..stop. If there is a text override in 'text',
-// use that to set the token's text. Override l method to emit
-// custom Token objects or provide a Newfactory.
+// use that to set the token's text. Override this method to emit
+// custom [Token] objects or provide a new factory.
// /
func (b *BaseLexer) Emit() Token {
t := b.factory.Create(b.tokenFactorySourcePair, b.thetype, b.text, b.channel, b.TokenStartCharIndex, b.GetCharIndex()-1, b.TokenStartLine, b.TokenStartColumn)
@@ -310,6 +314,7 @@ func (b *BaseLexer) Emit() Token {
return t
}
+// EmitEOF emits an EOF token. By default, this is the last token emitted
func (b *BaseLexer) EmitEOF() Token {
cpos := b.GetCharPositionInLine()
lpos := b.GetLine()
@@ -318,6 +323,7 @@ func (b *BaseLexer) EmitEOF() Token {
return eof
}
+// GetCharPositionInLine returns the current position in the current line as far as the lexer is concerned.
func (b *BaseLexer) GetCharPositionInLine() int {
return b.Interpreter.GetCharPositionInLine()
}
@@ -334,13 +340,12 @@ func (b *BaseLexer) SetType(t int) {
b.thetype = t
}
-// What is the index of the current character of lookahead?///
+// GetCharIndex returns the index of the current character of lookahead
func (b *BaseLexer) GetCharIndex() int {
return b.input.Index()
}
-// Return the text Matched so far for the current token or any text override.
-// Set the complete text of l token it wipes any previous changes to the text.
+// GetText returns the text Matched so far for the current token or any text override.
func (b *BaseLexer) GetText() string {
if b.text != "" {
return b.text
@@ -349,17 +354,20 @@ func (b *BaseLexer) GetText() string {
return b.Interpreter.GetText(b.input)
}
+// SetText sets the complete text of this token; it wipes any previous changes to the text.
func (b *BaseLexer) SetText(text string) {
b.text = text
}
+// GetATN returns the ATN used by the lexer.
func (b *BaseLexer) GetATN() *ATN {
return b.Interpreter.ATN()
}
-// Return a list of all Token objects in input char stream.
-// Forces load of all tokens. Does not include EOF token.
-// /
+// GetAllTokens returns a list of all [Token] objects in input char stream.
+// Forces a load of all tokens that can be made from the input char stream.
+//
+// Does not include EOF token.
func (b *BaseLexer) GetAllTokens() []Token {
vl := b.Virt
tokens := make([]Token, 0)
@@ -398,11 +406,13 @@ func (b *BaseLexer) getCharErrorDisplay(c rune) string {
return "'" + b.getErrorDisplayForChar(c) + "'"
}
-// Lexers can normally Match any char in it's vocabulary after Matching
-// a token, so do the easy thing and just kill a character and hope
+// Recover can normally Match any char in its vocabulary after Matching
+// a token, so here we do the easy thing and just kill a character and hope
// it all works out. You can instead use the rule invocation stack
// to do sophisticated error recovery if you are in a fragment rule.
-// /
+//
+// In general, lexers should not need to recover and should have rules that cover any eventuality, such as
+// a character that makes no sense to the recognizer.
func (b *BaseLexer) Recover(re RecognitionException) {
if b.input.LA(1) != TokenEOF {
if _, ok := re.(*LexerNoViableAltException); ok {
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_action.go b/vendor/github.com/antlr4-go/antlr/v4/lexer_action.go
similarity index 78%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_action.go
rename to vendor/github.com/antlr4-go/antlr/v4/lexer_action.go
index 111656c2952..eaa7393e06f 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_action.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/lexer_action.go
@@ -7,14 +7,29 @@ package antlr
import "strconv"
const (
- LexerActionTypeChannel = 0 //The type of a {@link LexerChannelAction} action.
- LexerActionTypeCustom = 1 //The type of a {@link LexerCustomAction} action.
- LexerActionTypeMode = 2 //The type of a {@link LexerModeAction} action.
- LexerActionTypeMore = 3 //The type of a {@link LexerMoreAction} action.
- LexerActionTypePopMode = 4 //The type of a {@link LexerPopModeAction} action.
- LexerActionTypePushMode = 5 //The type of a {@link LexerPushModeAction} action.
- LexerActionTypeSkip = 6 //The type of a {@link LexerSkipAction} action.
- LexerActionTypeType = 7 //The type of a {@link LexerTypeAction} action.
+ // LexerActionTypeChannel represents a [LexerChannelAction] action.
+ LexerActionTypeChannel = 0
+
+ // LexerActionTypeCustom represents a [LexerCustomAction] action.
+ LexerActionTypeCustom = 1
+
+ // LexerActionTypeMode represents a [LexerModeAction] action.
+ LexerActionTypeMode = 2
+
+ // LexerActionTypeMore represents a [LexerMoreAction] action.
+ LexerActionTypeMore = 3
+
+ // LexerActionTypePopMode represents a [LexerPopModeAction] action.
+ LexerActionTypePopMode = 4
+
+ // LexerActionTypePushMode represents a [LexerPushModeAction] action.
+ LexerActionTypePushMode = 5
+
+ // LexerActionTypeSkip represents a [LexerSkipAction] action.
+ LexerActionTypeSkip = 6
+
+ // LexerActionTypeType represents a [LexerTypeAction] action.
+ LexerActionTypeType = 7
)
type LexerAction interface {
@@ -39,7 +54,7 @@ func NewBaseLexerAction(action int) *BaseLexerAction {
return la
}
-func (b *BaseLexerAction) execute(lexer Lexer) {
+func (b *BaseLexerAction) execute(_ Lexer) {
panic("Not implemented")
}
@@ -52,17 +67,19 @@ func (b *BaseLexerAction) getIsPositionDependent() bool {
}
func (b *BaseLexerAction) Hash() int {
- return b.actionType
+ h := murmurInit(0)
+ h = murmurUpdate(h, b.actionType)
+ return murmurFinish(h, 1)
}
func (b *BaseLexerAction) Equals(other LexerAction) bool {
- return b == other
+ return b.actionType == other.getActionType()
}
-// Implements the {@code Skip} lexer action by calling {@link Lexer//Skip}.
+// LexerSkipAction implements the [BaseLexerAction.Skip] lexer action by calling [Lexer.Skip].
//
-// The {@code Skip} command does not have any parameters, so l action is
-// implemented as a singleton instance exposed by {@link //INSTANCE}.
+// The Skip command does not have any parameters, so this action is
+// implemented as a singleton instance exposed by the [LexerSkipActionINSTANCE].
type LexerSkipAction struct {
*BaseLexerAction
}
@@ -73,17 +90,22 @@ func NewLexerSkipAction() *LexerSkipAction {
return la
}
-// Provides a singleton instance of l parameterless lexer action.
+// LexerSkipActionINSTANCE provides a singleton instance of this parameterless lexer action.
var LexerSkipActionINSTANCE = NewLexerSkipAction()
func (l *LexerSkipAction) execute(lexer Lexer) {
lexer.Skip()
}
+// String returns a string representation of the current [LexerSkipAction].
func (l *LexerSkipAction) String() string {
return "skip"
}
+func (b *LexerSkipAction) Equals(other LexerAction) bool {
+ return other.getActionType() == LexerActionTypeSkip
+}
+
// Implements the {@code type} lexer action by calling {@link Lexer//setType}
//
// with the assigned type.
@@ -125,11 +147,10 @@ func (l *LexerTypeAction) String() string {
return "actionType(" + strconv.Itoa(l.thetype) + ")"
}
-// Implements the {@code pushMode} lexer action by calling
-// {@link Lexer//pushMode} with the assigned mode.
+// LexerPushModeAction implements the pushMode lexer action by calling
+// [Lexer.pushMode] with the assigned mode.
type LexerPushModeAction struct {
*BaseLexerAction
-
mode int
}
@@ -169,10 +190,10 @@ func (l *LexerPushModeAction) String() string {
return "pushMode(" + strconv.Itoa(l.mode) + ")"
}
-// Implements the {@code popMode} lexer action by calling {@link Lexer//popMode}.
+// LexerPopModeAction implements the popMode lexer action by calling [Lexer.popMode].
//
-// The {@code popMode} command does not have any parameters, so l action is
-// implemented as a singleton instance exposed by {@link //INSTANCE}.
+// The popMode command does not have any parameters, so this action is
+// implemented as a singleton instance exposed by [LexerPopModeActionINSTANCE]
type LexerPopModeAction struct {
*BaseLexerAction
}
@@ -224,11 +245,10 @@ func (l *LexerMoreAction) String() string {
return "more"
}
-// Implements the {@code mode} lexer action by calling {@link Lexer//mode} with
+// LexerModeAction implements the mode lexer action by calling [Lexer.mode] with
// the assigned mode.
type LexerModeAction struct {
*BaseLexerAction
-
mode int
}
@@ -322,16 +342,19 @@ func (l *LexerCustomAction) Equals(other LexerAction) bool {
}
}
-// Implements the {@code channel} lexer action by calling
-// {@link Lexer//setChannel} with the assigned channel.
-// Constructs a New{@code channel} action with the specified channel value.
-// @param channel The channel value to pass to {@link Lexer//setChannel}.
+// LexerChannelAction implements the channel lexer action by calling
+// [Lexer.setChannel] with the assigned channel.
+//
+// Constructs a new channel action with the specified channel value.
type LexerChannelAction struct {
*BaseLexerAction
-
channel int
}
+// NewLexerChannelAction creates a channel lexer action by calling
+// [Lexer.setChannel] with the assigned channel.
+//
+// Constructs a new channel action with the specified channel value.
func NewLexerChannelAction(channel int) *LexerChannelAction {
l := new(LexerChannelAction)
l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeChannel)
@@ -375,25 +398,22 @@ func (l *LexerChannelAction) String() string {
// lexer actions, see {@link LexerActionExecutor//append} and
// {@link LexerActionExecutor//fixOffsetBeforeMatch}.
-// Constructs a Newindexed custom action by associating a character offset
-// with a {@link LexerAction}.
-//
-// Note: This class is only required for lexer actions for which
-// {@link LexerAction//isPositionDependent} returns {@code true}.
-//
-// @param offset The offset into the input {@link CharStream}, relative to
-// the token start index, at which the specified lexer action should be
-// executed.
-// @param action The lexer action to execute at a particular offset in the
-// input {@link CharStream}.
type LexerIndexedCustomAction struct {
*BaseLexerAction
-
offset int
lexerAction LexerAction
isPositionDependent bool
}
+// NewLexerIndexedCustomAction constructs a new indexed custom action by associating a character offset
+// with a [LexerAction].
+//
+// Note: This class is only required for lexer actions for which
+// [LexerAction.isPositionDependent] returns true.
+//
+// The offset points into the input [CharStream], relative to
+// the token start index, at which the specified lexerAction should be
+// executed.
func NewLexerIndexedCustomAction(offset int, lexerAction LexerAction) *LexerIndexedCustomAction {
l := new(LexerIndexedCustomAction)
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_action_executor.go b/vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go
similarity index 70%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_action_executor.go
rename to vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go
index be1ba7a7e30..dfc28c32b30 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_action_executor.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/lexer_action_executor.go
@@ -29,28 +29,20 @@ func NewLexerActionExecutor(lexerActions []LexerAction) *LexerActionExecutor {
l.lexerActions = lexerActions
// Caches the result of {@link //hashCode} since the hash code is an element
- // of the performance-critical {@link LexerATNConfig//hashCode} operation.
- l.cachedHash = murmurInit(57)
+ // of the performance-critical {@link ATNConfig//hashCode} operation.
+ l.cachedHash = murmurInit(0)
for _, a := range lexerActions {
l.cachedHash = murmurUpdate(l.cachedHash, a.Hash())
}
+ l.cachedHash = murmurFinish(l.cachedHash, len(lexerActions))
return l
}
-// Creates a {@link LexerActionExecutor} which executes the actions for
-// the input {@code lexerActionExecutor} followed by a specified
-// {@code lexerAction}.
-//
-// @param lexerActionExecutor The executor for actions already traversed by
-// the lexer while Matching a token within a particular
-// {@link LexerATNConfig}. If this is {@code nil}, the method behaves as
-// though it were an empty executor.
-// @param lexerAction The lexer action to execute after the actions
-// specified in {@code lexerActionExecutor}.
-//
-// @return A {@link LexerActionExecutor} for executing the combine actions
-// of {@code lexerActionExecutor} and {@code lexerAction}.
+// LexerActionExecutorappend creates a [LexerActionExecutor] which executes the actions for
+// the input [LexerActionExecutor] followed by a specified
+// [LexerAction].
+// TODO: This does not match the Java code
func LexerActionExecutorappend(lexerActionExecutor *LexerActionExecutor, lexerAction LexerAction) *LexerActionExecutor {
if lexerActionExecutor == nil {
return NewLexerActionExecutor([]LexerAction{lexerAction})
@@ -59,47 +51,42 @@ func LexerActionExecutorappend(lexerActionExecutor *LexerActionExecutor, lexerAc
return NewLexerActionExecutor(append(lexerActionExecutor.lexerActions, lexerAction))
}
-// Creates a {@link LexerActionExecutor} which encodes the current offset
+// fixOffsetBeforeMatch creates a [LexerActionExecutor] which encodes the current offset
// for position-dependent lexer actions.
//
-// Normally, when the executor encounters lexer actions where
-// {@link LexerAction//isPositionDependent} returns {@code true}, it calls
-// {@link IntStream//seek} on the input {@link CharStream} to set the input
-// position to the end of the current token. This behavior provides
-// for efficient DFA representation of lexer actions which appear at the end
+// Normally, when the executor encounters lexer actions where
+// [LexerAction.isPositionDependent] returns true, it calls
+// [IntStream.Seek] on the input [CharStream] to set the input
+// position to the end of the current token. This behavior provides
+// for efficient [DFA] representation of lexer actions which appear at the end
// of a lexer rule, even when the lexer rule Matches a variable number of
-// characters.
+// characters.
//
-// Prior to traversing a Match transition in the ATN, the current offset
+// Prior to traversing a Match transition in the [ATN], the current offset
// from the token start index is assigned to all position-dependent lexer
// actions which have not already been assigned a fixed offset. By storing
-// the offsets relative to the token start index, the DFA representation of
+// the offsets relative to the token start index, the [DFA] representation of
// lexer actions which appear in the middle of tokens remains efficient due
-// to sharing among tokens of the same length, regardless of their absolute
-// position in the input stream.
+// to sharing among tokens of the same Length, regardless of their absolute
+// position in the input stream.
//
-// If the current executor already has offsets assigned to all
-// position-dependent lexer actions, the method returns {@code this}.
+// If the current executor already has offsets assigned to all
+// position-dependent lexer actions, the method returns this instance.
//
-// @param offset The current offset to assign to all position-dependent
+// The offset is assigned to all position-dependent
// lexer actions which do not already have offsets assigned.
//
-// @return A {@link LexerActionExecutor} which stores input stream offsets
+// The func returns a [LexerActionExecutor] that stores input stream offsets
// for all position-dependent lexer actions.
-// /
func (l *LexerActionExecutor) fixOffsetBeforeMatch(offset int) *LexerActionExecutor {
var updatedLexerActions []LexerAction
for i := 0; i < len(l.lexerActions); i++ {
_, ok := l.lexerActions[i].(*LexerIndexedCustomAction)
if l.lexerActions[i].getIsPositionDependent() && !ok {
if updatedLexerActions == nil {
- updatedLexerActions = make([]LexerAction, 0)
-
- for _, a := range l.lexerActions {
- updatedLexerActions = append(updatedLexerActions, a)
- }
+ updatedLexerActions = make([]LexerAction, 0, len(l.lexerActions))
+ updatedLexerActions = append(updatedLexerActions, l.lexerActions...)
}
-
updatedLexerActions[i] = NewLexerIndexedCustomAction(offset, l.lexerActions[i])
}
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_atn_simulator.go b/vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go
similarity index 80%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_atn_simulator.go
rename to vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go
index c573b752100..fe938b0259a 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/lexer_atn_simulator.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/lexer_atn_simulator.go
@@ -10,10 +10,8 @@ import (
"strings"
)
+//goland:noinspection GoUnusedGlobalVariable
var (
- LexerATNSimulatorDebug = false
- LexerATNSimulatorDFADebug = false
-
LexerATNSimulatorMinDFAEdge = 0
LexerATNSimulatorMaxDFAEdge = 127 // forces unicode to stay in ATN
@@ -32,11 +30,11 @@ type ILexerATNSimulator interface {
}
type LexerATNSimulator struct {
- *BaseATNSimulator
+ BaseATNSimulator
recog Lexer
predictionMode int
- mergeCache DoubleDict
+ mergeCache *JPCMap2
startIndex int
Line int
CharPositionInLine int
@@ -46,27 +44,35 @@ type LexerATNSimulator struct {
}
func NewLexerATNSimulator(recog Lexer, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *LexerATNSimulator {
- l := new(LexerATNSimulator)
-
- l.BaseATNSimulator = NewBaseATNSimulator(atn, sharedContextCache)
+ l := &LexerATNSimulator{
+ BaseATNSimulator: BaseATNSimulator{
+ atn: atn,
+ sharedContextCache: sharedContextCache,
+ },
+ }
l.decisionToDFA = decisionToDFA
l.recog = recog
+
// The current token's starting index into the character stream.
// Shared across DFA to ATN simulation in case the ATN fails and the
// DFA did not have a previous accept state. In l case, we use the
// ATN-generated exception object.
l.startIndex = -1
- // line number 1..n within the input///
+
+ // line number 1..n within the input
l.Line = 1
+
// The index of the character relative to the beginning of the line
- // 0..n-1///
+ // 0..n-1
l.CharPositionInLine = 0
+
l.mode = LexerDefaultMode
+
// Used during DFA/ATN exec to record the most recent accept configuration
// info
l.prevAccept = NewSimState()
- // done
+
return l
}
@@ -114,7 +120,7 @@ func (l *LexerATNSimulator) reset() {
func (l *LexerATNSimulator) MatchATN(input CharStream) int {
startState := l.atn.modeToStartState[l.mode]
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("MatchATN mode " + strconv.Itoa(l.mode) + " start: " + startState.String())
}
oldMode := l.mode
@@ -126,7 +132,7 @@ func (l *LexerATNSimulator) MatchATN(input CharStream) int {
predict := l.execATN(input, next)
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("DFA after MatchATN: " + l.decisionToDFA[oldMode].ToLexerString())
}
return predict
@@ -134,18 +140,18 @@ func (l *LexerATNSimulator) MatchATN(input CharStream) int {
func (l *LexerATNSimulator) execATN(input CharStream, ds0 *DFAState) int {
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("start state closure=" + ds0.configs.String())
}
if ds0.isAcceptState {
- // allow zero-length tokens
+ // allow zero-Length tokens
l.captureSimState(l.prevAccept, input, ds0)
}
t := input.LA(1)
s := ds0 // s is current/from DFA state
for { // while more work
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("execATN loop starting closure: " + s.configs.String())
}
@@ -188,7 +194,7 @@ func (l *LexerATNSimulator) execATN(input CharStream, ds0 *DFAState) int {
}
}
t = input.LA(1)
- s = target // flip current DFA target becomes Newsrc/from state
+ s = target // flip current DFA target becomes new src/from state
}
return l.failOrAccept(l.prevAccept, input, s.configs, t)
@@ -214,43 +220,39 @@ func (l *LexerATNSimulator) getExistingTargetState(s *DFAState, t int) *DFAState
return nil
}
target := s.getIthEdge(t - LexerATNSimulatorMinDFAEdge)
- if LexerATNSimulatorDebug && target != nil {
+ if runtimeConfig.lexerATNSimulatorDebug && target != nil {
fmt.Println("reuse state " + strconv.Itoa(s.stateNumber) + " edge to " + strconv.Itoa(target.stateNumber))
}
return target
}
-// Compute a target state for an edge in the DFA, and attempt to add the
-// computed state and corresponding edge to the DFA.
+// computeTargetState computes a target state for an edge in the [DFA], and attempt to add the
+// computed state and corresponding edge to the [DFA].
//
-// @param input The input stream
-// @param s The current DFA state
-// @param t The next input symbol
-//
-// @return The computed target DFA state for the given input symbol
-// {@code t}. If {@code t} does not lead to a valid DFA state, l method
-// returns {@link //ERROR}.
+// The func returns the computed target [DFA] state for the given input symbol t.
+// If this does not lead to a valid [DFA] state, this method
+// returns ATNSimulatorError.
func (l *LexerATNSimulator) computeTargetState(input CharStream, s *DFAState, t int) *DFAState {
reach := NewOrderedATNConfigSet()
// if we don't find an existing DFA state
// Fill reach starting from closure, following t transitions
- l.getReachableConfigSet(input, s.configs, reach.BaseATNConfigSet, t)
+ l.getReachableConfigSet(input, s.configs, reach, t)
if len(reach.configs) == 0 { // we got nowhere on t from s
if !reach.hasSemanticContext {
// we got nowhere on t, don't panic out l knowledge it'd
- // cause a failover from DFA later.
+ // cause a fail-over from DFA later.
l.addDFAEdge(s, t, ATNSimulatorError, nil)
}
// stop when we can't Match any more char
return ATNSimulatorError
}
// Add an edge from s to target DFA found/created for reach
- return l.addDFAEdge(s, t, nil, reach.BaseATNConfigSet)
+ return l.addDFAEdge(s, t, nil, reach)
}
-func (l *LexerATNSimulator) failOrAccept(prevAccept *SimState, input CharStream, reach ATNConfigSet, t int) int {
+func (l *LexerATNSimulator) failOrAccept(prevAccept *SimState, input CharStream, reach *ATNConfigSet, t int) int {
if l.prevAccept.dfaState != nil {
lexerActionExecutor := prevAccept.dfaState.lexerActionExecutor
l.accept(input, lexerActionExecutor, l.startIndex, prevAccept.index, prevAccept.line, prevAccept.column)
@@ -265,34 +267,35 @@ func (l *LexerATNSimulator) failOrAccept(prevAccept *SimState, input CharStream,
panic(NewLexerNoViableAltException(l.recog, input, l.startIndex, reach))
}
-// Given a starting configuration set, figure out all ATN configurations
-// we can reach upon input {@code t}. Parameter {@code reach} is a return
-// parameter.
-func (l *LexerATNSimulator) getReachableConfigSet(input CharStream, closure ATNConfigSet, reach ATNConfigSet, t int) {
+// getReachableConfigSet when given a starting configuration set, figures out all [ATN] configurations
+// we can reach upon input t.
+//
+// Parameter reach is a return parameter.
+func (l *LexerATNSimulator) getReachableConfigSet(input CharStream, closure *ATNConfigSet, reach *ATNConfigSet, t int) {
// l is used to Skip processing for configs which have a lower priority
- // than a config that already reached an accept state for the same rule
+ // than a runtimeConfig that already reached an accept state for the same rule
SkipAlt := ATNInvalidAltNumber
- for _, cfg := range closure.GetItems() {
- currentAltReachedAcceptState := (cfg.GetAlt() == SkipAlt)
- if currentAltReachedAcceptState && cfg.(*LexerATNConfig).passedThroughNonGreedyDecision {
+ for _, cfg := range closure.configs {
+ currentAltReachedAcceptState := cfg.GetAlt() == SkipAlt
+ if currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision {
continue
}
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
- fmt.Printf("testing %s at %s\n", l.GetTokenName(t), cfg.String()) // l.recog, true))
+ fmt.Printf("testing %s at %s\n", l.GetTokenName(t), cfg.String())
}
for _, trans := range cfg.GetState().GetTransitions() {
target := l.getReachableTarget(trans, t)
if target != nil {
- lexerActionExecutor := cfg.(*LexerATNConfig).lexerActionExecutor
+ lexerActionExecutor := cfg.lexerActionExecutor
if lexerActionExecutor != nil {
lexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.Index() - l.startIndex)
}
- treatEOFAsEpsilon := (t == TokenEOF)
- config := NewLexerATNConfig3(cfg.(*LexerATNConfig), target, lexerActionExecutor)
+ treatEOFAsEpsilon := t == TokenEOF
+ config := NewLexerATNConfig3(cfg, target, lexerActionExecutor)
if l.closure(input, config, reach,
currentAltReachedAcceptState, true, treatEOFAsEpsilon) {
// any remaining configs for l alt have a lower priority
@@ -305,7 +308,7 @@ func (l *LexerATNSimulator) getReachableConfigSet(input CharStream, closure ATNC
}
func (l *LexerATNSimulator) accept(input CharStream, lexerActionExecutor *LexerActionExecutor, startIndex, index, line, charPos int) {
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Printf("ACTION %v\n", lexerActionExecutor)
}
// seek to after last char in token
@@ -325,7 +328,7 @@ func (l *LexerATNSimulator) getReachableTarget(trans Transition, t int) ATNState
return nil
}
-func (l *LexerATNSimulator) computeStartState(input CharStream, p ATNState) *OrderedATNConfigSet {
+func (l *LexerATNSimulator) computeStartState(input CharStream, p ATNState) *ATNConfigSet {
configs := NewOrderedATNConfigSet()
for i := 0; i < len(p.GetTransitions()); i++ {
target := p.GetTransitions()[i].getTarget()
@@ -336,25 +339,24 @@ func (l *LexerATNSimulator) computeStartState(input CharStream, p ATNState) *Ord
return configs
}
-// Since the alternatives within any lexer decision are ordered by
-// preference, l method stops pursuing the closure as soon as an accept
+// closure since the alternatives within any lexer decision are ordered by
+// preference, this method stops pursuing the closure as soon as an accept
// state is reached. After the first accept state is reached by depth-first
-// search from {@code config}, all other (potentially reachable) states for
-// l rule would have a lower priority.
+// search from runtimeConfig, all other (potentially reachable) states for
+// this rule would have a lower priority.
//
-// @return {@code true} if an accept state is reached, otherwise
-// {@code false}.
-func (l *LexerATNSimulator) closure(input CharStream, config *LexerATNConfig, configs ATNConfigSet,
+// The func returns true if an accept state is reached.
+func (l *LexerATNSimulator) closure(input CharStream, config *ATNConfig, configs *ATNConfigSet,
currentAltReachedAcceptState, speculative, treatEOFAsEpsilon bool) bool {
- if LexerATNSimulatorDebug {
- fmt.Println("closure(" + config.String() + ")") // config.String(l.recog, true) + ")")
+ if runtimeConfig.lexerATNSimulatorDebug {
+ fmt.Println("closure(" + config.String() + ")")
}
_, ok := config.state.(*RuleStopState)
if ok {
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
if l.recog != nil {
fmt.Printf("closure at %s rule stop %s\n", l.recog.GetRuleNames()[config.state.GetRuleIndex()], config)
} else {
@@ -401,10 +403,10 @@ func (l *LexerATNSimulator) closure(input CharStream, config *LexerATNConfig, co
}
// side-effect: can alter configs.hasSemanticContext
-func (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *LexerATNConfig, trans Transition,
- configs ATNConfigSet, speculative, treatEOFAsEpsilon bool) *LexerATNConfig {
+func (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *ATNConfig, trans Transition,
+ configs *ATNConfigSet, speculative, treatEOFAsEpsilon bool) *ATNConfig {
- var cfg *LexerATNConfig
+ var cfg *ATNConfig
if trans.getSerializationType() == TransitionRULE {
@@ -435,10 +437,10 @@ func (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *LexerATNC
pt := trans.(*PredicateTransition)
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("EVAL rule " + strconv.Itoa(trans.(*PredicateTransition).ruleIndex) + ":" + strconv.Itoa(pt.predIndex))
}
- configs.SetHasSemanticContext(true)
+ configs.hasSemanticContext = true
if l.evaluatePredicate(input, pt.ruleIndex, pt.predIndex, speculative) {
cfg = NewLexerATNConfig4(config, trans.getTarget())
}
@@ -449,7 +451,7 @@ func (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *LexerATNC
// TODO: if the entry rule is invoked recursively, some
// actions may be executed during the recursive call. The
// problem can appear when hasEmptyPath() is true but
- // isEmpty() is false. In l case, the config needs to be
+ // isEmpty() is false. In this case, the config needs to be
// split into two contexts - one with just the empty path
// and another with everything but the empty path.
// Unfortunately, the current algorithm does not allow
@@ -476,26 +478,18 @@ func (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *LexerATNC
return cfg
}
-// Evaluate a predicate specified in the lexer.
+// evaluatePredicate eEvaluates a predicate specified in the lexer.
//
-// If {@code speculative} is {@code true}, l method was called before
-// {@link //consume} for the Matched character. This method should call
-// {@link //consume} before evaluating the predicate to ensure position
-// sensitive values, including {@link Lexer//GetText}, {@link Lexer//GetLine},
-// and {@link Lexer//getcolumn}, properly reflect the current
-// lexer state. This method should restore {@code input} and the simulator
-// to the original state before returning (i.e. undo the actions made by the
-// call to {@link //consume}.
+// If speculative is true, this method was called before
+// [consume] for the Matched character. This method should call
+// [consume] before evaluating the predicate to ensure position
+// sensitive values, including [GetText], [GetLine],
+// and [GetColumn], properly reflect the current
+// lexer state. This method should restore input and the simulator
+// to the original state before returning, i.e. undo the actions made by the
+// call to [Consume].
//
-// @param input The input stream.
-// @param ruleIndex The rule containing the predicate.
-// @param predIndex The index of the predicate within the rule.
-// @param speculative {@code true} if the current index in {@code input} is
-// one character before the predicate's location.
-//
-// @return {@code true} if the specified predicate evaluates to
-// {@code true}.
-// /
+// The func returns true if the specified predicate evaluates to true.
func (l *LexerATNSimulator) evaluatePredicate(input CharStream, ruleIndex, predIndex int, speculative bool) bool {
// assume true if no recognizer was provided
if l.recog == nil {
@@ -527,7 +521,7 @@ func (l *LexerATNSimulator) captureSimState(settings *SimState, input CharStream
settings.dfaState = dfaState
}
-func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfgs ATNConfigSet) *DFAState {
+func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfgs *ATNConfigSet) *DFAState {
if to == nil && cfgs != nil {
// leading to l call, ATNConfigSet.hasSemanticContext is used as a
// marker indicating dynamic predicate evaluation makes l edge
@@ -539,10 +533,9 @@ func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfg
// TJP notes: next time through the DFA, we see a pred again and eval.
// If that gets us to a previously created (but dangling) DFA
// state, we can continue in pure DFA mode from there.
- // /
- suppressEdge := cfgs.HasSemanticContext()
- cfgs.SetHasSemanticContext(false)
-
+ //
+ suppressEdge := cfgs.hasSemanticContext
+ cfgs.hasSemanticContext = false
to = l.addDFAState(cfgs, true)
if suppressEdge {
@@ -554,7 +547,7 @@ func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfg
// Only track edges within the DFA bounds
return to
}
- if LexerATNSimulatorDebug {
+ if runtimeConfig.lexerATNSimulatorDebug {
fmt.Println("EDGE " + from.String() + " -> " + to.String() + " upon " + strconv.Itoa(tk))
}
l.atn.edgeMu.Lock()
@@ -572,13 +565,12 @@ func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfg
// configurations already. This method also detects the first
// configuration containing an ATN rule stop state. Later, when
// traversing the DFA, we will know which rule to accept.
-func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet, suppressEdge bool) *DFAState {
+func (l *LexerATNSimulator) addDFAState(configs *ATNConfigSet, suppressEdge bool) *DFAState {
proposed := NewDFAState(-1, configs)
- var firstConfigWithRuleStopState ATNConfig
-
- for _, cfg := range configs.GetItems() {
+ var firstConfigWithRuleStopState *ATNConfig
+ for _, cfg := range configs.configs {
_, ok := cfg.GetState().(*RuleStopState)
if ok {
@@ -588,14 +580,14 @@ func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet, suppressEdge bool)
}
if firstConfigWithRuleStopState != nil {
proposed.isAcceptState = true
- proposed.lexerActionExecutor = firstConfigWithRuleStopState.(*LexerATNConfig).lexerActionExecutor
+ proposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor
proposed.setPrediction(l.atn.ruleToTokenType[firstConfigWithRuleStopState.GetState().GetRuleIndex()])
}
dfa := l.decisionToDFA[l.mode]
l.atn.stateMu.Lock()
defer l.atn.stateMu.Unlock()
- existing, present := dfa.states.Get(proposed)
+ existing, present := dfa.Get(proposed)
if present {
// This state was already present, so just return it.
@@ -605,10 +597,11 @@ func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet, suppressEdge bool)
// We need to add the new state
//
- proposed.stateNumber = dfa.states.Len()
- configs.SetReadOnly(true)
+ proposed.stateNumber = dfa.Len()
+ configs.readOnly = true
+ configs.configLookup = nil // Not needed now
proposed.configs = configs
- dfa.states.Put(proposed)
+ dfa.Put(proposed)
}
if !suppressEdge {
dfa.setS0(proposed)
@@ -620,7 +613,7 @@ func (l *LexerATNSimulator) getDFA(mode int) *DFA {
return l.decisionToDFA[mode]
}
-// Get the text Matched so far for the current token.
+// GetText returns the text [Match]ed so far for the current token.
func (l *LexerATNSimulator) GetText(input CharStream) string {
// index is first lookahead char, don't include.
return input.GetTextFromInterval(NewInterval(l.startIndex, input.Index()-1))
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/ll1_analyzer.go b/vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go
similarity index 73%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/ll1_analyzer.go
rename to vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go
index 76689615a6d..4955ac876f9 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/ll1_analyzer.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/ll1_analyzer.go
@@ -14,11 +14,11 @@ func NewLL1Analyzer(atn *ATN) *LL1Analyzer {
return la
}
-// - Special value added to the lookahead sets to indicate that we hit
-// a predicate during analysis if {@code seeThruPreds==false}.
-//
-// /
const (
+ // LL1AnalyzerHitPred is a special value added to the lookahead sets to indicate that we hit
+ // a predicate during analysis if
+ //
+ // seeThruPreds==false
LL1AnalyzerHitPred = TokenInvalidType
)
@@ -38,11 +38,12 @@ func (la *LL1Analyzer) getDecisionLookahead(s ATNState) []*IntervalSet {
count := len(s.GetTransitions())
look := make([]*IntervalSet, count)
for alt := 0; alt < count; alt++ {
+
look[alt] = NewIntervalSet()
- lookBusy := NewJStore[ATNConfig, Comparator[ATNConfig]](aConfEqInst)
- seeThruPreds := false // fail to get lookahead upon pred
- la.look1(s.GetTransitions()[alt].getTarget(), nil, BasePredictionContextEMPTY, look[alt], lookBusy, NewBitSet(), seeThruPreds, false)
- // Wipe out lookahead for la alternative if we found nothing
+ lookBusy := NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, "LL1Analyzer.getDecisionLookahead for lookBusy")
+ la.look1(s.GetTransitions()[alt].getTarget(), nil, BasePredictionContextEMPTY, look[alt], lookBusy, NewBitSet(), false, false)
+
+ // Wipe out lookahead for la alternative if we found nothing,
// or we had a predicate when we !seeThruPreds
if look[alt].length() == 0 || look[alt].contains(LL1AnalyzerHitPred) {
look[alt] = nil
@@ -51,32 +52,31 @@ func (la *LL1Analyzer) getDecisionLookahead(s ATNState) []*IntervalSet {
return look
}
-// *
-// Compute set of tokens that can follow {@code s} in the ATN in the
-// specified {@code ctx}.
+// Look computes the set of tokens that can follow s in the [ATN] in the
+// specified ctx.
//
-// If {@code ctx} is {@code nil} and the end of the rule containing
-// {@code s} is reached, {@link Token//EPSILON} is added to the result set.
-// If {@code ctx} is not {@code nil} and the end of the outermost rule is
-// reached, {@link Token//EOF} is added to the result set.
+// If ctx is nil and the end of the rule containing
+// s is reached, [EPSILON] is added to the result set.
//
-// @param s the ATN state
-// @param stopState the ATN state to stop at. This can be a
-// {@link BlockEndState} to detect epsilon paths through a closure.
-// @param ctx the complete parser context, or {@code nil} if the context
+// If ctx is not nil and the end of the outermost rule is
+// reached, [EOF] is added to the result set.
+//
+// Parameter s the ATN state, and stopState is the ATN state to stop at. This can be a
+// [BlockEndState] to detect epsilon paths through a closure.
+//
+// Parameter ctx is the complete parser context, or nil if the context
// should be ignored
//
-// @return The set of tokens that can follow {@code s} in the ATN in the
-// specified {@code ctx}.
-// /
+// The func returns the set of tokens that can follow s in the [ATN] in the
+// specified ctx.
func (la *LL1Analyzer) Look(s, stopState ATNState, ctx RuleContext) *IntervalSet {
r := NewIntervalSet()
- seeThruPreds := true // ignore preds get all lookahead
- var lookContext PredictionContext
+ var lookContext *PredictionContext
if ctx != nil {
lookContext = predictionContextFromRuleContext(s.GetATN(), ctx)
}
- la.look1(s, stopState, lookContext, r, NewJStore[ATNConfig, Comparator[ATNConfig]](aConfEqInst), NewBitSet(), seeThruPreds, true)
+ la.look1(s, stopState, lookContext, r, NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, "LL1Analyzer.Look for la.look1()"),
+ NewBitSet(), true, true)
return r
}
@@ -110,16 +110,17 @@ func (la *LL1Analyzer) Look(s, stopState ATNState, ctx RuleContext) *IntervalSet
// outermost context is reached. This parameter has no effect if {@code ctx}
// is {@code nil}.
-func (la *LL1Analyzer) look2(s, stopState ATNState, ctx PredictionContext, look *IntervalSet, lookBusy *JStore[ATNConfig, Comparator[ATNConfig]], calledRuleStack *BitSet, seeThruPreds, addEOF bool, i int) {
+func (la *LL1Analyzer) look2(_, stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]],
+ calledRuleStack *BitSet, seeThruPreds, addEOF bool, i int) {
returnState := la.atn.states[ctx.getReturnState(i)]
la.look1(returnState, stopState, ctx.GetParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF)
}
-func (la *LL1Analyzer) look1(s, stopState ATNState, ctx PredictionContext, look *IntervalSet, lookBusy *JStore[ATNConfig, Comparator[ATNConfig]], calledRuleStack *BitSet, seeThruPreds, addEOF bool) {
+func (la *LL1Analyzer) look1(s, stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]], calledRuleStack *BitSet, seeThruPreds, addEOF bool) {
- c := NewBaseATNConfig6(s, 0, ctx)
+ c := NewATNConfig6(s, 0, ctx)
if lookBusy.Contains(c) {
return
@@ -151,7 +152,7 @@ func (la *LL1Analyzer) look1(s, stopState ATNState, ctx PredictionContext, look
return
}
- if ctx != BasePredictionContextEMPTY {
+ if ctx.pcType != PredictionContextEmpty {
removed := calledRuleStack.contains(s.GetRuleIndex())
defer func() {
if removed {
@@ -202,7 +203,8 @@ func (la *LL1Analyzer) look1(s, stopState ATNState, ctx PredictionContext, look
}
}
-func (la *LL1Analyzer) look3(stopState ATNState, ctx PredictionContext, look *IntervalSet, lookBusy *JStore[ATNConfig, Comparator[ATNConfig]], calledRuleStack *BitSet, seeThruPreds, addEOF bool, t1 *RuleTransition) {
+func (la *LL1Analyzer) look3(stopState ATNState, ctx *PredictionContext, look *IntervalSet, lookBusy *JStore[*ATNConfig, Comparator[*ATNConfig]],
+ calledRuleStack *BitSet, seeThruPreds, addEOF bool, t1 *RuleTransition) {
newContext := SingletonBasePredictionContextCreate(ctx, t1.followState.GetStateNumber())
diff --git a/vendor/github.com/antlr4-go/antlr/v4/nostatistics.go b/vendor/github.com/antlr4-go/antlr/v4/nostatistics.go
new file mode 100644
index 00000000000..923c7b52c47
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/nostatistics.go
@@ -0,0 +1,47 @@
+//go:build !antlr.stats
+
+package antlr
+
+// This file is compiled when the build configuration antlr.stats is not enabled.
+// which then allows the compiler to optimize out all the code that is not used.
+const collectStats = false
+
+// goRunStats is a dummy struct used when build configuration antlr.stats is not enabled.
+type goRunStats struct {
+}
+
+var Statistics = &goRunStats{}
+
+func (s *goRunStats) AddJStatRec(_ *JStatRec) {
+ // Do nothing - compiler will optimize this out (hopefully)
+}
+
+func (s *goRunStats) CollectionAnomalies() {
+ // Do nothing - compiler will optimize this out (hopefully)
+}
+
+func (s *goRunStats) Reset() {
+ // Do nothing - compiler will optimize this out (hopefully)
+}
+
+func (s *goRunStats) Report(dir string, prefix string) error {
+ // Do nothing - compiler will optimize this out (hopefully)
+ return nil
+}
+
+func (s *goRunStats) Analyze() {
+ // Do nothing - compiler will optimize this out (hopefully)
+}
+
+type statsOption func(*goRunStats) error
+
+func (s *goRunStats) Configure(options ...statsOption) error {
+ // Do nothing - compiler will optimize this out (hopefully)
+ return nil
+}
+
+func WithTopN(topN int) statsOption {
+ return func(s *goRunStats) error {
+ return nil
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser.go b/vendor/github.com/antlr4-go/antlr/v4/parser.go
similarity index 80%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser.go
rename to vendor/github.com/antlr4-go/antlr/v4/parser.go
index d26bf063920..fb57ac15db7 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/parser.go
@@ -48,8 +48,10 @@ type BaseParser struct {
_SyntaxErrors int
}
-// p.is all the parsing support code essentially most of it is error
-// recovery stuff.//
+// NewBaseParser contains all the parsing support code to embed in parsers. Essentially most of it is error
+// recovery stuff.
+//
+//goland:noinspection GoUnusedExportedFunction
func NewBaseParser(input TokenStream) *BaseParser {
p := new(BaseParser)
@@ -58,39 +60,46 @@ func NewBaseParser(input TokenStream) *BaseParser {
// The input stream.
p.input = nil
+
// The error handling strategy for the parser. The default value is a new
// instance of {@link DefaultErrorStrategy}.
p.errHandler = NewDefaultErrorStrategy()
p.precedenceStack = make([]int, 0)
p.precedenceStack.Push(0)
- // The {@link ParserRuleContext} object for the currently executing rule.
+
+ // The ParserRuleContext object for the currently executing rule.
// p.is always non-nil during the parsing process.
p.ctx = nil
- // Specifies whether or not the parser should construct a parse tree during
+
+ // Specifies whether the parser should construct a parse tree during
// the parsing process. The default value is {@code true}.
p.BuildParseTrees = true
- // When {@link //setTrace}{@code (true)} is called, a reference to the
- // {@link TraceListener} is stored here so it can be easily removed in a
- // later call to {@link //setTrace}{@code (false)}. The listener itself is
+
+ // When setTrace(true) is called, a reference to the
+ // TraceListener is stored here, so it can be easily removed in a
+ // later call to setTrace(false). The listener itself is
// implemented as a parser listener so p.field is not directly used by
// other parser methods.
p.tracer = nil
- // The list of {@link ParseTreeListener} listeners registered to receive
+
+ // The list of ParseTreeListener listeners registered to receive
// events during the parse.
p.parseListeners = nil
+
// The number of syntax errors Reported during parsing. p.value is
- // incremented each time {@link //NotifyErrorListeners} is called.
+ // incremented each time NotifyErrorListeners is called.
p._SyntaxErrors = 0
p.SetInputStream(input)
return p
}
-// p.field maps from the serialized ATN string to the deserialized {@link
-// ATN} with
+// This field maps from the serialized ATN string to the deserialized [ATN] with
// bypass alternatives.
//
-// @see ATNDeserializationOptions//isGenerateRuleBypassTransitions()
+// [ATNDeserializationOptions.isGenerateRuleBypassTransitions]
+//
+//goland:noinspection GoUnusedGlobalVariable
var bypassAltsAtnCache = make(map[string]int)
// reset the parser's state//
@@ -143,10 +152,13 @@ func (p *BaseParser) Match(ttype int) Token {
p.Consume()
} else {
t = p.errHandler.RecoverInline(p)
+ if p.HasError() {
+ return nil
+ }
if p.BuildParseTrees && t.GetTokenIndex() == -1 {
- // we must have conjured up a Newtoken during single token
- // insertion
- // if it's not the current symbol
+
+ // we must have conjured up a new token during single token
+ // insertion if it's not the current symbol
p.ctx.AddErrorNode(t)
}
}
@@ -178,9 +190,8 @@ func (p *BaseParser) MatchWildcard() Token {
} else {
t = p.errHandler.RecoverInline(p)
if p.BuildParseTrees && t.GetTokenIndex() == -1 {
- // we must have conjured up a Newtoken during single token
- // insertion
- // if it's not the current symbol
+ // we must have conjured up a new token during single token
+ // insertion if it's not the current symbol
p.ctx.AddErrorNode(t)
}
}
@@ -202,33 +213,27 @@ func (p *BaseParser) GetParseListeners() []ParseTreeListener {
return p.parseListeners
}
-// Registers {@code listener} to receive events during the parsing process.
+// AddParseListener registers listener to receive events during the parsing process.
//
-// To support output-preserving grammar transformations (including but not
+// To support output-preserving grammar transformations (including but not
// limited to left-recursion removal, automated left-factoring, and
// optimized code generation), calls to listener methods during the parse
// may differ substantially from calls made by
-// {@link ParseTreeWalker//DEFAULT} used after the parse is complete. In
+// [ParseTreeWalker.DEFAULT] used after the parse is complete. In
// particular, rule entry and exit events may occur in a different order
// during the parse than after the parser. In addition, calls to certain
-// rule entry methods may be omitted.
-//
-// With the following specific exceptions, calls to listener events are
-// deterministic, i.e. for identical input the calls to listener
-// methods will be the same.
-//
-//
-// - Alterations to the grammar used to generate code may change the
-// behavior of the listener calls.
-// - Alterations to the command line options passed to ANTLR 4 when
-// generating the parser may change the behavior of the listener calls.
-// - Changing the version of the ANTLR Tool used to generate the parser
-// may change the behavior of the listener calls.
-//
+// rule entry methods may be omitted.
//
-// @param listener the listener to add
+// With the following specific exceptions, calls to listener events are
+// deterministic, i.e. for identical input the calls to listener
+// methods will be the same.
//
-// @panics nilPointerException if {@code} listener is {@code nil}
+// - Alterations to the grammar used to generate code may change the
+// behavior of the listener calls.
+// - Alterations to the command line options passed to ANTLR 4 when
+// generating the parser may change the behavior of the listener calls.
+// - Changing the version of the ANTLR Tool used to generate the parser
+// may change the behavior of the listener calls.
func (p *BaseParser) AddParseListener(listener ParseTreeListener) {
if listener == nil {
panic("listener")
@@ -239,11 +244,10 @@ func (p *BaseParser) AddParseListener(listener ParseTreeListener) {
p.parseListeners = append(p.parseListeners, listener)
}
-// Remove {@code listener} from the list of parse listeners.
+// RemoveParseListener removes listener from the list of parse listeners.
//
-// If {@code listener} is {@code nil} or has not been added as a parse
-// listener, p.method does nothing.
-// @param listener the listener to remove
+// If listener is nil or has not been added as a parse
+// listener, this func does nothing.
func (p *BaseParser) RemoveParseListener(listener ParseTreeListener) {
if p.parseListeners != nil {
@@ -274,7 +278,7 @@ func (p *BaseParser) removeParseListeners() {
p.parseListeners = nil
}
-// Notify any parse listeners of an enter rule event.
+// TriggerEnterRuleEvent notifies all parse listeners of an enter rule event.
func (p *BaseParser) TriggerEnterRuleEvent() {
if p.parseListeners != nil {
ctx := p.ctx
@@ -285,9 +289,7 @@ func (p *BaseParser) TriggerEnterRuleEvent() {
}
}
-// Notify any parse listeners of an exit rule event.
-//
-// @see //addParseListener
+// TriggerExitRuleEvent notifies any parse listeners of an exit rule event.
func (p *BaseParser) TriggerExitRuleEvent() {
if p.parseListeners != nil {
// reverse order walk of listeners
@@ -314,19 +316,16 @@ func (p *BaseParser) GetTokenFactory() TokenFactory {
return p.input.GetTokenSource().GetTokenFactory()
}
-// Tell our token source and error strategy about a Newway to create tokens.//
+// setTokenFactory is used to tell our token source and error strategy about a new way to create tokens.
func (p *BaseParser) setTokenFactory(factory TokenFactory) {
p.input.GetTokenSource().setTokenFactory(factory)
}
-// The ATN with bypass alternatives is expensive to create so we create it
+// GetATNWithBypassAlts - the ATN with bypass alternatives is expensive to create, so we create it
// lazily.
-//
-// @panics UnsupportedOperationException if the current parser does not
-// implement the {@link //getSerializedATN()} method.
func (p *BaseParser) GetATNWithBypassAlts() {
- // TODO
+ // TODO - Implement this?
panic("Not implemented!")
// serializedAtn := p.getSerializedATN()
@@ -354,6 +353,7 @@ func (p *BaseParser) GetATNWithBypassAlts() {
// String id = m.Get("ID")
//
+//goland:noinspection GoUnusedParameter
func (p *BaseParser) compileParseTreePattern(pattern, patternRuleIndex, lexer Lexer) {
panic("NewParseTreePatternMatcher not implemented!")
@@ -386,14 +386,16 @@ func (p *BaseParser) GetTokenStream() TokenStream {
return p.input
}
-// Set the token stream and reset the parser.//
+// SetTokenStream installs input as the token stream and resets the parser.
func (p *BaseParser) SetTokenStream(input TokenStream) {
p.input = nil
p.reset()
p.input = input
}
-// Match needs to return the current input symbol, which gets put
+// GetCurrentToken returns the current token at LT(1).
+//
+// [Match] needs to return the current input symbol, which gets put
// into the label for the associated token ref e.g., x=ID.
func (p *BaseParser) GetCurrentToken() Token {
return p.input.LT(1)
@@ -446,7 +448,7 @@ func (p *BaseParser) addContextToParseTree() {
}
}
-func (p *BaseParser) EnterRule(localctx ParserRuleContext, state, ruleIndex int) {
+func (p *BaseParser) EnterRule(localctx ParserRuleContext, state, _ int) {
p.SetState(state)
p.ctx = localctx
p.ctx.SetStart(p.input.LT(1))
@@ -474,7 +476,7 @@ func (p *BaseParser) ExitRule() {
func (p *BaseParser) EnterOuterAlt(localctx ParserRuleContext, altNum int) {
localctx.SetAltNumber(altNum)
- // if we have Newlocalctx, make sure we replace existing ctx
+ // if we have a new localctx, make sure we replace existing ctx
// that is previous child of parse tree
if p.BuildParseTrees && p.ctx != localctx {
if p.ctx.GetParent() != nil {
@@ -498,7 +500,7 @@ func (p *BaseParser) GetPrecedence() int {
return p.precedenceStack[len(p.precedenceStack)-1]
}
-func (p *BaseParser) EnterRecursionRule(localctx ParserRuleContext, state, ruleIndex, precedence int) {
+func (p *BaseParser) EnterRecursionRule(localctx ParserRuleContext, state, _, precedence int) {
p.SetState(state)
p.precedenceStack.Push(precedence)
p.ctx = localctx
@@ -512,7 +514,7 @@ func (p *BaseParser) EnterRecursionRule(localctx ParserRuleContext, state, ruleI
//
// Like {@link //EnterRule} but for recursive rules.
-func (p *BaseParser) PushNewRecursionContext(localctx ParserRuleContext, state, ruleIndex int) {
+func (p *BaseParser) PushNewRecursionContext(localctx ParserRuleContext, state, _ int) {
previous := p.ctx
previous.SetParent(localctx)
previous.SetInvokingState(state)
@@ -530,7 +532,7 @@ func (p *BaseParser) PushNewRecursionContext(localctx ParserRuleContext, state,
}
func (p *BaseParser) UnrollRecursionContexts(parentCtx ParserRuleContext) {
- p.precedenceStack.Pop()
+ _, _ = p.precedenceStack.Pop()
p.ctx.SetStop(p.input.LT(-1))
retCtx := p.ctx // save current ctx (return value)
// unroll so ctx is as it was before call to recursive method
@@ -561,29 +563,22 @@ func (p *BaseParser) GetInvokingContext(ruleIndex int) ParserRuleContext {
return nil
}
-func (p *BaseParser) Precpred(localctx RuleContext, precedence int) bool {
+func (p *BaseParser) Precpred(_ RuleContext, precedence int) bool {
return precedence >= p.precedenceStack[len(p.precedenceStack)-1]
}
+//goland:noinspection GoUnusedParameter
func (p *BaseParser) inContext(context ParserRuleContext) bool {
// TODO: useful in parser?
return false
}
-//
-// Checks whether or not {@code symbol} can follow the current state in the
-// ATN. The behavior of p.method is equivalent to the following, but is
+// IsExpectedToken checks whether symbol can follow the current state in the
+// {ATN}. The behavior of p.method is equivalent to the following, but is
// implemented such that the complete context-sensitive follow set does not
// need to be explicitly constructed.
//
-//
-// return getExpectedTokens().contains(symbol)
-//
-//
-// @param symbol the symbol type to check
-// @return {@code true} if {@code symbol} can follow the current state in
-// the ATN, otherwise {@code false}.
-
+// return getExpectedTokens().contains(symbol)
func (p *BaseParser) IsExpectedToken(symbol int) bool {
atn := p.Interpreter.atn
ctx := p.ctx
@@ -611,11 +606,9 @@ func (p *BaseParser) IsExpectedToken(symbol int) bool {
return false
}
-// Computes the set of input symbols which could follow the current parser
-// state and context, as given by {@link //GetState} and {@link //GetContext},
+// GetExpectedTokens and returns the set of input symbols which could follow the current parser
+// state and context, as given by [GetState] and [GetContext],
// respectively.
-//
-// @see ATN//getExpectedTokens(int, RuleContext)
func (p *BaseParser) GetExpectedTokens() *IntervalSet {
return p.Interpreter.atn.getExpectedTokens(p.state, p.ctx)
}
@@ -626,7 +619,7 @@ func (p *BaseParser) GetExpectedTokensWithinCurrentRule() *IntervalSet {
return atn.NextTokens(s, nil)
}
-// Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found.//
+// GetRuleIndex get a rule's index (i.e., RULE_ruleName field) or -1 if not found.
func (p *BaseParser) GetRuleIndex(ruleName string) int {
var ruleIndex, ok = p.GetRuleIndexMap()[ruleName]
if ok {
@@ -636,13 +629,10 @@ func (p *BaseParser) GetRuleIndex(ruleName string) int {
return -1
}
-// Return List<String> of the rule names in your parser instance
+// GetRuleInvocationStack returns a list of the rule names in your parser instance
// leading up to a call to the current rule. You could override if
// you want more details such as the file/line info of where
// in the ATN a rule is invoked.
-//
-// this very useful for error messages.
-
func (p *BaseParser) GetRuleInvocationStack(c ParserRuleContext) []string {
if c == nil {
c = p.ctx
@@ -668,16 +658,16 @@ func (p *BaseParser) GetRuleInvocationStack(c ParserRuleContext) []string {
return stack
}
-// For debugging and other purposes.//
+// GetDFAStrings returns a list of all DFA states used for debugging purposes
func (p *BaseParser) GetDFAStrings() string {
return fmt.Sprint(p.Interpreter.decisionToDFA)
}
-// For debugging and other purposes.//
+// DumpDFA prints the whole of the DFA for debugging
func (p *BaseParser) DumpDFA() {
seenOne := false
for _, dfa := range p.Interpreter.decisionToDFA {
- if dfa.states.Len() > 0 {
+ if dfa.Len() > 0 {
if seenOne {
fmt.Println()
}
@@ -692,8 +682,10 @@ func (p *BaseParser) GetSourceName() string {
return p.GrammarFileName
}
-// During a parse is sometimes useful to listen in on the rule entry and exit
-// events as well as token Matches. p.is for quick and dirty debugging.
+// SetTrace installs a trace listener for the parse.
+//
+// During a parse it is sometimes useful to listen in on the rule entry and exit
+// events as well as token Matches. This is for quick and dirty debugging.
func (p *BaseParser) SetTrace(trace *TraceListener) {
if trace == nil {
p.RemoveParseListener(p.tracer)
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser_atn_simulator.go b/vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go
similarity index 64%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser_atn_simulator.go
rename to vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go
index 8bcc46a0d99..ae2869692a6 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser_atn_simulator.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/parser_atn_simulator.go
@@ -10,31 +10,51 @@ import (
"strings"
)
-var (
- ParserATNSimulatorDebug = false
- ParserATNSimulatorTraceATNSim = false
- ParserATNSimulatorDFADebug = false
- ParserATNSimulatorRetryDebug = false
- TurnOffLRLoopEntryBranchOpt = false
-)
+var ()
+
+// ClosureBusy is a store of ATNConfigs and is a tiny abstraction layer over
+// a standard JStore so that we can use Lazy instantiation of the JStore, mostly
+// to avoid polluting the stats module with a ton of JStore instances with nothing in them.
+type ClosureBusy struct {
+ bMap *JStore[*ATNConfig, Comparator[*ATNConfig]]
+ desc string
+}
+
+// NewClosureBusy creates a new ClosureBusy instance used to avoid infinite recursion for right-recursive rules
+func NewClosureBusy(desc string) *ClosureBusy {
+ return &ClosureBusy{
+ desc: desc,
+ }
+}
+
+func (c *ClosureBusy) Put(config *ATNConfig) (*ATNConfig, bool) {
+ if c.bMap == nil {
+ c.bMap = NewJStore[*ATNConfig, Comparator[*ATNConfig]](aConfEqInst, ClosureBusyCollection, c.desc)
+ }
+ return c.bMap.Put(config)
+}
type ParserATNSimulator struct {
- *BaseATNSimulator
+ BaseATNSimulator
parser Parser
predictionMode int
input TokenStream
startIndex int
dfa *DFA
- mergeCache *DoubleDict
+ mergeCache *JPCMap
outerContext ParserRuleContext
}
+//goland:noinspection GoUnusedExportedFunction
func NewParserATNSimulator(parser Parser, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *ParserATNSimulator {
- p := new(ParserATNSimulator)
-
- p.BaseATNSimulator = NewBaseATNSimulator(atn, sharedContextCache)
+ p := &ParserATNSimulator{
+ BaseATNSimulator: BaseATNSimulator{
+ atn: atn,
+ sharedContextCache: sharedContextCache,
+ },
+ }
p.parser = parser
p.decisionToDFA = decisionToDFA
@@ -46,12 +66,12 @@ func NewParserATNSimulator(parser Parser, atn *ATN, decisionToDFA []*DFA, shared
p.outerContext = nil
p.dfa = nil
// Each prediction operation uses a cache for merge of prediction contexts.
- // Don't keep around as it wastes huge amounts of memory. DoubleKeyMap
- // isn't Synchronized but we're ok since two threads shouldn't reuse same
- // parser/atnsim object because it can only handle one input at a time.
- // This maps graphs a and b to merged result c. (a,b)&rarrc. We can avoid
- // the merge if we ever see a and b again. Note that (b,a)&rarrc should
- // also be examined during cache lookup.
+ // Don't keep around as it wastes huge amounts of memory. [JPCMap]
+ // isn't Synchronized, but we're ok since two threads shouldn't reuse same
+ // parser/atn-simulator object because it can only handle one input at a time.
+ // This maps graphs a and b to merged result c. (a,b) -> c. We can avoid
+ // the merge if we ever see a and b again. Note that (b,a) -> c should
+ // also be examined during cache lookup.
//
p.mergeCache = nil
@@ -69,14 +89,14 @@ func (p *ParserATNSimulator) SetPredictionMode(v int) {
func (p *ParserATNSimulator) reset() {
}
-func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, outerContext ParserRuleContext) int {
- if ParserATNSimulatorDebug || ParserATNSimulatorTraceATNSim {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) AdaptivePredict(parser *BaseParser, input TokenStream, decision int, outerContext ParserRuleContext) int {
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Println("adaptivePredict decision " + strconv.Itoa(decision) +
" exec LA(1)==" + p.getLookaheadName(input) +
" line " + strconv.Itoa(input.LT(1).GetLine()) + ":" +
strconv.Itoa(input.LT(1).GetColumn()))
}
-
p.input = input
p.startIndex = input.Index()
p.outerContext = outerContext
@@ -88,7 +108,15 @@ func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, ou
defer func() {
p.dfa = nil
- p.mergeCache = nil // wack cache after each prediction
+ p.mergeCache = nil // whack cache after each prediction
+ // Do not attempt to run a GC now that we're done with the cache as makes the
+ // GC overhead terrible for badly formed grammars and has little effect on well formed
+ // grammars.
+ // I have made some extra effort to try and reduce memory pressure by reusing allocations when
+ // possible. However, it can only have a limited effect. The real solution is to encourage grammar
+ // authors to think more carefully about their grammar and to use the new antlr.stats tag to inspect
+ // what is happening at runtime, along with using the error listener to report ambiguities.
+
input.Seek(index)
input.Release(m)
}()
@@ -113,7 +141,7 @@ func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, ou
if outerContext == nil {
outerContext = ParserRuleContextEmpty
}
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("predictATN decision " + strconv.Itoa(dfa.decision) +
" exec LA(1)==" + p.getLookaheadName(input) +
", outerContext=" + outerContext.String(p.parser.GetRuleNames(), nil))
@@ -142,47 +170,52 @@ func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, ou
p.atn.stateMu.Unlock()
}
- alt := p.execATN(dfa, s0, input, index, outerContext)
- if ParserATNSimulatorDebug {
+ alt, re := p.execATN(dfa, s0, input, index, outerContext)
+ parser.SetError(re)
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("DFA after predictATN: " + dfa.String(p.parser.GetLiteralNames(), nil))
}
return alt
}
-// Performs ATN simulation to compute a predicted alternative based
-// upon the remaining input, but also updates the DFA cache to avoid
-// having to traverse the ATN again for the same input sequence.
-
+// execATN performs ATN simulation to compute a predicted alternative based
+// upon the remaining input, but also updates the DFA cache to avoid
+// having to traverse the ATN again for the same input sequence.
+//
// There are some key conditions we're looking for after computing a new
// set of ATN configs (proposed DFA state):
-// if the set is empty, there is no viable alternative for current symbol
-// does the state uniquely predict an alternative?
-// does the state have a conflict that would prevent us from
-// putting it on the work list?
-
+//
+// - If the set is empty, there is no viable alternative for current symbol
+// - Does the state uniquely predict an alternative?
+// - Does the state have a conflict that would prevent us from
+// putting it on the work list?
+//
// We also have some key operations to do:
-// add an edge from previous DFA state to potentially NewDFA state, D,
-// upon current symbol but only if adding to work list, which means in all
-// cases except no viable alternative (and possibly non-greedy decisions?)
-// collecting predicates and adding semantic context to DFA accept states
-// adding rule context to context-sensitive DFA accept states
-// consuming an input symbol
-// Reporting a conflict
-// Reporting an ambiguity
-// Reporting a context sensitivity
-// Reporting insufficient predicates
-
-// cover these cases:
//
-// dead end
-// single alt
-// single alt + preds
-// conflict
-// conflict + preds
-func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream, startIndex int, outerContext ParserRuleContext) int {
-
- if ParserATNSimulatorDebug || ParserATNSimulatorTraceATNSim {
+// - Add an edge from previous DFA state to potentially NewDFA state, D,
+// - Upon current symbol but only if adding to work list, which means in all
+// cases except no viable alternative (and possibly non-greedy decisions?)
+// - Collecting predicates and adding semantic context to DFA accept states
+// - adding rule context to context-sensitive DFA accept states
+// - Consuming an input symbol
+// - Reporting a conflict
+// - Reporting an ambiguity
+// - Reporting a context sensitivity
+// - Reporting insufficient predicates
+//
+// Cover these cases:
+//
+// - dead end
+// - single alt
+// - single alt + predicates
+// - conflict
+// - conflict + predicates
+//
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream, startIndex int, outerContext ParserRuleContext) (int, RecognitionException) {
+
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Println("execATN decision " + strconv.Itoa(dfa.decision) +
", DFA state " + s0.String() +
", LA(1)==" + p.getLookaheadName(input) +
@@ -191,7 +224,7 @@ func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream,
previousD := s0
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("s0 = " + s0.String())
}
t := input.LA(1)
@@ -214,17 +247,17 @@ func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream,
input.Seek(startIndex)
alt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previousD.configs, outerContext)
if alt != ATNInvalidAltNumber {
- return alt
+ return alt, nil
}
-
- panic(e)
+ p.parser.SetError(e)
+ return ATNInvalidAltNumber, e
}
if D.requiresFullContext && p.predictionMode != PredictionModeSLL {
// IF PREDS, MIGHT RESOLVE TO SINGLE ALT => SLL (or syntax error)
- conflictingAlts := D.configs.GetConflictingAlts()
+ conflictingAlts := D.configs.conflictingAlts
if D.predicates != nil {
- if ParserATNSimulatorDebug {
- fmt.Println("DFA state has preds in DFA sim LL failover")
+ if runtimeConfig.parserATNSimulatorDebug {
+ fmt.Println("DFA state has preds in DFA sim LL fail-over")
}
conflictIndex := input.Index()
if conflictIndex != startIndex {
@@ -232,10 +265,10 @@ func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream,
}
conflictingAlts = p.evalSemanticContext(D.predicates, outerContext, true)
if conflictingAlts.length() == 1 {
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("Full LL avoided")
}
- return conflictingAlts.minValue()
+ return conflictingAlts.minValue(), nil
}
if conflictIndex != startIndex {
// restore the index so Reporting the fallback to full
@@ -243,18 +276,18 @@ func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream,
input.Seek(conflictIndex)
}
}
- if ParserATNSimulatorDFADebug {
+ if runtimeConfig.parserATNSimulatorDFADebug {
fmt.Println("ctx sensitive state " + outerContext.String(nil, nil) + " in " + D.String())
}
fullCtx := true
s0Closure := p.computeStartState(dfa.atnStartState, outerContext, fullCtx)
p.ReportAttemptingFullContext(dfa, conflictingAlts, D.configs, startIndex, input.Index())
- alt := p.execATNWithFullContext(dfa, D, s0Closure, input, startIndex, outerContext)
- return alt
+ alt, re := p.execATNWithFullContext(dfa, D, s0Closure, input, startIndex, outerContext)
+ return alt, re
}
if D.isAcceptState {
if D.predicates == nil {
- return D.prediction
+ return D.prediction, nil
}
stopIndex := input.Index()
input.Seek(startIndex)
@@ -262,13 +295,13 @@ func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream,
switch alts.length() {
case 0:
- panic(p.noViableAlt(input, outerContext, D.configs, startIndex))
+ return ATNInvalidAltNumber, p.noViableAlt(input, outerContext, D.configs, startIndex)
case 1:
- return alts.minValue()
+ return alts.minValue(), nil
default:
// Report ambiguity after predicate evaluation to make sure the correct set of ambig alts is Reported.
p.ReportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs)
- return alts.minValue()
+ return alts.minValue(), nil
}
}
previousD = D
@@ -314,7 +347,8 @@ func (p *ParserATNSimulator) getExistingTargetState(previousD *DFAState, t int)
// @return The computed target DFA state for the given input symbol
// {@code t}. If {@code t} does not lead to a valid DFA state, p method
// returns {@link //ERROR}.
-
+//
+//goland:noinspection GoBoolExpressions
func (p *ParserATNSimulator) computeTargetState(dfa *DFA, previousD *DFAState, t int) *DFAState {
reach := p.computeReachSet(previousD.configs, t, false)
@@ -322,12 +356,12 @@ func (p *ParserATNSimulator) computeTargetState(dfa *DFA, previousD *DFAState, t
p.addDFAEdge(dfa, previousD, t, ATNSimulatorError)
return ATNSimulatorError
}
- // create Newtarget state we'll add to DFA after it's complete
+ // create new target state we'll add to DFA after it's complete
D := NewDFAState(-1, reach)
predictedAlt := p.getUniqueAlt(reach)
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
altSubSets := PredictionModegetConflictingAltSubsets(reach)
fmt.Println("SLL altSubSets=" + fmt.Sprint(altSubSets) +
", previous=" + previousD.configs.String() +
@@ -340,17 +374,17 @@ func (p *ParserATNSimulator) computeTargetState(dfa *DFA, previousD *DFAState, t
if predictedAlt != ATNInvalidAltNumber {
// NO CONFLICT, UNIQUELY PREDICTED ALT
D.isAcceptState = true
- D.configs.SetUniqueAlt(predictedAlt)
+ D.configs.uniqueAlt = predictedAlt
D.setPrediction(predictedAlt)
} else if PredictionModehasSLLConflictTerminatingPrediction(p.predictionMode, reach) {
// MORE THAN ONE VIABLE ALTERNATIVE
- D.configs.SetConflictingAlts(p.getConflictingAlts(reach))
+ D.configs.conflictingAlts = p.getConflictingAlts(reach)
D.requiresFullContext = true
// in SLL-only mode, we will stop at p state and return the minimum alt
D.isAcceptState = true
- D.setPrediction(D.configs.GetConflictingAlts().minValue())
+ D.setPrediction(D.configs.conflictingAlts.minValue())
}
- if D.isAcceptState && D.configs.HasSemanticContext() {
+ if D.isAcceptState && D.configs.hasSemanticContext {
p.predicateDFAState(D, p.atn.getDecisionState(dfa.decision))
if D.predicates != nil {
D.setPrediction(ATNInvalidAltNumber)
@@ -381,15 +415,17 @@ func (p *ParserATNSimulator) predicateDFAState(dfaState *DFAState, decisionState
}
// comes back with reach.uniqueAlt set to a valid alt
-func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 ATNConfigSet, input TokenStream, startIndex int, outerContext ParserRuleContext) int {
+//
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 *ATNConfigSet, input TokenStream, startIndex int, outerContext ParserRuleContext) (int, RecognitionException) {
- if ParserATNSimulatorDebug || ParserATNSimulatorTraceATNSim {
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Println("execATNWithFullContext " + s0.String())
}
fullCtx := true
foundExactAmbig := false
- var reach ATNConfigSet
+ var reach *ATNConfigSet
previous := s0
input.Seek(startIndex)
t := input.LA(1)
@@ -407,25 +443,23 @@ func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 AT
// ATN states in SLL implies LL will also get nowhere.
// If conflict in states that dip out, choose min since we
// will get error no matter what.
- e := p.noViableAlt(input, outerContext, previous, startIndex)
input.Seek(startIndex)
alt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext)
if alt != ATNInvalidAltNumber {
- return alt
+ return alt, nil
}
-
- panic(e)
+ return alt, p.noViableAlt(input, outerContext, previous, startIndex)
}
altSubSets := PredictionModegetConflictingAltSubsets(reach)
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("LL altSubSets=" + fmt.Sprint(altSubSets) + ", predict=" +
strconv.Itoa(PredictionModegetUniqueAlt(altSubSets)) + ", resolvesToJustOneViableAlt=" +
fmt.Sprint(PredictionModeresolvesToJustOneViableAlt(altSubSets)))
}
- reach.SetUniqueAlt(p.getUniqueAlt(reach))
+ reach.uniqueAlt = p.getUniqueAlt(reach)
// unique prediction?
- if reach.GetUniqueAlt() != ATNInvalidAltNumber {
- predictedAlt = reach.GetUniqueAlt()
+ if reach.uniqueAlt != ATNInvalidAltNumber {
+ predictedAlt = reach.uniqueAlt
break
}
if p.predictionMode != PredictionModeLLExactAmbigDetection {
@@ -454,9 +488,9 @@ func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 AT
// If the configuration set uniquely predicts an alternative,
// without conflict, then we know that it's a full LL decision
// not SLL.
- if reach.GetUniqueAlt() != ATNInvalidAltNumber {
+ if reach.uniqueAlt != ATNInvalidAltNumber {
p.ReportContextSensitivity(dfa, predictedAlt, reach, startIndex, input.Index())
- return predictedAlt
+ return predictedAlt, nil
}
// We do not check predicates here because we have checked them
// on-the-fly when doing full context prediction.
@@ -469,10 +503,10 @@ func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 AT
//
// For example, we might know that we have conflicting configurations.
// But, that does not mean that there is no way forward without a
- // conflict. It's possible to have nonconflicting alt subsets as in:
-
+ // conflict. It's possible to have non-conflicting alt subsets as in:
+ //
// altSubSets=[{1, 2}, {1, 2}, {1}, {1, 2}]
-
+ //
// from
//
// [(17,1,[5 $]), (13,1,[5 10 $]), (21,1,[5 10 $]), (11,1,[$]),
@@ -487,14 +521,15 @@ func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 AT
p.ReportAmbiguity(dfa, D, startIndex, input.Index(), foundExactAmbig, reach.Alts(), reach)
- return predictedAlt
+ return predictedAlt, nil
}
-func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCtx bool) ATNConfigSet {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) computeReachSet(closure *ATNConfigSet, t int, fullCtx bool) *ATNConfigSet {
if p.mergeCache == nil {
- p.mergeCache = NewDoubleDict()
+ p.mergeCache = NewJPCMap(ReachSetCollection, "Merge cache for computeReachSet()")
}
- intermediate := NewBaseATNConfigSet(fullCtx)
+ intermediate := NewATNConfigSet(fullCtx)
// Configurations already in a rule stop state indicate reaching the end
// of the decision rule (local context) or end of the start rule (full
@@ -506,18 +541,18 @@ func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCt
// ensure that the alternative Matching the longest overall sequence is
// chosen when multiple such configurations can Match the input.
- var skippedStopStates []*BaseATNConfig
+ var skippedStopStates []*ATNConfig
// First figure out where we can reach on input t
- for _, c := range closure.GetItems() {
- if ParserATNSimulatorDebug {
+ for _, c := range closure.configs {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("testing " + p.GetTokenName(t) + " at " + c.String())
}
if _, ok := c.GetState().(*RuleStopState); ok {
if fullCtx || t == TokenEOF {
- skippedStopStates = append(skippedStopStates, c.(*BaseATNConfig))
- if ParserATNSimulatorDebug {
+ skippedStopStates = append(skippedStopStates, c)
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("added " + c.String() + " to SkippedStopStates")
}
}
@@ -527,9 +562,9 @@ func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCt
for _, trans := range c.GetState().GetTransitions() {
target := p.getReachableTarget(trans, t)
if target != nil {
- cfg := NewBaseATNConfig4(c, target)
+ cfg := NewATNConfig4(c, target)
intermediate.Add(cfg, p.mergeCache)
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("added " + cfg.String() + " to intermediate")
}
}
@@ -537,7 +572,7 @@ func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCt
}
// Now figure out where the reach operation can take us...
- var reach ATNConfigSet
+ var reach *ATNConfigSet
// This block optimizes the reach operation for intermediate sets which
// trivially indicate a termination state for the overall
@@ -565,8 +600,8 @@ func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCt
// operation on the intermediate set to compute its initial value.
//
if reach == nil {
- reach = NewBaseATNConfigSet(fullCtx)
- closureBusy := NewJStore[ATNConfig, Comparator[ATNConfig]](aConfEqInst)
+ reach = NewATNConfigSet(fullCtx)
+ closureBusy := NewClosureBusy("ParserATNSimulator.computeReachSet() make a closureBusy")
treatEOFAsEpsilon := t == TokenEOF
amount := len(intermediate.configs)
for k := 0; k < amount; k++ {
@@ -588,10 +623,10 @@ func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCt
//
// This is handled before the configurations in SkippedStopStates,
// because any configurations potentially added from that list are
- // already guaranteed to meet p condition whether or not it's
+ // already guaranteed to meet this condition whether it's
// required.
//
- reach = p.removeAllConfigsNotInRuleStopState(reach, reach == intermediate)
+ reach = p.removeAllConfigsNotInRuleStopState(reach, reach.Equals(intermediate))
}
// If SkippedStopStates!=nil, then it contains at least one
// configuration. For full-context reach operations, these
@@ -607,41 +642,40 @@ func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCt
}
}
- if ParserATNSimulatorTraceATNSim {
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Println("computeReachSet " + closure.String() + " -> " + reach.String())
}
- if len(reach.GetItems()) == 0 {
+ if len(reach.configs) == 0 {
return nil
}
return reach
}
-// Return a configuration set containing only the configurations from
-// {@code configs} which are in a {@link RuleStopState}. If all
-// configurations in {@code configs} are already in a rule stop state, p
-// method simply returns {@code configs}.
+// removeAllConfigsNotInRuleStopState returns a configuration set containing only the configurations from
+// configs which are in a [RuleStopState]. If all
+// configurations in configs are already in a rule stop state, this
+// method simply returns configs.
//
-// When {@code lookToEndOfRule} is true, p method uses
-// {@link ATN//NextTokens} for each configuration in {@code configs} which is
+// When lookToEndOfRule is true, this method uses
+// [ATN].[NextTokens] for each configuration in configs which is
// not already in a rule stop state to see if a rule stop state is reachable
-// from the configuration via epsilon-only transitions.
+// from the configuration via epsilon-only transitions.
//
-// @param configs the configuration set to update
-// @param lookToEndOfRule when true, p method checks for rule stop states
+// When lookToEndOfRule is true, this method checks for rule stop states
// reachable by epsilon-only transitions from each configuration in
-// {@code configs}.
+// configs.
//
-// @return {@code configs} if all configurations in {@code configs} are in a
-// rule stop state, otherwise return a Newconfiguration set containing only
-// the configurations from {@code configs} which are in a rule stop state
-func (p *ParserATNSimulator) removeAllConfigsNotInRuleStopState(configs ATNConfigSet, lookToEndOfRule bool) ATNConfigSet {
+// The func returns configs if all configurations in configs are in a
+// rule stop state, otherwise it returns a new configuration set containing only
+// the configurations from configs which are in a rule stop state
+func (p *ParserATNSimulator) removeAllConfigsNotInRuleStopState(configs *ATNConfigSet, lookToEndOfRule bool) *ATNConfigSet {
if PredictionModeallConfigsInRuleStopStates(configs) {
return configs
}
- result := NewBaseATNConfigSet(configs.FullContext())
- for _, config := range configs.GetItems() {
+ result := NewATNConfigSet(configs.fullCtx)
+ for _, config := range configs.configs {
if _, ok := config.GetState().(*RuleStopState); ok {
result.Add(config, p.mergeCache)
continue
@@ -650,91 +684,81 @@ func (p *ParserATNSimulator) removeAllConfigsNotInRuleStopState(configs ATNConfi
NextTokens := p.atn.NextTokens(config.GetState(), nil)
if NextTokens.contains(TokenEpsilon) {
endOfRuleState := p.atn.ruleToStopState[config.GetState().GetRuleIndex()]
- result.Add(NewBaseATNConfig4(config, endOfRuleState), p.mergeCache)
+ result.Add(NewATNConfig4(config, endOfRuleState), p.mergeCache)
}
}
}
return result
}
-func (p *ParserATNSimulator) computeStartState(a ATNState, ctx RuleContext, fullCtx bool) ATNConfigSet {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) computeStartState(a ATNState, ctx RuleContext, fullCtx bool) *ATNConfigSet {
// always at least the implicit call to start rule
initialContext := predictionContextFromRuleContext(p.atn, ctx)
- configs := NewBaseATNConfigSet(fullCtx)
- if ParserATNSimulatorDebug || ParserATNSimulatorTraceATNSim {
+ configs := NewATNConfigSet(fullCtx)
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Println("computeStartState from ATN state " + a.String() +
" initialContext=" + initialContext.String())
}
for i := 0; i < len(a.GetTransitions()); i++ {
target := a.GetTransitions()[i].getTarget()
- c := NewBaseATNConfig6(target, i+1, initialContext)
- closureBusy := NewJStore[ATNConfig, Comparator[ATNConfig]](atnConfCompInst)
+ c := NewATNConfig6(target, i+1, initialContext)
+ closureBusy := NewClosureBusy("ParserATNSimulator.computeStartState() make a closureBusy")
p.closure(c, configs, closureBusy, true, fullCtx, false)
}
return configs
}
-// This method transforms the start state computed by
-// {@link //computeStartState} to the special start state used by a
-// precedence DFA for a particular precedence value. The transformation
+// applyPrecedenceFilter transforms the start state computed by
+// [computeStartState] to the special start state used by a
+// precedence [DFA] for a particular precedence value. The transformation
// process applies the following changes to the start state's configuration
// set.
//
-//
-// - Evaluate the precedence predicates for each configuration using
-// {@link SemanticContext//evalPrecedence}.
-// - Remove all configurations which predict an alternative greater than
-// 1, for which another configuration that predicts alternative 1 is in the
-// same ATN state with the same prediction context. This transformation is
-// valid for the following reasons:
-//
-// - The closure block cannot contain any epsilon transitions which bypass
-// the body of the closure, so all states reachable via alternative 1 are
-// part of the precedence alternatives of the transformed left-recursive
-// rule.
-// - The "primary" portion of a left recursive rule cannot contain an
-// epsilon transition, so the only way an alternative other than 1 can exist
-// in a state that is also reachable via alternative 1 is by nesting calls
-// to the left-recursive rule, with the outer calls not being at the
-// preferred precedence level.
-//
-//
-//
+// 1. Evaluate the precedence predicates for each configuration using
+// [SemanticContext].evalPrecedence.
+// 2. Remove all configurations which predict an alternative greater than
+// 1, for which another configuration that predicts alternative 1 is in the
+// same ATN state with the same prediction context.
+//
+// Transformation 2 is valid for the following reasons:
+//
+// - The closure block cannot contain any epsilon transitions which bypass
+// the body of the closure, so all states reachable via alternative 1 are
+// part of the precedence alternatives of the transformed left-recursive
+// rule.
+// - The "primary" portion of a left recursive rule cannot contain an
+// epsilon transition, so the only way an alternative other than 1 can exist
+// in a state that is also reachable via alternative 1 is by nesting calls
+// to the left-recursive rule, with the outer calls not being at the
+// preferred precedence level.
+//
+// The prediction context must be considered by this filter to address
+// situations like the following:
+//
+// grammar TA
+// prog: statement* EOF
+// statement: letterA | statement letterA 'b'
+// letterA: 'a'
//
-//
-// The prediction context must be considered by p filter to address
-// situations like the following.
-//
-//
-//
-// grammar TA
-// prog: statement* EOF
-// statement: letterA | statement letterA 'b'
-// letterA: 'a'
-//
-//
-//
-// If the above grammar, the ATN state immediately before the token
-// reference {@code 'a'} in {@code letterA} is reachable from the left edge
+// In the above grammar, the [ATN] state immediately before the token
+// reference 'a' in letterA is reachable from the left edge
// of both the primary and closure blocks of the left-recursive rule
-// {@code statement}. The prediction context associated with each of these
+// statement. The prediction context associated with each of these
// configurations distinguishes between them, and prevents the alternative
-// which stepped out to {@code prog} (and then back in to {@code statement}
+// which stepped out to prog, and then back in to statement
// from being eliminated by the filter.
-//
//
-// @param configs The configuration set computed by
-// {@link //computeStartState} as the start state for the DFA.
-// @return The transformed configuration set representing the start state
-// for a precedence DFA at a particular precedence level (determined by
-// calling {@link Parser//getPrecedence}).
-func (p *ParserATNSimulator) applyPrecedenceFilter(configs ATNConfigSet) ATNConfigSet {
+// The func returns the transformed configuration set representing the start state
+// for a precedence [DFA] at a particular precedence level (determined by
+// calling [Parser].getPrecedence).
+func (p *ParserATNSimulator) applyPrecedenceFilter(configs *ATNConfigSet) *ATNConfigSet {
- statesFromAlt1 := make(map[int]PredictionContext)
- configSet := NewBaseATNConfigSet(configs.FullContext())
+ statesFromAlt1 := make(map[int]*PredictionContext)
+ configSet := NewATNConfigSet(configs.fullCtx)
- for _, config := range configs.GetItems() {
+ for _, config := range configs.configs {
// handle alt 1 first
if config.GetAlt() != 1 {
continue
@@ -746,12 +770,12 @@ func (p *ParserATNSimulator) applyPrecedenceFilter(configs ATNConfigSet) ATNConf
}
statesFromAlt1[config.GetState().GetStateNumber()] = config.GetContext()
if updatedContext != config.GetSemanticContext() {
- configSet.Add(NewBaseATNConfig2(config, updatedContext), p.mergeCache)
+ configSet.Add(NewATNConfig2(config, updatedContext), p.mergeCache)
} else {
configSet.Add(config, p.mergeCache)
}
}
- for _, config := range configs.GetItems() {
+ for _, config := range configs.configs {
if config.GetAlt() == 1 {
// already handled
@@ -780,10 +804,11 @@ func (p *ParserATNSimulator) getReachableTarget(trans Transition, ttype int) ATN
return nil
}
-func (p *ParserATNSimulator) getPredsForAmbigAlts(ambigAlts *BitSet, configs ATNConfigSet, nalts int) []SemanticContext {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) getPredsForAmbigAlts(ambigAlts *BitSet, configs *ATNConfigSet, nalts int) []SemanticContext {
altToPred := make([]SemanticContext, nalts+1)
- for _, c := range configs.GetItems() {
+ for _, c := range configs.configs {
if ambigAlts.contains(c.GetAlt()) {
altToPred[c.GetAlt()] = SemanticContextorContext(altToPred[c.GetAlt()], c.GetSemanticContext())
}
@@ -797,11 +822,11 @@ func (p *ParserATNSimulator) getPredsForAmbigAlts(ambigAlts *BitSet, configs ATN
nPredAlts++
}
}
- // nonambig alts are nil in altToPred
+ // unambiguous alts are nil in altToPred
if nPredAlts == 0 {
altToPred = nil
}
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("getPredsForAmbigAlts result " + fmt.Sprint(altToPred))
}
return altToPred
@@ -812,7 +837,7 @@ func (p *ParserATNSimulator) getPredicatePredictions(ambigAlts *BitSet, altToPre
containsPredicate := false
for i := 1; i < len(altToPred); i++ {
pred := altToPred[i]
- // unpredicated is indicated by SemanticContextNONE
+ // un-predicated is indicated by SemanticContextNONE
if ambigAlts != nil && ambigAlts.contains(i) {
pairs = append(pairs, NewPredPrediction(pred, i))
}
@@ -826,51 +851,42 @@ func (p *ParserATNSimulator) getPredicatePredictions(ambigAlts *BitSet, altToPre
return pairs
}
-// This method is used to improve the localization of error messages by
-// choosing an alternative rather than panicing a
-// {@link NoViableAltException} in particular prediction scenarios where the
-// {@link //ERROR} state was reached during ATN simulation.
+// getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule is used to improve the localization of error messages by
+// choosing an alternative rather than panic a NoViableAltException in particular prediction scenarios where the
+// Error state was reached during [ATN] simulation.
//
-//
-// The default implementation of p method uses the following
-// algorithm to identify an ATN configuration which successfully parsed the
+// The default implementation of this method uses the following
+// algorithm to identify an [ATN] configuration which successfully parsed the
// decision entry rule. Choosing such an alternative ensures that the
-// {@link ParserRuleContext} returned by the calling rule will be complete
+// [ParserRuleContext] returned by the calling rule will be complete
// and valid, and the syntax error will be Reported later at a more
-// localized location.
+// localized location.
//
-//
-// - If a syntactically valid path or paths reach the end of the decision rule and
-// they are semantically valid if predicated, return the min associated alt.
-// - Else, if a semantically invalid but syntactically valid path exist
-// or paths exist, return the minimum associated alt.
-//
-// - Otherwise, return {@link ATN//INVALID_ALT_NUMBER}.
-//
+// - If a syntactically valid path or paths reach the end of the decision rule, and
+// they are semantically valid if predicated, return the min associated alt.
+// - Else, if a semantically invalid but syntactically valid path exist
+// or paths exist, return the minimum associated alt.
+// - Otherwise, return [ATNInvalidAltNumber].
//
-//
// In some scenarios, the algorithm described above could predict an
-// alternative which will result in a {@link FailedPredicateException} in
-// the parser. Specifically, p could occur if the only configuration
+// alternative which will result in a [FailedPredicateException] in
+// the parser. Specifically, this could occur if the only configuration
// capable of successfully parsing to the end of the decision rule is
-// blocked by a semantic predicate. By choosing p alternative within
-// {@link //AdaptivePredict} instead of panicing a
-// {@link NoViableAltException}, the resulting
-// {@link FailedPredicateException} in the parser will identify the specific
+// blocked by a semantic predicate. By choosing this alternative within
+// [AdaptivePredict] instead of panic a [NoViableAltException], the resulting
+// [FailedPredicateException] in the parser will identify the specific
// predicate which is preventing the parser from successfully parsing the
// decision rule, which helps developers identify and correct logic errors
// in semantic predicates.
-//
//
-// @param configs The ATN configurations which were valid immediately before
-// the {@link //ERROR} state was reached
-// @param outerContext The is the \gamma_0 initial parser context from the paper
+// pass in the configs holding ATN configurations which were valid immediately before
+// the ERROR state was reached, outerContext as the initial parser context from the paper
// or the parser stack at the instant before prediction commences.
//
-// @return The value to return from {@link //AdaptivePredict}, or
-// {@link ATN//INVALID_ALT_NUMBER} if a suitable alternative was not
-// identified and {@link //AdaptivePredict} should Report an error instead.
-func (p *ParserATNSimulator) getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(configs ATNConfigSet, outerContext ParserRuleContext) int {
+// Teh func returns the value to return from [AdaptivePredict], or
+// [ATNInvalidAltNumber] if a suitable alternative was not
+// identified and [AdaptivePredict] should report an error instead.
+func (p *ParserATNSimulator) getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(configs *ATNConfigSet, outerContext ParserRuleContext) int {
cfgs := p.splitAccordingToSemanticValidity(configs, outerContext)
semValidConfigs := cfgs[0]
semInvalidConfigs := cfgs[1]
@@ -879,7 +895,7 @@ func (p *ParserATNSimulator) getSynValidOrSemInvalidAltThatFinishedDecisionEntry
return alt
}
// Is there a syntactically valid path with a failed pred?
- if len(semInvalidConfigs.GetItems()) > 0 {
+ if len(semInvalidConfigs.configs) > 0 {
alt = p.GetAltThatFinishedDecisionEntryRule(semInvalidConfigs)
if alt != ATNInvalidAltNumber { // syntactically viable path exists
return alt
@@ -888,10 +904,10 @@ func (p *ParserATNSimulator) getSynValidOrSemInvalidAltThatFinishedDecisionEntry
return ATNInvalidAltNumber
}
-func (p *ParserATNSimulator) GetAltThatFinishedDecisionEntryRule(configs ATNConfigSet) int {
+func (p *ParserATNSimulator) GetAltThatFinishedDecisionEntryRule(configs *ATNConfigSet) int {
alts := NewIntervalSet()
- for _, c := range configs.GetItems() {
+ for _, c := range configs.configs {
_, ok := c.GetState().(*RuleStopState)
if c.GetReachesIntoOuterContext() > 0 || (ok && c.GetContext().hasEmptyPath()) {
@@ -915,14 +931,14 @@ func (p *ParserATNSimulator) GetAltThatFinishedDecisionEntryRule(configs ATNConf
// prediction, which is where predicates need to evaluate.
type ATNConfigSetPair struct {
- item0, item1 ATNConfigSet
+ item0, item1 *ATNConfigSet
}
-func (p *ParserATNSimulator) splitAccordingToSemanticValidity(configs ATNConfigSet, outerContext ParserRuleContext) []ATNConfigSet {
- succeeded := NewBaseATNConfigSet(configs.FullContext())
- failed := NewBaseATNConfigSet(configs.FullContext())
+func (p *ParserATNSimulator) splitAccordingToSemanticValidity(configs *ATNConfigSet, outerContext ParserRuleContext) []*ATNConfigSet {
+ succeeded := NewATNConfigSet(configs.fullCtx)
+ failed := NewATNConfigSet(configs.fullCtx)
- for _, c := range configs.GetItems() {
+ for _, c := range configs.configs {
if c.GetSemanticContext() != SemanticContextNone {
predicateEvaluationResult := c.GetSemanticContext().evaluate(p.parser, outerContext)
if predicateEvaluationResult {
@@ -934,15 +950,16 @@ func (p *ParserATNSimulator) splitAccordingToSemanticValidity(configs ATNConfigS
succeeded.Add(c, nil)
}
}
- return []ATNConfigSet{succeeded, failed}
+ return []*ATNConfigSet{succeeded, failed}
}
-// Look through a list of predicate/alt pairs, returning alts for the
+// evalSemanticContext looks through a list of predicate/alt pairs, returning alts for the
+// pairs that win. A [SemanticContextNone] predicate indicates an alt containing an
+// un-predicated runtimeConfig which behaves as "always true." If !complete
+// then we stop at the first predicate that evaluates to true. This
+// includes pairs with nil predicates.
//
-// pairs that win. A {@code NONE} predicate indicates an alt containing an
-// unpredicated config which behaves as "always true." If !complete
-// then we stop at the first predicate that evaluates to true. This
-// includes pairs with nil predicates.
+//goland:noinspection GoBoolExpressions
func (p *ParserATNSimulator) evalSemanticContext(predPredictions []*PredPrediction, outerContext ParserRuleContext, complete bool) *BitSet {
predictions := NewBitSet()
for i := 0; i < len(predPredictions); i++ {
@@ -956,11 +973,11 @@ func (p *ParserATNSimulator) evalSemanticContext(predPredictions []*PredPredicti
}
predicateEvaluationResult := pair.pred.evaluate(p.parser, outerContext)
- if ParserATNSimulatorDebug || ParserATNSimulatorDFADebug {
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorDFADebug {
fmt.Println("eval pred " + pair.String() + "=" + fmt.Sprint(predicateEvaluationResult))
}
if predicateEvaluationResult {
- if ParserATNSimulatorDebug || ParserATNSimulatorDFADebug {
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorDFADebug {
fmt.Println("PREDICT " + fmt.Sprint(pair.alt))
}
predictions.add(pair.alt)
@@ -972,19 +989,82 @@ func (p *ParserATNSimulator) evalSemanticContext(predPredictions []*PredPredicti
return predictions
}
-func (p *ParserATNSimulator) closure(config ATNConfig, configs ATNConfigSet, closureBusy *JStore[ATNConfig, Comparator[ATNConfig]], collectPredicates, fullCtx, treatEOFAsEpsilon bool) {
+func (p *ParserATNSimulator) closure(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx, treatEOFAsEpsilon bool) {
initialDepth := 0
p.closureCheckingStopState(config, configs, closureBusy, collectPredicates,
fullCtx, initialDepth, treatEOFAsEpsilon)
}
-func (p *ParserATNSimulator) closureCheckingStopState(config ATNConfig, configs ATNConfigSet, closureBusy *JStore[ATNConfig, Comparator[ATNConfig]], collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {
- if ParserATNSimulatorTraceATNSim {
+func (p *ParserATNSimulator) closureCheckingStopState(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Println("closure(" + config.String() + ")")
- //fmt.Println("configs(" + configs.String() + ")")
- if config.GetReachesIntoOuterContext() > 50 {
- panic("problem")
+ }
+
+ var stack []*ATNConfig
+ visited := make(map[*ATNConfig]bool)
+
+ stack = append(stack, config)
+
+ for len(stack) > 0 {
+ currConfig := stack[len(stack)-1]
+ stack = stack[:len(stack)-1]
+
+ if _, ok := visited[currConfig]; ok {
+ continue
+ }
+ visited[currConfig] = true
+
+ if _, ok := currConfig.GetState().(*RuleStopState); ok {
+ // We hit rule end. If we have context info, use it
+ // run thru all possible stack tops in ctx
+ if !currConfig.GetContext().isEmpty() {
+ for i := 0; i < currConfig.GetContext().length(); i++ {
+ if currConfig.GetContext().getReturnState(i) == BasePredictionContextEmptyReturnState {
+ if fullCtx {
+ nb := NewATNConfig1(currConfig, currConfig.GetState(), BasePredictionContextEMPTY)
+ configs.Add(nb, p.mergeCache)
+ continue
+ } else {
+ // we have no context info, just chase follow links (if greedy)
+ if runtimeConfig.parserATNSimulatorDebug {
+ fmt.Println("FALLING off rule " + p.getRuleName(currConfig.GetState().GetRuleIndex()))
+ }
+ p.closureWork(currConfig, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)
+ }
+ continue
+ }
+ returnState := p.atn.states[currConfig.GetContext().getReturnState(i)]
+ newContext := currConfig.GetContext().GetParent(i) // "pop" return state
+
+ c := NewATNConfig5(returnState, currConfig.GetAlt(), newContext, currConfig.GetSemanticContext())
+ // While we have context to pop back from, we may have
+ // gotten that context AFTER having falling off a rule.
+ // Make sure we track that we are now out of context.
+ c.SetReachesIntoOuterContext(currConfig.GetReachesIntoOuterContext())
+
+ stack = append(stack, c)
+ }
+ continue
+ } else if fullCtx {
+ // reached end of start rule
+ configs.Add(currConfig, p.mergeCache)
+ continue
+ } else {
+ // else if we have no context info, just chase follow links (if greedy)
+ if runtimeConfig.parserATNSimulatorDebug {
+ fmt.Println("FALLING off rule " + p.getRuleName(currConfig.GetState().GetRuleIndex()))
+ }
+ }
}
+
+ p.closureWork(currConfig, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)
+ }
+}
+
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) closureCheckingStopStateRecursive(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
+ fmt.Println("closure(" + config.String() + ")")
}
if _, ok := config.GetState().(*RuleStopState); ok {
@@ -994,11 +1074,12 @@ func (p *ParserATNSimulator) closureCheckingStopState(config ATNConfig, configs
for i := 0; i < config.GetContext().length(); i++ {
if config.GetContext().getReturnState(i) == BasePredictionContextEmptyReturnState {
if fullCtx {
- configs.Add(NewBaseATNConfig1(config, config.GetState(), BasePredictionContextEMPTY), p.mergeCache)
+ nb := NewATNConfig1(config, config.GetState(), BasePredictionContextEMPTY)
+ configs.Add(nb, p.mergeCache)
continue
} else {
// we have no context info, just chase follow links (if greedy)
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("FALLING off rule " + p.getRuleName(config.GetState().GetRuleIndex()))
}
p.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)
@@ -1008,7 +1089,7 @@ func (p *ParserATNSimulator) closureCheckingStopState(config ATNConfig, configs
returnState := p.atn.states[config.GetContext().getReturnState(i)]
newContext := config.GetContext().GetParent(i) // "pop" return state
- c := NewBaseATNConfig5(returnState, config.GetAlt(), newContext, config.GetSemanticContext())
+ c := NewATNConfig5(returnState, config.GetAlt(), newContext, config.GetSemanticContext())
// While we have context to pop back from, we may have
// gotten that context AFTER having falling off a rule.
// Make sure we track that we are now out of context.
@@ -1022,7 +1103,7 @@ func (p *ParserATNSimulator) closureCheckingStopState(config ATNConfig, configs
return
} else {
// else if we have no context info, just chase follow links (if greedy)
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("FALLING off rule " + p.getRuleName(config.GetState().GetRuleIndex()))
}
}
@@ -1030,8 +1111,10 @@ func (p *ParserATNSimulator) closureCheckingStopState(config ATNConfig, configs
p.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)
}
-// Do the actual work of walking epsilon edges//
-func (p *ParserATNSimulator) closureWork(config ATNConfig, configs ATNConfigSet, closureBusy *JStore[ATNConfig, Comparator[ATNConfig]], collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {
+// Do the actual work of walking epsilon edges
+//
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) closureWork(config *ATNConfig, configs *ATNConfigSet, closureBusy *ClosureBusy, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {
state := config.GetState()
// optimization
if !state.GetEpsilonOnlyTransitions() {
@@ -1048,7 +1131,7 @@ func (p *ParserATNSimulator) closureWork(config ATNConfig, configs ATNConfigSet,
_, ok := t.(*ActionTransition)
continueCollecting := collectPredicates && !ok
c := p.getEpsilonTarget(config, t, continueCollecting, depth == 0, fullCtx, treatEOFAsEpsilon)
- if ci, ok := c.(*BaseATNConfig); ok && ci != nil {
+ if c != nil {
newDepth := depth
if _, ok := config.GetState().(*RuleStopState); ok {
@@ -1056,7 +1139,7 @@ func (p *ParserATNSimulator) closureWork(config ATNConfig, configs ATNConfigSet,
// We can't get here if incoming config was rule stop and we had context
// track how far we dip into outer context. Might
// come in handy and we avoid evaluating context dependent
- // preds if p is > 0.
+ // preds if this is > 0.
if p.dfa != nil && p.dfa.getPrecedenceDfa() {
if t.(*EpsilonTransition).outermostPrecedenceReturn == p.dfa.atnStartState.GetRuleIndex() {
@@ -1072,9 +1155,9 @@ func (p *ParserATNSimulator) closureWork(config ATNConfig, configs ATNConfigSet,
continue
}
- configs.SetDipsIntoOuterContext(true) // TODO: can remove? only care when we add to set per middle of p method
+ configs.dipsIntoOuterContext = true // TODO: can remove? only care when we add to set per middle of this method
newDepth--
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("dips into outer ctx: " + c.String())
}
} else {
@@ -1098,8 +1181,9 @@ func (p *ParserATNSimulator) closureWork(config ATNConfig, configs ATNConfigSet,
}
}
-func (p *ParserATNSimulator) canDropLoopEntryEdgeInLeftRecursiveRule(config ATNConfig) bool {
- if TurnOffLRLoopEntryBranchOpt {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) canDropLoopEntryEdgeInLeftRecursiveRule(config *ATNConfig) bool {
+ if !runtimeConfig.lRLoopEntryBranchOpt {
return false
}
@@ -1196,7 +1280,7 @@ func (p *ParserATNSimulator) getRuleName(index int) string {
return sb.String()
}
-func (p *ParserATNSimulator) getEpsilonTarget(config ATNConfig, t Transition, collectPredicates, inContext, fullCtx, treatEOFAsEpsilon bool) ATNConfig {
+func (p *ParserATNSimulator) getEpsilonTarget(config *ATNConfig, t Transition, collectPredicates, inContext, fullCtx, treatEOFAsEpsilon bool) *ATNConfig {
switch t.getSerializationType() {
case TransitionRULE:
@@ -1208,13 +1292,13 @@ func (p *ParserATNSimulator) getEpsilonTarget(config ATNConfig, t Transition, co
case TransitionACTION:
return p.actionTransition(config, t.(*ActionTransition))
case TransitionEPSILON:
- return NewBaseATNConfig4(config, t.getTarget())
+ return NewATNConfig4(config, t.getTarget())
case TransitionATOM, TransitionRANGE, TransitionSET:
// EOF transitions act like epsilon transitions after the first EOF
// transition is traversed
if treatEOFAsEpsilon {
if t.Matches(TokenEOF, 0, 1) {
- return NewBaseATNConfig4(config, t.getTarget())
+ return NewATNConfig4(config, t.getTarget())
}
}
return nil
@@ -1223,60 +1307,63 @@ func (p *ParserATNSimulator) getEpsilonTarget(config ATNConfig, t Transition, co
}
}
-func (p *ParserATNSimulator) actionTransition(config ATNConfig, t *ActionTransition) *BaseATNConfig {
- if ParserATNSimulatorDebug {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) actionTransition(config *ATNConfig, t *ActionTransition) *ATNConfig {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("ACTION edge " + strconv.Itoa(t.ruleIndex) + ":" + strconv.Itoa(t.actionIndex))
}
- return NewBaseATNConfig4(config, t.getTarget())
+ return NewATNConfig4(config, t.getTarget())
}
-func (p *ParserATNSimulator) precedenceTransition(config ATNConfig,
- pt *PrecedencePredicateTransition, collectPredicates, inContext, fullCtx bool) *BaseATNConfig {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) precedenceTransition(config *ATNConfig,
+ pt *PrecedencePredicateTransition, collectPredicates, inContext, fullCtx bool) *ATNConfig {
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("PRED (collectPredicates=" + fmt.Sprint(collectPredicates) + ") " +
strconv.Itoa(pt.precedence) + ">=_p, ctx dependent=true")
if p.parser != nil {
fmt.Println("context surrounding pred is " + fmt.Sprint(p.parser.GetRuleInvocationStack(nil)))
}
}
- var c *BaseATNConfig
+ var c *ATNConfig
if collectPredicates && inContext {
if fullCtx {
// In full context mode, we can evaluate predicates on-the-fly
// during closure, which dramatically reduces the size of
- // the config sets. It also obviates the need to test predicates
+ // the runtimeConfig sets. It also obviates the need to test predicates
// later during conflict resolution.
currentPosition := p.input.Index()
p.input.Seek(p.startIndex)
predSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext)
p.input.Seek(currentPosition)
if predSucceeds {
- c = NewBaseATNConfig4(config, pt.getTarget()) // no pred context
+ c = NewATNConfig4(config, pt.getTarget()) // no pred context
}
} else {
newSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate())
- c = NewBaseATNConfig3(config, pt.getTarget(), newSemCtx)
+ c = NewATNConfig3(config, pt.getTarget(), newSemCtx)
}
} else {
- c = NewBaseATNConfig4(config, pt.getTarget())
+ c = NewATNConfig4(config, pt.getTarget())
}
- if ParserATNSimulatorDebug {
- fmt.Println("config from pred transition=" + c.String())
+ if runtimeConfig.parserATNSimulatorDebug {
+ fmt.Println("runtimeConfig from pred transition=" + c.String())
}
return c
}
-func (p *ParserATNSimulator) predTransition(config ATNConfig, pt *PredicateTransition, collectPredicates, inContext, fullCtx bool) *BaseATNConfig {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) predTransition(config *ATNConfig, pt *PredicateTransition, collectPredicates, inContext, fullCtx bool) *ATNConfig {
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("PRED (collectPredicates=" + fmt.Sprint(collectPredicates) + ") " + strconv.Itoa(pt.ruleIndex) +
":" + strconv.Itoa(pt.predIndex) + ", ctx dependent=" + fmt.Sprint(pt.isCtxDependent))
if p.parser != nil {
fmt.Println("context surrounding pred is " + fmt.Sprint(p.parser.GetRuleInvocationStack(nil)))
}
}
- var c *BaseATNConfig
+ var c *ATNConfig
if collectPredicates && (!pt.isCtxDependent || inContext) {
if fullCtx {
// In full context mode, we can evaluate predicates on-the-fly
@@ -1288,78 +1375,92 @@ func (p *ParserATNSimulator) predTransition(config ATNConfig, pt *PredicateTrans
predSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext)
p.input.Seek(currentPosition)
if predSucceeds {
- c = NewBaseATNConfig4(config, pt.getTarget()) // no pred context
+ c = NewATNConfig4(config, pt.getTarget()) // no pred context
}
} else {
newSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate())
- c = NewBaseATNConfig3(config, pt.getTarget(), newSemCtx)
+ c = NewATNConfig3(config, pt.getTarget(), newSemCtx)
}
} else {
- c = NewBaseATNConfig4(config, pt.getTarget())
+ c = NewATNConfig4(config, pt.getTarget())
}
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("config from pred transition=" + c.String())
}
return c
}
-func (p *ParserATNSimulator) ruleTransition(config ATNConfig, t *RuleTransition) *BaseATNConfig {
- if ParserATNSimulatorDebug {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) ruleTransition(config *ATNConfig, t *RuleTransition) *ATNConfig {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("CALL rule " + p.getRuleName(t.getTarget().GetRuleIndex()) + ", ctx=" + config.GetContext().String())
}
returnState := t.followState
newContext := SingletonBasePredictionContextCreate(config.GetContext(), returnState.GetStateNumber())
- return NewBaseATNConfig1(config, t.getTarget(), newContext)
+ return NewATNConfig1(config, t.getTarget(), newContext)
}
-func (p *ParserATNSimulator) getConflictingAlts(configs ATNConfigSet) *BitSet {
+func (p *ParserATNSimulator) getConflictingAlts(configs *ATNConfigSet) *BitSet {
altsets := PredictionModegetConflictingAltSubsets(configs)
return PredictionModeGetAlts(altsets)
}
-// Sam pointed out a problem with the previous definition, v3, of
+// getConflictingAltsOrUniqueAlt Sam pointed out a problem with the previous definition, v3, of
// ambiguous states. If we have another state associated with conflicting
// alternatives, we should keep going. For example, the following grammar
//
-// s : (ID | ID ID?) ''
+// s : (ID | ID ID?) ;
+//
+// When the [ATN] simulation reaches the state before ;, it has a [DFA]
+// state that looks like:
+//
+// [12|1|[], 6|2|[], 12|2|[]].
+//
+// Naturally
+//
+// 12|1|[] and 12|2|[]
+//
+// conflict, but we cannot stop processing this node
+// because alternative to has another way to continue, via
+//
+// [6|2|[]].
//
-// When the ATN simulation reaches the state before '', it has a DFA
-// state that looks like: [12|1|[], 6|2|[], 12|2|[]]. Naturally
-// 12|1|[] and 12|2|[] conflict, but we cannot stop processing p node
-// because alternative to has another way to continue, via [6|2|[]].
// The key is that we have a single state that has config's only associated
// with a single alternative, 2, and crucially the state transitions
// among the configurations are all non-epsilon transitions. That means
// we don't consider any conflicts that include alternative 2. So, we
// ignore the conflict between alts 1 and 2. We ignore a set of
// conflicting alts when there is an intersection with an alternative
-// associated with a single alt state in the state&rarrconfig-list map.
+// associated with a single alt state in the state config-list map.
//
// It's also the case that we might have two conflicting configurations but
-// also a 3rd nonconflicting configuration for a different alternative:
-// [1|1|[], 1|2|[], 8|3|[]]. This can come about from grammar:
+// also a 3rd non-conflicting configuration for a different alternative:
+//
+// [1|1|[], 1|2|[], 8|3|[]].
+//
+// This can come about from grammar:
//
-// a : A | A | A B
+// a : A | A | A B
//
// After Matching input A, we reach the stop state for rule A, state 1.
// State 8 is the state right before B. Clearly alternatives 1 and 2
// conflict and no amount of further lookahead will separate the two.
-// However, alternative 3 will be able to continue and so we do not
-// stop working on p state. In the previous example, we're concerned
+// However, alternative 3 will be able to continue, so we do not
+// stop working on this state.
+//
+// In the previous example, we're concerned
// with states associated with the conflicting alternatives. Here alt
// 3 is not associated with the conflicting configs, but since we can continue
// looking for input reasonably, I don't declare the state done. We
// ignore a set of conflicting alts when we have an alternative
// that we still need to pursue.
-//
-
-func (p *ParserATNSimulator) getConflictingAltsOrUniqueAlt(configs ATNConfigSet) *BitSet {
+func (p *ParserATNSimulator) getConflictingAltsOrUniqueAlt(configs *ATNConfigSet) *BitSet {
var conflictingAlts *BitSet
- if configs.GetUniqueAlt() != ATNInvalidAltNumber {
+ if configs.uniqueAlt != ATNInvalidAltNumber {
conflictingAlts = NewBitSet()
- conflictingAlts.add(configs.GetUniqueAlt())
+ conflictingAlts.add(configs.uniqueAlt)
} else {
- conflictingAlts = configs.GetConflictingAlts()
+ conflictingAlts = configs.conflictingAlts
}
return conflictingAlts
}
@@ -1384,11 +1485,10 @@ func (p *ParserATNSimulator) getLookaheadName(input TokenStream) string {
return p.GetTokenName(input.LA(1))
}
-// Used for debugging in AdaptivePredict around execATN but I cut
-//
-// it out for clarity now that alg. works well. We can leave p
-// "dead" code for a bit.
-func (p *ParserATNSimulator) dumpDeadEndConfigs(nvae *NoViableAltException) {
+// Used for debugging in [AdaptivePredict] around [execATN], but I cut
+// it out for clarity now that alg. works well. We can leave this
+// "dead" code for a bit.
+func (p *ParserATNSimulator) dumpDeadEndConfigs(_ *NoViableAltException) {
panic("Not implemented")
@@ -1418,13 +1518,13 @@ func (p *ParserATNSimulator) dumpDeadEndConfigs(nvae *NoViableAltException) {
// }
}
-func (p *ParserATNSimulator) noViableAlt(input TokenStream, outerContext ParserRuleContext, configs ATNConfigSet, startIndex int) *NoViableAltException {
+func (p *ParserATNSimulator) noViableAlt(input TokenStream, outerContext ParserRuleContext, configs *ATNConfigSet, startIndex int) *NoViableAltException {
return NewNoViableAltException(p.parser, input, input.Get(startIndex), input.LT(1), configs, outerContext)
}
-func (p *ParserATNSimulator) getUniqueAlt(configs ATNConfigSet) int {
+func (p *ParserATNSimulator) getUniqueAlt(configs *ATNConfigSet) int {
alt := ATNInvalidAltNumber
- for _, c := range configs.GetItems() {
+ for _, c := range configs.configs {
if alt == ATNInvalidAltNumber {
alt = c.GetAlt() // found first alt
} else if c.GetAlt() != alt {
@@ -1452,8 +1552,10 @@ func (p *ParserATNSimulator) getUniqueAlt(configs ATNConfigSet) int {
// @return If {@code to} is {@code nil}, p method returns {@code nil}
// otherwise p method returns the result of calling {@link //addDFAState}
// on {@code to}
+//
+//goland:noinspection GoBoolExpressions
func (p *ParserATNSimulator) addDFAEdge(dfa *DFA, from *DFAState, t int, to *DFAState) *DFAState {
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
fmt.Println("EDGE " + from.String() + " -> " + to.String() + " upon " + p.GetTokenName(t))
}
if to == nil {
@@ -1472,7 +1574,7 @@ func (p *ParserATNSimulator) addDFAEdge(dfa *DFA, from *DFAState, t int, to *DFA
from.setIthEdge(t+1, to) // connect
p.atn.edgeMu.Unlock()
- if ParserATNSimulatorDebug {
+ if runtimeConfig.parserATNSimulatorDebug {
var names []string
if p.parser != nil {
names = p.parser.GetLiteralNames()
@@ -1483,48 +1585,49 @@ func (p *ParserATNSimulator) addDFAEdge(dfa *DFA, from *DFAState, t int, to *DFA
return to
}
-// Add state {@code D} to the DFA if it is not already present, and return
-// the actual instance stored in the DFA. If a state equivalent to {@code D}
-// is already in the DFA, the existing state is returned. Otherwise p
-// method returns {@code D} after adding it to the DFA.
+// addDFAState adds state D to the [DFA] if it is not already present, and returns
+// the actual instance stored in the [DFA]. If a state equivalent to D
+// is already in the [DFA], the existing state is returned. Otherwise, this
+// method returns D after adding it to the [DFA].
//
-// If {@code D} is {@link //ERROR}, p method returns {@link //ERROR} and
-// does not change the DFA.
+// If D is [ATNSimulatorError], this method returns [ATNSimulatorError] and
+// does not change the DFA.
//
-// @param dfa The dfa
-// @param D The DFA state to add
-// @return The state stored in the DFA. This will be either the existing
-// state if {@code D} is already in the DFA, or {@code D} itself if the
-// state was not already present.
+//goland:noinspection GoBoolExpressions
func (p *ParserATNSimulator) addDFAState(dfa *DFA, d *DFAState) *DFAState {
if d == ATNSimulatorError {
return d
}
- existing, present := dfa.states.Get(d)
+
+ existing, present := dfa.Get(d)
if present {
- if ParserATNSimulatorTraceATNSim {
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Print("addDFAState " + d.String() + " exists")
}
return existing
}
- // The state was not present, so update it with configs
+ // The state will be added if not already there or we will be given back the existing state struct
+ // if it is present.
//
- d.stateNumber = dfa.states.Len()
- if !d.configs.ReadOnly() {
- d.configs.OptimizeConfigs(p.BaseATNSimulator)
- d.configs.SetReadOnly(true)
+ d.stateNumber = dfa.Len()
+ if !d.configs.readOnly {
+ d.configs.OptimizeConfigs(&p.BaseATNSimulator)
+ d.configs.readOnly = true
+ d.configs.configLookup = nil
}
- dfa.states.Put(d)
- if ParserATNSimulatorTraceATNSim {
+ dfa.Put(d)
+
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
fmt.Println("addDFAState new " + d.String())
}
return d
}
-func (p *ParserATNSimulator) ReportAttemptingFullContext(dfa *DFA, conflictingAlts *BitSet, configs ATNConfigSet, startIndex, stopIndex int) {
- if ParserATNSimulatorDebug || ParserATNSimulatorRetryDebug {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) ReportAttemptingFullContext(dfa *DFA, conflictingAlts *BitSet, configs *ATNConfigSet, startIndex, stopIndex int) {
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug {
interval := NewInterval(startIndex, stopIndex+1)
fmt.Println("ReportAttemptingFullContext decision=" + strconv.Itoa(dfa.decision) + ":" + configs.String() +
", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval))
@@ -1534,8 +1637,9 @@ func (p *ParserATNSimulator) ReportAttemptingFullContext(dfa *DFA, conflictingAl
}
}
-func (p *ParserATNSimulator) ReportContextSensitivity(dfa *DFA, prediction int, configs ATNConfigSet, startIndex, stopIndex int) {
- if ParserATNSimulatorDebug || ParserATNSimulatorRetryDebug {
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) ReportContextSensitivity(dfa *DFA, prediction int, configs *ATNConfigSet, startIndex, stopIndex int) {
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug {
interval := NewInterval(startIndex, stopIndex+1)
fmt.Println("ReportContextSensitivity decision=" + strconv.Itoa(dfa.decision) + ":" + configs.String() +
", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval))
@@ -1545,10 +1649,15 @@ func (p *ParserATNSimulator) ReportContextSensitivity(dfa *DFA, prediction int,
}
}
-// If context sensitive parsing, we know it's ambiguity not conflict//
-func (p *ParserATNSimulator) ReportAmbiguity(dfa *DFA, D *DFAState, startIndex, stopIndex int,
- exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
- if ParserATNSimulatorDebug || ParserATNSimulatorRetryDebug {
+// ReportAmbiguity reports and ambiguity in the parse, which shows that the parser will explore a different route.
+//
+// If context-sensitive parsing, we know it's an ambiguity not a conflict or error, but we can report it to the developer
+// so that they can see that this is happening and can take action if they want to.
+//
+//goland:noinspection GoBoolExpressions
+func (p *ParserATNSimulator) ReportAmbiguity(dfa *DFA, _ *DFAState, startIndex, stopIndex int,
+ exact bool, ambigAlts *BitSet, configs *ATNConfigSet) {
+ if runtimeConfig.parserATNSimulatorDebug || runtimeConfig.parserATNSimulatorRetryDebug {
interval := NewInterval(startIndex, stopIndex+1)
fmt.Println("ReportAmbiguity " + ambigAlts.String() + ":" + configs.String() +
", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval))
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser_rule_context.go b/vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go
similarity index 77%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser_rule_context.go
rename to vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go
index 1c8cee74795..c249bc1385c 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/parser_rule_context.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/parser_rule_context.go
@@ -31,7 +31,9 @@ type ParserRuleContext interface {
}
type BaseParserRuleContext struct {
- *BaseRuleContext
+ parentCtx RuleContext
+ invokingState int
+ RuleIndex int
start, stop Token
exception RecognitionException
@@ -40,8 +42,22 @@ type BaseParserRuleContext struct {
func NewBaseParserRuleContext(parent ParserRuleContext, invokingStateNumber int) *BaseParserRuleContext {
prc := new(BaseParserRuleContext)
+ InitBaseParserRuleContext(prc, parent, invokingStateNumber)
+ return prc
+}
+
+func InitBaseParserRuleContext(prc *BaseParserRuleContext, parent ParserRuleContext, invokingStateNumber int) {
+ // What context invoked b rule?
+ prc.parentCtx = parent
- prc.BaseRuleContext = NewBaseRuleContext(parent, invokingStateNumber)
+ // What state invoked the rule associated with b context?
+ // The "return address" is the followState of invokingState
+ // If parent is nil, b should be -1.
+ if parent == nil {
+ prc.invokingState = -1
+ } else {
+ prc.invokingState = invokingStateNumber
+ }
prc.RuleIndex = -1
// * If we are debugging or building a parse tree for a Visitor,
@@ -56,8 +72,6 @@ func NewBaseParserRuleContext(parent ParserRuleContext, invokingStateNumber int)
// The exception that forced prc rule to return. If the rule successfully
// completed, prc is {@code nil}.
prc.exception = nil
-
- return prc
}
func (prc *BaseParserRuleContext) SetException(e RecognitionException) {
@@ -90,14 +104,15 @@ func (prc *BaseParserRuleContext) GetText() string {
return s
}
-// Double dispatch methods for listeners
-func (prc *BaseParserRuleContext) EnterRule(listener ParseTreeListener) {
+// EnterRule is called when any rule is entered.
+func (prc *BaseParserRuleContext) EnterRule(_ ParseTreeListener) {
}
-func (prc *BaseParserRuleContext) ExitRule(listener ParseTreeListener) {
+// ExitRule is called when any rule is exited.
+func (prc *BaseParserRuleContext) ExitRule(_ ParseTreeListener) {
}
-// * Does not set parent link other add methods do that///
+// * Does not set parent link other add methods do that
func (prc *BaseParserRuleContext) addTerminalNodeChild(child TerminalNode) TerminalNode {
if prc.children == nil {
prc.children = make([]Tree, 0)
@@ -120,10 +135,9 @@ func (prc *BaseParserRuleContext) AddChild(child RuleContext) RuleContext {
return child
}
-// * Used by EnterOuterAlt to toss out a RuleContext previously added as
-// we entered a rule. If we have // label, we will need to remove
-// generic ruleContext object.
-// /
+// RemoveLastChild is used by [EnterOuterAlt] to toss out a [RuleContext] previously added as
+// we entered a rule. If we have a label, we will need to remove
+// the generic ruleContext object.
func (prc *BaseParserRuleContext) RemoveLastChild() {
if prc.children != nil && len(prc.children) > 0 {
prc.children = prc.children[0 : len(prc.children)-1]
@@ -293,7 +307,7 @@ func (prc *BaseParserRuleContext) GetChildCount() int {
return len(prc.children)
}
-func (prc *BaseParserRuleContext) GetSourceInterval() *Interval {
+func (prc *BaseParserRuleContext) GetSourceInterval() Interval {
if prc.start == nil || prc.stop == nil {
return TreeInvalidInterval
}
@@ -340,6 +354,50 @@ func (prc *BaseParserRuleContext) String(ruleNames []string, stop RuleContext) s
return s
}
+func (prc *BaseParserRuleContext) SetParent(v Tree) {
+ if v == nil {
+ prc.parentCtx = nil
+ } else {
+ prc.parentCtx = v.(RuleContext)
+ }
+}
+
+func (prc *BaseParserRuleContext) GetInvokingState() int {
+ return prc.invokingState
+}
+
+func (prc *BaseParserRuleContext) SetInvokingState(t int) {
+ prc.invokingState = t
+}
+
+func (prc *BaseParserRuleContext) GetRuleIndex() int {
+ return prc.RuleIndex
+}
+
+func (prc *BaseParserRuleContext) GetAltNumber() int {
+ return ATNInvalidAltNumber
+}
+
+func (prc *BaseParserRuleContext) SetAltNumber(_ int) {}
+
+// IsEmpty returns true if the context of b is empty.
+//
+// A context is empty if there is no invoking state, meaning nobody calls
+// current context.
+func (prc *BaseParserRuleContext) IsEmpty() bool {
+ return prc.invokingState == -1
+}
+
+// GetParent returns the combined text of all child nodes. This method only considers
+// tokens which have been added to the parse tree.
+//
+// Since tokens on hidden channels (e.g. whitespace or comments) are not
+// added to the parse trees, they will not appear in the output of this
+// method.
+func (prc *BaseParserRuleContext) GetParent() Tree {
+ return prc.parentCtx
+}
+
var ParserRuleContextEmpty = NewBaseParserRuleContext(nil, -1)
type InterpreterRuleContext interface {
@@ -350,6 +408,7 @@ type BaseInterpreterRuleContext struct {
*BaseParserRuleContext
}
+//goland:noinspection GoUnusedExportedFunction
func NewBaseInterpreterRuleContext(parent BaseInterpreterRuleContext, invokingStateNumber, ruleIndex int) *BaseInterpreterRuleContext {
prc := new(BaseInterpreterRuleContext)
diff --git a/vendor/github.com/antlr4-go/antlr/v4/prediction_context.go b/vendor/github.com/antlr4-go/antlr/v4/prediction_context.go
new file mode 100644
index 00000000000..c1b80cc1f0f
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/prediction_context.go
@@ -0,0 +1,727 @@
+// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "golang.org/x/exp/slices"
+ "strconv"
+)
+
+var _emptyPredictionContextHash int
+
+func init() {
+ _emptyPredictionContextHash = murmurInit(1)
+ _emptyPredictionContextHash = murmurFinish(_emptyPredictionContextHash, 0)
+}
+
+func calculateEmptyHash() int {
+ return _emptyPredictionContextHash
+}
+
+const (
+ // BasePredictionContextEmptyReturnState represents {@code $} in an array in full context mode, $
+ // doesn't mean wildcard:
+ //
+ // $ + x = [$,x]
+ //
+ // Here,
+ //
+ // $ = EmptyReturnState
+ BasePredictionContextEmptyReturnState = 0x7FFFFFFF
+)
+
+// TODO: JI These are meant to be atomics - this does not seem to match the Java runtime here
+//
+//goland:noinspection GoUnusedGlobalVariable
+var (
+ BasePredictionContextglobalNodeCount = 1
+ BasePredictionContextid = BasePredictionContextglobalNodeCount
+)
+
+const (
+ PredictionContextEmpty = iota
+ PredictionContextSingleton
+ PredictionContextArray
+)
+
+// PredictionContext is a go idiomatic implementation of PredictionContext that does not rty to
+// emulate inheritance from Java, and can be used without an interface definition. An interface
+// is not required because no user code will ever need to implement this interface.
+type PredictionContext struct {
+ cachedHash int
+ pcType int
+ parentCtx *PredictionContext
+ returnState int
+ parents []*PredictionContext
+ returnStates []int
+}
+
+func NewEmptyPredictionContext() *PredictionContext {
+ nep := &PredictionContext{}
+ nep.cachedHash = calculateEmptyHash()
+ nep.pcType = PredictionContextEmpty
+ nep.returnState = BasePredictionContextEmptyReturnState
+ return nep
+}
+
+func NewBaseSingletonPredictionContext(parent *PredictionContext, returnState int) *PredictionContext {
+ pc := &PredictionContext{}
+ pc.pcType = PredictionContextSingleton
+ pc.returnState = returnState
+ pc.parentCtx = parent
+ if parent != nil {
+ pc.cachedHash = calculateHash(parent, returnState)
+ } else {
+ pc.cachedHash = calculateEmptyHash()
+ }
+ return pc
+}
+
+func SingletonBasePredictionContextCreate(parent *PredictionContext, returnState int) *PredictionContext {
+ if returnState == BasePredictionContextEmptyReturnState && parent == nil {
+ // someone can pass in the bits of an array ctx that mean $
+ return BasePredictionContextEMPTY
+ }
+ return NewBaseSingletonPredictionContext(parent, returnState)
+}
+
+func NewArrayPredictionContext(parents []*PredictionContext, returnStates []int) *PredictionContext {
+ // Parent can be nil only if full ctx mode and we make an array
+ // from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using
+ // nil parent and
+ // returnState == {@link //EmptyReturnState}.
+ hash := murmurInit(1)
+ for _, parent := range parents {
+ hash = murmurUpdate(hash, parent.Hash())
+ }
+ for _, returnState := range returnStates {
+ hash = murmurUpdate(hash, returnState)
+ }
+ hash = murmurFinish(hash, len(parents)<<1)
+
+ nec := &PredictionContext{}
+ nec.cachedHash = hash
+ nec.pcType = PredictionContextArray
+ nec.parents = parents
+ nec.returnStates = returnStates
+ return nec
+}
+
+func (p *PredictionContext) Hash() int {
+ return p.cachedHash
+}
+
+func (p *PredictionContext) Equals(other Collectable[*PredictionContext]) bool {
+ switch p.pcType {
+ case PredictionContextEmpty:
+ otherP := other.(*PredictionContext)
+ return other == nil || otherP == nil || otherP.isEmpty()
+ case PredictionContextSingleton:
+ return p.SingletonEquals(other)
+ case PredictionContextArray:
+ return p.ArrayEquals(other)
+ }
+ return false
+}
+
+func (p *PredictionContext) ArrayEquals(o Collectable[*PredictionContext]) bool {
+ if o == nil {
+ return false
+ }
+ other := o.(*PredictionContext)
+ if other == nil || other.pcType != PredictionContextArray {
+ return false
+ }
+ if p.cachedHash != other.Hash() {
+ return false // can't be same if hash is different
+ }
+
+ // Must compare the actual array elements and not just the array address
+ //
+ return slices.Equal(p.returnStates, other.returnStates) &&
+ slices.EqualFunc(p.parents, other.parents, func(x, y *PredictionContext) bool {
+ return x.Equals(y)
+ })
+}
+
+func (p *PredictionContext) SingletonEquals(other Collectable[*PredictionContext]) bool {
+ if other == nil {
+ return false
+ }
+ otherP := other.(*PredictionContext)
+ if otherP == nil {
+ return false
+ }
+
+ if p.cachedHash != otherP.Hash() {
+ return false // Can't be same if hash is different
+ }
+
+ if p.returnState != otherP.getReturnState(0) {
+ return false
+ }
+
+ // Both parents must be nil if one is
+ if p.parentCtx == nil {
+ return otherP.parentCtx == nil
+ }
+
+ return p.parentCtx.Equals(otherP.parentCtx)
+}
+
+func (p *PredictionContext) GetParent(i int) *PredictionContext {
+ switch p.pcType {
+ case PredictionContextEmpty:
+ return nil
+ case PredictionContextSingleton:
+ return p.parentCtx
+ case PredictionContextArray:
+ return p.parents[i]
+ }
+ return nil
+}
+
+func (p *PredictionContext) getReturnState(i int) int {
+ switch p.pcType {
+ case PredictionContextArray:
+ return p.returnStates[i]
+ default:
+ return p.returnState
+ }
+}
+
+func (p *PredictionContext) GetReturnStates() []int {
+ switch p.pcType {
+ case PredictionContextArray:
+ return p.returnStates
+ default:
+ return []int{p.returnState}
+ }
+}
+
+func (p *PredictionContext) length() int {
+ switch p.pcType {
+ case PredictionContextArray:
+ return len(p.returnStates)
+ default:
+ return 1
+ }
+}
+
+func (p *PredictionContext) hasEmptyPath() bool {
+ switch p.pcType {
+ case PredictionContextSingleton:
+ return p.returnState == BasePredictionContextEmptyReturnState
+ }
+ return p.getReturnState(p.length()-1) == BasePredictionContextEmptyReturnState
+}
+
+func (p *PredictionContext) String() string {
+ switch p.pcType {
+ case PredictionContextEmpty:
+ return "$"
+ case PredictionContextSingleton:
+ var up string
+
+ if p.parentCtx == nil {
+ up = ""
+ } else {
+ up = p.parentCtx.String()
+ }
+
+ if len(up) == 0 {
+ if p.returnState == BasePredictionContextEmptyReturnState {
+ return "$"
+ }
+
+ return strconv.Itoa(p.returnState)
+ }
+
+ return strconv.Itoa(p.returnState) + " " + up
+ case PredictionContextArray:
+ if p.isEmpty() {
+ return "[]"
+ }
+
+ s := "["
+ for i := 0; i < len(p.returnStates); i++ {
+ if i > 0 {
+ s = s + ", "
+ }
+ if p.returnStates[i] == BasePredictionContextEmptyReturnState {
+ s = s + "$"
+ continue
+ }
+ s = s + strconv.Itoa(p.returnStates[i])
+ if !p.parents[i].isEmpty() {
+ s = s + " " + p.parents[i].String()
+ } else {
+ s = s + "nil"
+ }
+ }
+ return s + "]"
+
+ default:
+ return "unknown"
+ }
+}
+
+func (p *PredictionContext) isEmpty() bool {
+ switch p.pcType {
+ case PredictionContextEmpty:
+ return true
+ case PredictionContextArray:
+ // since EmptyReturnState can only appear in the last position, we
+ // don't need to verify that size==1
+ return p.returnStates[0] == BasePredictionContextEmptyReturnState
+ default:
+ return false
+ }
+}
+
+func (p *PredictionContext) Type() int {
+ return p.pcType
+}
+
+func calculateHash(parent *PredictionContext, returnState int) int {
+ h := murmurInit(1)
+ h = murmurUpdate(h, parent.Hash())
+ h = murmurUpdate(h, returnState)
+ return murmurFinish(h, 2)
+}
+
+// Convert a {@link RuleContext} tree to a {@link BasePredictionContext} graph.
+// Return {@link //EMPTY} if {@code outerContext} is empty or nil.
+// /
+func predictionContextFromRuleContext(a *ATN, outerContext RuleContext) *PredictionContext {
+ if outerContext == nil {
+ outerContext = ParserRuleContextEmpty
+ }
+ // if we are in RuleContext of start rule, s, then BasePredictionContext
+ // is EMPTY. Nobody called us. (if we are empty, return empty)
+ if outerContext.GetParent() == nil || outerContext == ParserRuleContextEmpty {
+ return BasePredictionContextEMPTY
+ }
+ // If we have a parent, convert it to a BasePredictionContext graph
+ parent := predictionContextFromRuleContext(a, outerContext.GetParent().(RuleContext))
+ state := a.states[outerContext.GetInvokingState()]
+ transition := state.GetTransitions()[0]
+
+ return SingletonBasePredictionContextCreate(parent, transition.(*RuleTransition).followState.GetStateNumber())
+}
+
+func merge(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext {
+
+ // Share same graph if both same
+ //
+ if a == b || a.Equals(b) {
+ return a
+ }
+
+ if a.pcType == PredictionContextSingleton && b.pcType == PredictionContextSingleton {
+ return mergeSingletons(a, b, rootIsWildcard, mergeCache)
+ }
+ // At least one of a or b is array
+ // If one is $ and rootIsWildcard, return $ as wildcard
+ if rootIsWildcard {
+ if a.isEmpty() {
+ return a
+ }
+ if b.isEmpty() {
+ return b
+ }
+ }
+
+ // Convert either Singleton or Empty to arrays, so that we can merge them
+ //
+ ara := convertToArray(a)
+ arb := convertToArray(b)
+ return mergeArrays(ara, arb, rootIsWildcard, mergeCache)
+}
+
+func convertToArray(pc *PredictionContext) *PredictionContext {
+ switch pc.Type() {
+ case PredictionContextEmpty:
+ return NewArrayPredictionContext([]*PredictionContext{}, []int{})
+ case PredictionContextSingleton:
+ return NewArrayPredictionContext([]*PredictionContext{pc.GetParent(0)}, []int{pc.getReturnState(0)})
+ default:
+ // Already an array
+ }
+ return pc
+}
+
+// mergeSingletons merges two Singleton [PredictionContext] instances.
+//
+// Stack tops equal, parents merge is same return left graph.
+//
+//
+// Same stack top, parents differ merge parents giving array node, then
+// remainders of those graphs. A new root node is created to point to the
+// merged parents.
+//
+//
+// Different stack tops pointing to same parent. Make array node for the
+// root where both element in the root point to the same (original)
+// parent.
+//
+//
+// Different stack tops pointing to different parents. Make array node for
+// the root where each element points to the corresponding original
+// parent.
+//
+//
+// @param a the first {@link SingletonBasePredictionContext}
+// @param b the second {@link SingletonBasePredictionContext}
+// @param rootIsWildcard {@code true} if this is a local-context merge,
+// otherwise false to indicate a full-context merge
+// @param mergeCache
+// /
+func mergeSingletons(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext {
+ if mergeCache != nil {
+ previous, present := mergeCache.Get(a, b)
+ if present {
+ return previous
+ }
+ previous, present = mergeCache.Get(b, a)
+ if present {
+ return previous
+ }
+ }
+
+ rootMerge := mergeRoot(a, b, rootIsWildcard)
+ if rootMerge != nil {
+ if mergeCache != nil {
+ mergeCache.Put(a, b, rootMerge)
+ }
+ return rootMerge
+ }
+ if a.returnState == b.returnState {
+ parent := merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache)
+ // if parent is same as existing a or b parent or reduced to a parent,
+ // return it
+ if parent.Equals(a.parentCtx) {
+ return a // ax + bx = ax, if a=b
+ }
+ if parent.Equals(b.parentCtx) {
+ return b // ax + bx = bx, if a=b
+ }
+ // else: ax + ay = a'[x,y]
+ // merge parents x and y, giving array node with x,y then remainders
+ // of those graphs. dup a, a' points at merged array.
+ // New joined parent so create a new singleton pointing to it, a'
+ spc := SingletonBasePredictionContextCreate(parent, a.returnState)
+ if mergeCache != nil {
+ mergeCache.Put(a, b, spc)
+ }
+ return spc
+ }
+ // a != b payloads differ
+ // see if we can collapse parents due to $+x parents if local ctx
+ var singleParent *PredictionContext
+ if a.Equals(b) || (a.parentCtx != nil && a.parentCtx.Equals(b.parentCtx)) { // ax +
+ // bx =
+ // [a,b]x
+ singleParent = a.parentCtx
+ }
+ if singleParent != nil { // parents are same
+ // sort payloads and use same parent
+ payloads := []int{a.returnState, b.returnState}
+ if a.returnState > b.returnState {
+ payloads[0] = b.returnState
+ payloads[1] = a.returnState
+ }
+ parents := []*PredictionContext{singleParent, singleParent}
+ apc := NewArrayPredictionContext(parents, payloads)
+ if mergeCache != nil {
+ mergeCache.Put(a, b, apc)
+ }
+ return apc
+ }
+ // parents differ and can't merge them. Just pack together
+ // into array can't merge.
+ // ax + by = [ax,by]
+ payloads := []int{a.returnState, b.returnState}
+ parents := []*PredictionContext{a.parentCtx, b.parentCtx}
+ if a.returnState > b.returnState { // sort by payload
+ payloads[0] = b.returnState
+ payloads[1] = a.returnState
+ parents = []*PredictionContext{b.parentCtx, a.parentCtx}
+ }
+ apc := NewArrayPredictionContext(parents, payloads)
+ if mergeCache != nil {
+ mergeCache.Put(a, b, apc)
+ }
+ return apc
+}
+
+// Handle case where at least one of {@code a} or {@code b} is
+// {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used
+// to represent {@link //EMPTY}.
+//
+// Local-Context Merges
+//
+// These local-context merge operations are used when {@code rootIsWildcard}
+// is true.
+//
+// {@link //EMPTY} is superset of any graph return {@link //EMPTY}.
+//
+//
+// {@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is
+// {@code //EMPTY} return left graph.
+//
+//
+// Special case of last merge if local context.
+//
+//
+// Full-Context Merges
+//
+// These full-context merge operations are used when {@code rootIsWildcard}
+// is false.
+//
+//
+//
+// Must keep all contexts {@link //EMPTY} in array is a special value (and
+// nil parent).
+//
+//
+//
+//
+// @param a the first {@link SingletonBasePredictionContext}
+// @param b the second {@link SingletonBasePredictionContext}
+// @param rootIsWildcard {@code true} if this is a local-context merge,
+// otherwise false to indicate a full-context merge
+// /
+func mergeRoot(a, b *PredictionContext, rootIsWildcard bool) *PredictionContext {
+ if rootIsWildcard {
+ if a.pcType == PredictionContextEmpty {
+ return BasePredictionContextEMPTY // // + b =//
+ }
+ if b.pcType == PredictionContextEmpty {
+ return BasePredictionContextEMPTY // a +// =//
+ }
+ } else {
+ if a.isEmpty() && b.isEmpty() {
+ return BasePredictionContextEMPTY // $ + $ = $
+ } else if a.isEmpty() { // $ + x = [$,x]
+ payloads := []int{b.getReturnState(-1), BasePredictionContextEmptyReturnState}
+ parents := []*PredictionContext{b.GetParent(-1), nil}
+ return NewArrayPredictionContext(parents, payloads)
+ } else if b.isEmpty() { // x + $ = [$,x] ($ is always first if present)
+ payloads := []int{a.getReturnState(-1), BasePredictionContextEmptyReturnState}
+ parents := []*PredictionContext{a.GetParent(-1), nil}
+ return NewArrayPredictionContext(parents, payloads)
+ }
+ }
+ return nil
+}
+
+// Merge two {@link ArrayBasePredictionContext} instances.
+//
+// Different tops, different parents.
+//
+//
+// Shared top, same parents.
+//
+//
+// Shared top, different parents.
+//
+//
+// Shared top, all shared parents.
+//
+//
+// Equal tops, merge parents and reduce top to
+// {@link SingletonBasePredictionContext}.
+//
+//
+//goland:noinspection GoBoolExpressions
+func mergeArrays(a, b *PredictionContext, rootIsWildcard bool, mergeCache *JPCMap) *PredictionContext {
+ if mergeCache != nil {
+ previous, present := mergeCache.Get(a, b)
+ if present {
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
+ fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> previous")
+ }
+ return previous
+ }
+ previous, present = mergeCache.Get(b, a)
+ if present {
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
+ fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> previous")
+ }
+ return previous
+ }
+ }
+ // merge sorted payloads a + b => M
+ i := 0 // walks a
+ j := 0 // walks b
+ k := 0 // walks target M array
+
+ mergedReturnStates := make([]int, len(a.returnStates)+len(b.returnStates))
+ mergedParents := make([]*PredictionContext, len(a.returnStates)+len(b.returnStates))
+ // walk and merge to yield mergedParents, mergedReturnStates
+ for i < len(a.returnStates) && j < len(b.returnStates) {
+ aParent := a.parents[i]
+ bParent := b.parents[j]
+ if a.returnStates[i] == b.returnStates[j] {
+ // same payload (stack tops are equal), must yield merged singleton
+ payload := a.returnStates[i]
+ // $+$ = $
+ bothDollars := payload == BasePredictionContextEmptyReturnState && aParent == nil && bParent == nil
+ axAX := aParent != nil && bParent != nil && aParent.Equals(bParent) // ax+ax
+ // ->
+ // ax
+ if bothDollars || axAX {
+ mergedParents[k] = aParent // choose left
+ mergedReturnStates[k] = payload
+ } else { // ax+ay -> a'[x,y]
+ mergedParent := merge(aParent, bParent, rootIsWildcard, mergeCache)
+ mergedParents[k] = mergedParent
+ mergedReturnStates[k] = payload
+ }
+ i++ // hop over left one as usual
+ j++ // but also Skip one in right side since we merge
+ } else if a.returnStates[i] < b.returnStates[j] { // copy a[i] to M
+ mergedParents[k] = aParent
+ mergedReturnStates[k] = a.returnStates[i]
+ i++
+ } else { // b > a, copy b[j] to M
+ mergedParents[k] = bParent
+ mergedReturnStates[k] = b.returnStates[j]
+ j++
+ }
+ k++
+ }
+ // copy over any payloads remaining in either array
+ if i < len(a.returnStates) {
+ for p := i; p < len(a.returnStates); p++ {
+ mergedParents[k] = a.parents[p]
+ mergedReturnStates[k] = a.returnStates[p]
+ k++
+ }
+ } else {
+ for p := j; p < len(b.returnStates); p++ {
+ mergedParents[k] = b.parents[p]
+ mergedReturnStates[k] = b.returnStates[p]
+ k++
+ }
+ }
+ // trim merged if we combined a few that had same stack tops
+ if k < len(mergedParents) { // write index < last position trim
+ if k == 1 { // for just one merged element, return singleton top
+ pc := SingletonBasePredictionContextCreate(mergedParents[0], mergedReturnStates[0])
+ if mergeCache != nil {
+ mergeCache.Put(a, b, pc)
+ }
+ return pc
+ }
+ mergedParents = mergedParents[0:k]
+ mergedReturnStates = mergedReturnStates[0:k]
+ }
+
+ M := NewArrayPredictionContext(mergedParents, mergedReturnStates)
+
+ // if we created same array as a or b, return that instead
+ // TODO: JI track whether this is possible above during merge sort for speed and possibly avoid an allocation
+ if M.Equals(a) {
+ if mergeCache != nil {
+ mergeCache.Put(a, b, a)
+ }
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
+ fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> a")
+ }
+ return a
+ }
+ if M.Equals(b) {
+ if mergeCache != nil {
+ mergeCache.Put(a, b, b)
+ }
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
+ fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> b")
+ }
+ return b
+ }
+ combineCommonParents(&mergedParents)
+
+ if mergeCache != nil {
+ mergeCache.Put(a, b, M)
+ }
+ if runtimeConfig.parserATNSimulatorTraceATNSim {
+ fmt.Println("mergeArrays a=" + a.String() + ",b=" + b.String() + " -> " + M.String())
+ }
+ return M
+}
+
+// Make pass over all M parents and merge any Equals() ones.
+// Note that we pass a pointer to the slice as we want to modify it in place.
+//
+//goland:noinspection GoUnusedFunction
+func combineCommonParents(parents *[]*PredictionContext) {
+ uniqueParents := NewJStore[*PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionContextCollection, "combineCommonParents for PredictionContext")
+
+ for p := 0; p < len(*parents); p++ {
+ parent := (*parents)[p]
+ _, _ = uniqueParents.Put(parent)
+ }
+ for q := 0; q < len(*parents); q++ {
+ pc, _ := uniqueParents.Get((*parents)[q])
+ (*parents)[q] = pc
+ }
+}
+
+func getCachedBasePredictionContext(context *PredictionContext, contextCache *PredictionContextCache, visited *VisitRecord) *PredictionContext {
+ if context.isEmpty() {
+ return context
+ }
+ existing, present := visited.Get(context)
+ if present {
+ return existing
+ }
+
+ existing, present = contextCache.Get(context)
+ if present {
+ visited.Put(context, existing)
+ return existing
+ }
+ changed := false
+ parents := make([]*PredictionContext, context.length())
+ for i := 0; i < len(parents); i++ {
+ parent := getCachedBasePredictionContext(context.GetParent(i), contextCache, visited)
+ if changed || !parent.Equals(context.GetParent(i)) {
+ if !changed {
+ parents = make([]*PredictionContext, context.length())
+ for j := 0; j < context.length(); j++ {
+ parents[j] = context.GetParent(j)
+ }
+ changed = true
+ }
+ parents[i] = parent
+ }
+ }
+ if !changed {
+ contextCache.add(context)
+ visited.Put(context, context)
+ return context
+ }
+ var updated *PredictionContext
+ if len(parents) == 0 {
+ updated = BasePredictionContextEMPTY
+ } else if len(parents) == 1 {
+ updated = SingletonBasePredictionContextCreate(parents[0], context.getReturnState(0))
+ } else {
+ updated = NewArrayPredictionContext(parents, context.GetReturnStates())
+ }
+ contextCache.add(updated)
+ visited.Put(updated, updated)
+ visited.Put(context, updated)
+
+ return updated
+}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go b/vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go
new file mode 100644
index 00000000000..25dfb11e8ff
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go
@@ -0,0 +1,48 @@
+package antlr
+
+var BasePredictionContextEMPTY = &PredictionContext{
+ cachedHash: calculateEmptyHash(),
+ pcType: PredictionContextEmpty,
+ returnState: BasePredictionContextEmptyReturnState,
+}
+
+// PredictionContextCache is Used to cache [PredictionContext] objects. It is used for the shared
+// context cash associated with contexts in DFA states. This cache
+// can be used for both lexers and parsers.
+type PredictionContextCache struct {
+ cache *JMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]]
+}
+
+func NewPredictionContextCache() *PredictionContextCache {
+ return &PredictionContextCache{
+ cache: NewJMap[*PredictionContext, *PredictionContext, Comparator[*PredictionContext]](pContextEqInst, PredictionContextCacheCollection, "NewPredictionContextCache()"),
+ }
+}
+
+// Add a context to the cache and return it. If the context already exists,
+// return that one instead and do not add a new context to the cache.
+// Protect shared cache from unsafe thread access.
+func (p *PredictionContextCache) add(ctx *PredictionContext) *PredictionContext {
+ if ctx.isEmpty() {
+ return BasePredictionContextEMPTY
+ }
+
+ // Put will return the existing entry if it is present (note this is done via Equals, not whether it is
+ // the same pointer), otherwise it will add the new entry and return that.
+ //
+ existing, present := p.cache.Get(ctx)
+ if present {
+ return existing
+ }
+ p.cache.Put(ctx, ctx)
+ return ctx
+}
+
+func (p *PredictionContextCache) Get(ctx *PredictionContext) (*PredictionContext, bool) {
+ pc, exists := p.cache.Get(ctx)
+ return pc, exists
+}
+
+func (p *PredictionContextCache) length() int {
+ return p.cache.Len()
+}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go b/vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go
new file mode 100644
index 00000000000..3f85a6a520b
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go
@@ -0,0 +1,536 @@
+// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// This enumeration defines the prediction modes available in ANTLR 4 along with
+// utility methods for analyzing configuration sets for conflicts and/or
+// ambiguities.
+
+const (
+ // PredictionModeSLL represents the SLL(*) prediction mode.
+ // This prediction mode ignores the current
+ // parser context when making predictions. This is the fastest prediction
+ // mode, and provides correct results for many grammars. This prediction
+ // mode is more powerful than the prediction mode provided by ANTLR 3, but
+ // may result in syntax errors for grammar and input combinations which are
+ // not SLL.
+ //
+ // When using this prediction mode, the parser will either return a correct
+ // parse tree (i.e. the same parse tree that would be returned with the
+ // [PredictionModeLL] prediction mode), or it will Report a syntax error. If a
+ // syntax error is encountered when using the SLL prediction mode,
+ // it may be due to either an actual syntax error in the input or indicate
+ // that the particular combination of grammar and input requires the more
+ // powerful LL prediction abilities to complete successfully.
+ //
+ // This prediction mode does not provide any guarantees for prediction
+ // behavior for syntactically-incorrect inputs.
+ //
+ PredictionModeSLL = 0
+
+ // PredictionModeLL represents the LL(*) prediction mode.
+ // This prediction mode allows the current parser
+ // context to be used for resolving SLL conflicts that occur during
+ // prediction. This is the fastest prediction mode that guarantees correct
+ // parse results for all combinations of grammars with syntactically correct
+ // inputs.
+ //
+ // When using this prediction mode, the parser will make correct decisions
+ // for all syntactically-correct grammar and input combinations. However, in
+ // cases where the grammar is truly ambiguous this prediction mode might not
+ // report a precise answer for exactly which alternatives are
+ // ambiguous.
+ //
+ // This prediction mode does not provide any guarantees for prediction
+ // behavior for syntactically-incorrect inputs.
+ //
+ PredictionModeLL = 1
+
+ // PredictionModeLLExactAmbigDetection represents the LL(*) prediction mode
+ // with exact ambiguity detection.
+ //
+ // In addition to the correctness guarantees provided by the [PredictionModeLL] prediction mode,
+ // this prediction mode instructs the prediction algorithm to determine the
+ // complete and exact set of ambiguous alternatives for every ambiguous
+ // decision encountered while parsing.
+ //
+ // This prediction mode may be used for diagnosing ambiguities during
+ // grammar development. Due to the performance overhead of calculating sets
+ // of ambiguous alternatives, this prediction mode should be avoided when
+ // the exact results are not necessary.
+ //
+ // This prediction mode does not provide any guarantees for prediction
+ // behavior for syntactically-incorrect inputs.
+ //
+ PredictionModeLLExactAmbigDetection = 2
+)
+
+// PredictionModehasSLLConflictTerminatingPrediction computes the SLL prediction termination condition.
+//
+// This method computes the SLL prediction termination condition for both of
+// the following cases:
+//
+// - The usual SLL+LL fallback upon SLL conflict
+// - Pure SLL without LL fallback
+//
+// # Combined SLL+LL Parsing
+//
+// When LL-fallback is enabled upon SLL conflict, correct predictions are
+// ensured regardless of how the termination condition is computed by this
+// method. Due to the substantially higher cost of LL prediction, the
+// prediction should only fall back to LL when the additional lookahead
+// cannot lead to a unique SLL prediction.
+//
+// Assuming combined SLL+LL parsing, an SLL configuration set with only
+// conflicting subsets should fall back to full LL, even if the
+// configuration sets don't resolve to the same alternative, e.g.
+//
+// {1,2} and {3,4}
+//
+// If there is at least one non-conflicting
+// configuration, SLL could continue with the hopes that more lookahead will
+// resolve via one of those non-conflicting configurations.
+//
+// Here's the prediction termination rule them: SLL (for SLL+LL parsing)
+// stops when it sees only conflicting configuration subsets. In contrast,
+// full LL keeps going when there is uncertainty.
+//
+// # Heuristic
+//
+// As a heuristic, we stop prediction when we see any conflicting subset
+// unless we see a state that only has one alternative associated with it.
+// The single-alt-state thing lets prediction continue upon rules like
+// (otherwise, it would admit defeat too soon):
+//
+// [12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) ;
+//
+// When the [ATN] simulation reaches the state before ';', it has a
+// [DFA] state that looks like:
+//
+// [12|1|[], 6|2|[], 12|2|[]]
+//
+// Naturally
+//
+// 12|1|[] and 12|2|[]
+//
+// conflict, but we cannot stop processing this node because alternative to has another way to continue,
+// via
+//
+// [6|2|[]]
+//
+// It also let's us continue for this rule:
+//
+// [1|1|[], 1|2|[], 8|3|[]] a : A | A | A B ;
+//
+// After Matching input A, we reach the stop state for rule A, state 1.
+// State 8 is the state immediately before B. Clearly alternatives 1 and 2
+// conflict and no amount of further lookahead will separate the two.
+// However, alternative 3 will be able to continue, and so we do not stop
+// working on this state. In the previous example, we're concerned with
+// states associated with the conflicting alternatives. Here alt 3 is not
+// associated with the conflicting configs, but since we can continue
+// looking for input reasonably, don't declare the state done.
+//
+// # Pure SLL Parsing
+//
+// To handle pure SLL parsing, all we have to do is make sure that we
+// combine stack contexts for configurations that differ only by semantic
+// predicate. From there, we can do the usual SLL termination heuristic.
+//
+// # Predicates in SLL+LL Parsing
+//
+// SLL decisions don't evaluate predicates until after they reach [DFA] stop
+// states because they need to create the [DFA] cache that works in all
+// semantic situations. In contrast, full LL evaluates predicates collected
+// during start state computation, so it can ignore predicates thereafter.
+// This means that SLL termination detection can totally ignore semantic
+// predicates.
+//
+// Implementation-wise, [ATNConfigSet] combines stack contexts but not
+// semantic predicate contexts, so we might see two configurations like the
+// following:
+//
+// (s, 1, x, {}), (s, 1, x', {p})
+//
+// Before testing these configurations against others, we have to merge
+// x and x' (without modifying the existing configurations).
+// For example, we test (x+x')==x” when looking for conflicts in
+// the following configurations:
+//
+// (s, 1, x, {}), (s, 1, x', {p}), (s, 2, x”, {})
+//
+// If the configuration set has predicates (as indicated by
+// [ATNConfigSet.hasSemanticContext]), this algorithm makes a copy of
+// the configurations to strip out all the predicates so that a standard
+// [ATNConfigSet] will merge everything ignoring predicates.
+func PredictionModehasSLLConflictTerminatingPrediction(mode int, configs *ATNConfigSet) bool {
+
+ // Configs in rule stop states indicate reaching the end of the decision
+ // rule (local context) or end of start rule (full context). If all
+ // configs meet this condition, then none of the configurations is able
+ // to Match additional input, so we terminate prediction.
+ //
+ if PredictionModeallConfigsInRuleStopStates(configs) {
+ return true
+ }
+
+ // pure SLL mode parsing
+ if mode == PredictionModeSLL {
+ // Don't bother with combining configs from different semantic
+ // contexts if we can fail over to full LL costs more time
+ // since we'll often fail over anyway.
+ if configs.hasSemanticContext {
+ // dup configs, tossing out semantic predicates
+ dup := NewATNConfigSet(false)
+ for _, c := range configs.configs {
+
+ // NewATNConfig({semanticContext:}, c)
+ c = NewATNConfig2(c, SemanticContextNone)
+ dup.Add(c, nil)
+ }
+ configs = dup
+ }
+ // now we have combined contexts for configs with dissimilar predicates
+ }
+ // pure SLL or combined SLL+LL mode parsing
+ altsets := PredictionModegetConflictingAltSubsets(configs)
+ return PredictionModehasConflictingAltSet(altsets) && !PredictionModehasStateAssociatedWithOneAlt(configs)
+}
+
+// PredictionModehasConfigInRuleStopState checks if any configuration in the given configs is in a
+// [RuleStopState]. Configurations meeting this condition have reached
+// the end of the decision rule (local context) or end of start rule (full
+// context).
+//
+// The func returns true if any configuration in the supplied configs is in a [RuleStopState]
+func PredictionModehasConfigInRuleStopState(configs *ATNConfigSet) bool {
+ for _, c := range configs.configs {
+ if _, ok := c.GetState().(*RuleStopState); ok {
+ return true
+ }
+ }
+ return false
+}
+
+// PredictionModeallConfigsInRuleStopStates checks if all configurations in configs are in a
+// [RuleStopState]. Configurations meeting this condition have reached
+// the end of the decision rule (local context) or end of start rule (full
+// context).
+//
+// the func returns true if all configurations in configs are in a
+// [RuleStopState]
+func PredictionModeallConfigsInRuleStopStates(configs *ATNConfigSet) bool {
+
+ for _, c := range configs.configs {
+ if _, ok := c.GetState().(*RuleStopState); !ok {
+ return false
+ }
+ }
+ return true
+}
+
+// PredictionModeresolvesToJustOneViableAlt checks full LL prediction termination.
+//
+// Can we stop looking ahead during [ATN] simulation or is there some
+// uncertainty as to which alternative we will ultimately pick, after
+// consuming more input? Even if there are partial conflicts, we might know
+// that everything is going to resolve to the same minimum alternative. That
+// means we can stop since no more lookahead will change that fact. On the
+// other hand, there might be multiple conflicts that resolve to different
+// minimums. That means we need more look ahead to decide which of those
+// alternatives we should predict.
+//
+// The basic idea is to split the set of configurations 'C', into
+// conflicting subsets (s, _, ctx, _) and singleton subsets with
+// non-conflicting configurations. Two configurations conflict if they have
+// identical [ATNConfig].state and [ATNConfig].context values
+// but a different [ATNConfig].alt value, e.g.
+//
+// (s, i, ctx, _)
+//
+// and
+//
+// (s, j, ctx, _) ; for i != j
+//
+// Reduce these configuration subsets to the set of possible alternatives.
+// You can compute the alternative subsets in one pass as follows:
+//
+// A_s,ctx = {i | (s, i, ctx, _)}
+//
+// for each configuration in C holding s and ctx fixed.
+//
+// Or in pseudo-code:
+//
+// for each configuration c in C:
+// map[c] U = c.ATNConfig.alt alt // map hash/equals uses s and x, not alt and not pred
+//
+// The values in map are the set of
+//
+// A_s,ctx
+//
+// sets.
+//
+// If
+//
+// |A_s,ctx| = 1
+//
+// then there is no conflict associated with s and ctx.
+//
+// Reduce the subsets to singletons by choosing a minimum of each subset. If
+// the union of these alternative subsets is a singleton, then no amount of
+// further lookahead will help us. We will always pick that alternative. If,
+// however, there is more than one alternative, then we are uncertain which
+// alternative to predict and must continue looking for resolution. We may
+// or may not discover an ambiguity in the future, even if there are no
+// conflicting subsets this round.
+//
+// The biggest sin is to terminate early because it means we've made a
+// decision but were uncertain as to the eventual outcome. We haven't used
+// enough lookahead. On the other hand, announcing a conflict too late is no
+// big deal; you will still have the conflict. It's just inefficient. It
+// might even look until the end of file.
+//
+// No special consideration for semantic predicates is required because
+// predicates are evaluated on-the-fly for full LL prediction, ensuring that
+// no configuration contains a semantic context during the termination
+// check.
+//
+// # Conflicting Configs
+//
+// Two configurations:
+//
+// (s, i, x) and (s, j, x')
+//
+// conflict when i != j but x = x'. Because we merge all
+// (s, i, _) configurations together, that means that there are at
+// most n configurations associated with state s for
+// n possible alternatives in the decision. The merged stacks
+// complicate the comparison of configuration contexts x and x'.
+//
+// Sam checks to see if one is a subset of the other by calling
+// merge and checking to see if the merged result is either x or x'.
+// If the x associated with lowest alternative i
+// is the superset, then i is the only possible prediction since the
+// others resolve to min(i) as well. However, if x is
+// associated with j > i then at least one stack configuration for
+// j is not in conflict with alternative i. The algorithm
+// should keep going, looking for more lookahead due to the uncertainty.
+//
+// For simplicity, I'm doing an equality check between x and
+// x', which lets the algorithm continue to consume lookahead longer
+// than necessary. The reason I like the equality is of course the
+// simplicity but also because that is the test you need to detect the
+// alternatives that are actually in conflict.
+//
+// # Continue/Stop Rule
+//
+// Continue if the union of resolved alternative sets from non-conflicting and
+// conflicting alternative subsets has more than one alternative. We are
+// uncertain about which alternative to predict.
+//
+// The complete set of alternatives,
+//
+// [i for (_, i, _)]
+//
+// tells us which alternatives are still in the running for the amount of input we've
+// consumed at this point. The conflicting sets let us to strip away
+// configurations that won't lead to more states because we resolve
+// conflicts to the configuration with a minimum alternate for the
+// conflicting set.
+//
+// Cases
+//
+// - no conflicts and more than 1 alternative in set => continue
+// - (s, 1, x), (s, 2, x), (s, 3, z), (s', 1, y), (s', 2, y) yields non-conflicting set
+// {3} ∪ conflicting sets min({1,2}) ∪ min({1,2}) = {1,3} => continue
+// - (s, 1, x), (s, 2, x), (s', 1, y), (s', 2, y), (s”, 1, z) yields non-conflicting set
+// {1} ∪ conflicting sets min({1,2}) ∪ min({1,2}) = {1} => stop and predict 1
+// - (s, 1, x), (s, 2, x), (s', 1, y), (s', 2, y) yields conflicting, reduced sets
+// {1} ∪ {1} = {1} => stop and predict 1, can announce ambiguity {1,2}
+// - (s, 1, x), (s, 2, x), (s', 2, y), (s', 3, y) yields conflicting, reduced sets
+// {1} ∪ {2} = {1,2} => continue
+// - (s, 1, x), (s, 2, x), (s', 2, y), (s', 3, y) yields conflicting, reduced sets
+// {1} ∪ {2} = {1,2} => continue
+// - (s, 1, x), (s, 2, x), (s', 3, y), (s', 4, y) yields conflicting, reduced sets
+// {1} ∪ {3} = {1,3} => continue
+//
+// # Exact Ambiguity Detection
+//
+// If all states report the same conflicting set of alternatives, then we
+// know we have the exact ambiguity set:
+//
+// |A_i| > 1
+//
+// and
+//
+// A_i = A_j ; for all i, j
+//
+// In other words, we continue examining lookahead until all A_i
+// have more than one alternative and all A_i are the same. If
+//
+// A={{1,2}, {1,3}}
+//
+// then regular LL prediction would terminate because the resolved set is {1}.
+// To determine what the real ambiguity is, we have to know whether the ambiguity is between one and
+// two or one and three so we keep going. We can only stop prediction when
+// we need exact ambiguity detection when the sets look like:
+//
+// A={{1,2}}
+//
+// or
+//
+// {{1,2},{1,2}}, etc...
+func PredictionModeresolvesToJustOneViableAlt(altsets []*BitSet) int {
+ return PredictionModegetSingleViableAlt(altsets)
+}
+
+// PredictionModeallSubsetsConflict determines if every alternative subset in altsets contains more
+// than one alternative.
+//
+// The func returns true if every [BitSet] in altsets has
+// [BitSet].cardinality cardinality > 1
+func PredictionModeallSubsetsConflict(altsets []*BitSet) bool {
+ return !PredictionModehasNonConflictingAltSet(altsets)
+}
+
+// PredictionModehasNonConflictingAltSet determines if any single alternative subset in altsets contains
+// exactly one alternative.
+//
+// The func returns true if altsets contains at least one [BitSet] with
+// [BitSet].cardinality cardinality 1
+func PredictionModehasNonConflictingAltSet(altsets []*BitSet) bool {
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ if alts.length() == 1 {
+ return true
+ }
+ }
+ return false
+}
+
+// PredictionModehasConflictingAltSet determines if any single alternative subset in altsets contains
+// more than one alternative.
+//
+// The func returns true if altsets contains a [BitSet] with
+// [BitSet].cardinality cardinality > 1, otherwise false
+func PredictionModehasConflictingAltSet(altsets []*BitSet) bool {
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ if alts.length() > 1 {
+ return true
+ }
+ }
+ return false
+}
+
+// PredictionModeallSubsetsEqual determines if every alternative subset in altsets is equivalent.
+//
+// The func returns true if every member of altsets is equal to the others.
+func PredictionModeallSubsetsEqual(altsets []*BitSet) bool {
+ var first *BitSet
+
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ if first == nil {
+ first = alts
+ } else if alts != first {
+ return false
+ }
+ }
+
+ return true
+}
+
+// PredictionModegetUniqueAlt returns the unique alternative predicted by all alternative subsets in
+// altsets. If no such alternative exists, this method returns
+// [ATNInvalidAltNumber].
+//
+// @param altsets a collection of alternative subsets
+func PredictionModegetUniqueAlt(altsets []*BitSet) int {
+ all := PredictionModeGetAlts(altsets)
+ if all.length() == 1 {
+ return all.minValue()
+ }
+
+ return ATNInvalidAltNumber
+}
+
+// PredictionModeGetAlts returns the complete set of represented alternatives for a collection of
+// alternative subsets. This method returns the union of each [BitSet]
+// in altsets, being the set of represented alternatives in altsets.
+func PredictionModeGetAlts(altsets []*BitSet) *BitSet {
+ all := NewBitSet()
+ for _, alts := range altsets {
+ all.or(alts)
+ }
+ return all
+}
+
+// PredictionModegetConflictingAltSubsets gets the conflicting alt subsets from a configuration set.
+//
+// for each configuration c in configs:
+// map[c] U= c.ATNConfig.alt // map hash/equals uses s and x, not alt and not pred
+func PredictionModegetConflictingAltSubsets(configs *ATNConfigSet) []*BitSet {
+ configToAlts := NewJMap[*ATNConfig, *BitSet, *ATNAltConfigComparator[*ATNConfig]](atnAltCfgEqInst, AltSetCollection, "PredictionModegetConflictingAltSubsets()")
+
+ for _, c := range configs.configs {
+
+ alts, ok := configToAlts.Get(c)
+ if !ok {
+ alts = NewBitSet()
+ configToAlts.Put(c, alts)
+ }
+ alts.add(c.GetAlt())
+ }
+
+ return configToAlts.Values()
+}
+
+// PredictionModeGetStateToAltMap gets a map from state to alt subset from a configuration set.
+//
+// for each configuration c in configs:
+// map[c.ATNConfig.state] U= c.ATNConfig.alt}
+func PredictionModeGetStateToAltMap(configs *ATNConfigSet) *AltDict {
+ m := NewAltDict()
+
+ for _, c := range configs.configs {
+ alts := m.Get(c.GetState().String())
+ if alts == nil {
+ alts = NewBitSet()
+ m.put(c.GetState().String(), alts)
+ }
+ alts.(*BitSet).add(c.GetAlt())
+ }
+ return m
+}
+
+func PredictionModehasStateAssociatedWithOneAlt(configs *ATNConfigSet) bool {
+ values := PredictionModeGetStateToAltMap(configs).values()
+ for i := 0; i < len(values); i++ {
+ if values[i].(*BitSet).length() == 1 {
+ return true
+ }
+ }
+ return false
+}
+
+// PredictionModegetSingleViableAlt gets the single alternative predicted by all alternative subsets in altsets
+// if there is one.
+//
+// TODO: JI - Review this code - it does not seem to do the same thing as the Java code - maybe because [BitSet] is not like the Java utils BitSet
+func PredictionModegetSingleViableAlt(altsets []*BitSet) int {
+ result := ATNInvalidAltNumber
+
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ minAlt := alts.minValue()
+ if result == ATNInvalidAltNumber {
+ result = minAlt
+ } else if result != minAlt { // more than 1 viable alt
+ return ATNInvalidAltNumber
+ }
+ }
+ return result
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/recognizer.go b/vendor/github.com/antlr4-go/antlr/v4/recognizer.go
similarity index 70%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/recognizer.go
rename to vendor/github.com/antlr4-go/antlr/v4/recognizer.go
index bfe542d0914..2e0b504fb3d 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/recognizer.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/recognizer.go
@@ -26,6 +26,9 @@ type Recognizer interface {
RemoveErrorListeners()
GetATN() *ATN
GetErrorListenerDispatch() ErrorListener
+ HasError() bool
+ GetError() RecognitionException
+ SetError(RecognitionException)
}
type BaseRecognizer struct {
@@ -36,6 +39,7 @@ type BaseRecognizer struct {
LiteralNames []string
SymbolicNames []string
GrammarFileName string
+ SynErr RecognitionException
}
func NewBaseRecognizer() *BaseRecognizer {
@@ -45,7 +49,10 @@ func NewBaseRecognizer() *BaseRecognizer {
return rec
}
+//goland:noinspection GoUnusedGlobalVariable
var tokenTypeMapCache = make(map[string]int)
+
+//goland:noinspection GoUnusedGlobalVariable
var ruleIndexMapCache = make(map[string]int)
func (b *BaseRecognizer) checkVersion(toolVersion string) {
@@ -55,7 +62,19 @@ func (b *BaseRecognizer) checkVersion(toolVersion string) {
}
}
-func (b *BaseRecognizer) Action(context RuleContext, ruleIndex, actionIndex int) {
+func (b *BaseRecognizer) SetError(err RecognitionException) {
+ b.SynErr = err
+}
+
+func (b *BaseRecognizer) HasError() bool {
+ return b.SynErr != nil
+}
+
+func (b *BaseRecognizer) GetError() RecognitionException {
+ return b.SynErr
+}
+
+func (b *BaseRecognizer) Action(_ RuleContext, _, _ int) {
panic("action not implemented on Recognizer!")
}
@@ -105,9 +124,11 @@ func (b *BaseRecognizer) SetState(v int) {
// return result
//}
-// Get a map from rule names to rule indexes.
+// GetRuleIndexMap Get a map from rule names to rule indexes.
//
-// Used for XPath and tree pattern compilation.
+// Used for XPath and tree pattern compilation.
+//
+// TODO: JI This is not yet implemented in the Go runtime. Maybe not needed.
func (b *BaseRecognizer) GetRuleIndexMap() map[string]int {
panic("Method not defined!")
@@ -124,7 +145,8 @@ func (b *BaseRecognizer) GetRuleIndexMap() map[string]int {
// return result
}
-func (b *BaseRecognizer) GetTokenType(tokenName string) int {
+// GetTokenType get the token type based upon its name
+func (b *BaseRecognizer) GetTokenType(_ string) int {
panic("Method not defined!")
// var ttype = b.GetTokenTypeMap()[tokenName]
// if (ttype !=nil) {
@@ -162,26 +184,27 @@ func (b *BaseRecognizer) GetTokenType(tokenName string) int {
// }
//}
-// What is the error header, normally line/character position information?//
+// GetErrorHeader returns the error header, normally line/character position information.
+//
+// Can be overridden in sub structs embedding BaseRecognizer.
func (b *BaseRecognizer) GetErrorHeader(e RecognitionException) string {
line := e.GetOffendingToken().GetLine()
column := e.GetOffendingToken().GetColumn()
return "line " + strconv.Itoa(line) + ":" + strconv.Itoa(column)
}
-// How should a token be displayed in an error message? The default
+// GetTokenErrorDisplay shows how a token should be displayed in an error message.
//
-// is to display just the text, but during development you might
-// want to have a lot of information spit out. Override in that case
-// to use t.String() (which, for CommonToken, dumps everything about
-// the token). This is better than forcing you to override a method in
-// your token objects because you don't have to go modify your lexer
-// so that it creates a NewJava type.
+// The default is to display just the text, but during development you might
+// want to have a lot of information spit out. Override in that case
+// to use t.String() (which, for CommonToken, dumps everything about
+// the token). This is better than forcing you to override a method in
+// your token objects because you don't have to go modify your lexer
+// so that it creates a NewJava type.
//
-// @deprecated This method is not called by the ANTLR 4 Runtime. Specific
-// implementations of {@link ANTLRErrorStrategy} may provide a similar
-// feature when necessary. For example, see
-// {@link DefaultErrorStrategy//GetTokenErrorDisplay}.
+// Deprecated: This method is not called by the ANTLR 4 Runtime. Specific
+// implementations of [ANTLRErrorStrategy] may provide a similar
+// feature when necessary. For example, see [DefaultErrorStrategy].GetTokenErrorDisplay()
func (b *BaseRecognizer) GetTokenErrorDisplay(t Token) string {
if t == nil {
return ""
@@ -205,12 +228,14 @@ func (b *BaseRecognizer) GetErrorListenerDispatch() ErrorListener {
return NewProxyErrorListener(b.listeners)
}
-// subclass needs to override these if there are sempreds or actions
-// that the ATN interp needs to execute
-func (b *BaseRecognizer) Sempred(localctx RuleContext, ruleIndex int, actionIndex int) bool {
+// Sempred embedding structs need to override this if there are sempreds or actions
+// that the ATN interpreter needs to execute
+func (b *BaseRecognizer) Sempred(_ RuleContext, _ int, _ int) bool {
return true
}
-func (b *BaseRecognizer) Precpred(localctx RuleContext, precedence int) bool {
+// Precpred embedding structs need to override this if there are preceding predicates
+// that the ATN interpreter needs to execute
+func (b *BaseRecognizer) Precpred(_ RuleContext, _ int) bool {
return true
}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/rule_context.go b/vendor/github.com/antlr4-go/antlr/v4/rule_context.go
new file mode 100644
index 00000000000..f2ad04793e1
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/rule_context.go
@@ -0,0 +1,40 @@
+// Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// RuleContext is a record of a single rule invocation. It knows
+// which context invoked it, if any. If there is no parent context, then
+// naturally the invoking state is not valid. The parent link
+// provides a chain upwards from the current rule invocation to the root
+// of the invocation tree, forming a stack.
+//
+// We actually carry no information about the rule associated with this context (except
+// when parsing). We keep only the state number of the invoking state from
+// the [ATN] submachine that invoked this. Contrast this with the s
+// pointer inside [ParserRuleContext] that tracks the current state
+// being "executed" for the current rule.
+//
+// The parent contexts are useful for computing lookahead sets and
+// getting error information.
+//
+// These objects are used during parsing and prediction.
+// For the special case of parsers, we use the struct
+// [ParserRuleContext], which embeds a RuleContext.
+//
+// @see ParserRuleContext
+type RuleContext interface {
+ RuleNode
+
+ GetInvokingState() int
+ SetInvokingState(int)
+
+ GetRuleIndex() int
+ IsEmpty() bool
+
+ GetAltNumber() int
+ SetAltNumber(altNumber int)
+
+ String([]string, RuleContext) string
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/semantic_context.go b/vendor/github.com/antlr4-go/antlr/v4/semantic_context.go
similarity index 92%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/semantic_context.go
rename to vendor/github.com/antlr4-go/antlr/v4/semantic_context.go
index a702e99def7..68cb9061eb6 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/semantic_context.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/semantic_context.go
@@ -9,14 +9,13 @@ import (
"strconv"
)
-// A tree structure used to record the semantic context in which
-// an ATN configuration is valid. It's either a single predicate,
-// a conjunction {@code p1&&p2}, or a sum of products {@code p1||p2}.
+// SemanticContext is a tree structure used to record the semantic context in which
//
-// I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of
-// {@link SemanticContext} within the scope of this outer class.
+// an ATN configuration is valid. It's either a single predicate,
+// a conjunction p1 && p2, or a sum of products p1 || p2.
//
-
+// I have scoped the AND, OR, and Predicate subclasses of
+// [SemanticContext] within the scope of this outer ``class''
type SemanticContext interface {
Equals(other Collectable[SemanticContext]) bool
Hash() int
@@ -80,7 +79,7 @@ func NewPredicate(ruleIndex, predIndex int, isCtxDependent bool) *Predicate {
var SemanticContextNone = NewPredicate(-1, -1, false)
-func (p *Predicate) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {
+func (p *Predicate) evalPrecedence(_ Recognizer, _ RuleContext) SemanticContext {
return p
}
@@ -198,7 +197,7 @@ type AND struct {
func NewAND(a, b SemanticContext) *AND {
- operands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst)
+ operands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst, SemanticContextCollection, "NewAND() operands")
if aa, ok := a.(*AND); ok {
for _, o := range aa.opnds {
operands.Put(o)
@@ -230,9 +229,7 @@ func NewAND(a, b SemanticContext) *AND {
vs := operands.Values()
opnds := make([]SemanticContext, len(vs))
- for i, v := range vs {
- opnds[i] = v.(SemanticContext)
- }
+ copy(opnds, vs)
and := new(AND)
and.opnds = opnds
@@ -316,12 +313,12 @@ func (a *AND) Hash() int {
return murmurFinish(h, len(a.opnds))
}
-func (a *OR) Hash() int {
- h := murmurInit(41) // Init with a value different from AND
- for _, op := range a.opnds {
+func (o *OR) Hash() int {
+ h := murmurInit(41) // Init with o value different from AND
+ for _, op := range o.opnds {
h = murmurUpdate(h, op.Hash())
}
- return murmurFinish(h, len(a.opnds))
+ return murmurFinish(h, len(o.opnds))
}
func (a *AND) String() string {
@@ -349,7 +346,7 @@ type OR struct {
func NewOR(a, b SemanticContext) *OR {
- operands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst)
+ operands := NewJStore[SemanticContext, Comparator[SemanticContext]](semctxEqInst, SemanticContextCollection, "NewOR() operands")
if aa, ok := a.(*OR); ok {
for _, o := range aa.opnds {
operands.Put(o)
@@ -382,9 +379,7 @@ func NewOR(a, b SemanticContext) *OR {
vs := operands.Values()
opnds := make([]SemanticContext, len(vs))
- for i, v := range vs {
- opnds[i] = v.(SemanticContext)
- }
+ copy(opnds, vs)
o := new(OR)
o.opnds = opnds
diff --git a/vendor/github.com/antlr4-go/antlr/v4/statistics.go b/vendor/github.com/antlr4-go/antlr/v4/statistics.go
new file mode 100644
index 00000000000..70c0673a0f6
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/statistics.go
@@ -0,0 +1,281 @@
+//go:build antlr.stats
+
+package antlr
+
+import (
+ "fmt"
+ "log"
+ "os"
+ "path/filepath"
+ "sort"
+ "strconv"
+ "sync"
+)
+
+// This file allows the user to collect statistics about the runtime of the ANTLR runtime. It is not enabled by default
+// and so incurs no time penalty. To enable it, you must build the runtime with the antlr.stats build tag.
+//
+
+// Tells various components to collect statistics - because it is only true when this file is included, it will
+// allow the compiler to completely eliminate all the code that is only used when collecting statistics.
+const collectStats = true
+
+// goRunStats is a collection of all the various data the ANTLR runtime has collected about a particular run.
+// It is exported so that it can be used by others to look for things that are not already looked for in the
+// runtime statistics.
+type goRunStats struct {
+
+ // jStats is a slice of all the [JStatRec] records that have been created, which is one for EVERY collection created
+ // during a run. It is exported so that it can be used by others to look for things that are not already looked for
+ // within this package.
+ //
+ jStats []*JStatRec
+ jStatsLock sync.RWMutex
+ topN int
+ topNByMax []*JStatRec
+ topNByUsed []*JStatRec
+ unusedCollections map[CollectionSource]int
+ counts map[CollectionSource]int
+}
+
+const (
+ collectionsFile = "collections"
+)
+
+var (
+ Statistics = &goRunStats{
+ topN: 10,
+ }
+)
+
+type statsOption func(*goRunStats) error
+
+// Configure allows the statistics system to be configured as the user wants and override the defaults
+func (s *goRunStats) Configure(options ...statsOption) error {
+ for _, option := range options {
+ err := option(s)
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// WithTopN sets the number of things to list in the report when we are concerned with the top N things.
+//
+// For example, if you want to see the top 20 collections by size, you can do:
+//
+// antlr.Statistics.Configure(antlr.WithTopN(20))
+func WithTopN(topN int) statsOption {
+ return func(s *goRunStats) error {
+ s.topN = topN
+ return nil
+ }
+}
+
+// Analyze looks through all the statistical records and computes all the outputs that might be useful to the user.
+//
+// The function gathers and analyzes a number of statistics about any particular run of
+// an ANTLR generated recognizer. In the vast majority of cases, the statistics are only
+// useful to maintainers of ANTLR itself, but they can be useful to users as well. They may be
+// especially useful in tracking down bugs or performance problems when an ANTLR user could
+// supply the output from this package, but cannot supply the grammar file(s) they are using, even
+// privately to the maintainers.
+//
+// The statistics are gathered by the runtime itself, and are not gathered by the parser or lexer, but the user
+// must call this function their selves to analyze the statistics. This is because none of the infrastructure is
+// extant unless the calling program is built with the antlr.stats tag like so:
+//
+// go build -tags antlr.stats .
+//
+// When a program is built with the antlr.stats tag, the Statistics object is created and available outside
+// the package. The user can then call the [Statistics.Analyze] function to analyze the statistics and then call the
+// [Statistics.Report] function to report the statistics.
+//
+// Please forward any questions about this package to the ANTLR discussion groups on GitHub or send to them to
+// me [Jim Idle] directly at jimi@idle.ws
+//
+// [Jim Idle]: https:://github.com/jim-idle
+func (s *goRunStats) Analyze() {
+
+ // Look for anything that looks strange and record it in our local maps etc for the report to present it
+ //
+ s.CollectionAnomalies()
+ s.TopNCollections()
+}
+
+// TopNCollections looks through all the statistical records and gathers the top ten collections by size.
+func (s *goRunStats) TopNCollections() {
+
+ // Let's sort the stat records by MaxSize
+ //
+ sort.Slice(s.jStats, func(i, j int) bool {
+ return s.jStats[i].MaxSize > s.jStats[j].MaxSize
+ })
+
+ for i := 0; i < len(s.jStats) && i < s.topN; i++ {
+ s.topNByMax = append(s.topNByMax, s.jStats[i])
+ }
+
+ // Sort by the number of times used
+ //
+ sort.Slice(s.jStats, func(i, j int) bool {
+ return s.jStats[i].Gets+s.jStats[i].Puts > s.jStats[j].Gets+s.jStats[j].Puts
+ })
+ for i := 0; i < len(s.jStats) && i < s.topN; i++ {
+ s.topNByUsed = append(s.topNByUsed, s.jStats[i])
+ }
+}
+
+// Report dumps a markdown formatted report of all the statistics collected during a run to the given dir output
+// path, which should represent a directory. Generated files will be prefixed with the given prefix and will be
+// given a type name such as `anomalies` and a time stamp such as `2021-09-01T12:34:56` and a .md suffix.
+func (s *goRunStats) Report(dir string, prefix string) error {
+
+ isDir, err := isDirectory(dir)
+ switch {
+ case err != nil:
+ return err
+ case !isDir:
+ return fmt.Errorf("output directory `%s` is not a directory", dir)
+ }
+ s.reportCollections(dir, prefix)
+
+ // Clean out any old data in case the user forgets
+ //
+ s.Reset()
+ return nil
+}
+
+func (s *goRunStats) Reset() {
+ s.jStats = nil
+ s.topNByUsed = nil
+ s.topNByMax = nil
+}
+
+func (s *goRunStats) reportCollections(dir, prefix string) {
+ cname := filepath.Join(dir, ".asciidoctor")
+ // If the file doesn't exist, create it, or append to the file
+ f, err := os.OpenFile(cname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
+ if err != nil {
+ log.Fatal(err)
+ }
+ _, _ = f.WriteString(`// .asciidoctorconfig
+++++
+
+++++`)
+ _ = f.Close()
+
+ fname := filepath.Join(dir, prefix+"_"+"_"+collectionsFile+"_"+".adoc")
+ // If the file doesn't exist, create it, or append to the file
+ f, err = os.OpenFile(fname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer func(f *os.File) {
+ err := f.Close()
+ if err != nil {
+ log.Fatal(err)
+ }
+ }(f)
+ _, _ = f.WriteString("= Collections for " + prefix + "\n\n")
+
+ _, _ = f.WriteString("== Summary\n")
+
+ if s.unusedCollections != nil {
+ _, _ = f.WriteString("=== Unused Collections\n")
+ _, _ = f.WriteString("Unused collections incur a penalty for allocation that makes them a candidate for either\n")
+ _, _ = f.WriteString(" removal or optimization. If you are using a collection that is not used, you should\n")
+ _, _ = f.WriteString(" consider removing it. If you are using a collection that is used, but not very often,\n")
+ _, _ = f.WriteString(" you should consider using lazy initialization to defer the allocation until it is\n")
+ _, _ = f.WriteString(" actually needed.\n\n")
+
+ _, _ = f.WriteString("\n.Unused collections\n")
+ _, _ = f.WriteString(`[cols="<3,>1"]` + "\n\n")
+ _, _ = f.WriteString("|===\n")
+ _, _ = f.WriteString("| Type | Count\n")
+
+ for k, v := range s.unusedCollections {
+ _, _ = f.WriteString("| " + CollectionDescriptors[k].SybolicName + " | " + strconv.Itoa(v) + "\n")
+ }
+ f.WriteString("|===\n\n")
+ }
+
+ _, _ = f.WriteString("\n.Summary of Collections\n")
+ _, _ = f.WriteString(`[cols="<3,>1"]` + "\n\n")
+ _, _ = f.WriteString("|===\n")
+ _, _ = f.WriteString("| Type | Count\n")
+ for k, v := range s.counts {
+ _, _ = f.WriteString("| " + CollectionDescriptors[k].SybolicName + " | " + strconv.Itoa(v) + "\n")
+ }
+ _, _ = f.WriteString("| Total | " + strconv.Itoa(len(s.jStats)) + "\n")
+ _, _ = f.WriteString("|===\n\n")
+
+ _, _ = f.WriteString("\n.Summary of Top " + strconv.Itoa(s.topN) + " Collections by MaxSize\n")
+ _, _ = f.WriteString(`[cols="<1,<3,>1,>1,>1,>1"]` + "\n\n")
+ _, _ = f.WriteString("|===\n")
+ _, _ = f.WriteString("| Source | Description | MaxSize | EndSize | Puts | Gets\n")
+ for _, c := range s.topNByMax {
+ _, _ = f.WriteString("| " + CollectionDescriptors[c.Source].SybolicName + "\n")
+ _, _ = f.WriteString("| " + c.Description + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.MaxSize) + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.CurSize) + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.Puts) + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.Gets) + "\n")
+ _, _ = f.WriteString("\n")
+ }
+ _, _ = f.WriteString("|===\n\n")
+
+ _, _ = f.WriteString("\n.Summary of Top " + strconv.Itoa(s.topN) + " Collections by Access\n")
+ _, _ = f.WriteString(`[cols="<1,<3,>1,>1,>1,>1,>1"]` + "\n\n")
+ _, _ = f.WriteString("|===\n")
+ _, _ = f.WriteString("| Source | Description | MaxSize | EndSize | Puts | Gets | P+G\n")
+ for _, c := range s.topNByUsed {
+ _, _ = f.WriteString("| " + CollectionDescriptors[c.Source].SybolicName + "\n")
+ _, _ = f.WriteString("| " + c.Description + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.MaxSize) + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.CurSize) + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.Puts) + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.Gets) + "\n")
+ _, _ = f.WriteString("| " + strconv.Itoa(c.Gets+c.Puts) + "\n")
+ _, _ = f.WriteString("\n")
+ }
+ _, _ = f.WriteString("|===\n\n")
+}
+
+// AddJStatRec adds a [JStatRec] record to the [goRunStats] collection when build runtimeConfig antlr.stats is enabled.
+func (s *goRunStats) AddJStatRec(rec *JStatRec) {
+ s.jStatsLock.Lock()
+ defer s.jStatsLock.Unlock()
+ s.jStats = append(s.jStats, rec)
+}
+
+// CollectionAnomalies looks through all the statistical records and gathers any anomalies that have been found.
+func (s *goRunStats) CollectionAnomalies() {
+ s.jStatsLock.RLock()
+ defer s.jStatsLock.RUnlock()
+ s.counts = make(map[CollectionSource]int, len(s.jStats))
+ for _, c := range s.jStats {
+
+ // Accumlate raw counts
+ //
+ s.counts[c.Source]++
+
+ // Look for allocated but unused collections and count them
+ if c.MaxSize == 0 && c.Puts == 0 {
+ if s.unusedCollections == nil {
+ s.unusedCollections = make(map[CollectionSource]int)
+ }
+ s.unusedCollections[c.Source]++
+ }
+ if c.MaxSize > 6000 {
+ fmt.Println("Collection ", c.Description, "accumulated a max size of ", c.MaxSize, " - this is probably too large and indicates a poorly formed grammar")
+ }
+ }
+
+}
diff --git a/vendor/github.com/antlr4-go/antlr/v4/stats_data.go b/vendor/github.com/antlr4-go/antlr/v4/stats_data.go
new file mode 100644
index 00000000000..4d9eb94e5fa
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/stats_data.go
@@ -0,0 +1,23 @@
+package antlr
+
+// A JStatRec is a record of a particular use of a [JStore], [JMap] or JPCMap] collection. Typically, it will be
+// used to look for unused collections that wre allocated anyway, problems with hash bucket clashes, and anomalies
+// such as huge numbers of Gets with no entries found GetNoEnt. You can refer to the CollectionAnomalies() function
+// for ideas on what can be gleaned from these statistics about collections.
+type JStatRec struct {
+ Source CollectionSource
+ MaxSize int
+ CurSize int
+ Gets int
+ GetHits int
+ GetMisses int
+ GetHashConflicts int
+ GetNoEnt int
+ Puts int
+ PutHits int
+ PutMisses int
+ PutHashConflicts int
+ MaxSlotSize int
+ Description string
+ CreateStack []byte
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token.go b/vendor/github.com/antlr4-go/antlr/v4/token.go
similarity index 86%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token.go
rename to vendor/github.com/antlr4-go/antlr/v4/token.go
index f73b06bc6a0..9670efb829e 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/token.go
@@ -35,6 +35,8 @@ type Token interface {
GetTokenSource() TokenSource
GetInputStream() CharStream
+
+ String() string
}
type BaseToken struct {
@@ -53,7 +55,7 @@ type BaseToken struct {
const (
TokenInvalidType = 0
- // During lookahead operations, this "token" signifies we hit rule end ATN state
+ // TokenEpsilon - during lookahead operations, this "token" signifies we hit the rule end [ATN] state
// and did not follow it despite needing to.
TokenEpsilon = -2
@@ -61,15 +63,16 @@ const (
TokenEOF = -1
- // All tokens go to the parser (unless Skip() is called in that rule)
+ // TokenDefaultChannel is the default channel upon which tokens are sent to the parser.
+ //
+ // All tokens go to the parser (unless [Skip] is called in the lexer rule)
// on a particular "channel". The parser tunes to a particular channel
// so that whitespace etc... can go to the parser on a "hidden" channel.
-
TokenDefaultChannel = 0
- // Anything on different channel than DEFAULT_CHANNEL is not parsed
- // by parser.
-
+ // TokenHiddenChannel defines the normal hidden channel - the parser wil not see tokens that are not on [TokenDefaultChannel].
+ //
+ // Anything on a different channel than TokenDefaultChannel is not parsed by parser.
TokenHiddenChannel = 1
)
@@ -118,21 +121,22 @@ func (b *BaseToken) GetInputStream() CharStream {
}
type CommonToken struct {
- *BaseToken
+ BaseToken
}
func NewCommonToken(source *TokenSourceCharStreamPair, tokenType, channel, start, stop int) *CommonToken {
- t := new(CommonToken)
-
- t.BaseToken = new(BaseToken)
+ t := &CommonToken{
+ BaseToken: BaseToken{
+ source: source,
+ tokenType: tokenType,
+ channel: channel,
+ start: start,
+ stop: stop,
+ tokenIndex: -1,
+ },
+ }
- t.source = source
- t.tokenType = tokenType
- t.channel = channel
- t.start = start
- t.stop = stop
- t.tokenIndex = -1
if t.source.tokenSource != nil {
t.line = source.tokenSource.GetLine()
t.column = source.tokenSource.GetCharPositionInLine()
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token_source.go b/vendor/github.com/antlr4-go/antlr/v4/token_source.go
similarity index 100%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token_source.go
rename to vendor/github.com/antlr4-go/antlr/v4/token_source.go
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token_stream.go b/vendor/github.com/antlr4-go/antlr/v4/token_stream.go
similarity index 90%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token_stream.go
rename to vendor/github.com/antlr4-go/antlr/v4/token_stream.go
index 1527d43f608..bf4ff6633e8 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/token_stream.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/token_stream.go
@@ -8,13 +8,14 @@ type TokenStream interface {
IntStream
LT(k int) Token
+ Reset()
Get(index int) Token
GetTokenSource() TokenSource
SetTokenSource(TokenSource)
GetAllText() string
- GetTextFromInterval(*Interval) string
+ GetTextFromInterval(Interval) string
GetTextFromRuleContext(RuleContext) string
GetTextFromTokens(Token, Token) string
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/tokenstream_rewriter.go b/vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go
similarity index 73%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/tokenstream_rewriter.go
rename to vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go
index b3e38af3445..ccf59b465c5 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/tokenstream_rewriter.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/tokenstream_rewriter.go
@@ -86,14 +86,15 @@ import (
// first example shows.
const (
- Default_Program_Name = "default"
- Program_Init_Size = 100
- Min_Token_Index = 0
+ DefaultProgramName = "default"
+ ProgramInitSize = 100
+ MinTokenIndex = 0
)
// Define the rewrite operation hierarchy
type RewriteOperation interface {
+
// Execute the rewrite operation by possibly adding to the buffer.
// Return the index of the next token to operate on.
Execute(buffer *bytes.Buffer) int
@@ -112,19 +113,19 @@ type RewriteOperation interface {
type BaseRewriteOperation struct {
//Current index of rewrites list
- instruction_index int
+ instructionIndex int
//Token buffer index
index int
//Substitution text
text string
//Actual operation name
- op_name string
+ opName string
//Pointer to token steam
tokens TokenStream
}
func (op *BaseRewriteOperation) GetInstructionIndex() int {
- return op.instruction_index
+ return op.instructionIndex
}
func (op *BaseRewriteOperation) GetIndex() int {
@@ -136,7 +137,7 @@ func (op *BaseRewriteOperation) GetText() string {
}
func (op *BaseRewriteOperation) GetOpName() string {
- return op.op_name
+ return op.opName
}
func (op *BaseRewriteOperation) GetTokens() TokenStream {
@@ -144,7 +145,7 @@ func (op *BaseRewriteOperation) GetTokens() TokenStream {
}
func (op *BaseRewriteOperation) SetInstructionIndex(val int) {
- op.instruction_index = val
+ op.instructionIndex = val
}
func (op *BaseRewriteOperation) SetIndex(val int) {
@@ -156,20 +157,20 @@ func (op *BaseRewriteOperation) SetText(val string) {
}
func (op *BaseRewriteOperation) SetOpName(val string) {
- op.op_name = val
+ op.opName = val
}
func (op *BaseRewriteOperation) SetTokens(val TokenStream) {
op.tokens = val
}
-func (op *BaseRewriteOperation) Execute(buffer *bytes.Buffer) int {
+func (op *BaseRewriteOperation) Execute(_ *bytes.Buffer) int {
return op.index
}
func (op *BaseRewriteOperation) String() string {
return fmt.Sprintf("<%s@%d:\"%s\">",
- op.op_name,
+ op.opName,
op.tokens.Get(op.GetIndex()),
op.text,
)
@@ -182,10 +183,10 @@ type InsertBeforeOp struct {
func NewInsertBeforeOp(index int, text string, stream TokenStream) *InsertBeforeOp {
return &InsertBeforeOp{BaseRewriteOperation: BaseRewriteOperation{
- index: index,
- text: text,
- op_name: "InsertBeforeOp",
- tokens: stream,
+ index: index,
+ text: text,
+ opName: "InsertBeforeOp",
+ tokens: stream,
}}
}
@@ -201,20 +202,21 @@ func (op *InsertBeforeOp) String() string {
return op.BaseRewriteOperation.String()
}
-// Distinguish between insert after/before to do the "insert afters"
-// first and then the "insert befores" at same index. Implementation
-// of "insert after" is "insert before index+1".
-
+// InsertAfterOp distinguishes between insert after/before to do the "insert after" instructions
+// first and then the "insert before" instructions at same index. Implementation
+// of "insert after" is "insert before index+1".
type InsertAfterOp struct {
BaseRewriteOperation
}
func NewInsertAfterOp(index int, text string, stream TokenStream) *InsertAfterOp {
- return &InsertAfterOp{BaseRewriteOperation: BaseRewriteOperation{
- index: index + 1,
- text: text,
- tokens: stream,
- }}
+ return &InsertAfterOp{
+ BaseRewriteOperation: BaseRewriteOperation{
+ index: index + 1,
+ text: text,
+ tokens: stream,
+ },
+ }
}
func (op *InsertAfterOp) Execute(buffer *bytes.Buffer) int {
@@ -229,7 +231,7 @@ func (op *InsertAfterOp) String() string {
return op.BaseRewriteOperation.String()
}
-// I'm going to try replacing range from x..y with (y-x)+1 ReplaceOp
+// ReplaceOp tries to replace range from x..y with (y-x)+1 ReplaceOp
// instructions.
type ReplaceOp struct {
BaseRewriteOperation
@@ -239,10 +241,10 @@ type ReplaceOp struct {
func NewReplaceOp(from, to int, text string, stream TokenStream) *ReplaceOp {
return &ReplaceOp{
BaseRewriteOperation: BaseRewriteOperation{
- index: from,
- text: text,
- op_name: "ReplaceOp",
- tokens: stream,
+ index: from,
+ text: text,
+ opName: "ReplaceOp",
+ tokens: stream,
},
LastIndex: to,
}
@@ -270,17 +272,17 @@ type TokenStreamRewriter struct {
// You may have multiple, named streams of rewrite operations.
// I'm calling these things "programs."
// Maps String (name) → rewrite (List)
- programs map[string][]RewriteOperation
- last_rewrite_token_indexes map[string]int
+ programs map[string][]RewriteOperation
+ lastRewriteTokenIndexes map[string]int
}
func NewTokenStreamRewriter(tokens TokenStream) *TokenStreamRewriter {
return &TokenStreamRewriter{
tokens: tokens,
programs: map[string][]RewriteOperation{
- Default_Program_Name: make([]RewriteOperation, 0, Program_Init_Size),
+ DefaultProgramName: make([]RewriteOperation, 0, ProgramInitSize),
},
- last_rewrite_token_indexes: map[string]int{},
+ lastRewriteTokenIndexes: map[string]int{},
}
}
@@ -291,110 +293,110 @@ func (tsr *TokenStreamRewriter) GetTokenStream() TokenStream {
// Rollback the instruction stream for a program so that
// the indicated instruction (via instructionIndex) is no
// longer in the stream. UNTESTED!
-func (tsr *TokenStreamRewriter) Rollback(program_name string, instruction_index int) {
- is, ok := tsr.programs[program_name]
+func (tsr *TokenStreamRewriter) Rollback(programName string, instructionIndex int) {
+ is, ok := tsr.programs[programName]
if ok {
- tsr.programs[program_name] = is[Min_Token_Index:instruction_index]
+ tsr.programs[programName] = is[MinTokenIndex:instructionIndex]
}
}
-func (tsr *TokenStreamRewriter) RollbackDefault(instruction_index int) {
- tsr.Rollback(Default_Program_Name, instruction_index)
+func (tsr *TokenStreamRewriter) RollbackDefault(instructionIndex int) {
+ tsr.Rollback(DefaultProgramName, instructionIndex)
}
-// Reset the program so that no instructions exist
-func (tsr *TokenStreamRewriter) DeleteProgram(program_name string) {
- tsr.Rollback(program_name, Min_Token_Index) //TODO: double test on that cause lower bound is not included
+// DeleteProgram Reset the program so that no instructions exist
+func (tsr *TokenStreamRewriter) DeleteProgram(programName string) {
+ tsr.Rollback(programName, MinTokenIndex) //TODO: double test on that cause lower bound is not included
}
func (tsr *TokenStreamRewriter) DeleteProgramDefault() {
- tsr.DeleteProgram(Default_Program_Name)
+ tsr.DeleteProgram(DefaultProgramName)
}
-func (tsr *TokenStreamRewriter) InsertAfter(program_name string, index int, text string) {
+func (tsr *TokenStreamRewriter) InsertAfter(programName string, index int, text string) {
// to insert after, just insert before next index (even if past end)
var op RewriteOperation = NewInsertAfterOp(index, text, tsr.tokens)
- rewrites := tsr.GetProgram(program_name)
+ rewrites := tsr.GetProgram(programName)
op.SetInstructionIndex(len(rewrites))
- tsr.AddToProgram(program_name, op)
+ tsr.AddToProgram(programName, op)
}
func (tsr *TokenStreamRewriter) InsertAfterDefault(index int, text string) {
- tsr.InsertAfter(Default_Program_Name, index, text)
+ tsr.InsertAfter(DefaultProgramName, index, text)
}
-func (tsr *TokenStreamRewriter) InsertAfterToken(program_name string, token Token, text string) {
- tsr.InsertAfter(program_name, token.GetTokenIndex(), text)
+func (tsr *TokenStreamRewriter) InsertAfterToken(programName string, token Token, text string) {
+ tsr.InsertAfter(programName, token.GetTokenIndex(), text)
}
-func (tsr *TokenStreamRewriter) InsertBefore(program_name string, index int, text string) {
+func (tsr *TokenStreamRewriter) InsertBefore(programName string, index int, text string) {
var op RewriteOperation = NewInsertBeforeOp(index, text, tsr.tokens)
- rewrites := tsr.GetProgram(program_name)
+ rewrites := tsr.GetProgram(programName)
op.SetInstructionIndex(len(rewrites))
- tsr.AddToProgram(program_name, op)
+ tsr.AddToProgram(programName, op)
}
func (tsr *TokenStreamRewriter) InsertBeforeDefault(index int, text string) {
- tsr.InsertBefore(Default_Program_Name, index, text)
+ tsr.InsertBefore(DefaultProgramName, index, text)
}
-func (tsr *TokenStreamRewriter) InsertBeforeToken(program_name string, token Token, text string) {
- tsr.InsertBefore(program_name, token.GetTokenIndex(), text)
+func (tsr *TokenStreamRewriter) InsertBeforeToken(programName string, token Token, text string) {
+ tsr.InsertBefore(programName, token.GetTokenIndex(), text)
}
-func (tsr *TokenStreamRewriter) Replace(program_name string, from, to int, text string) {
+func (tsr *TokenStreamRewriter) Replace(programName string, from, to int, text string) {
if from > to || from < 0 || to < 0 || to >= tsr.tokens.Size() {
panic(fmt.Sprintf("replace: range invalid: %d..%d(size=%d)",
from, to, tsr.tokens.Size()))
}
var op RewriteOperation = NewReplaceOp(from, to, text, tsr.tokens)
- rewrites := tsr.GetProgram(program_name)
+ rewrites := tsr.GetProgram(programName)
op.SetInstructionIndex(len(rewrites))
- tsr.AddToProgram(program_name, op)
+ tsr.AddToProgram(programName, op)
}
func (tsr *TokenStreamRewriter) ReplaceDefault(from, to int, text string) {
- tsr.Replace(Default_Program_Name, from, to, text)
+ tsr.Replace(DefaultProgramName, from, to, text)
}
func (tsr *TokenStreamRewriter) ReplaceDefaultPos(index int, text string) {
tsr.ReplaceDefault(index, index, text)
}
-func (tsr *TokenStreamRewriter) ReplaceToken(program_name string, from, to Token, text string) {
- tsr.Replace(program_name, from.GetTokenIndex(), to.GetTokenIndex(), text)
+func (tsr *TokenStreamRewriter) ReplaceToken(programName string, from, to Token, text string) {
+ tsr.Replace(programName, from.GetTokenIndex(), to.GetTokenIndex(), text)
}
func (tsr *TokenStreamRewriter) ReplaceTokenDefault(from, to Token, text string) {
- tsr.ReplaceToken(Default_Program_Name, from, to, text)
+ tsr.ReplaceToken(DefaultProgramName, from, to, text)
}
func (tsr *TokenStreamRewriter) ReplaceTokenDefaultPos(index Token, text string) {
tsr.ReplaceTokenDefault(index, index, text)
}
-func (tsr *TokenStreamRewriter) Delete(program_name string, from, to int) {
- tsr.Replace(program_name, from, to, "")
+func (tsr *TokenStreamRewriter) Delete(programName string, from, to int) {
+ tsr.Replace(programName, from, to, "")
}
func (tsr *TokenStreamRewriter) DeleteDefault(from, to int) {
- tsr.Delete(Default_Program_Name, from, to)
+ tsr.Delete(DefaultProgramName, from, to)
}
func (tsr *TokenStreamRewriter) DeleteDefaultPos(index int) {
tsr.DeleteDefault(index, index)
}
-func (tsr *TokenStreamRewriter) DeleteToken(program_name string, from, to Token) {
- tsr.ReplaceToken(program_name, from, to, "")
+func (tsr *TokenStreamRewriter) DeleteToken(programName string, from, to Token) {
+ tsr.ReplaceToken(programName, from, to, "")
}
func (tsr *TokenStreamRewriter) DeleteTokenDefault(from, to Token) {
- tsr.DeleteToken(Default_Program_Name, from, to)
+ tsr.DeleteToken(DefaultProgramName, from, to)
}
-func (tsr *TokenStreamRewriter) GetLastRewriteTokenIndex(program_name string) int {
- i, ok := tsr.last_rewrite_token_indexes[program_name]
+func (tsr *TokenStreamRewriter) GetLastRewriteTokenIndex(programName string) int {
+ i, ok := tsr.lastRewriteTokenIndexes[programName]
if !ok {
return -1
}
@@ -402,15 +404,15 @@ func (tsr *TokenStreamRewriter) GetLastRewriteTokenIndex(program_name string) in
}
func (tsr *TokenStreamRewriter) GetLastRewriteTokenIndexDefault() int {
- return tsr.GetLastRewriteTokenIndex(Default_Program_Name)
+ return tsr.GetLastRewriteTokenIndex(DefaultProgramName)
}
-func (tsr *TokenStreamRewriter) SetLastRewriteTokenIndex(program_name string, i int) {
- tsr.last_rewrite_token_indexes[program_name] = i
+func (tsr *TokenStreamRewriter) SetLastRewriteTokenIndex(programName string, i int) {
+ tsr.lastRewriteTokenIndexes[programName] = i
}
func (tsr *TokenStreamRewriter) InitializeProgram(name string) []RewriteOperation {
- is := make([]RewriteOperation, 0, Program_Init_Size)
+ is := make([]RewriteOperation, 0, ProgramInitSize)
tsr.programs[name] = is
return is
}
@@ -429,24 +431,24 @@ func (tsr *TokenStreamRewriter) GetProgram(name string) []RewriteOperation {
return is
}
-// Return the text from the original tokens altered per the
+// GetTextDefault returns the text from the original tokens altered per the
// instructions given to this rewriter.
func (tsr *TokenStreamRewriter) GetTextDefault() string {
return tsr.GetText(
- Default_Program_Name,
+ DefaultProgramName,
NewInterval(0, tsr.tokens.Size()-1))
}
-// Return the text from the original tokens altered per the
+// GetText returns the text from the original tokens altered per the
// instructions given to this rewriter.
-func (tsr *TokenStreamRewriter) GetText(program_name string, interval *Interval) string {
- rewrites := tsr.programs[program_name]
+func (tsr *TokenStreamRewriter) GetText(programName string, interval Interval) string {
+ rewrites := tsr.programs[programName]
start := interval.Start
stop := interval.Stop
// ensure start/end are in range
stop = min(stop, tsr.tokens.Size()-1)
start = max(start, 0)
- if rewrites == nil || len(rewrites) == 0 {
+ if len(rewrites) == 0 {
return tsr.tokens.GetTextFromInterval(interval) // no instructions to execute
}
buf := bytes.Buffer{}
@@ -482,11 +484,13 @@ func (tsr *TokenStreamRewriter) GetText(program_name string, interval *Interval)
return buf.String()
}
-// We need to combine operations and report invalid operations (like
-// overlapping replaces that are not completed nested). Inserts to
-// same index need to be combined etc... Here are the cases:
+// reduceToSingleOperationPerIndex combines operations and report invalid operations (like
+// overlapping replaces that are not completed nested). Inserts to
+// same index need to be combined etc...
+//
+// Here are the cases:
//
-// I.i.u I.j.v leave alone, nonoverlapping
+// I.i.u I.j.v leave alone, non-overlapping
// I.i.u I.i.v combine: Iivu
//
// R.i-j.u R.x-y.v | i-j in x-y delete first R
@@ -498,38 +502,38 @@ func (tsr *TokenStreamRewriter) GetText(program_name string, interval *Interval)
// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
//
// I.i.u R.x-y.v | i in (x+1)-y delete I (since insert before
-// we're not deleting i)
-// I.i.u R.x-y.v | i not in (x+1)-y leave alone, nonoverlapping
+// we're not deleting i)
+// I.i.u R.x-y.v | i not in (x+1)-y leave alone, non-overlapping
// R.x-y.v I.i.u | i in x-y ERROR
// R.x-y.v I.x.u R.x-y.uv (combine, delete I)
-// R.x-y.v I.i.u | i not in x-y leave alone, nonoverlapping
+// R.x-y.v I.i.u | i not in x-y leave alone, non-overlapping
//
// I.i.u = insert u before op @ index i
// R.x-y.u = replace x-y indexed tokens with u
//
-// First we need to examine replaces. For any replace op:
+// First we need to examine replaces. For any replace op:
//
-// 1. wipe out any insertions before op within that range.
-// 2. Drop any replace op before that is contained completely within
-// that range.
-// 3. Throw exception upon boundary overlap with any previous replace.
+// 1. wipe out any insertions before op within that range.
+// 2. Drop any replace op before that is contained completely within
+// that range.
+// 3. Throw exception upon boundary overlap with any previous replace.
//
-// Then we can deal with inserts:
+// Then we can deal with inserts:
//
-// 1. for any inserts to same index, combine even if not adjacent.
-// 2. for any prior replace with same left boundary, combine this
-// insert with replace and delete this replace.
-// 3. throw exception if index in same range as previous replace
+// 1. for any inserts to same index, combine even if not adjacent.
+// 2. for any prior replace with same left boundary, combine this
+// insert with replace and delete this 'replace'.
+// 3. throw exception if index in same range as previous replace
//
-// Don't actually delete; make op null in list. Easier to walk list.
-// Later we can throw as we add to index → op map.
+// Don't actually delete; make op null in list. Easier to walk list.
+// Later we can throw as we add to index → op map.
//
-// Note that I.2 R.2-2 will wipe out I.2 even though, technically, the
-// inserted stuff would be before the replace range. But, if you
-// add tokens in front of a method body '{' and then delete the method
-// body, I think the stuff before the '{' you added should disappear too.
+// Note that I.2 R.2-2 will wipe out I.2 even though, technically, the
+// inserted stuff would be before the 'replace' range. But, if you
+// add tokens in front of a method body '{' and then delete the method
+// body, I think the stuff before the '{' you added should disappear too.
//
-// Return a map from token index to operation.
+// The func returns a map from token index to operation.
func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]RewriteOperation {
// WALK REPLACES
for i := 0; i < len(rewrites); i++ {
@@ -547,7 +551,7 @@ func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]Rewrit
if iop.index == rop.index {
// E.g., insert before 2, delete 2..2; update replace
// text to include insert before, kill insert
- rewrites[iop.instruction_index] = nil
+ rewrites[iop.instructionIndex] = nil
if rop.text != "" {
rop.text = iop.text + rop.text
} else {
@@ -555,7 +559,7 @@ func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]Rewrit
}
} else if iop.index > rop.index && iop.index <= rop.LastIndex {
// delete insert as it's a no-op.
- rewrites[iop.instruction_index] = nil
+ rewrites[iop.instructionIndex] = nil
}
}
}
@@ -564,7 +568,7 @@ func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]Rewrit
if prevop, ok := rewrites[j].(*ReplaceOp); ok {
if prevop.index >= rop.index && prevop.LastIndex <= rop.LastIndex {
// delete replace as it's a no-op.
- rewrites[prevop.instruction_index] = nil
+ rewrites[prevop.instructionIndex] = nil
continue
}
// throw exception unless disjoint or identical
@@ -572,10 +576,9 @@ func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]Rewrit
// Delete special case of replace (text==null):
// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
if prevop.text == "" && rop.text == "" && !disjoint {
- rewrites[prevop.instruction_index] = nil
+ rewrites[prevop.instructionIndex] = nil
rop.index = min(prevop.index, rop.index)
rop.LastIndex = max(prevop.LastIndex, rop.LastIndex)
- println("new rop" + rop.String()) //TODO: remove console write, taken from Java version
} else if !disjoint {
panic("replace op boundaries of " + rop.String() + " overlap with previous " + prevop.String())
}
@@ -607,7 +610,7 @@ func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]Rewrit
if prevIop, ok := rewrites[j].(*InsertBeforeOp); ok {
if prevIop.index == iop.GetIndex() {
iop.SetText(iop.GetText() + prevIop.text)
- rewrites[prevIop.instruction_index] = nil
+ rewrites[prevIop.instructionIndex] = nil
}
}
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/trace_listener.go b/vendor/github.com/antlr4-go/antlr/v4/trace_listener.go
similarity index 100%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/trace_listener.go
rename to vendor/github.com/antlr4-go/antlr/v4/trace_listener.go
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/transition.go b/vendor/github.com/antlr4-go/antlr/v4/transition.go
similarity index 67%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/transition.go
rename to vendor/github.com/antlr4-go/antlr/v4/transition.go
index 36be4f73310..313b0fc127f 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/transition.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/transition.go
@@ -72,7 +72,7 @@ func (t *BaseTransition) getSerializationType() int {
return t.serializationType
}
-func (t *BaseTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *BaseTransition) Matches(_, _, _ int) bool {
panic("Not implemented")
}
@@ -89,6 +89,7 @@ const (
TransitionPRECEDENCE = 10
)
+//goland:noinspection GoUnusedGlobalVariable
var TransitionserializationNames = []string{
"INVALID",
"EPSILON",
@@ -127,19 +128,22 @@ var TransitionserializationNames = []string{
// TransitionPRECEDENCE
//}
+// AtomTransition
// TODO: make all transitions sets? no, should remove set edges
type AtomTransition struct {
- *BaseTransition
+ BaseTransition
}
func NewAtomTransition(target ATNState, intervalSet int) *AtomTransition {
-
- t := new(AtomTransition)
- t.BaseTransition = NewBaseTransition(target)
-
- t.label = intervalSet // The token type or character value or, signifies special intervalSet.
+ t := &AtomTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionATOM,
+ label: intervalSet,
+ isEpsilon: false,
+ },
+ }
t.intervalSet = t.makeLabel()
- t.serializationType = TransitionATOM
return t
}
@@ -150,7 +154,7 @@ func (t *AtomTransition) makeLabel() *IntervalSet {
return s
}
-func (t *AtomTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *AtomTransition) Matches(symbol, _, _ int) bool {
return t.label == symbol
}
@@ -159,48 +163,45 @@ func (t *AtomTransition) String() string {
}
type RuleTransition struct {
- *BaseTransition
-
+ BaseTransition
followState ATNState
ruleIndex, precedence int
}
func NewRuleTransition(ruleStart ATNState, ruleIndex, precedence int, followState ATNState) *RuleTransition {
-
- t := new(RuleTransition)
- t.BaseTransition = NewBaseTransition(ruleStart)
-
- t.ruleIndex = ruleIndex
- t.precedence = precedence
- t.followState = followState
- t.serializationType = TransitionRULE
- t.isEpsilon = true
-
- return t
+ return &RuleTransition{
+ BaseTransition: BaseTransition{
+ target: ruleStart,
+ isEpsilon: true,
+ serializationType: TransitionRULE,
+ },
+ ruleIndex: ruleIndex,
+ precedence: precedence,
+ followState: followState,
+ }
}
-func (t *RuleTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *RuleTransition) Matches(_, _, _ int) bool {
return false
}
type EpsilonTransition struct {
- *BaseTransition
-
+ BaseTransition
outermostPrecedenceReturn int
}
func NewEpsilonTransition(target ATNState, outermostPrecedenceReturn int) *EpsilonTransition {
-
- t := new(EpsilonTransition)
- t.BaseTransition = NewBaseTransition(target)
-
- t.serializationType = TransitionEPSILON
- t.isEpsilon = true
- t.outermostPrecedenceReturn = outermostPrecedenceReturn
- return t
+ return &EpsilonTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionEPSILON,
+ isEpsilon: true,
+ },
+ outermostPrecedenceReturn: outermostPrecedenceReturn,
+ }
}
-func (t *EpsilonTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *EpsilonTransition) Matches(_, _, _ int) bool {
return false
}
@@ -209,19 +210,20 @@ func (t *EpsilonTransition) String() string {
}
type RangeTransition struct {
- *BaseTransition
-
+ BaseTransition
start, stop int
}
func NewRangeTransition(target ATNState, start, stop int) *RangeTransition {
-
- t := new(RangeTransition)
- t.BaseTransition = NewBaseTransition(target)
-
- t.serializationType = TransitionRANGE
- t.start = start
- t.stop = stop
+ t := &RangeTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionRANGE,
+ isEpsilon: false,
+ },
+ start: start,
+ stop: stop,
+ }
t.intervalSet = t.makeLabel()
return t
}
@@ -232,7 +234,7 @@ func (t *RangeTransition) makeLabel() *IntervalSet {
return s
}
-func (t *RangeTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *RangeTransition) Matches(symbol, _, _ int) bool {
return symbol >= t.start && symbol <= t.stop
}
@@ -252,40 +254,41 @@ type AbstractPredicateTransition interface {
}
type BaseAbstractPredicateTransition struct {
- *BaseTransition
+ BaseTransition
}
func NewBasePredicateTransition(target ATNState) *BaseAbstractPredicateTransition {
-
- t := new(BaseAbstractPredicateTransition)
- t.BaseTransition = NewBaseTransition(target)
-
- return t
+ return &BaseAbstractPredicateTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ },
+ }
}
func (a *BaseAbstractPredicateTransition) IAbstractPredicateTransitionFoo() {}
type PredicateTransition struct {
- *BaseAbstractPredicateTransition
-
+ BaseAbstractPredicateTransition
isCtxDependent bool
ruleIndex, predIndex int
}
func NewPredicateTransition(target ATNState, ruleIndex, predIndex int, isCtxDependent bool) *PredicateTransition {
-
- t := new(PredicateTransition)
- t.BaseAbstractPredicateTransition = NewBasePredicateTransition(target)
-
- t.serializationType = TransitionPREDICATE
- t.ruleIndex = ruleIndex
- t.predIndex = predIndex
- t.isCtxDependent = isCtxDependent // e.g., $i ref in pred
- t.isEpsilon = true
- return t
+ return &PredicateTransition{
+ BaseAbstractPredicateTransition: BaseAbstractPredicateTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionPREDICATE,
+ isEpsilon: true,
+ },
+ },
+ isCtxDependent: isCtxDependent,
+ ruleIndex: ruleIndex,
+ predIndex: predIndex,
+ }
}
-func (t *PredicateTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *PredicateTransition) Matches(_, _, _ int) bool {
return false
}
@@ -298,26 +301,25 @@ func (t *PredicateTransition) String() string {
}
type ActionTransition struct {
- *BaseTransition
-
+ BaseTransition
isCtxDependent bool
ruleIndex, actionIndex, predIndex int
}
func NewActionTransition(target ATNState, ruleIndex, actionIndex int, isCtxDependent bool) *ActionTransition {
-
- t := new(ActionTransition)
- t.BaseTransition = NewBaseTransition(target)
-
- t.serializationType = TransitionACTION
- t.ruleIndex = ruleIndex
- t.actionIndex = actionIndex
- t.isCtxDependent = isCtxDependent // e.g., $i ref in pred
- t.isEpsilon = true
- return t
+ return &ActionTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionACTION,
+ isEpsilon: true,
+ },
+ isCtxDependent: isCtxDependent,
+ ruleIndex: ruleIndex,
+ actionIndex: actionIndex,
+ }
}
-func (t *ActionTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *ActionTransition) Matches(_, _, _ int) bool {
return false
}
@@ -326,26 +328,27 @@ func (t *ActionTransition) String() string {
}
type SetTransition struct {
- *BaseTransition
+ BaseTransition
}
func NewSetTransition(target ATNState, set *IntervalSet) *SetTransition {
+ t := &SetTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionSET,
+ },
+ }
- t := new(SetTransition)
- t.BaseTransition = NewBaseTransition(target)
-
- t.serializationType = TransitionSET
if set != nil {
t.intervalSet = set
} else {
t.intervalSet = NewIntervalSet()
t.intervalSet.addOne(TokenInvalidType)
}
-
return t
}
-func (t *SetTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *SetTransition) Matches(symbol, _, _ int) bool {
return t.intervalSet.contains(symbol)
}
@@ -354,16 +357,24 @@ func (t *SetTransition) String() string {
}
type NotSetTransition struct {
- *SetTransition
+ SetTransition
}
func NewNotSetTransition(target ATNState, set *IntervalSet) *NotSetTransition {
-
- t := new(NotSetTransition)
-
- t.SetTransition = NewSetTransition(target, set)
-
- t.serializationType = TransitionNOTSET
+ t := &NotSetTransition{
+ SetTransition: SetTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionNOTSET,
+ },
+ },
+ }
+ if set != nil {
+ t.intervalSet = set
+ } else {
+ t.intervalSet = NewIntervalSet()
+ t.intervalSet.addOne(TokenInvalidType)
+ }
return t
}
@@ -377,16 +388,16 @@ func (t *NotSetTransition) String() string {
}
type WildcardTransition struct {
- *BaseTransition
+ BaseTransition
}
func NewWildcardTransition(target ATNState) *WildcardTransition {
-
- t := new(WildcardTransition)
- t.BaseTransition = NewBaseTransition(target)
-
- t.serializationType = TransitionWILDCARD
- return t
+ return &WildcardTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionWILDCARD,
+ },
+ }
}
func (t *WildcardTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
@@ -398,24 +409,24 @@ func (t *WildcardTransition) String() string {
}
type PrecedencePredicateTransition struct {
- *BaseAbstractPredicateTransition
-
+ BaseAbstractPredicateTransition
precedence int
}
func NewPrecedencePredicateTransition(target ATNState, precedence int) *PrecedencePredicateTransition {
-
- t := new(PrecedencePredicateTransition)
- t.BaseAbstractPredicateTransition = NewBasePredicateTransition(target)
-
- t.serializationType = TransitionPRECEDENCE
- t.precedence = precedence
- t.isEpsilon = true
-
- return t
+ return &PrecedencePredicateTransition{
+ BaseAbstractPredicateTransition: BaseAbstractPredicateTransition{
+ BaseTransition: BaseTransition{
+ target: target,
+ serializationType: TransitionPRECEDENCE,
+ isEpsilon: true,
+ },
+ },
+ precedence: precedence,
+ }
}
-func (t *PrecedencePredicateTransition) Matches(symbol, minVocabSymbol, maxVocabSymbol int) bool {
+func (t *PrecedencePredicateTransition) Matches(_, _, _ int) bool {
return false
}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/tree.go b/vendor/github.com/antlr4-go/antlr/v4/tree.go
similarity index 62%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/tree.go
rename to vendor/github.com/antlr4-go/antlr/v4/tree.go
index 85b4f137b5a..c288420fb20 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/tree.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/tree.go
@@ -21,29 +21,23 @@ type Tree interface {
type SyntaxTree interface {
Tree
-
- GetSourceInterval() *Interval
+ GetSourceInterval() Interval
}
type ParseTree interface {
SyntaxTree
-
Accept(Visitor ParseTreeVisitor) interface{}
GetText() string
-
ToStringTree([]string, Recognizer) string
}
type RuleNode interface {
ParseTree
-
GetRuleContext() RuleContext
- GetBaseRuleContext() *BaseRuleContext
}
type TerminalNode interface {
ParseTree
-
GetSymbol() Token
}
@@ -64,12 +58,12 @@ type BaseParseTreeVisitor struct{}
var _ ParseTreeVisitor = &BaseParseTreeVisitor{}
-func (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{} { return tree.Accept(v) }
-func (v *BaseParseTreeVisitor) VisitChildren(node RuleNode) interface{} { return nil }
-func (v *BaseParseTreeVisitor) VisitTerminal(node TerminalNode) interface{} { return nil }
-func (v *BaseParseTreeVisitor) VisitErrorNode(node ErrorNode) interface{} { return nil }
+func (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{} { return tree.Accept(v) }
+func (v *BaseParseTreeVisitor) VisitChildren(_ RuleNode) interface{} { return nil }
+func (v *BaseParseTreeVisitor) VisitTerminal(_ TerminalNode) interface{} { return nil }
+func (v *BaseParseTreeVisitor) VisitErrorNode(_ ErrorNode) interface{} { return nil }
-// TODO
+// TODO: Implement this?
//func (this ParseTreeVisitor) Visit(ctx) {
// if (Utils.isArray(ctx)) {
// self := this
@@ -101,15 +95,14 @@ type BaseParseTreeListener struct{}
var _ ParseTreeListener = &BaseParseTreeListener{}
-func (l *BaseParseTreeListener) VisitTerminal(node TerminalNode) {}
-func (l *BaseParseTreeListener) VisitErrorNode(node ErrorNode) {}
-func (l *BaseParseTreeListener) EnterEveryRule(ctx ParserRuleContext) {}
-func (l *BaseParseTreeListener) ExitEveryRule(ctx ParserRuleContext) {}
+func (l *BaseParseTreeListener) VisitTerminal(_ TerminalNode) {}
+func (l *BaseParseTreeListener) VisitErrorNode(_ ErrorNode) {}
+func (l *BaseParseTreeListener) EnterEveryRule(_ ParserRuleContext) {}
+func (l *BaseParseTreeListener) ExitEveryRule(_ ParserRuleContext) {}
type TerminalNodeImpl struct {
parentCtx RuleContext
-
- symbol Token
+ symbol Token
}
var _ TerminalNode = &TerminalNodeImpl{}
@@ -123,7 +116,7 @@ func NewTerminalNodeImpl(symbol Token) *TerminalNodeImpl {
return tn
}
-func (t *TerminalNodeImpl) GetChild(i int) Tree {
+func (t *TerminalNodeImpl) GetChild(_ int) Tree {
return nil
}
@@ -131,7 +124,7 @@ func (t *TerminalNodeImpl) GetChildren() []Tree {
return nil
}
-func (t *TerminalNodeImpl) SetChildren(tree []Tree) {
+func (t *TerminalNodeImpl) SetChildren(_ []Tree) {
panic("Cannot set children on terminal node")
}
@@ -151,7 +144,7 @@ func (t *TerminalNodeImpl) GetPayload() interface{} {
return t.symbol
}
-func (t *TerminalNodeImpl) GetSourceInterval() *Interval {
+func (t *TerminalNodeImpl) GetSourceInterval() Interval {
if t.symbol == nil {
return TreeInvalidInterval
}
@@ -179,7 +172,7 @@ func (t *TerminalNodeImpl) String() string {
return t.symbol.GetText()
}
-func (t *TerminalNodeImpl) ToStringTree(s []string, r Recognizer) string {
+func (t *TerminalNodeImpl) ToStringTree(_ []string, _ Recognizer) string {
return t.String()
}
@@ -214,10 +207,9 @@ func NewParseTreeWalker() *ParseTreeWalker {
return new(ParseTreeWalker)
}
-// Performs a walk on the given parse tree starting at the root and going down recursively
-// with depth-first search. On each node, EnterRule is called before
-// recursively walking down into child nodes, then
-// ExitRule is called after the recursive call to wind up.
+// Walk performs a walk on the given parse tree starting at the root and going down recursively
+// with depth-first search. On each node, [EnterRule] is called before
+// recursively walking down into child nodes, then [ExitRule] is called after the recursive call to wind up.
func (p *ParseTreeWalker) Walk(listener ParseTreeListener, t Tree) {
switch tt := t.(type) {
case ErrorNode:
@@ -234,7 +226,7 @@ func (p *ParseTreeWalker) Walk(listener ParseTreeListener, t Tree) {
}
}
-// Enters a grammar rule by first triggering the generic event {@link ParseTreeListener//EnterEveryRule}
+// EnterRule enters a grammar rule by first triggering the generic event [ParseTreeListener].[EnterEveryRule]
// then by triggering the event specific to the given parse tree node
func (p *ParseTreeWalker) EnterRule(listener ParseTreeListener, r RuleNode) {
ctx := r.GetRuleContext().(ParserRuleContext)
@@ -242,12 +234,71 @@ func (p *ParseTreeWalker) EnterRule(listener ParseTreeListener, r RuleNode) {
ctx.EnterRule(listener)
}
-// Exits a grammar rule by first triggering the event specific to the given parse tree node
-// then by triggering the generic event {@link ParseTreeListener//ExitEveryRule}
+// ExitRule exits a grammar rule by first triggering the event specific to the given parse tree node
+// then by triggering the generic event [ParseTreeListener].ExitEveryRule
func (p *ParseTreeWalker) ExitRule(listener ParseTreeListener, r RuleNode) {
ctx := r.GetRuleContext().(ParserRuleContext)
ctx.ExitRule(listener)
listener.ExitEveryRule(ctx)
}
+//goland:noinspection GoUnusedGlobalVariable
var ParseTreeWalkerDefault = NewParseTreeWalker()
+
+type IterativeParseTreeWalker struct {
+ *ParseTreeWalker
+}
+
+//goland:noinspection GoUnusedExportedFunction
+func NewIterativeParseTreeWalker() *IterativeParseTreeWalker {
+ return new(IterativeParseTreeWalker)
+}
+
+func (i *IterativeParseTreeWalker) Walk(listener ParseTreeListener, t Tree) {
+ var stack []Tree
+ var indexStack []int
+ currentNode := t
+ currentIndex := 0
+
+ for currentNode != nil {
+ // pre-order visit
+ switch tt := currentNode.(type) {
+ case ErrorNode:
+ listener.VisitErrorNode(tt)
+ case TerminalNode:
+ listener.VisitTerminal(tt)
+ default:
+ i.EnterRule(listener, currentNode.(RuleNode))
+ }
+ // Move down to first child, if exists
+ if currentNode.GetChildCount() > 0 {
+ stack = append(stack, currentNode)
+ indexStack = append(indexStack, currentIndex)
+ currentIndex = 0
+ currentNode = currentNode.GetChild(0)
+ continue
+ }
+
+ for {
+ // post-order visit
+ if ruleNode, ok := currentNode.(RuleNode); ok {
+ i.ExitRule(listener, ruleNode)
+ }
+ // No parent, so no siblings
+ if len(stack) == 0 {
+ currentNode = nil
+ currentIndex = 0
+ break
+ }
+ // Move to next sibling if possible
+ currentIndex++
+ if stack[len(stack)-1].GetChildCount() > currentIndex {
+ currentNode = stack[len(stack)-1].GetChild(currentIndex)
+ break
+ }
+ // No next, sibling, so move up
+ currentNode, stack = stack[len(stack)-1], stack[:len(stack)-1]
+ currentIndex, indexStack = indexStack[len(indexStack)-1], indexStack[:len(indexStack)-1]
+ }
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/trees.go b/vendor/github.com/antlr4-go/antlr/v4/trees.go
similarity index 81%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/trees.go
rename to vendor/github.com/antlr4-go/antlr/v4/trees.go
index d7dbb032282..f44c05d8111 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/trees.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/trees.go
@@ -8,10 +8,8 @@ import "fmt"
/** A set of utility routines useful for all kinds of ANTLR trees. */
-// Print out a whole tree in LISP form. {@link //getNodeText} is used on the
-//
-// node payloads to get the text for the nodes. Detect
-// parse trees and extract data appropriately.
+// TreesStringTree prints out a whole tree in LISP form. [getNodeText] is used on the
+// node payloads to get the text for the nodes. Detects parse trees and extracts data appropriately.
func TreesStringTree(tree Tree, ruleNames []string, recog Recognizer) string {
if recog != nil {
@@ -32,7 +30,7 @@ func TreesStringTree(tree Tree, ruleNames []string, recog Recognizer) string {
}
for i := 1; i < c; i++ {
s = TreesStringTree(tree.GetChild(i), ruleNames, nil)
- res += (" " + s)
+ res += " " + s
}
res += ")"
return res
@@ -62,7 +60,7 @@ func TreesGetNodeText(t Tree, ruleNames []string, recog Parser) string {
}
}
- // no recog for rule names
+ // no recognition for rule names
payload := t.GetPayload()
if p2, ok := payload.(Token); ok {
return p2.GetText()
@@ -71,7 +69,9 @@ func TreesGetNodeText(t Tree, ruleNames []string, recog Parser) string {
return fmt.Sprint(t.GetPayload())
}
-// Return ordered list of all children of this node
+// TreesGetChildren returns am ordered list of all children of this node
+//
+//goland:noinspection GoUnusedExportedFunction
func TreesGetChildren(t Tree) []Tree {
list := make([]Tree, 0)
for i := 0; i < t.GetChildCount(); i++ {
@@ -80,9 +80,10 @@ func TreesGetChildren(t Tree) []Tree {
return list
}
-// Return a list of all ancestors of this node. The first node of
+// TreesgetAncestors returns a list of all ancestors of this node. The first node of list is the root
+// and the last node is the parent of this node.
//
-// list is the root and the last is the parent of this node.
+//goland:noinspection GoUnusedExportedFunction
func TreesgetAncestors(t Tree) []Tree {
ancestors := make([]Tree, 0)
t = t.GetParent()
@@ -94,10 +95,12 @@ func TreesgetAncestors(t Tree) []Tree {
return ancestors
}
+//goland:noinspection GoUnusedExportedFunction
func TreesFindAllTokenNodes(t ParseTree, ttype int) []ParseTree {
return TreesfindAllNodes(t, ttype, true)
}
+//goland:noinspection GoUnusedExportedFunction
func TreesfindAllRuleNodes(t ParseTree, ruleIndex int) []ParseTree {
return TreesfindAllNodes(t, ruleIndex, false)
}
@@ -129,6 +132,7 @@ func treesFindAllNodes(t ParseTree, index int, findTokens bool, nodes *[]ParseTr
}
}
+//goland:noinspection GoUnusedExportedFunction
func TreesDescendants(t ParseTree) []ParseTree {
nodes := []ParseTree{t}
for i := 0; i < t.GetChildCount(); i++ {
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/utils.go b/vendor/github.com/antlr4-go/antlr/v4/utils.go
similarity index 85%
rename from vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/utils.go
rename to vendor/github.com/antlr4-go/antlr/v4/utils.go
index 9fad5d916bc..733d7df9dc7 100644
--- a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/utils.go
+++ b/vendor/github.com/antlr4-go/antlr/v4/utils.go
@@ -9,8 +9,10 @@ import (
"errors"
"fmt"
"math/bits"
+ "os"
"strconv"
"strings"
+ "syscall"
)
func intMin(a, b int) int {
@@ -31,7 +33,7 @@ func intMax(a, b int) int {
type IntStack []int
-var ErrEmptyStack = errors.New("Stack is empty")
+var ErrEmptyStack = errors.New("stack is empty")
func (s *IntStack) Pop() (int, error) {
l := len(*s) - 1
@@ -47,33 +49,13 @@ func (s *IntStack) Push(e int) {
*s = append(*s, e)
}
-type comparable interface {
- Equals(other Collectable[any]) bool
-}
-
-func standardEqualsFunction(a Collectable[any], b Collectable[any]) bool {
-
- return a.Equals(b)
-}
-
-func standardHashFunction(a interface{}) int {
- if h, ok := a.(hasher); ok {
- return h.Hash()
- }
-
- panic("Not Hasher")
-}
-
-type hasher interface {
- Hash() int
-}
-
const bitsPerWord = 64
func indexForBit(bit int) int {
return bit / bitsPerWord
}
+//goland:noinspection GoUnusedExportedFunction,GoUnusedFunction
func wordForBit(data []uint64, bit int) uint64 {
idx := indexForBit(bit)
if idx >= len(data) {
@@ -94,6 +76,8 @@ type BitSet struct {
data []uint64
}
+// NewBitSet creates a new bitwise set
+// TODO: See if we can replace with the standard library's BitSet
func NewBitSet() *BitSet {
return &BitSet{}
}
@@ -123,7 +107,7 @@ func (b *BitSet) or(set *BitSet) {
setLen := set.minLen()
maxLen := intMax(bLen, setLen)
if maxLen > len(b.data) {
- // Increase the size of len(b.data) to repesent the bits in both sets.
+ // Increase the size of len(b.data) to represent the bits in both sets.
data := make([]uint64, maxLen)
copy(data, b.data)
b.data = data
@@ -246,37 +230,6 @@ func (a *AltDict) values() []interface{} {
return vs
}
-type DoubleDict struct {
- data map[int]map[int]interface{}
-}
-
-func NewDoubleDict() *DoubleDict {
- dd := new(DoubleDict)
- dd.data = make(map[int]map[int]interface{})
- return dd
-}
-
-func (d *DoubleDict) Get(a, b int) interface{} {
- data := d.data[a]
-
- if data == nil {
- return nil
- }
-
- return data[b]
-}
-
-func (d *DoubleDict) set(a, b int, o interface{}) {
- data := d.data[a]
-
- if data == nil {
- data = make(map[int]interface{})
- d.data[a] = data
- }
-
- data[b] = o
-}
-
func EscapeWhitespace(s string, escapeSpaces bool) string {
s = strings.Replace(s, "\t", "\\t", -1)
@@ -288,6 +241,7 @@ func EscapeWhitespace(s string, escapeSpaces bool) string {
return s
}
+//goland:noinspection GoUnusedExportedFunction
func TerminalNodeToStringArray(sa []TerminalNode) []string {
st := make([]string, len(sa))
@@ -298,6 +252,7 @@ func TerminalNodeToStringArray(sa []TerminalNode) []string {
return st
}
+//goland:noinspection GoUnusedExportedFunction
func PrintArrayJavaStyle(sa []string) string {
var buffer bytes.Buffer
@@ -350,3 +305,24 @@ func murmurFinish(h int, numberOfWords int) int {
return int(hash)
}
+
+func isDirectory(dir string) (bool, error) {
+ fileInfo, err := os.Stat(dir)
+ if err != nil {
+ switch {
+ case errors.Is(err, syscall.ENOENT):
+ // The given directory does not exist, so we will try to create it
+ //
+ err = os.MkdirAll(dir, 0755)
+ if err != nil {
+ return false, err
+ }
+
+ return true, nil
+ case err != nil:
+ return false, err
+ default:
+ }
+ }
+ return fileInfo.IsDir(), err
+}
diff --git a/vendor/github.com/fvbommel/sortorder/.gitignore b/vendor/github.com/fvbommel/sortorder/.gitignore
deleted file mode 100644
index c021733e255..00000000000
--- a/vendor/github.com/fvbommel/sortorder/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-# Folders
-_obj
-_test
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-_testmain.go
-*.exe
-*.test
-*.prof
diff --git a/vendor/github.com/fvbommel/sortorder/README.md b/vendor/github.com/fvbommel/sortorder/README.md
deleted file mode 100644
index 06779c88520..00000000000
--- a/vendor/github.com/fvbommel/sortorder/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# sortorder [![PkgGoDev](https://pkg.go.dev/badge/github.com/fvbommel/sortorder)](https://pkg.go.dev/github.com/fvbommel/sortorder)
-
- import "github.com/fvbommel/sortorder"
-
-Sort orders and comparison functions.
-
-Case-insensitive sort orders are in the `casefolded` sub-package
-because it pulls in the Unicode tables in the standard library,
-which can add significantly to the size of binaries.
diff --git a/vendor/github.com/fvbommel/sortorder/doc.go b/vendor/github.com/fvbommel/sortorder/doc.go
deleted file mode 100644
index a7dd9585d0c..00000000000
--- a/vendor/github.com/fvbommel/sortorder/doc.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// Package sortorder implements sort orders and comparison functions.
-//
-// Currently, it only implements so-called "natural order", where integers
-// embedded in strings are compared by value.
-package sortorder // import "github.com/fvbommel/sortorder"
diff --git a/vendor/github.com/fvbommel/sortorder/natsort.go b/vendor/github.com/fvbommel/sortorder/natsort.go
deleted file mode 100644
index e4f15110b8e..00000000000
--- a/vendor/github.com/fvbommel/sortorder/natsort.go
+++ /dev/null
@@ -1,76 +0,0 @@
-package sortorder
-
-// Natural implements sort.Interface to sort strings in natural order. This
-// means that e.g. "abc2" < "abc12".
-//
-// Non-digit sequences and numbers are compared separately. The former are
-// compared bytewise, while digits are compared numerically (except that
-// the number of leading zeros is used as a tie-breaker, so e.g. "2" < "02")
-//
-// Limitation: only ASCII digits (0-9) are considered.
-type Natural []string
-
-func (n Natural) Len() int { return len(n) }
-func (n Natural) Swap(i, j int) { n[i], n[j] = n[j], n[i] }
-func (n Natural) Less(i, j int) bool { return NaturalLess(n[i], n[j]) }
-
-func isDigit(b byte) bool { return '0' <= b && b <= '9' }
-
-// NaturalLess compares two strings using natural ordering. This means that e.g.
-// "abc2" < "abc12".
-//
-// Non-digit sequences and numbers are compared separately. The former are
-// compared bytewise, while digits are compared numerically (except that
-// the number of leading zeros is used as a tie-breaker, so e.g. "2" < "02")
-//
-// Limitation: only ASCII digits (0-9) are considered.
-func NaturalLess(str1, str2 string) bool {
- idx1, idx2 := 0, 0
- for idx1 < len(str1) && idx2 < len(str2) {
- c1, c2 := str1[idx1], str2[idx2]
- dig1, dig2 := isDigit(c1), isDigit(c2)
- switch {
- case dig1 != dig2: // Digits before other characters.
- return dig1 // True if LHS is a digit, false if the RHS is one.
- case !dig1: // && !dig2, because dig1 == dig2
- // UTF-8 compares bytewise-lexicographically, no need to decode
- // codepoints.
- if c1 != c2 {
- return c1 < c2
- }
- idx1++
- idx2++
- default: // Digits
- // Eat zeros.
- for ; idx1 < len(str1) && str1[idx1] == '0'; idx1++ {
- }
- for ; idx2 < len(str2) && str2[idx2] == '0'; idx2++ {
- }
- // Eat all digits.
- nonZero1, nonZero2 := idx1, idx2
- for ; idx1 < len(str1) && isDigit(str1[idx1]); idx1++ {
- }
- for ; idx2 < len(str2) && isDigit(str2[idx2]); idx2++ {
- }
- // If lengths of numbers with non-zero prefix differ, the shorter
- // one is less.
- if len1, len2 := idx1-nonZero1, idx2-nonZero2; len1 != len2 {
- return len1 < len2
- }
- // If they're equally long, string comparison is correct.
- if nr1, nr2 := str1[nonZero1:idx1], str2[nonZero2:idx2]; nr1 != nr2 {
- return nr1 < nr2
- }
- // Otherwise, the one with less zeros is less.
- // Because everything up to the number is equal, comparing the index
- // after the zeros is sufficient.
- if nonZero1 != nonZero2 {
- return nonZero1 < nonZero2
- }
- }
- // They're identical so far, so continue comparing.
- }
- // So far they are identical. At least one is ended. If the other continues,
- // it sorts last.
- return len(str1) < len(str2)
-}
diff --git a/vendor/github.com/fxamacker/cbor/v2/.gitignore b/vendor/github.com/fxamacker/cbor/v2/.gitignore
new file mode 100644
index 00000000000..f1c181ec9c5
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/.gitignore
@@ -0,0 +1,12 @@
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+
+# Test binary, build with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
diff --git a/vendor/github.com/fxamacker/cbor/v2/.golangci.yml b/vendor/github.com/fxamacker/cbor/v2/.golangci.yml
new file mode 100644
index 00000000000..38cb9ae101b
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/.golangci.yml
@@ -0,0 +1,104 @@
+# Do not delete linter settings. Linters like gocritic can be enabled on the command line.
+
+linters-settings:
+ depguard:
+ rules:
+ prevent_unmaintained_packages:
+ list-mode: strict
+ files:
+ - $all
+ - "!$test"
+ allow:
+ - $gostd
+ - github.com/x448/float16
+ deny:
+ - pkg: io/ioutil
+ desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
+ dupl:
+ threshold: 100
+ funlen:
+ lines: 100
+ statements: 50
+ goconst:
+ ignore-tests: true
+ min-len: 2
+ min-occurrences: 3
+ gocritic:
+ enabled-tags:
+ - diagnostic
+ - experimental
+ - opinionated
+ - performance
+ - style
+ disabled-checks:
+ - commentedOutCode
+ - dupImport # https://github.com/go-critic/go-critic/issues/845
+ - ifElseChain
+ - octalLiteral
+ - paramTypeCombine
+ - whyNoLint
+ gofmt:
+ simplify: false
+ goimports:
+ local-prefixes: github.com/fxamacker/cbor
+ golint:
+ min-confidence: 0
+ govet:
+ check-shadowing: true
+ lll:
+ line-length: 140
+ maligned:
+ suggest-new: true
+ misspell:
+ locale: US
+ staticcheck:
+ checks: ["all"]
+
+linters:
+ disable-all: true
+ enable:
+ - asciicheck
+ - bidichk
+ - depguard
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocritic
+ - gocyclo
+ - gofmt
+ - goimports
+ - goprintffuncname
+ - gosec
+ - gosimple
+ - govet
+ - ineffassign
+ - misspell
+ - nilerr
+ - revive
+ - staticcheck
+ - stylecheck
+ - typecheck
+ - unconvert
+ - unused
+
+issues:
+ # max-issues-per-linter default is 50. Set to 0 to disable limit.
+ max-issues-per-linter: 0
+ # max-same-issues default is 3. Set to 0 to disable limit.
+ max-same-issues: 0
+
+ exclude-rules:
+ - path: decode.go
+ text: "string ` overflows ` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string ` \\(range is \\[` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string `, ` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string ` overflows Go's int64` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string `\\]\\)` has (\\d+) occurrences, make it a constant"
+ - path: valid.go
+ text: "string ` for type ` has (\\d+) occurrences, make it a constant"
+ - path: valid.go
+ text: "string `cbor: ` has (\\d+) occurrences, make it a constant"
diff --git a/vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md b/vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000000..c794b2b0c66
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md
@@ -0,0 +1,133 @@
+
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, caste, color, religion, or sexual
+identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the overall
+ community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or advances of
+ any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email address,
+ without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+faye.github@gmail.com.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series of
+actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or permanent
+ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within the
+community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.1, available at
+[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
+[https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
diff --git a/vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md b/vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md
new file mode 100644
index 00000000000..de0965e12d1
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md
@@ -0,0 +1,41 @@
+# How to contribute
+
+You can contribute by using the library, opening issues, or opening pull requests.
+
+## Bug reports and security vulnerabilities
+
+Most issues are tracked publicly on [GitHub](https://github.com/fxamacker/cbor/issues).
+
+To report security vulnerabilities, please email faye.github@gmail.com and allow time for the problem to be resolved before disclosing it to the public. For more info, see [Security Policy](https://github.com/fxamacker/cbor#security-policy).
+
+Please do not send data that might contain personally identifiable information, even if you think you have permission. That type of support requires payment and a signed contract where I'm indemnified, held harmless, and defended by you for any data you send to me.
+
+## Pull requests
+
+Please [create an issue](https://github.com/fxamacker/cbor/issues/new/choose) before you begin work on a PR. The improvement may have already been considered, etc.
+
+Pull requests have signing requirements and must not be anonymous. Exceptions are usually made for docs and CI scripts.
+
+See the [Pull Request Template](https://github.com/fxamacker/cbor/blob/master/.github/pull_request_template.md) for details.
+
+Pull requests have a greater chance of being approved if:
+- it does not reduce speed, increase memory use, reduce security, etc. for people not using the new option or feature.
+- it has > 97% code coverage.
+
+## Describe your issue
+
+Clearly describe the issue:
+* If it's a bug, please provide: **version of this library** and **Go** (`go version`), **unmodified error message**, and describe **how to reproduce it**. Also state **what you expected to happen** instead of the error.
+* If you propose a change or addition, try to give an example how the improved code could look like or how to use it.
+* If you found a compilation error, please confirm you're using a supported version of Go. If you are, then provide the output of `go version` first, followed by the complete error message.
+
+## Please don't
+
+Please don't send data containing personally identifiable information, even if you think you have permission. That type of support requires payment and a contract where I'm indemnified, held harmless, and defended for any data you send to me.
+
+Please don't send CBOR data larger than 1024 bytes by email. If you want to send crash-producing CBOR data > 1024 bytes by email, please get my permission before sending it to me.
+
+## Credits
+
+- This guide used nlohmann/json contribution guidelines for inspiration as suggested in issue #22.
+- Special thanks to @lukseven for pointing out the contribution guidelines didn't mention signing requirements.
diff --git a/vendor/github.com/fvbommel/sortorder/LICENSE b/vendor/github.com/fxamacker/cbor/v2/LICENSE
similarity index 93%
rename from vendor/github.com/fvbommel/sortorder/LICENSE
rename to vendor/github.com/fxamacker/cbor/v2/LICENSE
index 5c695fb590f..eaa85049214 100644
--- a/vendor/github.com/fvbommel/sortorder/LICENSE
+++ b/vendor/github.com/fxamacker/cbor/v2/LICENSE
@@ -1,17 +1,21 @@
-The MIT License (MIT)
-Copyright (c) 2015 Frits van Bommel
+MIT License
+
+Copyright (c) 2019-present Faye Amacker
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
+
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/fxamacker/cbor/v2/README.md b/vendor/github.com/fxamacker/cbor/v2/README.md
new file mode 100644
index 00000000000..af0a79507e5
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/README.md
@@ -0,0 +1,691 @@
+# CBOR Codec in Go
+
+
+
+[fxamacker/cbor](https://github.com/fxamacker/cbor) is a library for encoding and decoding [CBOR](https://www.rfc-editor.org/info/std94) and [CBOR Sequences](https://www.rfc-editor.org/rfc/rfc8742.html).
+
+CBOR is a [trusted alternative](https://www.rfc-editor.org/rfc/rfc8949.html#name-comparison-of-other-binary-) to JSON, MessagePack, Protocol Buffers, etc. CBOR is an Internet Standard defined by [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94) and is designed to be relevant for decades.
+
+`fxamacker/cbor` is used in projects by Arm Ltd., Cisco, EdgeX Foundry, Flow Foundation, Fraunhofer‑AISEC, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Microsoft, Mozilla, Oasis Protocol, Tailscale, Teleport, [etc](https://github.com/fxamacker/cbor#who-uses-fxamackercbor).
+
+See [Quick Start](#quick-start) and [Releases](https://github.com/fxamacker/cbor/releases/). 🆕 `UnmarshalFirst` and `DiagnoseFirst` can decode CBOR Sequences. `cbor.MarshalToBuffer()` and `UserBufferEncMode` accepts user-specified buffer.
+
+## fxamacker/cbor
+
+[![](https://github.com/fxamacker/cbor/workflows/ci/badge.svg)](https://github.com/fxamacker/cbor/actions?query=workflow%3Aci)
+[![](https://github.com/fxamacker/cbor/workflows/cover%20%E2%89%A596%25/badge.svg)](https://github.com/fxamacker/cbor/actions?query=workflow%3A%22cover+%E2%89%A596%25%22)
+[![CodeQL](https://github.com/fxamacker/cbor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/fxamacker/cbor/actions/workflows/codeql-analysis.yml)
+[![](https://img.shields.io/badge/fuzzing-passing-44c010)](#fuzzing-and-code-coverage)
+[![Go Report Card](https://goreportcard.com/badge/github.com/fxamacker/cbor)](https://goreportcard.com/report/github.com/fxamacker/cbor)
+
+`fxamacker/cbor` is a CBOR codec in full conformance with [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94). It also supports CBOR Sequences ([RFC 8742](https://www.rfc-editor.org/rfc/rfc8742.html)) and Extended Diagnostic Notation ([Appendix G of RFC 8610](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G)).
+
+Features include full support for CBOR tags, [Core Deterministic Encoding](https://www.rfc-editor.org/rfc/rfc8949.html#name-core-deterministic-encoding), duplicate map key detection, etc.
+
+Design balances trade-offs between security, speed, concurrency, encoded data size, usability, etc.
+
+Highlights
+
+__🚀 Speed__
+
+Encoding and decoding is fast without using Go's `unsafe` package. Slower settings are opt-in. Default limits allow very fast and memory efficient rejection of malformed CBOR data.
+
+__🔒 Security__
+
+Decoder has configurable limits that defend against malicious inputs. Duplicate map key detection is supported. By contrast, `encoding/gob` is [not designed to be hardened against adversarial inputs](https://pkg.go.dev/encoding/gob#hdr-Security).
+
+Codec passed multiple confidential security assessments in 2022. No vulnerabilities found in subset of codec in a [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) prepared by NCC Group for Microsoft Corporation.
+
+__🗜️ Data Size__
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) automatically reduce size of encoded structs. Encoding optionally shrinks float64→32→16 when values fit.
+
+__:jigsaw: Usability__
+
+API is mostly same as `encoding/json` plus interfaces that simplify concurrency for CBOR options. Encoding and decoding modes can be created at startup and reused by any goroutines.
+
+Presets include Core Deterministic Encoding, Preferred Serialization, CTAP2 Canonical CBOR, etc.
+
+__📆 Extensibility__
+
+Features include CBOR [extension points](https://www.rfc-editor.org/rfc/rfc8949.html#section-7.1) (e.g. CBOR tags) and extensive settings. API has interfaces that allow users to create custom encoding and decoding without modifying this library.
+
+
+
+
+
+### Secure Decoding with Configurable Settings
+
+`fxamacker/cbor` has configurable limits, etc. that defend against malicious CBOR data.
+
+By contrast, `encoding/gob` is [not designed to be hardened against adversarial inputs](https://pkg.go.dev/encoding/gob#hdr-Security).
+
+Example decoding with encoding/gob 💥 fatal error (out of memory)
+
+```Go
+// Example of encoding/gob having "fatal error: runtime: out of memory"
+// while decoding 181 bytes.
+package main
+import (
+ "bytes"
+ "encoding/gob"
+ "encoding/hex"
+ "fmt"
+)
+
+// Example data is from https://github.com/golang/go/issues/24446
+// (shortened to 181 bytes).
+const data = "4dffb503010102303001ff30000109010130010800010130010800010130" +
+ "01ffb80001014a01ffb60001014b01ff860001013001ff860001013001ff" +
+ "860001013001ff860001013001ffb80000001eff850401010e3030303030" +
+ "30303030303030303001ff3000010c0104000016ffb70201010830303030" +
+ "3030303001ff3000010c000030ffb6040405fcff00303030303030303030" +
+ "303030303030303030303030303030303030303030303030303030303030" +
+ "30"
+
+type X struct {
+ J *X
+ K map[string]int
+}
+
+func main() {
+ raw, _ := hex.DecodeString(data)
+ decoder := gob.NewDecoder(bytes.NewReader(raw))
+
+ var x X
+ decoder.Decode(&x) // fatal error: runtime: out of memory
+ fmt.Println("Decoding finished.")
+}
+```
+
+
+
+
+
+`fxamacker/cbor` is fast at rejecting malformed CBOR data. E.g. attempts to
+decode 10 bytes of malicious CBOR data to `[]byte` (with default settings):
+
+| Codec | Speed (ns/op) | Memory | Allocs |
+| :---- | ------------: | -----: | -----: |
+| fxamacker/cbor 2.5.0 | 44 ± 5% | 32 B/op | 2 allocs/op |
+| ugorji/go 1.2.11 | 5353261 ± 4% | 67111321 B/op | 13 allocs/op |
+
+Benchmark details
+
+Latest comparison used:
+- Input: `[]byte{0x9B, 0x00, 0x00, 0x42, 0xFA, 0x42, 0xFA, 0x42, 0xFA, 0x42}`
+- go1.19.10, linux/amd64, i5-13600K (disabled all e-cores, DDR4 @2933)
+- go test -bench=. -benchmem -count=20
+
+#### Prior comparisons
+
+| Codec | Speed (ns/op) | Memory | Allocs |
+| :---- | ------------: | -----: | -----: |
+| fxamacker/cbor 2.5.0-beta2 | 44.33 ± 2% | 32 B/op | 2 allocs/op |
+| fxamacker/cbor 0.1.0 - 2.4.0 | ~44.68 ± 6% | 32 B/op | 2 allocs/op |
+| ugorji/go 1.2.10 | 5524792.50 ± 3% | 67110491 B/op | 12 allocs/op |
+| ugorji/go 1.1.0 - 1.2.6 | 💥 runtime: | out of memory: | cannot allocate |
+
+- Input: `[]byte{0x9B, 0x00, 0x00, 0x42, 0xFA, 0x42, 0xFA, 0x42, 0xFA, 0x42}`
+- go1.19.6, linux/amd64, i5-13600K (DDR4)
+- go test -bench=. -benchmem -count=20
+
+
+
+
+
+### Smaller Encodings with Struct Tags
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) reduce encoded size of structs.
+
+Example encoding 3-level nested Go struct to 1 byte CBOR
+
+https://go.dev/play/p/YxwvfPdFQG2
+
+```Go
+// Example encoding nested struct (with omitempty tag)
+// - encoding/json: 18 byte JSON
+// - fxamacker/cbor: 1 byte CBOR
+package main
+
+import (
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+type GrandChild struct {
+ Quux int `json:",omitempty"`
+}
+
+type Child struct {
+ Baz int `json:",omitempty"`
+ Qux GrandChild `json:",omitempty"`
+}
+
+type Parent struct {
+ Foo Child `json:",omitempty"`
+ Bar int `json:",omitempty"`
+}
+
+func cb() {
+ results, _ := cbor.Marshal(Parent{})
+ fmt.Println("hex(CBOR): " + hex.EncodeToString(results))
+
+ text, _ := cbor.Diagnose(results) // Diagnostic Notation
+ fmt.Println("DN: " + text)
+}
+
+func js() {
+ results, _ := json.Marshal(Parent{})
+ fmt.Println("hex(JSON): " + hex.EncodeToString(results))
+
+ text := string(results) // JSON
+ fmt.Println("JSON: " + text)
+}
+
+func main() {
+ cb()
+ fmt.Println("-------------")
+ js()
+}
+```
+
+Output (DN is Diagnostic Notation):
+```
+hex(CBOR): a0
+DN: {}
+-------------
+hex(JSON): 7b22466f6f223a7b22517578223a7b7d7d7d
+JSON: {"Foo":{"Qux":{}}}
+```
+
+
+
+
+
+Example using different struct tags together:
+
+![alt text](https://github.com/fxamacker/images/raw/master/cbor/v2.3.0/cbor_struct_tags_api.svg?sanitize=1 "CBOR API and Go Struct Tags")
+
+API is mostly same as `encoding/json`, plus interfaces that simplify concurrency for CBOR options.
+
+## Quick Start
+
+__Install__: `go get github.com/fxamacker/cbor/v2` and `import "github.com/fxamacker/cbor/v2"`.
+
+### Key Points
+
+This library can encode and decode CBOR (RFC 8949) and CBOR Sequences (RFC 8742).
+
+- __CBOR data item__ is a single piece of CBOR data and its structure may contain 0 or more nested data items.
+- __CBOR sequence__ is a concatenation of 0 or more encoded CBOR data items.
+
+Configurable limits and options can be used to balance trade-offs.
+
+- Encoding and decoding modes are created from options (settings).
+- Modes can be created at startup and reused.
+- Modes are safe for concurrent use.
+
+### Default Mode
+
+Package level functions only use this library's default settings.
+They provide the "default mode" of encoding and decoding.
+
+```go
+// API matches encoding/json for Marshal, Unmarshal, Encode, Decode, etc.
+b, err = cbor.Marshal(v) // encode v to []byte b
+err = cbor.Unmarshal(b, &v) // decode []byte b to v
+decoder = cbor.NewDecoder(r) // create decoder with io.Reader r
+err = decoder.Decode(&v) // decode a CBOR data item to v
+
+// v2.7.0 added MarshalToBuffer() and UserBufferEncMode interface.
+err = cbor.MarshalToBuffer(v, b) // encode v to b instead of using built-in buf pool.
+
+// v2.5.0 added new functions that return remaining bytes.
+
+// UnmarshalFirst decodes first CBOR data item and returns remaining bytes.
+rest, err = cbor.UnmarshalFirst(b, &v) // decode []byte b to v
+
+// DiagnoseFirst translates first CBOR data item to text and returns remaining bytes.
+text, rest, err = cbor.DiagnoseFirst(b) // decode []byte b to Diagnostic Notation text
+
+// NOTE: Unmarshal returns ExtraneousDataError if there are remaining bytes,
+// but new funcs UnmarshalFirst and DiagnoseFirst do not.
+```
+
+__IMPORTANT__: 👉 CBOR settings allow trade-offs between speed, security, encoding size, etc.
+
+- Different CBOR libraries may use different default settings.
+- CBOR-based formats or protocols usually require specific settings.
+
+For example, WebAuthn uses "CTAP2 Canonical CBOR" which is available as a preset.
+
+### Presets
+
+Presets can be used as-is or as a starting point for custom settings.
+
+```go
+// EncOptions is a struct of encoder settings.
+func CoreDetEncOptions() EncOptions // RFC 8949 Core Deterministic Encoding
+func PreferredUnsortedEncOptions() EncOptions // RFC 8949 Preferred Serialization
+func CanonicalEncOptions() EncOptions // RFC 7049 Canonical CBOR
+func CTAP2EncOptions() EncOptions // FIDO2 CTAP2 Canonical CBOR
+```
+
+Presets are used to create custom modes.
+
+### Custom Modes
+
+Modes are created from settings. Once created, modes have immutable settings.
+
+💡 Create the mode at startup and reuse it. It is safe for concurrent use.
+
+```Go
+// Create encoding mode.
+opts := cbor.CoreDetEncOptions() // use preset options as a starting point
+opts.Time = cbor.TimeUnix // change any settings if needed
+em, err := opts.EncMode() // create an immutable encoding mode
+
+// Reuse the encoding mode. It is safe for concurrent use.
+
+// API matches encoding/json.
+b, err := em.Marshal(v) // encode v to []byte b
+encoder := em.NewEncoder(w) // create encoder with io.Writer w
+err := encoder.Encode(v) // encode v to io.Writer w
+```
+
+Default mode and custom modes automatically apply struct tags.
+
+### User Specified Buffer for Encoding (v2.7.0)
+
+`UserBufferEncMode` interface extends `EncMode` interface to add `MarshalToBuffer()`. It accepts a user-specified buffer instead of using built-in buffer pool.
+
+```Go
+em, err := myEncOptions.UserBufferEncMode() // create UserBufferEncMode mode
+
+var buf bytes.Buffer
+err = em.MarshalToBuffer(v, &buf) // encode v to provided buf
+```
+
+### Struct Tags
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) reduce encoded size of structs.
+
+Example encoding 3-level nested Go struct to 1 byte CBOR
+
+https://go.dev/play/p/YxwvfPdFQG2
+
+```Go
+// Example encoding nested struct (with omitempty tag)
+// - encoding/json: 18 byte JSON
+// - fxamacker/cbor: 1 byte CBOR
+package main
+
+import (
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+type GrandChild struct {
+ Quux int `json:",omitempty"`
+}
+
+type Child struct {
+ Baz int `json:",omitempty"`
+ Qux GrandChild `json:",omitempty"`
+}
+
+type Parent struct {
+ Foo Child `json:",omitempty"`
+ Bar int `json:",omitempty"`
+}
+
+func cb() {
+ results, _ := cbor.Marshal(Parent{})
+ fmt.Println("hex(CBOR): " + hex.EncodeToString(results))
+
+ text, _ := cbor.Diagnose(results) // Diagnostic Notation
+ fmt.Println("DN: " + text)
+}
+
+func js() {
+ results, _ := json.Marshal(Parent{})
+ fmt.Println("hex(JSON): " + hex.EncodeToString(results))
+
+ text := string(results) // JSON
+ fmt.Println("JSON: " + text)
+}
+
+func main() {
+ cb()
+ fmt.Println("-------------")
+ js()
+}
+```
+
+Output (DN is Diagnostic Notation):
+```
+hex(CBOR): a0
+DN: {}
+-------------
+hex(JSON): 7b22466f6f223a7b22517578223a7b7d7d7d
+JSON: {"Foo":{"Qux":{}}}
+```
+
+
+
+
+
+Example using several struct tags
+
+![alt text](https://github.com/fxamacker/images/raw/master/cbor/v2.3.0/cbor_struct_tags_api.svg?sanitize=1 "CBOR API and Go Struct Tags")
+
+
+
+Struct tags simplify use of CBOR-based protocols that require CBOR arrays or maps with integer keys.
+
+### CBOR Tags
+
+CBOR tags are specified in a `TagSet`.
+
+Custom modes can be created with a `TagSet` to handle CBOR tags.
+
+```go
+em, err := opts.EncMode() // no CBOR tags
+em, err := opts.EncModeWithTags(ts) // immutable CBOR tags
+em, err := opts.EncModeWithSharedTags(ts) // mutable shared CBOR tags
+```
+
+`TagSet` and modes using it are safe for concurrent use. Equivalent API is available for `DecMode`.
+
+Example using TagSet and TagOptions
+
+```go
+// Use signedCWT struct defined in "Decoding CWT" example.
+
+// Create TagSet (safe for concurrency).
+tags := cbor.NewTagSet()
+// Register tag COSE_Sign1 18 with signedCWT type.
+tags.Add(
+ cbor.TagOptions{EncTag: cbor.EncTagRequired, DecTag: cbor.DecTagRequired},
+ reflect.TypeOf(signedCWT{}),
+ 18)
+
+// Create DecMode with immutable tags.
+dm, _ := cbor.DecOptions{}.DecModeWithTags(tags)
+
+// Unmarshal to signedCWT with tag support.
+var v signedCWT
+if err := dm.Unmarshal(data, &v); err != nil {
+ return err
+}
+
+// Create EncMode with immutable tags.
+em, _ := cbor.EncOptions{}.EncModeWithTags(tags)
+
+// Marshal signedCWT with tag number.
+if data, err := cbor.Marshal(v); err != nil {
+ return err
+}
+```
+
+
+
+### Functions and Interfaces
+
+Functions and interfaces at a glance
+
+Common functions with same API as `encoding/json`:
+- `Marshal`, `Unmarshal`
+- `NewEncoder`, `(*Encoder).Encode`
+- `NewDecoder`, `(*Decoder).Decode`
+
+NOTE: `Unmarshal` will return `ExtraneousDataError` if there are remaining bytes
+because RFC 8949 treats CBOR data item with remaining bytes as malformed.
+- 💡 Use `UnmarshalFirst` to decode first CBOR data item and return any remaining bytes.
+
+Other useful functions:
+- `Diagnose`, `DiagnoseFirst` produce human-readable [Extended Diagnostic Notation](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G) from CBOR data.
+- `UnmarshalFirst` decodes first CBOR data item and return any remaining bytes.
+- `Wellformed` returns true if the the CBOR data item is well-formed.
+
+Interfaces identical or comparable to Go `encoding` packages include:
+`Marshaler`, `Unmarshaler`, `BinaryMarshaler`, and `BinaryUnmarshaler`.
+
+The `RawMessage` type can be used to delay CBOR decoding or precompute CBOR encoding.
+
+
+
+### Security Tips
+
+🔒 Use Go's `io.LimitReader` to limit size when decoding very large or indefinite size data.
+
+Default limits may need to be increased for systems handling very large data (e.g. blockchains).
+
+`DecOptions` can be used to modify default limits for `MaxArrayElements`, `MaxMapPairs`, and `MaxNestedLevels`.
+
+## Status
+
+v2.7.0 (June 23, 2024) adds features and improvements that help large projects (e.g. Kubernetes) use CBOR as an alternative to JSON and Protocol Buffers. Other improvements include speedups, improved memory use, bug fixes, new serialization options, etc. It passed fuzz tests (5+ billion executions) and is production quality.
+
+For more details, see [release notes](https://github.com/fxamacker/cbor/releases).
+
+### Prior Release
+
+[v2.6.0](https://github.com/fxamacker/cbor/releases/tag/v2.6.0) (February 2024) adds important new features, optimizations, and bug fixes. It is especially useful to systems that need to convert data between CBOR and JSON. New options and optimizations improve handling of bignum, integers, maps, and strings.
+
+v2.5.0 was released on Sunday, August 13, 2023 with new features and important bug fixes. It is fuzz tested and production quality after extended beta [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
+
+__IMPORTANT__: 👉 Before upgrading from v2.4 or older release, please read the notable changes highlighted in the release notes. v2.5.0 is a large release with bug fixes to error handling for extraneous data in `Unmarshal`, etc. that should be reviewed before upgrading.
+
+See [v2.5.0 release notes](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) for list of new features, improvements, and bug fixes.
+
+See ["Version and API Changes"](https://github.com/fxamacker/cbor#versions-and-api-changes) section for more info about version numbering, etc.
+
+
+
+## Who uses fxamacker/cbor
+
+`fxamacker/cbor` is used in projects by Arm Ltd., Berlin Institute of Health at Charité, Chainlink, Cisco, Confidential Computing Consortium, ConsenSys, Dapper Labs, EdgeX Foundry, F5, FIDO Alliance, Fraunhofer‑AISEC, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Matrix.org, Microsoft, Mozilla, National Cybersecurity Agency of France (govt), Netherlands (govt), Oasis Protocol, Smallstep, Tailscale, Taurus SA, Teleport, TIBCO, and others.
+
+`fxamacker/cbor` passed multiple confidential security assessments. A [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) (prepared by NCC Group for Microsoft Corporation) includes a subset of fxamacker/cbor v2.4.0 in its scope.
+
+## Standards
+
+`fxamacker/cbor` is a CBOR codec in full conformance with [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94). It also supports CBOR Sequences ([RFC 8742](https://www.rfc-editor.org/rfc/rfc8742.html)) and Extended Diagnostic Notation ([Appendix G of RFC 8610](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G)).
+
+Notable CBOR features include:
+
+| CBOR Feature | Description |
+| :--- | :--- |
+| CBOR tags | API supports built-in and user-defined tags. |
+| Preferred serialization | Integers encode to fewest bytes. Optional float64 → float32 → float16. |
+| Map key sorting | Unsorted, length-first (Canonical CBOR), and bytewise-lexicographic (CTAP2). |
+| Duplicate map keys | Always forbid for encoding and option to allow/forbid for decoding. |
+| Indefinite length data | Option to allow/forbid for encoding and decoding. |
+| Well-formedness | Always checked and enforced. |
+| Basic validity checks | Optionally check UTF-8 validity and duplicate map keys. |
+| Security considerations | Prevent integer overflow and resource exhaustion (RFC 8949 Section 10). |
+
+Known limitations are noted in the [Limitations section](#limitations).
+
+Go nil values for slices, maps, pointers, etc. are encoded as CBOR null. Empty slices, maps, etc. are encoded as empty CBOR arrays and maps.
+
+Decoder checks for all required well-formedness errors, including all "subkinds" of syntax errors and too little data.
+
+After well-formedness is verified, basic validity errors are handled as follows:
+
+* Invalid UTF-8 string: Decoder has option to check and return invalid UTF-8 string error. This check is enabled by default.
+* Duplicate keys in a map: Decoder has options to ignore or enforce rejection of duplicate map keys.
+
+When decoding well-formed CBOR arrays and maps, decoder saves the first error it encounters and continues with the next item. Options to handle this differently may be added in the future.
+
+By default, decoder treats time values of floating-point NaN and Infinity as if they are CBOR Null or CBOR Undefined.
+
+__Click to expand topic:__
+
+
+ Duplicate Map Keys
+
+This library provides options for fast detection and rejection of duplicate map keys based on applying a Go-specific data model to CBOR's extended generic data model in order to determine duplicate vs distinct map keys. Detection relies on whether the CBOR map key would be a duplicate "key" when decoded and applied to the user-provided Go map or struct.
+
+`DupMapKeyQuiet` turns off detection of duplicate map keys. It tries to use a "keep fastest" method by choosing either "keep first" or "keep last" depending on the Go data type.
+
+`DupMapKeyEnforcedAPF` enforces detection and rejection of duplidate map keys. Decoding stops immediately and returns `DupMapKeyError` when the first duplicate key is detected. The error includes the duplicate map key and the index number.
+
+APF suffix means "Allow Partial Fill" so the destination map or struct can contain some decoded values at the time of error. It is the caller's responsibility to respond to the `DupMapKeyError` by discarding the partially filled result if that's required by their protocol.
+
+
+
+
+ Tag Validity
+
+This library checks tag validity for built-in tags (currently tag numbers 0, 1, 2, 3, and 55799):
+
+* Inadmissible type for tag content
+* Inadmissible value for tag content
+
+Unknown tag data items (not tag number 0, 1, 2, 3, or 55799) are handled in two ways:
+
+* When decoding into an empty interface, unknown tag data item will be decoded into `cbor.Tag` data type, which contains tag number and tag content. The tag content will be decoded into the default Go data type for the CBOR data type.
+* When decoding into other Go types, unknown tag data item is decoded into the specified Go type. If Go type is registered with a tag number, the tag number can optionally be verified.
+
+Decoder also has an option to forbid tag data items (treat any tag data item as error) which is specified by protocols such as CTAP2 Canonical CBOR.
+
+For more information, see [decoding options](#decoding-options-1) and [tag options](#tag-options).
+
+
+
+## Limitations
+
+If any of these limitations prevent you from using this library, please open an issue along with a link to your project.
+
+* CBOR `Undefined` (0xf7) value decodes to Go's `nil` value. CBOR `Null` (0xf6) more closely matches Go's `nil`.
+* CBOR map keys with data types not supported by Go for map keys are ignored and an error is returned after continuing to decode remaining items.
+* When decoding registered CBOR tag data to interface type, decoder creates a pointer to registered Go type matching CBOR tag number. Requiring a pointer for this is a Go limitation.
+
+## Fuzzing and Code Coverage
+
+__Code coverage__ is always 95% or higher (with `go test -cover`) when tagging a release.
+
+__Coverage-guided fuzzing__ must pass billions of execs using before tagging a release. Fuzzing is done using nonpublic code which may eventually get merged into this project. Until then, reports like OpenSSF Scorecard can't detect fuzz tests being used by this project.
+
+
+
+## Versions and API Changes
+This project uses [Semantic Versioning](https://semver.org), so the API is always backwards compatible unless the major version number changes.
+
+These functions have signatures identical to encoding/json and their API will continue to match `encoding/json` even after major new releases:
+`Marshal`, `Unmarshal`, `NewEncoder`, `NewDecoder`, `(*Encoder).Encode`, and `(*Decoder).Decode`.
+
+Exclusions from SemVer:
+- Newly added API documented as "subject to change".
+- Newly added API in the master branch that has never been tagged in non-beta release.
+- If function parameters are unchanged, bug fixes that change behavior (e.g. return error for edge case was missed in prior version). We try to highlight these in the release notes and add extended beta period. E.g. [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
+
+This project avoids breaking changes to behavior of encoding and decoding functions unless required to improve conformance with supported RFCs (e.g. RFC 8949, RFC 8742, etc.) Visible changes that don't improve conformance to standards are typically made available as new opt-in settings or new functions.
+
+## Code of Conduct
+
+This project has adopted the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). Contact [faye.github@gmail.com](mailto:faye.github@gmail.com) with any questions or comments.
+
+## Contributing
+
+Please open an issue before beginning work on a PR. The improvement may have already been considered, etc.
+
+For more info, see [How to Contribute](CONTRIBUTING.md).
+
+## Security Policy
+
+Security fixes are provided for the latest released version of fxamacker/cbor.
+
+For the full text of the Security Policy, see [SECURITY.md](SECURITY.md).
+
+## Acknowledgements
+
+Many thanks to all the contributors on this project!
+
+I'm especially grateful to Bastian Müller and Dieter Shirley for suggesting and collaborating on CBOR stream mode, and much more.
+
+I'm very grateful to Stefan Tatschner, Yawning Angel, Jernej Kos, x448, ZenGround0, and Jakob Borg for their contributions or support in the very early days.
+
+Big thanks to Ben Luddy for his contributions in v2.6.0 and v2.7.0.
+
+This library clearly wouldn't be possible without Carsten Bormann authoring CBOR RFCs.
+
+Special thanks to Laurence Lundblade and Jeffrey Yasskin for their help on IETF mailing list or at [7049bis](https://github.com/cbor-wg/CBORbis).
+
+Huge thanks to The Go Authors for creating a fun and practical programming language with batteries included!
+
+This library uses `x448/float16` which used to be included. As a standalone package, `x448/float16` is useful to other projects as well.
+
+## License
+
+Copyright © 2019-2024 [Faye Amacker](https://github.com/fxamacker).
+
+fxamacker/cbor is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text.
+
+
diff --git a/vendor/github.com/fxamacker/cbor/v2/SECURITY.md b/vendor/github.com/fxamacker/cbor/v2/SECURITY.md
new file mode 100644
index 00000000000..9c05146d16c
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/SECURITY.md
@@ -0,0 +1,7 @@
+# Security Policy
+
+Security fixes are provided for the latest released version of fxamacker/cbor.
+
+If the security vulnerability is already known to the public, then you can open an issue as a bug report.
+
+To report security vulnerabilities not yet known to the public, please email faye.github@gmail.com and allow time for the problem to be resolved before reporting it to the public.
diff --git a/vendor/github.com/fxamacker/cbor/v2/bytestring.go b/vendor/github.com/fxamacker/cbor/v2/bytestring.go
new file mode 100644
index 00000000000..823bff12ce1
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/bytestring.go
@@ -0,0 +1,63 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "errors"
+)
+
+// ByteString represents CBOR byte string (major type 2). ByteString can be used
+// when using a Go []byte is not possible or convenient. For example, Go doesn't
+// allow []byte as map key, so ByteString can be used to support data formats
+// having CBOR map with byte string keys. ByteString can also be used to
+// encode invalid UTF-8 string as CBOR byte string.
+// See DecOption.MapKeyByteStringMode for more details.
+type ByteString string
+
+// Bytes returns bytes representing ByteString.
+func (bs ByteString) Bytes() []byte {
+ return []byte(bs)
+}
+
+// MarshalCBOR encodes ByteString as CBOR byte string (major type 2).
+func (bs ByteString) MarshalCBOR() ([]byte, error) {
+ e := getEncodeBuffer()
+ defer putEncodeBuffer(e)
+
+ // Encode length
+ encodeHead(e, byte(cborTypeByteString), uint64(len(bs)))
+
+ // Encode data
+ buf := make([]byte, e.Len()+len(bs))
+ n := copy(buf, e.Bytes())
+ copy(buf[n:], bs)
+
+ return buf, nil
+}
+
+// UnmarshalCBOR decodes CBOR byte string (major type 2) to ByteString.
+// Decoding CBOR null and CBOR undefined sets ByteString to be empty.
+func (bs *ByteString) UnmarshalCBOR(data []byte) error {
+ if bs == nil {
+ return errors.New("cbor.ByteString: UnmarshalCBOR on nil pointer")
+ }
+
+ // Decoding CBOR null and CBOR undefined to ByteString resets data.
+ // This behavior is similar to decoding CBOR null and CBOR undefined to []byte.
+ if len(data) == 1 && (data[0] == 0xf6 || data[0] == 0xf7) {
+ *bs = ""
+ return nil
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Check if CBOR data type is byte string
+ if typ := d.nextCBORType(); typ != cborTypeByteString {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: typeByteString.String()}
+ }
+
+ b, _ := d.parseByteString()
+ *bs = ByteString(b)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/cache.go b/vendor/github.com/fxamacker/cbor/v2/cache.go
new file mode 100644
index 00000000000..ea0f39e24f0
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/cache.go
@@ -0,0 +1,363 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "reflect"
+ "sort"
+ "strconv"
+ "strings"
+ "sync"
+)
+
+type encodeFuncs struct {
+ ef encodeFunc
+ ief isEmptyFunc
+}
+
+var (
+ decodingStructTypeCache sync.Map // map[reflect.Type]*decodingStructType
+ encodingStructTypeCache sync.Map // map[reflect.Type]*encodingStructType
+ encodeFuncCache sync.Map // map[reflect.Type]encodeFuncs
+ typeInfoCache sync.Map // map[reflect.Type]*typeInfo
+)
+
+type specialType int
+
+const (
+ specialTypeNone specialType = iota
+ specialTypeUnmarshalerIface
+ specialTypeEmptyIface
+ specialTypeIface
+ specialTypeTag
+ specialTypeTime
+)
+
+type typeInfo struct {
+ elemTypeInfo *typeInfo
+ keyTypeInfo *typeInfo
+ typ reflect.Type
+ kind reflect.Kind
+ nonPtrType reflect.Type
+ nonPtrKind reflect.Kind
+ spclType specialType
+}
+
+func newTypeInfo(t reflect.Type) *typeInfo {
+ tInfo := typeInfo{typ: t, kind: t.Kind()}
+
+ for t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+
+ k := t.Kind()
+
+ tInfo.nonPtrType = t
+ tInfo.nonPtrKind = k
+
+ if k == reflect.Interface {
+ if t.NumMethod() == 0 {
+ tInfo.spclType = specialTypeEmptyIface
+ } else {
+ tInfo.spclType = specialTypeIface
+ }
+ } else if t == typeTag {
+ tInfo.spclType = specialTypeTag
+ } else if t == typeTime {
+ tInfo.spclType = specialTypeTime
+ } else if reflect.PtrTo(t).Implements(typeUnmarshaler) {
+ tInfo.spclType = specialTypeUnmarshalerIface
+ }
+
+ switch k {
+ case reflect.Array, reflect.Slice:
+ tInfo.elemTypeInfo = getTypeInfo(t.Elem())
+ case reflect.Map:
+ tInfo.keyTypeInfo = getTypeInfo(t.Key())
+ tInfo.elemTypeInfo = getTypeInfo(t.Elem())
+ }
+
+ return &tInfo
+}
+
+type decodingStructType struct {
+ fields fields
+ fieldIndicesByName map[string]int
+ err error
+ toArray bool
+}
+
+// The stdlib errors.Join was introduced in Go 1.20, and we still support Go 1.17, so instead,
+// here's a very basic implementation of an aggregated error.
+type multierror []error
+
+func (m multierror) Error() string {
+ var sb strings.Builder
+ for i, err := range m {
+ sb.WriteString(err.Error())
+ if i < len(m)-1 {
+ sb.WriteString(", ")
+ }
+ }
+ return sb.String()
+}
+
+func getDecodingStructType(t reflect.Type) *decodingStructType {
+ if v, _ := decodingStructTypeCache.Load(t); v != nil {
+ return v.(*decodingStructType)
+ }
+
+ flds, structOptions := getFields(t)
+
+ toArray := hasToArrayOption(structOptions)
+
+ var errs []error
+ for i := 0; i < len(flds); i++ {
+ if flds[i].keyAsInt {
+ nameAsInt, numErr := strconv.Atoi(flds[i].name)
+ if numErr != nil {
+ errs = append(errs, errors.New("cbor: failed to parse field name \""+flds[i].name+"\" to int ("+numErr.Error()+")"))
+ break
+ }
+ flds[i].nameAsInt = int64(nameAsInt)
+ }
+
+ flds[i].typInfo = getTypeInfo(flds[i].typ)
+ }
+
+ fieldIndicesByName := make(map[string]int, len(flds))
+ for i, fld := range flds {
+ if _, ok := fieldIndicesByName[fld.name]; ok {
+ errs = append(errs, fmt.Errorf("cbor: two or more fields of %v have the same name %q", t, fld.name))
+ continue
+ }
+ fieldIndicesByName[fld.name] = i
+ }
+
+ var err error
+ {
+ var multi multierror
+ for _, each := range errs {
+ if each != nil {
+ multi = append(multi, each)
+ }
+ }
+ if len(multi) == 1 {
+ err = multi[0]
+ } else if len(multi) > 1 {
+ err = multi
+ }
+ }
+
+ structType := &decodingStructType{
+ fields: flds,
+ fieldIndicesByName: fieldIndicesByName,
+ err: err,
+ toArray: toArray,
+ }
+ decodingStructTypeCache.Store(t, structType)
+ return structType
+}
+
+type encodingStructType struct {
+ fields fields
+ bytewiseFields fields
+ lengthFirstFields fields
+ omitEmptyFieldsIdx []int
+ err error
+ toArray bool
+}
+
+func (st *encodingStructType) getFields(em *encMode) fields {
+ switch em.sort {
+ case SortNone, SortFastShuffle:
+ return st.fields
+ case SortLengthFirst:
+ return st.lengthFirstFields
+ default:
+ return st.bytewiseFields
+ }
+}
+
+type bytewiseFieldSorter struct {
+ fields fields
+}
+
+func (x *bytewiseFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *bytewiseFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *bytewiseFieldSorter) Less(i, j int) bool {
+ return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0
+}
+
+type lengthFirstFieldSorter struct {
+ fields fields
+}
+
+func (x *lengthFirstFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *lengthFirstFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *lengthFirstFieldSorter) Less(i, j int) bool {
+ if len(x.fields[i].cborName) != len(x.fields[j].cborName) {
+ return len(x.fields[i].cborName) < len(x.fields[j].cborName)
+ }
+ return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0
+}
+
+func getEncodingStructType(t reflect.Type) (*encodingStructType, error) {
+ if v, _ := encodingStructTypeCache.Load(t); v != nil {
+ structType := v.(*encodingStructType)
+ return structType, structType.err
+ }
+
+ flds, structOptions := getFields(t)
+
+ if hasToArrayOption(structOptions) {
+ return getEncodingStructToArrayType(t, flds)
+ }
+
+ var err error
+ var hasKeyAsInt bool
+ var hasKeyAsStr bool
+ var omitEmptyIdx []int
+ e := getEncodeBuffer()
+ for i := 0; i < len(flds); i++ {
+ // Get field's encodeFunc
+ flds[i].ef, flds[i].ief = getEncodeFunc(flds[i].typ)
+ if flds[i].ef == nil {
+ err = &UnsupportedTypeError{t}
+ break
+ }
+
+ // Encode field name
+ if flds[i].keyAsInt {
+ nameAsInt, numErr := strconv.Atoi(flds[i].name)
+ if numErr != nil {
+ err = errors.New("cbor: failed to parse field name \"" + flds[i].name + "\" to int (" + numErr.Error() + ")")
+ break
+ }
+ flds[i].nameAsInt = int64(nameAsInt)
+ if nameAsInt >= 0 {
+ encodeHead(e, byte(cborTypePositiveInt), uint64(nameAsInt))
+ } else {
+ n := nameAsInt*(-1) - 1
+ encodeHead(e, byte(cborTypeNegativeInt), uint64(n))
+ }
+ flds[i].cborName = make([]byte, e.Len())
+ copy(flds[i].cborName, e.Bytes())
+ e.Reset()
+
+ hasKeyAsInt = true
+ } else {
+ encodeHead(e, byte(cborTypeTextString), uint64(len(flds[i].name)))
+ flds[i].cborName = make([]byte, e.Len()+len(flds[i].name))
+ n := copy(flds[i].cborName, e.Bytes())
+ copy(flds[i].cborName[n:], flds[i].name)
+ e.Reset()
+
+ // If cborName contains a text string, then cborNameByteString contains a
+ // string that has the byte string major type but is otherwise identical to
+ // cborName.
+ flds[i].cborNameByteString = make([]byte, len(flds[i].cborName))
+ copy(flds[i].cborNameByteString, flds[i].cborName)
+ // Reset encoded CBOR type to byte string, preserving the "additional
+ // information" bits:
+ flds[i].cborNameByteString[0] = byte(cborTypeByteString) |
+ getAdditionalInformation(flds[i].cborNameByteString[0])
+
+ hasKeyAsStr = true
+ }
+
+ // Check if field can be omitted when empty
+ if flds[i].omitEmpty {
+ omitEmptyIdx = append(omitEmptyIdx, i)
+ }
+ }
+ putEncodeBuffer(e)
+
+ if err != nil {
+ structType := &encodingStructType{err: err}
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+ }
+
+ // Sort fields by canonical order
+ bytewiseFields := make(fields, len(flds))
+ copy(bytewiseFields, flds)
+ sort.Sort(&bytewiseFieldSorter{bytewiseFields})
+
+ lengthFirstFields := bytewiseFields
+ if hasKeyAsInt && hasKeyAsStr {
+ lengthFirstFields = make(fields, len(flds))
+ copy(lengthFirstFields, flds)
+ sort.Sort(&lengthFirstFieldSorter{lengthFirstFields})
+ }
+
+ structType := &encodingStructType{
+ fields: flds,
+ bytewiseFields: bytewiseFields,
+ lengthFirstFields: lengthFirstFields,
+ omitEmptyFieldsIdx: omitEmptyIdx,
+ }
+
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+}
+
+func getEncodingStructToArrayType(t reflect.Type, flds fields) (*encodingStructType, error) {
+ for i := 0; i < len(flds); i++ {
+ // Get field's encodeFunc
+ flds[i].ef, flds[i].ief = getEncodeFunc(flds[i].typ)
+ if flds[i].ef == nil {
+ structType := &encodingStructType{err: &UnsupportedTypeError{t}}
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+ }
+ }
+
+ structType := &encodingStructType{
+ fields: flds,
+ toArray: true,
+ }
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+}
+
+func getEncodeFunc(t reflect.Type) (encodeFunc, isEmptyFunc) {
+ if v, _ := encodeFuncCache.Load(t); v != nil {
+ fs := v.(encodeFuncs)
+ return fs.ef, fs.ief
+ }
+ ef, ief := getEncodeFuncInternal(t)
+ encodeFuncCache.Store(t, encodeFuncs{ef, ief})
+ return ef, ief
+}
+
+func getTypeInfo(t reflect.Type) *typeInfo {
+ if v, _ := typeInfoCache.Load(t); v != nil {
+ return v.(*typeInfo)
+ }
+ tInfo := newTypeInfo(t)
+ typeInfoCache.Store(t, tInfo)
+ return tInfo
+}
+
+func hasToArrayOption(tag string) bool {
+ s := ",toarray"
+ idx := strings.Index(tag, s)
+ return idx >= 0 && (len(tag) == idx+len(s) || tag[idx+len(s)] == ',')
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/common.go b/vendor/github.com/fxamacker/cbor/v2/common.go
new file mode 100644
index 00000000000..ec038a49ec2
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/common.go
@@ -0,0 +1,182 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "fmt"
+ "strconv"
+)
+
+type cborType uint8
+
+const (
+ cborTypePositiveInt cborType = 0x00
+ cborTypeNegativeInt cborType = 0x20
+ cborTypeByteString cborType = 0x40
+ cborTypeTextString cborType = 0x60
+ cborTypeArray cborType = 0x80
+ cborTypeMap cborType = 0xa0
+ cborTypeTag cborType = 0xc0
+ cborTypePrimitives cborType = 0xe0
+)
+
+func (t cborType) String() string {
+ switch t {
+ case cborTypePositiveInt:
+ return "positive integer"
+ case cborTypeNegativeInt:
+ return "negative integer"
+ case cborTypeByteString:
+ return "byte string"
+ case cborTypeTextString:
+ return "UTF-8 text string"
+ case cborTypeArray:
+ return "array"
+ case cborTypeMap:
+ return "map"
+ case cborTypeTag:
+ return "tag"
+ case cborTypePrimitives:
+ return "primitives"
+ default:
+ return "Invalid type " + strconv.Itoa(int(t))
+ }
+}
+
+type additionalInformation uint8
+
+const (
+ maxAdditionalInformationWithoutArgument = 23
+ additionalInformationWith1ByteArgument = 24
+ additionalInformationWith2ByteArgument = 25
+ additionalInformationWith4ByteArgument = 26
+ additionalInformationWith8ByteArgument = 27
+
+ // For major type 7.
+ additionalInformationAsFalse = 20
+ additionalInformationAsTrue = 21
+ additionalInformationAsNull = 22
+ additionalInformationAsUndefined = 23
+ additionalInformationAsFloat16 = 25
+ additionalInformationAsFloat32 = 26
+ additionalInformationAsFloat64 = 27
+
+ // For major type 2, 3, 4, 5.
+ additionalInformationAsIndefiniteLengthFlag = 31
+)
+
+const (
+ maxSimpleValueInAdditionalInformation = 23
+ minSimpleValueIn1ByteArgument = 32
+)
+
+func (ai additionalInformation) isIndefiniteLength() bool {
+ return ai == additionalInformationAsIndefiniteLengthFlag
+}
+
+const (
+ // From RFC 8949 Section 3:
+ // "The initial byte of each encoded data item contains both information about the major type
+ // (the high-order 3 bits, described in Section 3.1) and additional information
+ // (the low-order 5 bits)."
+
+ // typeMask is used to extract major type in initial byte of encoded data item.
+ typeMask = 0xe0
+
+ // additionalInformationMask is used to extract additional information in initial byte of encoded data item.
+ additionalInformationMask = 0x1f
+)
+
+func getType(raw byte) cborType {
+ return cborType(raw & typeMask)
+}
+
+func getAdditionalInformation(raw byte) byte {
+ return raw & additionalInformationMask
+}
+
+func isBreakFlag(raw byte) bool {
+ return raw == cborBreakFlag
+}
+
+func parseInitialByte(b byte) (t cborType, ai byte) {
+ return getType(b), getAdditionalInformation(b)
+}
+
+const (
+ tagNumRFC3339Time = 0
+ tagNumEpochTime = 1
+ tagNumUnsignedBignum = 2
+ tagNumNegativeBignum = 3
+ tagNumExpectedLaterEncodingBase64URL = 21
+ tagNumExpectedLaterEncodingBase64 = 22
+ tagNumExpectedLaterEncodingBase16 = 23
+ tagNumSelfDescribedCBOR = 55799
+)
+
+const (
+ cborBreakFlag = byte(0xff)
+ cborByteStringWithIndefiniteLengthHead = byte(0x5f)
+ cborTextStringWithIndefiniteLengthHead = byte(0x7f)
+ cborArrayWithIndefiniteLengthHead = byte(0x9f)
+ cborMapWithIndefiniteLengthHead = byte(0xbf)
+)
+
+var (
+ cborFalse = []byte{0xf4}
+ cborTrue = []byte{0xf5}
+ cborNil = []byte{0xf6}
+ cborNaN = []byte{0xf9, 0x7e, 0x00}
+ cborPositiveInfinity = []byte{0xf9, 0x7c, 0x00}
+ cborNegativeInfinity = []byte{0xf9, 0xfc, 0x00}
+)
+
+// validBuiltinTag checks that supported built-in tag numbers are followed by expected content types.
+func validBuiltinTag(tagNum uint64, contentHead byte) error {
+ t := getType(contentHead)
+ switch tagNum {
+ case tagNumRFC3339Time:
+ // Tag content (date/time text string in RFC 3339 format) must be string type.
+ if t != cborTypeTextString {
+ return newInadmissibleTagContentTypeError(
+ tagNumRFC3339Time,
+ "text string",
+ t.String())
+ }
+ return nil
+
+ case tagNumEpochTime:
+ // Tag content (epoch date/time) must be uint, int, or float type.
+ if t != cborTypePositiveInt && t != cborTypeNegativeInt && (contentHead < 0xf9 || contentHead > 0xfb) {
+ return newInadmissibleTagContentTypeError(
+ tagNumEpochTime,
+ "integer or floating-point number",
+ t.String())
+ }
+ return nil
+
+ case tagNumUnsignedBignum, tagNumNegativeBignum:
+ // Tag content (bignum) must be byte type.
+ if t != cborTypeByteString {
+ return newInadmissibleTagContentTypeErrorf(
+ fmt.Sprintf(
+ "tag number %d or %d must be followed by byte string, got %s",
+ tagNumUnsignedBignum,
+ tagNumNegativeBignum,
+ t.String(),
+ ))
+ }
+ return nil
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // From RFC 8949 3.4.5.2:
+ // The data item tagged can be a byte string or any other data item. In the latter
+ // case, the tag applies to all of the byte string data items contained in the data
+ // item, except for those contained in a nested data item tagged with an expected
+ // conversion.
+ return nil
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/decode.go b/vendor/github.com/fxamacker/cbor/v2/decode.go
new file mode 100644
index 00000000000..85842ac7367
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/decode.go
@@ -0,0 +1,3187 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "encoding"
+ "encoding/base64"
+ "encoding/binary"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "reflect"
+ "strconv"
+ "strings"
+ "time"
+ "unicode/utf8"
+
+ "github.com/x448/float16"
+)
+
+// Unmarshal parses the CBOR-encoded data into the value pointed to by v
+// using default decoding options. If v is nil, not a pointer, or
+// a nil pointer, Unmarshal returns an error.
+//
+// To unmarshal CBOR into a value implementing the Unmarshaler interface,
+// Unmarshal calls that value's UnmarshalCBOR method with a valid
+// CBOR value.
+//
+// To unmarshal CBOR byte string into a value implementing the
+// encoding.BinaryUnmarshaler interface, Unmarshal calls that value's
+// UnmarshalBinary method with decoded CBOR byte string.
+//
+// To unmarshal CBOR into a pointer, Unmarshal sets the pointer to nil
+// if CBOR data is null (0xf6) or undefined (0xf7). Otherwise, Unmarshal
+// unmarshals CBOR into the value pointed to by the pointer. If the
+// pointer is nil, Unmarshal creates a new value for it to point to.
+//
+// To unmarshal CBOR into an empty interface value, Unmarshal uses the
+// following rules:
+//
+// CBOR booleans decode to bool.
+// CBOR positive integers decode to uint64.
+// CBOR negative integers decode to int64 (big.Int if value overflows).
+// CBOR floating points decode to float64.
+// CBOR byte strings decode to []byte.
+// CBOR text strings decode to string.
+// CBOR arrays decode to []interface{}.
+// CBOR maps decode to map[interface{}]interface{}.
+// CBOR null and undefined values decode to nil.
+// CBOR times (tag 0 and 1) decode to time.Time.
+// CBOR bignums (tag 2 and 3) decode to big.Int.
+// CBOR tags with an unrecognized number decode to cbor.Tag
+//
+// To unmarshal a CBOR array into a slice, Unmarshal allocates a new slice
+// if the CBOR array is empty or slice capacity is less than CBOR array length.
+// Otherwise Unmarshal overwrites existing elements, and sets slice length
+// to CBOR array length.
+//
+// To unmarshal a CBOR array into a Go array, Unmarshal decodes CBOR array
+// elements into Go array elements. If the Go array is smaller than the
+// CBOR array, the extra CBOR array elements are discarded. If the CBOR
+// array is smaller than the Go array, the extra Go array elements are
+// set to zero values.
+//
+// To unmarshal a CBOR array into a struct, struct must have a special field "_"
+// with struct tag `cbor:",toarray"`. Go array elements are decoded into struct
+// fields. Any "omitempty" struct field tag option is ignored in this case.
+//
+// To unmarshal a CBOR map into a map, Unmarshal allocates a new map only if the
+// map is nil. Otherwise Unmarshal reuses the existing map and keeps existing
+// entries. Unmarshal stores key-value pairs from the CBOR map into Go map.
+// See DecOptions.DupMapKey to enable duplicate map key detection.
+//
+// To unmarshal a CBOR map into a struct, Unmarshal matches CBOR map keys to the
+// keys in the following priority:
+//
+// 1. "cbor" key in struct field tag,
+// 2. "json" key in struct field tag,
+// 3. struct field name.
+//
+// Unmarshal tries an exact match for field name, then a case-insensitive match.
+// Map key-value pairs without corresponding struct fields are ignored. See
+// DecOptions.ExtraReturnErrors to return error at unknown field.
+//
+// To unmarshal a CBOR text string into a time.Time value, Unmarshal parses text
+// string formatted in RFC3339. To unmarshal a CBOR integer/float into a
+// time.Time value, Unmarshal creates an unix time with integer/float as seconds
+// and fractional seconds since January 1, 1970 UTC. As a special case, Infinite
+// and NaN float values decode to time.Time's zero value.
+//
+// To unmarshal CBOR null (0xf6) and undefined (0xf7) values into a
+// slice/map/pointer, Unmarshal sets Go value to nil. Because null is often
+// used to mean "not present", unmarshalling CBOR null and undefined value
+// into any other Go type has no effect and returns no error.
+//
+// Unmarshal supports CBOR tag 55799 (self-describe CBOR), tag 0 and 1 (time),
+// and tag 2 and 3 (bignum).
+//
+// Unmarshal returns ExtraneousDataError error (without decoding into v)
+// if there are any remaining bytes following the first valid CBOR data item.
+// See UnmarshalFirst, if you want to unmarshal only the first
+// CBOR data item without ExtraneousDataError caused by remaining bytes.
+func Unmarshal(data []byte, v interface{}) error {
+ return defaultDecMode.Unmarshal(data, v)
+}
+
+// UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+// using default decoding options. Any remaining bytes are returned in rest.
+//
+// If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+//
+// See the documentation for Unmarshal for details.
+func UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error) {
+ return defaultDecMode.UnmarshalFirst(data, v)
+}
+
+// Valid checks whether data is a well-formed encoded CBOR data item and
+// that it complies with default restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+//
+// WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+// and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+//
+// Deprecated: Valid is kept for compatibility and should not be used.
+// Use Wellformed instead because it has a more appropriate name.
+func Valid(data []byte) error {
+ return defaultDecMode.Valid(data)
+}
+
+// Wellformed checks whether data is a well-formed encoded CBOR data item and
+// that it complies with default restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+func Wellformed(data []byte) error {
+ return defaultDecMode.Wellformed(data)
+}
+
+// Unmarshaler is the interface implemented by types that wish to unmarshal
+// CBOR data themselves. The input is a valid CBOR value. UnmarshalCBOR
+// must copy the CBOR data if it needs to use it after returning.
+type Unmarshaler interface {
+ UnmarshalCBOR([]byte) error
+}
+
+// InvalidUnmarshalError describes an invalid argument passed to Unmarshal.
+type InvalidUnmarshalError struct {
+ s string
+}
+
+func (e *InvalidUnmarshalError) Error() string {
+ return e.s
+}
+
+// UnmarshalTypeError describes a CBOR value that can't be decoded to a Go type.
+type UnmarshalTypeError struct {
+ CBORType string // type of CBOR value
+ GoType string // type of Go value it could not be decoded into
+ StructFieldName string // name of the struct field holding the Go value (optional)
+ errorMsg string // additional error message (optional)
+}
+
+func (e *UnmarshalTypeError) Error() string {
+ var s string
+ if e.StructFieldName != "" {
+ s = "cbor: cannot unmarshal " + e.CBORType + " into Go struct field " + e.StructFieldName + " of type " + e.GoType
+ } else {
+ s = "cbor: cannot unmarshal " + e.CBORType + " into Go value of type " + e.GoType
+ }
+ if e.errorMsg != "" {
+ s += " (" + e.errorMsg + ")"
+ }
+ return s
+}
+
+// InvalidMapKeyTypeError describes invalid Go map key type when decoding CBOR map.
+// For example, Go doesn't allow slice as map key.
+type InvalidMapKeyTypeError struct {
+ GoType string
+}
+
+func (e *InvalidMapKeyTypeError) Error() string {
+ return "cbor: invalid map key type: " + e.GoType
+}
+
+// DupMapKeyError describes detected duplicate map key in CBOR map.
+type DupMapKeyError struct {
+ Key interface{}
+ Index int
+}
+
+func (e *DupMapKeyError) Error() string {
+ return fmt.Sprintf("cbor: found duplicate map key \"%v\" at map element index %d", e.Key, e.Index)
+}
+
+// UnknownFieldError describes detected unknown field in CBOR map when decoding to Go struct.
+type UnknownFieldError struct {
+ Index int
+}
+
+func (e *UnknownFieldError) Error() string {
+ return fmt.Sprintf("cbor: found unknown field at map element index %d", e.Index)
+}
+
+// UnacceptableDataItemError is returned when unmarshaling a CBOR input that contains a data item
+// that is not acceptable to a specific CBOR-based application protocol ("invalid or unexpected" as
+// described in RFC 8949 Section 5 Paragraph 3).
+type UnacceptableDataItemError struct {
+ CBORType string
+ Message string
+}
+
+func (e UnacceptableDataItemError) Error() string {
+ return fmt.Sprintf("cbor: data item of cbor type %s is not accepted by protocol: %s", e.CBORType, e.Message)
+}
+
+// ByteStringExpectedFormatError is returned when unmarshaling CBOR byte string fails when
+// using non-default ByteStringExpectedFormat decoding option that makes decoder expect
+// a specified format such as base64, hex, etc.
+type ByteStringExpectedFormatError struct {
+ expectedFormatOption ByteStringExpectedFormatMode
+ err error
+}
+
+func newByteStringExpectedFormatError(expectedFormatOption ByteStringExpectedFormatMode, err error) *ByteStringExpectedFormatError {
+ return &ByteStringExpectedFormatError{expectedFormatOption, err}
+}
+
+func (e *ByteStringExpectedFormatError) Error() string {
+ switch e.expectedFormatOption {
+ case ByteStringExpectedBase64URL:
+ return fmt.Sprintf("cbor: failed to decode base64url from byte string: %s", e.err)
+
+ case ByteStringExpectedBase64:
+ return fmt.Sprintf("cbor: failed to decode base64 from byte string: %s", e.err)
+
+ case ByteStringExpectedBase16:
+ return fmt.Sprintf("cbor: failed to decode hex from byte string: %s", e.err)
+
+ default:
+ return fmt.Sprintf("cbor: failed to decode byte string in expected format %d: %s", e.expectedFormatOption, e.err)
+ }
+}
+
+func (e *ByteStringExpectedFormatError) Unwrap() error {
+ return e.err
+}
+
+// InadmissibleTagContentTypeError is returned when unmarshaling built-in CBOR tags
+// fails because of inadmissible type for tag content. Currently, the built-in
+// CBOR tags in this codec are tags 0-3 and 21-23.
+// See "Tag validity" in RFC 8949 Section 5.3.2.
+type InadmissibleTagContentTypeError struct {
+ s string
+ tagNum int
+ expectedTagContentType string
+ gotTagContentType string
+}
+
+func newInadmissibleTagContentTypeError(
+ tagNum int,
+ expectedTagContentType string,
+ gotTagContentType string,
+) *InadmissibleTagContentTypeError {
+ return &InadmissibleTagContentTypeError{
+ tagNum: tagNum,
+ expectedTagContentType: expectedTagContentType,
+ gotTagContentType: gotTagContentType,
+ }
+}
+
+func newInadmissibleTagContentTypeErrorf(s string) *InadmissibleTagContentTypeError {
+ return &InadmissibleTagContentTypeError{s: "cbor: " + s} //nolint:goconst // ignore "cbor"
+}
+
+func (e *InadmissibleTagContentTypeError) Error() string {
+ if e.s == "" {
+ return fmt.Sprintf(
+ "cbor: tag number %d must be followed by %s, got %s",
+ e.tagNum,
+ e.expectedTagContentType,
+ e.gotTagContentType,
+ )
+ }
+ return e.s
+}
+
+// DupMapKeyMode specifies how to enforce duplicate map key. Two map keys are considered duplicates if:
+// 1. When decoding into a struct, both keys match the same struct field. The keys are also
+// considered duplicates if neither matches any field and decoding to interface{} would produce
+// equal (==) values for both keys.
+// 2. When decoding into a map, both keys are equal (==) when decoded into values of the
+// destination map's key type.
+type DupMapKeyMode int
+
+const (
+ // DupMapKeyQuiet doesn't enforce duplicate map key. Decoder quietly (no error)
+ // uses faster of "keep first" or "keep last" depending on Go data type and other factors.
+ DupMapKeyQuiet DupMapKeyMode = iota
+
+ // DupMapKeyEnforcedAPF enforces detection and rejection of duplicate map keys.
+ // APF means "Allow Partial Fill" and the destination map or struct can be partially filled.
+ // If a duplicate map key is detected, DupMapKeyError is returned without further decoding
+ // of the map. It's the caller's responsibility to respond to DupMapKeyError by
+ // discarding the partially filled result if their protocol requires it.
+ // WARNING: using DupMapKeyEnforcedAPF will decrease performance and increase memory use.
+ DupMapKeyEnforcedAPF
+
+ maxDupMapKeyMode
+)
+
+func (dmkm DupMapKeyMode) valid() bool {
+ return dmkm >= 0 && dmkm < maxDupMapKeyMode
+}
+
+// IndefLengthMode specifies whether to allow indefinite length items.
+type IndefLengthMode int
+
+const (
+ // IndefLengthAllowed allows indefinite length items.
+ IndefLengthAllowed IndefLengthMode = iota
+
+ // IndefLengthForbidden disallows indefinite length items.
+ IndefLengthForbidden
+
+ maxIndefLengthMode
+)
+
+func (m IndefLengthMode) valid() bool {
+ return m >= 0 && m < maxIndefLengthMode
+}
+
+// TagsMode specifies whether to allow CBOR tags.
+type TagsMode int
+
+const (
+ // TagsAllowed allows CBOR tags.
+ TagsAllowed TagsMode = iota
+
+ // TagsForbidden disallows CBOR tags.
+ TagsForbidden
+
+ maxTagsMode
+)
+
+func (tm TagsMode) valid() bool {
+ return tm >= 0 && tm < maxTagsMode
+}
+
+// IntDecMode specifies which Go type (int64, uint64, or big.Int) should
+// be used when decoding CBOR integers (major type 0 and 1) to Go interface{}.
+type IntDecMode int
+
+const (
+ // IntDecConvertNone affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR unsigned integer (major type 0) to:
+ // - uint64
+ // It decodes CBOR negative integer (major type 1) to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value doesn't fit into int64
+ IntDecConvertNone IntDecMode = iota
+
+ // IntDecConvertSigned affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR integers (major type 0 and 1) to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value < math.MinInt64
+ // - return UnmarshalTypeError if value > math.MaxInt64
+ // Deprecated: IntDecConvertSigned should not be used.
+ // Please use other options, such as IntDecConvertSignedOrError, IntDecConvertSignedOrBigInt, IntDecConvertNone.
+ IntDecConvertSigned
+
+ // IntDecConvertSignedOrFail affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR integers (major type 0 and 1) to:
+ // - int64 if value fits
+ // - return UnmarshalTypeError if value doesn't fit into int64
+ IntDecConvertSignedOrFail
+
+ // IntDecConvertSigned affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It makes CBOR integers (major type 0 and 1) decode to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value doesn't fit into int64
+ IntDecConvertSignedOrBigInt
+
+ maxIntDec
+)
+
+func (idm IntDecMode) valid() bool {
+ return idm >= 0 && idm < maxIntDec
+}
+
+// MapKeyByteStringMode specifies how to decode CBOR byte string (major type 2)
+// as Go map key when decoding CBOR map key into an empty Go interface value.
+// Specifically, this option applies when decoding CBOR map into
+// - Go empty interface, or
+// - Go map with empty interface as key type.
+// The CBOR map key types handled by this option are
+// - byte string
+// - tagged byte string
+// - nested tagged byte string
+type MapKeyByteStringMode int
+
+const (
+ // MapKeyByteStringAllowed allows CBOR byte string to be decoded as Go map key.
+ // Since Go doesn't allow []byte as map key, CBOR byte string is decoded to
+ // ByteString which has underlying string type.
+ // This is the default setting.
+ MapKeyByteStringAllowed MapKeyByteStringMode = iota
+
+ // MapKeyByteStringForbidden forbids CBOR byte string being decoded as Go map key.
+ // Attempting to decode CBOR byte string as map key into empty interface value
+ // returns a decoding error.
+ MapKeyByteStringForbidden
+
+ maxMapKeyByteStringMode
+)
+
+func (mkbsm MapKeyByteStringMode) valid() bool {
+ return mkbsm >= 0 && mkbsm < maxMapKeyByteStringMode
+}
+
+// ExtraDecErrorCond specifies extra conditions that should be treated as errors.
+type ExtraDecErrorCond uint
+
+// ExtraDecErrorNone indicates no extra error condition.
+const ExtraDecErrorNone ExtraDecErrorCond = 0
+
+const (
+ // ExtraDecErrorUnknownField indicates error condition when destination
+ // Go struct doesn't have a field matching a CBOR map key.
+ ExtraDecErrorUnknownField ExtraDecErrorCond = 1 << iota
+
+ maxExtraDecError
+)
+
+func (ec ExtraDecErrorCond) valid() bool {
+ return ec < maxExtraDecError
+}
+
+// UTF8Mode option specifies if decoder should
+// decode CBOR Text containing invalid UTF-8 string.
+type UTF8Mode int
+
+const (
+ // UTF8RejectInvalid rejects CBOR Text containing
+ // invalid UTF-8 string.
+ UTF8RejectInvalid UTF8Mode = iota
+
+ // UTF8DecodeInvalid allows decoding CBOR Text containing
+ // invalid UTF-8 string.
+ UTF8DecodeInvalid
+
+ maxUTF8Mode
+)
+
+func (um UTF8Mode) valid() bool {
+ return um >= 0 && um < maxUTF8Mode
+}
+
+// FieldNameMatchingMode specifies how string keys in CBOR maps are matched to Go struct field names.
+type FieldNameMatchingMode int
+
+const (
+ // FieldNameMatchingPreferCaseSensitive prefers to decode map items into struct fields whose names (or tag
+ // names) exactly match the item's key. If there is no such field, a map item will be decoded into a field whose
+ // name is a case-insensitive match for the item's key.
+ FieldNameMatchingPreferCaseSensitive FieldNameMatchingMode = iota
+
+ // FieldNameMatchingCaseSensitive decodes map items only into a struct field whose name (or tag name) is an
+ // exact match for the item's key.
+ FieldNameMatchingCaseSensitive
+
+ maxFieldNameMatchingMode
+)
+
+func (fnmm FieldNameMatchingMode) valid() bool {
+ return fnmm >= 0 && fnmm < maxFieldNameMatchingMode
+}
+
+// BigIntDecMode specifies how to decode CBOR bignum to Go interface{}.
+type BigIntDecMode int
+
+const (
+ // BigIntDecodeValue makes CBOR bignum decode to big.Int (instead of *big.Int)
+ // when unmarshalling into a Go interface{}.
+ BigIntDecodeValue BigIntDecMode = iota
+
+ // BigIntDecodePointer makes CBOR bignum decode to *big.Int when
+ // unmarshalling into a Go interface{}.
+ BigIntDecodePointer
+
+ maxBigIntDecMode
+)
+
+func (bidm BigIntDecMode) valid() bool {
+ return bidm >= 0 && bidm < maxBigIntDecMode
+}
+
+// ByteStringToStringMode specifies the behavior when decoding a CBOR byte string into a Go string.
+type ByteStringToStringMode int
+
+const (
+ // ByteStringToStringForbidden generates an error on an attempt to decode a CBOR byte string into a Go string.
+ ByteStringToStringForbidden ByteStringToStringMode = iota
+
+ // ByteStringToStringAllowed permits decoding a CBOR byte string into a Go string.
+ ByteStringToStringAllowed
+
+ // ByteStringToStringAllowedWithExpectedLaterEncoding permits decoding a CBOR byte string
+ // into a Go string. Also, if the byte string is enclosed (directly or indirectly) by one of
+ // the "expected later encoding" tags (numbers 21 through 23), the destination string will
+ // be populated by applying the designated text encoding to the contents of the input byte
+ // string.
+ ByteStringToStringAllowedWithExpectedLaterEncoding
+
+ maxByteStringToStringMode
+)
+
+func (bstsm ByteStringToStringMode) valid() bool {
+ return bstsm >= 0 && bstsm < maxByteStringToStringMode
+}
+
+// FieldNameByteStringMode specifies the behavior when decoding a CBOR byte string map key as a Go struct field name.
+type FieldNameByteStringMode int
+
+const (
+ // FieldNameByteStringForbidden generates an error on an attempt to decode a CBOR byte string map key as a Go struct field name.
+ FieldNameByteStringForbidden FieldNameByteStringMode = iota
+
+ // FieldNameByteStringAllowed permits CBOR byte string map keys to be recognized as Go struct field names.
+ FieldNameByteStringAllowed
+
+ maxFieldNameByteStringMode
+)
+
+func (fnbsm FieldNameByteStringMode) valid() bool {
+ return fnbsm >= 0 && fnbsm < maxFieldNameByteStringMode
+}
+
+// UnrecognizedTagToAnyMode specifies how to decode unrecognized CBOR tag into an empty interface (any).
+// Currently, recognized CBOR tag numbers are 0, 1, 2, 3, or registered by TagSet.
+type UnrecognizedTagToAnyMode int
+
+const (
+ // UnrecognizedTagNumAndContentToAny decodes CBOR tag number and tag content to cbor.Tag
+ // when decoding unrecognized CBOR tag into an empty interface.
+ UnrecognizedTagNumAndContentToAny UnrecognizedTagToAnyMode = iota
+
+ // UnrecognizedTagContentToAny decodes only CBOR tag content (into its default type)
+ // when decoding unrecognized CBOR tag into an empty interface.
+ UnrecognizedTagContentToAny
+
+ maxUnrecognizedTagToAny
+)
+
+func (uttam UnrecognizedTagToAnyMode) valid() bool {
+ return uttam >= 0 && uttam < maxUnrecognizedTagToAny
+}
+
+// TimeTagToAnyMode specifies how to decode CBOR tag 0 and 1 into an empty interface (any).
+// Based on the specified mode, Unmarshal can return a time.Time value or a time string in a specific format.
+type TimeTagToAnyMode int
+
+const (
+ // TimeTagToTime decodes CBOR tag 0 and 1 into a time.Time value
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToTime TimeTagToAnyMode = iota
+
+ // TimeTagToRFC3339 decodes CBOR tag 0 and 1 into a time string in RFC3339 format
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToRFC3339
+
+ // TimeTagToRFC3339Nano decodes CBOR tag 0 and 1 into a time string in RFC3339Nano format
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToRFC3339Nano
+
+ maxTimeTagToAnyMode
+)
+
+func (tttam TimeTagToAnyMode) valid() bool {
+ return tttam >= 0 && tttam < maxTimeTagToAnyMode
+}
+
+// SimpleValueRegistry is a registry of unmarshaling behaviors for each possible CBOR simple value
+// number (0...23 and 32...255).
+type SimpleValueRegistry struct {
+ rejected [256]bool
+}
+
+// WithRejectedSimpleValue registers the given simple value as rejected. If the simple value is
+// encountered in a CBOR input during unmarshaling, an UnacceptableDataItemError is returned.
+func WithRejectedSimpleValue(sv SimpleValue) func(*SimpleValueRegistry) error {
+ return func(r *SimpleValueRegistry) error {
+ if sv >= 24 && sv <= 31 {
+ return fmt.Errorf("cbor: cannot set analog for reserved simple value %d", sv)
+ }
+ r.rejected[sv] = true
+ return nil
+ }
+}
+
+// Creates a new SimpleValueRegistry. The registry state is initialized by executing the provided
+// functions in order against a registry that is pre-populated with the defaults for all well-formed
+// simple value numbers.
+func NewSimpleValueRegistryFromDefaults(fns ...func(*SimpleValueRegistry) error) (*SimpleValueRegistry, error) {
+ var r SimpleValueRegistry
+ for _, fn := range fns {
+ if err := fn(&r); err != nil {
+ return nil, err
+ }
+ }
+ return &r, nil
+}
+
+// NaNMode specifies how to decode floating-point values (major type 7, additional information 25
+// through 27) representing NaN (not-a-number).
+type NaNMode int
+
+const (
+ // NaNDecodeAllowed will decode NaN values to Go float32 or float64.
+ NaNDecodeAllowed NaNMode = iota
+
+ // NaNDecodeForbidden will return an UnacceptableDataItemError on an attempt to decode a NaN value.
+ NaNDecodeForbidden
+
+ maxNaNDecode
+)
+
+func (ndm NaNMode) valid() bool {
+ return ndm >= 0 && ndm < maxNaNDecode
+}
+
+// InfMode specifies how to decode floating-point values (major type 7, additional information 25
+// through 27) representing positive or negative infinity.
+type InfMode int
+
+const (
+ // InfDecodeAllowed will decode infinite values to Go float32 or float64.
+ InfDecodeAllowed InfMode = iota
+
+ // InfDecodeForbidden will return an UnacceptableDataItemError on an attempt to decode an
+ // infinite value.
+ InfDecodeForbidden
+
+ maxInfDecode
+)
+
+func (idm InfMode) valid() bool {
+ return idm >= 0 && idm < maxInfDecode
+}
+
+// ByteStringToTimeMode specifies the behavior when decoding a CBOR byte string into a Go time.Time.
+type ByteStringToTimeMode int
+
+const (
+ // ByteStringToTimeForbidden generates an error on an attempt to decode a CBOR byte string into a Go time.Time.
+ ByteStringToTimeForbidden ByteStringToTimeMode = iota
+
+ // ByteStringToTimeAllowed permits decoding a CBOR byte string into a Go time.Time.
+ ByteStringToTimeAllowed
+
+ maxByteStringToTimeMode
+)
+
+func (bttm ByteStringToTimeMode) valid() bool {
+ return bttm >= 0 && bttm < maxByteStringToTimeMode
+}
+
+// ByteStringExpectedFormatMode specifies how to decode CBOR byte string into Go byte slice
+// when the byte string is NOT enclosed in CBOR tag 21, 22, or 23. An error is returned if
+// the CBOR byte string does not contain the expected format (e.g. base64) specified.
+// For tags 21-23, see "Expected Later Encoding for CBOR-to-JSON Converters"
+// in RFC 8949 Section 3.4.5.2.
+type ByteStringExpectedFormatMode int
+
+const (
+ // ByteStringExpectedFormatNone copies the unmodified CBOR byte string into Go byte slice
+ // if the byte string is not tagged by CBOR tag 21-23.
+ ByteStringExpectedFormatNone ByteStringExpectedFormatMode = iota
+
+ // ByteStringExpectedBase64URL expects CBOR byte strings to contain base64url-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base64url-encoded bytes into Go slice.
+ ByteStringExpectedBase64URL
+
+ // ByteStringExpectedBase64 expects CBOR byte strings to contain base64-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base64-encoded bytes into Go slice.
+ ByteStringExpectedBase64
+
+ // ByteStringExpectedBase16 expects CBOR byte strings to contain base16-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base16-encoded bytes into Go slice.
+ ByteStringExpectedBase16
+
+ maxByteStringExpectedFormatMode
+)
+
+func (bsefm ByteStringExpectedFormatMode) valid() bool {
+ return bsefm >= 0 && bsefm < maxByteStringExpectedFormatMode
+}
+
+// BignumTagMode specifies whether or not the "bignum" tags 2 and 3 (RFC 8949 Section 3.4.3) can be
+// decoded.
+type BignumTagMode int
+
+const (
+ // BignumTagAllowed allows bignum tags to be decoded.
+ BignumTagAllowed BignumTagMode = iota
+
+ // BignumTagForbidden produces an UnacceptableDataItemError during Unmarshal if a bignum tag
+ // is encountered in the input.
+ BignumTagForbidden
+
+ maxBignumTag
+)
+
+func (btm BignumTagMode) valid() bool {
+ return btm >= 0 && btm < maxBignumTag
+}
+
+// BinaryUnmarshalerMode specifies how to decode into types that implement
+// encoding.BinaryUnmarshaler.
+type BinaryUnmarshalerMode int
+
+const (
+ // BinaryUnmarshalerByteString will invoke UnmarshalBinary on the contents of a CBOR byte
+ // string when decoding into a value that implements BinaryUnmarshaler.
+ BinaryUnmarshalerByteString BinaryUnmarshalerMode = iota
+
+ // BinaryUnmarshalerNone does not recognize BinaryUnmarshaler implementations during decode.
+ BinaryUnmarshalerNone
+
+ maxBinaryUnmarshalerMode
+)
+
+func (bum BinaryUnmarshalerMode) valid() bool {
+ return bum >= 0 && bum < maxBinaryUnmarshalerMode
+}
+
+// DecOptions specifies decoding options.
+type DecOptions struct {
+ // DupMapKey specifies whether to enforce duplicate map key.
+ DupMapKey DupMapKeyMode
+
+ // TimeTag specifies whether or not untagged data items, or tags other
+ // than tag 0 and tag 1, can be decoded to time.Time. If tag 0 or tag 1
+ // appears in an input, the type of its content is always validated as
+ // specified in RFC 8949. That behavior is not controlled by this
+ // option. The behavior of the supported modes are:
+ //
+ // DecTagIgnored (default): Untagged text strings and text strings
+ // enclosed in tags other than 0 and 1 are decoded as though enclosed
+ // in tag 0. Untagged unsigned integers, negative integers, and
+ // floating-point numbers (or those enclosed in tags other than 0 and
+ // 1) are decoded as though enclosed in tag 1. Decoding a tag other
+ // than 0 or 1 enclosing simple values null or undefined into a
+ // time.Time does not modify the destination value.
+ //
+ // DecTagOptional: Untagged text strings are decoded as though
+ // enclosed in tag 0. Untagged unsigned integers, negative integers,
+ // and floating-point numbers are decoded as though enclosed in tag
+ // 1. Tags other than 0 and 1 will produce an error on attempts to
+ // decode them into a time.Time.
+ //
+ // DecTagRequired: Only tags 0 and 1 can be decoded to time.Time. Any
+ // other input will produce an error.
+ TimeTag DecTagMode
+
+ // MaxNestedLevels specifies the max nested levels allowed for any combination of CBOR array, maps, and tags.
+ // Default is 32 levels and it can be set to [4, 65535]. Note that higher maximum levels of nesting can
+ // require larger amounts of stack to deserialize. Don't increase this higher than you require.
+ MaxNestedLevels int
+
+ // MaxArrayElements specifies the max number of elements for CBOR arrays.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxArrayElements int
+
+ // MaxMapPairs specifies the max number of key-value pairs for CBOR maps.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxMapPairs int
+
+ // IndefLength specifies whether to allow indefinite length CBOR items.
+ IndefLength IndefLengthMode
+
+ // TagsMd specifies whether to allow CBOR tags (major type 6).
+ TagsMd TagsMode
+
+ // IntDec specifies which Go integer type (int64 or uint64) to use
+ // when decoding CBOR int (major type 0 and 1) to Go interface{}.
+ IntDec IntDecMode
+
+ // MapKeyByteString specifies how to decode CBOR byte string as map key
+ // when decoding CBOR map with byte string key into an empty interface value.
+ // By default, an error is returned when attempting to decode CBOR byte string
+ // as map key because Go doesn't allow []byte as map key.
+ MapKeyByteString MapKeyByteStringMode
+
+ // ExtraReturnErrors specifies extra conditions that should be treated as errors.
+ ExtraReturnErrors ExtraDecErrorCond
+
+ // DefaultMapType specifies Go map type to create and decode to
+ // when unmarshalling CBOR into an empty interface value.
+ // By default, unmarshal uses map[interface{}]interface{}.
+ DefaultMapType reflect.Type
+
+ // UTF8 specifies if decoder should decode CBOR Text containing invalid UTF-8.
+ // By default, unmarshal rejects CBOR text containing invalid UTF-8.
+ UTF8 UTF8Mode
+
+ // FieldNameMatching specifies how string keys in CBOR maps are matched to Go struct field names.
+ FieldNameMatching FieldNameMatchingMode
+
+ // BigIntDec specifies how to decode CBOR bignum to Go interface{}.
+ BigIntDec BigIntDecMode
+
+ // DefaultByteStringType is the Go type that should be produced when decoding a CBOR byte
+ // string into an empty interface value. Types to which a []byte is convertible are valid
+ // for this option, except for array and pointer-to-array types. If nil, the default is
+ // []byte.
+ DefaultByteStringType reflect.Type
+
+ // ByteStringToString specifies the behavior when decoding a CBOR byte string into a Go string.
+ ByteStringToString ByteStringToStringMode
+
+ // FieldNameByteString specifies the behavior when decoding a CBOR byte string map key as a
+ // Go struct field name.
+ FieldNameByteString FieldNameByteStringMode
+
+ // UnrecognizedTagToAny specifies how to decode unrecognized CBOR tag into an empty interface.
+ // Currently, recognized CBOR tag numbers are 0, 1, 2, 3, or registered by TagSet.
+ UnrecognizedTagToAny UnrecognizedTagToAnyMode
+
+ // TimeTagToAny specifies how to decode CBOR tag 0 and 1 into an empty interface (any).
+ // Based on the specified mode, Unmarshal can return a time.Time value or a time string in a specific format.
+ TimeTagToAny TimeTagToAnyMode
+
+ // SimpleValues is an immutable mapping from each CBOR simple value to a corresponding
+ // unmarshal behavior. If nil, the simple values false, true, null, and undefined are mapped
+ // to the Go analog values false, true, nil, and nil, respectively, and all other simple
+ // values N (except the reserved simple values 24 through 31) are mapped to
+ // cbor.SimpleValue(N). In other words, all well-formed simple values can be decoded.
+ //
+ // Users may provide a custom SimpleValueRegistry constructed via
+ // NewSimpleValueRegistryFromDefaults.
+ SimpleValues *SimpleValueRegistry
+
+ // NaN specifies how to decode floating-point values (major type 7, additional information
+ // 25 through 27) representing NaN (not-a-number).
+ NaN NaNMode
+
+ // Inf specifies how to decode floating-point values (major type 7, additional information
+ // 25 through 27) representing positive or negative infinity.
+ Inf InfMode
+
+ // ByteStringToTime specifies how to decode CBOR byte string into Go time.Time.
+ ByteStringToTime ByteStringToTimeMode
+
+ // ByteStringExpectedFormat specifies how to decode CBOR byte string into Go byte slice
+ // when the byte string is NOT enclosed in CBOR tag 21, 22, or 23. An error is returned if
+ // the CBOR byte string does not contain the expected format (e.g. base64) specified.
+ // For tags 21-23, see "Expected Later Encoding for CBOR-to-JSON Converters"
+ // in RFC 8949 Section 3.4.5.2.
+ ByteStringExpectedFormat ByteStringExpectedFormatMode
+
+ // BignumTag specifies whether or not the "bignum" tags 2 and 3 (RFC 8949 Section 3.4.3) can
+ // be decoded. Unlike BigIntDec, this option applies to all bignum tags encountered in a
+ // CBOR input, independent of the type of the destination value of a particular Unmarshal
+ // operation.
+ BignumTag BignumTagMode
+
+ // BinaryUnmarshaler specifies how to decode into types that implement
+ // encoding.BinaryUnmarshaler.
+ BinaryUnmarshaler BinaryUnmarshalerMode
+}
+
+// DecMode returns DecMode with immutable options and no tags (safe for concurrency).
+func (opts DecOptions) DecMode() (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.decMode()
+}
+
+// validForTags checks that the provided tag set is compatible with these options and returns a
+// non-nil error if and only if the provided tag set is incompatible.
+func (opts DecOptions) validForTags(tags TagSet) error { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return errors.New("cbor: cannot create DecMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return errors.New("cbor: cannot create DecMode with nil value as TagSet")
+ }
+ if opts.ByteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding ||
+ opts.ByteStringExpectedFormat != ByteStringExpectedFormatNone {
+ for _, tagNum := range []uint64{
+ tagNumExpectedLaterEncodingBase64URL,
+ tagNumExpectedLaterEncodingBase64,
+ tagNumExpectedLaterEncodingBase16,
+ } {
+ if rt := tags.getTypeFromTagNum([]uint64{tagNum}); rt != nil {
+ return fmt.Errorf("cbor: DecMode with non-default StringExpectedEncoding or ByteSliceExpectedEncoding treats tag %d as built-in and conflicts with the provided TagSet's registration of %v", tagNum, rt)
+ }
+ }
+
+ }
+ return nil
+}
+
+// DecModeWithTags returns DecMode with options and tags that are both immutable (safe for concurrency).
+func (opts DecOptions) DecModeWithTags(tags TagSet) (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ if err := opts.validForTags(tags); err != nil {
+ return nil, err
+ }
+ dm, err := opts.decMode()
+ if err != nil {
+ return nil, err
+ }
+
+ // Copy tags
+ ts := tagSet(make(map[reflect.Type]*tagItem))
+ syncTags := tags.(*syncTagSet)
+ syncTags.RLock()
+ for contentType, tag := range syncTags.t {
+ if tag.opts.DecTag != DecTagIgnored {
+ ts[contentType] = tag
+ }
+ }
+ syncTags.RUnlock()
+
+ if len(ts) > 0 {
+ dm.tags = ts
+ }
+
+ return dm, nil
+}
+
+// DecModeWithSharedTags returns DecMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts DecOptions) DecModeWithSharedTags(tags TagSet) (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ if err := opts.validForTags(tags); err != nil {
+ return nil, err
+ }
+ dm, err := opts.decMode()
+ if err != nil {
+ return nil, err
+ }
+ dm.tags = tags
+ return dm, nil
+}
+
+const (
+ defaultMaxArrayElements = 131072
+ minMaxArrayElements = 16
+ maxMaxArrayElements = 2147483647
+
+ defaultMaxMapPairs = 131072
+ minMaxMapPairs = 16
+ maxMaxMapPairs = 2147483647
+
+ defaultMaxNestedLevels = 32
+ minMaxNestedLevels = 4
+ maxMaxNestedLevels = 65535
+)
+
+var defaultSimpleValues = func() *SimpleValueRegistry {
+ registry, err := NewSimpleValueRegistryFromDefaults()
+ if err != nil {
+ panic(err)
+ }
+ return registry
+}()
+
+//nolint:gocyclo // Each option comes with some manageable boilerplate
+func (opts DecOptions) decMode() (*decMode, error) { //nolint:gocritic // ignore hugeParam
+ if !opts.DupMapKey.valid() {
+ return nil, errors.New("cbor: invalid DupMapKey " + strconv.Itoa(int(opts.DupMapKey)))
+ }
+
+ if !opts.TimeTag.valid() {
+ return nil, errors.New("cbor: invalid TimeTag " + strconv.Itoa(int(opts.TimeTag)))
+ }
+
+ if !opts.IndefLength.valid() {
+ return nil, errors.New("cbor: invalid IndefLength " + strconv.Itoa(int(opts.IndefLength)))
+ }
+
+ if !opts.TagsMd.valid() {
+ return nil, errors.New("cbor: invalid TagsMd " + strconv.Itoa(int(opts.TagsMd)))
+ }
+
+ if !opts.IntDec.valid() {
+ return nil, errors.New("cbor: invalid IntDec " + strconv.Itoa(int(opts.IntDec)))
+ }
+
+ if !opts.MapKeyByteString.valid() {
+ return nil, errors.New("cbor: invalid MapKeyByteString " + strconv.Itoa(int(opts.MapKeyByteString)))
+ }
+
+ if opts.MaxNestedLevels == 0 {
+ opts.MaxNestedLevels = defaultMaxNestedLevels
+ } else if opts.MaxNestedLevels < minMaxNestedLevels || opts.MaxNestedLevels > maxMaxNestedLevels {
+ return nil, errors.New("cbor: invalid MaxNestedLevels " + strconv.Itoa(opts.MaxNestedLevels) +
+ " (range is [" + strconv.Itoa(minMaxNestedLevels) + ", " + strconv.Itoa(maxMaxNestedLevels) + "])")
+ }
+
+ if opts.MaxArrayElements == 0 {
+ opts.MaxArrayElements = defaultMaxArrayElements
+ } else if opts.MaxArrayElements < minMaxArrayElements || opts.MaxArrayElements > maxMaxArrayElements {
+ return nil, errors.New("cbor: invalid MaxArrayElements " + strconv.Itoa(opts.MaxArrayElements) +
+ " (range is [" + strconv.Itoa(minMaxArrayElements) + ", " + strconv.Itoa(maxMaxArrayElements) + "])")
+ }
+
+ if opts.MaxMapPairs == 0 {
+ opts.MaxMapPairs = defaultMaxMapPairs
+ } else if opts.MaxMapPairs < minMaxMapPairs || opts.MaxMapPairs > maxMaxMapPairs {
+ return nil, errors.New("cbor: invalid MaxMapPairs " + strconv.Itoa(opts.MaxMapPairs) +
+ " (range is [" + strconv.Itoa(minMaxMapPairs) + ", " + strconv.Itoa(maxMaxMapPairs) + "])")
+ }
+
+ if !opts.ExtraReturnErrors.valid() {
+ return nil, errors.New("cbor: invalid ExtraReturnErrors " + strconv.Itoa(int(opts.ExtraReturnErrors)))
+ }
+
+ if opts.DefaultMapType != nil && opts.DefaultMapType.Kind() != reflect.Map {
+ return nil, fmt.Errorf("cbor: invalid DefaultMapType %s", opts.DefaultMapType)
+ }
+
+ if !opts.UTF8.valid() {
+ return nil, errors.New("cbor: invalid UTF8 " + strconv.Itoa(int(opts.UTF8)))
+ }
+
+ if !opts.FieldNameMatching.valid() {
+ return nil, errors.New("cbor: invalid FieldNameMatching " + strconv.Itoa(int(opts.FieldNameMatching)))
+ }
+
+ if !opts.BigIntDec.valid() {
+ return nil, errors.New("cbor: invalid BigIntDec " + strconv.Itoa(int(opts.BigIntDec)))
+ }
+
+ if opts.DefaultByteStringType != nil &&
+ opts.DefaultByteStringType.Kind() != reflect.String &&
+ (opts.DefaultByteStringType.Kind() != reflect.Slice || opts.DefaultByteStringType.Elem().Kind() != reflect.Uint8) {
+ return nil, fmt.Errorf("cbor: invalid DefaultByteStringType: %s is not of kind string or []uint8", opts.DefaultByteStringType)
+ }
+
+ if !opts.ByteStringToString.valid() {
+ return nil, errors.New("cbor: invalid ByteStringToString " + strconv.Itoa(int(opts.ByteStringToString)))
+ }
+
+ if !opts.FieldNameByteString.valid() {
+ return nil, errors.New("cbor: invalid FieldNameByteString " + strconv.Itoa(int(opts.FieldNameByteString)))
+ }
+
+ if !opts.UnrecognizedTagToAny.valid() {
+ return nil, errors.New("cbor: invalid UnrecognizedTagToAnyMode " + strconv.Itoa(int(opts.UnrecognizedTagToAny)))
+ }
+ simpleValues := opts.SimpleValues
+ if simpleValues == nil {
+ simpleValues = defaultSimpleValues
+ }
+
+ if !opts.TimeTagToAny.valid() {
+ return nil, errors.New("cbor: invalid TimeTagToAny " + strconv.Itoa(int(opts.TimeTagToAny)))
+ }
+
+ if !opts.NaN.valid() {
+ return nil, errors.New("cbor: invalid NaNDec " + strconv.Itoa(int(opts.NaN)))
+ }
+
+ if !opts.Inf.valid() {
+ return nil, errors.New("cbor: invalid InfDec " + strconv.Itoa(int(opts.Inf)))
+ }
+
+ if !opts.ByteStringToTime.valid() {
+ return nil, errors.New("cbor: invalid ByteStringToTime " + strconv.Itoa(int(opts.ByteStringToTime)))
+ }
+
+ if !opts.ByteStringExpectedFormat.valid() {
+ return nil, errors.New("cbor: invalid ByteStringExpectedFormat " + strconv.Itoa(int(opts.ByteStringExpectedFormat)))
+ }
+
+ if !opts.BignumTag.valid() {
+ return nil, errors.New("cbor: invalid BignumTag " + strconv.Itoa(int(opts.BignumTag)))
+ }
+
+ if !opts.BinaryUnmarshaler.valid() {
+ return nil, errors.New("cbor: invalid BinaryUnmarshaler " + strconv.Itoa(int(opts.BinaryUnmarshaler)))
+ }
+
+ dm := decMode{
+ dupMapKey: opts.DupMapKey,
+ timeTag: opts.TimeTag,
+ maxNestedLevels: opts.MaxNestedLevels,
+ maxArrayElements: opts.MaxArrayElements,
+ maxMapPairs: opts.MaxMapPairs,
+ indefLength: opts.IndefLength,
+ tagsMd: opts.TagsMd,
+ intDec: opts.IntDec,
+ mapKeyByteString: opts.MapKeyByteString,
+ extraReturnErrors: opts.ExtraReturnErrors,
+ defaultMapType: opts.DefaultMapType,
+ utf8: opts.UTF8,
+ fieldNameMatching: opts.FieldNameMatching,
+ bigIntDec: opts.BigIntDec,
+ defaultByteStringType: opts.DefaultByteStringType,
+ byteStringToString: opts.ByteStringToString,
+ fieldNameByteString: opts.FieldNameByteString,
+ unrecognizedTagToAny: opts.UnrecognizedTagToAny,
+ timeTagToAny: opts.TimeTagToAny,
+ simpleValues: simpleValues,
+ nanDec: opts.NaN,
+ infDec: opts.Inf,
+ byteStringToTime: opts.ByteStringToTime,
+ byteStringExpectedFormat: opts.ByteStringExpectedFormat,
+ bignumTag: opts.BignumTag,
+ binaryUnmarshaler: opts.BinaryUnmarshaler,
+ }
+
+ return &dm, nil
+}
+
+// DecMode is the main interface for CBOR decoding.
+type DecMode interface {
+ // Unmarshal parses the CBOR-encoded data into the value pointed to by v
+ // using the decoding mode. If v is nil, not a pointer, or a nil pointer,
+ // Unmarshal returns an error.
+ //
+ // See the documentation for Unmarshal for details.
+ Unmarshal(data []byte, v interface{}) error
+
+ // UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+ // using the decoding mode. Any remaining bytes are returned in rest.
+ //
+ // If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+ //
+ // See the documentation for Unmarshal for details.
+ UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error)
+
+ // Valid checks whether data is a well-formed encoded CBOR data item and
+ // that it complies with configurable restrictions such as MaxNestedLevels,
+ // MaxArrayElements, MaxMapPairs, etc.
+ //
+ // If there are any remaining bytes after the CBOR data item,
+ // an ExtraneousDataError is returned.
+ //
+ // WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+ // and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+ //
+ // Deprecated: Valid is kept for compatibility and should not be used.
+ // Use Wellformed instead because it has a more appropriate name.
+ Valid(data []byte) error
+
+ // Wellformed checks whether data is a well-formed encoded CBOR data item and
+ // that it complies with configurable restrictions such as MaxNestedLevels,
+ // MaxArrayElements, MaxMapPairs, etc.
+ //
+ // If there are any remaining bytes after the CBOR data item,
+ // an ExtraneousDataError is returned.
+ Wellformed(data []byte) error
+
+ // NewDecoder returns a new decoder that reads from r using dm DecMode.
+ NewDecoder(r io.Reader) *Decoder
+
+ // DecOptions returns user specified options used to create this DecMode.
+ DecOptions() DecOptions
+}
+
+type decMode struct {
+ tags tagProvider
+ dupMapKey DupMapKeyMode
+ timeTag DecTagMode
+ maxNestedLevels int
+ maxArrayElements int
+ maxMapPairs int
+ indefLength IndefLengthMode
+ tagsMd TagsMode
+ intDec IntDecMode
+ mapKeyByteString MapKeyByteStringMode
+ extraReturnErrors ExtraDecErrorCond
+ defaultMapType reflect.Type
+ utf8 UTF8Mode
+ fieldNameMatching FieldNameMatchingMode
+ bigIntDec BigIntDecMode
+ defaultByteStringType reflect.Type
+ byteStringToString ByteStringToStringMode
+ fieldNameByteString FieldNameByteStringMode
+ unrecognizedTagToAny UnrecognizedTagToAnyMode
+ timeTagToAny TimeTagToAnyMode
+ simpleValues *SimpleValueRegistry
+ nanDec NaNMode
+ infDec InfMode
+ byteStringToTime ByteStringToTimeMode
+ byteStringExpectedFormat ByteStringExpectedFormatMode
+ bignumTag BignumTagMode
+ binaryUnmarshaler BinaryUnmarshalerMode
+}
+
+var defaultDecMode, _ = DecOptions{}.decMode()
+
+// DecOptions returns user specified options used to create this DecMode.
+func (dm *decMode) DecOptions() DecOptions {
+ simpleValues := dm.simpleValues
+ if simpleValues == defaultSimpleValues {
+ // Users can't explicitly set this to defaultSimpleValues. It must have been nil in
+ // the original DecOptions.
+ simpleValues = nil
+ }
+
+ return DecOptions{
+ DupMapKey: dm.dupMapKey,
+ TimeTag: dm.timeTag,
+ MaxNestedLevels: dm.maxNestedLevels,
+ MaxArrayElements: dm.maxArrayElements,
+ MaxMapPairs: dm.maxMapPairs,
+ IndefLength: dm.indefLength,
+ TagsMd: dm.tagsMd,
+ IntDec: dm.intDec,
+ MapKeyByteString: dm.mapKeyByteString,
+ ExtraReturnErrors: dm.extraReturnErrors,
+ DefaultMapType: dm.defaultMapType,
+ UTF8: dm.utf8,
+ FieldNameMatching: dm.fieldNameMatching,
+ BigIntDec: dm.bigIntDec,
+ DefaultByteStringType: dm.defaultByteStringType,
+ ByteStringToString: dm.byteStringToString,
+ FieldNameByteString: dm.fieldNameByteString,
+ UnrecognizedTagToAny: dm.unrecognizedTagToAny,
+ TimeTagToAny: dm.timeTagToAny,
+ SimpleValues: simpleValues,
+ NaN: dm.nanDec,
+ Inf: dm.infDec,
+ ByteStringToTime: dm.byteStringToTime,
+ ByteStringExpectedFormat: dm.byteStringExpectedFormat,
+ BignumTag: dm.bignumTag,
+ BinaryUnmarshaler: dm.binaryUnmarshaler,
+ }
+}
+
+// Unmarshal parses the CBOR-encoded data into the value pointed to by v
+// using dm decoding mode. If v is nil, not a pointer, or a nil pointer,
+// Unmarshal returns an error.
+//
+// See the documentation for Unmarshal for details.
+func (dm *decMode) Unmarshal(data []byte, v interface{}) error {
+ d := decoder{data: data, dm: dm}
+
+ // Check well-formedness.
+ off := d.off // Save offset before data validation
+ err := d.wellformed(false, false) // don't allow any extra data after valid data item.
+ d.off = off // Restore offset
+ if err != nil {
+ return err
+ }
+
+ return d.value(v)
+}
+
+// UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+// using dm decoding mode. Any remaining bytes are returned in rest.
+//
+// If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+//
+// See the documentation for Unmarshal for details.
+func (dm *decMode) UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error) {
+ d := decoder{data: data, dm: dm}
+
+ // check well-formedness.
+ off := d.off // Save offset before data validation
+ err = d.wellformed(true, false) // allow extra data after well-formed data item
+ d.off = off // Restore offset
+
+ // If it is well-formed, parse the value. This is structured like this to allow
+ // better test coverage
+ if err == nil {
+ err = d.value(v)
+ }
+
+ // If either wellformed or value returned an error, do not return rest bytes
+ if err != nil {
+ return nil, err
+ }
+
+ // Return the rest of the data slice (which might be len 0)
+ return d.data[d.off:], nil
+}
+
+// Valid checks whether data is a well-formed encoded CBOR data item and
+// that it complies with configurable restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+//
+// WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+// and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+//
+// Deprecated: Valid is kept for compatibility and should not be used.
+// Use Wellformed instead because it has a more appropriate name.
+func (dm *decMode) Valid(data []byte) error {
+ return dm.Wellformed(data)
+}
+
+// Wellformed checks whether data is a well-formed encoded CBOR data item and
+// that it complies with configurable restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+func (dm *decMode) Wellformed(data []byte) error {
+ d := decoder{data: data, dm: dm}
+ return d.wellformed(false, false)
+}
+
+// NewDecoder returns a new decoder that reads from r using dm DecMode.
+func (dm *decMode) NewDecoder(r io.Reader) *Decoder {
+ return &Decoder{r: r, d: decoder{dm: dm}}
+}
+
+type decoder struct {
+ data []byte
+ off int // next read offset in data
+ dm *decMode
+
+ // expectedLaterEncodingTags stores a stack of encountered "Expected Later Encoding" tags,
+ // if any.
+ //
+ // The "Expected Later Encoding" tags (21 to 23) are valid for any data item. When decoding
+ // byte strings, the effective encoding comes from the tag nearest to the byte string being
+ // decoded. For example, the effective encoding of the byte string 21(22(h'41')) would be
+ // controlled by tag 22,and in the data item 23(h'42', 22([21(h'43')])]) the effective
+ // encoding of the byte strings h'42' and h'43' would be controlled by tag 23 and 21,
+ // respectively.
+ expectedLaterEncodingTags []uint64
+}
+
+// value decodes CBOR data item into the value pointed to by v.
+// If CBOR data item fails to be decoded into v,
+// error is returned and offset is moved to the next CBOR data item.
+// Precondition: d.data contains at least one well-formed CBOR data item.
+func (d *decoder) value(v interface{}) error {
+ // v can't be nil, non-pointer, or nil pointer value.
+ if v == nil {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(nil)"}
+ }
+ rv := reflect.ValueOf(v)
+ if rv.Kind() != reflect.Ptr {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(non-pointer " + rv.Type().String() + ")"}
+ } else if rv.IsNil() {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(nil " + rv.Type().String() + ")"}
+ }
+ rv = rv.Elem()
+ return d.parseToValue(rv, getTypeInfo(rv.Type()))
+}
+
+// parseToValue decodes CBOR data to value. It assumes data is well-formed,
+// and does not perform bounds checking.
+func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+
+ // Decode CBOR nil or CBOR undefined to pointer value by setting pointer value to nil.
+ if d.nextCBORNil() && v.Kind() == reflect.Ptr {
+ d.skip()
+ v.Set(reflect.Zero(v.Type()))
+ return nil
+ }
+
+ if tInfo.spclType == specialTypeIface {
+ if !v.IsNil() {
+ // Use value type
+ v = v.Elem()
+ tInfo = getTypeInfo(v.Type())
+ } else { //nolint:gocritic
+ // Create and use registered type if CBOR data is registered tag
+ if d.dm.tags != nil && d.nextCBORType() == cborTypeTag {
+
+ off := d.off
+ var tagNums []uint64
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ tagNums = append(tagNums, tagNum)
+ }
+ d.off = off
+
+ registeredType := d.dm.tags.getTypeFromTagNum(tagNums)
+ if registeredType != nil {
+ if registeredType.Implements(tInfo.nonPtrType) ||
+ reflect.PtrTo(registeredType).Implements(tInfo.nonPtrType) {
+ v.Set(reflect.New(registeredType))
+ v = v.Elem()
+ tInfo = getTypeInfo(registeredType)
+ }
+ }
+ }
+ }
+ }
+
+ // Create new value for the pointer v to point to.
+ // At this point, CBOR value is not nil/undefined if v is a pointer.
+ for v.Kind() == reflect.Ptr {
+ if v.IsNil() {
+ if !v.CanSet() {
+ d.skip()
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ }
+ v = v.Elem()
+ }
+
+ // Strip self-described CBOR tag number.
+ for d.nextCBORType() == cborTypeTag {
+ off := d.off
+ _, _, tagNum := d.getHead()
+ if tagNum != tagNumSelfDescribedCBOR {
+ d.off = off
+ break
+ }
+ }
+
+ // Check validity of supported built-in tags.
+ off := d.off
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ if err := validBuiltinTag(tagNum, d.data[d.off]); err != nil {
+ d.skip()
+ return err
+ }
+ }
+ d.off = off
+
+ if tInfo.spclType != specialTypeNone {
+ switch tInfo.spclType {
+ case specialTypeEmptyIface:
+ iv, err := d.parse(false) // Skipped self-described CBOR tag number already.
+ if iv != nil {
+ v.Set(reflect.ValueOf(iv))
+ }
+ return err
+
+ case specialTypeTag:
+ return d.parseToTag(v)
+
+ case specialTypeTime:
+ if d.nextCBORNil() {
+ // Decoding CBOR null and undefined to time.Time is no-op.
+ d.skip()
+ return nil
+ }
+ tm, ok, err := d.parseToTime()
+ if err != nil {
+ return err
+ }
+ if ok {
+ v.Set(reflect.ValueOf(tm))
+ }
+ return nil
+
+ case specialTypeUnmarshalerIface:
+ return d.parseToUnmarshaler(v)
+ }
+ }
+
+ // Check registered tag number
+ if tagItem := d.getRegisteredTagItem(tInfo.nonPtrType); tagItem != nil {
+ t := d.nextCBORType()
+ if t != cborTypeTag {
+ if tagItem.opts.DecTag == DecTagRequired {
+ d.skip() // Required tag number is absent, skip entire tag
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.typ.String(),
+ errorMsg: "expect CBOR tag value"}
+ }
+ } else if err := d.validRegisteredTagNums(tagItem); err != nil {
+ d.skip() // Skip tag content
+ return err
+ }
+ }
+
+ t := d.nextCBORType()
+
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+ return fillPositiveInt(t, val, v)
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ // CBOR negative integer overflows int64, use big.Int to store value.
+ bi := new(big.Int)
+ bi.SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows Go's int64",
+ }
+ }
+ nValue := int64(-1) ^ int64(val)
+ return fillNegativeInt(t, nValue, v)
+
+ case cborTypeByteString:
+ b, copied := d.parseByteString()
+ b, converted, err := d.applyByteStringTextConversion(b, v.Type())
+ if err != nil {
+ return err
+ }
+ copied = copied || converted
+ return fillByteString(t, b, !copied, v, d.dm.byteStringToString, d.dm.binaryUnmarshaler)
+
+ case cborTypeTextString:
+ b, err := d.parseTextString()
+ if err != nil {
+ return err
+ }
+ return fillTextString(t, b, v)
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ switch ai {
+ case additionalInformationAsFloat16:
+ f := float64(float16.Frombits(uint16(val)).Float32())
+ return fillFloat(t, f, v)
+
+ case additionalInformationAsFloat32:
+ f := float64(math.Float32frombits(uint32(val)))
+ return fillFloat(t, f, v)
+
+ case additionalInformationAsFloat64:
+ f := math.Float64frombits(val)
+ return fillFloat(t, f, v)
+
+ default: // ai <= 24
+ if d.dm.simpleValues.rejected[SimpleValue(val)] {
+ return &UnacceptableDataItemError{
+ CBORType: t.String(),
+ Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized",
+ }
+ }
+
+ switch ai {
+ case additionalInformationAsFalse,
+ additionalInformationAsTrue:
+ return fillBool(t, ai == additionalInformationAsTrue, v)
+
+ case additionalInformationAsNull,
+ additionalInformationAsUndefined:
+ return fillNil(t, v)
+
+ default:
+ return fillPositiveInt(t, val, v)
+ }
+ }
+
+ case cborTypeTag:
+ _, _, tagNum := d.getHead()
+ switch tagNum {
+ case tagNumUnsignedBignum:
+ // Bignum (tag 2) can be decoded to uint, int, float, slice, array, or big.Int.
+ b, copied := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ }
+ if bi.IsUint64() {
+ return fillPositiveInt(t, bi.Uint64(), v)
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows " + v.Type().String(),
+ }
+
+ case tagNumNegativeBignum:
+ // Bignum (tag 3) can be decoded to int, float, slice, array, or big.Int.
+ b, copied := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ }
+ if bi.IsInt64() {
+ return fillNegativeInt(t, bi.Int64(), v)
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows " + v.Type().String(),
+ }
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // If conversion for interoperability with text encodings is not configured,
+ // treat tags 21-23 as unregistered tags.
+ if d.dm.byteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding || d.dm.byteStringExpectedFormat != ByteStringExpectedFormatNone {
+ d.expectedLaterEncodingTags = append(d.expectedLaterEncodingTags, tagNum)
+ defer func() {
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:len(d.expectedLaterEncodingTags)-1]
+ }()
+ }
+ }
+
+ return d.parseToValue(v, tInfo)
+
+ case cborTypeArray:
+ if tInfo.nonPtrKind == reflect.Slice {
+ return d.parseArrayToSlice(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Array {
+ return d.parseArrayToArray(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Struct {
+ return d.parseArrayToStruct(v, tInfo)
+ }
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: tInfo.nonPtrType.String()}
+
+ case cborTypeMap:
+ if tInfo.nonPtrKind == reflect.Struct {
+ return d.parseMapToStruct(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Map {
+ return d.parseMapToMap(v, tInfo)
+ }
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: tInfo.nonPtrType.String()}
+ }
+
+ return nil
+}
+
+func (d *decoder) parseToTag(v reflect.Value) error {
+ if d.nextCBORNil() {
+ // Decoding CBOR null and undefined to cbor.Tag is no-op.
+ d.skip()
+ return nil
+ }
+
+ t := d.nextCBORType()
+ if t != cborTypeTag {
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: typeTag.String()}
+ }
+
+ // Unmarshal tag number
+ _, _, num := d.getHead()
+
+ // Unmarshal tag content
+ content, err := d.parse(false)
+ if err != nil {
+ return err
+ }
+
+ v.Set(reflect.ValueOf(Tag{num, content}))
+ return nil
+}
+
+// parseToTime decodes the current data item as a time.Time. The bool return value is false if and
+// only if the destination value should remain unmodified.
+func (d *decoder) parseToTime() (time.Time, bool, error) {
+ // Verify that tag number or absence of tag number is acceptable to specified timeTag.
+ if t := d.nextCBORType(); t == cborTypeTag {
+ if d.dm.timeTag == DecTagIgnored {
+ // Skip all enclosing tags
+ for t == cborTypeTag {
+ d.getHead()
+ t = d.nextCBORType()
+ }
+ if d.nextCBORNil() {
+ d.skip()
+ return time.Time{}, false, nil
+ }
+ } else {
+ // Read tag number
+ _, _, tagNum := d.getHead()
+ if tagNum != 0 && tagNum != 1 {
+ d.skip() // skip tag content
+ return time.Time{}, false, errors.New("cbor: wrong tag number for time.Time, got " + strconv.Itoa(int(tagNum)) + ", expect 0 or 1")
+ }
+ }
+ } else {
+ if d.dm.timeTag == DecTagRequired {
+ d.skip()
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String(), errorMsg: "expect CBOR tag value"}
+ }
+ }
+
+ switch t := d.nextCBORType(); t {
+ case cborTypeByteString:
+ if d.dm.byteStringToTime == ByteStringToTimeAllowed {
+ b, _ := d.parseByteString()
+ t, err := time.Parse(time.RFC3339, string(b))
+ if err != nil {
+ return time.Time{}, false, fmt.Errorf("cbor: cannot set %q for time.Time: %w", string(b), err)
+ }
+ return t, true, nil
+ }
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+
+ case cborTypeTextString:
+ s, err := d.parseTextString()
+ if err != nil {
+ return time.Time{}, false, err
+ }
+ t, err := time.Parse(time.RFC3339, string(s))
+ if err != nil {
+ return time.Time{}, false, errors.New("cbor: cannot set " + string(s) + " for time.Time: " + err.Error())
+ }
+ return t, true, nil
+
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: fmt.Sprintf("%d overflows Go's int64", val),
+ }
+ }
+ return time.Unix(int64(val), 0), true, nil
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ if val == math.MaxUint64 {
+ // Maximum absolute value representable by negative integer is 2^64,
+ // not 2^64-1, so it overflows uint64.
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: "-18446744073709551616 overflows Go's int64",
+ }
+ }
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: fmt.Sprintf("-%d overflows Go's int64", val+1),
+ }
+ }
+ return time.Unix(int64(-1)^int64(val), 0), true, nil
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ var f float64
+ switch ai {
+ case additionalInformationAsFloat16:
+ f = float64(float16.Frombits(uint16(val)).Float32())
+
+ case additionalInformationAsFloat32:
+ f = float64(math.Float32frombits(uint32(val)))
+
+ case additionalInformationAsFloat64:
+ f = math.Float64frombits(val)
+
+ default:
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+ }
+
+ if math.IsNaN(f) || math.IsInf(f, 0) {
+ // https://www.rfc-editor.org/rfc/rfc8949.html#section-3.4.2-6
+ return time.Time{}, true, nil
+ }
+ seconds, fractional := math.Modf(f)
+ return time.Unix(int64(seconds), int64(fractional*1e9)), true, nil
+
+ default:
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+ }
+}
+
+// parseToUnmarshaler parses CBOR data to value implementing Unmarshaler interface.
+// It assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) parseToUnmarshaler(v reflect.Value) error {
+ if d.nextCBORNil() && v.Kind() == reflect.Ptr && v.IsNil() {
+ d.skip()
+ return nil
+ }
+
+ if v.Kind() != reflect.Ptr && v.CanAddr() {
+ v = v.Addr()
+ }
+ if u, ok := v.Interface().(Unmarshaler); ok {
+ start := d.off
+ d.skip()
+ return u.UnmarshalCBOR(d.data[start:d.off])
+ }
+ d.skip()
+ return errors.New("cbor: failed to assert " + v.Type().String() + " as cbor.Unmarshaler")
+}
+
+// parse parses CBOR data and returns value in default Go type.
+// It assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) parse(skipSelfDescribedTag bool) (interface{}, error) { //nolint:gocyclo
+ // Strip self-described CBOR tag number.
+ if skipSelfDescribedTag {
+ for d.nextCBORType() == cborTypeTag {
+ off := d.off
+ _, _, tagNum := d.getHead()
+ if tagNum != tagNumSelfDescribedCBOR {
+ d.off = off
+ break
+ }
+ }
+ }
+
+ // Check validity of supported built-in tags.
+ off := d.off
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ if err := validBuiltinTag(tagNum, d.data[d.off]); err != nil {
+ d.skip()
+ return nil, err
+ }
+ }
+ d.off = off
+
+ t := d.nextCBORType()
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+
+ switch d.dm.intDec {
+ case IntDecConvertNone:
+ return val, nil
+
+ case IntDecConvertSigned, IntDecConvertSignedOrFail:
+ if val > math.MaxInt64 {
+ return nil, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows Go's int64",
+ }
+ }
+
+ return int64(val), nil
+
+ case IntDecConvertSignedOrBigInt:
+ if val > math.MaxInt64 {
+ bi := new(big.Int).SetUint64(val)
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+ }
+
+ return int64(val), nil
+
+ default:
+ // not reachable
+ }
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+
+ if val > math.MaxInt64 {
+ // CBOR negative integer value overflows Go int64, use big.Int instead.
+ bi := new(big.Int).SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if d.dm.intDec == IntDecConvertSignedOrFail {
+ return nil, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: bi.String() + " overflows Go's int64",
+ }
+ }
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+ }
+
+ nValue := int64(-1) ^ int64(val)
+ return nValue, nil
+
+ case cborTypeByteString:
+ b, copied := d.parseByteString()
+ var effectiveByteStringType = d.dm.defaultByteStringType
+ if effectiveByteStringType == nil {
+ effectiveByteStringType = typeByteSlice
+ }
+ b, converted, err := d.applyByteStringTextConversion(b, effectiveByteStringType)
+ if err != nil {
+ return nil, err
+ }
+ copied = copied || converted
+
+ switch effectiveByteStringType {
+ case typeByteSlice:
+ if copied {
+ return b, nil
+ }
+ clone := make([]byte, len(b))
+ copy(clone, b)
+ return clone, nil
+
+ case typeString:
+ return string(b), nil
+
+ default:
+ if copied || d.dm.defaultByteStringType.Kind() == reflect.String {
+ // Avoid an unnecessary copy since the conversion to string must
+ // copy the underlying bytes.
+ return reflect.ValueOf(b).Convert(d.dm.defaultByteStringType).Interface(), nil
+ }
+ clone := make([]byte, len(b))
+ copy(clone, b)
+ return reflect.ValueOf(clone).Convert(d.dm.defaultByteStringType).Interface(), nil
+ }
+
+ case cborTypeTextString:
+ b, err := d.parseTextString()
+ if err != nil {
+ return nil, err
+ }
+ return string(b), nil
+
+ case cborTypeTag:
+ tagOff := d.off
+ _, _, tagNum := d.getHead()
+ contentOff := d.off
+
+ switch tagNum {
+ case tagNumRFC3339Time, tagNumEpochTime:
+ d.off = tagOff
+ tm, _, err := d.parseToTime()
+ if err != nil {
+ return nil, err
+ }
+
+ switch d.dm.timeTagToAny {
+ case TimeTagToTime:
+ return tm, nil
+
+ case TimeTagToRFC3339:
+ if tagNum == 1 {
+ tm = tm.UTC()
+ }
+ // Call time.MarshalText() to format decoded time to RFC3339 format,
+ // and return error on time value that cannot be represented in
+ // RFC3339 format. E.g. year cannot exceed 9999, etc.
+ text, err := tm.Truncate(time.Second).MarshalText()
+ if err != nil {
+ return nil, fmt.Errorf("cbor: decoded time cannot be represented in RFC3339 format: %v", err)
+ }
+ return string(text), nil
+
+ case TimeTagToRFC3339Nano:
+ if tagNum == 1 {
+ tm = tm.UTC()
+ }
+ // Call time.MarshalText() to format decoded time to RFC3339 format,
+ // and return error on time value that cannot be represented in
+ // RFC3339 format with sub-second precision.
+ text, err := tm.MarshalText()
+ if err != nil {
+ return nil, fmt.Errorf("cbor: decoded time cannot be represented in RFC3339 format with sub-second precision: %v", err)
+ }
+ return string(text), nil
+
+ default:
+ // not reachable
+ }
+
+ case tagNumUnsignedBignum:
+ b, _ := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+
+ case tagNumNegativeBignum:
+ b, _ := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // If conversion for interoperability with text encodings is not configured,
+ // treat tags 21-23 as unregistered tags.
+ if d.dm.byteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding ||
+ d.dm.byteStringExpectedFormat != ByteStringExpectedFormatNone {
+ d.expectedLaterEncodingTags = append(d.expectedLaterEncodingTags, tagNum)
+ defer func() {
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:len(d.expectedLaterEncodingTags)-1]
+ }()
+ return d.parse(false)
+ }
+ }
+
+ if d.dm.tags != nil {
+ // Parse to specified type if tag number is registered.
+ tagNums := []uint64{tagNum}
+ for d.nextCBORType() == cborTypeTag {
+ _, _, num := d.getHead()
+ tagNums = append(tagNums, num)
+ }
+ registeredType := d.dm.tags.getTypeFromTagNum(tagNums)
+ if registeredType != nil {
+ d.off = tagOff
+ rv := reflect.New(registeredType)
+ if err := d.parseToValue(rv.Elem(), getTypeInfo(registeredType)); err != nil {
+ return nil, err
+ }
+ return rv.Elem().Interface(), nil
+ }
+ }
+
+ // Parse tag content
+ d.off = contentOff
+ content, err := d.parse(false)
+ if err != nil {
+ return nil, err
+ }
+ if d.dm.unrecognizedTagToAny == UnrecognizedTagContentToAny {
+ return content, nil
+ }
+ return Tag{tagNum, content}, nil
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ if ai <= 24 && d.dm.simpleValues.rejected[SimpleValue(val)] {
+ return nil, &UnacceptableDataItemError{
+ CBORType: t.String(),
+ Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized",
+ }
+ }
+ if ai < 20 || ai == 24 {
+ return SimpleValue(val), nil
+ }
+
+ switch ai {
+ case additionalInformationAsFalse,
+ additionalInformationAsTrue:
+ return (ai == additionalInformationAsTrue), nil
+
+ case additionalInformationAsNull,
+ additionalInformationAsUndefined:
+ return nil, nil
+
+ case additionalInformationAsFloat16:
+ f := float64(float16.Frombits(uint16(val)).Float32())
+ return f, nil
+
+ case additionalInformationAsFloat32:
+ f := float64(math.Float32frombits(uint32(val)))
+ return f, nil
+
+ case additionalInformationAsFloat64:
+ f := math.Float64frombits(val)
+ return f, nil
+ }
+
+ case cborTypeArray:
+ return d.parseArray()
+
+ case cborTypeMap:
+ if d.dm.defaultMapType != nil {
+ m := reflect.New(d.dm.defaultMapType)
+ err := d.parseToValue(m, getTypeInfo(m.Elem().Type()))
+ if err != nil {
+ return nil, err
+ }
+ return m.Elem().Interface(), nil
+ }
+ return d.parseMap()
+ }
+
+ return nil, nil
+}
+
+// parseByteString parses a CBOR encoded byte string. The returned byte slice
+// may be backed directly by the input. The second return value will be true if
+// and only if the slice is backed by a copy of the input. Callers are
+// responsible for making a copy if necessary.
+func (d *decoder) parseByteString() ([]byte, bool) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ if !indefiniteLength {
+ b := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ return b, false
+ }
+ // Process indefinite length string chunks.
+ b := []byte{}
+ for !d.foundBreak() {
+ _, _, val = d.getHead()
+ b = append(b, d.data[d.off:d.off+int(val)]...)
+ d.off += int(val)
+ }
+ return b, true
+}
+
+// applyByteStringTextConversion converts bytes read from a byte string to or from a configured text
+// encoding. If no transformation was performed (because it was not required), the original byte
+// slice is returned and the bool return value is false. Otherwise, a new slice containing the
+// converted bytes is returned along with the bool value true.
+func (d *decoder) applyByteStringTextConversion(
+ src []byte,
+ dstType reflect.Type,
+) (
+ dst []byte,
+ transformed bool,
+ err error,
+) {
+ switch dstType.Kind() {
+ case reflect.String:
+ if d.dm.byteStringToString != ByteStringToStringAllowedWithExpectedLaterEncoding || len(d.expectedLaterEncodingTags) == 0 {
+ return src, false, nil
+ }
+
+ switch d.expectedLaterEncodingTags[len(d.expectedLaterEncodingTags)-1] {
+ case tagNumExpectedLaterEncodingBase64URL:
+ encoded := make([]byte, base64.RawURLEncoding.EncodedLen(len(src)))
+ base64.RawURLEncoding.Encode(encoded, src)
+ return encoded, true, nil
+
+ case tagNumExpectedLaterEncodingBase64:
+ encoded := make([]byte, base64.StdEncoding.EncodedLen(len(src)))
+ base64.StdEncoding.Encode(encoded, src)
+ return encoded, true, nil
+
+ case tagNumExpectedLaterEncodingBase16:
+ encoded := make([]byte, hex.EncodedLen(len(src)))
+ hex.Encode(encoded, src)
+ return encoded, true, nil
+
+ default:
+ // If this happens, there is a bug: the decoder has pushed an invalid
+ // "expected later encoding" tag to the stack.
+ panic(fmt.Sprintf("unrecognized expected later encoding tag: %d", d.expectedLaterEncodingTags))
+ }
+
+ case reflect.Slice:
+ if dstType.Elem().Kind() != reflect.Uint8 || len(d.expectedLaterEncodingTags) > 0 {
+ // Either the destination is not a slice of bytes, or the encoder that
+ // produced the input indicated an expected text encoding tag and therefore
+ // the content of the byte string has NOT been text encoded.
+ return src, false, nil
+ }
+
+ switch d.dm.byteStringExpectedFormat {
+ case ByteStringExpectedBase64URL:
+ decoded := make([]byte, base64.RawURLEncoding.DecodedLen(len(src)))
+ n, err := base64.RawURLEncoding.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase64URL, err)
+ }
+ return decoded[:n], true, nil
+
+ case ByteStringExpectedBase64:
+ decoded := make([]byte, base64.StdEncoding.DecodedLen(len(src)))
+ n, err := base64.StdEncoding.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase64, err)
+ }
+ return decoded[:n], true, nil
+
+ case ByteStringExpectedBase16:
+ decoded := make([]byte, hex.DecodedLen(len(src)))
+ n, err := hex.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase16, err)
+ }
+ return decoded[:n], true, nil
+ }
+ }
+
+ return src, false, nil
+}
+
+// parseTextString parses CBOR encoded text string. It returns a byte slice
+// to prevent creating an extra copy of string. Caller should wrap returned
+// byte slice as string when needed.
+func (d *decoder) parseTextString() ([]byte, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ if !indefiniteLength {
+ b := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(b) {
+ return nil, &SemanticError{"cbor: invalid UTF-8 string"}
+ }
+ return b, nil
+ }
+ // Process indefinite length string chunks.
+ b := []byte{}
+ for !d.foundBreak() {
+ _, _, val = d.getHead()
+ x := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(x) {
+ for !d.foundBreak() {
+ d.skip() // Skip remaining chunk on error
+ }
+ return nil, &SemanticError{"cbor: invalid UTF-8 string"}
+ }
+ b = append(b, x...)
+ }
+ return b, nil
+}
+
+func (d *decoder) parseArray() ([]interface{}, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance
+ }
+ v := make([]interface{}, count)
+ var e interface{}
+ var err, lastErr error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ if e, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+ v[i] = e
+ }
+ return v, err
+}
+
+func (d *decoder) parseArrayToSlice(v reflect.Value, tInfo *typeInfo) error {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance
+ }
+ if v.IsNil() || v.Cap() < count || count == 0 {
+ v.Set(reflect.MakeSlice(tInfo.nonPtrType, count, count))
+ }
+ v.SetLen(count)
+ var err error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ if lastErr := d.parseToValue(v.Index(i), tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseArrayToArray(v reflect.Value, tInfo *typeInfo) error {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ gi := 0
+ vLen := v.Len()
+ var err error
+ for ci := 0; (hasSize && ci < count) || (!hasSize && !d.foundBreak()); ci++ {
+ if gi < vLen {
+ // Read CBOR array element and set array element
+ if lastErr := d.parseToValue(v.Index(gi), tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ }
+ gi++
+ } else {
+ d.skip() // Skip remaining CBOR array element
+ }
+ }
+ // Set remaining Go array elements to zero values.
+ if gi < vLen {
+ zeroV := reflect.Zero(tInfo.elemTypeInfo.typ)
+ for ; gi < vLen; gi++ {
+ v.Index(gi).Set(zeroV)
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseMap() (interface{}, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ m := make(map[interface{}]interface{})
+ var k, e interface{}
+ var err, lastErr error
+ keyCount := 0
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ // Parse CBOR map key.
+ if k, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip()
+ continue
+ }
+
+ // Detect if CBOR map key can be used as Go map key.
+ rv := reflect.ValueOf(k)
+ if !isHashableValue(rv) {
+ var converted bool
+ if d.dm.mapKeyByteString == MapKeyByteStringAllowed {
+ k, converted = convertByteSliceToByteString(k)
+ }
+ if !converted {
+ if err == nil {
+ err = &InvalidMapKeyTypeError{rv.Type().String()}
+ }
+ d.skip()
+ continue
+ }
+ }
+
+ // Parse CBOR map value.
+ if e, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+
+ // Add key-value pair to Go map.
+ m[k] = e
+
+ // Detect duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ newKeyCount := len(m)
+ if newKeyCount == keyCount {
+ m[k] = nil
+ err = &DupMapKeyError{k, i}
+ i++
+ // skip the rest of the map
+ for ; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ d.skip() // Skip map key
+ d.skip() // Skip map value
+ }
+ return m, err
+ }
+ keyCount = newKeyCount
+ }
+ }
+ return m, err
+}
+
+func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if v.IsNil() {
+ mapsize := count
+ if !hasSize {
+ mapsize = 0
+ }
+ v.Set(reflect.MakeMapWithSize(tInfo.nonPtrType, mapsize))
+ }
+ keyType, eleType := tInfo.keyTypeInfo.typ, tInfo.elemTypeInfo.typ
+ reuseKey, reuseEle := isImmutableKind(tInfo.keyTypeInfo.kind), isImmutableKind(tInfo.elemTypeInfo.kind)
+ var keyValue, eleValue, zeroKeyValue, zeroEleValue reflect.Value
+ keyIsInterfaceType := keyType == typeIntf // If key type is interface{}, need to check if key value is hashable.
+ var err, lastErr error
+ keyCount := v.Len()
+ var existingKeys map[interface{}]bool // Store existing map keys, used for detecting duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ existingKeys = make(map[interface{}]bool, keyCount)
+ if keyCount > 0 {
+ vKeys := v.MapKeys()
+ for i := 0; i < len(vKeys); i++ {
+ existingKeys[vKeys[i].Interface()] = true
+ }
+ }
+ }
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ // Parse CBOR map key.
+ if !keyValue.IsValid() {
+ keyValue = reflect.New(keyType).Elem()
+ } else if !reuseKey {
+ if !zeroKeyValue.IsValid() {
+ zeroKeyValue = reflect.Zero(keyType)
+ }
+ keyValue.Set(zeroKeyValue)
+ }
+ if lastErr = d.parseToValue(keyValue, tInfo.keyTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip()
+ continue
+ }
+
+ // Detect if CBOR map key can be used as Go map key.
+ if keyIsInterfaceType && keyValue.Elem().IsValid() {
+ if !isHashableValue(keyValue.Elem()) {
+ var converted bool
+ if d.dm.mapKeyByteString == MapKeyByteStringAllowed {
+ var k interface{}
+ k, converted = convertByteSliceToByteString(keyValue.Elem().Interface())
+ if converted {
+ keyValue.Set(reflect.ValueOf(k))
+ }
+ }
+ if !converted {
+ if err == nil {
+ err = &InvalidMapKeyTypeError{keyValue.Elem().Type().String()}
+ }
+ d.skip()
+ continue
+ }
+ }
+ }
+
+ // Parse CBOR map value.
+ if !eleValue.IsValid() {
+ eleValue = reflect.New(eleType).Elem()
+ } else if !reuseEle {
+ if !zeroEleValue.IsValid() {
+ zeroEleValue = reflect.Zero(eleType)
+ }
+ eleValue.Set(zeroEleValue)
+ }
+ if lastErr := d.parseToValue(eleValue, tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+
+ // Add key-value pair to Go map.
+ v.SetMapIndex(keyValue, eleValue)
+
+ // Detect duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ newKeyCount := v.Len()
+ if newKeyCount == keyCount {
+ kvi := keyValue.Interface()
+ if !existingKeys[kvi] {
+ v.SetMapIndex(keyValue, reflect.New(eleType).Elem())
+ err = &DupMapKeyError{kvi, i}
+ i++
+ // skip the rest of the map
+ for ; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ d.skip() // skip map key
+ d.skip() // skip map value
+ }
+ return err
+ }
+ delete(existingKeys, kvi)
+ }
+ keyCount = newKeyCount
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseArrayToStruct(v reflect.Value, tInfo *typeInfo) error {
+ structType := getDecodingStructType(tInfo.nonPtrType)
+ if structType.err != nil {
+ return structType.err
+ }
+
+ if !structType.toArray {
+ t := d.nextCBORType()
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: "cannot decode CBOR array to struct without toarray option",
+ }
+ }
+
+ start := d.off
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size
+ }
+ if count != len(structType.fields) {
+ d.off = start
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: cborTypeArray.String(),
+ GoType: tInfo.typ.String(),
+ errorMsg: "cannot decode CBOR array to struct with different number of elements",
+ }
+ }
+ var err, lastErr error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ f := structType.fields[i]
+
+ // Get field value by index
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ fv, lastErr = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) {
+ // Return a new value for embedded field null pointer to point to, or return error.
+ if !v.CanSet() {
+ return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ return v, nil
+ })
+ if lastErr != nil && err == nil {
+ err = lastErr
+ }
+ if !fv.IsValid() {
+ d.skip()
+ continue
+ }
+ }
+
+ if lastErr = d.parseToValue(fv, f.typInfo); lastErr != nil {
+ if err == nil {
+ if typeError, ok := lastErr.(*UnmarshalTypeError); ok {
+ typeError.StructFieldName = tInfo.typ.String() + "." + f.name
+ err = typeError
+ } else {
+ err = lastErr
+ }
+ }
+ }
+ }
+ return err
+}
+
+// parseMapToStruct needs to be fast so gocyclo can be ignored for now.
+func (d *decoder) parseMapToStruct(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+ structType := getDecodingStructType(tInfo.nonPtrType)
+ if structType.err != nil {
+ return structType.err
+ }
+
+ if structType.toArray {
+ t := d.nextCBORType()
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: "cannot decode CBOR map to struct with toarray option",
+ }
+ }
+
+ var err, lastErr error
+
+ // Get CBOR map size
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+
+ // Keeps track of matched struct fields
+ var foundFldIdx []bool
+ {
+ const maxStackFields = 128
+ if nfields := len(structType.fields); nfields <= maxStackFields {
+ // For structs with typical field counts, expect that this can be
+ // stack-allocated.
+ var a [maxStackFields]bool
+ foundFldIdx = a[:nfields]
+ } else {
+ foundFldIdx = make([]bool, len(structType.fields))
+ }
+ }
+
+ // Keeps track of CBOR map keys to detect duplicate map key
+ keyCount := 0
+ var mapKeys map[interface{}]struct{}
+
+ errOnUnknownField := (d.dm.extraReturnErrors & ExtraDecErrorUnknownField) > 0
+
+MapEntryLoop:
+ for j := 0; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ var f *field
+
+ // If duplicate field detection is enabled and the key at index j did not match any
+ // field, k will hold the map key.
+ var k interface{}
+
+ t := d.nextCBORType()
+ if t == cborTypeTextString || (t == cborTypeByteString && d.dm.fieldNameByteString == FieldNameByteStringAllowed) {
+ var keyBytes []byte
+ if t == cborTypeTextString {
+ keyBytes, lastErr = d.parseTextString()
+ if lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip() // skip value
+ continue
+ }
+ } else { // cborTypeByteString
+ keyBytes, _ = d.parseByteString()
+ }
+
+ // Check for exact match on field name.
+ if i, ok := structType.fieldIndicesByName[string(keyBytes)]; ok {
+ fld := structType.fields[i]
+
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{fld.name, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ }
+
+ // Find field with case-insensitive match
+ if f == nil && d.dm.fieldNameMatching == FieldNameMatchingPreferCaseSensitive {
+ keyLen := len(keyBytes)
+ keyString := string(keyBytes)
+ for i := 0; i < len(structType.fields); i++ {
+ fld := structType.fields[i]
+ if len(fld.name) == keyLen && strings.EqualFold(fld.name, keyString) {
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{keyString, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ break
+ }
+ }
+ }
+
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil {
+ k = string(keyBytes)
+ }
+ } else if t <= cborTypeNegativeInt { // uint/int
+ var nameAsInt int64
+
+ if t == cborTypePositiveInt {
+ _, _, val := d.getHead()
+ nameAsInt = int64(val)
+ } else {
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ if err == nil {
+ err = &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: "-1-" + strconv.FormatUint(val, 10) + " overflows Go's int64",
+ }
+ }
+ d.skip() // skip value
+ continue
+ }
+ nameAsInt = int64(-1) ^ int64(val)
+ }
+
+ // Find field
+ for i := 0; i < len(structType.fields); i++ {
+ fld := structType.fields[i]
+ if fld.keyAsInt && fld.nameAsInt == nameAsInt {
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{nameAsInt, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ break
+ }
+ }
+
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil {
+ k = nameAsInt
+ }
+ } else {
+ if err == nil {
+ err = &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf("").String(),
+ errorMsg: "map key is of type " + t.String() + " and cannot be used to match struct field name",
+ }
+ }
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ // parse key
+ k, lastErr = d.parse(true)
+ if lastErr != nil {
+ d.skip() // skip value
+ continue
+ }
+ // Detect if CBOR map key can be used as Go map key.
+ if !isHashableValue(reflect.ValueOf(k)) {
+ d.skip() // skip value
+ continue
+ }
+ } else {
+ d.skip() // skip key
+ }
+ }
+
+ if f == nil {
+ if errOnUnknownField {
+ err = &UnknownFieldError{j}
+ d.skip() // Skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ }
+
+ // Two map keys that match the same struct field are immediately considered
+ // duplicates. This check detects duplicates between two map keys that do
+ // not match a struct field. If unknown field errors are enabled, then this
+ // check is never reached.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ if mapKeys == nil {
+ mapKeys = make(map[interface{}]struct{}, 1)
+ }
+ mapKeys[k] = struct{}{}
+ newKeyCount := len(mapKeys)
+ if newKeyCount == keyCount {
+ err = &DupMapKeyError{k, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ }
+ keyCount = newKeyCount
+ }
+
+ d.skip() // Skip value
+ continue
+ }
+
+ // Get field value by index
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ fv, lastErr = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) {
+ // Return a new value for embedded field null pointer to point to, or return error.
+ if !v.CanSet() {
+ return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ return v, nil
+ })
+ if lastErr != nil && err == nil {
+ err = lastErr
+ }
+ if !fv.IsValid() {
+ d.skip()
+ continue
+ }
+ }
+
+ if lastErr = d.parseToValue(fv, f.typInfo); lastErr != nil {
+ if err == nil {
+ if typeError, ok := lastErr.(*UnmarshalTypeError); ok {
+ typeError.StructFieldName = tInfo.nonPtrType.String() + "." + f.name
+ err = typeError
+ } else {
+ err = lastErr
+ }
+ }
+ }
+ }
+ return err
+}
+
+// validRegisteredTagNums verifies that tag numbers match registered tag numbers of type t.
+// validRegisteredTagNums assumes next CBOR data type is tag. It scans all tag numbers, and stops at tag content.
+func (d *decoder) validRegisteredTagNums(registeredTag *tagItem) error {
+ // Scan until next cbor data is tag content.
+ tagNums := make([]uint64, 0, 1)
+ for d.nextCBORType() == cborTypeTag {
+ _, _, val := d.getHead()
+ tagNums = append(tagNums, val)
+ }
+
+ if !registeredTag.equalTagNum(tagNums) {
+ return &WrongTagError{registeredTag.contentType, registeredTag.num, tagNums}
+ }
+ return nil
+}
+
+func (d *decoder) getRegisteredTagItem(vt reflect.Type) *tagItem {
+ if d.dm.tags != nil {
+ return d.dm.tags.getTagItemFromType(vt)
+ }
+ return nil
+}
+
+// skip moves data offset to the next item. skip assumes data is well-formed,
+// and does not perform bounds checking.
+func (d *decoder) skip() {
+ t, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+
+ if indefiniteLength {
+ switch t {
+ case cborTypeByteString, cborTypeTextString, cborTypeArray, cborTypeMap:
+ for {
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ return
+ }
+ d.skip()
+ }
+ }
+ }
+
+ switch t {
+ case cborTypeByteString, cborTypeTextString:
+ d.off += int(val)
+
+ case cborTypeArray:
+ for i := 0; i < int(val); i++ {
+ d.skip()
+ }
+
+ case cborTypeMap:
+ for i := 0; i < int(val)*2; i++ {
+ d.skip()
+ }
+
+ case cborTypeTag:
+ d.skip()
+ }
+}
+
+func (d *decoder) getHeadWithIndefiniteLengthFlag() (
+ t cborType,
+ ai byte,
+ val uint64,
+ indefiniteLength bool,
+) {
+ t, ai, val = d.getHead()
+ indefiniteLength = additionalInformation(ai).isIndefiniteLength()
+ return
+}
+
+// getHead assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) getHead() (t cborType, ai byte, val uint64) {
+ t, ai = parseInitialByte(d.data[d.off])
+ val = uint64(ai)
+ d.off++
+
+ if ai <= maxAdditionalInformationWithoutArgument {
+ return
+ }
+
+ if ai == additionalInformationWith1ByteArgument {
+ val = uint64(d.data[d.off])
+ d.off++
+ return
+ }
+
+ if ai == additionalInformationWith2ByteArgument {
+ const argumentSize = 2
+ val = uint64(binary.BigEndian.Uint16(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ return
+ }
+
+ if ai == additionalInformationWith4ByteArgument {
+ const argumentSize = 4
+ val = uint64(binary.BigEndian.Uint32(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ return
+ }
+
+ if ai == additionalInformationWith8ByteArgument {
+ const argumentSize = 8
+ val = binary.BigEndian.Uint64(d.data[d.off : d.off+argumentSize])
+ d.off += argumentSize
+ return
+ }
+ return
+}
+
+func (d *decoder) numOfItemsUntilBreak() int {
+ savedOff := d.off
+ i := 0
+ for !d.foundBreak() {
+ d.skip()
+ i++
+ }
+ d.off = savedOff
+ return i
+}
+
+// foundBreak returns true if next byte is CBOR break code and moves cursor by 1,
+// otherwise it returns false.
+// foundBreak assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) foundBreak() bool {
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ return true
+ }
+ return false
+}
+
+func (d *decoder) reset(data []byte) {
+ d.data = data
+ d.off = 0
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:0]
+}
+
+func (d *decoder) nextCBORType() cborType {
+ return getType(d.data[d.off])
+}
+
+func (d *decoder) nextCBORNil() bool {
+ return d.data[d.off] == 0xf6 || d.data[d.off] == 0xf7
+}
+
+var (
+ typeIntf = reflect.TypeOf([]interface{}(nil)).Elem()
+ typeTime = reflect.TypeOf(time.Time{})
+ typeBigInt = reflect.TypeOf(big.Int{})
+ typeUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
+ typeBinaryUnmarshaler = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem()
+ typeString = reflect.TypeOf("")
+ typeByteSlice = reflect.TypeOf([]byte(nil))
+)
+
+func fillNil(_ cborType, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Slice, reflect.Map, reflect.Interface, reflect.Ptr:
+ v.Set(reflect.Zero(v.Type()))
+ return nil
+ }
+ return nil
+}
+
+func fillPositiveInt(t cborType, val uint64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ if val > math.MaxInt64 {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ if v.OverflowInt(int64(val)) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetInt(int64(val))
+ return nil
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ if v.OverflowUint(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetUint(val)
+ return nil
+
+ case reflect.Float32, reflect.Float64:
+ f := float64(val)
+ v.SetFloat(f)
+ return nil
+ }
+
+ if v.Type() == typeBigInt {
+ i := new(big.Int).SetUint64(val)
+ v.Set(reflect.ValueOf(*i))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillNegativeInt(t cborType, val int64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ if v.OverflowInt(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatInt(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetInt(val)
+ return nil
+
+ case reflect.Float32, reflect.Float64:
+ f := float64(val)
+ v.SetFloat(f)
+ return nil
+ }
+ if v.Type() == typeBigInt {
+ i := new(big.Int).SetInt64(val)
+ v.Set(reflect.ValueOf(*i))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillBool(t cborType, val bool, v reflect.Value) error {
+ if v.Kind() == reflect.Bool {
+ v.SetBool(val)
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillFloat(t cborType, val float64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Float32, reflect.Float64:
+ if v.OverflowFloat(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatFloat(val, 'E', -1, 64) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetFloat(val)
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts ByteStringToStringMode, bum BinaryUnmarshalerMode) error {
+ if bum == BinaryUnmarshalerByteString && reflect.PtrTo(v.Type()).Implements(typeBinaryUnmarshaler) {
+ if v.CanAddr() {
+ v = v.Addr()
+ if u, ok := v.Interface().(encoding.BinaryUnmarshaler); ok {
+ // The contract of BinaryUnmarshaler forbids
+ // retaining the input bytes, so no copying is
+ // required even if val is shared.
+ return u.UnmarshalBinary(val)
+ }
+ }
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+ if bsts != ByteStringToStringForbidden && v.Kind() == reflect.String {
+ v.SetString(string(val))
+ return nil
+ }
+ if v.Kind() == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 {
+ src := val
+ if shared {
+ // SetBytes shares the underlying bytes of the source slice.
+ src = make([]byte, len(val))
+ copy(src, val)
+ }
+ v.SetBytes(src)
+ return nil
+ }
+ if v.Kind() == reflect.Array && v.Type().Elem().Kind() == reflect.Uint8 {
+ vLen := v.Len()
+ i := 0
+ for ; i < vLen && i < len(val); i++ {
+ v.Index(i).SetUint(uint64(val[i]))
+ }
+ // Set remaining Go array elements to zero values.
+ if i < vLen {
+ zeroV := reflect.Zero(reflect.TypeOf(byte(0)))
+ for ; i < vLen; i++ {
+ v.Index(i).Set(zeroV)
+ }
+ }
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillTextString(t cborType, val []byte, v reflect.Value) error {
+ if v.Kind() == reflect.String {
+ v.SetString(string(val))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func isImmutableKind(k reflect.Kind) bool {
+ switch k {
+ case reflect.Bool,
+ reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
+ reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
+ reflect.Float32, reflect.Float64,
+ reflect.String:
+ return true
+
+ default:
+ return false
+ }
+}
+
+func isHashableValue(rv reflect.Value) bool {
+ switch rv.Kind() {
+ case reflect.Slice, reflect.Map, reflect.Func:
+ return false
+
+ case reflect.Struct:
+ switch rv.Type() {
+ case typeTag:
+ tag := rv.Interface().(Tag)
+ return isHashableValue(reflect.ValueOf(tag.Content))
+ case typeBigInt:
+ return false
+ }
+ }
+ return true
+}
+
+// convertByteSliceToByteString converts []byte to ByteString if
+// - v is []byte type, or
+// - v is Tag type and tag content type is []byte
+// This function also handles nested tags.
+// CBOR data is already verified to be well-formed before this function is used,
+// so the recursion won't exceed max nested levels.
+func convertByteSliceToByteString(v interface{}) (interface{}, bool) {
+ switch v := v.(type) {
+ case []byte:
+ return ByteString(v), true
+
+ case Tag:
+ content, converted := convertByteSliceToByteString(v.Content)
+ if converted {
+ return Tag{Number: v.Number, Content: content}, true
+ }
+ }
+ return v, false
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/diagnose.go b/vendor/github.com/fxamacker/cbor/v2/diagnose.go
new file mode 100644
index 00000000000..44afb866089
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/diagnose.go
@@ -0,0 +1,724 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "encoding/base32"
+ "encoding/base64"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "strconv"
+ "unicode/utf16"
+ "unicode/utf8"
+
+ "github.com/x448/float16"
+)
+
+// DiagMode is the main interface for CBOR diagnostic notation.
+type DiagMode interface {
+ // Diagnose returns extended diagnostic notation (EDN) of CBOR data items using this DiagMode.
+ Diagnose([]byte) (string, error)
+
+ // DiagnoseFirst returns extended diagnostic notation (EDN) of the first CBOR data item using the DiagMode. Any remaining bytes are returned in rest.
+ DiagnoseFirst([]byte) (string, []byte, error)
+
+ // DiagOptions returns user specified options used to create this DiagMode.
+ DiagOptions() DiagOptions
+}
+
+// ByteStringEncoding specifies the base encoding that byte strings are notated.
+type ByteStringEncoding uint8
+
+const (
+ // ByteStringBase16Encoding encodes byte strings in base16, without padding.
+ ByteStringBase16Encoding ByteStringEncoding = iota
+
+ // ByteStringBase32Encoding encodes byte strings in base32, without padding.
+ ByteStringBase32Encoding
+
+ // ByteStringBase32HexEncoding encodes byte strings in base32hex, without padding.
+ ByteStringBase32HexEncoding
+
+ // ByteStringBase64Encoding encodes byte strings in base64url, without padding.
+ ByteStringBase64Encoding
+
+ maxByteStringEncoding
+)
+
+func (bse ByteStringEncoding) valid() error {
+ if bse >= maxByteStringEncoding {
+ return errors.New("cbor: invalid ByteStringEncoding " + strconv.Itoa(int(bse)))
+ }
+ return nil
+}
+
+// DiagOptions specifies Diag options.
+type DiagOptions struct {
+ // ByteStringEncoding specifies the base encoding that byte strings are notated.
+ // Default is ByteStringBase16Encoding.
+ ByteStringEncoding ByteStringEncoding
+
+ // ByteStringHexWhitespace specifies notating with whitespace in byte string
+ // when ByteStringEncoding is ByteStringBase16Encoding.
+ ByteStringHexWhitespace bool
+
+ // ByteStringText specifies notating with text in byte string
+ // if it is a valid UTF-8 text.
+ ByteStringText bool
+
+ // ByteStringEmbeddedCBOR specifies notating embedded CBOR in byte string
+ // if it is a valid CBOR bytes.
+ ByteStringEmbeddedCBOR bool
+
+ // CBORSequence specifies notating CBOR sequences.
+ // otherwise, it returns an error if there are more bytes after the first CBOR.
+ CBORSequence bool
+
+ // FloatPrecisionIndicator specifies appending a suffix to indicate float precision.
+ // Refer to https://www.rfc-editor.org/rfc/rfc8949.html#name-encoding-indicators.
+ FloatPrecisionIndicator bool
+
+ // MaxNestedLevels specifies the max nested levels allowed for any combination of CBOR array, maps, and tags.
+ // Default is 32 levels and it can be set to [4, 65535]. Note that higher maximum levels of nesting can
+ // require larger amounts of stack to deserialize. Don't increase this higher than you require.
+ MaxNestedLevels int
+
+ // MaxArrayElements specifies the max number of elements for CBOR arrays.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxArrayElements int
+
+ // MaxMapPairs specifies the max number of key-value pairs for CBOR maps.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxMapPairs int
+}
+
+// DiagMode returns a DiagMode with immutable options.
+func (opts DiagOptions) DiagMode() (DiagMode, error) {
+ return opts.diagMode()
+}
+
+func (opts DiagOptions) diagMode() (*diagMode, error) {
+ if err := opts.ByteStringEncoding.valid(); err != nil {
+ return nil, err
+ }
+
+ decMode, err := DecOptions{
+ MaxNestedLevels: opts.MaxNestedLevels,
+ MaxArrayElements: opts.MaxArrayElements,
+ MaxMapPairs: opts.MaxMapPairs,
+ }.decMode()
+ if err != nil {
+ return nil, err
+ }
+
+ return &diagMode{
+ byteStringEncoding: opts.ByteStringEncoding,
+ byteStringHexWhitespace: opts.ByteStringHexWhitespace,
+ byteStringText: opts.ByteStringText,
+ byteStringEmbeddedCBOR: opts.ByteStringEmbeddedCBOR,
+ cborSequence: opts.CBORSequence,
+ floatPrecisionIndicator: opts.FloatPrecisionIndicator,
+ decMode: decMode,
+ }, nil
+}
+
+type diagMode struct {
+ byteStringEncoding ByteStringEncoding
+ byteStringHexWhitespace bool
+ byteStringText bool
+ byteStringEmbeddedCBOR bool
+ cborSequence bool
+ floatPrecisionIndicator bool
+ decMode *decMode
+}
+
+// DiagOptions returns user specified options used to create this DiagMode.
+func (dm *diagMode) DiagOptions() DiagOptions {
+ return DiagOptions{
+ ByteStringEncoding: dm.byteStringEncoding,
+ ByteStringHexWhitespace: dm.byteStringHexWhitespace,
+ ByteStringText: dm.byteStringText,
+ ByteStringEmbeddedCBOR: dm.byteStringEmbeddedCBOR,
+ CBORSequence: dm.cborSequence,
+ FloatPrecisionIndicator: dm.floatPrecisionIndicator,
+ MaxNestedLevels: dm.decMode.maxNestedLevels,
+ MaxArrayElements: dm.decMode.maxArrayElements,
+ MaxMapPairs: dm.decMode.maxMapPairs,
+ }
+}
+
+// Diagnose returns extended diagnostic notation (EDN) of CBOR data items using the DiagMode.
+func (dm *diagMode) Diagnose(data []byte) (string, error) {
+ return newDiagnose(data, dm.decMode, dm).diag(dm.cborSequence)
+}
+
+// DiagnoseFirst returns extended diagnostic notation (EDN) of the first CBOR data item using the DiagMode. Any remaining bytes are returned in rest.
+func (dm *diagMode) DiagnoseFirst(data []byte) (diagNotation string, rest []byte, err error) {
+ return newDiagnose(data, dm.decMode, dm).diagFirst()
+}
+
+var defaultDiagMode, _ = DiagOptions{}.diagMode()
+
+// Diagnose returns extended diagnostic notation (EDN) of CBOR data items
+// using the default diagnostic mode.
+//
+// Refer to https://www.rfc-editor.org/rfc/rfc8949.html#name-diagnostic-notation.
+func Diagnose(data []byte) (string, error) {
+ return defaultDiagMode.Diagnose(data)
+}
+
+// Diagnose returns extended diagnostic notation (EDN) of the first CBOR data item using the DiagMode. Any remaining bytes are returned in rest.
+func DiagnoseFirst(data []byte) (diagNotation string, rest []byte, err error) {
+ return defaultDiagMode.DiagnoseFirst(data)
+}
+
+type diagnose struct {
+ dm *diagMode
+ d *decoder
+ w *bytes.Buffer
+}
+
+func newDiagnose(data []byte, decm *decMode, diagm *diagMode) *diagnose {
+ return &diagnose{
+ dm: diagm,
+ d: &decoder{data: data, dm: decm},
+ w: &bytes.Buffer{},
+ }
+}
+
+func (di *diagnose) diag(cborSequence bool) (string, error) {
+ // CBOR Sequence
+ firstItem := true
+ for {
+ switch err := di.wellformed(cborSequence); err {
+ case nil:
+ if !firstItem {
+ di.w.WriteString(", ")
+ }
+ firstItem = false
+ if itemErr := di.item(); itemErr != nil {
+ return di.w.String(), itemErr
+ }
+
+ case io.EOF:
+ if firstItem {
+ return di.w.String(), err
+ }
+ return di.w.String(), nil
+
+ default:
+ return di.w.String(), err
+ }
+ }
+}
+
+func (di *diagnose) diagFirst() (diagNotation string, rest []byte, err error) {
+ err = di.wellformed(true)
+ if err == nil {
+ err = di.item()
+ }
+
+ if err == nil {
+ // Return EDN and the rest of the data slice (which might be len 0)
+ return di.w.String(), di.d.data[di.d.off:], nil
+ }
+
+ return di.w.String(), nil, err
+}
+
+func (di *diagnose) wellformed(allowExtraData bool) error {
+ off := di.d.off
+ err := di.d.wellformed(allowExtraData, false)
+ di.d.off = off
+ return err
+}
+
+func (di *diagnose) item() error { //nolint:gocyclo
+ initialByte := di.d.data[di.d.off]
+ switch initialByte {
+ case cborByteStringWithIndefiniteLengthHead,
+ cborTextStringWithIndefiniteLengthHead: // indefinite-length byte/text string
+ di.d.off++
+ if isBreakFlag(di.d.data[di.d.off]) {
+ di.d.off++
+ switch initialByte {
+ case cborByteStringWithIndefiniteLengthHead:
+ // indefinite-length bytes with no chunks.
+ di.w.WriteString(`''_`)
+ return nil
+ case cborTextStringWithIndefiniteLengthHead:
+ // indefinite-length text with no chunks.
+ di.w.WriteString(`""_`)
+ return nil
+ }
+ }
+
+ di.w.WriteString("(_ ")
+
+ i := 0
+ for !di.d.foundBreak() {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+
+ i++
+ // wellformedIndefiniteString() already checked that the next item is a byte/text string.
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+
+ di.w.WriteByte(')')
+ return nil
+
+ case cborArrayWithIndefiniteLengthHead: // indefinite-length array
+ di.d.off++
+ di.w.WriteString("[_ ")
+
+ i := 0
+ for !di.d.foundBreak() {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+
+ i++
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+
+ di.w.WriteByte(']')
+ return nil
+
+ case cborMapWithIndefiniteLengthHead: // indefinite-length map
+ di.d.off++
+ di.w.WriteString("{_ ")
+
+ i := 0
+ for !di.d.foundBreak() {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+
+ i++
+ // key
+ if err := di.item(); err != nil {
+ return err
+ }
+
+ di.w.WriteString(": ")
+
+ // value
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+
+ di.w.WriteByte('}')
+ return nil
+ }
+
+ t := di.d.nextCBORType()
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := di.d.getHead()
+ di.w.WriteString(strconv.FormatUint(val, 10))
+ return nil
+
+ case cborTypeNegativeInt:
+ _, _, val := di.d.getHead()
+ if val > math.MaxInt64 {
+ // CBOR negative integer overflows int64, use big.Int to store value.
+ bi := new(big.Int)
+ bi.SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+ di.w.WriteString(bi.String())
+ return nil
+ }
+
+ nValue := int64(-1) ^ int64(val)
+ di.w.WriteString(strconv.FormatInt(nValue, 10))
+ return nil
+
+ case cborTypeByteString:
+ b, _ := di.d.parseByteString()
+ return di.encodeByteString(b)
+
+ case cborTypeTextString:
+ b, err := di.d.parseTextString()
+ if err != nil {
+ return err
+ }
+ return di.encodeTextString(string(b), '"')
+
+ case cborTypeArray:
+ _, _, val := di.d.getHead()
+ count := int(val)
+ di.w.WriteByte('[')
+
+ for i := 0; i < count; i++ {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+ di.w.WriteByte(']')
+ return nil
+
+ case cborTypeMap:
+ _, _, val := di.d.getHead()
+ count := int(val)
+ di.w.WriteByte('{')
+
+ for i := 0; i < count; i++ {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+ // key
+ if err := di.item(); err != nil {
+ return err
+ }
+ di.w.WriteString(": ")
+ // value
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+ di.w.WriteByte('}')
+ return nil
+
+ case cborTypeTag:
+ _, _, tagNum := di.d.getHead()
+ switch tagNum {
+ case tagNumUnsignedBignum:
+ if nt := di.d.nextCBORType(); nt != cborTypeByteString {
+ return newInadmissibleTagContentTypeError(
+ tagNumUnsignedBignum,
+ "byte string",
+ nt.String())
+ }
+
+ b, _ := di.d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ di.w.WriteString(bi.String())
+ return nil
+
+ case tagNumNegativeBignum:
+ if nt := di.d.nextCBORType(); nt != cborTypeByteString {
+ return newInadmissibleTagContentTypeError(
+ tagNumNegativeBignum,
+ "byte string",
+ nt.String(),
+ )
+ }
+
+ b, _ := di.d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+ di.w.WriteString(bi.String())
+ return nil
+
+ default:
+ di.w.WriteString(strconv.FormatUint(tagNum, 10))
+ di.w.WriteByte('(')
+ if err := di.item(); err != nil {
+ return err
+ }
+ di.w.WriteByte(')')
+ return nil
+ }
+
+ case cborTypePrimitives:
+ _, ai, val := di.d.getHead()
+ switch ai {
+ case additionalInformationAsFalse:
+ di.w.WriteString("false")
+ return nil
+
+ case additionalInformationAsTrue:
+ di.w.WriteString("true")
+ return nil
+
+ case additionalInformationAsNull:
+ di.w.WriteString("null")
+ return nil
+
+ case additionalInformationAsUndefined:
+ di.w.WriteString("undefined")
+ return nil
+
+ case additionalInformationAsFloat16,
+ additionalInformationAsFloat32,
+ additionalInformationAsFloat64:
+ return di.encodeFloat(ai, val)
+
+ default:
+ di.w.WriteString("simple(")
+ di.w.WriteString(strconv.FormatUint(val, 10))
+ di.w.WriteByte(')')
+ return nil
+ }
+ }
+
+ return nil
+}
+
+// writeU16 format a rune as "\uxxxx"
+func (di *diagnose) writeU16(val rune) {
+ di.w.WriteString("\\u")
+ var in [2]byte
+ in[0] = byte(val >> 8)
+ in[1] = byte(val)
+ sz := hex.EncodedLen(len(in))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ hex.Encode(dst, in[:])
+ di.w.Write(dst)
+}
+
+var rawBase32Encoding = base32.StdEncoding.WithPadding(base32.NoPadding)
+var rawBase32HexEncoding = base32.HexEncoding.WithPadding(base32.NoPadding)
+
+func (di *diagnose) encodeByteString(val []byte) error {
+ if len(val) > 0 {
+ if di.dm.byteStringText && utf8.Valid(val) {
+ return di.encodeTextString(string(val), '\'')
+ }
+
+ if di.dm.byteStringEmbeddedCBOR {
+ di2 := newDiagnose(val, di.dm.decMode, di.dm)
+ // should always notating embedded CBOR sequence.
+ if str, err := di2.diag(true); err == nil {
+ di.w.WriteString("<<")
+ di.w.WriteString(str)
+ di.w.WriteString(">>")
+ return nil
+ }
+ }
+ }
+
+ switch di.dm.byteStringEncoding {
+ case ByteStringBase16Encoding:
+ di.w.WriteString("h'")
+ if di.dm.byteStringHexWhitespace {
+ sz := hex.EncodedLen(len(val))
+ if len(val) > 0 {
+ sz += len(val) - 1
+ }
+ di.w.Grow(sz)
+
+ dst := di.w.Bytes()[di.w.Len():]
+ for i := range val {
+ if i > 0 {
+ dst = append(dst, ' ')
+ }
+ hex.Encode(dst[len(dst):len(dst)+2], val[i:i+1])
+ dst = dst[:len(dst)+2]
+ }
+ di.w.Write(dst)
+ } else {
+ sz := hex.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ hex.Encode(dst, val)
+ di.w.Write(dst)
+ }
+ di.w.WriteByte('\'')
+ return nil
+
+ case ByteStringBase32Encoding:
+ di.w.WriteString("b32'")
+ sz := rawBase32Encoding.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ rawBase32Encoding.Encode(dst, val)
+ di.w.Write(dst)
+ di.w.WriteByte('\'')
+ return nil
+
+ case ByteStringBase32HexEncoding:
+ di.w.WriteString("h32'")
+ sz := rawBase32HexEncoding.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ rawBase32HexEncoding.Encode(dst, val)
+ di.w.Write(dst)
+ di.w.WriteByte('\'')
+ return nil
+
+ case ByteStringBase64Encoding:
+ di.w.WriteString("b64'")
+ sz := base64.RawURLEncoding.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ base64.RawURLEncoding.Encode(dst, val)
+ di.w.Write(dst)
+ di.w.WriteByte('\'')
+ return nil
+
+ default:
+ // It should not be possible for users to construct a *diagMode with an invalid byte
+ // string encoding.
+ panic(fmt.Sprintf("diagmode has invalid ByteStringEncoding %v", di.dm.byteStringEncoding))
+ }
+}
+
+const utf16SurrSelf = rune(0x10000)
+
+// quote should be either `'` or `"`
+func (di *diagnose) encodeTextString(val string, quote byte) error {
+ di.w.WriteByte(quote)
+
+ for i := 0; i < len(val); {
+ if b := val[i]; b < utf8.RuneSelf {
+ switch {
+ case b == '\t', b == '\n', b == '\r', b == '\\', b == quote:
+ di.w.WriteByte('\\')
+
+ switch b {
+ case '\t':
+ b = 't'
+ case '\n':
+ b = 'n'
+ case '\r':
+ b = 'r'
+ }
+ di.w.WriteByte(b)
+
+ case b >= ' ' && b <= '~':
+ di.w.WriteByte(b)
+
+ default:
+ di.writeU16(rune(b))
+ }
+
+ i++
+ continue
+ }
+
+ c, size := utf8.DecodeRuneInString(val[i:])
+ switch {
+ case c == utf8.RuneError:
+ return &SemanticError{"cbor: invalid UTF-8 string"}
+
+ case c < utf16SurrSelf:
+ di.writeU16(c)
+
+ default:
+ c1, c2 := utf16.EncodeRune(c)
+ di.writeU16(c1)
+ di.writeU16(c2)
+ }
+
+ i += size
+ }
+
+ di.w.WriteByte(quote)
+ return nil
+}
+
+func (di *diagnose) encodeFloat(ai byte, val uint64) error {
+ f64 := float64(0)
+ switch ai {
+ case additionalInformationAsFloat16:
+ f16 := float16.Frombits(uint16(val))
+ switch {
+ case f16.IsNaN():
+ di.w.WriteString("NaN")
+ return nil
+ case f16.IsInf(1):
+ di.w.WriteString("Infinity")
+ return nil
+ case f16.IsInf(-1):
+ di.w.WriteString("-Infinity")
+ return nil
+ default:
+ f64 = float64(f16.Float32())
+ }
+
+ case additionalInformationAsFloat32:
+ f32 := math.Float32frombits(uint32(val))
+ switch {
+ case f32 != f32:
+ di.w.WriteString("NaN")
+ return nil
+ case f32 > math.MaxFloat32:
+ di.w.WriteString("Infinity")
+ return nil
+ case f32 < -math.MaxFloat32:
+ di.w.WriteString("-Infinity")
+ return nil
+ default:
+ f64 = float64(f32)
+ }
+
+ case additionalInformationAsFloat64:
+ f64 = math.Float64frombits(val)
+ switch {
+ case f64 != f64:
+ di.w.WriteString("NaN")
+ return nil
+ case f64 > math.MaxFloat64:
+ di.w.WriteString("Infinity")
+ return nil
+ case f64 < -math.MaxFloat64:
+ di.w.WriteString("-Infinity")
+ return nil
+ }
+ }
+ // Use ES6 number to string conversion which should match most JSON generators.
+ // Inspired by https://github.com/golang/go/blob/4df10fba1687a6d4f51d7238a403f8f2298f6a16/src/encoding/json/encode.go#L585
+ const bitSize = 64
+ b := make([]byte, 0, 32)
+ if abs := math.Abs(f64); abs != 0 && (abs < 1e-6 || abs >= 1e21) {
+ b = strconv.AppendFloat(b, f64, 'e', -1, bitSize)
+ // clean up e-09 to e-9
+ n := len(b)
+ if n >= 4 && string(b[n-4:n-1]) == "e-0" {
+ b = append(b[:n-2], b[n-1])
+ }
+ } else {
+ b = strconv.AppendFloat(b, f64, 'f', -1, bitSize)
+ }
+
+ // add decimal point and trailing zero if needed
+ if bytes.IndexByte(b, '.') < 0 {
+ if i := bytes.IndexByte(b, 'e'); i < 0 {
+ b = append(b, '.', '0')
+ } else {
+ b = append(b[:i+2], b[i:]...)
+ b[i] = '.'
+ b[i+1] = '0'
+ }
+ }
+
+ di.w.WriteString(string(b))
+
+ if di.dm.floatPrecisionIndicator {
+ switch ai {
+ case additionalInformationAsFloat16:
+ di.w.WriteString("_1")
+ return nil
+
+ case additionalInformationAsFloat32:
+ di.w.WriteString("_2")
+ return nil
+
+ case additionalInformationAsFloat64:
+ di.w.WriteString("_3")
+ return nil
+ }
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/doc.go b/vendor/github.com/fxamacker/cbor/v2/doc.go
new file mode 100644
index 00000000000..23f68b984c6
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/doc.go
@@ -0,0 +1,129 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+/*
+Package cbor is a modern CBOR codec (RFC 8949 & RFC 7049) with CBOR tags,
+Go struct tags (toarray/keyasint/omitempty), Core Deterministic Encoding,
+CTAP2, Canonical CBOR, float64->32->16, and duplicate map key detection.
+
+Encoding options allow "preferred serialization" by encoding integers and floats
+to their smallest forms (e.g. float16) when values fit.
+
+Struct tags like "keyasint", "toarray" and "omitempty" make CBOR data smaller
+and easier to use with structs.
+
+For example, "toarray" tag makes struct fields encode to CBOR array elements. And
+"keyasint" makes a field encode to an element of CBOR map with specified int key.
+
+Latest docs can be viewed at https://github.com/fxamacker/cbor#cbor-library-in-go
+
+# Basics
+
+The Quick Start guide is at https://github.com/fxamacker/cbor#quick-start
+
+Function signatures identical to encoding/json include:
+
+ Marshal, Unmarshal, NewEncoder, NewDecoder, (*Encoder).Encode, (*Decoder).Decode.
+
+Standard interfaces include:
+
+ BinaryMarshaler, BinaryUnmarshaler, Marshaler, and Unmarshaler.
+
+Custom encoding and decoding is possible by implementing standard interfaces for
+user-defined Go types.
+
+Codec functions are available at package-level (using defaults options) or by
+creating modes from options at runtime.
+
+"Mode" in this API means definite way of encoding (EncMode) or decoding (DecMode).
+
+EncMode and DecMode interfaces are created from EncOptions or DecOptions structs.
+
+ em, err := cbor.EncOptions{...}.EncMode()
+ em, err := cbor.CanonicalEncOptions().EncMode()
+ em, err := cbor.CTAP2EncOptions().EncMode()
+
+Modes use immutable options to avoid side-effects and simplify concurrency. Behavior of
+modes won't accidentally change at runtime after they're created.
+
+Modes are intended to be reused and are safe for concurrent use.
+
+EncMode and DecMode Interfaces
+
+ // EncMode interface uses immutable options and is safe for concurrent use.
+ type EncMode interface {
+ Marshal(v interface{}) ([]byte, error)
+ NewEncoder(w io.Writer) *Encoder
+ EncOptions() EncOptions // returns copy of options
+ }
+
+ // DecMode interface uses immutable options and is safe for concurrent use.
+ type DecMode interface {
+ Unmarshal(data []byte, v interface{}) error
+ NewDecoder(r io.Reader) *Decoder
+ DecOptions() DecOptions // returns copy of options
+ }
+
+Using Default Encoding Mode
+
+ b, err := cbor.Marshal(v)
+
+ encoder := cbor.NewEncoder(w)
+ err = encoder.Encode(v)
+
+Using Default Decoding Mode
+
+ err := cbor.Unmarshal(b, &v)
+
+ decoder := cbor.NewDecoder(r)
+ err = decoder.Decode(&v)
+
+Creating and Using Encoding Modes
+
+ // Create EncOptions using either struct literal or a function.
+ opts := cbor.CanonicalEncOptions()
+
+ // If needed, modify encoding options
+ opts.Time = cbor.TimeUnix
+
+ // Create reusable EncMode interface with immutable options, safe for concurrent use.
+ em, err := opts.EncMode()
+
+ // Use EncMode like encoding/json, with same function signatures.
+ b, err := em.Marshal(v)
+ // or
+ encoder := em.NewEncoder(w)
+ err := encoder.Encode(v)
+
+ // NOTE: Both em.Marshal(v) and encoder.Encode(v) use encoding options
+ // specified during creation of em (encoding mode).
+
+# CBOR Options
+
+Predefined Encoding Options: https://github.com/fxamacker/cbor#predefined-encoding-options
+
+Encoding Options: https://github.com/fxamacker/cbor#encoding-options
+
+Decoding Options: https://github.com/fxamacker/cbor#decoding-options
+
+# Struct Tags
+
+Struct tags like `cbor:"name,omitempty"` and `json:"name,omitempty"` work as expected.
+If both struct tags are specified then `cbor` is used.
+
+Struct tags like "keyasint", "toarray", and "omitempty" make it easy to use
+very compact formats like COSE and CWT (CBOR Web Tokens) with structs.
+
+For example, "toarray" makes struct fields encode to array elements. And "keyasint"
+makes struct fields encode to elements of CBOR map with int keys.
+
+https://raw.githubusercontent.com/fxamacker/images/master/cbor/v2.0.0/cbor_easy_api.png
+
+Struct tags are listed at https://github.com/fxamacker/cbor#struct-tags-1
+
+# Tests and Fuzzing
+
+Over 375 tests are included in this package. Cover-guided fuzzing is handled by
+a private fuzzer that replaced fxamacker/cbor-fuzz years ago.
+*/
+package cbor
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode.go b/vendor/github.com/fxamacker/cbor/v2/encode.go
new file mode 100644
index 00000000000..6508e291d61
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode.go
@@ -0,0 +1,1989 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "encoding"
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "math/rand"
+ "reflect"
+ "sort"
+ "strconv"
+ "sync"
+ "time"
+
+ "github.com/x448/float16"
+)
+
+// Marshal returns the CBOR encoding of v using default encoding options.
+// See EncOptions for encoding options.
+//
+// Marshal uses the following encoding rules:
+//
+// If value implements the Marshaler interface, Marshal calls its
+// MarshalCBOR method.
+//
+// If value implements encoding.BinaryMarshaler, Marhsal calls its
+// MarshalBinary method and encode it as CBOR byte string.
+//
+// Boolean values encode as CBOR booleans (type 7).
+//
+// Positive integer values encode as CBOR positive integers (type 0).
+//
+// Negative integer values encode as CBOR negative integers (type 1).
+//
+// Floating point values encode as CBOR floating points (type 7).
+//
+// String values encode as CBOR text strings (type 3).
+//
+// []byte values encode as CBOR byte strings (type 2).
+//
+// Array and slice values encode as CBOR arrays (type 4).
+//
+// Map values encode as CBOR maps (type 5).
+//
+// Struct values encode as CBOR maps (type 5). Each exported struct field
+// becomes a pair with field name encoded as CBOR text string (type 3) and
+// field value encoded based on its type. See struct tag option "keyasint"
+// to encode field name as CBOR integer (type 0 and 1). Also see struct
+// tag option "toarray" for special field "_" to encode struct values as
+// CBOR array (type 4).
+//
+// Marshal supports format string stored under the "cbor" key in the struct
+// field's tag. CBOR format string can specify the name of the field,
+// "omitempty" and "keyasint" options, and special case "-" for field omission.
+// If "cbor" key is absent, Marshal uses "json" key.
+//
+// Struct field name is treated as integer if it has "keyasint" option in
+// its format string. The format string must specify an integer as its
+// field name.
+//
+// Special struct field "_" is used to specify struct level options, such as
+// "toarray". "toarray" option enables Go struct to be encoded as CBOR array.
+// "omitempty" is disabled by "toarray" to ensure that the same number
+// of elements are encoded every time.
+//
+// Anonymous struct fields are marshaled as if their exported fields
+// were fields in the outer struct. Marshal follows the same struct fields
+// visibility rules used by JSON encoding package.
+//
+// time.Time values encode as text strings specified in RFC3339 or numerical
+// representation of seconds since January 1, 1970 UTC depending on
+// EncOptions.Time setting. Also See EncOptions.TimeTag to encode
+// time.Time as CBOR tag with tag number 0 or 1.
+//
+// big.Int values encode as CBOR integers (type 0 and 1) if values fit.
+// Otherwise, big.Int values encode as CBOR bignums (tag 2 and 3). See
+// EncOptions.BigIntConvert to always encode big.Int values as CBOR
+// bignums.
+//
+// Pointer values encode as the value pointed to.
+//
+// Interface values encode as the value stored in the interface.
+//
+// Nil slice/map/pointer/interface values encode as CBOR nulls (type 7).
+//
+// Values of other types cannot be encoded in CBOR. Attempting
+// to encode such a value causes Marshal to return an UnsupportedTypeError.
+func Marshal(v interface{}) ([]byte, error) {
+ return defaultEncMode.Marshal(v)
+}
+
+// MarshalToBuffer encodes v into provided buffer (instead of using built-in buffer pool)
+// and uses default encoding options.
+//
+// NOTE: Unlike Marshal, the buffer provided to MarshalToBuffer can contain
+// partially encoded data if error is returned.
+//
+// See Marshal for more details.
+func MarshalToBuffer(v interface{}, buf *bytes.Buffer) error {
+ return defaultEncMode.MarshalToBuffer(v, buf)
+}
+
+// Marshaler is the interface implemented by types that can marshal themselves
+// into valid CBOR.
+type Marshaler interface {
+ MarshalCBOR() ([]byte, error)
+}
+
+// MarshalerError represents error from checking encoded CBOR data item
+// returned from MarshalCBOR for well-formedness and some very limited tag validation.
+type MarshalerError struct {
+ typ reflect.Type
+ err error
+}
+
+func (e *MarshalerError) Error() string {
+ return "cbor: error calling MarshalCBOR for type " +
+ e.typ.String() +
+ ": " + e.err.Error()
+}
+
+func (e *MarshalerError) Unwrap() error {
+ return e.err
+}
+
+// UnsupportedTypeError is returned by Marshal when attempting to encode value
+// of an unsupported type.
+type UnsupportedTypeError struct {
+ Type reflect.Type
+}
+
+func (e *UnsupportedTypeError) Error() string {
+ return "cbor: unsupported type: " + e.Type.String()
+}
+
+// UnsupportedValueError is returned by Marshal when attempting to encode an
+// unsupported value.
+type UnsupportedValueError struct {
+ msg string
+}
+
+func (e *UnsupportedValueError) Error() string {
+ return "cbor: unsupported value: " + e.msg
+}
+
+// SortMode identifies supported sorting order.
+type SortMode int
+
+const (
+ // SortNone encodes map pairs and struct fields in an arbitrary order.
+ SortNone SortMode = 0
+
+ // SortLengthFirst causes map keys or struct fields to be sorted such that:
+ // - If two keys have different lengths, the shorter one sorts earlier;
+ // - If two keys have the same length, the one with the lower value in
+ // (byte-wise) lexical order sorts earlier.
+ // It is used in "Canonical CBOR" encoding in RFC 7049 3.9.
+ SortLengthFirst SortMode = 1
+
+ // SortBytewiseLexical causes map keys or struct fields to be sorted in the
+ // bytewise lexicographic order of their deterministic CBOR encodings.
+ // It is used in "CTAP2 Canonical CBOR" and "Core Deterministic Encoding"
+ // in RFC 7049bis.
+ SortBytewiseLexical SortMode = 2
+
+ // SortShuffle encodes map pairs and struct fields in a shuffled
+ // order. This mode does not guarantee an unbiased permutation, but it
+ // does guarantee that the runtime of the shuffle algorithm used will be
+ // constant.
+ SortFastShuffle SortMode = 3
+
+ // SortCanonical is used in "Canonical CBOR" encoding in RFC 7049 3.9.
+ SortCanonical SortMode = SortLengthFirst
+
+ // SortCTAP2 is used in "CTAP2 Canonical CBOR".
+ SortCTAP2 SortMode = SortBytewiseLexical
+
+ // SortCoreDeterministic is used in "Core Deterministic Encoding" in RFC 7049bis.
+ SortCoreDeterministic SortMode = SortBytewiseLexical
+
+ maxSortMode SortMode = 4
+)
+
+func (sm SortMode) valid() bool {
+ return sm >= 0 && sm < maxSortMode
+}
+
+// StringMode specifies how to encode Go string values.
+type StringMode int
+
+const (
+ // StringToTextString encodes Go string to CBOR text string (major type 3).
+ StringToTextString StringMode = iota
+
+ // StringToByteString encodes Go string to CBOR byte string (major type 2).
+ StringToByteString
+)
+
+func (st StringMode) cborType() (cborType, error) {
+ switch st {
+ case StringToTextString:
+ return cborTypeTextString, nil
+
+ case StringToByteString:
+ return cborTypeByteString, nil
+ }
+ return 0, errors.New("cbor: invalid StringType " + strconv.Itoa(int(st)))
+}
+
+// ShortestFloatMode specifies which floating-point format should
+// be used as the shortest possible format for CBOR encoding.
+// It is not used for encoding Infinity and NaN values.
+type ShortestFloatMode int
+
+const (
+ // ShortestFloatNone makes float values encode without any conversion.
+ // This is the default for ShortestFloatMode in v1.
+ // E.g. a float32 in Go will encode to CBOR float32. And
+ // a float64 in Go will encode to CBOR float64.
+ ShortestFloatNone ShortestFloatMode = iota
+
+ // ShortestFloat16 specifies float16 as the shortest form that preserves value.
+ // E.g. if float64 can convert to float32 while preserving value, then
+ // encoding will also try to convert float32 to float16. So a float64 might
+ // encode as CBOR float64, float32 or float16 depending on the value.
+ ShortestFloat16
+
+ maxShortestFloat
+)
+
+func (sfm ShortestFloatMode) valid() bool {
+ return sfm >= 0 && sfm < maxShortestFloat
+}
+
+// NaNConvertMode specifies how to encode NaN and overrides ShortestFloatMode.
+// ShortestFloatMode is not used for encoding Infinity and NaN values.
+type NaNConvertMode int
+
+const (
+ // NaNConvert7e00 always encodes NaN to 0xf97e00 (CBOR float16 = 0x7e00).
+ NaNConvert7e00 NaNConvertMode = iota
+
+ // NaNConvertNone never modifies or converts NaN to other representations
+ // (float64 NaN stays float64, etc. even if it can use float16 without losing
+ // any bits).
+ NaNConvertNone
+
+ // NaNConvertPreserveSignal converts NaN to the smallest form that preserves
+ // value (quiet bit + payload) as described in RFC 7049bis Draft 12.
+ NaNConvertPreserveSignal
+
+ // NaNConvertQuiet always forces quiet bit = 1 and shortest form that preserves
+ // NaN payload.
+ NaNConvertQuiet
+
+ // NaNConvertReject returns UnsupportedValueError on attempts to encode a NaN value.
+ NaNConvertReject
+
+ maxNaNConvert
+)
+
+func (ncm NaNConvertMode) valid() bool {
+ return ncm >= 0 && ncm < maxNaNConvert
+}
+
+// InfConvertMode specifies how to encode Infinity and overrides ShortestFloatMode.
+// ShortestFloatMode is not used for encoding Infinity and NaN values.
+type InfConvertMode int
+
+const (
+ // InfConvertFloat16 always converts Inf to lossless IEEE binary16 (float16).
+ InfConvertFloat16 InfConvertMode = iota
+
+ // InfConvertNone never converts (used by CTAP2 Canonical CBOR).
+ InfConvertNone
+
+ // InfConvertReject returns UnsupportedValueError on attempts to encode an infinite value.
+ InfConvertReject
+
+ maxInfConvert
+)
+
+func (icm InfConvertMode) valid() bool {
+ return icm >= 0 && icm < maxInfConvert
+}
+
+// TimeMode specifies how to encode time.Time values.
+type TimeMode int
+
+const (
+ // TimeUnix causes time.Time to be encoded as epoch time in integer with second precision.
+ TimeUnix TimeMode = iota
+
+ // TimeUnixMicro causes time.Time to be encoded as epoch time in float-point rounded to microsecond precision.
+ TimeUnixMicro
+
+ // TimeUnixDynamic causes time.Time to be encoded as integer if time.Time doesn't have fractional seconds,
+ // otherwise float-point rounded to microsecond precision.
+ TimeUnixDynamic
+
+ // TimeRFC3339 causes time.Time to be encoded as RFC3339 formatted string with second precision.
+ TimeRFC3339
+
+ // TimeRFC3339Nano causes time.Time to be encoded as RFC3339 formatted string with nanosecond precision.
+ TimeRFC3339Nano
+
+ maxTimeMode
+)
+
+func (tm TimeMode) valid() bool {
+ return tm >= 0 && tm < maxTimeMode
+}
+
+// BigIntConvertMode specifies how to encode big.Int values.
+type BigIntConvertMode int
+
+const (
+ // BigIntConvertShortest makes big.Int encode to CBOR integer if value fits.
+ // E.g. if big.Int value can be converted to CBOR integer while preserving
+ // value, encoder will encode it to CBOR integer (major type 0 or 1).
+ BigIntConvertShortest BigIntConvertMode = iota
+
+ // BigIntConvertNone makes big.Int encode to CBOR bignum (tag 2 or 3) without
+ // converting it to another CBOR type.
+ BigIntConvertNone
+
+ // BigIntConvertReject returns an UnsupportedTypeError instead of marshaling a big.Int.
+ BigIntConvertReject
+
+ maxBigIntConvert
+)
+
+func (bim BigIntConvertMode) valid() bool {
+ return bim >= 0 && bim < maxBigIntConvert
+}
+
+// NilContainersMode specifies how to encode nil slices and maps.
+type NilContainersMode int
+
+const (
+ // NilContainerAsNull encodes nil slices and maps as CBOR null.
+ // This is the default.
+ NilContainerAsNull NilContainersMode = iota
+
+ // NilContainerAsEmpty encodes nil slices and maps as
+ // empty container (CBOR bytestring, array, or map).
+ NilContainerAsEmpty
+
+ maxNilContainersMode
+)
+
+func (m NilContainersMode) valid() bool {
+ return m >= 0 && m < maxNilContainersMode
+}
+
+// OmitEmptyMode specifies how to encode struct fields with omitempty tag.
+// The default behavior omits if field value would encode as empty CBOR value.
+type OmitEmptyMode int
+
+const (
+ // OmitEmptyCBORValue specifies that struct fields tagged with "omitempty"
+ // should be omitted from encoding if the field would be encoded as an empty
+ // CBOR value, such as CBOR false, 0, 0.0, nil, empty byte, empty string,
+ // empty array, or empty map.
+ OmitEmptyCBORValue OmitEmptyMode = iota
+
+ // OmitEmptyGoValue specifies that struct fields tagged with "omitempty"
+ // should be omitted from encoding if the field has an empty Go value,
+ // defined as false, 0, 0.0, a nil pointer, a nil interface value, and
+ // any empty array, slice, map, or string.
+ // This behavior is the same as the current (aka v1) encoding/json package
+ // included in Go.
+ OmitEmptyGoValue
+
+ maxOmitEmptyMode
+)
+
+func (om OmitEmptyMode) valid() bool {
+ return om >= 0 && om < maxOmitEmptyMode
+}
+
+// FieldNameMode specifies the CBOR type to use when encoding struct field names.
+type FieldNameMode int
+
+const (
+ // FieldNameToTextString encodes struct fields to CBOR text string (major type 3).
+ FieldNameToTextString FieldNameMode = iota
+
+ // FieldNameToTextString encodes struct fields to CBOR byte string (major type 2).
+ FieldNameToByteString
+
+ maxFieldNameMode
+)
+
+func (fnm FieldNameMode) valid() bool {
+ return fnm >= 0 && fnm < maxFieldNameMode
+}
+
+// ByteSliceLaterFormatMode specifies which later format conversion hint (CBOR tag 21-23)
+// to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
+// always encode unmodified bytes from the byte slice and just wrap it within
+// CBOR tag 21, 22, or 23 if specified.
+// See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.
+type ByteSliceLaterFormatMode int
+
+const (
+ // ByteSliceLaterFormatNone encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // without adding CBOR tag 21, 22, or 23.
+ ByteSliceLaterFormatNone ByteSliceLaterFormatMode = iota
+
+ // ByteSliceLaterFormatBase64URL encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 21 (expected later conversion to base64url encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase64URL
+
+ // ByteSliceLaterFormatBase64 encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 22 (expected later conversion to base64 encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase64
+
+ // ByteSliceLaterFormatBase16 encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 23 (expected later conversion to base16 encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase16
+)
+
+func (bsefm ByteSliceLaterFormatMode) encodingTag() (uint64, error) {
+ switch bsefm {
+ case ByteSliceLaterFormatNone:
+ return 0, nil
+
+ case ByteSliceLaterFormatBase64URL:
+ return tagNumExpectedLaterEncodingBase64URL, nil
+
+ case ByteSliceLaterFormatBase64:
+ return tagNumExpectedLaterEncodingBase64, nil
+
+ case ByteSliceLaterFormatBase16:
+ return tagNumExpectedLaterEncodingBase16, nil
+ }
+ return 0, errors.New("cbor: invalid ByteSliceLaterFormat " + strconv.Itoa(int(bsefm)))
+}
+
+// ByteArrayMode specifies how to encode byte arrays.
+type ByteArrayMode int
+
+const (
+ // ByteArrayToByteSlice encodes byte arrays the same way that a byte slice with identical
+ // length and contents is encoded.
+ ByteArrayToByteSlice ByteArrayMode = iota
+
+ // ByteArrayToArray encodes byte arrays to the CBOR array type with one unsigned integer
+ // item for each byte in the array.
+ ByteArrayToArray
+
+ maxByteArrayMode
+)
+
+func (bam ByteArrayMode) valid() bool {
+ return bam >= 0 && bam < maxByteArrayMode
+}
+
+// BinaryMarshalerMode specifies how to encode types that implement encoding.BinaryMarshaler.
+type BinaryMarshalerMode int
+
+const (
+ // BinaryMarshalerByteString encodes the output of MarshalBinary to a CBOR byte string.
+ BinaryMarshalerByteString BinaryMarshalerMode = iota
+
+ // BinaryMarshalerNone does not recognize BinaryMarshaler implementations during encode.
+ BinaryMarshalerNone
+
+ maxBinaryMarshalerMode
+)
+
+func (bmm BinaryMarshalerMode) valid() bool {
+ return bmm >= 0 && bmm < maxBinaryMarshalerMode
+}
+
+// EncOptions specifies encoding options.
+type EncOptions struct {
+ // Sort specifies sorting order.
+ Sort SortMode
+
+ // ShortestFloat specifies the shortest floating-point encoding that preserves
+ // the value being encoded.
+ ShortestFloat ShortestFloatMode
+
+ // NaNConvert specifies how to encode NaN and it overrides ShortestFloatMode.
+ NaNConvert NaNConvertMode
+
+ // InfConvert specifies how to encode Inf and it overrides ShortestFloatMode.
+ InfConvert InfConvertMode
+
+ // BigIntConvert specifies how to encode big.Int values.
+ BigIntConvert BigIntConvertMode
+
+ // Time specifies how to encode time.Time.
+ Time TimeMode
+
+ // TimeTag allows time.Time to be encoded with a tag number.
+ // RFC3339 format gets tag number 0, and numeric epoch time tag number 1.
+ TimeTag EncTagMode
+
+ // IndefLength specifies whether to allow indefinite length CBOR items.
+ IndefLength IndefLengthMode
+
+ // NilContainers specifies how to encode nil slices and maps.
+ NilContainers NilContainersMode
+
+ // TagsMd specifies whether to allow CBOR tags (major type 6).
+ TagsMd TagsMode
+
+ // OmitEmptyMode specifies how to encode struct fields with omitempty tag.
+ OmitEmpty OmitEmptyMode
+
+ // String specifies which CBOR type to use when encoding Go strings.
+ // - CBOR text string (major type 3) is default
+ // - CBOR byte string (major type 2)
+ String StringMode
+
+ // FieldName specifies the CBOR type to use when encoding struct field names.
+ FieldName FieldNameMode
+
+ // ByteSliceLaterFormat specifies which later format conversion hint (CBOR tag 21-23)
+ // to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
+ // always encode unmodified bytes from the byte slice and just wrap it within
+ // CBOR tag 21, 22, or 23 if specified.
+ // See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.
+ ByteSliceLaterFormat ByteSliceLaterFormatMode
+
+ // ByteArray specifies how to encode byte arrays.
+ ByteArray ByteArrayMode
+
+ // BinaryMarshaler specifies how to encode types that implement encoding.BinaryMarshaler.
+ BinaryMarshaler BinaryMarshalerMode
+}
+
+// CanonicalEncOptions returns EncOptions for "Canonical CBOR" encoding,
+// defined in RFC 7049 Section 3.9 with the following rules:
+//
+// 1. "Integers must be as small as possible."
+// 2. "The expression of lengths in major types 2 through 5 must be as short as possible."
+// 3. The keys in every map must be sorted in length-first sorting order.
+// See SortLengthFirst for details.
+// 4. "Indefinite-length items must be made into definite-length items."
+// 5. "If a protocol allows for IEEE floats, then additional canonicalization rules might
+// need to be added. One example rule might be to have all floats start as a 64-bit
+// float, then do a test conversion to a 32-bit float; if the result is the same numeric
+// value, use the shorter value and repeat the process with a test conversion to a
+// 16-bit float. (This rule selects 16-bit float for positive and negative Infinity
+// as well.) Also, there are many representations for NaN. If NaN is an allowed value,
+// it must always be represented as 0xf97e00."
+func CanonicalEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCanonical,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ IndefLength: IndefLengthForbidden,
+ }
+}
+
+// CTAP2EncOptions returns EncOptions for "CTAP2 Canonical CBOR" encoding,
+// defined in CTAP specification, with the following rules:
+//
+// 1. "Integers must be encoded as small as possible."
+// 2. "The representations of any floating-point values are not changed."
+// 3. "The expression of lengths in major types 2 through 5 must be as short as possible."
+// 4. "Indefinite-length items must be made into definite-length items.""
+// 5. The keys in every map must be sorted in bytewise lexicographic order.
+// See SortBytewiseLexical for details.
+// 6. "Tags as defined in Section 2.4 in [RFC7049] MUST NOT be present."
+func CTAP2EncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCTAP2,
+ ShortestFloat: ShortestFloatNone,
+ NaNConvert: NaNConvertNone,
+ InfConvert: InfConvertNone,
+ IndefLength: IndefLengthForbidden,
+ TagsMd: TagsForbidden,
+ }
+}
+
+// CoreDetEncOptions returns EncOptions for "Core Deterministic" encoding,
+// defined in RFC 7049bis with the following rules:
+//
+// 1. "Preferred serialization MUST be used. In particular, this means that arguments
+// (see Section 3) for integers, lengths in major types 2 through 5, and tags MUST
+// be as short as possible"
+// "Floating point values also MUST use the shortest form that preserves the value"
+// 2. "Indefinite-length items MUST NOT appear."
+// 3. "The keys in every map MUST be sorted in the bytewise lexicographic order of
+// their deterministic encodings."
+func CoreDetEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCoreDeterministic,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ IndefLength: IndefLengthForbidden,
+ }
+}
+
+// PreferredUnsortedEncOptions returns EncOptions for "Preferred Serialization" encoding,
+// defined in RFC 7049bis with the following rules:
+//
+// 1. "The preferred serialization always uses the shortest form of representing the argument
+// (Section 3);"
+// 2. "it also uses the shortest floating-point encoding that preserves the value being
+// encoded (see Section 5.5)."
+// "The preferred encoding for a floating-point value is the shortest floating-point encoding
+// that preserves its value, e.g., 0xf94580 for the number 5.5, and 0xfa45ad9c00 for the
+// number 5555.5, unless the CBOR-based protocol specifically excludes the use of the shorter
+// floating-point encodings. For NaN values, a shorter encoding is preferred if zero-padding
+// the shorter significand towards the right reconstitutes the original NaN value (for many
+// applications, the single NaN encoding 0xf97e00 will suffice)."
+// 3. "Definite length encoding is preferred whenever the length is known at the time the
+// serialization of the item starts."
+func PreferredUnsortedEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortNone,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ }
+}
+
+// EncMode returns EncMode with immutable options and no tags (safe for concurrency).
+func (opts EncOptions) EncMode() (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.encMode()
+}
+
+// UserBufferEncMode returns UserBufferEncMode with immutable options and no tags (safe for concurrency).
+func (opts EncOptions) UserBufferEncMode() (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.encMode()
+}
+
+// EncModeWithTags returns EncMode with options and tags that are both immutable (safe for concurrency).
+func (opts EncOptions) EncModeWithTags(tags TagSet) (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.UserBufferEncModeWithTags(tags)
+}
+
+// UserBufferEncModeWithTags returns UserBufferEncMode with options and tags that are both immutable (safe for concurrency).
+func (opts EncOptions) UserBufferEncModeWithTags(tags TagSet) (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return nil, errors.New("cbor: cannot create EncMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return nil, errors.New("cbor: cannot create EncMode with nil value as TagSet")
+ }
+ em, err := opts.encMode()
+ if err != nil {
+ return nil, err
+ }
+ // Copy tags
+ ts := tagSet(make(map[reflect.Type]*tagItem))
+ syncTags := tags.(*syncTagSet)
+ syncTags.RLock()
+ for contentType, tag := range syncTags.t {
+ if tag.opts.EncTag != EncTagNone {
+ ts[contentType] = tag
+ }
+ }
+ syncTags.RUnlock()
+ if len(ts) > 0 {
+ em.tags = ts
+ }
+ return em, nil
+}
+
+// EncModeWithSharedTags returns EncMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts EncOptions) EncModeWithSharedTags(tags TagSet) (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.UserBufferEncModeWithSharedTags(tags)
+}
+
+// UserBufferEncModeWithSharedTags returns UserBufferEncMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts EncOptions) UserBufferEncModeWithSharedTags(tags TagSet) (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return nil, errors.New("cbor: cannot create EncMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return nil, errors.New("cbor: cannot create EncMode with nil value as TagSet")
+ }
+ em, err := opts.encMode()
+ if err != nil {
+ return nil, err
+ }
+ em.tags = tags
+ return em, nil
+}
+
+func (opts EncOptions) encMode() (*encMode, error) { //nolint:gocritic // ignore hugeParam
+ if !opts.Sort.valid() {
+ return nil, errors.New("cbor: invalid SortMode " + strconv.Itoa(int(opts.Sort)))
+ }
+ if !opts.ShortestFloat.valid() {
+ return nil, errors.New("cbor: invalid ShortestFloatMode " + strconv.Itoa(int(opts.ShortestFloat)))
+ }
+ if !opts.NaNConvert.valid() {
+ return nil, errors.New("cbor: invalid NaNConvertMode " + strconv.Itoa(int(opts.NaNConvert)))
+ }
+ if !opts.InfConvert.valid() {
+ return nil, errors.New("cbor: invalid InfConvertMode " + strconv.Itoa(int(opts.InfConvert)))
+ }
+ if !opts.BigIntConvert.valid() {
+ return nil, errors.New("cbor: invalid BigIntConvertMode " + strconv.Itoa(int(opts.BigIntConvert)))
+ }
+ if !opts.Time.valid() {
+ return nil, errors.New("cbor: invalid TimeMode " + strconv.Itoa(int(opts.Time)))
+ }
+ if !opts.TimeTag.valid() {
+ return nil, errors.New("cbor: invalid TimeTag " + strconv.Itoa(int(opts.TimeTag)))
+ }
+ if !opts.IndefLength.valid() {
+ return nil, errors.New("cbor: invalid IndefLength " + strconv.Itoa(int(opts.IndefLength)))
+ }
+ if !opts.NilContainers.valid() {
+ return nil, errors.New("cbor: invalid NilContainers " + strconv.Itoa(int(opts.NilContainers)))
+ }
+ if !opts.TagsMd.valid() {
+ return nil, errors.New("cbor: invalid TagsMd " + strconv.Itoa(int(opts.TagsMd)))
+ }
+ if opts.TagsMd == TagsForbidden && opts.TimeTag == EncTagRequired {
+ return nil, errors.New("cbor: cannot set TagsMd to TagsForbidden when TimeTag is EncTagRequired")
+ }
+ if !opts.OmitEmpty.valid() {
+ return nil, errors.New("cbor: invalid OmitEmpty " + strconv.Itoa(int(opts.OmitEmpty)))
+ }
+ stringMajorType, err := opts.String.cborType()
+ if err != nil {
+ return nil, err
+ }
+ if !opts.FieldName.valid() {
+ return nil, errors.New("cbor: invalid FieldName " + strconv.Itoa(int(opts.FieldName)))
+ }
+ byteSliceLaterEncodingTag, err := opts.ByteSliceLaterFormat.encodingTag()
+ if err != nil {
+ return nil, err
+ }
+ if !opts.ByteArray.valid() {
+ return nil, errors.New("cbor: invalid ByteArray " + strconv.Itoa(int(opts.ByteArray)))
+ }
+ if !opts.BinaryMarshaler.valid() {
+ return nil, errors.New("cbor: invalid BinaryMarshaler " + strconv.Itoa(int(opts.BinaryMarshaler)))
+ }
+ em := encMode{
+ sort: opts.Sort,
+ shortestFloat: opts.ShortestFloat,
+ nanConvert: opts.NaNConvert,
+ infConvert: opts.InfConvert,
+ bigIntConvert: opts.BigIntConvert,
+ time: opts.Time,
+ timeTag: opts.TimeTag,
+ indefLength: opts.IndefLength,
+ nilContainers: opts.NilContainers,
+ tagsMd: opts.TagsMd,
+ omitEmpty: opts.OmitEmpty,
+ stringType: opts.String,
+ stringMajorType: stringMajorType,
+ fieldName: opts.FieldName,
+ byteSliceLaterFormat: opts.ByteSliceLaterFormat,
+ byteSliceLaterEncodingTag: byteSliceLaterEncodingTag,
+ byteArray: opts.ByteArray,
+ binaryMarshaler: opts.BinaryMarshaler,
+ }
+ return &em, nil
+}
+
+// EncMode is the main interface for CBOR encoding.
+type EncMode interface {
+ Marshal(v interface{}) ([]byte, error)
+ NewEncoder(w io.Writer) *Encoder
+ EncOptions() EncOptions
+}
+
+// UserBufferEncMode is an interface for CBOR encoding, which extends EncMode by
+// adding MarshalToBuffer to support user specified buffer rather than encoding
+// into the built-in buffer pool.
+type UserBufferEncMode interface {
+ EncMode
+ MarshalToBuffer(v interface{}, buf *bytes.Buffer) error
+
+ // This private method is to prevent users implementing
+ // this interface and so future additions to it will
+ // not be breaking changes.
+ // See https://go.dev/blog/module-compatibility
+ unexport()
+}
+
+type encMode struct {
+ tags tagProvider
+ sort SortMode
+ shortestFloat ShortestFloatMode
+ nanConvert NaNConvertMode
+ infConvert InfConvertMode
+ bigIntConvert BigIntConvertMode
+ time TimeMode
+ timeTag EncTagMode
+ indefLength IndefLengthMode
+ nilContainers NilContainersMode
+ tagsMd TagsMode
+ omitEmpty OmitEmptyMode
+ stringType StringMode
+ stringMajorType cborType
+ fieldName FieldNameMode
+ byteSliceLaterFormat ByteSliceLaterFormatMode
+ byteSliceLaterEncodingTag uint64
+ byteArray ByteArrayMode
+ binaryMarshaler BinaryMarshalerMode
+}
+
+var defaultEncMode, _ = EncOptions{}.encMode()
+
+// These four decoding modes are used by getMarshalerDecMode.
+// maxNestedLevels, maxArrayElements, and maxMapPairs are
+// set to max allowed limits to avoid rejecting Marshaler
+// output that would have been the allowable output of a
+// non-Marshaler object that exceeds default limits.
+var (
+ marshalerForbidIndefLengthForbidTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthForbidden,
+ tagsMd: TagsForbidden,
+ }
+
+ marshalerAllowIndefLengthForbidTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthAllowed,
+ tagsMd: TagsForbidden,
+ }
+
+ marshalerForbidIndefLengthAllowTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthForbidden,
+ tagsMd: TagsAllowed,
+ }
+
+ marshalerAllowIndefLengthAllowTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthAllowed,
+ tagsMd: TagsAllowed,
+ }
+)
+
+// getMarshalerDecMode returns one of four existing decoding modes
+// which can be reused (safe for parallel use) for the purpose of
+// checking if data returned by Marshaler is well-formed.
+func getMarshalerDecMode(indefLength IndefLengthMode, tagsMd TagsMode) *decMode {
+ switch {
+ case indefLength == IndefLengthAllowed && tagsMd == TagsAllowed:
+ return &marshalerAllowIndefLengthAllowTagsDecMode
+
+ case indefLength == IndefLengthAllowed && tagsMd == TagsForbidden:
+ return &marshalerAllowIndefLengthForbidTagsDecMode
+
+ case indefLength == IndefLengthForbidden && tagsMd == TagsAllowed:
+ return &marshalerForbidIndefLengthAllowTagsDecMode
+
+ case indefLength == IndefLengthForbidden && tagsMd == TagsForbidden:
+ return &marshalerForbidIndefLengthForbidTagsDecMode
+
+ default:
+ // This should never happen, unless we add new options to
+ // IndefLengthMode or TagsMode without updating this function.
+ return &decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: indefLength,
+ tagsMd: tagsMd,
+ }
+ }
+}
+
+// EncOptions returns user specified options used to create this EncMode.
+func (em *encMode) EncOptions() EncOptions {
+ return EncOptions{
+ Sort: em.sort,
+ ShortestFloat: em.shortestFloat,
+ NaNConvert: em.nanConvert,
+ InfConvert: em.infConvert,
+ BigIntConvert: em.bigIntConvert,
+ Time: em.time,
+ TimeTag: em.timeTag,
+ IndefLength: em.indefLength,
+ NilContainers: em.nilContainers,
+ TagsMd: em.tagsMd,
+ OmitEmpty: em.omitEmpty,
+ String: em.stringType,
+ FieldName: em.fieldName,
+ ByteSliceLaterFormat: em.byteSliceLaterFormat,
+ ByteArray: em.byteArray,
+ BinaryMarshaler: em.binaryMarshaler,
+ }
+}
+
+func (em *encMode) unexport() {}
+
+func (em *encMode) encTagBytes(t reflect.Type) []byte {
+ if em.tags != nil {
+ if tagItem := em.tags.getTagItemFromType(t); tagItem != nil {
+ return tagItem.cborTagNum
+ }
+ }
+ return nil
+}
+
+// Marshal returns the CBOR encoding of v using em encoding mode.
+//
+// See the documentation for Marshal for details.
+func (em *encMode) Marshal(v interface{}) ([]byte, error) {
+ e := getEncodeBuffer()
+
+ if err := encode(e, em, reflect.ValueOf(v)); err != nil {
+ putEncodeBuffer(e)
+ return nil, err
+ }
+
+ buf := make([]byte, e.Len())
+ copy(buf, e.Bytes())
+
+ putEncodeBuffer(e)
+ return buf, nil
+}
+
+// MarshalToBuffer encodes v into provided buffer (instead of using built-in buffer pool)
+// and uses em encoding mode.
+//
+// NOTE: Unlike Marshal, the buffer provided to MarshalToBuffer can contain
+// partially encoded data if error is returned.
+//
+// See Marshal for more details.
+func (em *encMode) MarshalToBuffer(v interface{}, buf *bytes.Buffer) error {
+ if buf == nil {
+ return fmt.Errorf("cbor: encoding buffer provided by user is nil")
+ }
+ return encode(buf, em, reflect.ValueOf(v))
+}
+
+// NewEncoder returns a new encoder that writes to w using em EncMode.
+func (em *encMode) NewEncoder(w io.Writer) *Encoder {
+ return &Encoder{w: w, em: em}
+}
+
+// encodeBufferPool caches unused bytes.Buffer objects for later reuse.
+var encodeBufferPool = sync.Pool{
+ New: func() interface{} {
+ e := new(bytes.Buffer)
+ e.Grow(32) // TODO: make this configurable
+ return e
+ },
+}
+
+func getEncodeBuffer() *bytes.Buffer {
+ return encodeBufferPool.Get().(*bytes.Buffer)
+}
+
+func putEncodeBuffer(e *bytes.Buffer) {
+ e.Reset()
+ encodeBufferPool.Put(e)
+}
+
+type encodeFunc func(e *bytes.Buffer, em *encMode, v reflect.Value) error
+type isEmptyFunc func(em *encMode, v reflect.Value) (empty bool, err error)
+
+func encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if !v.IsValid() {
+ // v is zero value
+ e.Write(cborNil)
+ return nil
+ }
+ vt := v.Type()
+ f, _ := getEncodeFunc(vt)
+ if f == nil {
+ return &UnsupportedTypeError{vt}
+ }
+
+ return f(e, em, v)
+}
+
+func encodeBool(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ b := cborFalse
+ if v.Bool() {
+ b = cborTrue
+ }
+ e.Write(b)
+ return nil
+}
+
+func encodeInt(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ i := v.Int()
+ if i >= 0 {
+ encodeHead(e, byte(cborTypePositiveInt), uint64(i))
+ return nil
+ }
+ i = i*(-1) - 1
+ encodeHead(e, byte(cborTypeNegativeInt), uint64(i))
+ return nil
+}
+
+func encodeUint(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ encodeHead(e, byte(cborTypePositiveInt), v.Uint())
+ return nil
+}
+
+func encodeFloat(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ f64 := v.Float()
+ if math.IsNaN(f64) {
+ return encodeNaN(e, em, v)
+ }
+ if math.IsInf(f64, 0) {
+ return encodeInf(e, em, v)
+ }
+ fopt := em.shortestFloat
+ if v.Kind() == reflect.Float64 && (fopt == ShortestFloatNone || cannotFitFloat32(f64)) {
+ // Encode float64
+ // Don't use encodeFloat64() because it cannot be inlined.
+ const argumentSize = 8
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | byte(additionalInformationAsFloat64)
+ binary.BigEndian.PutUint64(scratch[1:], math.Float64bits(f64))
+ e.Write(scratch[:])
+ return nil
+ }
+
+ f32 := float32(f64)
+ if fopt == ShortestFloat16 {
+ var f16 float16.Float16
+ p := float16.PrecisionFromfloat32(f32)
+ if p == float16.PrecisionExact {
+ // Roundtrip float32->float16->float32 test isn't needed.
+ f16 = float16.Fromfloat32(f32)
+ } else if p == float16.PrecisionUnknown {
+ // Try roundtrip float32->float16->float32 to determine if float32 can fit into float16.
+ f16 = float16.Fromfloat32(f32)
+ if f16.Float32() == f32 {
+ p = float16.PrecisionExact
+ }
+ }
+ if p == float16.PrecisionExact {
+ // Encode float16
+ // Don't use encodeFloat16() because it cannot be inlined.
+ const argumentSize = 2
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat16
+ binary.BigEndian.PutUint16(scratch[1:], uint16(f16))
+ e.Write(scratch[:])
+ return nil
+ }
+ }
+
+ // Encode float32
+ // Don't use encodeFloat32() because it cannot be inlined.
+ const argumentSize = 4
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat32
+ binary.BigEndian.PutUint32(scratch[1:], math.Float32bits(f32))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeInf(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ f64 := v.Float()
+ switch em.infConvert {
+ case InfConvertReject:
+ return &UnsupportedValueError{msg: "floating-point infinity"}
+
+ case InfConvertFloat16:
+ if f64 > 0 {
+ e.Write(cborPositiveInfinity)
+ } else {
+ e.Write(cborNegativeInfinity)
+ }
+ return nil
+ }
+ if v.Kind() == reflect.Float64 {
+ return encodeFloat64(e, f64)
+ }
+ return encodeFloat32(e, float32(f64))
+}
+
+func encodeNaN(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ switch em.nanConvert {
+ case NaNConvert7e00:
+ e.Write(cborNaN)
+ return nil
+
+ case NaNConvertNone:
+ if v.Kind() == reflect.Float64 {
+ return encodeFloat64(e, v.Float())
+ }
+ f32 := float32NaNFromReflectValue(v)
+ return encodeFloat32(e, f32)
+
+ case NaNConvertReject:
+ return &UnsupportedValueError{msg: "floating-point NaN"}
+
+ default: // NaNConvertPreserveSignal, NaNConvertQuiet
+ if v.Kind() == reflect.Float64 {
+ f64 := v.Float()
+ f64bits := math.Float64bits(f64)
+ if em.nanConvert == NaNConvertQuiet && f64bits&(1<<51) == 0 {
+ f64bits |= 1 << 51 // Set quiet bit = 1
+ f64 = math.Float64frombits(f64bits)
+ }
+ // The lower 29 bits are dropped when converting from float64 to float32.
+ if f64bits&0x1fffffff != 0 {
+ // Encode NaN as float64 because dropped coef bits from float64 to float32 are not all 0s.
+ return encodeFloat64(e, f64)
+ }
+ // Create float32 from float64 manually because float32(f64) always turns on NaN's quiet bits.
+ sign := uint32(f64bits>>32) & (1 << 31)
+ exp := uint32(0x7f800000)
+ coef := uint32((f64bits & 0xfffffffffffff) >> 29)
+ f32bits := sign | exp | coef
+ f32 := math.Float32frombits(f32bits)
+ // The lower 13 bits are dropped when converting from float32 to float16.
+ if f32bits&0x1fff != 0 {
+ // Encode NaN as float32 because dropped coef bits from float32 to float16 are not all 0s.
+ return encodeFloat32(e, f32)
+ }
+ // Encode NaN as float16
+ f16, _ := float16.FromNaN32ps(f32) // Ignore err because it only returns error when f32 is not a NaN.
+ return encodeFloat16(e, f16)
+ }
+
+ f32 := float32NaNFromReflectValue(v)
+ f32bits := math.Float32bits(f32)
+ if em.nanConvert == NaNConvertQuiet && f32bits&(1<<22) == 0 {
+ f32bits |= 1 << 22 // Set quiet bit = 1
+ f32 = math.Float32frombits(f32bits)
+ }
+ // The lower 13 bits are dropped coef bits when converting from float32 to float16.
+ if f32bits&0x1fff != 0 {
+ // Encode NaN as float32 because dropped coef bits from float32 to float16 are not all 0s.
+ return encodeFloat32(e, f32)
+ }
+ f16, _ := float16.FromNaN32ps(f32) // Ignore err because it only returns error when f32 is not a NaN.
+ return encodeFloat16(e, f16)
+ }
+}
+
+func encodeFloat16(e *bytes.Buffer, f16 float16.Float16) error {
+ const argumentSize = 2
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat16
+ binary.BigEndian.PutUint16(scratch[1:], uint16(f16))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeFloat32(e *bytes.Buffer, f32 float32) error {
+ const argumentSize = 4
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat32
+ binary.BigEndian.PutUint32(scratch[1:], math.Float32bits(f32))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeFloat64(e *bytes.Buffer, f64 float64) error {
+ const argumentSize = 8
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat64
+ binary.BigEndian.PutUint64(scratch[1:], math.Float64bits(f64))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeByteString(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ vk := v.Kind()
+ if vk == reflect.Slice && v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if vk == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 && em.byteSliceLaterEncodingTag != 0 {
+ encodeHead(e, byte(cborTypeTag), em.byteSliceLaterEncodingTag)
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ slen := v.Len()
+ if slen == 0 {
+ return e.WriteByte(byte(cborTypeByteString))
+ }
+ encodeHead(e, byte(cborTypeByteString), uint64(slen))
+ if vk == reflect.Array {
+ for i := 0; i < slen; i++ {
+ e.WriteByte(byte(v.Index(i).Uint()))
+ }
+ return nil
+ }
+ e.Write(v.Bytes())
+ return nil
+}
+
+func encodeString(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ s := v.String()
+ encodeHead(e, byte(em.stringMajorType), uint64(len(s)))
+ e.WriteString(s)
+ return nil
+}
+
+type arrayEncodeFunc struct {
+ f encodeFunc
+}
+
+func (ae arrayEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.byteArray == ByteArrayToByteSlice && v.Type().Elem().Kind() == reflect.Uint8 {
+ return encodeByteString(e, em, v)
+ }
+ if v.Kind() == reflect.Slice && v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ alen := v.Len()
+ if alen == 0 {
+ return e.WriteByte(byte(cborTypeArray))
+ }
+ encodeHead(e, byte(cborTypeArray), uint64(alen))
+ for i := 0; i < alen; i++ {
+ if err := ae.f(e, em, v.Index(i)); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// encodeKeyValueFunc encodes key/value pairs in map (v).
+// If kvs is provided (having the same length as v), length of encoded key and value are stored in kvs.
+// kvs is used for canonical encoding of map.
+type encodeKeyValueFunc func(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error
+
+type mapEncodeFunc struct {
+ e encodeKeyValueFunc
+}
+
+func (me mapEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ mlen := v.Len()
+ if mlen == 0 {
+ return e.WriteByte(byte(cborTypeMap))
+ }
+
+ encodeHead(e, byte(cborTypeMap), uint64(mlen))
+ if em.sort == SortNone || em.sort == SortFastShuffle || mlen <= 1 {
+ return me.e(e, em, v, nil)
+ }
+
+ kvsp := getKeyValues(v.Len()) // for sorting keys
+ defer putKeyValues(kvsp)
+ kvs := *kvsp
+
+ kvBeginOffset := e.Len()
+ if err := me.e(e, em, v, kvs); err != nil {
+ return err
+ }
+ kvTotalLen := e.Len() - kvBeginOffset
+
+ // Use the capacity at the tail of the encode buffer as a staging area to rearrange the
+ // encoded pairs into sorted order.
+ e.Grow(kvTotalLen)
+ tmp := e.Bytes()[e.Len() : e.Len()+kvTotalLen] // Can use e.AvailableBuffer() in Go 1.21+.
+ dst := e.Bytes()[kvBeginOffset:]
+
+ if em.sort == SortBytewiseLexical {
+ sort.Sort(&bytewiseKeyValueSorter{kvs: kvs, data: dst})
+ } else {
+ sort.Sort(&lengthFirstKeyValueSorter{kvs: kvs, data: dst})
+ }
+
+ // This is where the encoded bytes are actually rearranged in the output buffer to reflect
+ // the desired order.
+ sortedOffset := 0
+ for _, kv := range kvs {
+ copy(tmp[sortedOffset:], dst[kv.offset:kv.nextOffset])
+ sortedOffset += kv.nextOffset - kv.offset
+ }
+ copy(dst, tmp[:kvTotalLen])
+
+ return nil
+
+}
+
+// keyValue is the position of an encoded pair in a buffer. All offsets are zero-based and relative
+// to the first byte of the first encoded pair.
+type keyValue struct {
+ offset int
+ valueOffset int
+ nextOffset int
+}
+
+type bytewiseKeyValueSorter struct {
+ kvs []keyValue
+ data []byte
+}
+
+func (x *bytewiseKeyValueSorter) Len() int {
+ return len(x.kvs)
+}
+
+func (x *bytewiseKeyValueSorter) Swap(i, j int) {
+ x.kvs[i], x.kvs[j] = x.kvs[j], x.kvs[i]
+}
+
+func (x *bytewiseKeyValueSorter) Less(i, j int) bool {
+ kvi, kvj := x.kvs[i], x.kvs[j]
+ return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0
+}
+
+type lengthFirstKeyValueSorter struct {
+ kvs []keyValue
+ data []byte
+}
+
+func (x *lengthFirstKeyValueSorter) Len() int {
+ return len(x.kvs)
+}
+
+func (x *lengthFirstKeyValueSorter) Swap(i, j int) {
+ x.kvs[i], x.kvs[j] = x.kvs[j], x.kvs[i]
+}
+
+func (x *lengthFirstKeyValueSorter) Less(i, j int) bool {
+ kvi, kvj := x.kvs[i], x.kvs[j]
+ if keyLengthDifference := (kvi.valueOffset - kvi.offset) - (kvj.valueOffset - kvj.offset); keyLengthDifference != 0 {
+ return keyLengthDifference < 0
+ }
+ return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0
+}
+
+var keyValuePool = sync.Pool{}
+
+func getKeyValues(length int) *[]keyValue {
+ v := keyValuePool.Get()
+ if v == nil {
+ y := make([]keyValue, length)
+ return &y
+ }
+ x := v.(*[]keyValue)
+ if cap(*x) >= length {
+ *x = (*x)[:length]
+ return x
+ }
+ // []keyValue from the pool does not have enough capacity.
+ // Return it back to the pool and create a new one.
+ keyValuePool.Put(x)
+ y := make([]keyValue, length)
+ return &y
+}
+
+func putKeyValues(x *[]keyValue) {
+ *x = (*x)[:0]
+ keyValuePool.Put(x)
+}
+
+func encodeStructToArray(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return err
+ }
+
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+
+ flds := structType.fields
+
+ encodeHead(e, byte(cborTypeArray), uint64(len(flds)))
+ for i := 0; i < len(flds); i++ {
+ f := flds[i]
+
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Write CBOR nil for null pointer to embedded struct
+ e.Write(cborNil)
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+
+ if err := f.ef(e, em, fv); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func encodeStruct(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return err
+ }
+
+ flds := structType.getFields(em)
+
+ start := 0
+ if em.sort == SortFastShuffle && len(flds) > 0 {
+ start = rand.Intn(len(flds)) //nolint:gosec // Don't need a CSPRNG for deck cutting.
+ }
+
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+
+ // Encode head with struct field count.
+ // Head is rewritten later if actual encoded field count is different from struct field count.
+ encodedHeadLen := encodeHead(e, byte(cborTypeMap), uint64(len(flds)))
+
+ kvbegin := e.Len()
+ kvcount := 0
+ for offset := 0; offset < len(flds); offset++ {
+ f := flds[(start+offset)%len(flds)]
+
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Skip null pointer to embedded struct
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+ if f.omitEmpty {
+ empty, err := f.ief(em, fv)
+ if err != nil {
+ return err
+ }
+ if empty {
+ continue
+ }
+ }
+
+ if !f.keyAsInt && em.fieldName == FieldNameToByteString {
+ e.Write(f.cborNameByteString)
+ } else { // int or text string
+ e.Write(f.cborName)
+ }
+
+ if err := f.ef(e, em, fv); err != nil {
+ return err
+ }
+
+ kvcount++
+ }
+
+ if len(flds) == kvcount {
+ // Encoded element count in head is the same as actual element count.
+ return nil
+ }
+
+ // Overwrite the bytes that were reserved for the head before encoding the map entries.
+ var actualHeadLen int
+ {
+ headbuf := *bytes.NewBuffer(e.Bytes()[kvbegin-encodedHeadLen : kvbegin-encodedHeadLen : kvbegin])
+ actualHeadLen = encodeHead(&headbuf, byte(cborTypeMap), uint64(kvcount))
+ }
+
+ if actualHeadLen == encodedHeadLen {
+ // The bytes reserved for the encoded head were exactly the right size, so the
+ // encoded entries are already in their final positions.
+ return nil
+ }
+
+ // We reserved more bytes than needed for the encoded head, based on the number of fields
+ // encoded. The encoded entries are offset to the right by the number of excess reserved
+ // bytes. Shift the entries left to remove the gap.
+ excessReservedBytes := encodedHeadLen - actualHeadLen
+ dst := e.Bytes()[kvbegin-excessReservedBytes : e.Len()-excessReservedBytes]
+ src := e.Bytes()[kvbegin:e.Len()]
+ copy(dst, src)
+
+ // After shifting, the excess bytes are at the end of the output buffer and they are
+ // garbage.
+ e.Truncate(e.Len() - excessReservedBytes)
+ return nil
+}
+
+func encodeIntf(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if v.IsNil() {
+ e.Write(cborNil)
+ return nil
+ }
+ return encode(e, em, v.Elem())
+}
+
+func encodeTime(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ t := v.Interface().(time.Time)
+ if t.IsZero() {
+ e.Write(cborNil) // Even if tag is required, encode as CBOR null.
+ return nil
+ }
+ if em.timeTag == EncTagRequired {
+ tagNumber := 1
+ if em.time == TimeRFC3339 || em.time == TimeRFC3339Nano {
+ tagNumber = 0
+ }
+ encodeHead(e, byte(cborTypeTag), uint64(tagNumber))
+ }
+ switch em.time {
+ case TimeUnix:
+ secs := t.Unix()
+ return encodeInt(e, em, reflect.ValueOf(secs))
+
+ case TimeUnixMicro:
+ t = t.UTC().Round(time.Microsecond)
+ f := float64(t.UnixNano()) / 1e9
+ return encodeFloat(e, em, reflect.ValueOf(f))
+
+ case TimeUnixDynamic:
+ t = t.UTC().Round(time.Microsecond)
+ secs, nsecs := t.Unix(), uint64(t.Nanosecond())
+ if nsecs == 0 {
+ return encodeInt(e, em, reflect.ValueOf(secs))
+ }
+ f := float64(secs) + float64(nsecs)/1e9
+ return encodeFloat(e, em, reflect.ValueOf(f))
+
+ case TimeRFC3339:
+ s := t.Format(time.RFC3339)
+ return encodeString(e, em, reflect.ValueOf(s))
+
+ default: // TimeRFC3339Nano
+ s := t.Format(time.RFC3339Nano)
+ return encodeString(e, em, reflect.ValueOf(s))
+ }
+}
+
+func encodeBigInt(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.bigIntConvert == BigIntConvertReject {
+ return &UnsupportedTypeError{Type: typeBigInt}
+ }
+
+ vbi := v.Interface().(big.Int)
+ sign := vbi.Sign()
+ bi := new(big.Int).SetBytes(vbi.Bytes()) // bi is absolute value of v
+ if sign < 0 {
+ // For negative number, convert to CBOR encoded number (-v-1).
+ bi.Sub(bi, big.NewInt(1))
+ }
+
+ if em.bigIntConvert == BigIntConvertShortest {
+ if bi.IsUint64() {
+ if sign >= 0 {
+ // Encode as CBOR pos int (major type 0)
+ encodeHead(e, byte(cborTypePositiveInt), bi.Uint64())
+ return nil
+ }
+ // Encode as CBOR neg int (major type 1)
+ encodeHead(e, byte(cborTypeNegativeInt), bi.Uint64())
+ return nil
+ }
+ }
+
+ tagNum := 2
+ if sign < 0 {
+ tagNum = 3
+ }
+ // Write tag number
+ encodeHead(e, byte(cborTypeTag), uint64(tagNum))
+ // Write bignum byte string
+ b := bi.Bytes()
+ encodeHead(e, byte(cborTypeByteString), uint64(len(b)))
+ e.Write(b)
+ return nil
+}
+
+type binaryMarshalerEncoder struct {
+ alternateEncode encodeFunc
+ alternateIsEmpty isEmptyFunc
+}
+
+func (bme binaryMarshalerEncoder) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.binaryMarshaler != BinaryMarshalerByteString {
+ return bme.alternateEncode(e, em, v)
+ }
+
+ vt := v.Type()
+ m, ok := v.Interface().(encoding.BinaryMarshaler)
+ if !ok {
+ pv := reflect.New(vt)
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.BinaryMarshaler)
+ }
+ data, err := m.MarshalBinary()
+ if err != nil {
+ return err
+ }
+ if b := em.encTagBytes(vt); b != nil {
+ e.Write(b)
+ }
+ encodeHead(e, byte(cborTypeByteString), uint64(len(data)))
+ e.Write(data)
+ return nil
+}
+
+func (bme binaryMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, error) {
+ if em.binaryMarshaler != BinaryMarshalerByteString {
+ return bme.alternateIsEmpty(em, v)
+ }
+
+ m, ok := v.Interface().(encoding.BinaryMarshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.BinaryMarshaler)
+ }
+ data, err := m.MarshalBinary()
+ if err != nil {
+ return false, err
+ }
+ return len(data) == 0, nil
+}
+
+func encodeMarshalerType(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.tagsMd == TagsForbidden && v.Type() == typeRawTag {
+ return errors.New("cbor: cannot encode cbor.RawTag when TagsMd is TagsForbidden")
+ }
+ m, ok := v.Interface().(Marshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(Marshaler)
+ }
+ data, err := m.MarshalCBOR()
+ if err != nil {
+ return err
+ }
+
+ // Verify returned CBOR data item from MarshalCBOR() is well-formed and passes tag validity for builtin tags 0-3.
+ d := decoder{data: data, dm: getMarshalerDecMode(em.indefLength, em.tagsMd)}
+ err = d.wellformed(false, true)
+ if err != nil {
+ return &MarshalerError{typ: v.Type(), err: err}
+ }
+
+ e.Write(data)
+ return nil
+}
+
+func encodeTag(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.tagsMd == TagsForbidden {
+ return errors.New("cbor: cannot encode cbor.Tag when TagsMd is TagsForbidden")
+ }
+
+ t := v.Interface().(Tag)
+
+ if t.Number == 0 && t.Content == nil {
+ // Marshal uninitialized cbor.Tag
+ e.Write(cborNil)
+ return nil
+ }
+
+ // Marshal tag number
+ encodeHead(e, byte(cborTypeTag), t.Number)
+
+ vem := *em // shallow copy
+
+ // For built-in tags, disable settings that may introduce tag validity errors when
+ // marshaling certain Content values.
+ switch t.Number {
+ case tagNumRFC3339Time:
+ vem.stringType = StringToTextString
+ vem.stringMajorType = cborTypeTextString
+ case tagNumUnsignedBignum, tagNumNegativeBignum:
+ vem.byteSliceLaterFormat = ByteSliceLaterFormatNone
+ vem.byteSliceLaterEncodingTag = 0
+ }
+
+ // Marshal tag content
+ return encode(e, &vem, reflect.ValueOf(t.Content))
+}
+
+// encodeHead writes CBOR head of specified type t and returns number of bytes written.
+func encodeHead(e *bytes.Buffer, t byte, n uint64) int {
+ if n <= maxAdditionalInformationWithoutArgument {
+ const headSize = 1
+ e.WriteByte(t | byte(n))
+ return headSize
+ }
+
+ if n <= math.MaxUint8 {
+ const headSize = 2
+ scratch := [headSize]byte{
+ t | byte(additionalInformationWith1ByteArgument),
+ byte(n),
+ }
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ if n <= math.MaxUint16 {
+ const headSize = 3
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith2ByteArgument)
+ binary.BigEndian.PutUint16(scratch[1:], uint16(n))
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ if n <= math.MaxUint32 {
+ const headSize = 5
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith4ByteArgument)
+ binary.BigEndian.PutUint32(scratch[1:], uint32(n))
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ const headSize = 9
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith8ByteArgument)
+ binary.BigEndian.PutUint64(scratch[1:], n)
+ e.Write(scratch[:])
+ return headSize
+}
+
+var (
+ typeMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem()
+ typeBinaryMarshaler = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem()
+ typeRawMessage = reflect.TypeOf(RawMessage(nil))
+ typeByteString = reflect.TypeOf(ByteString(""))
+)
+
+func getEncodeFuncInternal(t reflect.Type) (ef encodeFunc, ief isEmptyFunc) {
+ k := t.Kind()
+ if k == reflect.Ptr {
+ return getEncodeIndirectValueFunc(t), isEmptyPtr
+ }
+ switch t {
+ case typeSimpleValue:
+ return encodeMarshalerType, isEmptyUint
+
+ case typeTag:
+ return encodeTag, alwaysNotEmpty
+
+ case typeTime:
+ return encodeTime, alwaysNotEmpty
+
+ case typeBigInt:
+ return encodeBigInt, alwaysNotEmpty
+
+ case typeRawMessage:
+ return encodeMarshalerType, isEmptySlice
+
+ case typeByteString:
+ return encodeMarshalerType, isEmptyString
+ }
+ if reflect.PtrTo(t).Implements(typeMarshaler) {
+ return encodeMarshalerType, alwaysNotEmpty
+ }
+ if reflect.PtrTo(t).Implements(typeBinaryMarshaler) {
+ defer func() {
+ // capture encoding method used for modes that disable BinaryMarshaler
+ bme := binaryMarshalerEncoder{
+ alternateEncode: ef,
+ alternateIsEmpty: ief,
+ }
+ ef = bme.encode
+ ief = bme.isEmpty
+ }()
+ }
+ switch k {
+ case reflect.Bool:
+ return encodeBool, isEmptyBool
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return encodeInt, isEmptyInt
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return encodeUint, isEmptyUint
+
+ case reflect.Float32, reflect.Float64:
+ return encodeFloat, isEmptyFloat
+
+ case reflect.String:
+ return encodeString, isEmptyString
+
+ case reflect.Slice:
+ if t.Elem().Kind() == reflect.Uint8 {
+ return encodeByteString, isEmptySlice
+ }
+ fallthrough
+
+ case reflect.Array:
+ f, _ := getEncodeFunc(t.Elem())
+ if f == nil {
+ return nil, nil
+ }
+ return arrayEncodeFunc{f: f}.encode, isEmptySlice
+
+ case reflect.Map:
+ f := getEncodeMapFunc(t)
+ if f == nil {
+ return nil, nil
+ }
+ return f, isEmptyMap
+
+ case reflect.Struct:
+ // Get struct's special field "_" tag options
+ if f, ok := t.FieldByName("_"); ok {
+ tag := f.Tag.Get("cbor")
+ if tag != "-" {
+ if hasToArrayOption(tag) {
+ return encodeStructToArray, isEmptyStruct
+ }
+ }
+ }
+ return encodeStruct, isEmptyStruct
+
+ case reflect.Interface:
+ return encodeIntf, isEmptyIntf
+ }
+ return nil, nil
+}
+
+func getEncodeIndirectValueFunc(t reflect.Type) encodeFunc {
+ for t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+ f, _ := getEncodeFunc(t)
+ if f == nil {
+ return nil
+ }
+ return func(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ for v.Kind() == reflect.Ptr && !v.IsNil() {
+ v = v.Elem()
+ }
+ if v.Kind() == reflect.Ptr && v.IsNil() {
+ e.Write(cborNil)
+ return nil
+ }
+ return f(e, em, v)
+ }
+}
+
+func alwaysNotEmpty(_ *encMode, _ reflect.Value) (empty bool, err error) {
+ return false, nil
+}
+
+func isEmptyBool(_ *encMode, v reflect.Value) (bool, error) {
+ return !v.Bool(), nil
+}
+
+func isEmptyInt(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Int() == 0, nil
+}
+
+func isEmptyUint(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Uint() == 0, nil
+}
+
+func isEmptyFloat(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Float() == 0.0, nil
+}
+
+func isEmptyString(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptySlice(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptyMap(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptyPtr(_ *encMode, v reflect.Value) (bool, error) {
+ return v.IsNil(), nil
+}
+
+func isEmptyIntf(_ *encMode, v reflect.Value) (bool, error) {
+ return v.IsNil(), nil
+}
+
+func isEmptyStruct(em *encMode, v reflect.Value) (bool, error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return false, err
+ }
+
+ if em.omitEmpty == OmitEmptyGoValue {
+ return false, nil
+ }
+
+ if structType.toArray {
+ return len(structType.fields) == 0, nil
+ }
+
+ if len(structType.fields) > len(structType.omitEmptyFieldsIdx) {
+ return false, nil
+ }
+
+ for _, i := range structType.omitEmptyFieldsIdx {
+ f := structType.fields[i]
+
+ // Get field value
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Skip null pointer to embedded struct
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+
+ empty, err := f.ief(em, fv)
+ if err != nil {
+ return false, err
+ }
+ if !empty {
+ return false, nil
+ }
+ }
+ return true, nil
+}
+
+func cannotFitFloat32(f64 float64) bool {
+ f32 := float32(f64)
+ return float64(f32) != f64
+}
+
+// float32NaNFromReflectValue extracts float32 NaN from reflect.Value while preserving NaN's quiet bit.
+func float32NaNFromReflectValue(v reflect.Value) float32 {
+ // Keith Randall's workaround for issue https://github.com/golang/go/issues/36400
+ p := reflect.New(v.Type())
+ p.Elem().Set(v)
+ f32 := p.Convert(reflect.TypeOf((*float32)(nil))).Elem().Interface().(float32)
+ return f32
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode_map.go b/vendor/github.com/fxamacker/cbor/v2/encode_map.go
new file mode 100644
index 00000000000..8b4b4bbc59f
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode_map.go
@@ -0,0 +1,94 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build go1.20
+
+package cbor
+
+import (
+ "bytes"
+ "reflect"
+ "sync"
+)
+
+type mapKeyValueEncodeFunc struct {
+ kf, ef encodeFunc
+ kpool, vpool sync.Pool
+}
+
+func (me *mapKeyValueEncodeFunc) encodeKeyValues(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error {
+ iterk := me.kpool.Get().(*reflect.Value)
+ defer func() {
+ iterk.SetZero()
+ me.kpool.Put(iterk)
+ }()
+ iterv := me.vpool.Get().(*reflect.Value)
+ defer func() {
+ iterv.SetZero()
+ me.vpool.Put(iterv)
+ }()
+
+ if kvs == nil {
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ iterk.SetIterKey(iter)
+ iterv.SetIterValue(iter)
+
+ if err := me.kf(e, em, *iterk); err != nil {
+ return err
+ }
+ if err := me.ef(e, em, *iterv); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+
+ initial := e.Len()
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ iterk.SetIterKey(iter)
+ iterv.SetIterValue(iter)
+
+ offset := e.Len()
+ if err := me.kf(e, em, *iterk); err != nil {
+ return err
+ }
+ valueOffset := e.Len()
+ if err := me.ef(e, em, *iterv); err != nil {
+ return err
+ }
+ kvs[i] = keyValue{
+ offset: offset - initial,
+ valueOffset: valueOffset - initial,
+ nextOffset: e.Len() - initial,
+ }
+ }
+
+ return nil
+}
+
+func getEncodeMapFunc(t reflect.Type) encodeFunc {
+ kf, _ := getEncodeFunc(t.Key())
+ ef, _ := getEncodeFunc(t.Elem())
+ if kf == nil || ef == nil {
+ return nil
+ }
+ mkv := &mapKeyValueEncodeFunc{
+ kf: kf,
+ ef: ef,
+ kpool: sync.Pool{
+ New: func() interface{} {
+ rk := reflect.New(t.Key()).Elem()
+ return &rk
+ },
+ },
+ vpool: sync.Pool{
+ New: func() interface{} {
+ rv := reflect.New(t.Elem()).Elem()
+ return &rv
+ },
+ },
+ }
+ return mapEncodeFunc{
+ e: mkv.encodeKeyValues,
+ }.encode
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go b/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go
new file mode 100644
index 00000000000..31c39336ddf
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go
@@ -0,0 +1,60 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build !go1.20
+
+package cbor
+
+import (
+ "bytes"
+ "reflect"
+)
+
+type mapKeyValueEncodeFunc struct {
+ kf, ef encodeFunc
+}
+
+func (me *mapKeyValueEncodeFunc) encodeKeyValues(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error {
+ if kvs == nil {
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ if err := me.kf(e, em, iter.Key()); err != nil {
+ return err
+ }
+ if err := me.ef(e, em, iter.Value()); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+
+ initial := e.Len()
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ offset := e.Len()
+ if err := me.kf(e, em, iter.Key()); err != nil {
+ return err
+ }
+ valueOffset := e.Len()
+ if err := me.ef(e, em, iter.Value()); err != nil {
+ return err
+ }
+ kvs[i] = keyValue{
+ offset: offset - initial,
+ valueOffset: valueOffset - initial,
+ nextOffset: e.Len() - initial,
+ }
+ }
+
+ return nil
+}
+
+func getEncodeMapFunc(t reflect.Type) encodeFunc {
+ kf, _ := getEncodeFunc(t.Key())
+ ef, _ := getEncodeFunc(t.Elem())
+ if kf == nil || ef == nil {
+ return nil
+ }
+ mkv := &mapKeyValueEncodeFunc{kf: kf, ef: ef}
+ return mapEncodeFunc{
+ e: mkv.encodeKeyValues,
+ }.encode
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/simplevalue.go b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go
new file mode 100644
index 00000000000..de175cee4ad
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go
@@ -0,0 +1,69 @@
+package cbor
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+)
+
+// SimpleValue represents CBOR simple value.
+// CBOR simple value is:
+// - an extension point like CBOR tag.
+// - a subset of CBOR major type 7 that isn't floating-point.
+// - "identified by a number between 0 and 255, but distinct from that number itself".
+// For example, "a simple value 2 is not equivalent to an integer 2" as a CBOR map key.
+//
+// CBOR simple values identified by 20..23 are: "false", "true" , "null", and "undefined".
+// Other CBOR simple values are currently unassigned/reserved by IANA.
+type SimpleValue uint8
+
+var (
+ typeSimpleValue = reflect.TypeOf(SimpleValue(0))
+)
+
+// MarshalCBOR encodes SimpleValue as CBOR simple value (major type 7).
+func (sv SimpleValue) MarshalCBOR() ([]byte, error) {
+ // RFC 8949 3.3. Floating-Point Numbers and Values with No Content says:
+ // "An encoder MUST NOT issue two-byte sequences that start with 0xf8
+ // (major type 7, additional information 24) and continue with a byte
+ // less than 0x20 (32 decimal). Such sequences are not well-formed.
+ // (This implies that an encoder cannot encode false, true, null, or
+ // undefined in two-byte sequences and that only the one-byte variants
+ // of these are well-formed; more generally speaking, each simple value
+ // only has a single representation variant)."
+
+ switch {
+ case sv <= maxSimpleValueInAdditionalInformation:
+ return []byte{byte(cborTypePrimitives) | byte(sv)}, nil
+
+ case sv >= minSimpleValueIn1ByteArgument:
+ return []byte{byte(cborTypePrimitives) | additionalInformationWith1ByteArgument, byte(sv)}, nil
+
+ default:
+ return nil, &UnsupportedValueError{msg: fmt.Sprintf("SimpleValue(%d)", sv)}
+ }
+}
+
+// UnmarshalCBOR decodes CBOR simple value (major type 7) to SimpleValue.
+func (sv *SimpleValue) UnmarshalCBOR(data []byte) error {
+ if sv == nil {
+ return errors.New("cbor.SimpleValue: UnmarshalCBOR on nil pointer")
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ typ, ai, val := d.getHead()
+
+ if typ != cborTypePrimitives {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue"}
+ }
+ if ai > additionalInformationWith1ByteArgument {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue", errorMsg: "not simple values"}
+ }
+
+ // It is safe to cast val to uint8 here because
+ // - data is already verified to be well-formed CBOR simple value and
+ // - val is <= math.MaxUint8.
+ *sv = SimpleValue(val)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/stream.go b/vendor/github.com/fxamacker/cbor/v2/stream.go
new file mode 100644
index 00000000000..507ab6c1849
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/stream.go
@@ -0,0 +1,277 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "errors"
+ "io"
+ "reflect"
+)
+
+// Decoder reads and decodes CBOR values from io.Reader.
+type Decoder struct {
+ r io.Reader
+ d decoder
+ buf []byte
+ off int // next read offset in buf
+ bytesRead int
+}
+
+// NewDecoder returns a new decoder that reads and decodes from r using
+// the default decoding options.
+func NewDecoder(r io.Reader) *Decoder {
+ return defaultDecMode.NewDecoder(r)
+}
+
+// Decode reads CBOR value and decodes it into the value pointed to by v.
+func (dec *Decoder) Decode(v interface{}) error {
+ _, err := dec.readNext()
+ if err != nil {
+ // Return validation error or read error.
+ return err
+ }
+
+ dec.d.reset(dec.buf[dec.off:])
+ err = dec.d.value(v)
+
+ // Increment dec.off even if decoding err is not nil because
+ // dec.d.off points to the next CBOR data item if current
+ // CBOR data item is valid but failed to be decoded into v.
+ // This allows next CBOR data item to be decoded in next
+ // call to this function.
+ dec.off += dec.d.off
+ dec.bytesRead += dec.d.off
+
+ return err
+}
+
+// Skip skips to the next CBOR data item (if there is any),
+// otherwise it returns error such as io.EOF, io.UnexpectedEOF, etc.
+func (dec *Decoder) Skip() error {
+ n, err := dec.readNext()
+ if err != nil {
+ // Return validation error or read error.
+ return err
+ }
+
+ dec.off += n
+ dec.bytesRead += n
+ return nil
+}
+
+// NumBytesRead returns the number of bytes read.
+func (dec *Decoder) NumBytesRead() int {
+ return dec.bytesRead
+}
+
+// Buffered returns a reader for data remaining in Decoder's buffer.
+// Returned reader is valid until the next call to Decode or Skip.
+func (dec *Decoder) Buffered() io.Reader {
+ return bytes.NewReader(dec.buf[dec.off:])
+}
+
+// readNext() reads next CBOR data item from Reader to buffer.
+// It returns the size of next CBOR data item.
+// It also returns validation error or read error if any.
+func (dec *Decoder) readNext() (int, error) {
+ var readErr error
+ var validErr error
+
+ for {
+ // Process any unread data in dec.buf.
+ if dec.off < len(dec.buf) {
+ dec.d.reset(dec.buf[dec.off:])
+ off := dec.off // Save offset before data validation
+ validErr = dec.d.wellformed(true, false)
+ dec.off = off // Restore offset
+
+ if validErr == nil {
+ return dec.d.off, nil
+ }
+
+ if validErr != io.ErrUnexpectedEOF {
+ return 0, validErr
+ }
+
+ // Process last read error on io.ErrUnexpectedEOF.
+ if readErr != nil {
+ if readErr == io.EOF {
+ // current CBOR data item is incomplete.
+ return 0, io.ErrUnexpectedEOF
+ }
+ return 0, readErr
+ }
+ }
+
+ // More data is needed and there was no read error.
+ var n int
+ for n == 0 {
+ n, readErr = dec.read()
+ if n == 0 && readErr != nil {
+ // No more data can be read and read error is encountered.
+ // At this point, validErr is either nil or io.ErrUnexpectedEOF.
+ if readErr == io.EOF {
+ if validErr == io.ErrUnexpectedEOF {
+ // current CBOR data item is incomplete.
+ return 0, io.ErrUnexpectedEOF
+ }
+ }
+ return 0, readErr
+ }
+ }
+
+ // At this point, dec.buf contains new data from last read (n > 0).
+ }
+}
+
+// read() reads data from Reader to buffer.
+// It returns number of bytes read and any read error encountered.
+// Postconditions:
+// - dec.buf contains previously unread data and new data.
+// - dec.off is 0.
+func (dec *Decoder) read() (int, error) {
+ // Grow buf if needed.
+ const minRead = 512
+ if cap(dec.buf)-len(dec.buf)+dec.off < minRead {
+ oldUnreadBuf := dec.buf[dec.off:]
+ dec.buf = make([]byte, len(dec.buf)-dec.off, 2*cap(dec.buf)+minRead)
+ dec.overwriteBuf(oldUnreadBuf)
+ }
+
+ // Copy unread data over read data and reset off to 0.
+ if dec.off > 0 {
+ dec.overwriteBuf(dec.buf[dec.off:])
+ }
+
+ // Read from reader and reslice buf.
+ n, err := dec.r.Read(dec.buf[len(dec.buf):cap(dec.buf)])
+ dec.buf = dec.buf[0 : len(dec.buf)+n]
+ return n, err
+}
+
+func (dec *Decoder) overwriteBuf(newBuf []byte) {
+ n := copy(dec.buf, newBuf)
+ dec.buf = dec.buf[:n]
+ dec.off = 0
+}
+
+// Encoder writes CBOR values to io.Writer.
+type Encoder struct {
+ w io.Writer
+ em *encMode
+ indefTypes []cborType
+}
+
+// NewEncoder returns a new encoder that writes to w using the default encoding options.
+func NewEncoder(w io.Writer) *Encoder {
+ return defaultEncMode.NewEncoder(w)
+}
+
+// Encode writes the CBOR encoding of v.
+func (enc *Encoder) Encode(v interface{}) error {
+ if len(enc.indefTypes) > 0 && v != nil {
+ indefType := enc.indefTypes[len(enc.indefTypes)-1]
+ if indefType == cborTypeTextString {
+ k := reflect.TypeOf(v).Kind()
+ if k != reflect.String {
+ return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length text string")
+ }
+ } else if indefType == cborTypeByteString {
+ t := reflect.TypeOf(v)
+ k := t.Kind()
+ if (k != reflect.Array && k != reflect.Slice) || t.Elem().Kind() != reflect.Uint8 {
+ return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length byte string")
+ }
+ }
+ }
+
+ buf := getEncodeBuffer()
+
+ err := encode(buf, enc.em, reflect.ValueOf(v))
+ if err == nil {
+ _, err = enc.w.Write(buf.Bytes())
+ }
+
+ putEncodeBuffer(buf)
+ return err
+}
+
+// StartIndefiniteByteString starts byte string encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes definite length byte strings
+// ("chunks") as one contiguous string until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteByteString() error {
+ return enc.startIndefinite(cborTypeByteString)
+}
+
+// StartIndefiniteTextString starts text string encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes definite length text strings
+// ("chunks") as one contiguous string until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteTextString() error {
+ return enc.startIndefinite(cborTypeTextString)
+}
+
+// StartIndefiniteArray starts array encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes elements of the array
+// until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteArray() error {
+ return enc.startIndefinite(cborTypeArray)
+}
+
+// StartIndefiniteMap starts array encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes elements of the map
+// until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteMap() error {
+ return enc.startIndefinite(cborTypeMap)
+}
+
+// EndIndefinite closes last opened indefinite length value.
+func (enc *Encoder) EndIndefinite() error {
+ if len(enc.indefTypes) == 0 {
+ return errors.New("cbor: cannot encode \"break\" code outside indefinite length values")
+ }
+ _, err := enc.w.Write([]byte{cborBreakFlag})
+ if err == nil {
+ enc.indefTypes = enc.indefTypes[:len(enc.indefTypes)-1]
+ }
+ return err
+}
+
+var cborIndefHeader = map[cborType][]byte{
+ cborTypeByteString: {cborByteStringWithIndefiniteLengthHead},
+ cborTypeTextString: {cborTextStringWithIndefiniteLengthHead},
+ cborTypeArray: {cborArrayWithIndefiniteLengthHead},
+ cborTypeMap: {cborMapWithIndefiniteLengthHead},
+}
+
+func (enc *Encoder) startIndefinite(typ cborType) error {
+ if enc.em.indefLength == IndefLengthForbidden {
+ return &IndefiniteLengthError{typ}
+ }
+ _, err := enc.w.Write(cborIndefHeader[typ])
+ if err == nil {
+ enc.indefTypes = append(enc.indefTypes, typ)
+ }
+ return err
+}
+
+// RawMessage is a raw encoded CBOR value.
+type RawMessage []byte
+
+// MarshalCBOR returns m or CBOR nil if m is nil.
+func (m RawMessage) MarshalCBOR() ([]byte, error) {
+ if len(m) == 0 {
+ return cborNil, nil
+ }
+ return m, nil
+}
+
+// UnmarshalCBOR creates a copy of data and saves to *m.
+func (m *RawMessage) UnmarshalCBOR(data []byte) error {
+ if m == nil {
+ return errors.New("cbor.RawMessage: UnmarshalCBOR on nil pointer")
+ }
+ *m = append((*m)[0:0], data...)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/structfields.go b/vendor/github.com/fxamacker/cbor/v2/structfields.go
new file mode 100644
index 00000000000..81228acf0fd
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/structfields.go
@@ -0,0 +1,260 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "reflect"
+ "sort"
+ "strings"
+)
+
+type field struct {
+ name string
+ nameAsInt int64 // used to decoder to match field name with CBOR int
+ cborName []byte
+ cborNameByteString []byte // major type 2 name encoding iff cborName has major type 3
+ idx []int
+ typ reflect.Type
+ ef encodeFunc
+ ief isEmptyFunc
+ typInfo *typeInfo // used to decoder to reuse type info
+ tagged bool // used to choose dominant field (at the same level tagged fields dominate untagged fields)
+ omitEmpty bool // used to skip empty field
+ keyAsInt bool // used to encode/decode field name as int
+}
+
+type fields []*field
+
+// indexFieldSorter sorts fields by field idx at each level, breaking ties with idx depth.
+type indexFieldSorter struct {
+ fields fields
+}
+
+func (x *indexFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *indexFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *indexFieldSorter) Less(i, j int) bool {
+ iIdx, jIdx := x.fields[i].idx, x.fields[j].idx
+ for k := 0; k < len(iIdx) && k < len(jIdx); k++ {
+ if iIdx[k] != jIdx[k] {
+ return iIdx[k] < jIdx[k]
+ }
+ }
+ return len(iIdx) <= len(jIdx)
+}
+
+// nameLevelAndTagFieldSorter sorts fields by field name, idx depth, and presence of tag.
+type nameLevelAndTagFieldSorter struct {
+ fields fields
+}
+
+func (x *nameLevelAndTagFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *nameLevelAndTagFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *nameLevelAndTagFieldSorter) Less(i, j int) bool {
+ fi, fj := x.fields[i], x.fields[j]
+ if fi.name != fj.name {
+ return fi.name < fj.name
+ }
+ if len(fi.idx) != len(fj.idx) {
+ return len(fi.idx) < len(fj.idx)
+ }
+ if fi.tagged != fj.tagged {
+ return fi.tagged
+ }
+ return i < j // Field i and j have the same name, depth, and tagged status. Nothing else matters.
+}
+
+// getFields returns visible fields of struct type t following visibility rules for JSON encoding.
+func getFields(t reflect.Type) (flds fields, structOptions string) {
+ // Get special field "_" tag options
+ if f, ok := t.FieldByName("_"); ok {
+ tag := f.Tag.Get("cbor")
+ if tag != "-" {
+ structOptions = tag
+ }
+ }
+
+ // nTypes contains next level anonymous fields' types and indexes
+ // (there can be multiple fields of the same type at the same level)
+ flds, nTypes := appendFields(t, nil, nil, nil)
+
+ if len(nTypes) > 0 {
+
+ var cTypes map[reflect.Type][][]int // current level anonymous fields' types and indexes
+ vTypes := map[reflect.Type]bool{t: true} // visited field types at less nested levels
+
+ for len(nTypes) > 0 {
+ cTypes, nTypes = nTypes, nil
+
+ for t, idx := range cTypes {
+ // If there are multiple anonymous fields of the same struct type at the same level, all are ignored.
+ if len(idx) > 1 {
+ continue
+ }
+
+ // Anonymous field of the same type at deeper nested level is ignored.
+ if vTypes[t] {
+ continue
+ }
+ vTypes[t] = true
+
+ flds, nTypes = appendFields(t, idx[0], flds, nTypes)
+ }
+ }
+ }
+
+ sort.Sort(&nameLevelAndTagFieldSorter{flds})
+
+ // Keep visible fields.
+ j := 0 // index of next unique field
+ for i := 0; i < len(flds); {
+ name := flds[i].name
+ if i == len(flds)-1 || // last field
+ name != flds[i+1].name || // field i has unique field name
+ len(flds[i].idx) < len(flds[i+1].idx) || // field i is at a less nested level than field i+1
+ (flds[i].tagged && !flds[i+1].tagged) { // field i is tagged while field i+1 is not
+ flds[j] = flds[i]
+ j++
+ }
+
+ // Skip fields with the same field name.
+ for i++; i < len(flds) && name == flds[i].name; i++ { //nolint:revive
+ }
+ }
+ if j != len(flds) {
+ flds = flds[:j]
+ }
+
+ // Sort fields by field index
+ sort.Sort(&indexFieldSorter{flds})
+
+ return flds, structOptions
+}
+
+// appendFields appends type t's exportable fields to flds and anonymous struct fields to nTypes .
+func appendFields(
+ t reflect.Type,
+ idx []int,
+ flds fields,
+ nTypes map[reflect.Type][][]int,
+) (
+ _flds fields,
+ _nTypes map[reflect.Type][][]int,
+) {
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+
+ ft := f.Type
+ for ft.Kind() == reflect.Ptr {
+ ft = ft.Elem()
+ }
+
+ if !isFieldExportable(f, ft.Kind()) {
+ continue
+ }
+
+ tag := f.Tag.Get("cbor")
+ if tag == "" {
+ tag = f.Tag.Get("json")
+ }
+ if tag == "-" {
+ continue
+ }
+
+ tagged := tag != ""
+
+ // Parse field tag options
+ var tagFieldName string
+ var omitempty, keyasint bool
+ for j := 0; tag != ""; j++ {
+ var token string
+ idx := strings.IndexByte(tag, ',')
+ if idx == -1 {
+ token, tag = tag, ""
+ } else {
+ token, tag = tag[:idx], tag[idx+1:]
+ }
+ if j == 0 {
+ tagFieldName = token
+ } else {
+ switch token {
+ case "omitempty":
+ omitempty = true
+ case "keyasint":
+ keyasint = true
+ }
+ }
+ }
+
+ fieldName := tagFieldName
+ if tagFieldName == "" {
+ fieldName = f.Name
+ }
+
+ fIdx := make([]int, len(idx)+1)
+ copy(fIdx, idx)
+ fIdx[len(fIdx)-1] = i
+
+ if !f.Anonymous || ft.Kind() != reflect.Struct || tagFieldName != "" {
+ flds = append(flds, &field{
+ name: fieldName,
+ idx: fIdx,
+ typ: f.Type,
+ omitEmpty: omitempty,
+ keyAsInt: keyasint,
+ tagged: tagged})
+ } else {
+ if nTypes == nil {
+ nTypes = make(map[reflect.Type][][]int)
+ }
+ nTypes[ft] = append(nTypes[ft], fIdx)
+ }
+ }
+
+ return flds, nTypes
+}
+
+// isFieldExportable returns true if f is an exportable (regular or anonymous) field or
+// a nonexportable anonymous field of struct type.
+// Nonexportable anonymous field of struct type can contain exportable fields.
+func isFieldExportable(f reflect.StructField, fk reflect.Kind) bool { //nolint:gocritic // ignore hugeParam
+ exportable := f.PkgPath == ""
+ return exportable || (f.Anonymous && fk == reflect.Struct)
+}
+
+type embeddedFieldNullPtrFunc func(reflect.Value) (reflect.Value, error)
+
+// getFieldValue returns field value of struct v by index. When encountering null pointer
+// to anonymous (embedded) struct field, f is called with the last traversed field value.
+func getFieldValue(v reflect.Value, idx []int, f embeddedFieldNullPtrFunc) (fv reflect.Value, err error) {
+ fv = v
+ for i, n := range idx {
+ fv = fv.Field(n)
+
+ if i < len(idx)-1 {
+ if fv.Kind() == reflect.Ptr && fv.Type().Elem().Kind() == reflect.Struct {
+ if fv.IsNil() {
+ // Null pointer to embedded struct field
+ fv, err = f(fv)
+ if err != nil || !fv.IsValid() {
+ return fv, err
+ }
+ }
+ fv = fv.Elem()
+ }
+ }
+ }
+ return fv, nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/tag.go b/vendor/github.com/fxamacker/cbor/v2/tag.go
new file mode 100644
index 00000000000..5c4d2b7a42f
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/tag.go
@@ -0,0 +1,299 @@
+package cbor
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "sync"
+)
+
+// Tag represents CBOR tag data, including tag number and unmarshaled tag content. Marshaling and
+// unmarshaling of tag content is subject to any encode and decode options that would apply to
+// enclosed data item if it were to appear outside of a tag.
+type Tag struct {
+ Number uint64
+ Content interface{}
+}
+
+// RawTag represents CBOR tag data, including tag number and raw tag content.
+// RawTag implements Unmarshaler and Marshaler interfaces.
+type RawTag struct {
+ Number uint64
+ Content RawMessage
+}
+
+// UnmarshalCBOR sets *t with tag number and raw tag content copied from data.
+func (t *RawTag) UnmarshalCBOR(data []byte) error {
+ if t == nil {
+ return errors.New("cbor.RawTag: UnmarshalCBOR on nil pointer")
+ }
+
+ // Decoding CBOR null and undefined to cbor.RawTag is no-op.
+ if len(data) == 1 && (data[0] == 0xf6 || data[0] == 0xf7) {
+ return nil
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Unmarshal tag number.
+ typ, _, num := d.getHead()
+ if typ != cborTypeTag {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: typeRawTag.String()}
+ }
+ t.Number = num
+
+ // Unmarshal tag content.
+ c := d.data[d.off:]
+ t.Content = make([]byte, len(c))
+ copy(t.Content, c)
+ return nil
+}
+
+// MarshalCBOR returns CBOR encoding of t.
+func (t RawTag) MarshalCBOR() ([]byte, error) {
+ if t.Number == 0 && len(t.Content) == 0 {
+ // Marshal uninitialized cbor.RawTag
+ b := make([]byte, len(cborNil))
+ copy(b, cborNil)
+ return b, nil
+ }
+
+ e := getEncodeBuffer()
+
+ encodeHead(e, byte(cborTypeTag), t.Number)
+
+ content := t.Content
+ if len(content) == 0 {
+ content = cborNil
+ }
+
+ buf := make([]byte, len(e.Bytes())+len(content))
+ n := copy(buf, e.Bytes())
+ copy(buf[n:], content)
+
+ putEncodeBuffer(e)
+ return buf, nil
+}
+
+// DecTagMode specifies how decoder handles tag number.
+type DecTagMode int
+
+const (
+ // DecTagIgnored makes decoder ignore tag number (skips if present).
+ DecTagIgnored DecTagMode = iota
+
+ // DecTagOptional makes decoder verify tag number if it's present.
+ DecTagOptional
+
+ // DecTagRequired makes decoder verify tag number and tag number must be present.
+ DecTagRequired
+
+ maxDecTagMode
+)
+
+func (dtm DecTagMode) valid() bool {
+ return dtm >= 0 && dtm < maxDecTagMode
+}
+
+// EncTagMode specifies how encoder handles tag number.
+type EncTagMode int
+
+const (
+ // EncTagNone makes encoder not encode tag number.
+ EncTagNone EncTagMode = iota
+
+ // EncTagRequired makes encoder encode tag number.
+ EncTagRequired
+
+ maxEncTagMode
+)
+
+func (etm EncTagMode) valid() bool {
+ return etm >= 0 && etm < maxEncTagMode
+}
+
+// TagOptions specifies how encoder and decoder handle tag number.
+type TagOptions struct {
+ DecTag DecTagMode
+ EncTag EncTagMode
+}
+
+// TagSet is an interface to add and remove tag info. It is used by EncMode and DecMode
+// to provide CBOR tag support.
+type TagSet interface {
+ // Add adds given tag number(s), content type, and tag options to TagSet.
+ Add(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) error
+
+ // Remove removes given tag content type from TagSet.
+ Remove(contentType reflect.Type)
+
+ tagProvider
+}
+
+type tagProvider interface {
+ getTagItemFromType(t reflect.Type) *tagItem
+ getTypeFromTagNum(num []uint64) reflect.Type
+}
+
+type tagItem struct {
+ num []uint64
+ cborTagNum []byte
+ contentType reflect.Type
+ opts TagOptions
+}
+
+func (t *tagItem) equalTagNum(num []uint64) bool {
+ // Fast path to compare 1 tag number
+ if len(t.num) == 1 && len(num) == 1 && t.num[0] == num[0] {
+ return true
+ }
+
+ if len(t.num) != len(num) {
+ return false
+ }
+
+ for i := 0; i < len(t.num); i++ {
+ if t.num[i] != num[i] {
+ return false
+ }
+ }
+
+ return true
+}
+
+type (
+ tagSet map[reflect.Type]*tagItem
+
+ syncTagSet struct {
+ sync.RWMutex
+ t tagSet
+ }
+)
+
+func (t tagSet) getTagItemFromType(typ reflect.Type) *tagItem {
+ return t[typ]
+}
+
+func (t tagSet) getTypeFromTagNum(num []uint64) reflect.Type {
+ for typ, tag := range t {
+ if tag.equalTagNum(num) {
+ return typ
+ }
+ }
+ return nil
+}
+
+// NewTagSet returns TagSet (safe for concurrency).
+func NewTagSet() TagSet {
+ return &syncTagSet{t: make(map[reflect.Type]*tagItem)}
+}
+
+// Add adds given tag number(s), content type, and tag options to TagSet.
+func (t *syncTagSet) Add(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) error {
+ if contentType == nil {
+ return errors.New("cbor: cannot add nil content type to TagSet")
+ }
+ for contentType.Kind() == reflect.Ptr {
+ contentType = contentType.Elem()
+ }
+ tag, err := newTagItem(opts, contentType, num, nestedNum...)
+ if err != nil {
+ return err
+ }
+ t.Lock()
+ defer t.Unlock()
+ for typ, ti := range t.t {
+ if typ == contentType {
+ return errors.New("cbor: content type " + contentType.String() + " already exists in TagSet")
+ }
+ if ti.equalTagNum(tag.num) {
+ return fmt.Errorf("cbor: tag number %v already exists in TagSet", tag.num)
+ }
+ }
+ t.t[contentType] = tag
+ return nil
+}
+
+// Remove removes given tag content type from TagSet.
+func (t *syncTagSet) Remove(contentType reflect.Type) {
+ for contentType.Kind() == reflect.Ptr {
+ contentType = contentType.Elem()
+ }
+ t.Lock()
+ delete(t.t, contentType)
+ t.Unlock()
+}
+
+func (t *syncTagSet) getTagItemFromType(typ reflect.Type) *tagItem {
+ t.RLock()
+ ti := t.t[typ]
+ t.RUnlock()
+ return ti
+}
+
+func (t *syncTagSet) getTypeFromTagNum(num []uint64) reflect.Type {
+ t.RLock()
+ rt := t.t.getTypeFromTagNum(num)
+ t.RUnlock()
+ return rt
+}
+
+func newTagItem(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) (*tagItem, error) {
+ if opts.DecTag == DecTagIgnored && opts.EncTag == EncTagNone {
+ return nil, errors.New("cbor: cannot add tag with DecTagIgnored and EncTagNone options to TagSet")
+ }
+ if contentType.PkgPath() == "" || contentType.Kind() == reflect.Interface {
+ return nil, errors.New("cbor: can only add named types to TagSet, got " + contentType.String())
+ }
+ if contentType == typeTime {
+ return nil, errors.New("cbor: cannot add time.Time to TagSet, use EncOptions.TimeTag and DecOptions.TimeTag instead")
+ }
+ if contentType == typeBigInt {
+ return nil, errors.New("cbor: cannot add big.Int to TagSet, it's built-in and supported automatically")
+ }
+ if contentType == typeTag {
+ return nil, errors.New("cbor: cannot add cbor.Tag to TagSet")
+ }
+ if contentType == typeRawTag {
+ return nil, errors.New("cbor: cannot add cbor.RawTag to TagSet")
+ }
+ if num == 0 || num == 1 {
+ return nil, errors.New("cbor: cannot add tag number 0 or 1 to TagSet, use EncOptions.TimeTag and DecOptions.TimeTag instead")
+ }
+ if num == 2 || num == 3 {
+ return nil, errors.New("cbor: cannot add tag number 2 or 3 to TagSet, it's built-in and supported automatically")
+ }
+ if num == tagNumSelfDescribedCBOR {
+ return nil, errors.New("cbor: cannot add tag number 55799 to TagSet, it's built-in and ignored automatically")
+ }
+
+ te := tagItem{num: []uint64{num}, opts: opts, contentType: contentType}
+ te.num = append(te.num, nestedNum...)
+
+ // Cache encoded tag numbers
+ e := getEncodeBuffer()
+ for _, n := range te.num {
+ encodeHead(e, byte(cborTypeTag), n)
+ }
+ te.cborTagNum = make([]byte, e.Len())
+ copy(te.cborTagNum, e.Bytes())
+ putEncodeBuffer(e)
+
+ return &te, nil
+}
+
+var (
+ typeTag = reflect.TypeOf(Tag{})
+ typeRawTag = reflect.TypeOf(RawTag{})
+)
+
+// WrongTagError describes mismatch between CBOR tag and registered tag.
+type WrongTagError struct {
+ RegisteredType reflect.Type
+ RegisteredTagNum []uint64
+ TagNum []uint64
+}
+
+func (e *WrongTagError) Error() string {
+ return fmt.Sprintf("cbor: wrong tag number for %s, got %v, expected %v", e.RegisteredType.String(), e.TagNum, e.RegisteredTagNum)
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/valid.go b/vendor/github.com/fxamacker/cbor/v2/valid.go
new file mode 100644
index 00000000000..b40793b95e3
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/valid.go
@@ -0,0 +1,394 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "encoding/binary"
+ "errors"
+ "io"
+ "math"
+ "strconv"
+
+ "github.com/x448/float16"
+)
+
+// SyntaxError is a description of a CBOR syntax error.
+type SyntaxError struct {
+ msg string
+}
+
+func (e *SyntaxError) Error() string { return e.msg }
+
+// SemanticError is a description of a CBOR semantic error.
+type SemanticError struct {
+ msg string
+}
+
+func (e *SemanticError) Error() string { return e.msg }
+
+// MaxNestedLevelError indicates exceeded max nested level of any combination of CBOR arrays/maps/tags.
+type MaxNestedLevelError struct {
+ maxNestedLevels int
+}
+
+func (e *MaxNestedLevelError) Error() string {
+ return "cbor: exceeded max nested level " + strconv.Itoa(e.maxNestedLevels)
+}
+
+// MaxArrayElementsError indicates exceeded max number of elements for CBOR arrays.
+type MaxArrayElementsError struct {
+ maxArrayElements int
+}
+
+func (e *MaxArrayElementsError) Error() string {
+ return "cbor: exceeded max number of elements " + strconv.Itoa(e.maxArrayElements) + " for CBOR array"
+}
+
+// MaxMapPairsError indicates exceeded max number of key-value pairs for CBOR maps.
+type MaxMapPairsError struct {
+ maxMapPairs int
+}
+
+func (e *MaxMapPairsError) Error() string {
+ return "cbor: exceeded max number of key-value pairs " + strconv.Itoa(e.maxMapPairs) + " for CBOR map"
+}
+
+// IndefiniteLengthError indicates found disallowed indefinite length items.
+type IndefiniteLengthError struct {
+ t cborType
+}
+
+func (e *IndefiniteLengthError) Error() string {
+ return "cbor: indefinite-length " + e.t.String() + " isn't allowed"
+}
+
+// TagsMdError indicates found disallowed CBOR tags.
+type TagsMdError struct {
+}
+
+func (e *TagsMdError) Error() string {
+ return "cbor: CBOR tag isn't allowed"
+}
+
+// ExtraneousDataError indicates found extraneous data following well-formed CBOR data item.
+type ExtraneousDataError struct {
+ numOfBytes int // number of bytes of extraneous data
+ index int // location of extraneous data
+}
+
+func (e *ExtraneousDataError) Error() string {
+ return "cbor: " + strconv.Itoa(e.numOfBytes) + " bytes of extraneous data starting at index " + strconv.Itoa(e.index)
+}
+
+// wellformed checks whether the CBOR data item is well-formed.
+// allowExtraData indicates if extraneous data is allowed after the CBOR data item.
+// - use allowExtraData = true when using Decoder.Decode()
+// - use allowExtraData = false when using Unmarshal()
+func (d *decoder) wellformed(allowExtraData bool, checkBuiltinTags bool) error {
+ if len(d.data) == d.off {
+ return io.EOF
+ }
+ _, err := d.wellformedInternal(0, checkBuiltinTags)
+ if err == nil {
+ if !allowExtraData && d.off != len(d.data) {
+ err = &ExtraneousDataError{len(d.data) - d.off, d.off}
+ }
+ }
+ return err
+}
+
+// wellformedInternal checks data's well-formedness and returns max depth and error.
+func (d *decoder) wellformedInternal(depth int, checkBuiltinTags bool) (int, error) { //nolint:gocyclo
+ t, _, val, indefiniteLength, err := d.wellformedHeadWithIndefiniteLengthFlag()
+ if err != nil {
+ return 0, err
+ }
+
+ switch t {
+ case cborTypeByteString, cborTypeTextString:
+ if indefiniteLength {
+ if d.dm.indefLength == IndefLengthForbidden {
+ return 0, &IndefiniteLengthError{t}
+ }
+ return d.wellformedIndefiniteString(t, depth, checkBuiltinTags)
+ }
+ valInt := int(val)
+ if valInt < 0 {
+ // Detect integer overflow
+ return 0, errors.New("cbor: " + t.String() + " length " + strconv.FormatUint(val, 10) + " is too large, causing integer overflow")
+ }
+ if len(d.data)-d.off < valInt { // valInt+off may overflow integer
+ return 0, io.ErrUnexpectedEOF
+ }
+ d.off += valInt
+
+ case cborTypeArray, cborTypeMap:
+ depth++
+ if depth > d.dm.maxNestedLevels {
+ return 0, &MaxNestedLevelError{d.dm.maxNestedLevels}
+ }
+
+ if indefiniteLength {
+ if d.dm.indefLength == IndefLengthForbidden {
+ return 0, &IndefiniteLengthError{t}
+ }
+ return d.wellformedIndefiniteArrayOrMap(t, depth, checkBuiltinTags)
+ }
+
+ valInt := int(val)
+ if valInt < 0 {
+ // Detect integer overflow
+ return 0, errors.New("cbor: " + t.String() + " length " + strconv.FormatUint(val, 10) + " is too large, it would cause integer overflow")
+ }
+
+ if t == cborTypeArray {
+ if valInt > d.dm.maxArrayElements {
+ return 0, &MaxArrayElementsError{d.dm.maxArrayElements}
+ }
+ } else {
+ if valInt > d.dm.maxMapPairs {
+ return 0, &MaxMapPairsError{d.dm.maxMapPairs}
+ }
+ }
+
+ count := 1
+ if t == cborTypeMap {
+ count = 2
+ }
+ maxDepth := depth
+ for j := 0; j < count; j++ {
+ for i := 0; i < valInt; i++ {
+ var dpt int
+ if dpt, err = d.wellformedInternal(depth, checkBuiltinTags); err != nil {
+ return 0, err
+ }
+ if dpt > maxDepth {
+ maxDepth = dpt // Save max depth
+ }
+ }
+ }
+ depth = maxDepth
+
+ case cborTypeTag:
+ if d.dm.tagsMd == TagsForbidden {
+ return 0, &TagsMdError{}
+ }
+
+ tagNum := val
+
+ // Scan nested tag numbers to avoid recursion.
+ for {
+ if len(d.data) == d.off { // Tag number must be followed by tag content.
+ return 0, io.ErrUnexpectedEOF
+ }
+ if checkBuiltinTags {
+ err = validBuiltinTag(tagNum, d.data[d.off])
+ if err != nil {
+ return 0, err
+ }
+ }
+ if d.dm.bignumTag == BignumTagForbidden && (tagNum == 2 || tagNum == 3) {
+ return 0, &UnacceptableDataItemError{
+ CBORType: cborTypeTag.String(),
+ Message: "bignum",
+ }
+ }
+ if getType(d.data[d.off]) != cborTypeTag {
+ break
+ }
+ if _, _, tagNum, err = d.wellformedHead(); err != nil {
+ return 0, err
+ }
+ depth++
+ if depth > d.dm.maxNestedLevels {
+ return 0, &MaxNestedLevelError{d.dm.maxNestedLevels}
+ }
+ }
+ // Check tag content.
+ return d.wellformedInternal(depth, checkBuiltinTags)
+ }
+
+ return depth, nil
+}
+
+// wellformedIndefiniteString checks indefinite length byte/text string's well-formedness and returns max depth and error.
+func (d *decoder) wellformedIndefiniteString(t cborType, depth int, checkBuiltinTags bool) (int, error) {
+ var err error
+ for {
+ if len(d.data) == d.off {
+ return 0, io.ErrUnexpectedEOF
+ }
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ break
+ }
+ // Peek ahead to get next type and indefinite length status.
+ nt, ai := parseInitialByte(d.data[d.off])
+ if t != nt {
+ return 0, &SyntaxError{"cbor: wrong element type " + nt.String() + " for indefinite-length " + t.String()}
+ }
+ if additionalInformation(ai).isIndefiniteLength() {
+ return 0, &SyntaxError{"cbor: indefinite-length " + t.String() + " chunk is not definite-length"}
+ }
+ if depth, err = d.wellformedInternal(depth, checkBuiltinTags); err != nil {
+ return 0, err
+ }
+ }
+ return depth, nil
+}
+
+// wellformedIndefiniteArrayOrMap checks indefinite length array/map's well-formedness and returns max depth and error.
+func (d *decoder) wellformedIndefiniteArrayOrMap(t cborType, depth int, checkBuiltinTags bool) (int, error) {
+ var err error
+ maxDepth := depth
+ i := 0
+ for {
+ if len(d.data) == d.off {
+ return 0, io.ErrUnexpectedEOF
+ }
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ break
+ }
+ var dpt int
+ if dpt, err = d.wellformedInternal(depth, checkBuiltinTags); err != nil {
+ return 0, err
+ }
+ if dpt > maxDepth {
+ maxDepth = dpt
+ }
+ i++
+ if t == cborTypeArray {
+ if i > d.dm.maxArrayElements {
+ return 0, &MaxArrayElementsError{d.dm.maxArrayElements}
+ }
+ } else {
+ if i%2 == 0 && i/2 > d.dm.maxMapPairs {
+ return 0, &MaxMapPairsError{d.dm.maxMapPairs}
+ }
+ }
+ }
+ if t == cborTypeMap && i%2 == 1 {
+ return 0, &SyntaxError{"cbor: unexpected \"break\" code"}
+ }
+ return maxDepth, nil
+}
+
+func (d *decoder) wellformedHeadWithIndefiniteLengthFlag() (
+ t cborType,
+ ai byte,
+ val uint64,
+ indefiniteLength bool,
+ err error,
+) {
+ t, ai, val, err = d.wellformedHead()
+ if err != nil {
+ return
+ }
+ indefiniteLength = additionalInformation(ai).isIndefiniteLength()
+ return
+}
+
+func (d *decoder) wellformedHead() (t cborType, ai byte, val uint64, err error) {
+ dataLen := len(d.data) - d.off
+ if dataLen == 0 {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+
+ t, ai = parseInitialByte(d.data[d.off])
+ val = uint64(ai)
+ d.off++
+ dataLen--
+
+ if ai <= maxAdditionalInformationWithoutArgument {
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith1ByteArgument {
+ const argumentSize = 1
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = uint64(d.data[d.off])
+ d.off++
+ if t == cborTypePrimitives && val < 32 {
+ return 0, 0, 0, &SyntaxError{"cbor: invalid simple value " + strconv.Itoa(int(val)) + " for type " + t.String()}
+ }
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith2ByteArgument {
+ const argumentSize = 2
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = uint64(binary.BigEndian.Uint16(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ if t == cborTypePrimitives {
+ if err := d.acceptableFloat(float64(float16.Frombits(uint16(val)).Float32())); err != nil {
+ return 0, 0, 0, err
+ }
+ }
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith4ByteArgument {
+ const argumentSize = 4
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = uint64(binary.BigEndian.Uint32(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ if t == cborTypePrimitives {
+ if err := d.acceptableFloat(float64(math.Float32frombits(uint32(val)))); err != nil {
+ return 0, 0, 0, err
+ }
+ }
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith8ByteArgument {
+ const argumentSize = 8
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = binary.BigEndian.Uint64(d.data[d.off : d.off+argumentSize])
+ d.off += argumentSize
+ if t == cborTypePrimitives {
+ if err := d.acceptableFloat(math.Float64frombits(val)); err != nil {
+ return 0, 0, 0, err
+ }
+ }
+ return t, ai, val, nil
+ }
+
+ if additionalInformation(ai).isIndefiniteLength() {
+ switch t {
+ case cborTypePositiveInt, cborTypeNegativeInt, cborTypeTag:
+ return 0, 0, 0, &SyntaxError{"cbor: invalid additional information " + strconv.Itoa(int(ai)) + " for type " + t.String()}
+ case cborTypePrimitives: // 0xff (break code) should not be outside wellformedIndefinite().
+ return 0, 0, 0, &SyntaxError{"cbor: unexpected \"break\" code"}
+ }
+ return t, ai, val, nil
+ }
+
+ // ai == 28, 29, 30
+ return 0, 0, 0, &SyntaxError{"cbor: invalid additional information " + strconv.Itoa(int(ai)) + " for type " + t.String()}
+}
+
+func (d *decoder) acceptableFloat(f float64) error {
+ switch {
+ case d.dm.nanDec == NaNDecodeForbidden && math.IsNaN(f):
+ return &UnacceptableDataItemError{
+ CBORType: cborTypePrimitives.String(),
+ Message: "floating-point NaN",
+ }
+ case d.dm.infDec == InfDecodeForbidden && math.IsInf(f, 0):
+ return &UnacceptableDataItemError{
+ CBORType: cborTypePrimitives.String(),
+ Message: "floating-point infinity",
+ }
+ }
+ return nil
+}
diff --git a/vendor/github.com/google/cel-go/cel/BUILD.bazel b/vendor/github.com/google/cel-go/cel/BUILD.bazel
index 0905f635395..6e2fc073d4d 100644
--- a/vendor/github.com/google/cel-go/cel/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/cel/BUILD.bazel
@@ -10,9 +10,12 @@ go_library(
"cel.go",
"decls.go",
"env.go",
+ "folding.go",
"io.go",
+ "inlining.go",
"library.go",
"macro.go",
+ "optimizer.go",
"options.go",
"program.go",
"validator.go",
@@ -56,7 +59,11 @@ go_test(
"cel_test.go",
"decls_test.go",
"env_test.go",
+ "folding_test.go",
"io_test.go",
+ "inlining_test.go",
+ "optimizer_test.go",
+ "validator_test.go",
],
data = [
"//cel/testdata:gen_test_fds",
@@ -70,6 +77,7 @@ go_test(
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
+ "//ext:go_default_library",
"//test:go_default_library",
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
diff --git a/vendor/github.com/google/cel-go/cel/decls.go b/vendor/github.com/google/cel-go/cel/decls.go
index 0f9501341b4..b59e3708de6 100644
--- a/vendor/github.com/google/cel-go/cel/decls.go
+++ b/vendor/github.com/google/cel-go/cel/decls.go
@@ -353,43 +353,3 @@ func ExprDeclToDeclaration(d *exprpb.Decl) (EnvOption, error) {
return nil, fmt.Errorf("unsupported decl: %v", d)
}
}
-
-func typeValueToKind(tv ref.Type) (Kind, error) {
- switch tv {
- case types.BoolType:
- return BoolKind, nil
- case types.DoubleType:
- return DoubleKind, nil
- case types.IntType:
- return IntKind, nil
- case types.UintType:
- return UintKind, nil
- case types.ListType:
- return ListKind, nil
- case types.MapType:
- return MapKind, nil
- case types.StringType:
- return StringKind, nil
- case types.BytesType:
- return BytesKind, nil
- case types.DurationType:
- return DurationKind, nil
- case types.TimestampType:
- return TimestampKind, nil
- case types.NullType:
- return NullTypeKind, nil
- case types.TypeType:
- return TypeKind, nil
- default:
- switch tv.TypeName() {
- case "dyn":
- return DynKind, nil
- case "google.protobuf.Any":
- return AnyKind, nil
- case "optional":
- return OpaqueKind, nil
- default:
- return 0, fmt.Errorf("no known conversion for type of %s", tv.TypeName())
- }
- }
-}
diff --git a/vendor/github.com/google/cel-go/cel/env.go b/vendor/github.com/google/cel-go/cel/env.go
index b5c3b4cc556..6568a8b8092 100644
--- a/vendor/github.com/google/cel-go/cel/env.go
+++ b/vendor/github.com/google/cel-go/cel/env.go
@@ -38,26 +38,42 @@ type Source = common.Source
// Ast representing the checked or unchecked expression, its source, and related metadata such as
// source position information.
type Ast struct {
- expr *exprpb.Expr
- info *exprpb.SourceInfo
- source Source
- refMap map[int64]*celast.ReferenceInfo
- typeMap map[int64]*types.Type
+ source Source
+ impl *celast.AST
+}
+
+// NativeRep converts the AST to a Go-native representation.
+func (ast *Ast) NativeRep() *celast.AST {
+ return ast.impl
}
// Expr returns the proto serializable instance of the parsed/checked expression.
+//
+// Deprecated: prefer cel.AstToCheckedExpr() or cel.AstToParsedExpr() and call GetExpr()
+// the result instead.
func (ast *Ast) Expr() *exprpb.Expr {
- return ast.expr
+ if ast == nil {
+ return nil
+ }
+ pbExpr, _ := celast.ExprToProto(ast.impl.Expr())
+ return pbExpr
}
// IsChecked returns whether the Ast value has been successfully type-checked.
func (ast *Ast) IsChecked() bool {
- return ast.typeMap != nil && len(ast.typeMap) > 0
+ if ast == nil {
+ return false
+ }
+ return ast.impl.IsChecked()
}
// SourceInfo returns character offset and newline position information about expression elements.
func (ast *Ast) SourceInfo() *exprpb.SourceInfo {
- return ast.info
+ if ast == nil {
+ return nil
+ }
+ pbInfo, _ := celast.SourceInfoToProto(ast.impl.SourceInfo())
+ return pbInfo
}
// ResultType returns the output type of the expression if the Ast has been type-checked, else
@@ -65,9 +81,6 @@ func (ast *Ast) SourceInfo() *exprpb.SourceInfo {
//
// Deprecated: use OutputType
func (ast *Ast) ResultType() *exprpb.Type {
- if !ast.IsChecked() {
- return chkdecls.Dyn
- }
out := ast.OutputType()
t, err := TypeToExprType(out)
if err != nil {
@@ -79,16 +92,18 @@ func (ast *Ast) ResultType() *exprpb.Type {
// OutputType returns the output type of the expression if the Ast has been type-checked, else
// returns cel.DynType as the parse step cannot infer types.
func (ast *Ast) OutputType() *Type {
- t, found := ast.typeMap[ast.expr.GetId()]
- if !found {
- return DynType
+ if ast == nil {
+ return types.ErrorType
}
- return t
+ return ast.impl.GetType(ast.impl.Expr().ID())
}
// Source returns a view of the input used to create the Ast. This source may be complete or
// constructed from the SourceInfo.
func (ast *Ast) Source() Source {
+ if ast == nil {
+ return nil
+ }
return ast.source
}
@@ -198,29 +213,28 @@ func NewCustomEnv(opts ...EnvOption) (*Env, error) {
// It is possible to have both non-nil Ast and Issues values returned from this call: however,
// the mere presence of an Ast does not imply that it is valid for use.
func (e *Env) Check(ast *Ast) (*Ast, *Issues) {
- // Note, errors aren't currently possible on the Ast to ParsedExpr conversion.
- pe, _ := AstToParsedExpr(ast)
-
// Construct the internal checker env, erroring if there is an issue adding the declarations.
chk, err := e.initChecker()
if err != nil {
errs := common.NewErrors(ast.Source())
errs.ReportError(common.NoLocation, err.Error())
- return nil, NewIssuesWithSourceInfo(errs, ast.SourceInfo())
+ return nil, NewIssuesWithSourceInfo(errs, ast.impl.SourceInfo())
}
- res, errs := checker.Check(pe, ast.Source(), chk)
+ checked, errs := checker.Check(ast.impl, ast.Source(), chk)
if len(errs.GetErrors()) > 0 {
- return nil, NewIssuesWithSourceInfo(errs, ast.SourceInfo())
+ return nil, NewIssuesWithSourceInfo(errs, ast.impl.SourceInfo())
}
// Manually create the Ast to ensure that the Ast source information (which may be more
// detailed than the information provided by Check), is returned to the caller.
ast = &Ast{
- source: ast.Source(),
- expr: res.Expr,
- info: res.SourceInfo,
- refMap: res.ReferenceMap,
- typeMap: res.TypeMap}
+ source: ast.Source(),
+ impl: checked}
+
+ // Avoid creating a validator config if it's not needed.
+ if len(e.validators) == 0 {
+ return ast, nil
+ }
// Generate a validator configuration from the set of configured validators.
vConfig := newValidatorConfig()
@@ -230,9 +244,9 @@ func (e *Env) Check(ast *Ast) (*Ast, *Issues) {
}
}
// Apply additional validators on the type-checked result.
- iss := NewIssuesWithSourceInfo(errs, ast.SourceInfo())
+ iss := NewIssuesWithSourceInfo(errs, ast.impl.SourceInfo())
for _, v := range e.validators {
- v.Validate(e, vConfig, res, iss)
+ v.Validate(e, vConfig, checked, iss)
}
if iss.Err() != nil {
return nil, iss
@@ -429,16 +443,11 @@ func (e *Env) Parse(txt string) (*Ast, *Issues) {
// It is possible to have both non-nil Ast and Issues values returned from this call; however,
// the mere presence of an Ast does not imply that it is valid for use.
func (e *Env) ParseSource(src Source) (*Ast, *Issues) {
- res, errs := e.prsr.Parse(src)
+ parsed, errs := e.prsr.Parse(src)
if len(errs.GetErrors()) > 0 {
return nil, &Issues{errs: errs}
}
- // Manually create the Ast to ensure that the text source information is propagated on
- // subsequent calls to Check.
- return &Ast{
- source: src,
- expr: res.GetExpr(),
- info: res.GetSourceInfo()}, nil
+ return &Ast{source: src, impl: parsed}, nil
}
// Program generates an evaluable instance of the Ast within the environment (Env).
@@ -534,8 +543,9 @@ func (e *Env) PartialVars(vars any) (interpreter.PartialActivation, error) {
// TODO: Consider adding an option to generate a Program.Residual to avoid round-tripping to an
// Ast format and then Program again.
func (e *Env) ResidualAst(a *Ast, details *EvalDetails) (*Ast, error) {
- pruned := interpreter.PruneAst(a.Expr(), a.SourceInfo().GetMacroCalls(), details.State())
- expr, err := AstToString(ParsedExprToAst(pruned))
+ pruned := interpreter.PruneAst(a.impl.Expr(), a.impl.SourceInfo().MacroCalls(), details.State())
+ newAST := &Ast{source: a.Source(), impl: pruned}
+ expr, err := AstToString(newAST)
if err != nil {
return nil, err
}
@@ -556,16 +566,10 @@ func (e *Env) ResidualAst(a *Ast, details *EvalDetails) (*Ast, error) {
// EstimateCost estimates the cost of a type checked CEL expression using the length estimates of input data and
// extension functions provided by estimator.
func (e *Env) EstimateCost(ast *Ast, estimator checker.CostEstimator, opts ...checker.CostOption) (checker.CostEstimate, error) {
- checked := &celast.CheckedAST{
- Expr: ast.Expr(),
- SourceInfo: ast.SourceInfo(),
- TypeMap: ast.typeMap,
- ReferenceMap: ast.refMap,
- }
extendedOpts := make([]checker.CostOption, 0, len(e.costOptions))
extendedOpts = append(extendedOpts, opts...)
extendedOpts = append(extendedOpts, e.costOptions...)
- return checker.Cost(checked, estimator, extendedOpts...)
+ return checker.Cost(ast.impl, estimator, extendedOpts...)
}
// configure applies a series of EnvOptions to the current environment.
@@ -707,7 +711,7 @@ type Error = common.Error
// Note: in the future, non-fatal warnings and notices may be inspectable via the Issues struct.
type Issues struct {
errs *common.Errors
- info *exprpb.SourceInfo
+ info *celast.SourceInfo
}
// NewIssues returns an Issues struct from a common.Errors object.
@@ -718,7 +722,7 @@ func NewIssues(errs *common.Errors) *Issues {
// NewIssuesWithSourceInfo returns an Issues struct from a common.Errors object with SourceInfo metatata
// which can be used with the `ReportErrorAtID` method for additional error reports within the context
// information that's inferred from an expression id.
-func NewIssuesWithSourceInfo(errs *common.Errors, info *exprpb.SourceInfo) *Issues {
+func NewIssuesWithSourceInfo(errs *common.Errors, info *celast.SourceInfo) *Issues {
return &Issues{
errs: errs,
info: info,
@@ -768,30 +772,7 @@ func (i *Issues) String() string {
// The source metadata for the expression at `id`, if present, is attached to the error report.
// To ensure that source metadata is attached to error reports, use NewIssuesWithSourceInfo.
func (i *Issues) ReportErrorAtID(id int64, message string, args ...any) {
- i.errs.ReportErrorAtID(id, locationByID(id, i.info), message, args...)
-}
-
-// locationByID returns a common.Location given an expression id.
-//
-// TODO: move this functionality into the native SourceInfo and an overhaul of the common.Source
-// as this implementation relies on the abstractions present in the protobuf SourceInfo object,
-// and is replicated in the checker.
-func locationByID(id int64, sourceInfo *exprpb.SourceInfo) common.Location {
- positions := sourceInfo.GetPositions()
- var line = 1
- if offset, found := positions[id]; found {
- col := int(offset)
- for _, lineOffset := range sourceInfo.GetLineOffsets() {
- if lineOffset < offset {
- line++
- col = int(offset - lineOffset)
- } else {
- break
- }
- }
- return common.NewLocation(line, col)
- }
- return common.NoLocation
+ i.errs.ReportErrorAtID(id, i.info.GetStartLocation(id), message, args...)
}
// getStdEnv lazy initializes the CEL standard environment.
@@ -822,6 +803,13 @@ func (p *interopCELTypeProvider) FindStructType(typeName string) (*types.Type, b
return nil, false
}
+// FindStructFieldNames returns an empty set of field for the interop provider.
+//
+// To inspect the field names, migrate to a `types.Provider` implementation.
+func (p *interopCELTypeProvider) FindStructFieldNames(typeName string) ([]string, bool) {
+ return []string{}, false
+}
+
// FindStructFieldType returns a types.FieldType instance for the given fully-qualified typeName and field
// name, if one exists.
//
diff --git a/vendor/github.com/google/cel-go/cel/folding.go b/vendor/github.com/google/cel-go/cel/folding.go
new file mode 100644
index 00000000000..d7060896d37
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/folding.go
@@ -0,0 +1,559 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cel
+
+import (
+ "fmt"
+
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/operators"
+ "github.com/google/cel-go/common/overloads"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+// ConstantFoldingOption defines a functional option for configuring constant folding.
+type ConstantFoldingOption func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error)
+
+// MaxConstantFoldIterations limits the number of times literals may be folding during optimization.
+//
+// Defaults to 100 if not set.
+func MaxConstantFoldIterations(limit int) ConstantFoldingOption {
+ return func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error) {
+ opt.maxFoldIterations = limit
+ return opt, nil
+ }
+}
+
+// NewConstantFoldingOptimizer creates an optimizer which inlines constant scalar an aggregate
+// literal values within function calls and select statements with their evaluated result.
+func NewConstantFoldingOptimizer(opts ...ConstantFoldingOption) (ASTOptimizer, error) {
+ folder := &constantFoldingOptimizer{
+ maxFoldIterations: defaultMaxConstantFoldIterations,
+ }
+ var err error
+ for _, o := range opts {
+ folder, err = o(folder)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return folder, nil
+}
+
+type constantFoldingOptimizer struct {
+ maxFoldIterations int
+}
+
+// Optimize queries the expression graph for scalar and aggregate literal expressions within call and
+// select statements and then evaluates them and replaces the call site with the literal result.
+//
+// Note: only values which can be represented as literals in CEL syntax are supported.
+func (opt *constantFoldingOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST {
+ root := ast.NavigateAST(a)
+
+ // Walk the list of foldable expression and continue to fold until there are no more folds left.
+ // All of the fold candidates returned by the constantExprMatcher should succeed unless there's
+ // a logic bug with the selection of expressions.
+ foldableExprs := ast.MatchDescendants(root, constantExprMatcher)
+ foldCount := 0
+ for len(foldableExprs) != 0 && foldCount < opt.maxFoldIterations {
+ for _, fold := range foldableExprs {
+ // If the expression could be folded because it's a non-strict call, and the
+ // branches are pruned, continue to the next fold.
+ if fold.Kind() == ast.CallKind && maybePruneBranches(ctx, fold) {
+ continue
+ }
+ // Otherwise, assume all context is needed to evaluate the expression.
+ err := tryFold(ctx, a, fold)
+ if err != nil {
+ ctx.ReportErrorAtID(fold.ID(), "constant-folding evaluation failed: %v", err.Error())
+ return a
+ }
+ }
+ foldCount++
+ foldableExprs = ast.MatchDescendants(root, constantExprMatcher)
+ }
+ // Once all of the constants have been folded, try to run through the remaining comprehensions
+ // one last time. In this case, there's no guarantee they'll run, so we only update the
+ // target comprehension node with the literal value if the evaluation succeeds.
+ for _, compre := range ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind)) {
+ tryFold(ctx, a, compre)
+ }
+
+ // If the output is a list, map, or struct which contains optional entries, then prune it
+ // to make sure that the optionals, if resolved, do not surface in the output literal.
+ pruneOptionalElements(ctx, root)
+
+ // Ensure that all intermediate values in the folded expression can be represented as valid
+ // CEL literals within the AST structure. Use `PostOrderVisit` rather than `MatchDescendents`
+ // to avoid extra allocations during this final pass through the AST.
+ ast.PostOrderVisit(root, ast.NewExprVisitor(func(e ast.Expr) {
+ if e.Kind() != ast.LiteralKind {
+ return
+ }
+ val := e.AsLiteral()
+ adapted, err := adaptLiteral(ctx, val)
+ if err != nil {
+ ctx.ReportErrorAtID(root.ID(), "constant-folding evaluation failed: %v", err.Error())
+ return
+ }
+ ctx.UpdateExpr(e, adapted)
+ }))
+
+ return a
+}
+
+// tryFold attempts to evaluate a sub-expression to a literal.
+//
+// If the evaluation succeeds, the input expr value will be modified to become a literal, otherwise
+// the method will return an error.
+func tryFold(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) error {
+ // Assume all context is needed to evaluate the expression.
+ subAST := &Ast{
+ impl: ast.NewCheckedAST(ast.NewAST(expr, a.SourceInfo()), a.TypeMap(), a.ReferenceMap()),
+ }
+ prg, err := ctx.Program(subAST)
+ if err != nil {
+ return err
+ }
+ out, _, err := prg.Eval(NoVars())
+ if err != nil {
+ return err
+ }
+ // Update the fold expression to be a literal.
+ ctx.UpdateExpr(expr, ctx.NewLiteral(out))
+ return nil
+}
+
+// maybePruneBranches inspects the non-strict call expression to determine whether
+// a branch can be removed. Evaluation will naturally prune logical and / or calls,
+// but conditional will not be pruned cleanly, so this is one small area where the
+// constant folding step reimplements a portion of the evaluator.
+func maybePruneBranches(ctx *OptimizerContext, expr ast.NavigableExpr) bool {
+ call := expr.AsCall()
+ args := call.Args()
+ switch call.FunctionName() {
+ case operators.LogicalAnd, operators.LogicalOr:
+ return maybeShortcircuitLogic(ctx, call.FunctionName(), args, expr)
+ case operators.Conditional:
+ cond := args[0]
+ truthy := args[1]
+ falsy := args[2]
+ if cond.Kind() != ast.LiteralKind {
+ return false
+ }
+ if cond.AsLiteral() == types.True {
+ ctx.UpdateExpr(expr, truthy)
+ } else {
+ ctx.UpdateExpr(expr, falsy)
+ }
+ return true
+ case operators.In:
+ haystack := args[1]
+ if haystack.Kind() == ast.ListKind && haystack.AsList().Size() == 0 {
+ ctx.UpdateExpr(expr, ctx.NewLiteral(types.False))
+ return true
+ }
+ needle := args[0]
+ if needle.Kind() == ast.LiteralKind && haystack.Kind() == ast.ListKind {
+ needleValue := needle.AsLiteral()
+ list := haystack.AsList()
+ for _, e := range list.Elements() {
+ if e.Kind() == ast.LiteralKind && e.AsLiteral().Equal(needleValue) == types.True {
+ ctx.UpdateExpr(expr, ctx.NewLiteral(types.True))
+ return true
+ }
+ }
+ }
+ }
+ return false
+}
+
+func maybeShortcircuitLogic(ctx *OptimizerContext, function string, args []ast.Expr, expr ast.NavigableExpr) bool {
+ shortcircuit := types.False
+ skip := types.True
+ if function == operators.LogicalOr {
+ shortcircuit = types.True
+ skip = types.False
+ }
+ newArgs := []ast.Expr{}
+ for _, arg := range args {
+ if arg.Kind() != ast.LiteralKind {
+ newArgs = append(newArgs, arg)
+ continue
+ }
+ if arg.AsLiteral() == skip {
+ continue
+ }
+ if arg.AsLiteral() == shortcircuit {
+ ctx.UpdateExpr(expr, arg)
+ return true
+ }
+ }
+ if len(newArgs) == 0 {
+ newArgs = append(newArgs, args[0])
+ ctx.UpdateExpr(expr, newArgs[0])
+ return true
+ }
+ if len(newArgs) == 1 {
+ ctx.UpdateExpr(expr, newArgs[0])
+ return true
+ }
+ ctx.UpdateExpr(expr, ctx.NewCall(function, newArgs...))
+ return true
+}
+
+// pruneOptionalElements works from the bottom up to resolve optional elements within
+// aggregate literals.
+//
+// Note, many aggregate literals will be resolved as arguments to functions or select
+// statements, so this method exists to handle the case where the literal could not be
+// fully resolved or exists outside of a call, select, or comprehension context.
+func pruneOptionalElements(ctx *OptimizerContext, root ast.NavigableExpr) {
+ aggregateLiterals := ast.MatchDescendants(root, aggregateLiteralMatcher)
+ for _, lit := range aggregateLiterals {
+ switch lit.Kind() {
+ case ast.ListKind:
+ pruneOptionalListElements(ctx, lit)
+ case ast.MapKind:
+ pruneOptionalMapEntries(ctx, lit)
+ case ast.StructKind:
+ pruneOptionalStructFields(ctx, lit)
+ }
+ }
+}
+
+func pruneOptionalListElements(ctx *OptimizerContext, e ast.Expr) {
+ l := e.AsList()
+ elems := l.Elements()
+ optIndices := l.OptionalIndices()
+ if len(optIndices) == 0 {
+ return
+ }
+ updatedElems := []ast.Expr{}
+ updatedIndices := []int32{}
+ newOptIndex := -1
+ for _, e := range elems {
+ newOptIndex++
+ if !l.IsOptional(int32(newOptIndex)) {
+ updatedElems = append(updatedElems, e)
+ continue
+ }
+ if e.Kind() != ast.LiteralKind {
+ updatedElems = append(updatedElems, e)
+ updatedIndices = append(updatedIndices, int32(newOptIndex))
+ continue
+ }
+ optElemVal, ok := e.AsLiteral().(*types.Optional)
+ if !ok {
+ updatedElems = append(updatedElems, e)
+ updatedIndices = append(updatedIndices, int32(newOptIndex))
+ continue
+ }
+ if !optElemVal.HasValue() {
+ newOptIndex-- // Skipping causes the list to get smaller.
+ continue
+ }
+ ctx.UpdateExpr(e, ctx.NewLiteral(optElemVal.GetValue()))
+ updatedElems = append(updatedElems, e)
+ }
+ ctx.UpdateExpr(e, ctx.NewList(updatedElems, updatedIndices))
+}
+
+func pruneOptionalMapEntries(ctx *OptimizerContext, e ast.Expr) {
+ m := e.AsMap()
+ entries := m.Entries()
+ updatedEntries := []ast.EntryExpr{}
+ modified := false
+ for _, e := range entries {
+ entry := e.AsMapEntry()
+ key := entry.Key()
+ val := entry.Value()
+ // If the entry is not optional, or the value-side of the optional hasn't
+ // been resolved to a literal, then preserve the entry as-is.
+ if !entry.IsOptional() || val.Kind() != ast.LiteralKind {
+ updatedEntries = append(updatedEntries, e)
+ continue
+ }
+ optElemVal, ok := val.AsLiteral().(*types.Optional)
+ if !ok {
+ updatedEntries = append(updatedEntries, e)
+ continue
+ }
+ // When the key is not a literal, but the value is, then it needs to be
+ // restored to an optional value.
+ if key.Kind() != ast.LiteralKind {
+ undoOptVal, err := adaptLiteral(ctx, optElemVal)
+ if err != nil {
+ ctx.ReportErrorAtID(val.ID(), "invalid map value literal %v: %v", optElemVal, err)
+ }
+ ctx.UpdateExpr(val, undoOptVal)
+ updatedEntries = append(updatedEntries, e)
+ continue
+ }
+ modified = true
+ if !optElemVal.HasValue() {
+ continue
+ }
+ ctx.UpdateExpr(val, ctx.NewLiteral(optElemVal.GetValue()))
+ updatedEntry := ctx.NewMapEntry(key, val, false)
+ updatedEntries = append(updatedEntries, updatedEntry)
+ }
+ if modified {
+ ctx.UpdateExpr(e, ctx.NewMap(updatedEntries))
+ }
+}
+
+func pruneOptionalStructFields(ctx *OptimizerContext, e ast.Expr) {
+ s := e.AsStruct()
+ fields := s.Fields()
+ updatedFields := []ast.EntryExpr{}
+ modified := false
+ for _, f := range fields {
+ field := f.AsStructField()
+ val := field.Value()
+ if !field.IsOptional() || val.Kind() != ast.LiteralKind {
+ updatedFields = append(updatedFields, f)
+ continue
+ }
+ optElemVal, ok := val.AsLiteral().(*types.Optional)
+ if !ok {
+ updatedFields = append(updatedFields, f)
+ continue
+ }
+ modified = true
+ if !optElemVal.HasValue() {
+ continue
+ }
+ ctx.UpdateExpr(val, ctx.NewLiteral(optElemVal.GetValue()))
+ updatedField := ctx.NewStructField(field.Name(), val, false)
+ updatedFields = append(updatedFields, updatedField)
+ }
+ if modified {
+ ctx.UpdateExpr(e, ctx.NewStruct(s.TypeName(), updatedFields))
+ }
+}
+
+// adaptLiteral converts a runtime CEL value to its equivalent literal expression.
+//
+// For strongly typed values, the type-provider will be used to reconstruct the fields
+// which are present in the literal and their equivalent initialization values.
+func adaptLiteral(ctx *OptimizerContext, val ref.Val) (ast.Expr, error) {
+ switch t := val.Type().(type) {
+ case *types.Type:
+ switch t {
+ case types.BoolType, types.BytesType, types.DoubleType, types.IntType,
+ types.NullType, types.StringType, types.UintType:
+ return ctx.NewLiteral(val), nil
+ case types.DurationType:
+ return ctx.NewCall(
+ overloads.TypeConvertDuration,
+ ctx.NewLiteral(val.ConvertToType(types.StringType)),
+ ), nil
+ case types.TimestampType:
+ return ctx.NewCall(
+ overloads.TypeConvertTimestamp,
+ ctx.NewLiteral(val.ConvertToType(types.StringType)),
+ ), nil
+ case types.OptionalType:
+ opt := val.(*types.Optional)
+ if !opt.HasValue() {
+ return ctx.NewCall("optional.none"), nil
+ }
+ target, err := adaptLiteral(ctx, opt.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return ctx.NewCall("optional.of", target), nil
+ case types.TypeType:
+ return ctx.NewIdent(val.(*types.Type).TypeName()), nil
+ case types.ListType:
+ l, ok := val.(traits.Lister)
+ if !ok {
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+ }
+ elems := make([]ast.Expr, l.Size().(types.Int))
+ idx := 0
+ it := l.Iterator()
+ for it.HasNext() == types.True {
+ elemVal := it.Next()
+ elemExpr, err := adaptLiteral(ctx, elemVal)
+ if err != nil {
+ return nil, err
+ }
+ elems[idx] = elemExpr
+ idx++
+ }
+ return ctx.NewList(elems, []int32{}), nil
+ case types.MapType:
+ m, ok := val.(traits.Mapper)
+ if !ok {
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+ }
+ entries := make([]ast.EntryExpr, m.Size().(types.Int))
+ idx := 0
+ it := m.Iterator()
+ for it.HasNext() == types.True {
+ keyVal := it.Next()
+ keyExpr, err := adaptLiteral(ctx, keyVal)
+ if err != nil {
+ return nil, err
+ }
+ valVal := m.Get(keyVal)
+ valExpr, err := adaptLiteral(ctx, valVal)
+ if err != nil {
+ return nil, err
+ }
+ entries[idx] = ctx.NewMapEntry(keyExpr, valExpr, false)
+ idx++
+ }
+ return ctx.NewMap(entries), nil
+ default:
+ provider := ctx.CELTypeProvider()
+ fields, found := provider.FindStructFieldNames(t.TypeName())
+ if !found {
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+ }
+ tester := val.(traits.FieldTester)
+ indexer := val.(traits.Indexer)
+ fieldInits := []ast.EntryExpr{}
+ for _, f := range fields {
+ field := types.String(f)
+ if tester.IsSet(field) != types.True {
+ continue
+ }
+ fieldVal := indexer.Get(field)
+ fieldExpr, err := adaptLiteral(ctx, fieldVal)
+ if err != nil {
+ return nil, err
+ }
+ fieldInits = append(fieldInits, ctx.NewStructField(f, fieldExpr, false))
+ }
+ return ctx.NewStruct(t.TypeName(), fieldInits), nil
+ }
+ }
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+}
+
+// constantExprMatcher matches calls, select statements, and comprehensions whose arguments
+// are all constant scalar or aggregate literal values.
+//
+// Only comprehensions which are not nested are included as possible constant folds, and only
+// if all variables referenced in the comprehension stack exist are only iteration or
+// accumulation variables.
+func constantExprMatcher(e ast.NavigableExpr) bool {
+ switch e.Kind() {
+ case ast.CallKind:
+ return constantCallMatcher(e)
+ case ast.SelectKind:
+ sel := e.AsSelect() // guaranteed to be a navigable value
+ return constantMatcher(sel.Operand().(ast.NavigableExpr))
+ case ast.ComprehensionKind:
+ if isNestedComprehension(e) {
+ return false
+ }
+ vars := map[string]bool{}
+ constantExprs := true
+ visitor := ast.NewExprVisitor(func(e ast.Expr) {
+ if e.Kind() == ast.ComprehensionKind {
+ nested := e.AsComprehension()
+ vars[nested.AccuVar()] = true
+ vars[nested.IterVar()] = true
+ }
+ if e.Kind() == ast.IdentKind && !vars[e.AsIdent()] {
+ constantExprs = false
+ }
+ })
+ ast.PreOrderVisit(e, visitor)
+ return constantExprs
+ default:
+ return false
+ }
+}
+
+// constantCallMatcher identifies strict and non-strict calls which can be folded.
+func constantCallMatcher(e ast.NavigableExpr) bool {
+ call := e.AsCall()
+ children := e.Children()
+ fnName := call.FunctionName()
+ if fnName == operators.LogicalAnd {
+ for _, child := range children {
+ if child.Kind() == ast.LiteralKind {
+ return true
+ }
+ }
+ }
+ if fnName == operators.LogicalOr {
+ for _, child := range children {
+ if child.Kind() == ast.LiteralKind {
+ return true
+ }
+ }
+ }
+ if fnName == operators.Conditional {
+ cond := children[0]
+ if cond.Kind() == ast.LiteralKind && cond.AsLiteral().Type() == types.BoolType {
+ return true
+ }
+ }
+ if fnName == operators.In {
+ haystack := children[1]
+ if haystack.Kind() == ast.ListKind && haystack.AsList().Size() == 0 {
+ return true
+ }
+ needle := children[0]
+ if needle.Kind() == ast.LiteralKind && haystack.Kind() == ast.ListKind {
+ needleValue := needle.AsLiteral()
+ list := haystack.AsList()
+ for _, e := range list.Elements() {
+ if e.Kind() == ast.LiteralKind && e.AsLiteral().Equal(needleValue) == types.True {
+ return true
+ }
+ }
+ }
+ }
+ // convert all other calls with constant arguments
+ for _, child := range children {
+ if !constantMatcher(child) {
+ return false
+ }
+ }
+ return true
+}
+
+func isNestedComprehension(e ast.NavigableExpr) bool {
+ parent, found := e.Parent()
+ for found {
+ if parent.Kind() == ast.ComprehensionKind {
+ return true
+ }
+ parent, found = parent.Parent()
+ }
+ return false
+}
+
+func aggregateLiteralMatcher(e ast.NavigableExpr) bool {
+ return e.Kind() == ast.ListKind || e.Kind() == ast.MapKind || e.Kind() == ast.StructKind
+}
+
+var (
+ constantMatcher = ast.ConstantValueMatcher()
+)
+
+const (
+ defaultMaxConstantFoldIterations = 100
+)
diff --git a/vendor/github.com/google/cel-go/cel/inlining.go b/vendor/github.com/google/cel-go/cel/inlining.go
new file mode 100644
index 00000000000..78d5bea65b1
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/inlining.go
@@ -0,0 +1,228 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cel
+
+import (
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/containers"
+ "github.com/google/cel-go/common/operators"
+ "github.com/google/cel-go/common/overloads"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+// InlineVariable holds a variable name to be matched and an AST representing
+// the expression graph which should be used to replace it.
+type InlineVariable struct {
+ name string
+ alias string
+ def *ast.AST
+}
+
+// Name returns the qualified variable or field selection to replace.
+func (v *InlineVariable) Name() string {
+ return v.name
+}
+
+// Alias returns the alias to use when performing cel.bind() calls during inlining.
+func (v *InlineVariable) Alias() string {
+ return v.alias
+}
+
+// Expr returns the inlined expression value.
+func (v *InlineVariable) Expr() ast.Expr {
+ return v.def.Expr()
+}
+
+// Type indicates the inlined expression type.
+func (v *InlineVariable) Type() *Type {
+ return v.def.GetType(v.def.Expr().ID())
+}
+
+// NewInlineVariable declares a variable name to be replaced by a checked expression.
+func NewInlineVariable(name string, definition *Ast) *InlineVariable {
+ return NewInlineVariableWithAlias(name, name, definition)
+}
+
+// NewInlineVariableWithAlias declares a variable name to be replaced by a checked expression.
+// If the variable occurs more than once, the provided alias will be used to replace the expressions
+// where the variable name occurs.
+func NewInlineVariableWithAlias(name, alias string, definition *Ast) *InlineVariable {
+ return &InlineVariable{name: name, alias: alias, def: definition.impl}
+}
+
+// NewInliningOptimizer creates and optimizer which replaces variables with expression definitions.
+//
+// If a variable occurs one time, the variable is replaced by the inline definition. If the
+// variable occurs more than once, the variable occurences are replaced by a cel.bind() call.
+func NewInliningOptimizer(inlineVars ...*InlineVariable) ASTOptimizer {
+ return &inliningOptimizer{variables: inlineVars}
+}
+
+type inliningOptimizer struct {
+ variables []*InlineVariable
+}
+
+func (opt *inliningOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST {
+ root := ast.NavigateAST(a)
+ for _, inlineVar := range opt.variables {
+ matches := ast.MatchDescendants(root, opt.matchVariable(inlineVar.Name()))
+ // Skip cases where the variable isn't in the expression graph
+ if len(matches) == 0 {
+ continue
+ }
+
+ // For a single match, do a direct replacement of the expression sub-graph.
+ if len(matches) == 1 || !isBindable(matches, inlineVar.Expr(), inlineVar.Type()) {
+ for _, match := range matches {
+ // Copy the inlined AST expr and source info.
+ copyExpr := ctx.CopyASTAndMetadata(inlineVar.def)
+ opt.inlineExpr(ctx, match, copyExpr, inlineVar.Type())
+ }
+ continue
+ }
+
+ // For multiple matches, find the least common ancestor (lca) and insert the
+ // variable as a cel.bind() macro.
+ var lca ast.NavigableExpr = root
+ lcaAncestorCount := 0
+ ancestors := map[int64]int{}
+ for _, match := range matches {
+ // Update the identifier matches with the provided alias.
+ parent, found := match, true
+ for found {
+ ancestorCount, hasAncestor := ancestors[parent.ID()]
+ if !hasAncestor {
+ ancestors[parent.ID()] = 1
+ parent, found = parent.Parent()
+ continue
+ }
+ if lcaAncestorCount < ancestorCount || (lcaAncestorCount == ancestorCount && lca.Depth() < parent.Depth()) {
+ lca = parent
+ lcaAncestorCount = ancestorCount
+ }
+ ancestors[parent.ID()] = ancestorCount + 1
+ parent, found = parent.Parent()
+ }
+ aliasExpr := ctx.NewIdent(inlineVar.Alias())
+ opt.inlineExpr(ctx, match, aliasExpr, inlineVar.Type())
+ }
+
+ // Copy the inlined AST expr and source info.
+ copyExpr := ctx.CopyASTAndMetadata(inlineVar.def)
+ // Update the least common ancestor by inserting a cel.bind() call to the alias.
+ inlined, bindMacro := ctx.NewBindMacro(lca.ID(), inlineVar.Alias(), copyExpr, lca)
+ opt.inlineExpr(ctx, lca, inlined, inlineVar.Type())
+ ctx.SetMacroCall(lca.ID(), bindMacro)
+ }
+ return a
+}
+
+// inlineExpr replaces the current expression with the inlined one, unless the location of the inlining
+// happens within a presence test, e.g. has(a.b.c) -> inline alpha for a.b.c in which case an attempt is
+// made to determine whether the inlined value can be presence or existence tested.
+func (opt *inliningOptimizer) inlineExpr(ctx *OptimizerContext, prev ast.NavigableExpr, inlined ast.Expr, inlinedType *Type) {
+ switch prev.Kind() {
+ case ast.SelectKind:
+ sel := prev.AsSelect()
+ if !sel.IsTestOnly() {
+ ctx.UpdateExpr(prev, inlined)
+ return
+ }
+ opt.rewritePresenceExpr(ctx, prev, inlined, inlinedType)
+ default:
+ ctx.UpdateExpr(prev, inlined)
+ }
+}
+
+// rewritePresenceExpr converts the inlined expression, when it occurs within a has() macro, to type-safe
+// expression appropriate for the inlined type, if possible.
+//
+// If the rewrite is not possible an error is reported at the inline expression site.
+func (opt *inliningOptimizer) rewritePresenceExpr(ctx *OptimizerContext, prev, inlined ast.Expr, inlinedType *Type) {
+ // If the input inlined expression is not a select expression it won't work with the has()
+ // macro. Attempt to rewrite the presence test in terms of the typed input, otherwise error.
+ if inlined.Kind() == ast.SelectKind {
+ presenceTest, hasMacro := ctx.NewHasMacro(prev.ID(), inlined)
+ ctx.UpdateExpr(prev, presenceTest)
+ ctx.SetMacroCall(prev.ID(), hasMacro)
+ return
+ }
+
+ ctx.ClearMacroCall(prev.ID())
+ if inlinedType.IsAssignableType(NullType) {
+ ctx.UpdateExpr(prev,
+ ctx.NewCall(operators.NotEquals,
+ inlined,
+ ctx.NewLiteral(types.NullValue),
+ ))
+ return
+ }
+ if inlinedType.HasTrait(traits.SizerType) {
+ ctx.UpdateExpr(prev,
+ ctx.NewCall(operators.NotEquals,
+ ctx.NewMemberCall(overloads.Size, inlined),
+ ctx.NewLiteral(types.IntZero),
+ ))
+ return
+ }
+ ctx.ReportErrorAtID(prev.ID(), "unable to inline expression type %v into presence test", inlinedType)
+}
+
+// isBindable indicates whether the inlined type can be used within a cel.bind() if the expression
+// being replaced occurs within a presence test. Value types with a size() method or field selection
+// support can be bound.
+//
+// In future iterations, support may also be added for indexer types which can be rewritten as an `in`
+// expression; however, this would imply a rewrite of the inlined expression that may not be necessary
+// in most cases.
+func isBindable(matches []ast.NavigableExpr, inlined ast.Expr, inlinedType *Type) bool {
+ if inlinedType.IsAssignableType(NullType) ||
+ inlinedType.HasTrait(traits.SizerType) {
+ return true
+ }
+ for _, m := range matches {
+ if m.Kind() != ast.SelectKind {
+ continue
+ }
+ sel := m.AsSelect()
+ if sel.IsTestOnly() {
+ return false
+ }
+ }
+ return true
+}
+
+// matchVariable matches simple identifiers, select expressions, and presence test expressions
+// which match the (potentially) qualified variable name provided as input.
+//
+// Note, this function does not support inlining against select expressions which includes optional
+// field selection. This may be a future refinement.
+func (opt *inliningOptimizer) matchVariable(varName string) ast.ExprMatcher {
+ return func(e ast.NavigableExpr) bool {
+ if e.Kind() == ast.IdentKind && e.AsIdent() == varName {
+ return true
+ }
+ if e.Kind() == ast.SelectKind {
+ sel := e.AsSelect()
+ // While the `ToQualifiedName` call could take the select directly, this
+ // would skip presence tests from possible matches, which we would like
+ // to include.
+ qualName, found := containers.ToQualifiedName(sel.Operand())
+ return found && qualName+"."+sel.FieldName() == varName
+ }
+ return false
+ }
+}
diff --git a/vendor/github.com/google/cel-go/cel/io.go b/vendor/github.com/google/cel-go/cel/io.go
index 80f63140e30..3133fb9d7d6 100644
--- a/vendor/github.com/google/cel-go/cel/io.go
+++ b/vendor/github.com/google/cel-go/cel/io.go
@@ -47,17 +47,11 @@ func CheckedExprToAst(checkedExpr *exprpb.CheckedExpr) *Ast {
//
// Prefer CheckedExprToAst if loading expressions from storage.
func CheckedExprToAstWithSource(checkedExpr *exprpb.CheckedExpr, src Source) (*Ast, error) {
- checkedAST, err := ast.CheckedExprToCheckedAST(checkedExpr)
+ checked, err := ast.ToAST(checkedExpr)
if err != nil {
return nil, err
}
- return &Ast{
- expr: checkedAST.Expr,
- info: checkedAST.SourceInfo,
- source: src,
- refMap: checkedAST.ReferenceMap,
- typeMap: checkedAST.TypeMap,
- }, nil
+ return &Ast{source: src, impl: checked}, nil
}
// AstToCheckedExpr converts an Ast to an protobuf CheckedExpr value.
@@ -67,13 +61,7 @@ func AstToCheckedExpr(a *Ast) (*exprpb.CheckedExpr, error) {
if !a.IsChecked() {
return nil, fmt.Errorf("cannot convert unchecked ast")
}
- cAst := &ast.CheckedAST{
- Expr: a.expr,
- SourceInfo: a.info,
- ReferenceMap: a.refMap,
- TypeMap: a.typeMap,
- }
- return ast.CheckedASTToCheckedExpr(cAst)
+ return ast.ToProto(a.impl)
}
// ParsedExprToAst converts a parsed expression proto message to an Ast.
@@ -89,18 +77,12 @@ func ParsedExprToAst(parsedExpr *exprpb.ParsedExpr) *Ast {
//
// Prefer ParsedExprToAst if loading expressions from storage.
func ParsedExprToAstWithSource(parsedExpr *exprpb.ParsedExpr, src Source) *Ast {
- si := parsedExpr.GetSourceInfo()
- if si == nil {
- si = &exprpb.SourceInfo{}
- }
+ info, _ := ast.ProtoToSourceInfo(parsedExpr.GetSourceInfo())
if src == nil {
- src = common.NewInfoSource(si)
- }
- return &Ast{
- expr: parsedExpr.GetExpr(),
- info: si,
- source: src,
+ src = common.NewInfoSource(parsedExpr.GetSourceInfo())
}
+ e, _ := ast.ProtoToExpr(parsedExpr.GetExpr())
+ return &Ast{source: src, impl: ast.NewAST(e, info)}
}
// AstToParsedExpr converts an Ast to an protobuf ParsedExpr value.
@@ -116,9 +98,7 @@ func AstToParsedExpr(a *Ast) (*exprpb.ParsedExpr, error) {
// Note, the conversion may not be an exact replica of the original expression, but will produce
// a string that is semantically equivalent and whose textual representation is stable.
func AstToString(a *Ast) (string, error) {
- expr := a.Expr()
- info := a.SourceInfo()
- return parser.Unparse(expr, info)
+ return parser.Unparse(a.impl.Expr(), a.impl.SourceInfo())
}
// RefValueToValue converts between ref.Val and api.expr.Value.
diff --git a/vendor/github.com/google/cel-go/cel/library.go b/vendor/github.com/google/cel-go/cel/library.go
index 4d232085c24..deddc14e59a 100644
--- a/vendor/github.com/google/cel-go/cel/library.go
+++ b/vendor/github.com/google/cel-go/cel/library.go
@@ -20,6 +20,7 @@ import (
"strings"
"time"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/stdlib"
@@ -28,8 +29,6 @@ import (
"github.com/google/cel-go/common/types/traits"
"github.com/google/cel-go/interpreter"
"github.com/google/cel-go/parser"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
const (
@@ -313,7 +312,7 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
Types(types.OptionalType),
// Configure the optMap and optFlatMap macros.
- Macros(NewReceiverMacro(optMapMacro, 2, optMap)),
+ Macros(ReceiverMacro(optMapMacro, 2, optMap)),
// Global and member functions for working with optional values.
Function(optionalOfFunc,
@@ -374,7 +373,7 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
Overload("optional_map_index_value", []*Type{OptionalType(mapTypeKV), paramTypeK}, optionalTypeV)),
}
if lib.version >= 1 {
- opts = append(opts, Macros(NewReceiverMacro(optFlatMapMacro, 2, optFlatMap)))
+ opts = append(opts, Macros(ReceiverMacro(optFlatMapMacro, 2, optFlatMap)))
}
return opts
}
@@ -386,57 +385,57 @@ func (lib *optionalLib) ProgramOptions() []ProgramOption {
}
}
-func optMap(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
+func optMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *Error) {
varIdent := args[0]
varName := ""
- switch varIdent.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- varName = varIdent.GetIdentExpr().GetName()
+ switch varIdent.Kind() {
+ case ast.IdentKind:
+ varName = varIdent.AsIdent()
default:
- return nil, meh.NewError(varIdent.GetId(), "optMap() variable name must be a simple identifier")
+ return nil, meh.NewError(varIdent.ID(), "optMap() variable name must be a simple identifier")
}
mapExpr := args[1]
- return meh.GlobalCall(
+ return meh.NewCall(
operators.Conditional,
- meh.ReceiverCall(hasValueFunc, target),
- meh.GlobalCall(optionalOfFunc,
- meh.Fold(
- unusedIterVar,
+ meh.NewMemberCall(hasValueFunc, target),
+ meh.NewCall(optionalOfFunc,
+ meh.NewComprehension(
meh.NewList(),
+ unusedIterVar,
varName,
- meh.ReceiverCall(valueFunc, target),
- meh.LiteralBool(false),
- meh.Ident(varName),
+ meh.NewMemberCall(valueFunc, target),
+ meh.NewLiteral(types.False),
+ meh.NewIdent(varName),
mapExpr,
),
),
- meh.GlobalCall(optionalNoneFunc),
+ meh.NewCall(optionalNoneFunc),
), nil
}
-func optFlatMap(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
+func optFlatMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *Error) {
varIdent := args[0]
varName := ""
- switch varIdent.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- varName = varIdent.GetIdentExpr().GetName()
+ switch varIdent.Kind() {
+ case ast.IdentKind:
+ varName = varIdent.AsIdent()
default:
- return nil, meh.NewError(varIdent.GetId(), "optFlatMap() variable name must be a simple identifier")
+ return nil, meh.NewError(varIdent.ID(), "optFlatMap() variable name must be a simple identifier")
}
mapExpr := args[1]
- return meh.GlobalCall(
+ return meh.NewCall(
operators.Conditional,
- meh.ReceiverCall(hasValueFunc, target),
- meh.Fold(
- unusedIterVar,
+ meh.NewMemberCall(hasValueFunc, target),
+ meh.NewComprehension(
meh.NewList(),
+ unusedIterVar,
varName,
- meh.ReceiverCall(valueFunc, target),
- meh.LiteralBool(false),
- meh.Ident(varName),
+ meh.NewMemberCall(valueFunc, target),
+ meh.NewLiteral(types.False),
+ meh.NewIdent(varName),
mapExpr,
),
- meh.GlobalCall(optionalNoneFunc),
+ meh.NewCall(optionalNoneFunc),
), nil
}
diff --git a/vendor/github.com/google/cel-go/cel/macro.go b/vendor/github.com/google/cel-go/cel/macro.go
index 1eb414c8be4..4db1fd57a9c 100644
--- a/vendor/github.com/google/cel-go/cel/macro.go
+++ b/vendor/github.com/google/cel-go/cel/macro.go
@@ -15,6 +15,11 @@
package cel
import (
+ "fmt"
+
+ "github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
"github.com/google/cel-go/parser"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
@@ -26,7 +31,14 @@ import (
// a Macro should be created per arg-count or as a var arg macro.
type Macro = parser.Macro
-// MacroExpander converts a call and its associated arguments into a new CEL abstract syntax tree.
+// MacroFactory defines an expansion function which converts a call and its arguments to a cel.Expr value.
+type MacroFactory = parser.MacroExpander
+
+// MacroExprFactory assists with the creation of Expr values in a manner which is consistent
+// the internal semantics and id generation behaviors of the parser and checker libraries.
+type MacroExprFactory = parser.ExprHelper
+
+// MacroExpander converts a call and its associated arguments into a protobuf Expr representation.
//
// If the MacroExpander determines within the implementation that an expansion is not needed it may return
// a nil Expr value to indicate a non-match. However, if an expansion is to be performed, but the arguments
@@ -36,48 +48,197 @@ type Macro = parser.Macro
// and produces as output an Expr ast node.
//
// Note: when the Macro.IsReceiverStyle() method returns true, the target argument will be nil.
-type MacroExpander = parser.MacroExpander
+type MacroExpander func(eh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error)
// MacroExprHelper exposes helper methods for creating new expressions within a CEL abstract syntax tree.
-type MacroExprHelper = parser.ExprHelper
+// ExprHelper assists with the manipulation of proto-based Expr values in a manner which is
+// consistent with the source position and expression id generation code leveraged by both
+// the parser and type-checker.
+type MacroExprHelper interface {
+ // Copy the input expression with a brand new set of identifiers.
+ Copy(*exprpb.Expr) *exprpb.Expr
+
+ // LiteralBool creates an Expr value for a bool literal.
+ LiteralBool(value bool) *exprpb.Expr
+
+ // LiteralBytes creates an Expr value for a byte literal.
+ LiteralBytes(value []byte) *exprpb.Expr
+
+ // LiteralDouble creates an Expr value for double literal.
+ LiteralDouble(value float64) *exprpb.Expr
+
+ // LiteralInt creates an Expr value for an int literal.
+ LiteralInt(value int64) *exprpb.Expr
+
+ // LiteralString creates am Expr value for a string literal.
+ LiteralString(value string) *exprpb.Expr
+
+ // LiteralUint creates an Expr value for a uint literal.
+ LiteralUint(value uint64) *exprpb.Expr
+
+ // NewList creates a CreateList instruction where the list is comprised of the optional set
+ // of elements provided as arguments.
+ NewList(elems ...*exprpb.Expr) *exprpb.Expr
+
+ // NewMap creates a CreateStruct instruction for a map where the map is comprised of the
+ // optional set of key, value entries.
+ NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+
+ // NewMapEntry creates a Map Entry for the key, value pair.
+ NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+
+ // NewObject creates a CreateStruct instruction for an object with a given type name and
+ // optional set of field initializers.
+ NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+
+ // NewObjectFieldInit creates a new Object field initializer from the field name and value.
+ NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+
+ // Fold creates a fold comprehension instruction.
+ //
+ // - iterVar is the iteration variable name.
+ // - iterRange represents the expression that resolves to a list or map where the elements or
+ // keys (respectively) will be iterated over.
+ // - accuVar is the accumulation variable name, typically parser.AccumulatorName.
+ // - accuInit is the initial expression whose value will be set for the accuVar prior to
+ // folding.
+ // - condition is the expression to test to determine whether to continue folding.
+ // - step is the expression to evaluation at the conclusion of a single fold iteration.
+ // - result is the computation to evaluate at the conclusion of the fold.
+ //
+ // The accuVar should not shadow variable names that you would like to reference within the
+ // environment in the step and condition expressions. Presently, the name __result__ is commonly
+ // used by built-in macros but this may change in the future.
+ Fold(iterVar string,
+ iterRange *exprpb.Expr,
+ accuVar string,
+ accuInit *exprpb.Expr,
+ condition *exprpb.Expr,
+ step *exprpb.Expr,
+ result *exprpb.Expr) *exprpb.Expr
+
+ // Ident creates an identifier Expr value.
+ Ident(name string) *exprpb.Expr
+
+ // AccuIdent returns an accumulator identifier for use with comprehension results.
+ AccuIdent() *exprpb.Expr
+
+ // GlobalCall creates a function call Expr value for a global (free) function.
+ GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr
+
+ // ReceiverCall creates a function call Expr value for a receiver-style function.
+ ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr
+
+ // PresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
+ PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr
+
+ // Select create a field traversal Expr value.
+ Select(operand *exprpb.Expr, field string) *exprpb.Expr
+
+ // OffsetLocation returns the Location of the expression identifier.
+ OffsetLocation(exprID int64) common.Location
+
+ // NewError associates an error message with a given expression id.
+ NewError(exprID int64, message string) *Error
+}
+
+// GlobalMacro creates a Macro for a global function with the specified arg count.
+func GlobalMacro(function string, argCount int, factory MacroFactory) Macro {
+ return parser.NewGlobalMacro(function, argCount, factory)
+}
+
+// ReceiverMacro creates a Macro for a receiver function matching the specified arg count.
+func ReceiverMacro(function string, argCount int, factory MacroFactory) Macro {
+ return parser.NewReceiverMacro(function, argCount, factory)
+}
+
+// GlobalVarArgMacro creates a Macro for a global function with a variable arg count.
+func GlobalVarArgMacro(function string, factory MacroFactory) Macro {
+ return parser.NewGlobalVarArgMacro(function, factory)
+}
+
+// ReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count.
+func ReceiverVarArgMacro(function string, factory MacroFactory) Macro {
+ return parser.NewReceiverVarArgMacro(function, factory)
+}
// NewGlobalMacro creates a Macro for a global function with the specified arg count.
+//
+// Deprecated: use GlobalMacro
func NewGlobalMacro(function string, argCount int, expander MacroExpander) Macro {
- return parser.NewGlobalMacro(function, argCount, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewGlobalMacro(function, argCount, expand.Expander)
}
// NewReceiverMacro creates a Macro for a receiver function matching the specified arg count.
+//
+// Deprecated: use ReceiverMacro
func NewReceiverMacro(function string, argCount int, expander MacroExpander) Macro {
- return parser.NewReceiverMacro(function, argCount, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewReceiverMacro(function, argCount, expand.Expander)
}
// NewGlobalVarArgMacro creates a Macro for a global function with a variable arg count.
+//
+// Deprecated: use GlobalVarArgMacro
func NewGlobalVarArgMacro(function string, expander MacroExpander) Macro {
- return parser.NewGlobalVarArgMacro(function, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewGlobalVarArgMacro(function, expand.Expander)
}
// NewReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count.
+//
+// Deprecated: use ReceiverVarArgMacro
func NewReceiverVarArgMacro(function string, expander MacroExpander) Macro {
- return parser.NewReceiverVarArgMacro(function, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewReceiverVarArgMacro(function, expand.Expander)
}
// HasMacroExpander expands the input call arguments into a presence test, e.g. has(.field)
func HasMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeHas(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ arg, err := adaptToExpr(args[0])
+ if err != nil {
+ return nil, err
+ }
+ if arg.Kind() == ast.SelectKind {
+ s := arg.AsSelect()
+ return adaptToProto(ph.NewPresenceTest(s.Operand(), s.FieldName()))
+ }
+ return nil, ph.NewError(arg.ID(), "invalid argument to has() macro")
}
// ExistsMacroExpander expands the input call arguments into a comprehension that returns true if any of the
// elements in the range match the predicate expressions:
// .exists(, )
func ExistsMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeExists(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeExists(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
// ExistsOneMacroExpander expands the input call arguments into a comprehension that returns true if exactly
// one of the elements in the range match the predicate expressions:
// .exists_one(, )
func ExistsOneMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeExistsOne(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeExistsOne(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
// MapMacroExpander expands the input call arguments into a comprehension that transforms each element in the
@@ -91,14 +252,30 @@ func ExistsOneMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*ex
// In the second form only iterVar values which return true when provided to the predicate expression
// are transformed.
func MapMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeMap(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeMap(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
// FilterMacroExpander expands the input call arguments into a comprehension which produces a list which contains
// only elements which match the provided predicate expression:
// .filter(, )
func FilterMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeFilter(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeFilter(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
var (
@@ -142,3 +319,258 @@ var (
// NoMacros provides an alias to an empty list of macros
NoMacros = []Macro{}
)
+
+type adaptingExpander struct {
+ legacyExpander MacroExpander
+}
+
+func (adapt *adaptingExpander) Expander(eh parser.ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
+ var legacyTarget *exprpb.Expr = nil
+ var err *Error = nil
+ if target != nil {
+ legacyTarget, err = adaptToProto(target)
+ if err != nil {
+ return nil, err
+ }
+ }
+ legacyArgs := make([]*exprpb.Expr, len(args))
+ for i, arg := range args {
+ legacyArgs[i], err = adaptToProto(arg)
+ if err != nil {
+ return nil, err
+ }
+ }
+ ah := &adaptingHelper{modernHelper: eh}
+ legacyExpr, err := adapt.legacyExpander(ah, legacyTarget, legacyArgs)
+ if err != nil {
+ return nil, err
+ }
+ ex, err := adaptToExpr(legacyExpr)
+ if err != nil {
+ return nil, err
+ }
+ return ex, nil
+}
+
+func wrapErr(id int64, message string, err error) *common.Error {
+ return &common.Error{
+ Location: common.NoLocation,
+ Message: fmt.Sprintf("%s: %v", message, err),
+ ExprID: id,
+ }
+}
+
+type adaptingHelper struct {
+ modernHelper parser.ExprHelper
+}
+
+// Copy the input expression with a brand new set of identifiers.
+func (ah *adaptingHelper) Copy(e *exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.Copy(mustAdaptToExpr(e)))
+}
+
+// LiteralBool creates an Expr value for a bool literal.
+func (ah *adaptingHelper) LiteralBool(value bool) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Bool(value)))
+}
+
+// LiteralBytes creates an Expr value for a byte literal.
+func (ah *adaptingHelper) LiteralBytes(value []byte) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Bytes(value)))
+}
+
+// LiteralDouble creates an Expr value for double literal.
+func (ah *adaptingHelper) LiteralDouble(value float64) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Double(value)))
+}
+
+// LiteralInt creates an Expr value for an int literal.
+func (ah *adaptingHelper) LiteralInt(value int64) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Int(value)))
+}
+
+// LiteralString creates am Expr value for a string literal.
+func (ah *adaptingHelper) LiteralString(value string) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.String(value)))
+}
+
+// LiteralUint creates an Expr value for a uint literal.
+func (ah *adaptingHelper) LiteralUint(value uint64) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Uint(value)))
+}
+
+// NewList creates a CreateList instruction where the list is comprised of the optional set
+// of elements provided as arguments.
+func (ah *adaptingHelper) NewList(elems ...*exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewList(mustAdaptToExprs(elems)...))
+}
+
+// NewMap creates a CreateStruct instruction for a map where the map is comprised of the
+// optional set of key, value entries.
+func (ah *adaptingHelper) NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
+ adaptedEntries := make([]ast.EntryExpr, len(entries))
+ for i, e := range entries {
+ adaptedEntries[i] = mustAdaptToEntryExpr(e)
+ }
+ return mustAdaptToProto(ah.modernHelper.NewMap(adaptedEntries...))
+}
+
+// NewMapEntry creates a Map Entry for the key, value pair.
+func (ah *adaptingHelper) NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
+ return mustAdaptToProtoEntry(
+ ah.modernHelper.NewMapEntry(mustAdaptToExpr(key), mustAdaptToExpr(val), optional))
+}
+
+// NewObject creates a CreateStruct instruction for an object with a given type name and
+// optional set of field initializers.
+func (ah *adaptingHelper) NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
+ adaptedEntries := make([]ast.EntryExpr, len(fieldInits))
+ for i, e := range fieldInits {
+ adaptedEntries[i] = mustAdaptToEntryExpr(e)
+ }
+ return mustAdaptToProto(ah.modernHelper.NewStruct(typeName, adaptedEntries...))
+}
+
+// NewObjectFieldInit creates a new Object field initializer from the field name and value.
+func (ah *adaptingHelper) NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
+ return mustAdaptToProtoEntry(
+ ah.modernHelper.NewStructField(field, mustAdaptToExpr(init), optional))
+}
+
+// Fold creates a fold comprehension instruction.
+//
+// - iterVar is the iteration variable name.
+// - iterRange represents the expression that resolves to a list or map where the elements or
+// keys (respectively) will be iterated over.
+// - accuVar is the accumulation variable name, typically parser.AccumulatorName.
+// - accuInit is the initial expression whose value will be set for the accuVar prior to
+// folding.
+// - condition is the expression to test to determine whether to continue folding.
+// - step is the expression to evaluation at the conclusion of a single fold iteration.
+// - result is the computation to evaluate at the conclusion of the fold.
+//
+// The accuVar should not shadow variable names that you would like to reference within the
+// environment in the step and condition expressions. Presently, the name __result__ is commonly
+// used by built-in macros but this may change in the future.
+func (ah *adaptingHelper) Fold(iterVar string,
+ iterRange *exprpb.Expr,
+ accuVar string,
+ accuInit *exprpb.Expr,
+ condition *exprpb.Expr,
+ step *exprpb.Expr,
+ result *exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(
+ ah.modernHelper.NewComprehension(
+ mustAdaptToExpr(iterRange),
+ iterVar,
+ accuVar,
+ mustAdaptToExpr(accuInit),
+ mustAdaptToExpr(condition),
+ mustAdaptToExpr(step),
+ mustAdaptToExpr(result),
+ ),
+ )
+}
+
+// Ident creates an identifier Expr value.
+func (ah *adaptingHelper) Ident(name string) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewIdent(name))
+}
+
+// AccuIdent returns an accumulator identifier for use with comprehension results.
+func (ah *adaptingHelper) AccuIdent() *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewAccuIdent())
+}
+
+// GlobalCall creates a function call Expr value for a global (free) function.
+func (ah *adaptingHelper) GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewCall(function, mustAdaptToExprs(args)...))
+}
+
+// ReceiverCall creates a function call Expr value for a receiver-style function.
+func (ah *adaptingHelper) ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(
+ ah.modernHelper.NewMemberCall(function, mustAdaptToExpr(target), mustAdaptToExprs(args)...))
+}
+
+// PresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
+func (ah *adaptingHelper) PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr {
+ op := mustAdaptToExpr(operand)
+ return mustAdaptToProto(ah.modernHelper.NewPresenceTest(op, field))
+}
+
+// Select create a field traversal Expr value.
+func (ah *adaptingHelper) Select(operand *exprpb.Expr, field string) *exprpb.Expr {
+ op := mustAdaptToExpr(operand)
+ return mustAdaptToProto(ah.modernHelper.NewSelect(op, field))
+}
+
+// OffsetLocation returns the Location of the expression identifier.
+func (ah *adaptingHelper) OffsetLocation(exprID int64) common.Location {
+ return ah.modernHelper.OffsetLocation(exprID)
+}
+
+// NewError associates an error message with a given expression id.
+func (ah *adaptingHelper) NewError(exprID int64, message string) *Error {
+ return ah.modernHelper.NewError(exprID, message)
+}
+
+func mustAdaptToExprs(exprs []*exprpb.Expr) []ast.Expr {
+ adapted := make([]ast.Expr, len(exprs))
+ for i, e := range exprs {
+ adapted[i] = mustAdaptToExpr(e)
+ }
+ return adapted
+}
+
+func mustAdaptToExpr(e *exprpb.Expr) ast.Expr {
+ out, _ := adaptToExpr(e)
+ return out
+}
+
+func adaptToExpr(e *exprpb.Expr) (ast.Expr, *Error) {
+ if e == nil {
+ return nil, nil
+ }
+ out, err := ast.ProtoToExpr(e)
+ if err != nil {
+ return nil, wrapErr(e.GetId(), "proto conversion failure", err)
+ }
+ return out, nil
+}
+
+func mustAdaptToEntryExpr(e *exprpb.Expr_CreateStruct_Entry) ast.EntryExpr {
+ out, _ := ast.ProtoToEntryExpr(e)
+ return out
+}
+
+func mustAdaptToProto(e ast.Expr) *exprpb.Expr {
+ out, _ := adaptToProto(e)
+ return out
+}
+
+func adaptToProto(e ast.Expr) (*exprpb.Expr, *Error) {
+ if e == nil {
+ return nil, nil
+ }
+ out, err := ast.ExprToProto(e)
+ if err != nil {
+ return nil, wrapErr(e.ID(), "expr conversion failure", err)
+ }
+ return out, nil
+}
+
+func mustAdaptToProtoEntry(e ast.EntryExpr) *exprpb.Expr_CreateStruct_Entry {
+ out, _ := ast.EntryExprToProto(e)
+ return out
+}
+
+func toParserHelper(meh MacroExprHelper) (parser.ExprHelper, *Error) {
+ ah, ok := meh.(*adaptingHelper)
+ if !ok {
+ return nil, common.NewError(0,
+ fmt.Sprintf("unsupported macro helper: %v (%T)", meh, meh),
+ common.NoLocation)
+ }
+ return ah.modernHelper, nil
+}
diff --git a/vendor/github.com/google/cel-go/cel/optimizer.go b/vendor/github.com/google/cel-go/cel/optimizer.go
new file mode 100644
index 00000000000..f26df462344
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/optimizer.go
@@ -0,0 +1,509 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cel
+
+import (
+ "github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+// StaticOptimizer contains a sequence of ASTOptimizer instances which will be applied in order.
+//
+// The static optimizer normalizes expression ids and type-checking run between optimization
+// passes to ensure that the final optimized output is a valid expression with metadata consistent
+// with what would have been generated from a parsed and checked expression.
+//
+// Note: source position information is best-effort and likely wrong, but optimized expressions
+// should be suitable for calls to parser.Unparse.
+type StaticOptimizer struct {
+ optimizers []ASTOptimizer
+}
+
+// NewStaticOptimizer creates a StaticOptimizer with a sequence of ASTOptimizer's to be applied
+// to a checked expression.
+func NewStaticOptimizer(optimizers ...ASTOptimizer) *StaticOptimizer {
+ return &StaticOptimizer{
+ optimizers: optimizers,
+ }
+}
+
+// Optimize applies a sequence of optimizations to an Ast within a given environment.
+//
+// If issues are encountered, the Issues.Err() return value will be non-nil.
+func (opt *StaticOptimizer) Optimize(env *Env, a *Ast) (*Ast, *Issues) {
+ // Make a copy of the AST to be optimized.
+ optimized := ast.Copy(a.impl)
+ ids := newIDGenerator(ast.MaxID(a.impl))
+
+ // Create the optimizer context, could be pooled in the future.
+ issues := NewIssues(common.NewErrors(a.Source()))
+ baseFac := ast.NewExprFactory()
+ exprFac := &optimizerExprFactory{
+ idGenerator: ids,
+ fac: baseFac,
+ sourceInfo: optimized.SourceInfo(),
+ }
+ ctx := &OptimizerContext{
+ optimizerExprFactory: exprFac,
+ Env: env,
+ Issues: issues,
+ }
+
+ // Apply the optimizations sequentially.
+ for _, o := range opt.optimizers {
+ optimized = o.Optimize(ctx, optimized)
+ if issues.Err() != nil {
+ return nil, issues
+ }
+ // Normalize expression id metadata including coordination with macro call metadata.
+ freshIDGen := newIDGenerator(0)
+ info := optimized.SourceInfo()
+ expr := optimized.Expr()
+ normalizeIDs(freshIDGen.renumberStable, expr, info)
+ cleanupMacroRefs(expr, info)
+
+ // Recheck the updated expression for any possible type-agreement or validation errors.
+ parsed := &Ast{
+ source: a.Source(),
+ impl: ast.NewAST(expr, info)}
+ checked, iss := ctx.Check(parsed)
+ if iss.Err() != nil {
+ return nil, iss
+ }
+ optimized = checked.impl
+ }
+
+ // Return the optimized result.
+ return &Ast{
+ source: a.Source(),
+ impl: optimized,
+ }, nil
+}
+
+// normalizeIDs ensures that the metadata present with an AST is reset in a manner such
+// that the ids within the expression correspond to the ids within macros.
+func normalizeIDs(idGen ast.IDGenerator, optimized ast.Expr, info *ast.SourceInfo) {
+ optimized.RenumberIDs(idGen)
+
+ if len(info.MacroCalls()) == 0 {
+ return
+ }
+
+ // First, update the macro call ids themselves.
+ callIDMap := map[int64]int64{}
+ for id := range info.MacroCalls() {
+ callIDMap[id] = idGen(id)
+ }
+ // Then update the macro call definitions which refer to these ids, but
+ // ensure that the updates don't collide and remove macro entries which haven't
+ // been visited / updated yet.
+ type macroUpdate struct {
+ id int64
+ call ast.Expr
+ }
+ macroUpdates := []macroUpdate{}
+ for oldID, newID := range callIDMap {
+ call, found := info.GetMacroCall(oldID)
+ if !found {
+ continue
+ }
+ call.RenumberIDs(idGen)
+ macroUpdates = append(macroUpdates, macroUpdate{id: newID, call: call})
+ info.ClearMacroCall(oldID)
+ }
+ for _, u := range macroUpdates {
+ info.SetMacroCall(u.id, u.call)
+ }
+}
+
+func cleanupMacroRefs(expr ast.Expr, info *ast.SourceInfo) {
+ if len(info.MacroCalls()) == 0 {
+ return
+ }
+ // Sanitize the macro call references once the optimized expression has been computed
+ // and the ids normalized between the expression and the macros.
+ exprRefMap := make(map[int64]struct{})
+ ast.PostOrderVisit(expr, ast.NewExprVisitor(func(e ast.Expr) {
+ if e.ID() == 0 {
+ return
+ }
+ exprRefMap[e.ID()] = struct{}{}
+ }))
+ // Update the macro call id references to ensure that macro pointers are
+ // updated consistently across macros.
+ for _, call := range info.MacroCalls() {
+ ast.PostOrderVisit(call, ast.NewExprVisitor(func(e ast.Expr) {
+ if e.ID() == 0 {
+ return
+ }
+ exprRefMap[e.ID()] = struct{}{}
+ }))
+ }
+ for id := range info.MacroCalls() {
+ if _, found := exprRefMap[id]; !found {
+ info.ClearMacroCall(id)
+ }
+ }
+}
+
+// newIDGenerator ensures that new ids are only created the first time they are encountered.
+func newIDGenerator(seed int64) *idGenerator {
+ return &idGenerator{
+ idMap: make(map[int64]int64),
+ seed: seed,
+ }
+}
+
+type idGenerator struct {
+ idMap map[int64]int64
+ seed int64
+}
+
+func (gen *idGenerator) nextID() int64 {
+ gen.seed++
+ return gen.seed
+}
+
+func (gen *idGenerator) renumberStable(id int64) int64 {
+ if id == 0 {
+ return 0
+ }
+ if newID, found := gen.idMap[id]; found {
+ return newID
+ }
+ nextID := gen.nextID()
+ gen.idMap[id] = nextID
+ return nextID
+}
+
+// OptimizerContext embeds Env and Issues instances to make it easy to type-check and evaluate
+// subexpressions and report any errors encountered along the way. The context also embeds the
+// optimizerExprFactory which can be used to generate new sub-expressions with expression ids
+// consistent with the expectations of a parsed expression.
+type OptimizerContext struct {
+ *Env
+ *optimizerExprFactory
+ *Issues
+}
+
+// ASTOptimizer applies an optimization over an AST and returns the optimized result.
+type ASTOptimizer interface {
+ // Optimize optimizes a type-checked AST within an Environment and accumulates any issues.
+ Optimize(*OptimizerContext, *ast.AST) *ast.AST
+}
+
+type optimizerExprFactory struct {
+ *idGenerator
+ fac ast.ExprFactory
+ sourceInfo *ast.SourceInfo
+}
+
+// NewAST creates an AST from the current expression using the tracked source info which
+// is modified and managed by the OptimizerContext.
+func (opt *optimizerExprFactory) NewAST(expr ast.Expr) *ast.AST {
+ return ast.NewAST(expr, opt.sourceInfo)
+}
+
+// CopyAST creates a renumbered copy of `Expr` and `SourceInfo` values of the input AST, where the
+// renumbering uses the same scheme as the core optimizer logic ensuring there are no collisions
+// between copies.
+//
+// Use this method before attempting to merge the expression from AST into another.
+func (opt *optimizerExprFactory) CopyAST(a *ast.AST) (ast.Expr, *ast.SourceInfo) {
+ idGen := newIDGenerator(opt.nextID())
+ defer func() { opt.seed = idGen.nextID() }()
+ copyExpr := opt.fac.CopyExpr(a.Expr())
+ copyInfo := ast.CopySourceInfo(a.SourceInfo())
+ normalizeIDs(idGen.renumberStable, copyExpr, copyInfo)
+ return copyExpr, copyInfo
+}
+
+// CopyASTAndMetadata copies the input AST and propagates the macro metadata into the AST being
+// optimized.
+func (opt *optimizerExprFactory) CopyASTAndMetadata(a *ast.AST) ast.Expr {
+ copyExpr, copyInfo := opt.CopyAST(a)
+ for macroID, call := range copyInfo.MacroCalls() {
+ opt.SetMacroCall(macroID, call)
+ }
+ return copyExpr
+}
+
+// ClearMacroCall clears the macro at the given expression id.
+func (opt *optimizerExprFactory) ClearMacroCall(id int64) {
+ opt.sourceInfo.ClearMacroCall(id)
+}
+
+// SetMacroCall sets the macro call metadata for the given macro id within the tracked source info
+// metadata.
+func (opt *optimizerExprFactory) SetMacroCall(id int64, expr ast.Expr) {
+ opt.sourceInfo.SetMacroCall(id, expr)
+}
+
+// NewBindMacro creates an AST expression representing the expanded bind() macro, and a macro expression
+// representing the unexpanded call signature to be inserted into the source info macro call metadata.
+func (opt *optimizerExprFactory) NewBindMacro(macroID int64, varName string, varInit, remaining ast.Expr) (astExpr, macroExpr ast.Expr) {
+ varID := opt.nextID()
+ remainingID := opt.nextID()
+ remaining = opt.fac.CopyExpr(remaining)
+ remaining.RenumberIDs(func(id int64) int64 {
+ if id == macroID {
+ return remainingID
+ }
+ return id
+ })
+ if call, exists := opt.sourceInfo.GetMacroCall(macroID); exists {
+ opt.SetMacroCall(remainingID, opt.fac.CopyExpr(call))
+ }
+
+ astExpr = opt.fac.NewComprehension(macroID,
+ opt.fac.NewList(opt.nextID(), []ast.Expr{}, []int32{}),
+ "#unused",
+ varName,
+ opt.fac.CopyExpr(varInit),
+ opt.fac.NewLiteral(opt.nextID(), types.False),
+ opt.fac.NewIdent(varID, varName),
+ remaining)
+
+ macroExpr = opt.fac.NewMemberCall(0, "bind",
+ opt.fac.NewIdent(opt.nextID(), "cel"),
+ opt.fac.NewIdent(varID, varName),
+ opt.fac.CopyExpr(varInit),
+ opt.fac.CopyExpr(remaining))
+ opt.sanitizeMacro(macroID, macroExpr)
+ return
+}
+
+// NewCall creates a global function call invocation expression.
+//
+// Example:
+//
+// countByField(list, fieldName)
+// - function: countByField
+// - args: [list, fieldName]
+func (opt *optimizerExprFactory) NewCall(function string, args ...ast.Expr) ast.Expr {
+ return opt.fac.NewCall(opt.nextID(), function, args...)
+}
+
+// NewMemberCall creates a member function call invocation expression where 'target' is the receiver of the call.
+//
+// Example:
+//
+// list.countByField(fieldName)
+// - function: countByField
+// - target: list
+// - args: [fieldName]
+func (opt *optimizerExprFactory) NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr {
+ return opt.fac.NewMemberCall(opt.nextID(), function, target, args...)
+}
+
+// NewIdent creates a new identifier expression.
+//
+// Examples:
+//
+// - simple_var_name
+// - qualified.subpackage.var_name
+func (opt *optimizerExprFactory) NewIdent(name string) ast.Expr {
+ return opt.fac.NewIdent(opt.nextID(), name)
+}
+
+// NewLiteral creates a new literal expression value.
+//
+// The range of valid values for a literal generated during optimization is different than for expressions
+// generated via parsing / type-checking, as the ref.Val may be _any_ CEL value so long as the value can
+// be converted back to a literal-like form.
+func (opt *optimizerExprFactory) NewLiteral(value ref.Val) ast.Expr {
+ return opt.fac.NewLiteral(opt.nextID(), value)
+}
+
+// NewList creates a list expression with a set of optional indices.
+//
+// Examples:
+//
+// [a, b]
+// - elems: [a, b]
+// - optIndices: []
+//
+// [a, ?b, ?c]
+// - elems: [a, b, c]
+// - optIndices: [1, 2]
+func (opt *optimizerExprFactory) NewList(elems []ast.Expr, optIndices []int32) ast.Expr {
+ return opt.fac.NewList(opt.nextID(), elems, optIndices)
+}
+
+// NewMap creates a map from a set of entry expressions which contain a key and value expression.
+func (opt *optimizerExprFactory) NewMap(entries []ast.EntryExpr) ast.Expr {
+ return opt.fac.NewMap(opt.nextID(), entries)
+}
+
+// NewMapEntry creates a map entry with a key and value expression and a flag to indicate whether the
+// entry is optional.
+//
+// Examples:
+//
+// {a: b}
+// - key: a
+// - value: b
+// - optional: false
+//
+// {?a: ?b}
+// - key: a
+// - value: b
+// - optional: true
+func (opt *optimizerExprFactory) NewMapEntry(key, value ast.Expr, isOptional bool) ast.EntryExpr {
+ return opt.fac.NewMapEntry(opt.nextID(), key, value, isOptional)
+}
+
+// NewHasMacro generates a test-only select expression to be included within an AST and an unexpanded
+// has() macro call signature to be inserted into the source info macro call metadata.
+func (opt *optimizerExprFactory) NewHasMacro(macroID int64, s ast.Expr) (astExpr, macroExpr ast.Expr) {
+ sel := s.AsSelect()
+ astExpr = opt.fac.NewPresenceTest(macroID, sel.Operand(), sel.FieldName())
+ macroExpr = opt.fac.NewCall(0, "has",
+ opt.NewSelect(opt.fac.CopyExpr(sel.Operand()), sel.FieldName()))
+ opt.sanitizeMacro(macroID, macroExpr)
+ return
+}
+
+// NewSelect creates a select expression where a field value is selected from an operand.
+//
+// Example:
+//
+// msg.field_name
+// - operand: msg
+// - field: field_name
+func (opt *optimizerExprFactory) NewSelect(operand ast.Expr, field string) ast.Expr {
+ return opt.fac.NewSelect(opt.nextID(), operand, field)
+}
+
+// NewStruct creates a new typed struct value with an set of field initializations.
+//
+// Example:
+//
+// pkg.TypeName{field: value}
+// - typeName: pkg.TypeName
+// - fields: [{field: value}]
+func (opt *optimizerExprFactory) NewStruct(typeName string, fields []ast.EntryExpr) ast.Expr {
+ return opt.fac.NewStruct(opt.nextID(), typeName, fields)
+}
+
+// NewStructField creates a struct field initialization.
+//
+// Examples:
+//
+// {count: 3u}
+// - field: count
+// - value: 3u
+// - optional: false
+//
+// {?count: x}
+// - field: count
+// - value: x
+// - optional: true
+func (opt *optimizerExprFactory) NewStructField(field string, value ast.Expr, isOptional bool) ast.EntryExpr {
+ return opt.fac.NewStructField(opt.nextID(), field, value, isOptional)
+}
+
+// UpdateExpr updates the target expression with the updated content while preserving macro metadata.
+//
+// There are four scenarios during the update to consider:
+// 1. target is not macro, updated is not macro
+// 2. target is macro, updated is not macro
+// 3. target is macro, updated is macro
+// 4. target is not macro, updated is macro
+//
+// When the target is a macro already, it may either be updated to a new macro function
+// body if the update is also a macro, or it may be removed altogether if the update is
+// a macro.
+//
+// When the update is a macro, then the target references within other macros must be
+// updated to point to the new updated macro. Otherwise, other macros which pointed to
+// the target body must be replaced with copies of the updated expression body.
+func (opt *optimizerExprFactory) UpdateExpr(target, updated ast.Expr) {
+ // Update the expression
+ target.SetKindCase(updated)
+
+ // Early return if there's no macros present sa the source info reflects the
+ // macro set from the target and updated expressions.
+ if len(opt.sourceInfo.MacroCalls()) == 0 {
+ return
+ }
+ // Determine whether the target expression was a macro.
+ _, targetIsMacro := opt.sourceInfo.GetMacroCall(target.ID())
+
+ // Determine whether the updated expression was a macro.
+ updatedMacro, updatedIsMacro := opt.sourceInfo.GetMacroCall(updated.ID())
+
+ if updatedIsMacro {
+ // If the updated call was a macro, then updated id maps to target id,
+ // and the updated macro moves into the target id slot.
+ opt.sourceInfo.ClearMacroCall(updated.ID())
+ opt.sourceInfo.SetMacroCall(target.ID(), updatedMacro)
+ } else if targetIsMacro {
+ // Otherwise if the target expr was a macro, but is no longer, clear
+ // the macro reference.
+ opt.sourceInfo.ClearMacroCall(target.ID())
+ }
+
+ // Punch holes in the updated value where macros references exist.
+ macroExpr := opt.fac.CopyExpr(target)
+ macroRefVisitor := ast.NewExprVisitor(func(e ast.Expr) {
+ if _, exists := opt.sourceInfo.GetMacroCall(e.ID()); exists {
+ e.SetKindCase(nil)
+ }
+ })
+ ast.PostOrderVisit(macroExpr, macroRefVisitor)
+
+ // Update any references to the expression within a macro
+ macroVisitor := ast.NewExprVisitor(func(call ast.Expr) {
+ // Update the target expression to point to the macro expression which
+ // will be empty if the updated expression was a macro.
+ if call.ID() == target.ID() {
+ call.SetKindCase(opt.fac.CopyExpr(macroExpr))
+ }
+ // Update the macro call expression if it refers to the updated expression
+ // id which has since been remapped to the target id.
+ if call.ID() == updated.ID() {
+ // Either ensure the expression is a macro reference or a populated with
+ // the relevant sub-expression if the updated expr was not a macro.
+ if updatedIsMacro {
+ call.SetKindCase(nil)
+ } else {
+ call.SetKindCase(opt.fac.CopyExpr(macroExpr))
+ }
+ // Since SetKindCase does not renumber the id, ensure the references to
+ // the old 'updated' id are mapped to the target id.
+ call.RenumberIDs(func(id int64) int64 {
+ if id == updated.ID() {
+ return target.ID()
+ }
+ return id
+ })
+ }
+ })
+ for _, call := range opt.sourceInfo.MacroCalls() {
+ ast.PostOrderVisit(call, macroVisitor)
+ }
+}
+
+func (opt *optimizerExprFactory) sanitizeMacro(macroID int64, macroExpr ast.Expr) {
+ macroRefVisitor := ast.NewExprVisitor(func(e ast.Expr) {
+ if _, exists := opt.sourceInfo.GetMacroCall(e.ID()); exists && e.ID() != macroID {
+ e.SetKindCase(nil)
+ }
+ })
+ ast.PostOrderVisit(macroExpr, macroRefVisitor)
+}
diff --git a/vendor/github.com/google/cel-go/cel/options.go b/vendor/github.com/google/cel-go/cel/options.go
index 05867730d36..3c53e21afa8 100644
--- a/vendor/github.com/google/cel-go/cel/options.go
+++ b/vendor/github.com/google/cel-go/cel/options.go
@@ -448,6 +448,8 @@ const (
OptTrackCost EvalOption = 1 << iota
// OptCheckStringFormat enables compile-time checking of string.format calls for syntax/cardinality.
+ //
+ // Deprecated: use ext.StringsValidateFormatCalls() as this option is now a no-op.
OptCheckStringFormat EvalOption = 1 << iota
)
diff --git a/vendor/github.com/google/cel-go/cel/program.go b/vendor/github.com/google/cel-go/cel/program.go
index 2dd72f75010..ece9fbdafa9 100644
--- a/vendor/github.com/google/cel-go/cel/program.go
+++ b/vendor/github.com/google/cel-go/cel/program.go
@@ -19,7 +19,6 @@ import (
"fmt"
"sync"
- celast "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/interpreter"
@@ -152,7 +151,7 @@ func (p *prog) clone() *prog {
// ProgramOption values.
//
// If the program cannot be configured the prog will be nil, with a non-nil error response.
-func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
+func newProgram(e *Env, a *Ast, opts []ProgramOption) (Program, error) {
// Build the dispatcher, interpreter, and default program value.
disp := interpreter.NewDispatcher()
@@ -213,34 +212,6 @@ func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
if len(p.regexOptimizations) > 0 {
decorators = append(decorators, interpreter.CompileRegexConstants(p.regexOptimizations...))
}
- // Enable compile-time checking of syntax/cardinality for string.format calls.
- if p.evalOpts&OptCheckStringFormat == OptCheckStringFormat {
- var isValidType func(id int64, validTypes ...ref.Type) (bool, error)
- if ast.IsChecked() {
- isValidType = func(id int64, validTypes ...ref.Type) (bool, error) {
- t := ast.typeMap[id]
- if t.Kind() == DynKind {
- return true, nil
- }
- for _, vt := range validTypes {
- k, err := typeValueToKind(vt)
- if err != nil {
- return false, err
- }
- if t.Kind() == k {
- return true, nil
- }
- }
- return false, nil
- }
- } else {
- // if the AST isn't type-checked, short-circuit validation
- isValidType = func(id int64, validTypes ...ref.Type) (bool, error) {
- return true, nil
- }
- }
- decorators = append(decorators, interpreter.InterpolateFormattedString(isValidType))
- }
// Enable exhaustive eval, state tracking and cost tracking last since they require a factory.
if p.evalOpts&(OptExhaustiveEval|OptTrackState|OptTrackCost) != 0 {
@@ -274,33 +245,16 @@ func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
decs = append(decs, interpreter.Observe(observers...))
}
- return p.clone().initInterpretable(ast, decs)
+ return p.clone().initInterpretable(a, decs)
}
return newProgGen(factory)
}
- return p.initInterpretable(ast, decorators)
+ return p.initInterpretable(a, decorators)
}
-func (p *prog) initInterpretable(ast *Ast, decs []interpreter.InterpretableDecorator) (*prog, error) {
- // Unchecked programs do not contain type and reference information and may be slower to execute.
- if !ast.IsChecked() {
- interpretable, err :=
- p.interpreter.NewUncheckedInterpretable(ast.Expr(), decs...)
- if err != nil {
- return nil, err
- }
- p.interpretable = interpretable
- return p, nil
- }
-
- // When the AST has been checked it contains metadata that can be used to speed up program execution.
- checked := &celast.CheckedAST{
- Expr: ast.Expr(),
- SourceInfo: ast.SourceInfo(),
- TypeMap: ast.typeMap,
- ReferenceMap: ast.refMap,
- }
- interpretable, err := p.interpreter.NewInterpretable(checked, decs...)
+func (p *prog) initInterpretable(a *Ast, decs []interpreter.InterpretableDecorator) (*prog, error) {
+ // When the AST has been exprAST it contains metadata that can be used to speed up program execution.
+ interpretable, err := p.interpreter.NewInterpretable(a.impl, decs...)
if err != nil {
return nil, err
}
@@ -580,8 +534,6 @@ func (p *evalActivationPool) Put(value any) {
}
var (
- emptyEvalState = interpreter.NewEvalState()
-
// activationPool is an internally managed pool of Activation values that wrap map[string]any inputs
activationPool = newEvalActivationPool()
diff --git a/vendor/github.com/google/cel-go/cel/validator.go b/vendor/github.com/google/cel-go/cel/validator.go
index 78b31138186..b50c674520a 100644
--- a/vendor/github.com/google/cel-go/cel/validator.go
+++ b/vendor/github.com/google/cel-go/cel/validator.go
@@ -21,8 +21,6 @@ import (
"github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/overloads"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
const (
@@ -69,7 +67,7 @@ type ASTValidator interface {
//
// See individual validators for more information on their configuration keys and configuration
// properties.
- Validate(*Env, ValidatorConfig, *ast.CheckedAST, *Issues)
+ Validate(*Env, ValidatorConfig, *ast.AST, *Issues)
}
// ValidatorConfig provides an accessor method for querying validator configuration state.
@@ -180,7 +178,7 @@ func ValidateComprehensionNestingLimit(limit int) ASTValidator {
return nestingLimitValidator{limit: limit}
}
-type argChecker func(env *Env, call, arg ast.NavigableExpr) error
+type argChecker func(env *Env, call, arg ast.Expr) error
func newFormatValidator(funcName string, argNum int, check argChecker) formatValidator {
return formatValidator{
@@ -203,8 +201,8 @@ func (v formatValidator) Name() string {
// Validate searches the AST for uses of a given function name with a constant argument and performs a check
// on whether the argument is a valid literal value.
-func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST, iss *Issues) {
- root := ast.NavigateCheckedAST(a)
+func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.AST, iss *Issues) {
+ root := ast.NavigateAST(a)
funcCalls := ast.MatchDescendants(root, ast.FunctionMatcher(v.funcName))
for _, call := range funcCalls {
callArgs := call.AsCall().Args()
@@ -221,8 +219,8 @@ func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST,
}
}
-func evalCall(env *Env, call, arg ast.NavigableExpr) error {
- ast := ParsedExprToAst(&exprpb.ParsedExpr{Expr: call.ToExpr()})
+func evalCall(env *Env, call, arg ast.Expr) error {
+ ast := &Ast{impl: ast.NewAST(call, ast.NewSourceInfo(nil))}
prg, err := env.Program(ast)
if err != nil {
return err
@@ -231,7 +229,7 @@ func evalCall(env *Env, call, arg ast.NavigableExpr) error {
return err
}
-func compileRegex(_ *Env, _, arg ast.NavigableExpr) error {
+func compileRegex(_ *Env, _, arg ast.Expr) error {
pattern := arg.AsLiteral().Value().(string)
_, err := regexp.Compile(pattern)
return err
@@ -244,25 +242,14 @@ func (homogeneousAggregateLiteralValidator) Name() string {
return homogeneousValidatorName
}
-// Configure implements the ASTValidatorConfigurer interface and currently sets the list of standard
-// and exempt functions from homogeneous aggregate literal checks.
-//
-// TODO: Move this call into the string.format() ASTValidator once ported.
-func (homogeneousAggregateLiteralValidator) Configure(c MutableValidatorConfig) error {
- emptyList := []string{}
- exemptFunctions := c.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, emptyList).([]string)
- exemptFunctions = append(exemptFunctions, "format")
- return c.Set(HomogeneousAggregateLiteralExemptFunctions, exemptFunctions)
-}
-
// Validate validates that all lists and map literals have homogeneous types, i.e. don't contain dyn types.
//
// This validator makes an exception for list and map literals which occur at any level of nesting within
// string format calls.
-func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig, a *ast.CheckedAST, iss *Issues) {
+func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig, a *ast.AST, iss *Issues) {
var exemptedFunctions []string
exemptedFunctions = c.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, exemptedFunctions).([]string)
- root := ast.NavigateCheckedAST(a)
+ root := ast.NavigateAST(a)
listExprs := ast.MatchDescendants(root, ast.KindMatcher(ast.ListKind))
for _, listExpr := range listExprs {
if inExemptFunction(listExpr, exemptedFunctions) {
@@ -273,7 +260,7 @@ func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig
optIndices := l.OptionalIndices()
var elemType *Type
for i, e := range elements {
- et := e.Type()
+ et := a.GetType(e.ID())
if isOptionalIndex(i, optIndices) {
et = et.Parameters()[0]
}
@@ -296,9 +283,10 @@ func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig
entries := m.Entries()
var keyType, valType *Type
for _, e := range entries {
- key, val := e.Key(), e.Value()
- kt, vt := key.Type(), val.Type()
- if e.IsOptional() {
+ mapEntry := e.AsMapEntry()
+ key, val := mapEntry.Key(), mapEntry.Value()
+ kt, vt := a.GetType(key.ID()), a.GetType(val.ID())
+ if mapEntry.IsOptional() {
vt = vt.Parameters()[0]
}
if keyType == nil && valType == nil {
@@ -316,7 +304,8 @@ func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig
}
func inExemptFunction(e ast.NavigableExpr, exemptFunctions []string) bool {
- if parent, found := e.Parent(); found {
+ parent, found := e.Parent()
+ for found {
if parent.Kind() == ast.CallKind {
fnName := parent.AsCall().FunctionName()
for _, exempt := range exemptFunctions {
@@ -325,9 +314,7 @@ func inExemptFunction(e ast.NavigableExpr, exemptFunctions []string) bool {
}
}
}
- if parent.Kind() == ast.ListKind || parent.Kind() == ast.MapKind {
- return inExemptFunction(parent, exemptFunctions)
- }
+ parent, found = parent.Parent()
}
return false
}
@@ -353,8 +340,8 @@ func (v nestingLimitValidator) Name() string {
return "cel.lib.std.validate.comprehension_nesting_limit"
}
-func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST, iss *Issues) {
- root := ast.NavigateCheckedAST(a)
+func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.AST, iss *Issues) {
+ root := ast.NavigateAST(a)
comprehensions := ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind))
if len(comprehensions) <= v.limit {
return
diff --git a/vendor/github.com/google/cel-go/checker/BUILD.bazel b/vendor/github.com/google/cel-go/checker/BUILD.bazel
index 0459d35239f..997fa91d15d 100644
--- a/vendor/github.com/google/cel-go/checker/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/checker/BUILD.bazel
@@ -60,7 +60,6 @@ go_test(
"//test:go_default_library",
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],
)
diff --git a/vendor/github.com/google/cel-go/checker/checker.go b/vendor/github.com/google/cel-go/checker/checker.go
index 720e4fa968f..57fb3ce5ea1 100644
--- a/vendor/github.com/google/cel-go/checker/checker.go
+++ b/vendor/github.com/google/cel-go/checker/checker.go
@@ -18,6 +18,7 @@ package checker
import (
"fmt"
+ "reflect"
"github.com/google/cel-go/common"
"github.com/google/cel-go/common/ast"
@@ -25,139 +26,98 @@ import (
"github.com/google/cel-go/common/decls"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/types/ref"
)
type checker struct {
+ *ast.AST
+ ast.ExprFactory
env *Env
errors *typeErrors
mappings *mapping
freeTypeVarCounter int
- sourceInfo *exprpb.SourceInfo
- types map[int64]*types.Type
- references map[int64]*ast.ReferenceInfo
}
// Check performs type checking, giving a typed AST.
-// The input is a ParsedExpr proto and an env which encapsulates
-// type binding of variables, declarations of built-in functions,
-// descriptions of protocol buffers, and a registry for errors.
-// Returns a CheckedExpr proto, which might not be usable if
-// there are errors in the error registry.
-func Check(parsedExpr *exprpb.ParsedExpr, source common.Source, env *Env) (*ast.CheckedAST, *common.Errors) {
+//
+// The input is a parsed AST and an env which encapsulates type binding of variables,
+// declarations of built-in functions, descriptions of protocol buffers, and a registry for
+// errors.
+//
+// Returns a type-checked AST, which might not be usable if there are errors in the error
+// registry.
+func Check(parsed *ast.AST, source common.Source, env *Env) (*ast.AST, *common.Errors) {
errs := common.NewErrors(source)
+ typeMap := make(map[int64]*types.Type)
+ refMap := make(map[int64]*ast.ReferenceInfo)
c := checker{
+ AST: ast.NewCheckedAST(parsed, typeMap, refMap),
+ ExprFactory: ast.NewExprFactory(),
env: env,
errors: &typeErrors{errs: errs},
mappings: newMapping(),
freeTypeVarCounter: 0,
- sourceInfo: parsedExpr.GetSourceInfo(),
- types: make(map[int64]*types.Type),
- references: make(map[int64]*ast.ReferenceInfo),
}
- c.check(parsedExpr.GetExpr())
+ c.check(c.Expr())
- // Walk over the final type map substituting any type parameters either by their bound value or
- // by DYN.
- m := make(map[int64]*types.Type)
- for id, t := range c.types {
- m[id] = substitute(c.mappings, t, true)
+ // Walk over the final type map substituting any type parameters either by their bound value
+ // or by DYN.
+ for id, t := range c.TypeMap() {
+ c.SetType(id, substitute(c.mappings, t, true))
}
-
- return &ast.CheckedAST{
- Expr: parsedExpr.GetExpr(),
- SourceInfo: parsedExpr.GetSourceInfo(),
- TypeMap: m,
- ReferenceMap: c.references,
- }, errs
+ return c.AST, errs
}
-func (c *checker) check(e *exprpb.Expr) {
+func (c *checker) check(e ast.Expr) {
if e == nil {
return
}
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- literal := e.GetConstExpr()
- switch literal.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- c.checkBoolLiteral(e)
- case *exprpb.Constant_BytesValue:
- c.checkBytesLiteral(e)
- case *exprpb.Constant_DoubleValue:
- c.checkDoubleLiteral(e)
- case *exprpb.Constant_Int64Value:
- c.checkInt64Literal(e)
- case *exprpb.Constant_NullValue:
- c.checkNullLiteral(e)
- case *exprpb.Constant_StringValue:
- c.checkStringLiteral(e)
- case *exprpb.Constant_Uint64Value:
- c.checkUint64Literal(e)
+ switch e.Kind() {
+ case ast.LiteralKind:
+ literal := ref.Val(e.AsLiteral())
+ switch literal.Type() {
+ case types.BoolType, types.BytesType, types.DoubleType, types.IntType,
+ types.NullType, types.StringType, types.UintType:
+ c.setType(e, literal.Type().(*types.Type))
+ default:
+ c.errors.unexpectedASTType(e.ID(), c.location(e), "literal", literal.Type().TypeName())
}
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
c.checkIdent(e)
- case *exprpb.Expr_SelectExpr:
+ case ast.SelectKind:
c.checkSelect(e)
- case *exprpb.Expr_CallExpr:
+ case ast.CallKind:
c.checkCall(e)
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
c.checkCreateList(e)
- case *exprpb.Expr_StructExpr:
+ case ast.MapKind:
+ c.checkCreateMap(e)
+ case ast.StructKind:
c.checkCreateStruct(e)
- case *exprpb.Expr_ComprehensionExpr:
+ case ast.ComprehensionKind:
c.checkComprehension(e)
default:
- c.errors.unexpectedASTType(e.GetId(), c.location(e), e)
+ c.errors.unexpectedASTType(e.ID(), c.location(e), "unspecified", reflect.TypeOf(e).Name())
}
}
-func (c *checker) checkInt64Literal(e *exprpb.Expr) {
- c.setType(e, types.IntType)
-}
-
-func (c *checker) checkUint64Literal(e *exprpb.Expr) {
- c.setType(e, types.UintType)
-}
-
-func (c *checker) checkStringLiteral(e *exprpb.Expr) {
- c.setType(e, types.StringType)
-}
-
-func (c *checker) checkBytesLiteral(e *exprpb.Expr) {
- c.setType(e, types.BytesType)
-}
-
-func (c *checker) checkDoubleLiteral(e *exprpb.Expr) {
- c.setType(e, types.DoubleType)
-}
-
-func (c *checker) checkBoolLiteral(e *exprpb.Expr) {
- c.setType(e, types.BoolType)
-}
-
-func (c *checker) checkNullLiteral(e *exprpb.Expr) {
- c.setType(e, types.NullType)
-}
-
-func (c *checker) checkIdent(e *exprpb.Expr) {
- identExpr := e.GetIdentExpr()
+func (c *checker) checkIdent(e ast.Expr) {
+ identName := e.AsIdent()
// Check to see if the identifier is declared.
- if ident := c.env.LookupIdent(identExpr.GetName()); ident != nil {
+ if ident := c.env.LookupIdent(identName); ident != nil {
c.setType(e, ident.Type())
c.setReference(e, ast.NewIdentReference(ident.Name(), ident.Value()))
// Overwrite the identifier with its fully qualified name.
- identExpr.Name = ident.Name()
+ e.SetKindCase(c.NewIdent(e.ID(), ident.Name()))
return
}
c.setType(e, types.ErrorType)
- c.errors.undeclaredReference(e.GetId(), c.location(e), c.env.container.Name(), identExpr.GetName())
+ c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), identName)
}
-func (c *checker) checkSelect(e *exprpb.Expr) {
- sel := e.GetSelectExpr()
+func (c *checker) checkSelect(e ast.Expr) {
+ sel := e.AsSelect()
// Before traversing down the tree, try to interpret as qualified name.
qname, found := containers.ToQualifiedName(e)
if found {
@@ -170,31 +130,26 @@ func (c *checker) checkSelect(e *exprpb.Expr) {
// variable name.
c.setType(e, ident.Type())
c.setReference(e, ast.NewIdentReference(ident.Name(), ident.Value()))
- identName := ident.Name()
- e.ExprKind = &exprpb.Expr_IdentExpr{
- IdentExpr: &exprpb.Expr_Ident{
- Name: identName,
- },
- }
+ e.SetKindCase(c.NewIdent(e.ID(), ident.Name()))
return
}
}
- resultType := c.checkSelectField(e, sel.GetOperand(), sel.GetField(), false)
- if sel.TestOnly {
+ resultType := c.checkSelectField(e, sel.Operand(), sel.FieldName(), false)
+ if sel.IsTestOnly() {
resultType = types.BoolType
}
c.setType(e, substitute(c.mappings, resultType, false))
}
-func (c *checker) checkOptSelect(e *exprpb.Expr) {
+func (c *checker) checkOptSelect(e ast.Expr) {
// Collect metadata related to the opt select call packaged by the parser.
- call := e.GetCallExpr()
- operand := call.GetArgs()[0]
- field := call.GetArgs()[1]
+ call := e.AsCall()
+ operand := call.Args()[0]
+ field := call.Args()[1]
fieldName, isString := maybeUnwrapString(field)
if !isString {
- c.errors.notAnOptionalFieldSelection(field.GetId(), c.location(field), field)
+ c.errors.notAnOptionalFieldSelection(field.ID(), c.location(field), field)
return
}
@@ -204,7 +159,7 @@ func (c *checker) checkOptSelect(e *exprpb.Expr) {
c.setReference(e, ast.NewFunctionReference("select_optional_field"))
}
-func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, optional bool) *types.Type {
+func (c *checker) checkSelectField(e, operand ast.Expr, field string, optional bool) *types.Type {
// Interpret as field selection, first traversing down the operand.
c.check(operand)
operandType := substitute(c.mappings, c.getType(operand), false)
@@ -222,7 +177,7 @@ func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, option
// Objects yield their field type declaration as the selection result type, but only if
// the field is defined.
messageType := targetType
- if fieldType, found := c.lookupFieldType(e.GetId(), messageType.TypeName(), field); found {
+ if fieldType, found := c.lookupFieldType(e.ID(), messageType.TypeName(), field); found {
resultType = fieldType
}
case types.TypeParamKind:
@@ -236,7 +191,7 @@ func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, option
// Dynamic / error values are treated as DYN type. Errors are handled this way as well
// in order to allow forward progress on the check.
if !isDynOrError(targetType) {
- c.errors.typeDoesNotSupportFieldSelection(e.GetId(), c.location(e), targetType)
+ c.errors.typeDoesNotSupportFieldSelection(e.ID(), c.location(e), targetType)
}
resultType = types.DynType
}
@@ -248,35 +203,34 @@ func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, option
return resultType
}
-func (c *checker) checkCall(e *exprpb.Expr) {
+func (c *checker) checkCall(e ast.Expr) {
// Note: similar logic exists within the `interpreter/planner.go`. If making changes here
// please consider the impact on planner.go and consolidate implementations or mirror code
// as appropriate.
- call := e.GetCallExpr()
- fnName := call.GetFunction()
+ call := e.AsCall()
+ fnName := call.FunctionName()
if fnName == operators.OptSelect {
c.checkOptSelect(e)
return
}
- args := call.GetArgs()
+ args := call.Args()
// Traverse arguments.
for _, arg := range args {
c.check(arg)
}
- target := call.GetTarget()
// Regular static call with simple name.
- if target == nil {
+ if !call.IsMemberFunction() {
// Check for the existence of the function.
fn := c.env.LookupFunction(fnName)
if fn == nil {
- c.errors.undeclaredReference(e.GetId(), c.location(e), c.env.container.Name(), fnName)
+ c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), fnName)
c.setType(e, types.ErrorType)
return
}
// Overwrite the function name with its fully qualified resolved name.
- call.Function = fn.Name()
+ e.SetKindCase(c.NewCall(e.ID(), fn.Name(), args...))
// Check to see whether the overload resolves.
c.resolveOverloadOrError(e, fn, nil, args)
return
@@ -287,6 +241,7 @@ func (c *checker) checkCall(e *exprpb.Expr) {
// target a.b.
//
// Check whether the target is a namespaced function name.
+ target := call.Target()
qualifiedPrefix, maybeQualified := containers.ToQualifiedName(target)
if maybeQualified {
maybeQualifiedName := qualifiedPrefix + "." + fnName
@@ -295,15 +250,14 @@ func (c *checker) checkCall(e *exprpb.Expr) {
// The function name is namespaced and so preserving the target operand would
// be an inaccurate representation of the desired evaluation behavior.
// Overwrite with fully-qualified resolved function name sans receiver target.
- call.Target = nil
- call.Function = fn.Name()
+ e.SetKindCase(c.NewCall(e.ID(), fn.Name(), args...))
c.resolveOverloadOrError(e, fn, nil, args)
return
}
}
// Regular instance call.
- c.check(call.Target)
+ c.check(target)
fn := c.env.LookupFunction(fnName)
// Function found, attempt overload resolution.
if fn != nil {
@@ -312,11 +266,11 @@ func (c *checker) checkCall(e *exprpb.Expr) {
}
// Function name not declared, record error.
c.setType(e, types.ErrorType)
- c.errors.undeclaredReference(e.GetId(), c.location(e), c.env.container.Name(), fnName)
+ c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), fnName)
}
func (c *checker) resolveOverloadOrError(
- e *exprpb.Expr, fn *decls.FunctionDecl, target *exprpb.Expr, args []*exprpb.Expr) {
+ e ast.Expr, fn *decls.FunctionDecl, target ast.Expr, args []ast.Expr) {
// Attempt to resolve the overload.
resolution := c.resolveOverload(e, fn, target, args)
// No such overload, error noted in the resolveOverload call, type recorded here.
@@ -330,7 +284,7 @@ func (c *checker) resolveOverloadOrError(
}
func (c *checker) resolveOverload(
- call *exprpb.Expr, fn *decls.FunctionDecl, target *exprpb.Expr, args []*exprpb.Expr) *overloadResolution {
+ call ast.Expr, fn *decls.FunctionDecl, target ast.Expr, args []ast.Expr) *overloadResolution {
var argTypes []*types.Type
if target != nil {
@@ -362,8 +316,8 @@ func (c *checker) resolveOverload(
for i, argType := range argTypes {
if !c.isAssignable(argType, types.BoolType) {
c.errors.typeMismatch(
- args[i].GetId(),
- c.locationByID(args[i].GetId()),
+ args[i].ID(),
+ c.locationByID(args[i].ID()),
types.BoolType,
argType)
resultType = types.ErrorType
@@ -408,29 +362,29 @@ func (c *checker) resolveOverload(
for i, argType := range argTypes {
argTypes[i] = substitute(c.mappings, argType, true)
}
- c.errors.noMatchingOverload(call.GetId(), c.location(call), fn.Name(), argTypes, target != nil)
+ c.errors.noMatchingOverload(call.ID(), c.location(call), fn.Name(), argTypes, target != nil)
return nil
}
return newResolution(checkedRef, resultType)
}
-func (c *checker) checkCreateList(e *exprpb.Expr) {
- create := e.GetListExpr()
+func (c *checker) checkCreateList(e ast.Expr) {
+ create := e.AsList()
var elemsType *types.Type
- optionalIndices := create.GetOptionalIndices()
+ optionalIndices := create.OptionalIndices()
optionals := make(map[int32]bool, len(optionalIndices))
for _, optInd := range optionalIndices {
optionals[optInd] = true
}
- for i, e := range create.GetElements() {
+ for i, e := range create.Elements() {
c.check(e)
elemType := c.getType(e)
if optionals[int32(i)] {
var isOptional bool
elemType, isOptional = maybeUnwrapOptional(elemType)
if !isOptional && !isDyn(elemType) {
- c.errors.typeMismatch(e.GetId(), c.location(e), types.NewOptionalType(elemType), elemType)
+ c.errors.typeMismatch(e.ID(), c.location(e), types.NewOptionalType(elemType), elemType)
}
}
elemsType = c.joinTypes(e, elemsType, elemType)
@@ -442,32 +396,24 @@ func (c *checker) checkCreateList(e *exprpb.Expr) {
c.setType(e, types.NewListType(elemsType))
}
-func (c *checker) checkCreateStruct(e *exprpb.Expr) {
- str := e.GetStructExpr()
- if str.GetMessageName() != "" {
- c.checkCreateMessage(e)
- } else {
- c.checkCreateMap(e)
- }
-}
-
-func (c *checker) checkCreateMap(e *exprpb.Expr) {
- mapVal := e.GetStructExpr()
+func (c *checker) checkCreateMap(e ast.Expr) {
+ mapVal := e.AsMap()
var mapKeyType *types.Type
var mapValueType *types.Type
- for _, ent := range mapVal.GetEntries() {
- key := ent.GetMapKey()
+ for _, e := range mapVal.Entries() {
+ entry := e.AsMapEntry()
+ key := entry.Key()
c.check(key)
mapKeyType = c.joinTypes(key, mapKeyType, c.getType(key))
- val := ent.GetValue()
+ val := entry.Value()
c.check(val)
valType := c.getType(val)
- if ent.GetOptionalEntry() {
+ if entry.IsOptional() {
var isOptional bool
valType, isOptional = maybeUnwrapOptional(valType)
if !isOptional && !isDyn(valType) {
- c.errors.typeMismatch(val.GetId(), c.location(val), types.NewOptionalType(valType), valType)
+ c.errors.typeMismatch(val.ID(), c.location(val), types.NewOptionalType(valType), valType)
}
}
mapValueType = c.joinTypes(val, mapValueType, valType)
@@ -480,25 +426,28 @@ func (c *checker) checkCreateMap(e *exprpb.Expr) {
c.setType(e, types.NewMapType(mapKeyType, mapValueType))
}
-func (c *checker) checkCreateMessage(e *exprpb.Expr) {
- msgVal := e.GetStructExpr()
+func (c *checker) checkCreateStruct(e ast.Expr) {
+ msgVal := e.AsStruct()
// Determine the type of the message.
resultType := types.ErrorType
- ident := c.env.LookupIdent(msgVal.GetMessageName())
+ ident := c.env.LookupIdent(msgVal.TypeName())
if ident == nil {
c.errors.undeclaredReference(
- e.GetId(), c.location(e), c.env.container.Name(), msgVal.GetMessageName())
+ e.ID(), c.location(e), c.env.container.Name(), msgVal.TypeName())
c.setType(e, types.ErrorType)
return
}
// Ensure the type name is fully qualified in the AST.
typeName := ident.Name()
- msgVal.MessageName = typeName
- c.setReference(e, ast.NewIdentReference(ident.Name(), nil))
+ if msgVal.TypeName() != typeName {
+ e.SetKindCase(c.NewStruct(e.ID(), typeName, msgVal.Fields()))
+ msgVal = e.AsStruct()
+ }
+ c.setReference(e, ast.NewIdentReference(typeName, nil))
identKind := ident.Type().Kind()
if identKind != types.ErrorKind {
if identKind != types.TypeKind {
- c.errors.notAType(e.GetId(), c.location(e), ident.Type().DeclaredTypeName())
+ c.errors.notAType(e.ID(), c.location(e), ident.Type().DeclaredTypeName())
} else {
resultType = ident.Type().Parameters()[0]
// Backwards compatibility test between well-known types and message types
@@ -509,7 +458,7 @@ func (c *checker) checkCreateMessage(e *exprpb.Expr) {
} else if resultType.Kind() == types.StructKind {
typeName = resultType.DeclaredTypeName()
} else {
- c.errors.notAMessageType(e.GetId(), c.location(e), resultType.DeclaredTypeName())
+ c.errors.notAMessageType(e.ID(), c.location(e), resultType.DeclaredTypeName())
resultType = types.ErrorType
}
}
@@ -517,37 +466,38 @@ func (c *checker) checkCreateMessage(e *exprpb.Expr) {
c.setType(e, resultType)
// Check the field initializers.
- for _, ent := range msgVal.GetEntries() {
- field := ent.GetFieldKey()
- value := ent.GetValue()
+ for _, f := range msgVal.Fields() {
+ field := f.AsStructField()
+ fieldName := field.Name()
+ value := field.Value()
c.check(value)
fieldType := types.ErrorType
- ft, found := c.lookupFieldType(ent.GetId(), typeName, field)
+ ft, found := c.lookupFieldType(f.ID(), typeName, fieldName)
if found {
fieldType = ft
}
valType := c.getType(value)
- if ent.GetOptionalEntry() {
+ if field.IsOptional() {
var isOptional bool
valType, isOptional = maybeUnwrapOptional(valType)
if !isOptional && !isDyn(valType) {
- c.errors.typeMismatch(value.GetId(), c.location(value), types.NewOptionalType(valType), valType)
+ c.errors.typeMismatch(value.ID(), c.location(value), types.NewOptionalType(valType), valType)
}
}
if !c.isAssignable(fieldType, valType) {
- c.errors.fieldTypeMismatch(ent.GetId(), c.locationByID(ent.GetId()), field, fieldType, valType)
+ c.errors.fieldTypeMismatch(f.ID(), c.locationByID(f.ID()), fieldName, fieldType, valType)
}
}
}
-func (c *checker) checkComprehension(e *exprpb.Expr) {
- comp := e.GetComprehensionExpr()
- c.check(comp.GetIterRange())
- c.check(comp.GetAccuInit())
- accuType := c.getType(comp.GetAccuInit())
- rangeType := substitute(c.mappings, c.getType(comp.GetIterRange()), false)
+func (c *checker) checkComprehension(e ast.Expr) {
+ comp := e.AsComprehension()
+ c.check(comp.IterRange())
+ c.check(comp.AccuInit())
+ accuType := c.getType(comp.AccuInit())
+ rangeType := substitute(c.mappings, c.getType(comp.IterRange()), false)
var varType *types.Type
switch rangeType.Kind() {
@@ -564,32 +514,32 @@ func (c *checker) checkComprehension(e *exprpb.Expr) {
// Set the range iteration variable to type DYN as well.
varType = types.DynType
default:
- c.errors.notAComprehensionRange(comp.GetIterRange().GetId(), c.location(comp.GetIterRange()), rangeType)
+ c.errors.notAComprehensionRange(comp.IterRange().ID(), c.location(comp.IterRange()), rangeType)
varType = types.ErrorType
}
// Create a scope for the comprehension since it has a local accumulation variable.
// This scope will contain the accumulation variable used to compute the result.
c.env = c.env.enterScope()
- c.env.AddIdents(decls.NewVariable(comp.GetAccuVar(), accuType))
+ c.env.AddIdents(decls.NewVariable(comp.AccuVar(), accuType))
// Create a block scope for the loop.
c.env = c.env.enterScope()
- c.env.AddIdents(decls.NewVariable(comp.GetIterVar(), varType))
+ c.env.AddIdents(decls.NewVariable(comp.IterVar(), varType))
// Check the variable references in the condition and step.
- c.check(comp.GetLoopCondition())
- c.assertType(comp.GetLoopCondition(), types.BoolType)
- c.check(comp.GetLoopStep())
- c.assertType(comp.GetLoopStep(), accuType)
+ c.check(comp.LoopCondition())
+ c.assertType(comp.LoopCondition(), types.BoolType)
+ c.check(comp.LoopStep())
+ c.assertType(comp.LoopStep(), accuType)
// Exit the loop's block scope before checking the result.
c.env = c.env.exitScope()
- c.check(comp.GetResult())
+ c.check(comp.Result())
// Exit the comprehension scope.
c.env = c.env.exitScope()
- c.setType(e, substitute(c.mappings, c.getType(comp.GetResult()), false))
+ c.setType(e, substitute(c.mappings, c.getType(comp.Result()), false))
}
// Checks compatibility of joined types, and returns the most general common type.
-func (c *checker) joinTypes(e *exprpb.Expr, previous, current *types.Type) *types.Type {
+func (c *checker) joinTypes(e ast.Expr, previous, current *types.Type) *types.Type {
if previous == nil {
return current
}
@@ -599,7 +549,7 @@ func (c *checker) joinTypes(e *exprpb.Expr, previous, current *types.Type) *type
if c.dynAggregateLiteralElementTypesEnabled() {
return types.DynType
}
- c.errors.typeMismatch(e.GetId(), c.location(e), previous, current)
+ c.errors.typeMismatch(e.ID(), c.location(e), previous, current)
return types.ErrorType
}
@@ -633,41 +583,41 @@ func (c *checker) isAssignableList(l1, l2 []*types.Type) bool {
return false
}
-func maybeUnwrapString(e *exprpb.Expr) (string, bool) {
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- literal := e.GetConstExpr()
- switch literal.GetConstantKind().(type) {
- case *exprpb.Constant_StringValue:
- return literal.GetStringValue(), true
+func maybeUnwrapString(e ast.Expr) (string, bool) {
+ switch e.Kind() {
+ case ast.LiteralKind:
+ literal := e.AsLiteral()
+ switch v := literal.(type) {
+ case types.String:
+ return string(v), true
}
}
return "", false
}
-func (c *checker) setType(e *exprpb.Expr, t *types.Type) {
- if old, found := c.types[e.GetId()]; found && !old.IsExactType(t) {
- c.errors.incompatibleType(e.GetId(), c.location(e), e, old, t)
+func (c *checker) setType(e ast.Expr, t *types.Type) {
+ if old, found := c.TypeMap()[e.ID()]; found && !old.IsExactType(t) {
+ c.errors.incompatibleType(e.ID(), c.location(e), e, old, t)
return
}
- c.types[e.GetId()] = t
+ c.SetType(e.ID(), t)
}
-func (c *checker) getType(e *exprpb.Expr) *types.Type {
- return c.types[e.GetId()]
+func (c *checker) getType(e ast.Expr) *types.Type {
+ return c.TypeMap()[e.ID()]
}
-func (c *checker) setReference(e *exprpb.Expr, r *ast.ReferenceInfo) {
- if old, found := c.references[e.GetId()]; found && !old.Equals(r) {
- c.errors.referenceRedefinition(e.GetId(), c.location(e), e, old, r)
+func (c *checker) setReference(e ast.Expr, r *ast.ReferenceInfo) {
+ if old, found := c.ReferenceMap()[e.ID()]; found && !old.Equals(r) {
+ c.errors.referenceRedefinition(e.ID(), c.location(e), e, old, r)
return
}
- c.references[e.GetId()] = r
+ c.SetReference(e.ID(), r)
}
-func (c *checker) assertType(e *exprpb.Expr, t *types.Type) {
+func (c *checker) assertType(e ast.Expr, t *types.Type) {
if !c.isAssignable(t, c.getType(e)) {
- c.errors.typeMismatch(e.GetId(), c.location(e), t, c.getType(e))
+ c.errors.typeMismatch(e.ID(), c.location(e), t, c.getType(e))
}
}
@@ -683,26 +633,12 @@ func newResolution(r *ast.ReferenceInfo, t *types.Type) *overloadResolution {
}
}
-func (c *checker) location(e *exprpb.Expr) common.Location {
- return c.locationByID(e.GetId())
+func (c *checker) location(e ast.Expr) common.Location {
+ return c.locationByID(e.ID())
}
func (c *checker) locationByID(id int64) common.Location {
- positions := c.sourceInfo.GetPositions()
- var line = 1
- if offset, found := positions[id]; found {
- col := int(offset)
- for _, lineOffset := range c.sourceInfo.GetLineOffsets() {
- if lineOffset < offset {
- line++
- col = int(offset - lineOffset)
- } else {
- break
- }
- }
- return common.NewLocation(line, col)
- }
- return common.NoLocation
+ return c.SourceInfo().GetStartLocation(id)
}
func (c *checker) lookupFieldType(exprID int64, structType, fieldName string) (*types.Type, bool) {
diff --git a/vendor/github.com/google/cel-go/checker/cost.go b/vendor/github.com/google/cel-go/checker/cost.go
index f232f30daca..04244694d81 100644
--- a/vendor/github.com/google/cel-go/checker/cost.go
+++ b/vendor/github.com/google/cel-go/checker/cost.go
@@ -22,8 +22,6 @@ import (
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/parser"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// WARNING: Any changes to cost calculations in this file require a corresponding change in interpreter/runtimecost.go
@@ -58,7 +56,7 @@ type AstNode interface {
// Type returns the deduced type of the AstNode.
Type() *types.Type
// Expr returns the expression of the AstNode.
- Expr() *exprpb.Expr
+ Expr() ast.Expr
// ComputedSize returns a size estimate of the AstNode derived from information available in the CEL expression.
// For constants and inline list and map declarations, the exact size is returned. For concatenated list, strings
// and bytes, the size is derived from the size estimates of the operands. nil is returned if there is no
@@ -69,7 +67,7 @@ type AstNode interface {
type astNode struct {
path []string
t *types.Type
- expr *exprpb.Expr
+ expr ast.Expr
derivedSize *SizeEstimate
}
@@ -81,7 +79,7 @@ func (e astNode) Type() *types.Type {
return e.t
}
-func (e astNode) Expr() *exprpb.Expr {
+func (e astNode) Expr() ast.Expr {
return e.expr
}
@@ -90,29 +88,27 @@ func (e astNode) ComputedSize() *SizeEstimate {
return e.derivedSize
}
var v uint64
- switch ek := e.expr.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- switch ck := ek.ConstExpr.GetConstantKind().(type) {
- case *exprpb.Constant_StringValue:
+ switch e.expr.Kind() {
+ case ast.LiteralKind:
+ switch ck := e.expr.AsLiteral().(type) {
+ case types.String:
// converting to runes here is an O(n) operation, but
// this is consistent with how size is computed at runtime,
// and how the language definition defines string size
- v = uint64(len([]rune(ck.StringValue)))
- case *exprpb.Constant_BytesValue:
- v = uint64(len(ck.BytesValue))
- case *exprpb.Constant_BoolValue, *exprpb.Constant_DoubleValue, *exprpb.Constant_DurationValue,
- *exprpb.Constant_Int64Value, *exprpb.Constant_TimestampValue, *exprpb.Constant_Uint64Value,
- *exprpb.Constant_NullValue:
+ v = uint64(len([]rune(ck)))
+ case types.Bytes:
+ v = uint64(len(ck))
+ case types.Bool, types.Double, types.Duration,
+ types.Int, types.Timestamp, types.Uint,
+ types.Null:
v = uint64(1)
default:
return nil
}
- case *exprpb.Expr_ListExpr:
- v = uint64(len(ek.ListExpr.GetElements()))
- case *exprpb.Expr_StructExpr:
- if ek.StructExpr.GetMessageName() == "" {
- v = uint64(len(ek.StructExpr.GetEntries()))
- }
+ case ast.ListKind:
+ v = uint64(e.expr.AsList().Size())
+ case ast.MapKind:
+ v = uint64(e.expr.AsMap().Size())
default:
return nil
}
@@ -265,7 +261,7 @@ type coster struct {
iterRanges iterRangeScopes
// computedSizes tracks the computed sizes of call results.
computedSizes map[int64]SizeEstimate
- checkedAST *ast.CheckedAST
+ checkedAST *ast.AST
estimator CostEstimator
overloadEstimators map[string]FunctionEstimator
// presenceTestCost will either be a zero or one based on whether has() macros count against cost computations.
@@ -275,8 +271,8 @@ type coster struct {
// Use a stack of iterVar -> iterRange Expr Ids to handle shadowed variable names.
type iterRangeScopes map[string][]int64
-func (vs iterRangeScopes) push(varName string, expr *exprpb.Expr) {
- vs[varName] = append(vs[varName], expr.GetId())
+func (vs iterRangeScopes) push(varName string, expr ast.Expr) {
+ vs[varName] = append(vs[varName], expr.ID())
}
func (vs iterRangeScopes) pop(varName string) {
@@ -324,9 +320,9 @@ func OverloadCostEstimate(overloadID string, functionCoster FunctionEstimator) C
}
// Cost estimates the cost of the parsed and type checked CEL expression.
-func Cost(checker *ast.CheckedAST, estimator CostEstimator, opts ...CostOption) (CostEstimate, error) {
+func Cost(checked *ast.AST, estimator CostEstimator, opts ...CostOption) (CostEstimate, error) {
c := &coster{
- checkedAST: checker,
+ checkedAST: checked,
estimator: estimator,
overloadEstimators: map[string]FunctionEstimator{},
exprPath: map[int64][]string{},
@@ -340,28 +336,30 @@ func Cost(checker *ast.CheckedAST, estimator CostEstimator, opts ...CostOption)
return CostEstimate{}, err
}
}
- return c.cost(checker.Expr), nil
+ return c.cost(checked.Expr()), nil
}
-func (c *coster) cost(e *exprpb.Expr) CostEstimate {
+func (c *coster) cost(e ast.Expr) CostEstimate {
if e == nil {
return CostEstimate{}
}
var cost CostEstimate
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
+ switch e.Kind() {
+ case ast.LiteralKind:
cost = constCost
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
cost = c.costIdent(e)
- case *exprpb.Expr_SelectExpr:
+ case ast.SelectKind:
cost = c.costSelect(e)
- case *exprpb.Expr_CallExpr:
+ case ast.CallKind:
cost = c.costCall(e)
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
cost = c.costCreateList(e)
- case *exprpb.Expr_StructExpr:
+ case ast.MapKind:
+ cost = c.costCreateMap(e)
+ case ast.StructKind:
cost = c.costCreateStruct(e)
- case *exprpb.Expr_ComprehensionExpr:
+ case ast.ComprehensionKind:
cost = c.costComprehension(e)
default:
return CostEstimate{}
@@ -369,53 +367,51 @@ func (c *coster) cost(e *exprpb.Expr) CostEstimate {
return cost
}
-func (c *coster) costIdent(e *exprpb.Expr) CostEstimate {
- identExpr := e.GetIdentExpr()
-
+func (c *coster) costIdent(e ast.Expr) CostEstimate {
+ identName := e.AsIdent()
// build and track the field path
- if iterRange, ok := c.iterRanges.peek(identExpr.GetName()); ok {
- switch c.checkedAST.TypeMap[iterRange].Kind() {
+ if iterRange, ok := c.iterRanges.peek(identName); ok {
+ switch c.checkedAST.GetType(iterRange).Kind() {
case types.ListKind:
c.addPath(e, append(c.exprPath[iterRange], "@items"))
case types.MapKind:
c.addPath(e, append(c.exprPath[iterRange], "@keys"))
}
} else {
- c.addPath(e, []string{identExpr.GetName()})
+ c.addPath(e, []string{identName})
}
return selectAndIdentCost
}
-func (c *coster) costSelect(e *exprpb.Expr) CostEstimate {
- sel := e.GetSelectExpr()
+func (c *coster) costSelect(e ast.Expr) CostEstimate {
+ sel := e.AsSelect()
var sum CostEstimate
- if sel.GetTestOnly() {
+ if sel.IsTestOnly() {
// recurse, but do not add any cost
// this is equivalent to how evalTestOnly increments the runtime cost counter
// but does not add any additional cost for the qualifier, except here we do
// the reverse (ident adds cost)
sum = sum.Add(c.presenceTestCost)
- sum = sum.Add(c.cost(sel.GetOperand()))
+ sum = sum.Add(c.cost(sel.Operand()))
return sum
}
- sum = sum.Add(c.cost(sel.GetOperand()))
- targetType := c.getType(sel.GetOperand())
+ sum = sum.Add(c.cost(sel.Operand()))
+ targetType := c.getType(sel.Operand())
switch targetType.Kind() {
case types.MapKind, types.StructKind, types.TypeParamKind:
sum = sum.Add(selectAndIdentCost)
}
// build and track the field path
- c.addPath(e, append(c.getPath(sel.GetOperand()), sel.GetField()))
+ c.addPath(e, append(c.getPath(sel.Operand()), sel.FieldName()))
return sum
}
-func (c *coster) costCall(e *exprpb.Expr) CostEstimate {
- call := e.GetCallExpr()
- target := call.GetTarget()
- args := call.GetArgs()
+func (c *coster) costCall(e ast.Expr) CostEstimate {
+ call := e.AsCall()
+ args := call.Args()
var sum CostEstimate
@@ -426,22 +422,20 @@ func (c *coster) costCall(e *exprpb.Expr) CostEstimate {
argTypes[i] = c.newAstNode(arg)
}
- ref := c.checkedAST.ReferenceMap[e.GetId()]
- if ref == nil || len(ref.OverloadIDs) == 0 {
+ overloadIDs := c.checkedAST.GetOverloadIDs(e.ID())
+ if len(overloadIDs) == 0 {
return CostEstimate{}
}
var targetType AstNode
- if target != nil {
- if call.Target != nil {
- sum = sum.Add(c.cost(call.GetTarget()))
- targetType = c.newAstNode(call.GetTarget())
- }
+ if call.IsMemberFunction() {
+ sum = sum.Add(c.cost(call.Target()))
+ targetType = c.newAstNode(call.Target())
}
// Pick a cost estimate range that covers all the overload cost estimation ranges
fnCost := CostEstimate{Min: uint64(math.MaxUint64), Max: 0}
var resultSize *SizeEstimate
- for _, overload := range ref.OverloadIDs {
- overloadCost := c.functionCost(call.GetFunction(), overload, &targetType, argTypes, argCosts)
+ for _, overload := range overloadIDs {
+ overloadCost := c.functionCost(call.FunctionName(), overload, &targetType, argTypes, argCosts)
fnCost = fnCost.Union(overloadCost.CostEstimate)
if overloadCost.ResultSize != nil {
if resultSize == nil {
@@ -464,62 +458,57 @@ func (c *coster) costCall(e *exprpb.Expr) CostEstimate {
}
}
if resultSize != nil {
- c.computedSizes[e.GetId()] = *resultSize
+ c.computedSizes[e.ID()] = *resultSize
}
return sum.Add(fnCost)
}
-func (c *coster) costCreateList(e *exprpb.Expr) CostEstimate {
- create := e.GetListExpr()
+func (c *coster) costCreateList(e ast.Expr) CostEstimate {
+ create := e.AsList()
var sum CostEstimate
- for _, e := range create.GetElements() {
+ for _, e := range create.Elements() {
sum = sum.Add(c.cost(e))
}
return sum.Add(createListBaseCost)
}
-func (c *coster) costCreateStruct(e *exprpb.Expr) CostEstimate {
- str := e.GetStructExpr()
- if str.MessageName != "" {
- return c.costCreateMessage(e)
- }
- return c.costCreateMap(e)
-}
-
-func (c *coster) costCreateMap(e *exprpb.Expr) CostEstimate {
- mapVal := e.GetStructExpr()
+func (c *coster) costCreateMap(e ast.Expr) CostEstimate {
+ mapVal := e.AsMap()
var sum CostEstimate
- for _, ent := range mapVal.GetEntries() {
- key := ent.GetMapKey()
- sum = sum.Add(c.cost(key))
-
- sum = sum.Add(c.cost(ent.GetValue()))
+ for _, ent := range mapVal.Entries() {
+ entry := ent.AsMapEntry()
+ sum = sum.Add(c.cost(entry.Key()))
+ sum = sum.Add(c.cost(entry.Value()))
}
return sum.Add(createMapBaseCost)
}
-func (c *coster) costCreateMessage(e *exprpb.Expr) CostEstimate {
- msgVal := e.GetStructExpr()
+func (c *coster) costCreateStruct(e ast.Expr) CostEstimate {
+ msgVal := e.AsStruct()
var sum CostEstimate
- for _, ent := range msgVal.GetEntries() {
- sum = sum.Add(c.cost(ent.GetValue()))
+ for _, ent := range msgVal.Fields() {
+ field := ent.AsStructField()
+ sum = sum.Add(c.cost(field.Value()))
}
return sum.Add(createMessageBaseCost)
}
-func (c *coster) costComprehension(e *exprpb.Expr) CostEstimate {
- comp := e.GetComprehensionExpr()
+func (c *coster) costComprehension(e ast.Expr) CostEstimate {
+ comp := e.AsComprehension()
var sum CostEstimate
- sum = sum.Add(c.cost(comp.GetIterRange()))
- sum = sum.Add(c.cost(comp.GetAccuInit()))
+ sum = sum.Add(c.cost(comp.IterRange()))
+ sum = sum.Add(c.cost(comp.AccuInit()))
// Track the iterRange of each IterVar for field path construction
- c.iterRanges.push(comp.GetIterVar(), comp.GetIterRange())
- loopCost := c.cost(comp.GetLoopCondition())
- stepCost := c.cost(comp.GetLoopStep())
- c.iterRanges.pop(comp.GetIterVar())
- sum = sum.Add(c.cost(comp.Result))
- rangeCnt := c.sizeEstimate(c.newAstNode(comp.GetIterRange()))
+ c.iterRanges.push(comp.IterVar(), comp.IterRange())
+ loopCost := c.cost(comp.LoopCondition())
+ stepCost := c.cost(comp.LoopStep())
+ c.iterRanges.pop(comp.IterVar())
+ sum = sum.Add(c.cost(comp.Result()))
+ rangeCnt := c.sizeEstimate(c.newAstNode(comp.IterRange()))
+
+ c.computedSizes[e.ID()] = rangeCnt
+
rangeCost := rangeCnt.MultiplyByCost(stepCost.Add(loopCost))
sum = sum.Add(rangeCost)
@@ -671,26 +660,26 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
return CallEstimate{CostEstimate: CostEstimate{Min: 1, Max: 1}.Add(argCostSum())}
}
-func (c *coster) getType(e *exprpb.Expr) *types.Type {
- return c.checkedAST.TypeMap[e.GetId()]
+func (c *coster) getType(e ast.Expr) *types.Type {
+ return c.checkedAST.GetType(e.ID())
}
-func (c *coster) getPath(e *exprpb.Expr) []string {
- return c.exprPath[e.GetId()]
+func (c *coster) getPath(e ast.Expr) []string {
+ return c.exprPath[e.ID()]
}
-func (c *coster) addPath(e *exprpb.Expr, path []string) {
- c.exprPath[e.GetId()] = path
+func (c *coster) addPath(e ast.Expr, path []string) {
+ c.exprPath[e.ID()] = path
}
-func (c *coster) newAstNode(e *exprpb.Expr) *astNode {
+func (c *coster) newAstNode(e ast.Expr) *astNode {
path := c.getPath(e)
if len(path) > 0 && path[0] == parser.AccumulatorName {
// only provide paths to root vars; omit accumulator vars
path = nil
}
var derivedSize *SizeEstimate
- if size, ok := c.computedSizes[e.GetId()]; ok {
+ if size, ok := c.computedSizes[e.ID()]; ok {
derivedSize = &size
}
return &astNode{
diff --git a/vendor/github.com/google/cel-go/checker/decls/decls.go b/vendor/github.com/google/cel-go/checker/decls/decls.go
index 0d91bef5145..c0e5de469f5 100644
--- a/vendor/github.com/google/cel-go/checker/decls/decls.go
+++ b/vendor/github.com/google/cel-go/checker/decls/decls.go
@@ -67,7 +67,7 @@ func NewAbstractType(name string, paramTypes ...*exprpb.Type) *exprpb.Type {
// NewOptionalType constructs an abstract type indicating that the parameterized type
// may be contained within the object.
func NewOptionalType(paramType *exprpb.Type) *exprpb.Type {
- return NewAbstractType("optional", paramType)
+ return NewAbstractType("optional_type", paramType)
}
// NewFunctionType creates a function invocation contract, typically only used
diff --git a/vendor/github.com/google/cel-go/checker/env.go b/vendor/github.com/google/cel-go/checker/env.go
index 70682b17c6b..d5ac05014ee 100644
--- a/vendor/github.com/google/cel-go/checker/env.go
+++ b/vendor/github.com/google/cel-go/checker/env.go
@@ -146,6 +146,14 @@ func (e *Env) LookupIdent(name string) *decls.VariableDecl {
return decl
}
+ if i, found := e.provider.FindIdent(candidate); found {
+ if t, ok := i.(*types.Type); ok {
+ decl := decls.NewVariable(candidate, types.NewTypeTypeWithParam(t))
+ e.declarations.AddIdent(decl)
+ return decl
+ }
+ }
+
// Next try to import this as an enum value by splitting the name in a type prefix and
// the enum inside.
if enumValue := e.provider.EnumValue(candidate); enumValue.Type() != types.ErrType {
diff --git a/vendor/github.com/google/cel-go/checker/errors.go b/vendor/github.com/google/cel-go/checker/errors.go
index c2b96498d1d..8b3bf0b8b64 100644
--- a/vendor/github.com/google/cel-go/checker/errors.go
+++ b/vendor/github.com/google/cel-go/checker/errors.go
@@ -15,13 +15,9 @@
package checker
import (
- "reflect"
-
"github.com/google/cel-go/common"
"github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// typeErrors is a specialization of Errors.
@@ -34,9 +30,9 @@ func (e *typeErrors) fieldTypeMismatch(id int64, l common.Location, name string,
name, FormatCELType(field), FormatCELType(value))
}
-func (e *typeErrors) incompatibleType(id int64, l common.Location, ex *exprpb.Expr, prev, next *types.Type) {
+func (e *typeErrors) incompatibleType(id int64, l common.Location, ex ast.Expr, prev, next *types.Type) {
e.errs.ReportErrorAtID(id, l,
- "incompatible type already exists for expression: %v(%d) old:%v, new:%v", ex, ex.GetId(), prev, next)
+ "incompatible type already exists for expression: %v(%d) old:%v, new:%v", ex, ex.ID(), prev, next)
}
func (e *typeErrors) noMatchingOverload(id int64, l common.Location, name string, args []*types.Type, isInstance bool) {
@@ -49,7 +45,7 @@ func (e *typeErrors) notAComprehensionRange(id int64, l common.Location, t *type
FormatCELType(t))
}
-func (e *typeErrors) notAnOptionalFieldSelection(id int64, l common.Location, field *exprpb.Expr) {
+func (e *typeErrors) notAnOptionalFieldSelection(id int64, l common.Location, field ast.Expr) {
e.errs.ReportErrorAtID(id, l, "unsupported optional field selection: %v", field)
}
@@ -61,9 +57,9 @@ func (e *typeErrors) notAMessageType(id int64, l common.Location, typeName strin
e.errs.ReportErrorAtID(id, l, "'%s' is not a message type", typeName)
}
-func (e *typeErrors) referenceRedefinition(id int64, l common.Location, ex *exprpb.Expr, prev, next *ast.ReferenceInfo) {
+func (e *typeErrors) referenceRedefinition(id int64, l common.Location, ex ast.Expr, prev, next *ast.ReferenceInfo) {
e.errs.ReportErrorAtID(id, l,
- "reference already exists for expression: %v(%d) old:%v, new:%v", ex, ex.GetId(), prev, next)
+ "reference already exists for expression: %v(%d) old:%v, new:%v", ex, ex.ID(), prev, next)
}
func (e *typeErrors) typeDoesNotSupportFieldSelection(id int64, l common.Location, t *types.Type) {
@@ -87,6 +83,6 @@ func (e *typeErrors) unexpectedFailedResolution(id int64, l common.Location, typ
e.errs.ReportErrorAtID(id, l, "unexpected failed resolution of '%s'", typeName)
}
-func (e *typeErrors) unexpectedASTType(id int64, l common.Location, ex *exprpb.Expr) {
- e.errs.ReportErrorAtID(id, l, "unrecognized ast type: %v", reflect.TypeOf(ex))
+func (e *typeErrors) unexpectedASTType(id int64, l common.Location, kind, typeName string) {
+ e.errs.ReportErrorAtID(id, l, "unexpected %s type: %v", kind, typeName)
}
diff --git a/vendor/github.com/google/cel-go/checker/printer.go b/vendor/github.com/google/cel-go/checker/printer.go
index 15cba06ee97..7a3984f02ce 100644
--- a/vendor/github.com/google/cel-go/checker/printer.go
+++ b/vendor/github.com/google/cel-go/checker/printer.go
@@ -17,40 +17,40 @@ package checker
import (
"sort"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/debug"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
type semanticAdorner struct {
- checks *exprpb.CheckedExpr
+ checked *ast.AST
}
var _ debug.Adorner = &semanticAdorner{}
func (a *semanticAdorner) GetMetadata(elem any) string {
result := ""
- e, isExpr := elem.(*exprpb.Expr)
+ e, isExpr := elem.(ast.Expr)
if !isExpr {
return result
}
- t := a.checks.TypeMap[e.GetId()]
+ t := a.checked.TypeMap()[e.ID()]
if t != nil {
result += "~"
- result += FormatCheckedType(t)
+ result += FormatCELType(t)
}
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr,
- *exprpb.Expr_CallExpr,
- *exprpb.Expr_StructExpr,
- *exprpb.Expr_SelectExpr:
- if ref, found := a.checks.ReferenceMap[e.GetId()]; found {
- if len(ref.GetOverloadId()) == 0 {
+ switch e.Kind() {
+ case ast.IdentKind,
+ ast.CallKind,
+ ast.ListKind,
+ ast.StructKind,
+ ast.SelectKind:
+ if ref, found := a.checked.ReferenceMap()[e.ID()]; found {
+ if len(ref.OverloadIDs) == 0 {
result += "^" + ref.Name
} else {
- sort.Strings(ref.GetOverloadId())
- for i, overload := range ref.GetOverloadId() {
+ sort.Strings(ref.OverloadIDs)
+ for i, overload := range ref.OverloadIDs {
if i == 0 {
result += "^"
} else {
@@ -68,7 +68,7 @@ func (a *semanticAdorner) GetMetadata(elem any) string {
// Print returns a string representation of the Expr message,
// annotated with types from the CheckedExpr. The Expr must
// be a sub-expression embedded in the CheckedExpr.
-func Print(e *exprpb.Expr, checks *exprpb.CheckedExpr) string {
- a := &semanticAdorner{checks: checks}
+func Print(e ast.Expr, checked *ast.AST) string {
+ a := &semanticAdorner{checked: checked}
return debug.ToAdornedDebugString(e, a)
}
diff --git a/vendor/github.com/google/cel-go/checker/types.go b/vendor/github.com/google/cel-go/checker/types.go
index e2373d1b7cb..4c65b2737cd 100644
--- a/vendor/github.com/google/cel-go/checker/types.go
+++ b/vendor/github.com/google/cel-go/checker/types.go
@@ -41,7 +41,7 @@ func isError(t *types.Type) bool {
func isOptional(t *types.Type) bool {
if t.Kind() == types.OpaqueKind {
- return t.TypeName() == "optional"
+ return t.TypeName() == "optional_type"
}
return false
}
@@ -137,7 +137,11 @@ func internalIsAssignable(m *mapping, t1, t2 *types.Type) bool {
case types.BoolKind, types.BytesKind, types.DoubleKind, types.IntKind, types.StringKind, types.UintKind,
types.AnyKind, types.DurationKind, types.TimestampKind,
types.StructKind:
- return t1.IsAssignableType(t2)
+ // Test whether t2 is assignable from t1. The order of this check won't usually matter;
+ // however, there may be cases where type capabilities are expanded beyond what is supported
+ // in the current common/types package. For example, an interface designation for a group of
+ // Struct types.
+ return t2.IsAssignableType(t1)
case types.TypeKind:
return kind2 == types.TypeKind
case types.OpaqueKind, types.ListKind, types.MapKind:
@@ -256,7 +260,7 @@ func notReferencedIn(m *mapping, t, withinType *types.Type) bool {
return true
}
return notReferencedIn(m, t, wtSub)
- case types.OpaqueKind, types.ListKind, types.MapKind:
+ case types.OpaqueKind, types.ListKind, types.MapKind, types.TypeKind:
for _, pt := range withinType.Parameters() {
if !notReferencedIn(m, t, pt) {
return false
@@ -288,7 +292,8 @@ func substitute(m *mapping, t *types.Type, typeParamToDyn bool) *types.Type {
substitute(m, t.Parameters()[1], typeParamToDyn))
case types.TypeKind:
if len(t.Parameters()) > 0 {
- return types.NewTypeTypeWithParam(substitute(m, t.Parameters()[0], typeParamToDyn))
+ tParam := t.Parameters()[0]
+ return types.NewTypeTypeWithParam(substitute(m, tParam, typeParamToDyn))
}
return t
default:
diff --git a/vendor/github.com/google/cel-go/common/ast/BUILD.bazel b/vendor/github.com/google/cel-go/common/ast/BUILD.bazel
index 7269cdff5f7..5c40c37813b 100644
--- a/vendor/github.com/google/cel-go/common/ast/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/ast/BUILD.bazel
@@ -1,12 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
package(
- default_visibility = [
- "//cel:__subpackages__",
- "//checker:__subpackages__",
- "//common:__subpackages__",
- "//interpreter:__subpackages__",
- ],
+ default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
)
@@ -14,10 +9,14 @@ go_library(
name = "go_default_library",
srcs = [
"ast.go",
+ "conversion.go",
"expr.go",
+ "factory.go",
+ "navigable.go",
],
importpath = "github.com/google/cel-go/common/ast",
deps = [
+ "//common:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
@@ -29,7 +28,9 @@ go_test(
name = "go_default_test",
srcs = [
"ast_test.go",
+ "conversion_test.go",
"expr_test.go",
+ "navigable_test.go",
],
embed = [
":go_default_library",
@@ -48,5 +49,6 @@ go_test(
"//test/proto3pb:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
+ "@org_golang_google_protobuf//encoding/prototext:go_default_library",
],
-)
\ No newline at end of file
+)
diff --git a/vendor/github.com/google/cel-go/common/ast/ast.go b/vendor/github.com/google/cel-go/common/ast/ast.go
index b3c150793a9..355ddd49a2b 100644
--- a/vendor/github.com/google/cel-go/common/ast/ast.go
+++ b/vendor/github.com/google/cel-go/common/ast/ast.go
@@ -16,74 +16,361 @@
package ast
import (
- "fmt"
-
+ "github.com/google/cel-go/common"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
+)
- structpb "google.golang.org/protobuf/types/known/structpb"
+// AST contains a protobuf expression and source info along with CEL-native type and reference information.
+type AST struct {
+ expr Expr
+ sourceInfo *SourceInfo
+ typeMap map[int64]*types.Type
+ refMap map[int64]*ReferenceInfo
+}
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
-)
+// Expr returns the root ast.Expr value in the AST.
+func (a *AST) Expr() Expr {
+ if a == nil {
+ return nilExpr
+ }
+ return a.expr
+}
+
+// SourceInfo returns the source metadata associated with the parse / type-check passes.
+func (a *AST) SourceInfo() *SourceInfo {
+ if a == nil {
+ return nil
+ }
+ return a.sourceInfo
+}
-// CheckedAST contains a protobuf expression and source info along with CEL-native type and reference information.
-type CheckedAST struct {
- Expr *exprpb.Expr
- SourceInfo *exprpb.SourceInfo
- TypeMap map[int64]*types.Type
- ReferenceMap map[int64]*ReferenceInfo
-}
-
-// CheckedASTToCheckedExpr converts a CheckedAST to a CheckedExpr protobouf.
-func CheckedASTToCheckedExpr(ast *CheckedAST) (*exprpb.CheckedExpr, error) {
- refMap := make(map[int64]*exprpb.Reference, len(ast.ReferenceMap))
- for id, ref := range ast.ReferenceMap {
- r, err := ReferenceInfoToReferenceExpr(ref)
- if err != nil {
- return nil, err
+// GetType returns the type for the expression at the given id, if one exists, else types.DynType.
+func (a *AST) GetType(id int64) *types.Type {
+ if t, found := a.TypeMap()[id]; found {
+ return t
+ }
+ return types.DynType
+}
+
+// SetType sets the type of the expression node at the given id.
+func (a *AST) SetType(id int64, t *types.Type) {
+ if a == nil {
+ return
+ }
+ a.typeMap[id] = t
+}
+
+// TypeMap returns the map of expression ids to type-checked types.
+//
+// If the AST is not type-checked, the map will be empty.
+func (a *AST) TypeMap() map[int64]*types.Type {
+ if a == nil {
+ return map[int64]*types.Type{}
+ }
+ return a.typeMap
+}
+
+// GetOverloadIDs returns the set of overload function names for a given expression id.
+//
+// If the expression id is not a function call, or the AST is not type-checked, the result will be empty.
+func (a *AST) GetOverloadIDs(id int64) []string {
+ if ref, found := a.ReferenceMap()[id]; found {
+ return ref.OverloadIDs
+ }
+ return []string{}
+}
+
+// ReferenceMap returns the map of expression id to identifier, constant, and function references.
+func (a *AST) ReferenceMap() map[int64]*ReferenceInfo {
+ if a == nil {
+ return map[int64]*ReferenceInfo{}
+ }
+ return a.refMap
+}
+
+// SetReference adds a reference to the checked AST type map.
+func (a *AST) SetReference(id int64, r *ReferenceInfo) {
+ if a == nil {
+ return
+ }
+ a.refMap[id] = r
+}
+
+// IsChecked returns whether the AST is type-checked.
+func (a *AST) IsChecked() bool {
+ return a != nil && len(a.TypeMap()) > 0
+}
+
+// NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value.
+func NewAST(e Expr, sourceInfo *SourceInfo) *AST {
+ if e == nil {
+ e = nilExpr
+ }
+ return &AST{
+ expr: e,
+ sourceInfo: sourceInfo,
+ typeMap: make(map[int64]*types.Type),
+ refMap: make(map[int64]*ReferenceInfo),
+ }
+}
+
+// NewCheckedAST wraps an parsed AST and augments it with type and reference metadata.
+func NewCheckedAST(parsed *AST, typeMap map[int64]*types.Type, refMap map[int64]*ReferenceInfo) *AST {
+ return &AST{
+ expr: parsed.Expr(),
+ sourceInfo: parsed.SourceInfo(),
+ typeMap: typeMap,
+ refMap: refMap,
+ }
+}
+
+// Copy creates a deep copy of the Expr and SourceInfo values in the input AST.
+//
+// Copies of the Expr value are generated using an internal default ExprFactory.
+func Copy(a *AST) *AST {
+ if a == nil {
+ return nil
+ }
+ e := defaultFactory.CopyExpr(a.expr)
+ if !a.IsChecked() {
+ return NewAST(e, CopySourceInfo(a.SourceInfo()))
+ }
+ typesCopy := make(map[int64]*types.Type, len(a.typeMap))
+ for id, t := range a.typeMap {
+ typesCopy[id] = t
+ }
+ refsCopy := make(map[int64]*ReferenceInfo, len(a.refMap))
+ for id, r := range a.refMap {
+ refsCopy[id] = r
+ }
+ return NewCheckedAST(NewAST(e, CopySourceInfo(a.SourceInfo())), typesCopy, refsCopy)
+}
+
+// MaxID returns the upper-bound, non-inclusive, of ids present within the AST's Expr value.
+func MaxID(a *AST) int64 {
+ visitor := &maxIDVisitor{maxID: 1}
+ PostOrderVisit(a.Expr(), visitor)
+ for id, call := range a.SourceInfo().MacroCalls() {
+ PostOrderVisit(call, visitor)
+ if id > visitor.maxID {
+ visitor.maxID = id + 1
}
- refMap[id] = r
}
- typeMap := make(map[int64]*exprpb.Type, len(ast.TypeMap))
- for id, typ := range ast.TypeMap {
- t, err := types.TypeToExprType(typ)
- if err != nil {
- return nil, err
+ return visitor.maxID + 1
+}
+
+// NewSourceInfo creates a simple SourceInfo object from an input common.Source value.
+func NewSourceInfo(src common.Source) *SourceInfo {
+ var lineOffsets []int32
+ var desc string
+ baseLine := int32(0)
+ baseCol := int32(0)
+ if src != nil {
+ desc = src.Description()
+ lineOffsets = src.LineOffsets()
+ // Determine whether the source metadata should be computed relative
+ // to a base line and column value. This can be determined by requesting
+ // the location for offset 0 from the source object.
+ if loc, found := src.OffsetLocation(0); found {
+ baseLine = int32(loc.Line()) - 1
+ baseCol = int32(loc.Column())
}
- typeMap[id] = t
- }
- return &exprpb.CheckedExpr{
- Expr: ast.Expr,
- SourceInfo: ast.SourceInfo,
- ReferenceMap: refMap,
- TypeMap: typeMap,
- }, nil
-}
-
-// CheckedExprToCheckedAST converts a CheckedExpr protobuf to a CheckedAST instance.
-func CheckedExprToCheckedAST(checked *exprpb.CheckedExpr) (*CheckedAST, error) {
- refMap := make(map[int64]*ReferenceInfo, len(checked.GetReferenceMap()))
- for id, ref := range checked.GetReferenceMap() {
- r, err := ReferenceExprToReferenceInfo(ref)
- if err != nil {
- return nil, err
+ }
+ return &SourceInfo{
+ desc: desc,
+ lines: lineOffsets,
+ baseLine: baseLine,
+ baseCol: baseCol,
+ offsetRanges: make(map[int64]OffsetRange),
+ macroCalls: make(map[int64]Expr),
+ }
+}
+
+// CopySourceInfo creates a deep copy of the MacroCalls within the input SourceInfo.
+//
+// Copies of macro Expr values are generated using an internal default ExprFactory.
+func CopySourceInfo(info *SourceInfo) *SourceInfo {
+ if info == nil {
+ return nil
+ }
+ rangesCopy := make(map[int64]OffsetRange, len(info.offsetRanges))
+ for id, off := range info.offsetRanges {
+ rangesCopy[id] = off
+ }
+ callsCopy := make(map[int64]Expr, len(info.macroCalls))
+ for id, call := range info.macroCalls {
+ callsCopy[id] = defaultFactory.CopyExpr(call)
+ }
+ return &SourceInfo{
+ syntax: info.syntax,
+ desc: info.desc,
+ lines: info.lines,
+ baseLine: info.baseLine,
+ baseCol: info.baseCol,
+ offsetRanges: rangesCopy,
+ macroCalls: callsCopy,
+ }
+}
+
+// SourceInfo records basic information about the expression as a textual input and
+// as a parsed expression value.
+type SourceInfo struct {
+ syntax string
+ desc string
+ lines []int32
+ baseLine int32
+ baseCol int32
+ offsetRanges map[int64]OffsetRange
+ macroCalls map[int64]Expr
+}
+
+// SyntaxVersion returns the syntax version associated with the text expression.
+func (s *SourceInfo) SyntaxVersion() string {
+ if s == nil {
+ return ""
+ }
+ return s.syntax
+}
+
+// Description provides information about where the expression came from.
+func (s *SourceInfo) Description() string {
+ if s == nil {
+ return ""
+ }
+ return s.desc
+}
+
+// LineOffsets returns a list of the 0-based character offsets in the input text where newlines appear.
+func (s *SourceInfo) LineOffsets() []int32 {
+ if s == nil {
+ return []int32{}
+ }
+ return s.lines
+}
+
+// MacroCalls returns a map of expression id to ast.Expr value where the id represents the expression
+// node where the macro was inserted into the AST, and the ast.Expr value represents the original call
+// signature which was replaced.
+func (s *SourceInfo) MacroCalls() map[int64]Expr {
+ if s == nil {
+ return map[int64]Expr{}
+ }
+ return s.macroCalls
+}
+
+// GetMacroCall returns the original ast.Expr value for the given expression if it was generated via
+// a macro replacement.
+//
+// Note, parsing options must be enabled to track macro calls before this method will return a value.
+func (s *SourceInfo) GetMacroCall(id int64) (Expr, bool) {
+ e, found := s.MacroCalls()[id]
+ return e, found
+}
+
+// SetMacroCall records a macro call at a specific location.
+func (s *SourceInfo) SetMacroCall(id int64, e Expr) {
+ if s != nil {
+ s.macroCalls[id] = e
+ }
+}
+
+// ClearMacroCall removes the macro call at the given expression id.
+func (s *SourceInfo) ClearMacroCall(id int64) {
+ if s != nil {
+ delete(s.macroCalls, id)
+ }
+}
+
+// OffsetRanges returns a map of expression id to OffsetRange values where the range indicates either:
+// the start and end position in the input stream where the expression occurs, or the start position
+// only. If the range only captures start position, the stop position of the range will be equal to
+// the start.
+func (s *SourceInfo) OffsetRanges() map[int64]OffsetRange {
+ if s == nil {
+ return map[int64]OffsetRange{}
+ }
+ return s.offsetRanges
+}
+
+// GetOffsetRange retrieves an OffsetRange for the given expression id if one exists.
+func (s *SourceInfo) GetOffsetRange(id int64) (OffsetRange, bool) {
+ if s == nil {
+ return OffsetRange{}, false
+ }
+ o, found := s.offsetRanges[id]
+ return o, found
+}
+
+// SetOffsetRange sets the OffsetRange for the given expression id.
+func (s *SourceInfo) SetOffsetRange(id int64, o OffsetRange) {
+ if s == nil {
+ return
+ }
+ s.offsetRanges[id] = o
+}
+
+// GetStartLocation calculates the human-readable 1-based line and 0-based column of the first character
+// of the expression node at the id.
+func (s *SourceInfo) GetStartLocation(id int64) common.Location {
+ if o, found := s.GetOffsetRange(id); found {
+ line := 1
+ col := int(o.Start)
+ for _, lineOffset := range s.LineOffsets() {
+ if lineOffset < o.Start {
+ line++
+ col = int(o.Start - lineOffset)
+ } else {
+ break
+ }
}
- refMap[id] = r
+ return common.NewLocation(line, col)
}
- typeMap := make(map[int64]*types.Type, len(checked.GetTypeMap()))
- for id, typ := range checked.GetTypeMap() {
- t, err := types.ExprTypeToType(typ)
- if err != nil {
- return nil, err
+ return common.NoLocation
+}
+
+// GetStopLocation calculates the human-readable 1-based line and 0-based column of the last character for
+// the expression node at the given id.
+//
+// If the SourceInfo was generated from a serialized protobuf representation, the stop location will
+// be identical to the start location for the expression.
+func (s *SourceInfo) GetStopLocation(id int64) common.Location {
+ if o, found := s.GetOffsetRange(id); found {
+ line := 1
+ col := int(o.Stop)
+ for _, lineOffset := range s.LineOffsets() {
+ if lineOffset < o.Stop {
+ line++
+ col = int(o.Stop - lineOffset)
+ } else {
+ break
+ }
}
- typeMap[id] = t
+ return common.NewLocation(line, col)
}
- return &CheckedAST{
- Expr: checked.GetExpr(),
- SourceInfo: checked.GetSourceInfo(),
- ReferenceMap: refMap,
- TypeMap: typeMap,
- }, nil
+ return common.NoLocation
+}
+
+// ComputeOffset calculates the 0-based character offset from a 1-based line and 0-based column.
+func (s *SourceInfo) ComputeOffset(line, col int32) int32 {
+ if s != nil {
+ line = s.baseLine + line
+ col = s.baseCol + col
+ }
+ if line == 1 {
+ return col
+ }
+ if line < 1 || line > int32(len(s.LineOffsets())) {
+ return -1
+ }
+ offset := s.LineOffsets()[line-2]
+ return offset + col
+}
+
+// OffsetRange captures the start and stop positions of a section of text in the input expression.
+type OffsetRange struct {
+ Start int32
+ Stop int32
}
// ReferenceInfo contains a CEL native representation of an identifier reference which may refer to
@@ -149,78 +436,21 @@ func (r *ReferenceInfo) Equals(other *ReferenceInfo) bool {
return true
}
-// ReferenceInfoToReferenceExpr converts a ReferenceInfo instance to a protobuf Reference suitable for serialization.
-func ReferenceInfoToReferenceExpr(info *ReferenceInfo) (*exprpb.Reference, error) {
- c, err := ValToConstant(info.Value)
- if err != nil {
- return nil, err
- }
- return &exprpb.Reference{
- Name: info.Name,
- OverloadId: info.OverloadIDs,
- Value: c,
- }, nil
+type maxIDVisitor struct {
+ maxID int64
+ *baseVisitor
}
-// ReferenceExprToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance.
-func ReferenceExprToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) {
- v, err := ConstantToVal(ref.GetValue())
- if err != nil {
- return nil, err
+// VisitExpr updates the max identifier if the incoming expression id is greater than previously observed.
+func (v *maxIDVisitor) VisitExpr(e Expr) {
+ if v.maxID < e.ID() {
+ v.maxID = e.ID()
}
- return &ReferenceInfo{
- Name: ref.GetName(),
- OverloadIDs: ref.GetOverloadId(),
- Value: v,
- }, nil
}
-// ValToConstant converts a CEL-native ref.Val to a protobuf Constant.
-//
-// Only simple scalar types are supported by this method.
-func ValToConstant(v ref.Val) (*exprpb.Constant, error) {
- if v == nil {
- return nil, nil
- }
- switch v.Type() {
- case types.BoolType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: v.Value().(bool)}}, nil
- case types.BytesType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: v.Value().([]byte)}}, nil
- case types.DoubleType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: v.Value().(float64)}}, nil
- case types.IntType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: v.Value().(int64)}}, nil
- case types.NullType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: structpb.NullValue_NULL_VALUE}}, nil
- case types.StringType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: v.Value().(string)}}, nil
- case types.UintType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: v.Value().(uint64)}}, nil
- }
- return nil, fmt.Errorf("unsupported constant kind: %v", v.Type())
-}
-
-// ConstantToVal converts a protobuf Constant to a CEL-native ref.Val.
-func ConstantToVal(c *exprpb.Constant) (ref.Val, error) {
- if c == nil {
- return nil, nil
- }
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- return types.Bool(c.GetBoolValue()), nil
- case *exprpb.Constant_BytesValue:
- return types.Bytes(c.GetBytesValue()), nil
- case *exprpb.Constant_DoubleValue:
- return types.Double(c.GetDoubleValue()), nil
- case *exprpb.Constant_Int64Value:
- return types.Int(c.GetInt64Value()), nil
- case *exprpb.Constant_NullValue:
- return types.NullValue, nil
- case *exprpb.Constant_StringValue:
- return types.String(c.GetStringValue()), nil
- case *exprpb.Constant_Uint64Value:
- return types.Uint(c.GetUint64Value()), nil
- }
- return nil, fmt.Errorf("unsupported constant kind: %v", c.GetConstantKind())
+// VisitEntryExpr updates the max identifier if the incoming entry id is greater than previously observed.
+func (v *maxIDVisitor) VisitEntryExpr(e EntryExpr) {
+ if v.maxID < e.ID() {
+ v.maxID = e.ID()
+ }
}
diff --git a/vendor/github.com/google/cel-go/common/ast/conversion.go b/vendor/github.com/google/cel-go/common/ast/conversion.go
new file mode 100644
index 00000000000..8f2c4bd1e64
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/conversion.go
@@ -0,0 +1,632 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ast
+
+import (
+ "fmt"
+
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+
+ structpb "google.golang.org/protobuf/types/known/structpb"
+
+ exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+)
+
+// ToProto converts an AST to a CheckedExpr protobouf.
+func ToProto(ast *AST) (*exprpb.CheckedExpr, error) {
+ refMap := make(map[int64]*exprpb.Reference, len(ast.ReferenceMap()))
+ for id, ref := range ast.ReferenceMap() {
+ r, err := ReferenceInfoToProto(ref)
+ if err != nil {
+ return nil, err
+ }
+ refMap[id] = r
+ }
+ typeMap := make(map[int64]*exprpb.Type, len(ast.TypeMap()))
+ for id, typ := range ast.TypeMap() {
+ t, err := types.TypeToExprType(typ)
+ if err != nil {
+ return nil, err
+ }
+ typeMap[id] = t
+ }
+ e, err := ExprToProto(ast.Expr())
+ if err != nil {
+ return nil, err
+ }
+ info, err := SourceInfoToProto(ast.SourceInfo())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.CheckedExpr{
+ Expr: e,
+ SourceInfo: info,
+ ReferenceMap: refMap,
+ TypeMap: typeMap,
+ }, nil
+}
+
+// ToAST converts a CheckedExpr protobuf to an AST instance.
+func ToAST(checked *exprpb.CheckedExpr) (*AST, error) {
+ refMap := make(map[int64]*ReferenceInfo, len(checked.GetReferenceMap()))
+ for id, ref := range checked.GetReferenceMap() {
+ r, err := ProtoToReferenceInfo(ref)
+ if err != nil {
+ return nil, err
+ }
+ refMap[id] = r
+ }
+ typeMap := make(map[int64]*types.Type, len(checked.GetTypeMap()))
+ for id, typ := range checked.GetTypeMap() {
+ t, err := types.ExprTypeToType(typ)
+ if err != nil {
+ return nil, err
+ }
+ typeMap[id] = t
+ }
+ info, err := ProtoToSourceInfo(checked.GetSourceInfo())
+ if err != nil {
+ return nil, err
+ }
+ root, err := ProtoToExpr(checked.GetExpr())
+ if err != nil {
+ return nil, err
+ }
+ ast := NewCheckedAST(NewAST(root, info), typeMap, refMap)
+ return ast, nil
+}
+
+// ProtoToExpr converts a protobuf Expr value to an ast.Expr value.
+func ProtoToExpr(e *exprpb.Expr) (Expr, error) {
+ factory := NewExprFactory()
+ return exprInternal(factory, e)
+}
+
+// ProtoToEntryExpr converts a protobuf struct/map entry to an ast.EntryExpr
+func ProtoToEntryExpr(e *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) {
+ factory := NewExprFactory()
+ switch e.GetKeyKind().(type) {
+ case *exprpb.Expr_CreateStruct_Entry_FieldKey:
+ return exprStructField(factory, e.GetId(), e)
+ case *exprpb.Expr_CreateStruct_Entry_MapKey:
+ return exprMapEntry(factory, e.GetId(), e)
+ }
+ return nil, fmt.Errorf("unsupported expr entry kind: %v", e)
+}
+
+func exprInternal(factory ExprFactory, e *exprpb.Expr) (Expr, error) {
+ id := e.GetId()
+ switch e.GetExprKind().(type) {
+ case *exprpb.Expr_CallExpr:
+ return exprCall(factory, id, e.GetCallExpr())
+ case *exprpb.Expr_ComprehensionExpr:
+ return exprComprehension(factory, id, e.GetComprehensionExpr())
+ case *exprpb.Expr_ConstExpr:
+ return exprLiteral(factory, id, e.GetConstExpr())
+ case *exprpb.Expr_IdentExpr:
+ return exprIdent(factory, id, e.GetIdentExpr())
+ case *exprpb.Expr_ListExpr:
+ return exprList(factory, id, e.GetListExpr())
+ case *exprpb.Expr_SelectExpr:
+ return exprSelect(factory, id, e.GetSelectExpr())
+ case *exprpb.Expr_StructExpr:
+ s := e.GetStructExpr()
+ if s.GetMessageName() != "" {
+ return exprStruct(factory, id, s)
+ }
+ return exprMap(factory, id, s)
+ }
+ return factory.NewUnspecifiedExpr(id), nil
+}
+
+func exprCall(factory ExprFactory, id int64, call *exprpb.Expr_Call) (Expr, error) {
+ var err error
+ args := make([]Expr, len(call.GetArgs()))
+ for i, a := range call.GetArgs() {
+ args[i], err = exprInternal(factory, a)
+ if err != nil {
+ return nil, err
+ }
+ }
+ if call.GetTarget() == nil {
+ return factory.NewCall(id, call.GetFunction(), args...), nil
+ }
+
+ target, err := exprInternal(factory, call.GetTarget())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewMemberCall(id, call.GetFunction(), target, args...), nil
+}
+
+func exprComprehension(factory ExprFactory, id int64, comp *exprpb.Expr_Comprehension) (Expr, error) {
+ iterRange, err := exprInternal(factory, comp.GetIterRange())
+ if err != nil {
+ return nil, err
+ }
+ accuInit, err := exprInternal(factory, comp.GetAccuInit())
+ if err != nil {
+ return nil, err
+ }
+ loopCond, err := exprInternal(factory, comp.GetLoopCondition())
+ if err != nil {
+ return nil, err
+ }
+ loopStep, err := exprInternal(factory, comp.GetLoopStep())
+ if err != nil {
+ return nil, err
+ }
+ result, err := exprInternal(factory, comp.GetResult())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewComprehension(id,
+ iterRange,
+ comp.GetIterVar(),
+ comp.GetAccuVar(),
+ accuInit,
+ loopCond,
+ loopStep,
+ result), nil
+}
+
+func exprLiteral(factory ExprFactory, id int64, c *exprpb.Constant) (Expr, error) {
+ val, err := ConstantToVal(c)
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewLiteral(id, val), nil
+}
+
+func exprIdent(factory ExprFactory, id int64, i *exprpb.Expr_Ident) (Expr, error) {
+ return factory.NewIdent(id, i.GetName()), nil
+}
+
+func exprList(factory ExprFactory, id int64, l *exprpb.Expr_CreateList) (Expr, error) {
+ elems := make([]Expr, len(l.GetElements()))
+ for i, e := range l.GetElements() {
+ elem, err := exprInternal(factory, e)
+ if err != nil {
+ return nil, err
+ }
+ elems[i] = elem
+ }
+ return factory.NewList(id, elems, l.GetOptionalIndices()), nil
+}
+
+func exprMap(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct) (Expr, error) {
+ entries := make([]EntryExpr, len(s.GetEntries()))
+ var err error
+ for i, entry := range s.GetEntries() {
+ entries[i], err = exprMapEntry(factory, entry.GetId(), entry)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return factory.NewMap(id, entries), nil
+}
+
+func exprMapEntry(factory ExprFactory, id int64, e *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) {
+ k, err := exprInternal(factory, e.GetMapKey())
+ if err != nil {
+ return nil, err
+ }
+ v, err := exprInternal(factory, e.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewMapEntry(id, k, v, e.GetOptionalEntry()), nil
+}
+
+func exprSelect(factory ExprFactory, id int64, s *exprpb.Expr_Select) (Expr, error) {
+ op, err := exprInternal(factory, s.GetOperand())
+ if err != nil {
+ return nil, err
+ }
+ if s.GetTestOnly() {
+ return factory.NewPresenceTest(id, op, s.GetField()), nil
+ }
+ return factory.NewSelect(id, op, s.GetField()), nil
+}
+
+func exprStruct(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct) (Expr, error) {
+ fields := make([]EntryExpr, len(s.GetEntries()))
+ var err error
+ for i, field := range s.GetEntries() {
+ fields[i], err = exprStructField(factory, field.GetId(), field)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return factory.NewStruct(id, s.GetMessageName(), fields), nil
+}
+
+func exprStructField(factory ExprFactory, id int64, f *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) {
+ v, err := exprInternal(factory, f.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewStructField(id, f.GetFieldKey(), v, f.GetOptionalEntry()), nil
+}
+
+// ExprToProto serializes an ast.Expr value to a protobuf Expr representation.
+func ExprToProto(e Expr) (*exprpb.Expr, error) {
+ if e == nil {
+ return &exprpb.Expr{}, nil
+ }
+ switch e.Kind() {
+ case CallKind:
+ return protoCall(e.ID(), e.AsCall())
+ case ComprehensionKind:
+ return protoComprehension(e.ID(), e.AsComprehension())
+ case IdentKind:
+ return protoIdent(e.ID(), e.AsIdent())
+ case ListKind:
+ return protoList(e.ID(), e.AsList())
+ case LiteralKind:
+ return protoLiteral(e.ID(), e.AsLiteral())
+ case MapKind:
+ return protoMap(e.ID(), e.AsMap())
+ case SelectKind:
+ return protoSelect(e.ID(), e.AsSelect())
+ case StructKind:
+ return protoStruct(e.ID(), e.AsStruct())
+ case UnspecifiedExprKind:
+ // Handle the case where a macro reference may be getting translated.
+ // A nested macro 'pointer' is a non-zero expression id with no kind set.
+ if e.ID() != 0 {
+ return &exprpb.Expr{Id: e.ID()}, nil
+ }
+ return &exprpb.Expr{}, nil
+ }
+ return nil, fmt.Errorf("unsupported expr kind: %v", e)
+}
+
+// EntryExprToProto converts an ast.EntryExpr to a protobuf CreateStruct entry
+func EntryExprToProto(e EntryExpr) (*exprpb.Expr_CreateStruct_Entry, error) {
+ switch e.Kind() {
+ case MapEntryKind:
+ return protoMapEntry(e.ID(), e.AsMapEntry())
+ case StructFieldKind:
+ return protoStructField(e.ID(), e.AsStructField())
+ case UnspecifiedEntryExprKind:
+ return &exprpb.Expr_CreateStruct_Entry{}, nil
+ }
+ return nil, fmt.Errorf("unsupported expr entry kind: %v", e)
+}
+
+func protoCall(id int64, call CallExpr) (*exprpb.Expr, error) {
+ var err error
+ var target *exprpb.Expr
+ if call.IsMemberFunction() {
+ target, err = ExprToProto(call.Target())
+ if err != nil {
+ return nil, err
+ }
+ }
+ callArgs := call.Args()
+ args := make([]*exprpb.Expr, len(callArgs))
+ for i, a := range callArgs {
+ args[i], err = ExprToProto(a)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_CallExpr{
+ CallExpr: &exprpb.Expr_Call{
+ Function: call.FunctionName(),
+ Target: target,
+ Args: args,
+ },
+ },
+ }, nil
+}
+
+func protoComprehension(id int64, comp ComprehensionExpr) (*exprpb.Expr, error) {
+ iterRange, err := ExprToProto(comp.IterRange())
+ if err != nil {
+ return nil, err
+ }
+ accuInit, err := ExprToProto(comp.AccuInit())
+ if err != nil {
+ return nil, err
+ }
+ loopCond, err := ExprToProto(comp.LoopCondition())
+ if err != nil {
+ return nil, err
+ }
+ loopStep, err := ExprToProto(comp.LoopStep())
+ if err != nil {
+ return nil, err
+ }
+ result, err := ExprToProto(comp.Result())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_ComprehensionExpr{
+ ComprehensionExpr: &exprpb.Expr_Comprehension{
+ IterVar: comp.IterVar(),
+ IterRange: iterRange,
+ AccuVar: comp.AccuVar(),
+ AccuInit: accuInit,
+ LoopCondition: loopCond,
+ LoopStep: loopStep,
+ Result: result,
+ },
+ },
+ }, nil
+}
+
+func protoIdent(id int64, name string) (*exprpb.Expr, error) {
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_IdentExpr{
+ IdentExpr: &exprpb.Expr_Ident{
+ Name: name,
+ },
+ },
+ }, nil
+}
+
+func protoList(id int64, list ListExpr) (*exprpb.Expr, error) {
+ var err error
+ elems := make([]*exprpb.Expr, list.Size())
+ for i, e := range list.Elements() {
+ elems[i], err = ExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_ListExpr{
+ ListExpr: &exprpb.Expr_CreateList{
+ Elements: elems,
+ OptionalIndices: list.OptionalIndices(),
+ },
+ },
+ }, nil
+}
+
+func protoLiteral(id int64, val ref.Val) (*exprpb.Expr, error) {
+ c, err := ValToConstant(val)
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_ConstExpr{
+ ConstExpr: c,
+ },
+ }, nil
+}
+
+func protoMap(id int64, m MapExpr) (*exprpb.Expr, error) {
+ entries := make([]*exprpb.Expr_CreateStruct_Entry, len(m.Entries()))
+ var err error
+ for i, e := range m.Entries() {
+ entries[i], err = EntryExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_StructExpr{
+ StructExpr: &exprpb.Expr_CreateStruct{
+ Entries: entries,
+ },
+ },
+ }, nil
+}
+
+func protoMapEntry(id int64, e MapEntry) (*exprpb.Expr_CreateStruct_Entry, error) {
+ k, err := ExprToProto(e.Key())
+ if err != nil {
+ return nil, err
+ }
+ v, err := ExprToProto(e.Value())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr_CreateStruct_Entry{
+ Id: id,
+ KeyKind: &exprpb.Expr_CreateStruct_Entry_MapKey{
+ MapKey: k,
+ },
+ Value: v,
+ OptionalEntry: e.IsOptional(),
+ }, nil
+}
+
+func protoSelect(id int64, s SelectExpr) (*exprpb.Expr, error) {
+ op, err := ExprToProto(s.Operand())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_SelectExpr{
+ SelectExpr: &exprpb.Expr_Select{
+ Operand: op,
+ Field: s.FieldName(),
+ TestOnly: s.IsTestOnly(),
+ },
+ },
+ }, nil
+}
+
+func protoStruct(id int64, s StructExpr) (*exprpb.Expr, error) {
+ entries := make([]*exprpb.Expr_CreateStruct_Entry, len(s.Fields()))
+ var err error
+ for i, e := range s.Fields() {
+ entries[i], err = EntryExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_StructExpr{
+ StructExpr: &exprpb.Expr_CreateStruct{
+ MessageName: s.TypeName(),
+ Entries: entries,
+ },
+ },
+ }, nil
+}
+
+func protoStructField(id int64, f StructField) (*exprpb.Expr_CreateStruct_Entry, error) {
+ v, err := ExprToProto(f.Value())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr_CreateStruct_Entry{
+ Id: id,
+ KeyKind: &exprpb.Expr_CreateStruct_Entry_FieldKey{
+ FieldKey: f.Name(),
+ },
+ Value: v,
+ OptionalEntry: f.IsOptional(),
+ }, nil
+}
+
+// SourceInfoToProto serializes an ast.SourceInfo value to a protobuf SourceInfo object.
+func SourceInfoToProto(info *SourceInfo) (*exprpb.SourceInfo, error) {
+ if info == nil {
+ return &exprpb.SourceInfo{}, nil
+ }
+ sourceInfo := &exprpb.SourceInfo{
+ SyntaxVersion: info.SyntaxVersion(),
+ Location: info.Description(),
+ LineOffsets: info.LineOffsets(),
+ Positions: make(map[int64]int32, len(info.OffsetRanges())),
+ MacroCalls: make(map[int64]*exprpb.Expr, len(info.MacroCalls())),
+ }
+ for id, offset := range info.OffsetRanges() {
+ sourceInfo.Positions[id] = offset.Start
+ }
+ for id, e := range info.MacroCalls() {
+ call, err := ExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ sourceInfo.MacroCalls[id] = call
+ }
+ return sourceInfo, nil
+}
+
+// ProtoToSourceInfo deserializes the protobuf into a native SourceInfo value.
+func ProtoToSourceInfo(info *exprpb.SourceInfo) (*SourceInfo, error) {
+ sourceInfo := &SourceInfo{
+ syntax: info.GetSyntaxVersion(),
+ desc: info.GetLocation(),
+ lines: info.GetLineOffsets(),
+ offsetRanges: make(map[int64]OffsetRange, len(info.GetPositions())),
+ macroCalls: make(map[int64]Expr, len(info.GetMacroCalls())),
+ }
+ for id, offset := range info.GetPositions() {
+ sourceInfo.SetOffsetRange(id, OffsetRange{Start: offset, Stop: offset})
+ }
+ for id, e := range info.GetMacroCalls() {
+ call, err := ProtoToExpr(e)
+ if err != nil {
+ return nil, err
+ }
+ sourceInfo.SetMacroCall(id, call)
+ }
+ return sourceInfo, nil
+}
+
+// ReferenceInfoToProto converts a ReferenceInfo instance to a protobuf Reference suitable for serialization.
+func ReferenceInfoToProto(info *ReferenceInfo) (*exprpb.Reference, error) {
+ c, err := ValToConstant(info.Value)
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Reference{
+ Name: info.Name,
+ OverloadId: info.OverloadIDs,
+ Value: c,
+ }, nil
+}
+
+// ProtoToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance.
+func ProtoToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) {
+ v, err := ConstantToVal(ref.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return &ReferenceInfo{
+ Name: ref.GetName(),
+ OverloadIDs: ref.GetOverloadId(),
+ Value: v,
+ }, nil
+}
+
+// ValToConstant converts a CEL-native ref.Val to a protobuf Constant.
+//
+// Only simple scalar types are supported by this method.
+func ValToConstant(v ref.Val) (*exprpb.Constant, error) {
+ if v == nil {
+ return nil, nil
+ }
+ switch v.Type() {
+ case types.BoolType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: v.Value().(bool)}}, nil
+ case types.BytesType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: v.Value().([]byte)}}, nil
+ case types.DoubleType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: v.Value().(float64)}}, nil
+ case types.IntType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: v.Value().(int64)}}, nil
+ case types.NullType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: structpb.NullValue_NULL_VALUE}}, nil
+ case types.StringType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: v.Value().(string)}}, nil
+ case types.UintType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: v.Value().(uint64)}}, nil
+ }
+ return nil, fmt.Errorf("unsupported constant kind: %v", v.Type())
+}
+
+// ConstantToVal converts a protobuf Constant to a CEL-native ref.Val.
+func ConstantToVal(c *exprpb.Constant) (ref.Val, error) {
+ if c == nil {
+ return nil, nil
+ }
+ switch c.GetConstantKind().(type) {
+ case *exprpb.Constant_BoolValue:
+ return types.Bool(c.GetBoolValue()), nil
+ case *exprpb.Constant_BytesValue:
+ return types.Bytes(c.GetBytesValue()), nil
+ case *exprpb.Constant_DoubleValue:
+ return types.Double(c.GetDoubleValue()), nil
+ case *exprpb.Constant_Int64Value:
+ return types.Int(c.GetInt64Value()), nil
+ case *exprpb.Constant_NullValue:
+ return types.NullValue, nil
+ case *exprpb.Constant_StringValue:
+ return types.String(c.GetStringValue()), nil
+ case *exprpb.Constant_Uint64Value:
+ return types.Uint(c.GetUint64Value()), nil
+ }
+ return nil, fmt.Errorf("unsupported constant kind: %v", c.GetConstantKind())
+}
diff --git a/vendor/github.com/google/cel-go/common/ast/expr.go b/vendor/github.com/google/cel-go/common/ast/expr.go
index b63884a6028..c9d88bbaab7 100644
--- a/vendor/github.com/google/cel-go/common/ast/expr.go
+++ b/vendor/github.com/google/cel-go/common/ast/expr.go
@@ -15,168 +15,61 @@
package ast
import (
- "github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// ExprKind represents the expression node kind.
type ExprKind int
const (
- // UnspecifiedKind represents an unset expression with no specified properties.
- UnspecifiedKind ExprKind = iota
+ // UnspecifiedExprKind represents an unset expression with no specified properties.
+ UnspecifiedExprKind ExprKind = iota
- // LiteralKind represents a primitive scalar literal.
- LiteralKind
+ // CallKind represents a function call.
+ CallKind
+
+ // ComprehensionKind represents a comprehension expression generated by a macro.
+ ComprehensionKind
// IdentKind represents a simple variable, constant, or type identifier.
IdentKind
- // SelectKind represents a field selection expression.
- SelectKind
-
- // CallKind represents a function call.
- CallKind
-
// ListKind represents a list literal expression.
ListKind
+ // LiteralKind represents a primitive scalar literal.
+ LiteralKind
+
// MapKind represents a map literal expression.
MapKind
+ // SelectKind represents a field selection expression.
+ SelectKind
+
// StructKind represents a struct literal expression.
StructKind
-
- // ComprehensionKind represents a comprehension expression generated by a macro.
- ComprehensionKind
)
-// NavigateCheckedAST converts a CheckedAST to a NavigableExpr
-func NavigateCheckedAST(ast *CheckedAST) NavigableExpr {
- return newNavigableExpr(nil, ast.Expr, ast.TypeMap)
-}
-
-// ExprMatcher takes a NavigableExpr in and indicates whether the value is a match.
+// Expr represents the base expression node in a CEL abstract syntax tree.
//
-// This function type should be use with the `Match` and `MatchList` calls.
-type ExprMatcher func(NavigableExpr) bool
-
-// ConstantValueMatcher returns an ExprMatcher which will return true if the input NavigableExpr
-// is comprised of all constant values, such as a simple literal or even list and map literal.
-func ConstantValueMatcher() ExprMatcher {
- return matchIsConstantValue
-}
-
-// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches
-// the specified `kind`.
-func KindMatcher(kind ExprKind) ExprMatcher {
- return func(e NavigableExpr) bool {
- return e.Kind() == kind
- }
-}
-
-// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose
-// function name is equal to `funcName`.
-func FunctionMatcher(funcName string) ExprMatcher {
- return func(e NavigableExpr) bool {
- if e.Kind() != CallKind {
- return false
- }
- return e.AsCall().FunctionName() == funcName
- }
-}
-
-// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list.
-//
-// Such a result would work well with subsequent MatchList calls.
-func AllMatcher() ExprMatcher {
- return func(NavigableExpr) bool {
- return true
- }
-}
-
-// MatchDescendants takes a NavigableExpr and ExprMatcher and produces a list of NavigableExpr values of the
-// descendants which match.
-func MatchDescendants(expr NavigableExpr, matcher ExprMatcher) []NavigableExpr {
- return matchListInternal([]NavigableExpr{expr}, matcher, true)
-}
-
-// MatchSubset applies an ExprMatcher to a list of NavigableExpr values and their descendants, producing a
-// subset of NavigableExpr values which match.
-func MatchSubset(exprs []NavigableExpr, matcher ExprMatcher) []NavigableExpr {
- visit := make([]NavigableExpr, len(exprs))
- copy(visit, exprs)
- return matchListInternal(visit, matcher, false)
-}
-
-func matchListInternal(visit []NavigableExpr, matcher ExprMatcher, visitDescendants bool) []NavigableExpr {
- var matched []NavigableExpr
- for len(visit) != 0 {
- e := visit[0]
- if matcher(e) {
- matched = append(matched, e)
- }
- if visitDescendants {
- visit = append(visit[1:], e.Children()...)
- } else {
- visit = visit[1:]
- }
- }
- return matched
-}
-
-func matchIsConstantValue(e NavigableExpr) bool {
- if e.Kind() == LiteralKind {
- return true
- }
- if e.Kind() == StructKind || e.Kind() == MapKind || e.Kind() == ListKind {
- for _, child := range e.Children() {
- if !matchIsConstantValue(child) {
- return false
- }
- }
- return true
- }
- return false
-}
-
-// NavigableExpr represents the base navigable expression value.
-//
-// Depending on the `Kind()` value, the NavigableExpr may be converted to a concrete expression types
+// Depending on the `Kind()` value, the Expr may be converted to a concrete expression types
// as indicated by the `As` methods.
-//
-// NavigableExpr values and their concrete expression types should be nil-safe. Conversion of an expr
-// to the wrong kind should produce a nil value.
-type NavigableExpr interface {
+type Expr interface {
// ID of the expression as it appears in the AST
ID() int64
// Kind of the expression node. See ExprKind for the valid enum values.
Kind() ExprKind
- // Type of the expression node.
- Type() *types.Type
-
- // Parent returns the parent expression node, if one exists.
- Parent() (NavigableExpr, bool)
-
- // Children returns a list of child expression nodes.
- Children() []NavigableExpr
-
- // ToExpr adapts this NavigableExpr to a protobuf representation.
- ToExpr() *exprpb.Expr
-
- // AsCall adapts the expr into a NavigableCallExpr
+ // AsCall adapts the expr into a CallExpr
//
// The Kind() must be equal to a CallKind for the conversion to be well-defined.
- AsCall() NavigableCallExpr
+ AsCall() CallExpr
- // AsComprehension adapts the expr into a NavigableComprehensionExpr.
+ // AsComprehension adapts the expr into a ComprehensionExpr.
//
// The Kind() must be equal to a ComprehensionKind for the conversion to be well-defined.
- AsComprehension() NavigableComprehensionExpr
+ AsComprehension() ComprehensionExpr
// AsIdent adapts the expr into an identifier string.
//
@@ -188,67 +81,123 @@ type NavigableExpr interface {
// The Kind() must be equal to a LiteralKind for the conversion to be well-defined.
AsLiteral() ref.Val
- // AsList adapts the expr into a NavigableListExpr.
+ // AsList adapts the expr into a ListExpr.
//
// The Kind() must be equal to a ListKind for the conversion to be well-defined.
- AsList() NavigableListExpr
+ AsList() ListExpr
- // AsMap adapts the expr into a NavigableMapExpr.
+ // AsMap adapts the expr into a MapExpr.
//
// The Kind() must be equal to a MapKind for the conversion to be well-defined.
- AsMap() NavigableMapExpr
+ AsMap() MapExpr
- // AsSelect adapts the expr into a NavigableSelectExpr.
+ // AsSelect adapts the expr into a SelectExpr.
//
// The Kind() must be equal to a SelectKind for the conversion to be well-defined.
- AsSelect() NavigableSelectExpr
+ AsSelect() SelectExpr
- // AsStruct adapts the expr into a NavigableStructExpr.
+ // AsStruct adapts the expr into a StructExpr.
//
// The Kind() must be equal to a StructKind for the conversion to be well-defined.
- AsStruct() NavigableStructExpr
+ AsStruct() StructExpr
- // marker interface method
- isNavigable()
+ // RenumberIDs performs an in-place update of the expression and all of its descendents numeric ids.
+ RenumberIDs(IDGenerator)
+
+ // SetKindCase replaces the contents of the current expression with the contents of the other.
+ //
+ // The SetKindCase takes ownership of any expression instances references within the input Expr.
+ // A shallow copy is made of the Expr value itself, but not a deep one.
+ //
+ // This method should only be used during AST rewrites using temporary Expr values.
+ SetKindCase(Expr)
+
+ // isExpr is a marker interface.
+ isExpr()
}
-// NavigableCallExpr defines an interface for inspecting a function call and its arugments.
-type NavigableCallExpr interface {
+// EntryExprKind represents the possible EntryExpr kinds.
+type EntryExprKind int
+
+const (
+ // UnspecifiedEntryExprKind indicates that the entry expr is not set.
+ UnspecifiedEntryExprKind EntryExprKind = iota
+
+ // MapEntryKind indicates that the entry is a MapEntry type with key and value expressions.
+ MapEntryKind
+
+ // StructFieldKind indicates that the entry is a StructField with a field name and initializer
+ // expression.
+ StructFieldKind
+)
+
+// EntryExpr represents the base entry expression in a CEL map or struct literal.
+type EntryExpr interface {
+ // ID of the entry as it appears in the AST.
+ ID() int64
+
+ // Kind of the entry expression node. See EntryExprKind for valid enum values.
+ Kind() EntryExprKind
+
+ // AsMapEntry casts the EntryExpr to a MapEntry.
+ //
+ // The Kind() must be equal to MapEntryKind for the conversion to be well-defined.
+ AsMapEntry() MapEntry
+
+ // AsStructField casts the EntryExpr to a StructField
+ //
+ // The Kind() must be equal to StructFieldKind for the conversion to be well-defined.
+ AsStructField() StructField
+
+ // RenumberIDs performs an in-place update of the expression and all of its descendents numeric ids.
+ RenumberIDs(IDGenerator)
+
+ isEntryExpr()
+}
+
+// IDGenerator produces unique ids suitable for tagging expression nodes
+type IDGenerator func(originalID int64) int64
+
+// CallExpr defines an interface for inspecting a function call and its arugments.
+type CallExpr interface {
// FunctionName returns the name of the function.
FunctionName() string
+ // IsMemberFunction returns whether the call has a non-nil target indicating it is a member function
+ IsMemberFunction() bool
+
// Target returns the target of the expression if one is present.
- Target() NavigableExpr
+ Target() Expr
// Args returns the list of call arguments, excluding the target.
- Args() []NavigableExpr
-
- // ReturnType returns the result type of the call.
- ReturnType() *types.Type
+ Args() []Expr
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableListExpr defines an interface for inspecting a list literal expression.
-type NavigableListExpr interface {
+// ListExpr defines an interface for inspecting a list literal expression.
+type ListExpr interface {
// Elements returns the list elements as navigable expressions.
- Elements() []NavigableExpr
+ Elements() []Expr
// OptionalIndicies returns the list of optional indices in the list literal.
OptionalIndices() []int32
+ // IsOptional indicates whether the given element index is optional.
+ IsOptional(int32) bool
+
// Size returns the number of elements in the list.
Size() int
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableSelectExpr defines an interface for inspecting a select expression.
-type NavigableSelectExpr interface {
+// SelectExpr defines an interface for inspecting a select expression.
+type SelectExpr interface {
// Operand returns the selection operand expression.
- Operand() NavigableExpr
+ Operand() Expr
// FieldName returns the field name being selected from the operand.
FieldName() string
@@ -257,67 +206,67 @@ type NavigableSelectExpr interface {
IsTestOnly() bool
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableMapExpr defines an interface for inspecting a map expression.
-type NavigableMapExpr interface {
- // Entries returns the map key value pairs as NavigableEntry values.
- Entries() []NavigableEntry
+// MapExpr defines an interface for inspecting a map expression.
+type MapExpr interface {
+ // Entries returns the map key value pairs as EntryExpr values.
+ Entries() []EntryExpr
// Size returns the number of entries in the map.
Size() int
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableEntry defines an interface for inspecting a map entry.
-type NavigableEntry interface {
+// MapEntry defines an interface for inspecting a map entry.
+type MapEntry interface {
// Key returns the map entry key expression.
- Key() NavigableExpr
+ Key() Expr
// Value returns the map entry value expression.
- Value() NavigableExpr
+ Value() Expr
// IsOptional returns whether the entry is optional.
IsOptional() bool
// marker interface method
- isNavigable()
+ isEntryExpr()
}
-// NavigableStructExpr defines an interfaces for inspecting a struct and its field initializers.
-type NavigableStructExpr interface {
+// StructExpr defines an interfaces for inspecting a struct and its field initializers.
+type StructExpr interface {
// TypeName returns the struct type name.
TypeName() string
- // Fields returns the set of field initializers in the struct expression as NavigableField values.
- Fields() []NavigableField
+ // Fields returns the set of field initializers in the struct expression as EntryExpr values.
+ Fields() []EntryExpr
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableField defines an interface for inspecting a struct field initialization.
-type NavigableField interface {
- // FieldName returns the name of the field.
- FieldName() string
+// StructField defines an interface for inspecting a struct field initialization.
+type StructField interface {
+ // Name returns the name of the field.
+ Name() string
// Value returns the field initialization expression.
- Value() NavigableExpr
+ Value() Expr
// IsOptional returns whether the field is optional.
IsOptional() bool
// marker interface method
- isNavigable()
+ isEntryExpr()
}
-// NavigableComprehensionExpr defines an interface for inspecting a comprehension expression.
-type NavigableComprehensionExpr interface {
+// ComprehensionExpr defines an interface for inspecting a comprehension expression.
+type ComprehensionExpr interface {
// IterRange returns the iteration range expression.
- IterRange() NavigableExpr
+ IterRange() Expr
// IterVar returns the iteration variable name.
IterVar() string
@@ -326,384 +275,586 @@ type NavigableComprehensionExpr interface {
AccuVar() string
// AccuInit returns the accumulation variable initialization expression.
- AccuInit() NavigableExpr
+ AccuInit() Expr
// LoopCondition returns the loop condition expression.
- LoopCondition() NavigableExpr
+ LoopCondition() Expr
// LoopStep returns the loop step expression.
- LoopStep() NavigableExpr
+ LoopStep() Expr
// Result returns the comprehension result expression.
- Result() NavigableExpr
+ Result() Expr
// marker interface method
- isNavigable()
+ isExpr()
}
-func newNavigableExpr(parent NavigableExpr, expr *exprpb.Expr, typeMap map[int64]*types.Type) NavigableExpr {
- kind, factory := kindOf(expr)
- nav := &navigableExprImpl{
- parent: parent,
- kind: kind,
- expr: expr,
- typeMap: typeMap,
- createChildren: factory,
+var _ Expr = &expr{}
+
+type expr struct {
+ id int64
+ exprKindCase
+}
+
+type exprKindCase interface {
+ Kind() ExprKind
+
+ renumberIDs(IDGenerator)
+
+ isExpr()
+}
+
+func (e *expr) ID() int64 {
+ if e == nil {
+ return 0
}
- return nav
+ return e.id
}
-type navigableExprImpl struct {
- parent NavigableExpr
- kind ExprKind
- expr *exprpb.Expr
- typeMap map[int64]*types.Type
- createChildren childFactory
+func (e *expr) Kind() ExprKind {
+ if e == nil || e.exprKindCase == nil {
+ return UnspecifiedExprKind
+ }
+ return e.exprKindCase.Kind()
}
-func (nav *navigableExprImpl) ID() int64 {
- return nav.ToExpr().GetId()
+func (e *expr) AsCall() CallExpr {
+ if e.Kind() != CallKind {
+ return nilCall
+ }
+ return e.exprKindCase.(CallExpr)
}
-func (nav *navigableExprImpl) Kind() ExprKind {
- return nav.kind
+func (e *expr) AsComprehension() ComprehensionExpr {
+ if e.Kind() != ComprehensionKind {
+ return nilCompre
+ }
+ return e.exprKindCase.(ComprehensionExpr)
}
-func (nav *navigableExprImpl) Type() *types.Type {
- if t, found := nav.typeMap[nav.ID()]; found {
- return t
+func (e *expr) AsIdent() string {
+ if e.Kind() != IdentKind {
+ return ""
}
- return types.DynType
+ return string(e.exprKindCase.(baseIdentExpr))
}
-func (nav *navigableExprImpl) Parent() (NavigableExpr, bool) {
- if nav.parent != nil {
- return nav.parent, true
+func (e *expr) AsLiteral() ref.Val {
+ if e.Kind() != LiteralKind {
+ return nil
}
- return nil, false
+ return e.exprKindCase.(*baseLiteral).Val
}
-func (nav *navigableExprImpl) Children() []NavigableExpr {
- return nav.createChildren(nav)
+func (e *expr) AsList() ListExpr {
+ if e.Kind() != ListKind {
+ return nilList
+ }
+ return e.exprKindCase.(ListExpr)
}
-func (nav *navigableExprImpl) ToExpr() *exprpb.Expr {
- return nav.expr
+func (e *expr) AsMap() MapExpr {
+ if e.Kind() != MapKind {
+ return nilMap
+ }
+ return e.exprKindCase.(MapExpr)
}
-func (nav *navigableExprImpl) AsCall() NavigableCallExpr {
- return navigableCallImpl{navigableExprImpl: nav}
+func (e *expr) AsSelect() SelectExpr {
+ if e.Kind() != SelectKind {
+ return nilSel
+ }
+ return e.exprKindCase.(SelectExpr)
}
-func (nav *navigableExprImpl) AsComprehension() NavigableComprehensionExpr {
- return navigableComprehensionImpl{navigableExprImpl: nav}
+func (e *expr) AsStruct() StructExpr {
+ if e.Kind() != StructKind {
+ return nilStruct
+ }
+ return e.exprKindCase.(StructExpr)
}
-func (nav *navigableExprImpl) AsIdent() string {
- return nav.ToExpr().GetIdentExpr().GetName()
+func (e *expr) SetKindCase(other Expr) {
+ if e == nil {
+ return
+ }
+ if other == nil {
+ e.exprKindCase = nil
+ return
+ }
+ switch other.Kind() {
+ case CallKind:
+ c := other.AsCall()
+ e.exprKindCase = &baseCallExpr{
+ function: c.FunctionName(),
+ target: c.Target(),
+ args: c.Args(),
+ isMember: c.IsMemberFunction(),
+ }
+ case ComprehensionKind:
+ c := other.AsComprehension()
+ e.exprKindCase = &baseComprehensionExpr{
+ iterRange: c.IterRange(),
+ iterVar: c.IterVar(),
+ accuVar: c.AccuVar(),
+ accuInit: c.AccuInit(),
+ loopCond: c.LoopCondition(),
+ loopStep: c.LoopStep(),
+ result: c.Result(),
+ }
+ case IdentKind:
+ e.exprKindCase = baseIdentExpr(other.AsIdent())
+ case ListKind:
+ l := other.AsList()
+ optIndexMap := make(map[int32]struct{}, len(l.OptionalIndices()))
+ for _, idx := range l.OptionalIndices() {
+ optIndexMap[idx] = struct{}{}
+ }
+ e.exprKindCase = &baseListExpr{
+ elements: l.Elements(),
+ optIndices: l.OptionalIndices(),
+ optIndexMap: optIndexMap,
+ }
+ case LiteralKind:
+ e.exprKindCase = &baseLiteral{Val: other.AsLiteral()}
+ case MapKind:
+ e.exprKindCase = &baseMapExpr{
+ entries: other.AsMap().Entries(),
+ }
+ case SelectKind:
+ s := other.AsSelect()
+ e.exprKindCase = &baseSelectExpr{
+ operand: s.Operand(),
+ field: s.FieldName(),
+ testOnly: s.IsTestOnly(),
+ }
+ case StructKind:
+ s := other.AsStruct()
+ e.exprKindCase = &baseStructExpr{
+ typeName: s.TypeName(),
+ fields: s.Fields(),
+ }
+ case UnspecifiedExprKind:
+ e.exprKindCase = nil
+ }
}
-func (nav *navigableExprImpl) AsLiteral() ref.Val {
- if nav.Kind() != LiteralKind {
- return nil
+func (e *expr) RenumberIDs(idGen IDGenerator) {
+ if e == nil {
+ return
}
- val, err := ConstantToVal(nav.ToExpr().GetConstExpr())
- if err != nil {
- panic(err)
+ e.id = idGen(e.id)
+ if e.exprKindCase != nil {
+ e.exprKindCase.renumberIDs(idGen)
}
- return val
}
-func (nav *navigableExprImpl) AsList() NavigableListExpr {
- return navigableListImpl{navigableExprImpl: nav}
+type baseCallExpr struct {
+ function string
+ target Expr
+ args []Expr
+ isMember bool
}
-func (nav *navigableExprImpl) AsMap() NavigableMapExpr {
- return navigableMapImpl{navigableExprImpl: nav}
+func (*baseCallExpr) Kind() ExprKind {
+ return CallKind
}
-func (nav *navigableExprImpl) AsSelect() NavigableSelectExpr {
- return navigableSelectImpl{navigableExprImpl: nav}
+func (e *baseCallExpr) FunctionName() string {
+ if e == nil {
+ return ""
+ }
+ return e.function
}
-func (nav *navigableExprImpl) AsStruct() NavigableStructExpr {
- return navigableStructImpl{navigableExprImpl: nav}
+func (e *baseCallExpr) IsMemberFunction() bool {
+ if e == nil {
+ return false
+ }
+ return e.isMember
}
-func (nav *navigableExprImpl) createChild(e *exprpb.Expr) NavigableExpr {
- return newNavigableExpr(nav, e, nav.typeMap)
+func (e *baseCallExpr) Target() Expr {
+ if e == nil || !e.IsMemberFunction() {
+ return nilExpr
+ }
+ return e.target
}
-func (nav *navigableExprImpl) isNavigable() {}
+func (e *baseCallExpr) Args() []Expr {
+ if e == nil {
+ return []Expr{}
+ }
+ return e.args
+}
-type navigableCallImpl struct {
- *navigableExprImpl
+func (e *baseCallExpr) renumberIDs(idGen IDGenerator) {
+ if e.IsMemberFunction() {
+ e.Target().RenumberIDs(idGen)
+ }
+ for _, arg := range e.Args() {
+ arg.RenumberIDs(idGen)
+ }
}
-func (call navigableCallImpl) FunctionName() string {
- return call.ToExpr().GetCallExpr().GetFunction()
+func (*baseCallExpr) isExpr() {}
+
+var _ ComprehensionExpr = &baseComprehensionExpr{}
+
+type baseComprehensionExpr struct {
+ iterRange Expr
+ iterVar string
+ accuVar string
+ accuInit Expr
+ loopCond Expr
+ loopStep Expr
+ result Expr
}
-func (call navigableCallImpl) Target() NavigableExpr {
- t := call.ToExpr().GetCallExpr().GetTarget()
- if t != nil {
- return call.createChild(t)
- }
- return nil
+func (*baseComprehensionExpr) Kind() ExprKind {
+ return ComprehensionKind
}
-func (call navigableCallImpl) Args() []NavigableExpr {
- args := call.ToExpr().GetCallExpr().GetArgs()
- navArgs := make([]NavigableExpr, len(args))
- for i, a := range args {
- navArgs[i] = call.createChild(a)
+func (e *baseComprehensionExpr) IterRange() Expr {
+ if e == nil {
+ return nilExpr
}
- return navArgs
+ return e.iterRange
}
-func (call navigableCallImpl) ReturnType() *types.Type {
- return call.Type()
+func (e *baseComprehensionExpr) IterVar() string {
+ return e.iterVar
}
-type navigableComprehensionImpl struct {
- *navigableExprImpl
+func (e *baseComprehensionExpr) AccuVar() string {
+ return e.accuVar
}
-func (comp navigableComprehensionImpl) IterRange() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetIterRange())
+func (e *baseComprehensionExpr) AccuInit() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.accuInit
}
-func (comp navigableComprehensionImpl) IterVar() string {
- return comp.ToExpr().GetComprehensionExpr().GetIterVar()
+func (e *baseComprehensionExpr) LoopCondition() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.loopCond
}
-func (comp navigableComprehensionImpl) AccuVar() string {
- return comp.ToExpr().GetComprehensionExpr().GetAccuVar()
+func (e *baseComprehensionExpr) LoopStep() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.loopStep
}
-func (comp navigableComprehensionImpl) AccuInit() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetAccuInit())
+func (e *baseComprehensionExpr) Result() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.result
}
-func (comp navigableComprehensionImpl) LoopCondition() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopCondition())
+func (e *baseComprehensionExpr) renumberIDs(idGen IDGenerator) {
+ e.IterRange().RenumberIDs(idGen)
+ e.AccuInit().RenumberIDs(idGen)
+ e.LoopCondition().RenumberIDs(idGen)
+ e.LoopStep().RenumberIDs(idGen)
+ e.Result().RenumberIDs(idGen)
}
-func (comp navigableComprehensionImpl) LoopStep() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopStep())
+func (*baseComprehensionExpr) isExpr() {}
+
+var _ exprKindCase = baseIdentExpr("")
+
+type baseIdentExpr string
+
+func (baseIdentExpr) Kind() ExprKind {
+ return IdentKind
}
-func (comp navigableComprehensionImpl) Result() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetResult())
+func (e baseIdentExpr) renumberIDs(IDGenerator) {}
+
+func (baseIdentExpr) isExpr() {}
+
+var _ exprKindCase = &baseLiteral{}
+var _ ref.Val = &baseLiteral{}
+
+type baseLiteral struct {
+ ref.Val
}
-type navigableListImpl struct {
- *navigableExprImpl
+func (*baseLiteral) Kind() ExprKind {
+ return LiteralKind
}
-func (l navigableListImpl) Elements() []NavigableExpr {
- return l.Children()
+func (l *baseLiteral) renumberIDs(IDGenerator) {}
+
+func (*baseLiteral) isExpr() {}
+
+var _ ListExpr = &baseListExpr{}
+
+type baseListExpr struct {
+ elements []Expr
+ optIndices []int32
+ optIndexMap map[int32]struct{}
}
-func (l navigableListImpl) OptionalIndices() []int32 {
- return l.ToExpr().GetListExpr().GetOptionalIndices()
+func (*baseListExpr) Kind() ExprKind {
+ return ListKind
}
-func (l navigableListImpl) Size() int {
- return len(l.ToExpr().GetListExpr().GetElements())
+func (e *baseListExpr) Elements() []Expr {
+ if e == nil {
+ return []Expr{}
+ }
+ return e.elements
}
-type navigableMapImpl struct {
- *navigableExprImpl
+func (e *baseListExpr) IsOptional(index int32) bool {
+ _, found := e.optIndexMap[index]
+ return found
}
-func (m navigableMapImpl) Entries() []NavigableEntry {
- mapExpr := m.ToExpr().GetStructExpr()
- entries := make([]NavigableEntry, len(mapExpr.GetEntries()))
- for i, e := range mapExpr.GetEntries() {
- entries[i] = navigableEntryImpl{
- key: m.createChild(e.GetMapKey()),
- val: m.createChild(e.GetValue()),
- isOpt: e.GetOptionalEntry(),
- }
+func (e *baseListExpr) OptionalIndices() []int32 {
+ if e == nil {
+ return []int32{}
}
- return entries
+ return e.optIndices
}
-func (m navigableMapImpl) Size() int {
- return len(m.ToExpr().GetStructExpr().GetEntries())
+func (e *baseListExpr) Size() int {
+ return len(e.Elements())
}
-type navigableEntryImpl struct {
- key NavigableExpr
- val NavigableExpr
- isOpt bool
+func (e *baseListExpr) renumberIDs(idGen IDGenerator) {
+ for _, elem := range e.Elements() {
+ elem.RenumberIDs(idGen)
+ }
}
-func (e navigableEntryImpl) Key() NavigableExpr {
- return e.key
-}
+func (*baseListExpr) isExpr() {}
-func (e navigableEntryImpl) Value() NavigableExpr {
- return e.val
+type baseMapExpr struct {
+ entries []EntryExpr
}
-func (e navigableEntryImpl) IsOptional() bool {
- return e.isOpt
+func (*baseMapExpr) Kind() ExprKind {
+ return MapKind
}
-func (e navigableEntryImpl) isNavigable() {}
+func (e *baseMapExpr) Entries() []EntryExpr {
+ if e == nil {
+ return []EntryExpr{}
+ }
+ return e.entries
+}
-type navigableSelectImpl struct {
- *navigableExprImpl
+func (e *baseMapExpr) Size() int {
+ return len(e.Entries())
}
-func (sel navigableSelectImpl) FieldName() string {
- return sel.ToExpr().GetSelectExpr().GetField()
+func (e *baseMapExpr) renumberIDs(idGen IDGenerator) {
+ for _, entry := range e.Entries() {
+ entry.RenumberIDs(idGen)
+ }
}
-func (sel navigableSelectImpl) IsTestOnly() bool {
- return sel.ToExpr().GetSelectExpr().GetTestOnly()
+func (*baseMapExpr) isExpr() {}
+
+type baseSelectExpr struct {
+ operand Expr
+ field string
+ testOnly bool
}
-func (sel navigableSelectImpl) Operand() NavigableExpr {
- return sel.createChild(sel.ToExpr().GetSelectExpr().GetOperand())
+func (*baseSelectExpr) Kind() ExprKind {
+ return SelectKind
}
-type navigableStructImpl struct {
- *navigableExprImpl
+func (e *baseSelectExpr) Operand() Expr {
+ if e == nil || e.operand == nil {
+ return nilExpr
+ }
+ return e.operand
}
-func (s navigableStructImpl) TypeName() string {
- return s.ToExpr().GetStructExpr().GetMessageName()
+func (e *baseSelectExpr) FieldName() string {
+ if e == nil {
+ return ""
+ }
+ return e.field
}
-func (s navigableStructImpl) Fields() []NavigableField {
- fieldInits := s.ToExpr().GetStructExpr().GetEntries()
- fields := make([]NavigableField, len(fieldInits))
- for i, f := range fieldInits {
- fields[i] = navigableFieldImpl{
- name: f.GetFieldKey(),
- val: s.createChild(f.GetValue()),
- isOpt: f.GetOptionalEntry(),
- }
+func (e *baseSelectExpr) IsTestOnly() bool {
+ if e == nil {
+ return false
}
- return fields
+ return e.testOnly
}
-type navigableFieldImpl struct {
- name string
- val NavigableExpr
- isOpt bool
+func (e *baseSelectExpr) renumberIDs(idGen IDGenerator) {
+ e.Operand().RenumberIDs(idGen)
}
-func (f navigableFieldImpl) FieldName() string {
- return f.name
+func (*baseSelectExpr) isExpr() {}
+
+type baseStructExpr struct {
+ typeName string
+ fields []EntryExpr
}
-func (f navigableFieldImpl) Value() NavigableExpr {
- return f.val
+func (*baseStructExpr) Kind() ExprKind {
+ return StructKind
}
-func (f navigableFieldImpl) IsOptional() bool {
- return f.isOpt
+func (e *baseStructExpr) TypeName() string {
+ if e == nil {
+ return ""
+ }
+ return e.typeName
}
-func (f navigableFieldImpl) isNavigable() {}
+func (e *baseStructExpr) Fields() []EntryExpr {
+ if e == nil {
+ return []EntryExpr{}
+ }
+ return e.fields
+}
-func kindOf(expr *exprpb.Expr) (ExprKind, childFactory) {
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- return LiteralKind, noopFactory
- case *exprpb.Expr_IdentExpr:
- return IdentKind, noopFactory
- case *exprpb.Expr_SelectExpr:
- return SelectKind, selectFactory
- case *exprpb.Expr_CallExpr:
- return CallKind, callArgFactory
- case *exprpb.Expr_ListExpr:
- return ListKind, listElemFactory
- case *exprpb.Expr_StructExpr:
- if expr.GetStructExpr().GetMessageName() != "" {
- return StructKind, structEntryFactory
- }
- return MapKind, mapEntryFactory
- case *exprpb.Expr_ComprehensionExpr:
- return ComprehensionKind, comprehensionFactory
- default:
- return UnspecifiedKind, noopFactory
+func (e *baseStructExpr) renumberIDs(idGen IDGenerator) {
+ for _, f := range e.Fields() {
+ f.RenumberIDs(idGen)
}
}
-type childFactory func(*navigableExprImpl) []NavigableExpr
+func (*baseStructExpr) isExpr() {}
+
+type entryExprKindCase interface {
+ Kind() EntryExprKind
+
+ renumberIDs(IDGenerator)
+
+ isEntryExpr()
+}
+
+var _ EntryExpr = &entryExpr{}
+
+type entryExpr struct {
+ id int64
+ entryExprKindCase
+}
-func noopFactory(*navigableExprImpl) []NavigableExpr {
- return nil
+func (e *entryExpr) ID() int64 {
+ return e.id
}
-func selectFactory(nav *navigableExprImpl) []NavigableExpr {
- return []NavigableExpr{
- nav.createChild(nav.ToExpr().GetSelectExpr().GetOperand()),
+func (e *entryExpr) AsMapEntry() MapEntry {
+ if e.Kind() != MapEntryKind {
+ return nilMapEntry
}
+ return e.entryExprKindCase.(MapEntry)
}
-func callArgFactory(nav *navigableExprImpl) []NavigableExpr {
- call := nav.ToExpr().GetCallExpr()
- argCount := len(call.GetArgs())
- if call.GetTarget() != nil {
- argCount++
+func (e *entryExpr) AsStructField() StructField {
+ if e.Kind() != StructFieldKind {
+ return nilStructField
}
- navExprs := make([]NavigableExpr, argCount)
- i := 0
- if call.GetTarget() != nil {
- navExprs[i] = nav.createChild(call.GetTarget())
- i++
+ return e.entryExprKindCase.(StructField)
+}
+
+func (e *entryExpr) RenumberIDs(idGen IDGenerator) {
+ e.id = idGen(e.id)
+ e.entryExprKindCase.renumberIDs(idGen)
+}
+
+type baseMapEntry struct {
+ key Expr
+ value Expr
+ isOptional bool
+}
+
+func (e *baseMapEntry) Kind() EntryExprKind {
+ return MapEntryKind
+}
+
+func (e *baseMapEntry) Key() Expr {
+ if e == nil {
+ return nilExpr
}
- for _, arg := range call.GetArgs() {
- navExprs[i] = nav.createChild(arg)
- i++
+ return e.key
+}
+
+func (e *baseMapEntry) Value() Expr {
+ if e == nil {
+ return nilExpr
}
- return navExprs
+ return e.value
}
-func listElemFactory(nav *navigableExprImpl) []NavigableExpr {
- l := nav.ToExpr().GetListExpr()
- navExprs := make([]NavigableExpr, len(l.GetElements()))
- for i, e := range l.GetElements() {
- navExprs[i] = nav.createChild(e)
+func (e *baseMapEntry) IsOptional() bool {
+ if e == nil {
+ return false
}
- return navExprs
+ return e.isOptional
}
-func structEntryFactory(nav *navigableExprImpl) []NavigableExpr {
- s := nav.ToExpr().GetStructExpr()
- entries := make([]NavigableExpr, len(s.GetEntries()))
- for i, e := range s.GetEntries() {
+func (e *baseMapEntry) renumberIDs(idGen IDGenerator) {
+ e.Key().RenumberIDs(idGen)
+ e.Value().RenumberIDs(idGen)
+}
+
+func (*baseMapEntry) isEntryExpr() {}
+
+type baseStructField struct {
+ field string
+ value Expr
+ isOptional bool
+}
+
+func (f *baseStructField) Kind() EntryExprKind {
+ return StructFieldKind
+}
- entries[i] = nav.createChild(e.GetValue())
+func (f *baseStructField) Name() string {
+ if f == nil {
+ return ""
}
- return entries
+ return f.field
}
-func mapEntryFactory(nav *navigableExprImpl) []NavigableExpr {
- s := nav.ToExpr().GetStructExpr()
- entries := make([]NavigableExpr, len(s.GetEntries())*2)
- j := 0
- for _, e := range s.GetEntries() {
- entries[j] = nav.createChild(e.GetMapKey())
- entries[j+1] = nav.createChild(e.GetValue())
- j += 2
+func (f *baseStructField) Value() Expr {
+ if f == nil {
+ return nilExpr
}
- return entries
+ return f.value
}
-func comprehensionFactory(nav *navigableExprImpl) []NavigableExpr {
- compre := nav.ToExpr().GetComprehensionExpr()
- return []NavigableExpr{
- nav.createChild(compre.GetIterRange()),
- nav.createChild(compre.GetAccuInit()),
- nav.createChild(compre.GetLoopCondition()),
- nav.createChild(compre.GetLoopStep()),
- nav.createChild(compre.GetResult()),
+func (f *baseStructField) IsOptional() bool {
+ if f == nil {
+ return false
}
+ return f.isOptional
}
+
+func (f *baseStructField) renumberIDs(idGen IDGenerator) {
+ f.Value().RenumberIDs(idGen)
+}
+
+func (*baseStructField) isEntryExpr() {}
+
+var (
+ nilExpr *expr = nil
+ nilCall *baseCallExpr = nil
+ nilCompre *baseComprehensionExpr = nil
+ nilList *baseListExpr = nil
+ nilMap *baseMapExpr = nil
+ nilMapEntry *baseMapEntry = nil
+ nilSel *baseSelectExpr = nil
+ nilStruct *baseStructExpr = nil
+ nilStructField *baseStructField = nil
+)
diff --git a/vendor/github.com/google/cel-go/common/ast/factory.go b/vendor/github.com/google/cel-go/common/ast/factory.go
new file mode 100644
index 00000000000..b7f36e72a49
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/factory.go
@@ -0,0 +1,303 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ast
+
+import "github.com/google/cel-go/common/types/ref"
+
+// ExprFactory interfaces defines a set of methods necessary for building native expression values.
+type ExprFactory interface {
+ // CopyExpr creates a deep copy of the input Expr value.
+ CopyExpr(Expr) Expr
+
+ // CopyEntryExpr creates a deep copy of the input EntryExpr value.
+ CopyEntryExpr(EntryExpr) EntryExpr
+
+ // NewCall creates an Expr value representing a global function call.
+ NewCall(id int64, function string, args ...Expr) Expr
+
+ // NewComprehension creates an Expr value representing a comprehension over a value range.
+ NewComprehension(id int64, iterRange Expr, iterVar, accuVar string, accuInit, loopCondition, loopStep, result Expr) Expr
+
+ // NewMemberCall creates an Expr value representing a member function call.
+ NewMemberCall(id int64, function string, receiver Expr, args ...Expr) Expr
+
+ // NewIdent creates an Expr value representing an identifier.
+ NewIdent(id int64, name string) Expr
+
+ // NewAccuIdent creates an Expr value representing an accumulator identifier within a
+ //comprehension.
+ NewAccuIdent(id int64) Expr
+
+ // NewLiteral creates an Expr value representing a literal value, such as a string or integer.
+ NewLiteral(id int64, value ref.Val) Expr
+
+ // NewList creates an Expr value representing a list literal expression with optional indices.
+ //
+ // Optional indicies will typically be empty unless the CEL optional types are enabled.
+ NewList(id int64, elems []Expr, optIndices []int32) Expr
+
+ // NewMap creates an Expr value representing a map literal expression
+ NewMap(id int64, entries []EntryExpr) Expr
+
+ // NewMapEntry creates a MapEntry with a given key, value, and a flag indicating whether
+ // the key is optionally set.
+ NewMapEntry(id int64, key, value Expr, isOptional bool) EntryExpr
+
+ // NewPresenceTest creates an Expr representing a field presence test on an operand expression.
+ NewPresenceTest(id int64, operand Expr, field string) Expr
+
+ // NewSelect creates an Expr representing a field selection on an operand expression.
+ NewSelect(id int64, operand Expr, field string) Expr
+
+ // NewStruct creates an Expr value representing a struct literal with a given type name and a
+ // set of field initializers.
+ NewStruct(id int64, typeName string, fields []EntryExpr) Expr
+
+ // NewStructField creates a StructField with a given field name, value, and a flag indicating
+ // whether the field is optionally set.
+ NewStructField(id int64, field string, value Expr, isOptional bool) EntryExpr
+
+ // NewUnspecifiedExpr creates an empty expression node.
+ NewUnspecifiedExpr(id int64) Expr
+
+ isExprFactory()
+}
+
+type baseExprFactory struct{}
+
+// NewExprFactory creates an ExprFactory instance.
+func NewExprFactory() ExprFactory {
+ return &baseExprFactory{}
+}
+
+func (fac *baseExprFactory) NewCall(id int64, function string, args ...Expr) Expr {
+ if len(args) == 0 {
+ args = []Expr{}
+ }
+ return fac.newExpr(
+ id,
+ &baseCallExpr{
+ function: function,
+ target: nilExpr,
+ args: args,
+ isMember: false,
+ })
+}
+
+func (fac *baseExprFactory) NewMemberCall(id int64, function string, target Expr, args ...Expr) Expr {
+ if len(args) == 0 {
+ args = []Expr{}
+ }
+ return fac.newExpr(
+ id,
+ &baseCallExpr{
+ function: function,
+ target: target,
+ args: args,
+ isMember: true,
+ })
+}
+
+func (fac *baseExprFactory) NewComprehension(id int64, iterRange Expr, iterVar, accuVar string, accuInit, loopCond, loopStep, result Expr) Expr {
+ return fac.newExpr(
+ id,
+ &baseComprehensionExpr{
+ iterRange: iterRange,
+ iterVar: iterVar,
+ accuVar: accuVar,
+ accuInit: accuInit,
+ loopCond: loopCond,
+ loopStep: loopStep,
+ result: result,
+ })
+}
+
+func (fac *baseExprFactory) NewIdent(id int64, name string) Expr {
+ return fac.newExpr(id, baseIdentExpr(name))
+}
+
+func (fac *baseExprFactory) NewAccuIdent(id int64) Expr {
+ return fac.NewIdent(id, "__result__")
+}
+
+func (fac *baseExprFactory) NewLiteral(id int64, value ref.Val) Expr {
+ return fac.newExpr(id, &baseLiteral{Val: value})
+}
+
+func (fac *baseExprFactory) NewList(id int64, elems []Expr, optIndices []int32) Expr {
+ optIndexMap := make(map[int32]struct{}, len(optIndices))
+ for _, idx := range optIndices {
+ optIndexMap[idx] = struct{}{}
+ }
+ return fac.newExpr(id,
+ &baseListExpr{
+ elements: elems,
+ optIndices: optIndices,
+ optIndexMap: optIndexMap,
+ })
+}
+
+func (fac *baseExprFactory) NewMap(id int64, entries []EntryExpr) Expr {
+ return fac.newExpr(id, &baseMapExpr{entries: entries})
+}
+
+func (fac *baseExprFactory) NewMapEntry(id int64, key, value Expr, isOptional bool) EntryExpr {
+ return fac.newEntryExpr(
+ id,
+ &baseMapEntry{
+ key: key,
+ value: value,
+ isOptional: isOptional,
+ })
+}
+
+func (fac *baseExprFactory) NewPresenceTest(id int64, operand Expr, field string) Expr {
+ return fac.newExpr(
+ id,
+ &baseSelectExpr{
+ operand: operand,
+ field: field,
+ testOnly: true,
+ })
+}
+
+func (fac *baseExprFactory) NewSelect(id int64, operand Expr, field string) Expr {
+ return fac.newExpr(
+ id,
+ &baseSelectExpr{
+ operand: operand,
+ field: field,
+ })
+}
+
+func (fac *baseExprFactory) NewStruct(id int64, typeName string, fields []EntryExpr) Expr {
+ return fac.newExpr(
+ id,
+ &baseStructExpr{
+ typeName: typeName,
+ fields: fields,
+ })
+}
+
+func (fac *baseExprFactory) NewStructField(id int64, field string, value Expr, isOptional bool) EntryExpr {
+ return fac.newEntryExpr(
+ id,
+ &baseStructField{
+ field: field,
+ value: value,
+ isOptional: isOptional,
+ })
+}
+
+func (fac *baseExprFactory) NewUnspecifiedExpr(id int64) Expr {
+ return fac.newExpr(id, nil)
+}
+
+func (fac *baseExprFactory) CopyExpr(e Expr) Expr {
+ // unwrap navigable expressions to avoid unnecessary allocations during copying.
+ if nav, ok := e.(*navigableExprImpl); ok {
+ e = nav.Expr
+ }
+ switch e.Kind() {
+ case CallKind:
+ c := e.AsCall()
+ argsCopy := make([]Expr, len(c.Args()))
+ for i, arg := range c.Args() {
+ argsCopy[i] = fac.CopyExpr(arg)
+ }
+ if !c.IsMemberFunction() {
+ return fac.NewCall(e.ID(), c.FunctionName(), argsCopy...)
+ }
+ return fac.NewMemberCall(e.ID(), c.FunctionName(), fac.CopyExpr(c.Target()), argsCopy...)
+ case ComprehensionKind:
+ compre := e.AsComprehension()
+ return fac.NewComprehension(e.ID(),
+ fac.CopyExpr(compre.IterRange()),
+ compre.IterVar(),
+ compre.AccuVar(),
+ fac.CopyExpr(compre.AccuInit()),
+ fac.CopyExpr(compre.LoopCondition()),
+ fac.CopyExpr(compre.LoopStep()),
+ fac.CopyExpr(compre.Result()))
+ case IdentKind:
+ return fac.NewIdent(e.ID(), e.AsIdent())
+ case ListKind:
+ l := e.AsList()
+ elemsCopy := make([]Expr, l.Size())
+ for i, elem := range l.Elements() {
+ elemsCopy[i] = fac.CopyExpr(elem)
+ }
+ return fac.NewList(e.ID(), elemsCopy, l.OptionalIndices())
+ case LiteralKind:
+ return fac.NewLiteral(e.ID(), e.AsLiteral())
+ case MapKind:
+ m := e.AsMap()
+ entriesCopy := make([]EntryExpr, m.Size())
+ for i, entry := range m.Entries() {
+ entriesCopy[i] = fac.CopyEntryExpr(entry)
+ }
+ return fac.NewMap(e.ID(), entriesCopy)
+ case SelectKind:
+ s := e.AsSelect()
+ if s.IsTestOnly() {
+ return fac.NewPresenceTest(e.ID(), fac.CopyExpr(s.Operand()), s.FieldName())
+ }
+ return fac.NewSelect(e.ID(), fac.CopyExpr(s.Operand()), s.FieldName())
+ case StructKind:
+ s := e.AsStruct()
+ fieldsCopy := make([]EntryExpr, len(s.Fields()))
+ for i, field := range s.Fields() {
+ fieldsCopy[i] = fac.CopyEntryExpr(field)
+ }
+ return fac.NewStruct(e.ID(), s.TypeName(), fieldsCopy)
+ default:
+ return fac.NewUnspecifiedExpr(e.ID())
+ }
+}
+
+func (fac *baseExprFactory) CopyEntryExpr(e EntryExpr) EntryExpr {
+ switch e.Kind() {
+ case MapEntryKind:
+ entry := e.AsMapEntry()
+ return fac.NewMapEntry(e.ID(),
+ fac.CopyExpr(entry.Key()), fac.CopyExpr(entry.Value()), entry.IsOptional())
+ case StructFieldKind:
+ field := e.AsStructField()
+ return fac.NewStructField(e.ID(),
+ field.Name(), fac.CopyExpr(field.Value()), field.IsOptional())
+ default:
+ return fac.newEntryExpr(e.ID(), nil)
+ }
+}
+
+func (*baseExprFactory) isExprFactory() {}
+
+func (fac *baseExprFactory) newExpr(id int64, e exprKindCase) Expr {
+ return &expr{
+ id: id,
+ exprKindCase: e,
+ }
+}
+
+func (fac *baseExprFactory) newEntryExpr(id int64, e entryExprKindCase) EntryExpr {
+ return &entryExpr{
+ id: id,
+ entryExprKindCase: e,
+ }
+}
+
+var (
+ defaultFactory = &baseExprFactory{}
+)
diff --git a/vendor/github.com/google/cel-go/common/ast/navigable.go b/vendor/github.com/google/cel-go/common/ast/navigable.go
new file mode 100644
index 00000000000..f5ddf6aac66
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/navigable.go
@@ -0,0 +1,652 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ast
+
+import (
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+// NavigableExpr represents the base navigable expression value with methods to inspect the
+// parent and child expressions.
+type NavigableExpr interface {
+ Expr
+
+ // Type of the expression.
+ //
+ // If the expression is type-checked, the type check metadata is returned. If the expression
+ // has not been type-checked, the types.DynType value is returned.
+ Type() *types.Type
+
+ // Parent returns the parent expression node, if one exists.
+ Parent() (NavigableExpr, bool)
+
+ // Children returns a list of child expression nodes.
+ Children() []NavigableExpr
+
+ // Depth indicates the depth in the expression tree.
+ //
+ // The root expression has depth 0.
+ Depth() int
+}
+
+// NavigateAST converts an AST to a NavigableExpr
+func NavigateAST(ast *AST) NavigableExpr {
+ return NavigateExpr(ast, ast.Expr())
+}
+
+// NavigateExpr creates a NavigableExpr whose type information is backed by the input AST.
+//
+// If the expression is already a NavigableExpr, the parent and depth information will be
+// propagated on the new NavigableExpr value; otherwise, the expr value will be treated
+// as though it is the root of the expression graph with a depth of 0.
+func NavigateExpr(ast *AST, expr Expr) NavigableExpr {
+ depth := 0
+ var parent NavigableExpr = nil
+ if nav, ok := expr.(NavigableExpr); ok {
+ depth = nav.Depth()
+ parent, _ = nav.Parent()
+ }
+ return newNavigableExpr(ast, parent, expr, depth)
+}
+
+// ExprMatcher takes a NavigableExpr in and indicates whether the value is a match.
+//
+// This function type should be use with the `Match` and `MatchList` calls.
+type ExprMatcher func(NavigableExpr) bool
+
+// ConstantValueMatcher returns an ExprMatcher which will return true if the input NavigableExpr
+// is comprised of all constant values, such as a simple literal or even list and map literal.
+func ConstantValueMatcher() ExprMatcher {
+ return matchIsConstantValue
+}
+
+// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches
+// the specified `kind`.
+func KindMatcher(kind ExprKind) ExprMatcher {
+ return func(e NavigableExpr) bool {
+ return e.Kind() == kind
+ }
+}
+
+// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose
+// function name is equal to `funcName`.
+func FunctionMatcher(funcName string) ExprMatcher {
+ return func(e NavigableExpr) bool {
+ if e.Kind() != CallKind {
+ return false
+ }
+ return e.AsCall().FunctionName() == funcName
+ }
+}
+
+// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list.
+//
+// Such a result would work well with subsequent MatchList calls.
+func AllMatcher() ExprMatcher {
+ return func(NavigableExpr) bool {
+ return true
+ }
+}
+
+// MatchDescendants takes a NavigableExpr and ExprMatcher and produces a list of NavigableExpr values
+// matching the input criteria in post-order (bottom up).
+func MatchDescendants(expr NavigableExpr, matcher ExprMatcher) []NavigableExpr {
+ matches := []NavigableExpr{}
+ navVisitor := &baseVisitor{
+ visitExpr: func(e Expr) {
+ nav := e.(NavigableExpr)
+ if matcher(nav) {
+ matches = append(matches, nav)
+ }
+ },
+ }
+ visit(expr, navVisitor, postOrder, 0, 0)
+ return matches
+}
+
+// MatchSubset applies an ExprMatcher to a list of NavigableExpr values and their descendants, producing a
+// subset of NavigableExpr values which match.
+func MatchSubset(exprs []NavigableExpr, matcher ExprMatcher) []NavigableExpr {
+ matches := []NavigableExpr{}
+ navVisitor := &baseVisitor{
+ visitExpr: func(e Expr) {
+ nav := e.(NavigableExpr)
+ if matcher(nav) {
+ matches = append(matches, nav)
+ }
+ },
+ }
+ for _, expr := range exprs {
+ visit(expr, navVisitor, postOrder, 0, 1)
+ }
+ return matches
+}
+
+// Visitor defines an object for visiting Expr and EntryExpr nodes within an expression graph.
+type Visitor interface {
+ // VisitExpr visits the input expression.
+ VisitExpr(Expr)
+
+ // VisitEntryExpr visits the input entry expression, i.e. a struct field or map entry.
+ VisitEntryExpr(EntryExpr)
+}
+
+type baseVisitor struct {
+ visitExpr func(Expr)
+ visitEntryExpr func(EntryExpr)
+}
+
+// VisitExpr visits the Expr if the internal expr visitor has been configured.
+func (v *baseVisitor) VisitExpr(e Expr) {
+ if v.visitExpr != nil {
+ v.visitExpr(e)
+ }
+}
+
+// VisitEntryExpr visits the entry if the internal expr entry visitor has been configured.
+func (v *baseVisitor) VisitEntryExpr(e EntryExpr) {
+ if v.visitEntryExpr != nil {
+ v.visitEntryExpr(e)
+ }
+}
+
+// NewExprVisitor creates a visitor which only visits expression nodes.
+func NewExprVisitor(v func(Expr)) Visitor {
+ return &baseVisitor{
+ visitExpr: v,
+ visitEntryExpr: nil,
+ }
+}
+
+// PostOrderVisit walks the expression graph and calls the visitor in post-order (bottom-up).
+func PostOrderVisit(expr Expr, visitor Visitor) {
+ visit(expr, visitor, postOrder, 0, 0)
+}
+
+// PreOrderVisit walks the expression graph and calls the visitor in pre-order (top-down).
+func PreOrderVisit(expr Expr, visitor Visitor) {
+ visit(expr, visitor, preOrder, 0, 0)
+}
+
+type visitOrder int
+
+const (
+ preOrder = iota + 1
+ postOrder
+)
+
+// TODO: consider exposing a way to configure a limit for the max visit depth.
+// It's possible that we could want to configure this on the NewExprVisitor()
+// and through MatchDescendents() / MaxID().
+func visit(expr Expr, visitor Visitor, order visitOrder, depth, maxDepth int) {
+ if maxDepth > 0 && depth == maxDepth {
+ return
+ }
+ if order == preOrder {
+ visitor.VisitExpr(expr)
+ }
+ switch expr.Kind() {
+ case CallKind:
+ c := expr.AsCall()
+ if c.IsMemberFunction() {
+ visit(c.Target(), visitor, order, depth+1, maxDepth)
+ }
+ for _, arg := range c.Args() {
+ visit(arg, visitor, order, depth+1, maxDepth)
+ }
+ case ComprehensionKind:
+ c := expr.AsComprehension()
+ visit(c.IterRange(), visitor, order, depth+1, maxDepth)
+ visit(c.AccuInit(), visitor, order, depth+1, maxDepth)
+ visit(c.LoopCondition(), visitor, order, depth+1, maxDepth)
+ visit(c.LoopStep(), visitor, order, depth+1, maxDepth)
+ visit(c.Result(), visitor, order, depth+1, maxDepth)
+ case ListKind:
+ l := expr.AsList()
+ for _, elem := range l.Elements() {
+ visit(elem, visitor, order, depth+1, maxDepth)
+ }
+ case MapKind:
+ m := expr.AsMap()
+ for _, e := range m.Entries() {
+ if order == preOrder {
+ visitor.VisitEntryExpr(e)
+ }
+ entry := e.AsMapEntry()
+ visit(entry.Key(), visitor, order, depth+1, maxDepth)
+ visit(entry.Value(), visitor, order, depth+1, maxDepth)
+ if order == postOrder {
+ visitor.VisitEntryExpr(e)
+ }
+ }
+ case SelectKind:
+ visit(expr.AsSelect().Operand(), visitor, order, depth+1, maxDepth)
+ case StructKind:
+ s := expr.AsStruct()
+ for _, f := range s.Fields() {
+ visitor.VisitEntryExpr(f)
+ visit(f.AsStructField().Value(), visitor, order, depth+1, maxDepth)
+ }
+ }
+ if order == postOrder {
+ visitor.VisitExpr(expr)
+ }
+}
+
+func matchIsConstantValue(e NavigableExpr) bool {
+ if e.Kind() == LiteralKind {
+ return true
+ }
+ if e.Kind() == StructKind || e.Kind() == MapKind || e.Kind() == ListKind {
+ for _, child := range e.Children() {
+ if !matchIsConstantValue(child) {
+ return false
+ }
+ }
+ return true
+ }
+ return false
+}
+
+func newNavigableExpr(ast *AST, parent NavigableExpr, expr Expr, depth int) NavigableExpr {
+ // Reduce navigable expression nesting by unwrapping the embedded Expr value.
+ if nav, ok := expr.(*navigableExprImpl); ok {
+ expr = nav.Expr
+ }
+ nav := &navigableExprImpl{
+ Expr: expr,
+ depth: depth,
+ ast: ast,
+ parent: parent,
+ createChildren: getChildFactory(expr),
+ }
+ return nav
+}
+
+type navigableExprImpl struct {
+ Expr
+ depth int
+ ast *AST
+ parent NavigableExpr
+ createChildren childFactory
+}
+
+func (nav *navigableExprImpl) Parent() (NavigableExpr, bool) {
+ if nav.parent != nil {
+ return nav.parent, true
+ }
+ return nil, false
+}
+
+func (nav *navigableExprImpl) ID() int64 {
+ return nav.Expr.ID()
+}
+
+func (nav *navigableExprImpl) Kind() ExprKind {
+ return nav.Expr.Kind()
+}
+
+func (nav *navigableExprImpl) Type() *types.Type {
+ return nav.ast.GetType(nav.ID())
+}
+
+func (nav *navigableExprImpl) Children() []NavigableExpr {
+ return nav.createChildren(nav)
+}
+
+func (nav *navigableExprImpl) Depth() int {
+ return nav.depth
+}
+
+func (nav *navigableExprImpl) AsCall() CallExpr {
+ return navigableCallImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsComprehension() ComprehensionExpr {
+ return navigableComprehensionImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsIdent() string {
+ return nav.Expr.AsIdent()
+}
+
+func (nav *navigableExprImpl) AsList() ListExpr {
+ return navigableListImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsLiteral() ref.Val {
+ return nav.Expr.AsLiteral()
+}
+
+func (nav *navigableExprImpl) AsMap() MapExpr {
+ return navigableMapImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsSelect() SelectExpr {
+ return navigableSelectImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsStruct() StructExpr {
+ return navigableStructImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) createChild(e Expr) NavigableExpr {
+ return newNavigableExpr(nav.ast, nav, e, nav.depth+1)
+}
+
+func (nav *navigableExprImpl) isExpr() {}
+
+type navigableCallImpl struct {
+ *navigableExprImpl
+}
+
+func (call navigableCallImpl) FunctionName() string {
+ return call.Expr.AsCall().FunctionName()
+}
+
+func (call navigableCallImpl) IsMemberFunction() bool {
+ return call.Expr.AsCall().IsMemberFunction()
+}
+
+func (call navigableCallImpl) Target() Expr {
+ t := call.Expr.AsCall().Target()
+ if t != nil {
+ return call.createChild(t)
+ }
+ return nil
+}
+
+func (call navigableCallImpl) Args() []Expr {
+ args := call.Expr.AsCall().Args()
+ navArgs := make([]Expr, len(args))
+ for i, a := range args {
+ navArgs[i] = call.createChild(a)
+ }
+ return navArgs
+}
+
+type navigableComprehensionImpl struct {
+ *navigableExprImpl
+}
+
+func (comp navigableComprehensionImpl) IterRange() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().IterRange())
+}
+
+func (comp navigableComprehensionImpl) IterVar() string {
+ return comp.Expr.AsComprehension().IterVar()
+}
+
+func (comp navigableComprehensionImpl) AccuVar() string {
+ return comp.Expr.AsComprehension().AccuVar()
+}
+
+func (comp navigableComprehensionImpl) AccuInit() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().AccuInit())
+}
+
+func (comp navigableComprehensionImpl) LoopCondition() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().LoopCondition())
+}
+
+func (comp navigableComprehensionImpl) LoopStep() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().LoopStep())
+}
+
+func (comp navigableComprehensionImpl) Result() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().Result())
+}
+
+type navigableListImpl struct {
+ *navigableExprImpl
+}
+
+func (l navigableListImpl) Elements() []Expr {
+ pbElems := l.Expr.AsList().Elements()
+ elems := make([]Expr, len(pbElems))
+ for i := 0; i < len(pbElems); i++ {
+ elems[i] = l.createChild(pbElems[i])
+ }
+ return elems
+}
+
+func (l navigableListImpl) IsOptional(index int32) bool {
+ return l.Expr.AsList().IsOptional(index)
+}
+
+func (l navigableListImpl) OptionalIndices() []int32 {
+ return l.Expr.AsList().OptionalIndices()
+}
+
+func (l navigableListImpl) Size() int {
+ return l.Expr.AsList().Size()
+}
+
+type navigableMapImpl struct {
+ *navigableExprImpl
+}
+
+func (m navigableMapImpl) Entries() []EntryExpr {
+ mapExpr := m.Expr.AsMap()
+ entries := make([]EntryExpr, len(mapExpr.Entries()))
+ for i, e := range mapExpr.Entries() {
+ entry := e.AsMapEntry()
+ entries[i] = &entryExpr{
+ id: e.ID(),
+ entryExprKindCase: navigableEntryImpl{
+ key: m.createChild(entry.Key()),
+ val: m.createChild(entry.Value()),
+ isOpt: entry.IsOptional(),
+ },
+ }
+ }
+ return entries
+}
+
+func (m navigableMapImpl) Size() int {
+ return m.Expr.AsMap().Size()
+}
+
+type navigableEntryImpl struct {
+ key NavigableExpr
+ val NavigableExpr
+ isOpt bool
+}
+
+func (e navigableEntryImpl) Kind() EntryExprKind {
+ return MapEntryKind
+}
+
+func (e navigableEntryImpl) Key() Expr {
+ return e.key
+}
+
+func (e navigableEntryImpl) Value() Expr {
+ return e.val
+}
+
+func (e navigableEntryImpl) IsOptional() bool {
+ return e.isOpt
+}
+
+func (e navigableEntryImpl) renumberIDs(IDGenerator) {}
+
+func (e navigableEntryImpl) isEntryExpr() {}
+
+type navigableSelectImpl struct {
+ *navigableExprImpl
+}
+
+func (sel navigableSelectImpl) FieldName() string {
+ return sel.Expr.AsSelect().FieldName()
+}
+
+func (sel navigableSelectImpl) IsTestOnly() bool {
+ return sel.Expr.AsSelect().IsTestOnly()
+}
+
+func (sel navigableSelectImpl) Operand() Expr {
+ return sel.createChild(sel.Expr.AsSelect().Operand())
+}
+
+type navigableStructImpl struct {
+ *navigableExprImpl
+}
+
+func (s navigableStructImpl) TypeName() string {
+ return s.Expr.AsStruct().TypeName()
+}
+
+func (s navigableStructImpl) Fields() []EntryExpr {
+ fieldInits := s.Expr.AsStruct().Fields()
+ fields := make([]EntryExpr, len(fieldInits))
+ for i, f := range fieldInits {
+ field := f.AsStructField()
+ fields[i] = &entryExpr{
+ id: f.ID(),
+ entryExprKindCase: navigableFieldImpl{
+ name: field.Name(),
+ val: s.createChild(field.Value()),
+ isOpt: field.IsOptional(),
+ },
+ }
+ }
+ return fields
+}
+
+type navigableFieldImpl struct {
+ name string
+ val NavigableExpr
+ isOpt bool
+}
+
+func (f navigableFieldImpl) Kind() EntryExprKind {
+ return StructFieldKind
+}
+
+func (f navigableFieldImpl) Name() string {
+ return f.name
+}
+
+func (f navigableFieldImpl) Value() Expr {
+ return f.val
+}
+
+func (f navigableFieldImpl) IsOptional() bool {
+ return f.isOpt
+}
+
+func (f navigableFieldImpl) renumberIDs(IDGenerator) {}
+
+func (f navigableFieldImpl) isEntryExpr() {}
+
+func getChildFactory(expr Expr) childFactory {
+ if expr == nil {
+ return noopFactory
+ }
+ switch expr.Kind() {
+ case LiteralKind:
+ return noopFactory
+ case IdentKind:
+ return noopFactory
+ case SelectKind:
+ return selectFactory
+ case CallKind:
+ return callArgFactory
+ case ListKind:
+ return listElemFactory
+ case MapKind:
+ return mapEntryFactory
+ case StructKind:
+ return structEntryFactory
+ case ComprehensionKind:
+ return comprehensionFactory
+ default:
+ return noopFactory
+ }
+}
+
+type childFactory func(*navigableExprImpl) []NavigableExpr
+
+func noopFactory(*navigableExprImpl) []NavigableExpr {
+ return nil
+}
+
+func selectFactory(nav *navigableExprImpl) []NavigableExpr {
+ return []NavigableExpr{nav.createChild(nav.AsSelect().Operand())}
+}
+
+func callArgFactory(nav *navigableExprImpl) []NavigableExpr {
+ call := nav.Expr.AsCall()
+ argCount := len(call.Args())
+ if call.IsMemberFunction() {
+ argCount++
+ }
+ navExprs := make([]NavigableExpr, argCount)
+ i := 0
+ if call.IsMemberFunction() {
+ navExprs[i] = nav.createChild(call.Target())
+ i++
+ }
+ for _, arg := range call.Args() {
+ navExprs[i] = nav.createChild(arg)
+ i++
+ }
+ return navExprs
+}
+
+func listElemFactory(nav *navigableExprImpl) []NavigableExpr {
+ l := nav.Expr.AsList()
+ navExprs := make([]NavigableExpr, len(l.Elements()))
+ for i, e := range l.Elements() {
+ navExprs[i] = nav.createChild(e)
+ }
+ return navExprs
+}
+
+func structEntryFactory(nav *navigableExprImpl) []NavigableExpr {
+ s := nav.Expr.AsStruct()
+ entries := make([]NavigableExpr, len(s.Fields()))
+ for i, e := range s.Fields() {
+ f := e.AsStructField()
+ entries[i] = nav.createChild(f.Value())
+ }
+ return entries
+}
+
+func mapEntryFactory(nav *navigableExprImpl) []NavigableExpr {
+ m := nav.Expr.AsMap()
+ entries := make([]NavigableExpr, len(m.Entries())*2)
+ j := 0
+ for _, e := range m.Entries() {
+ mapEntry := e.AsMapEntry()
+ entries[j] = nav.createChild(mapEntry.Key())
+ entries[j+1] = nav.createChild(mapEntry.Value())
+ j += 2
+ }
+ return entries
+}
+
+func comprehensionFactory(nav *navigableExprImpl) []NavigableExpr {
+ compre := nav.Expr.AsComprehension()
+ return []NavigableExpr{
+ nav.createChild(compre.IterRange()),
+ nav.createChild(compre.AccuInit()),
+ nav.createChild(compre.LoopCondition()),
+ nav.createChild(compre.LoopStep()),
+ nav.createChild(compre.Result()),
+ }
+}
diff --git a/vendor/github.com/google/cel-go/common/containers/BUILD.bazel b/vendor/github.com/google/cel-go/common/containers/BUILD.bazel
index 3f3f0788712..81197f0641c 100644
--- a/vendor/github.com/google/cel-go/common/containers/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/containers/BUILD.bazel
@@ -12,7 +12,7 @@ go_library(
],
importpath = "github.com/google/cel-go/common/containers",
deps = [
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
+ "//common/ast:go_default_library",
],
)
@@ -26,6 +26,6 @@ go_test(
":go_default_library",
],
deps = [
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
+ "//common/ast:go_default_library",
],
)
diff --git a/vendor/github.com/google/cel-go/common/containers/container.go b/vendor/github.com/google/cel-go/common/containers/container.go
index d46698d3cdf..52153d4cd18 100644
--- a/vendor/github.com/google/cel-go/common/containers/container.go
+++ b/vendor/github.com/google/cel-go/common/containers/container.go
@@ -20,7 +20,7 @@ import (
"fmt"
"strings"
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
)
var (
@@ -297,19 +297,19 @@ func Name(name string) ContainerOption {
// ToQualifiedName converts an expression AST into a qualified name if possible, with a boolean
// 'found' value that indicates if the conversion is successful.
-func ToQualifiedName(e *exprpb.Expr) (string, bool) {
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- id := e.GetIdentExpr()
- return id.GetName(), true
- case *exprpb.Expr_SelectExpr:
- sel := e.GetSelectExpr()
+func ToQualifiedName(e ast.Expr) (string, bool) {
+ switch e.Kind() {
+ case ast.IdentKind:
+ id := e.AsIdent()
+ return id, true
+ case ast.SelectKind:
+ sel := e.AsSelect()
// Test only expressions are not valid as qualified names.
- if sel.GetTestOnly() {
+ if sel.IsTestOnly() {
return "", false
}
- if qual, found := ToQualifiedName(sel.GetOperand()); found {
- return qual + "." + sel.GetField(), true
+ if qual, found := ToQualifiedName(sel.Operand()); found {
+ return qual + "." + sel.FieldName(), true
}
}
return "", false
diff --git a/vendor/github.com/google/cel-go/common/debug/BUILD.bazel b/vendor/github.com/google/cel-go/common/debug/BUILD.bazel
index 1f029839c71..724ed340458 100644
--- a/vendor/github.com/google/cel-go/common/debug/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/debug/BUILD.bazel
@@ -13,6 +13,8 @@ go_library(
importpath = "github.com/google/cel-go/common/debug",
deps = [
"//common:go_default_library",
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
+ "//common/ast:go_default_library",
+ "//common/types:go_default_library",
+ "//common/types/ref:go_default_library",
],
)
diff --git a/vendor/github.com/google/cel-go/common/debug/debug.go b/vendor/github.com/google/cel-go/common/debug/debug.go
index 5dab156ef36..e4c01ac6ed2 100644
--- a/vendor/github.com/google/cel-go/common/debug/debug.go
+++ b/vendor/github.com/google/cel-go/common/debug/debug.go
@@ -22,7 +22,9 @@ import (
"strconv"
"strings"
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
)
// Adorner returns debug metadata that will be tacked on to the string
@@ -38,7 +40,7 @@ type Writer interface {
// Buffer pushes an expression into an internal queue of expressions to
// write to a string.
- Buffer(e *exprpb.Expr)
+ Buffer(e ast.Expr)
}
type emptyDebugAdorner struct {
@@ -51,12 +53,12 @@ func (a *emptyDebugAdorner) GetMetadata(e any) string {
}
// ToDebugString gives the unadorned string representation of the Expr.
-func ToDebugString(e *exprpb.Expr) string {
+func ToDebugString(e ast.Expr) string {
return ToAdornedDebugString(e, emptyAdorner)
}
// ToAdornedDebugString gives the adorned string representation of the Expr.
-func ToAdornedDebugString(e *exprpb.Expr, adorner Adorner) string {
+func ToAdornedDebugString(e ast.Expr, adorner Adorner) string {
w := newDebugWriter(adorner)
w.Buffer(e)
return w.String()
@@ -78,49 +80,51 @@ func newDebugWriter(a Adorner) *debugWriter {
}
}
-func (w *debugWriter) Buffer(e *exprpb.Expr) {
+func (w *debugWriter) Buffer(e ast.Expr) {
if e == nil {
return
}
- switch e.ExprKind.(type) {
- case *exprpb.Expr_ConstExpr:
- w.append(formatLiteral(e.GetConstExpr()))
- case *exprpb.Expr_IdentExpr:
- w.append(e.GetIdentExpr().Name)
- case *exprpb.Expr_SelectExpr:
- w.appendSelect(e.GetSelectExpr())
- case *exprpb.Expr_CallExpr:
- w.appendCall(e.GetCallExpr())
- case *exprpb.Expr_ListExpr:
- w.appendList(e.GetListExpr())
- case *exprpb.Expr_StructExpr:
- w.appendStruct(e.GetStructExpr())
- case *exprpb.Expr_ComprehensionExpr:
- w.appendComprehension(e.GetComprehensionExpr())
+ switch e.Kind() {
+ case ast.LiteralKind:
+ w.append(formatLiteral(e.AsLiteral()))
+ case ast.IdentKind:
+ w.append(e.AsIdent())
+ case ast.SelectKind:
+ w.appendSelect(e.AsSelect())
+ case ast.CallKind:
+ w.appendCall(e.AsCall())
+ case ast.ListKind:
+ w.appendList(e.AsList())
+ case ast.MapKind:
+ w.appendMap(e.AsMap())
+ case ast.StructKind:
+ w.appendStruct(e.AsStruct())
+ case ast.ComprehensionKind:
+ w.appendComprehension(e.AsComprehension())
}
w.adorn(e)
}
-func (w *debugWriter) appendSelect(sel *exprpb.Expr_Select) {
- w.Buffer(sel.GetOperand())
+func (w *debugWriter) appendSelect(sel ast.SelectExpr) {
+ w.Buffer(sel.Operand())
w.append(".")
- w.append(sel.GetField())
- if sel.TestOnly {
+ w.append(sel.FieldName())
+ if sel.IsTestOnly() {
w.append("~test-only~")
}
}
-func (w *debugWriter) appendCall(call *exprpb.Expr_Call) {
- if call.Target != nil {
- w.Buffer(call.GetTarget())
+func (w *debugWriter) appendCall(call ast.CallExpr) {
+ if call.IsMemberFunction() {
+ w.Buffer(call.Target())
w.append(".")
}
- w.append(call.GetFunction())
+ w.append(call.FunctionName())
w.append("(")
- if len(call.GetArgs()) > 0 {
+ if len(call.Args()) > 0 {
w.addIndent()
w.appendLine()
- for i, arg := range call.GetArgs() {
+ for i, arg := range call.Args() {
if i > 0 {
w.append(",")
w.appendLine()
@@ -133,12 +137,12 @@ func (w *debugWriter) appendCall(call *exprpb.Expr_Call) {
w.append(")")
}
-func (w *debugWriter) appendList(list *exprpb.Expr_CreateList) {
+func (w *debugWriter) appendList(list ast.ListExpr) {
w.append("[")
- if len(list.GetElements()) > 0 {
+ if len(list.Elements()) > 0 {
w.appendLine()
w.addIndent()
- for i, elem := range list.GetElements() {
+ for i, elem := range list.Elements() {
if i > 0 {
w.append(",")
w.appendLine()
@@ -151,32 +155,25 @@ func (w *debugWriter) appendList(list *exprpb.Expr_CreateList) {
w.append("]")
}
-func (w *debugWriter) appendStruct(obj *exprpb.Expr_CreateStruct) {
- if obj.MessageName != "" {
- w.appendObject(obj)
- } else {
- w.appendMap(obj)
- }
-}
-
-func (w *debugWriter) appendObject(obj *exprpb.Expr_CreateStruct) {
- w.append(obj.GetMessageName())
+func (w *debugWriter) appendStruct(obj ast.StructExpr) {
+ w.append(obj.TypeName())
w.append("{")
- if len(obj.GetEntries()) > 0 {
+ if len(obj.Fields()) > 0 {
w.appendLine()
w.addIndent()
- for i, entry := range obj.GetEntries() {
+ for i, f := range obj.Fields() {
+ field := f.AsStructField()
if i > 0 {
w.append(",")
w.appendLine()
}
- if entry.GetOptionalEntry() {
+ if field.IsOptional() {
w.append("?")
}
- w.append(entry.GetFieldKey())
+ w.append(field.Name())
w.append(":")
- w.Buffer(entry.GetValue())
- w.adorn(entry)
+ w.Buffer(field.Value())
+ w.adorn(f)
}
w.removeIndent()
w.appendLine()
@@ -184,23 +181,24 @@ func (w *debugWriter) appendObject(obj *exprpb.Expr_CreateStruct) {
w.append("}")
}
-func (w *debugWriter) appendMap(obj *exprpb.Expr_CreateStruct) {
+func (w *debugWriter) appendMap(m ast.MapExpr) {
w.append("{")
- if len(obj.GetEntries()) > 0 {
+ if m.Size() > 0 {
w.appendLine()
w.addIndent()
- for i, entry := range obj.GetEntries() {
+ for i, e := range m.Entries() {
+ entry := e.AsMapEntry()
if i > 0 {
w.append(",")
w.appendLine()
}
- if entry.GetOptionalEntry() {
+ if entry.IsOptional() {
w.append("?")
}
- w.Buffer(entry.GetMapKey())
+ w.Buffer(entry.Key())
w.append(":")
- w.Buffer(entry.GetValue())
- w.adorn(entry)
+ w.Buffer(entry.Value())
+ w.adorn(e)
}
w.removeIndent()
w.appendLine()
@@ -208,62 +206,62 @@ func (w *debugWriter) appendMap(obj *exprpb.Expr_CreateStruct) {
w.append("}")
}
-func (w *debugWriter) appendComprehension(comprehension *exprpb.Expr_Comprehension) {
+func (w *debugWriter) appendComprehension(comprehension ast.ComprehensionExpr) {
w.append("__comprehension__(")
w.addIndent()
w.appendLine()
w.append("// Variable")
w.appendLine()
- w.append(comprehension.GetIterVar())
+ w.append(comprehension.IterVar())
w.append(",")
w.appendLine()
w.append("// Target")
w.appendLine()
- w.Buffer(comprehension.GetIterRange())
+ w.Buffer(comprehension.IterRange())
w.append(",")
w.appendLine()
w.append("// Accumulator")
w.appendLine()
- w.append(comprehension.GetAccuVar())
+ w.append(comprehension.AccuVar())
w.append(",")
w.appendLine()
w.append("// Init")
w.appendLine()
- w.Buffer(comprehension.GetAccuInit())
+ w.Buffer(comprehension.AccuInit())
w.append(",")
w.appendLine()
w.append("// LoopCondition")
w.appendLine()
- w.Buffer(comprehension.GetLoopCondition())
+ w.Buffer(comprehension.LoopCondition())
w.append(",")
w.appendLine()
w.append("// LoopStep")
w.appendLine()
- w.Buffer(comprehension.GetLoopStep())
+ w.Buffer(comprehension.LoopStep())
w.append(",")
w.appendLine()
w.append("// Result")
w.appendLine()
- w.Buffer(comprehension.GetResult())
+ w.Buffer(comprehension.Result())
w.append(")")
w.removeIndent()
}
-func formatLiteral(c *exprpb.Constant) string {
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- return fmt.Sprintf("%t", c.GetBoolValue())
- case *exprpb.Constant_BytesValue:
- return fmt.Sprintf("b\"%s\"", string(c.GetBytesValue()))
- case *exprpb.Constant_DoubleValue:
- return fmt.Sprintf("%v", c.GetDoubleValue())
- case *exprpb.Constant_Int64Value:
- return fmt.Sprintf("%d", c.GetInt64Value())
- case *exprpb.Constant_StringValue:
- return strconv.Quote(c.GetStringValue())
- case *exprpb.Constant_Uint64Value:
- return fmt.Sprintf("%du", c.GetUint64Value())
- case *exprpb.Constant_NullValue:
+func formatLiteral(c ref.Val) string {
+ switch v := c.(type) {
+ case types.Bool:
+ return fmt.Sprintf("%t", v)
+ case types.Bytes:
+ return fmt.Sprintf("b\"%s\"", string(v))
+ case types.Double:
+ return fmt.Sprintf("%v", float64(v))
+ case types.Int:
+ return fmt.Sprintf("%d", int64(v))
+ case types.String:
+ return strconv.Quote(string(v))
+ case types.Uint:
+ return fmt.Sprintf("%du", uint64(v))
+ case types.Null:
return "null"
default:
panic("Unknown constant type")
diff --git a/vendor/github.com/google/cel-go/common/errors.go b/vendor/github.com/google/cel-go/common/errors.go
index 63919714ea7..25adc73d8e0 100644
--- a/vendor/github.com/google/cel-go/common/errors.go
+++ b/vendor/github.com/google/cel-go/common/errors.go
@@ -64,7 +64,7 @@ func (e *Errors) GetErrors() []*Error {
// Append creates a new Errors object with the current and input errors.
func (e *Errors) Append(errs []*Error) *Errors {
return &Errors{
- errors: append(e.errors, errs...),
+ errors: append(e.errors[:], errs...),
source: e.source,
numErrors: e.numErrors + len(errs),
maxErrorsToReport: e.maxErrorsToReport,
diff --git a/vendor/github.com/google/cel-go/common/types/err.go b/vendor/github.com/google/cel-go/common/types/err.go
index aa8f94b4f85..9c9d9e21efb 100644
--- a/vendor/github.com/google/cel-go/common/types/err.go
+++ b/vendor/github.com/google/cel-go/common/types/err.go
@@ -31,6 +31,7 @@ type Error interface {
// Err type which extends the built-in go error and implements ref.Val.
type Err struct {
error
+ id int64
}
var (
@@ -58,7 +59,24 @@ var (
// NewErr creates a new Err described by the format string and args.
// TODO: Audit the use of this function and standardize the error messages and codes.
func NewErr(format string, args ...any) ref.Val {
- return &Err{fmt.Errorf(format, args...)}
+ return &Err{error: fmt.Errorf(format, args...)}
+}
+
+// NewErrWithNodeID creates a new Err described by the format string and args.
+// TODO: Audit the use of this function and standardize the error messages and codes.
+func NewErrWithNodeID(id int64, format string, args ...any) ref.Val {
+ return &Err{error: fmt.Errorf(format, args...), id: id}
+}
+
+// LabelErrNode returns val unaltered it is not an Err or if the error has a non-zero
+// AST node ID already present. Otherwise the id is added to the error for
+// recovery with the Err.NodeID method.
+func LabelErrNode(id int64, val ref.Val) ref.Val {
+ if err, ok := val.(*Err); ok && err.id == 0 {
+ err.id = id
+ return err
+ }
+ return val
}
// NoSuchOverloadErr returns a new types.Err instance with a no such overload message.
@@ -124,6 +142,11 @@ func (e *Err) Value() any {
return e.error
}
+// NodeID returns the AST node ID of the expression that returned the error.
+func (e *Err) NodeID() int64 {
+ return e.id
+}
+
// Is implements errors.Is.
func (e *Err) Is(target error) bool {
return e.error.Error() == target.Error()
diff --git a/vendor/github.com/google/cel-go/common/types/int.go b/vendor/github.com/google/cel-go/common/types/int.go
index 940772aed1f..0ae9507c396 100644
--- a/vendor/github.com/google/cel-go/common/types/int.go
+++ b/vendor/github.com/google/cel-go/common/types/int.go
@@ -90,6 +90,18 @@ func (i Int) ConvertToNative(typeDesc reflect.Type) (any, error) {
return nil, err
}
return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Int8:
+ v, err := int64ToInt8Checked(int64(i))
+ if err != nil {
+ return nil, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Int16:
+ v, err := int64ToInt16Checked(int64(i))
+ if err != nil {
+ return nil, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
case reflect.Int64:
return reflect.ValueOf(i).Convert(typeDesc).Interface(), nil
case reflect.Ptr:
diff --git a/vendor/github.com/google/cel-go/common/types/list.go b/vendor/github.com/google/cel-go/common/types/list.go
index d4932b4a90c..06f48dde75f 100644
--- a/vendor/github.com/google/cel-go/common/types/list.go
+++ b/vendor/github.com/google/cel-go/common/types/list.go
@@ -190,7 +190,13 @@ func (l *baseList) ConvertToNative(typeDesc reflect.Type) (any, error) {
// Allow the element ConvertToNative() function to determine whether conversion is possible.
otherElemType := typeDesc.Elem()
elemCount := l.size
- nativeList := reflect.MakeSlice(typeDesc, elemCount, elemCount)
+ var nativeList reflect.Value
+ if typeDesc.Kind() == reflect.Array {
+ nativeList = reflect.New(reflect.ArrayOf(elemCount, typeDesc)).Elem().Index(0)
+ } else {
+ nativeList = reflect.MakeSlice(typeDesc, elemCount, elemCount)
+
+ }
for i := 0; i < elemCount; i++ {
elem := l.NativeToValue(l.get(i))
nativeElemVal, err := elem.ConvertToNative(otherElemType)
diff --git a/vendor/github.com/google/cel-go/common/types/optional.go b/vendor/github.com/google/cel-go/common/types/optional.go
index a9f30aed015..97845a740c8 100644
--- a/vendor/github.com/google/cel-go/common/types/optional.go
+++ b/vendor/github.com/google/cel-go/common/types/optional.go
@@ -24,7 +24,7 @@ import (
var (
// OptionalType indicates the runtime type of an optional value.
- OptionalType = NewOpaqueType("optional")
+ OptionalType = NewOpaqueType("optional_type")
// OptionalNone is a sentinel value which is used to indicate an empty optional value.
OptionalNone = &Optional{}
diff --git a/vendor/github.com/google/cel-go/common/types/overflow.go b/vendor/github.com/google/cel-go/common/types/overflow.go
index c68a921826b..dcb66ef5961 100644
--- a/vendor/github.com/google/cel-go/common/types/overflow.go
+++ b/vendor/github.com/google/cel-go/common/types/overflow.go
@@ -326,6 +326,26 @@ func int64ToUint64Checked(v int64) (uint64, error) {
return uint64(v), nil
}
+// int64ToInt8Checked converts an int64 to an int8 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func int64ToInt8Checked(v int64) (int8, error) {
+ if v < math.MinInt8 || v > math.MaxInt8 {
+ return 0, errIntOverflow
+ }
+ return int8(v), nil
+}
+
+// int64ToInt16Checked converts an int64 to an int16 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func int64ToInt16Checked(v int64) (int16, error) {
+ if v < math.MinInt16 || v > math.MaxInt16 {
+ return 0, errIntOverflow
+ }
+ return int16(v), nil
+}
+
// int64ToInt32Checked converts an int64 to an int32 value.
//
// If the conversion fails due to overflow the error return value will be non-nil.
@@ -336,6 +356,26 @@ func int64ToInt32Checked(v int64) (int32, error) {
return int32(v), nil
}
+// uint64ToUint8Checked converts a uint64 to a uint8 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func uint64ToUint8Checked(v uint64) (uint8, error) {
+ if v > math.MaxUint8 {
+ return 0, errUintOverflow
+ }
+ return uint8(v), nil
+}
+
+// uint64ToUint16Checked converts a uint64 to a uint16 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func uint64ToUint16Checked(v uint64) (uint16, error) {
+ if v > math.MaxUint16 {
+ return 0, errUintOverflow
+ }
+ return uint16(v), nil
+}
+
// uint64ToUint32Checked converts a uint64 to a uint32 value.
//
// If the conversion fails due to overflow the error return value will be non-nil.
diff --git a/vendor/github.com/google/cel-go/common/types/provider.go b/vendor/github.com/google/cel-go/common/types/provider.go
index e80b4622e24..c5ff05fdb96 100644
--- a/vendor/github.com/google/cel-go/common/types/provider.go
+++ b/vendor/github.com/google/cel-go/common/types/provider.go
@@ -54,6 +54,10 @@ type Provider interface {
// Returns false if not found.
FindStructType(structType string) (*Type, bool)
+ // FindStructFieldNames returns thet field names associated with the type, if the type
+ // is found.
+ FindStructFieldNames(structType string) ([]string, bool)
+
// FieldStructFieldType returns the field type for a checked type value. Returns
// false if the field could not be found.
FindStructFieldType(structType, fieldName string) (*FieldType, bool)
@@ -154,7 +158,7 @@ func (p *Registry) EnumValue(enumName string) ref.Val {
return Int(enumVal.Value())
}
-// FieldFieldType returns the field type for a checked type value. Returns false if
+// FindFieldType returns the field type for a checked type value. Returns false if
// the field could not be found.
//
// Deprecated: use FindStructFieldType
@@ -173,7 +177,24 @@ func (p *Registry) FindFieldType(structType, fieldName string) (*ref.FieldType,
GetFrom: field.GetFrom}, true
}
-// FieldStructFieldType returns the field type for a checked type value. Returns
+// FindStructFieldNames returns the set of field names for the given struct type,
+// if the type exists in the registry.
+func (p *Registry) FindStructFieldNames(structType string) ([]string, bool) {
+ msgType, found := p.pbdb.DescribeType(structType)
+ if !found {
+ return []string{}, false
+ }
+ fieldMap := msgType.FieldMap()
+ fields := make([]string, len(fieldMap))
+ idx := 0
+ for f := range fieldMap {
+ fields[idx] = f
+ idx++
+ }
+ return fields, true
+}
+
+// FindStructFieldType returns the field type for a checked type value. Returns
// false if the field could not be found.
func (p *Registry) FindStructFieldType(structType, fieldName string) (*FieldType, bool) {
msgType, found := p.pbdb.DescribeType(structType)
@@ -255,7 +276,7 @@ func (p *Registry) NewValue(structType string, fields map[string]ref.Val) ref.Va
}
err := msgSetField(msg, field, value)
if err != nil {
- return &Err{err}
+ return &Err{error: err}
}
}
return p.NativeToValue(msg.Interface())
@@ -569,12 +590,33 @@ func nativeToValue(a Adapter, value any) (ref.Val, bool) {
return NewDynamicMap(a, v), true
// type aliases of primitive types cannot be asserted as that type, but rather need
// to be downcast to int32 before being converted to a CEL representation.
+ case reflect.Bool:
+ boolTupe := reflect.TypeOf(false)
+ return Bool(refValue.Convert(boolTupe).Interface().(bool)), true
+ case reflect.Int:
+ intType := reflect.TypeOf(int(0))
+ return Int(refValue.Convert(intType).Interface().(int)), true
+ case reflect.Int8:
+ intType := reflect.TypeOf(int8(0))
+ return Int(refValue.Convert(intType).Interface().(int8)), true
+ case reflect.Int16:
+ intType := reflect.TypeOf(int16(0))
+ return Int(refValue.Convert(intType).Interface().(int16)), true
case reflect.Int32:
intType := reflect.TypeOf(int32(0))
return Int(refValue.Convert(intType).Interface().(int32)), true
case reflect.Int64:
intType := reflect.TypeOf(int64(0))
return Int(refValue.Convert(intType).Interface().(int64)), true
+ case reflect.Uint:
+ uintType := reflect.TypeOf(uint(0))
+ return Uint(refValue.Convert(uintType).Interface().(uint)), true
+ case reflect.Uint8:
+ uintType := reflect.TypeOf(uint8(0))
+ return Uint(refValue.Convert(uintType).Interface().(uint8)), true
+ case reflect.Uint16:
+ uintType := reflect.TypeOf(uint16(0))
+ return Uint(refValue.Convert(uintType).Interface().(uint16)), true
case reflect.Uint32:
uintType := reflect.TypeOf(uint32(0))
return Uint(refValue.Convert(uintType).Interface().(uint32)), true
@@ -587,6 +629,9 @@ func nativeToValue(a Adapter, value any) (ref.Val, bool) {
case reflect.Float64:
doubleType := reflect.TypeOf(float64(0))
return Double(refValue.Convert(doubleType).Interface().(float64)), true
+ case reflect.String:
+ stringType := reflect.TypeOf("")
+ return String(refValue.Convert(stringType).Interface().(string)), true
}
}
return nil, false
diff --git a/vendor/github.com/google/cel-go/common/types/string.go b/vendor/github.com/google/cel-go/common/types/string.go
index 028e6824d22..3a93743f24e 100644
--- a/vendor/github.com/google/cel-go/common/types/string.go
+++ b/vendor/github.com/google/cel-go/common/types/string.go
@@ -66,10 +66,7 @@ func (s String) Compare(other ref.Val) ref.Val {
func (s String) ConvertToNative(typeDesc reflect.Type) (any, error) {
switch typeDesc.Kind() {
case reflect.String:
- if reflect.TypeOf(s).AssignableTo(typeDesc) {
- return s, nil
- }
- return s.Value(), nil
+ return reflect.ValueOf(s).Convert(typeDesc).Interface(), nil
case reflect.Ptr:
switch typeDesc {
case anyValueType:
@@ -158,7 +155,7 @@ func (s String) Match(pattern ref.Val) ref.Val {
}
matched, err := regexp.MatchString(pat.Value().(string), s.Value().(string))
if err != nil {
- return &Err{err}
+ return &Err{error: err}
}
return Bool(matched)
}
diff --git a/vendor/github.com/google/cel-go/common/types/types.go b/vendor/github.com/google/cel-go/common/types/types.go
index 76624eefdee..6c3d5f719ba 100644
--- a/vendor/github.com/google/cel-go/common/types/types.go
+++ b/vendor/github.com/google/cel-go/common/types/types.go
@@ -373,6 +373,23 @@ func (t *Type) TypeName() string {
return t.runtimeTypeName
}
+// WithTraits creates a copy of the current Type and sets the trait mask to the traits parameter.
+//
+// This method should be used with Opaque types where the type acts like a container, e.g. vector.
+func (t *Type) WithTraits(traits int) *Type {
+ if t == nil {
+ return nil
+ }
+ return &Type{
+ kind: t.kind,
+ parameters: t.parameters,
+ runtimeTypeName: t.runtimeTypeName,
+ isAssignableType: t.isAssignableType,
+ isAssignableRuntimeType: t.isAssignableRuntimeType,
+ traitMask: traits,
+ }
+}
+
// String returns a human-readable definition of the type name.
func (t *Type) String() string {
if len(t.Parameters()) == 0 {
@@ -496,7 +513,7 @@ func NewNullableType(wrapped *Type) *Type {
// NewOptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional.
func NewOptionalType(param *Type) *Type {
- return NewOpaqueType("optional", param)
+ return NewOpaqueType("optional_type", param)
}
// NewOpaqueType creates an abstract parameterized type with a given name.
diff --git a/vendor/github.com/google/cel-go/common/types/uint.go b/vendor/github.com/google/cel-go/common/types/uint.go
index 3257f9ade97..6d74f30d884 100644
--- a/vendor/github.com/google/cel-go/common/types/uint.go
+++ b/vendor/github.com/google/cel-go/common/types/uint.go
@@ -80,6 +80,18 @@ func (i Uint) ConvertToNative(typeDesc reflect.Type) (any, error) {
return 0, err
}
return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Uint8:
+ v, err := uint64ToUint8Checked(uint64(i))
+ if err != nil {
+ return 0, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Uint16:
+ v, err := uint64ToUint16Checked(uint64(i))
+ if err != nil {
+ return 0, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
case reflect.Uint64:
return reflect.ValueOf(i).Convert(typeDesc).Interface(), nil
case reflect.Ptr:
diff --git a/vendor/github.com/google/cel-go/ext/BUILD.bazel b/vendor/github.com/google/cel-go/ext/BUILD.bazel
index 6fdcc60c658..db223da2f7b 100644
--- a/vendor/github.com/google/cel-go/ext/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/ext/BUILD.bazel
@@ -7,7 +7,9 @@ package(
go_library(
name = "go_default_library",
srcs = [
+ "bindings.go",
"encoders.go",
+ "formatting.go",
"guards.go",
"lists.go",
"math.go",
@@ -21,14 +23,14 @@ go_library(
deps = [
"//cel:go_default_library",
"//checker:go_default_library",
- "//checker/decls:go_default_library",
+ "//common/ast:go_default_library",
"//common/overloads:go_default_library",
+ "//common/operators:go_default_library",
"//common/types:go_default_library",
"//common/types/pb:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
"//interpreter:go_default_library",
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//types/known/structpb",
@@ -61,7 +63,6 @@ go_test(
"//test:go_default_library",
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/known/wrapperspb:go_default_library",
"@org_golang_google_protobuf//encoding/protojson:go_default_library",
diff --git a/vendor/github.com/google/cel-go/ext/README.md b/vendor/github.com/google/cel-go/ext/README.md
index 6f621ac4af6..2fac0cb22ba 100644
--- a/vendor/github.com/google/cel-go/ext/README.md
+++ b/vendor/github.com/google/cel-go/ext/README.md
@@ -414,3 +414,17 @@ Examples:
'TacoCat'.upperAscii() // returns 'TACOCAT'
'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII'
+
+### Reverse
+
+Returns a new string whose characters are the same as the target string, only formatted in
+reverse order.
+This function relies on converting strings to rune arrays in order to reverse.
+It can be located in Version 3 of strings.
+
+ .reverse() ->
+
+Examples:
+
+ 'gums'.reverse() // returns 'smug'
+ 'John Smith'.reverse() // returns 'htimS nhoJ'
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/ext/bindings.go b/vendor/github.com/google/cel-go/ext/bindings.go
index 4ac9a7f07fc..2c6cc627fab 100644
--- a/vendor/github.com/google/cel-go/ext/bindings.go
+++ b/vendor/github.com/google/cel-go/ext/bindings.go
@@ -16,8 +16,8 @@ package ext
import (
"github.com/google/cel-go/cel"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
)
// Bindings returns a cel.EnvOption to configure support for local variable
@@ -61,7 +61,7 @@ func (celBindings) CompileOptions() []cel.EnvOption {
return []cel.EnvOption{
cel.Macros(
// cel.bind(var, , )
- cel.NewReceiverMacro(bindMacro, 3, celBind),
+ cel.ReceiverMacro(bindMacro, 3, celBind),
),
}
}
@@ -70,27 +70,27 @@ func (celBindings) ProgramOptions() []cel.ProgramOption {
return []cel.ProgramOption{}
}
-func celBind(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func celBind(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(celNamespace, target) {
return nil, nil
}
varIdent := args[0]
varName := ""
- switch varIdent.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- varName = varIdent.GetIdentExpr().GetName()
+ switch varIdent.Kind() {
+ case ast.IdentKind:
+ varName = varIdent.AsIdent()
default:
- return nil, meh.NewError(varIdent.GetId(), "cel.bind() variable names must be simple identifiers")
+ return nil, mef.NewError(varIdent.ID(), "cel.bind() variable names must be simple identifiers")
}
varInit := args[1]
resultExpr := args[2]
- return meh.Fold(
+ return mef.NewComprehension(
+ mef.NewList(),
unusedIterVar,
- meh.NewList(),
varName,
varInit,
- meh.LiteralBool(false),
- meh.Ident(varName),
+ mef.NewLiteral(types.False),
+ mef.NewIdent(varName),
resultExpr,
), nil
}
diff --git a/vendor/github.com/google/cel-go/ext/formatting.go b/vendor/github.com/google/cel-go/ext/formatting.go
new file mode 100644
index 00000000000..2f35b996cb8
--- /dev/null
+++ b/vendor/github.com/google/cel-go/ext/formatting.go
@@ -0,0 +1,904 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ext
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "sort"
+ "strconv"
+ "strings"
+ "unicode"
+
+ "golang.org/x/text/language"
+ "golang.org/x/text/message"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/overloads"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+type clauseImpl func(ref.Val, string) (string, error)
+
+func clauseForType(argType ref.Type) (clauseImpl, error) {
+ switch argType {
+ case types.IntType, types.UintType:
+ return formatDecimal, nil
+ case types.StringType, types.BytesType, types.BoolType, types.NullType, types.TypeType:
+ return FormatString, nil
+ case types.TimestampType, types.DurationType:
+ // special case to ensure timestamps/durations get printed as CEL literals
+ return func(arg ref.Val, locale string) (string, error) {
+ argStrVal := arg.ConvertToType(types.StringType)
+ argStr := argStrVal.Value().(string)
+ if arg.Type() == types.TimestampType {
+ return fmt.Sprintf("timestamp(%q)", argStr), nil
+ }
+ if arg.Type() == types.DurationType {
+ return fmt.Sprintf("duration(%q)", argStr), nil
+ }
+ return "", fmt.Errorf("cannot convert argument of type %s to timestamp/duration", arg.Type().TypeName())
+ }, nil
+ case types.ListType:
+ return formatList, nil
+ case types.MapType:
+ return formatMap, nil
+ case types.DoubleType:
+ // avoid formatFixed so we can output a period as the decimal separator in order
+ // to always be a valid CEL literal
+ return func(arg ref.Val, locale string) (string, error) {
+ argDouble, ok := arg.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("couldn't convert %s to float64", arg.Type().TypeName())
+ }
+ fmtStr := fmt.Sprintf("%%.%df", defaultPrecision)
+ return fmt.Sprintf(fmtStr, argDouble), nil
+ }, nil
+ case types.TypeType:
+ return func(arg ref.Val, locale string) (string, error) {
+ return fmt.Sprintf("type(%s)", arg.Value().(string)), nil
+ }, nil
+ default:
+ return nil, fmt.Errorf("no formatting function for %s", argType.TypeName())
+ }
+}
+
+func formatList(arg ref.Val, locale string) (string, error) {
+ argList := arg.(traits.Lister)
+ argIterator := argList.Iterator()
+ var listStrBuilder strings.Builder
+ _, err := listStrBuilder.WriteRune('[')
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ for argIterator.HasNext() == types.True {
+ member := argIterator.Next()
+ memberFormat, err := clauseForType(member.Type())
+ if err != nil {
+ return "", err
+ }
+ unquotedStr, err := memberFormat(member, locale)
+ if err != nil {
+ return "", err
+ }
+ str := quoteForCEL(member, unquotedStr)
+ _, err = listStrBuilder.WriteString(str)
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ if argIterator.HasNext() == types.True {
+ _, err = listStrBuilder.WriteString(", ")
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ }
+ }
+ _, err = listStrBuilder.WriteRune(']')
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ return listStrBuilder.String(), nil
+}
+
+func formatMap(arg ref.Val, locale string) (string, error) {
+ argMap := arg.(traits.Mapper)
+ argIterator := argMap.Iterator()
+ type mapPair struct {
+ key string
+ value string
+ }
+ argPairs := make([]mapPair, argMap.Size().Value().(int64))
+ i := 0
+ for argIterator.HasNext() == types.True {
+ key := argIterator.Next()
+ var keyFormat clauseImpl
+ switch key.Type() {
+ case types.StringType, types.BoolType:
+ keyFormat = FormatString
+ case types.IntType, types.UintType:
+ keyFormat = formatDecimal
+ default:
+ return "", fmt.Errorf("no formatting function for map key of type %s", key.Type().TypeName())
+ }
+ unquotedKeyStr, err := keyFormat(key, locale)
+ if err != nil {
+ return "", err
+ }
+ keyStr := quoteForCEL(key, unquotedKeyStr)
+ value, found := argMap.Find(key)
+ if !found {
+ return "", fmt.Errorf("could not find key: %q", key)
+ }
+ valueFormat, err := clauseForType(value.Type())
+ if err != nil {
+ return "", err
+ }
+ unquotedValueStr, err := valueFormat(value, locale)
+ if err != nil {
+ return "", err
+ }
+ valueStr := quoteForCEL(value, unquotedValueStr)
+ argPairs[i] = mapPair{keyStr, valueStr}
+ i++
+ }
+ sort.SliceStable(argPairs, func(x, y int) bool {
+ return argPairs[x].key < argPairs[y].key
+ })
+ var mapStrBuilder strings.Builder
+ _, err := mapStrBuilder.WriteRune('{')
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ for i, entry := range argPairs {
+ _, err = mapStrBuilder.WriteString(fmt.Sprintf("%s:%s", entry.key, entry.value))
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ if i < len(argPairs)-1 {
+ _, err = mapStrBuilder.WriteString(", ")
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ }
+ }
+ _, err = mapStrBuilder.WriteRune('}')
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ return mapStrBuilder.String(), nil
+}
+
+// quoteForCEL takes a formatted, unquoted value and quotes it in a manner suitable
+// for embedding directly in CEL.
+func quoteForCEL(refVal ref.Val, unquotedValue string) string {
+ switch refVal.Type() {
+ case types.StringType:
+ return fmt.Sprintf("%q", unquotedValue)
+ case types.BytesType:
+ return fmt.Sprintf("b%q", unquotedValue)
+ case types.DoubleType:
+ // special case to handle infinity/NaN
+ num := refVal.Value().(float64)
+ if math.IsInf(num, 1) || math.IsInf(num, -1) || math.IsNaN(num) {
+ return fmt.Sprintf("%q", unquotedValue)
+ }
+ return unquotedValue
+ default:
+ return unquotedValue
+ }
+}
+
+// FormatString returns the string representation of a CEL value.
+//
+// It is used to implement the %s specifier in the (string).format() extension function.
+func FormatString(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.ListType:
+ return formatList(arg, locale)
+ case types.MapType:
+ return formatMap(arg, locale)
+ case types.IntType, types.UintType, types.DoubleType,
+ types.BoolType, types.StringType, types.TimestampType, types.BytesType, types.DurationType, types.TypeType:
+ argStrVal := arg.ConvertToType(types.StringType)
+ argStr, ok := argStrVal.Value().(string)
+ if !ok {
+ return "", fmt.Errorf("could not convert argument %q to string", argStrVal)
+ }
+ return argStr, nil
+ case types.NullType:
+ return "null", nil
+ default:
+ return "", stringFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+func formatDecimal(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt, ok := arg.ConvertToType(types.IntType).Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
+ }
+ return fmt.Sprintf("%d", argInt), nil
+ case types.UintType:
+ argInt, ok := arg.ConvertToType(types.UintType).Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
+ }
+ return fmt.Sprintf("%d", argInt), nil
+ default:
+ return "", decimalFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+func matchLanguage(locale string) (language.Tag, error) {
+ matcher, err := makeMatcher(locale)
+ if err != nil {
+ return language.Und, err
+ }
+ tag, _ := language.MatchStrings(matcher, locale)
+ return tag, nil
+}
+
+func makeMatcher(locale string) (language.Matcher, error) {
+ tags := make([]language.Tag, 0)
+ tag, err := language.Parse(locale)
+ if err != nil {
+ return nil, err
+ }
+ tags = append(tags, tag)
+ return language.NewMatcher(tags), nil
+}
+
+type stringFormatter struct{}
+
+func (c *stringFormatter) String(arg ref.Val, locale string) (string, error) {
+ return FormatString(arg, locale)
+}
+
+func (c *stringFormatter) Decimal(arg ref.Val, locale string) (string, error) {
+ return formatDecimal(arg, locale)
+}
+
+func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, error) {
+ if precision == nil {
+ precision = new(int)
+ *precision = defaultPrecision
+ }
+ return func(arg ref.Val, locale string) (string, error) {
+ strException := false
+ if arg.Type() == types.StringType {
+ argStr := arg.Value().(string)
+ if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
+ strException = true
+ }
+ }
+ if arg.Type() != types.DoubleType && !strException {
+ return "", fixedPointFormatError(runtimeID, arg.Type().TypeName())
+ }
+ argFloatVal := arg.ConvertToType(types.DoubleType)
+ argFloat, ok := argFloatVal.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to float64", argFloatVal.Value())
+ }
+ fmtStr := fmt.Sprintf("%%.%df", *precision)
+
+ matchedLocale, err := matchLanguage(locale)
+ if err != nil {
+ return "", fmt.Errorf("error matching locale: %w", err)
+ }
+ return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
+ }
+}
+
+func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (string, error) {
+ if precision == nil {
+ precision = new(int)
+ *precision = defaultPrecision
+ }
+ return func(arg ref.Val, locale string) (string, error) {
+ strException := false
+ if arg.Type() == types.StringType {
+ argStr := arg.Value().(string)
+ if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
+ strException = true
+ }
+ }
+ if arg.Type() != types.DoubleType && !strException {
+ return "", scientificFormatError(runtimeID, arg.Type().TypeName())
+ }
+ argFloatVal := arg.ConvertToType(types.DoubleType)
+ argFloat, ok := argFloatVal.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%v\" to float64", argFloatVal.Value())
+ }
+ matchedLocale, err := matchLanguage(locale)
+ if err != nil {
+ return "", fmt.Errorf("error matching locale: %w", err)
+ }
+ fmtStr := fmt.Sprintf("%%%de", *precision)
+ return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
+ }
+}
+
+func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt := arg.Value().(int64)
+ // locale is intentionally unused as integers formatted as binary
+ // strings are locale-independent
+ return fmt.Sprintf("%b", argInt), nil
+ case types.UintType:
+ argInt := arg.Value().(uint64)
+ return fmt.Sprintf("%b", argInt), nil
+ case types.BoolType:
+ argBool := arg.Value().(bool)
+ if argBool {
+ return "1", nil
+ }
+ return "0", nil
+ default:
+ return "", binaryFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ fmtStr := "%x"
+ if useUpper {
+ fmtStr = "%X"
+ }
+ switch arg.Type() {
+ case types.StringType, types.BytesType:
+ if arg.Type() == types.BytesType {
+ return fmt.Sprintf(fmtStr, arg.Value().([]byte)), nil
+ }
+ return fmt.Sprintf(fmtStr, arg.Value().(string)), nil
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
+ }
+ return fmt.Sprintf(fmtStr, argInt), nil
+ case types.UintType:
+ argInt, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
+ }
+ return fmt.Sprintf(fmtStr, argInt), nil
+ default:
+ return "", hexFormatError(runtimeID, arg.Type().TypeName())
+ }
+ }
+}
+
+func (c *stringFormatter) Octal(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt := arg.Value().(int64)
+ return fmt.Sprintf("%o", argInt), nil
+ case types.UintType:
+ argInt := arg.Value().(uint64)
+ return fmt.Sprintf("%o", argInt), nil
+ default:
+ return "", octalFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+// stringFormatValidator implements the cel.ASTValidator interface allowing for static validation
+// of string.format calls.
+type stringFormatValidator struct{}
+
+// Name returns the name of the validator.
+func (stringFormatValidator) Name() string {
+ return "cel.lib.ext.validate.functions.string.format"
+}
+
+// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip
+// during homogeneous aggregate literal type-checks.
+func (stringFormatValidator) Configure(config cel.MutableValidatorConfig) error {
+ functions := config.GetOrDefault(cel.HomogeneousAggregateLiteralExemptFunctions, []string{}).([]string)
+ functions = append(functions, "format")
+ return config.Set(cel.HomogeneousAggregateLiteralExemptFunctions, functions)
+}
+
+// Validate parses all literal format strings and type checks the format clause against the argument
+// at the corresponding ordinal within the list literal argument to the function, if one is specified.
+func (stringFormatValidator) Validate(env *cel.Env, _ cel.ValidatorConfig, a *ast.AST, iss *cel.Issues) {
+ root := ast.NavigateAST(a)
+ formatCallExprs := ast.MatchDescendants(root, matchConstantFormatStringWithListLiteralArgs(a))
+ for _, e := range formatCallExprs {
+ call := e.AsCall()
+ formatStr := call.Target().AsLiteral().Value().(string)
+ args := call.Args()[0].AsList().Elements()
+ formatCheck := &stringFormatChecker{
+ args: args,
+ ast: a,
+ }
+ // use a placeholder locale, since locale doesn't affect syntax
+ _, err := parseFormatString(formatStr, formatCheck, formatCheck, "en_US")
+ if err != nil {
+ iss.ReportErrorAtID(getErrorExprID(e.ID(), err), err.Error())
+ continue
+ }
+ seenArgs := formatCheck.argsRequested
+ if len(args) > seenArgs {
+ iss.ReportErrorAtID(e.ID(),
+ "too many arguments supplied to string.format (expected %d, got %d)", seenArgs, len(args))
+ }
+ }
+}
+
+// getErrorExprID determines which list literal argument triggered a type-disagreement for the
+// purposes of more accurate error message reports.
+func getErrorExprID(id int64, err error) int64 {
+ fmtErr, ok := err.(formatError)
+ if ok {
+ return fmtErr.id
+ }
+ wrapped := errors.Unwrap(err)
+ if wrapped != nil {
+ return getErrorExprID(id, wrapped)
+ }
+ return id
+}
+
+// matchConstantFormatStringWithListLiteralArgs matches all valid expression nodes for string
+// format checking.
+func matchConstantFormatStringWithListLiteralArgs(a *ast.AST) ast.ExprMatcher {
+ return func(e ast.NavigableExpr) bool {
+ if e.Kind() != ast.CallKind {
+ return false
+ }
+ call := e.AsCall()
+ if !call.IsMemberFunction() || call.FunctionName() != "format" {
+ return false
+ }
+ overloadIDs := a.GetOverloadIDs(e.ID())
+ if len(overloadIDs) != 0 {
+ found := false
+ for _, overload := range overloadIDs {
+ if overload == overloads.ExtFormatString {
+ found = true
+ break
+ }
+ }
+ if !found {
+ return false
+ }
+ }
+ formatString := call.Target()
+ if formatString.Kind() != ast.LiteralKind && formatString.AsLiteral().Type() != cel.StringType {
+ return false
+ }
+ args := call.Args()
+ if len(args) != 1 {
+ return false
+ }
+ formatArgs := args[0]
+ return formatArgs.Kind() == ast.ListKind
+ }
+}
+
+// stringFormatChecker implements the formatStringInterpolater interface
+type stringFormatChecker struct {
+ args []ast.Expr
+ argsRequested int
+ currArgIndex int64
+ ast *ast.AST
+}
+
+func (c *stringFormatChecker) String(arg ref.Val, locale string) (string, error) {
+ formatArg := c.args[c.currArgIndex]
+ valid, badID := c.verifyString(formatArg)
+ if !valid {
+ return "", stringFormatError(badID, c.typeOf(badID).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Decimal(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
+ if !valid {
+ return "", decimalFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ // we allow StringType since "NaN", "Infinity", and "-Infinity" are also valid values
+ valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType)
+ if !valid {
+ return "", fixedPointFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType)
+ if !valid {
+ return "", scientificFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.BoolType)
+ if !valid {
+ return "", binaryFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType)
+ if !valid {
+ return "", hexFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
+ if !valid {
+ return "", octalFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Arg(index int64) (ref.Val, error) {
+ c.argsRequested++
+ c.currArgIndex = index
+ // return a dummy value - this is immediately passed to back to us
+ // through one of the FormatCallback functions, so anything will do
+ return types.Int(0), nil
+}
+
+func (c *stringFormatChecker) Size() int64 {
+ return int64(len(c.args))
+}
+
+func (c *stringFormatChecker) typeOf(id int64) *cel.Type {
+ return c.ast.GetType(id)
+}
+
+func (c *stringFormatChecker) verifyTypeOneOf(id int64, validTypes ...*cel.Type) bool {
+ t := c.typeOf(id)
+ if t == cel.DynType {
+ return true
+ }
+ for _, vt := range validTypes {
+ // Only check runtime type compatibility without delving deeper into parameterized types
+ if t.Kind() == vt.Kind() {
+ return true
+ }
+ }
+ return false
+}
+
+func (c *stringFormatChecker) verifyString(sub ast.Expr) (bool, int64) {
+ paramA := cel.TypeParamType("A")
+ paramB := cel.TypeParamType("B")
+ subVerified := c.verifyTypeOneOf(sub.ID(),
+ cel.ListType(paramA), cel.MapType(paramA, paramB),
+ cel.IntType, cel.UintType, cel.DoubleType, cel.BoolType, cel.StringType,
+ cel.TimestampType, cel.BytesType, cel.DurationType, cel.TypeType, cel.NullType)
+ if !subVerified {
+ return false, sub.ID()
+ }
+ switch sub.Kind() {
+ case ast.ListKind:
+ for _, e := range sub.AsList().Elements() {
+ // recursively verify if we're dealing with a list/map
+ verified, id := c.verifyString(e)
+ if !verified {
+ return false, id
+ }
+ }
+ return true, sub.ID()
+ case ast.MapKind:
+ for _, e := range sub.AsMap().Entries() {
+ // recursively verify if we're dealing with a list/map
+ entry := e.AsMapEntry()
+ verified, id := c.verifyString(entry.Key())
+ if !verified {
+ return false, id
+ }
+ verified, id = c.verifyString(entry.Value())
+ if !verified {
+ return false, id
+ }
+ }
+ return true, sub.ID()
+ default:
+ return true, sub.ID()
+ }
+}
+
+// helper routines for reporting common errors during string formatting static validation and
+// runtime execution.
+
+func binaryFormatError(id int64, badType string) error {
+ return newFormatError(id, "only integers and bools can be formatted as binary, was given %s", badType)
+}
+
+func decimalFormatError(id int64, badType string) error {
+ return newFormatError(id, "decimal clause can only be used on integers, was given %s", badType)
+}
+
+func fixedPointFormatError(id int64, badType string) error {
+ return newFormatError(id, "fixed-point clause can only be used on doubles, was given %s", badType)
+}
+
+func hexFormatError(id int64, badType string) error {
+ return newFormatError(id, "only integers, byte buffers, and strings can be formatted as hex, was given %s", badType)
+}
+
+func octalFormatError(id int64, badType string) error {
+ return newFormatError(id, "octal clause can only be used on integers, was given %s", badType)
+}
+
+func scientificFormatError(id int64, badType string) error {
+ return newFormatError(id, "scientific clause can only be used on doubles, was given %s", badType)
+}
+
+func stringFormatError(id int64, badType string) error {
+ return newFormatError(id, "string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps, was given %s", badType)
+}
+
+type formatError struct {
+ id int64
+ msg string
+}
+
+func newFormatError(id int64, msg string, args ...any) error {
+ return formatError{
+ id: id,
+ msg: fmt.Sprintf(msg, args...),
+ }
+}
+
+func (e formatError) Error() string {
+ return e.msg
+}
+
+func (e formatError) Is(target error) bool {
+ return e.msg == target.Error()
+}
+
+// stringArgList implements the formatListArgs interface.
+type stringArgList struct {
+ args traits.Lister
+}
+
+func (c *stringArgList) Arg(index int64) (ref.Val, error) {
+ if index >= c.args.Size().Value().(int64) {
+ return nil, fmt.Errorf("index %d out of range", index)
+ }
+ return c.args.Get(types.Int(index)), nil
+}
+
+func (c *stringArgList) Size() int64 {
+ return c.args.Size().Value().(int64)
+}
+
+// formatStringInterpolator is an interface that allows user-defined behavior
+// for formatting clause implementations, as well as argument retrieval.
+// Each function is expected to support the appropriate types as laid out in
+// the string.format documentation, and to return an error if given an inappropriate type.
+type formatStringInterpolator interface {
+ // String takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a string, or an error if one occurred.
+ String(ref.Val, string) (string, error)
+
+ // Decimal takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a decimal integer, or an error if one occurred.
+ Decimal(ref.Val, string) (string, error)
+
+ // Fixed takes an int pointer representing precision (or nil if none was given) and
+ // returns a function operating in a similar manner to String and Decimal, taking a
+ // ref.Val and locale and returning the appropriate string. A closure is returned
+ // so precision can be set without needing an additional function call/configuration.
+ Fixed(*int) func(ref.Val, string) (string, error)
+
+ // Scientific functions identically to Fixed, except the string returned from the closure
+ // is expected to be in scientific notation.
+ Scientific(*int) func(ref.Val, string) (string, error)
+
+ // Binary takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a binary integer, or an error if one occurred.
+ Binary(ref.Val, string) (string, error)
+
+ // Hex takes a boolean that, if true, indicates the hex string output by the returned
+ // closure should use uppercase letters for A-F.
+ Hex(bool) func(ref.Val, string) (string, error)
+
+ // Octal takes a ref.Val and a string representing the current locale identifier and
+ // returns the Val formatted in octal, or an error if one occurred.
+ Octal(ref.Val, string) (string, error)
+}
+
+// formatListArgs is an interface that allows user-defined list-like datatypes to be used
+// for formatting clause implementations.
+type formatListArgs interface {
+ // Arg returns the ref.Val at the given index, or an error if one occurred.
+ Arg(int64) (ref.Val, error)
+
+ // Size returns the length of the argument list.
+ Size() int64
+}
+
+// parseFormatString formats a string according to the string.format syntax, taking the clause implementations
+// from the provided FormatCallback and the args from the given FormatList.
+func parseFormatString(formatStr string, callback formatStringInterpolator, list formatListArgs, locale string) (string, error) {
+ i := 0
+ argIndex := 0
+ var builtStr strings.Builder
+ for i < len(formatStr) {
+ if formatStr[i] == '%' {
+ if i+1 < len(formatStr) && formatStr[i+1] == '%' {
+ err := builtStr.WriteByte('%')
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i += 2
+ continue
+ } else {
+ argAny, err := list.Arg(int64(argIndex))
+ if err != nil {
+ return "", err
+ }
+ if i+1 >= len(formatStr) {
+ return "", errors.New("unexpected end of string")
+ }
+ if int64(argIndex) >= list.Size() {
+ return "", fmt.Errorf("index %d out of range", argIndex)
+ }
+ numRead, val, refErr := parseAndFormatClause(formatStr[i:], argAny, callback, list, locale)
+ if refErr != nil {
+ return "", refErr
+ }
+ _, err = builtStr.WriteString(val)
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i += numRead
+ argIndex++
+ }
+ } else {
+ err := builtStr.WriteByte(formatStr[i])
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i++
+ }
+ }
+ return builtStr.String(), nil
+}
+
+// parseAndFormatClause parses the format clause at the start of the given string with val, and returns
+// how many characters were consumed and the substituted string form of val, or an error if one occurred.
+func parseAndFormatClause(formatStr string, val ref.Val, callback formatStringInterpolator, list formatListArgs, locale string) (int, string, error) {
+ i := 1
+ read, formatter, err := parseFormattingClause(formatStr[i:], callback)
+ i += read
+ if err != nil {
+ return -1, "", newParseFormatError("could not parse formatting clause", err)
+ }
+
+ valStr, err := formatter(val, locale)
+ if err != nil {
+ return -1, "", newParseFormatError("error during formatting", err)
+ }
+ return i, valStr, nil
+}
+
+func parseFormattingClause(formatStr string, callback formatStringInterpolator) (int, clauseImpl, error) {
+ i := 0
+ read, precision, err := parsePrecision(formatStr[i:])
+ i += read
+ if err != nil {
+ return -1, nil, fmt.Errorf("error while parsing precision: %w", err)
+ }
+ r := rune(formatStr[i])
+ i++
+ switch r {
+ case 's':
+ return i, callback.String, nil
+ case 'd':
+ return i, callback.Decimal, nil
+ case 'f':
+ return i, callback.Fixed(precision), nil
+ case 'e':
+ return i, callback.Scientific(precision), nil
+ case 'b':
+ return i, callback.Binary, nil
+ case 'x', 'X':
+ return i, callback.Hex(unicode.IsUpper(r)), nil
+ case 'o':
+ return i, callback.Octal, nil
+ default:
+ return -1, nil, fmt.Errorf("unrecognized formatting clause \"%c\"", r)
+ }
+}
+
+func parsePrecision(formatStr string) (int, *int, error) {
+ i := 0
+ if formatStr[i] != '.' {
+ return i, nil, nil
+ }
+ i++
+ var buffer strings.Builder
+ for {
+ if i >= len(formatStr) {
+ return -1, nil, errors.New("could not find end of precision specifier")
+ }
+ if !isASCIIDigit(rune(formatStr[i])) {
+ break
+ }
+ buffer.WriteByte(formatStr[i])
+ i++
+ }
+ precision, err := strconv.Atoi(buffer.String())
+ if err != nil {
+ return -1, nil, fmt.Errorf("error while converting precision to integer: %w", err)
+ }
+ return i, &precision, nil
+}
+
+func isASCIIDigit(r rune) bool {
+ return r <= unicode.MaxASCII && unicode.IsDigit(r)
+}
+
+type parseFormatError struct {
+ msg string
+ wrapped error
+}
+
+func newParseFormatError(msg string, wrapped error) error {
+ return parseFormatError{msg: msg, wrapped: wrapped}
+}
+
+func (e parseFormatError) Error() string {
+ return fmt.Sprintf("%s: %s", e.msg, e.wrapped.Error())
+}
+
+func (e parseFormatError) Is(target error) bool {
+ return e.Error() == target.Error()
+}
+
+func (e parseFormatError) Unwrap() error {
+ return e.wrapped
+}
+
+const (
+ runtimeID = int64(-1)
+)
diff --git a/vendor/github.com/google/cel-go/ext/guards.go b/vendor/github.com/google/cel-go/ext/guards.go
index 785c8675bbf..2c00bfe3a87 100644
--- a/vendor/github.com/google/cel-go/ext/guards.go
+++ b/vendor/github.com/google/cel-go/ext/guards.go
@@ -15,10 +15,9 @@
package ext
import (
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// function invocation guards for common call signatures within extension functions.
@@ -51,10 +50,10 @@ func listStringOrError(strs []string, err error) ref.Val {
return types.DefaultTypeAdapter.NativeToValue(strs)
}
-func macroTargetMatchesNamespace(ns string, target *exprpb.Expr) bool {
- switch target.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- if target.GetIdentExpr().GetName() != ns {
+func macroTargetMatchesNamespace(ns string, target ast.Expr) bool {
+ switch target.Kind() {
+ case ast.IdentKind:
+ if target.AsIdent() != ns {
return false
}
return true
diff --git a/vendor/github.com/google/cel-go/ext/math.go b/vendor/github.com/google/cel-go/ext/math.go
index 0b9a3610314..65d7e2eb076 100644
--- a/vendor/github.com/google/cel-go/ext/math.go
+++ b/vendor/github.com/google/cel-go/ext/math.go
@@ -19,11 +19,10 @@ import (
"strings"
"github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// Math returns a cel.EnvOption to configure namespaced math helper macros and
@@ -111,9 +110,9 @@ func (mathLib) CompileOptions() []cel.EnvOption {
return []cel.EnvOption{
cel.Macros(
// math.least(num, ...)
- cel.NewReceiverVarArgMacro(leastMacro, mathLeast),
+ cel.ReceiverVarArgMacro(leastMacro, mathLeast),
// math.greatest(num, ...)
- cel.NewReceiverVarArgMacro(greatestMacro, mathGreatest),
+ cel.ReceiverVarArgMacro(greatestMacro, mathGreatest),
),
cel.Function(minFunc,
cel.Overload("math_@min_double", []*cel.Type{cel.DoubleType}, cel.DoubleType,
@@ -187,57 +186,57 @@ func (mathLib) ProgramOptions() []cel.ProgramOption {
return []cel.ProgramOption{}
}
-func mathLeast(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func mathLeast(meh cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(mathNamespace, target) {
return nil, nil
}
switch len(args) {
case 0:
- return nil, meh.NewError(target.GetId(), "math.least() requires at least one argument")
+ return nil, meh.NewError(target.ID(), "math.least() requires at least one argument")
case 1:
if isListLiteralWithValidArgs(args[0]) || isValidArgType(args[0]) {
- return meh.GlobalCall(minFunc, args[0]), nil
+ return meh.NewCall(minFunc, args[0]), nil
}
- return nil, meh.NewError(args[0].GetId(), "math.least() invalid single argument value")
+ return nil, meh.NewError(args[0].ID(), "math.least() invalid single argument value")
case 2:
err := checkInvalidArgs(meh, "math.least()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(minFunc, args...), nil
+ return meh.NewCall(minFunc, args...), nil
default:
err := checkInvalidArgs(meh, "math.least()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(minFunc, meh.NewList(args...)), nil
+ return meh.NewCall(minFunc, meh.NewList(args...)), nil
}
}
-func mathGreatest(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func mathGreatest(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(mathNamespace, target) {
return nil, nil
}
switch len(args) {
case 0:
- return nil, meh.NewError(target.GetId(), "math.greatest() requires at least one argument")
+ return nil, mef.NewError(target.ID(), "math.greatest() requires at least one argument")
case 1:
if isListLiteralWithValidArgs(args[0]) || isValidArgType(args[0]) {
- return meh.GlobalCall(maxFunc, args[0]), nil
+ return mef.NewCall(maxFunc, args[0]), nil
}
- return nil, meh.NewError(args[0].GetId(), "math.greatest() invalid single argument value")
+ return nil, mef.NewError(args[0].ID(), "math.greatest() invalid single argument value")
case 2:
- err := checkInvalidArgs(meh, "math.greatest()", args)
+ err := checkInvalidArgs(mef, "math.greatest()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(maxFunc, args...), nil
+ return mef.NewCall(maxFunc, args...), nil
default:
- err := checkInvalidArgs(meh, "math.greatest()", args)
+ err := checkInvalidArgs(mef, "math.greatest()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(maxFunc, meh.NewList(args...)), nil
+ return mef.NewCall(maxFunc, mef.NewList(args...)), nil
}
}
@@ -311,48 +310,48 @@ func maxList(numList ref.Val) ref.Val {
}
}
-func checkInvalidArgs(meh cel.MacroExprHelper, funcName string, args []*exprpb.Expr) *cel.Error {
+func checkInvalidArgs(meh cel.MacroExprFactory, funcName string, args []ast.Expr) *cel.Error {
for _, arg := range args {
err := checkInvalidArgLiteral(funcName, arg)
if err != nil {
- return meh.NewError(arg.GetId(), err.Error())
+ return meh.NewError(arg.ID(), err.Error())
}
}
return nil
}
-func checkInvalidArgLiteral(funcName string, arg *exprpb.Expr) error {
+func checkInvalidArgLiteral(funcName string, arg ast.Expr) error {
if !isValidArgType(arg) {
return fmt.Errorf("%s simple literal arguments must be numeric", funcName)
}
return nil
}
-func isValidArgType(arg *exprpb.Expr) bool {
- switch arg.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- c := arg.GetConstExpr()
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_DoubleValue, *exprpb.Constant_Int64Value, *exprpb.Constant_Uint64Value:
+func isValidArgType(arg ast.Expr) bool {
+ switch arg.Kind() {
+ case ast.LiteralKind:
+ c := ref.Val(arg.AsLiteral())
+ switch c.(type) {
+ case types.Double, types.Int, types.Uint:
return true
default:
return false
}
- case *exprpb.Expr_ListExpr, *exprpb.Expr_StructExpr:
+ case ast.ListKind, ast.MapKind, ast.StructKind:
return false
default:
return true
}
}
-func isListLiteralWithValidArgs(arg *exprpb.Expr) bool {
- switch arg.GetExprKind().(type) {
- case *exprpb.Expr_ListExpr:
- list := arg.GetListExpr()
- if len(list.GetElements()) == 0 {
+func isListLiteralWithValidArgs(arg ast.Expr) bool {
+ switch arg.Kind() {
+ case ast.ListKind:
+ list := arg.AsList()
+ if list.Size() == 0 {
return false
}
- for _, e := range list.GetElements() {
+ for _, e := range list.Elements() {
if !isValidArgType(e) {
return false
}
diff --git a/vendor/github.com/google/cel-go/ext/native.go b/vendor/github.com/google/cel-go/ext/native.go
index 0b5fc38ca97..d1b7877758c 100644
--- a/vendor/github.com/google/cel-go/ext/native.go
+++ b/vendor/github.com/google/cel-go/ext/native.go
@@ -96,17 +96,21 @@ func newNativeTypeProvider(adapter types.Adapter, provider types.Provider, refTy
for _, refType := range refTypes {
switch rt := refType.(type) {
case reflect.Type:
- t, err := newNativeType(rt)
+ result, err := newNativeTypes(rt)
if err != nil {
return nil, err
}
- nativeTypes[t.TypeName()] = t
+ for idx := range result {
+ nativeTypes[result[idx].TypeName()] = result[idx]
+ }
case reflect.Value:
- t, err := newNativeType(rt.Type())
+ result, err := newNativeTypes(rt.Type())
if err != nil {
return nil, err
}
- nativeTypes[t.TypeName()] = t
+ for idx := range result {
+ nativeTypes[result[idx].TypeName()] = result[idx]
+ }
default:
return nil, fmt.Errorf("unsupported native type: %v (%T) must be reflect.Type or reflect.Value", rt, rt)
}
@@ -151,6 +155,24 @@ func (tp *nativeTypeProvider) FindStructType(typeName string) (*types.Type, bool
return tp.baseProvider.FindStructType(typeName)
}
+// FindStructFieldNames looks up the type definition first from the native types, then from
+// the backing provider type set. If found, a set of field names corresponding to the type
+// will be returned.
+func (tp *nativeTypeProvider) FindStructFieldNames(typeName string) ([]string, bool) {
+ if t, found := tp.nativeTypes[typeName]; found {
+ fieldCount := t.refType.NumField()
+ fields := make([]string, fieldCount)
+ for i := 0; i < fieldCount; i++ {
+ fields[i] = t.refType.Field(i).Name
+ }
+ return fields, true
+ }
+ if celTypeFields, found := tp.baseProvider.FindStructFieldNames(typeName); found {
+ return celTypeFields, true
+ }
+ return tp.baseProvider.FindStructFieldNames(typeName)
+}
+
// FindStructFieldType looks up a native type's field definition, and if the type name is not a native
// type then proxies to the composed types.Provider
func (tp *nativeTypeProvider) FindStructFieldType(typeName, fieldName string) (*types.FieldType, bool) {
@@ -447,6 +469,42 @@ func (o *nativeObj) Value() any {
return o.val
}
+func newNativeTypes(rawType reflect.Type) ([]*nativeType, error) {
+ nt, err := newNativeType(rawType)
+ if err != nil {
+ return nil, err
+ }
+ result := []*nativeType{nt}
+
+ alreadySeen := make(map[string]struct{})
+ var iterateStructMembers func(reflect.Type)
+ iterateStructMembers = func(t reflect.Type) {
+ if k := t.Kind(); k == reflect.Pointer || k == reflect.Slice || k == reflect.Array || k == reflect.Map {
+ t = t.Elem()
+ }
+ if t.Kind() != reflect.Struct {
+ return
+ }
+ if _, seen := alreadySeen[t.String()]; seen {
+ return
+ }
+ alreadySeen[t.String()] = struct{}{}
+ nt, ntErr := newNativeType(t)
+ if ntErr != nil {
+ err = ntErr
+ return
+ }
+ result = append(result, nt)
+
+ for idx := 0; idx < t.NumField(); idx++ {
+ iterateStructMembers(t.Field(idx).Type)
+ }
+ }
+ iterateStructMembers(rawType)
+
+ return result, err
+}
+
func newNativeType(rawType reflect.Type) (*nativeType, error) {
refType := rawType
if refType.Kind() == reflect.Pointer {
diff --git a/vendor/github.com/google/cel-go/ext/protos.go b/vendor/github.com/google/cel-go/ext/protos.go
index a7ca27a6a27..68796f60ada 100644
--- a/vendor/github.com/google/cel-go/ext/protos.go
+++ b/vendor/github.com/google/cel-go/ext/protos.go
@@ -16,8 +16,7 @@ package ext
import (
"github.com/google/cel-go/cel"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
)
// Protos returns a cel.EnvOption to configure extended macros and functions for
@@ -72,9 +71,9 @@ func (protoLib) CompileOptions() []cel.EnvOption {
return []cel.EnvOption{
cel.Macros(
// proto.getExt(msg, select_expression)
- cel.NewReceiverMacro(getExtension, 2, getProtoExt),
+ cel.ReceiverMacro(getExtension, 2, getProtoExt),
// proto.hasExt(msg, select_expression)
- cel.NewReceiverMacro(hasExtension, 2, hasProtoExt),
+ cel.ReceiverMacro(hasExtension, 2, hasProtoExt),
),
}
}
@@ -85,56 +84,56 @@ func (protoLib) ProgramOptions() []cel.ProgramOption {
}
// hasProtoExt generates a test-only select expression for a fully-qualified extension name on a protobuf message.
-func hasProtoExt(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func hasProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(protoNamespace, target) {
return nil, nil
}
- extensionField, err := getExtFieldName(meh, args[1])
+ extensionField, err := getExtFieldName(mef, args[1])
if err != nil {
return nil, err
}
- return meh.PresenceTest(args[0], extensionField), nil
+ return mef.NewPresenceTest(args[0], extensionField), nil
}
// getProtoExt generates a select expression for a fully-qualified extension name on a protobuf message.
-func getProtoExt(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func getProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(protoNamespace, target) {
return nil, nil
}
- extFieldName, err := getExtFieldName(meh, args[1])
+ extFieldName, err := getExtFieldName(mef, args[1])
if err != nil {
return nil, err
}
- return meh.Select(args[0], extFieldName), nil
+ return mef.NewSelect(args[0], extFieldName), nil
}
-func getExtFieldName(meh cel.MacroExprHelper, expr *exprpb.Expr) (string, *cel.Error) {
+func getExtFieldName(mef cel.MacroExprFactory, expr ast.Expr) (string, *cel.Error) {
isValid := false
extensionField := ""
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_SelectExpr:
+ switch expr.Kind() {
+ case ast.SelectKind:
extensionField, isValid = validateIdentifier(expr)
}
if !isValid {
- return "", meh.NewError(expr.GetId(), "invalid extension field")
+ return "", mef.NewError(expr.ID(), "invalid extension field")
}
return extensionField, nil
}
-func validateIdentifier(expr *exprpb.Expr) (string, bool) {
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- return expr.GetIdentExpr().GetName(), true
- case *exprpb.Expr_SelectExpr:
- sel := expr.GetSelectExpr()
- if sel.GetTestOnly() {
+func validateIdentifier(expr ast.Expr) (string, bool) {
+ switch expr.Kind() {
+ case ast.IdentKind:
+ return expr.AsIdent(), true
+ case ast.SelectKind:
+ sel := expr.AsSelect()
+ if sel.IsTestOnly() {
return "", false
}
- opStr, isIdent := validateIdentifier(sel.GetOperand())
+ opStr, isIdent := validateIdentifier(sel.Operand())
if !isIdent {
return "", false
}
- return opStr + "." + sel.GetField(), true
+ return opStr + "." + sel.FieldName(), true
default:
return "", false
}
diff --git a/vendor/github.com/google/cel-go/ext/sets.go b/vendor/github.com/google/cel-go/ext/sets.go
index 833c15f616f..7e941665521 100644
--- a/vendor/github.com/google/cel-go/ext/sets.go
+++ b/vendor/github.com/google/cel-go/ext/sets.go
@@ -19,6 +19,8 @@ import (
"github.com/google/cel-go/cel"
"github.com/google/cel-go/checker"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
@@ -119,6 +121,68 @@ func (setsLib) ProgramOptions() []cel.ProgramOption {
}
}
+// NewSetMembershipOptimizer rewrites set membership tests using the `in` operator against a list
+// of constant values of enum, int, uint, string, or boolean type into a set membership test against
+// a map where the map keys are the elements of the list.
+func NewSetMembershipOptimizer() (cel.ASTOptimizer, error) {
+ return setsLib{}, nil
+}
+
+func (setsLib) Optimize(ctx *cel.OptimizerContext, a *ast.AST) *ast.AST {
+ root := ast.NavigateAST(a)
+ matches := ast.MatchDescendants(root, matchInConstantList(a))
+ for _, match := range matches {
+ call := match.AsCall()
+ listArg := call.Args()[1]
+ entries := make([]ast.EntryExpr, len(listArg.AsList().Elements()))
+ for i, elem := range listArg.AsList().Elements() {
+ var entry ast.EntryExpr
+ if r, found := a.ReferenceMap()[elem.ID()]; found && r.Value != nil {
+ entry = ctx.NewMapEntry(ctx.NewLiteral(r.Value), ctx.NewLiteral(types.True), false)
+ } else {
+ entry = ctx.NewMapEntry(elem, ctx.NewLiteral(types.True), false)
+ }
+ entries[i] = entry
+ }
+ mapArg := ctx.NewMap(entries)
+ ctx.UpdateExpr(listArg, mapArg)
+ }
+ return a
+}
+
+func matchInConstantList(a *ast.AST) ast.ExprMatcher {
+ return func(e ast.NavigableExpr) bool {
+ if e.Kind() != ast.CallKind {
+ return false
+ }
+ call := e.AsCall()
+ if call.FunctionName() != operators.In {
+ return false
+ }
+ aggregateVal := call.Args()[1]
+ if aggregateVal.Kind() != ast.ListKind {
+ return false
+ }
+ listVal := aggregateVal.AsList()
+ for _, elem := range listVal.Elements() {
+ if r, found := a.ReferenceMap()[elem.ID()]; found {
+ if r.Value != nil {
+ continue
+ }
+ }
+ if elem.Kind() != ast.LiteralKind {
+ return false
+ }
+ lit := elem.AsLiteral()
+ if !(lit.Type() == cel.StringType || lit.Type() == cel.IntType ||
+ lit.Type() == cel.UintType || lit.Type() == cel.BoolType) {
+ return false
+ }
+ }
+ return true
+ }
+}
+
func setsIntersects(listA, listB ref.Val) ref.Val {
lA := listA.(traits.Lister)
lB := listB.(traits.Lister)
diff --git a/vendor/github.com/google/cel-go/ext/strings.go b/vendor/github.com/google/cel-go/ext/strings.go
index 88c119f2b0b..2e20f1e4c42 100644
--- a/vendor/github.com/google/cel-go/ext/strings.go
+++ b/vendor/github.com/google/cel-go/ext/strings.go
@@ -21,19 +21,16 @@ import (
"fmt"
"math"
"reflect"
- "sort"
"strings"
"unicode"
"unicode/utf8"
"golang.org/x/text/language"
- "golang.org/x/text/message"
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
- "github.com/google/cel-go/interpreter"
)
const (
@@ -99,7 +96,7 @@ const (
// "a map inside a list: %s".format([[1, 2, 3, {"a": "x", "b": "y", "c": "z"}]]) // returns "a map inside a list: [1, 2, 3, {"a":"x", "b":"y", "c":"d"}]"
// "true bool: %s - false bool: %s\nbinary bool: %b".format([true, false, true]) // returns "true bool: true - false bool: false\nbinary bool: 1"
//
-// Passing an incorrect type (an integer to `%s`) is considered an error, as well as attempting
+// Passing an incorrect type (a string to `%b`) is considered an error, as well as attempting
// to use more formatting clauses than there are arguments (`%d %d %d` while passing two ints, for instance).
// If compile-time checking is enabled, and the formatting string is a constant, and the argument list is a literal,
// then letting any arguments go unused/unformatted is also considered an error.
@@ -205,6 +202,8 @@ const (
// 'hello hello'.replace('he', 'we', -1) // returns 'wello wello'
// 'hello hello'.replace('he', 'we', 1) // returns 'wello hello'
// 'hello hello'.replace('he', 'we', 0) // returns 'hello hello'
+// 'hello hello'.replace('', '_') // returns '_h_e_l_l_o_ _h_e_l_l_o_'
+// 'hello hello'.replace('h', '') // returns 'ello ello'
//
// # Split
//
@@ -270,8 +269,26 @@ const (
//
// 'TacoCat'.upperAscii() // returns 'TACOCAT'
// 'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII'
+//
+// # Reverse
+//
+// Introduced at version: 3
+//
+// Returns a new string whose characters are the same as the target string, only formatted in
+// reverse order.
+// This function relies on converting strings to rune arrays in order to reverse
+//
+// .reverse() ->
+//
+// Examples:
+//
+// 'gums'.reverse() // returns 'smug'
+// 'John Smith'.reverse() // returns 'htimS nhoJ'
func Strings(options ...StringsOption) cel.EnvOption {
- s := &stringLib{version: math.MaxUint32}
+ s := &stringLib{
+ version: math.MaxUint32,
+ validateFormat: true,
+ }
for _, o := range options {
s = o(s)
}
@@ -279,8 +296,9 @@ func Strings(options ...StringsOption) cel.EnvOption {
}
type stringLib struct {
- locale string
- version uint32
+ locale string
+ version uint32
+ validateFormat bool
}
// LibraryName implements the SingletonLibrary interface method.
@@ -317,6 +335,17 @@ func StringsVersion(version uint32) StringsOption {
}
}
+// StringsValidateFormatCalls validates type-checked ASTs to ensure that string.format() calls have
+// valid formatting clauses and valid argument types for each clause.
+//
+// Enabled by default.
+func StringsValidateFormatCalls(value bool) StringsOption {
+ return func(s *stringLib) *stringLib {
+ s.validateFormat = value
+ return s
+ }
+}
+
// CompileOptions implements the Library interface method.
func (lib *stringLib) CompileOptions() []cel.EnvOption {
formatLocale := "en_US"
@@ -440,13 +469,15 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
cel.FunctionBinding(func(args ...ref.Val) ref.Val {
s := string(args[0].(types.String))
formatArgs := args[1].(traits.Lister)
- return stringOrError(interpreter.ParseFormatString(s, &stringFormatter{}, &stringArgList{formatArgs}, formatLocale))
+ return stringOrError(parseFormatString(s, &stringFormatter{}, &stringArgList{formatArgs}, formatLocale))
}))),
cel.Function("strings.quote", cel.Overload("strings_quote", []*cel.Type{cel.StringType}, cel.StringType,
cel.UnaryBinding(func(str ref.Val) ref.Val {
s := str.(types.String)
return stringOrError(quote(string(s)))
- }))))
+ }))),
+
+ cel.ASTValidators(stringFormatValidator{}))
}
if lib.version >= 2 {
@@ -471,7 +502,7 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
cel.UnaryBinding(func(list ref.Val) ref.Val {
l, err := list.ConvertToNative(stringListType)
if err != nil {
- return types.NewErr(err.Error())
+ return types.WrapErr(err)
}
return stringOrError(join(l.([]string)))
})),
@@ -479,13 +510,26 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
cel.BinaryBinding(func(list, delim ref.Val) ref.Val {
l, err := list.ConvertToNative(stringListType)
if err != nil {
- return types.NewErr(err.Error())
+ return types.WrapErr(err)
}
d := delim.(types.String)
return stringOrError(joinSeparator(l.([]string), string(d)))
}))),
)
}
+ if lib.version >= 3 {
+ opts = append(opts,
+ cel.Function("reverse",
+ cel.MemberOverload("reverse", []*cel.Type{cel.StringType}, cel.StringType,
+ cel.UnaryBinding(func(str ref.Val) ref.Val {
+ s := str.(types.String)
+ return stringOrError(reverse(string(s)))
+ }))),
+ )
+ }
+ if lib.validateFormat {
+ opts = append(opts, cel.ASTValidators(stringFormatValidator{}))
+ }
return opts
}
@@ -636,6 +680,14 @@ func upperASCII(str string) (string, error) {
return string(runes), nil
}
+func reverse(str string) (string, error) {
+ chars := []rune(str)
+ for i, j := 0, len(chars)-1; i < j; i, j = i+1, j-1 {
+ chars[i], chars[j] = chars[j], chars[i]
+ }
+ return string(chars), nil
+}
+
func joinSeparator(strs []string, separator string) (string, error) {
return strings.Join(strs, separator), nil
}
@@ -661,238 +713,6 @@ func joinValSeparator(strs traits.Lister, separator string) (string, error) {
return sb.String(), nil
}
-type clauseImpl func(ref.Val, string) (string, error)
-
-func clauseForType(argType ref.Type) (clauseImpl, error) {
- switch argType {
- case types.IntType, types.UintType:
- return formatDecimal, nil
- case types.StringType, types.BytesType, types.BoolType, types.NullType, types.TypeType:
- return FormatString, nil
- case types.TimestampType, types.DurationType:
- // special case to ensure timestamps/durations get printed as CEL literals
- return func(arg ref.Val, locale string) (string, error) {
- argStrVal := arg.ConvertToType(types.StringType)
- argStr := argStrVal.Value().(string)
- if arg.Type() == types.TimestampType {
- return fmt.Sprintf("timestamp(%q)", argStr), nil
- }
- if arg.Type() == types.DurationType {
- return fmt.Sprintf("duration(%q)", argStr), nil
- }
- return "", fmt.Errorf("cannot convert argument of type %s to timestamp/duration", arg.Type().TypeName())
- }, nil
- case types.ListType:
- return formatList, nil
- case types.MapType:
- return formatMap, nil
- case types.DoubleType:
- // avoid formatFixed so we can output a period as the decimal separator in order
- // to always be a valid CEL literal
- return func(arg ref.Val, locale string) (string, error) {
- argDouble, ok := arg.Value().(float64)
- if !ok {
- return "", fmt.Errorf("couldn't convert %s to float64", arg.Type().TypeName())
- }
- fmtStr := fmt.Sprintf("%%.%df", defaultPrecision)
- return fmt.Sprintf(fmtStr, argDouble), nil
- }, nil
- case types.TypeType:
- return func(arg ref.Val, locale string) (string, error) {
- return fmt.Sprintf("type(%s)", arg.Value().(string)), nil
- }, nil
- default:
- return nil, fmt.Errorf("no formatting function for %s", argType.TypeName())
- }
-}
-
-func formatList(arg ref.Val, locale string) (string, error) {
- argList := arg.(traits.Lister)
- argIterator := argList.Iterator()
- var listStrBuilder strings.Builder
- _, err := listStrBuilder.WriteRune('[')
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- for argIterator.HasNext() == types.True {
- member := argIterator.Next()
- memberFormat, err := clauseForType(member.Type())
- if err != nil {
- return "", err
- }
- unquotedStr, err := memberFormat(member, locale)
- if err != nil {
- return "", err
- }
- str := quoteForCEL(member, unquotedStr)
- _, err = listStrBuilder.WriteString(str)
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- if argIterator.HasNext() == types.True {
- _, err = listStrBuilder.WriteString(", ")
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- }
- }
- _, err = listStrBuilder.WriteRune(']')
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- return listStrBuilder.String(), nil
-}
-
-func formatMap(arg ref.Val, locale string) (string, error) {
- argMap := arg.(traits.Mapper)
- argIterator := argMap.Iterator()
- type mapPair struct {
- key string
- value string
- }
- argPairs := make([]mapPair, argMap.Size().Value().(int64))
- i := 0
- for argIterator.HasNext() == types.True {
- key := argIterator.Next()
- var keyFormat clauseImpl
- switch key.Type() {
- case types.StringType, types.BoolType:
- keyFormat = FormatString
- case types.IntType, types.UintType:
- keyFormat = formatDecimal
- default:
- return "", fmt.Errorf("no formatting function for map key of type %s", key.Type().TypeName())
- }
- unquotedKeyStr, err := keyFormat(key, locale)
- if err != nil {
- return "", err
- }
- keyStr := quoteForCEL(key, unquotedKeyStr)
- value, found := argMap.Find(key)
- if !found {
- return "", fmt.Errorf("could not find key: %q", key)
- }
- valueFormat, err := clauseForType(value.Type())
- if err != nil {
- return "", err
- }
- unquotedValueStr, err := valueFormat(value, locale)
- if err != nil {
- return "", err
- }
- valueStr := quoteForCEL(value, unquotedValueStr)
- argPairs[i] = mapPair{keyStr, valueStr}
- i++
- }
- sort.SliceStable(argPairs, func(x, y int) bool {
- return argPairs[x].key < argPairs[y].key
- })
- var mapStrBuilder strings.Builder
- _, err := mapStrBuilder.WriteRune('{')
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- for i, entry := range argPairs {
- _, err = mapStrBuilder.WriteString(fmt.Sprintf("%s:%s", entry.key, entry.value))
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- if i < len(argPairs)-1 {
- _, err = mapStrBuilder.WriteString(", ")
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- }
- }
- _, err = mapStrBuilder.WriteRune('}')
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- return mapStrBuilder.String(), nil
-}
-
-// quoteForCEL takes a formatted, unquoted value and quotes it in a manner
-// suitable for embedding directly in CEL.
-func quoteForCEL(refVal ref.Val, unquotedValue string) string {
- switch refVal.Type() {
- case types.StringType:
- return fmt.Sprintf("%q", unquotedValue)
- case types.BytesType:
- return fmt.Sprintf("b%q", unquotedValue)
- case types.DoubleType:
- // special case to handle infinity/NaN
- num := refVal.Value().(float64)
- if math.IsInf(num, 1) || math.IsInf(num, -1) || math.IsNaN(num) {
- return fmt.Sprintf("%q", unquotedValue)
- }
- return unquotedValue
- default:
- return unquotedValue
- }
-}
-
-// FormatString returns the string representation of a CEL value.
-// It is used to implement the %s specifier in the (string).format() extension
-// function.
-func FormatString(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.ListType:
- return formatList(arg, locale)
- case types.MapType:
- return formatMap(arg, locale)
- case types.IntType, types.UintType, types.DoubleType,
- types.BoolType, types.StringType, types.TimestampType, types.BytesType, types.DurationType, types.TypeType:
- argStrVal := arg.ConvertToType(types.StringType)
- argStr, ok := argStrVal.Value().(string)
- if !ok {
- return "", fmt.Errorf("could not convert argument %q to string", argStrVal)
- }
- return argStr, nil
- case types.NullType:
- return "null", nil
- default:
- return "", fmt.Errorf("string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps, was given %s", arg.Type().TypeName())
- }
-}
-
-func formatDecimal(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.IntType:
- argInt, ok := arg.ConvertToType(types.IntType).Value().(int64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
- }
- return fmt.Sprintf("%d", argInt), nil
- case types.UintType:
- argInt, ok := arg.ConvertToType(types.UintType).Value().(uint64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
- }
- return fmt.Sprintf("%d", argInt), nil
- default:
- return "", fmt.Errorf("decimal clause can only be used on integers, was given %s", arg.Type().TypeName())
- }
-}
-
-func matchLanguage(locale string) (language.Tag, error) {
- matcher, err := makeMatcher(locale)
- if err != nil {
- return language.Und, err
- }
- tag, _ := language.MatchStrings(matcher, locale)
- return tag, nil
-}
-
-func makeMatcher(locale string) (language.Matcher, error) {
- tags := make([]language.Tag, 0)
- tag, err := language.Parse(locale)
- if err != nil {
- return nil, err
- }
- tags = append(tags, tag)
- return language.NewMatcher(tags), nil
-}
-
// quote implements a string quoting function. The string will be wrapped in
// double quotes, and all valid CEL escape sequences will be escaped to show up
// literally if printed. If the input contains any invalid UTF-8, the invalid runes
@@ -940,156 +760,6 @@ func sanitize(s string) string {
return sanitizedStringBuilder.String()
}
-type stringFormatter struct{}
-
-func (c *stringFormatter) String(arg ref.Val, locale string) (string, error) {
- return FormatString(arg, locale)
-}
-
-func (c *stringFormatter) Decimal(arg ref.Val, locale string) (string, error) {
- return formatDecimal(arg, locale)
-}
-
-func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, error) {
- if precision == nil {
- precision = new(int)
- *precision = defaultPrecision
- }
- return func(arg ref.Val, locale string) (string, error) {
- strException := false
- if arg.Type() == types.StringType {
- argStr := arg.Value().(string)
- if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
- strException = true
- }
- }
- if arg.Type() != types.DoubleType && !strException {
- return "", fmt.Errorf("fixed-point clause can only be used on doubles, was given %s", arg.Type().TypeName())
- }
- argFloatVal := arg.ConvertToType(types.DoubleType)
- argFloat, ok := argFloatVal.Value().(float64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to float64", argFloatVal.Value())
- }
- fmtStr := fmt.Sprintf("%%.%df", *precision)
-
- matchedLocale, err := matchLanguage(locale)
- if err != nil {
- return "", fmt.Errorf("error matching locale: %w", err)
- }
- return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
- }
-}
-
-func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (string, error) {
- if precision == nil {
- precision = new(int)
- *precision = defaultPrecision
- }
- return func(arg ref.Val, locale string) (string, error) {
- strException := false
- if arg.Type() == types.StringType {
- argStr := arg.Value().(string)
- if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
- strException = true
- }
- }
- if arg.Type() != types.DoubleType && !strException {
- return "", fmt.Errorf("scientific clause can only be used on doubles, was given %s", arg.Type().TypeName())
- }
- argFloatVal := arg.ConvertToType(types.DoubleType)
- argFloat, ok := argFloatVal.Value().(float64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to float64", argFloatVal.Value())
- }
- matchedLocale, err := matchLanguage(locale)
- if err != nil {
- return "", fmt.Errorf("error matching locale: %w", err)
- }
- fmtStr := fmt.Sprintf("%%%de", *precision)
- return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
- }
-}
-
-func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.IntType:
- argInt := arg.Value().(int64)
- // locale is intentionally unused as integers formatted as binary
- // strings are locale-independent
- return fmt.Sprintf("%b", argInt), nil
- case types.UintType:
- argInt := arg.Value().(uint64)
- return fmt.Sprintf("%b", argInt), nil
- case types.BoolType:
- argBool := arg.Value().(bool)
- if argBool {
- return "1", nil
- }
- return "0", nil
- default:
- return "", fmt.Errorf("only integers and bools can be formatted as binary, was given %s", arg.Type().TypeName())
- }
-}
-
-func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- fmtStr := "%x"
- if useUpper {
- fmtStr = "%X"
- }
- switch arg.Type() {
- case types.StringType, types.BytesType:
- if arg.Type() == types.BytesType {
- return fmt.Sprintf(fmtStr, arg.Value().([]byte)), nil
- }
- return fmt.Sprintf(fmtStr, arg.Value().(string)), nil
- case types.IntType:
- argInt, ok := arg.Value().(int64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
- }
- return fmt.Sprintf(fmtStr, argInt), nil
- case types.UintType:
- argInt, ok := arg.Value().(uint64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
- }
- return fmt.Sprintf(fmtStr, argInt), nil
- default:
- return "", fmt.Errorf("only integers, byte buffers, and strings can be formatted as hex, was given %s", arg.Type().TypeName())
- }
- }
-}
-
-func (c *stringFormatter) Octal(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.IntType:
- argInt := arg.Value().(int64)
- return fmt.Sprintf("%o", argInt), nil
- case types.UintType:
- argInt := arg.Value().(uint64)
- return fmt.Sprintf("%o", argInt), nil
- default:
- return "", fmt.Errorf("octal clause can only be used on integers, was given %s", arg.Type().TypeName())
- }
-}
-
-type stringArgList struct {
- args traits.Lister
-}
-
-func (c *stringArgList) Arg(index int64) (ref.Val, error) {
- if index >= c.args.Size().Value().(int64) {
- return nil, fmt.Errorf("index %d out of range", index)
- }
- return c.args.Get(types.Int(index)), nil
-}
-
-func (c *stringArgList) ArgSize() int64 {
- return c.args.Size().Value().(int64)
-}
-
var (
stringListType = reflect.TypeOf([]string{})
)
diff --git a/vendor/github.com/google/cel-go/interpreter/BUILD.bazel b/vendor/github.com/google/cel-go/interpreter/BUILD.bazel
index 3a5219eb5f6..220e23d4752 100644
--- a/vendor/github.com/google/cel-go/interpreter/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/interpreter/BUILD.bazel
@@ -14,7 +14,6 @@ go_library(
"decorators.go",
"dispatcher.go",
"evalstate.go",
- "formatting.go",
"interpretable.go",
"interpreter.go",
"optimizations.go",
diff --git a/vendor/github.com/google/cel-go/interpreter/attributes.go b/vendor/github.com/google/cel-go/interpreter/attributes.go
index ca97bdfcf14..0098750dd77 100644
--- a/vendor/github.com/google/cel-go/interpreter/attributes.go
+++ b/vendor/github.com/google/cel-go/interpreter/attributes.go
@@ -287,6 +287,9 @@ func (a *absoluteAttribute) Resolve(vars Activation) (any, error) {
// determine whether the type is unknown before returning.
obj, found := vars.ResolveName(nm)
if found {
+ if celErr, ok := obj.(*types.Err); ok {
+ return nil, celErr.Unwrap()
+ }
obj, isOpt, err := applyQualifiers(vars, obj, a.qualifiers)
if err != nil {
return nil, err
diff --git a/vendor/github.com/google/cel-go/interpreter/formatting.go b/vendor/github.com/google/cel-go/interpreter/formatting.go
deleted file mode 100644
index e3f7533745e..00000000000
--- a/vendor/github.com/google/cel-go/interpreter/formatting.go
+++ /dev/null
@@ -1,383 +0,0 @@
-// Copyright 2023 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package interpreter
-
-import (
- "errors"
- "fmt"
- "strconv"
- "strings"
- "unicode"
-
- "github.com/google/cel-go/common/types"
- "github.com/google/cel-go/common/types/ref"
-)
-
-type typeVerifier func(int64, ...ref.Type) (bool, error)
-
-// InterpolateFormattedString checks the syntax and cardinality of any string.format calls present in the expression and reports
-// any errors at compile time.
-func InterpolateFormattedString(verifier typeVerifier) InterpretableDecorator {
- return func(inter Interpretable) (Interpretable, error) {
- call, ok := inter.(InterpretableCall)
- if !ok {
- return inter, nil
- }
- if call.OverloadID() != "string_format" {
- return inter, nil
- }
- args := call.Args()
- if len(args) != 2 {
- return nil, fmt.Errorf("wrong number of arguments to string.format (expected 2, got %d)", len(args))
- }
- fmtStrInter, ok := args[0].(InterpretableConst)
- if !ok {
- return inter, nil
- }
- var fmtArgsInter InterpretableConstructor
- fmtArgsInter, ok = args[1].(InterpretableConstructor)
- if !ok {
- return inter, nil
- }
- if fmtArgsInter.Type() != types.ListType {
- // don't necessarily return an error since the list may be DynType
- return inter, nil
- }
- formatStr := fmtStrInter.Value().Value().(string)
- initVals := fmtArgsInter.InitVals()
-
- formatCheck := &formatCheck{
- args: initVals,
- verifier: verifier,
- }
- // use a placeholder locale, since locale doesn't affect syntax
- _, err := ParseFormatString(formatStr, formatCheck, formatCheck, "en_US")
- if err != nil {
- return nil, err
- }
- seenArgs := formatCheck.argsRequested
- if len(initVals) > seenArgs {
- return nil, fmt.Errorf("too many arguments supplied to string.format (expected %d, got %d)", seenArgs, len(initVals))
- }
- return inter, nil
- }
-}
-
-type formatCheck struct {
- args []Interpretable
- argsRequested int
- curArgIndex int64
- enableCheckArgTypes bool
- verifier typeVerifier
-}
-
-func (c *formatCheck) String(arg ref.Val, locale string) (string, error) {
- valid, err := verifyString(c.args[c.curArgIndex], c.verifier)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps")
- }
- return "", nil
-}
-
-func (c *formatCheck) Decimal(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("integer clause can only be used on integers")
- }
- return "", nil
-}
-
-func (c *formatCheck) Fixed(precision *int) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- // we allow StringType since "NaN", "Infinity", and "-Infinity" are also valid values
- valid, err := c.verifier(id, types.DoubleType, types.StringType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("fixed-point clause can only be used on doubles")
- }
- return "", nil
- }
-}
-
-func (c *formatCheck) Scientific(precision *int) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.DoubleType, types.StringType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("scientific clause can only be used on doubles")
- }
- return "", nil
- }
-}
-
-func (c *formatCheck) Binary(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType, types.BoolType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("only integers and bools can be formatted as binary")
- }
- return "", nil
-}
-
-func (c *formatCheck) Hex(useUpper bool) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType, types.StringType, types.BytesType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("only integers, byte buffers, and strings can be formatted as hex")
- }
- return "", nil
- }
-}
-
-func (c *formatCheck) Octal(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("octal clause can only be used on integers")
- }
- return "", nil
-}
-
-func (c *formatCheck) Arg(index int64) (ref.Val, error) {
- c.argsRequested++
- c.curArgIndex = index
- // return a dummy value - this is immediately passed to back to us
- // through one of the FormatCallback functions, so anything will do
- return types.Int(0), nil
-}
-
-func (c *formatCheck) ArgSize() int64 {
- return int64(len(c.args))
-}
-
-func verifyString(sub Interpretable, verifier typeVerifier) (bool, error) {
- subVerified, err := verifier(sub.ID(),
- types.ListType, types.MapType, types.IntType, types.UintType, types.DoubleType,
- types.BoolType, types.StringType, types.TimestampType, types.BytesType, types.DurationType, types.TypeType, types.NullType)
- if err != nil {
- return false, err
- }
- if !subVerified {
- return false, nil
- }
- con, ok := sub.(InterpretableConstructor)
- if ok {
- members := con.InitVals()
- for _, m := range members {
- // recursively verify if we're dealing with a list/map
- verified, err := verifyString(m, verifier)
- if err != nil {
- return false, err
- }
- if !verified {
- return false, nil
- }
- }
- }
- return true, nil
-
-}
-
-// FormatStringInterpolator is an interface that allows user-defined behavior
-// for formatting clause implementations, as well as argument retrieval.
-// Each function is expected to support the appropriate types as laid out in
-// the string.format documentation, and to return an error if given an inappropriate type.
-type FormatStringInterpolator interface {
- // String takes a ref.Val and a string representing the current locale identifier
- // and returns the Val formatted as a string, or an error if one occurred.
- String(ref.Val, string) (string, error)
-
- // Decimal takes a ref.Val and a string representing the current locale identifier
- // and returns the Val formatted as a decimal integer, or an error if one occurred.
- Decimal(ref.Val, string) (string, error)
-
- // Fixed takes an int pointer representing precision (or nil if none was given) and
- // returns a function operating in a similar manner to String and Decimal, taking a
- // ref.Val and locale and returning the appropriate string. A closure is returned
- // so precision can be set without needing an additional function call/configuration.
- Fixed(*int) func(ref.Val, string) (string, error)
-
- // Scientific functions identically to Fixed, except the string returned from the closure
- // is expected to be in scientific notation.
- Scientific(*int) func(ref.Val, string) (string, error)
-
- // Binary takes a ref.Val and a string representing the current locale identifier
- // and returns the Val formatted as a binary integer, or an error if one occurred.
- Binary(ref.Val, string) (string, error)
-
- // Hex takes a boolean that, if true, indicates the hex string output by the returned
- // closure should use uppercase letters for A-F.
- Hex(bool) func(ref.Val, string) (string, error)
-
- // Octal takes a ref.Val and a string representing the current locale identifier and
- // returns the Val formatted in octal, or an error if one occurred.
- Octal(ref.Val, string) (string, error)
-}
-
-// FormatList is an interface that allows user-defined list-like datatypes to be used
-// for formatting clause implementations.
-type FormatList interface {
- // Arg returns the ref.Val at the given index, or an error if one occurred.
- Arg(int64) (ref.Val, error)
- // ArgSize returns the length of the argument list.
- ArgSize() int64
-}
-
-type clauseImpl func(ref.Val, string) (string, error)
-
-// ParseFormatString formats a string according to the string.format syntax, taking the clause implementations
-// from the provided FormatCallback and the args from the given FormatList.
-func ParseFormatString(formatStr string, callback FormatStringInterpolator, list FormatList, locale string) (string, error) {
- i := 0
- argIndex := 0
- var builtStr strings.Builder
- for i < len(formatStr) {
- if formatStr[i] == '%' {
- if i+1 < len(formatStr) && formatStr[i+1] == '%' {
- err := builtStr.WriteByte('%')
- if err != nil {
- return "", fmt.Errorf("error writing format string: %w", err)
- }
- i += 2
- continue
- } else {
- argAny, err := list.Arg(int64(argIndex))
- if err != nil {
- return "", err
- }
- if i+1 >= len(formatStr) {
- return "", errors.New("unexpected end of string")
- }
- if int64(argIndex) >= list.ArgSize() {
- return "", fmt.Errorf("index %d out of range", argIndex)
- }
- numRead, val, refErr := parseAndFormatClause(formatStr[i:], argAny, callback, list, locale)
- if refErr != nil {
- return "", refErr
- }
- _, err = builtStr.WriteString(val)
- if err != nil {
- return "", fmt.Errorf("error writing format string: %w", err)
- }
- i += numRead
- argIndex++
- }
- } else {
- err := builtStr.WriteByte(formatStr[i])
- if err != nil {
- return "", fmt.Errorf("error writing format string: %w", err)
- }
- i++
- }
- }
- return builtStr.String(), nil
-}
-
-// parseAndFormatClause parses the format clause at the start of the given string with val, and returns
-// how many characters were consumed and the substituted string form of val, or an error if one occurred.
-func parseAndFormatClause(formatStr string, val ref.Val, callback FormatStringInterpolator, list FormatList, locale string) (int, string, error) {
- i := 1
- read, formatter, err := parseFormattingClause(formatStr[i:], callback)
- i += read
- if err != nil {
- return -1, "", fmt.Errorf("could not parse formatting clause: %s", err)
- }
-
- valStr, err := formatter(val, locale)
- if err != nil {
- return -1, "", fmt.Errorf("error during formatting: %s", err)
- }
- return i, valStr, nil
-}
-
-func parseFormattingClause(formatStr string, callback FormatStringInterpolator) (int, clauseImpl, error) {
- i := 0
- read, precision, err := parsePrecision(formatStr[i:])
- i += read
- if err != nil {
- return -1, nil, fmt.Errorf("error while parsing precision: %w", err)
- }
- r := rune(formatStr[i])
- i++
- switch r {
- case 's':
- return i, callback.String, nil
- case 'd':
- return i, callback.Decimal, nil
- case 'f':
- return i, callback.Fixed(precision), nil
- case 'e':
- return i, callback.Scientific(precision), nil
- case 'b':
- return i, callback.Binary, nil
- case 'x', 'X':
- return i, callback.Hex(unicode.IsUpper(r)), nil
- case 'o':
- return i, callback.Octal, nil
- default:
- return -1, nil, fmt.Errorf("unrecognized formatting clause \"%c\"", r)
- }
-}
-
-func parsePrecision(formatStr string) (int, *int, error) {
- i := 0
- if formatStr[i] != '.' {
- return i, nil, nil
- }
- i++
- var buffer strings.Builder
- for {
- if i >= len(formatStr) {
- return -1, nil, errors.New("could not find end of precision specifier")
- }
- if !isASCIIDigit(rune(formatStr[i])) {
- break
- }
- buffer.WriteByte(formatStr[i])
- i++
- }
- precision, err := strconv.Atoi(buffer.String())
- if err != nil {
- return -1, nil, fmt.Errorf("error while converting precision to integer: %w", err)
- }
- return i, &precision, nil
-}
-
-func isASCIIDigit(r rune) bool {
- return r <= unicode.MaxASCII && unicode.IsDigit(r)
-}
diff --git a/vendor/github.com/google/cel-go/interpreter/interpretable.go b/vendor/github.com/google/cel-go/interpreter/interpretable.go
index c4598dfa73b..56123840747 100644
--- a/vendor/github.com/google/cel-go/interpreter/interpretable.go
+++ b/vendor/github.com/google/cel-go/interpreter/interpretable.go
@@ -125,7 +125,7 @@ func (test *evalTestOnly) Eval(ctx Activation) ref.Val {
val, err := test.Resolve(ctx)
// Return an error if the resolve step fails
if err != nil {
- return types.WrapErr(err)
+ return types.LabelErrNode(test.id, types.WrapErr(err))
}
if optVal, isOpt := val.(*types.Optional); isOpt {
return types.Bool(optVal.HasValue())
@@ -231,6 +231,7 @@ func (or *evalOr) Eval(ctx Activation) ref.Val {
} else {
err = types.MaybeNoSuchOverloadErr(val)
}
+ err = types.LabelErrNode(or.id, err)
}
}
}
@@ -273,6 +274,7 @@ func (and *evalAnd) Eval(ctx Activation) ref.Val {
} else {
err = types.MaybeNoSuchOverloadErr(val)
}
+ err = types.LabelErrNode(and.id, err)
}
}
}
@@ -377,7 +379,7 @@ func (zero *evalZeroArity) ID() int64 {
// Eval implements the Interpretable interface method.
func (zero *evalZeroArity) Eval(ctx Activation) ref.Val {
- return zero.impl()
+ return types.LabelErrNode(zero.id, zero.impl())
}
// Function implements the InterpretableCall interface method.
@@ -421,14 +423,14 @@ func (un *evalUnary) Eval(ctx Activation) ref.Val {
// If the implementation is bound and the argument value has the right traits required to
// invoke it, then call the implementation.
if un.impl != nil && (un.trait == 0 || (!strict && types.IsUnknownOrError(argVal)) || argVal.Type().HasTrait(un.trait)) {
- return un.impl(argVal)
+ return types.LabelErrNode(un.id, un.impl(argVal))
}
// Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the
// operand (arg0).
if argVal.Type().HasTrait(traits.ReceiverType) {
- return argVal.(traits.Receiver).Receive(un.function, un.overload, []ref.Val{})
+ return types.LabelErrNode(un.id, argVal.(traits.Receiver).Receive(un.function, un.overload, []ref.Val{}))
}
- return types.NewErr("no such overload: %s", un.function)
+ return types.NewErrWithNodeID(un.id, "no such overload: %s", un.function)
}
// Function implements the InterpretableCall interface method.
@@ -479,14 +481,14 @@ func (bin *evalBinary) Eval(ctx Activation) ref.Val {
// If the implementation is bound and the argument value has the right traits required to
// invoke it, then call the implementation.
if bin.impl != nil && (bin.trait == 0 || (!strict && types.IsUnknownOrError(lVal)) || lVal.Type().HasTrait(bin.trait)) {
- return bin.impl(lVal, rVal)
+ return types.LabelErrNode(bin.id, bin.impl(lVal, rVal))
}
// Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the
// operand (arg0).
if lVal.Type().HasTrait(traits.ReceiverType) {
- return lVal.(traits.Receiver).Receive(bin.function, bin.overload, []ref.Val{rVal})
+ return types.LabelErrNode(bin.id, lVal.(traits.Receiver).Receive(bin.function, bin.overload, []ref.Val{rVal}))
}
- return types.NewErr("no such overload: %s", bin.function)
+ return types.NewErrWithNodeID(bin.id, "no such overload: %s", bin.function)
}
// Function implements the InterpretableCall interface method.
@@ -545,14 +547,14 @@ func (fn *evalVarArgs) Eval(ctx Activation) ref.Val {
// invoke it, then call the implementation.
arg0 := argVals[0]
if fn.impl != nil && (fn.trait == 0 || (!strict && types.IsUnknownOrError(arg0)) || arg0.Type().HasTrait(fn.trait)) {
- return fn.impl(argVals...)
+ return types.LabelErrNode(fn.id, fn.impl(argVals...))
}
// Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the
// operand (arg0).
if arg0.Type().HasTrait(traits.ReceiverType) {
- return arg0.(traits.Receiver).Receive(fn.function, fn.overload, argVals[1:])
+ return types.LabelErrNode(fn.id, arg0.(traits.Receiver).Receive(fn.function, fn.overload, argVals[1:]))
}
- return types.NewErr("no such overload: %s", fn.function)
+ return types.NewErrWithNodeID(fn.id, "no such overload: %s %d", fn.function, fn.id)
}
// Function implements the InterpretableCall interface method.
@@ -595,7 +597,7 @@ func (l *evalList) Eval(ctx Activation) ref.Val {
if l.hasOptionals && l.optionals[i] {
optVal, ok := elemVal.(*types.Optional)
if !ok {
- return invalidOptionalElementInit(elemVal)
+ return types.LabelErrNode(l.id, invalidOptionalElementInit(elemVal))
}
if !optVal.HasValue() {
continue
@@ -645,7 +647,7 @@ func (m *evalMap) Eval(ctx Activation) ref.Val {
if m.hasOptionals && m.optionals[i] {
optVal, ok := valVal.(*types.Optional)
if !ok {
- return invalidOptionalEntryInit(keyVal, valVal)
+ return types.LabelErrNode(m.id, invalidOptionalEntryInit(keyVal, valVal))
}
if !optVal.HasValue() {
delete(entries, keyVal)
@@ -705,7 +707,7 @@ func (o *evalObj) Eval(ctx Activation) ref.Val {
if o.hasOptionals && o.optionals[i] {
optVal, ok := val.(*types.Optional)
if !ok {
- return invalidOptionalEntryInit(field, val)
+ return types.LabelErrNode(o.id, invalidOptionalEntryInit(field, val))
}
if !optVal.HasValue() {
delete(fieldVals, field)
@@ -715,7 +717,7 @@ func (o *evalObj) Eval(ctx Activation) ref.Val {
}
fieldVals[field] = val
}
- return o.provider.NewValue(o.typeName, fieldVals)
+ return types.LabelErrNode(o.id, o.provider.NewValue(o.typeName, fieldVals))
}
func (o *evalObj) InitVals() []Interpretable {
@@ -921,7 +923,7 @@ func (e *evalWatchConstQual) Qualify(vars Activation, obj any) (any, error) {
out, err := e.ConstantQualifier.Qualify(vars, obj)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else {
val = e.adapter.NativeToValue(out)
}
@@ -934,7 +936,7 @@ func (e *evalWatchConstQual) QualifyIfPresent(vars Activation, obj any, presence
out, present, err := e.ConstantQualifier.QualifyIfPresent(vars, obj, presenceOnly)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else if out != nil {
val = e.adapter.NativeToValue(out)
} else if presenceOnly {
@@ -964,7 +966,7 @@ func (e *evalWatchAttrQual) Qualify(vars Activation, obj any) (any, error) {
out, err := e.Attribute.Qualify(vars, obj)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else {
val = e.adapter.NativeToValue(out)
}
@@ -977,7 +979,7 @@ func (e *evalWatchAttrQual) QualifyIfPresent(vars Activation, obj any, presenceO
out, present, err := e.Attribute.QualifyIfPresent(vars, obj, presenceOnly)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else if out != nil {
val = e.adapter.NativeToValue(out)
} else if presenceOnly {
@@ -1001,7 +1003,7 @@ func (e *evalWatchQual) Qualify(vars Activation, obj any) (any, error) {
out, err := e.Qualifier.Qualify(vars, obj)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else {
val = e.adapter.NativeToValue(out)
}
@@ -1014,7 +1016,7 @@ func (e *evalWatchQual) QualifyIfPresent(vars Activation, obj any, presenceOnly
out, present, err := e.Qualifier.QualifyIfPresent(vars, obj, presenceOnly)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else if out != nil {
val = e.adapter.NativeToValue(out)
} else if presenceOnly {
@@ -1157,12 +1159,12 @@ func (cond *evalExhaustiveConditional) Eval(ctx Activation) ref.Val {
}
if cBool {
if tErr != nil {
- return types.WrapErr(tErr)
+ return types.LabelErrNode(cond.id, types.WrapErr(tErr))
}
return cond.adapter.NativeToValue(tVal)
}
if fErr != nil {
- return types.WrapErr(fErr)
+ return types.LabelErrNode(cond.id, types.WrapErr(fErr))
}
return cond.adapter.NativeToValue(fVal)
}
@@ -1202,7 +1204,7 @@ func (a *evalAttr) Adapter() types.Adapter {
func (a *evalAttr) Eval(ctx Activation) ref.Val {
v, err := a.attr.Resolve(ctx)
if err != nil {
- return types.WrapErr(err)
+ return types.LabelErrNode(a.ID(), types.WrapErr(err))
}
return a.adapter.NativeToValue(v)
}
diff --git a/vendor/github.com/google/cel-go/interpreter/interpreter.go b/vendor/github.com/google/cel-go/interpreter/interpreter.go
index 00fc74732c6..0aca74d88b9 100644
--- a/vendor/github.com/google/cel-go/interpreter/interpreter.go
+++ b/vendor/github.com/google/cel-go/interpreter/interpreter.go
@@ -22,19 +22,13 @@ import (
"github.com/google/cel-go/common/containers"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// Interpreter generates a new Interpretable from a checked or unchecked expression.
type Interpreter interface {
// NewInterpretable creates an Interpretable from a checked expression and an
// optional list of InterpretableDecorator values.
- NewInterpretable(checked *ast.CheckedAST, decorators ...InterpretableDecorator) (Interpretable, error)
-
- // NewUncheckedInterpretable returns an Interpretable from a parsed expression
- // and an optional list of InterpretableDecorator values.
- NewUncheckedInterpretable(expr *exprpb.Expr, decorators ...InterpretableDecorator) (Interpretable, error)
+ NewInterpretable(exprAST *ast.AST, decorators ...InterpretableDecorator) (Interpretable, error)
}
// EvalObserver is a functional interface that accepts an expression id and an observed value.
@@ -177,7 +171,7 @@ func NewInterpreter(dispatcher Dispatcher,
// NewIntepretable implements the Interpreter interface method.
func (i *exprInterpreter) NewInterpretable(
- checked *ast.CheckedAST,
+ checked *ast.AST,
decorators ...InterpretableDecorator) (Interpretable, error) {
p := newPlanner(
i.dispatcher,
@@ -187,19 +181,5 @@ func (i *exprInterpreter) NewInterpretable(
i.container,
checked,
decorators...)
- return p.Plan(checked.Expr)
-}
-
-// NewUncheckedIntepretable implements the Interpreter interface method.
-func (i *exprInterpreter) NewUncheckedInterpretable(
- expr *exprpb.Expr,
- decorators ...InterpretableDecorator) (Interpretable, error) {
- p := newUncheckedPlanner(
- i.dispatcher,
- i.provider,
- i.adapter,
- i.attrFactory,
- i.container,
- decorators...)
- return p.Plan(expr)
+ return p.Plan(checked.Expr())
}
diff --git a/vendor/github.com/google/cel-go/interpreter/planner.go b/vendor/github.com/google/cel-go/interpreter/planner.go
index 757cd080e5c..cf371f95d51 100644
--- a/vendor/github.com/google/cel-go/interpreter/planner.go
+++ b/vendor/github.com/google/cel-go/interpreter/planner.go
@@ -23,15 +23,12 @@ import (
"github.com/google/cel-go/common/functions"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
- "github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// interpretablePlanner creates an Interpretable evaluation plan from a proto Expr value.
type interpretablePlanner interface {
// Plan generates an Interpretable value (or error) from the input proto Expr.
- Plan(expr *exprpb.Expr) (Interpretable, error)
+ Plan(expr ast.Expr) (Interpretable, error)
}
// newPlanner creates an interpretablePlanner which references a Dispatcher, TypeProvider,
@@ -43,28 +40,7 @@ func newPlanner(disp Dispatcher,
adapter types.Adapter,
attrFactory AttributeFactory,
cont *containers.Container,
- checked *ast.CheckedAST,
- decorators ...InterpretableDecorator) interpretablePlanner {
- return &planner{
- disp: disp,
- provider: provider,
- adapter: adapter,
- attrFactory: attrFactory,
- container: cont,
- refMap: checked.ReferenceMap,
- typeMap: checked.TypeMap,
- decorators: decorators,
- }
-}
-
-// newUncheckedPlanner creates an interpretablePlanner which references a Dispatcher, TypeProvider,
-// TypeAdapter, and Container to resolve functions and types at plan time. Namespaces present in
-// Select expressions are resolved lazily at evaluation time.
-func newUncheckedPlanner(disp Dispatcher,
- provider types.Provider,
- adapter types.Adapter,
- attrFactory AttributeFactory,
- cont *containers.Container,
+ exprAST *ast.AST,
decorators ...InterpretableDecorator) interpretablePlanner {
return &planner{
disp: disp,
@@ -72,8 +48,8 @@ func newUncheckedPlanner(disp Dispatcher,
adapter: adapter,
attrFactory: attrFactory,
container: cont,
- refMap: make(map[int64]*ast.ReferenceInfo),
- typeMap: make(map[int64]*types.Type),
+ refMap: exprAST.ReferenceMap(),
+ typeMap: exprAST.TypeMap(),
decorators: decorators,
}
}
@@ -95,22 +71,24 @@ type planner struct {
// useful for layering functionality into the evaluation that is not natively understood by CEL,
// such as state-tracking, expression re-write, and possibly efficient thread-safe memoization of
// repeated expressions.
-func (p *planner) Plan(expr *exprpb.Expr) (Interpretable, error) {
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_CallExpr:
+func (p *planner) Plan(expr ast.Expr) (Interpretable, error) {
+ switch expr.Kind() {
+ case ast.CallKind:
return p.decorate(p.planCall(expr))
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
return p.decorate(p.planIdent(expr))
- case *exprpb.Expr_SelectExpr:
+ case ast.LiteralKind:
+ return p.decorate(p.planConst(expr))
+ case ast.SelectKind:
return p.decorate(p.planSelect(expr))
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
return p.decorate(p.planCreateList(expr))
- case *exprpb.Expr_StructExpr:
+ case ast.MapKind:
+ return p.decorate(p.planCreateMap(expr))
+ case ast.StructKind:
return p.decorate(p.planCreateStruct(expr))
- case *exprpb.Expr_ComprehensionExpr:
+ case ast.ComprehensionKind:
return p.decorate(p.planComprehension(expr))
- case *exprpb.Expr_ConstExpr:
- return p.decorate(p.planConst(expr))
}
return nil, fmt.Errorf("unsupported expr: %v", expr)
}
@@ -132,16 +110,16 @@ func (p *planner) decorate(i Interpretable, err error) (Interpretable, error) {
}
// planIdent creates an Interpretable that resolves an identifier from an Activation.
-func (p *planner) planIdent(expr *exprpb.Expr) (Interpretable, error) {
+func (p *planner) planIdent(expr ast.Expr) (Interpretable, error) {
// Establish whether the identifier is in the reference map.
- if identRef, found := p.refMap[expr.GetId()]; found {
- return p.planCheckedIdent(expr.GetId(), identRef)
+ if identRef, found := p.refMap[expr.ID()]; found {
+ return p.planCheckedIdent(expr.ID(), identRef)
}
// Create the possible attribute list for the unresolved reference.
- ident := expr.GetIdentExpr()
+ ident := expr.AsIdent()
return &evalAttr{
adapter: p.adapter,
- attr: p.attrFactory.MaybeAttribute(expr.GetId(), ident.Name),
+ attr: p.attrFactory.MaybeAttribute(expr.ID(), ident),
}, nil
}
@@ -174,20 +152,20 @@ func (p *planner) planCheckedIdent(id int64, identRef *ast.ReferenceInfo) (Inter
// a) selects a field from a map or proto.
// b) creates a field presence test for a select within a has() macro.
// c) resolves the select expression to a namespaced identifier.
-func (p *planner) planSelect(expr *exprpb.Expr) (Interpretable, error) {
+func (p *planner) planSelect(expr ast.Expr) (Interpretable, error) {
// If the Select id appears in the reference map from the CheckedExpr proto then it is either
// a namespaced identifier or enum value.
- if identRef, found := p.refMap[expr.GetId()]; found {
- return p.planCheckedIdent(expr.GetId(), identRef)
+ if identRef, found := p.refMap[expr.ID()]; found {
+ return p.planCheckedIdent(expr.ID(), identRef)
}
- sel := expr.GetSelectExpr()
+ sel := expr.AsSelect()
// Plan the operand evaluation.
- op, err := p.Plan(sel.GetOperand())
+ op, err := p.Plan(sel.Operand())
if err != nil {
return nil, err
}
- opType := p.typeMap[sel.GetOperand().GetId()]
+ opType := p.typeMap[sel.Operand().ID()]
// If the Select was marked TestOnly, this is a presence test.
//
@@ -211,14 +189,14 @@ func (p *planner) planSelect(expr *exprpb.Expr) (Interpretable, error) {
}
// Build a qualifier for the attribute.
- qual, err := p.attrFactory.NewQualifier(opType, expr.GetId(), sel.GetField(), false)
+ qual, err := p.attrFactory.NewQualifier(opType, expr.ID(), sel.FieldName(), false)
if err != nil {
return nil, err
}
// Modify the attribute to be test-only.
- if sel.GetTestOnly() {
+ if sel.IsTestOnly() {
attr = &evalTestOnly{
- id: expr.GetId(),
+ id: expr.ID(),
InterpretableAttribute: attr,
}
}
@@ -230,10 +208,10 @@ func (p *planner) planSelect(expr *exprpb.Expr) (Interpretable, error) {
// planCall creates a callable Interpretable while specializing for common functions and invocation
// patterns. Specifically, conditional operators &&, ||, ?:, and (in)equality functions result in
// optimized Interpretable values.
-func (p *planner) planCall(expr *exprpb.Expr) (Interpretable, error) {
- call := expr.GetCallExpr()
+func (p *planner) planCall(expr ast.Expr) (Interpretable, error) {
+ call := expr.AsCall()
target, fnName, oName := p.resolveFunction(expr)
- argCount := len(call.GetArgs())
+ argCount := len(call.Args())
var offset int
if target != nil {
argCount++
@@ -248,7 +226,7 @@ func (p *planner) planCall(expr *exprpb.Expr) (Interpretable, error) {
}
args[0] = arg
}
- for i, argExpr := range call.GetArgs() {
+ for i, argExpr := range call.Args() {
arg, err := p.Plan(argExpr)
if err != nil {
return nil, err
@@ -307,7 +285,7 @@ func (p *planner) planCall(expr *exprpb.Expr) (Interpretable, error) {
}
// planCallZero generates a zero-arity callable Interpretable.
-func (p *planner) planCallZero(expr *exprpb.Expr,
+func (p *planner) planCallZero(expr ast.Expr,
function string,
overload string,
impl *functions.Overload) (Interpretable, error) {
@@ -315,7 +293,7 @@ func (p *planner) planCallZero(expr *exprpb.Expr,
return nil, fmt.Errorf("no such overload: %s()", function)
}
return &evalZeroArity{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
impl: impl.Function,
@@ -323,7 +301,7 @@ func (p *planner) planCallZero(expr *exprpb.Expr,
}
// planCallUnary generates a unary callable Interpretable.
-func (p *planner) planCallUnary(expr *exprpb.Expr,
+func (p *planner) planCallUnary(expr ast.Expr,
function string,
overload string,
impl *functions.Overload,
@@ -340,7 +318,7 @@ func (p *planner) planCallUnary(expr *exprpb.Expr,
nonStrict = impl.NonStrict
}
return &evalUnary{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
arg: args[0],
@@ -351,7 +329,7 @@ func (p *planner) planCallUnary(expr *exprpb.Expr,
}
// planCallBinary generates a binary callable Interpretable.
-func (p *planner) planCallBinary(expr *exprpb.Expr,
+func (p *planner) planCallBinary(expr ast.Expr,
function string,
overload string,
impl *functions.Overload,
@@ -368,7 +346,7 @@ func (p *planner) planCallBinary(expr *exprpb.Expr,
nonStrict = impl.NonStrict
}
return &evalBinary{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
lhs: args[0],
@@ -380,7 +358,7 @@ func (p *planner) planCallBinary(expr *exprpb.Expr,
}
// planCallVarArgs generates a variable argument callable Interpretable.
-func (p *planner) planCallVarArgs(expr *exprpb.Expr,
+func (p *planner) planCallVarArgs(expr ast.Expr,
function string,
overload string,
impl *functions.Overload,
@@ -397,7 +375,7 @@ func (p *planner) planCallVarArgs(expr *exprpb.Expr,
nonStrict = impl.NonStrict
}
return &evalVarArgs{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
args: args,
@@ -408,41 +386,41 @@ func (p *planner) planCallVarArgs(expr *exprpb.Expr,
}
// planCallEqual generates an equals (==) Interpretable.
-func (p *planner) planCallEqual(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallEqual(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalEq{
- id: expr.GetId(),
+ id: expr.ID(),
lhs: args[0],
rhs: args[1],
}, nil
}
// planCallNotEqual generates a not equals (!=) Interpretable.
-func (p *planner) planCallNotEqual(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallNotEqual(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalNe{
- id: expr.GetId(),
+ id: expr.ID(),
lhs: args[0],
rhs: args[1],
}, nil
}
// planCallLogicalAnd generates a logical and (&&) Interpretable.
-func (p *planner) planCallLogicalAnd(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallLogicalAnd(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalAnd{
- id: expr.GetId(),
+ id: expr.ID(),
terms: args,
}, nil
}
// planCallLogicalOr generates a logical or (||) Interpretable.
-func (p *planner) planCallLogicalOr(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallLogicalOr(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalOr{
- id: expr.GetId(),
+ id: expr.ID(),
terms: args,
}, nil
}
// planCallConditional generates a conditional / ternary (c ? t : f) Interpretable.
-func (p *planner) planCallConditional(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallConditional(expr ast.Expr, args []Interpretable) (Interpretable, error) {
cond := args[0]
t := args[1]
var tAttr Attribute
@@ -464,13 +442,13 @@ func (p *planner) planCallConditional(expr *exprpb.Expr, args []Interpretable) (
return &evalAttr{
adapter: p.adapter,
- attr: p.attrFactory.ConditionalAttribute(expr.GetId(), cond, tAttr, fAttr),
+ attr: p.attrFactory.ConditionalAttribute(expr.ID(), cond, tAttr, fAttr),
}, nil
}
// planCallIndex either extends an attribute with the argument to the index operation, or creates
// a relative attribute based on the return of a function call or operation.
-func (p *planner) planCallIndex(expr *exprpb.Expr, args []Interpretable, optional bool) (Interpretable, error) {
+func (p *planner) planCallIndex(expr ast.Expr, args []Interpretable, optional bool) (Interpretable, error) {
op := args[0]
ind := args[1]
opType := p.typeMap[op.ID()]
@@ -489,11 +467,11 @@ func (p *planner) planCallIndex(expr *exprpb.Expr, args []Interpretable, optiona
var qual Qualifier
switch ind := ind.(type) {
case InterpretableConst:
- qual, err = p.attrFactory.NewQualifier(opType, expr.GetId(), ind.Value(), optional)
+ qual, err = p.attrFactory.NewQualifier(opType, expr.ID(), ind.Value(), optional)
case InterpretableAttribute:
- qual, err = p.attrFactory.NewQualifier(opType, expr.GetId(), ind, optional)
+ qual, err = p.attrFactory.NewQualifier(opType, expr.ID(), ind, optional)
default:
- qual, err = p.relativeAttr(expr.GetId(), ind, optional)
+ qual, err = p.relativeAttr(expr.ID(), ind, optional)
}
if err != nil {
return nil, err
@@ -505,10 +483,10 @@ func (p *planner) planCallIndex(expr *exprpb.Expr, args []Interpretable, optiona
}
// planCreateList generates a list construction Interpretable.
-func (p *planner) planCreateList(expr *exprpb.Expr) (Interpretable, error) {
- list := expr.GetListExpr()
- optionalIndices := list.GetOptionalIndices()
- elements := list.GetElements()
+func (p *planner) planCreateList(expr ast.Expr) (Interpretable, error) {
+ list := expr.AsList()
+ optionalIndices := list.OptionalIndices()
+ elements := list.Elements()
optionals := make([]bool, len(elements))
for _, index := range optionalIndices {
if index < 0 || index >= int32(len(elements)) {
@@ -525,7 +503,7 @@ func (p *planner) planCreateList(expr *exprpb.Expr) (Interpretable, error) {
elems[i] = elemVal
}
return &evalList{
- id: expr.GetId(),
+ id: expr.ID(),
elems: elems,
optionals: optionals,
hasOptionals: len(optionals) != 0,
@@ -534,31 +512,29 @@ func (p *planner) planCreateList(expr *exprpb.Expr) (Interpretable, error) {
}
// planCreateStruct generates a map or object construction Interpretable.
-func (p *planner) planCreateStruct(expr *exprpb.Expr) (Interpretable, error) {
- str := expr.GetStructExpr()
- if len(str.MessageName) != 0 {
- return p.planCreateObj(expr)
- }
- entries := str.GetEntries()
+func (p *planner) planCreateMap(expr ast.Expr) (Interpretable, error) {
+ m := expr.AsMap()
+ entries := m.Entries()
optionals := make([]bool, len(entries))
keys := make([]Interpretable, len(entries))
vals := make([]Interpretable, len(entries))
- for i, entry := range entries {
- keyVal, err := p.Plan(entry.GetMapKey())
+ for i, e := range entries {
+ entry := e.AsMapEntry()
+ keyVal, err := p.Plan(entry.Key())
if err != nil {
return nil, err
}
keys[i] = keyVal
- valVal, err := p.Plan(entry.GetValue())
+ valVal, err := p.Plan(entry.Value())
if err != nil {
return nil, err
}
vals[i] = valVal
- optionals[i] = entry.GetOptionalEntry()
+ optionals[i] = entry.IsOptional()
}
return &evalMap{
- id: expr.GetId(),
+ id: expr.ID(),
keys: keys,
vals: vals,
optionals: optionals,
@@ -568,27 +544,28 @@ func (p *planner) planCreateStruct(expr *exprpb.Expr) (Interpretable, error) {
}
// planCreateObj generates an object construction Interpretable.
-func (p *planner) planCreateObj(expr *exprpb.Expr) (Interpretable, error) {
- obj := expr.GetStructExpr()
- typeName, defined := p.resolveTypeName(obj.GetMessageName())
+func (p *planner) planCreateStruct(expr ast.Expr) (Interpretable, error) {
+ obj := expr.AsStruct()
+ typeName, defined := p.resolveTypeName(obj.TypeName())
if !defined {
- return nil, fmt.Errorf("unknown type: %s", obj.GetMessageName())
- }
- entries := obj.GetEntries()
- optionals := make([]bool, len(entries))
- fields := make([]string, len(entries))
- vals := make([]Interpretable, len(entries))
- for i, entry := range entries {
- fields[i] = entry.GetFieldKey()
- val, err := p.Plan(entry.GetValue())
+ return nil, fmt.Errorf("unknown type: %s", obj.TypeName())
+ }
+ objFields := obj.Fields()
+ optionals := make([]bool, len(objFields))
+ fields := make([]string, len(objFields))
+ vals := make([]Interpretable, len(objFields))
+ for i, f := range objFields {
+ field := f.AsStructField()
+ fields[i] = field.Name()
+ val, err := p.Plan(field.Value())
if err != nil {
return nil, err
}
vals[i] = val
- optionals[i] = entry.GetOptionalEntry()
+ optionals[i] = field.IsOptional()
}
return &evalObj{
- id: expr.GetId(),
+ id: expr.ID(),
typeName: typeName,
fields: fields,
vals: vals,
@@ -599,33 +576,33 @@ func (p *planner) planCreateObj(expr *exprpb.Expr) (Interpretable, error) {
}
// planComprehension generates an Interpretable fold operation.
-func (p *planner) planComprehension(expr *exprpb.Expr) (Interpretable, error) {
- fold := expr.GetComprehensionExpr()
- accu, err := p.Plan(fold.GetAccuInit())
+func (p *planner) planComprehension(expr ast.Expr) (Interpretable, error) {
+ fold := expr.AsComprehension()
+ accu, err := p.Plan(fold.AccuInit())
if err != nil {
return nil, err
}
- iterRange, err := p.Plan(fold.GetIterRange())
+ iterRange, err := p.Plan(fold.IterRange())
if err != nil {
return nil, err
}
- cond, err := p.Plan(fold.GetLoopCondition())
+ cond, err := p.Plan(fold.LoopCondition())
if err != nil {
return nil, err
}
- step, err := p.Plan(fold.GetLoopStep())
+ step, err := p.Plan(fold.LoopStep())
if err != nil {
return nil, err
}
- result, err := p.Plan(fold.GetResult())
+ result, err := p.Plan(fold.Result())
if err != nil {
return nil, err
}
return &evalFold{
- id: expr.GetId(),
- accuVar: fold.AccuVar,
+ id: expr.ID(),
+ accuVar: fold.AccuVar(),
accu: accu,
- iterVar: fold.IterVar,
+ iterVar: fold.IterVar(),
iterRange: iterRange,
cond: cond,
step: step,
@@ -635,37 +612,8 @@ func (p *planner) planComprehension(expr *exprpb.Expr) (Interpretable, error) {
}
// planConst generates a constant valued Interpretable.
-func (p *planner) planConst(expr *exprpb.Expr) (Interpretable, error) {
- val, err := p.constValue(expr.GetConstExpr())
- if err != nil {
- return nil, err
- }
- return NewConstValue(expr.GetId(), val), nil
-}
-
-// constValue converts a proto Constant value to a ref.Val.
-func (p *planner) constValue(c *exprpb.Constant) (ref.Val, error) {
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- return p.adapter.NativeToValue(c.GetBoolValue()), nil
- case *exprpb.Constant_BytesValue:
- return p.adapter.NativeToValue(c.GetBytesValue()), nil
- case *exprpb.Constant_DoubleValue:
- return p.adapter.NativeToValue(c.GetDoubleValue()), nil
- case *exprpb.Constant_DurationValue:
- return p.adapter.NativeToValue(c.GetDurationValue().AsDuration()), nil
- case *exprpb.Constant_Int64Value:
- return p.adapter.NativeToValue(c.GetInt64Value()), nil
- case *exprpb.Constant_NullValue:
- return p.adapter.NativeToValue(c.GetNullValue()), nil
- case *exprpb.Constant_StringValue:
- return p.adapter.NativeToValue(c.GetStringValue()), nil
- case *exprpb.Constant_TimestampValue:
- return p.adapter.NativeToValue(c.GetTimestampValue().AsTime()), nil
- case *exprpb.Constant_Uint64Value:
- return p.adapter.NativeToValue(c.GetUint64Value()), nil
- }
- return nil, fmt.Errorf("unknown constant type: %v", c)
+func (p *planner) planConst(expr ast.Expr) (Interpretable, error) {
+ return NewConstValue(expr.ID(), expr.AsLiteral()), nil
}
// resolveTypeName takes a qualified string constructed at parse time, applies the proto
@@ -687,17 +635,20 @@ func (p *planner) resolveTypeName(typeName string) (string, bool) {
// - The target expression may only consist of ident and select expressions.
// - The function is declared in the environment using its fully-qualified name.
// - The fully-qualified function name matches the string serialized target value.
-func (p *planner) resolveFunction(expr *exprpb.Expr) (*exprpb.Expr, string, string) {
+func (p *planner) resolveFunction(expr ast.Expr) (ast.Expr, string, string) {
// Note: similar logic exists within the `checker/checker.go`. If making changes here
// please consider the impact on checker.go and consolidate implementations or mirror code
// as appropriate.
- call := expr.GetCallExpr()
- target := call.GetTarget()
- fnName := call.GetFunction()
+ call := expr.AsCall()
+ var target ast.Expr = nil
+ if call.IsMemberFunction() {
+ target = call.Target()
+ }
+ fnName := call.FunctionName()
// Checked expressions always have a reference map entry, and _should_ have the fully qualified
// function name as the fnName value.
- oRef, hasOverload := p.refMap[expr.GetId()]
+ oRef, hasOverload := p.refMap[expr.ID()]
if hasOverload {
if len(oRef.OverloadIDs) == 1 {
return target, fnName, oRef.OverloadIDs[0]
@@ -771,16 +722,30 @@ func (p *planner) relativeAttr(id int64, eval Interpretable, opt bool) (Interpre
// toQualifiedName converts an expression AST into a qualified name if possible, with a boolean
// 'found' value that indicates if the conversion is successful.
-func (p *planner) toQualifiedName(operand *exprpb.Expr) (string, bool) {
+func (p *planner) toQualifiedName(operand ast.Expr) (string, bool) {
// If the checker identified the expression as an attribute by the type-checker, then it can't
// possibly be part of qualified name in a namespace.
- _, isAttr := p.refMap[operand.GetId()]
+ _, isAttr := p.refMap[operand.ID()]
if isAttr {
return "", false
}
// Since functions cannot be both namespaced and receiver functions, if the operand is not an
// qualified variable name, return the (possibly) qualified name given the expressions.
- return containers.ToQualifiedName(operand)
+ switch operand.Kind() {
+ case ast.IdentKind:
+ id := operand.AsIdent()
+ return id, true
+ case ast.SelectKind:
+ sel := operand.AsSelect()
+ // Test only expressions are not valid as qualified names.
+ if sel.IsTestOnly() {
+ return "", false
+ }
+ if qual, found := p.toQualifiedName(sel.Operand()); found {
+ return qual + "." + sel.FieldName(), true
+ }
+ }
+ return "", false
}
func stripLeadingDot(name string) string {
diff --git a/vendor/github.com/google/cel-go/interpreter/prune.go b/vendor/github.com/google/cel-go/interpreter/prune.go
index b8834b1cb85..410d80dc43c 100644
--- a/vendor/github.com/google/cel-go/interpreter/prune.go
+++ b/vendor/github.com/google/cel-go/interpreter/prune.go
@@ -15,19 +15,18 @@
package interpreter
import (
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
- structpb "google.golang.org/protobuf/types/known/structpb"
)
type astPruner struct {
- expr *exprpb.Expr
- macroCalls map[int64]*exprpb.Expr
+ ast.ExprFactory
+ expr ast.Expr
+ macroCalls map[int64]ast.Expr
state EvalState
nextExprID int64
}
@@ -67,84 +66,44 @@ type astPruner struct {
// compiled and constant folded expressions, but is not willing to constant
// fold(and thus cache results of) some external calls, then they can prepare
// the overloads accordingly.
-func PruneAst(expr *exprpb.Expr, macroCalls map[int64]*exprpb.Expr, state EvalState) *exprpb.ParsedExpr {
+func PruneAst(expr ast.Expr, macroCalls map[int64]ast.Expr, state EvalState) *ast.AST {
pruneState := NewEvalState()
for _, id := range state.IDs() {
v, _ := state.Value(id)
pruneState.SetValue(id, v)
}
pruner := &astPruner{
- expr: expr,
- macroCalls: macroCalls,
- state: pruneState,
- nextExprID: getMaxID(expr)}
+ ExprFactory: ast.NewExprFactory(),
+ expr: expr,
+ macroCalls: macroCalls,
+ state: pruneState,
+ nextExprID: getMaxID(expr)}
newExpr, _ := pruner.maybePrune(expr)
- return &exprpb.ParsedExpr{
- Expr: newExpr,
- SourceInfo: &exprpb.SourceInfo{MacroCalls: pruner.macroCalls},
- }
-}
-
-func (p *astPruner) createLiteral(id int64, val *exprpb.Constant) *exprpb.Expr {
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_ConstExpr{
- ConstExpr: val,
- },
+ newInfo := ast.NewSourceInfo(nil)
+ for id, call := range pruner.macroCalls {
+ newInfo.SetMacroCall(id, call)
}
+ return ast.NewAST(newExpr, newInfo)
}
-func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, bool) {
+func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (ast.Expr, bool) {
switch v := val.(type) {
- case types.Bool:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: bool(v)}}), true
- case types.Bytes:
+ case types.Bool, types.Bytes, types.Double, types.Int, types.Null, types.String, types.Uint:
p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: []byte(v)}}), true
- case types.Double:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: float64(v)}}), true
+ return p.NewLiteral(id, val), true
case types.Duration:
p.state.SetValue(id, val)
- durationString := string(v.ConvertToType(types.StringType).(types.String))
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Function: overloads.TypeConvertDuration,
- Args: []*exprpb.Expr{
- p.createLiteral(p.nextID(),
- &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: durationString}}),
- },
- },
- },
- }, true
- case types.Int:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: int64(v)}}), true
- case types.Uint:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: uint64(v)}}), true
- case types.String:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: string(v)}}), true
- case types.Null:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: v.Value().(structpb.NullValue)}}), true
+ durationString := v.ConvertToType(types.StringType).(types.String)
+ return p.NewCall(id, overloads.TypeConvertDuration, p.NewLiteral(p.nextID(), durationString)), true
+ case types.Timestamp:
+ timestampString := v.ConvertToType(types.StringType).(types.String)
+ return p.NewCall(id, overloads.TypeConvertTimestamp, p.NewLiteral(p.nextID(), timestampString)), true
}
// Attempt to build a list literal.
if list, isList := val.(traits.Lister); isList {
sz := list.Size().(types.Int)
- elemExprs := make([]*exprpb.Expr, sz)
+ elemExprs := make([]ast.Expr, sz)
for i := types.Int(0); i < sz; i++ {
elem := list.Get(i)
if types.IsUnknownOrError(elem) {
@@ -157,20 +116,13 @@ func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, boo
elemExprs[i] = elemExpr
}
p.state.SetValue(id, val)
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: elemExprs,
- },
- },
- }, true
+ return p.NewList(id, elemExprs, []int32{}), true
}
// Create a map literal if possible.
if mp, isMap := val.(traits.Mapper); isMap {
it := mp.Iterator()
- entries := make([]*exprpb.Expr_CreateStruct_Entry, mp.Size().(types.Int))
+ entries := make([]ast.EntryExpr, mp.Size().(types.Int))
i := 0
for it.HasNext() != types.False {
key := it.Next()
@@ -186,25 +138,12 @@ func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, boo
if !ok {
return nil, false
}
- entry := &exprpb.Expr_CreateStruct_Entry{
- Id: p.nextID(),
- KeyKind: &exprpb.Expr_CreateStruct_Entry_MapKey{
- MapKey: keyExpr,
- },
- Value: valExpr,
- }
+ entry := p.NewMapEntry(p.nextID(), keyExpr, valExpr, false)
entries[i] = entry
i++
}
p.state.SetValue(id, val)
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- Entries: entries,
- },
- },
- }, true
+ return p.NewMap(id, entries), true
}
// TODO(issues/377) To construct message literals, the type provider will need to support
@@ -212,215 +151,206 @@ func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, boo
return nil, false
}
-func (p *astPruner) maybePruneOptional(elem *exprpb.Expr) (*exprpb.Expr, bool) {
- elemVal, found := p.value(elem.GetId())
+func (p *astPruner) maybePruneOptional(elem ast.Expr) (ast.Expr, bool) {
+ elemVal, found := p.value(elem.ID())
if found && elemVal.Type() == types.OptionalType {
opt := elemVal.(*types.Optional)
if !opt.HasValue() {
return nil, true
}
- if newElem, pruned := p.maybeCreateLiteral(elem.GetId(), opt.GetValue()); pruned {
+ if newElem, pruned := p.maybeCreateLiteral(elem.ID(), opt.GetValue()); pruned {
return newElem, true
}
}
return elem, false
}
-func (p *astPruner) maybePruneIn(node *exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *astPruner) maybePruneIn(node ast.Expr) (ast.Expr, bool) {
// elem in list
- call := node.GetCallExpr()
- val, exists := p.maybeValue(call.GetArgs()[1].GetId())
+ call := node.AsCall()
+ val, exists := p.maybeValue(call.Args()[1].ID())
if !exists {
return nil, false
}
if sz, ok := val.(traits.Sizer); ok && sz.Size() == types.IntZero {
- return p.maybeCreateLiteral(node.GetId(), types.False)
+ return p.maybeCreateLiteral(node.ID(), types.False)
}
return nil, false
}
-func (p *astPruner) maybePruneLogicalNot(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
- arg := call.GetArgs()[0]
- val, exists := p.maybeValue(arg.GetId())
+func (p *astPruner) maybePruneLogicalNot(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
+ arg := call.Args()[0]
+ val, exists := p.maybeValue(arg.ID())
if !exists {
return nil, false
}
if b, ok := val.(types.Bool); ok {
- return p.maybeCreateLiteral(node.GetId(), !b)
+ return p.maybeCreateLiteral(node.ID(), !b)
}
return nil, false
}
-func (p *astPruner) maybePruneOr(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
+func (p *astPruner) maybePruneOr(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
// We know result is unknown, so we have at least one unknown arg
// and if one side is a known value, we know we can ignore it.
- if v, exists := p.maybeValue(call.GetArgs()[0].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[0].ID()); exists {
if v == types.True {
- return p.maybeCreateLiteral(node.GetId(), types.True)
+ return p.maybeCreateLiteral(node.ID(), types.True)
}
- return call.GetArgs()[1], true
+ return call.Args()[1], true
}
- if v, exists := p.maybeValue(call.GetArgs()[1].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[1].ID()); exists {
if v == types.True {
- return p.maybeCreateLiteral(node.GetId(), types.True)
+ return p.maybeCreateLiteral(node.ID(), types.True)
}
- return call.GetArgs()[0], true
+ return call.Args()[0], true
}
return nil, false
}
-func (p *astPruner) maybePruneAnd(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
+func (p *astPruner) maybePruneAnd(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
// We know result is unknown, so we have at least one unknown arg
// and if one side is a known value, we know we can ignore it.
- if v, exists := p.maybeValue(call.GetArgs()[0].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[0].ID()); exists {
if v == types.False {
- return p.maybeCreateLiteral(node.GetId(), types.False)
+ return p.maybeCreateLiteral(node.ID(), types.False)
}
- return call.GetArgs()[1], true
+ return call.Args()[1], true
}
- if v, exists := p.maybeValue(call.GetArgs()[1].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[1].ID()); exists {
if v == types.False {
- return p.maybeCreateLiteral(node.GetId(), types.False)
+ return p.maybeCreateLiteral(node.ID(), types.False)
}
- return call.GetArgs()[0], true
+ return call.Args()[0], true
}
return nil, false
}
-func (p *astPruner) maybePruneConditional(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
- cond, exists := p.maybeValue(call.GetArgs()[0].GetId())
+func (p *astPruner) maybePruneConditional(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
+ cond, exists := p.maybeValue(call.Args()[0].ID())
if !exists {
return nil, false
}
if cond.Value().(bool) {
- return call.GetArgs()[1], true
+ return call.Args()[1], true
}
- return call.GetArgs()[2], true
+ return call.Args()[2], true
}
-func (p *astPruner) maybePruneFunction(node *exprpb.Expr) (*exprpb.Expr, bool) {
- if _, exists := p.value(node.GetId()); !exists {
+func (p *astPruner) maybePruneFunction(node ast.Expr) (ast.Expr, bool) {
+ if _, exists := p.value(node.ID()); !exists {
return nil, false
}
- call := node.GetCallExpr()
- if call.Function == operators.LogicalOr {
+ call := node.AsCall()
+ if call.FunctionName() == operators.LogicalOr {
return p.maybePruneOr(node)
}
- if call.Function == operators.LogicalAnd {
+ if call.FunctionName() == operators.LogicalAnd {
return p.maybePruneAnd(node)
}
- if call.Function == operators.Conditional {
+ if call.FunctionName() == operators.Conditional {
return p.maybePruneConditional(node)
}
- if call.Function == operators.In {
+ if call.FunctionName() == operators.In {
return p.maybePruneIn(node)
}
- if call.Function == operators.LogicalNot {
+ if call.FunctionName() == operators.LogicalNot {
return p.maybePruneLogicalNot(node)
}
return nil, false
}
-func (p *astPruner) maybePrune(node *exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *astPruner) maybePrune(node ast.Expr) (ast.Expr, bool) {
return p.prune(node)
}
-func (p *astPruner) prune(node *exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *astPruner) prune(node ast.Expr) (ast.Expr, bool) {
if node == nil {
return node, false
}
- val, valueExists := p.maybeValue(node.GetId())
+ val, valueExists := p.maybeValue(node.ID())
if valueExists {
- if newNode, ok := p.maybeCreateLiteral(node.GetId(), val); ok {
- delete(p.macroCalls, node.GetId())
+ if newNode, ok := p.maybeCreateLiteral(node.ID(), val); ok {
+ delete(p.macroCalls, node.ID())
return newNode, true
}
}
- if macro, found := p.macroCalls[node.GetId()]; found {
+ if macro, found := p.macroCalls[node.ID()]; found {
// Ensure that intermediate values for the comprehension are cleared during pruning
- compre := node.GetComprehensionExpr()
- if compre != nil {
- visit(macro, clearIterVarVisitor(compre.IterVar, p.state))
+ if node.Kind() == ast.ComprehensionKind {
+ compre := node.AsComprehension()
+ visit(macro, clearIterVarVisitor(compre.IterVar(), p.state))
}
// prune the expression in terms of the macro call instead of the expanded form.
if newMacro, pruned := p.prune(macro); pruned {
- p.macroCalls[node.GetId()] = newMacro
+ p.macroCalls[node.ID()] = newMacro
}
}
// We have either an unknown/error value, or something we don't want to
// transform, or expression was not evaluated. If possible, drill down
// more.
- switch node.GetExprKind().(type) {
- case *exprpb.Expr_SelectExpr:
- if operand, pruned := p.maybePrune(node.GetSelectExpr().GetOperand()); pruned {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_SelectExpr{
- SelectExpr: &exprpb.Expr_Select{
- Operand: operand,
- Field: node.GetSelectExpr().GetField(),
- TestOnly: node.GetSelectExpr().GetTestOnly(),
- },
- },
- }, true
- }
- case *exprpb.Expr_CallExpr:
- var prunedCall bool
- call := node.GetCallExpr()
- args := call.GetArgs()
- newArgs := make([]*exprpb.Expr, len(args))
- newCall := &exprpb.Expr_Call{
- Function: call.GetFunction(),
- Target: call.GetTarget(),
- Args: newArgs,
- }
- for i, arg := range args {
- newArgs[i] = arg
- if newArg, prunedArg := p.maybePrune(arg); prunedArg {
- prunedCall = true
- newArgs[i] = newArg
+ switch node.Kind() {
+ case ast.SelectKind:
+ sel := node.AsSelect()
+ if operand, isPruned := p.maybePrune(sel.Operand()); isPruned {
+ if sel.IsTestOnly() {
+ return p.NewPresenceTest(node.ID(), operand, sel.FieldName()), true
}
+ return p.NewSelect(node.ID(), operand, sel.FieldName()), true
}
- if newTarget, prunedTarget := p.maybePrune(call.GetTarget()); prunedTarget {
- prunedCall = true
- newCall.Target = newTarget
+ case ast.CallKind:
+ argsPruned := false
+ call := node.AsCall()
+ args := call.Args()
+ newArgs := make([]ast.Expr, len(args))
+ for i, a := range args {
+ newArgs[i] = a
+ if arg, isPruned := p.maybePrune(a); isPruned {
+ argsPruned = true
+ newArgs[i] = arg
+ }
}
- newNode := &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: newCall,
- },
+ if !call.IsMemberFunction() {
+ newCall := p.NewCall(node.ID(), call.FunctionName(), newArgs...)
+ if prunedCall, isPruned := p.maybePruneFunction(newCall); isPruned {
+ return prunedCall, true
+ }
+ return newCall, argsPruned
}
- if newExpr, pruned := p.maybePruneFunction(newNode); pruned {
- newExpr, _ = p.maybePrune(newExpr)
- return newExpr, true
+ newTarget := call.Target()
+ targetPruned := false
+ if prunedTarget, isPruned := p.maybePrune(call.Target()); isPruned {
+ targetPruned = true
+ newTarget = prunedTarget
}
- if prunedCall {
- return newNode, true
+ newCall := p.NewMemberCall(node.ID(), call.FunctionName(), newTarget, newArgs...)
+ if prunedCall, isPruned := p.maybePruneFunction(newCall); isPruned {
+ return prunedCall, true
}
- case *exprpb.Expr_ListExpr:
- elems := node.GetListExpr().GetElements()
- optIndices := node.GetListExpr().GetOptionalIndices()
+ return newCall, targetPruned || argsPruned
+ case ast.ListKind:
+ l := node.AsList()
+ elems := l.Elements()
+ optIndices := l.OptionalIndices()
optIndexMap := map[int32]bool{}
for _, i := range optIndices {
optIndexMap[i] = true
}
newOptIndexMap := make(map[int32]bool, len(optIndexMap))
- newElems := make([]*exprpb.Expr, 0, len(elems))
- var prunedList bool
-
+ newElems := make([]ast.Expr, 0, len(elems))
+ var listPruned bool
prunedIdx := 0
for i, elem := range elems {
_, isOpt := optIndexMap[int32(i)]
if isOpt {
newElem, pruned := p.maybePruneOptional(elem)
if pruned {
- prunedList = true
+ listPruned = true
if newElem != nil {
newElems = append(newElems, newElem)
prunedIdx++
@@ -431,7 +361,7 @@ func (p *astPruner) prune(node *exprpb.Expr) (*exprpb.Expr, bool) {
}
if newElem, prunedElem := p.maybePrune(elem); prunedElem {
newElems = append(newElems, newElem)
- prunedList = true
+ listPruned = true
} else {
newElems = append(newElems, elem)
}
@@ -443,76 +373,64 @@ func (p *astPruner) prune(node *exprpb.Expr) (*exprpb.Expr, bool) {
optIndices[idx] = i
idx++
}
- if prunedList {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: newElems,
- OptionalIndices: optIndices,
- },
- },
- }, true
+ if listPruned {
+ return p.NewList(node.ID(), newElems, optIndices), true
}
- case *exprpb.Expr_StructExpr:
- var prunedStruct bool
- entries := node.GetStructExpr().GetEntries()
- messageType := node.GetStructExpr().GetMessageName()
- newEntries := make([]*exprpb.Expr_CreateStruct_Entry, len(entries))
+ case ast.MapKind:
+ var mapPruned bool
+ m := node.AsMap()
+ entries := m.Entries()
+ newEntries := make([]ast.EntryExpr, len(entries))
for i, entry := range entries {
newEntries[i] = entry
- newKey, prunedKey := p.maybePrune(entry.GetMapKey())
- newValue, prunedValue := p.maybePrune(entry.GetValue())
- if !prunedKey && !prunedValue {
+ e := entry.AsMapEntry()
+ newKey, keyPruned := p.maybePrune(e.Key())
+ newValue, valuePruned := p.maybePrune(e.Value())
+ if !keyPruned && !valuePruned {
continue
}
- prunedStruct = true
- newEntry := &exprpb.Expr_CreateStruct_Entry{
- Value: newValue,
- }
- if messageType != "" {
- newEntry.KeyKind = &exprpb.Expr_CreateStruct_Entry_FieldKey{
- FieldKey: entry.GetFieldKey(),
- }
- } else {
- newEntry.KeyKind = &exprpb.Expr_CreateStruct_Entry_MapKey{
- MapKey: newKey,
- }
- }
- newEntry.OptionalEntry = entry.GetOptionalEntry()
+ mapPruned = true
+ newEntry := p.NewMapEntry(entry.ID(), newKey, newValue, e.IsOptional())
newEntries[i] = newEntry
}
- if prunedStruct {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- MessageName: messageType,
- Entries: newEntries,
- },
- },
- }, true
+ if mapPruned {
+ return p.NewMap(node.ID(), newEntries), true
}
- case *exprpb.Expr_ComprehensionExpr:
- compre := node.GetComprehensionExpr()
+ case ast.StructKind:
+ var structPruned bool
+ obj := node.AsStruct()
+ fields := obj.Fields()
+ newFields := make([]ast.EntryExpr, len(fields))
+ for i, field := range fields {
+ newFields[i] = field
+ f := field.AsStructField()
+ newValue, prunedValue := p.maybePrune(f.Value())
+ if !prunedValue {
+ continue
+ }
+ structPruned = true
+ newEntry := p.NewStructField(field.ID(), f.Name(), newValue, f.IsOptional())
+ newFields[i] = newEntry
+ }
+ if structPruned {
+ return p.NewStruct(node.ID(), obj.TypeName(), newFields), true
+ }
+ case ast.ComprehensionKind:
+ compre := node.AsComprehension()
// Only the range of the comprehension is pruned since the state tracking only records
// the last iteration of the comprehension and not each step in the evaluation which
// means that the any residuals computed in between might be inaccurate.
- if newRange, pruned := p.maybePrune(compre.GetIterRange()); pruned {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_ComprehensionExpr{
- ComprehensionExpr: &exprpb.Expr_Comprehension{
- IterVar: compre.GetIterVar(),
- IterRange: newRange,
- AccuVar: compre.GetAccuVar(),
- AccuInit: compre.GetAccuInit(),
- LoopCondition: compre.GetLoopCondition(),
- LoopStep: compre.GetLoopStep(),
- Result: compre.GetResult(),
- },
- },
- }, true
+ if newRange, pruned := p.maybePrune(compre.IterRange()); pruned {
+ return p.NewComprehension(
+ node.ID(),
+ newRange,
+ compre.IterVar(),
+ compre.AccuVar(),
+ compre.AccuInit(),
+ compre.LoopCondition(),
+ compre.LoopStep(),
+ compre.Result(),
+ ), true
}
}
return node, false
@@ -539,12 +457,12 @@ func (p *astPruner) nextID() int64 {
type astVisitor struct {
// visitEntry is called on every expr node, including those within a map/struct entry.
- visitExpr func(expr *exprpb.Expr)
+ visitExpr func(expr ast.Expr)
// visitEntry is called before entering the key, value of a map/struct entry.
- visitEntry func(entry *exprpb.Expr_CreateStruct_Entry)
+ visitEntry func(entry ast.EntryExpr)
}
-func getMaxID(expr *exprpb.Expr) int64 {
+func getMaxID(expr ast.Expr) int64 {
maxID := int64(1)
visit(expr, maxIDVisitor(&maxID))
return maxID
@@ -552,10 +470,9 @@ func getMaxID(expr *exprpb.Expr) int64 {
func clearIterVarVisitor(varName string, state EvalState) astVisitor {
return astVisitor{
- visitExpr: func(e *exprpb.Expr) {
- ident := e.GetIdentExpr()
- if ident != nil && ident.GetName() == varName {
- state.SetValue(e.GetId(), nil)
+ visitExpr: func(e ast.Expr) {
+ if e.Kind() == ast.IdentKind && e.AsIdent() == varName {
+ state.SetValue(e.ID(), nil)
}
},
}
@@ -563,56 +480,63 @@ func clearIterVarVisitor(varName string, state EvalState) astVisitor {
func maxIDVisitor(maxID *int64) astVisitor {
return astVisitor{
- visitExpr: func(e *exprpb.Expr) {
- if e.GetId() >= *maxID {
- *maxID = e.GetId() + 1
+ visitExpr: func(e ast.Expr) {
+ if e.ID() >= *maxID {
+ *maxID = e.ID() + 1
}
},
- visitEntry: func(e *exprpb.Expr_CreateStruct_Entry) {
- if e.GetId() >= *maxID {
- *maxID = e.GetId() + 1
+ visitEntry: func(e ast.EntryExpr) {
+ if e.ID() >= *maxID {
+ *maxID = e.ID() + 1
}
},
}
}
-func visit(expr *exprpb.Expr, visitor astVisitor) {
- exprs := []*exprpb.Expr{expr}
+func visit(expr ast.Expr, visitor astVisitor) {
+ exprs := []ast.Expr{expr}
for len(exprs) != 0 {
e := exprs[0]
if visitor.visitExpr != nil {
visitor.visitExpr(e)
}
exprs = exprs[1:]
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_SelectExpr:
- exprs = append(exprs, e.GetSelectExpr().GetOperand())
- case *exprpb.Expr_CallExpr:
- call := e.GetCallExpr()
- if call.GetTarget() != nil {
- exprs = append(exprs, call.GetTarget())
+ switch e.Kind() {
+ case ast.SelectKind:
+ exprs = append(exprs, e.AsSelect().Operand())
+ case ast.CallKind:
+ call := e.AsCall()
+ if call.Target() != nil {
+ exprs = append(exprs, call.Target())
}
- exprs = append(exprs, call.GetArgs()...)
- case *exprpb.Expr_ComprehensionExpr:
- compre := e.GetComprehensionExpr()
+ exprs = append(exprs, call.Args()...)
+ case ast.ComprehensionKind:
+ compre := e.AsComprehension()
exprs = append(exprs,
- compre.GetIterRange(),
- compre.GetAccuInit(),
- compre.GetLoopCondition(),
- compre.GetLoopStep(),
- compre.GetResult())
- case *exprpb.Expr_ListExpr:
- list := e.GetListExpr()
- exprs = append(exprs, list.GetElements()...)
- case *exprpb.Expr_StructExpr:
- for _, entry := range e.GetStructExpr().GetEntries() {
+ compre.IterRange(),
+ compre.AccuInit(),
+ compre.LoopCondition(),
+ compre.LoopStep(),
+ compre.Result())
+ case ast.ListKind:
+ list := e.AsList()
+ exprs = append(exprs, list.Elements()...)
+ case ast.MapKind:
+ for _, entry := range e.AsMap().Entries() {
+ e := entry.AsMapEntry()
if visitor.visitEntry != nil {
visitor.visitEntry(entry)
}
- if entry.GetMapKey() != nil {
- exprs = append(exprs, entry.GetMapKey())
+ exprs = append(exprs, e.Key())
+ exprs = append(exprs, e.Value())
+ }
+ case ast.StructKind:
+ for _, entry := range e.AsStruct().Fields() {
+ f := entry.AsStructField()
+ if visitor.visitEntry != nil {
+ visitor.visitEntry(entry)
}
- exprs = append(exprs, entry.GetValue())
+ exprs = append(exprs, f.Value())
}
}
}
diff --git a/vendor/github.com/google/cel-go/parser/BUILD.bazel b/vendor/github.com/google/cel-go/parser/BUILD.bazel
index 67ecc955439..97bc9bd4344 100644
--- a/vendor/github.com/google/cel-go/parser/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/parser/BUILD.bazel
@@ -20,10 +20,13 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//common:go_default_library",
+ "//common/ast:go_default_library",
"//common/operators:go_default_library",
"//common/runes:go_default_library",
+ "//common/types:go_default_library",
+ "//common/types/ref:go_default_library",
"//parser/gen:go_default_library",
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
+ "@com_github_antlr4_go_antlr_v4//:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/known/structpb:go_default_library",
@@ -43,10 +46,12 @@ go_test(
":go_default_library",
],
deps = [
+ "//common/ast:go_default_library",
"//common/debug:go_default_library",
+ "//common/types:go_default_library",
"//parser/gen:go_default_library",
"//test:go_default_library",
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
+ "@com_github_antlr4_go_antlr_v4//:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//testing/protocmp:go_default_library",
],
diff --git a/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel b/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel
index 654d1de7aad..e7043348347 100644
--- a/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel
@@ -21,6 +21,6 @@ go_library(
],
importpath = "github.com/google/cel-go/parser/gen",
deps = [
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
+ "@com_github_antlr4_go_antlr_v4//:go_default_library",
],
)
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
index 0247f470a7c..c49d038676b 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
@@ -1,7 +1,7 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
// BaseCELListener is a complete listener for a parse tree produced by CELParser.
type BaseCELListener struct{}
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
index 52a7f4dc57e..b2c0783d390 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
@@ -1,7 +1,8 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
+
type BaseCELVisitor struct {
*antlr.BaseParseTreeVisitor
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go b/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
index 98ddc06d0bd..e026cc46f0f 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
@@ -1,280 +1,278 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen
-
import (
"fmt"
- "sync"
+ "sync"
"unicode"
-
- "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ "github.com/antlr4-go/antlr/v4"
)
-
// Suppress unused import error
var _ = fmt.Printf
var _ = sync.Once{}
var _ = unicode.IsLetter
+
type CELLexer struct {
*antlr.BaseLexer
channelNames []string
- modeNames []string
+ modeNames []string
// TODO: EOF string
}
-var cellexerLexerStaticData struct {
- once sync.Once
- serializedATN []int32
- channelNames []string
- modeNames []string
- literalNames []string
- symbolicNames []string
- ruleNames []string
- predictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
+var CELLexerLexerStaticData struct {
+ once sync.Once
+ serializedATN []int32
+ ChannelNames []string
+ ModeNames []string
+ LiteralNames []string
+ SymbolicNames []string
+ RuleNames []string
+ PredictionContextCache *antlr.PredictionContextCache
+ atn *antlr.ATN
+ decisionToDFA []*antlr.DFA
}
func cellexerLexerInit() {
- staticData := &cellexerLexerStaticData
- staticData.channelNames = []string{
- "DEFAULT_TOKEN_CHANNEL", "HIDDEN",
- }
- staticData.modeNames = []string{
- "DEFAULT_MODE",
- }
- staticData.literalNames = []string{
- "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
- "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
- "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
- }
- staticData.symbolicNames = []string{
- "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
- "STRING", "BYTES", "IDENTIFIER",
- }
- staticData.ruleNames = []string{
- "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "BACKSLASH", "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW",
- "ESC_SEQ", "ESC_CHAR_SEQ", "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ",
- "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING",
- "BYTES", "IDENTIFIER",
- }
- staticData.predictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 0, 36, 423, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
- 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
- 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
- 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
- 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
- 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
- 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36,
- 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7,
- 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46,
- 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4,
- 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8,
- 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13,
- 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1,
- 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24,
- 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1,
- 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29,
- 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 177, 8, 31, 1, 31, 4, 31, 180, 8, 31,
- 11, 31, 12, 31, 181, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1,
- 34, 3, 34, 192, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36,
- 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1,
- 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
- 1, 38, 1, 38, 1, 38, 3, 38, 225, 8, 38, 1, 39, 4, 39, 228, 8, 39, 11, 39,
- 12, 39, 229, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 238, 8, 40,
- 10, 40, 12, 40, 241, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 246, 8, 41, 11,
- 41, 12, 41, 247, 1, 41, 1, 41, 4, 41, 252, 8, 41, 11, 41, 12, 41, 253,
- 1, 41, 3, 41, 257, 8, 41, 1, 41, 4, 41, 260, 8, 41, 11, 41, 12, 41, 261,
- 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 268, 8, 41, 11, 41, 12, 41, 269, 1,
- 41, 3, 41, 273, 8, 41, 3, 41, 275, 8, 41, 1, 42, 4, 42, 278, 8, 42, 11,
- 42, 12, 42, 279, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 286, 8, 42, 11, 42,
- 12, 42, 287, 3, 42, 290, 8, 42, 1, 43, 4, 43, 293, 8, 43, 11, 43, 12, 43,
- 294, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 303, 8, 43, 11, 43,
- 12, 43, 304, 1, 43, 1, 43, 3, 43, 309, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44,
- 314, 8, 44, 10, 44, 12, 44, 317, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5,
- 44, 323, 8, 44, 10, 44, 12, 44, 326, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44,
- 1, 44, 1, 44, 1, 44, 5, 44, 335, 8, 44, 10, 44, 12, 44, 338, 9, 44, 1,
- 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 349,
- 8, 44, 10, 44, 12, 44, 352, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
- 44, 5, 44, 360, 8, 44, 10, 44, 12, 44, 363, 9, 44, 1, 44, 1, 44, 1, 44,
- 1, 44, 1, 44, 5, 44, 370, 8, 44, 10, 44, 12, 44, 373, 9, 44, 1, 44, 1,
- 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 383, 8, 44, 10, 44,
- 12, 44, 386, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
- 44, 1, 44, 1, 44, 5, 44, 398, 8, 44, 10, 44, 12, 44, 401, 9, 44, 1, 44,
- 1, 44, 1, 44, 1, 44, 3, 44, 407, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1,
- 46, 3, 46, 414, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 419, 8, 46, 10, 46,
- 12, 46, 422, 9, 46, 4, 336, 350, 384, 399, 0, 47, 1, 1, 3, 2, 5, 3, 7,
- 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27,
- 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45,
- 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0,
- 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31,
- 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 1, 0, 16, 2, 0, 65, 90, 97, 122,
- 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97,
- 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96,
- 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120,
- 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117,
- 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92,
- 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39,
- 39, 2, 0, 66, 66, 98, 98, 456, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5,
- 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13,
- 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0,
- 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0,
- 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0,
- 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0,
- 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1,
- 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81,
- 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0,
- 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0,
- 3, 98, 1, 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 106, 1, 0,
- 0, 0, 11, 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17,
- 117, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 122, 1, 0, 0, 0, 23, 124, 1,
- 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 130, 1, 0, 0, 0,
- 31, 132, 1, 0, 0, 0, 33, 134, 1, 0, 0, 0, 35, 136, 1, 0, 0, 0, 37, 138,
- 1, 0, 0, 0, 39, 140, 1, 0, 0, 0, 41, 142, 1, 0, 0, 0, 43, 144, 1, 0, 0,
- 0, 45, 146, 1, 0, 0, 0, 47, 148, 1, 0, 0, 0, 49, 150, 1, 0, 0, 0, 51, 152,
- 1, 0, 0, 0, 53, 157, 1, 0, 0, 0, 55, 163, 1, 0, 0, 0, 57, 168, 1, 0, 0,
- 0, 59, 170, 1, 0, 0, 0, 61, 172, 1, 0, 0, 0, 63, 174, 1, 0, 0, 0, 65, 183,
- 1, 0, 0, 0, 67, 185, 1, 0, 0, 0, 69, 191, 1, 0, 0, 0, 71, 193, 1, 0, 0,
- 0, 73, 196, 1, 0, 0, 0, 75, 201, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227,
- 1, 0, 0, 0, 81, 233, 1, 0, 0, 0, 83, 274, 1, 0, 0, 0, 85, 289, 1, 0, 0,
- 0, 87, 308, 1, 0, 0, 0, 89, 406, 1, 0, 0, 0, 91, 408, 1, 0, 0, 0, 93, 413,
- 1, 0, 0, 0, 95, 96, 5, 61, 0, 0, 96, 97, 5, 61, 0, 0, 97, 2, 1, 0, 0, 0,
- 98, 99, 5, 33, 0, 0, 99, 100, 5, 61, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102,
- 5, 105, 0, 0, 102, 103, 5, 110, 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5,
- 60, 0, 0, 105, 8, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 108, 5, 61, 0,
- 0, 108, 10, 1, 0, 0, 0, 109, 110, 5, 62, 0, 0, 110, 111, 5, 61, 0, 0, 111,
- 12, 1, 0, 0, 0, 112, 113, 5, 62, 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5,
- 38, 0, 0, 115, 116, 5, 38, 0, 0, 116, 16, 1, 0, 0, 0, 117, 118, 5, 124,
- 0, 0, 118, 119, 5, 124, 0, 0, 119, 18, 1, 0, 0, 0, 120, 121, 5, 91, 0,
- 0, 121, 20, 1, 0, 0, 0, 122, 123, 5, 93, 0, 0, 123, 22, 1, 0, 0, 0, 124,
- 125, 5, 123, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 125, 0, 0, 127, 26,
- 1, 0, 0, 0, 128, 129, 5, 40, 0, 0, 129, 28, 1, 0, 0, 0, 130, 131, 5, 41,
- 0, 0, 131, 30, 1, 0, 0, 0, 132, 133, 5, 46, 0, 0, 133, 32, 1, 0, 0, 0,
- 134, 135, 5, 44, 0, 0, 135, 34, 1, 0, 0, 0, 136, 137, 5, 45, 0, 0, 137,
- 36, 1, 0, 0, 0, 138, 139, 5, 33, 0, 0, 139, 38, 1, 0, 0, 0, 140, 141, 5,
- 63, 0, 0, 141, 40, 1, 0, 0, 0, 142, 143, 5, 58, 0, 0, 143, 42, 1, 0, 0,
- 0, 144, 145, 5, 43, 0, 0, 145, 44, 1, 0, 0, 0, 146, 147, 5, 42, 0, 0, 147,
- 46, 1, 0, 0, 0, 148, 149, 5, 47, 0, 0, 149, 48, 1, 0, 0, 0, 150, 151, 5,
- 37, 0, 0, 151, 50, 1, 0, 0, 0, 152, 153, 5, 116, 0, 0, 153, 154, 5, 114,
- 0, 0, 154, 155, 5, 117, 0, 0, 155, 156, 5, 101, 0, 0, 156, 52, 1, 0, 0,
- 0, 157, 158, 5, 102, 0, 0, 158, 159, 5, 97, 0, 0, 159, 160, 5, 108, 0,
- 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 54, 1, 0, 0, 0,
- 163, 164, 5, 110, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 108, 0, 0,
- 166, 167, 5, 108, 0, 0, 167, 56, 1, 0, 0, 0, 168, 169, 5, 92, 0, 0, 169,
- 58, 1, 0, 0, 0, 170, 171, 7, 0, 0, 0, 171, 60, 1, 0, 0, 0, 172, 173, 2,
- 48, 57, 0, 173, 62, 1, 0, 0, 0, 174, 176, 7, 1, 0, 0, 175, 177, 7, 2, 0,
- 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178,
- 180, 3, 61, 30, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179,
- 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 64, 1, 0, 0, 0, 183, 184, 7, 3,
- 0, 0, 184, 66, 1, 0, 0, 0, 185, 186, 7, 4, 0, 0, 186, 68, 1, 0, 0, 0, 187,
- 192, 3, 71, 35, 0, 188, 192, 3, 75, 37, 0, 189, 192, 3, 77, 38, 0, 190,
- 192, 3, 73, 36, 0, 191, 187, 1, 0, 0, 0, 191, 188, 1, 0, 0, 0, 191, 189,
- 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 70, 1, 0, 0, 0, 193, 194, 3, 57,
- 28, 0, 194, 195, 7, 5, 0, 0, 195, 72, 1, 0, 0, 0, 196, 197, 3, 57, 28,
- 0, 197, 198, 2, 48, 51, 0, 198, 199, 2, 48, 55, 0, 199, 200, 2, 48, 55,
- 0, 200, 74, 1, 0, 0, 0, 201, 202, 3, 57, 28, 0, 202, 203, 7, 6, 0, 0, 203,
- 204, 3, 65, 32, 0, 204, 205, 3, 65, 32, 0, 205, 76, 1, 0, 0, 0, 206, 207,
- 3, 57, 28, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 65, 32, 0, 209, 210,
- 3, 65, 32, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 225,
- 1, 0, 0, 0, 213, 214, 3, 57, 28, 0, 214, 215, 5, 85, 0, 0, 215, 216, 3,
- 65, 32, 0, 216, 217, 3, 65, 32, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3,
- 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3,
- 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 225, 1, 0, 0, 0, 224, 206, 1, 0,
- 0, 0, 224, 213, 1, 0, 0, 0, 225, 78, 1, 0, 0, 0, 226, 228, 7, 7, 0, 0,
- 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229,
- 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 6, 39, 0, 0, 232, 80,
- 1, 0, 0, 0, 233, 234, 5, 47, 0, 0, 234, 235, 5, 47, 0, 0, 235, 239, 1,
- 0, 0, 0, 236, 238, 8, 8, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0,
- 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241,
- 239, 1, 0, 0, 0, 242, 243, 6, 40, 0, 0, 243, 82, 1, 0, 0, 0, 244, 246,
- 3, 61, 30, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 245, 1,
- 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 5, 46, 0,
- 0, 250, 252, 3, 61, 30, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0,
- 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255,
- 257, 3, 63, 31, 0, 256, 255, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 275,
- 1, 0, 0, 0, 258, 260, 3, 61, 30, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1,
- 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0,
- 0, 263, 264, 3, 63, 31, 0, 264, 275, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0,
- 266, 268, 3, 61, 30, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269,
- 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 273,
- 3, 63, 31, 0, 272, 271, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1,
- 0, 0, 0, 274, 245, 1, 0, 0, 0, 274, 259, 1, 0, 0, 0, 274, 265, 1, 0, 0,
- 0, 275, 84, 1, 0, 0, 0, 276, 278, 3, 61, 30, 0, 277, 276, 1, 0, 0, 0, 278,
- 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 290,
- 1, 0, 0, 0, 281, 282, 5, 48, 0, 0, 282, 283, 5, 120, 0, 0, 283, 285, 1,
- 0, 0, 0, 284, 286, 3, 65, 32, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0,
- 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0,
- 289, 277, 1, 0, 0, 0, 289, 281, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 293,
- 3, 61, 30, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1,
- 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 7, 9, 0,
- 0, 297, 309, 1, 0, 0, 0, 298, 299, 5, 48, 0, 0, 299, 300, 5, 120, 0, 0,
- 300, 302, 1, 0, 0, 0, 301, 303, 3, 65, 32, 0, 302, 301, 1, 0, 0, 0, 303,
- 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306,
- 1, 0, 0, 0, 306, 307, 7, 9, 0, 0, 307, 309, 1, 0, 0, 0, 308, 292, 1, 0,
- 0, 0, 308, 298, 1, 0, 0, 0, 309, 88, 1, 0, 0, 0, 310, 315, 5, 34, 0, 0,
- 311, 314, 3, 69, 34, 0, 312, 314, 8, 10, 0, 0, 313, 311, 1, 0, 0, 0, 313,
- 312, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316,
- 1, 0, 0, 0, 316, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 407, 5, 34,
- 0, 0, 319, 324, 5, 39, 0, 0, 320, 323, 3, 69, 34, 0, 321, 323, 8, 11, 0,
- 0, 322, 320, 1, 0, 0, 0, 322, 321, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324,
- 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 327, 1, 0, 0, 0, 326, 324,
- 1, 0, 0, 0, 327, 407, 5, 39, 0, 0, 328, 329, 5, 34, 0, 0, 329, 330, 5,
- 34, 0, 0, 330, 331, 5, 34, 0, 0, 331, 336, 1, 0, 0, 0, 332, 335, 3, 69,
- 34, 0, 333, 335, 8, 12, 0, 0, 334, 332, 1, 0, 0, 0, 334, 333, 1, 0, 0,
- 0, 335, 338, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337,
- 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 340, 5, 34, 0, 0, 340, 341,
- 5, 34, 0, 0, 341, 407, 5, 34, 0, 0, 342, 343, 5, 39, 0, 0, 343, 344, 5,
- 39, 0, 0, 344, 345, 5, 39, 0, 0, 345, 350, 1, 0, 0, 0, 346, 349, 3, 69,
- 34, 0, 347, 349, 8, 12, 0, 0, 348, 346, 1, 0, 0, 0, 348, 347, 1, 0, 0,
- 0, 349, 352, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 351,
- 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 354, 5, 39, 0, 0, 354, 355,
- 5, 39, 0, 0, 355, 407, 5, 39, 0, 0, 356, 357, 3, 67, 33, 0, 357, 361, 5,
- 34, 0, 0, 358, 360, 8, 13, 0, 0, 359, 358, 1, 0, 0, 0, 360, 363, 1, 0,
- 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 364, 1, 0, 0, 0,
- 363, 361, 1, 0, 0, 0, 364, 365, 5, 34, 0, 0, 365, 407, 1, 0, 0, 0, 366,
- 367, 3, 67, 33, 0, 367, 371, 5, 39, 0, 0, 368, 370, 8, 14, 0, 0, 369, 368,
- 1, 0, 0, 0, 370, 373, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0,
- 0, 0, 372, 374, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 375, 5, 39, 0, 0,
- 375, 407, 1, 0, 0, 0, 376, 377, 3, 67, 33, 0, 377, 378, 5, 34, 0, 0, 378,
- 379, 5, 34, 0, 0, 379, 380, 5, 34, 0, 0, 380, 384, 1, 0, 0, 0, 381, 383,
- 9, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 385, 1, 0,
- 0, 0, 384, 382, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0,
- 387, 388, 5, 34, 0, 0, 388, 389, 5, 34, 0, 0, 389, 390, 5, 34, 0, 0, 390,
- 407, 1, 0, 0, 0, 391, 392, 3, 67, 33, 0, 392, 393, 5, 39, 0, 0, 393, 394,
- 5, 39, 0, 0, 394, 395, 5, 39, 0, 0, 395, 399, 1, 0, 0, 0, 396, 398, 9,
- 0, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 400, 1, 0, 0,
- 0, 399, 397, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402,
- 403, 5, 39, 0, 0, 403, 404, 5, 39, 0, 0, 404, 405, 5, 39, 0, 0, 405, 407,
- 1, 0, 0, 0, 406, 310, 1, 0, 0, 0, 406, 319, 1, 0, 0, 0, 406, 328, 1, 0,
- 0, 0, 406, 342, 1, 0, 0, 0, 406, 356, 1, 0, 0, 0, 406, 366, 1, 0, 0, 0,
- 406, 376, 1, 0, 0, 0, 406, 391, 1, 0, 0, 0, 407, 90, 1, 0, 0, 0, 408, 409,
- 7, 15, 0, 0, 409, 410, 3, 89, 44, 0, 410, 92, 1, 0, 0, 0, 411, 414, 3,
- 59, 29, 0, 412, 414, 5, 95, 0, 0, 413, 411, 1, 0, 0, 0, 413, 412, 1, 0,
- 0, 0, 414, 420, 1, 0, 0, 0, 415, 419, 3, 59, 29, 0, 416, 419, 3, 61, 30,
- 0, 417, 419, 5, 95, 0, 0, 418, 415, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 418,
- 417, 1, 0, 0, 0, 419, 422, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 421,
- 1, 0, 0, 0, 421, 94, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 36, 0, 176, 181,
- 191, 224, 229, 239, 247, 253, 256, 261, 269, 272, 274, 279, 287, 289, 294,
- 304, 308, 313, 315, 322, 324, 334, 336, 348, 350, 361, 371, 384, 399, 406,
- 413, 418, 420, 1, 0, 1, 0,
- }
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
+ staticData := &CELLexerLexerStaticData
+ staticData.ChannelNames = []string{
+ "DEFAULT_TOKEN_CHANNEL", "HIDDEN",
+ }
+ staticData.ModeNames = []string{
+ "DEFAULT_MODE",
+ }
+ staticData.LiteralNames = []string{
+ "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
+ "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
+ "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
+ }
+ staticData.SymbolicNames = []string{
+ "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
+ "STRING", "BYTES", "IDENTIFIER",
+ }
+ staticData.RuleNames = []string{
+ "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "BACKSLASH", "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW",
+ "ESC_SEQ", "ESC_CHAR_SEQ", "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ",
+ "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING",
+ "BYTES", "IDENTIFIER",
+ }
+ staticData.PredictionContextCache = antlr.NewPredictionContextCache()
+ staticData.serializedATN = []int32{
+ 4, 0, 36, 423, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
+ 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
+ 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
+ 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
+ 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
+ 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
+ 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36,
+ 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7,
+ 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46,
+ 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4,
+ 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8,
+ 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13,
+ 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1,
+ 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24,
+ 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1,
+ 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29,
+ 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 177, 8, 31, 1, 31, 4, 31, 180, 8, 31,
+ 11, 31, 12, 31, 181, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1,
+ 34, 3, 34, 192, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36,
+ 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1,
+ 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
+ 1, 38, 1, 38, 1, 38, 3, 38, 225, 8, 38, 1, 39, 4, 39, 228, 8, 39, 11, 39,
+ 12, 39, 229, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 238, 8, 40,
+ 10, 40, 12, 40, 241, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 246, 8, 41, 11,
+ 41, 12, 41, 247, 1, 41, 1, 41, 4, 41, 252, 8, 41, 11, 41, 12, 41, 253,
+ 1, 41, 3, 41, 257, 8, 41, 1, 41, 4, 41, 260, 8, 41, 11, 41, 12, 41, 261,
+ 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 268, 8, 41, 11, 41, 12, 41, 269, 1,
+ 41, 3, 41, 273, 8, 41, 3, 41, 275, 8, 41, 1, 42, 4, 42, 278, 8, 42, 11,
+ 42, 12, 42, 279, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 286, 8, 42, 11, 42,
+ 12, 42, 287, 3, 42, 290, 8, 42, 1, 43, 4, 43, 293, 8, 43, 11, 43, 12, 43,
+ 294, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 303, 8, 43, 11, 43,
+ 12, 43, 304, 1, 43, 1, 43, 3, 43, 309, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44,
+ 314, 8, 44, 10, 44, 12, 44, 317, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5,
+ 44, 323, 8, 44, 10, 44, 12, 44, 326, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44,
+ 1, 44, 1, 44, 1, 44, 5, 44, 335, 8, 44, 10, 44, 12, 44, 338, 9, 44, 1,
+ 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 349,
+ 8, 44, 10, 44, 12, 44, 352, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
+ 44, 5, 44, 360, 8, 44, 10, 44, 12, 44, 363, 9, 44, 1, 44, 1, 44, 1, 44,
+ 1, 44, 1, 44, 5, 44, 370, 8, 44, 10, 44, 12, 44, 373, 9, 44, 1, 44, 1,
+ 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 383, 8, 44, 10, 44,
+ 12, 44, 386, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
+ 44, 1, 44, 1, 44, 5, 44, 398, 8, 44, 10, 44, 12, 44, 401, 9, 44, 1, 44,
+ 1, 44, 1, 44, 1, 44, 3, 44, 407, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1,
+ 46, 3, 46, 414, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 419, 8, 46, 10, 46,
+ 12, 46, 422, 9, 46, 4, 336, 350, 384, 399, 0, 47, 1, 1, 3, 2, 5, 3, 7,
+ 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27,
+ 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45,
+ 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0,
+ 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31,
+ 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 1, 0, 16, 2, 0, 65, 90, 97, 122,
+ 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97,
+ 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96,
+ 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120,
+ 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117,
+ 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92,
+ 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39,
+ 39, 2, 0, 66, 66, 98, 98, 456, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5,
+ 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13,
+ 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0,
+ 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0,
+ 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0,
+ 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0,
+ 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1,
+ 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81,
+ 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0,
+ 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0,
+ 3, 98, 1, 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 106, 1, 0,
+ 0, 0, 11, 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17,
+ 117, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 122, 1, 0, 0, 0, 23, 124, 1,
+ 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 130, 1, 0, 0, 0,
+ 31, 132, 1, 0, 0, 0, 33, 134, 1, 0, 0, 0, 35, 136, 1, 0, 0, 0, 37, 138,
+ 1, 0, 0, 0, 39, 140, 1, 0, 0, 0, 41, 142, 1, 0, 0, 0, 43, 144, 1, 0, 0,
+ 0, 45, 146, 1, 0, 0, 0, 47, 148, 1, 0, 0, 0, 49, 150, 1, 0, 0, 0, 51, 152,
+ 1, 0, 0, 0, 53, 157, 1, 0, 0, 0, 55, 163, 1, 0, 0, 0, 57, 168, 1, 0, 0,
+ 0, 59, 170, 1, 0, 0, 0, 61, 172, 1, 0, 0, 0, 63, 174, 1, 0, 0, 0, 65, 183,
+ 1, 0, 0, 0, 67, 185, 1, 0, 0, 0, 69, 191, 1, 0, 0, 0, 71, 193, 1, 0, 0,
+ 0, 73, 196, 1, 0, 0, 0, 75, 201, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227,
+ 1, 0, 0, 0, 81, 233, 1, 0, 0, 0, 83, 274, 1, 0, 0, 0, 85, 289, 1, 0, 0,
+ 0, 87, 308, 1, 0, 0, 0, 89, 406, 1, 0, 0, 0, 91, 408, 1, 0, 0, 0, 93, 413,
+ 1, 0, 0, 0, 95, 96, 5, 61, 0, 0, 96, 97, 5, 61, 0, 0, 97, 2, 1, 0, 0, 0,
+ 98, 99, 5, 33, 0, 0, 99, 100, 5, 61, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102,
+ 5, 105, 0, 0, 102, 103, 5, 110, 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5,
+ 60, 0, 0, 105, 8, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 108, 5, 61, 0,
+ 0, 108, 10, 1, 0, 0, 0, 109, 110, 5, 62, 0, 0, 110, 111, 5, 61, 0, 0, 111,
+ 12, 1, 0, 0, 0, 112, 113, 5, 62, 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5,
+ 38, 0, 0, 115, 116, 5, 38, 0, 0, 116, 16, 1, 0, 0, 0, 117, 118, 5, 124,
+ 0, 0, 118, 119, 5, 124, 0, 0, 119, 18, 1, 0, 0, 0, 120, 121, 5, 91, 0,
+ 0, 121, 20, 1, 0, 0, 0, 122, 123, 5, 93, 0, 0, 123, 22, 1, 0, 0, 0, 124,
+ 125, 5, 123, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 125, 0, 0, 127, 26,
+ 1, 0, 0, 0, 128, 129, 5, 40, 0, 0, 129, 28, 1, 0, 0, 0, 130, 131, 5, 41,
+ 0, 0, 131, 30, 1, 0, 0, 0, 132, 133, 5, 46, 0, 0, 133, 32, 1, 0, 0, 0,
+ 134, 135, 5, 44, 0, 0, 135, 34, 1, 0, 0, 0, 136, 137, 5, 45, 0, 0, 137,
+ 36, 1, 0, 0, 0, 138, 139, 5, 33, 0, 0, 139, 38, 1, 0, 0, 0, 140, 141, 5,
+ 63, 0, 0, 141, 40, 1, 0, 0, 0, 142, 143, 5, 58, 0, 0, 143, 42, 1, 0, 0,
+ 0, 144, 145, 5, 43, 0, 0, 145, 44, 1, 0, 0, 0, 146, 147, 5, 42, 0, 0, 147,
+ 46, 1, 0, 0, 0, 148, 149, 5, 47, 0, 0, 149, 48, 1, 0, 0, 0, 150, 151, 5,
+ 37, 0, 0, 151, 50, 1, 0, 0, 0, 152, 153, 5, 116, 0, 0, 153, 154, 5, 114,
+ 0, 0, 154, 155, 5, 117, 0, 0, 155, 156, 5, 101, 0, 0, 156, 52, 1, 0, 0,
+ 0, 157, 158, 5, 102, 0, 0, 158, 159, 5, 97, 0, 0, 159, 160, 5, 108, 0,
+ 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 54, 1, 0, 0, 0,
+ 163, 164, 5, 110, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 108, 0, 0,
+ 166, 167, 5, 108, 0, 0, 167, 56, 1, 0, 0, 0, 168, 169, 5, 92, 0, 0, 169,
+ 58, 1, 0, 0, 0, 170, 171, 7, 0, 0, 0, 171, 60, 1, 0, 0, 0, 172, 173, 2,
+ 48, 57, 0, 173, 62, 1, 0, 0, 0, 174, 176, 7, 1, 0, 0, 175, 177, 7, 2, 0,
+ 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178,
+ 180, 3, 61, 30, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179,
+ 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 64, 1, 0, 0, 0, 183, 184, 7, 3,
+ 0, 0, 184, 66, 1, 0, 0, 0, 185, 186, 7, 4, 0, 0, 186, 68, 1, 0, 0, 0, 187,
+ 192, 3, 71, 35, 0, 188, 192, 3, 75, 37, 0, 189, 192, 3, 77, 38, 0, 190,
+ 192, 3, 73, 36, 0, 191, 187, 1, 0, 0, 0, 191, 188, 1, 0, 0, 0, 191, 189,
+ 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 70, 1, 0, 0, 0, 193, 194, 3, 57,
+ 28, 0, 194, 195, 7, 5, 0, 0, 195, 72, 1, 0, 0, 0, 196, 197, 3, 57, 28,
+ 0, 197, 198, 2, 48, 51, 0, 198, 199, 2, 48, 55, 0, 199, 200, 2, 48, 55,
+ 0, 200, 74, 1, 0, 0, 0, 201, 202, 3, 57, 28, 0, 202, 203, 7, 6, 0, 0, 203,
+ 204, 3, 65, 32, 0, 204, 205, 3, 65, 32, 0, 205, 76, 1, 0, 0, 0, 206, 207,
+ 3, 57, 28, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 65, 32, 0, 209, 210,
+ 3, 65, 32, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 225,
+ 1, 0, 0, 0, 213, 214, 3, 57, 28, 0, 214, 215, 5, 85, 0, 0, 215, 216, 3,
+ 65, 32, 0, 216, 217, 3, 65, 32, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3,
+ 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3,
+ 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 225, 1, 0, 0, 0, 224, 206, 1, 0,
+ 0, 0, 224, 213, 1, 0, 0, 0, 225, 78, 1, 0, 0, 0, 226, 228, 7, 7, 0, 0,
+ 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229,
+ 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 6, 39, 0, 0, 232, 80,
+ 1, 0, 0, 0, 233, 234, 5, 47, 0, 0, 234, 235, 5, 47, 0, 0, 235, 239, 1,
+ 0, 0, 0, 236, 238, 8, 8, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0,
+ 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241,
+ 239, 1, 0, 0, 0, 242, 243, 6, 40, 0, 0, 243, 82, 1, 0, 0, 0, 244, 246,
+ 3, 61, 30, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 245, 1,
+ 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 5, 46, 0,
+ 0, 250, 252, 3, 61, 30, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0,
+ 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255,
+ 257, 3, 63, 31, 0, 256, 255, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 275,
+ 1, 0, 0, 0, 258, 260, 3, 61, 30, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1,
+ 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0,
+ 0, 263, 264, 3, 63, 31, 0, 264, 275, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0,
+ 266, 268, 3, 61, 30, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269,
+ 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 273,
+ 3, 63, 31, 0, 272, 271, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1,
+ 0, 0, 0, 274, 245, 1, 0, 0, 0, 274, 259, 1, 0, 0, 0, 274, 265, 1, 0, 0,
+ 0, 275, 84, 1, 0, 0, 0, 276, 278, 3, 61, 30, 0, 277, 276, 1, 0, 0, 0, 278,
+ 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 290,
+ 1, 0, 0, 0, 281, 282, 5, 48, 0, 0, 282, 283, 5, 120, 0, 0, 283, 285, 1,
+ 0, 0, 0, 284, 286, 3, 65, 32, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0,
+ 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0,
+ 289, 277, 1, 0, 0, 0, 289, 281, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 293,
+ 3, 61, 30, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1,
+ 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 7, 9, 0,
+ 0, 297, 309, 1, 0, 0, 0, 298, 299, 5, 48, 0, 0, 299, 300, 5, 120, 0, 0,
+ 300, 302, 1, 0, 0, 0, 301, 303, 3, 65, 32, 0, 302, 301, 1, 0, 0, 0, 303,
+ 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306,
+ 1, 0, 0, 0, 306, 307, 7, 9, 0, 0, 307, 309, 1, 0, 0, 0, 308, 292, 1, 0,
+ 0, 0, 308, 298, 1, 0, 0, 0, 309, 88, 1, 0, 0, 0, 310, 315, 5, 34, 0, 0,
+ 311, 314, 3, 69, 34, 0, 312, 314, 8, 10, 0, 0, 313, 311, 1, 0, 0, 0, 313,
+ 312, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316,
+ 1, 0, 0, 0, 316, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 407, 5, 34,
+ 0, 0, 319, 324, 5, 39, 0, 0, 320, 323, 3, 69, 34, 0, 321, 323, 8, 11, 0,
+ 0, 322, 320, 1, 0, 0, 0, 322, 321, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324,
+ 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 327, 1, 0, 0, 0, 326, 324,
+ 1, 0, 0, 0, 327, 407, 5, 39, 0, 0, 328, 329, 5, 34, 0, 0, 329, 330, 5,
+ 34, 0, 0, 330, 331, 5, 34, 0, 0, 331, 336, 1, 0, 0, 0, 332, 335, 3, 69,
+ 34, 0, 333, 335, 8, 12, 0, 0, 334, 332, 1, 0, 0, 0, 334, 333, 1, 0, 0,
+ 0, 335, 338, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337,
+ 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 340, 5, 34, 0, 0, 340, 341,
+ 5, 34, 0, 0, 341, 407, 5, 34, 0, 0, 342, 343, 5, 39, 0, 0, 343, 344, 5,
+ 39, 0, 0, 344, 345, 5, 39, 0, 0, 345, 350, 1, 0, 0, 0, 346, 349, 3, 69,
+ 34, 0, 347, 349, 8, 12, 0, 0, 348, 346, 1, 0, 0, 0, 348, 347, 1, 0, 0,
+ 0, 349, 352, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 351,
+ 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 354, 5, 39, 0, 0, 354, 355,
+ 5, 39, 0, 0, 355, 407, 5, 39, 0, 0, 356, 357, 3, 67, 33, 0, 357, 361, 5,
+ 34, 0, 0, 358, 360, 8, 13, 0, 0, 359, 358, 1, 0, 0, 0, 360, 363, 1, 0,
+ 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 364, 1, 0, 0, 0,
+ 363, 361, 1, 0, 0, 0, 364, 365, 5, 34, 0, 0, 365, 407, 1, 0, 0, 0, 366,
+ 367, 3, 67, 33, 0, 367, 371, 5, 39, 0, 0, 368, 370, 8, 14, 0, 0, 369, 368,
+ 1, 0, 0, 0, 370, 373, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0,
+ 0, 0, 372, 374, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 375, 5, 39, 0, 0,
+ 375, 407, 1, 0, 0, 0, 376, 377, 3, 67, 33, 0, 377, 378, 5, 34, 0, 0, 378,
+ 379, 5, 34, 0, 0, 379, 380, 5, 34, 0, 0, 380, 384, 1, 0, 0, 0, 381, 383,
+ 9, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 385, 1, 0,
+ 0, 0, 384, 382, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0,
+ 387, 388, 5, 34, 0, 0, 388, 389, 5, 34, 0, 0, 389, 390, 5, 34, 0, 0, 390,
+ 407, 1, 0, 0, 0, 391, 392, 3, 67, 33, 0, 392, 393, 5, 39, 0, 0, 393, 394,
+ 5, 39, 0, 0, 394, 395, 5, 39, 0, 0, 395, 399, 1, 0, 0, 0, 396, 398, 9,
+ 0, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 400, 1, 0, 0,
+ 0, 399, 397, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402,
+ 403, 5, 39, 0, 0, 403, 404, 5, 39, 0, 0, 404, 405, 5, 39, 0, 0, 405, 407,
+ 1, 0, 0, 0, 406, 310, 1, 0, 0, 0, 406, 319, 1, 0, 0, 0, 406, 328, 1, 0,
+ 0, 0, 406, 342, 1, 0, 0, 0, 406, 356, 1, 0, 0, 0, 406, 366, 1, 0, 0, 0,
+ 406, 376, 1, 0, 0, 0, 406, 391, 1, 0, 0, 0, 407, 90, 1, 0, 0, 0, 408, 409,
+ 7, 15, 0, 0, 409, 410, 3, 89, 44, 0, 410, 92, 1, 0, 0, 0, 411, 414, 3,
+ 59, 29, 0, 412, 414, 5, 95, 0, 0, 413, 411, 1, 0, 0, 0, 413, 412, 1, 0,
+ 0, 0, 414, 420, 1, 0, 0, 0, 415, 419, 3, 59, 29, 0, 416, 419, 3, 61, 30,
+ 0, 417, 419, 5, 95, 0, 0, 418, 415, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 418,
+ 417, 1, 0, 0, 0, 419, 422, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 421,
+ 1, 0, 0, 0, 421, 94, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 36, 0, 176, 181,
+ 191, 224, 229, 239, 247, 253, 256, 261, 269, 272, 274, 279, 287, 289, 294,
+ 304, 308, 313, 315, 322, 324, 334, 336, 348, 350, 361, 371, 384, 399, 406,
+ 413, 418, 420, 1, 0, 1, 0,
+}
+ deserializer := antlr.NewATNDeserializer(nil)
+ staticData.atn = deserializer.Deserialize(staticData.serializedATN)
+ atn := staticData.atn
+ staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
+ decisionToDFA := staticData.decisionToDFA
+ for index, state := range atn.DecisionToState {
+ decisionToDFA[index] = antlr.NewDFA(state, index)
+ }
}
// CELLexerInit initializes any static state used to implement CELLexer. By default the
@@ -282,22 +280,22 @@ func cellexerLexerInit() {
// NewCELLexer(). You can call this function if you wish to initialize the static state ahead
// of time.
func CELLexerInit() {
- staticData := &cellexerLexerStaticData
- staticData.once.Do(cellexerLexerInit)
+ staticData := &CELLexerLexerStaticData
+ staticData.once.Do(cellexerLexerInit)
}
// NewCELLexer produces a new lexer instance for the optional input antlr.CharStream.
func NewCELLexer(input antlr.CharStream) *CELLexer {
- CELLexerInit()
+ CELLexerInit()
l := new(CELLexer)
l.BaseLexer = antlr.NewBaseLexer(input)
- staticData := &cellexerLexerStaticData
- l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache)
- l.channelNames = staticData.channelNames
- l.modeNames = staticData.modeNames
- l.RuleNames = staticData.ruleNames
- l.LiteralNames = staticData.literalNames
- l.SymbolicNames = staticData.symbolicNames
+ staticData := &CELLexerLexerStaticData
+ l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
+ l.channelNames = staticData.ChannelNames
+ l.modeNames = staticData.ModeNames
+ l.RuleNames = staticData.RuleNames
+ l.LiteralNames = staticData.LiteralNames
+ l.SymbolicNames = staticData.SymbolicNames
l.GrammarFileName = "CEL.g4"
// TODO: l.EOF = antlr.TokenEOF
@@ -306,40 +304,41 @@ func NewCELLexer(input antlr.CharStream) *CELLexer {
// CELLexer tokens.
const (
- CELLexerEQUALS = 1
- CELLexerNOT_EQUALS = 2
- CELLexerIN = 3
- CELLexerLESS = 4
- CELLexerLESS_EQUALS = 5
+ CELLexerEQUALS = 1
+ CELLexerNOT_EQUALS = 2
+ CELLexerIN = 3
+ CELLexerLESS = 4
+ CELLexerLESS_EQUALS = 5
CELLexerGREATER_EQUALS = 6
- CELLexerGREATER = 7
- CELLexerLOGICAL_AND = 8
- CELLexerLOGICAL_OR = 9
- CELLexerLBRACKET = 10
- CELLexerRPRACKET = 11
- CELLexerLBRACE = 12
- CELLexerRBRACE = 13
- CELLexerLPAREN = 14
- CELLexerRPAREN = 15
- CELLexerDOT = 16
- CELLexerCOMMA = 17
- CELLexerMINUS = 18
- CELLexerEXCLAM = 19
- CELLexerQUESTIONMARK = 20
- CELLexerCOLON = 21
- CELLexerPLUS = 22
- CELLexerSTAR = 23
- CELLexerSLASH = 24
- CELLexerPERCENT = 25
- CELLexerCEL_TRUE = 26
- CELLexerCEL_FALSE = 27
- CELLexerNUL = 28
- CELLexerWHITESPACE = 29
- CELLexerCOMMENT = 30
- CELLexerNUM_FLOAT = 31
- CELLexerNUM_INT = 32
- CELLexerNUM_UINT = 33
- CELLexerSTRING = 34
- CELLexerBYTES = 35
- CELLexerIDENTIFIER = 36
+ CELLexerGREATER = 7
+ CELLexerLOGICAL_AND = 8
+ CELLexerLOGICAL_OR = 9
+ CELLexerLBRACKET = 10
+ CELLexerRPRACKET = 11
+ CELLexerLBRACE = 12
+ CELLexerRBRACE = 13
+ CELLexerLPAREN = 14
+ CELLexerRPAREN = 15
+ CELLexerDOT = 16
+ CELLexerCOMMA = 17
+ CELLexerMINUS = 18
+ CELLexerEXCLAM = 19
+ CELLexerQUESTIONMARK = 20
+ CELLexerCOLON = 21
+ CELLexerPLUS = 22
+ CELLexerSTAR = 23
+ CELLexerSLASH = 24
+ CELLexerPERCENT = 25
+ CELLexerCEL_TRUE = 26
+ CELLexerCEL_FALSE = 27
+ CELLexerNUL = 28
+ CELLexerWHITESPACE = 29
+ CELLexerCOMMENT = 30
+ CELLexerNUM_FLOAT = 31
+ CELLexerNUM_INT = 32
+ CELLexerNUM_UINT = 33
+ CELLexerSTRING = 34
+ CELLexerBYTES = 35
+ CELLexerIDENTIFIER = 36
)
+
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
index 73b7f1d39fa..22dc9978989 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
@@ -1,7 +1,8 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
+
// CELListener is a complete listener for a parse tree produced by CELParser.
type CELListener interface {
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go b/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
index 0cb6c8eae88..35334af615b 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
@@ -1,12 +1,12 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
import (
"fmt"
"strconv"
- "sync"
+ "sync"
- "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ "github.com/antlr4-go/antlr/v4"
)
// Suppress unused import errors
@@ -14,166 +14,167 @@ var _ = fmt.Printf
var _ = strconv.Itoa
var _ = sync.Once{}
+
type CELParser struct {
*antlr.BaseParser
}
-var celParserStaticData struct {
- once sync.Once
- serializedATN []int32
- literalNames []string
- symbolicNames []string
- ruleNames []string
- predictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
+var CELParserStaticData struct {
+ once sync.Once
+ serializedATN []int32
+ LiteralNames []string
+ SymbolicNames []string
+ RuleNames []string
+ PredictionContextCache *antlr.PredictionContextCache
+ atn *antlr.ATN
+ decisionToDFA []*antlr.DFA
}
func celParserInit() {
- staticData := &celParserStaticData
- staticData.literalNames = []string{
- "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
- "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
- "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
- }
- staticData.symbolicNames = []string{
- "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
- "STRING", "BYTES", "IDENTIFIER",
- }
- staticData.ruleNames = []string{
- "start", "expr", "conditionalOr", "conditionalAnd", "relation", "calc",
- "unary", "member", "primary", "exprList", "listInit", "fieldInitializerList",
- "optField", "mapInitializerList", "optExpr", "literal",
- }
- staticData.predictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 1, 36, 251, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7,
- 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7,
- 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15,
- 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 42, 8, 1, 1,
- 2, 1, 2, 1, 2, 5, 2, 47, 8, 2, 10, 2, 12, 2, 50, 9, 2, 1, 3, 1, 3, 1, 3,
- 5, 3, 55, 8, 3, 10, 3, 12, 3, 58, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1,
- 4, 5, 4, 66, 8, 4, 10, 4, 12, 4, 69, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5,
- 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 80, 8, 5, 10, 5, 12, 5, 83, 9, 5, 1, 6, 1,
- 6, 4, 6, 87, 8, 6, 11, 6, 12, 6, 88, 1, 6, 1, 6, 4, 6, 93, 8, 6, 11, 6,
- 12, 6, 94, 1, 6, 3, 6, 98, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3,
- 7, 106, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 114, 8, 7, 1, 7,
- 1, 7, 1, 7, 1, 7, 3, 7, 120, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10,
- 7, 12, 7, 128, 9, 7, 1, 8, 3, 8, 131, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 136,
- 8, 8, 1, 8, 3, 8, 139, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8,
- 147, 8, 8, 1, 8, 3, 8, 150, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 155, 8, 8, 1,
- 8, 3, 8, 158, 8, 8, 1, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8,
- 167, 8, 8, 10, 8, 12, 8, 170, 9, 8, 1, 8, 1, 8, 3, 8, 174, 8, 8, 1, 8,
- 3, 8, 177, 8, 8, 1, 8, 1, 8, 3, 8, 181, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 186,
- 8, 9, 10, 9, 12, 9, 189, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 194, 8, 10,
- 10, 10, 12, 10, 197, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1,
- 11, 1, 11, 5, 11, 207, 8, 11, 10, 11, 12, 11, 210, 9, 11, 1, 12, 3, 12,
- 213, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1,
- 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 14, 3, 14,
- 231, 8, 14, 1, 14, 1, 14, 1, 15, 3, 15, 236, 8, 15, 1, 15, 1, 15, 1, 15,
- 3, 15, 241, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 249,
- 8, 15, 1, 15, 0, 3, 8, 10, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
- 22, 24, 26, 28, 30, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22,
- 281, 0, 32, 1, 0, 0, 0, 2, 35, 1, 0, 0, 0, 4, 43, 1, 0, 0, 0, 6, 51, 1,
- 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 70, 1, 0, 0, 0, 12, 97, 1, 0, 0, 0, 14,
- 99, 1, 0, 0, 0, 16, 180, 1, 0, 0, 0, 18, 182, 1, 0, 0, 0, 20, 190, 1, 0,
- 0, 0, 22, 198, 1, 0, 0, 0, 24, 212, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28,
- 230, 1, 0, 0, 0, 30, 248, 1, 0, 0, 0, 32, 33, 3, 2, 1, 0, 33, 34, 5, 0,
- 0, 1, 34, 1, 1, 0, 0, 0, 35, 41, 3, 4, 2, 0, 36, 37, 5, 20, 0, 0, 37, 38,
- 3, 4, 2, 0, 38, 39, 5, 21, 0, 0, 39, 40, 3, 2, 1, 0, 40, 42, 1, 0, 0, 0,
- 41, 36, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 3, 1, 0, 0, 0, 43, 48, 3, 6,
- 3, 0, 44, 45, 5, 9, 0, 0, 45, 47, 3, 6, 3, 0, 46, 44, 1, 0, 0, 0, 47, 50,
- 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 5, 1, 0, 0, 0,
- 50, 48, 1, 0, 0, 0, 51, 56, 3, 8, 4, 0, 52, 53, 5, 8, 0, 0, 53, 55, 3,
- 8, 4, 0, 54, 52, 1, 0, 0, 0, 55, 58, 1, 0, 0, 0, 56, 54, 1, 0, 0, 0, 56,
- 57, 1, 0, 0, 0, 57, 7, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 59, 60, 6, 4, -1,
- 0, 60, 61, 3, 10, 5, 0, 61, 67, 1, 0, 0, 0, 62, 63, 10, 1, 0, 0, 63, 64,
- 7, 0, 0, 0, 64, 66, 3, 8, 4, 2, 65, 62, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0,
- 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 9, 1, 0, 0, 0, 69, 67, 1, 0,
- 0, 0, 70, 71, 6, 5, -1, 0, 71, 72, 3, 12, 6, 0, 72, 81, 1, 0, 0, 0, 73,
- 74, 10, 2, 0, 0, 74, 75, 7, 1, 0, 0, 75, 80, 3, 10, 5, 3, 76, 77, 10, 1,
- 0, 0, 77, 78, 7, 2, 0, 0, 78, 80, 3, 10, 5, 2, 79, 73, 1, 0, 0, 0, 79,
- 76, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0,
- 0, 82, 11, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 98, 3, 14, 7, 0, 85, 87,
- 5, 19, 0, 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0,
- 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 98, 3, 14, 7, 0, 91, 93, 5,
- 18, 0, 0, 92, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94,
- 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 3, 14, 7, 0, 97, 84, 1, 0,
- 0, 0, 97, 86, 1, 0, 0, 0, 97, 92, 1, 0, 0, 0, 98, 13, 1, 0, 0, 0, 99, 100,
- 6, 7, -1, 0, 100, 101, 3, 16, 8, 0, 101, 126, 1, 0, 0, 0, 102, 103, 10,
- 3, 0, 0, 103, 105, 5, 16, 0, 0, 104, 106, 5, 20, 0, 0, 105, 104, 1, 0,
- 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 125, 5, 36, 0, 0,
- 108, 109, 10, 2, 0, 0, 109, 110, 5, 16, 0, 0, 110, 111, 5, 36, 0, 0, 111,
- 113, 5, 14, 0, 0, 112, 114, 3, 18, 9, 0, 113, 112, 1, 0, 0, 0, 113, 114,
- 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 125, 5, 15, 0, 0, 116, 117, 10,
- 1, 0, 0, 117, 119, 5, 10, 0, 0, 118, 120, 5, 20, 0, 0, 119, 118, 1, 0,
- 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 3, 2, 1, 0,
- 122, 123, 5, 11, 0, 0, 123, 125, 1, 0, 0, 0, 124, 102, 1, 0, 0, 0, 124,
- 108, 1, 0, 0, 0, 124, 116, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124,
- 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 15, 1, 0, 0, 0, 128, 126, 1, 0,
- 0, 0, 129, 131, 5, 16, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0,
- 131, 132, 1, 0, 0, 0, 132, 138, 5, 36, 0, 0, 133, 135, 5, 14, 0, 0, 134,
- 136, 3, 18, 9, 0, 135, 134, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137,
- 1, 0, 0, 0, 137, 139, 5, 15, 0, 0, 138, 133, 1, 0, 0, 0, 138, 139, 1, 0,
- 0, 0, 139, 181, 1, 0, 0, 0, 140, 141, 5, 14, 0, 0, 141, 142, 3, 2, 1, 0,
- 142, 143, 5, 15, 0, 0, 143, 181, 1, 0, 0, 0, 144, 146, 5, 10, 0, 0, 145,
- 147, 3, 20, 10, 0, 146, 145, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149,
- 1, 0, 0, 0, 148, 150, 5, 17, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0,
- 0, 0, 150, 151, 1, 0, 0, 0, 151, 181, 5, 11, 0, 0, 152, 154, 5, 12, 0,
- 0, 153, 155, 3, 26, 13, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0,
- 155, 157, 1, 0, 0, 0, 156, 158, 5, 17, 0, 0, 157, 156, 1, 0, 0, 0, 157,
- 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 181, 5, 13, 0, 0, 160, 162,
- 5, 16, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0,
- 0, 0, 163, 168, 5, 36, 0, 0, 164, 165, 5, 16, 0, 0, 165, 167, 5, 36, 0,
- 0, 166, 164, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 168,
- 169, 1, 0, 0, 0, 169, 171, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 171, 173,
- 5, 12, 0, 0, 172, 174, 3, 22, 11, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1,
- 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 177, 5, 17, 0, 0, 176, 175, 1, 0, 0,
- 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 181, 5, 13, 0, 0, 179,
- 181, 3, 30, 15, 0, 180, 130, 1, 0, 0, 0, 180, 140, 1, 0, 0, 0, 180, 144,
- 1, 0, 0, 0, 180, 152, 1, 0, 0, 0, 180, 161, 1, 0, 0, 0, 180, 179, 1, 0,
- 0, 0, 181, 17, 1, 0, 0, 0, 182, 187, 3, 2, 1, 0, 183, 184, 5, 17, 0, 0,
- 184, 186, 3, 2, 1, 0, 185, 183, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187,
- 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 19, 1, 0, 0, 0, 189, 187, 1,
- 0, 0, 0, 190, 195, 3, 28, 14, 0, 191, 192, 5, 17, 0, 0, 192, 194, 3, 28,
- 14, 0, 193, 191, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0,
- 195, 196, 1, 0, 0, 0, 196, 21, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199,
- 3, 24, 12, 0, 199, 200, 5, 21, 0, 0, 200, 208, 3, 2, 1, 0, 201, 202, 5,
- 17, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 205, 3, 2,
- 1, 0, 205, 207, 1, 0, 0, 0, 206, 201, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0,
- 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 23, 1, 0, 0, 0, 210, 208,
- 1, 0, 0, 0, 211, 213, 5, 20, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0,
- 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 36, 0, 0, 215, 25, 1, 0, 0, 0,
- 216, 217, 3, 28, 14, 0, 217, 218, 5, 21, 0, 0, 218, 226, 3, 2, 1, 0, 219,
- 220, 5, 17, 0, 0, 220, 221, 3, 28, 14, 0, 221, 222, 5, 21, 0, 0, 222, 223,
- 3, 2, 1, 0, 223, 225, 1, 0, 0, 0, 224, 219, 1, 0, 0, 0, 225, 228, 1, 0,
- 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 27, 1, 0, 0, 0,
- 228, 226, 1, 0, 0, 0, 229, 231, 5, 20, 0, 0, 230, 229, 1, 0, 0, 0, 230,
- 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 3, 2, 1, 0, 233, 29, 1,
- 0, 0, 0, 234, 236, 5, 18, 0, 0, 235, 234, 1, 0, 0, 0, 235, 236, 1, 0, 0,
- 0, 236, 237, 1, 0, 0, 0, 237, 249, 5, 32, 0, 0, 238, 249, 5, 33, 0, 0,
- 239, 241, 5, 18, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241,
- 242, 1, 0, 0, 0, 242, 249, 5, 31, 0, 0, 243, 249, 5, 34, 0, 0, 244, 249,
- 5, 35, 0, 0, 245, 249, 5, 26, 0, 0, 246, 249, 5, 27, 0, 0, 247, 249, 5,
- 28, 0, 0, 248, 235, 1, 0, 0, 0, 248, 238, 1, 0, 0, 0, 248, 240, 1, 0, 0,
- 0, 248, 243, 1, 0, 0, 0, 248, 244, 1, 0, 0, 0, 248, 245, 1, 0, 0, 0, 248,
- 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 31, 1, 0, 0, 0, 35, 41, 48,
- 56, 67, 79, 81, 88, 94, 97, 105, 113, 119, 124, 126, 130, 135, 138, 146,
- 149, 154, 157, 161, 168, 173, 176, 180, 187, 195, 208, 212, 226, 230, 235,
- 240, 248,
- }
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
+ staticData := &CELParserStaticData
+ staticData.LiteralNames = []string{
+ "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
+ "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
+ "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
+ }
+ staticData.SymbolicNames = []string{
+ "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
+ "STRING", "BYTES", "IDENTIFIER",
+ }
+ staticData.RuleNames = []string{
+ "start", "expr", "conditionalOr", "conditionalAnd", "relation", "calc",
+ "unary", "member", "primary", "exprList", "listInit", "fieldInitializerList",
+ "optField", "mapInitializerList", "optExpr", "literal",
+ }
+ staticData.PredictionContextCache = antlr.NewPredictionContextCache()
+ staticData.serializedATN = []int32{
+ 4, 1, 36, 251, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7,
+ 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7,
+ 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15,
+ 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 42, 8, 1, 1,
+ 2, 1, 2, 1, 2, 5, 2, 47, 8, 2, 10, 2, 12, 2, 50, 9, 2, 1, 3, 1, 3, 1, 3,
+ 5, 3, 55, 8, 3, 10, 3, 12, 3, 58, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1,
+ 4, 5, 4, 66, 8, 4, 10, 4, 12, 4, 69, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5,
+ 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 80, 8, 5, 10, 5, 12, 5, 83, 9, 5, 1, 6, 1,
+ 6, 4, 6, 87, 8, 6, 11, 6, 12, 6, 88, 1, 6, 1, 6, 4, 6, 93, 8, 6, 11, 6,
+ 12, 6, 94, 1, 6, 3, 6, 98, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3,
+ 7, 106, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 114, 8, 7, 1, 7,
+ 1, 7, 1, 7, 1, 7, 3, 7, 120, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10,
+ 7, 12, 7, 128, 9, 7, 1, 8, 3, 8, 131, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 136,
+ 8, 8, 1, 8, 3, 8, 139, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8,
+ 147, 8, 8, 1, 8, 3, 8, 150, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 155, 8, 8, 1,
+ 8, 3, 8, 158, 8, 8, 1, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8,
+ 167, 8, 8, 10, 8, 12, 8, 170, 9, 8, 1, 8, 1, 8, 3, 8, 174, 8, 8, 1, 8,
+ 3, 8, 177, 8, 8, 1, 8, 1, 8, 3, 8, 181, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 186,
+ 8, 9, 10, 9, 12, 9, 189, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 194, 8, 10,
+ 10, 10, 12, 10, 197, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1,
+ 11, 1, 11, 5, 11, 207, 8, 11, 10, 11, 12, 11, 210, 9, 11, 1, 12, 3, 12,
+ 213, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1,
+ 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 14, 3, 14,
+ 231, 8, 14, 1, 14, 1, 14, 1, 15, 3, 15, 236, 8, 15, 1, 15, 1, 15, 1, 15,
+ 3, 15, 241, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 249,
+ 8, 15, 1, 15, 0, 3, 8, 10, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
+ 22, 24, 26, 28, 30, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22,
+ 281, 0, 32, 1, 0, 0, 0, 2, 35, 1, 0, 0, 0, 4, 43, 1, 0, 0, 0, 6, 51, 1,
+ 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 70, 1, 0, 0, 0, 12, 97, 1, 0, 0, 0, 14,
+ 99, 1, 0, 0, 0, 16, 180, 1, 0, 0, 0, 18, 182, 1, 0, 0, 0, 20, 190, 1, 0,
+ 0, 0, 22, 198, 1, 0, 0, 0, 24, 212, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28,
+ 230, 1, 0, 0, 0, 30, 248, 1, 0, 0, 0, 32, 33, 3, 2, 1, 0, 33, 34, 5, 0,
+ 0, 1, 34, 1, 1, 0, 0, 0, 35, 41, 3, 4, 2, 0, 36, 37, 5, 20, 0, 0, 37, 38,
+ 3, 4, 2, 0, 38, 39, 5, 21, 0, 0, 39, 40, 3, 2, 1, 0, 40, 42, 1, 0, 0, 0,
+ 41, 36, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 3, 1, 0, 0, 0, 43, 48, 3, 6,
+ 3, 0, 44, 45, 5, 9, 0, 0, 45, 47, 3, 6, 3, 0, 46, 44, 1, 0, 0, 0, 47, 50,
+ 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 5, 1, 0, 0, 0,
+ 50, 48, 1, 0, 0, 0, 51, 56, 3, 8, 4, 0, 52, 53, 5, 8, 0, 0, 53, 55, 3,
+ 8, 4, 0, 54, 52, 1, 0, 0, 0, 55, 58, 1, 0, 0, 0, 56, 54, 1, 0, 0, 0, 56,
+ 57, 1, 0, 0, 0, 57, 7, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 59, 60, 6, 4, -1,
+ 0, 60, 61, 3, 10, 5, 0, 61, 67, 1, 0, 0, 0, 62, 63, 10, 1, 0, 0, 63, 64,
+ 7, 0, 0, 0, 64, 66, 3, 8, 4, 2, 65, 62, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0,
+ 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 9, 1, 0, 0, 0, 69, 67, 1, 0,
+ 0, 0, 70, 71, 6, 5, -1, 0, 71, 72, 3, 12, 6, 0, 72, 81, 1, 0, 0, 0, 73,
+ 74, 10, 2, 0, 0, 74, 75, 7, 1, 0, 0, 75, 80, 3, 10, 5, 3, 76, 77, 10, 1,
+ 0, 0, 77, 78, 7, 2, 0, 0, 78, 80, 3, 10, 5, 2, 79, 73, 1, 0, 0, 0, 79,
+ 76, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0,
+ 0, 82, 11, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 98, 3, 14, 7, 0, 85, 87,
+ 5, 19, 0, 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0,
+ 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 98, 3, 14, 7, 0, 91, 93, 5,
+ 18, 0, 0, 92, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94,
+ 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 3, 14, 7, 0, 97, 84, 1, 0,
+ 0, 0, 97, 86, 1, 0, 0, 0, 97, 92, 1, 0, 0, 0, 98, 13, 1, 0, 0, 0, 99, 100,
+ 6, 7, -1, 0, 100, 101, 3, 16, 8, 0, 101, 126, 1, 0, 0, 0, 102, 103, 10,
+ 3, 0, 0, 103, 105, 5, 16, 0, 0, 104, 106, 5, 20, 0, 0, 105, 104, 1, 0,
+ 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 125, 5, 36, 0, 0,
+ 108, 109, 10, 2, 0, 0, 109, 110, 5, 16, 0, 0, 110, 111, 5, 36, 0, 0, 111,
+ 113, 5, 14, 0, 0, 112, 114, 3, 18, 9, 0, 113, 112, 1, 0, 0, 0, 113, 114,
+ 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 125, 5, 15, 0, 0, 116, 117, 10,
+ 1, 0, 0, 117, 119, 5, 10, 0, 0, 118, 120, 5, 20, 0, 0, 119, 118, 1, 0,
+ 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 3, 2, 1, 0,
+ 122, 123, 5, 11, 0, 0, 123, 125, 1, 0, 0, 0, 124, 102, 1, 0, 0, 0, 124,
+ 108, 1, 0, 0, 0, 124, 116, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124,
+ 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 15, 1, 0, 0, 0, 128, 126, 1, 0,
+ 0, 0, 129, 131, 5, 16, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0,
+ 131, 132, 1, 0, 0, 0, 132, 138, 5, 36, 0, 0, 133, 135, 5, 14, 0, 0, 134,
+ 136, 3, 18, 9, 0, 135, 134, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137,
+ 1, 0, 0, 0, 137, 139, 5, 15, 0, 0, 138, 133, 1, 0, 0, 0, 138, 139, 1, 0,
+ 0, 0, 139, 181, 1, 0, 0, 0, 140, 141, 5, 14, 0, 0, 141, 142, 3, 2, 1, 0,
+ 142, 143, 5, 15, 0, 0, 143, 181, 1, 0, 0, 0, 144, 146, 5, 10, 0, 0, 145,
+ 147, 3, 20, 10, 0, 146, 145, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149,
+ 1, 0, 0, 0, 148, 150, 5, 17, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0,
+ 0, 0, 150, 151, 1, 0, 0, 0, 151, 181, 5, 11, 0, 0, 152, 154, 5, 12, 0,
+ 0, 153, 155, 3, 26, 13, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0,
+ 155, 157, 1, 0, 0, 0, 156, 158, 5, 17, 0, 0, 157, 156, 1, 0, 0, 0, 157,
+ 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 181, 5, 13, 0, 0, 160, 162,
+ 5, 16, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0,
+ 0, 0, 163, 168, 5, 36, 0, 0, 164, 165, 5, 16, 0, 0, 165, 167, 5, 36, 0,
+ 0, 166, 164, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 168,
+ 169, 1, 0, 0, 0, 169, 171, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 171, 173,
+ 5, 12, 0, 0, 172, 174, 3, 22, 11, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1,
+ 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 177, 5, 17, 0, 0, 176, 175, 1, 0, 0,
+ 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 181, 5, 13, 0, 0, 179,
+ 181, 3, 30, 15, 0, 180, 130, 1, 0, 0, 0, 180, 140, 1, 0, 0, 0, 180, 144,
+ 1, 0, 0, 0, 180, 152, 1, 0, 0, 0, 180, 161, 1, 0, 0, 0, 180, 179, 1, 0,
+ 0, 0, 181, 17, 1, 0, 0, 0, 182, 187, 3, 2, 1, 0, 183, 184, 5, 17, 0, 0,
+ 184, 186, 3, 2, 1, 0, 185, 183, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187,
+ 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 19, 1, 0, 0, 0, 189, 187, 1,
+ 0, 0, 0, 190, 195, 3, 28, 14, 0, 191, 192, 5, 17, 0, 0, 192, 194, 3, 28,
+ 14, 0, 193, 191, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0,
+ 195, 196, 1, 0, 0, 0, 196, 21, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199,
+ 3, 24, 12, 0, 199, 200, 5, 21, 0, 0, 200, 208, 3, 2, 1, 0, 201, 202, 5,
+ 17, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 205, 3, 2,
+ 1, 0, 205, 207, 1, 0, 0, 0, 206, 201, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0,
+ 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 23, 1, 0, 0, 0, 210, 208,
+ 1, 0, 0, 0, 211, 213, 5, 20, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0,
+ 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 36, 0, 0, 215, 25, 1, 0, 0, 0,
+ 216, 217, 3, 28, 14, 0, 217, 218, 5, 21, 0, 0, 218, 226, 3, 2, 1, 0, 219,
+ 220, 5, 17, 0, 0, 220, 221, 3, 28, 14, 0, 221, 222, 5, 21, 0, 0, 222, 223,
+ 3, 2, 1, 0, 223, 225, 1, 0, 0, 0, 224, 219, 1, 0, 0, 0, 225, 228, 1, 0,
+ 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 27, 1, 0, 0, 0,
+ 228, 226, 1, 0, 0, 0, 229, 231, 5, 20, 0, 0, 230, 229, 1, 0, 0, 0, 230,
+ 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 3, 2, 1, 0, 233, 29, 1,
+ 0, 0, 0, 234, 236, 5, 18, 0, 0, 235, 234, 1, 0, 0, 0, 235, 236, 1, 0, 0,
+ 0, 236, 237, 1, 0, 0, 0, 237, 249, 5, 32, 0, 0, 238, 249, 5, 33, 0, 0,
+ 239, 241, 5, 18, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241,
+ 242, 1, 0, 0, 0, 242, 249, 5, 31, 0, 0, 243, 249, 5, 34, 0, 0, 244, 249,
+ 5, 35, 0, 0, 245, 249, 5, 26, 0, 0, 246, 249, 5, 27, 0, 0, 247, 249, 5,
+ 28, 0, 0, 248, 235, 1, 0, 0, 0, 248, 238, 1, 0, 0, 0, 248, 240, 1, 0, 0,
+ 0, 248, 243, 1, 0, 0, 0, 248, 244, 1, 0, 0, 0, 248, 245, 1, 0, 0, 0, 248,
+ 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 31, 1, 0, 0, 0, 35, 41, 48,
+ 56, 67, 79, 81, 88, 94, 97, 105, 113, 119, 124, 126, 130, 135, 138, 146,
+ 149, 154, 157, 161, 168, 173, 176, 180, 187, 195, 208, 212, 226, 230, 235,
+ 240, 248,
+}
+ deserializer := antlr.NewATNDeserializer(nil)
+ staticData.atn = deserializer.Deserialize(staticData.serializedATN)
+ atn := staticData.atn
+ staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
+ decisionToDFA := staticData.decisionToDFA
+ for index, state := range atn.DecisionToState {
+ decisionToDFA[index] = antlr.NewDFA(state, index)
+ }
}
// CELParserInit initializes any static state used to implement CELParser. By default the
@@ -181,8 +182,8 @@ func celParserInit() {
// NewCELParser(). You can call this function if you wish to initialize the static state ahead
// of time.
func CELParserInit() {
- staticData := &celParserStaticData
- staticData.once.Do(celParserInit)
+ staticData := &CELParserStaticData
+ staticData.once.Do(celParserInit)
}
// NewCELParser produces a new parser instance for the optional input antlr.TokenStream.
@@ -190,75 +191,76 @@ func NewCELParser(input antlr.TokenStream) *CELParser {
CELParserInit()
this := new(CELParser)
this.BaseParser = antlr.NewBaseParser(input)
- staticData := &celParserStaticData
- this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache)
- this.RuleNames = staticData.ruleNames
- this.LiteralNames = staticData.literalNames
- this.SymbolicNames = staticData.symbolicNames
+ staticData := &CELParserStaticData
+ this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
+ this.RuleNames = staticData.RuleNames
+ this.LiteralNames = staticData.LiteralNames
+ this.SymbolicNames = staticData.SymbolicNames
this.GrammarFileName = "CEL.g4"
return this
}
+
// CELParser tokens.
const (
- CELParserEOF = antlr.TokenEOF
- CELParserEQUALS = 1
- CELParserNOT_EQUALS = 2
- CELParserIN = 3
- CELParserLESS = 4
- CELParserLESS_EQUALS = 5
+ CELParserEOF = antlr.TokenEOF
+ CELParserEQUALS = 1
+ CELParserNOT_EQUALS = 2
+ CELParserIN = 3
+ CELParserLESS = 4
+ CELParserLESS_EQUALS = 5
CELParserGREATER_EQUALS = 6
- CELParserGREATER = 7
- CELParserLOGICAL_AND = 8
- CELParserLOGICAL_OR = 9
- CELParserLBRACKET = 10
- CELParserRPRACKET = 11
- CELParserLBRACE = 12
- CELParserRBRACE = 13
- CELParserLPAREN = 14
- CELParserRPAREN = 15
- CELParserDOT = 16
- CELParserCOMMA = 17
- CELParserMINUS = 18
- CELParserEXCLAM = 19
- CELParserQUESTIONMARK = 20
- CELParserCOLON = 21
- CELParserPLUS = 22
- CELParserSTAR = 23
- CELParserSLASH = 24
- CELParserPERCENT = 25
- CELParserCEL_TRUE = 26
- CELParserCEL_FALSE = 27
- CELParserNUL = 28
- CELParserWHITESPACE = 29
- CELParserCOMMENT = 30
- CELParserNUM_FLOAT = 31
- CELParserNUM_INT = 32
- CELParserNUM_UINT = 33
- CELParserSTRING = 34
- CELParserBYTES = 35
- CELParserIDENTIFIER = 36
+ CELParserGREATER = 7
+ CELParserLOGICAL_AND = 8
+ CELParserLOGICAL_OR = 9
+ CELParserLBRACKET = 10
+ CELParserRPRACKET = 11
+ CELParserLBRACE = 12
+ CELParserRBRACE = 13
+ CELParserLPAREN = 14
+ CELParserRPAREN = 15
+ CELParserDOT = 16
+ CELParserCOMMA = 17
+ CELParserMINUS = 18
+ CELParserEXCLAM = 19
+ CELParserQUESTIONMARK = 20
+ CELParserCOLON = 21
+ CELParserPLUS = 22
+ CELParserSTAR = 23
+ CELParserSLASH = 24
+ CELParserPERCENT = 25
+ CELParserCEL_TRUE = 26
+ CELParserCEL_FALSE = 27
+ CELParserNUL = 28
+ CELParserWHITESPACE = 29
+ CELParserCOMMENT = 30
+ CELParserNUM_FLOAT = 31
+ CELParserNUM_INT = 32
+ CELParserNUM_UINT = 33
+ CELParserSTRING = 34
+ CELParserBYTES = 35
+ CELParserIDENTIFIER = 36
)
// CELParser rules.
const (
- CELParserRULE_start = 0
- CELParserRULE_expr = 1
- CELParserRULE_conditionalOr = 2
- CELParserRULE_conditionalAnd = 3
- CELParserRULE_relation = 4
- CELParserRULE_calc = 5
- CELParserRULE_unary = 6
- CELParserRULE_member = 7
- CELParserRULE_primary = 8
- CELParserRULE_exprList = 9
- CELParserRULE_listInit = 10
+ CELParserRULE_start = 0
+ CELParserRULE_expr = 1
+ CELParserRULE_conditionalOr = 2
+ CELParserRULE_conditionalAnd = 3
+ CELParserRULE_relation = 4
+ CELParserRULE_calc = 5
+ CELParserRULE_unary = 6
+ CELParserRULE_member = 7
+ CELParserRULE_primary = 8
+ CELParserRULE_exprList = 9
+ CELParserRULE_listInit = 10
CELParserRULE_fieldInitializerList = 11
- CELParserRULE_optField = 12
- CELParserRULE_mapInitializerList = 13
- CELParserRULE_optExpr = 14
- CELParserRULE_literal = 15
+ CELParserRULE_optField = 12
+ CELParserRULE_mapInitializerList = 13
+ CELParserRULE_optExpr = 14
+ CELParserRULE_literal = 15
)
// IStartContext is an interface to support dynamic dispatch.
@@ -271,9 +273,11 @@ type IStartContext interface {
// GetE returns the e rule contexts.
GetE() IExprContext
+
// SetE sets the e rule contexts.
SetE(IExprContext)
+
// Getter signatures
EOF() antlr.TerminalNode
Expr() IExprContext
@@ -283,24 +287,29 @@ type IStartContext interface {
}
type StartContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- e IExprContext
+ e IExprContext
}
func NewEmptyStartContext() *StartContext {
var p = new(StartContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_start
return p
}
+func InitEmptyStartContext(p *StartContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_start
+}
+
func (*StartContext) IsStartContext() {}
func NewStartContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StartContext {
var p = new(StartContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_start
@@ -312,17 +321,19 @@ func (s *StartContext) GetParser() antlr.Parser { return s.parser }
func (s *StartContext) GetE() IExprContext { return s.e }
+
func (s *StartContext) SetE(v IExprContext) { s.e = v }
+
func (s *StartContext) EOF() antlr.TerminalNode {
return s.GetToken(CELParserEOF, 0)
}
func (s *StartContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -342,6 +353,7 @@ func (s *StartContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *StartContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterStart(s)
@@ -364,45 +376,46 @@ func (s *StartContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Start() (localctx IStartContext) {
- this := p
- _ = this
- localctx = NewStartContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 0, CELParserRULE_start)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) Start_() (localctx IStartContext) {
+ localctx = NewStartContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 0, CELParserRULE_start)
p.EnterOuterAlt(localctx, 1)
{
p.SetState(32)
var _x = p.Expr()
+
localctx.(*StartContext).e = _x
}
{
p.SetState(33)
p.Match(CELParserEOF)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IExprContext is an interface to support dynamic dispatch.
type IExprContext interface {
antlr.ParserRuleContext
@@ -411,10 +424,12 @@ type IExprContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
+ GetOp() antlr.Token
+
// SetOp sets the op token.
- SetOp(antlr.Token)
+ SetOp(antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IConditionalOrContext
@@ -425,6 +440,7 @@ type IExprContext interface {
// GetE2 returns the e2 rule contexts.
GetE2() IExprContext
+
// SetE sets the e rule contexts.
SetE(IConditionalOrContext)
@@ -434,6 +450,7 @@ type IExprContext interface {
// SetE2 sets the e2 rule contexts.
SetE2(IExprContext)
+
// Getter signatures
AllConditionalOr() []IConditionalOrContext
ConditionalOr(i int) IConditionalOrContext
@@ -446,27 +463,32 @@ type IExprContext interface {
}
type ExprContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- e IConditionalOrContext
- op antlr.Token
- e1 IConditionalOrContext
- e2 IExprContext
+ e IConditionalOrContext
+ op antlr.Token
+ e1 IConditionalOrContext
+ e2 IExprContext
}
func NewEmptyExprContext() *ExprContext {
var p = new(ExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_expr
return p
}
+func InitEmptyExprContext(p *ExprContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_expr
+}
+
func (*ExprContext) IsExprContext() {}
func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext {
var p = new(ExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_expr
@@ -478,20 +500,24 @@ func (s *ExprContext) GetParser() antlr.Parser { return s.parser }
func (s *ExprContext) GetOp() antlr.Token { return s.op }
+
func (s *ExprContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *ExprContext) GetE() IConditionalOrContext { return s.e }
func (s *ExprContext) GetE1() IConditionalOrContext { return s.e1 }
func (s *ExprContext) GetE2() IExprContext { return s.e2 }
+
func (s *ExprContext) SetE(v IConditionalOrContext) { s.e = v }
func (s *ExprContext) SetE1(v IConditionalOrContext) { s.e1 = v }
func (s *ExprContext) SetE2(v IExprContext) { s.e2 = v }
+
func (s *ExprContext) AllConditionalOr() []IConditionalOrContext {
children := s.GetChildren()
len := 0
@@ -514,12 +540,12 @@ func (s *ExprContext) AllConditionalOr() []IConditionalOrContext {
}
func (s *ExprContext) ConditionalOr(i int) IConditionalOrContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IConditionalOrContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -542,10 +568,10 @@ func (s *ExprContext) QUESTIONMARK() antlr.TerminalNode {
}
func (s *ExprContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -565,6 +591,7 @@ func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterExpr(s)
@@ -587,42 +614,31 @@ func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Expr() (localctx IExprContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) Expr() (localctx IExprContext) {
localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 2, CELParserRULE_expr)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(35)
var _x = p.ConditionalOr()
+
localctx.(*ExprContext).e = _x
}
p.SetState(41)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(36)
@@ -630,31 +646,54 @@ func (p *CELParser) Expr() (localctx IExprContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*ExprContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(37)
var _x = p.ConditionalOr()
+
localctx.(*ExprContext).e1 = _x
}
{
p.SetState(38)
p.Match(CELParserCOLON)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(39)
var _x = p.Expr()
+
localctx.(*ExprContext).e2 = _x
}
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IConditionalOrContext is an interface to support dynamic dispatch.
type IConditionalOrContext interface {
antlr.ParserRuleContext
@@ -663,34 +702,42 @@ type IConditionalOrContext interface {
GetParser() antlr.Parser
// GetS9 returns the s9 token.
- GetS9() antlr.Token
+ GetS9() antlr.Token
+
// SetS9 sets the s9 token.
- SetS9(antlr.Token)
+ SetS9(antlr.Token)
+
// GetOps returns the ops token list.
GetOps() []antlr.Token
+
// SetOps sets the ops token list.
SetOps([]antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IConditionalAndContext
// Get_conditionalAnd returns the _conditionalAnd rule contexts.
Get_conditionalAnd() IConditionalAndContext
+
// SetE sets the e rule contexts.
SetE(IConditionalAndContext)
// Set_conditionalAnd sets the _conditionalAnd rule contexts.
Set_conditionalAnd(IConditionalAndContext)
+
// GetE1 returns the e1 rule context list.
GetE1() []IConditionalAndContext
+
// SetE1 sets the e1 rule context list.
- SetE1([]IConditionalAndContext)
+ SetE1([]IConditionalAndContext)
+
// Getter signatures
AllConditionalAnd() []IConditionalAndContext
@@ -703,28 +750,33 @@ type IConditionalOrContext interface {
}
type ConditionalOrContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- e IConditionalAndContext
- s9 antlr.Token
- ops []antlr.Token
- _conditionalAnd IConditionalAndContext
- e1 []IConditionalAndContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ e IConditionalAndContext
+ s9 antlr.Token
+ ops []antlr.Token
+ _conditionalAnd IConditionalAndContext
+ e1 []IConditionalAndContext
}
func NewEmptyConditionalOrContext() *ConditionalOrContext {
var p = new(ConditionalOrContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_conditionalOr
return p
}
+func InitEmptyConditionalOrContext(p *ConditionalOrContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_conditionalOr
+}
+
func (*ConditionalOrContext) IsConditionalOrContext() {}
func NewConditionalOrContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalOrContext {
var p = new(ConditionalOrContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_conditionalOr
@@ -736,24 +788,32 @@ func (s *ConditionalOrContext) GetParser() antlr.Parser { return s.parser }
func (s *ConditionalOrContext) GetS9() antlr.Token { return s.s9 }
+
func (s *ConditionalOrContext) SetS9(v antlr.Token) { s.s9 = v }
+
func (s *ConditionalOrContext) GetOps() []antlr.Token { return s.ops }
+
func (s *ConditionalOrContext) SetOps(v []antlr.Token) { s.ops = v }
+
func (s *ConditionalOrContext) GetE() IConditionalAndContext { return s.e }
func (s *ConditionalOrContext) Get_conditionalAnd() IConditionalAndContext { return s._conditionalAnd }
+
func (s *ConditionalOrContext) SetE(v IConditionalAndContext) { s.e = v }
func (s *ConditionalOrContext) Set_conditionalAnd(v IConditionalAndContext) { s._conditionalAnd = v }
+
func (s *ConditionalOrContext) GetE1() []IConditionalAndContext { return s.e1 }
+
func (s *ConditionalOrContext) SetE1(v []IConditionalAndContext) { s.e1 = v }
+
func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext {
children := s.GetChildren()
len := 0
@@ -776,12 +836,12 @@ func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext {
}
func (s *ConditionalOrContext) ConditionalAnd(i int) IConditionalAndContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IConditionalAndContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -811,6 +871,7 @@ func (s *ConditionalOrContext) ToStringTree(ruleNames []string, recog antlr.Reco
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ConditionalOrContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConditionalOr(s)
@@ -833,42 +894,31 @@ func (s *ConditionalOrContext) Accept(visitor antlr.ParseTreeVisitor) interface{
}
}
-func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
localctx = NewConditionalOrContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 4, CELParserRULE_conditionalOr)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(43)
var _x = p.ConditionalAnd()
+
localctx.(*ConditionalOrContext).e = _x
}
p.SetState(48)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserLOGICAL_OR {
{
p.SetState(44)
@@ -876,6 +926,10 @@ func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
var _m = p.Match(CELParserLOGICAL_OR)
localctx.(*ConditionalOrContext).s9 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*ConditionalOrContext).ops = append(localctx.(*ConditionalOrContext).ops, localctx.(*ConditionalOrContext).s9)
{
@@ -883,18 +937,36 @@ func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
var _x = p.ConditionalAnd()
+
localctx.(*ConditionalOrContext)._conditionalAnd = _x
}
localctx.(*ConditionalOrContext).e1 = append(localctx.(*ConditionalOrContext).e1, localctx.(*ConditionalOrContext)._conditionalAnd)
+
p.SetState(50)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IConditionalAndContext is an interface to support dynamic dispatch.
type IConditionalAndContext interface {
antlr.ParserRuleContext
@@ -903,34 +975,42 @@ type IConditionalAndContext interface {
GetParser() antlr.Parser
// GetS8 returns the s8 token.
- GetS8() antlr.Token
+ GetS8() antlr.Token
+
// SetS8 sets the s8 token.
- SetS8(antlr.Token)
+ SetS8(antlr.Token)
+
// GetOps returns the ops token list.
GetOps() []antlr.Token
+
// SetOps sets the ops token list.
SetOps([]antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IRelationContext
// Get_relation returns the _relation rule contexts.
Get_relation() IRelationContext
+
// SetE sets the e rule contexts.
SetE(IRelationContext)
// Set_relation sets the _relation rule contexts.
Set_relation(IRelationContext)
+
// GetE1 returns the e1 rule context list.
GetE1() []IRelationContext
+
// SetE1 sets the e1 rule context list.
- SetE1([]IRelationContext)
+ SetE1([]IRelationContext)
+
// Getter signatures
AllRelation() []IRelationContext
@@ -943,28 +1023,33 @@ type IConditionalAndContext interface {
}
type ConditionalAndContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- e IRelationContext
- s8 antlr.Token
- ops []antlr.Token
- _relation IRelationContext
- e1 []IRelationContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ e IRelationContext
+ s8 antlr.Token
+ ops []antlr.Token
+ _relation IRelationContext
+ e1 []IRelationContext
}
func NewEmptyConditionalAndContext() *ConditionalAndContext {
var p = new(ConditionalAndContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_conditionalAnd
return p
}
+func InitEmptyConditionalAndContext(p *ConditionalAndContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_conditionalAnd
+}
+
func (*ConditionalAndContext) IsConditionalAndContext() {}
func NewConditionalAndContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalAndContext {
var p = new(ConditionalAndContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_conditionalAnd
@@ -976,24 +1061,32 @@ func (s *ConditionalAndContext) GetParser() antlr.Parser { return s.parser }
func (s *ConditionalAndContext) GetS8() antlr.Token { return s.s8 }
+
func (s *ConditionalAndContext) SetS8(v antlr.Token) { s.s8 = v }
+
func (s *ConditionalAndContext) GetOps() []antlr.Token { return s.ops }
+
func (s *ConditionalAndContext) SetOps(v []antlr.Token) { s.ops = v }
+
func (s *ConditionalAndContext) GetE() IRelationContext { return s.e }
func (s *ConditionalAndContext) Get_relation() IRelationContext { return s._relation }
+
func (s *ConditionalAndContext) SetE(v IRelationContext) { s.e = v }
func (s *ConditionalAndContext) Set_relation(v IRelationContext) { s._relation = v }
+
func (s *ConditionalAndContext) GetE1() []IRelationContext { return s.e1 }
+
func (s *ConditionalAndContext) SetE1(v []IRelationContext) { s.e1 = v }
+
func (s *ConditionalAndContext) AllRelation() []IRelationContext {
children := s.GetChildren()
len := 0
@@ -1016,12 +1109,12 @@ func (s *ConditionalAndContext) AllRelation() []IRelationContext {
}
func (s *ConditionalAndContext) Relation(i int) IRelationContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IRelationContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -1051,6 +1144,7 @@ func (s *ConditionalAndContext) ToStringTree(ruleNames []string, recog antlr.Rec
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ConditionalAndContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConditionalAnd(s)
@@ -1073,30 +1167,14 @@ func (s *ConditionalAndContext) Accept(visitor antlr.ParseTreeVisitor) interface
}
}
-func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
localctx = NewConditionalAndContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 6, CELParserRULE_conditionalAnd)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(51)
@@ -1107,8 +1185,12 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
}
p.SetState(56)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserLOGICAL_AND {
{
p.SetState(52)
@@ -1116,6 +1198,10 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
var _m = p.Match(CELParserLOGICAL_AND)
localctx.(*ConditionalAndContext).s8 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*ConditionalAndContext).ops = append(localctx.(*ConditionalAndContext).ops, localctx.(*ConditionalAndContext).s8)
{
@@ -1127,14 +1213,31 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
}
localctx.(*ConditionalAndContext).e1 = append(localctx.(*ConditionalAndContext).e1, localctx.(*ConditionalAndContext)._relation)
+
p.SetState(58)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IRelationContext is an interface to support dynamic dispatch.
type IRelationContext interface {
antlr.ParserRuleContext
@@ -1143,10 +1246,12 @@ type IRelationContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
+ GetOp() antlr.Token
+
// SetOp sets the op token.
- SetOp(antlr.Token)
+ SetOp(antlr.Token)
+
// Getter signatures
Calc() ICalcContext
@@ -1165,24 +1270,29 @@ type IRelationContext interface {
}
type RelationContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- op antlr.Token
+ op antlr.Token
}
func NewEmptyRelationContext() *RelationContext {
var p = new(RelationContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_relation
return p
}
+func InitEmptyRelationContext(p *RelationContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_relation
+}
+
func (*RelationContext) IsRelationContext() {}
func NewRelationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RelationContext {
var p = new(RelationContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_relation
@@ -1194,13 +1304,15 @@ func (s *RelationContext) GetParser() antlr.Parser { return s.parser }
func (s *RelationContext) GetOp() antlr.Token { return s.op }
+
func (s *RelationContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *RelationContext) Calc() ICalcContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ICalcContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1234,12 +1346,12 @@ func (s *RelationContext) AllRelation() []IRelationContext {
}
func (s *RelationContext) Relation(i int) IRelationContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IRelationContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -1289,6 +1401,7 @@ func (s *RelationContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *RelationContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterRelation(s)
@@ -1311,15 +1424,17 @@ func (s *RelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
+
+
+
func (p *CELParser) Relation() (localctx IRelationContext) {
return p.relation(0)
}
func (p *CELParser) relation(_p int) (localctx IRelationContext) {
- this := p
- _ = this
-
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
+
_parentState := p.GetState()
localctx = NewRelationContext(p, p.GetParserRuleContext(), _parentState)
var _prevctx IRelationContext = localctx
@@ -1328,22 +1443,6 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.EnterRecursionRule(localctx, 8, CELParserRULE_relation, _p)
var _la int
- defer func() {
- p.UnrollRecursionContexts(_parentctx)
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -1355,8 +1454,13 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
p.SetState(67)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
if p.GetParseListeners() != nil {
@@ -1368,7 +1472,8 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.SetState(62)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ goto errorExit
}
{
p.SetState(63)
@@ -1379,7 +1484,7 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
_la = p.GetTokenStream().LA(1)
- if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&254) != 0) {
+ if !(((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 254) != 0)) {
var _ri = p.GetErrorHandler().RecoverInline(p)
localctx.(*RelationContext).op = _ri
@@ -1393,15 +1498,35 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.relation(2)
}
+
}
p.SetState(69)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+ errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.UnrollRecursionContexts(_parentctx)
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// ICalcContext is an interface to support dynamic dispatch.
type ICalcContext interface {
antlr.ParserRuleContext
@@ -1410,10 +1535,12 @@ type ICalcContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
+ GetOp() antlr.Token
+
// SetOp sets the op token.
- SetOp(antlr.Token)
+ SetOp(antlr.Token)
+
// Getter signatures
Unary() IUnaryContext
@@ -1430,24 +1557,29 @@ type ICalcContext interface {
}
type CalcContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- op antlr.Token
+ op antlr.Token
}
func NewEmptyCalcContext() *CalcContext {
var p = new(CalcContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_calc
return p
}
+func InitEmptyCalcContext(p *CalcContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_calc
+}
+
func (*CalcContext) IsCalcContext() {}
func NewCalcContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CalcContext {
var p = new(CalcContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_calc
@@ -1459,13 +1591,15 @@ func (s *CalcContext) GetParser() antlr.Parser { return s.parser }
func (s *CalcContext) GetOp() antlr.Token { return s.op }
+
func (s *CalcContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CalcContext) Unary() IUnaryContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IUnaryContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1499,12 +1633,12 @@ func (s *CalcContext) AllCalc() []ICalcContext {
}
func (s *CalcContext) Calc(i int) ICalcContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ICalcContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -1546,6 +1680,7 @@ func (s *CalcContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *CalcContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCalc(s)
@@ -1568,15 +1703,17 @@ func (s *CalcContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
+
+
+
func (p *CELParser) Calc() (localctx ICalcContext) {
return p.calc(0)
}
func (p *CELParser) calc(_p int) (localctx ICalcContext) {
- this := p
- _ = this
-
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
+
_parentState := p.GetState()
localctx = NewCalcContext(p, p.GetParserRuleContext(), _parentState)
var _prevctx ICalcContext = localctx
@@ -1585,22 +1722,6 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.EnterRecursionRule(localctx, 10, CELParserRULE_calc, _p)
var _la int
- defer func() {
- p.UnrollRecursionContexts(_parentctx)
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -1612,8 +1733,13 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
p.SetState(81)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
if p.GetParseListeners() != nil {
@@ -1622,14 +1748,19 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
_prevctx = localctx
p.SetState(79)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 4, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 4, p.GetParserRuleContext()) {
case 1:
localctx = NewCalcContext(p, _parentctx, _parentState)
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc)
p.SetState(73)
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ goto errorExit
}
{
p.SetState(74)
@@ -1640,7 +1771,7 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
_la = p.GetTokenStream().LA(1)
- if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&58720256) != 0) {
+ if !(((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 58720256) != 0)) {
var _ri = p.GetErrorHandler().RecoverInline(p)
localctx.(*CalcContext).op = _ri
@@ -1654,13 +1785,15 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.calc(3)
}
+
case 2:
localctx = NewCalcContext(p, _parentctx, _parentState)
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc)
p.SetState(76)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ goto errorExit
}
{
p.SetState(77)
@@ -1685,17 +1818,38 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.calc(2)
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
}
p.SetState(83)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+ errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.UnrollRecursionContexts(_parentctx)
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IUnaryContext is an interface to support dynamic dispatch.
type IUnaryContext interface {
antlr.ParserRuleContext
@@ -1707,23 +1861,28 @@ type IUnaryContext interface {
}
type UnaryContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyUnaryContext() *UnaryContext {
var p = new(UnaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_unary
return p
}
+func InitEmptyUnaryContext(p *UnaryContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_unary
+}
+
func (*UnaryContext) IsUnaryContext() {}
func NewUnaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UnaryContext {
var p = new(UnaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_unary
@@ -1733,8 +1892,8 @@ func NewUnaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invoki
func (s *UnaryContext) GetParser() antlr.Parser { return s.parser }
-func (s *UnaryContext) CopyFrom(ctx *UnaryContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *UnaryContext) CopyAll(ctx *UnaryContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *UnaryContext) GetRuleContext() antlr.RuleContext {
@@ -1745,8 +1904,11 @@ func (s *UnaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
type LogicalNotContext struct {
- *UnaryContext
+ UnaryContext
s19 antlr.Token
ops []antlr.Token
}
@@ -1754,19 +1916,23 @@ type LogicalNotContext struct {
func NewLogicalNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalNotContext {
var p = new(LogicalNotContext)
- p.UnaryContext = NewEmptyUnaryContext()
+ InitEmptyUnaryContext(&p.UnaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*UnaryContext))
+ p.CopyAll(ctx.(*UnaryContext))
return p
}
+
func (s *LogicalNotContext) GetS19() antlr.Token { return s.s19 }
+
func (s *LogicalNotContext) SetS19(v antlr.Token) { s.s19 = v }
+
func (s *LogicalNotContext) GetOps() []antlr.Token { return s.ops }
+
func (s *LogicalNotContext) SetOps(v []antlr.Token) { s.ops = v }
func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext {
@@ -1774,10 +1940,10 @@ func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext {
}
func (s *LogicalNotContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1797,6 +1963,7 @@ func (s *LogicalNotContext) EXCLAM(i int) antlr.TerminalNode {
return s.GetToken(CELParserEXCLAM, i)
}
+
func (s *LogicalNotContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterLogicalNot(s)
@@ -1819,16 +1986,17 @@ func (s *LogicalNotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type MemberExprContext struct {
- *UnaryContext
+ UnaryContext
}
func NewMemberExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberExprContext {
var p = new(MemberExprContext)
- p.UnaryContext = NewEmptyUnaryContext()
+ InitEmptyUnaryContext(&p.UnaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*UnaryContext))
+ p.CopyAll(ctx.(*UnaryContext))
return p
}
@@ -1838,10 +2006,10 @@ func (s *MemberExprContext) GetRuleContext() antlr.RuleContext {
}
func (s *MemberExprContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1853,6 +2021,7 @@ func (s *MemberExprContext) Member() IMemberContext {
return t.(IMemberContext)
}
+
func (s *MemberExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMemberExpr(s)
@@ -1875,8 +2044,9 @@ func (s *MemberExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type NegateContext struct {
- *UnaryContext
+ UnaryContext
s18 antlr.Token
ops []antlr.Token
}
@@ -1884,19 +2054,23 @@ type NegateContext struct {
func NewNegateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NegateContext {
var p = new(NegateContext)
- p.UnaryContext = NewEmptyUnaryContext()
+ InitEmptyUnaryContext(&p.UnaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*UnaryContext))
+ p.CopyAll(ctx.(*UnaryContext))
return p
}
+
func (s *NegateContext) GetS18() antlr.Token { return s.s18 }
+
func (s *NegateContext) SetS18(v antlr.Token) { s.s18 = v }
+
func (s *NegateContext) GetOps() []antlr.Token { return s.ops }
+
func (s *NegateContext) SetOps(v []antlr.Token) { s.ops = v }
func (s *NegateContext) GetRuleContext() antlr.RuleContext {
@@ -1904,10 +2078,10 @@ func (s *NegateContext) GetRuleContext() antlr.RuleContext {
}
func (s *NegateContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1927,6 +2101,7 @@ func (s *NegateContext) MINUS(i int) antlr.TerminalNode {
return s.GetToken(CELParserMINUS, i)
}
+
func (s *NegateContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNegate(s)
@@ -1949,35 +2124,22 @@ func (s *NegateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Unary() (localctx IUnaryContext) {
- this := p
- _ = this
+
+func (p *CELParser) Unary() (localctx IUnaryContext) {
localctx = NewUnaryContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 12, CELParserRULE_unary)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.SetState(97)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 8, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) {
case 1:
localctx = NewMemberExprContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
@@ -1986,13 +2148,18 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
p.member(0)
}
+
case 2:
localctx = NewLogicalNotContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
p.SetState(86)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for ok := true; ok; ok = _la == CELParserEXCLAM {
{
p.SetState(85)
@@ -2000,11 +2167,19 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
var _m = p.Match(CELParserEXCLAM)
localctx.(*LogicalNotContext).s19 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*LogicalNotContext).ops = append(localctx.(*LogicalNotContext).ops, localctx.(*LogicalNotContext).s19)
+
p.SetState(88)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
{
@@ -2012,42 +2187,71 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
p.member(0)
}
+
case 3:
localctx = NewNegateContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
p.SetState(92)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_alt = 1
for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
switch _alt {
case 1:
- {
- p.SetState(91)
+ {
+ p.SetState(91)
+
+ var _m = p.Match(CELParserMINUS)
+
+ localctx.(*NegateContext).s18 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
+ }
+ localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s18)
+
- var _m = p.Match(CELParserMINUS)
- localctx.(*NegateContext).s18 = _m
- }
- localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s18)
default:
- panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
+ p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
+ goto errorExit
}
p.SetState(94)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 7, p.GetParserRuleContext())
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 7, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
{
p.SetState(96)
p.member(0)
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IMemberContext is an interface to support dynamic dispatch.
type IMemberContext interface {
antlr.ParserRuleContext
@@ -2059,23 +2263,28 @@ type IMemberContext interface {
}
type MemberContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyMemberContext() *MemberContext {
var p = new(MemberContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_member
return p
}
+func InitEmptyMemberContext(p *MemberContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_member
+}
+
func (*MemberContext) IsMemberContext() {}
func NewMemberContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MemberContext {
var p = new(MemberContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_member
@@ -2085,8 +2294,8 @@ func NewMemberContext(parser antlr.Parser, parent antlr.ParserRuleContext, invok
func (s *MemberContext) GetParser() antlr.Parser { return s.parser }
-func (s *MemberContext) CopyFrom(ctx *MemberContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *MemberContext) CopyAll(ctx *MemberContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *MemberContext) GetRuleContext() antlr.RuleContext {
@@ -2097,38 +2306,46 @@ func (s *MemberContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
+
type MemberCallContext struct {
- *MemberContext
- op antlr.Token
- id antlr.Token
+ MemberContext
+ op antlr.Token
+ id antlr.Token
open antlr.Token
- args IExprListContext
+ args IExprListContext
}
func NewMemberCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberCallContext {
var p = new(MemberCallContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
+
func (s *MemberCallContext) GetOp() antlr.Token { return s.op }
func (s *MemberCallContext) GetId() antlr.Token { return s.id }
func (s *MemberCallContext) GetOpen() antlr.Token { return s.open }
+
func (s *MemberCallContext) SetOp(v antlr.Token) { s.op = v }
func (s *MemberCallContext) SetId(v antlr.Token) { s.id = v }
func (s *MemberCallContext) SetOpen(v antlr.Token) { s.open = v }
+
func (s *MemberCallContext) GetArgs() IExprListContext { return s.args }
+
func (s *MemberCallContext) SetArgs(v IExprListContext) { s.args = v }
func (s *MemberCallContext) GetRuleContext() antlr.RuleContext {
@@ -2136,10 +2353,10 @@ func (s *MemberCallContext) GetRuleContext() antlr.RuleContext {
}
func (s *MemberCallContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2168,10 +2385,10 @@ func (s *MemberCallContext) LPAREN() antlr.TerminalNode {
}
func (s *MemberCallContext) ExprList() IExprListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2183,6 +2400,7 @@ func (s *MemberCallContext) ExprList() IExprListContext {
return t.(IExprListContext)
}
+
func (s *MemberCallContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMemberCall(s)
@@ -2205,29 +2423,32 @@ func (s *MemberCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type SelectContext struct {
- *MemberContext
- op antlr.Token
+ MemberContext
+ op antlr.Token
opt antlr.Token
- id antlr.Token
+ id antlr.Token
}
func NewSelectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectContext {
var p = new(SelectContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
+
func (s *SelectContext) GetOp() antlr.Token { return s.op }
func (s *SelectContext) GetOpt() antlr.Token { return s.opt }
func (s *SelectContext) GetId() antlr.Token { return s.id }
+
func (s *SelectContext) SetOp(v antlr.Token) { s.op = v }
func (s *SelectContext) SetOpt(v antlr.Token) { s.opt = v }
@@ -2239,10 +2460,10 @@ func (s *SelectContext) GetRuleContext() antlr.RuleContext {
}
func (s *SelectContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2266,6 +2487,7 @@ func (s *SelectContext) QUESTIONMARK() antlr.TerminalNode {
return s.GetToken(CELParserQUESTIONMARK, 0)
}
+
func (s *SelectContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterSelect(s)
@@ -2288,16 +2510,17 @@ func (s *SelectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type PrimaryExprContext struct {
- *MemberContext
+ MemberContext
}
func NewPrimaryExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PrimaryExprContext {
var p = new(PrimaryExprContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
@@ -2307,10 +2530,10 @@ func (s *PrimaryExprContext) GetRuleContext() antlr.RuleContext {
}
func (s *PrimaryExprContext) Primary() IPrimaryContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IPrimaryContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2322,6 +2545,7 @@ func (s *PrimaryExprContext) Primary() IPrimaryContext {
return t.(IPrimaryContext)
}
+
func (s *PrimaryExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterPrimaryExpr(s)
@@ -2344,33 +2568,38 @@ func (s *PrimaryExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
}
}
+
type IndexContext struct {
- *MemberContext
- op antlr.Token
- opt antlr.Token
- index IExprContext
+ MemberContext
+ op antlr.Token
+ opt antlr.Token
+ index IExprContext
}
func NewIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IndexContext {
var p = new(IndexContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
+
func (s *IndexContext) GetOp() antlr.Token { return s.op }
func (s *IndexContext) GetOpt() antlr.Token { return s.opt }
+
func (s *IndexContext) SetOp(v antlr.Token) { s.op = v }
func (s *IndexContext) SetOpt(v antlr.Token) { s.opt = v }
+
func (s *IndexContext) GetIndex() IExprContext { return s.index }
+
func (s *IndexContext) SetIndex(v IExprContext) { s.index = v }
func (s *IndexContext) GetRuleContext() antlr.RuleContext {
@@ -2378,10 +2607,10 @@ func (s *IndexContext) GetRuleContext() antlr.RuleContext {
}
func (s *IndexContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2402,10 +2631,10 @@ func (s *IndexContext) LBRACKET() antlr.TerminalNode {
}
func (s *IndexContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2421,6 +2650,7 @@ func (s *IndexContext) QUESTIONMARK() antlr.TerminalNode {
return s.GetToken(CELParserQUESTIONMARK, 0)
}
+
func (s *IndexContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterIndex(s)
@@ -2443,15 +2673,15 @@ func (s *IndexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
+
func (p *CELParser) Member() (localctx IMemberContext) {
return p.member(0)
}
func (p *CELParser) member(_p int) (localctx IMemberContext) {
- this := p
- _ = this
-
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
+
_parentState := p.GetState()
localctx = NewMemberContext(p, p.GetParserRuleContext(), _parentState)
var _prevctx IMemberContext = localctx
@@ -2460,22 +2690,6 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
p.EnterRecursionRule(localctx, 14, CELParserRULE_member, _p)
var _la int
- defer func() {
- p.UnrollRecursionContexts(_parentctx)
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -2491,8 +2705,13 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
p.SetState(126)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 13, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
if p.GetParseListeners() != nil {
@@ -2501,14 +2720,19 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
_prevctx = localctx
p.SetState(124)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 12, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) {
case 1:
localctx = NewSelectContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
p.SetState(102)
if !(p.Precpred(p.GetParserRuleContext(), 3)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", ""))
+ goto errorExit
}
{
p.SetState(103)
@@ -2516,11 +2740,19 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserDOT)
localctx.(*SelectContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(105)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(104)
@@ -2528,6 +2760,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*SelectContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -2537,15 +2773,21 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*SelectContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 2:
localctx = NewMemberCallContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
p.SetState(108)
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ goto errorExit
}
{
p.SetState(109)
@@ -2553,6 +2795,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserDOT)
localctx.(*MemberCallContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(110)
@@ -2560,6 +2806,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*MemberCallContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(111)
@@ -2567,17 +2817,26 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserLPAREN)
localctx.(*MemberCallContext).open = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(113)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135762105344) != 0) {
{
p.SetState(112)
var _x = p.ExprList()
+
localctx.(*MemberCallContext).args = _x
}
@@ -2585,15 +2844,21 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
{
p.SetState(115)
p.Match(CELParserRPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 3:
localctx = NewIndexContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
p.SetState(116)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ goto errorExit
}
{
p.SetState(117)
@@ -2601,11 +2866,19 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserLBRACKET)
localctx.(*IndexContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(119)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(118)
@@ -2613,6 +2886,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*IndexContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -2621,24 +2898,50 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _x = p.Expr()
+
localctx.(*IndexContext).index = _x
}
{
p.SetState(122)
p.Match(CELParserRPRACKET)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
}
p.SetState(128)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 13, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+ errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.UnrollRecursionContexts(_parentctx)
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IPrimaryContext is an interface to support dynamic dispatch.
type IPrimaryContext interface {
antlr.ParserRuleContext
@@ -2650,23 +2953,28 @@ type IPrimaryContext interface {
}
type PrimaryContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyPrimaryContext() *PrimaryContext {
var p = new(PrimaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_primary
return p
}
+func InitEmptyPrimaryContext(p *PrimaryContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_primary
+}
+
func (*PrimaryContext) IsPrimaryContext() {}
func NewPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrimaryContext {
var p = new(PrimaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_primary
@@ -2676,8 +2984,8 @@ func NewPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invo
func (s *PrimaryContext) GetParser() antlr.Parser { return s.parser }
-func (s *PrimaryContext) CopyFrom(ctx *PrimaryContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *PrimaryContext) CopyAll(ctx *PrimaryContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *PrimaryContext) GetRuleContext() antlr.RuleContext {
@@ -2688,28 +2996,35 @@ func (s *PrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
type CreateListContext struct {
- *PrimaryContext
- op antlr.Token
- elems IListInitContext
+ PrimaryContext
+ op antlr.Token
+ elems IListInitContext
}
func NewCreateListContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateListContext {
var p = new(CreateListContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *CreateListContext) GetOp() antlr.Token { return s.op }
+
func (s *CreateListContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CreateListContext) GetElems() IListInitContext { return s.elems }
+
func (s *CreateListContext) SetElems(v IListInitContext) { s.elems = v }
func (s *CreateListContext) GetRuleContext() antlr.RuleContext {
@@ -2729,10 +3044,10 @@ func (s *CreateListContext) COMMA() antlr.TerminalNode {
}
func (s *CreateListContext) ListInit() IListInitContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IListInitContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2744,6 +3059,7 @@ func (s *CreateListContext) ListInit() IListInitContext {
return t.(IListInitContext)
}
+
func (s *CreateListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateList(s)
@@ -2766,28 +3082,33 @@ func (s *CreateListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type CreateStructContext struct {
- *PrimaryContext
- op antlr.Token
- entries IMapInitializerListContext
+ PrimaryContext
+ op antlr.Token
+ entries IMapInitializerListContext
}
func NewCreateStructContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateStructContext {
var p = new(CreateStructContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *CreateStructContext) GetOp() antlr.Token { return s.op }
+
func (s *CreateStructContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CreateStructContext) GetEntries() IMapInitializerListContext { return s.entries }
+
func (s *CreateStructContext) SetEntries(v IMapInitializerListContext) { s.entries = v }
func (s *CreateStructContext) GetRuleContext() antlr.RuleContext {
@@ -2807,10 +3128,10 @@ func (s *CreateStructContext) COMMA() antlr.TerminalNode {
}
func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMapInitializerListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2822,6 +3143,7 @@ func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext {
return t.(IMapInitializerListContext)
}
+
func (s *CreateStructContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateStruct(s)
@@ -2844,16 +3166,17 @@ func (s *CreateStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
}
}
+
type ConstantLiteralContext struct {
- *PrimaryContext
+ PrimaryContext
}
func NewConstantLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConstantLiteralContext {
var p = new(ConstantLiteralContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
@@ -2863,10 +3186,10 @@ func (s *ConstantLiteralContext) GetRuleContext() antlr.RuleContext {
}
func (s *ConstantLiteralContext) Literal() ILiteralContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ILiteralContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2878,6 +3201,7 @@ func (s *ConstantLiteralContext) Literal() ILiteralContext {
return t.(ILiteralContext)
}
+
func (s *ConstantLiteralContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConstantLiteral(s)
@@ -2900,23 +3224,26 @@ func (s *ConstantLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interfac
}
}
+
type NestedContext struct {
- *PrimaryContext
- e IExprContext
+ PrimaryContext
+ e IExprContext
}
func NewNestedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NestedContext {
var p = new(NestedContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *NestedContext) GetE() IExprContext { return s.e }
+
func (s *NestedContext) SetE(v IExprContext) { s.e = v }
func (s *NestedContext) GetRuleContext() antlr.RuleContext {
@@ -2932,10 +3259,10 @@ func (s *NestedContext) RPAREN() antlr.TerminalNode {
}
func (s *NestedContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2947,6 +3274,7 @@ func (s *NestedContext) Expr() IExprContext {
return t.(IExprContext)
}
+
func (s *NestedContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNested(s)
@@ -2969,27 +3297,29 @@ func (s *NestedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type CreateMessageContext struct {
- *PrimaryContext
- leadingDot antlr.Token
+ PrimaryContext
+ leadingDot antlr.Token
_IDENTIFIER antlr.Token
- ids []antlr.Token
- s16 antlr.Token
- ops []antlr.Token
- op antlr.Token
- entries IFieldInitializerListContext
+ ids []antlr.Token
+ s16 antlr.Token
+ ops []antlr.Token
+ op antlr.Token
+ entries IFieldInitializerListContext
}
func NewCreateMessageContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateMessageContext {
var p = new(CreateMessageContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *CreateMessageContext) GetLeadingDot() antlr.Token { return s.leadingDot }
func (s *CreateMessageContext) Get_IDENTIFIER() antlr.Token { return s._IDENTIFIER }
@@ -2998,6 +3328,7 @@ func (s *CreateMessageContext) GetS16() antlr.Token { return s.s16 }
func (s *CreateMessageContext) GetOp() antlr.Token { return s.op }
+
func (s *CreateMessageContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
func (s *CreateMessageContext) Set_IDENTIFIER(v antlr.Token) { s._IDENTIFIER = v }
@@ -3006,16 +3337,20 @@ func (s *CreateMessageContext) SetS16(v antlr.Token) { s.s16 = v }
func (s *CreateMessageContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CreateMessageContext) GetIds() []antlr.Token { return s.ids }
func (s *CreateMessageContext) GetOps() []antlr.Token { return s.ops }
+
func (s *CreateMessageContext) SetIds(v []antlr.Token) { s.ids = v }
func (s *CreateMessageContext) SetOps(v []antlr.Token) { s.ops = v }
+
func (s *CreateMessageContext) GetEntries() IFieldInitializerListContext { return s.entries }
+
func (s *CreateMessageContext) SetEntries(v IFieldInitializerListContext) { s.entries = v }
func (s *CreateMessageContext) GetRuleContext() antlr.RuleContext {
@@ -3051,10 +3386,10 @@ func (s *CreateMessageContext) DOT(i int) antlr.TerminalNode {
}
func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IFieldInitializerListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -3066,6 +3401,7 @@ func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListConte
return t.(IFieldInitializerListContext)
}
+
func (s *CreateMessageContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateMessage(s)
@@ -3088,38 +3424,43 @@ func (s *CreateMessageContext) Accept(visitor antlr.ParseTreeVisitor) interface{
}
}
+
type IdentOrGlobalCallContext struct {
- *PrimaryContext
+ PrimaryContext
leadingDot antlr.Token
- id antlr.Token
- op antlr.Token
- args IExprListContext
+ id antlr.Token
+ op antlr.Token
+ args IExprListContext
}
func NewIdentOrGlobalCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdentOrGlobalCallContext {
var p = new(IdentOrGlobalCallContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *IdentOrGlobalCallContext) GetLeadingDot() antlr.Token { return s.leadingDot }
func (s *IdentOrGlobalCallContext) GetId() antlr.Token { return s.id }
func (s *IdentOrGlobalCallContext) GetOp() antlr.Token { return s.op }
+
func (s *IdentOrGlobalCallContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
func (s *IdentOrGlobalCallContext) SetId(v antlr.Token) { s.id = v }
func (s *IdentOrGlobalCallContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *IdentOrGlobalCallContext) GetArgs() IExprListContext { return s.args }
+
func (s *IdentOrGlobalCallContext) SetArgs(v IExprListContext) { s.args = v }
func (s *IdentOrGlobalCallContext) GetRuleContext() antlr.RuleContext {
@@ -3143,10 +3484,10 @@ func (s *IdentOrGlobalCallContext) LPAREN() antlr.TerminalNode {
}
func (s *IdentOrGlobalCallContext) ExprList() IExprListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -3158,6 +3499,7 @@ func (s *IdentOrGlobalCallContext) ExprList() IExprListContext {
return t.(IExprListContext)
}
+
func (s *IdentOrGlobalCallContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterIdentOrGlobalCall(s)
@@ -3180,40 +3522,31 @@ func (s *IdentOrGlobalCallContext) Accept(visitor antlr.ParseTreeVisitor) interf
}
}
-func (p *CELParser) Primary() (localctx IPrimaryContext) {
- this := p
- _ = this
+
+func (p *CELParser) Primary() (localctx IPrimaryContext) {
localctx = NewPrimaryContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 16, CELParserRULE_primary)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.SetState(180)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 25, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) {
case 1:
localctx = NewIdentOrGlobalCallContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
p.SetState(130)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserDOT {
{
p.SetState(129)
@@ -3221,6 +3554,10 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserDOT)
localctx.(*IdentOrGlobalCallContext).leadingDot = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -3230,28 +3567,42 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*IdentOrGlobalCallContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(138)
p.GetErrorHandler().Sync(p)
- if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
+
+ if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
{
p.SetState(133)
var _m = p.Match(CELParserLPAREN)
localctx.(*IdentOrGlobalCallContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(135)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135762105344) != 0) {
{
p.SetState(134)
var _x = p.ExprList()
+
localctx.(*IdentOrGlobalCallContext).args = _x
}
@@ -3259,29 +3610,46 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
{
p.SetState(137)
p.Match(CELParserRPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+ } else if p.HasError() { // JIM
+ goto errorExit
}
+
case 2:
localctx = NewNestedContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
{
p.SetState(140)
p.Match(CELParserLPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(141)
var _x = p.Expr()
+
localctx.(*NestedContext).e = _x
}
{
p.SetState(142)
p.Match(CELParserRPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 3:
localctx = NewCreateListContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
@@ -3291,37 +3659,59 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserLBRACKET)
localctx.(*CreateListContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(146)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135763153920) != 0) {
{
p.SetState(145)
var _x = p.ListInit()
+
localctx.(*CreateListContext).elems = _x
}
}
p.SetState(149)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserCOMMA {
{
p.SetState(148)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(151)
p.Match(CELParserRPRACKET)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 4:
localctx = NewCreateStructContext(p, localctx)
p.EnterOuterAlt(localctx, 4)
@@ -3331,44 +3721,70 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserLBRACE)
localctx.(*CreateStructContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(154)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135763153920) != 0) {
{
p.SetState(153)
var _x = p.MapInitializerList()
+
localctx.(*CreateStructContext).entries = _x
}
}
p.SetState(157)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserCOMMA {
{
p.SetState(156)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(159)
p.Match(CELParserRBRACE)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 5:
localctx = NewCreateMessageContext(p, localctx)
p.EnterOuterAlt(localctx, 5)
p.SetState(161)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserDOT {
{
p.SetState(160)
@@ -3376,6 +3792,10 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserDOT)
localctx.(*CreateMessageContext).leadingDot = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -3385,12 +3805,20 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*CreateMessageContext)._IDENTIFIER = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER)
p.SetState(168)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserDOT {
{
p.SetState(164)
@@ -3398,6 +3826,10 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserDOT)
localctx.(*CreateMessageContext).s16 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*CreateMessageContext).ops = append(localctx.(*CreateMessageContext).ops, localctx.(*CreateMessageContext).s16)
{
@@ -3406,11 +3838,19 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*CreateMessageContext)._IDENTIFIER = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER)
+
p.SetState(170)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
{
@@ -3419,37 +3859,59 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserLBRACE)
localctx.(*CreateMessageContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(173)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK || _la == CELParserIDENTIFIER {
{
p.SetState(172)
var _x = p.FieldInitializerList()
+
localctx.(*CreateMessageContext).entries = _x
}
}
p.SetState(176)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserCOMMA {
{
p.SetState(175)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(178)
p.Match(CELParserRBRACE)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 6:
localctx = NewConstantLiteralContext(p, localctx)
p.EnterOuterAlt(localctx, 6)
@@ -3458,11 +3920,25 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
p.Literal()
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IExprListContext is an interface to support dynamic dispatch.
type IExprListContext interface {
antlr.ParserRuleContext
@@ -3473,14 +3949,18 @@ type IExprListContext interface {
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
+
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
+
// GetE returns the e rule context list.
GetE() []IExprContext
+
// SetE sets the e rule context list.
- SetE([]IExprContext)
+ SetE([]IExprContext)
+
// Getter signatures
AllExpr() []IExprContext
@@ -3493,25 +3973,30 @@ type IExprListContext interface {
}
type ExprListContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- _expr IExprContext
- e []IExprContext
+ _expr IExprContext
+ e []IExprContext
}
func NewEmptyExprListContext() *ExprListContext {
var p = new(ExprListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_exprList
return p
}
+func InitEmptyExprListContext(p *ExprListContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_exprList
+}
+
func (*ExprListContext) IsExprListContext() {}
func NewExprListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprListContext {
var p = new(ExprListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_exprList
@@ -3523,12 +4008,16 @@ func (s *ExprListContext) GetParser() antlr.Parser { return s.parser }
func (s *ExprListContext) Get_expr() IExprContext { return s._expr }
+
func (s *ExprListContext) Set_expr(v IExprContext) { s._expr = v }
+
func (s *ExprListContext) GetE() []IExprContext { return s.e }
+
func (s *ExprListContext) SetE(v []IExprContext) { s.e = v }
+
func (s *ExprListContext) AllExpr() []IExprContext {
children := s.GetChildren()
len := 0
@@ -3551,12 +4040,12 @@ func (s *ExprListContext) AllExpr() []IExprContext {
}
func (s *ExprListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -3586,6 +4075,7 @@ func (s *ExprListContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ExprListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterExprList(s)
@@ -3608,65 +4098,76 @@ func (s *ExprListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) ExprList() (localctx IExprListContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) ExprList() (localctx IExprListContext) {
localctx = NewExprListContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 18, CELParserRULE_exprList)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(182)
var _x = p.Expr()
+
localctx.(*ExprListContext)._expr = _x
}
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr)
p.SetState(187)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserCOMMA {
{
p.SetState(183)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(184)
var _x = p.Expr()
+
localctx.(*ExprListContext)._expr = _x
}
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr)
+
p.SetState(189)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IListInitContext is an interface to support dynamic dispatch.
type IListInitContext interface {
antlr.ParserRuleContext
@@ -3677,14 +4178,18 @@ type IListInitContext interface {
// Get_optExpr returns the _optExpr rule contexts.
Get_optExpr() IOptExprContext
+
// Set_optExpr sets the _optExpr rule contexts.
Set_optExpr(IOptExprContext)
+
// GetElems returns the elems rule context list.
GetElems() []IOptExprContext
+
// SetElems sets the elems rule context list.
- SetElems([]IOptExprContext)
+ SetElems([]IOptExprContext)
+
// Getter signatures
AllOptExpr() []IOptExprContext
@@ -3697,25 +4202,30 @@ type IListInitContext interface {
}
type ListInitContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- _optExpr IOptExprContext
- elems []IOptExprContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ _optExpr IOptExprContext
+ elems []IOptExprContext
}
func NewEmptyListInitContext() *ListInitContext {
var p = new(ListInitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_listInit
return p
}
+func InitEmptyListInitContext(p *ListInitContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_listInit
+}
+
func (*ListInitContext) IsListInitContext() {}
func NewListInitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ListInitContext {
var p = new(ListInitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_listInit
@@ -3727,12 +4237,16 @@ func (s *ListInitContext) GetParser() antlr.Parser { return s.parser }
func (s *ListInitContext) Get_optExpr() IOptExprContext { return s._optExpr }
+
func (s *ListInitContext) Set_optExpr(v IOptExprContext) { s._optExpr = v }
+
func (s *ListInitContext) GetElems() []IOptExprContext { return s.elems }
+
func (s *ListInitContext) SetElems(v []IOptExprContext) { s.elems = v }
+
func (s *ListInitContext) AllOptExpr() []IOptExprContext {
children := s.GetChildren()
len := 0
@@ -3755,12 +4269,12 @@ func (s *ListInitContext) AllOptExpr() []IOptExprContext {
}
func (s *ListInitContext) OptExpr(i int) IOptExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -3790,6 +4304,7 @@ func (s *ListInitContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ListInitContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterListInit(s)
@@ -3812,29 +4327,12 @@ func (s *ListInitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) ListInit() (localctx IListInitContext) {
- this := p
- _ = this
- localctx = NewListInitContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 20, CELParserRULE_listInit)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) ListInit() (localctx IListInitContext) {
+ localctx = NewListInitContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 20, CELParserRULE_listInit)
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -3843,37 +4341,68 @@ func (p *CELParser) ListInit() (localctx IListInitContext) {
var _x = p.OptExpr()
+
localctx.(*ListInitContext)._optExpr = _x
}
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr)
p.SetState(195)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 27, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
p.SetState(191)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(192)
var _x = p.OptExpr()
+
localctx.(*ListInitContext)._optExpr = _x
}
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr)
+
}
p.SetState(197)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 27, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IFieldInitializerListContext is an interface to support dynamic dispatch.
type IFieldInitializerListContext interface {
antlr.ParserRuleContext
@@ -3882,40 +4411,48 @@ type IFieldInitializerListContext interface {
GetParser() antlr.Parser
// GetS21 returns the s21 token.
- GetS21() antlr.Token
+ GetS21() antlr.Token
+
// SetS21 sets the s21 token.
- SetS21(antlr.Token)
+ SetS21(antlr.Token)
+
// GetCols returns the cols token list.
GetCols() []antlr.Token
+
// SetCols sets the cols token list.
SetCols([]antlr.Token)
+
// Get_optField returns the _optField rule contexts.
Get_optField() IOptFieldContext
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
+
// Set_optField sets the _optField rule contexts.
Set_optField(IOptFieldContext)
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
+
// GetFields returns the fields rule context list.
GetFields() []IOptFieldContext
// GetValues returns the values rule context list.
GetValues() []IExprContext
+
// SetFields sets the fields rule context list.
- SetFields([]IOptFieldContext)
+ SetFields([]IOptFieldContext)
// SetValues sets the values rule context list.
- SetValues([]IExprContext)
+ SetValues([]IExprContext)
+
// Getter signatures
AllOptField() []IOptFieldContext
@@ -3932,29 +4469,34 @@ type IFieldInitializerListContext interface {
}
type FieldInitializerListContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- _optField IOptFieldContext
- fields []IOptFieldContext
- s21 antlr.Token
- cols []antlr.Token
- _expr IExprContext
- values []IExprContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ _optField IOptFieldContext
+ fields []IOptFieldContext
+ s21 antlr.Token
+ cols []antlr.Token
+ _expr IExprContext
+ values []IExprContext
}
func NewEmptyFieldInitializerListContext() *FieldInitializerListContext {
var p = new(FieldInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_fieldInitializerList
return p
}
+func InitEmptyFieldInitializerListContext(p *FieldInitializerListContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_fieldInitializerList
+}
+
func (*FieldInitializerListContext) IsFieldInitializerListContext() {}
func NewFieldInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FieldInitializerListContext {
var p = new(FieldInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_fieldInitializerList
@@ -3966,28 +4508,36 @@ func (s *FieldInitializerListContext) GetParser() antlr.Parser { return s.parser
func (s *FieldInitializerListContext) GetS21() antlr.Token { return s.s21 }
+
func (s *FieldInitializerListContext) SetS21(v antlr.Token) { s.s21 = v }
+
func (s *FieldInitializerListContext) GetCols() []antlr.Token { return s.cols }
+
func (s *FieldInitializerListContext) SetCols(v []antlr.Token) { s.cols = v }
+
func (s *FieldInitializerListContext) Get_optField() IOptFieldContext { return s._optField }
func (s *FieldInitializerListContext) Get_expr() IExprContext { return s._expr }
+
func (s *FieldInitializerListContext) Set_optField(v IOptFieldContext) { s._optField = v }
func (s *FieldInitializerListContext) Set_expr(v IExprContext) { s._expr = v }
+
func (s *FieldInitializerListContext) GetFields() []IOptFieldContext { return s.fields }
func (s *FieldInitializerListContext) GetValues() []IExprContext { return s.values }
+
func (s *FieldInitializerListContext) SetFields(v []IOptFieldContext) { s.fields = v }
func (s *FieldInitializerListContext) SetValues(v []IExprContext) { s.values = v }
+
func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext {
children := s.GetChildren()
len := 0
@@ -4010,12 +4560,12 @@ func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext {
}
func (s *FieldInitializerListContext) OptField(i int) IOptFieldContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptFieldContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4059,12 +4609,12 @@ func (s *FieldInitializerListContext) AllExpr() []IExprContext {
}
func (s *FieldInitializerListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4094,6 +4644,7 @@ func (s *FieldInitializerListContext) ToStringTree(ruleNames []string, recog ant
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *FieldInitializerListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterFieldInitializerList(s)
@@ -4116,29 +4667,12 @@ func (s *FieldInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) int
}
}
-func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContext) {
- this := p
- _ = this
- localctx = NewFieldInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 22, CELParserRULE_fieldInitializerList)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContext) {
+ localctx = NewFieldInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 22, CELParserRULE_fieldInitializerList)
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -4147,6 +4681,7 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _x = p.OptField()
+
localctx.(*FieldInitializerListContext)._optField = _x
}
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField)
@@ -4156,6 +4691,10 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _m = p.Match(CELParserCOLON)
localctx.(*FieldInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21)
{
@@ -4163,24 +4702,35 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _x = p.Expr()
+
localctx.(*FieldInitializerListContext)._expr = _x
}
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr)
p.SetState(208)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
p.SetState(201)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(202)
var _x = p.OptField()
+
localctx.(*FieldInitializerListContext)._optField = _x
}
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField)
@@ -4190,6 +4740,10 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _m = p.Match(CELParserCOLON)
localctx.(*FieldInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21)
{
@@ -4197,19 +4751,40 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _x = p.Expr()
+
localctx.(*FieldInitializerListContext)._expr = _x
}
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr)
+
}
p.SetState(210)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IOptFieldContext is an interface to support dynamic dispatch.
type IOptFieldContext interface {
antlr.ParserRuleContext
@@ -4218,10 +4793,12 @@ type IOptFieldContext interface {
GetParser() antlr.Parser
// GetOpt returns the opt token.
- GetOpt() antlr.Token
+ GetOpt() antlr.Token
+
// SetOpt sets the opt token.
- SetOpt(antlr.Token)
+ SetOpt(antlr.Token)
+
// Getter signatures
IDENTIFIER() antlr.TerminalNode
@@ -4232,24 +4809,29 @@ type IOptFieldContext interface {
}
type OptFieldContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- opt antlr.Token
+ opt antlr.Token
}
func NewEmptyOptFieldContext() *OptFieldContext {
var p = new(OptFieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_optField
return p
}
+func InitEmptyOptFieldContext(p *OptFieldContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_optField
+}
+
func (*OptFieldContext) IsOptFieldContext() {}
func NewOptFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptFieldContext {
var p = new(OptFieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_optField
@@ -4261,8 +4843,10 @@ func (s *OptFieldContext) GetParser() antlr.Parser { return s.parser }
func (s *OptFieldContext) GetOpt() antlr.Token { return s.opt }
+
func (s *OptFieldContext) SetOpt(v antlr.Token) { s.opt = v }
+
func (s *OptFieldContext) IDENTIFIER() antlr.TerminalNode {
return s.GetToken(CELParserIDENTIFIER, 0)
}
@@ -4279,6 +4863,7 @@ func (s *OptFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *OptFieldContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterOptField(s)
@@ -4301,35 +4886,23 @@ func (s *OptFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) OptField() (localctx IOptFieldContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) OptField() (localctx IOptFieldContext) {
localctx = NewOptFieldContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 24, CELParserRULE_optField)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
p.SetState(212)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(211)
@@ -4337,17 +4910,38 @@ func (p *CELParser) OptField() (localctx IOptFieldContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*OptFieldContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(214)
p.Match(CELParserIDENTIFIER)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IMapInitializerListContext is an interface to support dynamic dispatch.
type IMapInitializerListContext interface {
antlr.ParserRuleContext
@@ -4356,40 +4950,48 @@ type IMapInitializerListContext interface {
GetParser() antlr.Parser
// GetS21 returns the s21 token.
- GetS21() antlr.Token
+ GetS21() antlr.Token
+
// SetS21 sets the s21 token.
- SetS21(antlr.Token)
+ SetS21(antlr.Token)
+
// GetCols returns the cols token list.
GetCols() []antlr.Token
+
// SetCols sets the cols token list.
SetCols([]antlr.Token)
+
// Get_optExpr returns the _optExpr rule contexts.
Get_optExpr() IOptExprContext
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
+
// Set_optExpr sets the _optExpr rule contexts.
Set_optExpr(IOptExprContext)
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
+
// GetKeys returns the keys rule context list.
GetKeys() []IOptExprContext
// GetValues returns the values rule context list.
GetValues() []IExprContext
+
// SetKeys sets the keys rule context list.
- SetKeys([]IOptExprContext)
+ SetKeys([]IOptExprContext)
// SetValues sets the values rule context list.
- SetValues([]IExprContext)
+ SetValues([]IExprContext)
+
// Getter signatures
AllOptExpr() []IOptExprContext
@@ -4406,29 +5008,34 @@ type IMapInitializerListContext interface {
}
type MapInitializerListContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- _optExpr IOptExprContext
- keys []IOptExprContext
- s21 antlr.Token
- cols []antlr.Token
- _expr IExprContext
- values []IExprContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ _optExpr IOptExprContext
+ keys []IOptExprContext
+ s21 antlr.Token
+ cols []antlr.Token
+ _expr IExprContext
+ values []IExprContext
}
func NewEmptyMapInitializerListContext() *MapInitializerListContext {
var p = new(MapInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_mapInitializerList
return p
}
+func InitEmptyMapInitializerListContext(p *MapInitializerListContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_mapInitializerList
+}
+
func (*MapInitializerListContext) IsMapInitializerListContext() {}
func NewMapInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MapInitializerListContext {
var p = new(MapInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_mapInitializerList
@@ -4440,28 +5047,36 @@ func (s *MapInitializerListContext) GetParser() antlr.Parser { return s.parser }
func (s *MapInitializerListContext) GetS21() antlr.Token { return s.s21 }
+
func (s *MapInitializerListContext) SetS21(v antlr.Token) { s.s21 = v }
+
func (s *MapInitializerListContext) GetCols() []antlr.Token { return s.cols }
+
func (s *MapInitializerListContext) SetCols(v []antlr.Token) { s.cols = v }
+
func (s *MapInitializerListContext) Get_optExpr() IOptExprContext { return s._optExpr }
func (s *MapInitializerListContext) Get_expr() IExprContext { return s._expr }
+
func (s *MapInitializerListContext) Set_optExpr(v IOptExprContext) { s._optExpr = v }
func (s *MapInitializerListContext) Set_expr(v IExprContext) { s._expr = v }
+
func (s *MapInitializerListContext) GetKeys() []IOptExprContext { return s.keys }
func (s *MapInitializerListContext) GetValues() []IExprContext { return s.values }
+
func (s *MapInitializerListContext) SetKeys(v []IOptExprContext) { s.keys = v }
func (s *MapInitializerListContext) SetValues(v []IExprContext) { s.values = v }
+
func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext {
children := s.GetChildren()
len := 0
@@ -4484,12 +5099,12 @@ func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext {
}
func (s *MapInitializerListContext) OptExpr(i int) IOptExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4533,12 +5148,12 @@ func (s *MapInitializerListContext) AllExpr() []IExprContext {
}
func (s *MapInitializerListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4568,6 +5183,7 @@ func (s *MapInitializerListContext) ToStringTree(ruleNames []string, recog antlr
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *MapInitializerListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMapInitializerList(s)
@@ -4590,29 +5206,12 @@ func (s *MapInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) inter
}
}
-func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
- this := p
- _ = this
- localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 26, CELParserRULE_mapInitializerList)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
+ localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 26, CELParserRULE_mapInitializerList)
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -4621,6 +5220,7 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _x = p.OptExpr()
+
localctx.(*MapInitializerListContext)._optExpr = _x
}
localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
@@ -4630,6 +5230,10 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _m = p.Match(CELParserCOLON)
localctx.(*MapInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
{
@@ -4637,24 +5241,35 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _x = p.Expr()
+
localctx.(*MapInitializerListContext)._expr = _x
}
localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
p.SetState(226)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 30, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
p.SetState(219)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(220)
var _x = p.OptExpr()
+
localctx.(*MapInitializerListContext)._optExpr = _x
}
localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
@@ -4664,6 +5279,10 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _m = p.Match(CELParserCOLON)
localctx.(*MapInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
{
@@ -4671,19 +5290,40 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _x = p.Expr()
+
localctx.(*MapInitializerListContext)._expr = _x
}
localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
+
}
p.SetState(228)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IOptExprContext is an interface to support dynamic dispatch.
type IOptExprContext interface {
antlr.ParserRuleContext
@@ -4692,17 +5332,21 @@ type IOptExprContext interface {
GetParser() antlr.Parser
// GetOpt returns the opt token.
- GetOpt() antlr.Token
+ GetOpt() antlr.Token
+
// SetOpt sets the opt token.
- SetOpt(antlr.Token)
+ SetOpt(antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IExprContext
+
// SetE sets the e rule contexts.
SetE(IExprContext)
+
// Getter signatures
Expr() IExprContext
QUESTIONMARK() antlr.TerminalNode
@@ -4712,25 +5356,30 @@ type IOptExprContext interface {
}
type OptExprContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- opt antlr.Token
- e IExprContext
+ opt antlr.Token
+ e IExprContext
}
func NewEmptyOptExprContext() *OptExprContext {
var p = new(OptExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_optExpr
return p
}
+func InitEmptyOptExprContext(p *OptExprContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_optExpr
+}
+
func (*OptExprContext) IsOptExprContext() {}
func NewOptExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptExprContext {
var p = new(OptExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_optExpr
@@ -4742,17 +5391,21 @@ func (s *OptExprContext) GetParser() antlr.Parser { return s.parser }
func (s *OptExprContext) GetOpt() antlr.Token { return s.opt }
+
func (s *OptExprContext) SetOpt(v antlr.Token) { s.opt = v }
+
func (s *OptExprContext) GetE() IExprContext { return s.e }
+
func (s *OptExprContext) SetE(v IExprContext) { s.e = v }
+
func (s *OptExprContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -4776,6 +5429,7 @@ func (s *OptExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *OptExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterOptExpr(s)
@@ -4798,35 +5452,23 @@ func (s *OptExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) OptExpr() (localctx IOptExprContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) OptExpr() (localctx IOptExprContext) {
localctx = NewOptExprContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 28, CELParserRULE_optExpr)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
p.SetState(230)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(229)
@@ -4834,6 +5476,10 @@ func (p *CELParser) OptExpr() (localctx IOptExprContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*OptExprContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -4842,12 +5488,26 @@ func (p *CELParser) OptExpr() (localctx IOptExprContext) {
var _x = p.Expr()
+
localctx.(*OptExprContext).e = _x
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// ILiteralContext is an interface to support dynamic dispatch.
type ILiteralContext interface {
antlr.ParserRuleContext
@@ -4859,23 +5519,28 @@ type ILiteralContext interface {
}
type LiteralContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyLiteralContext() *LiteralContext {
var p = new(LiteralContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_literal
return p
}
+func InitEmptyLiteralContext(p *LiteralContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_literal
+}
+
func (*LiteralContext) IsLiteralContext() {}
func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext {
var p = new(LiteralContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_literal
@@ -4885,8 +5550,8 @@ func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invo
func (s *LiteralContext) GetParser() antlr.Parser { return s.parser }
-func (s *LiteralContext) CopyFrom(ctx *LiteralContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *LiteralContext) CopyAll(ctx *LiteralContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *LiteralContext) GetRuleContext() antlr.RuleContext {
@@ -4897,23 +5562,28 @@ func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
type BytesContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewBytesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BytesContext {
var p = new(BytesContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *BytesContext) GetTok() antlr.Token { return s.tok }
+
func (s *BytesContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BytesContext) GetRuleContext() antlr.RuleContext {
@@ -4924,6 +5594,7 @@ func (s *BytesContext) BYTES() antlr.TerminalNode {
return s.GetToken(CELParserBYTES, 0)
}
+
func (s *BytesContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBytes(s)
@@ -4946,23 +5617,26 @@ func (s *BytesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type UintContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewUintContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UintContext {
var p = new(UintContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *UintContext) GetTok() antlr.Token { return s.tok }
+
func (s *UintContext) SetTok(v antlr.Token) { s.tok = v }
func (s *UintContext) GetRuleContext() antlr.RuleContext {
@@ -4973,6 +5647,7 @@ func (s *UintContext) NUM_UINT() antlr.TerminalNode {
return s.GetToken(CELParserNUM_UINT, 0)
}
+
func (s *UintContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterUint(s)
@@ -4995,23 +5670,26 @@ func (s *UintContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type NullContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullContext {
var p = new(NullContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *NullContext) GetTok() antlr.Token { return s.tok }
+
func (s *NullContext) SetTok(v antlr.Token) { s.tok = v }
func (s *NullContext) GetRuleContext() antlr.RuleContext {
@@ -5022,6 +5700,7 @@ func (s *NullContext) NUL() antlr.TerminalNode {
return s.GetToken(CELParserNUL, 0)
}
+
func (s *NullContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNull(s)
@@ -5044,23 +5723,26 @@ func (s *NullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type BoolFalseContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewBoolFalseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolFalseContext {
var p = new(BoolFalseContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *BoolFalseContext) GetTok() antlr.Token { return s.tok }
+
func (s *BoolFalseContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BoolFalseContext) GetRuleContext() antlr.RuleContext {
@@ -5071,6 +5753,7 @@ func (s *BoolFalseContext) CEL_FALSE() antlr.TerminalNode {
return s.GetToken(CELParserCEL_FALSE, 0)
}
+
func (s *BoolFalseContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBoolFalse(s)
@@ -5093,23 +5776,26 @@ func (s *BoolFalseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type StringContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringContext {
var p = new(StringContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *StringContext) GetTok() antlr.Token { return s.tok }
+
func (s *StringContext) SetTok(v antlr.Token) { s.tok = v }
func (s *StringContext) GetRuleContext() antlr.RuleContext {
@@ -5120,6 +5806,7 @@ func (s *StringContext) STRING() antlr.TerminalNode {
return s.GetToken(CELParserSTRING, 0)
}
+
func (s *StringContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterString(s)
@@ -5142,26 +5829,29 @@ func (s *StringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type DoubleContext struct {
- *LiteralContext
+ LiteralContext
sign antlr.Token
- tok antlr.Token
+ tok antlr.Token
}
func NewDoubleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DoubleContext {
var p = new(DoubleContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *DoubleContext) GetSign() antlr.Token { return s.sign }
func (s *DoubleContext) GetTok() antlr.Token { return s.tok }
+
func (s *DoubleContext) SetSign(v antlr.Token) { s.sign = v }
func (s *DoubleContext) SetTok(v antlr.Token) { s.tok = v }
@@ -5178,6 +5868,7 @@ func (s *DoubleContext) MINUS() antlr.TerminalNode {
return s.GetToken(CELParserMINUS, 0)
}
+
func (s *DoubleContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterDouble(s)
@@ -5200,23 +5891,26 @@ func (s *DoubleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type BoolTrueContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewBoolTrueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolTrueContext {
var p = new(BoolTrueContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *BoolTrueContext) GetTok() antlr.Token { return s.tok }
+
func (s *BoolTrueContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BoolTrueContext) GetRuleContext() antlr.RuleContext {
@@ -5227,6 +5921,7 @@ func (s *BoolTrueContext) CEL_TRUE() antlr.TerminalNode {
return s.GetToken(CELParserCEL_TRUE, 0)
}
+
func (s *BoolTrueContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBoolTrue(s)
@@ -5249,26 +5944,29 @@ func (s *BoolTrueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type IntContext struct {
- *LiteralContext
+ LiteralContext
sign antlr.Token
- tok antlr.Token
+ tok antlr.Token
}
func NewIntContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntContext {
var p = new(IntContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *IntContext) GetSign() antlr.Token { return s.sign }
func (s *IntContext) GetTok() antlr.Token { return s.tok }
+
func (s *IntContext) SetSign(v antlr.Token) { s.sign = v }
func (s *IntContext) SetTok(v antlr.Token) { s.tok = v }
@@ -5285,6 +5983,7 @@ func (s *IntContext) MINUS() antlr.TerminalNode {
return s.GetToken(CELParserMINUS, 0)
}
+
func (s *IntContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterInt(s)
@@ -5307,40 +6006,31 @@ func (s *IntContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Literal() (localctx ILiteralContext) {
- this := p
- _ = this
+
+func (p *CELParser) Literal() (localctx ILiteralContext) {
localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 30, CELParserRULE_literal)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.SetState(248)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 34, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 34, p.GetParserRuleContext()) {
case 1:
localctx = NewIntContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
p.SetState(235)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserMINUS {
{
p.SetState(234)
@@ -5348,6 +6038,10 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserMINUS)
localctx.(*IntContext).sign = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -5357,8 +6051,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUM_INT)
localctx.(*IntContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 2:
localctx = NewUintContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
@@ -5368,15 +6067,24 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUM_UINT)
localctx.(*UintContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 3:
localctx = NewDoubleContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
p.SetState(240)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserMINUS {
{
p.SetState(239)
@@ -5384,6 +6092,10 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserMINUS)
localctx.(*DoubleContext).sign = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -5393,8 +6105,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUM_FLOAT)
localctx.(*DoubleContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 4:
localctx = NewStringContext(p, localctx)
p.EnterOuterAlt(localctx, 4)
@@ -5404,8 +6121,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserSTRING)
localctx.(*StringContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 5:
localctx = NewBytesContext(p, localctx)
p.EnterOuterAlt(localctx, 5)
@@ -5415,8 +6137,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserBYTES)
localctx.(*BytesContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 6:
localctx = NewBoolTrueContext(p, localctx)
p.EnterOuterAlt(localctx, 6)
@@ -5426,8 +6153,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserCEL_TRUE)
localctx.(*BoolTrueContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 7:
localctx = NewBoolFalseContext(p, localctx)
p.EnterOuterAlt(localctx, 7)
@@ -5437,8 +6169,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserCEL_FALSE)
localctx.(*BoolFalseContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 8:
localctx = NewNullContext(p, localctx)
p.EnterOuterAlt(localctx, 8)
@@ -5448,35 +6185,48 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUL)
localctx.(*NullContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
func (p *CELParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool {
switch ruleIndex {
case 4:
- var t *RelationContext = nil
- if localctx != nil {
- t = localctx.(*RelationContext)
- }
- return p.Relation_Sempred(t, predIndex)
+ var t *RelationContext = nil
+ if localctx != nil { t = localctx.(*RelationContext) }
+ return p.Relation_Sempred(t, predIndex)
case 5:
- var t *CalcContext = nil
- if localctx != nil {
- t = localctx.(*CalcContext)
- }
- return p.Calc_Sempred(t, predIndex)
+ var t *CalcContext = nil
+ if localctx != nil { t = localctx.(*CalcContext) }
+ return p.Calc_Sempred(t, predIndex)
case 7:
- var t *MemberContext = nil
- if localctx != nil {
- t = localctx.(*MemberContext)
- }
- return p.Member_Sempred(t, predIndex)
+ var t *MemberContext = nil
+ if localctx != nil { t = localctx.(*MemberContext) }
+ return p.Member_Sempred(t, predIndex)
+
default:
panic("No predicate with index: " + fmt.Sprint(ruleIndex))
@@ -5484,12 +6234,9 @@ func (p *CELParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int
}
func (p *CELParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int) bool {
- this := p
- _ = this
-
switch predIndex {
case 0:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
@@ -5497,15 +6244,12 @@ func (p *CELParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int)
}
func (p *CELParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool {
- this := p
- _ = this
-
switch predIndex {
case 1:
- return p.Precpred(p.GetParserRuleContext(), 2)
+ return p.Precpred(p.GetParserRuleContext(), 2)
case 2:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
@@ -5513,20 +6257,18 @@ func (p *CELParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool
}
func (p *CELParser) Member_Sempred(localctx antlr.RuleContext, predIndex int) bool {
- this := p
- _ = this
-
switch predIndex {
case 3:
- return p.Precpred(p.GetParserRuleContext(), 3)
+ return p.Precpred(p.GetParserRuleContext(), 3)
case 4:
- return p.Precpred(p.GetParserRuleContext(), 2)
+ return p.Precpred(p.GetParserRuleContext(), 2)
case 5:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
}
}
+
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
index 2c54e2cb02e..d2fbd563ab7 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
@@ -1,7 +1,8 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
+
// A complete Visitor for a parse tree produced by CELParser.
type CELVisitor interface {
@@ -105,4 +106,5 @@ type CELVisitor interface {
// Visit a parse tree produced by CELParser#Null.
VisitNull(ctx *NullContext) interface{}
-}
+
+}
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/parser/gen/generate.sh b/vendor/github.com/google/cel-go/parser/gen/generate.sh
index 389107c6a57..27a9559f7c4 100644
--- a/vendor/github.com/google/cel-go/parser/gen/generate.sh
+++ b/vendor/github.com/google/cel-go/parser/gen/generate.sh
@@ -27,7 +27,7 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Generate AntLR artifacts.
-java -Xmx500M -cp ${DIR}/antlr-4.12.0-complete.jar org.antlr.v4.Tool \
+java -Xmx500M -cp ${DIR}/antlr-4.13.1-complete.jar org.antlr.v4.Tool \
-Dlanguage=Go \
-package gen \
-o ${DIR} \
diff --git a/vendor/github.com/google/cel-go/parser/helper.go b/vendor/github.com/google/cel-go/parser/helper.go
index a5f29e3d7ae..182ff034c22 100644
--- a/vendor/github.com/google/cel-go/parser/helper.go
+++ b/vendor/github.com/google/cel-go/parser/helper.go
@@ -17,284 +17,209 @@ package parser
import (
"sync"
- antlr "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ antlr "github.com/antlr4-go/antlr/v4"
"github.com/google/cel-go/common"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
)
type parserHelper struct {
- source common.Source
- nextID int64
- positions map[int64]int32
- macroCalls map[int64]*exprpb.Expr
+ exprFactory ast.ExprFactory
+ source common.Source
+ sourceInfo *ast.SourceInfo
+ nextID int64
}
-func newParserHelper(source common.Source) *parserHelper {
+func newParserHelper(source common.Source, fac ast.ExprFactory) *parserHelper {
return &parserHelper{
- source: source,
- nextID: 1,
- positions: make(map[int64]int32),
- macroCalls: make(map[int64]*exprpb.Expr),
+ exprFactory: fac,
+ source: source,
+ sourceInfo: ast.NewSourceInfo(source),
+ nextID: 1,
}
}
-func (p *parserHelper) getSourceInfo() *exprpb.SourceInfo {
- return &exprpb.SourceInfo{
- Location: p.source.Description(),
- Positions: p.positions,
- LineOffsets: p.source.LineOffsets(),
- MacroCalls: p.macroCalls}
+func (p *parserHelper) getSourceInfo() *ast.SourceInfo {
+ return p.sourceInfo
}
-func (p *parserHelper) newLiteral(ctx any, value *exprpb.Constant) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_ConstExpr{ConstExpr: value}
- return exprNode
+func (p *parserHelper) newLiteral(ctx any, value ref.Val) ast.Expr {
+ return p.exprFactory.NewLiteral(p.newID(ctx), value)
}
-func (p *parserHelper) newLiteralBool(ctx any, value bool) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: value}})
+func (p *parserHelper) newLiteralBool(ctx any, value bool) ast.Expr {
+ return p.newLiteral(ctx, types.Bool(value))
}
-func (p *parserHelper) newLiteralString(ctx any, value string) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: value}})
+func (p *parserHelper) newLiteralString(ctx any, value string) ast.Expr {
+ return p.newLiteral(ctx, types.String(value))
}
-func (p *parserHelper) newLiteralBytes(ctx any, value []byte) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: value}})
+func (p *parserHelper) newLiteralBytes(ctx any, value []byte) ast.Expr {
+ return p.newLiteral(ctx, types.Bytes(value))
}
-func (p *parserHelper) newLiteralInt(ctx any, value int64) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: value}})
+func (p *parserHelper) newLiteralInt(ctx any, value int64) ast.Expr {
+ return p.newLiteral(ctx, types.Int(value))
}
-func (p *parserHelper) newLiteralUint(ctx any, value uint64) *exprpb.Expr {
- return p.newLiteral(ctx, &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: value}})
+func (p *parserHelper) newLiteralUint(ctx any, value uint64) ast.Expr {
+ return p.newLiteral(ctx, types.Uint(value))
}
-func (p *parserHelper) newLiteralDouble(ctx any, value float64) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: value}})
+func (p *parserHelper) newLiteralDouble(ctx any, value float64) ast.Expr {
+ return p.newLiteral(ctx, types.Double(value))
}
-func (p *parserHelper) newIdent(ctx any, name string) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_IdentExpr{IdentExpr: &exprpb.Expr_Ident{Name: name}}
- return exprNode
+func (p *parserHelper) newIdent(ctx any, name string) ast.Expr {
+ return p.exprFactory.NewIdent(p.newID(ctx), name)
}
-func (p *parserHelper) newSelect(ctx any, operand *exprpb.Expr, field string) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_SelectExpr{
- SelectExpr: &exprpb.Expr_Select{Operand: operand, Field: field}}
- return exprNode
+func (p *parserHelper) newSelect(ctx any, operand ast.Expr, field string) ast.Expr {
+ return p.exprFactory.NewSelect(p.newID(ctx), operand, field)
}
-func (p *parserHelper) newPresenceTest(ctx any, operand *exprpb.Expr, field string) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_SelectExpr{
- SelectExpr: &exprpb.Expr_Select{Operand: operand, Field: field, TestOnly: true}}
- return exprNode
+func (p *parserHelper) newPresenceTest(ctx any, operand ast.Expr, field string) ast.Expr {
+ return p.exprFactory.NewPresenceTest(p.newID(ctx), operand, field)
}
-func (p *parserHelper) newGlobalCall(ctx any, function string, args ...*exprpb.Expr) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{Function: function, Args: args}}
- return exprNode
+func (p *parserHelper) newGlobalCall(ctx any, function string, args ...ast.Expr) ast.Expr {
+ return p.exprFactory.NewCall(p.newID(ctx), function, args...)
}
-func (p *parserHelper) newReceiverCall(ctx any, function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{Function: function, Target: target, Args: args}}
- return exprNode
+func (p *parserHelper) newReceiverCall(ctx any, function string, target ast.Expr, args ...ast.Expr) ast.Expr {
+ return p.exprFactory.NewMemberCall(p.newID(ctx), function, target, args...)
}
-func (p *parserHelper) newList(ctx any, elements []*exprpb.Expr, optionals ...int32) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: elements,
- OptionalIndices: optionals,
- }}
- return exprNode
+func (p *parserHelper) newList(ctx any, elements []ast.Expr, optionals ...int32) ast.Expr {
+ return p.exprFactory.NewList(p.newID(ctx), elements, optionals)
}
-func (p *parserHelper) newMap(ctx any, entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{Entries: entries}}
- return exprNode
+func (p *parserHelper) newMap(ctx any, entries ...ast.EntryExpr) ast.Expr {
+ return p.exprFactory.NewMap(p.newID(ctx), entries)
}
-func (p *parserHelper) newMapEntry(entryID int64, key *exprpb.Expr, value *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return &exprpb.Expr_CreateStruct_Entry{
- Id: entryID,
- KeyKind: &exprpb.Expr_CreateStruct_Entry_MapKey{MapKey: key},
- Value: value,
- OptionalEntry: optional,
- }
+func (p *parserHelper) newMapEntry(entryID int64, key ast.Expr, value ast.Expr, optional bool) ast.EntryExpr {
+ return p.exprFactory.NewMapEntry(entryID, key, value, optional)
}
-func (p *parserHelper) newObject(ctx any, typeName string, entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- MessageName: typeName,
- Entries: entries,
- },
- }
- return exprNode
+func (p *parserHelper) newObject(ctx any, typeName string, fields ...ast.EntryExpr) ast.Expr {
+ return p.exprFactory.NewStruct(p.newID(ctx), typeName, fields)
}
-func (p *parserHelper) newObjectField(fieldID int64, field string, value *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return &exprpb.Expr_CreateStruct_Entry{
- Id: fieldID,
- KeyKind: &exprpb.Expr_CreateStruct_Entry_FieldKey{FieldKey: field},
- Value: value,
- OptionalEntry: optional,
- }
+func (p *parserHelper) newObjectField(fieldID int64, field string, value ast.Expr, optional bool) ast.EntryExpr {
+ return p.exprFactory.NewStructField(fieldID, field, value, optional)
}
-func (p *parserHelper) newComprehension(ctx any, iterVar string,
- iterRange *exprpb.Expr,
+func (p *parserHelper) newComprehension(ctx any,
+ iterRange ast.Expr,
+ iterVar string,
accuVar string,
- accuInit *exprpb.Expr,
- condition *exprpb.Expr,
- step *exprpb.Expr,
- result *exprpb.Expr) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_ComprehensionExpr{
- ComprehensionExpr: &exprpb.Expr_Comprehension{
- AccuVar: accuVar,
- AccuInit: accuInit,
- IterVar: iterVar,
- IterRange: iterRange,
- LoopCondition: condition,
- LoopStep: step,
- Result: result}}
- return exprNode
-}
-
-func (p *parserHelper) newExpr(ctx any) *exprpb.Expr {
- id, isID := ctx.(int64)
- if isID {
- return &exprpb.Expr{Id: id}
+ accuInit ast.Expr,
+ condition ast.Expr,
+ step ast.Expr,
+ result ast.Expr) ast.Expr {
+ return p.exprFactory.NewComprehension(
+ p.newID(ctx), iterRange, iterVar, accuVar, accuInit, condition, step, result)
+}
+
+func (p *parserHelper) newID(ctx any) int64 {
+ if id, isID := ctx.(int64); isID {
+ return id
}
- return &exprpb.Expr{Id: p.id(ctx)}
+ return p.id(ctx)
+}
+
+func (p *parserHelper) newExpr(ctx any) ast.Expr {
+ return p.exprFactory.NewUnspecifiedExpr(p.newID(ctx))
}
func (p *parserHelper) id(ctx any) int64 {
- var location common.Location
+ var offset ast.OffsetRange
switch c := ctx.(type) {
case antlr.ParserRuleContext:
- token := c.GetStart()
- location = p.source.NewLocation(token.GetLine(), token.GetColumn())
+ start, stop := c.GetStart(), c.GetStop()
+ if stop == nil {
+ stop = start
+ }
+ offset.Start = p.sourceInfo.ComputeOffset(int32(start.GetLine()), int32(start.GetColumn()))
+ offset.Stop = p.sourceInfo.ComputeOffset(int32(stop.GetLine()), int32(stop.GetColumn()))
case antlr.Token:
- token := c
- location = p.source.NewLocation(token.GetLine(), token.GetColumn())
+ offset.Start = p.sourceInfo.ComputeOffset(int32(c.GetLine()), int32(c.GetColumn()))
+ offset.Stop = offset.Start
case common.Location:
- location = c
+ offset.Start = p.sourceInfo.ComputeOffset(int32(c.Line()), int32(c.Column()))
+ offset.Stop = offset.Start
+ case ast.OffsetRange:
+ offset = c
default:
// This should only happen if the ctx is nil
return -1
}
id := p.nextID
- p.positions[id], _ = p.source.LocationOffset(location)
+ p.sourceInfo.SetOffsetRange(id, offset)
p.nextID++
return id
}
func (p *parserHelper) getLocation(id int64) common.Location {
- characterOffset := p.positions[id]
- location, _ := p.source.OffsetLocation(characterOffset)
- return location
+ return p.sourceInfo.GetStartLocation(id)
}
// buildMacroCallArg iterates the expression and returns a new expression
// where all macros have been replaced by their IDs in MacroCalls
-func (p *parserHelper) buildMacroCallArg(expr *exprpb.Expr) *exprpb.Expr {
- if _, found := p.macroCalls[expr.GetId()]; found {
- return &exprpb.Expr{Id: expr.GetId()}
+func (p *parserHelper) buildMacroCallArg(expr ast.Expr) ast.Expr {
+ if _, found := p.sourceInfo.GetMacroCall(expr.ID()); found {
+ return p.exprFactory.NewUnspecifiedExpr(expr.ID())
}
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_CallExpr:
+ switch expr.Kind() {
+ case ast.CallKind:
// Iterate the AST from `expr` recursively looking for macros. Because we are at most
// starting from the top level macro, this recursion is bounded by the size of the AST. This
// means that the depth check on the AST during parsing will catch recursion overflows
// before we get to here.
- macroTarget := expr.GetCallExpr().GetTarget()
- if macroTarget != nil {
- macroTarget = p.buildMacroCallArg(macroTarget)
- }
- macroArgs := make([]*exprpb.Expr, len(expr.GetCallExpr().GetArgs()))
- for index, arg := range expr.GetCallExpr().GetArgs() {
+ call := expr.AsCall()
+ macroArgs := make([]ast.Expr, len(call.Args()))
+ for index, arg := range call.Args() {
macroArgs[index] = p.buildMacroCallArg(arg)
}
- return &exprpb.Expr{
- Id: expr.GetId(),
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Target: macroTarget,
- Function: expr.GetCallExpr().GetFunction(),
- Args: macroArgs,
- },
- },
+ if !call.IsMemberFunction() {
+ return p.exprFactory.NewCall(expr.ID(), call.FunctionName(), macroArgs...)
}
- case *exprpb.Expr_ListExpr:
- listExpr := expr.GetListExpr()
- macroListArgs := make([]*exprpb.Expr, len(listExpr.GetElements()))
- for i, elem := range listExpr.GetElements() {
+ macroTarget := p.buildMacroCallArg(call.Target())
+ return p.exprFactory.NewMemberCall(expr.ID(), call.FunctionName(), macroTarget, macroArgs...)
+ case ast.ListKind:
+ list := expr.AsList()
+ macroListArgs := make([]ast.Expr, list.Size())
+ for i, elem := range list.Elements() {
macroListArgs[i] = p.buildMacroCallArg(elem)
}
- return &exprpb.Expr{
- Id: expr.GetId(),
- ExprKind: &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: macroListArgs,
- OptionalIndices: listExpr.GetOptionalIndices(),
- },
- },
- }
+ return p.exprFactory.NewList(expr.ID(), macroListArgs, list.OptionalIndices())
}
-
return expr
}
// addMacroCall adds the macro the the MacroCalls map in source info. If a macro has args/subargs/target
// that are macros, their ID will be stored instead for later self-lookups.
-func (p *parserHelper) addMacroCall(exprID int64, function string, target *exprpb.Expr, args ...*exprpb.Expr) {
- macroTarget := target
- if target != nil {
- if _, found := p.macroCalls[target.GetId()]; found {
- macroTarget = &exprpb.Expr{Id: target.GetId()}
- } else {
- macroTarget = p.buildMacroCallArg(target)
- }
- }
-
- macroArgs := make([]*exprpb.Expr, len(args))
+func (p *parserHelper) addMacroCall(exprID int64, function string, target ast.Expr, args ...ast.Expr) {
+ macroArgs := make([]ast.Expr, len(args))
for index, arg := range args {
macroArgs[index] = p.buildMacroCallArg(arg)
}
-
- p.macroCalls[exprID] = &exprpb.Expr{
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Target: macroTarget,
- Function: function,
- Args: macroArgs,
- },
- },
+ if target == nil {
+ p.sourceInfo.SetMacroCall(exprID, p.exprFactory.NewCall(0, function, macroArgs...))
+ return
}
+ macroTarget := target
+ if _, found := p.sourceInfo.GetMacroCall(target.ID()); found {
+ macroTarget = p.exprFactory.NewUnspecifiedExpr(target.ID())
+ } else {
+ macroTarget = p.buildMacroCallArg(target)
+ }
+ p.sourceInfo.SetMacroCall(exprID, p.exprFactory.NewMemberCall(0, function, macroTarget, macroArgs...))
}
// logicManager compacts logical trees into a more efficient structure which is semantically
@@ -309,71 +234,71 @@ func (p *parserHelper) addMacroCall(exprID int64, function string, target *exprp
// controversial choice as it alters the traditional order of execution assumptions present in most
// expressions.
type logicManager struct {
- helper *parserHelper
+ exprFactory ast.ExprFactory
function string
- terms []*exprpb.Expr
+ terms []ast.Expr
ops []int64
variadicASTs bool
}
// newVariadicLogicManager creates a logic manager instance bound to a specific function and its first term.
-func newVariadicLogicManager(h *parserHelper, function string, term *exprpb.Expr) *logicManager {
+func newVariadicLogicManager(fac ast.ExprFactory, function string, term ast.Expr) *logicManager {
return &logicManager{
- helper: h,
+ exprFactory: fac,
function: function,
- terms: []*exprpb.Expr{term},
+ terms: []ast.Expr{term},
ops: []int64{},
variadicASTs: true,
}
}
// newBalancingLogicManager creates a logic manager instance bound to a specific function and its first term.
-func newBalancingLogicManager(h *parserHelper, function string, term *exprpb.Expr) *logicManager {
+func newBalancingLogicManager(fac ast.ExprFactory, function string, term ast.Expr) *logicManager {
return &logicManager{
- helper: h,
+ exprFactory: fac,
function: function,
- terms: []*exprpb.Expr{term},
+ terms: []ast.Expr{term},
ops: []int64{},
variadicASTs: false,
}
}
// addTerm adds an operation identifier and term to the set of terms to be balanced.
-func (l *logicManager) addTerm(op int64, term *exprpb.Expr) {
+func (l *logicManager) addTerm(op int64, term ast.Expr) {
l.terms = append(l.terms, term)
l.ops = append(l.ops, op)
}
// toExpr renders the logic graph into an Expr value, either balancing a tree of logical
// operations or creating a variadic representation of the logical operator.
-func (l *logicManager) toExpr() *exprpb.Expr {
+func (l *logicManager) toExpr() ast.Expr {
if len(l.terms) == 1 {
return l.terms[0]
}
if l.variadicASTs {
- return l.helper.newGlobalCall(l.ops[0], l.function, l.terms...)
+ return l.exprFactory.NewCall(l.ops[0], l.function, l.terms...)
}
return l.balancedTree(0, len(l.ops)-1)
}
// balancedTree recursively balances the terms provided to a commutative operator.
-func (l *logicManager) balancedTree(lo, hi int) *exprpb.Expr {
+func (l *logicManager) balancedTree(lo, hi int) ast.Expr {
mid := (lo + hi + 1) / 2
- var left *exprpb.Expr
+ var left ast.Expr
if mid == lo {
left = l.terms[mid]
} else {
left = l.balancedTree(lo, mid-1)
}
- var right *exprpb.Expr
+ var right ast.Expr
if mid == hi {
right = l.terms[mid+1]
} else {
right = l.balancedTree(mid+1, hi)
}
- return l.helper.newGlobalCall(l.ops[mid], l.function, left, right)
+ return l.exprFactory.NewCall(l.ops[mid], l.function, left, right)
}
type exprHelper struct {
@@ -387,202 +312,151 @@ func (e *exprHelper) nextMacroID() int64 {
// Copy implements the ExprHelper interface method by producing a copy of the input Expr value
// with a fresh set of numeric identifiers the Expr and all its descendants.
-func (e *exprHelper) Copy(expr *exprpb.Expr) *exprpb.Expr {
- copy := e.parserHelper.newExpr(e.parserHelper.getLocation(expr.GetId()))
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- copy.ExprKind = &exprpb.Expr_ConstExpr{ConstExpr: expr.GetConstExpr()}
- case *exprpb.Expr_IdentExpr:
- copy.ExprKind = &exprpb.Expr_IdentExpr{IdentExpr: expr.GetIdentExpr()}
- case *exprpb.Expr_SelectExpr:
- op := expr.GetSelectExpr().GetOperand()
- copy.ExprKind = &exprpb.Expr_SelectExpr{SelectExpr: &exprpb.Expr_Select{
- Operand: e.Copy(op),
- Field: expr.GetSelectExpr().GetField(),
- TestOnly: expr.GetSelectExpr().GetTestOnly(),
- }}
- case *exprpb.Expr_CallExpr:
- call := expr.GetCallExpr()
- target := call.GetTarget()
- if target != nil {
- target = e.Copy(target)
+func (e *exprHelper) Copy(expr ast.Expr) ast.Expr {
+ offsetRange, _ := e.parserHelper.sourceInfo.GetOffsetRange(expr.ID())
+ copyID := e.parserHelper.newID(offsetRange)
+ switch expr.Kind() {
+ case ast.LiteralKind:
+ return e.exprFactory.NewLiteral(copyID, expr.AsLiteral())
+ case ast.IdentKind:
+ return e.exprFactory.NewIdent(copyID, expr.AsIdent())
+ case ast.SelectKind:
+ sel := expr.AsSelect()
+ op := e.Copy(sel.Operand())
+ if sel.IsTestOnly() {
+ return e.exprFactory.NewPresenceTest(copyID, op, sel.FieldName())
}
- args := call.GetArgs()
- argsCopy := make([]*exprpb.Expr, len(args))
+ return e.exprFactory.NewSelect(copyID, op, sel.FieldName())
+ case ast.CallKind:
+ call := expr.AsCall()
+ args := call.Args()
+ argsCopy := make([]ast.Expr, len(args))
for i, arg := range args {
argsCopy[i] = e.Copy(arg)
}
- copy.ExprKind = &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Function: call.GetFunction(),
- Target: target,
- Args: argsCopy,
- },
+ if !call.IsMemberFunction() {
+ return e.exprFactory.NewCall(copyID, call.FunctionName(), argsCopy...)
}
- case *exprpb.Expr_ListExpr:
- elems := expr.GetListExpr().GetElements()
- elemsCopy := make([]*exprpb.Expr, len(elems))
+ return e.exprFactory.NewMemberCall(copyID, call.FunctionName(), e.Copy(call.Target()), argsCopy...)
+ case ast.ListKind:
+ list := expr.AsList()
+ elems := list.Elements()
+ elemsCopy := make([]ast.Expr, len(elems))
for i, elem := range elems {
elemsCopy[i] = e.Copy(elem)
}
- copy.ExprKind = &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{Elements: elemsCopy},
- }
- case *exprpb.Expr_StructExpr:
- entries := expr.GetStructExpr().GetEntries()
- entriesCopy := make([]*exprpb.Expr_CreateStruct_Entry, len(entries))
- for i, entry := range entries {
- entryCopy := &exprpb.Expr_CreateStruct_Entry{}
- entryCopy.Id = e.nextMacroID()
- switch entry.GetKeyKind().(type) {
- case *exprpb.Expr_CreateStruct_Entry_FieldKey:
- entryCopy.KeyKind = &exprpb.Expr_CreateStruct_Entry_FieldKey{
- FieldKey: entry.GetFieldKey(),
- }
- case *exprpb.Expr_CreateStruct_Entry_MapKey:
- entryCopy.KeyKind = &exprpb.Expr_CreateStruct_Entry_MapKey{
- MapKey: e.Copy(entry.GetMapKey()),
- }
- }
- entryCopy.Value = e.Copy(entry.GetValue())
- entriesCopy[i] = entryCopy
+ return e.exprFactory.NewList(copyID, elemsCopy, list.OptionalIndices())
+ case ast.MapKind:
+ m := expr.AsMap()
+ entries := m.Entries()
+ entriesCopy := make([]ast.EntryExpr, len(entries))
+ for i, en := range entries {
+ entry := en.AsMapEntry()
+ entryID := e.nextMacroID()
+ entriesCopy[i] = e.exprFactory.NewMapEntry(entryID,
+ e.Copy(entry.Key()), e.Copy(entry.Value()), entry.IsOptional())
}
- copy.ExprKind = &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- MessageName: expr.GetStructExpr().GetMessageName(),
- Entries: entriesCopy,
- },
- }
- case *exprpb.Expr_ComprehensionExpr:
- iterRange := e.Copy(expr.GetComprehensionExpr().GetIterRange())
- accuInit := e.Copy(expr.GetComprehensionExpr().GetAccuInit())
- cond := e.Copy(expr.GetComprehensionExpr().GetLoopCondition())
- step := e.Copy(expr.GetComprehensionExpr().GetLoopStep())
- result := e.Copy(expr.GetComprehensionExpr().GetResult())
- copy.ExprKind = &exprpb.Expr_ComprehensionExpr{
- ComprehensionExpr: &exprpb.Expr_Comprehension{
- IterRange: iterRange,
- IterVar: expr.GetComprehensionExpr().GetIterVar(),
- AccuInit: accuInit,
- AccuVar: expr.GetComprehensionExpr().GetAccuVar(),
- LoopCondition: cond,
- LoopStep: step,
- Result: result,
- },
+ return e.exprFactory.NewMap(copyID, entriesCopy)
+ case ast.StructKind:
+ s := expr.AsStruct()
+ fields := s.Fields()
+ fieldsCopy := make([]ast.EntryExpr, len(fields))
+ for i, f := range fields {
+ field := f.AsStructField()
+ fieldID := e.nextMacroID()
+ fieldsCopy[i] = e.exprFactory.NewStructField(fieldID,
+ field.Name(), e.Copy(field.Value()), field.IsOptional())
}
+ return e.exprFactory.NewStruct(copyID, s.TypeName(), fieldsCopy)
+ case ast.ComprehensionKind:
+ compre := expr.AsComprehension()
+ iterRange := e.Copy(compre.IterRange())
+ accuInit := e.Copy(compre.AccuInit())
+ cond := e.Copy(compre.LoopCondition())
+ step := e.Copy(compre.LoopStep())
+ result := e.Copy(compre.Result())
+ return e.exprFactory.NewComprehension(copyID,
+ iterRange, compre.IterVar(), compre.AccuVar(), accuInit, cond, step, result)
}
- return copy
-}
-
-// LiteralBool implements the ExprHelper interface method.
-func (e *exprHelper) LiteralBool(value bool) *exprpb.Expr {
- return e.parserHelper.newLiteralBool(e.nextMacroID(), value)
-}
-
-// LiteralBytes implements the ExprHelper interface method.
-func (e *exprHelper) LiteralBytes(value []byte) *exprpb.Expr {
- return e.parserHelper.newLiteralBytes(e.nextMacroID(), value)
-}
-
-// LiteralDouble implements the ExprHelper interface method.
-func (e *exprHelper) LiteralDouble(value float64) *exprpb.Expr {
- return e.parserHelper.newLiteralDouble(e.nextMacroID(), value)
-}
-
-// LiteralInt implements the ExprHelper interface method.
-func (e *exprHelper) LiteralInt(value int64) *exprpb.Expr {
- return e.parserHelper.newLiteralInt(e.nextMacroID(), value)
+ return e.exprFactory.NewUnspecifiedExpr(copyID)
}
-// LiteralString implements the ExprHelper interface method.
-func (e *exprHelper) LiteralString(value string) *exprpb.Expr {
- return e.parserHelper.newLiteralString(e.nextMacroID(), value)
-}
-
-// LiteralUint implements the ExprHelper interface method.
-func (e *exprHelper) LiteralUint(value uint64) *exprpb.Expr {
- return e.parserHelper.newLiteralUint(e.nextMacroID(), value)
+// NewLiteral implements the ExprHelper interface method.
+func (e *exprHelper) NewLiteral(value ref.Val) ast.Expr {
+ return e.exprFactory.NewLiteral(e.nextMacroID(), value)
}
// NewList implements the ExprHelper interface method.
-func (e *exprHelper) NewList(elems ...*exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newList(e.nextMacroID(), elems)
+func (e *exprHelper) NewList(elems ...ast.Expr) ast.Expr {
+ return e.exprFactory.NewList(e.nextMacroID(), elems, []int32{})
}
// NewMap implements the ExprHelper interface method.
-func (e *exprHelper) NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- return e.parserHelper.newMap(e.nextMacroID(), entries...)
+func (e *exprHelper) NewMap(entries ...ast.EntryExpr) ast.Expr {
+ return e.exprFactory.NewMap(e.nextMacroID(), entries)
}
// NewMapEntry implements the ExprHelper interface method.
-func (e *exprHelper) NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return e.parserHelper.newMapEntry(e.nextMacroID(), key, val, optional)
+func (e *exprHelper) NewMapEntry(key ast.Expr, val ast.Expr, optional bool) ast.EntryExpr {
+ return e.exprFactory.NewMapEntry(e.nextMacroID(), key, val, optional)
}
-// NewObject implements the ExprHelper interface method.
-func (e *exprHelper) NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- return e.parserHelper.newObject(e.nextMacroID(), typeName, fieldInits...)
+// NewStruct implements the ExprHelper interface method.
+func (e *exprHelper) NewStruct(typeName string, fieldInits ...ast.EntryExpr) ast.Expr {
+ return e.exprFactory.NewStruct(e.nextMacroID(), typeName, fieldInits)
}
-// NewObjectFieldInit implements the ExprHelper interface method.
-func (e *exprHelper) NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return e.parserHelper.newObjectField(e.nextMacroID(), field, init, optional)
+// NewStructField implements the ExprHelper interface method.
+func (e *exprHelper) NewStructField(field string, init ast.Expr, optional bool) ast.EntryExpr {
+ return e.exprFactory.NewStructField(e.nextMacroID(), field, init, optional)
}
-// Fold implements the ExprHelper interface method.
-func (e *exprHelper) Fold(iterVar string,
- iterRange *exprpb.Expr,
+// NewComprehension implements the ExprHelper interface method.
+func (e *exprHelper) NewComprehension(
+ iterRange ast.Expr,
+ iterVar string,
accuVar string,
- accuInit *exprpb.Expr,
- condition *exprpb.Expr,
- step *exprpb.Expr,
- result *exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newComprehension(
- e.nextMacroID(), iterVar, iterRange, accuVar, accuInit, condition, step, result)
+ accuInit ast.Expr,
+ condition ast.Expr,
+ step ast.Expr,
+ result ast.Expr) ast.Expr {
+ return e.exprFactory.NewComprehension(
+ e.nextMacroID(), iterRange, iterVar, accuVar, accuInit, condition, step, result)
}
-// Ident implements the ExprHelper interface method.
-func (e *exprHelper) Ident(name string) *exprpb.Expr {
- return e.parserHelper.newIdent(e.nextMacroID(), name)
+// NewIdent implements the ExprHelper interface method.
+func (e *exprHelper) NewIdent(name string) ast.Expr {
+ return e.exprFactory.NewIdent(e.nextMacroID(), name)
}
-// AccuIdent implements the ExprHelper interface method.
-func (e *exprHelper) AccuIdent() *exprpb.Expr {
- return e.parserHelper.newIdent(e.nextMacroID(), AccumulatorName)
+// NewAccuIdent implements the ExprHelper interface method.
+func (e *exprHelper) NewAccuIdent() ast.Expr {
+ return e.exprFactory.NewAccuIdent(e.nextMacroID())
}
-// GlobalCall implements the ExprHelper interface method.
-func (e *exprHelper) GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newGlobalCall(e.nextMacroID(), function, args...)
+// NewGlobalCall implements the ExprHelper interface method.
+func (e *exprHelper) NewCall(function string, args ...ast.Expr) ast.Expr {
+ return e.exprFactory.NewCall(e.nextMacroID(), function, args...)
}
-// ReceiverCall implements the ExprHelper interface method.
-func (e *exprHelper) ReceiverCall(function string,
- target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newReceiverCall(e.nextMacroID(), function, target, args...)
+// NewMemberCall implements the ExprHelper interface method.
+func (e *exprHelper) NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr {
+ return e.exprFactory.NewMemberCall(e.nextMacroID(), function, target, args...)
}
-// PresenceTest implements the ExprHelper interface method.
-func (e *exprHelper) PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr {
- return e.parserHelper.newPresenceTest(e.nextMacroID(), operand, field)
+// NewPresenceTest implements the ExprHelper interface method.
+func (e *exprHelper) NewPresenceTest(operand ast.Expr, field string) ast.Expr {
+ return e.exprFactory.NewPresenceTest(e.nextMacroID(), operand, field)
}
-// Select implements the ExprHelper interface method.
-func (e *exprHelper) Select(operand *exprpb.Expr, field string) *exprpb.Expr {
- return e.parserHelper.newSelect(e.nextMacroID(), operand, field)
+// NewSelect implements the ExprHelper interface method.
+func (e *exprHelper) NewSelect(operand ast.Expr, field string) ast.Expr {
+ return e.exprFactory.NewSelect(e.nextMacroID(), operand, field)
}
// OffsetLocation implements the ExprHelper interface method.
func (e *exprHelper) OffsetLocation(exprID int64) common.Location {
- offset, found := e.parserHelper.positions[exprID]
- if !found {
- return common.NoLocation
- }
- location, found := e.parserHelper.source.OffsetLocation(offset)
- if !found {
- return common.NoLocation
- }
- return location
+ return e.parserHelper.sourceInfo.GetStartLocation(exprID)
}
// NewError associates an error message with a given expression id, populating the source offset location of the error if possible.
diff --git a/vendor/github.com/google/cel-go/parser/input.go b/vendor/github.com/google/cel-go/parser/input.go
index 810eaff218d..44792455d8b 100644
--- a/vendor/github.com/google/cel-go/parser/input.go
+++ b/vendor/github.com/google/cel-go/parser/input.go
@@ -15,7 +15,7 @@
package parser
import (
- antlr "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ antlr "github.com/antlr4-go/antlr/v4"
"github.com/google/cel-go/common/runes"
)
@@ -110,7 +110,7 @@ func (c *charStream) GetTextFromTokens(start, stop antlr.Token) string {
}
// GetTextFromInterval implements (antlr.CharStream).GetTextFromInterval.
-func (c *charStream) GetTextFromInterval(i *antlr.Interval) string {
+func (c *charStream) GetTextFromInterval(i antlr.Interval) string {
return c.GetText(i.Start, i.Stop)
}
diff --git a/vendor/github.com/google/cel-go/parser/macro.go b/vendor/github.com/google/cel-go/parser/macro.go
index 6066e8ef4f8..1f4c847e0d4 100644
--- a/vendor/github.com/google/cel-go/parser/macro.go
+++ b/vendor/github.com/google/cel-go/parser/macro.go
@@ -18,9 +18,10 @@ import (
"fmt"
"github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
)
// NewGlobalMacro creates a Macro for a global function with the specified arg count.
@@ -142,58 +143,38 @@ func makeVarArgMacroKey(name string, receiverStyle bool) string {
// and produces as output an Expr ast node.
//
// Note: when the Macro.IsReceiverStyle() method returns true, the target argument will be nil.
-type MacroExpander func(eh ExprHelper,
- target *exprpb.Expr,
- args []*exprpb.Expr) (*exprpb.Expr, *common.Error)
+type MacroExpander func(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error)
-// ExprHelper assists with the manipulation of proto-based Expr values in a manner which is
-// consistent with the source position and expression id generation code leveraged by both
-// the parser and type-checker.
+// ExprHelper assists with the creation of Expr values in a manner which is consistent
+// the internal semantics and id generation behaviors of the parser and checker libraries.
type ExprHelper interface {
// Copy the input expression with a brand new set of identifiers.
- Copy(*exprpb.Expr) *exprpb.Expr
-
- // LiteralBool creates an Expr value for a bool literal.
- LiteralBool(value bool) *exprpb.Expr
-
- // LiteralBytes creates an Expr value for a byte literal.
- LiteralBytes(value []byte) *exprpb.Expr
-
- // LiteralDouble creates an Expr value for double literal.
- LiteralDouble(value float64) *exprpb.Expr
+ Copy(ast.Expr) ast.Expr
- // LiteralInt creates an Expr value for an int literal.
- LiteralInt(value int64) *exprpb.Expr
+ // Literal creates an Expr value for a scalar literal value.
+ NewLiteral(value ref.Val) ast.Expr
- // LiteralString creates am Expr value for a string literal.
- LiteralString(value string) *exprpb.Expr
-
- // LiteralUint creates an Expr value for a uint literal.
- LiteralUint(value uint64) *exprpb.Expr
-
- // NewList creates a CreateList instruction where the list is comprised of the optional set
- // of elements provided as arguments.
- NewList(elems ...*exprpb.Expr) *exprpb.Expr
+ // NewList creates a list literal instruction with an optional set of elements.
+ NewList(elems ...ast.Expr) ast.Expr
// NewMap creates a CreateStruct instruction for a map where the map is comprised of the
// optional set of key, value entries.
- NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+ NewMap(entries ...ast.EntryExpr) ast.Expr
// NewMapEntry creates a Map Entry for the key, value pair.
- NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+ NewMapEntry(key ast.Expr, val ast.Expr, optional bool) ast.EntryExpr
- // NewObject creates a CreateStruct instruction for an object with a given type name and
- // optional set of field initializers.
- NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+ // NewStruct creates a struct literal expression with an optional set of field initializers.
+ NewStruct(typeName string, fieldInits ...ast.EntryExpr) ast.Expr
- // NewObjectFieldInit creates a new Object field initializer from the field name and value.
- NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+ // NewStructField creates a new struct field initializer from the field name and value.
+ NewStructField(field string, init ast.Expr, optional bool) ast.EntryExpr
- // Fold creates a fold comprehension instruction.
+ // NewComprehension creates a new comprehension instruction.
//
- // - iterVar is the iteration variable name.
// - iterRange represents the expression that resolves to a list or map where the elements or
// keys (respectively) will be iterated over.
+ // - iterVar is the iteration variable name.
// - accuVar is the accumulation variable name, typically parser.AccumulatorName.
// - accuInit is the initial expression whose value will be set for the accuVar prior to
// folding.
@@ -204,31 +185,31 @@ type ExprHelper interface {
// The accuVar should not shadow variable names that you would like to reference within the
// environment in the step and condition expressions. Presently, the name __result__ is commonly
// used by built-in macros but this may change in the future.
- Fold(iterVar string,
- iterRange *exprpb.Expr,
+ NewComprehension(iterRange ast.Expr,
+ iterVar string,
accuVar string,
- accuInit *exprpb.Expr,
- condition *exprpb.Expr,
- step *exprpb.Expr,
- result *exprpb.Expr) *exprpb.Expr
+ accuInit ast.Expr,
+ condition ast.Expr,
+ step ast.Expr,
+ result ast.Expr) ast.Expr
- // Ident creates an identifier Expr value.
- Ident(name string) *exprpb.Expr
+ // NewIdent creates an identifier Expr value.
+ NewIdent(name string) ast.Expr
- // AccuIdent returns an accumulator identifier for use with comprehension results.
- AccuIdent() *exprpb.Expr
+ // NewAccuIdent returns an accumulator identifier for use with comprehension results.
+ NewAccuIdent() ast.Expr
- // GlobalCall creates a function call Expr value for a global (free) function.
- GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr
+ // NewCall creates a function call Expr value for a global (free) function.
+ NewCall(function string, args ...ast.Expr) ast.Expr
- // ReceiverCall creates a function call Expr value for a receiver-style function.
- ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr
+ // NewMemberCall creates a function call Expr value for a receiver-style function.
+ NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr
- // PresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
- PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr
+ // NewPresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
+ NewPresenceTest(operand ast.Expr, field string) ast.Expr
- // Select create a field traversal Expr value.
- Select(operand *exprpb.Expr, field string) *exprpb.Expr
+ // NewSelect create a field traversal Expr value.
+ NewSelect(operand ast.Expr, field string) ast.Expr
// OffsetLocation returns the Location of the expression identifier.
OffsetLocation(exprID int64) common.Location
@@ -296,21 +277,21 @@ const (
// MakeAll expands the input call arguments into a comprehension that returns true if all of the
// elements in the range match the predicate expressions:
// .all(, )
-func MakeAll(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeAll(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
return makeQuantifier(quantifierAll, eh, target, args)
}
// MakeExists expands the input call arguments into a comprehension that returns true if any of the
// elements in the range match the predicate expressions:
// .exists(, )
-func MakeExists(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeExists(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
return makeQuantifier(quantifierExists, eh, target, args)
}
// MakeExistsOne expands the input call arguments into a comprehension that returns true if exactly
// one of the elements in the range match the predicate expressions:
// .exists_one(, )
-func MakeExistsOne(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeExistsOne(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
return makeQuantifier(quantifierExistsOne, eh, target, args)
}
@@ -324,14 +305,14 @@ func MakeExistsOne(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*ex
//
// In the second form only iterVar values which return true when provided to the predicate expression
// are transformed.
-func MakeMap(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeMap(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
v, found := extractIdent(args[0])
if !found {
- return nil, eh.NewError(args[0].GetId(), "argument is not an identifier")
+ return nil, eh.NewError(args[0].ID(), "argument is not an identifier")
}
- var fn *exprpb.Expr
- var filter *exprpb.Expr
+ var fn ast.Expr
+ var filter ast.Expr
if len(args) == 3 {
filter = args[1]
@@ -341,84 +322,83 @@ func MakeMap(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.E
fn = args[1]
}
- accuExpr := eh.Ident(AccumulatorName)
init := eh.NewList()
- condition := eh.LiteralBool(true)
- step := eh.GlobalCall(operators.Add, accuExpr, eh.NewList(fn))
+ condition := eh.NewLiteral(types.True)
+ step := eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewList(fn))
if filter != nil {
- step = eh.GlobalCall(operators.Conditional, filter, step, accuExpr)
+ step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent())
}
- return eh.Fold(v, target, AccumulatorName, init, condition, step, accuExpr), nil
+ return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, eh.NewAccuIdent()), nil
}
// MakeFilter expands the input call arguments into a comprehension which produces a list which contains
// only elements which match the provided predicate expression:
// .filter(, )
-func MakeFilter(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeFilter(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
v, found := extractIdent(args[0])
if !found {
- return nil, eh.NewError(args[0].GetId(), "argument is not an identifier")
+ return nil, eh.NewError(args[0].ID(), "argument is not an identifier")
}
filter := args[1]
- accuExpr := eh.Ident(AccumulatorName)
init := eh.NewList()
- condition := eh.LiteralBool(true)
- step := eh.GlobalCall(operators.Add, accuExpr, eh.NewList(args[0]))
- step = eh.GlobalCall(operators.Conditional, filter, step, accuExpr)
- return eh.Fold(v, target, AccumulatorName, init, condition, step, accuExpr), nil
+ condition := eh.NewLiteral(types.True)
+ step := eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewList(args[0]))
+ step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent())
+ return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, eh.NewAccuIdent()), nil
}
// MakeHas expands the input call arguments into a presence test, e.g. has(.field)
-func MakeHas(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
- if s, ok := args[0].ExprKind.(*exprpb.Expr_SelectExpr); ok {
- return eh.PresenceTest(s.SelectExpr.GetOperand(), s.SelectExpr.GetField()), nil
+func MakeHas(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
+ if args[0].Kind() == ast.SelectKind {
+ s := args[0].AsSelect()
+ return eh.NewPresenceTest(s.Operand(), s.FieldName()), nil
}
- return nil, eh.NewError(args[0].GetId(), "invalid argument to has() macro")
+ return nil, eh.NewError(args[0].ID(), "invalid argument to has() macro")
}
-func makeQuantifier(kind quantifierKind, eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func makeQuantifier(kind quantifierKind, eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
v, found := extractIdent(args[0])
if !found {
- return nil, eh.NewError(args[0].GetId(), "argument must be a simple name")
+ return nil, eh.NewError(args[0].ID(), "argument must be a simple name")
}
- var init *exprpb.Expr
- var condition *exprpb.Expr
- var step *exprpb.Expr
- var result *exprpb.Expr
+ var init ast.Expr
+ var condition ast.Expr
+ var step ast.Expr
+ var result ast.Expr
switch kind {
case quantifierAll:
- init = eh.LiteralBool(true)
- condition = eh.GlobalCall(operators.NotStrictlyFalse, eh.AccuIdent())
- step = eh.GlobalCall(operators.LogicalAnd, eh.AccuIdent(), args[1])
- result = eh.AccuIdent()
+ init = eh.NewLiteral(types.True)
+ condition = eh.NewCall(operators.NotStrictlyFalse, eh.NewAccuIdent())
+ step = eh.NewCall(operators.LogicalAnd, eh.NewAccuIdent(), args[1])
+ result = eh.NewAccuIdent()
case quantifierExists:
- init = eh.LiteralBool(false)
- condition = eh.GlobalCall(
+ init = eh.NewLiteral(types.False)
+ condition = eh.NewCall(
operators.NotStrictlyFalse,
- eh.GlobalCall(operators.LogicalNot, eh.AccuIdent()))
- step = eh.GlobalCall(operators.LogicalOr, eh.AccuIdent(), args[1])
- result = eh.AccuIdent()
+ eh.NewCall(operators.LogicalNot, eh.NewAccuIdent()))
+ step = eh.NewCall(operators.LogicalOr, eh.NewAccuIdent(), args[1])
+ result = eh.NewAccuIdent()
case quantifierExistsOne:
- zeroExpr := eh.LiteralInt(0)
- oneExpr := eh.LiteralInt(1)
+ zeroExpr := eh.NewLiteral(types.Int(0))
+ oneExpr := eh.NewLiteral(types.Int(1))
init = zeroExpr
- condition = eh.LiteralBool(true)
- step = eh.GlobalCall(operators.Conditional, args[1],
- eh.GlobalCall(operators.Add, eh.AccuIdent(), oneExpr), eh.AccuIdent())
- result = eh.GlobalCall(operators.Equals, eh.AccuIdent(), oneExpr)
+ condition = eh.NewLiteral(types.True)
+ step = eh.NewCall(operators.Conditional, args[1],
+ eh.NewCall(operators.Add, eh.NewAccuIdent(), oneExpr), eh.NewAccuIdent())
+ result = eh.NewCall(operators.Equals, eh.NewAccuIdent(), oneExpr)
default:
- return nil, eh.NewError(args[0].GetId(), fmt.Sprintf("unrecognized quantifier '%v'", kind))
+ return nil, eh.NewError(args[0].ID(), fmt.Sprintf("unrecognized quantifier '%v'", kind))
}
- return eh.Fold(v, target, AccumulatorName, init, condition, step, result), nil
+ return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, result), nil
}
-func extractIdent(e *exprpb.Expr) (string, bool) {
- switch e.ExprKind.(type) {
- case *exprpb.Expr_IdentExpr:
- return e.GetIdentExpr().GetName(), true
+func extractIdent(e ast.Expr) (string, bool) {
+ switch e.Kind() {
+ case ast.IdentKind:
+ return e.AsIdent(), true
}
return "", false
}
diff --git a/vendor/github.com/google/cel-go/parser/parser.go b/vendor/github.com/google/cel-go/parser/parser.go
index 109326a9399..cb753df73d2 100644
--- a/vendor/github.com/google/cel-go/parser/parser.go
+++ b/vendor/github.com/google/cel-go/parser/parser.go
@@ -21,17 +21,15 @@ import (
"regexp"
"strconv"
"strings"
- "sync"
- antlr "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ antlr "github.com/antlr4-go/antlr/v4"
"github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/runes"
+ "github.com/google/cel-go/common/types"
"github.com/google/cel-go/parser/gen"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
- structpb "google.golang.org/protobuf/types/known/structpb"
)
// Parser encapsulates the context necessary to perform parsing for different expressions.
@@ -88,11 +86,13 @@ func mustNewParser(opts ...Option) *Parser {
}
// Parse parses the expression represented by source and returns the result.
-func (p *Parser) Parse(source common.Source) (*exprpb.ParsedExpr, *common.Errors) {
+func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) {
errs := common.NewErrors(source)
+ fac := ast.NewExprFactory()
impl := parser{
errors: &parseErrors{errs},
- helper: newParserHelper(source),
+ exprFactory: fac,
+ helper: newParserHelper(source, fac),
macros: p.macros,
maxRecursionDepth: p.maxRecursionDepth,
errorReportingLimit: p.errorReportingLimit,
@@ -106,18 +106,15 @@ func (p *Parser) Parse(source common.Source) (*exprpb.ParsedExpr, *common.Errors
if !ok {
buf = runes.NewBuffer(source.Content())
}
- var e *exprpb.Expr
+ var out ast.Expr
if buf.Len() > p.expressionSizeCodePointLimit {
- e = impl.reportError(common.NoLocation,
+ out = impl.reportError(common.NoLocation,
"expression code point size exceeds limit: size: %d, limit %d",
buf.Len(), p.expressionSizeCodePointLimit)
} else {
- e = impl.parse(buf, source.Description())
+ out = impl.parse(buf, source.Description())
}
- return &exprpb.ParsedExpr{
- Expr: e,
- SourceInfo: impl.helper.getSourceInfo(),
- }, errs
+ return ast.NewAST(out, impl.helper.getSourceInfo()), errs
}
// reservedIds are not legal to use as variables. We exclude them post-parse, as they *are* valid
@@ -150,7 +147,7 @@ var reservedIds = map[string]struct{}{
// This function calls ParseWithMacros with AllMacros.
//
// Deprecated: Use NewParser().Parse() instead.
-func Parse(source common.Source) (*exprpb.ParsedExpr, *common.Errors) {
+func Parse(source common.Source) (*ast.AST, *common.Errors) {
return mustNewParser(Macros(AllMacros...)).Parse(source)
}
@@ -287,6 +284,7 @@ var _ antlr.ErrorStrategy = &recoveryLimitErrorStrategy{}
type parser struct {
gen.BaseCELVisitor
errors *parseErrors
+ exprFactory ast.ExprFactory
helper *parserHelper
macros map[string]Macro
recursionDepth int
@@ -300,53 +298,21 @@ type parser struct {
enableVariadicOperatorASTs bool
}
-var (
- _ gen.CELVisitor = (*parser)(nil)
-
- lexerPool *sync.Pool = &sync.Pool{
- New: func() any {
- l := gen.NewCELLexer(nil)
- l.RemoveErrorListeners()
- return l
- },
- }
+var _ gen.CELVisitor = (*parser)(nil)
- parserPool *sync.Pool = &sync.Pool{
- New: func() any {
- p := gen.NewCELParser(nil)
- p.RemoveErrorListeners()
- return p
- },
- }
-)
+func (p *parser) parse(expr runes.Buffer, desc string) ast.Expr {
+ lexer := gen.NewCELLexer(newCharStream(expr, desc))
+ lexer.RemoveErrorListeners()
+ lexer.AddErrorListener(p)
-func (p *parser) parse(expr runes.Buffer, desc string) *exprpb.Expr {
- // TODO: get rid of these pools once https://github.com/antlr/antlr4/pull/3571 is in a release
- lexer := lexerPool.Get().(*gen.CELLexer)
- prsr := parserPool.Get().(*gen.CELParser)
+ prsr := gen.NewCELParser(antlr.NewCommonTokenStream(lexer, 0))
+ prsr.RemoveErrorListeners()
prsrListener := &recursionListener{
maxDepth: p.maxRecursionDepth,
ruleTypeDepth: map[int]*int{},
}
- defer func() {
- // Unfortunately ANTLR Go runtime is missing (*antlr.BaseParser).RemoveParseListeners,
- // so this is good enough until that is exported.
- // Reset the lexer and parser before putting them back in the pool.
- lexer.RemoveErrorListeners()
- prsr.RemoveParseListener(prsrListener)
- prsr.RemoveErrorListeners()
- lexer.SetInputStream(nil)
- prsr.SetInputStream(nil)
- lexerPool.Put(lexer)
- parserPool.Put(prsr)
- }()
-
- lexer.SetInputStream(newCharStream(expr, desc))
- prsr.SetInputStream(antlr.NewCommonTokenStream(lexer, 0))
-
- lexer.AddErrorListener(p)
prsr.AddErrorListener(p)
prsr.AddParseListener(prsrListener)
@@ -373,7 +339,7 @@ func (p *parser) parse(expr runes.Buffer, desc string) *exprpb.Expr {
}
}()
- return p.Visit(prsr.Start()).(*exprpb.Expr)
+ return p.Visit(prsr.Start_()).(ast.Expr)
}
// Visitor implementations.
@@ -470,26 +436,26 @@ func (p *parser) VisitStart(ctx *gen.StartContext) any {
// Visit a parse tree produced by CELParser#expr.
func (p *parser) VisitExpr(ctx *gen.ExprContext) any {
- result := p.Visit(ctx.GetE()).(*exprpb.Expr)
+ result := p.Visit(ctx.GetE()).(ast.Expr)
if ctx.GetOp() == nil {
return result
}
opID := p.helper.id(ctx.GetOp())
- ifTrue := p.Visit(ctx.GetE1()).(*exprpb.Expr)
- ifFalse := p.Visit(ctx.GetE2()).(*exprpb.Expr)
+ ifTrue := p.Visit(ctx.GetE1()).(ast.Expr)
+ ifFalse := p.Visit(ctx.GetE2()).(ast.Expr)
return p.globalCallOrMacro(opID, operators.Conditional, result, ifTrue, ifFalse)
}
// Visit a parse tree produced by CELParser#conditionalOr.
func (p *parser) VisitConditionalOr(ctx *gen.ConditionalOrContext) any {
- result := p.Visit(ctx.GetE()).(*exprpb.Expr)
+ result := p.Visit(ctx.GetE()).(ast.Expr)
l := p.newLogicManager(operators.LogicalOr, result)
rest := ctx.GetE1()
for i, op := range ctx.GetOps() {
if i >= len(rest) {
return p.reportError(ctx, "unexpected character, wanted '||'")
}
- next := p.Visit(rest[i]).(*exprpb.Expr)
+ next := p.Visit(rest[i]).(ast.Expr)
opID := p.helper.id(op)
l.addTerm(opID, next)
}
@@ -498,14 +464,14 @@ func (p *parser) VisitConditionalOr(ctx *gen.ConditionalOrContext) any {
// Visit a parse tree produced by CELParser#conditionalAnd.
func (p *parser) VisitConditionalAnd(ctx *gen.ConditionalAndContext) any {
- result := p.Visit(ctx.GetE()).(*exprpb.Expr)
+ result := p.Visit(ctx.GetE()).(ast.Expr)
l := p.newLogicManager(operators.LogicalAnd, result)
rest := ctx.GetE1()
for i, op := range ctx.GetOps() {
if i >= len(rest) {
return p.reportError(ctx, "unexpected character, wanted '&&'")
}
- next := p.Visit(rest[i]).(*exprpb.Expr)
+ next := p.Visit(rest[i]).(ast.Expr)
opID := p.helper.id(op)
l.addTerm(opID, next)
}
@@ -519,9 +485,9 @@ func (p *parser) VisitRelation(ctx *gen.RelationContext) any {
opText = ctx.GetOp().GetText()
}
if op, found := operators.Find(opText); found {
- lhs := p.Visit(ctx.Relation(0)).(*exprpb.Expr)
+ lhs := p.Visit(ctx.Relation(0)).(ast.Expr)
opID := p.helper.id(ctx.GetOp())
- rhs := p.Visit(ctx.Relation(1)).(*exprpb.Expr)
+ rhs := p.Visit(ctx.Relation(1)).(ast.Expr)
return p.globalCallOrMacro(opID, op, lhs, rhs)
}
return p.reportError(ctx, "operator not found")
@@ -534,9 +500,9 @@ func (p *parser) VisitCalc(ctx *gen.CalcContext) any {
opText = ctx.GetOp().GetText()
}
if op, found := operators.Find(opText); found {
- lhs := p.Visit(ctx.Calc(0)).(*exprpb.Expr)
+ lhs := p.Visit(ctx.Calc(0)).(ast.Expr)
opID := p.helper.id(ctx.GetOp())
- rhs := p.Visit(ctx.Calc(1)).(*exprpb.Expr)
+ rhs := p.Visit(ctx.Calc(1)).(ast.Expr)
return p.globalCallOrMacro(opID, op, lhs, rhs)
}
return p.reportError(ctx, "operator not found")
@@ -552,7 +518,7 @@ func (p *parser) VisitLogicalNot(ctx *gen.LogicalNotContext) any {
return p.Visit(ctx.Member())
}
opID := p.helper.id(ctx.GetOps()[0])
- target := p.Visit(ctx.Member()).(*exprpb.Expr)
+ target := p.Visit(ctx.Member()).(ast.Expr)
return p.globalCallOrMacro(opID, operators.LogicalNot, target)
}
@@ -561,13 +527,13 @@ func (p *parser) VisitNegate(ctx *gen.NegateContext) any {
return p.Visit(ctx.Member())
}
opID := p.helper.id(ctx.GetOps()[0])
- target := p.Visit(ctx.Member()).(*exprpb.Expr)
+ target := p.Visit(ctx.Member()).(ast.Expr)
return p.globalCallOrMacro(opID, operators.Negate, target)
}
// VisitSelect visits a parse tree produced by CELParser#Select.
func (p *parser) VisitSelect(ctx *gen.SelectContext) any {
- operand := p.Visit(ctx.Member()).(*exprpb.Expr)
+ operand := p.Visit(ctx.Member()).(ast.Expr)
// Handle the error case where no valid identifier is specified.
if ctx.GetId() == nil || ctx.GetOp() == nil {
return p.helper.newExpr(ctx)
@@ -588,7 +554,7 @@ func (p *parser) VisitSelect(ctx *gen.SelectContext) any {
// VisitMemberCall visits a parse tree produced by CELParser#MemberCall.
func (p *parser) VisitMemberCall(ctx *gen.MemberCallContext) any {
- operand := p.Visit(ctx.Member()).(*exprpb.Expr)
+ operand := p.Visit(ctx.Member()).(ast.Expr)
// Handle the error case where no valid identifier is specified.
if ctx.GetId() == nil {
return p.helper.newExpr(ctx)
@@ -600,13 +566,13 @@ func (p *parser) VisitMemberCall(ctx *gen.MemberCallContext) any {
// Visit a parse tree produced by CELParser#Index.
func (p *parser) VisitIndex(ctx *gen.IndexContext) any {
- target := p.Visit(ctx.Member()).(*exprpb.Expr)
+ target := p.Visit(ctx.Member()).(ast.Expr)
// Handle the error case where no valid identifier is specified.
if ctx.GetOp() == nil {
return p.helper.newExpr(ctx)
}
opID := p.helper.id(ctx.GetOp())
- index := p.Visit(ctx.GetIndex()).(*exprpb.Expr)
+ index := p.Visit(ctx.GetIndex()).(ast.Expr)
operator := operators.Index
if ctx.GetOpt() != nil {
if !p.enableOptionalSyntax {
@@ -630,7 +596,7 @@ func (p *parser) VisitCreateMessage(ctx *gen.CreateMessageContext) any {
messageName = "." + messageName
}
objID := p.helper.id(ctx.GetOp())
- entries := p.VisitIFieldInitializerList(ctx.GetEntries()).([]*exprpb.Expr_CreateStruct_Entry)
+ entries := p.VisitIFieldInitializerList(ctx.GetEntries()).([]ast.EntryExpr)
return p.helper.newObject(objID, messageName, entries...)
}
@@ -638,16 +604,16 @@ func (p *parser) VisitCreateMessage(ctx *gen.CreateMessageContext) any {
func (p *parser) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext) any {
if ctx == nil || ctx.GetFields() == nil {
// This is the result of a syntax error handled elswhere, return empty.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
- result := make([]*exprpb.Expr_CreateStruct_Entry, len(ctx.GetFields()))
+ result := make([]ast.EntryExpr, len(ctx.GetFields()))
cols := ctx.GetCols()
vals := ctx.GetValues()
for i, f := range ctx.GetFields() {
if i >= len(cols) || i >= len(vals) {
// This is the result of a syntax error detected elsewhere.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
initID := p.helper.id(cols[i])
optField := f.(*gen.OptFieldContext)
@@ -659,10 +625,10 @@ func (p *parser) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext
// The field may be empty due to a prior error.
id := optField.IDENTIFIER()
if id == nil {
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
fieldName := id.GetText()
- value := p.Visit(vals[i]).(*exprpb.Expr)
+ value := p.Visit(vals[i]).(ast.Expr)
field := p.helper.newObjectField(initID, fieldName, value, optional)
result[i] = field
}
@@ -702,9 +668,9 @@ func (p *parser) VisitCreateList(ctx *gen.CreateListContext) any {
// Visit a parse tree produced by CELParser#CreateStruct.
func (p *parser) VisitCreateStruct(ctx *gen.CreateStructContext) any {
structID := p.helper.id(ctx.GetOp())
- entries := []*exprpb.Expr_CreateStruct_Entry{}
+ entries := []ast.EntryExpr{}
if ctx.GetEntries() != nil {
- entries = p.Visit(ctx.GetEntries()).([]*exprpb.Expr_CreateStruct_Entry)
+ entries = p.Visit(ctx.GetEntries()).([]ast.EntryExpr)
}
return p.helper.newMap(structID, entries...)
}
@@ -713,17 +679,17 @@ func (p *parser) VisitCreateStruct(ctx *gen.CreateStructContext) any {
func (p *parser) VisitMapInitializerList(ctx *gen.MapInitializerListContext) any {
if ctx == nil || ctx.GetKeys() == nil {
// This is the result of a syntax error handled elswhere, return empty.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
- result := make([]*exprpb.Expr_CreateStruct_Entry, len(ctx.GetCols()))
+ result := make([]ast.EntryExpr, len(ctx.GetCols()))
keys := ctx.GetKeys()
vals := ctx.GetValues()
for i, col := range ctx.GetCols() {
colID := p.helper.id(col)
if i >= len(keys) || i >= len(vals) {
// This is the result of a syntax error detected elsewhere.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
optKey := keys[i]
optional := optKey.GetOpt() != nil
@@ -731,8 +697,8 @@ func (p *parser) VisitMapInitializerList(ctx *gen.MapInitializerListContext) any
p.reportError(optKey, "unsupported syntax '?'")
continue
}
- key := p.Visit(optKey.GetE()).(*exprpb.Expr)
- value := p.Visit(vals[i]).(*exprpb.Expr)
+ key := p.Visit(optKey.GetE()).(ast.Expr)
+ value := p.Visit(vals[i]).(ast.Expr)
entry := p.helper.newMapEntry(colID, key, value, optional)
result[i] = entry
}
@@ -812,30 +778,27 @@ func (p *parser) VisitBoolFalse(ctx *gen.BoolFalseContext) any {
// Visit a parse tree produced by CELParser#Null.
func (p *parser) VisitNull(ctx *gen.NullContext) any {
- return p.helper.newLiteral(ctx,
- &exprpb.Constant{
- ConstantKind: &exprpb.Constant_NullValue{
- NullValue: structpb.NullValue_NULL_VALUE}})
+ return p.helper.exprFactory.NewLiteral(p.helper.newID(ctx), types.NullValue)
}
-func (p *parser) visitExprList(ctx gen.IExprListContext) []*exprpb.Expr {
+func (p *parser) visitExprList(ctx gen.IExprListContext) []ast.Expr {
if ctx == nil {
- return []*exprpb.Expr{}
+ return []ast.Expr{}
}
return p.visitSlice(ctx.GetE())
}
-func (p *parser) visitListInit(ctx gen.IListInitContext) ([]*exprpb.Expr, []int32) {
+func (p *parser) visitListInit(ctx gen.IListInitContext) ([]ast.Expr, []int32) {
if ctx == nil {
- return []*exprpb.Expr{}, []int32{}
+ return []ast.Expr{}, []int32{}
}
elements := ctx.GetElems()
- result := make([]*exprpb.Expr, len(elements))
+ result := make([]ast.Expr, len(elements))
optionals := []int32{}
for i, e := range elements {
- ex := p.Visit(e.GetE()).(*exprpb.Expr)
+ ex := p.Visit(e.GetE()).(ast.Expr)
if ex == nil {
- return []*exprpb.Expr{}, []int32{}
+ return []ast.Expr{}, []int32{}
}
result[i] = ex
if e.GetOpt() != nil {
@@ -849,13 +812,13 @@ func (p *parser) visitListInit(ctx gen.IListInitContext) ([]*exprpb.Expr, []int3
return result, optionals
}
-func (p *parser) visitSlice(expressions []gen.IExprContext) []*exprpb.Expr {
+func (p *parser) visitSlice(expressions []gen.IExprContext) []ast.Expr {
if expressions == nil {
- return []*exprpb.Expr{}
+ return []ast.Expr{}
}
- result := make([]*exprpb.Expr, len(expressions))
+ result := make([]ast.Expr, len(expressions))
for i, e := range expressions {
- ex := p.Visit(e).(*exprpb.Expr)
+ ex := p.Visit(e).(ast.Expr)
result[i] = ex
}
return result
@@ -870,24 +833,24 @@ func (p *parser) unquote(ctx any, value string, isBytes bool) string {
return text
}
-func (p *parser) newLogicManager(function string, term *exprpb.Expr) *logicManager {
+func (p *parser) newLogicManager(function string, term ast.Expr) *logicManager {
if p.enableVariadicOperatorASTs {
- return newVariadicLogicManager(p.helper, function, term)
+ return newVariadicLogicManager(p.exprFactory, function, term)
}
- return newBalancingLogicManager(p.helper, function, term)
+ return newBalancingLogicManager(p.exprFactory, function, term)
}
-func (p *parser) reportError(ctx any, format string, args ...any) *exprpb.Expr {
+func (p *parser) reportError(ctx any, format string, args ...any) ast.Expr {
var location common.Location
err := p.helper.newExpr(ctx)
switch c := ctx.(type) {
case common.Location:
location = c
case antlr.Token, antlr.ParserRuleContext:
- location = p.helper.getLocation(err.GetId())
+ location = p.helper.getLocation(err.ID())
}
// Provide arguments to the report error.
- p.errors.reportErrorAtID(err.GetId(), location, format, args...)
+ p.errors.reportErrorAtID(err.ID(), location, format, args...)
return err
}
@@ -912,33 +875,33 @@ func (p *parser) SyntaxError(recognizer antlr.Recognizer, offendingSymbol any, l
}
}
-func (p *parser) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs antlr.ATNConfigSet) {
+func (p *parser) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs *antlr.ATNConfigSet) {
// Intentional
}
-func (p *parser) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet) {
+func (p *parser) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs *antlr.ATNConfigSet) {
// Intentional
}
-func (p *parser) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet) {
+func (p *parser) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs *antlr.ATNConfigSet) {
// Intentional
}
-func (p *parser) globalCallOrMacro(exprID int64, function string, args ...*exprpb.Expr) *exprpb.Expr {
+func (p *parser) globalCallOrMacro(exprID int64, function string, args ...ast.Expr) ast.Expr {
if expr, found := p.expandMacro(exprID, function, nil, args...); found {
return expr
}
return p.helper.newGlobalCall(exprID, function, args...)
}
-func (p *parser) receiverCallOrMacro(exprID int64, function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
+func (p *parser) receiverCallOrMacro(exprID int64, function string, target ast.Expr, args ...ast.Expr) ast.Expr {
if expr, found := p.expandMacro(exprID, function, target, args...); found {
return expr
}
return p.helper.newReceiverCall(exprID, function, target, args...)
}
-func (p *parser) expandMacro(exprID int64, function string, target *exprpb.Expr, args ...*exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *parser) expandMacro(exprID int64, function string, target ast.Expr, args ...ast.Expr) (ast.Expr, bool) {
macro, found := p.macros[makeMacroKey(function, len(args), target != nil)]
if !found {
macro, found = p.macros[makeVarArgMacroKey(function, target != nil)]
@@ -964,7 +927,7 @@ func (p *parser) expandMacro(exprID int64, function string, target *exprpb.Expr,
return nil, false
}
if p.populateMacroCalls {
- p.helper.addMacroCall(expr.GetId(), function, target, args...)
+ p.helper.addMacroCall(expr.ID(), function, target, args...)
}
return expr, true
}
diff --git a/vendor/github.com/google/cel-go/parser/unparser.go b/vendor/github.com/google/cel-go/parser/unparser.go
index c3c40a0dd36..91cf7294475 100644
--- a/vendor/github.com/google/cel-go/parser/unparser.go
+++ b/vendor/github.com/google/cel-go/parser/unparser.go
@@ -20,9 +20,9 @@ import (
"strconv"
"strings"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/types"
)
// Unparse takes an input expression and source position information and generates a human-readable
@@ -39,7 +39,7 @@ import (
//
// This function optionally takes in one or more UnparserOption to alter the unparsing behavior, such as
// performing word wrapping on expressions.
-func Unparse(expr *exprpb.Expr, info *exprpb.SourceInfo, opts ...UnparserOption) (string, error) {
+func Unparse(expr ast.Expr, info *ast.SourceInfo, opts ...UnparserOption) (string, error) {
unparserOpts := &unparserOption{
wrapOnColumn: defaultWrapOnColumn,
wrapAfterColumnLimit: defaultWrapAfterColumnLimit,
@@ -68,12 +68,12 @@ func Unparse(expr *exprpb.Expr, info *exprpb.SourceInfo, opts ...UnparserOption)
// unparser visits an expression to reconstruct a human-readable string from an AST.
type unparser struct {
str strings.Builder
- info *exprpb.SourceInfo
+ info *ast.SourceInfo
options *unparserOption
lastWrappedIndex int
}
-func (un *unparser) visit(expr *exprpb.Expr) error {
+func (un *unparser) visit(expr ast.Expr) error {
if expr == nil {
return errors.New("unsupported expression")
}
@@ -81,27 +81,29 @@ func (un *unparser) visit(expr *exprpb.Expr) error {
if visited || err != nil {
return err
}
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_CallExpr:
+ switch expr.Kind() {
+ case ast.CallKind:
return un.visitCall(expr)
- case *exprpb.Expr_ConstExpr:
+ case ast.LiteralKind:
return un.visitConst(expr)
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
return un.visitIdent(expr)
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
return un.visitList(expr)
- case *exprpb.Expr_SelectExpr:
+ case ast.MapKind:
+ return un.visitStructMap(expr)
+ case ast.SelectKind:
return un.visitSelect(expr)
- case *exprpb.Expr_StructExpr:
- return un.visitStruct(expr)
+ case ast.StructKind:
+ return un.visitStructMsg(expr)
default:
return fmt.Errorf("unsupported expression: %v", expr)
}
}
-func (un *unparser) visitCall(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
+func (un *unparser) visitCall(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
switch fun {
// ternary operator
case operators.Conditional:
@@ -141,10 +143,10 @@ func (un *unparser) visitCall(expr *exprpb.Expr) error {
}
}
-func (un *unparser) visitCallBinary(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
- args := c.GetArgs()
+func (un *unparser) visitCallBinary(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
+ args := c.Args()
lhs := args[0]
// add parens if the current operator is lower precedence than the lhs expr operator.
lhsParen := isComplexOperatorWithRespectTo(fun, lhs)
@@ -168,9 +170,9 @@ func (un *unparser) visitCallBinary(expr *exprpb.Expr) error {
return un.visitMaybeNested(rhs, rhsParen)
}
-func (un *unparser) visitCallConditional(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- args := c.GetArgs()
+func (un *unparser) visitCallConditional(expr ast.Expr) error {
+ c := expr.AsCall()
+ args := c.Args()
// add parens if operand is a conditional itself.
nested := isSamePrecedence(operators.Conditional, args[0]) ||
isComplexOperator(args[0])
@@ -196,13 +198,13 @@ func (un *unparser) visitCallConditional(expr *exprpb.Expr) error {
return un.visitMaybeNested(args[2], nested)
}
-func (un *unparser) visitCallFunc(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
- args := c.GetArgs()
- if c.GetTarget() != nil {
- nested := isBinaryOrTernaryOperator(c.GetTarget())
- err := un.visitMaybeNested(c.GetTarget(), nested)
+func (un *unparser) visitCallFunc(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
+ args := c.Args()
+ if c.IsMemberFunction() {
+ nested := isBinaryOrTernaryOperator(c.Target())
+ err := un.visitMaybeNested(c.Target(), nested)
if err != nil {
return err
}
@@ -223,17 +225,17 @@ func (un *unparser) visitCallFunc(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitCallIndex(expr *exprpb.Expr) error {
+func (un *unparser) visitCallIndex(expr ast.Expr) error {
return un.visitCallIndexInternal(expr, "[")
}
-func (un *unparser) visitCallOptIndex(expr *exprpb.Expr) error {
+func (un *unparser) visitCallOptIndex(expr ast.Expr) error {
return un.visitCallIndexInternal(expr, "[?")
}
-func (un *unparser) visitCallIndexInternal(expr *exprpb.Expr, op string) error {
- c := expr.GetCallExpr()
- args := c.GetArgs()
+func (un *unparser) visitCallIndexInternal(expr ast.Expr, op string) error {
+ c := expr.AsCall()
+ args := c.Args()
nested := isBinaryOrTernaryOperator(args[0])
err := un.visitMaybeNested(args[0], nested)
if err != nil {
@@ -248,10 +250,10 @@ func (un *unparser) visitCallIndexInternal(expr *exprpb.Expr, op string) error {
return nil
}
-func (un *unparser) visitCallUnary(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
- args := c.GetArgs()
+func (un *unparser) visitCallUnary(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
+ args := c.Args()
unmangled, found := operators.FindReverse(fun)
if !found {
return fmt.Errorf("cannot unmangle operator: %s", fun)
@@ -261,35 +263,34 @@ func (un *unparser) visitCallUnary(expr *exprpb.Expr) error {
return un.visitMaybeNested(args[0], nested)
}
-func (un *unparser) visitConst(expr *exprpb.Expr) error {
- c := expr.GetConstExpr()
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- un.str.WriteString(strconv.FormatBool(c.GetBoolValue()))
- case *exprpb.Constant_BytesValue:
+func (un *unparser) visitConst(expr ast.Expr) error {
+ val := expr.AsLiteral()
+ switch val := val.(type) {
+ case types.Bool:
+ un.str.WriteString(strconv.FormatBool(bool(val)))
+ case types.Bytes:
// bytes constants are surrounded with b""
- b := c.GetBytesValue()
un.str.WriteString(`b"`)
- un.str.WriteString(bytesToOctets(b))
+ un.str.WriteString(bytesToOctets([]byte(val)))
un.str.WriteString(`"`)
- case *exprpb.Constant_DoubleValue:
+ case types.Double:
// represent the float using the minimum required digits
- d := strconv.FormatFloat(c.GetDoubleValue(), 'g', -1, 64)
+ d := strconv.FormatFloat(float64(val), 'g', -1, 64)
un.str.WriteString(d)
if !strings.Contains(d, ".") {
un.str.WriteString(".0")
}
- case *exprpb.Constant_Int64Value:
- i := strconv.FormatInt(c.GetInt64Value(), 10)
+ case types.Int:
+ i := strconv.FormatInt(int64(val), 10)
un.str.WriteString(i)
- case *exprpb.Constant_NullValue:
+ case types.Null:
un.str.WriteString("null")
- case *exprpb.Constant_StringValue:
+ case types.String:
// strings will be double quoted with quotes escaped.
- un.str.WriteString(strconv.Quote(c.GetStringValue()))
- case *exprpb.Constant_Uint64Value:
+ un.str.WriteString(strconv.Quote(string(val)))
+ case types.Uint:
// uint literals have a 'u' suffix.
- ui := strconv.FormatUint(c.GetUint64Value(), 10)
+ ui := strconv.FormatUint(uint64(val), 10)
un.str.WriteString(ui)
un.str.WriteString("u")
default:
@@ -298,16 +299,16 @@ func (un *unparser) visitConst(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitIdent(expr *exprpb.Expr) error {
- un.str.WriteString(expr.GetIdentExpr().GetName())
+func (un *unparser) visitIdent(expr ast.Expr) error {
+ un.str.WriteString(expr.AsIdent())
return nil
}
-func (un *unparser) visitList(expr *exprpb.Expr) error {
- l := expr.GetListExpr()
- elems := l.GetElements()
+func (un *unparser) visitList(expr ast.Expr) error {
+ l := expr.AsList()
+ elems := l.Elements()
optIndices := make(map[int]bool, len(elems))
- for _, idx := range l.GetOptionalIndices() {
+ for _, idx := range l.OptionalIndices() {
optIndices[int(idx)] = true
}
un.str.WriteString("[")
@@ -327,20 +328,20 @@ func (un *unparser) visitList(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitOptSelect(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- args := c.GetArgs()
+func (un *unparser) visitOptSelect(expr ast.Expr) error {
+ c := expr.AsCall()
+ args := c.Args()
operand := args[0]
- field := args[1].GetConstExpr().GetStringValue()
- return un.visitSelectInternal(operand, false, ".?", field)
+ field := args[1].AsLiteral().(types.String)
+ return un.visitSelectInternal(operand, false, ".?", string(field))
}
-func (un *unparser) visitSelect(expr *exprpb.Expr) error {
- sel := expr.GetSelectExpr()
- return un.visitSelectInternal(sel.GetOperand(), sel.GetTestOnly(), ".", sel.GetField())
+func (un *unparser) visitSelect(expr ast.Expr) error {
+ sel := expr.AsSelect()
+ return un.visitSelectInternal(sel.Operand(), sel.IsTestOnly(), ".", sel.FieldName())
}
-func (un *unparser) visitSelectInternal(operand *exprpb.Expr, testOnly bool, op string, field string) error {
+func (un *unparser) visitSelectInternal(operand ast.Expr, testOnly bool, op string, field string) error {
// handle the case when the select expression was generated by the has() macro.
if testOnly {
un.str.WriteString("has(")
@@ -358,34 +359,25 @@ func (un *unparser) visitSelectInternal(operand *exprpb.Expr, testOnly bool, op
return nil
}
-func (un *unparser) visitStruct(expr *exprpb.Expr) error {
- s := expr.GetStructExpr()
- // If the message name is non-empty, then this should be treated as message construction.
- if s.GetMessageName() != "" {
- return un.visitStructMsg(expr)
- }
- // Otherwise, build a map.
- return un.visitStructMap(expr)
-}
-
-func (un *unparser) visitStructMsg(expr *exprpb.Expr) error {
- m := expr.GetStructExpr()
- entries := m.GetEntries()
- un.str.WriteString(m.GetMessageName())
+func (un *unparser) visitStructMsg(expr ast.Expr) error {
+ m := expr.AsStruct()
+ fields := m.Fields()
+ un.str.WriteString(m.TypeName())
un.str.WriteString("{")
- for i, entry := range entries {
- f := entry.GetFieldKey()
- if entry.GetOptionalEntry() {
+ for i, f := range fields {
+ field := f.AsStructField()
+ f := field.Name()
+ if field.IsOptional() {
un.str.WriteString("?")
}
un.str.WriteString(f)
un.str.WriteString(": ")
- v := entry.GetValue()
+ v := field.Value()
err := un.visit(v)
if err != nil {
return err
}
- if i < len(entries)-1 {
+ if i < len(fields)-1 {
un.str.WriteString(", ")
}
}
@@ -393,13 +385,14 @@ func (un *unparser) visitStructMsg(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitStructMap(expr *exprpb.Expr) error {
- m := expr.GetStructExpr()
- entries := m.GetEntries()
+func (un *unparser) visitStructMap(expr ast.Expr) error {
+ m := expr.AsMap()
+ entries := m.Entries()
un.str.WriteString("{")
- for i, entry := range entries {
- k := entry.GetMapKey()
- if entry.GetOptionalEntry() {
+ for i, e := range entries {
+ entry := e.AsMapEntry()
+ k := entry.Key()
+ if entry.IsOptional() {
un.str.WriteString("?")
}
err := un.visit(k)
@@ -407,7 +400,7 @@ func (un *unparser) visitStructMap(expr *exprpb.Expr) error {
return err
}
un.str.WriteString(": ")
- v := entry.GetValue()
+ v := entry.Value()
err = un.visit(v)
if err != nil {
return err
@@ -420,16 +413,15 @@ func (un *unparser) visitStructMap(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitMaybeMacroCall(expr *exprpb.Expr) (bool, error) {
- macroCalls := un.info.GetMacroCalls()
- call, found := macroCalls[expr.GetId()]
+func (un *unparser) visitMaybeMacroCall(expr ast.Expr) (bool, error) {
+ call, found := un.info.GetMacroCall(expr.ID())
if !found {
return false, nil
}
return true, un.visit(call)
}
-func (un *unparser) visitMaybeNested(expr *exprpb.Expr, nested bool) error {
+func (un *unparser) visitMaybeNested(expr ast.Expr, nested bool) error {
if nested {
un.str.WriteString("(")
}
@@ -453,12 +445,12 @@ func isLeftRecursive(op string) bool {
// precedence of the (possible) operation represented in the input Expr.
//
// If the expr is not a Call, the result is false.
-func isSamePrecedence(op string, expr *exprpb.Expr) bool {
- if expr.GetCallExpr() == nil {
+func isSamePrecedence(op string, expr ast.Expr) bool {
+ if expr.Kind() != ast.CallKind {
return false
}
- c := expr.GetCallExpr()
- other := c.GetFunction()
+ c := expr.AsCall()
+ other := c.FunctionName()
return operators.Precedence(op) == operators.Precedence(other)
}
@@ -466,16 +458,16 @@ func isSamePrecedence(op string, expr *exprpb.Expr) bool {
// than the (possible) operation represented in the input Expr.
//
// If the expr is not a Call, the result is false.
-func isLowerPrecedence(op string, expr *exprpb.Expr) bool {
- c := expr.GetCallExpr()
- other := c.GetFunction()
+func isLowerPrecedence(op string, expr ast.Expr) bool {
+ c := expr.AsCall()
+ other := c.FunctionName()
return operators.Precedence(op) < operators.Precedence(other)
}
// Indicates whether the expr is a complex operator, i.e., a call expression
// with 2 or more arguments.
-func isComplexOperator(expr *exprpb.Expr) bool {
- if expr.GetCallExpr() != nil && len(expr.GetCallExpr().GetArgs()) >= 2 {
+func isComplexOperator(expr ast.Expr) bool {
+ if expr.Kind() == ast.CallKind && len(expr.AsCall().Args()) >= 2 {
return true
}
return false
@@ -484,19 +476,19 @@ func isComplexOperator(expr *exprpb.Expr) bool {
// Indicates whether it is a complex operation compared to another.
// expr is *not* considered complex if it is not a call expression or has
// less than two arguments, or if it has a higher precedence than op.
-func isComplexOperatorWithRespectTo(op string, expr *exprpb.Expr) bool {
- if expr.GetCallExpr() == nil || len(expr.GetCallExpr().GetArgs()) < 2 {
+func isComplexOperatorWithRespectTo(op string, expr ast.Expr) bool {
+ if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 {
return false
}
return isLowerPrecedence(op, expr)
}
// Indicate whether this is a binary or ternary operator.
-func isBinaryOrTernaryOperator(expr *exprpb.Expr) bool {
- if expr.GetCallExpr() == nil || len(expr.GetCallExpr().GetArgs()) < 2 {
+func isBinaryOrTernaryOperator(expr ast.Expr) bool {
+ if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 {
return false
}
- _, isBinaryOp := operators.FindReverseBinaryOperator(expr.GetCallExpr().GetFunction())
+ _, isBinaryOp := operators.FindReverseBinaryOperator(expr.AsCall().FunctionName())
return isBinaryOp || isSamePrecedence(operators.Conditional, expr)
}
diff --git a/vendor/github.com/moby/spdystream/connection.go b/vendor/github.com/moby/spdystream/connection.go
index d906bb05ced..d649eccc852 100644
--- a/vendor/github.com/moby/spdystream/connection.go
+++ b/vendor/github.com/moby/spdystream/connection.go
@@ -208,9 +208,10 @@ type Connection struct {
nextStreamId spdy.StreamId
receivedStreamId spdy.StreamId
- pingIdLock sync.Mutex
- pingId uint32
- pingChans map[uint32]chan error
+ // pingLock protects pingChans and pingId
+ pingLock sync.Mutex
+ pingId uint32
+ pingChans map[uint32]chan error
shutdownLock sync.Mutex
shutdownChan chan error
@@ -274,16 +275,20 @@ func NewConnection(conn net.Conn, server bool) (*Connection, error) {
// returns the response time
func (s *Connection) Ping() (time.Duration, error) {
pid := s.pingId
- s.pingIdLock.Lock()
+ s.pingLock.Lock()
if s.pingId > 0x7ffffffe {
s.pingId = s.pingId - 0x7ffffffe
} else {
s.pingId = s.pingId + 2
}
- s.pingIdLock.Unlock()
pingChan := make(chan error)
s.pingChans[pid] = pingChan
- defer delete(s.pingChans, pid)
+ s.pingLock.Unlock()
+ defer func() {
+ s.pingLock.Lock()
+ delete(s.pingChans, pid)
+ s.pingLock.Unlock()
+ }()
frame := &spdy.PingFrame{Id: pid}
startTime := time.Now()
@@ -612,10 +617,14 @@ func (s *Connection) handleDataFrame(frame *spdy.DataFrame) error {
}
func (s *Connection) handlePingFrame(frame *spdy.PingFrame) error {
- if s.pingId&0x01 != frame.Id&0x01 {
+ s.pingLock.Lock()
+ pingId := s.pingId
+ pingChan, pingOk := s.pingChans[frame.Id]
+ s.pingLock.Unlock()
+
+ if pingId&0x01 != frame.Id&0x01 {
return s.framer.WriteFrame(frame)
}
- pingChan, pingOk := s.pingChans[frame.Id]
if pingOk {
close(pingChan)
}
@@ -731,16 +740,14 @@ func (s *Connection) shutdown(closeTimeout time.Duration) {
if err != nil {
duration := 10 * time.Minute
- time.AfterFunc(duration, func() {
- select {
- case err, ok := <-s.shutdownChan:
- if ok {
- debugMessage("Unhandled close error after %s: %s", duration, err)
- }
- default:
- }
- })
- s.shutdownChan <- err
+ timer := time.NewTimer(duration)
+ defer timer.Stop()
+ select {
+ case s.shutdownChan <- err:
+ // error was handled
+ case <-timer.C:
+ debugMessage("Unhandled close error after %s: %s", duration, err)
+ }
}
close(s.shutdownChan)
}
diff --git a/vendor/github.com/moby/spdystream/stream.go b/vendor/github.com/moby/spdystream/stream.go
index 404e3c02dfa..171c1e9e331 100644
--- a/vendor/github.com/moby/spdystream/stream.go
+++ b/vendor/github.com/moby/spdystream/stream.go
@@ -305,6 +305,8 @@ func (s *Stream) Identifier() uint32 {
// IsFinished returns whether the stream has finished
// sending data
func (s *Stream) IsFinished() bool {
+ s.finishLock.Lock()
+ defer s.finishLock.Unlock()
return s.finished
}
diff --git a/vendor/github.com/moby/term/doc.go b/vendor/github.com/moby/term/doc.go
new file mode 100644
index 00000000000..c9bc0324435
--- /dev/null
+++ b/vendor/github.com/moby/term/doc.go
@@ -0,0 +1,3 @@
+// Package term provides structures and helper functions to work with
+// terminal (state, sizes).
+package term
diff --git a/vendor/github.com/moby/term/tc.go b/vendor/github.com/moby/term/tc.go
deleted file mode 100644
index 8a5e09f5849..00000000000
--- a/vendor/github.com/moby/term/tc.go
+++ /dev/null
@@ -1,20 +0,0 @@
-//go:build !windows
-// +build !windows
-
-package term
-
-import (
- "golang.org/x/sys/unix"
-)
-
-func tcget(fd uintptr) (*Termios, error) {
- p, err := unix.IoctlGetTermios(int(fd), getTermios)
- if err != nil {
- return nil, err
- }
- return p, nil
-}
-
-func tcset(fd uintptr, p *Termios) error {
- return unix.IoctlSetTermios(int(fd), setTermios, p)
-}
diff --git a/vendor/github.com/moby/term/term.go b/vendor/github.com/moby/term/term.go
index 2dd3d090dff..f9d8988ef88 100644
--- a/vendor/github.com/moby/term/term.go
+++ b/vendor/github.com/moby/term/term.go
@@ -1,100 +1,85 @@
-//go:build !windows
-// +build !windows
-
-// Package term provides structures and helper functions to work with
-// terminal (state, sizes).
package term
-import (
- "errors"
- "io"
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-// ErrInvalidState is returned if the state of the terminal is invalid.
-var ErrInvalidState = errors.New("Invalid terminal state")
+import "io"
-// State represents the state of the terminal.
-type State struct {
- termios Termios
-}
+// State holds the platform-specific state / console mode for the terminal.
+type State terminalState
// Winsize represents the size of the terminal window.
type Winsize struct {
Height uint16
Width uint16
- x uint16
- y uint16
+
+ // Only used on Unix
+ x uint16
+ y uint16
}
// StdStreams returns the standard streams (stdin, stdout, stderr).
+//
+// On Windows, it attempts to turn on VT handling on all std handles if
+// supported, or falls back to terminal emulation. On Unix, this returns
+// the standard [os.Stdin], [os.Stdout] and [os.Stderr].
func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
- return os.Stdin, os.Stdout, os.Stderr
+ return stdStreams()
}
// GetFdInfo returns the file descriptor for an os.File and indicates whether the file represents a terminal.
-func GetFdInfo(in interface{}) (uintptr, bool) {
- var inFd uintptr
- var isTerminalIn bool
- if file, ok := in.(*os.File); ok {
- inFd = file.Fd()
- isTerminalIn = IsTerminal(inFd)
- }
- return inFd, isTerminalIn
+func GetFdInfo(in interface{}) (fd uintptr, isTerminal bool) {
+ return getFdInfo(in)
+}
+
+// GetWinsize returns the window size based on the specified file descriptor.
+func GetWinsize(fd uintptr) (*Winsize, error) {
+ return getWinsize(fd)
+}
+
+// SetWinsize tries to set the specified window size for the specified file
+// descriptor. It is only implemented on Unix, and returns an error on Windows.
+func SetWinsize(fd uintptr, ws *Winsize) error {
+ return setWinsize(fd, ws)
}
// IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal(fd uintptr) bool {
- _, err := tcget(fd)
- return err == nil
+ return isTerminal(fd)
}
// RestoreTerminal restores the terminal connected to the given file descriptor
// to a previous state.
func RestoreTerminal(fd uintptr, state *State) error {
- if state == nil {
- return ErrInvalidState
- }
- return tcset(fd, &state.termios)
+ return restoreTerminal(fd, state)
}
// SaveState saves the state of the terminal connected to the given file descriptor.
func SaveState(fd uintptr) (*State, error) {
- termios, err := tcget(fd)
- if err != nil {
- return nil, err
- }
- return &State{termios: *termios}, nil
+ return saveState(fd)
}
// DisableEcho applies the specified state to the terminal connected to the file
// descriptor, with echo disabled.
func DisableEcho(fd uintptr, state *State) error {
- newState := state.termios
- newState.Lflag &^= unix.ECHO
-
- if err := tcset(fd, &newState); err != nil {
- return err
- }
- return nil
+ return disableEcho(fd, state)
}
// SetRawTerminal puts the terminal connected to the given file descriptor into
-// raw mode and returns the previous state. On UNIX, this puts both the input
-// and output into raw mode. On Windows, it only puts the input into raw mode.
-func SetRawTerminal(fd uintptr) (*State, error) {
- oldState, err := MakeRaw(fd)
- if err != nil {
- return nil, err
- }
- return oldState, err
+// raw mode and returns the previous state. On UNIX, this is the equivalent of
+// [MakeRaw], and puts both the input and output into raw mode. On Windows, it
+// only puts the input into raw mode.
+func SetRawTerminal(fd uintptr) (previousState *State, err error) {
+ return setRawTerminal(fd)
}
// SetRawTerminalOutput puts the output of terminal connected to the given file
// descriptor into raw mode. On UNIX, this does nothing and returns nil for the
// state. On Windows, it disables LF -> CRLF translation.
-func SetRawTerminalOutput(fd uintptr) (*State, error) {
- return nil, nil
+func SetRawTerminalOutput(fd uintptr) (previousState *State, err error) {
+ return setRawTerminalOutput(fd)
+}
+
+// MakeRaw puts the terminal (Windows Console) connected to the
+// given file descriptor into raw mode and returns the previous state of
+// the terminal so that it can be restored.
+func MakeRaw(fd uintptr) (previousState *State, err error) {
+ return makeRaw(fd)
}
diff --git a/vendor/github.com/moby/term/term_unix.go b/vendor/github.com/moby/term/term_unix.go
new file mode 100644
index 00000000000..2ec7706a16a
--- /dev/null
+++ b/vendor/github.com/moby/term/term_unix.go
@@ -0,0 +1,98 @@
+//go:build !windows
+// +build !windows
+
+package term
+
+import (
+ "errors"
+ "io"
+ "os"
+
+ "golang.org/x/sys/unix"
+)
+
+// ErrInvalidState is returned if the state of the terminal is invalid.
+//
+// Deprecated: ErrInvalidState is no longer used.
+var ErrInvalidState = errors.New("Invalid terminal state")
+
+// terminalState holds the platform-specific state / console mode for the terminal.
+type terminalState struct {
+ termios unix.Termios
+}
+
+func stdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
+ return os.Stdin, os.Stdout, os.Stderr
+}
+
+func getFdInfo(in interface{}) (uintptr, bool) {
+ var inFd uintptr
+ var isTerminalIn bool
+ if file, ok := in.(*os.File); ok {
+ inFd = file.Fd()
+ isTerminalIn = isTerminal(inFd)
+ }
+ return inFd, isTerminalIn
+}
+
+func getWinsize(fd uintptr) (*Winsize, error) {
+ uws, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ)
+ ws := &Winsize{Height: uws.Row, Width: uws.Col, x: uws.Xpixel, y: uws.Ypixel}
+ return ws, err
+}
+
+func setWinsize(fd uintptr, ws *Winsize) error {
+ return unix.IoctlSetWinsize(int(fd), unix.TIOCSWINSZ, &unix.Winsize{
+ Row: ws.Height,
+ Col: ws.Width,
+ Xpixel: ws.x,
+ Ypixel: ws.y,
+ })
+}
+
+func isTerminal(fd uintptr) bool {
+ _, err := tcget(fd)
+ return err == nil
+}
+
+func restoreTerminal(fd uintptr, state *State) error {
+ if state == nil {
+ return errors.New("invalid terminal state")
+ }
+ return tcset(fd, &state.termios)
+}
+
+func saveState(fd uintptr) (*State, error) {
+ termios, err := tcget(fd)
+ if err != nil {
+ return nil, err
+ }
+ return &State{termios: *termios}, nil
+}
+
+func disableEcho(fd uintptr, state *State) error {
+ newState := state.termios
+ newState.Lflag &^= unix.ECHO
+
+ return tcset(fd, &newState)
+}
+
+func setRawTerminal(fd uintptr) (*State, error) {
+ return makeRaw(fd)
+}
+
+func setRawTerminalOutput(fd uintptr) (*State, error) {
+ return nil, nil
+}
+
+func tcget(fd uintptr) (*unix.Termios, error) {
+ p, err := unix.IoctlGetTermios(int(fd), getTermios)
+ if err != nil {
+ return nil, err
+ }
+ return p, nil
+}
+
+func tcset(fd uintptr, p *unix.Termios) error {
+ return unix.IoctlSetTermios(int(fd), setTermios, p)
+}
diff --git a/vendor/github.com/moby/term/term_windows.go b/vendor/github.com/moby/term/term_windows.go
index 3cdc8edbdaa..81ccff04281 100644
--- a/vendor/github.com/moby/term/term_windows.go
+++ b/vendor/github.com/moby/term/term_windows.go
@@ -1,6 +1,7 @@
package term
import (
+ "fmt"
"io"
"os"
"os/signal"
@@ -9,22 +10,15 @@ import (
"golang.org/x/sys/windows"
)
-// State holds the console mode for the terminal.
-type State struct {
+// terminalState holds the platform-specific state / console mode for the terminal.
+type terminalState struct {
mode uint32
}
-// Winsize is used for window size.
-type Winsize struct {
- Height uint16
- Width uint16
-}
-
// vtInputSupported is true if winterm.ENABLE_VIRTUAL_TERMINAL_INPUT is supported by the console
var vtInputSupported bool
-// StdStreams returns the standard streams (stdin, stdout, stderr).
-func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
+func stdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
// Turn on VT handling on all std handles, if possible. This might
// fail, in which case we will fall back to terminal emulation.
var (
@@ -87,16 +81,14 @@ func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
stdErr = os.Stderr
}
- return
+ return stdIn, stdOut, stdErr
}
-// GetFdInfo returns the file descriptor for an os.File and indicates whether the file represents a terminal.
-func GetFdInfo(in interface{}) (uintptr, bool) {
+func getFdInfo(in interface{}) (uintptr, bool) {
return windowsconsole.GetHandleInfo(in)
}
-// GetWinsize returns the window size based on the specified file descriptor.
-func GetWinsize(fd uintptr) (*Winsize, error) {
+func getWinsize(fd uintptr) (*Winsize, error) {
var info windows.ConsoleScreenBufferInfo
if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil {
return nil, err
@@ -110,21 +102,21 @@ func GetWinsize(fd uintptr) (*Winsize, error) {
return winsize, nil
}
-// IsTerminal returns true if the given file descriptor is a terminal.
-func IsTerminal(fd uintptr) bool {
+func setWinsize(fd uintptr, ws *Winsize) error {
+ return fmt.Errorf("not implemented on Windows")
+}
+
+func isTerminal(fd uintptr) bool {
var mode uint32
err := windows.GetConsoleMode(windows.Handle(fd), &mode)
return err == nil
}
-// RestoreTerminal restores the terminal connected to the given file descriptor
-// to a previous state.
-func RestoreTerminal(fd uintptr, state *State) error {
+func restoreTerminal(fd uintptr, state *State) error {
return windows.SetConsoleMode(windows.Handle(fd), state.mode)
}
-// SaveState saves the state of the terminal connected to the given file descriptor.
-func SaveState(fd uintptr) (*State, error) {
+func saveState(fd uintptr) (*State, error) {
var mode uint32
if err := windows.GetConsoleMode(windows.Handle(fd), &mode); err != nil {
@@ -134,9 +126,8 @@ func SaveState(fd uintptr) (*State, error) {
return &State{mode: mode}, nil
}
-// DisableEcho disables echo for the terminal connected to the given file descriptor.
-// -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx
-func DisableEcho(fd uintptr, state *State) error {
+func disableEcho(fd uintptr, state *State) error {
+ // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx
mode := state.mode
mode &^= windows.ENABLE_ECHO_INPUT
mode |= windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT
@@ -150,69 +141,27 @@ func DisableEcho(fd uintptr, state *State) error {
return nil
}
-// SetRawTerminal puts the terminal connected to the given file descriptor into
-// raw mode and returns the previous state. On UNIX, this puts both the input
-// and output into raw mode. On Windows, it only puts the input into raw mode.
-func SetRawTerminal(fd uintptr) (*State, error) {
- state, err := MakeRaw(fd)
+func setRawTerminal(fd uintptr) (*State, error) {
+ oldState, err := MakeRaw(fd)
if err != nil {
return nil, err
}
// Register an interrupt handler to catch and restore prior state
- restoreAtInterrupt(fd, state)
- return state, err
+ restoreAtInterrupt(fd, oldState)
+ return oldState, err
}
-// SetRawTerminalOutput puts the output of terminal connected to the given file
-// descriptor into raw mode. On UNIX, this does nothing and returns nil for the
-// state. On Windows, it disables LF -> CRLF translation.
-func SetRawTerminalOutput(fd uintptr) (*State, error) {
- state, err := SaveState(fd)
+func setRawTerminalOutput(fd uintptr) (*State, error) {
+ oldState, err := saveState(fd)
if err != nil {
return nil, err
}
// Ignore failures, since winterm.DISABLE_NEWLINE_AUTO_RETURN might not be supported on this
// version of Windows.
- _ = windows.SetConsoleMode(windows.Handle(fd), state.mode|windows.DISABLE_NEWLINE_AUTO_RETURN)
- return state, err
-}
-
-// MakeRaw puts the terminal (Windows Console) connected to the given file descriptor into raw
-// mode and returns the previous state of the terminal so that it can be restored.
-func MakeRaw(fd uintptr) (*State, error) {
- state, err := SaveState(fd)
- if err != nil {
- return nil, err
- }
-
- mode := state.mode
-
- // See
- // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx
- // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx
-
- // Disable these modes
- mode &^= windows.ENABLE_ECHO_INPUT
- mode &^= windows.ENABLE_LINE_INPUT
- mode &^= windows.ENABLE_MOUSE_INPUT
- mode &^= windows.ENABLE_WINDOW_INPUT
- mode &^= windows.ENABLE_PROCESSED_INPUT
-
- // Enable these modes
- mode |= windows.ENABLE_EXTENDED_FLAGS
- mode |= windows.ENABLE_INSERT_MODE
- mode |= windows.ENABLE_QUICK_EDIT_MODE
- if vtInputSupported {
- mode |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT
- }
-
- err = windows.SetConsoleMode(windows.Handle(fd), mode)
- if err != nil {
- return nil, err
- }
- return state, nil
+ _ = windows.SetConsoleMode(windows.Handle(fd), oldState.mode|windows.DISABLE_NEWLINE_AUTO_RETURN)
+ return oldState, err
}
func restoreAtInterrupt(fd uintptr, state *State) {
diff --git a/vendor/github.com/moby/term/termios.go b/vendor/github.com/moby/term/termios_unix.go
similarity index 50%
rename from vendor/github.com/moby/term/termios.go
rename to vendor/github.com/moby/term/termios_unix.go
index 99c0f7de60d..60c823783cd 100644
--- a/vendor/github.com/moby/term/termios.go
+++ b/vendor/github.com/moby/term/termios_unix.go
@@ -8,12 +8,11 @@ import (
)
// Termios is the Unix API for terminal I/O.
+//
+// Deprecated: use [unix.Termios].
type Termios = unix.Termios
-// MakeRaw puts the terminal connected to the given file descriptor into raw
-// mode and returns the previous state of the terminal so that it can be
-// restored.
-func MakeRaw(fd uintptr) (*State, error) {
+func makeRaw(fd uintptr) (*State, error) {
termios, err := tcget(fd)
if err != nil {
return nil, err
@@ -21,10 +20,10 @@ func MakeRaw(fd uintptr) (*State, error) {
oldState := State{termios: *termios}
- termios.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON)
+ termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON
termios.Oflag &^= unix.OPOST
- termios.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN)
- termios.Cflag &^= (unix.CSIZE | unix.PARENB)
+ termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN
+ termios.Cflag &^= unix.CSIZE | unix.PARENB
termios.Cflag |= unix.CS8
termios.Cc[unix.VMIN] = 1
termios.Cc[unix.VTIME] = 0
diff --git a/vendor/github.com/moby/term/termios_windows.go b/vendor/github.com/moby/term/termios_windows.go
new file mode 100644
index 00000000000..5be4e760113
--- /dev/null
+++ b/vendor/github.com/moby/term/termios_windows.go
@@ -0,0 +1,37 @@
+package term
+
+import "golang.org/x/sys/windows"
+
+func makeRaw(fd uintptr) (*State, error) {
+ state, err := SaveState(fd)
+ if err != nil {
+ return nil, err
+ }
+
+ mode := state.mode
+
+ // See
+ // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx
+ // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx
+
+ // Disable these modes
+ mode &^= windows.ENABLE_ECHO_INPUT
+ mode &^= windows.ENABLE_LINE_INPUT
+ mode &^= windows.ENABLE_MOUSE_INPUT
+ mode &^= windows.ENABLE_WINDOW_INPUT
+ mode &^= windows.ENABLE_PROCESSED_INPUT
+
+ // Enable these modes
+ mode |= windows.ENABLE_EXTENDED_FLAGS
+ mode |= windows.ENABLE_INSERT_MODE
+ mode |= windows.ENABLE_QUICK_EDIT_MODE
+ if vtInputSupported {
+ mode |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT
+ }
+
+ err = windows.SetConsoleMode(windows.Handle(fd), mode)
+ if err != nil {
+ return nil, err
+ }
+ return state, nil
+}
diff --git a/vendor/github.com/moby/term/windows/ansi_reader.go b/vendor/github.com/moby/term/windows/ansi_reader.go
index f32aa537ef2..fb34c547aad 100644
--- a/vendor/github.com/moby/term/windows/ansi_reader.go
+++ b/vendor/github.com/moby/term/windows/ansi_reader.go
@@ -195,10 +195,10 @@ func keyToString(keyEvent *winterm.KEY_EVENT_RECORD, escapeSequence []byte) stri
// +Key generates ESC N Key
if !control && alt {
- return ansiterm.KEY_ESC_N + strings.ToLower(string(keyEvent.UnicodeChar))
+ return ansiterm.KEY_ESC_N + strings.ToLower(string(rune(keyEvent.UnicodeChar)))
}
- return string(keyEvent.UnicodeChar)
+ return string(rune(keyEvent.UnicodeChar))
}
// formatVirtualKey converts a virtual key (e.g., up arrow) into the appropriate ANSI string.
diff --git a/vendor/github.com/moby/term/windows/console.go b/vendor/github.com/moby/term/windows/console.go
index 116b74e8f58..21e57bd52fe 100644
--- a/vendor/github.com/moby/term/windows/console.go
+++ b/vendor/github.com/moby/term/windows/console.go
@@ -30,8 +30,11 @@ func GetHandleInfo(in interface{}) (uintptr, bool) {
// IsConsole returns true if the given file descriptor is a Windows Console.
// The code assumes that GetConsoleMode will return an error for file descriptors that are not a console.
-// Deprecated: use golang.org/x/sys/windows.GetConsoleMode() or golang.org/x/term.IsTerminal()
-var IsConsole = isConsole
+//
+// Deprecated: use [windows.GetConsoleMode] or [golang.org/x/term.IsTerminal].
+func IsConsole(fd uintptr) bool {
+ return isConsole(fd)
+}
func isConsole(fd uintptr) bool {
var mode uint32
diff --git a/vendor/github.com/moby/term/winsize.go b/vendor/github.com/moby/term/winsize.go
deleted file mode 100644
index bea8d4595cf..00000000000
--- a/vendor/github.com/moby/term/winsize.go
+++ /dev/null
@@ -1,21 +0,0 @@
-//go:build !windows
-// +build !windows
-
-package term
-
-import (
- "golang.org/x/sys/unix"
-)
-
-// GetWinsize returns the window size based on the specified file descriptor.
-func GetWinsize(fd uintptr) (*Winsize, error) {
- uws, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ)
- ws := &Winsize{Height: uws.Row, Width: uws.Col, x: uws.Xpixel, y: uws.Ypixel}
- return ws, err
-}
-
-// SetWinsize tries to set the specified window size for the specified file descriptor.
-func SetWinsize(fd uintptr, ws *Winsize) error {
- uws := &unix.Winsize{Row: ws.Height, Col: ws.Width, Xpixel: ws.x, Ypixel: ws.y}
- return unix.IoctlSetWinsize(int(fd), unix.TIOCSWINSZ, uws)
-}
diff --git a/vendor/github.com/open-policy-agent/cert-controller/pkg/rotator/rotator.go b/vendor/github.com/open-policy-agent/cert-controller/pkg/rotator/rotator.go
index dc00c856346..455bffb5637 100644
--- a/vendor/github.com/open-policy-agent/cert-controller/pkg/rotator/rotator.go
+++ b/vendor/github.com/open-policy-agent/cert-controller/pkg/rotator/rotator.go
@@ -678,8 +678,8 @@ func ValidCert(caCert, cert, key []byte, dnsName string, keyUsages *[]x509.ExtKe
return true, nil
}
-func reconcileSecretAndWebhookMapFunc(webhook WebhookInfo, r *ReconcileWH) func(ctx context.Context, object client.Object) []reconcile.Request {
- return func(ctx context.Context, object client.Object) []reconcile.Request {
+func reconcileSecretAndWebhookMapFunc(webhook WebhookInfo, r *ReconcileWH) func(ctx context.Context, object *unstructured.Unstructured) []reconcile.Request {
+ return func(ctx context.Context, object *unstructured.Unstructured) []reconcile.Request {
whKey := types.NamespacedName{Name: webhook.Name}
if object.GetNamespace() != whKey.Namespace {
return nil
@@ -700,8 +700,7 @@ func addController(mgr manager.Manager, r *ReconcileWH) error {
}
err = c.Watch(
- source.Kind(r.cache, &corev1.Secret{}),
- &handler.EnqueueRequestForObject{},
+ source.Kind(r.cache, &corev1.Secret{}, &handler.TypedEnqueueRequestForObject[*corev1.Secret]{}),
)
if err != nil {
return fmt.Errorf("watching Secrets: %w", err)
@@ -711,9 +710,9 @@ func addController(mgr manager.Manager, r *ReconcileWH) error {
wh := &unstructured.Unstructured{}
wh.SetGroupVersionKind(webhook.gvk())
err = c.Watch(
- source.Kind(r.cache, wh),
- handler.EnqueueRequestsFromMapFunc(reconcileSecretAndWebhookMapFunc(webhook, r)),
+ source.Kind(r.cache, wh, handler.TypedEnqueueRequestsFromMapFunc(reconcileSecretAndWebhookMapFunc(webhook, r))),
)
+
if err != nil {
return fmt.Errorf("watching webhook %s: %w", webhook.Name, err)
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
index 8d35f2d8ae9..519db348a74 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
@@ -844,9 +844,7 @@ func (h *histogram) Write(out *dto.Metric) error {
}}
}
- // If exemplars are not configured, the cap will be 0.
- // So append is not needed in this case.
- if cap(h.nativeExemplars.exemplars) > 0 {
+ if h.nativeExemplars.isEnabled() {
h.nativeExemplars.Lock()
his.Exemplars = append(his.Exemplars, h.nativeExemplars.exemplars...)
h.nativeExemplars.Unlock()
@@ -1658,10 +1656,17 @@ func addAndResetCounts(hot, cold *histogramCounts) {
type nativeExemplars struct {
sync.Mutex
- ttl time.Duration
+ // Time-to-live for exemplars, it is set to -1 if exemplars are disabled, that is NativeHistogramMaxExemplars is below 0.
+ // The ttl is used on insertion to remove an exemplar that is older than ttl, if present.
+ ttl time.Duration
+
exemplars []*dto.Exemplar
}
+func (n *nativeExemplars) isEnabled() bool {
+ return n.ttl != -1
+}
+
func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars {
if ttl == 0 {
ttl = 5 * time.Minute
@@ -1673,6 +1678,7 @@ func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars {
if maxCount < 0 {
maxCount = 0
+ ttl = -1
}
return nativeExemplars{
@@ -1682,20 +1688,18 @@ func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars {
}
func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
- if cap(n.exemplars) == 0 {
+ if !n.isEnabled() {
return
}
n.Lock()
defer n.Unlock()
- // The index where to insert the new exemplar.
- var nIdx int = -1
-
// When the number of exemplars has not yet exceeded or
// is equal to cap(n.exemplars), then
// insert the new exemplar directly.
if len(n.exemplars) < cap(n.exemplars) {
+ var nIdx int
for nIdx = 0; nIdx < len(n.exemplars); nIdx++ {
if *e.Value < *n.exemplars[nIdx].Value {
break
@@ -1705,17 +1709,46 @@ func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
return
}
+ if len(n.exemplars) == 1 {
+ // When the number of exemplars is 1, then
+ // replace the existing exemplar with the new exemplar.
+ n.exemplars[0] = e
+ return
+ }
+ // From this point on, the number of exemplars is greater than 1.
+
// When the number of exemplars exceeds the limit, remove one exemplar.
var (
- rIdx int // The index where to remove the old exemplar.
-
- ot = time.Now() // Oldest timestamp seen.
- otIdx = -1 // Index of the exemplar with the oldest timestamp.
-
- md = -1.0 // Logarithm of the delta of the closest pair of exemplars.
- mdIdx = -1 // Index of the older exemplar within the closest pair.
- cLog float64 // Logarithm of the current exemplar.
- pLog float64 // Logarithm of the previous exemplar.
+ ot = time.Time{} // Oldest timestamp seen. Initial value doesn't matter as we replace it due to otIdx == -1 in the loop.
+ otIdx = -1 // Index of the exemplar with the oldest timestamp.
+
+ md = -1.0 // Logarithm of the delta of the closest pair of exemplars.
+
+ // The insertion point of the new exemplar in the exemplars slice after insertion.
+ // This is calculated purely based on the order of the exemplars by value.
+ // nIdx == len(n.exemplars) means the new exemplar is to be inserted after the end.
+ nIdx = -1
+
+ // rIdx is ultimately the index for the exemplar that we are replacing with the new exemplar.
+ // The aim is to keep a good spread of exemplars by value and not let them bunch up too much.
+ // It is calculated in 3 steps:
+ // 1. First we set rIdx to the index of the older exemplar within the closest pair by value.
+ // That is the following will be true (on log scale):
+ // either the exemplar pair on index (rIdx-1, rIdx) or (rIdx, rIdx+1) will have
+ // the closest values to each other from all pairs.
+ // For example, suppose the values are distributed like this:
+ // |-----------x-------------x----------------x----x-----|
+ // ^--rIdx as this is older.
+ // Or like this:
+ // |-----------x-------------x----------------x----x-----|
+ // ^--rIdx as this is older.
+ // 2. If there is an exemplar that expired, then we simple reset rIdx to that index.
+ // 3. We check if by inserting the new exemplar we would create a closer pair at
+ // (nIdx-1, nIdx) or (nIdx, nIdx+1) and set rIdx to nIdx-1 or nIdx accordingly to
+ // keep the spread of exemplars by value; otherwise we keep rIdx as it is.
+ rIdx = -1
+ cLog float64 // Logarithm of the current exemplar.
+ pLog float64 // Logarithm of the previous exemplar.
)
for i, exemplar := range n.exemplars {
@@ -1726,7 +1759,7 @@ func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
}
// Find the index at which to insert new the exemplar.
- if *e.Value <= *exemplar.Value && nIdx == -1 {
+ if nIdx == -1 && *e.Value <= *exemplar.Value {
nIdx = i
}
@@ -1738,11 +1771,13 @@ func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
}
diff := math.Abs(cLog - pLog)
if md == -1 || diff < md {
+ // The closest exemplar pair is at index: i-1, i.
+ // Choose the exemplar with the older timestamp for replacement.
md = diff
if n.exemplars[i].Timestamp.AsTime().Before(n.exemplars[i-1].Timestamp.AsTime()) {
- mdIdx = i
+ rIdx = i
} else {
- mdIdx = i - 1
+ rIdx = i - 1
}
}
@@ -1753,8 +1788,12 @@ func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
if nIdx == -1 {
nIdx = len(n.exemplars)
}
+ // Here, we have the following relationships:
+ // n.exemplars[nIdx-1].Value < e.Value (if nIdx > 0)
+ // e.Value <= n.exemplars[nIdx].Value (if nIdx < len(n.exemplars))
if otIdx != -1 && e.Timestamp.AsTime().Sub(ot) > n.ttl {
+ // If the oldest exemplar has expired, then replace it with the new exemplar.
rIdx = otIdx
} else {
// In the previous for loop, when calculating the closest pair of exemplars,
@@ -1764,23 +1803,26 @@ func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
if nIdx > 0 {
diff := math.Abs(elog - math.Log(n.exemplars[nIdx-1].GetValue()))
if diff < md {
+ // The value we are about to insert is closer to the previous exemplar at the insertion point than what we calculated before in rIdx.
+ // v--rIdx
+ // |-----------x-n-----------x----------------x----x-----|
+ // nIdx-1--^ ^--new exemplar value
+ // Do not make the spread worse, replace nIdx-1 and not rIdx.
md = diff
- mdIdx = nIdx
- if n.exemplars[nIdx-1].Timestamp.AsTime().Before(e.Timestamp.AsTime()) {
- mdIdx = nIdx - 1
- }
+ rIdx = nIdx - 1
}
}
if nIdx < len(n.exemplars) {
diff := math.Abs(math.Log(n.exemplars[nIdx].GetValue()) - elog)
if diff < md {
- mdIdx = nIdx
- if n.exemplars[nIdx].Timestamp.AsTime().Before(e.Timestamp.AsTime()) {
- mdIdx = nIdx
- }
+ // The value we are about to insert is closer to the next exemplar at the insertion point than what we calculated before in rIdx.
+ // v--rIdx
+ // |-----------x-----------n-x----------------x----x-----|
+ // new exemplar value--^ ^--nIdx
+ // Do not make the spread worse, replace nIdx-1 and not rIdx.
+ rIdx = nIdx
}
}
- rIdx = mdIdx
}
// Adjust the slice according to rIdx and nIdx.
diff --git a/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/raycluster_types.go b/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/raycluster_types.go
index a317a3b479f..79b8db3b88e 100644
--- a/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/raycluster_types.go
+++ b/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/raycluster_types.go
@@ -121,6 +121,8 @@ type RayClusterStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Status reflects the status of the cluster
+ //
+ // Deprecated: the State field is replaced by the Conditions field.
State ClusterState `json:"state,omitempty"`
// DesiredCPU indicates total desired CPUs for the cluster
DesiredCPU resource.Quantity `json:"desiredCPU,omitempty"`
diff --git a/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/rayjob_types.go b/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/rayjob_types.go
index 4124a8cb748..5c7b5c75c43 100644
--- a/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/rayjob_types.go
+++ b/vendor/github.com/ray-project/kuberay/ray-operator/apis/ray/v1/rayjob_types.go
@@ -42,6 +42,7 @@ const (
JobDeploymentStatusSuspending JobDeploymentStatus = "Suspending"
JobDeploymentStatusSuspended JobDeploymentStatus = "Suspended"
JobDeploymentStatusRetrying JobDeploymentStatus = "Retrying"
+ JobDeploymentStatusWaiting JobDeploymentStatus = "Waiting"
)
// JobFailedReason indicates the reason the RayJob changes its JobDeploymentStatus to 'Failed'
@@ -58,6 +59,7 @@ type JobSubmissionMode string
const (
K8sJobMode JobSubmissionMode = "K8sJobMode" // Submit job via Kubernetes Job
HTTPMode JobSubmissionMode = "HTTPMode" // Submit job via HTTP request
+ UserMode JobSubmissionMode = "UserMode" // Don't submit job in KubeRay. Instead, wait for user to submit job and provide the job submission ID
)
type SubmitterConfig struct {
@@ -86,7 +88,7 @@ type RayJobSpec struct {
SubmitterConfig *SubmitterConfig `json:"submitterConfig,omitempty"`
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
- Entrypoint string `json:"entrypoint"`
+ Entrypoint string `json:"entrypoint,omitempty"`
// RuntimeEnvYAML represents the runtime environment configuration
// provided as a multi-line YAML string.
RuntimeEnvYAML string `json:"runtimeEnvYAML,omitempty"`
diff --git a/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/constant.go b/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/constant.go
index c4c902da7af..0f1b0426f90 100644
--- a/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/constant.go
+++ b/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/constant.go
@@ -26,14 +26,16 @@ const (
HashWithoutReplicasAndWorkersToDeleteKey = "ray.io/hash-without-replicas-and-workers-to-delete"
NumWorkerGroupsKey = "ray.io/num-worker-groups"
KubeRayVersion = "ray.io/kuberay-version"
+ RayJobSubmissionIdLabelKey = "ray.io/ray-job-submission-id"
// In KubeRay, the Ray container must be the first application container in a head or worker Pod.
RayContainerIndex = 0
// Batch scheduling labels
// TODO(tgaddair): consider making these part of the CRD
- RaySchedulerName = "ray.io/scheduler-name"
- RayPriorityClassName = "ray.io/priority-class-name"
+ RaySchedulerName = "ray.io/scheduler-name"
+ RayPriorityClassName = "ray.io/priority-class-name"
+ RayClusterGangSchedulingEnabled = "ray.io/gang-scheduling-enabled"
// Ray GCS FT related annotations
RayFTEnabledAnnotationKey = "ray.io/ft-enabled"
@@ -150,17 +152,21 @@ const (
// Ray FT default readiness probe values
DefaultReadinessProbeInitialDelaySeconds = 10
DefaultReadinessProbeTimeoutSeconds = 2
- DefaultReadinessProbePeriodSeconds = 5
- DefaultReadinessProbeSuccessThreshold = 1
- DefaultReadinessProbeFailureThreshold = 10
- ServeReadinessProbeFailureThreshold = 1
+ // Probe timeout for Head pod needs to be longer as it queries two endpoints (api/local_raylet_healthz & api/gcs_healthz)
+ DefaultHeadReadinessProbeTimeoutSeconds = 5
+ DefaultReadinessProbePeriodSeconds = 5
+ DefaultReadinessProbeSuccessThreshold = 1
+ DefaultReadinessProbeFailureThreshold = 10
+ ServeReadinessProbeFailureThreshold = 1
// Ray FT default liveness probe values
DefaultLivenessProbeInitialDelaySeconds = 30
DefaultLivenessProbeTimeoutSeconds = 2
- DefaultLivenessProbePeriodSeconds = 5
- DefaultLivenessProbeSuccessThreshold = 1
- DefaultLivenessProbeFailureThreshold = 120
+ // Probe timeout for Head pod needs to be longer as it queries two endpoints (api/local_raylet_healthz & api/gcs_healthz)
+ DefaultHeadLivenessProbeTimeoutSeconds = 5
+ DefaultLivenessProbePeriodSeconds = 5
+ DefaultLivenessProbeSuccessThreshold = 1
+ DefaultLivenessProbeFailureThreshold = 120
// Ray health check related configurations
// Note: Since the Raylet process and the dashboard agent process are fate-sharing,
@@ -182,7 +188,7 @@ const (
// The version is included in the RAY_USAGE_STATS_EXTRA_TAGS environment variable
// as well as the user-agent. This constant is updated before release.
// TODO: Update KUBERAY_VERSION to be a build-time variable.
- KUBERAY_VERSION = "v1.2.1"
+ KUBERAY_VERSION = "v1.2.2"
)
type ServiceType string
@@ -222,3 +228,63 @@ func RayClusterReplicaFailureReason(err error) string {
}
return ""
}
+
+// Currently, KubeRay fires events when failures occur during the creation or deletion of resources.
+type K8sEventType string
+
+const (
+ // Head Pod event list
+ CreatedHeadPod K8sEventType = "CreatedHeadPod"
+ FailedToCreateHeadPod K8sEventType = "FailedToCreateHeadPod"
+ DeletedHeadPod K8sEventType = "DeletedHeadPod"
+ FailedToDeleteHeadPod K8sEventType = "FailedToDeleteHeadPod"
+
+ // Worker Pod event list
+ CreatedWorkerPod K8sEventType = "CreatedWorkerPod"
+ FailedToCreateWorkerPod K8sEventType = "FailedToCreateWorkerPod"
+ DeletedWorkerPod K8sEventType = "DeletedWorkerPod"
+ FailedToDeleteWorkerPod K8sEventType = "FailedToDeleteWorkerPod"
+
+ // Redis Cleanup Job event list
+ CreatedRedisCleanupJob K8sEventType = "CreatedRedisCleanupJob"
+ FailedToCreateRedisCleanupJob K8sEventType = "FailedToCreateRedisCleanupJob"
+
+ // RayJob event list
+ CreatedRayJobSubmitter K8sEventType = "CreatedRayJobSubmitter"
+ DeletedRayJobSubmitter K8sEventType = "DeletedRayJobSubmitter"
+ FailedToCreateRayJobSubmitter K8sEventType = "FailedToCreateRayJobSubmitter"
+ FailedToDeleteRayJobSubmitter K8sEventType = "FailedToDeleteRayJobSubmitter"
+ CreatedRayCluster K8sEventType = "CreatedRayCluster"
+ DeletedRayCluster K8sEventType = "DeletedRayCluster"
+ FailedToCreateRayCluster K8sEventType = "FailedToCreateRayCluster"
+ FailedToDeleteRayCluster K8sEventType = "FailedToDeleteRayCluster"
+
+ // Generic Pod event list
+ DeletedPod K8sEventType = "DeletedPod"
+ FailedToDeletePod K8sEventType = "FailedToDeletePod"
+
+ // Ingress event list
+ CreatedIngress K8sEventType = "CreatedIngress"
+ FailedToCreateIngress K8sEventType = "FailedToCreateIngress"
+
+ // Route event list
+ CreatedRoute K8sEventType = "CreatedRoute"
+ FailedToCreateRoute K8sEventType = "FailedToCreateRoute"
+
+ // Service event list
+ CreatedService K8sEventType = "CreatedService"
+ FailedToCreateService K8sEventType = "FailedToCreateService"
+
+ // ServiceAccount event list
+ CreatedServiceAccount K8sEventType = "CreatedServiceAccount"
+ FailedToCreateServiceAccount K8sEventType = "FailedToCreateServiceAccount"
+ AutoscalerServiceAccountNotFound K8sEventType = "AutoscalerServiceAccountNotFound"
+
+ // Role event list
+ CreatedRole K8sEventType = "CreatedRole"
+ FailedToCreateRole K8sEventType = "FailedToCreateRole"
+
+ // RoleBinding list
+ CreatedRoleBinding K8sEventType = "CreatedRoleBinding"
+ FailedToCreateRoleBinding K8sEventType = "FailedToCreateRoleBinding"
+)
diff --git a/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/util.go b/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/util.go
index 8daf167066d..792c1c1eece 100644
--- a/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/util.go
+++ b/vendor/github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/util.go
@@ -10,9 +10,10 @@ import (
"reflect"
"strconv"
"strings"
- "time"
"unicode"
+ "k8s.io/apimachinery/pkg/api/resource"
+
"sigs.k8s.io/controller-runtime/pkg/manager"
batchv1 "k8s.io/api/batch/v1"
@@ -374,10 +375,10 @@ func CalculateAvailableReplicas(pods corev1.PodList) int32 {
func CalculateDesiredResources(cluster *rayv1.RayCluster) corev1.ResourceList {
desiredResourcesList := []corev1.ResourceList{{}}
- headPodResource := calculatePodResource(cluster.Spec.HeadGroupSpec.Template.Spec)
+ headPodResource := CalculatePodResource(cluster.Spec.HeadGroupSpec.Template.Spec)
desiredResourcesList = append(desiredResourcesList, headPodResource)
for _, nodeGroup := range cluster.Spec.WorkerGroupSpecs {
- podResource := calculatePodResource(nodeGroup.Template.Spec)
+ podResource := CalculatePodResource(nodeGroup.Template.Spec)
for i := int32(0); i < *nodeGroup.Replicas; i++ {
desiredResourcesList = append(desiredResourcesList, podResource)
}
@@ -387,10 +388,10 @@ func CalculateDesiredResources(cluster *rayv1.RayCluster) corev1.ResourceList {
func CalculateMinResources(cluster *rayv1.RayCluster) corev1.ResourceList {
minResourcesList := []corev1.ResourceList{{}}
- headPodResource := calculatePodResource(cluster.Spec.HeadGroupSpec.Template.Spec)
+ headPodResource := CalculatePodResource(cluster.Spec.HeadGroupSpec.Template.Spec)
minResourcesList = append(minResourcesList, headPodResource)
for _, nodeGroup := range cluster.Spec.WorkerGroupSpecs {
- podResource := calculatePodResource(nodeGroup.Template.Spec)
+ podResource := CalculatePodResource(nodeGroup.Template.Spec)
for i := int32(0); i < *nodeGroup.MinReplicas; i++ {
minResourcesList = append(minResourcesList, podResource)
}
@@ -398,9 +399,9 @@ func CalculateMinResources(cluster *rayv1.RayCluster) corev1.ResourceList {
return sumResourceList(minResourcesList)
}
-// calculatePodResource returns the total resources of a pod.
+// CalculatePodResource returns the total resources of a pod.
// Request values take precedence over limit values.
-func calculatePodResource(podSpec corev1.PodSpec) corev1.ResourceList {
+func CalculatePodResource(podSpec corev1.PodSpec) corev1.ResourceList {
podResource := corev1.ResourceList{}
for _, container := range podSpec.Containers {
containerResource := container.Resources.Requests
@@ -424,6 +425,14 @@ func calculatePodResource(podSpec corev1.PodSpec) corev1.ResourceList {
return podResource
}
+func ConvertResourceListToMapString(resourceList corev1.ResourceList) map[string]resource.Quantity {
+ result := make(map[string]resource.Quantity)
+ for key, value := range resourceList {
+ result[string(key)] = value
+ }
+ return result
+}
+
func sumResourceList(list []corev1.ResourceList) corev1.ResourceList {
totalResource := corev1.ResourceList{}
for _, l := range list {
@@ -502,14 +511,6 @@ func CompareJsonStruct(objA interface{}, objB interface{}) bool {
return reflect.DeepEqual(v1, v2)
}
-func ConvertUnixTimeToMetav1Time(unixTime uint64) *metav1.Time {
- // The Ray jobInfo returns the start_time, which is a unix timestamp in milliseconds.
- // https://docs.ray.io/en/latest/cluster/jobs-package-ref.html#jobinfo
- t := time.Unix(int64(unixTime)/1000, int64(unixTime)%1000*1000000)
- kt := metav1.NewTime(t)
- return &kt
-}
-
// Json-serializes obj and returns its hash string
func GenerateJsonHash(obj interface{}) (string, error) {
serialObj, err := json.Marshal(obj)
diff --git a/vendor/github.com/x448/float16/.travis.yml b/vendor/github.com/x448/float16/.travis.yml
new file mode 100644
index 00000000000..8902bdaaffc
--- /dev/null
+++ b/vendor/github.com/x448/float16/.travis.yml
@@ -0,0 +1,13 @@
+language: go
+
+go:
+ - 1.11.x
+
+env:
+ - GO111MODULE=on
+
+script:
+ - go test -short -coverprofile=coverage.txt -covermode=count ./...
+
+after_success:
+ - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/x448/float16/LICENSE b/vendor/github.com/x448/float16/LICENSE
new file mode 100644
index 00000000000..bf6e357854a
--- /dev/null
+++ b/vendor/github.com/x448/float16/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/vendor/github.com/x448/float16/README.md b/vendor/github.com/x448/float16/README.md
new file mode 100644
index 00000000000..b524b8135d5
--- /dev/null
+++ b/vendor/github.com/x448/float16/README.md
@@ -0,0 +1,133 @@
+# Float16 (Binary16) in Go/Golang
+[![Build Status](https://travis-ci.org/x448/float16.svg?branch=master)](https://travis-ci.org/x448/float16)
+[![codecov](https://codecov.io/gh/x448/float16/branch/master/graph/badge.svg?v=4)](https://codecov.io/gh/x448/float16)
+[![Go Report Card](https://goreportcard.com/badge/github.com/x448/float16)](https://goreportcard.com/report/github.com/x448/float16)
+[![Release](https://img.shields.io/github/release/x448/float16.svg?style=flat-square)](https://github.com/x448/float16/releases)
+[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/x448/float16/master/LICENSE)
+
+`float16` package provides [IEEE 754 half-precision floating-point format (binary16)](https://en.wikipedia.org/wiki/Half-precision_floating-point_format) with IEEE 754 default rounding for conversions. IEEE 754-2008 refers to this 16-bit floating-point format as binary16.
+
+IEEE 754 default rounding ("Round-to-Nearest RoundTiesToEven") is considered the most accurate and statistically unbiased estimate of the true result.
+
+All possible 4+ billion floating-point conversions with this library are verified to be correct.
+
+Lowercase "float16" refers to IEEE 754 binary16. And capitalized "Float16" refers to exported Go data type provided by this library.
+
+## Features
+Current features include:
+
+* float16 to float32 conversions use lossless conversion.
+* float32 to float16 conversions use IEEE 754-2008 "Round-to-Nearest RoundTiesToEven".
+* conversions using pure Go take about 2.65 ns/op on a desktop amd64.
+* unit tests provide 100% code coverage and check all possible 4+ billion conversions.
+* other functions include: IsInf(), IsNaN(), IsNormal(), PrecisionFromfloat32(), String(), etc.
+* all functions in this library use zero allocs except String().
+
+## Status
+This library is used by [fxamacker/cbor](https://github.com/fxamacker/cbor) and is ready for production use on supported platforms. The version number < 1.0 indicates more functions and options are planned but not yet published.
+
+Current status:
+
+* core API is done and breaking API changes are unlikely.
+* 100% of unit tests pass:
+ * short mode (`go test -short`) tests around 65765 conversions in 0.005s.
+ * normal mode (`go test`) tests all possible 4+ billion conversions in about 95s.
+* 100% code coverage with both short mode and normal mode.
+* tested on amd64 but it should work on all little-endian platforms supported by Go.
+
+Roadmap:
+
+* add functions for fast batch conversions leveraging SIMD when supported by hardware.
+* speed up unit test when verifying all possible 4+ billion conversions.
+* test on additional platforms.
+
+## Float16 to Float32 Conversion
+Conversions from float16 to float32 are lossless conversions. All 65536 possible float16 to float32 conversions (in pure Go) are confirmed to be correct.
+
+Unit tests take a fraction of a second to check all 65536 expected values for float16 to float32 conversions.
+
+## Float32 to Float16 Conversion
+Conversions from float32 to float16 use IEEE 754 default rounding ("Round-to-Nearest RoundTiesToEven"). All 4294967296 possible float32 to float16 conversions (in pure Go) are confirmed to be correct.
+
+Unit tests in normal mode take about 1-2 minutes to check all 4+ billion float32 input values and results for Fromfloat32(), FromNaN32ps(), and PrecisionFromfloat32().
+
+Unit tests in short mode use a small subset (around 229 float32 inputs) and finish in under 0.01 second while still reaching 100% code coverage.
+
+## Usage
+Install with `go get github.com/x448/float16`.
+```
+// Convert float32 to float16
+pi := float32(math.Pi)
+pi16 := float16.Fromfloat32(pi)
+
+// Convert float16 to float32
+pi32 := pi16.Float32()
+
+// PrecisionFromfloat32() is faster than the overhead of calling a function.
+// This example only converts if there's no data loss and input is not a subnormal.
+if float16.PrecisionFromfloat32(pi) == float16.PrecisionExact {
+ pi16 := float16.Fromfloat32(pi)
+}
+```
+
+## Float16 Type and API
+Float16 (capitalized) is a Go type with uint16 as the underlying state. There are 6 exported functions and 9 exported methods.
+```
+package float16 // import "github.com/x448/float16"
+
+// Exported types and consts
+type Float16 uint16
+const ErrInvalidNaNValue = float16Error("float16: invalid NaN value, expected IEEE 754 NaN")
+
+// Exported functions
+Fromfloat32(f32 float32) Float16 // Float16 number converted from f32 using IEEE 754 default rounding
+ with identical results to AMD and Intel F16C hardware. NaN inputs
+ are converted with quiet bit always set on, to be like F16C.
+
+FromNaN32ps(nan float32) (Float16, error) // Float16 NaN without modifying quiet bit.
+ // The "ps" suffix means "preserve signaling".
+ // Returns sNaN and ErrInvalidNaNValue if nan isn't a NaN.
+
+Frombits(b16 uint16) Float16 // Float16 number corresponding to b16 (IEEE 754 binary16 rep.)
+NaN() Float16 // Float16 of IEEE 754 binary16 not-a-number
+Inf(sign int) Float16 // Float16 of IEEE 754 binary16 infinity according to sign
+
+PrecisionFromfloat32(f32 float32) Precision // quickly indicates exact, ..., overflow, underflow
+ // (inline and < 1 ns/op)
+// Exported methods
+(f Float16) Float32() float32 // float32 number converted from f16 using lossless conversion
+(f Float16) Bits() uint16 // the IEEE 754 binary16 representation of f
+(f Float16) IsNaN() bool // true if f is not-a-number (NaN)
+(f Float16) IsQuietNaN() bool // true if f is a quiet not-a-number (NaN)
+(f Float16) IsInf(sign int) bool // true if f is infinite based on sign (-1=NegInf, 0=any, 1=PosInf)
+(f Float16) IsFinite() bool // true if f is not infinite or NaN
+(f Float16) IsNormal() bool // true if f is not zero, infinite, subnormal, or NaN.
+(f Float16) Signbit() bool // true if f is negative or negative zero
+(f Float16) String() string // string representation of f to satisfy fmt.Stringer interface
+```
+See [API](https://godoc.org/github.com/x448/float16) at godoc.org for more info.
+
+## Benchmarks
+Conversions (in pure Go) are around 2.65 ns/op for float16 -> float32 and float32 -> float16 on amd64. Speeds can vary depending on input value.
+
+```
+All functions have zero allocations except float16.String().
+
+FromFloat32pi-2 2.59ns ± 0% // speed using Fromfloat32() to convert a float32 of math.Pi to Float16
+ToFloat32pi-2 2.69ns ± 0% // speed using Float32() to convert a float16 of math.Pi to float32
+Frombits-2 0.29ns ± 5% // speed using Frombits() to cast a uint16 to Float16
+
+PrecisionFromFloat32-2 0.29ns ± 1% // speed using PrecisionFromfloat32() to check for overflows, etc.
+```
+
+## System Requirements
+* Tested on Go 1.11, 1.12, and 1.13 but it should also work with older versions.
+* Tested on amd64 but it should also work on all little-endian platforms supported by Go.
+
+## Special Thanks
+Special thanks to Kathryn Long (starkat99) for creating [half-rs](https://github.com/starkat99/half-rs), a very nice rust implementation of float16.
+
+## License
+Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+
+Licensed under [MIT License](LICENSE)
diff --git a/vendor/github.com/x448/float16/float16.go b/vendor/github.com/x448/float16/float16.go
new file mode 100644
index 00000000000..1a0e6dad004
--- /dev/null
+++ b/vendor/github.com/x448/float16/float16.go
@@ -0,0 +1,302 @@
+// Copyright 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+//
+// Special thanks to Kathryn Long for her Rust implementation
+// of float16 at github.com/starkat99/half-rs (MIT license)
+
+package float16
+
+import (
+ "math"
+ "strconv"
+)
+
+// Float16 represents IEEE 754 half-precision floating-point numbers (binary16).
+type Float16 uint16
+
+// Precision indicates whether the conversion to Float16 is
+// exact, subnormal without dropped bits, inexact, underflow, or overflow.
+type Precision int
+
+const (
+
+ // PrecisionExact is for non-subnormals that don't drop bits during conversion.
+ // All of these can round-trip. Should always convert to float16.
+ PrecisionExact Precision = iota
+
+ // PrecisionUnknown is for subnormals that don't drop bits during conversion but
+ // not all of these can round-trip so precision is unknown without more effort.
+ // Only 2046 of these can round-trip and the rest cannot round-trip.
+ PrecisionUnknown
+
+ // PrecisionInexact is for dropped significand bits and cannot round-trip.
+ // Some of these are subnormals. Cannot round-trip float32->float16->float32.
+ PrecisionInexact
+
+ // PrecisionUnderflow is for Underflows. Cannot round-trip float32->float16->float32.
+ PrecisionUnderflow
+
+ // PrecisionOverflow is for Overflows. Cannot round-trip float32->float16->float32.
+ PrecisionOverflow
+)
+
+// PrecisionFromfloat32 returns Precision without performing
+// the conversion. Conversions from both Infinity and NaN
+// values will always report PrecisionExact even if NaN payload
+// or NaN-Quiet-Bit is lost. This function is kept simple to
+// allow inlining and run < 0.5 ns/op, to serve as a fast filter.
+func PrecisionFromfloat32(f32 float32) Precision {
+ u32 := math.Float32bits(f32)
+
+ if u32 == 0 || u32 == 0x80000000 {
+ // +- zero will always be exact conversion
+ return PrecisionExact
+ }
+
+ const COEFMASK uint32 = 0x7fffff // 23 least significant bits
+ const EXPSHIFT uint32 = 23
+ const EXPBIAS uint32 = 127
+ const EXPMASK uint32 = uint32(0xff) << EXPSHIFT
+ const DROPMASK uint32 = COEFMASK >> 10
+
+ exp := int32(((u32 & EXPMASK) >> EXPSHIFT) - EXPBIAS)
+ coef := u32 & COEFMASK
+
+ if exp == 128 {
+ // +- infinity or NaN
+ // apps may want to do extra checks for NaN separately
+ return PrecisionExact
+ }
+
+ // https://en.wikipedia.org/wiki/Half-precision_floating-point_format says,
+ // "Decimals between 2^−24 (minimum positive subnormal) and 2^−14 (maximum subnormal): fixed interval 2^−24"
+ if exp < -24 {
+ return PrecisionUnderflow
+ }
+ if exp > 15 {
+ return PrecisionOverflow
+ }
+ if (coef & DROPMASK) != uint32(0) {
+ // these include subnormals and non-subnormals that dropped bits
+ return PrecisionInexact
+ }
+
+ if exp < -14 {
+ // Subnormals. Caller may want to test these further.
+ // There are 2046 subnormals that can successfully round-trip f32->f16->f32
+ // and 20 of those 2046 have 32-bit input coef == 0.
+ // RFC 7049 and 7049bis Draft 12 don't precisely define "preserves value"
+ // so some protocols and libraries will choose to handle subnormals differently
+ // when deciding to encode them to CBOR float32 vs float16.
+ return PrecisionUnknown
+ }
+
+ return PrecisionExact
+}
+
+// Frombits returns the float16 number corresponding to the IEEE 754 binary16
+// representation u16, with the sign bit of u16 and the result in the same bit
+// position. Frombits(Bits(x)) == x.
+func Frombits(u16 uint16) Float16 {
+ return Float16(u16)
+}
+
+// Fromfloat32 returns a Float16 value converted from f32. Conversion uses
+// IEEE default rounding (nearest int, with ties to even).
+func Fromfloat32(f32 float32) Float16 {
+ return Float16(f32bitsToF16bits(math.Float32bits(f32)))
+}
+
+// ErrInvalidNaNValue indicates a NaN was not received.
+const ErrInvalidNaNValue = float16Error("float16: invalid NaN value, expected IEEE 754 NaN")
+
+type float16Error string
+
+func (e float16Error) Error() string { return string(e) }
+
+// FromNaN32ps converts nan to IEEE binary16 NaN while preserving both
+// signaling and payload. Unlike Fromfloat32(), which can only return
+// qNaN because it sets quiet bit = 1, this can return both sNaN and qNaN.
+// If the result is infinity (sNaN with empty payload), then the
+// lowest bit of payload is set to make the result a NaN.
+// Returns ErrInvalidNaNValue and 0x7c01 (sNaN) if nan isn't IEEE 754 NaN.
+// This function was kept simple to be able to inline.
+func FromNaN32ps(nan float32) (Float16, error) {
+ const SNAN = Float16(uint16(0x7c01)) // signalling NaN
+
+ u32 := math.Float32bits(nan)
+ sign := u32 & 0x80000000
+ exp := u32 & 0x7f800000
+ coef := u32 & 0x007fffff
+
+ if (exp != 0x7f800000) || (coef == 0) {
+ return SNAN, ErrInvalidNaNValue
+ }
+
+ u16 := uint16((sign >> 16) | uint32(0x7c00) | (coef >> 13))
+
+ if (u16 & 0x03ff) == 0 {
+ // result became infinity, make it NaN by setting lowest bit in payload
+ u16 = u16 | 0x0001
+ }
+
+ return Float16(u16), nil
+}
+
+// NaN returns a Float16 of IEEE 754 binary16 not-a-number (NaN).
+// Returned NaN value 0x7e01 has all exponent bits = 1 with the
+// first and last bits = 1 in the significand. This is consistent
+// with Go's 64-bit math.NaN(). Canonical CBOR in RFC 7049 uses 0x7e00.
+func NaN() Float16 {
+ return Float16(0x7e01)
+}
+
+// Inf returns a Float16 with an infinity value with the specified sign.
+// A sign >= returns positive infinity.
+// A sign < 0 returns negative infinity.
+func Inf(sign int) Float16 {
+ if sign >= 0 {
+ return Float16(0x7c00)
+ }
+ return Float16(0x8000 | 0x7c00)
+}
+
+// Float32 returns a float32 converted from f (Float16).
+// This is a lossless conversion.
+func (f Float16) Float32() float32 {
+ u32 := f16bitsToF32bits(uint16(f))
+ return math.Float32frombits(u32)
+}
+
+// Bits returns the IEEE 754 binary16 representation of f, with the sign bit
+// of f and the result in the same bit position. Bits(Frombits(x)) == x.
+func (f Float16) Bits() uint16 {
+ return uint16(f)
+}
+
+// IsNaN reports whether f is an IEEE 754 binary16 “not-a-number” value.
+func (f Float16) IsNaN() bool {
+ return (f&0x7c00 == 0x7c00) && (f&0x03ff != 0)
+}
+
+// IsQuietNaN reports whether f is a quiet (non-signaling) IEEE 754 binary16
+// “not-a-number” value.
+func (f Float16) IsQuietNaN() bool {
+ return (f&0x7c00 == 0x7c00) && (f&0x03ff != 0) && (f&0x0200 != 0)
+}
+
+// IsInf reports whether f is an infinity (inf).
+// A sign > 0 reports whether f is positive inf.
+// A sign < 0 reports whether f is negative inf.
+// A sign == 0 reports whether f is either inf.
+func (f Float16) IsInf(sign int) bool {
+ return ((f == 0x7c00) && sign >= 0) ||
+ (f == 0xfc00 && sign <= 0)
+}
+
+// IsFinite returns true if f is neither infinite nor NaN.
+func (f Float16) IsFinite() bool {
+ return (uint16(f) & uint16(0x7c00)) != uint16(0x7c00)
+}
+
+// IsNormal returns true if f is neither zero, infinite, subnormal, or NaN.
+func (f Float16) IsNormal() bool {
+ exp := uint16(f) & uint16(0x7c00)
+ return (exp != uint16(0x7c00)) && (exp != 0)
+}
+
+// Signbit reports whether f is negative or negative zero.
+func (f Float16) Signbit() bool {
+ return (uint16(f) & uint16(0x8000)) != 0
+}
+
+// String satisfies the fmt.Stringer interface.
+func (f Float16) String() string {
+ return strconv.FormatFloat(float64(f.Float32()), 'f', -1, 32)
+}
+
+// f16bitsToF32bits returns uint32 (float32 bits) converted from specified uint16.
+func f16bitsToF32bits(in uint16) uint32 {
+ // All 65536 conversions with this were confirmed to be correct
+ // by Montgomery Edwards⁴⁴⁸ (github.com/x448).
+
+ sign := uint32(in&0x8000) << 16 // sign for 32-bit
+ exp := uint32(in&0x7c00) >> 10 // exponenent for 16-bit
+ coef := uint32(in&0x03ff) << 13 // significand for 32-bit
+
+ if exp == 0x1f {
+ if coef == 0 {
+ // infinity
+ return sign | 0x7f800000 | coef
+ }
+ // NaN
+ return sign | 0x7fc00000 | coef
+ }
+
+ if exp == 0 {
+ if coef == 0 {
+ // zero
+ return sign
+ }
+
+ // normalize subnormal numbers
+ exp++
+ for coef&0x7f800000 == 0 {
+ coef <<= 1
+ exp--
+ }
+ coef &= 0x007fffff
+ }
+
+ return sign | ((exp + (0x7f - 0xf)) << 23) | coef
+}
+
+// f32bitsToF16bits returns uint16 (Float16 bits) converted from the specified float32.
+// Conversion rounds to nearest integer with ties to even.
+func f32bitsToF16bits(u32 uint32) uint16 {
+ // Translated from Rust to Go by Montgomery Edwards⁴⁴⁸ (github.com/x448).
+ // All 4294967296 conversions with this were confirmed to be correct by x448.
+ // Original Rust implementation is by Kathryn Long (github.com/starkat99) with MIT license.
+
+ sign := u32 & 0x80000000
+ exp := u32 & 0x7f800000
+ coef := u32 & 0x007fffff
+
+ if exp == 0x7f800000 {
+ // NaN or Infinity
+ nanBit := uint32(0)
+ if coef != 0 {
+ nanBit = uint32(0x0200)
+ }
+ return uint16((sign >> 16) | uint32(0x7c00) | nanBit | (coef >> 13))
+ }
+
+ halfSign := sign >> 16
+
+ unbiasedExp := int32(exp>>23) - 127
+ halfExp := unbiasedExp + 15
+
+ if halfExp >= 0x1f {
+ return uint16(halfSign | uint32(0x7c00))
+ }
+
+ if halfExp <= 0 {
+ if 14-halfExp > 24 {
+ return uint16(halfSign)
+ }
+ coef := coef | uint32(0x00800000)
+ halfCoef := coef >> uint32(14-halfExp)
+ roundBit := uint32(1) << uint32(13-halfExp)
+ if (coef&roundBit) != 0 && (coef&(3*roundBit-1)) != 0 {
+ halfCoef++
+ }
+ return uint16(halfSign | halfCoef)
+ }
+
+ uHalfExp := uint32(halfExp) << 10
+ halfCoef := coef >> 13
+ roundBit := uint32(0x00001000)
+ if (coef&roundBit) != 0 && (coef&(3*roundBit-1)) != 0 {
+ return uint16((halfSign | uHalfExp | halfCoef) + 1)
+ }
+ return uint16(halfSign | uHalfExp | halfCoef)
+}
diff --git a/vendor/go.etcd.io/etcd/api/v3/version/version.go b/vendor/go.etcd.io/etcd/api/v3/version/version.go
index 52be9f964f6..6b5177fc3ce 100644
--- a/vendor/go.etcd.io/etcd/api/v3/version/version.go
+++ b/vendor/go.etcd.io/etcd/api/v3/version/version.go
@@ -26,7 +26,7 @@ import (
var (
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
MinClusterVersion = "3.0.0"
- Version = "3.5.11"
+ Version = "3.5.14"
APIVersion = "unknown"
// Git SHA Value will be set during build
diff --git a/vendor/go.etcd.io/etcd/client/v3/client.go b/vendor/go.etcd.io/etcd/client/v3/client.go
index efa44e8902d..312d03e7a62 100644
--- a/vendor/go.etcd.io/etcd/client/v3/client.go
+++ b/vendor/go.etcd.io/etcd/client/v3/client.go
@@ -86,7 +86,7 @@ func New(cfg Config) (*Client, error) {
// service interface implementations and do not need connection management.
func NewCtxClient(ctx context.Context, opts ...Option) *Client {
cctx, cancel := context.WithCancel(ctx)
- c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex)}
+ c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex), mu: new(sync.RWMutex)}
for _, opt := range opts {
opt(c)
}
@@ -231,15 +231,30 @@ func (c *Client) dialSetupOpts(creds grpccredentials.TransportCredentials, dopts
opts = append(opts, grpc.WithInsecure())
}
+ unaryMaxRetries := defaultUnaryMaxRetries
+ if c.cfg.MaxUnaryRetries > 0 {
+ unaryMaxRetries = c.cfg.MaxUnaryRetries
+ }
+
+ backoffWaitBetween := defaultBackoffWaitBetween
+ if c.cfg.BackoffWaitBetween > 0 {
+ backoffWaitBetween = c.cfg.BackoffWaitBetween
+ }
+
+ backoffJitterFraction := defaultBackoffJitterFraction
+ if c.cfg.BackoffJitterFraction > 0 {
+ backoffJitterFraction = c.cfg.BackoffJitterFraction
+ }
+
// Interceptor retry and backoff.
// TODO: Replace all of clientv3/retry.go with RetryPolicy:
// https://github.com/grpc/grpc-proto/blob/cdd9ed5c3d3f87aef62f373b93361cf7bddc620d/grpc/service_config/service_config.proto#L130
- rrBackoff := withBackoff(c.roundRobinQuorumBackoff(defaultBackoffWaitBetween, defaultBackoffJitterFraction))
+ rrBackoff := withBackoff(c.roundRobinQuorumBackoff(backoffWaitBetween, backoffJitterFraction))
opts = append(opts,
// Disable stream retry by default since go-grpc-middleware/retry does not support client streams.
// Streams that are safe to retry are enabled individually.
grpc.WithStreamInterceptor(c.streamClientInterceptor(withMax(0), rrBackoff)),
- grpc.WithUnaryInterceptor(c.unaryClientInterceptor(withMax(defaultUnaryMaxRetries), rrBackoff)),
+ grpc.WithUnaryInterceptor(c.unaryClientInterceptor(withMax(unaryMaxRetries), rrBackoff)),
)
return opts, nil
diff --git a/vendor/go.etcd.io/etcd/client/v3/config.go b/vendor/go.etcd.io/etcd/client/v3/config.go
index 335a288732b..6f5b41978d3 100644
--- a/vendor/go.etcd.io/etcd/client/v3/config.go
+++ b/vendor/go.etcd.io/etcd/client/v3/config.go
@@ -88,5 +88,14 @@ type Config struct {
// PermitWithoutStream when set will allow client to send keepalive pings to server without any active streams(RPCs).
PermitWithoutStream bool `json:"permit-without-stream"`
+ // MaxUnaryRetries is the maximum number of retries for unary RPCs.
+ MaxUnaryRetries uint `json:"max-unary-retries"`
+
+ // BackoffWaitBetween is the wait time before retrying an RPC.
+ BackoffWaitBetween time.Duration `json:"backoff-wait-between"`
+
+ // BackoffJitterFraction is the jitter fraction to randomize backoff wait time.
+ BackoffJitterFraction float64 `json:"backoff-jitter-fraction"`
+
// TODO: support custom balancer picker
}
diff --git a/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go b/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go
index 7dc5ddae0fd..8c50dcfa93d 100644
--- a/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go
+++ b/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go
@@ -19,6 +19,7 @@ package clientv3
import (
"context"
+ "errors"
"io"
"sync"
"time"
@@ -85,7 +86,7 @@ func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClien
}
continue
}
- if !isSafeRetry(c.lg, lastErr, callOpts) {
+ if !isSafeRetry(c, lastErr, callOpts) {
return lastErr
}
}
@@ -279,7 +280,7 @@ func (s *serverStreamingRetryingStream) receiveMsgAndIndicateRetry(m interface{}
return true, err
}
- return isSafeRetry(s.client.lg, err, s.callOpts), err
+ return isSafeRetry(s.client, err, s.callOpts), err
}
func (s *serverStreamingRetryingStream) reestablishStreamAndResendBuffer(callCtx context.Context) (grpc.ClientStream, error) {
@@ -319,17 +320,28 @@ func waitRetryBackoff(ctx context.Context, attempt uint, callOpts *options) erro
}
// isSafeRetry returns "true", if request is safe for retry with the given error.
-func isSafeRetry(lg *zap.Logger, err error, callOpts *options) bool {
+func isSafeRetry(c *Client, err error, callOpts *options) bool {
if isContextError(err) {
return false
}
+
+ // Situation when learner refuses RPC it is supposed to not serve is from the server
+ // perspective not retryable.
+ // But for backward-compatibility reasons we need to support situation that
+ // customer provides mix of learners (not yet voters) and voters with an
+ // expectation to pick voter in the next attempt.
+ // TODO: Ideally client should be 'aware' which endpoint represents: leader/voter/learner with high probability.
+ if errors.Is(err, rpctypes.ErrGPRCNotSupportedForLearner) && len(c.Endpoints()) > 1 {
+ return true
+ }
+
switch callOpts.retryPolicy {
case repeatable:
return isSafeRetryImmutableRPC(err)
case nonRepeatable:
return isSafeRetryMutableRPC(err)
default:
- lg.Warn("unrecognized retry policy", zap.String("retryPolicy", callOpts.retryPolicy.String()))
+ c.lg.Warn("unrecognized retry policy", zap.String("retryPolicy", callOpts.retryPolicy.String()))
return false
}
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
index 67f8d733999..ab091cf6ade 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
@@ -1,23 +1,15 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
import (
+ "google.golang.org/grpc/stats"
+
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/metric/noop"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"go.opentelemetry.io/otel/trace"
@@ -30,18 +22,26 @@ const (
GRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
)
-// Filter is a predicate used to determine whether a given request in
-// interceptor info should be traced. A Filter must return true if
+// InterceptorFilter is a predicate used to determine whether a given request in
+// interceptor info should be instrumented. A InterceptorFilter must return true if
// the request should be traced.
-type Filter func(*InterceptorInfo) bool
+//
+// Deprecated: Use stats handlers instead.
+type InterceptorFilter func(*InterceptorInfo) bool
+
+// Filter is a predicate used to determine whether a given request in
+// should be instrumented by the attached RPC tag info.
+// A Filter must return true if the request should be instrumented.
+type Filter func(*stats.RPCTagInfo) bool
// config is a group of options for this instrumentation.
type config struct {
- Filter Filter
- Propagators propagation.TextMapPropagator
- TracerProvider trace.TracerProvider
- MeterProvider metric.MeterProvider
- SpanStartOptions []trace.SpanStartOption
+ Filter Filter
+ InterceptorFilter InterceptorFilter
+ Propagators propagation.TextMapPropagator
+ TracerProvider trace.TracerProvider
+ MeterProvider metric.MeterProvider
+ SpanStartOptions []trace.SpanStartOption
ReceivedEvent bool
SentEvent bool
@@ -89,6 +89,9 @@ func newConfig(opts []Option, role string) *config {
metric.WithUnit("ms"))
if err != nil {
otel.Handle(err)
+ if c.rpcDuration == nil {
+ c.rpcDuration = noop.Float64Histogram{}
+ }
}
c.rpcRequestSize, err = c.meter.Int64Histogram("rpc."+role+".request.size",
@@ -96,6 +99,9 @@ func newConfig(opts []Option, role string) *config {
metric.WithUnit("By"))
if err != nil {
otel.Handle(err)
+ if c.rpcRequestSize == nil {
+ c.rpcRequestSize = noop.Int64Histogram{}
+ }
}
c.rpcResponseSize, err = c.meter.Int64Histogram("rpc."+role+".response.size",
@@ -103,6 +109,9 @@ func newConfig(opts []Option, role string) *config {
metric.WithUnit("By"))
if err != nil {
otel.Handle(err)
+ if c.rpcResponseSize == nil {
+ c.rpcResponseSize = noop.Int64Histogram{}
+ }
}
c.rpcRequestsPerRPC, err = c.meter.Int64Histogram("rpc."+role+".requests_per_rpc",
@@ -110,6 +119,9 @@ func newConfig(opts []Option, role string) *config {
metric.WithUnit("{count}"))
if err != nil {
otel.Handle(err)
+ if c.rpcRequestsPerRPC == nil {
+ c.rpcRequestsPerRPC = noop.Int64Histogram{}
+ }
}
c.rpcResponsesPerRPC, err = c.meter.Int64Histogram("rpc."+role+".responses_per_rpc",
@@ -117,6 +129,9 @@ func newConfig(opts []Option, role string) *config {
metric.WithUnit("{count}"))
if err != nil {
otel.Handle(err)
+ if c.rpcResponsesPerRPC == nil {
+ c.rpcResponsesPerRPC = noop.Int64Histogram{}
+ }
}
return c
@@ -147,15 +162,30 @@ func (o tracerProviderOption) apply(c *config) {
// WithInterceptorFilter returns an Option to use the request filter.
//
// Deprecated: Use stats handlers instead.
-func WithInterceptorFilter(f Filter) Option {
+func WithInterceptorFilter(f InterceptorFilter) Option {
return interceptorFilterOption{f: f}
}
type interceptorFilterOption struct {
- f Filter
+ f InterceptorFilter
}
func (o interceptorFilterOption) apply(c *config) {
+ if o.f != nil {
+ c.InterceptorFilter = o.f
+ }
+}
+
+// WithFilter returns an Option to use the request filter.
+func WithFilter(f Filter) Option {
+ return filterOption{f: f}
+}
+
+type filterOption struct {
+ f Filter
+}
+
+func (o filterOption) apply(c *config) {
if o.f != nil {
c.Filter = o.f
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
index 958dcd87a4c..b8b836b00fb 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otelgrpc is the instrumentation library for [google.golang.org/grpc].
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
index fa015e9ac88..7d5ed058082 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
@@ -18,6 +7,7 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.g
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md
import (
"context"
+ "errors"
"io"
"net"
"strconv"
@@ -59,7 +49,7 @@ var (
)
// UnaryClientInterceptor returns a grpc.UnaryClientInterceptor suitable
-// for use in a grpc.Dial call.
+// for use in a grpc.NewClient call.
//
// Deprecated: Use [NewClientHandler] instead.
func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
@@ -81,7 +71,7 @@ func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
Method: method,
Type: UnaryClient,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
return invoker(ctx, method, req, reply, cc, callOpts...)
}
@@ -125,27 +115,13 @@ func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
}
}
-type streamEventType int
-
-type streamEvent struct {
- Type streamEventType
- Err error
-}
-
-const (
- receiveEndEvent streamEventType = iota
- errorEvent
-)
-
// clientStream wraps around the embedded grpc.ClientStream, and intercepts the RecvMsg and
// SendMsg method call.
type clientStream struct {
grpc.ClientStream
+ desc *grpc.StreamDesc
- desc *grpc.StreamDesc
- events chan streamEvent
- eventsDone chan struct{}
- finished chan error
+ span trace.Span
receivedEvent bool
sentEvent bool
@@ -160,11 +136,11 @@ func (w *clientStream) RecvMsg(m interface{}) error {
err := w.ClientStream.RecvMsg(m)
if err == nil && !w.desc.ServerStreams {
- w.sendStreamEvent(receiveEndEvent, nil)
- } else if err == io.EOF {
- w.sendStreamEvent(receiveEndEvent, nil)
+ w.endSpan(nil)
+ } else if errors.Is(err, io.EOF) {
+ w.endSpan(nil)
} else if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
} else {
w.receivedMessageID++
@@ -186,7 +162,7 @@ func (w *clientStream) SendMsg(m interface{}) error {
}
if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
}
return err
@@ -195,7 +171,7 @@ func (w *clientStream) SendMsg(m interface{}) error {
func (w *clientStream) Header() (metadata.MD, error) {
md, err := w.ClientStream.Header()
if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
}
return md, err
@@ -204,58 +180,36 @@ func (w *clientStream) Header() (metadata.MD, error) {
func (w *clientStream) CloseSend() error {
err := w.ClientStream.CloseSend()
if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
}
return err
}
-func wrapClientStream(ctx context.Context, s grpc.ClientStream, desc *grpc.StreamDesc, cfg *config) *clientStream {
- events := make(chan streamEvent)
- eventsDone := make(chan struct{})
- finished := make(chan error)
-
- go func() {
- defer close(eventsDone)
-
- for {
- select {
- case event := <-events:
- switch event.Type {
- case receiveEndEvent:
- finished <- nil
- return
- case errorEvent:
- finished <- event.Err
- return
- }
- case <-ctx.Done():
- finished <- ctx.Err()
- return
- }
- }
- }()
-
+func wrapClientStream(s grpc.ClientStream, desc *grpc.StreamDesc, span trace.Span, cfg *config) *clientStream {
return &clientStream{
ClientStream: s,
+ span: span,
desc: desc,
- events: events,
- eventsDone: eventsDone,
- finished: finished,
receivedEvent: cfg.ReceivedEvent,
sentEvent: cfg.SentEvent,
}
}
-func (w *clientStream) sendStreamEvent(eventType streamEventType, err error) {
- select {
- case <-w.eventsDone:
- case w.events <- streamEvent{Type: eventType, Err: err}:
+func (w *clientStream) endSpan(err error) {
+ if err != nil {
+ s, _ := status.FromError(err)
+ w.span.SetStatus(codes.Error, s.Message())
+ w.span.SetAttributes(statusCodeAttr(s.Code()))
+ } else {
+ w.span.SetAttributes(statusCodeAttr(grpc_codes.OK))
}
+
+ w.span.End()
}
// StreamClientInterceptor returns a grpc.StreamClientInterceptor suitable
-// for use in a grpc.Dial call.
+// for use in a grpc.NewClient call.
//
// Deprecated: Use [NewClientHandler] instead.
func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
@@ -277,7 +231,7 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
Method: method,
Type: StreamClient,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
return streamer(ctx, desc, cc, method, callOpts...)
}
@@ -306,22 +260,7 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
span.End()
return s, err
}
- stream := wrapClientStream(ctx, s, desc, cfg)
-
- go func() {
- err := <-stream.finished
-
- if err != nil {
- s, _ := status.FromError(err)
- span.SetStatus(codes.Error, s.Message())
- span.SetAttributes(statusCodeAttr(s.Code()))
- } else {
- span.SetAttributes(statusCodeAttr(grpc_codes.OK))
- }
-
- span.End()
- }()
-
+ stream := wrapClientStream(s, desc, span, cfg)
return stream, nil
}
}
@@ -347,7 +286,7 @@ func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor {
UnaryServerInfo: info,
Type: UnaryServer,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
return handler(ctx, req)
}
@@ -391,9 +330,11 @@ func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor {
grpcStatusCodeAttr := statusCodeAttr(s.Code())
span.SetAttributes(grpcStatusCodeAttr)
- elapsedTime := time.Since(before).Milliseconds()
+ // Use floating point division here for higher precision (instead of Millisecond method).
+ elapsedTime := float64(time.Since(before)) / float64(time.Millisecond)
+
metricAttrs = append(metricAttrs, grpcStatusCodeAttr)
- cfg.rpcDuration.Record(ctx, float64(elapsedTime), metric.WithAttributes(metricAttrs...))
+ cfg.rpcDuration.Record(ctx, elapsedTime, metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
return resp, err
}
@@ -471,7 +412,7 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
StreamServerInfo: info,
Type: StreamServer,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
return handler(srv, wrapServerStream(ctx, ss, cfg))
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
index f6116946bfd..b62f7cd7c46 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
index cf32a9e978c..bef07b7a3ca 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
index f585fb6ae0c..3aa37915df2 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
index b65fab308f3..409c621b74c 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
index 0211e55e003..201867a8694 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
@@ -20,6 +9,7 @@ import (
"time"
grpc_codes "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/peer"
"google.golang.org/grpc/stats"
"google.golang.org/grpc/status"
@@ -37,13 +27,14 @@ type gRPCContext struct {
messagesReceived int64
messagesSent int64
metricAttrs []attribute.KeyValue
+ record bool
}
type serverHandler struct {
*config
}
-// NewServerHandler creates a stats.Handler for gRPC server.
+// NewServerHandler creates a stats.Handler for a gRPC server.
func NewServerHandler(opts ...Option) stats.Handler {
h := &serverHandler{
config: newConfig(opts, "server"),
@@ -54,9 +45,6 @@ func NewServerHandler(opts ...Option) stats.Handler {
// TagConn can attach some information to the given context.
func (h *serverHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context {
- span := trace.SpanFromContext(ctx)
- attrs := peerAttr(peerFromCtx(ctx))
- span.SetAttributes(attrs...)
return ctx
}
@@ -79,20 +67,25 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont
gctx := gRPCContext{
metricAttrs: attrs,
+ record: true,
+ }
+ if h.config.Filter != nil {
+ gctx.record = h.config.Filter(info)
}
return context.WithValue(ctx, gRPCContextKey{}, &gctx)
}
// HandleRPC processes the RPC stats.
func (h *serverHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
- h.handleRPC(ctx, rs)
+ isServer := true
+ h.handleRPC(ctx, rs, isServer)
}
type clientHandler struct {
*config
}
-// NewClientHandler creates a stats.Handler for gRPC client.
+// NewClientHandler creates a stats.Handler for a gRPC client.
func NewClientHandler(opts ...Option) stats.Handler {
h := &clientHandler{
config: newConfig(opts, "client"),
@@ -114,6 +107,10 @@ func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont
gctx := gRPCContext{
metricAttrs: attrs,
+ record: true,
+ }
+ if h.config.Filter != nil {
+ gctx.record = h.config.Filter(info)
}
return inject(context.WithValue(ctx, gRPCContextKey{}, &gctx), h.config.Propagators)
@@ -121,14 +118,12 @@ func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont
// HandleRPC processes the RPC stats.
func (h *clientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
- h.handleRPC(ctx, rs)
+ isServer := false
+ h.handleRPC(ctx, rs, isServer)
}
// TagConn can attach some information to the given context.
-func (h *clientHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context {
- span := trace.SpanFromContext(ctx)
- attrs := peerAttr(cti.RemoteAddr.String())
- span.SetAttributes(attrs...)
+func (h *clientHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context {
return ctx
}
@@ -137,20 +132,26 @@ func (h *clientHandler) HandleConn(context.Context, stats.ConnStats) {
// no-op
}
-func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats) {
+func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats, isServer bool) { // nolint: revive // isServer is not a control flag.
span := trace.SpanFromContext(ctx)
- gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext)
+ var metricAttrs []attribute.KeyValue
var messageId int64
- metricAttrs := make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1)
- metricAttrs = append(metricAttrs, gctx.metricAttrs...)
- wctx := withoutCancel(ctx)
+
+ gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext)
+ if gctx != nil {
+ if !gctx.record {
+ return
+ }
+ metricAttrs = make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1)
+ metricAttrs = append(metricAttrs, gctx.metricAttrs...)
+ }
switch rs := rs.(type) {
case *stats.Begin:
case *stats.InPayload:
if gctx != nil {
messageId = atomic.AddInt64(&gctx.messagesReceived, 1)
- c.rpcRequestSize.Record(wctx, int64(rs.Length), metric.WithAttributes(metricAttrs...))
+ c.rpcRequestSize.Record(ctx, int64(rs.Length), metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
}
if c.ReceivedEvent {
@@ -166,7 +167,7 @@ func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats) {
case *stats.OutPayload:
if gctx != nil {
messageId = atomic.AddInt64(&gctx.messagesSent, 1)
- c.rpcResponseSize.Record(wctx, int64(rs.Length), metric.WithAttributes(metricAttrs...))
+ c.rpcResponseSize.Record(ctx, int64(rs.Length), metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
}
if c.SentEvent {
@@ -180,12 +181,21 @@ func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats) {
)
}
case *stats.OutTrailer:
+ case *stats.OutHeader:
+ if p, ok := peer.FromContext(ctx); ok {
+ span.SetAttributes(peerAttr(p.Addr.String())...)
+ }
case *stats.End:
var rpcStatusAttr attribute.KeyValue
if rs.Error != nil {
s, _ := status.FromError(rs.Error)
- span.SetStatus(codes.Error, s.Message())
+ if isServer {
+ statusCode, msg := serverStatus(s)
+ span.SetStatus(statusCode, msg)
+ } else {
+ span.SetStatus(codes.Error, s.Message())
+ }
rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(s.Code()))
} else {
rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(grpc_codes.OK))
@@ -194,42 +204,19 @@ func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats) {
span.End()
metricAttrs = append(metricAttrs, rpcStatusAttr)
- c.rpcDuration.Record(wctx, float64(rs.EndTime.Sub(rs.BeginTime)), metric.WithAttributes(metricAttrs...))
- c.rpcRequestsPerRPC.Record(wctx, gctx.messagesReceived, metric.WithAttributes(metricAttrs...))
- c.rpcResponsesPerRPC.Record(wctx, gctx.messagesSent, metric.WithAttributes(metricAttrs...))
+ // Allocate vararg slice once.
+ recordOpts := []metric.RecordOption{metric.WithAttributeSet(attribute.NewSet(metricAttrs...))}
+
+ // Use floating point division here for higher precision (instead of Millisecond method).
+ // Measure right before calling Record() to capture as much elapsed time as possible.
+ elapsedTime := float64(rs.EndTime.Sub(rs.BeginTime)) / float64(time.Millisecond)
+ c.rpcDuration.Record(ctx, elapsedTime, recordOpts...)
+ if gctx != nil {
+ c.rpcRequestsPerRPC.Record(ctx, atomic.LoadInt64(&gctx.messagesReceived), recordOpts...)
+ c.rpcResponsesPerRPC.Record(ctx, atomic.LoadInt64(&gctx.messagesSent), recordOpts...)
+ }
default:
return
}
}
-
-func withoutCancel(parent context.Context) context.Context {
- if parent == nil {
- panic("cannot create context from nil parent")
- }
- return withoutCancelCtx{parent}
-}
-
-type withoutCancelCtx struct {
- c context.Context
-}
-
-func (withoutCancelCtx) Deadline() (deadline time.Time, ok bool) {
- return
-}
-
-func (withoutCancelCtx) Done() <-chan struct{} {
- return nil
-}
-
-func (withoutCancelCtx) Err() error {
- return nil
-}
-
-func (w withoutCancelCtx) Value(key any) any {
- return w.c.Value(key)
-}
-
-func (w withoutCancelCtx) String() string {
- return "withoutCancel"
-}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
index 5c13a7ceab4..a15d06cb0c4 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
@@ -1,22 +1,11 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
// Version is the current release version of the gRPC instrumentation.
func Version() string {
- return "0.46.0"
+ return "0.53.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
index 92b8cf73c97..6aae83bfd20 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -23,7 +12,7 @@ import (
)
// DefaultClient is the default Client and is used by Get, Head, Post and PostForm.
-// Please be careful of intitialization order - for example, if you change
+// Please be careful of initialization order - for example, if you change
// the global propagator, the DefaultClient might still be using the old one.
var DefaultClient = &http.Client{Transport: NewTransport(http.DefaultTransport)}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
index 9509014e87c..214acaf581e 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -31,10 +20,16 @@ const (
// Server HTTP metrics.
const (
- RequestCount = "http.server.request_count" // Incoming request count total
- RequestContentLength = "http.server.request_content_length" // Incoming request bytes total
- ResponseContentLength = "http.server.response_content_length" // Incoming response bytes total
- ServerLatency = "http.server.duration" // Incoming end to end duration, milliseconds
+ serverRequestSize = "http.server.request.size" // Incoming request bytes total
+ serverResponseSize = "http.server.response.size" // Incoming response bytes total
+ serverDuration = "http.server.duration" // Incoming end to end duration, milliseconds
+)
+
+// Client HTTP metrics.
+const (
+ clientRequestSize = "http.client.request.size" // Outgoing request bytes total
+ clientResponseSize = "http.client.response.size" // Outgoing response bytes total
+ clientDuration = "http.client.duration" // Outgoing end to end duration, milliseconds
)
// Filter is a predicate used to determine whether a given http.request should
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
index a1b5b5e5aa8..f0a9bb9efeb 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -111,7 +100,7 @@ func WithPublicEndpoint() Option {
})
}
-// WithPublicEndpointFn runs with every request, and allows conditionnally
+// WithPublicEndpointFn runs with every request, and allows conditionally
// configuring the Handler to link the span with an incoming span context. If
// this option is not provided or returns false, then the association is a
// child association instead of a link.
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
index 38c7f01c71a..56b24b982ae 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package otelhttp provides an http.Handler and functions that are intended
// to be used to add tracing by wrapping existing handlers (with Handler) and
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
index 9a8260059d9..d01bdccf40d 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
@@ -1,32 +1,20 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
import (
- "io"
"net/http"
"time"
"github.com/felixge/httpsnoop"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"go.opentelemetry.io/otel/trace"
)
@@ -43,10 +31,13 @@ type middleware struct {
writeEvent bool
filters []Filter
spanNameFormatter func(string, *http.Request) string
- counters map[string]metric.Int64Counter
- valueRecorders map[string]metric.Float64Histogram
publicEndpoint bool
publicEndpointFn func(*http.Request) bool
+
+ traceSemconv semconv.HTTPServer
+ requestBytesCounter metric.Int64Counter
+ responseBytesCounter metric.Int64Counter
+ serverLatencyMeasure metric.Float64Histogram
}
func defaultHandlerFormatter(operation string, _ *http.Request) string {
@@ -65,6 +56,8 @@ func NewHandler(handler http.Handler, operation string, opts ...Option) http.Han
func NewMiddleware(operation string, opts ...Option) func(http.Handler) http.Handler {
h := middleware{
operation: operation,
+
+ traceSemconv: semconv.NewHTTPServer(),
}
defaultOpts := []Option{
@@ -104,33 +97,27 @@ func handleErr(err error) {
}
func (h *middleware) createMeasures() {
- h.counters = make(map[string]metric.Int64Counter)
- h.valueRecorders = make(map[string]metric.Float64Histogram)
-
- requestBytesCounter, err := h.meter.Int64Counter(
- RequestContentLength,
+ var err error
+ h.requestBytesCounter, err = h.meter.Int64Counter(
+ serverRequestSize,
metric.WithUnit("By"),
- metric.WithDescription("Measures the size of HTTP request content length (uncompressed)"),
+ metric.WithDescription("Measures the size of HTTP request messages."),
)
handleErr(err)
- responseBytesCounter, err := h.meter.Int64Counter(
- ResponseContentLength,
+ h.responseBytesCounter, err = h.meter.Int64Counter(
+ serverResponseSize,
metric.WithUnit("By"),
- metric.WithDescription("Measures the size of HTTP response content length (uncompressed)"),
+ metric.WithDescription("Measures the size of HTTP response messages."),
)
handleErr(err)
- serverLatencyMeasure, err := h.meter.Float64Histogram(
- ServerLatency,
+ h.serverLatencyMeasure, err = h.meter.Float64Histogram(
+ serverDuration,
metric.WithUnit("ms"),
- metric.WithDescription("Measures the duration of HTTP request handling"),
+ metric.WithDescription("Measures the duration of inbound HTTP requests."),
)
handleErr(err)
-
- h.counters[RequestContentLength] = requestBytesCounter
- h.counters[ResponseContentLength] = responseBytesCounter
- h.valueRecorders[ServerLatency] = serverLatencyMeasure
}
// serveHTTP sets up tracing and calls the given next http.Handler with the span
@@ -147,12 +134,9 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header))
opts := []trace.SpanStartOption{
- trace.WithAttributes(semconvutil.HTTPServerRequest(h.server, r)...),
- }
- if h.server != "" {
- hostAttr := semconv.NetHostName(h.server)
- opts = append(opts, trace.WithAttributes(hostAttr))
+ trace.WithAttributes(h.traceSemconv.RequestTraceAttrs(h.server, r)...),
}
+
opts = append(opts, h.spanStartOptions...)
if h.publicEndpoint || (h.publicEndpointFn != nil && h.publicEndpointFn(r.WithContext(ctx))) {
opts = append(opts, trace.WithNewRoot())
@@ -221,61 +205,48 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
WriteHeader: func(httpsnoop.WriteHeaderFunc) httpsnoop.WriteHeaderFunc {
return rww.WriteHeader
},
+ Flush: func(httpsnoop.FlushFunc) httpsnoop.FlushFunc {
+ return rww.Flush
+ },
})
- labeler := &Labeler{}
- ctx = injectLabeler(ctx, labeler)
+ labeler, found := LabelerFromContext(ctx)
+ if !found {
+ ctx = ContextWithLabeler(ctx, labeler)
+ }
next.ServeHTTP(w, r.WithContext(ctx))
- setAfterServeAttributes(span, bw.read, rww.written, rww.statusCode, bw.err, rww.err)
+ span.SetStatus(semconv.ServerStatus(rww.statusCode))
+ span.SetAttributes(h.traceSemconv.ResponseTraceAttrs(semconv.ResponseTelemetry{
+ StatusCode: rww.statusCode,
+ ReadBytes: bw.read.Load(),
+ ReadError: bw.err,
+ WriteBytes: rww.written,
+ WriteError: rww.err,
+ })...)
// Add metrics
attributes := append(labeler.Get(), semconvutil.HTTPServerRequestMetrics(h.server, r)...)
if rww.statusCode > 0 {
attributes = append(attributes, semconv.HTTPStatusCode(rww.statusCode))
}
- o := metric.WithAttributes(attributes...)
- h.counters[RequestContentLength].Add(ctx, bw.read, o)
- h.counters[ResponseContentLength].Add(ctx, rww.written, o)
+ o := metric.WithAttributeSet(attribute.NewSet(attributes...))
+ addOpts := []metric.AddOption{o} // Allocate vararg slice once.
+ h.requestBytesCounter.Add(ctx, bw.read.Load(), addOpts...)
+ h.responseBytesCounter.Add(ctx, rww.written, addOpts...)
// Use floating point division here for higher precision (instead of Millisecond method).
elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond)
- h.valueRecorders[ServerLatency].Record(ctx, elapsedTime, o)
-}
-
-func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, rerr, werr error) {
- attributes := []attribute.KeyValue{}
-
- // TODO: Consider adding an event after each read and write, possibly as an
- // option (defaulting to off), so as to not create needlessly verbose spans.
- if read > 0 {
- attributes = append(attributes, ReadBytesKey.Int64(read))
- }
- if rerr != nil && rerr != io.EOF {
- attributes = append(attributes, ReadErrorKey.String(rerr.Error()))
- }
- if wrote > 0 {
- attributes = append(attributes, WroteBytesKey.Int64(wrote))
- }
- if statusCode > 0 {
- attributes = append(attributes, semconv.HTTPStatusCode(statusCode))
- }
- span.SetStatus(semconvutil.HTTPServerStatus(statusCode))
-
- if werr != nil && werr != io.EOF {
- attributes = append(attributes, WriteErrorKey.String(werr.Error()))
- }
- span.SetAttributes(attributes...)
+ h.serverLatencyMeasure.Record(ctx, elapsedTime, o)
}
// WithRouteTag annotates spans and metrics with the provided route name
// with HTTP route attribute.
func WithRouteTag(route string, h http.Handler) http.Handler {
+ attr := semconv.NewHTTPServer().Route(route)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- attr := semconv.HTTPRouteKey.String(route)
-
span := trace.SpanFromContext(r.Context())
span.SetAttributes(attr)
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
new file mode 100644
index 00000000000..3ec0ad00c81
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
@@ -0,0 +1,82 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "fmt"
+ "net/http"
+ "os"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+)
+
+type ResponseTelemetry struct {
+ StatusCode int
+ ReadBytes int64
+ ReadError error
+ WriteBytes int64
+ WriteError error
+}
+
+type HTTPServer struct {
+ duplicate bool
+}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (s HTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ if s.duplicate {
+ return append(oldHTTPServer{}.RequestTraceAttrs(server, req), newHTTPServer{}.RequestTraceAttrs(server, req)...)
+ }
+ return oldHTTPServer{}.RequestTraceAttrs(server, req)
+}
+
+// ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (s HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ if s.duplicate {
+ return append(oldHTTPServer{}.ResponseTraceAttrs(resp), newHTTPServer{}.ResponseTraceAttrs(resp)...)
+ }
+ return oldHTTPServer{}.ResponseTraceAttrs(resp)
+}
+
+// Route returns the attribute for the route.
+func (s HTTPServer) Route(route string) attribute.KeyValue {
+ return oldHTTPServer{}.Route(route)
+}
+
+func NewHTTPServer() HTTPServer {
+ env := strings.ToLower(os.Getenv("OTEL_HTTP_CLIENT_COMPATIBILITY_MODE"))
+ return HTTPServer{duplicate: env == "http/dup"}
+}
+
+// ServerStatus returns a span status code and message for an HTTP status code
+// value returned by a server. Status codes in the 400-499 range are not
+// returned as errors.
+func ServerStatus(code int) (codes.Code, string) {
+ if code < 100 || code >= 600 {
+ return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code)
+ }
+ if code >= 500 {
+ return codes.Error, ""
+ }
+ return codes.Unset, ""
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
new file mode 100644
index 00000000000..e7f293761bd
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
@@ -0,0 +1,91 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "net"
+ "net/http"
+ "strconv"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ semconvNew "go.opentelemetry.io/otel/semconv/v1.24.0"
+)
+
+// splitHostPort splits a network address hostport of the form "host",
+// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port",
+// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and
+// port.
+//
+// An empty host is returned if it is not provided or unparsable. A negative
+// port is returned if it is not provided or unparsable.
+func splitHostPort(hostport string) (host string, port int) {
+ port = -1
+
+ if strings.HasPrefix(hostport, "[") {
+ addrEnd := strings.LastIndex(hostport, "]")
+ if addrEnd < 0 {
+ // Invalid hostport.
+ return
+ }
+ if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
+ host = hostport[1:addrEnd]
+ return
+ }
+ } else {
+ if i := strings.LastIndex(hostport, ":"); i < 0 {
+ host = hostport
+ return
+ }
+ }
+
+ host, pStr, err := net.SplitHostPort(hostport)
+ if err != nil {
+ return
+ }
+
+ p, err := strconv.ParseUint(pStr, 10, 16)
+ if err != nil {
+ return
+ }
+ return host, int(p)
+}
+
+func requiredHTTPPort(https bool, port int) int { // nolint:revive
+ if https {
+ if port > 0 && port != 443 {
+ return port
+ }
+ } else {
+ if port > 0 && port != 80 {
+ return port
+ }
+ }
+ return -1
+}
+
+func serverClientIP(xForwardedFor string) string {
+ if idx := strings.Index(xForwardedFor, ","); idx >= 0 {
+ xForwardedFor = xForwardedFor[:idx]
+ }
+ return xForwardedFor
+}
+
+func netProtocol(proto string) (name string, version string) {
+ name, version, _ = strings.Cut(proto, "/")
+ name = strings.ToLower(name)
+ return name, version
+}
+
+var methodLookup = map[string]attribute.KeyValue{
+ http.MethodConnect: semconvNew.HTTPRequestMethodConnect,
+ http.MethodDelete: semconvNew.HTTPRequestMethodDelete,
+ http.MethodGet: semconvNew.HTTPRequestMethodGet,
+ http.MethodHead: semconvNew.HTTPRequestMethodHead,
+ http.MethodOptions: semconvNew.HTTPRequestMethodOptions,
+ http.MethodPatch: semconvNew.HTTPRequestMethodPatch,
+ http.MethodPost: semconvNew.HTTPRequestMethodPost,
+ http.MethodPut: semconvNew.HTTPRequestMethodPut,
+ http.MethodTrace: semconvNew.HTTPRequestMethodTrace,
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
new file mode 100644
index 00000000000..c3e838aaa54
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
@@ -0,0 +1,74 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "errors"
+ "io"
+ "net/http"
+
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
+ "go.opentelemetry.io/otel/attribute"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
+)
+
+type oldHTTPServer struct{}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (o oldHTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ return semconvutil.HTTPServerRequest(server, req)
+}
+
+// ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (o oldHTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ attributes := []attribute.KeyValue{}
+
+ if resp.ReadBytes > 0 {
+ attributes = append(attributes, semconv.HTTPRequestContentLength(int(resp.ReadBytes)))
+ }
+ if resp.ReadError != nil && !errors.Is(resp.ReadError, io.EOF) {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.read_error", resp.ReadError.Error()))
+ }
+ if resp.WriteBytes > 0 {
+ attributes = append(attributes, semconv.HTTPResponseContentLength(int(resp.WriteBytes)))
+ }
+ if resp.StatusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCode(resp.StatusCode))
+ }
+ if resp.WriteError != nil && !errors.Is(resp.WriteError, io.EOF) {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.write_error", resp.WriteError.Error()))
+ }
+
+ return attributes
+}
+
+// Route returns the attribute for the route.
+func (o oldHTTPServer) Route(route string) attribute.KeyValue {
+ return semconv.HTTPRoute(route)
+}
+
+// HTTPStatusCode returns the attribute for the HTTP status code.
+// This is a temporary function needed by metrics. This will be removed when MetricsRequest is added.
+func HTTPStatusCode(status int) attribute.KeyValue {
+ return semconv.HTTPStatusCode(status)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.24.0.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.24.0.go
new file mode 100644
index 00000000000..0c5d4c4608a
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.24.0.go
@@ -0,0 +1,197 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "net/http"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ semconvNew "go.opentelemetry.io/otel/semconv/v1.24.0"
+)
+
+type newHTTPServer struct{}
+
+// TraceRequest returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (n newHTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ count := 3 // ServerAddress, Method, Scheme
+
+ var host string
+ var p int
+ if server == "" {
+ host, p = splitHostPort(req.Host)
+ } else {
+ // Prioritize the primary server name.
+ host, p = splitHostPort(server)
+ if p < 0 {
+ _, p = splitHostPort(req.Host)
+ }
+ }
+
+ hostPort := requiredHTTPPort(req.TLS != nil, p)
+ if hostPort > 0 {
+ count++
+ }
+
+ method, methodOriginal := n.method(req.Method)
+ if methodOriginal != (attribute.KeyValue{}) {
+ count++
+ }
+
+ scheme := n.scheme(req.TLS != nil)
+
+ if peer, peerPort := splitHostPort(req.RemoteAddr); peer != "" {
+ // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a
+ // file-path that would be interpreted with a sock family.
+ count++
+ if peerPort > 0 {
+ count++
+ }
+ }
+
+ useragent := req.UserAgent()
+ if useragent != "" {
+ count++
+ }
+
+ clientIP := serverClientIP(req.Header.Get("X-Forwarded-For"))
+ if clientIP != "" {
+ count++
+ }
+
+ if req.URL != nil && req.URL.Path != "" {
+ count++
+ }
+
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" && protoName != "http" {
+ count++
+ }
+ if protoVersion != "" {
+ count++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, count)
+ attrs = append(attrs,
+ semconvNew.ServerAddress(host),
+ method,
+ scheme,
+ )
+
+ if hostPort > 0 {
+ attrs = append(attrs, semconvNew.ServerPort(hostPort))
+ }
+ if methodOriginal != (attribute.KeyValue{}) {
+ attrs = append(attrs, methodOriginal)
+ }
+
+ if peer, peerPort := splitHostPort(req.RemoteAddr); peer != "" {
+ // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a
+ // file-path that would be interpreted with a sock family.
+ attrs = append(attrs, semconvNew.NetworkPeerAddress(peer))
+ if peerPort > 0 {
+ attrs = append(attrs, semconvNew.NetworkPeerPort(peerPort))
+ }
+ }
+
+ if useragent := req.UserAgent(); useragent != "" {
+ attrs = append(attrs, semconvNew.UserAgentOriginal(useragent))
+ }
+
+ if clientIP != "" {
+ attrs = append(attrs, semconvNew.ClientAddress(clientIP))
+ }
+
+ if req.URL != nil && req.URL.Path != "" {
+ attrs = append(attrs, semconvNew.URLPath(req.URL.Path))
+ }
+
+ if protoName != "" && protoName != "http" {
+ attrs = append(attrs, semconvNew.NetworkProtocolName(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, semconvNew.NetworkProtocolVersion(protoVersion))
+ }
+
+ return attrs
+}
+
+func (n newHTTPServer) method(method string) (attribute.KeyValue, attribute.KeyValue) {
+ if method == "" {
+ return semconvNew.HTTPRequestMethodGet, attribute.KeyValue{}
+ }
+ if attr, ok := methodLookup[method]; ok {
+ return attr, attribute.KeyValue{}
+ }
+
+ orig := semconvNew.HTTPRequestMethodOriginal(method)
+ if attr, ok := methodLookup[strings.ToUpper(method)]; ok {
+ return attr, orig
+ }
+ return semconvNew.HTTPRequestMethodGet, orig
+}
+
+func (n newHTTPServer) scheme(https bool) attribute.KeyValue { // nolint:revive
+ if https {
+ return semconvNew.URLScheme("https")
+ }
+ return semconvNew.URLScheme("http")
+}
+
+// TraceResponse returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (n newHTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ var count int
+
+ if resp.ReadBytes > 0 {
+ count++
+ }
+ if resp.WriteBytes > 0 {
+ count++
+ }
+ if resp.StatusCode > 0 {
+ count++
+ }
+
+ attributes := make([]attribute.KeyValue, 0, count)
+
+ if resp.ReadBytes > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPRequestBodySize(int(resp.ReadBytes)),
+ )
+ }
+ if resp.WriteBytes > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPResponseBodySize(int(resp.WriteBytes)),
+ )
+ }
+ if resp.StatusCode > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPResponseStatusCode(resp.StatusCode),
+ )
+ }
+
+ return attributes
+}
+
+// Route returns the attribute for the route.
+func (n newHTTPServer) Route(route string) attribute.KeyValue {
+ return semconvNew.HTTPRoute(route)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
index edf4ce3d315..7aa5f99e815 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
index d3dede9ebbd..a73bb06e90e 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
@@ -2,18 +2,7 @@
// source: internal/shared/semconvutil/httpconv.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
@@ -24,7 +13,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)
// HTTPClientResponse returns trace attributes for an HTTP response received by a
@@ -43,14 +32,22 @@ func HTTPClientResponse(resp *http.Response) []attribute.KeyValue {
}
// HTTPClientRequest returns trace attributes for an HTTP request made by a client.
-// The following attributes are always returned: "http.url", "http.flavor",
-// "http.method", "net.peer.name". The following attributes are returned if the
-// related values are defined in req: "net.peer.port", "http.user_agent",
-// "http.request_content_length", "enduser.id".
+// The following attributes are always returned: "http.url", "http.method",
+// "net.peer.name". The following attributes are returned if the related values
+// are defined in req: "net.peer.port", "user_agent.original",
+// "http.request_content_length".
func HTTPClientRequest(req *http.Request) []attribute.KeyValue {
return hc.ClientRequest(req)
}
+// HTTPClientRequestMetrics returns metric attributes for an HTTP request made by a client.
+// The following attributes are always returned: "http.method", "net.peer.name".
+// The following attributes are returned if the
+// related values are defined in req: "net.peer.port".
+func HTTPClientRequestMetrics(req *http.Request) []attribute.KeyValue {
+ return hc.ClientRequestMetrics(req)
+}
+
// HTTPClientStatus returns a span status code and message for an HTTP status code
// value received by a client.
func HTTPClientStatus(code int) (codes.Code, string) {
@@ -75,10 +72,9 @@ func HTTPClientStatus(code int) (codes.Code, string) {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "http.target", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port",
-// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
-// "http.client_ip".
+// "http.target", "net.host.name". The following attributes are returned if
+// they related values are defined in req: "net.host.port", "net.sock.peer.addr",
+// "net.sock.peer.port", "user_agent.original", "http.client_ip".
func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue {
return hc.ServerRequest(server, req)
}
@@ -101,8 +97,8 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port".
+// "net.host.name". The following attributes are returned if they related
+// values are defined in req: "net.host.port".
func HTTPServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue {
return hc.ServerRequestMetrics(server, req)
}
@@ -114,44 +110,12 @@ func HTTPServerStatus(code int) (codes.Code, string) {
return hc.ServerStatus(code)
}
-// HTTPRequestHeader returns the contents of h as attributes.
-//
-// Instrumentation should require an explicit configuration of which headers to
-// captured and then prune what they pass here. Including all headers can be a
-// security risk - explicit configuration helps avoid leaking sensitive
-// information.
-//
-// The User-Agent header is already captured in the http.user_agent attribute
-// from ClientRequest and ServerRequest. Instrumentation may provide an option
-// to capture that header here even though it is not recommended. Otherwise,
-// instrumentation should filter that out of what is passed.
-func HTTPRequestHeader(h http.Header) []attribute.KeyValue {
- return hc.RequestHeader(h)
-}
-
-// HTTPResponseHeader returns the contents of h as attributes.
-//
-// Instrumentation should require an explicit configuration of which headers to
-// captured and then prune what they pass here. Including all headers can be a
-// security risk - explicit configuration helps avoid leaking sensitive
-// information.
-//
-// The User-Agent header is already captured in the http.user_agent attribute
-// from ClientRequest and ServerRequest. Instrumentation may provide an option
-// to capture that header here even though it is not recommended. Otherwise,
-// instrumentation should filter that out of what is passed.
-func HTTPResponseHeader(h http.Header) []attribute.KeyValue {
- return hc.ResponseHeader(h)
-}
-
// httpConv are the HTTP semantic convention attributes defined for a version
// of the OpenTelemetry specification.
type httpConv struct {
NetConv *netConv
- EnduserIDKey attribute.Key
HTTPClientIPKey attribute.Key
- HTTPFlavorKey attribute.Key
HTTPMethodKey attribute.Key
HTTPRequestContentLengthKey attribute.Key
HTTPResponseContentLengthKey attribute.Key
@@ -161,15 +125,13 @@ type httpConv struct {
HTTPStatusCodeKey attribute.Key
HTTPTargetKey attribute.Key
HTTPURLKey attribute.Key
- HTTPUserAgentKey attribute.Key
+ UserAgentOriginalKey attribute.Key
}
var hc = &httpConv{
NetConv: nc,
- EnduserIDKey: semconv.EnduserIDKey,
HTTPClientIPKey: semconv.HTTPClientIPKey,
- HTTPFlavorKey: semconv.HTTPFlavorKey,
HTTPMethodKey: semconv.HTTPMethodKey,
HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey,
HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey,
@@ -179,7 +141,7 @@ var hc = &httpConv{
HTTPStatusCodeKey: semconv.HTTPStatusCodeKey,
HTTPTargetKey: semconv.HTTPTargetKey,
HTTPURLKey: semconv.HTTPURLKey,
- HTTPUserAgentKey: semconv.HTTPUserAgentKey,
+ UserAgentOriginalKey: semconv.UserAgentOriginalKey,
}
// ClientResponse returns attributes for an HTTP response received by a client
@@ -193,6 +155,10 @@ var hc = &httpConv{
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.status_code int
+ http.response_content_length int
+ */
var n int
if resp.StatusCode > 0 {
n++
@@ -212,11 +178,31 @@ func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
}
// ClientRequest returns attributes for an HTTP request made by a client. The
-// following attributes are always returned: "http.url", "http.flavor",
-// "http.method", "net.peer.name". The following attributes are returned if the
-// related values are defined in req: "net.peer.port", "http.user_agent",
-// "http.request_content_length", "enduser.id".
+// following attributes are always returned: "http.url", "http.method",
+// "net.peer.name". The following attributes are returned if the related values
+// are defined in req: "net.peer.port", "user_agent.original",
+// "http.request_content_length", "user_agent.original".
func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.method string
+ user_agent.original string
+ http.url string
+ net.peer.name string
+ net.peer.port int
+ http.request_content_length int
+ */
+
+ /* The following semantic conventions are not returned:
+ http.status_code This requires the response. See ClientResponse.
+ http.response_content_length This requires the response. See ClientResponse.
+ net.sock.family This requires the socket used.
+ net.sock.peer.addr This requires the socket used.
+ net.sock.peer.name This requires the socket used.
+ net.sock.peer.port This requires the socket used.
+ http.resend_count This is something outside of a single request.
+ net.protocol.name The value is the Request is ignored, and the go client will always use "http".
+ net.protocol.version The value in the Request is ignored, and the go client will always use 1.1 or 2.0.
+ */
n := 3 // URL, peer name, proto, and method.
var h string
if req.URL != nil {
@@ -234,14 +220,10 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
if req.ContentLength > 0 {
n++
}
- userID, _, hasUserID := req.BasicAuth()
- if hasUserID {
- n++
- }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.method(req.Method))
- attrs = append(attrs, c.flavor(req.Proto))
var u string
if req.URL != nil {
@@ -260,15 +242,43 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
}
if useragent != "" {
- attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
+ attrs = append(attrs, c.UserAgentOriginalKey.String(useragent))
}
if l := req.ContentLength; l > 0 {
attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l))
}
- if hasUserID {
- attrs = append(attrs, c.EnduserIDKey.String(userID))
+ return attrs
+}
+
+// ClientRequestMetrics returns metric attributes for an HTTP request made by a client. The
+// following attributes are always returned: "http.method", "net.peer.name".
+// The following attributes are returned if the related values
+// are defined in req: "net.peer.port".
+func (c *httpConv) ClientRequestMetrics(req *http.Request) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.method string
+ net.peer.name string
+ net.peer.port int
+ */
+
+ n := 2 // method, peer name.
+ var h string
+ if req.URL != nil {
+ h = req.URL.Host
+ }
+ peer, p := firstHostPort(h, req.Header.Get("Host"))
+ port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", p)
+ if port > 0 {
+ n++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, n)
+ attrs = append(attrs, c.method(req.Method), c.NetConv.PeerName(peer))
+
+ if port > 0 {
+ attrs = append(attrs, c.NetConv.PeerPort(port))
}
return attrs
@@ -291,18 +301,35 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "http.target", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port",
-// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
-// "http.client_ip".
+// "http.target", "net.host.name". The following attributes are returned if they
+// related values are defined in req: "net.host.port", "net.sock.peer.addr",
+// "net.sock.peer.port", "user_agent.original", "http.client_ip",
+// "net.protocol.name", "net.protocol.version".
func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue {
- // TODO: This currently does not add the specification required
- // `http.target` attribute. It has too high of a cardinality to safely be
- // added. An alternate should be added, or this comment removed, when it is
- // addressed by the specification. If it is ultimately decided to continue
- // not including the attribute, the HTTPTargetKey field of the httpConv
- // should be removed as well.
-
+ /* The following semantic conventions are returned if present:
+ http.method string
+ http.scheme string
+ net.host.name string
+ net.host.port int
+ net.sock.peer.addr string
+ net.sock.peer.port int
+ user_agent.original string
+ http.client_ip string
+ net.protocol.name string Note: not set if the value is "http".
+ net.protocol.version string
+ http.target string Note: doesn't include the query parameter.
+ */
+
+ /* The following semantic conventions are not returned:
+ http.status_code This requires the response.
+ http.request_content_length This requires the len() of body, which can mutate it.
+ http.response_content_length This requires the response.
+ http.route This is not available.
+ net.sock.peer.name This would require a DNS lookup.
+ net.sock.host.addr The request doesn't have access to the underlying socket.
+ net.sock.host.port The request doesn't have access to the underlying socket.
+
+ */
n := 4 // Method, scheme, proto, and host name.
var host string
var p int
@@ -330,19 +357,31 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
if useragent != "" {
n++
}
- userID, _, hasUserID := req.BasicAuth()
- if hasUserID {
- n++
- }
+
clientIP := serverClientIP(req.Header.Get("X-Forwarded-For"))
if clientIP != "" {
n++
}
+
+ var target string
+ if req.URL != nil {
+ target = req.URL.Path
+ if target != "" {
+ n++
+ }
+ }
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" && protoName != "http" {
+ n++
+ }
+ if protoVersion != "" {
+ n++
+ }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.method(req.Method))
attrs = append(attrs, c.scheme(req.TLS != nil))
- attrs = append(attrs, c.flavor(req.Proto))
attrs = append(attrs, c.NetConv.HostName(host))
if hostPort > 0 {
@@ -359,17 +398,24 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
}
if useragent != "" {
- attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
- }
-
- if hasUserID {
- attrs = append(attrs, c.EnduserIDKey.String(userID))
+ attrs = append(attrs, c.UserAgentOriginalKey.String(useragent))
}
if clientIP != "" {
attrs = append(attrs, c.HTTPClientIPKey.String(clientIP))
}
+ if target != "" {
+ attrs = append(attrs, c.HTTPTargetKey.String(target))
+ }
+
+ if protoName != "" && protoName != "http" {
+ attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion))
+ }
+
return attrs
}
@@ -391,17 +437,21 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port".
+// "net.host.name". The following attributes are returned if they related
+// values are defined in req: "net.host.port".
func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue {
- // TODO: This currently does not add the specification required
- // `http.target` attribute. It has too high of a cardinality to safely be
- // added. An alternate should be added, or this comment removed, when it is
- // addressed by the specification. If it is ultimately decided to continue
- // not including the attribute, the HTTPTargetKey field of the httpConv
- // should be removed as well.
-
- n := 4 // Method, scheme, proto, and host name.
+ /* The following semantic conventions are returned if present:
+ http.scheme string
+ http.route string
+ http.method string
+ http.status_code int
+ net.host.name string
+ net.host.port int
+ net.protocol.name string Note: not set if the value is "http".
+ net.protocol.version string
+ */
+
+ n := 3 // Method, scheme, and host name.
var host string
var p int
if server == "" {
@@ -417,16 +467,29 @@ func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attr
if hostPort > 0 {
n++
}
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" {
+ n++
+ }
+ if protoVersion != "" {
+ n++
+ }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.methodMetric(req.Method))
attrs = append(attrs, c.scheme(req.TLS != nil))
- attrs = append(attrs, c.flavor(req.Proto))
attrs = append(attrs, c.NetConv.HostName(host))
if hostPort > 0 {
attrs = append(attrs, c.NetConv.HostPort(hostPort))
}
+ if protoName != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion))
+ }
return attrs
}
@@ -455,21 +518,6 @@ func (c *httpConv) scheme(https bool) attribute.KeyValue { // nolint:revive
return c.HTTPSchemeHTTP
}
-func (c *httpConv) flavor(proto string) attribute.KeyValue {
- switch proto {
- case "HTTP/1.0":
- return c.HTTPFlavorKey.String("1.0")
- case "HTTP/1.1":
- return c.HTTPFlavorKey.String("1.1")
- case "HTTP/2":
- return c.HTTPFlavorKey.String("2.0")
- case "HTTP/3":
- return c.HTTPFlavorKey.String("3.0")
- default:
- return c.HTTPFlavorKey.String(proto)
- }
-}
-
func serverClientIP(xForwardedFor string) string {
if idx := strings.Index(xForwardedFor, ","); idx >= 0 {
xForwardedFor = xForwardedFor[:idx]
@@ -501,31 +549,6 @@ func firstHostPort(source ...string) (host string, port int) {
return
}
-// RequestHeader returns the contents of h as OpenTelemetry attributes.
-func (c *httpConv) RequestHeader(h http.Header) []attribute.KeyValue {
- return c.header("http.request.header", h)
-}
-
-// ResponseHeader returns the contents of h as OpenTelemetry attributes.
-func (c *httpConv) ResponseHeader(h http.Header) []attribute.KeyValue {
- return c.header("http.response.header", h)
-}
-
-func (c *httpConv) header(prefix string, h http.Header) []attribute.KeyValue {
- key := func(k string) attribute.Key {
- k = strings.ToLower(k)
- k = strings.ReplaceAll(k, "-", "_")
- k = fmt.Sprintf("%s.%s", prefix, k)
- return attribute.Key(k)
- }
-
- attrs := make([]attribute.KeyValue, 0, len(h))
- for k, v := range h {
- attrs = append(attrs, key(k).StringSlice(v))
- }
- return attrs
-}
-
// ClientStatus returns a span status code and message for an HTTP status code
// value received by a client.
func (c *httpConv) ClientStatus(code int) (codes.Code, string) {
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
index bde8893437d..a9a9226b39a 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
@@ -2,17 +2,7 @@
// source: internal/shared/semconvutil/netconv.go.tmpl
// Copyright The OpenTelemetry Authors
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
@@ -22,7 +12,7 @@ import (
"strings"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)
// NetTransport returns a trace attribute describing the transport protocol of the
@@ -32,24 +22,6 @@ func NetTransport(network string) attribute.KeyValue {
return nc.Transport(network)
}
-// NetClient returns trace attributes for a client network connection to address.
-// See net.Dial for information about acceptable address values, address should
-// be the same as the one used to create conn. If conn is nil, only network
-// peer attributes will be returned that describe address. Otherwise, the
-// socket level information about conn will also be included.
-func NetClient(address string, conn net.Conn) []attribute.KeyValue {
- return nc.Client(address, conn)
-}
-
-// NetServer returns trace attributes for a network listener listening at address.
-// See net.Listen for information about acceptable address values, address
-// should be the same as the one used to create ln. If ln is nil, only network
-// host attributes will be returned that describe address. Otherwise, the
-// socket level information about ln will also be included.
-func NetServer(address string, ln net.Listener) []attribute.KeyValue {
- return nc.Server(address, ln)
-}
-
// netConv are the network semantic convention attributes defined for a version
// of the OpenTelemetry specification.
type netConv struct {
@@ -57,6 +29,8 @@ type netConv struct {
NetHostPortKey attribute.Key
NetPeerNameKey attribute.Key
NetPeerPortKey attribute.Key
+ NetProtocolName attribute.Key
+ NetProtocolVersion attribute.Key
NetSockFamilyKey attribute.Key
NetSockPeerAddrKey attribute.Key
NetSockPeerPortKey attribute.Key
@@ -73,6 +47,8 @@ var nc = &netConv{
NetHostPortKey: semconv.NetHostPortKey,
NetPeerNameKey: semconv.NetPeerNameKey,
NetPeerPortKey: semconv.NetPeerPortKey,
+ NetProtocolName: semconv.NetProtocolNameKey,
+ NetProtocolVersion: semconv.NetProtocolVersionKey,
NetSockFamilyKey: semconv.NetSockFamilyKey,
NetSockPeerAddrKey: semconv.NetSockPeerAddrKey,
NetSockPeerPortKey: semconv.NetSockPeerPortKey,
@@ -116,57 +92,11 @@ func (c *netConv) Host(address string) []attribute.KeyValue {
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.HostName(h))
if p > 0 {
- attrs = append(attrs, c.HostPort(int(p)))
+ attrs = append(attrs, c.HostPort(p))
}
return attrs
}
-// Server returns attributes for a network listener listening at address. See
-// net.Listen for information about acceptable address values, address should
-// be the same as the one used to create ln. If ln is nil, only network host
-// attributes will be returned that describe address. Otherwise, the socket
-// level information about ln will also be included.
-func (c *netConv) Server(address string, ln net.Listener) []attribute.KeyValue {
- if ln == nil {
- return c.Host(address)
- }
-
- lAddr := ln.Addr()
- if lAddr == nil {
- return c.Host(address)
- }
-
- hostName, hostPort := splitHostPort(address)
- sockHostAddr, sockHostPort := splitHostPort(lAddr.String())
- network := lAddr.Network()
- sockFamily := family(network, sockHostAddr)
-
- n := nonZeroStr(hostName, network, sockHostAddr, sockFamily)
- n += positiveInt(hostPort, sockHostPort)
- attr := make([]attribute.KeyValue, 0, n)
- if hostName != "" {
- attr = append(attr, c.HostName(hostName))
- if hostPort > 0 {
- // Only if net.host.name is set should net.host.port be.
- attr = append(attr, c.HostPort(hostPort))
- }
- }
- if network != "" {
- attr = append(attr, c.Transport(network))
- }
- if sockFamily != "" {
- attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
- }
- if sockHostAddr != "" {
- attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
- if sockHostPort > 0 {
- // Only if net.sock.host.addr is set should net.sock.host.port be.
- attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
- }
- }
- return attr
-}
-
func (c *netConv) HostName(name string) attribute.KeyValue {
return c.NetHostNameKey.String(name)
}
@@ -175,85 +105,6 @@ func (c *netConv) HostPort(port int) attribute.KeyValue {
return c.NetHostPortKey.Int(port)
}
-// Client returns attributes for a client network connection to address. See
-// net.Dial for information about acceptable address values, address should be
-// the same as the one used to create conn. If conn is nil, only network peer
-// attributes will be returned that describe address. Otherwise, the socket
-// level information about conn will also be included.
-func (c *netConv) Client(address string, conn net.Conn) []attribute.KeyValue {
- if conn == nil {
- return c.Peer(address)
- }
-
- lAddr, rAddr := conn.LocalAddr(), conn.RemoteAddr()
-
- var network string
- switch {
- case lAddr != nil:
- network = lAddr.Network()
- case rAddr != nil:
- network = rAddr.Network()
- default:
- return c.Peer(address)
- }
-
- peerName, peerPort := splitHostPort(address)
- var (
- sockFamily string
- sockPeerAddr string
- sockPeerPort int
- sockHostAddr string
- sockHostPort int
- )
-
- if lAddr != nil {
- sockHostAddr, sockHostPort = splitHostPort(lAddr.String())
- }
-
- if rAddr != nil {
- sockPeerAddr, sockPeerPort = splitHostPort(rAddr.String())
- }
-
- switch {
- case sockHostAddr != "":
- sockFamily = family(network, sockHostAddr)
- case sockPeerAddr != "":
- sockFamily = family(network, sockPeerAddr)
- }
-
- n := nonZeroStr(peerName, network, sockPeerAddr, sockHostAddr, sockFamily)
- n += positiveInt(peerPort, sockPeerPort, sockHostPort)
- attr := make([]attribute.KeyValue, 0, n)
- if peerName != "" {
- attr = append(attr, c.PeerName(peerName))
- if peerPort > 0 {
- // Only if net.peer.name is set should net.peer.port be.
- attr = append(attr, c.PeerPort(peerPort))
- }
- }
- if network != "" {
- attr = append(attr, c.Transport(network))
- }
- if sockFamily != "" {
- attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
- }
- if sockPeerAddr != "" {
- attr = append(attr, c.NetSockPeerAddrKey.String(sockPeerAddr))
- if sockPeerPort > 0 {
- // Only if net.sock.peer.addr is set should net.sock.peer.port be.
- attr = append(attr, c.NetSockPeerPortKey.Int(sockPeerPort))
- }
- }
- if sockHostAddr != "" {
- attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
- if sockHostPort > 0 {
- // Only if net.sock.host.addr is set should net.sock.host.port be.
- attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
- }
- }
- return attr
-}
-
func family(network, address string) string {
switch network {
case "unix", "unixgram", "unixpacket":
@@ -269,26 +120,6 @@ func family(network, address string) string {
return ""
}
-func nonZeroStr(strs ...string) int {
- var n int
- for _, str := range strs {
- if str != "" {
- n++
- }
- }
- return n
-}
-
-func positiveInt(ints ...int) int {
- var n int
- for _, i := range ints {
- if i > 0 {
- n++
- }
- }
- return n
-}
-
// Peer returns attributes for a network peer address.
func (c *netConv) Peer(address string) []attribute.KeyValue {
h, p := splitHostPort(address)
@@ -307,7 +138,7 @@ func (c *netConv) Peer(address string) []attribute.KeyValue {
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.PeerName(h))
if p > 0 {
- attrs = append(attrs, c.PeerPort(int(p)))
+ attrs = append(attrs, c.PeerPort(p))
}
return attrs
}
@@ -366,3 +197,9 @@ func splitHostPort(hostport string) (host string, port int) {
}
return host, int(p)
}
+
+func netProtocol(proto string) (name string, version string) {
+ name, version, _ = strings.Cut(proto, "/")
+ name = strings.ToLower(name)
+ return name, version
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
index 26a51a18050..ea504e396f1 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -48,8 +37,12 @@ type labelerContextKeyType int
const lablelerContextKey labelerContextKeyType = 0
-func injectLabeler(ctx context.Context, l *Labeler) context.Context {
- return context.WithValue(ctx, lablelerContextKey, l)
+// ContextWithLabeler returns a new context with the provided Labeler instance.
+// Attributes added to the specified labeler will be injected into metrics
+// emitted by the instrumentation. Only one labeller can be injected into the
+// context. Injecting it multiple times will override the previous calls.
+func ContextWithLabeler(parent context.Context, l *Labeler) context.Context {
+ return context.WithValue(parent, lablelerContextKey, l)
}
// LabelerFromContext retrieves a Labeler instance from the provided context if
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
index e835cac12e4..0d3cb2e4aa4 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -19,31 +8,42 @@ import (
"io"
"net/http"
"net/http/httptrace"
+ "sync/atomic"
+ "time"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
"go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
"go.opentelemetry.io/otel/trace"
)
// Transport implements the http.RoundTripper interface and wraps
-// outbound HTTP(S) requests with a span.
+// outbound HTTP(S) requests with a span and enriches it with metrics.
type Transport struct {
rt http.RoundTripper
tracer trace.Tracer
+ meter metric.Meter
propagators propagation.TextMapPropagator
spanStartOptions []trace.SpanStartOption
filters []Filter
spanNameFormatter func(string, *http.Request) string
clientTrace func(context.Context) *httptrace.ClientTrace
+
+ requestBytesCounter metric.Int64Counter
+ responseBytesCounter metric.Int64Counter
+ latencyMeasure metric.Float64Histogram
}
var _ http.RoundTripper = &Transport{}
// NewTransport wraps the provided http.RoundTripper with one that
-// starts a span and injects the span context into the outbound request headers.
+// starts a span, injects the span context into the outbound request headers,
+// and enriches it with metrics.
//
// If the provided http.RoundTripper is nil, http.DefaultTransport will be used
// as the base http.RoundTripper.
@@ -63,12 +63,14 @@ func NewTransport(base http.RoundTripper, opts ...Option) *Transport {
c := newConfig(append(defaultOpts, opts...)...)
t.applyConfig(c)
+ t.createMeasures()
return &t
}
func (t *Transport) applyConfig(c *config) {
t.tracer = c.Tracer
+ t.meter = c.Meter
t.propagators = c.Propagators
t.spanStartOptions = c.SpanStartOptions
t.filters = c.Filters
@@ -76,6 +78,30 @@ func (t *Transport) applyConfig(c *config) {
t.clientTrace = c.ClientTrace
}
+func (t *Transport) createMeasures() {
+ var err error
+ t.requestBytesCounter, err = t.meter.Int64Counter(
+ clientRequestSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP request messages."),
+ )
+ handleErr(err)
+
+ t.responseBytesCounter, err = t.meter.Int64Counter(
+ clientResponseSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP response messages."),
+ )
+ handleErr(err)
+
+ t.latencyMeasure, err = t.meter.Float64Histogram(
+ clientDuration,
+ metric.WithUnit("ms"),
+ metric.WithDescription("Measures the duration of outbound HTTP requests."),
+ )
+ handleErr(err)
+}
+
func defaultTransportFormatter(_ string, r *http.Request) string {
return "HTTP " + r.Method
}
@@ -84,6 +110,7 @@ func defaultTransportFormatter(_ string, r *http.Request) string {
// before handing the request to the configured base RoundTripper. The created span will
// end when the response body is closed or when a read from the body returns io.EOF.
func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
+ requestStartTime := time.Now()
for _, f := range t.filters {
if !f(r) {
// Simply pass through to the base RoundTripper if a filter rejects the request
@@ -109,7 +136,25 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
ctx = httptrace.WithClientTrace(ctx, t.clientTrace(ctx))
}
+ labeler, found := LabelerFromContext(ctx)
+ if !found {
+ ctx = ContextWithLabeler(ctx, labeler)
+ }
+
r = r.Clone(ctx) // According to RoundTripper spec, we shouldn't modify the origin request.
+
+ // use a body wrapper to determine the request size
+ var bw bodyWrapper
+ // if request body is nil or NoBody, we don't want to mutate the body as it
+ // will affect the identity of it in an unforeseeable way because we assert
+ // ReadCloser fulfills a certain interface and it is indeed nil or NoBody.
+ if r.Body != nil && r.Body != http.NoBody {
+ bw.ReadCloser = r.Body
+ // noop to prevent nil panic. not using this record fun yet.
+ bw.record = func(int64) {}
+ r.Body = &bw
+ }
+
span.SetAttributes(semconvutil.HTTPClientRequest(r)...)
t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header))
@@ -121,9 +166,29 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
return res, err
}
+ // metrics
+ metricAttrs := append(labeler.Get(), semconvutil.HTTPClientRequestMetrics(r)...)
+ if res.StatusCode > 0 {
+ metricAttrs = append(metricAttrs, semconv.HTTPStatusCode(res.StatusCode))
+ }
+ o := metric.WithAttributeSet(attribute.NewSet(metricAttrs...))
+ addOpts := []metric.AddOption{o} // Allocate vararg slice once.
+ t.requestBytesCounter.Add(ctx, bw.read.Load(), addOpts...)
+ // For handling response bytes we leverage a callback when the client reads the http response
+ readRecordFunc := func(n int64) {
+ t.responseBytesCounter.Add(ctx, n, addOpts...)
+ }
+
+ // traces
span.SetAttributes(semconvutil.HTTPClientResponse(res)...)
span.SetStatus(semconvutil.HTTPClientStatus(res.StatusCode))
- res.Body = newWrappedBody(span, res.Body)
+
+ res.Body = newWrappedBody(span, readRecordFunc, res.Body)
+
+ // Use floating point division here for higher precision (instead of Millisecond method).
+ elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond)
+
+ t.latencyMeasure.Record(ctx, elapsedTime, o)
return res, err
}
@@ -131,17 +196,17 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
// newWrappedBody returns a new and appropriately scoped *wrappedBody as an
// io.ReadCloser. If the passed body implements io.Writer, the returned value
// will implement io.ReadWriteCloser.
-func newWrappedBody(span trace.Span, body io.ReadCloser) io.ReadCloser {
+func newWrappedBody(span trace.Span, record func(n int64), body io.ReadCloser) io.ReadCloser {
// The successful protocol switch responses will have a body that
// implement an io.ReadWriteCloser. Ensure this interface type continues
// to be satisfied if that is the case.
if _, ok := body.(io.ReadWriteCloser); ok {
- return &wrappedBody{span: span, body: body}
+ return &wrappedBody{span: span, record: record, body: body}
}
// Remove the implementation of the io.ReadWriteCloser and only implement
// the io.ReadCloser.
- return struct{ io.ReadCloser }{&wrappedBody{span: span, body: body}}
+ return struct{ io.ReadCloser }{&wrappedBody{span: span, record: record, body: body}}
}
// wrappedBody is the response body type returned by the transport
@@ -153,8 +218,11 @@ func newWrappedBody(span trace.Span, body io.ReadCloser) io.ReadCloser {
// If the response body implements the io.Writer interface (i.e. for
// successful protocol switches), the wrapped body also will.
type wrappedBody struct {
- span trace.Span
- body io.ReadCloser
+ span trace.Span
+ recorded atomic.Bool
+ record func(n int64)
+ body io.ReadCloser
+ read atomic.Int64
}
var _ io.ReadWriteCloser = &wrappedBody{}
@@ -171,11 +239,14 @@ func (wb *wrappedBody) Write(p []byte) (int, error) {
func (wb *wrappedBody) Read(b []byte) (int, error) {
n, err := wb.body.Read(b)
+ // Record the number of bytes read
+ wb.read.Add(int64(n))
switch err {
case nil:
// nothing to do here but fall through to the return
case io.EOF:
+ wb.recordBytesRead()
wb.span.End()
default:
wb.span.RecordError(err)
@@ -184,7 +255,20 @@ func (wb *wrappedBody) Read(b []byte) (int, error) {
return n, err
}
+// recordBytesRead is a function that ensures the number of bytes read is recorded once and only once.
+func (wb *wrappedBody) recordBytesRead() {
+ // note: it is more performant (and equally correct) to use atomic.Bool over sync.Once here. In the event that
+ // two goroutines are racing to call this method, the number of bytes read will no longer increase. Using
+ // CompareAndSwap allows later goroutines to return quickly and not block waiting for the race winner to finish
+ // calling wb.record(wb.read.Load()).
+ if wb.recorded.CompareAndSwap(false, true) {
+ // Record the total number of bytes read
+ wb.record(wb.read.Load())
+ }
+}
+
func (wb *wrappedBody) Close() error {
+ wb.recordBytesRead()
wb.span.End()
if wb.body != nil {
return wb.body.Close()
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
index 8a5cf07bd20..b0957f28cea 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
@@ -1,22 +1,11 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
// Version is the current release version of the otelhttp instrumentation.
func Version() string {
- return "0.46.0"
+ return "0.53.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
index 11a35ed167f..948f8406c09 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -18,6 +7,7 @@ import (
"context"
"io"
"net/http"
+ "sync/atomic"
"go.opentelemetry.io/otel/propagation"
)
@@ -30,14 +20,14 @@ type bodyWrapper struct {
io.ReadCloser
record func(n int64) // must not be nil
- read int64
+ read atomic.Int64
err error
}
func (w *bodyWrapper) Read(b []byte) (int, error) {
n, err := w.ReadCloser.Read(b)
n1 := int64(n)
- w.read += n1
+ w.read.Add(n1)
w.err = err
w.record(n1)
return n, err
@@ -97,3 +87,13 @@ func (w *respWriterWrapper) WriteHeader(statusCode int) {
}
w.ResponseWriter.WriteHeader(statusCode)
}
+
+func (w *respWriterWrapper) Flush() {
+ if !w.wroteHeader {
+ w.WriteHeader(http.StatusOK)
+ }
+
+ if f, ok := w.ResponseWriter.(http.Flusher); ok {
+ f.Flush()
+ }
+}
diff --git a/vendor/go.opentelemetry.io/otel/.codespellignore b/vendor/go.opentelemetry.io/otel/.codespellignore
index ae6a3bcf12c..6bf3abc41e7 100644
--- a/vendor/go.opentelemetry.io/otel/.codespellignore
+++ b/vendor/go.opentelemetry.io/otel/.codespellignore
@@ -3,3 +3,7 @@ fo
te
collison
consequentially
+ans
+nam
+valu
+thirdparty
diff --git a/vendor/go.opentelemetry.io/otel/.codespellrc b/vendor/go.opentelemetry.io/otel/.codespellrc
index 4afbb1fb3bd..e2cb3ea944b 100644
--- a/vendor/go.opentelemetry.io/otel/.codespellrc
+++ b/vendor/go.opentelemetry.io/otel/.codespellrc
@@ -5,6 +5,6 @@ check-filenames =
check-hidden =
ignore-words = .codespellignore
interactive = 1
-skip = .git,go.mod,go.sum,semconv,venv,.tools
+skip = .git,go.mod,go.sum,go.work,go.work.sum,semconv,venv,.tools
uri-ignore-words-list = *
write =
diff --git a/vendor/go.opentelemetry.io/otel/.gitignore b/vendor/go.opentelemetry.io/otel/.gitignore
index 9248055655b..895c7664beb 100644
--- a/vendor/go.opentelemetry.io/otel/.gitignore
+++ b/vendor/go.opentelemetry.io/otel/.gitignore
@@ -14,13 +14,9 @@ go.work.sum
gen/
/example/dice/dice
-/example/fib/fib
-/example/fib/traces.txt
-/example/jaeger/jaeger
/example/namedtracer/namedtracer
/example/otel-collector/otel-collector
/example/opencensus/opencensus
/example/passthrough/passthrough
/example/prometheus/prometheus
-/example/view/view
/example/zipkin/zipkin
diff --git a/vendor/go.opentelemetry.io/otel/.gitmodules b/vendor/go.opentelemetry.io/otel/.gitmodules
deleted file mode 100644
index 38a1f56982b..00000000000
--- a/vendor/go.opentelemetry.io/otel/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "opentelemetry-proto"]
- path = exporters/otlp/internal/opentelemetry-proto
- url = https://github.com/open-telemetry/opentelemetry-proto
diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml
index a62511f382e..6d9c8b64958 100644
--- a/vendor/go.opentelemetry.io/otel/.golangci.yml
+++ b/vendor/go.opentelemetry.io/otel/.golangci.yml
@@ -11,6 +11,7 @@ linters:
enable:
- depguard
- errcheck
+ - errorlint
- godot
- gofumpt
- goimports
@@ -21,8 +22,11 @@ linters:
- misspell
- revive
- staticcheck
+ - tenv
- typecheck
+ - unconvert
- unused
+ - unparam
issues:
# Maximum issues count per one linter.
@@ -124,6 +128,8 @@ linters-settings:
- "**/example/**/*.go"
- "**/trace/*.go"
- "**/trace/**/*.go"
+ - "**/log/*.go"
+ - "**/log/**/*.go"
deny:
- pkg: "go.opentelemetry.io/otel/internal$"
desc: Do not use cross-module internal packages.
diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
index c4e7ad475f5..c01e6998e0b 100644
--- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md
+++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
@@ -8,9 +8,291 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
+## [1.28.0/0.50.0/0.4.0] 2024-07-02
+
+### Added
+
+- The `IsEmpty` method is added to the `Instrument` type in `go.opentelemetry.io/otel/sdk/metric`.
+ This method is used to check if an `Instrument` instance is a zero-value. (#5431)
+- Store and provide the emitted `context.Context` in `ScopeRecords` of `go.opentelemetry.io/otel/sdk/log/logtest`. (#5468)
+- The `go.opentelemetry.io/otel/semconv/v1.26.0` package.
+ The package contains semantic conventions from the `v1.26.0` version of the OpenTelemetry Semantic Conventions. (#5476)
+- The `AssertRecordEqual` method to `go.opentelemetry.io/otel/log/logtest` to allow comparison of two log records in tests. (#5499)
+- The `WithHeaders` option to `go.opentelemetry.io/otel/exporters/zipkin` to allow configuring custom http headers while exporting spans. (#5530)
+
+### Changed
+
+- `Tracer.Start` in `go.opentelemetry.io/otel/trace/noop` no longer allocates a span for empty span context. (#5457)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/otel-collector`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/zipkin`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/exporters/zipkin`. (#5490)
+ - The exporter no longer exports the deprecated "otel.library.name" or "otel.library.version" attributes.
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/resource`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/trace`. (#5490)
+- `SimpleProcessor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` no longer allocates a slice which makes it possible to have a zero-allocation log processing using `SimpleProcessor`. (#5493)
+- Use non-generic functions in the `Start` method of `"go.opentelemetry.io/otel/sdk/trace".Trace` to reduce memory allocation. (#5497)
+- `service.instance.id` is populated for a `Resource` created with `"go.opentelemetry.io/otel/sdk/resource".Default` with a default value when `OTEL_GO_X_RESOURCE` is set. (#5520)
+- Improve performance of metric instruments in `go.opentelemetry.io/otel/sdk/metric` by removing unnecessary calls to `time.Now`. (#5545)
+
+### Fixed
+
+- Log a warning to the OpenTelemetry internal logger when a `Record` in `go.opentelemetry.io/otel/sdk/log` drops an attribute due to a limit being reached. (#5376)
+- Identify the `Tracer` returned from the global `TracerProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426)
+- Identify the `Meter` returned from the global `MeterProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426)
+- Log a warning to the OpenTelemetry internal logger when a `Span` in `go.opentelemetry.io/otel/sdk/trace` drops an attribute, event, or link due to a limit being reached. (#5434)
+- Document instrument name requirements in `go.opentelemetry.io/otel/metric`. (#5435)
+- Prevent random number generation data-race for experimental rand exemplars in `go.opentelemetry.io/otel/sdk/metric`. (#5456)
+- Fix counting number of dropped attributes of `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5464)
+- Fix panic in baggage creation when a member contains `0x80` char in key or value. (#5494)
+- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5508)
+- Retry trace and span ID generation if it generated an invalid one in `go.opentelemetry.io/otel/sdk/trace`. (#5514)
+- Fix stale timestamps reported by the last-value aggregation. (#5517)
+- Indicate the `Exporter` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` must be created by the `New` method. (#5521)
+- Improved performance in all `{Bool,Int64,Float64,String}SliceValue` functions of `go.opentelemetry.io/attributes` by reducing the number of allocations. (#5549)
+
+## [1.27.0/0.49.0/0.3.0] 2024-05-21
+
+### Added
+
+- Add example for `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5242)
+- Add `RecordFactory` in `go.opentelemetry.io/otel/sdk/log/logtest` to facilitate testing exporter and processor implementations. (#5258)
+- Add `RecordFactory` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing bridge implementations. (#5263)
+- The count of dropped records from the `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` is logged. (#5276)
+- Add metrics in the `otel-collector` example. (#5283)
+- Add the synchronous gauge instrument to `go.opentelemetry.io/otel/metric`. (#5304)
+ - An `int64` or `float64` synchronous gauge instrument can now be created from a `Meter`.
+ - All implementations of the API (`go.opentelemetry.io/otel/metric/noop`, `go.opentelemetry.io/otel/sdk/metric`) are updated to support this instrument.
+- Add logs to `go.opentelemetry.io/otel/example/dice`. (#5349)
+
+### Changed
+
+- The `Shutdown` method of `Exporter` in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` ignores the context cancellation and always returns `nil`. (#5189)
+- The `ForceFlush` and `Shutdown` methods of the exporter returned by `New` in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` ignore the context cancellation and always return `nil`. (#5189)
+- Apply the value length limits to `Record` attributes in `go.opentelemetry.io/otel/sdk/log`. (#5230)
+- De-duplicate map attributes added to a `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5230)
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` won't print timestamps when `WithoutTimestamps` option is set. (#5241)
+- The `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` exporter won't print `AttributeValueLengthLimit` and `AttributeCountLimit` fields now, instead it prints the `DroppedAttributes` field. (#5272)
+- Improved performance in the `Stringer` implementation of `go.opentelemetry.io/otel/baggage.Member` by reducing the number of allocations. (#5286)
+- Set the start time for last-value aggregates in `go.opentelemetry.io/otel/sdk/metric`. (#5305)
+- The `Span` in `go.opentelemetry.io/otel/sdk/trace` will record links without span context if either non-empty `TraceState` or attributes are provided. (#5315)
+- Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0` to `go.opentelemetry.io/otel/semconv/v1.25.0`. (#5374)
+
+### Fixed
+
+- Comparison of unordered maps for `go.opentelemetry.io/otel/log.KeyValue` and `go.opentelemetry.io/otel/log.Value`. (#5306)
+- Fix the empty output of `go.opentelemetry.io/otel/log.Value` in `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5311)
+- Split the behavior of `Recorder` in `go.opentelemetry.io/otel/log/logtest` so it behaves as a `LoggerProvider` only. (#5365)
+- Fix wrong package name of the error message when parsing endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5371)
+- Identify the `Logger` returned from the global `LoggerProvider` in `go.opentelemetry.io/otel/log/global` with its schema URL. (#5375)
+
+## [1.26.0/0.48.0/0.2.0-alpha] 2024-04-24
+
+### Added
+
+- Add `Recorder` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing the log bridge implementations. (#5134)
+- Add span flags to OTLP spans and links exported by `go.opentelemetry.io/otel/exporters/otlp/otlptrace`. (#5194)
+- Make the initial alpha release of `go.opentelemetry.io/otel/sdk/log`.
+ This new module contains the Go implementation of the OpenTelemetry Logs SDK.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`.
+ This new module contains an OTLP exporter that transmits log telemetry using HTTP.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`.
+ This new module contains an exporter prints log records to STDOUT.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- The `go.opentelemetry.io/otel/semconv/v1.25.0` package.
+ The package contains semantic conventions from the `v1.25.0` version of the OpenTelemetry Semantic Conventions. (#5254)
+
+### Changed
+
+- Update `go.opentelemetry.io/proto/otlp` from v1.1.0 to v1.2.0. (#5177)
+- Improve performance of baggage member character validation in `go.opentelemetry.io/otel/baggage`. (#5214)
+- The `otel-collector` example now uses docker compose to bring up services instead of kubernetes. (#5244)
+
+### Fixed
+
+- Slice attribute values in `go.opentelemetry.io/otel/attribute` are now emitted as their JSON representation. (#5159)
+
+## [1.25.0/0.47.0/0.0.8/0.1.0-alpha] 2024-04-05
+
+### Added
+
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4906)
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp`. (#4906)
+- Add `AddLink` method to the `Span` interface in `go.opentelemetry.io/otel/trace`. (#5032)
+- The `Enabled` method is added to the `Logger` interface in `go.opentelemetry.io/otel/log`.
+ This method is used to notify users if a log record will be emitted or not. (#5071)
+- Add `SeverityUndefined` `const` to `go.opentelemetry.io/otel/log`.
+ This value represents an unset severity level. (#5072)
+- Add `Empty` function in `go.opentelemetry.io/otel/log` to return a `KeyValue` for an empty value. (#5076)
+- Add `go.opentelemetry.io/otel/log/global` to manage the global `LoggerProvider`.
+ This package is provided with the anticipation that all functionality will be migrate to `go.opentelemetry.io/otel` when `go.opentelemetry.io/otel/log` stabilizes.
+ At which point, users will be required to migrage their code, and this package will be deprecated then removed. (#5085)
+- Add support for `Summary` metrics in the `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` exporters. (#5100)
+- Add `otel.scope.name` and `otel.scope.version` tags to spans exported by `go.opentelemetry.io/otel/exporters/zipkin`. (#5108)
+- Add support for `AddLink` to `go.opentelemetry.io/otel/bridge/opencensus`. (#5116)
+- Add `String` method to `Value` and `KeyValue` in `go.opentelemetry.io/otel/log`. (#5117)
+- Add Exemplar support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5111)
+- Add metric semantic conventions to `go.opentelemetry.io/otel/semconv/v1.24.0`. Future `semconv` packages will include metric semantic conventions as well. (#4528)
+
+### Changed
+
+- `SpanFromContext` and `SpanContextFromContext` in `go.opentelemetry.io/otel/trace` no longer make a heap allocation when the passed context has no span. (#5049)
+- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` now create a gRPC client in idle mode and with "dns" as the default resolver using [`grpc.NewClient`](https://pkg.go.dev/google.golang.org/grpc#NewClient). (#5151)
+ Because of that `WithDialOption` ignores [`grpc.WithBlock`](https://pkg.go.dev/google.golang.org/grpc#WithBlock), [`grpc.WithTimeout`](https://pkg.go.dev/google.golang.org/grpc#WithTimeout), and [`grpc.WithReturnConnectionError`](https://pkg.go.dev/google.golang.org/grpc#WithReturnConnectionError).
+ Notice that [`grpc.DialContext`](https://pkg.go.dev/google.golang.org/grpc#DialContext) which was used before is now deprecated.
+
+### Fixed
+
+- Clarify the documentation about equivalence guarantees for the `Set` and `Distinct` types in `go.opentelemetry.io/otel/attribute`. (#5027)
+- Prevent default `ErrorHandler` self-delegation. (#5137)
+- Update all dependencies to address [GO-2024-2687]. (#5139)
+
+### Removed
+
+- Drop support for [Go 1.20]. (#4967)
+
+### Deprecated
+
+- Deprecate `go.opentelemetry.io/otel/attribute.Sortable` type. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortable` function. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortableFiltered` function. (#4734)
+
+## [1.24.0/0.46.0/0.0.1-alpha] 2024-02-23
+
+This release is the last to support [Go 1.20].
+The next release will require at least [Go 1.21].
+
+### Added
+
+- Support [Go 1.22]. (#4890)
+- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4900)
+- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4900)
+- The `go.opentelemetry.io/otel/log` module is added.
+ This module includes OpenTelemetry Go's implementation of the Logs Bridge API.
+ This module is in an alpha state, it is subject to breaking changes.
+ See our [versioning policy](./VERSIONING.md) for more info. (#4961)
+- ARM64 platform to the compatibility testing suite. (#4994)
+
+### Fixed
+
+- Fix registration of multiple callbacks when using the global meter provider from `go.opentelemetry.io/otel`. (#4945)
+- Fix negative buckets in output of exponential histograms. (#4956)
+
+## [1.23.1] 2024-02-07
+
+### Fixed
+
+- Register all callbacks passed during observable instrument creation instead of just the last one multiple times in `go.opentelemetry.io/otel/sdk/metric`. (#4888)
+
+## [1.23.0] 2024-02-06
+
+This release contains the first stable, `v1`, release of the following modules:
+
+- `go.opentelemetry.io/otel/bridge/opencensus`
+- `go.opentelemetry.io/otel/bridge/opencensus/test`
+- `go.opentelemetry.io/otel/example/opencensus`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric`
+
+See our [versioning policy](VERSIONING.md) for more information about these stability guarantees.
+
+### Added
+
+- Add `WithEndpointURL` option to the `exporters/otlp/otlpmetric/otlpmetricgrpc`, `exporters/otlp/otlpmetric/otlpmetrichttp`, `exporters/otlp/otlptrace/otlptracegrpc` and `exporters/otlp/otlptrace/otlptracehttp` packages. (#4808)
+- Experimental exemplar exporting is added to the metric SDK.
+ See [metric documentation](./sdk/metric/internal/x/README.md#exemplars) for more information about this feature and how to enable it. (#4871)
+- `ErrSchemaURLConflict` is added to `go.opentelemetry.io/otel/sdk/resource`.
+ This error is returned when a merge of two `Resource`s with different (non-empty) schema URL is attempted. (#4876)
+
+### Changed
+
+- The `Merge` and `New` functions in `go.opentelemetry.io/otel/sdk/resource` now returns a partial result if there is a schema URL merge conflict.
+ Instead of returning `nil` when two `Resource`s with different (non-empty) schema URLs are merged the merged `Resource`, along with the new `ErrSchemaURLConflict` error, is returned.
+ It is up to the user to decide if they want to use the returned `Resource` or not.
+ It may have desired attributes overwritten or include stale semantic conventions. (#4876)
+
+### Fixed
+
+- Fix `ContainerID` resource detection on systemd when cgroup path has a colon. (#4449)
+- Fix `go.opentelemetry.io/otel/sdk/metric` to cache instruments to avoid leaking memory when the same instrument is created multiple times. (#4820)
+- Fix missing `Mix` and `Max` values for `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` by introducing `MarshalText` and `MarshalJSON` for the `Extrema` type in `go.opentelemetry.io/sdk/metric/metricdata`. (#4827)
+
+## [1.23.0-rc.1] 2024-01-18
+
+This is a release candidate for the v1.23.0 release.
+That release is expected to include the `v1` release of the following modules:
+
+- `go.opentelemetry.io/otel/bridge/opencensus`
+- `go.opentelemetry.io/otel/bridge/opencensus/test`
+- `go.opentelemetry.io/otel/example/opencensus`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric`
+
+See our [versioning policy](VERSIONING.md) for more information about these stability guarantees.
+
+## [1.22.0/0.45.0] 2024-01-17
+
+### Added
+
+- The `go.opentelemetry.io/otel/semconv/v1.22.0` package.
+ The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735)
+- The `go.opentelemetry.io/otel/semconv/v1.23.0` package.
+ The package contains semantic conventions from the `v1.23.0` version of the OpenTelemetry Semantic Conventions. (#4746)
+- The `go.opentelemetry.io/otel/semconv/v1.23.1` package.
+ The package contains semantic conventions from the `v1.23.1` version of the OpenTelemetry Semantic Conventions. (#4749)
+- The `go.opentelemetry.io/otel/semconv/v1.24.0` package.
+ The package contains semantic conventions from the `v1.24.0` version of the OpenTelemetry Semantic Conventions. (#4770)
+- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733)
+- Experimental cardinality limiting is added to the metric SDK.
+ See [metric documentation](./sdk/metric/internal/x/README.md#cardinality-limit) for more information about this feature and how to enable it. (#4457)
+- Add `NewMemberRaw` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage`. (#4804)
+
+### Changed
+
+- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.24.0`. (#4754)
+- Update transformations in `go.opentelemetry.io/otel/exporters/zipkin` to follow `v1.24.0` version of the OpenTelemetry specification. (#4754)
+- Record synchronous measurements when the passed context is canceled instead of dropping in `go.opentelemetry.io/otel/sdk/metric`.
+ If you do not want to make a measurement when the context is cancelled, you need to handle it yourself (e.g `if ctx.Err() != nil`). (#4671)
+- Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722)
+- Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721)
+- Improve `go.opentelemetry.io/otel/baggage` performance. (#4743)
+- Improve performance of the `(*Set).Filter` method in `go.opentelemetry.io/otel/attribute` when the passed filter does not filter out any attributes from the set. (#4774)
+- `Member.String` in `go.opentelemetry.io/otel/baggage` percent-encodes only when necessary. (#4775)
+- Improve `go.opentelemetry.io/otel/trace.Span`'s performance when adding multiple attributes. (#4818)
+- `Property.Value` in `go.opentelemetry.io/otel/baggage` now returns a raw string instead of a percent-encoded value. (#4804)
+
+### Fixed
+
+- Fix `Parse` in `go.opentelemetry.io/otel/baggage` to validate member value before percent-decoding. (#4755)
+- Fix whitespace encoding of `Member.String` in `go.opentelemetry.io/otel/baggage`. (#4756)
+- Fix observable not registered error when the asynchronous instrument has a drop aggregation in `go.opentelemetry.io/otel/sdk/metric`. (#4772)
+- Fix baggage item key so that it is not canonicalized in `go.opentelemetry.io/otel/bridge/opentracing`. (#4776)
+- Fix `go.opentelemetry.io/otel/bridge/opentracing` to properly handle baggage values that requires escaping during propagation. (#4804)
+- Fix a bug where using multiple readers resulted in incorrect asynchronous counter values in `go.opentelemetry.io/otel/sdk/metric`. (#4742)
+
+## [1.21.0/0.44.0] 2023-11-16
+
+### Removed
+
+- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706)
+- Remove the deprecated `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` module. (#4707)
+- Remove the deprecated `go.opentelemetry.io/otel/example/view` module. (#4708)
+- Remove the deprecated `go.opentelemetry.io/otel/example/fib` module. (#4723)
+
+### Fixed
+
+- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4719)
+- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4719)
+
## [1.20.0/0.43.0] 2023-11-10
-This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementors need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this.
+This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementers need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this.
### Added
@@ -42,15 +324,15 @@ This release brings a breaking change for custom trace API implementations. Some
- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583)
- The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type.
This extends the `TracerProvider` interface and is is a breaking change for any existing implementation.
- Implementors need to update their implementations based on what they want the default behavior of the interface to be.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
- The `Tracer` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Tracer` type.
This extends the `Tracer` interface and is is a breaking change for any existing implementation.
- Implementors need to update their implementations based on what they want the default behavior of the interface to be.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
- The `Span` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Span` type.
This extends the `Span` interface and is is a breaking change for any existing implementation.
- Implementors need to update their implementations based on what they want the default behavior of the interface to be.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660)
- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660)
@@ -686,7 +968,7 @@ The next release will require at least [Go 1.19].
- Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340)
- `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436)
- Re-enabled Attribute Filters in the Metric SDK. (#3396)
-- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#3408)
+- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggregation. (#3408)
- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432)
- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440)
- Prevent duplicate Prometheus description, unit, and type. (#3469)
@@ -1731,7 +2013,7 @@ with major version 0.
- `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369)
- Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369)
- Unify endpoint API that related to OTel exporter. (#1401)
-- Optimize metric histogram aggregator to re-use its slice of buckets. (#1435)
+- Optimize metric histogram aggregator to reuse its slice of buckets. (#1435)
- Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430)
- Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434)
- `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432)
@@ -2721,7 +3003,17 @@ It contains api and sdk for trace and meter.
- CircleCI build CI manifest files.
- CODEOWNERS file to track owners of this project.
-[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.20.0...HEAD
+[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.28.0...HEAD
+[1.28.0/0.50.0/0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.28.0
+[1.27.0/0.49.0/0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.27.0
+[1.26.0/0.48.0/0.2.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.26.0
+[1.25.0/0.47.0/0.0.8/0.1.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.25.0
+[1.24.0/0.46.0/0.0.1-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.24.0
+[1.23.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.1
+[1.23.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0
+[1.23.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0-rc.1
+[1.22.0/0.45.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.22.0
+[1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0
[1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0
[1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0
[1.19.0-rc.1/0.42.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0-rc.1
@@ -2794,6 +3086,8 @@ It contains api and sdk for trace and meter.
[0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1
[0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0
+[Go 1.22]: https://go.dev/doc/go1.22
+[Go 1.21]: https://go.dev/doc/go1.21
[Go 1.20]: https://go.dev/doc/go1.20
[Go 1.19]: https://go.dev/doc/go1.19
[Go 1.18]: https://go.dev/doc/go1.18
@@ -2801,3 +3095,5 @@ It contains api and sdk for trace and meter.
[metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric
[metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric
[trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace
+
+[GO-2024-2687]: https://pkg.go.dev/vuln/GO-2024-2687
diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS
index 623740007d4..20255493323 100644
--- a/vendor/go.opentelemetry.io/otel/CODEOWNERS
+++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS
@@ -12,6 +12,6 @@
# https://help.github.com/en/articles/about-code-owners
#
-* @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu
+* @MrAlias @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu
-CODEOWNERS @MrAlias @MadVikingGod @pellared
\ No newline at end of file
+CODEOWNERS @MrAlias @MadVikingGod @pellared @dashpole @XSAM @dmathieu
diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
index a00dbca7b08..b86572f58ea 100644
--- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
+++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
@@ -90,6 +90,10 @@ git push
Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull
request ID to the entry you added to `CHANGELOG.md`.
+Avoid rebasing and force-pushing to your branch to facilitate reviewing the pull request.
+Rewriting Git history makes it difficult to keep track of iterations during code review.
+All pull requests are squashed to a single commit upon merge to `main`.
+
### How to Receive Comments
* If the PR is not ready for review, please put `[WIP]` in the title,
@@ -197,6 +201,16 @@ You can install and run a "local Go Doc site" in the following way:
[`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
is an example of a very well-documented package.
+### README files
+
+Each (non-internal, non-test, non-documentation) package must contain a
+`README.md` file containing at least a title, and a `pkg.go.dev` badge.
+
+The README should not be a repetition of Go doc comments.
+
+You can verify the presence of all README files with the `make verify-readmes`
+command.
+
## Style Guide
One of the primary goals of this project is that it is actually used by
@@ -556,6 +570,9 @@ functionality should be added, each one will need their own super-set
interfaces and will duplicate the pattern. For this reason, the simple targeted
interface that defines the specific functionality should be preferred.
+See also:
+[Keeping Your Modules Compatible: Working with interfaces](https://go.dev/blog/module-compatibility#working-with-interfaces).
+
### Testing
The tests should never leak goroutines.
@@ -587,27 +604,48 @@ this.
[^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548
+### Ignoring context cancellation
+
+OpenTelemetry API implementations need to ignore the cancellation of the context that are
+passed when recording a value (e.g. starting a span, recording a measurement, emitting a log).
+Recording methods should not return an error describing the cancellation state of the context
+when they complete, nor should they abort any work.
+
+This rule may not apply if the OpenTelemetry specification defines a timeout mechanism for
+the method. In that case the context cancellation can be used for the timeout with the
+restriction that this behavior is documented for the method. Otherwise, timeouts
+are expected to be handled by the user calling the API, not the implementation.
+
+Stoppage of the telemetry pipeline is handled by calling the appropriate `Shutdown` method
+of a provider. It is assumed the context passed from a user is not used for this purpose.
+
+Outside of the direct recording of telemetry from the API (e.g. exporting telemetry,
+force flushing telemetry, shutting down a signal provider) the context cancellation
+should be honored. This means all work done on behalf of the user provided context
+should be canceled.
+
## Approvers and Maintainers
### Approvers
-- [Evan Torrie](https://github.com/evantorrie), Verizon Media
-- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics
-- [David Ashpole](https://github.com/dashpole), Google
- [Chester Cheung](https://github.com/hanyuancheung), Tencent
-- [Damien Mathieu](https://github.com/dmathieu), Elastic
-- [Anthony Mirabella](https://github.com/Aneurysm9), AWS
### Maintainers
- [Aaron Clawson](https://github.com/MadVikingGod), LightStep
+- [Damien Mathieu](https://github.com/dmathieu), Elastic
+- [David Ashpole](https://github.com/dashpole), Google
- [Robert Pająk](https://github.com/pellared), Splunk
+- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics
- [Tyler Yahn](https://github.com/MrAlias), Splunk
### Emeritus
+- [Liz Fong-Jones](https://github.com/lizthegrey), Honeycomb
- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep
- [Josh MacDonald](https://github.com/jmacd), LightStep
+- [Anthony Mirabella](https://github.com/Aneurysm9), AWS
+- [Evan Torrie](https://github.com/evantorrie), Yahoo
### Become an Approver or a Maintainer
diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile
index 35fc189961b..f33619f76a2 100644
--- a/vendor/go.opentelemetry.io/otel/Makefile
+++ b/vendor/go.opentelemetry.io/otel/Makefile
@@ -1,16 +1,5 @@
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
TOOLS_MOD_DIR := ./internal/tools
@@ -25,8 +14,8 @@ TIMEOUT = 60
.DEFAULT_GOAL := precommit
.PHONY: precommit ci
-precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default
-ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage
+precommit: generate license-check misspell go-mod-tidy golangci-lint-fix verify-readmes verify-mods test-default
+ci: generate license-check lint vanity-import-check verify-readmes verify-mods build test-default check-clean-work-tree test-coverage
# Tools
@@ -34,7 +23,7 @@ TOOLS = $(CURDIR)/.tools
$(TOOLS):
@mkdir -p $@
-$(TOOLS)/%: | $(TOOLS)
+$(TOOLS)/%: $(TOOLS_MOD_DIR)/go.mod | $(TOOLS)
cd $(TOOLS_MOD_DIR) && \
$(GO) build -o $@ $(PACKAGE)
@@ -50,9 +39,6 @@ $(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink
SEMCONVKIT = $(TOOLS)/semconvkit
$(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit
-DBOTCONF = $(TOOLS)/dbotconf
-$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/build-tools/dbotconf
-
GOLANGCI_LINT = $(TOOLS)/golangci-lint
$(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint
@@ -81,7 +67,7 @@ GOVULNCHECK = $(TOOLS)/govulncheck
$(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck
.PHONY: tools
-tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
+tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
# Virtualized python tools via docker
@@ -110,7 +96,7 @@ $(PYTOOLS):
@$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip"
# Install python packages into the virtual environment.
-$(PYTOOLS)/%: | $(PYTOOLS)
+$(PYTOOLS)/%: $(PYTOOLS)
@$(DOCKERPY) $(PIP) install -r requirements.txt
CODESPELL = $(PYTOOLS)/codespell
@@ -124,18 +110,18 @@ generate: go-generate vanity-import-fix
.PHONY: go-generate
go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%)
go-generate/%: DIR=$*
-go-generate/%: | $(STRINGER) $(GOTMPL)
+go-generate/%: $(STRINGER) $(GOTMPL)
@echo "$(GO) generate $(DIR)/..." \
&& cd $(DIR) \
&& PATH="$(TOOLS):$${PATH}" $(GO) generate ./...
.PHONY: vanity-import-fix
-vanity-import-fix: | $(PORTO)
+vanity-import-fix: $(PORTO)
@$(PORTO) --include-internal -w .
# Generate go.work file for local development.
.PHONY: go-work
-go-work: | $(CROSSLINK)
+go-work: $(CROSSLINK)
$(CROSSLINK) work --root=$(shell pwd)
# Build
@@ -178,7 +164,7 @@ test/%:
COVERAGE_MODE = atomic
COVERAGE_PROFILE = coverage.out
.PHONY: test-coverage
-test-coverage: | $(GOCOVMERGE)
+test-coverage: $(GOCOVMERGE)
@set -e; \
printf "" > coverage.txt; \
for dir in $(ALL_COVERAGE_MOD_DIRS); do \
@@ -192,7 +178,7 @@ test-coverage: | $(GOCOVMERGE)
done; \
$(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt
-# Adding a directory will include all benchmarks in that direcotry if a filter is not specified.
+# Adding a directory will include all benchmarks in that directory if a filter is not specified.
BENCHMARK_TARGETS := sdk/trace
.PHONY: benchmark
benchmark: $(BENCHMARK_TARGETS:%=benchmark/%)
@@ -209,23 +195,23 @@ golangci-lint-fix: ARGS=--fix
golangci-lint-fix: golangci-lint
golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%)
golangci-lint/%: DIR=$*
-golangci-lint/%: | $(GOLANGCI_LINT)
+golangci-lint/%: $(GOLANGCI_LINT)
@echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \
&& cd $(DIR) \
&& $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS)
.PHONY: crosslink
-crosslink: | $(CROSSLINK)
+crosslink: $(CROSSLINK)
@echo "Updating intra-repository dependencies in all go modules" \
&& $(CROSSLINK) --root=$(shell pwd) --prune
.PHONY: go-mod-tidy
go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%)
go-mod-tidy/%: DIR=$*
-go-mod-tidy/%: | crosslink
+go-mod-tidy/%: crosslink
@echo "$(GO) mod tidy in $(DIR)" \
&& cd $(DIR) \
- && $(GO) mod tidy -compat=1.20
+ && $(GO) mod tidy -compat=1.21
.PHONY: lint-modules
lint-modules: go-mod-tidy
@@ -234,23 +220,23 @@ lint-modules: go-mod-tidy
lint: misspell lint-modules golangci-lint govulncheck
.PHONY: vanity-import-check
-vanity-import-check: | $(PORTO)
+vanity-import-check: $(PORTO)
@$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 )
.PHONY: misspell
-misspell: | $(MISSPELL)
+misspell: $(MISSPELL)
@$(MISSPELL) -w $(ALL_DOCS)
.PHONY: govulncheck
govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%)
govulncheck/%: DIR=$*
-govulncheck/%: | $(GOVULNCHECK)
+govulncheck/%: $(GOVULNCHECK)
@echo "govulncheck ./... in $(DIR)" \
&& cd $(DIR) \
&& $(GOVULNCHECK) ./...
.PHONY: codespell
-codespell: | $(CODESPELL)
+codespell: $(CODESPELL)
@$(DOCKERPY) $(CODESPELL)
.PHONY: license-check
@@ -263,15 +249,6 @@ license-check:
exit 1; \
fi
-DEPENDABOT_CONFIG = .github/dependabot.yml
-.PHONY: dependabot-check
-dependabot-check: | $(DBOTCONF)
- @$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || ( echo "(run: make dependabot-generate)"; exit 1 )
-
-.PHONY: dependabot-generate
-dependabot-generate: | $(DBOTCONF)
- @$(DBOTCONF) generate > $(DEPENDABOT_CONFIG)
-
.PHONY: check-clean-work-tree
check-clean-work-tree:
@if ! git diff --quiet; then \
@@ -284,13 +261,11 @@ check-clean-work-tree:
SEMCONVPKG ?= "semconv/"
.PHONY: semconv-generate
-semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT)
+semconv-generate: $(SEMCONVGEN) $(SEMCONVKIT)
[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 )
[ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 )
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
+ $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=metric -f metric.go -t "$(SEMCONVPKG)/metric_template.j2" -s "$(TAG)"
$(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
.PHONY: gorelease
@@ -302,17 +277,25 @@ gorelease/%:| $(GORELEASE)
&& $(GORELEASE) \
|| echo ""
+.PHONY: verify-mods
+verify-mods: $(MULTIMOD)
+ $(MULTIMOD) verify
+
.PHONY: prerelease
-prerelease: | $(MULTIMOD)
+prerelease: verify-mods
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
- $(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET}
+ $(MULTIMOD) prerelease -m ${MODSET}
COMMIT ?= "HEAD"
.PHONY: add-tags
-add-tags: | $(MULTIMOD)
+add-tags: verify-mods
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
- $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
+ $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
.PHONY: lint-markdown
-lint-markdown:
- docker run -v "$(CURDIR):$(WORKDIR)" docker://avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md
+lint-markdown:
+ docker run -v "$(CURDIR):$(WORKDIR)" avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md
+
+.PHONY: verify-readmes
+verify-readmes:
+ ./verify_readmes.sh
diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md
index 2c5b0cc28ab..5a890931731 100644
--- a/vendor/go.opentelemetry.io/otel/README.md
+++ b/vendor/go.opentelemetry.io/otel/README.md
@@ -11,14 +11,11 @@ It provides a set of APIs to directly measure performance and behavior of your s
## Project Status
-| Signal | Status |
-|---------|------------|
-| Traces | Stable |
-| Metrics | Stable |
-| Logs | Design [1] |
-
-- [1]: Currently the logs signal development is in a design phase ([#4696](https://github.com/open-telemetry/opentelemetry-go/issues/4696)).
- No Logs Pull Requests are currently being accepted.
+| Signal | Status |
+|---------|--------------------|
+| Traces | Stable |
+| Metrics | Stable |
+| Logs | Beta[^1] |
Progress and status specific to this repository is tracked in our
[project boards](https://github.com/open-telemetry/opentelemetry-go/projects)
@@ -28,6 +25,8 @@ and
Project versioning information and stability guarantees can be found in the
[versioning documentation](VERSIONING.md).
+[^1]: https://github.com/orgs/open-telemetry/projects/43
+
### Compatibility
OpenTelemetry-Go ensures compatibility with the current supported versions of
@@ -50,23 +49,25 @@ Currently, this project supports the following environments.
| OS | Go Version | Architecture |
|---------|------------|--------------|
+| Ubuntu | 1.22 | amd64 |
| Ubuntu | 1.21 | amd64 |
-| Ubuntu | 1.20 | amd64 |
+| Ubuntu | 1.22 | 386 |
| Ubuntu | 1.21 | 386 |
-| Ubuntu | 1.20 | 386 |
+| Linux | 1.22 | arm64 |
+| Linux | 1.21 | arm64 |
+| MacOS | 1.22 | amd64 |
| MacOS | 1.21 | amd64 |
-| MacOS | 1.20 | amd64 |
+| Windows | 1.22 | amd64 |
| Windows | 1.21 | amd64 |
-| Windows | 1.20 | amd64 |
+| Windows | 1.22 | 386 |
| Windows | 1.21 | 386 |
-| Windows | 1.20 | 386 |
While this project should work for other systems, no compatibility guarantees
are made for those systems currently.
## Getting Started
-You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/go/getting-started/).
+You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/).
OpenTelemetry's goal is to provide a single set of APIs to capture distributed
traces and metrics from your application and send them to an observability
@@ -96,12 +97,12 @@ export pipeline to send that telemetry to an observability platform.
All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters).
-| Exporter | Metrics | Traces |
-|---------------------------------------|:-------:|:------:|
-| [OTLP](./exporters/otlp/) | ✓ | ✓ |
-| [Prometheus](./exporters/prometheus/) | ✓ | |
-| [stdout](./exporters/stdout/) | ✓ | ✓ |
-| [Zipkin](./exporters/zipkin/) | | ✓ |
+| Exporter | Logs | Metrics | Traces |
+|---------------------------------------|:----:|:-------:|:------:|
+| [OTLP](./exporters/otlp/) | ✓ | ✓ | ✓ |
+| [Prometheus](./exporters/prometheus/) | | ✓ | |
+| [stdout](./exporters/stdout/) | ✓ | ✓ | ✓ |
+| [Zipkin](./exporters/zipkin/) | | | ✓ |
## Contributing
diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md
index 82ce3ee46a1..940f57f3d87 100644
--- a/vendor/go.opentelemetry.io/otel/RELEASING.md
+++ b/vendor/go.opentelemetry.io/otel/RELEASING.md
@@ -27,6 +27,12 @@ You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org
You can check/report problems with `gorelease` [here](https://golang.org/issues/26420).
+## Verify changes for contrib repository
+
+If the changes in the main repository are going to affect the contrib repository, it is important to verify that the changes are compatible with the contrib repository.
+
+Follow [the steps](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md#verify-otel-changes) in the contrib repository to verify OTel changes.
+
## Pre-Release
First, decide which module sets will be released and update their versions
@@ -123,12 +129,12 @@ Once verified be sure to [make a release for the `contrib` repository](https://g
### Website Documentation
-Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/instrumentation/go].
+Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go].
Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate.
[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions
-[Go instrumentation documentation]: https://opentelemetry.io/docs/instrumentation/go/
-[content/en/docs/instrumentation/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/go
+[Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/
+[content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go
### Demo Repository
diff --git a/vendor/go.opentelemetry.io/otel/attribute/README.md b/vendor/go.opentelemetry.io/otel/attribute/README.md
new file mode 100644
index 00000000000..5b3da8f14ca
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/attribute/README.md
@@ -0,0 +1,3 @@
+# Attribute
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/attribute)](https://pkg.go.dev/go.opentelemetry.io/otel/attribute)
diff --git a/vendor/go.opentelemetry.io/otel/attribute/doc.go b/vendor/go.opentelemetry.io/otel/attribute/doc.go
index dafe7424dfb..eef51ebc2a2 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/doc.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package attribute provides key and value attributes.
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
index fe2bc5766cf..318e42fcabe 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/encoder.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go
index 638c213d59a..be9cd922d87 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/filter.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
index 841b271fb7d..f2ba89ce4bc 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/iterator.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go
index 0656a04e43b..d9a22c65020 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/key.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/key.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go
index 1ddf3ce0580..3028f9a40f8 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/kv.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go
index 9f9303d4f15..bff9c7fdbb9 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/set.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/set.go
@@ -1,24 +1,14 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
+ "cmp"
"encoding/json"
"reflect"
+ "slices"
"sort"
- "sync"
)
type (
@@ -26,23 +16,33 @@ type (
// immutable set of attributes, with an internal cache for storing
// attribute encodings.
//
- // This type supports the Equivalent method of comparison using values of
- // type Distinct.
+ // This type will remain comparable for backwards compatibility. The
+ // equivalence of Sets across versions is not guaranteed to be stable.
+ // Prior versions may find two Sets to be equal or not when compared
+ // directly (i.e. ==), but subsequent versions may not. Users should use
+ // the Equals method to ensure stable equivalence checking.
+ //
+ // Users should also use the Distinct returned from Equivalent as a map key
+ // instead of a Set directly. In addition to that type providing guarantees
+ // on stable equivalence, it may also provide performance improvements.
Set struct {
equivalent Distinct
}
- // Distinct wraps a variable-size array of KeyValue, constructed with keys
- // in sorted order. This can be used as a map key or for equality checking
- // between Sets.
+ // Distinct is a unique identifier of a Set.
+ //
+ // Distinct is designed to be ensures equivalence stability: comparisons
+ // will return the save value across versions. For this reason, Distinct
+ // should always be used as a map key instead of a Set.
Distinct struct {
iface interface{}
}
- // Sortable implements sort.Interface, used for sorting KeyValue. This is
- // an exported type to support a memory optimization. A pointer to one of
- // these is needed for the call to sort.Stable(), which the caller may
- // provide in order to avoid an allocation. See NewSetWithSortable().
+ // Sortable implements sort.Interface, used for sorting KeyValue.
+ //
+ // Deprecated: This type is no longer used. It was added as a performance
+ // optimization for Go < 1.21 that is no longer needed (Go < 1.21 is no
+ // longer supported by the module).
Sortable []KeyValue
)
@@ -56,12 +56,6 @@ var (
iface: [0]KeyValue{},
},
}
-
- // sortables is a pool of Sortables used to create Sets with a user does
- // not provide one.
- sortables = sync.Pool{
- New: func() interface{} { return new(Sortable) },
- }
)
// EmptySet returns a reference to a Set with no elements.
@@ -187,13 +181,7 @@ func empty() Set {
// Except for empty sets, this method adds an additional allocation compared
// with calls that include a Sortable.
func NewSet(kvs ...KeyValue) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- srt := sortables.Get().(*Sortable)
- s, _ := NewSetWithSortableFiltered(kvs, srt, nil)
- sortables.Put(srt)
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -201,12 +189,10 @@ func NewSet(kvs ...KeyValue) Set {
// NewSetWithSortableFiltered for more details.
//
// This call includes a Sortable option as a memory optimization.
-func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- s, _ := NewSetWithSortableFiltered(kvs, tmp, nil)
+//
+// Deprecated: Use [NewSet] instead.
+func NewSetWithSortable(kvs []KeyValue, _ *Sortable) Set {
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -220,10 +206,37 @@ func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
if len(kvs) == 0 {
return empty(), nil
}
- srt := sortables.Get().(*Sortable)
- s, filtered := NewSetWithSortableFiltered(kvs, srt, filter)
- sortables.Put(srt)
- return s, filtered
+
+ // Stable sort so the following de-duplication can implement
+ // last-value-wins semantics.
+ slices.SortStableFunc(kvs, func(a, b KeyValue) int {
+ return cmp.Compare(a.Key, b.Key)
+ })
+
+ position := len(kvs) - 1
+ offset := position - 1
+
+ // The requirements stated above require that the stable
+ // result be placed in the end of the input slice, while
+ // overwritten values are swapped to the beginning.
+ //
+ // De-duplicate with last-value-wins semantics. Preserve
+ // duplicate values at the beginning of the input slice.
+ for ; offset >= 0; offset-- {
+ if kvs[offset].Key == kvs[position].Key {
+ continue
+ }
+ position--
+ kvs[offset], kvs[position] = kvs[position], kvs[offset]
+ }
+ kvs = kvs[position:]
+
+ if filter != nil {
+ if div := filteredToFront(kvs, filter); div != 0 {
+ return Set{equivalent: computeDistinct(kvs[div:])}, kvs[:div]
+ }
+ }
+ return Set{equivalent: computeDistinct(kvs)}, nil
}
// NewSetWithSortableFiltered returns a new Set.
@@ -249,82 +262,71 @@ func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
//
// The second []KeyValue return value is a list of attributes that were
// excluded by the Filter (if non-nil).
-func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty(), nil
- }
-
- *tmp = kvs
-
- // Stable sort so the following de-duplication can implement
- // last-value-wins semantics.
- sort.Stable(tmp)
-
- *tmp = nil
-
- position := len(kvs) - 1
- offset := position - 1
-
- // The requirements stated above require that the stable
- // result be placed in the end of the input slice, while
- // overwritten values are swapped to the beginning.
- //
- // De-duplicate with last-value-wins semantics. Preserve
- // duplicate values at the beginning of the input slice.
- for ; offset >= 0; offset-- {
- if kvs[offset].Key == kvs[position].Key {
- continue
- }
- position--
- kvs[offset], kvs[position] = kvs[position], kvs[offset]
- }
- if filter != nil {
- return filterSet(kvs[position:], filter)
- }
- return Set{
- equivalent: computeDistinct(kvs[position:]),
- }, nil
+//
+// Deprecated: Use [NewSetWithFiltered] instead.
+func NewSetWithSortableFiltered(kvs []KeyValue, _ *Sortable, filter Filter) (Set, []KeyValue) {
+ return NewSetWithFiltered(kvs, filter)
}
-// filterSet reorders kvs so that included keys are contiguous at the end of
-// the slice, while excluded keys precede the included keys.
-func filterSet(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
- var excluded []KeyValue
-
- // Move attributes that do not match the filter so they're adjacent before
- // calling computeDistinct().
- distinctPosition := len(kvs)
-
- // Swap indistinct keys forward and distinct keys toward the
- // end of the slice.
- offset := len(kvs) - 1
- for ; offset >= 0; offset-- {
- if filter(kvs[offset]) {
- distinctPosition--
- kvs[offset], kvs[distinctPosition] = kvs[distinctPosition], kvs[offset]
- continue
+// filteredToFront filters slice in-place using keep function. All KeyValues that need to
+// be removed are moved to the front. All KeyValues that need to be kept are
+// moved (in-order) to the back. The index for the first KeyValue to be kept is
+// returned.
+func filteredToFront(slice []KeyValue, keep Filter) int {
+ n := len(slice)
+ j := n
+ for i := n - 1; i >= 0; i-- {
+ if keep(slice[i]) {
+ j--
+ slice[i], slice[j] = slice[j], slice[i]
}
}
- excluded = kvs[:distinctPosition]
-
- return Set{
- equivalent: computeDistinct(kvs[distinctPosition:]),
- }, excluded
+ return j
}
// Filter returns a filtered copy of this Set. See the documentation for
// NewSetWithSortableFiltered for more details.
func (l *Set) Filter(re Filter) (Set, []KeyValue) {
if re == nil {
- return Set{
- equivalent: l.equivalent,
- }, nil
+ return *l, nil
+ }
+
+ // Iterate in reverse to the first attribute that will be filtered out.
+ n := l.Len()
+ first := n - 1
+ for ; first >= 0; first-- {
+ kv, _ := l.Get(first)
+ if !re(kv) {
+ break
+ }
+ }
+
+ // No attributes will be dropped, return the immutable Set l and nil.
+ if first < 0 {
+ return *l, nil
}
- // Note: This could be refactored to avoid the temporary slice
- // allocation, if it proves to be expensive.
- return filterSet(l.ToSlice(), re)
+ // Copy now that we know we need to return a modified set.
+ //
+ // Do not do this in-place on the underlying storage of *Set l. Sets are
+ // immutable and filtering should not change this.
+ slice := l.ToSlice()
+
+ // Don't re-iterate the slice if only slice[0] is filtered.
+ if first == 0 {
+ // It is safe to assume len(slice) >= 1 given we found at least one
+ // attribute above that needs to be filtered out.
+ return Set{equivalent: computeDistinct(slice[1:])}, slice[:1]
+ }
+
+ // Move the filtered slice[first] to the front (preserving order).
+ kv := slice[first]
+ copy(slice[1:first+1], slice[:first])
+ slice[0] = kv
+
+ // Do not re-evaluate re(slice[first+1:]).
+ div := filteredToFront(slice[1:first+1], re) + 1
+ return Set{equivalent: computeDistinct(slice[div:])}, slice[:div]
}
// computeDistinct returns a Distinct using either the fixed- or
@@ -404,7 +406,7 @@ func (l *Set) MarshalJSON() ([]byte, error) {
return json.Marshal(l.equivalent.iface)
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Set.
func (l Set) MarshalLog() interface{} {
kvs := make(map[string]string)
for _, kv := range l.ToSlice() {
diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go
index cb21dd5c096..9ea0ecbbd27 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/value.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/value.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
@@ -242,15 +231,27 @@ func (v Value) Emit() string {
case BOOL:
return strconv.FormatBool(v.AsBool())
case INT64SLICE:
- return fmt.Sprint(v.asInt64Slice())
+ j, err := json.Marshal(v.asInt64Slice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asInt64Slice())
+ }
+ return string(j)
case INT64:
return strconv.FormatInt(v.AsInt64(), 10)
case FLOAT64SLICE:
- return fmt.Sprint(v.asFloat64Slice())
+ j, err := json.Marshal(v.asFloat64Slice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asFloat64Slice())
+ }
+ return string(j)
case FLOAT64:
return fmt.Sprint(v.AsFloat64())
case STRINGSLICE:
- return fmt.Sprint(v.asStringSlice())
+ j, err := json.Marshal(v.asStringSlice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asStringSlice())
+ }
+ return string(j)
case STRING:
return v.stringly
default:
diff --git a/vendor/go.opentelemetry.io/otel/baggage/README.md b/vendor/go.opentelemetry.io/otel/baggage/README.md
new file mode 100644
index 00000000000..7d798435e12
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/baggage/README.md
@@ -0,0 +1,3 @@
+# Baggage
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/baggage)](https://pkg.go.dev/go.opentelemetry.io/otel/baggage)
diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
index 84532cb1da3..c40c896cc66 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
@@ -18,8 +7,8 @@ import (
"errors"
"fmt"
"net/url"
- "regexp"
"strings"
+ "unicode/utf8"
"go.opentelemetry.io/otel/internal/baggage"
)
@@ -32,16 +21,6 @@ const (
listDelimiter = ","
keyValueDelimiter = "="
propertyDelimiter = ";"
-
- keyDef = `([\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5a\x5e-\x7a\x7c\x7e]+)`
- valueDef = `([\x21\x23-\x2b\x2d-\x3a\x3c-\x5B\x5D-\x7e]*)`
- keyValueDef = `\s*` + keyDef + `\s*` + keyValueDelimiter + `\s*` + valueDef + `\s*`
-)
-
-var (
- keyRe = regexp.MustCompile(`^` + keyDef + `$`)
- valueRe = regexp.MustCompile(`^` + valueDef + `$`)
- propertyRe = regexp.MustCompile(`^(?:\s*` + keyDef + `\s*|` + keyValueDef + `)$`)
)
var (
@@ -67,7 +46,7 @@ type Property struct {
//
// If key is invalid, an error will be returned.
func NewKeyProperty(key string) (Property, error) {
- if !keyRe.MatchString(key) {
+ if !validateKey(key) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
}
@@ -77,14 +56,29 @@ func NewKeyProperty(key string) (Property, error) {
// NewKeyValueProperty returns a new Property for key with value.
//
-// If key or value are invalid, an error will be returned.
+// The passed key must be compliant with W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
+//
+// Notice: Consider using [NewKeyValuePropertyRaw] instead
+// that does not require percent-encoding of the value.
func NewKeyValueProperty(key, value string) (Property, error) {
- if !keyRe.MatchString(key) {
- return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
+ if !validateValue(value) {
+ return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
}
- if !valueRe.MatchString(value) {
+ decodedValue, err := url.PathUnescape(value)
+ if err != nil {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
}
+ return NewKeyValuePropertyRaw(key, decodedValue)
+}
+
+// NewKeyValuePropertyRaw returns a new Property for key with value.
+//
+// The passed key must be compliant with W3C Baggage specification.
+func NewKeyValuePropertyRaw(key, value string) (Property, error) {
+ if !validateKey(key) {
+ return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
+ }
p := Property{
key: key,
@@ -106,20 +100,11 @@ func parseProperty(property string) (Property, error) {
return newInvalidProperty(), nil
}
- match := propertyRe.FindStringSubmatch(property)
- if len(match) != 4 {
+ p, ok := parsePropertyInternal(property)
+ if !ok {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property)
}
- var p Property
- if match[1] != "" {
- p.key = match[1]
- } else {
- p.key = match[2]
- p.value = match[3]
- p.hasValue = true
- }
-
return p, nil
}
@@ -130,12 +115,9 @@ func (p Property) validate() error {
return fmt.Errorf("invalid property: %w", err)
}
- if !keyRe.MatchString(p.key) {
+ if !validateKey(p.key) {
return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key))
}
- if p.hasValue && !valueRe.MatchString(p.value) {
- return errFunc(fmt.Errorf("%w: %q", errInvalidValue, p.value))
- }
if !p.hasValue && p.value != "" {
return errFunc(errors.New("inconsistent value"))
}
@@ -154,11 +136,11 @@ func (p Property) Value() (string, bool) {
return p.value, p.hasValue
}
-// String encodes Property into a string compliant with the W3C Baggage
+// String encodes Property into a header string compliant with the W3C Baggage
// specification.
func (p Property) String() string {
if p.hasValue {
- return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, p.value)
+ return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, valueEscape(p.value))
}
return p.key
}
@@ -218,7 +200,7 @@ func (p properties) validate() error {
return nil
}
-// String encodes properties into a string compliant with the W3C Baggage
+// String encodes properties into a header string compliant with the W3C Baggage
// specification.
func (p properties) String() string {
props := make([]string, len(p))
@@ -240,11 +222,28 @@ type Member struct {
hasData bool
}
-// NewMember returns a new Member from the passed arguments. The key will be
-// used directly while the value will be url decoded after validation. An error
-// is returned if the created Member would be invalid according to the W3C
-// Baggage specification.
+// NewMember returns a new Member from the passed arguments.
+//
+// The passed key must be compliant with W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
+//
+// Notice: Consider using [NewMemberRaw] instead
+// that does not require percent-encoding of the value.
func NewMember(key, value string, props ...Property) (Member, error) {
+ if !validateValue(value) {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ decodedValue, err := url.PathUnescape(value)
+ if err != nil {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ return NewMemberRaw(key, decodedValue, props...)
+}
+
+// NewMemberRaw returns a new Member from the passed arguments.
+//
+// The passed key must be compliant with W3C Baggage specification.
+func NewMemberRaw(key, value string, props ...Property) (Member, error) {
m := Member{
key: key,
value: value,
@@ -254,11 +253,6 @@ func NewMember(key, value string, props ...Property) (Member, error) {
if err := m.validate(); err != nil {
return newInvalidMember(), err
}
- decodedValue, err := url.PathUnescape(value)
- if err != nil {
- return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
- }
- m.value = decodedValue
return m, nil
}
@@ -274,11 +268,7 @@ func parseMember(member string) (Member, error) {
return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n)
}
- var (
- key, value string
- props properties
- )
-
+ var props properties
keyValue, properties, found := strings.Cut(member, propertyDelimiter)
if found {
// Parse the member properties.
@@ -299,36 +289,34 @@ func parseMember(member string) (Member, error) {
}
// "Leading and trailing whitespaces are allowed but MUST be trimmed
// when converting the header into a data structure."
- key = strings.TrimSpace(k)
- var err error
- value, err = url.PathUnescape(strings.TrimSpace(v))
- if err != nil {
- return newInvalidMember(), fmt.Errorf("%w: %q", err, value)
- }
- if !keyRe.MatchString(key) {
+ key := strings.TrimSpace(k)
+ if !validateKey(key) {
return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key)
}
- if !valueRe.MatchString(value) {
- return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+
+ val := strings.TrimSpace(v)
+ if !validateValue(val) {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v)
}
+ // Decode a percent-encoded value.
+ value, err := url.PathUnescape(val)
+ if err != nil {
+ return newInvalidMember(), fmt.Errorf("%w: %w", errInvalidValue, err)
+ }
return Member{key: key, value: value, properties: props, hasData: true}, nil
}
// validate ensures m conforms to the W3C Baggage specification.
-// A key is just an ASCII string, but a value must be URL encoded UTF-8,
-// returning an error otherwise.
+// A key must be an ASCII string, returning an error otherwise.
func (m Member) validate() error {
if !m.hasData {
return fmt.Errorf("%w: %q", errInvalidMember, m)
}
- if !keyRe.MatchString(m.key) {
+ if !validateKey(m.key) {
return fmt.Errorf("%w: %q", errInvalidKey, m.key)
}
- if !valueRe.MatchString(m.value) {
- return fmt.Errorf("%w: %q", errInvalidValue, m.value)
- }
return m.properties.validate()
}
@@ -341,13 +329,15 @@ func (m Member) Value() string { return m.value }
// Properties returns a copy of the Member properties.
func (m Member) Properties() []Property { return m.properties.Copy() }
-// String encodes Member into a string compliant with the W3C Baggage
+// String encodes Member into a header string compliant with the W3C Baggage
// specification.
func (m Member) String() string {
- // A key is just an ASCII string, but a value is URL encoded UTF-8.
- s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, url.QueryEscape(m.value))
+ // A key is just an ASCII string. A value is restricted to be
+ // US-ASCII characters excluding CTLs, whitespace,
+ // DQUOTE, comma, semicolon, and backslash.
+ s := m.key + keyValueDelimiter + valueEscape(m.value)
if len(m.properties) > 0 {
- s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String())
+ s += propertyDelimiter + m.properties.String()
}
return s
}
@@ -536,9 +526,8 @@ func (b Baggage) Len() int {
return len(b.list)
}
-// String encodes Baggage into a string compliant with the W3C Baggage
-// specification. The returned string will be invalid if the Baggage contains
-// any invalid list-members.
+// String encodes Baggage into a header string compliant with the W3C Baggage
+// specification.
func (b Baggage) String() string {
members := make([]string, 0, len(b.list))
for k, v := range b.list {
@@ -550,3 +539,372 @@ func (b Baggage) String() string {
}
return strings.Join(members, listDelimiter)
}
+
+// parsePropertyInternal attempts to decode a Property from the passed string.
+// It follows the spec at https://www.w3.org/TR/baggage/#definition.
+func parsePropertyInternal(s string) (p Property, ok bool) {
+ // For the entire function we will use " key = value " as an example.
+ // Attempting to parse the key.
+ // First skip spaces at the beginning "< >key = value " (they could be empty).
+ index := skipSpace(s, 0)
+
+ // Parse the key: " = value ".
+ keyStart := index
+ keyEnd := index
+ for _, c := range s[keyStart:] {
+ if !validateKeyChar(c) {
+ break
+ }
+ keyEnd++
+ }
+
+ // If we couldn't find any valid key character,
+ // it means the key is either empty or invalid.
+ if keyStart == keyEnd {
+ return
+ }
+
+ // Skip spaces after the key: " key< >= value ".
+ index = skipSpace(s, keyEnd)
+
+ if index == len(s) {
+ // A key can have no value, like: " key ".
+ ok = true
+ p.key = s[keyStart:keyEnd]
+ return
+ }
+
+ // If we have not reached the end and we can't find the '=' delimiter,
+ // it means the property is invalid.
+ if s[index] != keyValueDelimiter[0] {
+ return
+ }
+
+ // Attempting to parse the value.
+ // Match: " key =< >value ".
+ index = skipSpace(s, index+1)
+
+ // Match the value string: " key = ".
+ // A valid property can be: " key =".
+ // Therefore, we don't have to check if the value is empty.
+ valueStart := index
+ valueEnd := index
+ for _, c := range s[valueStart:] {
+ if !validateValueChar(c) {
+ break
+ }
+ valueEnd++
+ }
+
+ // Skip all trailing whitespaces: " key = value< >".
+ index = skipSpace(s, valueEnd)
+
+ // If after looking for the value and skipping whitespaces
+ // we have not reached the end, it means the property is
+ // invalid, something like: " key = value value1".
+ if index != len(s) {
+ return
+ }
+
+ // Decode a percent-encoded value.
+ value, err := url.PathUnescape(s[valueStart:valueEnd])
+ if err != nil {
+ return
+ }
+
+ ok = true
+ p.key = s[keyStart:keyEnd]
+ p.hasValue = true
+
+ p.value = value
+ return
+}
+
+func skipSpace(s string, offset int) int {
+ i := offset
+ for ; i < len(s); i++ {
+ c := s[i]
+ if c != ' ' && c != '\t' {
+ break
+ }
+ }
+ return i
+}
+
+var safeKeyCharset = [utf8.RuneSelf]bool{
+ // 0x23 to 0x27
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+
+ // 0x30 to 0x39
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+
+ // 0x41 to 0x5a
+ 'A': true,
+ 'B': true,
+ 'C': true,
+ 'D': true,
+ 'E': true,
+ 'F': true,
+ 'G': true,
+ 'H': true,
+ 'I': true,
+ 'J': true,
+ 'K': true,
+ 'L': true,
+ 'M': true,
+ 'N': true,
+ 'O': true,
+ 'P': true,
+ 'Q': true,
+ 'R': true,
+ 'S': true,
+ 'T': true,
+ 'U': true,
+ 'V': true,
+ 'W': true,
+ 'X': true,
+ 'Y': true,
+ 'Z': true,
+
+ // 0x5e to 0x7a
+ '^': true,
+ '_': true,
+ '`': true,
+ 'a': true,
+ 'b': true,
+ 'c': true,
+ 'd': true,
+ 'e': true,
+ 'f': true,
+ 'g': true,
+ 'h': true,
+ 'i': true,
+ 'j': true,
+ 'k': true,
+ 'l': true,
+ 'm': true,
+ 'n': true,
+ 'o': true,
+ 'p': true,
+ 'q': true,
+ 'r': true,
+ 's': true,
+ 't': true,
+ 'u': true,
+ 'v': true,
+ 'w': true,
+ 'x': true,
+ 'y': true,
+ 'z': true,
+
+ // remainder
+ '!': true,
+ '*': true,
+ '+': true,
+ '-': true,
+ '.': true,
+ '|': true,
+ '~': true,
+}
+
+func validateKey(s string) bool {
+ if len(s) == 0 {
+ return false
+ }
+
+ for _, c := range s {
+ if !validateKeyChar(c) {
+ return false
+ }
+ }
+
+ return true
+}
+
+func validateKeyChar(c int32) bool {
+ return c >= 0 && c < int32(utf8.RuneSelf) && safeKeyCharset[c]
+}
+
+func validateValue(s string) bool {
+ for _, c := range s {
+ if !validateValueChar(c) {
+ return false
+ }
+ }
+
+ return true
+}
+
+var safeValueCharset = [utf8.RuneSelf]bool{
+ '!': true, // 0x21
+
+ // 0x23 to 0x2b
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+ '(': true,
+ ')': true,
+ '*': true,
+ '+': true,
+
+ // 0x2d to 0x3a
+ '-': true,
+ '.': true,
+ '/': true,
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+ ':': true,
+
+ // 0x3c to 0x5b
+ '<': true, // 0x3C
+ '=': true, // 0x3D
+ '>': true, // 0x3E
+ '?': true, // 0x3F
+ '@': true, // 0x40
+ 'A': true, // 0x41
+ 'B': true, // 0x42
+ 'C': true, // 0x43
+ 'D': true, // 0x44
+ 'E': true, // 0x45
+ 'F': true, // 0x46
+ 'G': true, // 0x47
+ 'H': true, // 0x48
+ 'I': true, // 0x49
+ 'J': true, // 0x4A
+ 'K': true, // 0x4B
+ 'L': true, // 0x4C
+ 'M': true, // 0x4D
+ 'N': true, // 0x4E
+ 'O': true, // 0x4F
+ 'P': true, // 0x50
+ 'Q': true, // 0x51
+ 'R': true, // 0x52
+ 'S': true, // 0x53
+ 'T': true, // 0x54
+ 'U': true, // 0x55
+ 'V': true, // 0x56
+ 'W': true, // 0x57
+ 'X': true, // 0x58
+ 'Y': true, // 0x59
+ 'Z': true, // 0x5A
+ '[': true, // 0x5B
+
+ // 0x5d to 0x7e
+ ']': true, // 0x5D
+ '^': true, // 0x5E
+ '_': true, // 0x5F
+ '`': true, // 0x60
+ 'a': true, // 0x61
+ 'b': true, // 0x62
+ 'c': true, // 0x63
+ 'd': true, // 0x64
+ 'e': true, // 0x65
+ 'f': true, // 0x66
+ 'g': true, // 0x67
+ 'h': true, // 0x68
+ 'i': true, // 0x69
+ 'j': true, // 0x6A
+ 'k': true, // 0x6B
+ 'l': true, // 0x6C
+ 'm': true, // 0x6D
+ 'n': true, // 0x6E
+ 'o': true, // 0x6F
+ 'p': true, // 0x70
+ 'q': true, // 0x71
+ 'r': true, // 0x72
+ 's': true, // 0x73
+ 't': true, // 0x74
+ 'u': true, // 0x75
+ 'v': true, // 0x76
+ 'w': true, // 0x77
+ 'x': true, // 0x78
+ 'y': true, // 0x79
+ 'z': true, // 0x7A
+ '{': true, // 0x7B
+ '|': true, // 0x7C
+ '}': true, // 0x7D
+ '~': true, // 0x7E
+}
+
+func validateValueChar(c int32) bool {
+ return c >= 0 && c < int32(utf8.RuneSelf) && safeValueCharset[c]
+}
+
+// valueEscape escapes the string so it can be safely placed inside a baggage value,
+// replacing special characters with %XX sequences as needed.
+//
+// The implementation is based on:
+// https://github.com/golang/go/blob/f6509cf5cdbb5787061b784973782933c47f1782/src/net/url/url.go#L285.
+func valueEscape(s string) string {
+ hexCount := 0
+ for i := 0; i < len(s); i++ {
+ c := s[i]
+ if shouldEscape(c) {
+ hexCount++
+ }
+ }
+
+ if hexCount == 0 {
+ return s
+ }
+
+ var buf [64]byte
+ var t []byte
+
+ required := len(s) + 2*hexCount
+ if required <= len(buf) {
+ t = buf[:required]
+ } else {
+ t = make([]byte, required)
+ }
+
+ j := 0
+ for i := 0; i < len(s); i++ {
+ c := s[i]
+ if shouldEscape(s[i]) {
+ const upperhex = "0123456789ABCDEF"
+ t[j] = '%'
+ t[j+1] = upperhex[c>>4]
+ t[j+2] = upperhex[c&15]
+ j += 3
+ } else {
+ t[j] = c
+ j++
+ }
+ }
+
+ return string(t)
+}
+
+// shouldEscape returns true if the specified byte should be escaped when
+// appearing in a baggage value string.
+func shouldEscape(c byte) bool {
+ if c == '%' {
+ // The percent character must be encoded so that percent-encoding can work.
+ return true
+ }
+ return !validateValueChar(int32(c))
+}
diff --git a/vendor/go.opentelemetry.io/otel/baggage/context.go b/vendor/go.opentelemetry.io/otel/baggage/context.go
index 24b34b7564a..a572461a05f 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/baggage/doc.go b/vendor/go.opentelemetry.io/otel/baggage/doc.go
index 4545100df67..b51d87cab70 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/doc.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides functionality for storing and retrieving
diff --git a/vendor/go.opentelemetry.io/otel/codes/README.md b/vendor/go.opentelemetry.io/otel/codes/README.md
new file mode 100644
index 00000000000..24c52b387d2
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/codes/README.md
@@ -0,0 +1,3 @@
+# Codes
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/codes)](https://pkg.go.dev/go.opentelemetry.io/otel/codes)
diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go
index 587ebae4e30..df29d96a6da 100644
--- a/vendor/go.opentelemetry.io/otel/codes/codes.go
+++ b/vendor/go.opentelemetry.io/otel/codes/codes.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package codes // import "go.opentelemetry.io/otel/codes"
diff --git a/vendor/go.opentelemetry.io/otel/codes/doc.go b/vendor/go.opentelemetry.io/otel/codes/doc.go
index 4e328fbb4b3..ee8db448b8b 100644
--- a/vendor/go.opentelemetry.io/otel/codes/doc.go
+++ b/vendor/go.opentelemetry.io/otel/codes/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package codes defines the canonical error codes used by OpenTelemetry.
diff --git a/vendor/go.opentelemetry.io/otel/doc.go b/vendor/go.opentelemetry.io/otel/doc.go
index daa36c89dc6..441c595014d 100644
--- a/vendor/go.opentelemetry.io/otel/doc.go
+++ b/vendor/go.opentelemetry.io/otel/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otel provides global access to the OpenTelemetry API. The subpackages of
@@ -22,7 +11,7 @@ transmitted anywhere. An implementation of the OpenTelemetry SDK, like the
default SDK implementation (go.opentelemetry.io/otel/sdk), and associated
exporters are used to process and transport this data.
-To read the getting started guide, see https://opentelemetry.io/docs/go/getting-started/.
+To read the getting started guide, see https://opentelemetry.io/docs/languages/go/getting-started/.
To read more about tracing, see go.opentelemetry.io/otel/trace.
diff --git a/vendor/go.opentelemetry.io/otel/error_handler.go b/vendor/go.opentelemetry.io/otel/error_handler.go
index 72fad85412b..67414c71e05 100644
--- a/vendor/go.opentelemetry.io/otel/error_handler.go
+++ b/vendor/go.opentelemetry.io/otel/error_handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
new file mode 100644
index 00000000000..50802d5aee6
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
@@ -0,0 +1,3 @@
+# OTLP Trace Exporter
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlptrace)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace)
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go
index dbb40cf5820..3c1a625c067 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go
index 9e642235ade..09ad5eadb6f 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otlptrace contains abstractions for OTLP span exporters.
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
index b46a38d60ab..3f0a518ae0f 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
@@ -104,7 +93,7 @@ func NewUnstarted(client Client) *Exporter {
}
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Exporter.
func (e *Exporter) MarshalLog() interface{} {
return struct {
Type string
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
index ec74f1aad75..4571a5ca397 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go
index 7aaec38d22a..f6dd3decc90 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go
index 05a1f78adbc..db7b698a566 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go
index b83cbd72478..c3c69c5a0d6 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
@@ -121,6 +110,7 @@ func span(sd tracesdk.ReadOnlySpan) *tracepb.Span {
if psid := sd.Parent().SpanID(); psid.IsValid() {
s.ParentSpanId = psid[:]
}
+ s.Flags = buildSpanFlags(sd.Parent())
return s
}
@@ -157,16 +147,28 @@ func links(links []tracesdk.Link) []*tracepb.Span_Link {
tid := otLink.SpanContext.TraceID()
sid := otLink.SpanContext.SpanID()
+ flags := buildSpanFlags(otLink.SpanContext)
+
sl = append(sl, &tracepb.Span_Link{
TraceId: tid[:],
SpanId: sid[:],
Attributes: KeyValues(otLink.Attributes),
DroppedAttributesCount: uint32(otLink.DroppedAttributeCount),
+ Flags: flags,
})
}
return sl
}
+func buildSpanFlags(sc trace.SpanContext) uint32 {
+ flags := tracepb.SpanFlags_SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK
+ if sc.IsRemote() {
+ flags |= tracepb.SpanFlags_SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK
+ }
+
+ return uint32(flags)
+}
+
// spanEvents transforms span Events to an OTLP span events.
func spanEvents(es []tracesdk.Event) []*tracepb.Span_Event {
if len(es) == 0 {
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md
new file mode 100644
index 00000000000..5309bb7cb1c
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md
@@ -0,0 +1,3 @@
+# OTLP Trace gRPC Exporter
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc)
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
index b4cc21d7a3c..3993df927de 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
@@ -89,11 +78,11 @@ func newClient(opts ...Option) *client {
}
// Start establishes a gRPC connection to the collector.
-func (c *client) Start(ctx context.Context) error {
+func (c *client) Start(context.Context) error {
if c.conn == nil {
// If the caller did not provide a ClientConn when the client was
// created, create one using the configuration they did provide.
- conn, err := grpc.DialContext(ctx, c.endpoint, c.dialOpts...)
+ conn, err := grpc.NewClient(c.endpoint, c.dialOpts...)
if err != nil {
return err
}
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go
index 1f514ef9ea3..e783b57ac4b 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otlptracegrpc provides an OTLP span exporter using gRPC.
@@ -28,7 +17,7 @@ The value may additionally a port, a scheme, and a path.
The value accepts "http" and "https" scheme.
The value should not contain a query string or fragment.
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT takes precedence over OTEL_EXPORTER_OTLP_ENDPOINT.
-The configuration can be overridden by [WithEndpoint], [WithInsecure], [WithGRPCConn] options.
+The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithGRPCConn] options.
OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_TRACES_INSECURE (default: "false") -
setting "true" disables client transport security for the exporter's gRPC connection.
@@ -40,7 +29,7 @@ The configuration can be overridden by [WithInsecure], [WithGRPCConn] options.
OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS (default: none) -
key-value pairs used as gRPC metadata associated with gRPC requests.
-The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format],
+The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format],
except that additional semi-colon delimited metadata is not supported.
Example value: "key1=value1,key2=value2".
OTEL_EXPORTER_OTLP_TRACES_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS.
@@ -63,12 +52,12 @@ OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_C
The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options.
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE (default: none) -
-the filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format.
+the filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format.
OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE.
The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options.
OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY (default: none) -
-the filepath to the clients private key to use in mTLS communication in PEM format.
+the filepath to the client's private key to use in mTLS communication in PEM format.
OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY.
The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] option.
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go
index 89af41002f7..b826b84247e 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go
index 5530119e4cf..9513c0a57ca 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/envconfig/envconfig.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go
index 1fb29061894..97cd6c54f70 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
index 32f6dddb4f6..7bb189a94bc 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go
index dddb1f334de..8f84a799632 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go
@@ -2,24 +2,15 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
import (
"crypto/tls"
"fmt"
+ "net/http"
+ "net/url"
"path"
"strings"
"time"
@@ -32,6 +23,7 @@ import (
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry"
+ "go.opentelemetry.io/otel/internal/global"
)
const (
@@ -44,6 +36,10 @@ const (
)
type (
+ // HTTPTransportProxyFunc is a function that resolves which URL to use as proxy for a given request.
+ // This type is compatible with `http.Transport.Proxy` and can be used to set a custom proxy function to the OTLP HTTP client.
+ HTTPTransportProxyFunc func(*http.Request) (*url.URL, error)
+
SignalConfig struct {
Endpoint string
Insecure bool
@@ -55,6 +51,8 @@ type (
// gRPC configurations
GRPCCredentials credentials.TransportCredentials
+
+ Proxy HTTPTransportProxyFunc
}
Config struct {
@@ -258,6 +256,9 @@ func NewGRPCOption(fn func(cfg Config) Config) GRPCOption {
// Generic Options
+// WithEndpoint configures the trace host and port only; endpoint should
+// resemble "example.com" or "localhost:4317". To configure the scheme and path,
+// use WithEndpointURL.
func WithEndpoint(endpoint string) GenericOption {
return newGenericOption(func(cfg Config) Config {
cfg.Traces.Endpoint = endpoint
@@ -265,6 +266,26 @@ func WithEndpoint(endpoint string) GenericOption {
})
}
+// WithEndpointURL configures the trace scheme, host, port, and path; the
+// provided value should resemble "https://example.com:4318/v1/traces".
+func WithEndpointURL(v string) GenericOption {
+ return newGenericOption(func(cfg Config) Config {
+ u, err := url.Parse(v)
+ if err != nil {
+ global.Error(err, "otlptrace: parse endpoint url", "url", v)
+ return cfg
+ }
+
+ cfg.Traces.Endpoint = u.Host
+ cfg.Traces.URLPath = u.Path
+ if u.Scheme != "https" {
+ cfg.Traces.Insecure = true
+ }
+
+ return cfg
+ })
+}
+
func WithCompression(compression Compression) GenericOption {
return newGenericOption(func(cfg Config) Config {
cfg.Traces.Compression = compression
@@ -323,3 +344,10 @@ func WithTimeout(duration time.Duration) GenericOption {
return cfg
})
}
+
+func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
+ return newGenericOption(func(cfg Config) Config {
+ cfg.Traces.Proxy = pf
+ return cfg
+ })
+}
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go
index d9dcdc96e7d..3d4f699d477 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go
index 19b6d4b21f9..38b97a01313 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go
index 076905e54bf..a12ea4c48eb 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/partialsuccess.go
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go
index 3ce7d6632b8..4f2113ae2cf 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/retry/retry.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package retry provides request retry functionality that can perform
// configurable exponential backoff for transient errors and honor any
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
index 17ffeaf6ef0..bbad0e6d01e 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
@@ -64,14 +53,48 @@ func WithInsecure() Option {
return wrappedOption{otlpconfig.WithInsecure()}
}
-// WithEndpoint sets the target endpoint the exporter will connect to. If
-// unset, localhost:4317 will be used as a default.
+// WithEndpoint sets the target endpoint (host and port) the Exporter will
+// connect to. The provided endpoint should resemble "example.com:4317" (no
+// scheme or path).
+//
+// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// environment variable is set, and this option is not passed, that variable
+// value will be used. If both are set, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// will take precedence.
+//
+// If both this option and WithEndpointURL are used, the last used option will
+// take precedence.
+//
+// By default, if an environment variable is not set, and this option is not
+// passed, "localhost:4317" will be used.
//
// This option has no effect if WithGRPCConn is used.
func WithEndpoint(endpoint string) Option {
return wrappedOption{otlpconfig.WithEndpoint(endpoint)}
}
+// WithEndpointURL sets the target endpoint URL (scheme, host, port, path)
+// the Exporter will connect to. The provided endpoint URL should resemble
+// "https://example.com:4318/v1/traces".
+//
+// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// environment variable is set, and this option is not passed, that variable
+// value will be used. If both are set, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// will take precedence.
+//
+// If both this option and WithEndpoint are used, the last used option will
+// take precedence.
+//
+// If an invalid URL is provided, the default value will be kept.
+//
+// By default, if an environment variable is not set, and this option is not
+// passed, "https://localhost:4317/v1/traces" will be used.
+//
+// This option has no effect if WithGRPCConn is used.
+func WithEndpointURL(u string) Option {
+ return wrappedOption{otlpconfig.WithEndpointURL(u)}
+}
+
// WithReconnectionPeriod set the minimum amount of time between connection
// attempts to the target endpoint.
//
@@ -131,6 +154,8 @@ func WithServiceConfig(serviceConfig string) Option {
// connection. The options here are appended to the internal grpc.DialOptions
// used so they will take precedence over any other internal grpc.DialOptions
// they might conflict with.
+// The [grpc.WithBlock], [grpc.WithTimeout], and [grpc.WithReturnConnectionError]
+// grpc.DialOptions are ignored.
//
// This option has no effect if WithGRPCConn is used.
func WithDialOption(opts ...grpc.DialOption) Option {
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
index 620ea88bf14..14ad8c33b48 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
// Version is the current release version of the OpenTelemetry OTLP trace exporter in use.
func Version() string {
- return "1.20.0"
+ return "1.28.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
index 9a58fb1d372..93e80ea306c 100644
--- a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
+++ b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
@@ -1,18 +1,7 @@
#!/usr/bin/env bash
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go
index 4115fe3bbb5..07623b67914 100644
--- a/vendor/go.opentelemetry.io/otel/handler.go
+++ b/vendor/go.opentelemetry.io/otel/handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
@@ -18,12 +7,8 @@ import (
"go.opentelemetry.io/otel/internal/global"
)
-var (
- // Compile-time check global.ErrDelegator implements ErrorHandler.
- _ ErrorHandler = (*global.ErrDelegator)(nil)
- // Compile-time check global.ErrLogger implements ErrorHandler.
- _ ErrorHandler = (*global.ErrLogger)(nil)
-)
+// Compile-time check global.ErrDelegator implements ErrorHandler.
+var _ ErrorHandler = (*global.ErrDelegator)(nil)
// GetErrorHandler returns the global ErrorHandler instance.
//
@@ -44,5 +29,5 @@ func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() }
// delegate errors to h.
func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) }
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) { global.Handle(err) }
+// Handle is a convenience function for GetErrorHandler().Handle(err).
+func Handle(err error) { global.GetErrorHandler().Handle(err) }
diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
index 622c3ee3f27..822d8479474 100644
--- a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
+++ b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package attribute provide several helper functions for some commonly used
@@ -25,33 +14,33 @@ import (
// BoolSliceValue converts a bool slice into an array with same elements as slice.
func BoolSliceValue(v []bool) interface{} {
var zero bool
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]bool), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// Int64SliceValue converts an int64 slice into an array with same elements as slice.
func Int64SliceValue(v []int64) interface{} {
var zero int64
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]int64), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// Float64SliceValue converts a float64 slice into an array with same elements as slice.
func Float64SliceValue(v []float64) interface{} {
var zero float64
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]float64), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// StringSliceValue converts a string slice into an array with same elements as slice.
func StringSliceValue(v []string) interface{} {
var zero string
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]string), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// AsBoolSlice converts a bool array into a slice into with same elements as array.
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
index b96e5408e69..b4f85f44a93 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides base types and functionality to store and retrieve
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
index 4469700d9cb..3aea9c491f0 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/internal/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go
index f532f07e9e5..4259f0320d4 100644
--- a/vendor/go.opentelemetry.io/otel/internal/gen.go
+++ b/vendor/go.opentelemetry.io/otel/internal/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
index 5e9b8304792..c657ff8e755 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/handler.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
@@ -1,38 +1,13 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
import (
"log"
- "os"
"sync/atomic"
)
-var (
- // GlobalErrorHandler provides an ErrorHandler that can be used
- // throughout an OpenTelemetry instrumented project. When a user
- // specified ErrorHandler is registered (`SetErrorHandler`) all calls to
- // `Handle` and will be delegated to the registered ErrorHandler.
- GlobalErrorHandler = defaultErrorHandler()
-
- // Compile-time check that delegator implements ErrorHandler.
- _ ErrorHandler = (*ErrDelegator)(nil)
- // Compile-time check that errLogger implements ErrorHandler.
- _ ErrorHandler = (*ErrLogger)(nil)
-)
-
// ErrorHandler handles irremediable events.
type ErrorHandler interface {
// Handle handles any error deemed irremediable by an OpenTelemetry
@@ -44,59 +19,18 @@ type ErrDelegator struct {
delegate atomic.Pointer[ErrorHandler]
}
-func (d *ErrDelegator) Handle(err error) {
- d.getDelegate().Handle(err)
-}
+// Compile-time check that delegator implements ErrorHandler.
+var _ ErrorHandler = (*ErrDelegator)(nil)
-func (d *ErrDelegator) getDelegate() ErrorHandler {
- return *d.delegate.Load()
+func (d *ErrDelegator) Handle(err error) {
+ if eh := d.delegate.Load(); eh != nil {
+ (*eh).Handle(err)
+ return
+ }
+ log.Print(err)
}
// setDelegate sets the ErrorHandler delegate.
func (d *ErrDelegator) setDelegate(eh ErrorHandler) {
d.delegate.Store(&eh)
}
-
-func defaultErrorHandler() *ErrDelegator {
- d := &ErrDelegator{}
- d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)})
- return d
-}
-
-// ErrLogger logs errors if no delegate is set, otherwise they are delegated.
-type ErrLogger struct {
- l *log.Logger
-}
-
-// Handle logs err if no delegate is set, otherwise it is delegated.
-func (h *ErrLogger) Handle(err error) {
- h.l.Print(err)
-}
-
-// GetErrorHandler returns the global ErrorHandler instance.
-//
-// The default ErrorHandler instance returned will log all errors to STDERR
-// until an override ErrorHandler is set with SetErrorHandler. All
-// ErrorHandler returned prior to this will automatically forward errors to
-// the set instance instead of logging.
-//
-// Subsequent calls to SetErrorHandler after the first will not forward errors
-// to the new ErrorHandler for prior returned instances.
-func GetErrorHandler() ErrorHandler {
- return GlobalErrorHandler
-}
-
-// SetErrorHandler sets the global ErrorHandler to h.
-//
-// The first time this is called all ErrorHandler previously returned from
-// GetErrorHandler will send errors to h instead of the default logging
-// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
-// delegate errors to h.
-func SetErrorHandler(h ErrorHandler) {
- GlobalErrorHandler.setDelegate(h)
-}
-
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) {
- GetErrorHandler().Handle(err)
-}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
index ebb13c20678..3a0cc42f6a4 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -292,6 +281,32 @@ func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.Reco
}
}
+type sfGauge struct {
+ embedded.Float64Gauge
+
+ name string
+ opts []metric.Float64GaugeOption
+
+ delegate atomic.Value // metric.Float64Gauge
+}
+
+var _ metric.Float64Gauge = (*sfGauge)(nil)
+
+func (i *sfGauge) setDelegate(m metric.Meter) {
+ ctr, err := m.Float64Gauge(i.name, i.opts...)
+ if err != nil {
+ GetErrorHandler().Handle(err)
+ return
+ }
+ i.delegate.Store(ctr)
+}
+
+func (i *sfGauge) Record(ctx context.Context, x float64, opts ...metric.RecordOption) {
+ if ctr := i.delegate.Load(); ctr != nil {
+ ctr.(metric.Float64Gauge).Record(ctx, x, opts...)
+ }
+}
+
type siCounter struct {
embedded.Int64Counter
@@ -369,3 +384,29 @@ func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.Record
ctr.(metric.Int64Histogram).Record(ctx, x, opts...)
}
}
+
+type siGauge struct {
+ embedded.Int64Gauge
+
+ name string
+ opts []metric.Int64GaugeOption
+
+ delegate atomic.Value // metric.Int64Gauge
+}
+
+var _ metric.Int64Gauge = (*siGauge)(nil)
+
+func (i *siGauge) setDelegate(m metric.Meter) {
+ ctr, err := m.Int64Gauge(i.name, i.opts...)
+ if err != nil {
+ GetErrorHandler().Handle(err)
+ return
+ }
+ i.delegate.Store(ctr)
+}
+
+func (i *siGauge) Record(ctx context.Context, x int64, opts ...metric.RecordOption) {
+ if ctr := i.delegate.Load(); ctr != nil {
+ ctr.(metric.Int64Gauge).Record(ctx, x, opts...)
+ }
+}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
index c6f305a2b76..adbca7d3477 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -23,17 +12,20 @@ import (
"github.com/go-logr/stdr"
)
-// globalLogger is the logging interface used within the otel api and sdk provide details of the internals.
+// globalLogger holds a reference to the [logr.Logger] used within
+// go.opentelemetry.io/otel.
//
// The default logger uses stdr which is backed by the standard `log.Logger`
// interface. This logger will only show messages at the Error Level.
-var globalLogger atomic.Pointer[logr.Logger]
+var globalLogger = func() *atomic.Pointer[logr.Logger] {
+ l := stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))
-func init() {
- SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile)))
-}
+ p := new(atomic.Pointer[logr.Logger])
+ p.Store(&l)
+ return p
+}()
-// SetLogger overrides the globalLogger with l.
+// SetLogger sets the global Logger to l.
//
// To see Warn messages use a logger with `l.V(1).Enabled() == true`
// To see Info messages use a logger with `l.V(4).Enabled() == true`
@@ -42,28 +34,29 @@ func SetLogger(l logr.Logger) {
globalLogger.Store(&l)
}
-func getLogger() logr.Logger {
+// GetLogger returns the global logger.
+func GetLogger() logr.Logger {
return *globalLogger.Load()
}
// Info prints messages about the general state of the API or SDK.
// This should usually be less than 5 messages a minute.
func Info(msg string, keysAndValues ...interface{}) {
- getLogger().V(4).Info(msg, keysAndValues...)
+ GetLogger().V(4).Info(msg, keysAndValues...)
}
// Error prints messages about exceptional states of the API or SDK.
func Error(err error, msg string, keysAndValues ...interface{}) {
- getLogger().Error(err, msg, keysAndValues...)
+ GetLogger().Error(err, msg, keysAndValues...)
}
// Debug prints messages about all internal changes in the API or SDK.
func Debug(msg string, keysAndValues ...interface{}) {
- getLogger().V(8).Info(msg, keysAndValues...)
+ GetLogger().V(8).Info(msg, keysAndValues...)
}
// Warn prints messages about warnings in the API or SDK.
// Not an error but is likely more important than an informational event.
func Warn(msg string, keysAndValues ...interface{}) {
- getLogger().V(1).Info(msg, keysAndValues...)
+ GetLogger().V(1).Info(msg, keysAndValues...)
}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
index 0097db478c6..cfd1df9bfa2 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/meter.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -76,6 +65,7 @@ func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Me
key := il{
name: name,
version: c.InstrumentationVersion(),
+ schema: c.SchemaURL(),
}
if p.meters == nil {
@@ -130,9 +120,11 @@ func (m *meter) setDelegate(provider metric.MeterProvider) {
inst.setDelegate(meter)
}
- for e := m.registry.Front(); e != nil; e = e.Next() {
+ var n *list.Element
+ for e := m.registry.Front(); e != nil; e = n {
r := e.Value.(*registration)
r.setDelegate(meter)
+ n = e.Next()
m.registry.Remove(e)
}
@@ -173,6 +165,17 @@ func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOpti
return i, nil
}
+func (m *meter) Int64Gauge(name string, options ...metric.Int64GaugeOption) (metric.Int64Gauge, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Int64Gauge(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &siGauge{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) {
if del, ok := m.delegate.Load().(metric.Meter); ok {
return del.Int64ObservableCounter(name, options...)
@@ -239,6 +242,17 @@ func (m *meter) Float64Histogram(name string, options ...metric.Float64Histogram
return i, nil
}
+func (m *meter) Float64Gauge(name string, options ...metric.Float64GaugeOption) (metric.Float64Gauge, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64Gauge(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &sfGauge{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) {
if del, ok := m.delegate.Load().(metric.Meter); ok {
return del.Float64ObservableCounter(name, options...)
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
index 06bac35c2fe..38560ff9915 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go
index 7985005bcb6..204ea142a50 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/state.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -25,6 +14,10 @@ import (
)
type (
+ errorHandlerHolder struct {
+ eh ErrorHandler
+ }
+
tracerProviderHolder struct {
tp trace.TracerProvider
}
@@ -39,15 +32,59 @@ type (
)
var (
+ globalErrorHandler = defaultErrorHandler()
globalTracer = defaultTracerValue()
globalPropagators = defaultPropagatorsValue()
globalMeterProvider = defaultMeterProvider()
+ delegateErrorHandlerOnce sync.Once
delegateTraceOnce sync.Once
delegateTextMapPropagatorOnce sync.Once
delegateMeterOnce sync.Once
)
+// GetErrorHandler returns the global ErrorHandler instance.
+//
+// The default ErrorHandler instance returned will log all errors to STDERR
+// until an override ErrorHandler is set with SetErrorHandler. All
+// ErrorHandler returned prior to this will automatically forward errors to
+// the set instance instead of logging.
+//
+// Subsequent calls to SetErrorHandler after the first will not forward errors
+// to the new ErrorHandler for prior returned instances.
+func GetErrorHandler() ErrorHandler {
+ return globalErrorHandler.Load().(errorHandlerHolder).eh
+}
+
+// SetErrorHandler sets the global ErrorHandler to h.
+//
+// The first time this is called all ErrorHandler previously returned from
+// GetErrorHandler will send errors to h instead of the default logging
+// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
+// delegate errors to h.
+func SetErrorHandler(h ErrorHandler) {
+ current := GetErrorHandler()
+
+ if _, cOk := current.(*ErrDelegator); cOk {
+ if _, ehOk := h.(*ErrDelegator); ehOk && current == h {
+ // Do not assign to the delegate of the default ErrDelegator to be
+ // itself.
+ Error(
+ errors.New("no ErrorHandler delegate configured"),
+ "ErrorHandler remains its current value.",
+ )
+ return
+ }
+ }
+
+ delegateErrorHandlerOnce.Do(func() {
+ if def, ok := current.(*ErrDelegator); ok {
+ def.setDelegate(h)
+ }
+ })
+ globalErrorHandler.Store(errorHandlerHolder{eh: h})
+}
+
// TracerProvider is the internal implementation for global.TracerProvider.
func TracerProvider() trace.TracerProvider {
return globalTracer.Load().(tracerProviderHolder).tp
@@ -63,7 +100,7 @@ func SetTracerProvider(tp trace.TracerProvider) {
// to itself.
Error(
errors.New("no delegate configured in tracer provider"),
- "Setting tracer provider to it's current value. No delegate will be configured",
+ "Setting tracer provider to its current value. No delegate will be configured",
)
return
}
@@ -92,7 +129,7 @@ func SetTextMapPropagator(p propagation.TextMapPropagator) {
// delegate to itself.
Error(
errors.New("no delegate configured in text map propagator"),
- "Setting text map propagator to it's current value. No delegate will be configured",
+ "Setting text map propagator to its current value. No delegate will be configured",
)
return
}
@@ -123,7 +160,7 @@ func SetMeterProvider(mp metric.MeterProvider) {
// to itself.
Error(
errors.New("no delegate configured in meter provider"),
- "Setting meter provider to it's current value. No delegate will be configured",
+ "Setting meter provider to its current value. No delegate will be configured",
)
return
}
@@ -137,6 +174,12 @@ func SetMeterProvider(mp metric.MeterProvider) {
globalMeterProvider.Store(meterProviderHolder{mp: mp})
}
+func defaultErrorHandler() *atomic.Value {
+ v := &atomic.Value{}
+ v.Store(errorHandlerHolder{eh: &ErrDelegator{}})
+ return v
+}
+
func defaultTracerValue() *atomic.Value {
v := &atomic.Value{}
v.Store(tracerProviderHolder{tp: &tracerProvider{}})
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
index 3f61ec12a34..e31f442b48f 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/trace.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -97,6 +86,7 @@ func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
key := il{
name: name,
version: c.InstrumentationVersion(),
+ schema: c.SchemaURL(),
}
if p.tracers == nil {
@@ -112,10 +102,7 @@ func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
return t
}
-type il struct {
- name string
- version string
-}
+type il struct{ name, version, schema string }
// tracer is a placeholder for a trace.Tracer.
//
@@ -193,6 +180,9 @@ func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {}
// AddEvent does nothing.
func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {}
+// AddLink does nothing.
+func (nonRecordingSpan) AddLink(trace.Link) {}
+
// SetName does nothing.
func (nonRecordingSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
index e07e7940004..3e7bb3b3566 100644
--- a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
+++ b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
diff --git a/vendor/go.opentelemetry.io/otel/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal_logging.go
index c4f8acd5d83..6de7f2e4d88 100644
--- a/vendor/go.opentelemetry.io/otel/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric.go b/vendor/go.opentelemetry.io/otel/metric.go
index f955171951f..1e6473b32f3 100644
--- a/vendor/go.opentelemetry.io/otel/metric.go
+++ b/vendor/go.opentelemetry.io/otel/metric.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric/README.md b/vendor/go.opentelemetry.io/otel/metric/README.md
new file mode 100644
index 00000000000..0cf902e01f0
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/README.md
@@ -0,0 +1,3 @@
+# Metric API
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric)](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
index 072baa8e8d0..cf23db77803 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -50,7 +39,7 @@ type Float64ObservableCounter interface {
}
// Float64ObservableCounterConfig contains options for asynchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64ObservableCounterConfig struct {
description string
unit string
@@ -108,7 +97,7 @@ type Float64ObservableUpDownCounter interface {
}
// Float64ObservableUpDownCounterConfig contains options for asynchronous
-// counter instruments that record int64 values.
+// counter instruments that record float64 values.
type Float64ObservableUpDownCounterConfig struct {
description string
unit string
@@ -165,7 +154,7 @@ type Float64ObservableGauge interface {
}
// Float64ObservableGaugeConfig contains options for asynchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64ObservableGaugeConfig struct {
description string
unit string
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
index 9bd6ebf0205..c82ba5324e2 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/config.go b/vendor/go.opentelemetry.io/otel/metric/config.go
index 778ad2d748b..d9e3b13e4d1 100644
--- a/vendor/go.opentelemetry.io/otel/metric/config.go
+++ b/vendor/go.opentelemetry.io/otel/metric/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/doc.go b/vendor/go.opentelemetry.io/otel/metric/doc.go
index 54716e13b35..f153745b005 100644
--- a/vendor/go.opentelemetry.io/otel/metric/doc.go
+++ b/vendor/go.opentelemetry.io/otel/metric/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package metric provides the OpenTelemetry API used to measure metrics about
@@ -68,6 +57,23 @@ asynchronous measurement, a Gauge ([Int64ObservableGauge] and
See the [OpenTelemetry documentation] for more information about instruments
and their intended use.
+# Instrument Name
+
+OpenTelemetry defines an [instrument name syntax] that restricts what
+instrument names are allowed.
+
+Instrument names should ...
+
+ - Not be empty.
+ - Have an alphabetic character as their first letter.
+ - Have any letter after the first be an alphanumeric character, ‘_’, ‘.’,
+ ‘-’, or ‘/’.
+ - Have a maximum length of 255 letters.
+
+To ensure compatibility with observability platforms, all instruments created
+need to conform to this syntax. Not all implementations of the API will validate
+these names, it is the callers responsibility to ensure compliance.
+
# Measurements
Measurements are made by recording values and information about the values with
@@ -164,6 +170,7 @@ It is strongly recommended that authors only embed
That implementation is the only one OpenTelemetry authors can guarantee will
fully implement all the API interfaces when a user updates their API.
+[instrument name syntax]: https://opentelemetry.io/docs/specs/otel/metrics/api/#instrument-name-syntax
[OpenTelemetry documentation]: https://opentelemetry.io/docs/concepts/signals/metrics/
[GetMeterProvider]: https://pkg.go.dev/go.opentelemetry.io/otel#GetMeterProvider
*/
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/README.md b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
new file mode 100644
index 00000000000..1f6e0efa73d
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
@@ -0,0 +1,3 @@
+# Metric Embedded
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
index ae0bdbd2e64..1a9dc68093f 100644
--- a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package embedded provides interfaces embedded within the [OpenTelemetry
// metric API].
@@ -113,6 +102,16 @@ type Float64Counter interface{ float64Counter() }
// the API package).
type Float64Histogram interface{ float64Histogram() }
+// Float64Gauge is embedded in [go.opentelemetry.io/otel/metric.Float64Gauge].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/metric.Float64Gauge] if you want users to
+// experience a compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/metric.Float64Gauge]
+// interface is extended (which is something that can happen without a major
+// version bump of the API package).
+type Float64Gauge interface{ float64Gauge() }
+
// Float64ObservableCounter is embedded in
// [go.opentelemetry.io/otel/metric.Float64ObservableCounter].
//
@@ -185,6 +184,16 @@ type Int64Counter interface{ int64Counter() }
// the API package).
type Int64Histogram interface{ int64Histogram() }
+// Int64Gauge is embedded in [go.opentelemetry.io/otel/metric.Int64Gauge].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/metric.Int64Gauge] if you want users to experience
+// a compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/metric.Int64Gauge]
+// interface is extended (which is something that can happen without a major
+// version bump of the API package).
+type Int64Gauge interface{ int64Gauge() }
+
// Int64ObservableCounter is embedded in
// [go.opentelemetry.io/otel/metric.Int64ObservableCounter].
//
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go
index be89cd53341..ea52e402331 100644
--- a/vendor/go.opentelemetry.io/otel/metric/instrument.go
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -27,6 +16,7 @@ type InstrumentOption interface {
Int64CounterOption
Int64UpDownCounterOption
Int64HistogramOption
+ Int64GaugeOption
Int64ObservableCounterOption
Int64ObservableUpDownCounterOption
Int64ObservableGaugeOption
@@ -34,6 +24,7 @@ type InstrumentOption interface {
Float64CounterOption
Float64UpDownCounterOption
Float64HistogramOption
+ Float64GaugeOption
Float64ObservableCounterOption
Float64ObservableUpDownCounterOption
Float64ObservableGaugeOption
@@ -62,6 +53,11 @@ func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64Histogra
return c
}
+func (o descOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig {
+ c.description = string(o)
+ return c
+}
+
func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig {
c.description = string(o)
return c
@@ -92,6 +88,11 @@ func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfi
return c
}
+func (o descOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig {
+ c.description = string(o)
+ return c
+}
+
func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig {
c.description = string(o)
return c
@@ -127,6 +128,11 @@ func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64Histogra
return c
}
+func (o unitOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig {
+ c.unit = string(o)
+ return c
+}
+
func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig {
c.unit = string(o)
return c
@@ -157,6 +163,11 @@ func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfi
return c
}
+func (o unitOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig {
+ c.unit = string(o)
+ return c
+}
+
func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig {
c.unit = string(o)
return c
diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go
index 2520bc74af1..6a7991e0151 100644
--- a/vendor/go.opentelemetry.io/otel/metric/meter.go
+++ b/vendor/go.opentelemetry.io/otel/metric/meter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -58,17 +47,37 @@ type Meter interface {
// Int64Counter returns a new Int64Counter instrument identified by name
// and configured with options. The instrument is used to synchronously
// record increasing int64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64Counter(name string, options ...Int64CounterOption) (Int64Counter, error)
// Int64UpDownCounter returns a new Int64UpDownCounter instrument
// identified by name and configured with options. The instrument is used
// to synchronously record int64 measurements during a computational
// operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64UpDownCounter(name string, options ...Int64UpDownCounterOption) (Int64UpDownCounter, error)
// Int64Histogram returns a new Int64Histogram instrument identified by
// name and configured with options. The instrument is used to
// synchronously record the distribution of int64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64Histogram(name string, options ...Int64HistogramOption) (Int64Histogram, error)
+ // Int64Gauge returns a new Int64Gauge instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // instantaneous int64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
+ Int64Gauge(name string, options ...Int64GaugeOption) (Int64Gauge, error)
// Int64ObservableCounter returns a new Int64ObservableCounter identified
// by name and configured with options. The instrument is used to
// asynchronously record increasing int64 measurements once per a
@@ -78,6 +87,10 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableCounter(name string, options ...Int64ObservableCounterOption) (Int64ObservableCounter, error)
// Int64ObservableUpDownCounter returns a new Int64ObservableUpDownCounter
// instrument identified by name and configured with options. The
@@ -88,6 +101,10 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableUpDownCounter(name string, options ...Int64ObservableUpDownCounterOption) (Int64ObservableUpDownCounter, error)
// Int64ObservableGauge returns a new Int64ObservableGauge instrument
// identified by name and configured with options. The instrument is used
@@ -98,23 +115,47 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableGauge(name string, options ...Int64ObservableGaugeOption) (Int64ObservableGauge, error)
// Float64Counter returns a new Float64Counter instrument identified by
// name and configured with options. The instrument is used to
// synchronously record increasing float64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64Counter(name string, options ...Float64CounterOption) (Float64Counter, error)
// Float64UpDownCounter returns a new Float64UpDownCounter instrument
// identified by name and configured with options. The instrument is used
// to synchronously record float64 measurements during a computational
// operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64UpDownCounter(name string, options ...Float64UpDownCounterOption) (Float64UpDownCounter, error)
// Float64Histogram returns a new Float64Histogram instrument identified by
// name and configured with options. The instrument is used to
// synchronously record the distribution of float64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64Histogram(name string, options ...Float64HistogramOption) (Float64Histogram, error)
+ // Float64Gauge returns a new Float64Gauge instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // instantaneous float64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
+ Float64Gauge(name string, options ...Float64GaugeOption) (Float64Gauge, error)
// Float64ObservableCounter returns a new Float64ObservableCounter
// instrument identified by name and configured with options. The
// instrument is used to asynchronously record increasing float64
@@ -124,6 +165,10 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableCounter(name string, options ...Float64ObservableCounterOption) (Float64ObservableCounter, error)
// Float64ObservableUpDownCounter returns a new
// Float64ObservableUpDownCounter instrument identified by name and
@@ -134,6 +179,10 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableUpDownCounter(name string, options ...Float64ObservableUpDownCounterOption) (Float64ObservableUpDownCounter, error)
// Float64ObservableGauge returns a new Float64ObservableGauge instrument
// identified by name and configured with options. The instrument is used
@@ -144,6 +193,10 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableGauge(name string, options ...Float64ObservableGaugeOption) (Float64ObservableGauge, error)
// RegisterCallback registers f to be called during the collection of a
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/README.md b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
new file mode 100644
index 00000000000..bb89694356b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
@@ -0,0 +1,3 @@
+# Metric Noop
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/noop)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/noop)
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/noop.go b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
new file mode 100644
index 00000000000..ca6fcbdc099
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
@@ -0,0 +1,281 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package noop provides an implementation of the OpenTelemetry metric API that
+// produces no telemetry and minimizes used computation resources.
+//
+// Using this package to implement the OpenTelemetry metric API will
+// effectively disable OpenTelemetry.
+//
+// This implementation can be embedded in other implementations of the
+// OpenTelemetry metric API. Doing so will mean the implementation defaults to
+// no operation for methods it does not implement.
+package noop // import "go.opentelemetry.io/otel/metric/noop"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/metric/embedded"
+)
+
+var (
+ // Compile-time check this implements the OpenTelemetry API.
+
+ _ metric.MeterProvider = MeterProvider{}
+ _ metric.Meter = Meter{}
+ _ metric.Observer = Observer{}
+ _ metric.Registration = Registration{}
+ _ metric.Int64Counter = Int64Counter{}
+ _ metric.Float64Counter = Float64Counter{}
+ _ metric.Int64UpDownCounter = Int64UpDownCounter{}
+ _ metric.Float64UpDownCounter = Float64UpDownCounter{}
+ _ metric.Int64Histogram = Int64Histogram{}
+ _ metric.Float64Histogram = Float64Histogram{}
+ _ metric.Int64Gauge = Int64Gauge{}
+ _ metric.Float64Gauge = Float64Gauge{}
+ _ metric.Int64ObservableCounter = Int64ObservableCounter{}
+ _ metric.Float64ObservableCounter = Float64ObservableCounter{}
+ _ metric.Int64ObservableGauge = Int64ObservableGauge{}
+ _ metric.Float64ObservableGauge = Float64ObservableGauge{}
+ _ metric.Int64ObservableUpDownCounter = Int64ObservableUpDownCounter{}
+ _ metric.Float64ObservableUpDownCounter = Float64ObservableUpDownCounter{}
+ _ metric.Int64Observer = Int64Observer{}
+ _ metric.Float64Observer = Float64Observer{}
+)
+
+// MeterProvider is an OpenTelemetry No-Op MeterProvider.
+type MeterProvider struct{ embedded.MeterProvider }
+
+// NewMeterProvider returns a MeterProvider that does not record any telemetry.
+func NewMeterProvider() MeterProvider {
+ return MeterProvider{}
+}
+
+// Meter returns an OpenTelemetry Meter that does not record any telemetry.
+func (MeterProvider) Meter(string, ...metric.MeterOption) metric.Meter {
+ return Meter{}
+}
+
+// Meter is an OpenTelemetry No-Op Meter.
+type Meter struct{ embedded.Meter }
+
+// Int64Counter returns a Counter used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Counter(string, ...metric.Int64CounterOption) (metric.Int64Counter, error) {
+ return Int64Counter{}, nil
+}
+
+// Int64UpDownCounter returns an UpDownCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64UpDownCounter(string, ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) {
+ return Int64UpDownCounter{}, nil
+}
+
+// Int64Histogram returns a Histogram used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Histogram(string, ...metric.Int64HistogramOption) (metric.Int64Histogram, error) {
+ return Int64Histogram{}, nil
+}
+
+// Int64Gauge returns a Gauge used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Gauge(string, ...metric.Int64GaugeOption) (metric.Int64Gauge, error) {
+ return Int64Gauge{}, nil
+}
+
+// Int64ObservableCounter returns an ObservableCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64ObservableCounter(string, ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) {
+ return Int64ObservableCounter{}, nil
+}
+
+// Int64ObservableUpDownCounter returns an ObservableUpDownCounter used to
+// record int64 measurements that produces no telemetry.
+func (Meter) Int64ObservableUpDownCounter(string, ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) {
+ return Int64ObservableUpDownCounter{}, nil
+}
+
+// Int64ObservableGauge returns an ObservableGauge used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64ObservableGauge(string, ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) {
+ return Int64ObservableGauge{}, nil
+}
+
+// Float64Counter returns a Counter used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Float64Counter(string, ...metric.Float64CounterOption) (metric.Float64Counter, error) {
+ return Float64Counter{}, nil
+}
+
+// Float64UpDownCounter returns an UpDownCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64UpDownCounter(string, ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) {
+ return Float64UpDownCounter{}, nil
+}
+
+// Float64Histogram returns a Histogram used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Float64Histogram(string, ...metric.Float64HistogramOption) (metric.Float64Histogram, error) {
+ return Float64Histogram{}, nil
+}
+
+// Float64Gauge returns a Gauge used to record float64 measurements that
+// produces no telemetry.
+func (Meter) Float64Gauge(string, ...metric.Float64GaugeOption) (metric.Float64Gauge, error) {
+ return Float64Gauge{}, nil
+}
+
+// Float64ObservableCounter returns an ObservableCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64ObservableCounter(string, ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) {
+ return Float64ObservableCounter{}, nil
+}
+
+// Float64ObservableUpDownCounter returns an ObservableUpDownCounter used to
+// record int64 measurements that produces no telemetry.
+func (Meter) Float64ObservableUpDownCounter(string, ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) {
+ return Float64ObservableUpDownCounter{}, nil
+}
+
+// Float64ObservableGauge returns an ObservableGauge used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64ObservableGauge(string, ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) {
+ return Float64ObservableGauge{}, nil
+}
+
+// RegisterCallback performs no operation.
+func (Meter) RegisterCallback(metric.Callback, ...metric.Observable) (metric.Registration, error) {
+ return Registration{}, nil
+}
+
+// Observer acts as a recorder of measurements for multiple instruments in a
+// Callback, it performing no operation.
+type Observer struct{ embedded.Observer }
+
+// ObserveFloat64 performs no operation.
+func (Observer) ObserveFloat64(metric.Float64Observable, float64, ...metric.ObserveOption) {
+}
+
+// ObserveInt64 performs no operation.
+func (Observer) ObserveInt64(metric.Int64Observable, int64, ...metric.ObserveOption) {
+}
+
+// Registration is the registration of a Callback with a No-Op Meter.
+type Registration struct{ embedded.Registration }
+
+// Unregister unregisters the Callback the Registration represents with the
+// No-Op Meter. This will always return nil because the No-Op Meter performs no
+// operation, including hold any record of registrations.
+func (Registration) Unregister() error { return nil }
+
+// Int64Counter is an OpenTelemetry Counter used to record int64 measurements.
+// It produces no telemetry.
+type Int64Counter struct{ embedded.Int64Counter }
+
+// Add performs no operation.
+func (Int64Counter) Add(context.Context, int64, ...metric.AddOption) {}
+
+// Float64Counter is an OpenTelemetry Counter used to record float64
+// measurements. It produces no telemetry.
+type Float64Counter struct{ embedded.Float64Counter }
+
+// Add performs no operation.
+func (Float64Counter) Add(context.Context, float64, ...metric.AddOption) {}
+
+// Int64UpDownCounter is an OpenTelemetry UpDownCounter used to record int64
+// measurements. It produces no telemetry.
+type Int64UpDownCounter struct{ embedded.Int64UpDownCounter }
+
+// Add performs no operation.
+func (Int64UpDownCounter) Add(context.Context, int64, ...metric.AddOption) {}
+
+// Float64UpDownCounter is an OpenTelemetry UpDownCounter used to record
+// float64 measurements. It produces no telemetry.
+type Float64UpDownCounter struct{ embedded.Float64UpDownCounter }
+
+// Add performs no operation.
+func (Float64UpDownCounter) Add(context.Context, float64, ...metric.AddOption) {}
+
+// Int64Histogram is an OpenTelemetry Histogram used to record int64
+// measurements. It produces no telemetry.
+type Int64Histogram struct{ embedded.Int64Histogram }
+
+// Record performs no operation.
+func (Int64Histogram) Record(context.Context, int64, ...metric.RecordOption) {}
+
+// Float64Histogram is an OpenTelemetry Histogram used to record float64
+// measurements. It produces no telemetry.
+type Float64Histogram struct{ embedded.Float64Histogram }
+
+// Record performs no operation.
+func (Float64Histogram) Record(context.Context, float64, ...metric.RecordOption) {}
+
+// Int64Gauge is an OpenTelemetry Gauge used to record instantaneous int64
+// measurements. It produces no telemetry.
+type Int64Gauge struct{ embedded.Int64Gauge }
+
+// Record performs no operation.
+func (Int64Gauge) Record(context.Context, int64, ...metric.RecordOption) {}
+
+// Float64Gauge is an OpenTelemetry Gauge used to record instantaneous float64
+// measurements. It produces no telemetry.
+type Float64Gauge struct{ embedded.Float64Gauge }
+
+// Record performs no operation.
+func (Float64Gauge) Record(context.Context, float64, ...metric.RecordOption) {}
+
+// Int64ObservableCounter is an OpenTelemetry ObservableCounter used to record
+// int64 measurements. It produces no telemetry.
+type Int64ObservableCounter struct {
+ metric.Int64Observable
+ embedded.Int64ObservableCounter
+}
+
+// Float64ObservableCounter is an OpenTelemetry ObservableCounter used to record
+// float64 measurements. It produces no telemetry.
+type Float64ObservableCounter struct {
+ metric.Float64Observable
+ embedded.Float64ObservableCounter
+}
+
+// Int64ObservableGauge is an OpenTelemetry ObservableGauge used to record
+// int64 measurements. It produces no telemetry.
+type Int64ObservableGauge struct {
+ metric.Int64Observable
+ embedded.Int64ObservableGauge
+}
+
+// Float64ObservableGauge is an OpenTelemetry ObservableGauge used to record
+// float64 measurements. It produces no telemetry.
+type Float64ObservableGauge struct {
+ metric.Float64Observable
+ embedded.Float64ObservableGauge
+}
+
+// Int64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter
+// used to record int64 measurements. It produces no telemetry.
+type Int64ObservableUpDownCounter struct {
+ metric.Int64Observable
+ embedded.Int64ObservableUpDownCounter
+}
+
+// Float64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter
+// used to record float64 measurements. It produces no telemetry.
+type Float64ObservableUpDownCounter struct {
+ metric.Float64Observable
+ embedded.Float64ObservableUpDownCounter
+}
+
+// Int64Observer is a recorder of int64 measurements that performs no operation.
+type Int64Observer struct{ embedded.Int64Observer }
+
+// Observe performs no operation.
+func (Int64Observer) Observe(int64, ...metric.ObserveOption) {}
+
+// Float64Observer is a recorder of float64 measurements that performs no
+// operation.
+type Float64Observer struct{ embedded.Float64Observer }
+
+// Observe performs no operation.
+func (Float64Observer) Observe(float64, ...metric.ObserveOption) {}
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
index 0a4825ae6a7..8403a4bad2d 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -39,7 +28,7 @@ type Float64Counter interface {
}
// Float64CounterConfig contains options for synchronous counter instruments that
-// record int64 values.
+// record float64 values.
type Float64CounterConfig struct {
description string
unit string
@@ -92,7 +81,7 @@ type Float64UpDownCounter interface {
}
// Float64UpDownCounterConfig contains options for synchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64UpDownCounterConfig struct {
description string
unit string
@@ -144,8 +133,8 @@ type Float64Histogram interface {
Record(ctx context.Context, incr float64, options ...RecordOption)
}
-// Float64HistogramConfig contains options for synchronous counter instruments
-// that record int64 values.
+// Float64HistogramConfig contains options for synchronous histogram
+// instruments that record float64 values.
type Float64HistogramConfig struct {
description string
unit string
@@ -183,3 +172,55 @@ func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 {
type Float64HistogramOption interface {
applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig
}
+
+// Float64Gauge is an instrument that records instantaneous float64 values.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Float64Gauge interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Float64Gauge
+
+ // Record records the instantaneous value.
+ //
+ // Use the WithAttributeSet (or, if performance is not a concern,
+ // the WithAttributes) option to include measurement attributes.
+ Record(ctx context.Context, value float64, options ...RecordOption)
+}
+
+// Float64GaugeConfig contains options for synchronous gauge instruments that
+// record float64 values.
+type Float64GaugeConfig struct {
+ description string
+ unit string
+}
+
+// NewFloat64GaugeConfig returns a new [Float64GaugeConfig] with all opts
+// applied.
+func NewFloat64GaugeConfig(opts ...Float64GaugeOption) Float64GaugeConfig {
+ var config Float64GaugeConfig
+ for _, o := range opts {
+ config = o.applyFloat64Gauge(config)
+ }
+ return config
+}
+
+// Description returns the configured description.
+func (c Float64GaugeConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the configured unit.
+func (c Float64GaugeConfig) Unit() string {
+ return c.unit
+}
+
+// Float64GaugeOption applies options to a [Float64GaugeConfig]. See
+// [InstrumentOption] for other options that can be used as a
+// Float64GaugeOption.
+type Float64GaugeOption interface {
+ applyFloat64Gauge(Float64GaugeConfig) Float64GaugeConfig
+}
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
index 56667d32fc0..783fdfba773 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -144,7 +133,7 @@ type Int64Histogram interface {
Record(ctx context.Context, incr int64, options ...RecordOption)
}
-// Int64HistogramConfig contains options for synchronous counter instruments
+// Int64HistogramConfig contains options for synchronous histogram instruments
// that record int64 values.
type Int64HistogramConfig struct {
description string
@@ -183,3 +172,55 @@ func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 {
type Int64HistogramOption interface {
applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig
}
+
+// Int64Gauge is an instrument that records instantaneous int64 values.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Int64Gauge interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Int64Gauge
+
+ // Record records the instantaneous value.
+ //
+ // Use the WithAttributeSet (or, if performance is not a concern,
+ // the WithAttributes) option to include measurement attributes.
+ Record(ctx context.Context, value int64, options ...RecordOption)
+}
+
+// Int64GaugeConfig contains options for synchronous gauge instruments that
+// record int64 values.
+type Int64GaugeConfig struct {
+ description string
+ unit string
+}
+
+// NewInt64GaugeConfig returns a new [Int64GaugeConfig] with all opts
+// applied.
+func NewInt64GaugeConfig(opts ...Int64GaugeOption) Int64GaugeConfig {
+ var config Int64GaugeConfig
+ for _, o := range opts {
+ config = o.applyInt64Gauge(config)
+ }
+ return config
+}
+
+// Description returns the configured description.
+func (c Int64GaugeConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the configured unit.
+func (c Int64GaugeConfig) Unit() string {
+ return c.unit
+}
+
+// Int64GaugeOption applies options to a [Int64GaugeConfig]. See
+// [InstrumentOption] for other options that can be used as a
+// Int64GaugeOption.
+type Int64GaugeOption interface {
+ applyInt64Gauge(Int64GaugeConfig) Int64GaugeConfig
+}
diff --git a/vendor/go.opentelemetry.io/otel/propagation.go b/vendor/go.opentelemetry.io/otel/propagation.go
index d29aaa32c0b..2fd9497338f 100644
--- a/vendor/go.opentelemetry.io/otel/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/README.md b/vendor/go.opentelemetry.io/otel/propagation/README.md
new file mode 100644
index 00000000000..e2959ac747a
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/propagation/README.md
@@ -0,0 +1,3 @@
+# Propagation
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/propagation)](https://pkg.go.dev/go.opentelemetry.io/otel/propagation)
diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
index 303cdf1cbff..552263ba734 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/doc.go b/vendor/go.opentelemetry.io/otel/propagation/doc.go
index c119eb2858b..33a3baf15f1 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/doc.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package propagation contains OpenTelemetry context propagators.
diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
index c94438f73a5..8c8286aab4d 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
index 75a8f3435a5..6870e316dc0 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
@@ -18,7 +7,7 @@ import (
"context"
"encoding/hex"
"fmt"
- "regexp"
+ "strings"
"go.opentelemetry.io/otel/trace"
)
@@ -28,6 +17,7 @@ const (
maxVersion = 254
traceparentHeader = "traceparent"
tracestateHeader = "tracestate"
+ delimiter = "-"
)
// TraceContext is a propagator that supports the W3C Trace Context format
@@ -41,11 +31,11 @@ const (
type TraceContext struct{}
var (
- _ TextMapPropagator = TraceContext{}
- traceCtxRegExp = regexp.MustCompile("^(?P[0-9a-f]{2})-(?P[a-f0-9]{32})-(?P[a-f0-9]{16})-(?P[a-f0-9]{2})(?:-.*)?$")
+ _ TextMapPropagator = TraceContext{}
+ versionPart = fmt.Sprintf("%.2X", supportedVersion)
)
-// Inject set tracecontext from the Context into the carrier.
+// Inject injects the trace context from ctx into carrier.
func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
sc := trace.SpanContextFromContext(ctx)
if !sc.IsValid() {
@@ -59,12 +49,19 @@ func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
// Clear all flags other than the trace-context supported sampling bit.
flags := sc.TraceFlags() & trace.FlagsSampled
- h := fmt.Sprintf("%.2x-%s-%s-%s",
- supportedVersion,
- sc.TraceID(),
- sc.SpanID(),
- flags)
- carrier.Set(traceparentHeader, h)
+ var sb strings.Builder
+ sb.Grow(2 + 32 + 16 + 2 + 3)
+ _, _ = sb.WriteString(versionPart)
+ traceID := sc.TraceID()
+ spanID := sc.SpanID()
+ flagByte := [1]byte{byte(flags)}
+ var buf [32]byte
+ for _, src := range [][]byte{traceID[:], spanID[:], flagByte[:]} {
+ _ = sb.WriteByte(delimiter[0])
+ n := hex.Encode(buf[:], src)
+ _, _ = sb.Write(buf[:n])
+ }
+ carrier.Set(traceparentHeader, sb.String())
}
// Extract reads tracecontext from the carrier into a returned Context.
@@ -86,21 +83,8 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return trace.SpanContext{}
}
- matches := traceCtxRegExp.FindStringSubmatch(h)
-
- if len(matches) == 0 {
- return trace.SpanContext{}
- }
-
- if len(matches) < 5 { // four subgroups plus the overall match
- return trace.SpanContext{}
- }
-
- if len(matches[1]) != 2 {
- return trace.SpanContext{}
- }
- ver, err := hex.DecodeString(matches[1])
- if err != nil {
+ var ver [1]byte
+ if !extractPart(ver[:], &h, 2) {
return trace.SpanContext{}
}
version := int(ver[0])
@@ -108,36 +92,24 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return trace.SpanContext{}
}
- if version == 0 && len(matches) != 5 { // four subgroups plus the overall match
- return trace.SpanContext{}
- }
-
- if len(matches[2]) != 32 {
- return trace.SpanContext{}
- }
-
var scc trace.SpanContextConfig
-
- scc.TraceID, err = trace.TraceIDFromHex(matches[2][:32])
- if err != nil {
+ if !extractPart(scc.TraceID[:], &h, 32) {
return trace.SpanContext{}
}
-
- if len(matches[3]) != 16 {
- return trace.SpanContext{}
- }
- scc.SpanID, err = trace.SpanIDFromHex(matches[3])
- if err != nil {
+ if !extractPart(scc.SpanID[:], &h, 16) {
return trace.SpanContext{}
}
- if len(matches[4]) != 2 {
+ var opts [1]byte
+ if !extractPart(opts[:], &h, 2) {
return trace.SpanContext{}
}
- opts, err := hex.DecodeString(matches[4])
- if err != nil || len(opts) < 1 || (version == 0 && opts[0] > 2) {
+ if version == 0 && (h != "" || opts[0] > 2) {
+ // version 0 not allow extra
+ // version 0 not allow other flag
return trace.SpanContext{}
}
+
// Clear all flags other than the trace-context supported sampling bit.
scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled
@@ -155,6 +127,29 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return sc
}
+// upperHex detect hex is upper case Unicode characters.
+func upperHex(v string) bool {
+ for _, c := range v {
+ if c >= 'A' && c <= 'F' {
+ return true
+ }
+ }
+ return false
+}
+
+func extractPart(dst []byte, h *string, n int) bool {
+ part, left, _ := strings.Cut(*h, delimiter)
+ *h = left
+ // hex.Decode decodes unsupported upper-case characters, so exclude explicitly.
+ if len(part) != n || upperHex(part) {
+ return false
+ }
+ if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 {
+ return false
+ }
+ return true
+}
+
// Fields returns the keys who's values are set with Inject.
func (tc TraceContext) Fields() []string {
return []string{traceparentHeader, tracestateHeader}
diff --git a/vendor/go.opentelemetry.io/otel/renovate.json b/vendor/go.opentelemetry.io/otel/renovate.json
new file mode 100644
index 00000000000..8c5ac55ca93
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/renovate.json
@@ -0,0 +1,24 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": [
+ "config:recommended"
+ ],
+ "ignorePaths": [],
+ "labels": ["Skip Changelog", "dependencies"],
+ "postUpdateOptions" : [
+ "gomodTidy"
+ ],
+ "packageRules": [
+ {
+ "matchManagers": ["gomod"],
+ "matchDepTypes": ["indirect"],
+ "enabled": true
+ },
+ {
+ "matchFileNames": ["internal/tools/**"],
+ "matchManagers": ["gomod"],
+ "matchDepTypes": ["indirect"],
+ "enabled": false
+ }
+ ]
+}
diff --git a/vendor/go.opentelemetry.io/otel/requirements.txt b/vendor/go.opentelemetry.io/otel/requirements.txt
index e0a43e13840..ab09daf9d53 100644
--- a/vendor/go.opentelemetry.io/otel/requirements.txt
+++ b/vendor/go.opentelemetry.io/otel/requirements.txt
@@ -1 +1 @@
-codespell==2.2.6
+codespell==2.3.0
diff --git a/vendor/go.opentelemetry.io/otel/sdk/README.md b/vendor/go.opentelemetry.io/otel/sdk/README.md
new file mode 100644
index 00000000000..f81b1576ad4
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/README.md
@@ -0,0 +1,3 @@
+# SDK
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/sdk)](https://pkg.go.dev/go.opentelemetry.io/otel/sdk)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/README.md b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/README.md
new file mode 100644
index 00000000000..06e6d868548
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/README.md
@@ -0,0 +1,3 @@
+# SDK Instrumentation
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/sdk/instrumentation)](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/instrumentation)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go
index 6e923acab43..a4faa6a03d5 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package instrumentation provides types to represent the code libraries that
// provide OpenTelemetry instrumentation. These types are used in the
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go
index 39f025a1715..f4d1857c4f4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go
index 09c6d93f6d0..728115045bb 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go b/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go
index 59dcfab2501..07923ed8d94 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package env // import "go.opentelemetry.io/otel/sdk/internal/env"
@@ -33,7 +22,7 @@ const (
BatchSpanProcessorMaxQueueSizeKey = "OTEL_BSP_MAX_QUEUE_SIZE"
// BatchSpanProcessorMaxExportBatchSizeKey is the maximum batch size (i.e.
// 512). Note: it must be less than or equal to
- // EnvBatchSpanProcessorMaxQueueSize.
+ // BatchSpanProcessorMaxQueueSize.
BatchSpanProcessorMaxExportBatchSizeKey = "OTEL_BSP_MAX_EXPORT_BATCH_SIZE"
// AttributeValueLengthKey is the maximum allowed attribute value size.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go b/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go
deleted file mode 100644
index bd84f624b45..00000000000
--- a/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package internal // import "go.opentelemetry.io/otel/sdk/internal"
-
-//go:generate gotmpl --body=../../internal/shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go
-//go:generate gotmpl --body=../../internal/shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go
-//go:generate gotmpl --body=../../internal/shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go
-
-//go:generate gotmpl --body=../../internal/shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/sdk/internal/matchers\"}" --out=internaltest/harness.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go b/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go
deleted file mode 100644
index dfeaaa8ca04..00000000000
--- a/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package internal // import "go.opentelemetry.io/otel/sdk/internal"
-
-import "time"
-
-// MonotonicEndTime returns the end time at present
-// but offset from start, monotonically.
-//
-// The monotonic clock is used in subtractions hence
-// the duration since start added back to start gives
-// end as a monotonic time.
-// See https://golang.org/pkg/time/#hdr-Monotonic_Clocks
-func MonotonicEndTime(start time.Time) time.Time {
- return start.Add(time.Since(start))
-}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md b/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md
new file mode 100644
index 00000000000..fab61647c2d
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md
@@ -0,0 +1,46 @@
+# Experimental Features
+
+The SDK contains features that have not yet stabilized in the OpenTelemetry specification.
+These features are added to the OpenTelemetry Go SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback.
+
+These feature may change in backwards incompatible ways as feedback is applied.
+See the [Compatibility and Stability](#compatibility-and-stability) section for more information.
+
+## Features
+
+- [Resource](#resource)
+
+### Resource
+
+[OpenTelemetry resource semantic conventions] include many attribute definitions that are defined as experimental.
+To have experimental semantic conventions be added by [resource detectors] set the `OTEL_GO_X_RESOURCE` environment variable.
+The value set must be the case-insensitive string of `"true"` to enable the feature.
+All other values are ignored.
+
+
+
+[OpenTelemetry resource semantic conventions]: https://opentelemetry.io/docs/specs/semconv/resource/
+[resource detectors]: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource#Detector
+
+#### Examples
+
+Enable experimental resource semantic conventions.
+
+```console
+export OTEL_GO_X_RESOURCE=true
+```
+
+Disable experimental resource semantic conventions.
+
+```console
+unset OTEL_GO_X_RESOURCE
+```
+
+## Compatibility and Stability
+
+Experimental features do not fall within the scope of the OpenTelemetry Go versioning and stability [policy](../../../VERSIONING.md).
+These features may be removed or modified in successive version releases, including patch versions.
+
+When an experimental feature is promoted to a stable feature, a migration path will be included in the changelog entry of the release.
+There is no guarantee that any environment variable feature flags that enabled the experimental feature will be supported by the stable version.
+If they are supported, they may be accompanied with a deprecation notice stating a timeline for the removal of that support.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go
new file mode 100644
index 00000000000..68d296cbed3
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go
@@ -0,0 +1,66 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package x contains support for OTel SDK experimental features.
+//
+// This package should only be used for features defined in the specification.
+// It should not be used for experiments or new project ideas.
+package x // import "go.opentelemetry.io/otel/sdk/internal/x"
+
+import (
+ "os"
+ "strings"
+)
+
+// Resource is an experimental feature flag that defines if resource detectors
+// should be included experimental semantic conventions.
+//
+// To enable this feature set the OTEL_GO_X_RESOURCE environment variable
+// to the case-insensitive string value of "true" (i.e. "True" and "TRUE"
+// will also enable this).
+var Resource = newFeature("RESOURCE", func(v string) (string, bool) {
+ if strings.ToLower(v) == "true" {
+ return v, true
+ }
+ return "", false
+})
+
+// Feature is an experimental feature control flag. It provides a uniform way
+// to interact with these feature flags and parse their values.
+type Feature[T any] struct {
+ key string
+ parse func(v string) (T, bool)
+}
+
+func newFeature[T any](suffix string, parse func(string) (T, bool)) Feature[T] {
+ const envKeyRoot = "OTEL_GO_X_"
+ return Feature[T]{
+ key: envKeyRoot + suffix,
+ parse: parse,
+ }
+}
+
+// Key returns the environment variable key that needs to be set to enable the
+// feature.
+func (f Feature[T]) Key() string { return f.key }
+
+// Lookup returns the user configured value for the feature and true if the
+// user has enabled the feature. Otherwise, if the feature is not enabled, a
+// zero-value and false are returned.
+func (f Feature[T]) Lookup() (v T, ok bool) {
+ // https://github.com/open-telemetry/opentelemetry-specification/blob/62effed618589a0bec416a87e559c0a9d96289bb/specification/configuration/sdk-environment-variables.md#parsing-empty-value
+ //
+ // > The SDK MUST interpret an empty value of an environment variable the
+ // > same way as when the variable is unset.
+ vRaw := os.Getenv(f.key)
+ if vRaw == "" {
+ return v, ok
+ }
+ return f.parse(vRaw)
+}
+
+// Enabled returns if the feature is enabled.
+func (f Feature[T]) Enabled() bool {
+ _, ok := f.Lookup()
+ return ok
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/README.md b/vendor/go.opentelemetry.io/otel/sdk/resource/README.md
new file mode 100644
index 00000000000..4ad864d716e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/README.md
@@ -0,0 +1,3 @@
+# SDK Resource
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/sdk/resource)](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go b/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go
index 4279013be88..95a61d61d49 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -41,8 +30,20 @@ type Detector interface {
// must never be done outside of a new major release.
}
-// Detect calls all input detectors sequentially and merges each result with the previous one.
-// It returns the merged error too.
+// Detect returns a new [Resource] merged from all the Resources each of the
+// detectors produces. Each of the detectors are called sequentially, in the
+// order they are passed, merging the produced resource into the previous.
+//
+// This may return a partial Resource along with an error containing
+// [ErrPartialResource] if that error is returned from a detector. It may also
+// return a merge-conflicting Resource along with an error containing
+// [ErrSchemaURLConflict] if merging Resources from different detectors results
+// in a schema URL conflict. It is up to the caller to determine if this
+// returned Resource should be used or not.
+//
+// If one of the detectors returns an error that is not [ErrPartialResource],
+// the resource produced by the detector will not be merged and the returned
+// error will wrap that detector's error.
func Detect(ctx context.Context, detectors ...Detector) (*Resource, error) {
r := new(Resource)
return r, detect(ctx, r, detectors)
@@ -50,6 +51,10 @@ func Detect(ctx context.Context, detectors ...Detector) (*Resource, error) {
// detect runs all detectors using ctx and merges the result into res. This
// assumes res is allocated and not nil, it will panic otherwise.
+//
+// If the detectors or merging resources produces any errors (i.e.
+// [ErrPartialResource] [ErrSchemaURLConflict]), a single error wrapping all of
+// these errors will be returned. Otherwise, nil is returned.
func detect(ctx context.Context, res *Resource, detectors []Detector) error {
var (
r *Resource
@@ -78,6 +83,11 @@ func detect(ctx context.Context, res *Resource, detectors []Detector) error {
if len(errs) == 0 {
return nil
}
+ if errors.Is(errs, ErrSchemaURLConflict) {
+ // If there has been a merge conflict, ensure the resource has no
+ // schema URL.
+ res.schemaURL = ""
+ }
return errs
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
index c63a0dd1f8c..6ac1cdbf7b4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -20,9 +9,11 @@ import (
"os"
"path/filepath"
+ "github.com/google/uuid"
+
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type (
@@ -47,6 +38,8 @@ type (
}
defaultServiceNameDetector struct{}
+
+ defaultServiceInstanceIDDetector struct{}
)
var (
@@ -54,6 +47,7 @@ var (
_ Detector = host{}
_ Detector = stringDetector{}
_ Detector = defaultServiceNameDetector{}
+ _ Detector = defaultServiceInstanceIDDetector{}
)
// Detect returns a *Resource that describes the OpenTelemetry SDK used.
@@ -106,3 +100,19 @@ func (defaultServiceNameDetector) Detect(ctx context.Context) (*Resource, error)
},
).Detect(ctx)
}
+
+// Detect implements Detector.
+func (defaultServiceInstanceIDDetector) Detect(ctx context.Context) (*Resource, error) {
+ return StringDetector(
+ semconv.SchemaURL,
+ semconv.ServiceInstanceIDKey,
+ func() (string, error) {
+ version4Uuid, err := uuid.NewRandom()
+ if err != nil {
+ return "", err
+ }
+
+ return version4Uuid.String(), nil
+ },
+ ).Detect(ctx)
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/config.go b/vendor/go.opentelemetry.io/otel/sdk/resource/config.go
index f263919f6ec..0d6e213d924 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/config.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
index 3d536228283..5ecd859a52d 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -22,14 +11,14 @@ import (
"os"
"regexp"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type containerIDProvider func() (string, error)
var (
containerID containerIDProvider = getContainerIDFromCGroup
- cgroupContainerIDRe = regexp.MustCompile(`^.*/(?:.*-)?([0-9a-f]+)(?:\.|\s*$)`)
+ cgroupContainerIDRe = regexp.MustCompile(`^.*/(?:.*[-:])?([0-9a-f]+)(?:\.|\s*$)`)
)
type cgroupContainerIDDetector struct{}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go b/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go
index d55a50b0dc2..64939a27131 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package resource provides detecting and representing resources.
//
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
index e29ae563a69..813f0562424 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -23,7 +12,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
const (
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
index fb1ebf2cab2..2d0f65498a0 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -19,7 +8,7 @@ import (
"errors"
"strings"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type hostIDProvider func() (string, error)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go
index 1778bbacf05..cc8b8938ed5 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build dragonfly || freebsd || netbsd || openbsd || solaris
// +build dragonfly freebsd netbsd openbsd solaris
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go
index ba41409b23c..b09fde3b735 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go
index 207acb0ed3a..d9e5d1a8fff 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build darwin || dragonfly || freebsd || netbsd || openbsd || solaris
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go
index 410579b8fc9..f84f173240f 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build linux
// +build linux
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go
index 721e3ca6e7d..6354b356022 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build linux || dragonfly || freebsd || netbsd || openbsd || solaris
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go
index 89df9d6882e..df12c44c564 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go
@@ -1,25 +1,8 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
-// +build !darwin
-// +build !dragonfly
-// +build !freebsd
-// +build !linux
-// +build !netbsd
-// +build !openbsd
-// +build !solaris
-// +build !windows
+//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows
+// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go
index 5b431c6ee6e..71386e2da4c 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build windows
// +build windows
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
index 0cbd559739c..8a48ab4fa32 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -19,7 +8,7 @@ import (
"strings"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type osDescriptionProvider func() (string, error)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go
index 24ec85793de..ce455dc544b 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
index c771942deec..f537e5ca5c4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
// +build aix dragonfly freebsd linux netbsd openbsd solaris zos
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go
index 1c84afc1852..a6ff26a4d27 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go
index 3ebcb534f28..a77742b0771 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go
@@ -1,27 +1,8 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
-// +build !aix
-// +build !darwin
-// +build !dragonfly
-// +build !freebsd
-// +build !linux
-// +build !netbsd
-// +build !openbsd
-// +build !solaris
-// +build !windows
-// +build !zos
+//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
+// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go
index faad64d8daa..5e3d199d785 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
index ecdd11dd762..085fe68fd77 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -22,7 +11,7 @@ import (
"path/filepath"
"runtime"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type (
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
index 176ff106668..ad4b50df404 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
@@ -1,26 +1,17 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
import (
"context"
"errors"
+ "fmt"
"sync"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/sdk/internal/x"
)
// Resource describes an entity about which identifying information
@@ -40,9 +31,20 @@ var (
defaultResourceOnce sync.Once
)
-var errMergeConflictSchemaURL = errors.New("cannot merge resource due to conflicting Schema URL")
+// ErrSchemaURLConflict is an error returned when two Resources are merged
+// together that contain different, non-empty, schema URLs.
+var ErrSchemaURLConflict = errors.New("conflicting Schema URL")
-// New returns a Resource combined from the user-provided detectors.
+// New returns a [Resource] built using opts.
+//
+// This may return a partial Resource along with an error containing
+// [ErrPartialResource] if options that provide a [Detector] are used and that
+// error is returned from one or more of the Detectors. It may also return a
+// merge-conflict Resource along with an error containing
+// [ErrSchemaURLConflict] if merging Resources from the opts results in a
+// schema URL conflict (see [Resource.Merge] for more information). It is up to
+// the caller to determine if this returned Resource should be used or not
+// based on these errors.
func New(ctx context.Context, opts ...Option) (*Resource, error) {
cfg := config{}
for _, opt := range opts {
@@ -98,7 +100,7 @@ func (r *Resource) String() string {
return r.attrs.Encoded(attribute.DefaultEncoder())
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Resource.
func (r *Resource) MarshalLog() interface{} {
return struct {
Attributes attribute.Set
@@ -146,16 +148,29 @@ func (r *Resource) Equal(eq *Resource) bool {
return r.Equivalent() == eq.Equivalent()
}
-// Merge creates a new resource by combining resource a and b.
+// Merge creates a new [Resource] by merging a and b.
+//
+// If there are common keys between a and b, then the value from b will
+// overwrite the value from a, even if b's value is empty.
+//
+// The SchemaURL of the resources will be merged according to the
+// [OpenTelemetry specification rules]:
//
-// If there are common keys between resource a and b, then the value
-// from resource b will overwrite the value from resource a, even
-// if resource b's value is empty.
+// - If a's schema URL is empty then the returned Resource's schema URL will
+// be set to the schema URL of b,
+// - Else if b's schema URL is empty then the returned Resource's schema URL
+// will be set to the schema URL of a,
+// - Else if the schema URLs of a and b are the same then that will be the
+// schema URL of the returned Resource,
+// - Else this is a merging error. If the resources have different,
+// non-empty, schema URLs an error containing [ErrSchemaURLConflict] will
+// be returned with the merged Resource. The merged Resource will have an
+// empty schema URL. It may be the case that some unintended attributes
+// have been overwritten or old semantic conventions persisted in the
+// returned Resource. It is up to the caller to determine if this returned
+// Resource should be used or not.
//
-// The SchemaURL of the resources will be merged according to the spec rules:
-// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/resource/sdk.md#merge
-// If the resources have different non-empty schemaURL an empty resource and an error
-// will be returned.
+// [OpenTelemetry specification rules]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/resource/sdk.md#merge
func Merge(a, b *Resource) (*Resource, error) {
if a == nil && b == nil {
return Empty(), nil
@@ -167,19 +182,6 @@ func Merge(a, b *Resource) (*Resource, error) {
return a, nil
}
- // Merge the schema URL.
- var schemaURL string
- switch true {
- case a.schemaURL == "":
- schemaURL = b.schemaURL
- case b.schemaURL == "":
- schemaURL = a.schemaURL
- case a.schemaURL == b.schemaURL:
- schemaURL = a.schemaURL
- default:
- return Empty(), errMergeConflictSchemaURL
- }
-
// Note: 'b' attributes will overwrite 'a' with last-value-wins in attribute.Key()
// Meaning this is equivalent to: append(a.Attributes(), b.Attributes()...)
mi := attribute.NewMergeIterator(b.Set(), a.Set())
@@ -187,8 +189,23 @@ func Merge(a, b *Resource) (*Resource, error) {
for mi.Next() {
combine = append(combine, mi.Attribute())
}
- merged := NewWithAttributes(schemaURL, combine...)
- return merged, nil
+
+ switch {
+ case a.schemaURL == "":
+ return NewWithAttributes(b.schemaURL, combine...), nil
+ case b.schemaURL == "":
+ return NewWithAttributes(a.schemaURL, combine...), nil
+ case a.schemaURL == b.schemaURL:
+ return NewWithAttributes(a.schemaURL, combine...), nil
+ }
+ // Return the merged resource with an appropriate error. It is up to
+ // the user to decide if the returned resource can be used or not.
+ return NewSchemaless(combine...), fmt.Errorf(
+ "%w: %s and %s",
+ ErrSchemaURLConflict,
+ a.schemaURL,
+ b.schemaURL,
+ )
}
// Empty returns an instance of Resource with no attributes. It is
@@ -202,11 +219,17 @@ func Empty() *Resource {
func Default() *Resource {
defaultResourceOnce.Do(func() {
var err error
- defaultResource, err = Detect(
- context.Background(),
+ defaultDetectors := []Detector{
defaultServiceNameDetector{},
fromEnv{},
telemetrySDK{},
+ }
+ if x.Resource.Enabled() {
+ defaultDetectors = append([]Detector{defaultServiceInstanceIDDetector{}}, defaultDetectors...)
+ }
+ defaultResource, err = Detect(
+ context.Background(),
+ defaultDetectors...,
)
if err != nil {
otel.Handle(err)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/README.md b/vendor/go.opentelemetry.io/otel/sdk/trace/README.md
new file mode 100644
index 00000000000..f2936e14392
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/README.md
@@ -0,0 +1,3 @@
+# SDK Trace
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/sdk/trace)](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
index c9c7effbf38..1d399a75db2 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -392,7 +381,7 @@ func (bsp *batchSpanProcessor) enqueueBlockOnQueueFull(ctx context.Context, sd R
}
}
-func (bsp *batchSpanProcessor) enqueueDrop(ctx context.Context, sd ReadOnlySpan) bool {
+func (bsp *batchSpanProcessor) enqueueDrop(_ context.Context, sd ReadOnlySpan) bool {
if !sd.SpanContext().IsSampled() {
return false
}
@@ -406,7 +395,7 @@ func (bsp *batchSpanProcessor) enqueueDrop(ctx context.Context, sd ReadOnlySpan)
return false
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Span Processor.
func (bsp *batchSpanProcessor) MarshalLog() interface{} {
return struct {
Type string
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
index 0285e99be07..1f60524e3ee 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package trace contains support for OpenTelemetry distributed tracing.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/event.go b/vendor/go.opentelemetry.io/otel/sdk/trace/event.go
index 1e3b426757d..60a7ed1349b 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/event.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/event.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go b/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go
index d1c86e59b22..821c83faa1d 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go
@@ -1,36 +1,45 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
+import (
+ "slices"
+ "sync"
+
+ "go.opentelemetry.io/otel/internal/global"
+)
+
// evictedQueue is a FIFO queue with a configurable capacity.
-type evictedQueue struct {
- queue []interface{}
+type evictedQueue[T any] struct {
+ queue []T
capacity int
droppedCount int
+ logDropped func()
}
-func newEvictedQueue(capacity int) evictedQueue {
+func newEvictedQueueEvent(capacity int) evictedQueue[Event] {
// Do not pre-allocate queue, do this lazily.
- return evictedQueue{capacity: capacity}
+ return evictedQueue[Event]{
+ capacity: capacity,
+ logDropped: sync.OnceFunc(func() { global.Warn("limit reached: dropping trace trace.Event") }),
+ }
+}
+
+func newEvictedQueueLink(capacity int) evictedQueue[Link] {
+ // Do not pre-allocate queue, do this lazily.
+ return evictedQueue[Link]{
+ capacity: capacity,
+ logDropped: sync.OnceFunc(func() { global.Warn("limit reached: dropping trace trace.Link") }),
+ }
}
// add adds value to the evictedQueue eq. If eq is at capacity, the oldest
// queued value will be discarded and the drop count incremented.
-func (eq *evictedQueue) add(value interface{}) {
+func (eq *evictedQueue[T]) add(value T) {
if eq.capacity == 0 {
eq.droppedCount++
+ eq.logDropped()
return
}
@@ -39,6 +48,12 @@ func (eq *evictedQueue) add(value interface{}) {
copy(eq.queue[:eq.capacity-1], eq.queue[1:])
eq.queue = eq.queue[:eq.capacity-1]
eq.droppedCount++
+ eq.logDropped()
}
eq.queue = append(eq.queue, value)
}
+
+// copy returns a copy of the evictedQueue.
+func (eq *evictedQueue[T]) copy() []T {
+ return slices.Clone(eq.queue)
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
index bba246041a4..925bcf99305 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -52,7 +41,12 @@ func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.Trace
gen.Lock()
defer gen.Unlock()
sid := trace.SpanID{}
- _, _ = gen.randSource.Read(sid[:])
+ for {
+ _, _ = gen.randSource.Read(sid[:])
+ if sid.IsValid() {
+ break
+ }
+ }
return sid
}
@@ -62,9 +56,19 @@ func (gen *randomIDGenerator) NewIDs(ctx context.Context) (trace.TraceID, trace.
gen.Lock()
defer gen.Unlock()
tid := trace.TraceID{}
- _, _ = gen.randSource.Read(tid[:])
sid := trace.SpanID{}
- _, _ = gen.randSource.Read(sid[:])
+ for {
+ _, _ = gen.randSource.Read(tid[:])
+ if tid.IsValid() {
+ break
+ }
+ }
+ for {
+ _, _ = gen.randSource.Read(sid[:])
+ if sid.IsValid() {
+ break
+ }
+ }
return tid, sid
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/link.go b/vendor/go.opentelemetry.io/otel/sdk/trace/link.go
index 19cfea4ba45..c03bdc90f68 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/link.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/link.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
index 7d46c4b48e5..14c2e5bebda 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -55,7 +44,7 @@ type tracerProviderConfig struct {
resource *resource.Resource
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Provider.
func (cfg tracerProviderConfig) MarshalLog() interface{} {
return struct {
SpanProcessors []SpanProcessor
@@ -302,7 +291,7 @@ func (p *TracerProvider) Shutdown(ctx context.Context) error {
retErr = err
} else {
// Poor man's list of errors
- retErr = fmt.Errorf("%v; %v", retErr, err)
+ retErr = fmt.Errorf("%w; %w", retErr, err)
}
}
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go b/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
index 02053b318ae..d2d1f72466b 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
index a7bc125b9e8..ebb6df6c908 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
index f8770fff79b..554111bb4a2 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -36,10 +25,10 @@ var _ SpanProcessor = (*simpleSpanProcessor)(nil)
// send completed spans to the exporter immediately.
//
// This SpanProcessor is not recommended for production use. The synchronous
-// nature of this SpanProcessor make it good for testing, debugging, or
-// showing examples of other feature, but it will be slow and have a high
-// computation resource usage overhead. The BatchSpanProcessor is recommended
-// for production use instead.
+// nature of this SpanProcessor makes it good for testing, debugging, or showing
+// examples of other features, but it will be slow and have a high computation
+// resource usage overhead. The BatchSpanProcessor is recommended for production
+// use instead.
func NewSimpleSpanProcessor(exporter SpanExporter) SpanProcessor {
ssp := &simpleSpanProcessor{
exporter: exporter,
@@ -80,10 +69,10 @@ func (ssp *simpleSpanProcessor) Shutdown(ctx context.Context) error {
//
// A closure is used to keep reference to the exporter and then the
// field is zeroed. This ensures the simpleSpanProcessor is shut down
- // before the exporter. This order is important as it avoids a
- // potential deadlock. If the exporter shut down operation generates a
- // span, that span would need to be exported. Meaning, OnEnd would be
- // called and try acquiring the lock that is held here.
+ // before the exporter. This order is important as it avoids a potential
+ // deadlock. If the exporter shut down operation generates a span, that
+ // span would need to be exported. Meaning, OnEnd would be called and
+ // try acquiring the lock that is held here.
ssp.exporterMu.Lock()
done, shutdown := stopFunc(ssp.exporter)
ssp.exporter = nil
@@ -95,15 +84,15 @@ func (ssp *simpleSpanProcessor) Shutdown(ctx context.Context) error {
select {
case err = <-done:
case <-ctx.Done():
- // It is possible for the exporter to have immediately shut down
- // and the context to be done simultaneously. In that case this
- // outer select statement will randomly choose a case. This will
- // result in a different returned error for similar scenarios.
- // Instead, double check if the exporter shut down at the same
- // time and return that error if so. This will ensure consistency
- // as well as ensure the caller knows the exporter shut down
- // successfully (they can already determine if the deadline is
- // expired given they passed the context).
+ // It is possible for the exporter to have immediately shut down and
+ // the context to be done simultaneously. In that case this outer
+ // select statement will randomly choose a case. This will result in
+ // a different returned error for similar scenarios. Instead, double
+ // check if the exporter shut down at the same time and return that
+ // error if so. This will ensure consistency as well as ensure
+ // the caller knows the exporter shut down successfully (they can
+ // already determine if the deadline is expired given they passed
+ // the context).
select {
case err = <-done:
default:
@@ -119,7 +108,8 @@ func (ssp *simpleSpanProcessor) ForceFlush(context.Context) error {
return nil
}
-// MarshalLog is the marshaling function used by the logging system to represent this Span Processor.
+// MarshalLog is the marshaling function used by the logging system to represent
+// this Span Processor.
func (ssp *simpleSpanProcessor) MarshalLog() interface{} {
return struct {
Type string
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
index 0349b2f198e..32f862790c7 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
index 36dbf67764b..ac90f1a2600 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -20,6 +9,7 @@ import (
"reflect"
"runtime"
rt "runtime/trace"
+ "slices"
"strings"
"sync"
"time"
@@ -27,10 +17,10 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/internal/global"
"go.opentelemetry.io/otel/sdk/instrumentation"
- "go.opentelemetry.io/otel/sdk/internal"
"go.opentelemetry.io/otel/sdk/resource"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/embedded"
)
@@ -147,12 +137,13 @@ type recordingSpan struct {
// ReadOnlySpan exported when the span ends.
attributes []attribute.KeyValue
droppedAttributes int
+ logDropAttrsOnce sync.Once
// events are stored in FIFO queue capped by configured limit.
- events evictedQueue
+ events evictedQueue[Event]
// links are stored in FIFO queue capped by configured limit.
- links evictedQueue
+ links evictedQueue[Link]
// executionTracerTaskEnd ends the execution tracer span.
executionTracerTaskEnd func()
@@ -229,7 +220,7 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) {
limit := s.tracer.provider.spanLimits.AttributeCountLimit
if limit == 0 {
// No attributes allowed.
- s.droppedAttributes += len(attributes)
+ s.addDroppedAttr(len(attributes))
return
}
@@ -242,10 +233,11 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) {
// Otherwise, add without deduplication. When attributes are read they
// will be deduplicated, optimizing the operation.
+ s.attributes = slices.Grow(s.attributes, len(s.attributes)+len(attributes))
for _, a := range attributes {
if !a.Valid() {
// Drop all invalid attributes.
- s.droppedAttributes++
+ s.addDroppedAttr(1)
continue
}
a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a)
@@ -253,6 +245,22 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) {
}
}
+// Declared as a var so tests can override.
+var logDropAttrs = func() {
+ global.Warn("limit reached: dropping trace Span attributes")
+}
+
+// addDroppedAttr adds incr to the count of dropped attributes.
+//
+// The first, and only the first, time this method is called a warning will be
+// logged.
+//
+// This method assumes s.mu.Lock is held by the caller.
+func (s *recordingSpan) addDroppedAttr(incr int) {
+ s.droppedAttributes += incr
+ s.logDropAttrsOnce.Do(logDropAttrs)
+}
+
// addOverCapAttrs adds the attributes attrs to the span s while
// de-duplicating the attributes of s and attrs and dropping attributes that
// exceed the limit.
@@ -277,10 +285,12 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) {
// Now that s.attributes is deduplicated, adding unique attributes up to
// the capacity of s will not over allocate s.attributes.
+ sum := len(attrs) + len(s.attributes)
+ s.attributes = slices.Grow(s.attributes, min(sum, limit))
for _, a := range attrs {
if !a.Valid() {
// Drop all invalid attributes.
- s.droppedAttributes++
+ s.addDroppedAttr(1)
continue
}
@@ -293,7 +303,7 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) {
if len(s.attributes) >= limit {
// Do not just drop all of the remaining attributes, make sure
// updates are checked and performed.
- s.droppedAttributes++
+ s.addDroppedAttr(1)
} else {
a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a)
s.attributes = append(s.attributes, a)
@@ -374,7 +384,7 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) {
// Store the end time as soon as possible to avoid artificially increasing
// the span's duration in case some operation below takes a while.
- et := internal.MonotonicEndTime(s.startTime)
+ et := monotonicEndTime(s.startTime)
// Do relative expensive check now that we have an end time and see if we
// need to do any more processing.
@@ -425,6 +435,16 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) {
}
}
+// monotonicEndTime returns the end time at present but offset from start,
+// monotonically.
+//
+// The monotonic clock is used in subtractions hence the duration since start
+// added back to start gives end as a monotonic time. See
+// https://golang.org/pkg/time/#hdr-Monotonic_Clocks
+func monotonicEndTime(start time.Time) time.Time {
+ return start.Add(time.Since(start))
+}
+
// RecordError will record err as a span event for this span. An additional call to
// SetStatus is required if the Status of the Span should be set to Error, this method
// does not change the Span status. If this span is not being recorded or err is nil
@@ -592,7 +612,7 @@ func (s *recordingSpan) Links() []Link {
if len(s.links.queue) == 0 {
return []Link{}
}
- return s.interfaceArrayToLinksArray()
+ return s.links.copy()
}
// Events returns the events of this span.
@@ -602,7 +622,7 @@ func (s *recordingSpan) Events() []Event {
if len(s.events.queue) == 0 {
return []Event{}
}
- return s.interfaceArrayToEventArray()
+ return s.events.copy()
}
// Status returns the status of this span.
@@ -636,8 +656,12 @@ func (s *recordingSpan) Resource() *resource.Resource {
return s.tracer.provider.resource
}
-func (s *recordingSpan) addLink(link trace.Link) {
- if !s.IsRecording() || !link.SpanContext.IsValid() {
+func (s *recordingSpan) AddLink(link trace.Link) {
+ if !s.IsRecording() {
+ return
+ }
+ if !link.SpanContext.IsValid() && len(link.Attributes) == 0 &&
+ link.SpanContext.TraceState().Len() == 0 {
return
}
@@ -720,32 +744,16 @@ func (s *recordingSpan) snapshot() ReadOnlySpan {
}
sd.droppedAttributeCount = s.droppedAttributes
if len(s.events.queue) > 0 {
- sd.events = s.interfaceArrayToEventArray()
+ sd.events = s.events.copy()
sd.droppedEventCount = s.events.droppedCount
}
if len(s.links.queue) > 0 {
- sd.links = s.interfaceArrayToLinksArray()
+ sd.links = s.links.copy()
sd.droppedLinkCount = s.links.droppedCount
}
return &sd
}
-func (s *recordingSpan) interfaceArrayToLinksArray() []Link {
- linkArr := make([]Link, 0)
- for _, value := range s.links.queue {
- linkArr = append(linkArr, value.(Link))
- }
- return linkArr
-}
-
-func (s *recordingSpan) interfaceArrayToEventArray() []Event {
- eventArr := make([]Event, 0)
- for _, value := range s.events.queue {
- eventArr = append(eventArr, value.(Event))
- }
- return eventArr
-}
-
func (s *recordingSpan) addChild() {
if !s.IsRecording() {
return
@@ -810,6 +818,9 @@ func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {}
// AddEvent does nothing.
func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {}
+// AddLink does nothing.
+func (nonRecordingSpan) AddLink(trace.Link) {}
+
// SetName does nothing.
func (nonRecordingSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go
index c9bd52f7ad4..6bdda3d94a4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go
index aa4d4221db3..bec5e209787 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
index 9c53657a719..af7f9177fc5 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
index 301e1a7abcc..43419d3b541 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -143,13 +132,13 @@ func (tr *tracer) newRecordingSpan(psc, sc trace.SpanContext, name string, sr Sa
spanKind: trace.ValidateSpanKind(config.SpanKind()),
name: name,
startTime: startTime,
- events: newEvictedQueue(tr.provider.spanLimits.EventCountLimit),
- links: newEvictedQueue(tr.provider.spanLimits.LinkCountLimit),
+ events: newEvictedQueueEvent(tr.provider.spanLimits.EventCountLimit),
+ links: newEvictedQueueLink(tr.provider.spanLimits.LinkCountLimit),
tracer: tr,
}
for _, l := range config.Links() {
- s.addLink(l)
+ s.AddLink(l)
}
s.SetAttributes(sr.Attributes...)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/version.go b/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
index d3457ed1355..b84dd2c5eef 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/version.go b/vendor/go.opentelemetry.io/otel/sdk/version.go
index 7048c788e93..33d065a7cb9 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/version.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package sdk // import "go.opentelemetry.io/otel/sdk"
// Version is the current release version of the OpenTelemetry SDK in use.
func Version() string {
- return "1.20.0"
+ return "1.28.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go b/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
index 19c394c69b6..ada857995db 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/semconv/internal"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md
new file mode 100644
index 00000000000..6a273180feb
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.12.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.12.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.12.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
index 181fcc9c520..fc255ef05d9 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
index d6892709437..f0e12957e36 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
index 4b4f3cbaf0b..4e19ca342c6 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
index b2155676f45..45951685a7e 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
index 2f2a019e43d..f01d515bc23 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
index 047d8e95cce..70c25dc2108 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
@@ -1206,7 +1195,7 @@ const (
// Stability: stable
// Examples: 'Users', 'CatsTable'
AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
- // The the number of items in the `TableNames` response parameter.
+ // The number of items in the `TableNames` response parameter.
//
// Type: int
// Required: No
@@ -1267,7 +1256,7 @@ const (
// Stability: stable
// Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
- // The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates`
+ // The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates`
// request field.
//
// Type: string[]
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md
new file mode 100644
index 00000000000..87b842c5d11
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.17.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.17.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.17.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
index 71a1f7748d5..e087c9c04d9 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
index 679c40c4de4..c7b804bbe2e 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
index 9b8c559de42..137acc67de0 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
index d5c4b5c136a..d318221e59f 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
index 39a2eab3a6a..7e365e82ce8 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
index 42fc525d165..634a1dce07a 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
index 8c4a7299d27..21497bb6bc6 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
new file mode 100644
index 00000000000..82e1f46b4ea
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.20.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.20.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.20.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
new file mode 100644
index 00000000000..6685c392b50
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
@@ -0,0 +1,1198 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Describes HTTP attributes.
+const (
+ // HTTPMethodKey is the attribute Key conforming to the "http.method"
+ // semantic conventions. It represents the hTTP request method.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ HTTPMethodKey = attribute.Key("http.method")
+
+ // HTTPStatusCodeKey is the attribute Key conforming to the
+ // "http.status_code" semantic conventions. It represents the [HTTP
+ // response status code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If and only if one was
+ // received/sent.)
+ // Stability: stable
+ // Examples: 200
+ HTTPStatusCodeKey = attribute.Key("http.status_code")
+)
+
+// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
+// semantic conventions. It represents the hTTP request method.
+func HTTPMethod(val string) attribute.KeyValue {
+ return HTTPMethodKey.String(val)
+}
+
+// HTTPStatusCode returns an attribute KeyValue conforming to the
+// "http.status_code" semantic conventions. It represents the [HTTP response
+// status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPStatusCode(val int) attribute.KeyValue {
+ return HTTPStatusCodeKey.Int(val)
+}
+
+// HTTP Server spans attributes
+const (
+ // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
+ // semantic conventions. It represents the URI scheme identifying the used
+ // protocol.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'http', 'https'
+ HTTPSchemeKey = attribute.Key("http.scheme")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route (path template in
+ // the format used by the respective server framework). See note below
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If and only if it's available)
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/specification/trace/semantic_conventions/http.md#http-server-definitions)
+ // if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
+// semantic conventions. It represents the URI scheme identifying the used
+// protocol.
+func HTTPScheme(val string) attribute.KeyValue {
+ return HTTPSchemeKey.String(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route (path template in the
+// format used by the respective server framework). See note below
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the name identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'click', 'exception'
+ EventNameKey = attribute.Key("event.name")
+
+ // EventDomainKey is the attribute Key conforming to the "event.domain"
+ // semantic conventions. It represents the domain identifies the business
+ // context for the events.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Note: Events across different domains may have same `event.name`, yet be
+ // unrelated events.
+ EventDomainKey = attribute.Key("event.domain")
+)
+
+var (
+ // Events from browser apps
+ EventDomainBrowser = EventDomainKey.String("browser")
+ // Events from mobile apps
+ EventDomainDevice = EventDomainKey.String("device")
+ // Events from Kubernetes
+ EventDomainK8S = EventDomainKey.String("k8s")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the name identifies the event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetTransportKey is the attribute Key conforming to the "net.transport"
+ // semantic conventions. It represents the transport protocol used. See
+ // note below.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ NetTransportKey = attribute.Key("net.transport")
+
+ // NetProtocolNameKey is the attribute Key conforming to the
+ // "net.protocol.name" semantic conventions. It represents the application
+ // layer protocol used. The value SHOULD be normalized to lowercase.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ NetProtocolNameKey = attribute.Key("net.protocol.name")
+
+ // NetProtocolVersionKey is the attribute Key conforming to the
+ // "net.protocol.version" semantic conventions. It represents the version
+ // of the application layer protocol used. See note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '3.1.1'
+ // Note: `net.protocol.version` refers to the version of the protocol used
+ // and might be different from the protocol client's version. If the HTTP
+ // client used has a version of `0.27.2`, but sends HTTP version `1.1`,
+ // this attribute should be set to `1.1`.
+ NetProtocolVersionKey = attribute.Key("net.protocol.version")
+
+ // NetSockPeerNameKey is the attribute Key conforming to the
+ // "net.sock.peer.name" semantic conventions. It represents the remote
+ // socket peer name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended (If available and different from
+ // `net.peer.name` and if `net.sock.peer.addr` is set.)
+ // Stability: stable
+ // Examples: 'proxy.example.com'
+ NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
+
+ // NetSockPeerAddrKey is the attribute Key conforming to the
+ // "net.sock.peer.addr" semantic conventions. It represents the remote
+ // socket peer address: IPv4 or IPv6 for internet protocols, path for local
+ // communication,
+ // [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '127.0.0.1', '/tmp/mysql.sock'
+ NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
+
+ // NetSockPeerPortKey is the attribute Key conforming to the
+ // "net.sock.peer.port" semantic conventions. It represents the remote
+ // socket peer port.
+ //
+ // Type: int
+ // RequirementLevel: Recommended (If defined for the address family and if
+ // different than `net.peer.port` and if `net.sock.peer.addr` is set.)
+ // Stability: stable
+ // Examples: 16456
+ NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
+
+ // NetSockFamilyKey is the attribute Key conforming to the
+ // "net.sock.family" semantic conventions. It represents the protocol
+ // [address
+ // family](https://man7.org/linux/man-pages/man7/address_families.7.html)
+ // which is used for communication.
+ //
+ // Type: Enum
+ // RequirementLevel: ConditionallyRequired (If different than `inet` and if
+ // any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers
+ // of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in
+ // `net.sock.peer.addr` if `net.sock.family` is not set. This is to support
+ // instrumentations that follow previous versions of this document.)
+ // Stability: stable
+ // Examples: 'inet6', 'bluetooth'
+ NetSockFamilyKey = attribute.Key("net.sock.family")
+
+ // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
+ // semantic conventions. It represents the logical remote hostname, see
+ // note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com'
+ // Note: `net.peer.name` SHOULD NOT be set if capturing it would require an
+ // extra DNS lookup.
+ NetPeerNameKey = attribute.Key("net.peer.name")
+
+ // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
+ // semantic conventions. It represents the logical remote port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ NetPeerPortKey = attribute.Key("net.peer.port")
+
+ // NetHostNameKey is the attribute Key conforming to the "net.host.name"
+ // semantic conventions. It represents the logical local hostname or
+ // similar, see note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'localhost'
+ NetHostNameKey = attribute.Key("net.host.name")
+
+ // NetHostPortKey is the attribute Key conforming to the "net.host.port"
+ // semantic conventions. It represents the logical local port number,
+ // preferably the one that the peer used to connect
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 8080
+ NetHostPortKey = attribute.Key("net.host.port")
+
+ // NetSockHostAddrKey is the attribute Key conforming to the
+ // "net.sock.host.addr" semantic conventions. It represents the local
+ // socket address. Useful in case of a multi-IP host.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '192.168.0.1'
+ NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
+
+ // NetSockHostPortKey is the attribute Key conforming to the
+ // "net.sock.host.port" semantic conventions. It represents the local
+ // socket port number.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If defined for the address
+ // family and if different than `net.host.port` and if `net.sock.host.addr`
+ // is set. In other cases, it is still recommended to set this.)
+ // Stability: stable
+ // Examples: 35555
+ NetSockHostPortKey = attribute.Key("net.sock.host.port")
+)
+
+var (
+ // ip_tcp
+ NetTransportTCP = NetTransportKey.String("ip_tcp")
+ // ip_udp
+ NetTransportUDP = NetTransportKey.String("ip_udp")
+ // Named or anonymous pipe. See note below
+ NetTransportPipe = NetTransportKey.String("pipe")
+ // In-process communication
+ NetTransportInProc = NetTransportKey.String("inproc")
+ // Something else (non IP-based)
+ NetTransportOther = NetTransportKey.String("other")
+)
+
+var (
+ // IPv4 address
+ NetSockFamilyInet = NetSockFamilyKey.String("inet")
+ // IPv6 address
+ NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
+ // Unix domain socket path
+ NetSockFamilyUnix = NetSockFamilyKey.String("unix")
+)
+
+// NetProtocolName returns an attribute KeyValue conforming to the
+// "net.protocol.name" semantic conventions. It represents the application
+// layer protocol used. The value SHOULD be normalized to lowercase.
+func NetProtocolName(val string) attribute.KeyValue {
+ return NetProtocolNameKey.String(val)
+}
+
+// NetProtocolVersion returns an attribute KeyValue conforming to the
+// "net.protocol.version" semantic conventions. It represents the version of
+// the application layer protocol used. See note below.
+func NetProtocolVersion(val string) attribute.KeyValue {
+ return NetProtocolVersionKey.String(val)
+}
+
+// NetSockPeerName returns an attribute KeyValue conforming to the
+// "net.sock.peer.name" semantic conventions. It represents the remote socket
+// peer name.
+func NetSockPeerName(val string) attribute.KeyValue {
+ return NetSockPeerNameKey.String(val)
+}
+
+// NetSockPeerAddr returns an attribute KeyValue conforming to the
+// "net.sock.peer.addr" semantic conventions. It represents the remote socket
+// peer address: IPv4 or IPv6 for internet protocols, path for local
+// communication,
+// [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
+func NetSockPeerAddr(val string) attribute.KeyValue {
+ return NetSockPeerAddrKey.String(val)
+}
+
+// NetSockPeerPort returns an attribute KeyValue conforming to the
+// "net.sock.peer.port" semantic conventions. It represents the remote socket
+// peer port.
+func NetSockPeerPort(val int) attribute.KeyValue {
+ return NetSockPeerPortKey.Int(val)
+}
+
+// NetPeerName returns an attribute KeyValue conforming to the
+// "net.peer.name" semantic conventions. It represents the logical remote
+// hostname, see note below.
+func NetPeerName(val string) attribute.KeyValue {
+ return NetPeerNameKey.String(val)
+}
+
+// NetPeerPort returns an attribute KeyValue conforming to the
+// "net.peer.port" semantic conventions. It represents the logical remote port
+// number
+func NetPeerPort(val int) attribute.KeyValue {
+ return NetPeerPortKey.Int(val)
+}
+
+// NetHostName returns an attribute KeyValue conforming to the
+// "net.host.name" semantic conventions. It represents the logical local
+// hostname or similar, see note below.
+func NetHostName(val string) attribute.KeyValue {
+ return NetHostNameKey.String(val)
+}
+
+// NetHostPort returns an attribute KeyValue conforming to the
+// "net.host.port" semantic conventions. It represents the logical local port
+// number, preferably the one that the peer used to connect
+func NetHostPort(val int) attribute.KeyValue {
+ return NetHostPortKey.Int(val)
+}
+
+// NetSockHostAddr returns an attribute KeyValue conforming to the
+// "net.sock.host.addr" semantic conventions. It represents the local socket
+// address. Useful in case of a multi-IP host.
+func NetSockHostAddr(val string) attribute.KeyValue {
+ return NetSockHostAddrKey.String(val)
+}
+
+// NetSockHostPort returns an attribute KeyValue conforming to the
+// "net.sock.host.port" semantic conventions. It represents the local socket
+// port number.
+func NetSockHostPort(val int) attribute.KeyValue {
+ return NetSockHostPortKey.Int(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetHostConnectionTypeKey is the attribute Key conforming to the
+ // "net.host.connection.type" semantic conventions. It represents the
+ // internet connection type currently being used by the host.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'wifi'
+ NetHostConnectionTypeKey = attribute.Key("net.host.connection.type")
+
+ // NetHostConnectionSubtypeKey is the attribute Key conforming to the
+ // "net.host.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'LTE'
+ NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype")
+
+ // NetHostCarrierNameKey is the attribute Key conforming to the
+ // "net.host.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'sprint'
+ NetHostCarrierNameKey = attribute.Key("net.host.carrier.name")
+
+ // NetHostCarrierMccKey is the attribute Key conforming to the
+ // "net.host.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '310'
+ NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc")
+
+ // NetHostCarrierMncKey is the attribute Key conforming to the
+ // "net.host.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '001'
+ NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc")
+
+ // NetHostCarrierIccKey is the attribute Key conforming to the
+ // "net.host.carrier.icc" semantic conventions. It represents the ISO
+ // 3166-1 alpha-2 2-character country code associated with the mobile
+ // carrier network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'DE'
+ NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc")
+)
+
+var (
+ // wifi
+ NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi")
+ // wired
+ NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired")
+ // cell
+ NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell")
+ // unavailable
+ NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable")
+ // unknown
+ NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown")
+)
+
+var (
+ // GPRS
+ NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca")
+)
+
+// NetHostCarrierName returns an attribute KeyValue conforming to the
+// "net.host.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetHostCarrierName(val string) attribute.KeyValue {
+ return NetHostCarrierNameKey.String(val)
+}
+
+// NetHostCarrierMcc returns an attribute KeyValue conforming to the
+// "net.host.carrier.mcc" semantic conventions. It represents the mobile
+// carrier country code.
+func NetHostCarrierMcc(val string) attribute.KeyValue {
+ return NetHostCarrierMccKey.String(val)
+}
+
+// NetHostCarrierMnc returns an attribute KeyValue conforming to the
+// "net.host.carrier.mnc" semantic conventions. It represents the mobile
+// carrier network code.
+func NetHostCarrierMnc(val string) attribute.KeyValue {
+ return NetHostCarrierMncKey.String(val)
+}
+
+// NetHostCarrierIcc returns an attribute KeyValue conforming to the
+// "net.host.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetHostCarrierIcc(val string) attribute.KeyValue {
+ return NetHostCarrierIccKey.String(val)
+}
+
+// Semantic conventions for HTTP client and server Spans.
+const (
+ // HTTPRequestContentLengthKey is the attribute Key conforming to the
+ // "http.request_content_length" semantic conventions. It represents the
+ // size of the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3495
+ HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
+
+ // HTTPResponseContentLengthKey is the attribute Key conforming to the
+ // "http.response_content_length" semantic conventions. It represents the
+ // size of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3495
+ HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
+)
+
+// HTTPRequestContentLength returns an attribute KeyValue conforming to the
+// "http.request_content_length" semantic conventions. It represents the size
+// of the request payload body in bytes. This is the number of bytes
+// transferred excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestContentLength(val int) attribute.KeyValue {
+ return HTTPRequestContentLengthKey.Int(val)
+}
+
+// HTTPResponseContentLength returns an attribute KeyValue conforming to the
+// "http.response_content_length" semantic conventions. It represents the size
+// of the response payload body in bytes. This is the number of bytes
+// transferred excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseContentLength(val int) attribute.KeyValue {
+ return HTTPResponseContentLengthKey.Int(val)
+}
+
+// Semantic convention describing per-message attributes populated on messaging
+// spans or links.
+const (
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the [conversation ID](#conversations) identifying the conversation to
+ // which the message belongs, represented as a string. Sometimes called
+ // "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
+ // the "messaging.message.payload_size_bytes" semantic conventions. It
+ // represents the (uncompressed) size of the message payload in bytes. Also
+ // use this attribute if it is unknown whether the compressed or
+ // uncompressed payload size is reported.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2738
+ MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
+
+ // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
+ // conforming to the "messaging.message.payload_compressed_size_bytes"
+ // semantic conventions. It represents the compressed size of the message
+ // payload in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2048
+ MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
+)
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the [conversation ID](#conversations) identifying the
+// conversation to which the message belongs, represented as a string.
+// Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
+// to the "messaging.message.payload_size_bytes" semantic conventions. It
+// represents the (uncompressed) size of the message payload in bytes. Also use
+// this attribute if it is unknown whether the compressed or uncompressed
+// payload size is reported.
+func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
+ return MessagingMessagePayloadSizeBytesKey.Int(val)
+}
+
+// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
+// conforming to the "messaging.message.payload_compressed_size_bytes" semantic
+// conventions. It represents the compressed size of the message payload in
+// bytes.
+func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
+ return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
+}
+
+// Semantic convention for attributes that describe messaging destination on
+// broker
+const (
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker does not have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+)
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// Semantic convention for attributes that describe messaging source on broker
+const (
+ // MessagingSourceNameKey is the attribute Key conforming to the
+ // "messaging.source.name" semantic conventions. It represents the message
+ // source name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Source name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker does not have such notion, the source name SHOULD uniquely
+ // identify the broker.
+ MessagingSourceNameKey = attribute.Key("messaging.source.name")
+
+ // MessagingSourceTemplateKey is the attribute Key conforming to the
+ // "messaging.source.template" semantic conventions. It represents the low
+ // cardinality representation of the messaging source name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Source names could be constructed from templates. An example would
+ // be a source name involving a user name or product id. Although the
+ // source name in this case is of high cardinality, the underlying template
+ // is of low cardinality and can be effectively used for grouping and
+ // aggregation.
+ MessagingSourceTemplateKey = attribute.Key("messaging.source.template")
+
+ // MessagingSourceTemporaryKey is the attribute Key conforming to the
+ // "messaging.source.temporary" semantic conventions. It represents a
+ // boolean that is true if the message source is temporary and might not
+ // exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary")
+
+ // MessagingSourceAnonymousKey is the attribute Key conforming to the
+ // "messaging.source.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message source is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous")
+)
+
+// MessagingSourceName returns an attribute KeyValue conforming to the
+// "messaging.source.name" semantic conventions. It represents the message
+// source name
+func MessagingSourceName(val string) attribute.KeyValue {
+ return MessagingSourceNameKey.String(val)
+}
+
+// MessagingSourceTemplate returns an attribute KeyValue conforming to the
+// "messaging.source.template" semantic conventions. It represents the low
+// cardinality representation of the messaging source name
+func MessagingSourceTemplate(val string) attribute.KeyValue {
+ return MessagingSourceTemplateKey.String(val)
+}
+
+// MessagingSourceTemporary returns an attribute KeyValue conforming to the
+// "messaging.source.temporary" semantic conventions. It represents a boolean
+// that is true if the message source is temporary and might not exist anymore
+// after messages are processed.
+func MessagingSourceTemporary(val bool) attribute.KeyValue {
+ return MessagingSourceTemporaryKey.Bool(val)
+}
+
+// MessagingSourceAnonymous returns an attribute KeyValue conforming to the
+// "messaging.source.anonymous" semantic conventions. It represents a boolean
+// that is true if the message source is anonymous (could be unnamed or have
+// auto-generated name).
+func MessagingSourceAnonymous(val bool) attribute.KeyValue {
+ return MessagingSourceAnonymousKey.Bool(val)
+}
+
+// Attributes for RabbitMQ
+const (
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If not empty.)
+ // Stability: stable
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+)
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// Attributes for Apache Kafka
+const (
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaClientIDKey is the attribute Key conforming to the
+ // "messaging.kafka.client_id" semantic conventions. It represents the
+ // client ID for the Consumer or Producer that is handling the message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client-5'
+ MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
+
+ // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
+ // the "messaging.kafka.destination.partition" semantic conventions. It
+ // represents the partition the message is sent to.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2
+ MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
+
+ // MessagingKafkaSourcePartitionKey is the attribute Key conforming to the
+ // "messaging.kafka.source.partition" semantic conventions. It represents
+ // the partition the message is received from.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2
+ MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: ConditionallyRequired (If value is `true`. When
+ // missing, the value is assumed to be `false`.)
+ // Stability: stable
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+)
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaClientID returns an attribute KeyValue conforming to the
+// "messaging.kafka.client_id" semantic conventions. It represents the client
+// ID for the Consumer or Producer that is handling the message.
+func MessagingKafkaClientID(val string) attribute.KeyValue {
+ return MessagingKafkaClientIDKey.String(val)
+}
+
+// MessagingKafkaDestinationPartition returns an attribute KeyValue
+// conforming to the "messaging.kafka.destination.partition" semantic
+// conventions. It represents the partition the message is sent to.
+func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
+ return MessagingKafkaDestinationPartitionKey.Int(val)
+}
+
+// MessagingKafkaSourcePartition returns an attribute KeyValue conforming to
+// the "messaging.kafka.source.partition" semantic conventions. It represents
+// the partition the message is received from.
+func MessagingKafkaSourcePartition(val int) attribute.KeyValue {
+ return MessagingKafkaSourcePartitionKey.Int(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// Attributes for Apache RocketMQ
+const (
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqClientIDKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_id" semantic conventions. It represents the
+ // unique identifier for each client.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myhost@8742@s8083jm'
+ MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay
+ // and delay time level is not specified.)
+ // Stability: stable
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay
+ // and delivery timestamp is not specified.)
+ // Stability: stable
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
+ // Stability: stable
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqClientID returns an attribute KeyValue conforming to the
+// "messaging.rocketmq.client_id" semantic conventions. It represents the
+// unique identifier for each client.
+func MessagingRocketmqClientID(val string) attribute.KeyValue {
+ return MessagingRocketmqClientIDKey.String(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+)
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
new file mode 100644
index 00000000000..0d1f55a8fe9
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the conventions
+// as of the v1.20.0 version of the OpenTelemetry specification.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
similarity index 92%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
index 30ae34fe478..63776393217 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
new file mode 100644
index 00000000000..f40c97825aa
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
new file mode 100644
index 00000000000..9c1840631b6
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
@@ -0,0 +1,10 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+// HTTP scheme attributes.
+var (
+ HTTPSchemeHTTP = HTTPSchemeKey.String("http")
+ HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
similarity index 86%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
index b6d8935cf97..3d44dae2750 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
@@ -273,8 +262,6 @@ var (
CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
// Azure Red Hat OpenShift
CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
- // Google Bare Metal Solution (BMS)
- CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
// Google Cloud Compute Engine (GCE)
CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
// Google Cloud Run
@@ -547,103 +534,6 @@ func AWSLogStreamARNs(val ...string) attribute.KeyValue {
return AWSLogStreamARNsKey.StringSlice(val)
}
-// Resource used by Google Cloud Run.
-const (
- // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
- // "gcp.cloud_run.job.execution" semantic conventions. It represents the
- // name of the Cloud Run
- // [execution](https://cloud.google.com/run/docs/managing/job-executions)
- // being run for the Job, as set by the
- // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
- // environment variable.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'job-name-xxxx', 'sample-job-mdw84'
- GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
-
- // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
- // "gcp.cloud_run.job.task_index" semantic conventions. It represents the
- // index for a task within an execution as provided by the
- // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
- // environment variable.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 0, 1
- GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
-)
-
-// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
-// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
-// of the Cloud Run
-// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
-// run for the Job, as set by the
-// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
-// environment variable.
-func GCPCloudRunJobExecution(val string) attribute.KeyValue {
- return GCPCloudRunJobExecutionKey.String(val)
-}
-
-// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
-// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
-// for a task within an execution as provided by the
-// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
-// environment variable.
-func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
- return GCPCloudRunJobTaskIndexKey.Int(val)
-}
-
-// Resources used by Google Compute Engine (GCE).
-const (
- // GCPGceInstanceNameKey is the attribute Key conforming to the
- // "gcp.gce.instance.name" semantic conventions. It represents the instance
- // name of a GCE instance. This is the value provided by `host.name`, the
- // visible name of the instance in the Cloud Console UI, and the prefix for
- // the default hostname of the instance as defined by the [default internal
- // DNS
- // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'instance-1', 'my-vm-name'
- GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
-
- // GCPGceInstanceHostnameKey is the attribute Key conforming to the
- // "gcp.gce.instance.hostname" semantic conventions. It represents the
- // hostname of a GCE instance. This is the full value of the default or
- // [custom
- // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'my-host1234.example.com',
- // 'sample-vm.us-west1-b.c.my-project.internal'
- GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
-)
-
-// GCPGceInstanceName returns an attribute KeyValue conforming to the
-// "gcp.gce.instance.name" semantic conventions. It represents the instance
-// name of a GCE instance. This is the value provided by `host.name`, the
-// visible name of the instance in the Cloud Console UI, and the prefix for the
-// default hostname of the instance as defined by the [default internal DNS
-// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
-func GCPGceInstanceName(val string) attribute.KeyValue {
- return GCPGceInstanceNameKey.String(val)
-}
-
-// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
-// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
-// of a GCE instance. This is the full value of the default or [custom
-// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
-func GCPGceInstanceHostname(val string) attribute.KeyValue {
- return GCPGceInstanceHostnameKey.String(val)
-}
-
// Heroku dyno metadata
const (
// HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
@@ -751,59 +641,6 @@ const (
// Stability: stable
// Examples: '0.1'
ContainerImageTagKey = attribute.Key("container.image.tag")
-
- // ContainerImageIDKey is the attribute Key conforming to the
- // "container.image.id" semantic conventions. It represents the runtime
- // specific image identifier. Usually a hash algorithm followed by a UUID.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples:
- // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
- // Note: Docker defines a sha256 of the image id; `container.image.id`
- // corresponds to the `Image` field from the Docker container inspect
- // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
- // endpoint.
- // K8S defines a link to the container registry repository with digest
- // `"imageID": "registry.azurecr.io
- // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
- // OCI defines a digest of manifest.
- ContainerImageIDKey = attribute.Key("container.image.id")
-
- // ContainerCommandKey is the attribute Key conforming to the
- // "container.command" semantic conventions. It represents the command used
- // to run the container (i.e. the command name).
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'otelcontribcol'
- // Note: If using embedded credentials or sensitive data, it is recommended
- // to remove them to prevent potential leakage.
- ContainerCommandKey = attribute.Key("container.command")
-
- // ContainerCommandLineKey is the attribute Key conforming to the
- // "container.command_line" semantic conventions. It represents the full
- // command run by the container as a single string representing the full
- // command. [2]
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'otelcontribcol --config config.yaml'
- ContainerCommandLineKey = attribute.Key("container.command_line")
-
- // ContainerCommandArgsKey is the attribute Key conforming to the
- // "container.command_args" semantic conventions. It represents the all the
- // command arguments (including the command/executable itself) run by the
- // container. [2]
- //
- // Type: string[]
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'otelcontribcol, --config, config.yaml'
- ContainerCommandArgsKey = attribute.Key("container.command_args")
)
// ContainerName returns an attribute KeyValue conforming to the
@@ -843,36 +680,6 @@ func ContainerImageTag(val string) attribute.KeyValue {
return ContainerImageTagKey.String(val)
}
-// ContainerImageID returns an attribute KeyValue conforming to the
-// "container.image.id" semantic conventions. It represents the runtime
-// specific image identifier. Usually a hash algorithm followed by a UUID.
-func ContainerImageID(val string) attribute.KeyValue {
- return ContainerImageIDKey.String(val)
-}
-
-// ContainerCommand returns an attribute KeyValue conforming to the
-// "container.command" semantic conventions. It represents the command used to
-// run the container (i.e. the command name).
-func ContainerCommand(val string) attribute.KeyValue {
- return ContainerCommandKey.String(val)
-}
-
-// ContainerCommandLine returns an attribute KeyValue conforming to the
-// "container.command_line" semantic conventions. It represents the full
-// command run by the container as a single string representing the full
-// command. [2]
-func ContainerCommandLine(val string) attribute.KeyValue {
- return ContainerCommandLineKey.String(val)
-}
-
-// ContainerCommandArgs returns an attribute KeyValue conforming to the
-// "container.command_args" semantic conventions. It represents the all the
-// command arguments (including the command/executable itself) run by the
-// container. [2]
-func ContainerCommandArgs(val ...string) attribute.KeyValue {
- return ContainerCommandArgsKey.StringSlice(val)
-}
-
// The software deployment.
const (
// DeploymentEnvironmentKey is the attribute Key conforming to the
@@ -1002,7 +809,7 @@ const (
// FaaS
// platform and is usually different from the name of the callback
// function (which may be stored in the
- // [`code.namespace`/`code.function`](/docs/general/general-attributes.md#source-code-attributes)
+ // [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes)
// span attributes).
//
// For some cloud providers, the above definition is ambiguous. The
@@ -1032,7 +839,7 @@ const (
// * **AWS Lambda:** The [function
// version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
// (an integer represented as a decimal string).
- // * **Google Cloud Run (Services):** The
+ // * **Google Cloud Run:** The
// [revision](https://cloud.google.com/run/docs/managing/revisions)
// (i.e., the function name plus the revision suffix).
// * **Google Cloud Functions:** The value of the
@@ -1098,8 +905,7 @@ func FaaSMaxMemory(val int) attribute.KeyValue {
return FaaSMaxMemoryKey.Int(val)
}
-// A host is defined as a computing instance. For example, physical servers,
-// virtual machines, switches or disk array.
+// A host is defined as a general computing instance.
const (
// HostIDKey is the attribute Key conforming to the "host.id" semantic
// conventions. It represents the unique host ID. For Cloud, this must be
@@ -1154,8 +960,8 @@ const (
HostImageNameKey = attribute.Key("host.image.name")
// HostImageIDKey is the attribute Key conforming to the "host.image.id"
- // semantic conventions. It represents the vM image ID or host OS image ID.
- // For Cloud, this value is from the provider.
+ // semantic conventions. It represents the vM image ID. For Cloud, this
+ // value is from the provider.
//
// Type: string
// RequirementLevel: Optional
@@ -1165,7 +971,7 @@ const (
// HostImageVersionKey is the attribute Key conforming to the
// "host.image.version" semantic conventions. It represents the version
- // string of the VM image or host OS as defined in [Version
+ // string of the VM image as defined in [Version
// Attributes](README.md#version-attributes).
//
// Type: string
@@ -1226,15 +1032,15 @@ func HostImageName(val string) attribute.KeyValue {
}
// HostImageID returns an attribute KeyValue conforming to the
-// "host.image.id" semantic conventions. It represents the vM image ID or host
-// OS image ID. For Cloud, this value is from the provider.
+// "host.image.id" semantic conventions. It represents the vM image ID. For
+// Cloud, this value is from the provider.
func HostImageID(val string) attribute.KeyValue {
return HostImageIDKey.String(val)
}
// HostImageVersion returns an attribute KeyValue conforming to the
// "host.image.version" semantic conventions. It represents the version string
-// of the VM image or host OS as defined in [Version
+// of the VM image as defined in [Version
// Attributes](README.md#version-attributes).
func HostImageVersion(val string) attribute.KeyValue {
return HostImageVersionKey.String(val)
@@ -1251,40 +1057,6 @@ const (
// Stability: stable
// Examples: 'opentelemetry-cluster'
K8SClusterNameKey = attribute.Key("k8s.cluster.name")
-
- // K8SClusterUIDKey is the attribute Key conforming to the
- // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for
- // the cluster, set to the UID of the `kube-system` namespace.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d'
- // Note: K8S does not have support for obtaining a cluster ID. If this is
- // ever
- // added, we will recommend collecting the `k8s.cluster.uid` through the
- // official APIs. In the meantime, we are able to use the `uid` of the
- // `kube-system` namespace as a proxy for cluster ID. Read on for the
- // rationale.
- //
- // Every object created in a K8S cluster is assigned a distinct UID. The
- // `kube-system` namespace is used by Kubernetes itself and will exist
- // for the lifetime of the cluster. Using the `uid` of the `kube-system`
- // namespace is a reasonable proxy for the K8S ClusterID as it will only
- // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
- // UUIDs as standardized by
- // [ISO/IEC 9834-8 and ITU-T
- // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
- // Which states:
- //
- // > If generated according to one of the mechanisms defined in Rec.
- // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
- // different from all other UUIDs generated before 3603 A.D., or is
- // extremely likely to be different (depending on the mechanism chosen).
- //
- // Therefore, UIDs between clusters should be extremely unlikely to
- // conflict.
- K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
)
// K8SClusterName returns an attribute KeyValue conforming to the
@@ -1294,13 +1066,6 @@ func K8SClusterName(val string) attribute.KeyValue {
return K8SClusterNameKey.String(val)
}
-// K8SClusterUID returns an attribute KeyValue conforming to the
-// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
-// cluster, set to the UID of the `kube-system` namespace.
-func K8SClusterUID(val string) attribute.KeyValue {
- return K8SClusterUIDKey.String(val)
-}
-
// A Kubernetes Node object.
const (
// K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
@@ -1683,7 +1448,7 @@ const (
// OSVersionKey is the attribute Key conforming to the "os.version"
// semantic conventions. It represents the version string of the operating
// system as defined in [Version
- // Attributes](/docs/resource/README.md#version-attributes).
+ // Attributes](../../resource/semantic_conventions/README.md#version-attributes).
//
// Type: string
// RequirementLevel: Optional
@@ -1734,7 +1499,7 @@ func OSName(val string) attribute.KeyValue {
// OSVersion returns an attribute KeyValue conforming to the "os.version"
// semantic conventions. It represents the version string of the operating
// system as defined in [Version
-// Attributes](/docs/resource/README.md#version-attributes).
+// Attributes](../../resource/semantic_conventions/README.md#version-attributes).
func OSVersion(val string) attribute.KeyValue {
return OSVersionKey.String(val)
}
@@ -1983,17 +1748,6 @@ const (
// `unknown_service:bash`. If `process.executable.name` is not available,
// the value MUST be set to `unknown_service`.
ServiceNameKey = attribute.Key("service.name")
-
- // ServiceVersionKey is the attribute Key conforming to the
- // "service.version" semantic conventions. It represents the version string
- // of the service API or implementation. The format is not defined by these
- // conventions.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '2.0.0', 'a01dbef8a'
- ServiceVersionKey = attribute.Key("service.version")
)
// ServiceName returns an attribute KeyValue conforming to the
@@ -2003,14 +1757,6 @@ func ServiceName(val string) attribute.KeyValue {
return ServiceNameKey.String(val)
}
-// ServiceVersion returns an attribute KeyValue conforming to the
-// "service.version" semantic conventions. It represents the version string of
-// the service API or implementation. The format is not defined by these
-// conventions.
-func ServiceVersion(val string) attribute.KeyValue {
- return ServiceVersionKey.String(val)
-}
-
// A service instance.
const (
// ServiceNamespaceKey is the attribute Key conforming to the
@@ -2054,6 +1800,16 @@ const (
// RFC 4122 UUID (services aiming for reproducible UUIDs may also use
// Version 5, see RFC 4122 for more recommendations).
ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceVersionKey is the attribute Key conforming to the
+ // "service.version" semantic conventions. It represents the version string
+ // of the service API or implementation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '2.0.0'
+ ServiceVersionKey = attribute.Key("service.version")
)
// ServiceNamespace returns an attribute KeyValue conforming to the
@@ -2070,6 +1826,13 @@ func ServiceInstanceID(val string) attribute.KeyValue {
return ServiceInstanceIDKey.String(val)
}
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
// The telemetry SDK used to capture data recorded by the instrumentation
// libraries.
const (
@@ -2081,17 +1844,6 @@ const (
// RequirementLevel: Required
// Stability: stable
// Examples: 'opentelemetry'
- // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute
- // to `opentelemetry`.
- // If another SDK, like a fork or a vendor-provided implementation, is
- // used, this SDK MUST set the
- // `telemetry.sdk.name` attribute to the fully-qualified class or module
- // name of this SDK's main entry point
- // or another suitable identifier depending on the language.
- // The identifier `opentelemetry` is reserved and MUST NOT be used in this
- // case.
- // All custom identifiers SHOULD be stable across different versions of an
- // implementation.
TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
// TelemetrySDKLanguageKey is the attribute Key conforming to the
@@ -2133,12 +1885,10 @@ var (
TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
// ruby
TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
- // rust
- TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
- // swift
- TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
// webjs
TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs")
+ // swift
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
)
// TelemetrySDKName returns an attribute KeyValue conforming to the
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
new file mode 100644
index 00000000000..95d0210e38f
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
similarity index 94%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
index b5a91450d42..90b1b0452cc 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
@@ -84,6 +73,33 @@ func ExceptionStacktrace(val string) attribute.KeyValue {
return ExceptionStacktraceKey.String(val)
}
+// The attributes described in this section are rather generic. They may be
+// used in any Log Record they apply to.
+const (
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
// Span attributes used by AWS Lambda (in addition to general `faas`
// attributes).
const (
@@ -498,8 +514,8 @@ const (
// RequirementLevel: Optional
// Stability: stable
// Examples: 'MSSQLSERVER'
- // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer
- // required (but still recommended if non-standard).
+ // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no
+ // longer required (but still recommended if non-standard).
DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
)
@@ -1208,9 +1224,9 @@ func FaaSInvokedRegion(val string) attribute.KeyValue {
const (
// PeerServiceKey is the attribute Key conforming to the "peer.service"
// semantic conventions. It represents the
- // [`service.name`](/docs/resource/README.md#service) of the remote
- // service. SHOULD be equal to the actual `service.name` resource attribute
- // of the remote service if any.
+ // [`service.name`](../../resource/semantic_conventions/README.md#service)
+ // of the remote service. SHOULD be equal to the actual `service.name`
+ // resource attribute of the remote service if any.
//
// Type: string
// RequirementLevel: Optional
@@ -1221,9 +1237,9 @@ const (
// PeerService returns an attribute KeyValue conforming to the
// "peer.service" semantic conventions. It represents the
-// [`service.name`](/docs/resource/README.md#service) of the remote service.
-// SHOULD be equal to the actual `service.name` resource attribute of the
-// remote service if any.
+// [`service.name`](../../resource/semantic_conventions/README.md#service) of
+// the remote service. SHOULD be equal to the actual `service.name` resource
+// attribute of the remote service if any.
func PeerService(val string) attribute.KeyValue {
return PeerServiceKey.String(val)
}
@@ -1436,6 +1452,21 @@ func CodeColumn(val int) attribute.KeyValue {
// Semantic Convention for HTTP Client
const (
+ // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
+ // conventions. It represents the full HTTP request URL in the form
+ // `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is
+ // not transmitted over HTTP, but if it is known, it should be included
+ // nevertheless.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
+ // Note: `http.url` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case the
+ // attribute's value should be `https://www.example.com/`.
+ HTTPURLKey = attribute.Key("http.url")
+
// HTTPResendCountKey is the attribute Key conforming to the
// "http.resend_count" semantic conventions. It represents the ordinal
// number of request resending attempt (for any reason, including
@@ -1452,6 +1483,15 @@ const (
HTTPResendCountKey = attribute.Key("http.resend_count")
)
+// HTTPURL returns an attribute KeyValue conforming to the "http.url"
+// semantic conventions. It represents the full HTTP request URL in the form
+// `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not
+// transmitted over HTTP, but if it is known, it should be included
+// nevertheless.
+func HTTPURL(val string) attribute.KeyValue {
+ return HTTPURLKey.String(val)
+}
+
// HTTPResendCount returns an attribute KeyValue conforming to the
// "http.resend_count" semantic conventions. It represents the ordinal number
// of request resending attempt (for any reason, including redirects).
@@ -1459,6 +1499,58 @@ func HTTPResendCount(val int) attribute.KeyValue {
return HTTPResendCountKey.Int(val)
}
+// Semantic Convention for HTTP Server
+const (
+ // HTTPTargetKey is the attribute Key conforming to the "http.target"
+ // semantic conventions. It represents the full request target as passed in
+ // a HTTP request line or equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: '/users/12314/?q=ddds'
+ HTTPTargetKey = attribute.Key("http.target")
+
+ // HTTPClientIPKey is the attribute Key conforming to the "http.client_ip"
+ // semantic conventions. It represents the IP address of the original
+ // client behind all proxies, if known (e.g. from
+ // [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '83.164.160.102'
+ // Note: This is not necessarily the same as `net.sock.peer.addr`, which
+ // would
+ // identify the network-level peer, which may be a proxy.
+ //
+ // This attribute should be set when a source of information different
+ // from the one used for `net.sock.peer.addr`, is available even if that
+ // other
+ // source just confirms the same value as `net.sock.peer.addr`.
+ // Rationale: For `net.sock.peer.addr`, one typically does not know if it
+ // comes from a proxy, reverse proxy, or the actual client. Setting
+ // `http.client_ip` when it's the same as `net.sock.peer.addr` means that
+ // one is at least somewhat confident that the address is not that of
+ // the closest proxy.
+ HTTPClientIPKey = attribute.Key("http.client_ip")
+)
+
+// HTTPTarget returns an attribute KeyValue conforming to the "http.target"
+// semantic conventions. It represents the full request target as passed in a
+// HTTP request line or equivalent.
+func HTTPTarget(val string) attribute.KeyValue {
+ return HTTPTargetKey.String(val)
+}
+
+// HTTPClientIP returns an attribute KeyValue conforming to the
+// "http.client_ip" semantic conventions. It represents the IP address of the
+// original client behind all proxies, if known (e.g. from
+// [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
+func HTTPClientIP(val string) attribute.KeyValue {
+ return HTTPClientIPKey.String(val)
+}
+
// The `aws` conventions apply to operations using the AWS SDK. They map
// request or response parameters in AWS SDK API calls to attributes on a Span.
// The conventions have been collected over time based on feedback from AWS
@@ -2201,16 +2293,6 @@ const (
// operation, instrumentations SHOULD use `messaging.batch.message_count`
// for batching APIs and SHOULD NOT use it for single-message APIs.
MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
-
- // MessagingClientIDKey is the attribute Key conforming to the
- // "messaging.client_id" semantic conventions. It represents a unique
- // identifier for the client that consumes or produces a message.
- //
- // Type: string
- // RequirementLevel: Recommended (If a client id is available)
- // Stability: stable
- // Examples: 'client-5', 'myhost@8742@s8083jm'
- MessagingClientIDKey = attribute.Key("messaging.client_id")
)
var (
@@ -2237,11 +2319,33 @@ func MessagingBatchMessageCount(val int) attribute.KeyValue {
return MessagingBatchMessageCountKey.Int(val)
}
-// MessagingClientID returns an attribute KeyValue conforming to the
-// "messaging.client_id" semantic conventions. It represents a unique
-// identifier for the client that consumes or produces a message.
-func MessagingClientID(val string) attribute.KeyValue {
- return MessagingClientIDKey.String(val)
+// Semantic convention for a consumer of messages received from a messaging
+// system
+const (
+ // MessagingConsumerIDKey is the attribute Key conforming to the
+ // "messaging.consumer.id" semantic conventions. It represents the
+ // identifier for the consumer receiving a message. For Kafka, set it to
+ // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if
+ // both are present, or only `messaging.kafka.consumer.group`. For brokers,
+ // such as RabbitMQ and Artemis, set it to the `client_id` of the client
+ // consuming the message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'mygroup - client-6'
+ MessagingConsumerIDKey = attribute.Key("messaging.consumer.id")
+)
+
+// MessagingConsumerID returns an attribute KeyValue conforming to the
+// "messaging.consumer.id" semantic conventions. It represents the identifier
+// for the consumer receiving a message. For Kafka, set it to
+// `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both
+// are present, or only `messaging.kafka.consumer.group`. For brokers, such as
+// RabbitMQ and Artemis, set it to the `client_id` of the client consuming the
+// message.
+func MessagingConsumerID(val string) attribute.KeyValue {
+ return MessagingConsumerIDKey.String(val)
}
// Semantic conventions for remote procedure calls.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go
deleted file mode 100644
index e6cf8951053..00000000000
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go
+++ /dev/null
@@ -1,1877 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Code generated from semantic convention specification. DO NOT EDIT.
-
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
-
-import "go.opentelemetry.io/otel/attribute"
-
-// These attributes may be used to describe the client in a connection-based
-// network interaction where there is one side that initiates the connection
-// (the client is the side that initiates the connection). This covers all TCP
-// network interactions since TCP is connection-based and one side initiates
-// the connection (an exception is made for peer-to-peer communication over TCP
-// where the "user-facing" surface of the protocol / API does not expose a
-// clear notion of client and server). This also covers UDP network
-// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3)
-// and DNS.
-const (
- // ClientAddressKey is the attribute Key conforming to the "client.address"
- // semantic conventions. It represents the client address - unix domain
- // socket name, IPv4 or IPv6 address.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/tmp/my.sock', '10.1.2.80'
- // Note: When observed from the server side, and when communicating through
- // an intermediary, `client.address` SHOULD represent client address behind
- // any intermediaries (e.g. proxies) if it's available.
- ClientAddressKey = attribute.Key("client.address")
-
- // ClientPortKey is the attribute Key conforming to the "client.port"
- // semantic conventions. It represents the client port number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 65123
- // Note: When observed from the server side, and when communicating through
- // an intermediary, `client.port` SHOULD represent client port behind any
- // intermediaries (e.g. proxies) if it's available.
- ClientPortKey = attribute.Key("client.port")
-
- // ClientSocketAddressKey is the attribute Key conforming to the
- // "client.socket.address" semantic conventions. It represents the
- // immediate client peer address - unix domain socket name, IPv4 or IPv6
- // address.
- //
- // Type: string
- // RequirementLevel: Recommended (If different than `client.address`.)
- // Stability: stable
- // Examples: '/tmp/my.sock', '127.0.0.1'
- ClientSocketAddressKey = attribute.Key("client.socket.address")
-
- // ClientSocketPortKey is the attribute Key conforming to the
- // "client.socket.port" semantic conventions. It represents the immediate
- // client peer port number
- //
- // Type: int
- // RequirementLevel: Recommended (If different than `client.port`.)
- // Stability: stable
- // Examples: 35555
- ClientSocketPortKey = attribute.Key("client.socket.port")
-)
-
-// ClientAddress returns an attribute KeyValue conforming to the
-// "client.address" semantic conventions. It represents the client address -
-// unix domain socket name, IPv4 or IPv6 address.
-func ClientAddress(val string) attribute.KeyValue {
- return ClientAddressKey.String(val)
-}
-
-// ClientPort returns an attribute KeyValue conforming to the "client.port"
-// semantic conventions. It represents the client port number
-func ClientPort(val int) attribute.KeyValue {
- return ClientPortKey.Int(val)
-}
-
-// ClientSocketAddress returns an attribute KeyValue conforming to the
-// "client.socket.address" semantic conventions. It represents the immediate
-// client peer address - unix domain socket name, IPv4 or IPv6 address.
-func ClientSocketAddress(val string) attribute.KeyValue {
- return ClientSocketAddressKey.String(val)
-}
-
-// ClientSocketPort returns an attribute KeyValue conforming to the
-// "client.socket.port" semantic conventions. It represents the immediate
-// client peer port number
-func ClientSocketPort(val int) attribute.KeyValue {
- return ClientSocketPortKey.Int(val)
-}
-
-// Describes deprecated HTTP attributes.
-const (
- // HTTPMethodKey is the attribute Key conforming to the "http.method"
- // semantic conventions. It represents the deprecated, use
- // `http.request.method` instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'GET', 'POST', 'HEAD'
- HTTPMethodKey = attribute.Key("http.method")
-
- // HTTPStatusCodeKey is the attribute Key conforming to the
- // "http.status_code" semantic conventions. It represents the deprecated,
- // use `http.response.status_code` instead.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 200
- HTTPStatusCodeKey = attribute.Key("http.status_code")
-
- // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
- // semantic conventions. It represents the deprecated, use `url.scheme`
- // instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'http', 'https'
- HTTPSchemeKey = attribute.Key("http.scheme")
-
- // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
- // conventions. It represents the deprecated, use `url.full` instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
- HTTPURLKey = attribute.Key("http.url")
-
- // HTTPTargetKey is the attribute Key conforming to the "http.target"
- // semantic conventions. It represents the deprecated, use `url.path` and
- // `url.query` instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '/search?q=OpenTelemetry#SemConv'
- HTTPTargetKey = attribute.Key("http.target")
-
- // HTTPRequestContentLengthKey is the attribute Key conforming to the
- // "http.request_content_length" semantic conventions. It represents the
- // deprecated, use `http.request.body.size` instead.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 3495
- HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
-
- // HTTPResponseContentLengthKey is the attribute Key conforming to the
- // "http.response_content_length" semantic conventions. It represents the
- // deprecated, use `http.response.body.size` instead.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 3495
- HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
-)
-
-// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
-// semantic conventions. It represents the deprecated, use
-// `http.request.method` instead.
-func HTTPMethod(val string) attribute.KeyValue {
- return HTTPMethodKey.String(val)
-}
-
-// HTTPStatusCode returns an attribute KeyValue conforming to the
-// "http.status_code" semantic conventions. It represents the deprecated, use
-// `http.response.status_code` instead.
-func HTTPStatusCode(val int) attribute.KeyValue {
- return HTTPStatusCodeKey.Int(val)
-}
-
-// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
-// semantic conventions. It represents the deprecated, use `url.scheme`
-// instead.
-func HTTPScheme(val string) attribute.KeyValue {
- return HTTPSchemeKey.String(val)
-}
-
-// HTTPURL returns an attribute KeyValue conforming to the "http.url"
-// semantic conventions. It represents the deprecated, use `url.full` instead.
-func HTTPURL(val string) attribute.KeyValue {
- return HTTPURLKey.String(val)
-}
-
-// HTTPTarget returns an attribute KeyValue conforming to the "http.target"
-// semantic conventions. It represents the deprecated, use `url.path` and
-// `url.query` instead.
-func HTTPTarget(val string) attribute.KeyValue {
- return HTTPTargetKey.String(val)
-}
-
-// HTTPRequestContentLength returns an attribute KeyValue conforming to the
-// "http.request_content_length" semantic conventions. It represents the
-// deprecated, use `http.request.body.size` instead.
-func HTTPRequestContentLength(val int) attribute.KeyValue {
- return HTTPRequestContentLengthKey.Int(val)
-}
-
-// HTTPResponseContentLength returns an attribute KeyValue conforming to the
-// "http.response_content_length" semantic conventions. It represents the
-// deprecated, use `http.response.body.size` instead.
-func HTTPResponseContentLength(val int) attribute.KeyValue {
- return HTTPResponseContentLengthKey.Int(val)
-}
-
-// These attributes may be used for any network related operation.
-const (
- // NetSockPeerNameKey is the attribute Key conforming to the
- // "net.sock.peer.name" semantic conventions. It represents the deprecated,
- // use `server.socket.domain` on client spans.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '/var/my.sock'
- NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
-
- // NetSockPeerAddrKey is the attribute Key conforming to the
- // "net.sock.peer.addr" semantic conventions. It represents the deprecated,
- // use `server.socket.address` on client spans and `client.socket.address`
- // on server spans.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '192.168.0.1'
- NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
-
- // NetSockPeerPortKey is the attribute Key conforming to the
- // "net.sock.peer.port" semantic conventions. It represents the deprecated,
- // use `server.socket.port` on client spans and `client.socket.port` on
- // server spans.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 65531
- NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
-
- // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
- // semantic conventions. It represents the deprecated, use `server.address`
- // on client spans and `client.address` on server spans.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'example.com'
- NetPeerNameKey = attribute.Key("net.peer.name")
-
- // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
- // semantic conventions. It represents the deprecated, use `server.port` on
- // client spans and `client.port` on server spans.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 8080
- NetPeerPortKey = attribute.Key("net.peer.port")
-
- // NetHostNameKey is the attribute Key conforming to the "net.host.name"
- // semantic conventions. It represents the deprecated, use
- // `server.address`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'example.com'
- NetHostNameKey = attribute.Key("net.host.name")
-
- // NetHostPortKey is the attribute Key conforming to the "net.host.port"
- // semantic conventions. It represents the deprecated, use `server.port`.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 8080
- NetHostPortKey = attribute.Key("net.host.port")
-
- // NetSockHostAddrKey is the attribute Key conforming to the
- // "net.sock.host.addr" semantic conventions. It represents the deprecated,
- // use `server.socket.address`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '/var/my.sock'
- NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
-
- // NetSockHostPortKey is the attribute Key conforming to the
- // "net.sock.host.port" semantic conventions. It represents the deprecated,
- // use `server.socket.port`.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 8080
- NetSockHostPortKey = attribute.Key("net.sock.host.port")
-
- // NetTransportKey is the attribute Key conforming to the "net.transport"
- // semantic conventions. It represents the deprecated, use
- // `network.transport`.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: deprecated
- NetTransportKey = attribute.Key("net.transport")
-
- // NetProtocolNameKey is the attribute Key conforming to the
- // "net.protocol.name" semantic conventions. It represents the deprecated,
- // use `network.protocol.name`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'amqp', 'http', 'mqtt'
- NetProtocolNameKey = attribute.Key("net.protocol.name")
-
- // NetProtocolVersionKey is the attribute Key conforming to the
- // "net.protocol.version" semantic conventions. It represents the
- // deprecated, use `network.protocol.version`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '3.1.1'
- NetProtocolVersionKey = attribute.Key("net.protocol.version")
-
- // NetSockFamilyKey is the attribute Key conforming to the
- // "net.sock.family" semantic conventions. It represents the deprecated,
- // use `network.transport` and `network.type`.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: deprecated
- NetSockFamilyKey = attribute.Key("net.sock.family")
-)
-
-var (
- // ip_tcp
- NetTransportTCP = NetTransportKey.String("ip_tcp")
- // ip_udp
- NetTransportUDP = NetTransportKey.String("ip_udp")
- // Named or anonymous pipe
- NetTransportPipe = NetTransportKey.String("pipe")
- // In-process communication
- NetTransportInProc = NetTransportKey.String("inproc")
- // Something else (non IP-based)
- NetTransportOther = NetTransportKey.String("other")
-)
-
-var (
- // IPv4 address
- NetSockFamilyInet = NetSockFamilyKey.String("inet")
- // IPv6 address
- NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
- // Unix domain socket path
- NetSockFamilyUnix = NetSockFamilyKey.String("unix")
-)
-
-// NetSockPeerName returns an attribute KeyValue conforming to the
-// "net.sock.peer.name" semantic conventions. It represents the deprecated, use
-// `server.socket.domain` on client spans.
-func NetSockPeerName(val string) attribute.KeyValue {
- return NetSockPeerNameKey.String(val)
-}
-
-// NetSockPeerAddr returns an attribute KeyValue conforming to the
-// "net.sock.peer.addr" semantic conventions. It represents the deprecated, use
-// `server.socket.address` on client spans and `client.socket.address` on
-// server spans.
-func NetSockPeerAddr(val string) attribute.KeyValue {
- return NetSockPeerAddrKey.String(val)
-}
-
-// NetSockPeerPort returns an attribute KeyValue conforming to the
-// "net.sock.peer.port" semantic conventions. It represents the deprecated, use
-// `server.socket.port` on client spans and `client.socket.port` on server
-// spans.
-func NetSockPeerPort(val int) attribute.KeyValue {
- return NetSockPeerPortKey.Int(val)
-}
-
-// NetPeerName returns an attribute KeyValue conforming to the
-// "net.peer.name" semantic conventions. It represents the deprecated, use
-// `server.address` on client spans and `client.address` on server spans.
-func NetPeerName(val string) attribute.KeyValue {
- return NetPeerNameKey.String(val)
-}
-
-// NetPeerPort returns an attribute KeyValue conforming to the
-// "net.peer.port" semantic conventions. It represents the deprecated, use
-// `server.port` on client spans and `client.port` on server spans.
-func NetPeerPort(val int) attribute.KeyValue {
- return NetPeerPortKey.Int(val)
-}
-
-// NetHostName returns an attribute KeyValue conforming to the
-// "net.host.name" semantic conventions. It represents the deprecated, use
-// `server.address`.
-func NetHostName(val string) attribute.KeyValue {
- return NetHostNameKey.String(val)
-}
-
-// NetHostPort returns an attribute KeyValue conforming to the
-// "net.host.port" semantic conventions. It represents the deprecated, use
-// `server.port`.
-func NetHostPort(val int) attribute.KeyValue {
- return NetHostPortKey.Int(val)
-}
-
-// NetSockHostAddr returns an attribute KeyValue conforming to the
-// "net.sock.host.addr" semantic conventions. It represents the deprecated, use
-// `server.socket.address`.
-func NetSockHostAddr(val string) attribute.KeyValue {
- return NetSockHostAddrKey.String(val)
-}
-
-// NetSockHostPort returns an attribute KeyValue conforming to the
-// "net.sock.host.port" semantic conventions. It represents the deprecated, use
-// `server.socket.port`.
-func NetSockHostPort(val int) attribute.KeyValue {
- return NetSockHostPortKey.Int(val)
-}
-
-// NetProtocolName returns an attribute KeyValue conforming to the
-// "net.protocol.name" semantic conventions. It represents the deprecated, use
-// `network.protocol.name`.
-func NetProtocolName(val string) attribute.KeyValue {
- return NetProtocolNameKey.String(val)
-}
-
-// NetProtocolVersion returns an attribute KeyValue conforming to the
-// "net.protocol.version" semantic conventions. It represents the deprecated,
-// use `network.protocol.version`.
-func NetProtocolVersion(val string) attribute.KeyValue {
- return NetProtocolVersionKey.String(val)
-}
-
-// These attributes may be used to describe the receiver of a network
-// exchange/packet. These should be used when there is no client/server
-// relationship between the two sides, or when that relationship is unknown.
-// This covers low-level network interactions (e.g. packet tracing) where you
-// don't know if there was a connection or which side initiated it. This also
-// covers unidirectional UDP flows and peer-to-peer communication where the
-// "user-facing" surface of the protocol / API does not expose a clear notion
-// of client and server.
-const (
- // DestinationDomainKey is the attribute Key conforming to the
- // "destination.domain" semantic conventions. It represents the domain name
- // of the destination system.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'foo.example.com'
- // Note: This value may be a host name, a fully qualified domain name, or
- // another host naming format.
- DestinationDomainKey = attribute.Key("destination.domain")
-
- // DestinationAddressKey is the attribute Key conforming to the
- // "destination.address" semantic conventions. It represents the peer
- // address, for example IP address or UNIX socket name.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '10.5.3.2'
- DestinationAddressKey = attribute.Key("destination.address")
-
- // DestinationPortKey is the attribute Key conforming to the
- // "destination.port" semantic conventions. It represents the peer port
- // number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3389, 2888
- DestinationPortKey = attribute.Key("destination.port")
-)
-
-// DestinationDomain returns an attribute KeyValue conforming to the
-// "destination.domain" semantic conventions. It represents the domain name of
-// the destination system.
-func DestinationDomain(val string) attribute.KeyValue {
- return DestinationDomainKey.String(val)
-}
-
-// DestinationAddress returns an attribute KeyValue conforming to the
-// "destination.address" semantic conventions. It represents the peer address,
-// for example IP address or UNIX socket name.
-func DestinationAddress(val string) attribute.KeyValue {
- return DestinationAddressKey.String(val)
-}
-
-// DestinationPort returns an attribute KeyValue conforming to the
-// "destination.port" semantic conventions. It represents the peer port number
-func DestinationPort(val int) attribute.KeyValue {
- return DestinationPortKey.Int(val)
-}
-
-// Describes HTTP attributes.
-const (
- // HTTPRequestMethodKey is the attribute Key conforming to the
- // "http.request.method" semantic conventions. It represents the hTTP
- // request method.
- //
- // Type: Enum
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'GET', 'POST', 'HEAD'
- // Note: HTTP request method value SHOULD be "known" to the
- // instrumentation.
- // By default, this convention defines "known" methods as the ones listed
- // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
- // and the PATCH method defined in
- // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
- //
- // If the HTTP request method is not known to instrumentation, it MUST set
- // the `http.request.method` attribute to `_OTHER` and, except if reporting
- // a metric, MUST
- // set the exact method received in the request line as value of the
- // `http.request.method_original` attribute.
- //
- // If the HTTP instrumentation could end up converting valid HTTP request
- // methods to `_OTHER`, then it MUST provide a way to override
- // the list of known HTTP methods. If this override is done via environment
- // variable, then the environment variable MUST be named
- // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
- // list of case-sensitive known HTTP methods
- // (this list MUST be a full override of the default known method, it is
- // not a list of known methods in addition to the defaults).
- //
- // HTTP method names are case-sensitive and `http.request.method` attribute
- // value MUST match a known HTTP method name exactly.
- // Instrumentations for specific web frameworks that consider HTTP methods
- // to be case insensitive, SHOULD populate a canonical equivalent.
- // Tracing instrumentations that do so, MUST also set
- // `http.request.method_original` to the original value.
- HTTPRequestMethodKey = attribute.Key("http.request.method")
-
- // HTTPResponseStatusCodeKey is the attribute Key conforming to the
- // "http.response.status_code" semantic conventions. It represents the
- // [HTTP response status
- // code](https://tools.ietf.org/html/rfc7231#section-6).
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If and only if one was
- // received/sent.)
- // Stability: stable
- // Examples: 200
- HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
-)
-
-var (
- // CONNECT method
- HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
- // DELETE method
- HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
- // GET method
- HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
- // HEAD method
- HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
- // OPTIONS method
- HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
- // PATCH method
- HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
- // POST method
- HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
- // PUT method
- HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
- // TRACE method
- HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
- // Any HTTP method that the instrumentation has no prior knowledge of
- HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
-)
-
-// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
-// "http.response.status_code" semantic conventions. It represents the [HTTP
-// response status code](https://tools.ietf.org/html/rfc7231#section-6).
-func HTTPResponseStatusCode(val int) attribute.KeyValue {
- return HTTPResponseStatusCodeKey.Int(val)
-}
-
-// HTTP Server attributes
-const (
- // HTTPRouteKey is the attribute Key conforming to the "http.route"
- // semantic conventions. It represents the matched route (path template in
- // the format used by the respective server framework). See note below
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If and only if it's available)
- // Stability: stable
- // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
- // Note: MUST NOT be populated when this is not supported by the HTTP
- // server framework as the route attribute should have low-cardinality and
- // the URI path can NOT substitute it.
- // SHOULD include the [application
- // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
- HTTPRouteKey = attribute.Key("http.route")
-)
-
-// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
-// semantic conventions. It represents the matched route (path template in the
-// format used by the respective server framework). See note below
-func HTTPRoute(val string) attribute.KeyValue {
- return HTTPRouteKey.String(val)
-}
-
-// Attributes for Events represented using Log Records.
-const (
- // EventNameKey is the attribute Key conforming to the "event.name"
- // semantic conventions. It represents the name identifies the event.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'click', 'exception'
- EventNameKey = attribute.Key("event.name")
-
- // EventDomainKey is the attribute Key conforming to the "event.domain"
- // semantic conventions. It represents the domain identifies the business
- // context for the events.
- //
- // Type: Enum
- // RequirementLevel: Required
- // Stability: stable
- // Note: Events across different domains may have same `event.name`, yet be
- // unrelated events.
- EventDomainKey = attribute.Key("event.domain")
-)
-
-var (
- // Events from browser apps
- EventDomainBrowser = EventDomainKey.String("browser")
- // Events from mobile apps
- EventDomainDevice = EventDomainKey.String("device")
- // Events from Kubernetes
- EventDomainK8S = EventDomainKey.String("k8s")
-)
-
-// EventName returns an attribute KeyValue conforming to the "event.name"
-// semantic conventions. It represents the name identifies the event.
-func EventName(val string) attribute.KeyValue {
- return EventNameKey.String(val)
-}
-
-// The attributes described in this section are rather generic. They may be
-// used in any Log Record they apply to.
-const (
- // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
- // semantic conventions. It represents a unique identifier for the Log
- // Record.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
- // Note: If an id is provided, other log records with the same id will be
- // considered duplicates and can be removed safely. This means, that two
- // distinguishable log records MUST have different values.
- // The id MAY be an [Universally Unique Lexicographically Sortable
- // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
- // (e.g. UUID) may be used as needed.
- LogRecordUIDKey = attribute.Key("log.record.uid")
-)
-
-// LogRecordUID returns an attribute KeyValue conforming to the
-// "log.record.uid" semantic conventions. It represents a unique identifier for
-// the Log Record.
-func LogRecordUID(val string) attribute.KeyValue {
- return LogRecordUIDKey.String(val)
-}
-
-// Describes Log attributes
-const (
- // LogIostreamKey is the attribute Key conforming to the "log.iostream"
- // semantic conventions. It represents the stream associated with the log.
- // See below for a list of well-known values.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- LogIostreamKey = attribute.Key("log.iostream")
-)
-
-var (
- // Logs from stdout stream
- LogIostreamStdout = LogIostreamKey.String("stdout")
- // Events from stderr stream
- LogIostreamStderr = LogIostreamKey.String("stderr")
-)
-
-// A file to which log was emitted.
-const (
- // LogFileNameKey is the attribute Key conforming to the "log.file.name"
- // semantic conventions. It represents the basename of the file.
- //
- // Type: string
- // RequirementLevel: Recommended
- // Stability: stable
- // Examples: 'audit.log'
- LogFileNameKey = attribute.Key("log.file.name")
-
- // LogFilePathKey is the attribute Key conforming to the "log.file.path"
- // semantic conventions. It represents the full path to the file.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/var/log/mysql/audit.log'
- LogFilePathKey = attribute.Key("log.file.path")
-
- // LogFileNameResolvedKey is the attribute Key conforming to the
- // "log.file.name_resolved" semantic conventions. It represents the
- // basename of the file, with symlinks resolved.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'uuid.log'
- LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
-
- // LogFilePathResolvedKey is the attribute Key conforming to the
- // "log.file.path_resolved" semantic conventions. It represents the full
- // path to the file, with symlinks resolved.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/var/lib/docker/uuid.log'
- LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
-)
-
-// LogFileName returns an attribute KeyValue conforming to the
-// "log.file.name" semantic conventions. It represents the basename of the
-// file.
-func LogFileName(val string) attribute.KeyValue {
- return LogFileNameKey.String(val)
-}
-
-// LogFilePath returns an attribute KeyValue conforming to the
-// "log.file.path" semantic conventions. It represents the full path to the
-// file.
-func LogFilePath(val string) attribute.KeyValue {
- return LogFilePathKey.String(val)
-}
-
-// LogFileNameResolved returns an attribute KeyValue conforming to the
-// "log.file.name_resolved" semantic conventions. It represents the basename of
-// the file, with symlinks resolved.
-func LogFileNameResolved(val string) attribute.KeyValue {
- return LogFileNameResolvedKey.String(val)
-}
-
-// LogFilePathResolved returns an attribute KeyValue conforming to the
-// "log.file.path_resolved" semantic conventions. It represents the full path
-// to the file, with symlinks resolved.
-func LogFilePathResolved(val string) attribute.KeyValue {
- return LogFilePathResolvedKey.String(val)
-}
-
-// Describes JVM memory metric attributes.
-const (
- // TypeKey is the attribute Key conforming to the "type" semantic
- // conventions. It represents the type of memory.
- //
- // Type: Enum
- // RequirementLevel: Recommended
- // Stability: stable
- // Examples: 'heap', 'non_heap'
- TypeKey = attribute.Key("type")
-
- // PoolKey is the attribute Key conforming to the "pool" semantic
- // conventions. It represents the name of the memory pool.
- //
- // Type: string
- // RequirementLevel: Recommended
- // Stability: stable
- // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
- // Note: Pool names are generally obtained via
- // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
- PoolKey = attribute.Key("pool")
-)
-
-var (
- // Heap memory
- TypeHeap = TypeKey.String("heap")
- // Non-heap memory
- TypeNonHeap = TypeKey.String("non_heap")
-)
-
-// Pool returns an attribute KeyValue conforming to the "pool" semantic
-// conventions. It represents the name of the memory pool.
-func Pool(val string) attribute.KeyValue {
- return PoolKey.String(val)
-}
-
-// These attributes may be used to describe the server in a connection-based
-// network interaction where there is one side that initiates the connection
-// (the client is the side that initiates the connection). This covers all TCP
-// network interactions since TCP is connection-based and one side initiates
-// the connection (an exception is made for peer-to-peer communication over TCP
-// where the "user-facing" surface of the protocol / API does not expose a
-// clear notion of client and server). This also covers UDP network
-// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3)
-// and DNS.
-const (
- // ServerAddressKey is the attribute Key conforming to the "server.address"
- // semantic conventions. It represents the logical server hostname, matches
- // server FQDN if available, and IP or socket address if FQDN is not known.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'example.com'
- ServerAddressKey = attribute.Key("server.address")
-
- // ServerPortKey is the attribute Key conforming to the "server.port"
- // semantic conventions. It represents the logical server port number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 80, 8080, 443
- ServerPortKey = attribute.Key("server.port")
-
- // ServerSocketDomainKey is the attribute Key conforming to the
- // "server.socket.domain" semantic conventions. It represents the domain
- // name of an immediate peer.
- //
- // Type: string
- // RequirementLevel: Recommended (If different than `server.address`.)
- // Stability: stable
- // Examples: 'proxy.example.com'
- // Note: Typically observed from the client side, and represents a proxy or
- // other intermediary domain name.
- ServerSocketDomainKey = attribute.Key("server.socket.domain")
-
- // ServerSocketAddressKey is the attribute Key conforming to the
- // "server.socket.address" semantic conventions. It represents the physical
- // server IP address or Unix socket address. If set from the client, should
- // simply use the socket's peer address, and not attempt to find any actual
- // server IP (i.e., if set from client, this may represent some proxy
- // server instead of the logical server).
- //
- // Type: string
- // RequirementLevel: Recommended (If different than `server.address`.)
- // Stability: stable
- // Examples: '10.5.3.2'
- ServerSocketAddressKey = attribute.Key("server.socket.address")
-
- // ServerSocketPortKey is the attribute Key conforming to the
- // "server.socket.port" semantic conventions. It represents the physical
- // server port.
- //
- // Type: int
- // RequirementLevel: Recommended (If different than `server.port`.)
- // Stability: stable
- // Examples: 16456
- ServerSocketPortKey = attribute.Key("server.socket.port")
-)
-
-// ServerAddress returns an attribute KeyValue conforming to the
-// "server.address" semantic conventions. It represents the logical server
-// hostname, matches server FQDN if available, and IP or socket address if FQDN
-// is not known.
-func ServerAddress(val string) attribute.KeyValue {
- return ServerAddressKey.String(val)
-}
-
-// ServerPort returns an attribute KeyValue conforming to the "server.port"
-// semantic conventions. It represents the logical server port number
-func ServerPort(val int) attribute.KeyValue {
- return ServerPortKey.Int(val)
-}
-
-// ServerSocketDomain returns an attribute KeyValue conforming to the
-// "server.socket.domain" semantic conventions. It represents the domain name
-// of an immediate peer.
-func ServerSocketDomain(val string) attribute.KeyValue {
- return ServerSocketDomainKey.String(val)
-}
-
-// ServerSocketAddress returns an attribute KeyValue conforming to the
-// "server.socket.address" semantic conventions. It represents the physical
-// server IP address or Unix socket address. If set from the client, should
-// simply use the socket's peer address, and not attempt to find any actual
-// server IP (i.e., if set from client, this may represent some proxy server
-// instead of the logical server).
-func ServerSocketAddress(val string) attribute.KeyValue {
- return ServerSocketAddressKey.String(val)
-}
-
-// ServerSocketPort returns an attribute KeyValue conforming to the
-// "server.socket.port" semantic conventions. It represents the physical server
-// port.
-func ServerSocketPort(val int) attribute.KeyValue {
- return ServerSocketPortKey.Int(val)
-}
-
-// These attributes may be used to describe the sender of a network
-// exchange/packet. These should be used when there is no client/server
-// relationship between the two sides, or when that relationship is unknown.
-// This covers low-level network interactions (e.g. packet tracing) where you
-// don't know if there was a connection or which side initiated it. This also
-// covers unidirectional UDP flows and peer-to-peer communication where the
-// "user-facing" surface of the protocol / API does not expose a clear notion
-// of client and server.
-const (
- // SourceDomainKey is the attribute Key conforming to the "source.domain"
- // semantic conventions. It represents the domain name of the source
- // system.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'foo.example.com'
- // Note: This value may be a host name, a fully qualified domain name, or
- // another host naming format.
- SourceDomainKey = attribute.Key("source.domain")
-
- // SourceAddressKey is the attribute Key conforming to the "source.address"
- // semantic conventions. It represents the source address, for example IP
- // address or Unix socket name.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '10.5.3.2'
- SourceAddressKey = attribute.Key("source.address")
-
- // SourcePortKey is the attribute Key conforming to the "source.port"
- // semantic conventions. It represents the source port number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3389, 2888
- SourcePortKey = attribute.Key("source.port")
-)
-
-// SourceDomain returns an attribute KeyValue conforming to the
-// "source.domain" semantic conventions. It represents the domain name of the
-// source system.
-func SourceDomain(val string) attribute.KeyValue {
- return SourceDomainKey.String(val)
-}
-
-// SourceAddress returns an attribute KeyValue conforming to the
-// "source.address" semantic conventions. It represents the source address, for
-// example IP address or Unix socket name.
-func SourceAddress(val string) attribute.KeyValue {
- return SourceAddressKey.String(val)
-}
-
-// SourcePort returns an attribute KeyValue conforming to the "source.port"
-// semantic conventions. It represents the source port number
-func SourcePort(val int) attribute.KeyValue {
- return SourcePortKey.Int(val)
-}
-
-// These attributes may be used for any network related operation.
-const (
- // NetworkTransportKey is the attribute Key conforming to the
- // "network.transport" semantic conventions. It represents the [OSI
- // Transport Layer](https://osi-model.com/transport-layer/) or
- // [Inter-process Communication
- // method](https://en.wikipedia.org/wiki/Inter-process_communication). The
- // value SHOULD be normalized to lowercase.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'tcp', 'udp'
- NetworkTransportKey = attribute.Key("network.transport")
-
- // NetworkTypeKey is the attribute Key conforming to the "network.type"
- // semantic conventions. It represents the [OSI Network
- // Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The
- // value SHOULD be normalized to lowercase.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'ipv4', 'ipv6'
- NetworkTypeKey = attribute.Key("network.type")
-
- // NetworkProtocolNameKey is the attribute Key conforming to the
- // "network.protocol.name" semantic conventions. It represents the [OSI
- // Application Layer](https://osi-model.com/application-layer/) or non-OSI
- // equivalent. The value SHOULD be normalized to lowercase.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'amqp', 'http', 'mqtt'
- NetworkProtocolNameKey = attribute.Key("network.protocol.name")
-
- // NetworkProtocolVersionKey is the attribute Key conforming to the
- // "network.protocol.version" semantic conventions. It represents the
- // version of the application layer protocol used. See note below.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '3.1.1'
- // Note: `network.protocol.version` refers to the version of the protocol
- // used and might be different from the protocol client's version. If the
- // HTTP client used has a version of `0.27.2`, but sends HTTP version
- // `1.1`, this attribute should be set to `1.1`.
- NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
-)
-
-var (
- // TCP
- NetworkTransportTCP = NetworkTransportKey.String("tcp")
- // UDP
- NetworkTransportUDP = NetworkTransportKey.String("udp")
- // Named or anonymous pipe. See note below
- NetworkTransportPipe = NetworkTransportKey.String("pipe")
- // Unix domain socket
- NetworkTransportUnix = NetworkTransportKey.String("unix")
-)
-
-var (
- // IPv4
- NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
- // IPv6
- NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
-)
-
-// NetworkProtocolName returns an attribute KeyValue conforming to the
-// "network.protocol.name" semantic conventions. It represents the [OSI
-// Application Layer](https://osi-model.com/application-layer/) or non-OSI
-// equivalent. The value SHOULD be normalized to lowercase.
-func NetworkProtocolName(val string) attribute.KeyValue {
- return NetworkProtocolNameKey.String(val)
-}
-
-// NetworkProtocolVersion returns an attribute KeyValue conforming to the
-// "network.protocol.version" semantic conventions. It represents the version
-// of the application layer protocol used. See note below.
-func NetworkProtocolVersion(val string) attribute.KeyValue {
- return NetworkProtocolVersionKey.String(val)
-}
-
-// These attributes may be used for any network related operation.
-const (
- // NetworkConnectionTypeKey is the attribute Key conforming to the
- // "network.connection.type" semantic conventions. It represents the
- // internet connection type.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'wifi'
- NetworkConnectionTypeKey = attribute.Key("network.connection.type")
-
- // NetworkConnectionSubtypeKey is the attribute Key conforming to the
- // "network.connection.subtype" semantic conventions. It represents the
- // this describes more details regarding the connection.type. It may be the
- // type of cell technology connection, but it could be used for describing
- // details about a wifi connection.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'LTE'
- NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
-
- // NetworkCarrierNameKey is the attribute Key conforming to the
- // "network.carrier.name" semantic conventions. It represents the name of
- // the mobile carrier.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'sprint'
- NetworkCarrierNameKey = attribute.Key("network.carrier.name")
-
- // NetworkCarrierMccKey is the attribute Key conforming to the
- // "network.carrier.mcc" semantic conventions. It represents the mobile
- // carrier country code.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '310'
- NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
-
- // NetworkCarrierMncKey is the attribute Key conforming to the
- // "network.carrier.mnc" semantic conventions. It represents the mobile
- // carrier network code.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '001'
- NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
-
- // NetworkCarrierIccKey is the attribute Key conforming to the
- // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
- // alpha-2 2-character country code associated with the mobile carrier
- // network.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'DE'
- NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
-)
-
-var (
- // wifi
- NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
- // wired
- NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
- // cell
- NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
- // unavailable
- NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
- // unknown
- NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
-)
-
-var (
- // GPRS
- NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
- // EDGE
- NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
- // UMTS
- NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
- // CDMA
- NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
- // EVDO Rel. 0
- NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
- // EVDO Rev. A
- NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
- // CDMA2000 1XRTT
- NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
- // HSDPA
- NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
- // HSUPA
- NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
- // HSPA
- NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
- // IDEN
- NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
- // EVDO Rev. B
- NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
- // LTE
- NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
- // EHRPD
- NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
- // HSPAP
- NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
- // GSM
- NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
- // TD-SCDMA
- NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
- // IWLAN
- NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
- // 5G NR (New Radio)
- NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
- // 5G NRNSA (New Radio Non-Standalone)
- NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
- // LTE CA
- NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
-)
-
-// NetworkCarrierName returns an attribute KeyValue conforming to the
-// "network.carrier.name" semantic conventions. It represents the name of the
-// mobile carrier.
-func NetworkCarrierName(val string) attribute.KeyValue {
- return NetworkCarrierNameKey.String(val)
-}
-
-// NetworkCarrierMcc returns an attribute KeyValue conforming to the
-// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
-// country code.
-func NetworkCarrierMcc(val string) attribute.KeyValue {
- return NetworkCarrierMccKey.String(val)
-}
-
-// NetworkCarrierMnc returns an attribute KeyValue conforming to the
-// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
-// network code.
-func NetworkCarrierMnc(val string) attribute.KeyValue {
- return NetworkCarrierMncKey.String(val)
-}
-
-// NetworkCarrierIcc returns an attribute KeyValue conforming to the
-// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
-// alpha-2 2-character country code associated with the mobile carrier network.
-func NetworkCarrierIcc(val string) attribute.KeyValue {
- return NetworkCarrierIccKey.String(val)
-}
-
-// Semantic conventions for HTTP client and server Spans.
-const (
- // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
- // "http.request.method_original" semantic conventions. It represents the
- // original HTTP method sent by the client in the request line.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If and only if it's different
- // than `http.request.method`.)
- // Stability: stable
- // Examples: 'GeT', 'ACL', 'foo'
- HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
-
- // HTTPRequestBodySizeKey is the attribute Key conforming to the
- // "http.request.body.size" semantic conventions. It represents the size of
- // the request payload body in bytes. This is the number of bytes
- // transferred excluding headers and is often, but not always, present as
- // the
- // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
- // header. For requests using transport encoding, this should be the
- // compressed size.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3495
- HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
-
- // HTTPResponseBodySizeKey is the attribute Key conforming to the
- // "http.response.body.size" semantic conventions. It represents the size
- // of the response payload body in bytes. This is the number of bytes
- // transferred excluding headers and is often, but not always, present as
- // the
- // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
- // header. For requests using transport encoding, this should be the
- // compressed size.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3495
- HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
-)
-
-// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
-// "http.request.method_original" semantic conventions. It represents the
-// original HTTP method sent by the client in the request line.
-func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
- return HTTPRequestMethodOriginalKey.String(val)
-}
-
-// HTTPRequestBodySize returns an attribute KeyValue conforming to the
-// "http.request.body.size" semantic conventions. It represents the size of the
-// request payload body in bytes. This is the number of bytes transferred
-// excluding headers and is often, but not always, present as the
-// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
-// header. For requests using transport encoding, this should be the compressed
-// size.
-func HTTPRequestBodySize(val int) attribute.KeyValue {
- return HTTPRequestBodySizeKey.Int(val)
-}
-
-// HTTPResponseBodySize returns an attribute KeyValue conforming to the
-// "http.response.body.size" semantic conventions. It represents the size of
-// the response payload body in bytes. This is the number of bytes transferred
-// excluding headers and is often, but not always, present as the
-// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
-// header. For requests using transport encoding, this should be the compressed
-// size.
-func HTTPResponseBodySize(val int) attribute.KeyValue {
- return HTTPResponseBodySizeKey.Int(val)
-}
-
-// Semantic convention describing per-message attributes populated on messaging
-// spans or links.
-const (
- // MessagingMessageIDKey is the attribute Key conforming to the
- // "messaging.message.id" semantic conventions. It represents a value used
- // by the messaging system as an identifier for the message, represented as
- // a string.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
- MessagingMessageIDKey = attribute.Key("messaging.message.id")
-
- // MessagingMessageConversationIDKey is the attribute Key conforming to the
- // "messaging.message.conversation_id" semantic conventions. It represents
- // the [conversation ID](#conversations) identifying the conversation to
- // which the message belongs, represented as a string. Sometimes called
- // "Correlation ID".
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'MyConversationID'
- MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
-
- // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
- // the "messaging.message.payload_size_bytes" semantic conventions. It
- // represents the (uncompressed) size of the message payload in bytes. Also
- // use this attribute if it is unknown whether the compressed or
- // uncompressed payload size is reported.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2738
- MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
-
- // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
- // conforming to the "messaging.message.payload_compressed_size_bytes"
- // semantic conventions. It represents the compressed size of the message
- // payload in bytes.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2048
- MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
-)
-
-// MessagingMessageID returns an attribute KeyValue conforming to the
-// "messaging.message.id" semantic conventions. It represents a value used by
-// the messaging system as an identifier for the message, represented as a
-// string.
-func MessagingMessageID(val string) attribute.KeyValue {
- return MessagingMessageIDKey.String(val)
-}
-
-// MessagingMessageConversationID returns an attribute KeyValue conforming
-// to the "messaging.message.conversation_id" semantic conventions. It
-// represents the [conversation ID](#conversations) identifying the
-// conversation to which the message belongs, represented as a string.
-// Sometimes called "Correlation ID".
-func MessagingMessageConversationID(val string) attribute.KeyValue {
- return MessagingMessageConversationIDKey.String(val)
-}
-
-// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
-// to the "messaging.message.payload_size_bytes" semantic conventions. It
-// represents the (uncompressed) size of the message payload in bytes. Also use
-// this attribute if it is unknown whether the compressed or uncompressed
-// payload size is reported.
-func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
- return MessagingMessagePayloadSizeBytesKey.Int(val)
-}
-
-// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
-// conforming to the "messaging.message.payload_compressed_size_bytes" semantic
-// conventions. It represents the compressed size of the message payload in
-// bytes.
-func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
- return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
-}
-
-// Semantic convention for attributes that describe messaging destination on
-// broker
-const (
- // MessagingDestinationNameKey is the attribute Key conforming to the
- // "messaging.destination.name" semantic conventions. It represents the
- // message destination name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'MyQueue', 'MyTopic'
- // Note: Destination name SHOULD uniquely identify a specific queue, topic
- // or other entity within the broker. If
- // the broker does not have such notion, the destination name SHOULD
- // uniquely identify the broker.
- MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
-
- // MessagingDestinationTemplateKey is the attribute Key conforming to the
- // "messaging.destination.template" semantic conventions. It represents the
- // low cardinality representation of the messaging destination name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/customers/{customerID}'
- // Note: Destination names could be constructed from templates. An example
- // would be a destination name involving a user name or product id.
- // Although the destination name in this case is of high cardinality, the
- // underlying template is of low cardinality and can be effectively used
- // for grouping and aggregation.
- MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
-
- // MessagingDestinationTemporaryKey is the attribute Key conforming to the
- // "messaging.destination.temporary" semantic conventions. It represents a
- // boolean that is true if the message destination is temporary and might
- // not exist anymore after messages are processed.
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
-
- // MessagingDestinationAnonymousKey is the attribute Key conforming to the
- // "messaging.destination.anonymous" semantic conventions. It represents a
- // boolean that is true if the message destination is anonymous (could be
- // unnamed or have auto-generated name).
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
-)
-
-// MessagingDestinationName returns an attribute KeyValue conforming to the
-// "messaging.destination.name" semantic conventions. It represents the message
-// destination name
-func MessagingDestinationName(val string) attribute.KeyValue {
- return MessagingDestinationNameKey.String(val)
-}
-
-// MessagingDestinationTemplate returns an attribute KeyValue conforming to
-// the "messaging.destination.template" semantic conventions. It represents the
-// low cardinality representation of the messaging destination name
-func MessagingDestinationTemplate(val string) attribute.KeyValue {
- return MessagingDestinationTemplateKey.String(val)
-}
-
-// MessagingDestinationTemporary returns an attribute KeyValue conforming to
-// the "messaging.destination.temporary" semantic conventions. It represents a
-// boolean that is true if the message destination is temporary and might not
-// exist anymore after messages are processed.
-func MessagingDestinationTemporary(val bool) attribute.KeyValue {
- return MessagingDestinationTemporaryKey.Bool(val)
-}
-
-// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
-// the "messaging.destination.anonymous" semantic conventions. It represents a
-// boolean that is true if the message destination is anonymous (could be
-// unnamed or have auto-generated name).
-func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
- return MessagingDestinationAnonymousKey.Bool(val)
-}
-
-// Attributes for RabbitMQ
-const (
- // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
- // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
- // conventions. It represents the rabbitMQ message routing key.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If not empty.)
- // Stability: stable
- // Examples: 'myKey'
- MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
-)
-
-// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
-// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
-// conventions. It represents the rabbitMQ message routing key.
-func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
- return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
-}
-
-// Attributes for Apache Kafka
-const (
- // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
- // "messaging.kafka.message.key" semantic conventions. It represents the
- // message keys in Kafka are used for grouping alike messages to ensure
- // they're processed on the same partition. They differ from
- // `messaging.message.id` in that they're not unique. If the key is `null`,
- // the attribute MUST NOT be set.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'myKey'
- // Note: If the key type is not string, it's string representation has to
- // be supplied for the attribute. If the key has no unambiguous, canonical
- // string form, don't include its value.
- MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
-
- // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
- // "messaging.kafka.consumer.group" semantic conventions. It represents the
- // name of the Kafka Consumer Group that is handling the message. Only
- // applies to consumers, not producers.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'my-group'
- MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
-
- // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
- // the "messaging.kafka.destination.partition" semantic conventions. It
- // represents the partition the message is sent to.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2
- MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
-
- // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
- // "messaging.kafka.message.offset" semantic conventions. It represents the
- // offset of a record in the corresponding Kafka partition.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 42
- MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
-
- // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
- // "messaging.kafka.message.tombstone" semantic conventions. It represents
- // a boolean that is true if the message is a tombstone.
- //
- // Type: boolean
- // RequirementLevel: ConditionallyRequired (If value is `true`. When
- // missing, the value is assumed to be `false`.)
- // Stability: stable
- MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
-)
-
-// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
-// "messaging.kafka.message.key" semantic conventions. It represents the
-// message keys in Kafka are used for grouping alike messages to ensure they're
-// processed on the same partition. They differ from `messaging.message.id` in
-// that they're not unique. If the key is `null`, the attribute MUST NOT be
-// set.
-func MessagingKafkaMessageKey(val string) attribute.KeyValue {
- return MessagingKafkaMessageKeyKey.String(val)
-}
-
-// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
-// the "messaging.kafka.consumer.group" semantic conventions. It represents the
-// name of the Kafka Consumer Group that is handling the message. Only applies
-// to consumers, not producers.
-func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
- return MessagingKafkaConsumerGroupKey.String(val)
-}
-
-// MessagingKafkaDestinationPartition returns an attribute KeyValue
-// conforming to the "messaging.kafka.destination.partition" semantic
-// conventions. It represents the partition the message is sent to.
-func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
- return MessagingKafkaDestinationPartitionKey.Int(val)
-}
-
-// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
-// the "messaging.kafka.message.offset" semantic conventions. It represents the
-// offset of a record in the corresponding Kafka partition.
-func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
- return MessagingKafkaMessageOffsetKey.Int(val)
-}
-
-// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
-// to the "messaging.kafka.message.tombstone" semantic conventions. It
-// represents a boolean that is true if the message is a tombstone.
-func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
- return MessagingKafkaMessageTombstoneKey.Bool(val)
-}
-
-// Attributes for Apache RocketMQ
-const (
- // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
- // "messaging.rocketmq.namespace" semantic conventions. It represents the
- // namespace of RocketMQ resources, resources in different namespaces are
- // individual.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'myNamespace'
- MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
-
- // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
- // "messaging.rocketmq.client_group" semantic conventions. It represents
- // the name of the RocketMQ producer/consumer group that is handling the
- // message. The client type is identified by the SpanKind.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'myConsumerGroup'
- MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
-
- // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
- // conforming to the "messaging.rocketmq.message.delivery_timestamp"
- // semantic conventions. It represents the timestamp in milliseconds that
- // the delay message is expected to be delivered to consumer.
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If the message type is delay
- // and delay time level is not specified.)
- // Stability: stable
- // Examples: 1665987217045
- MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
-
- // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
- // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
- // conventions. It represents the delay time level for delay message, which
- // determines the message delay time.
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If the message type is delay
- // and delivery timestamp is not specified.)
- // Stability: stable
- // Examples: 3
- MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
-
- // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.group" semantic conventions. It represents
- // the it is essential for FIFO message. Messages that belong to the same
- // message group are always processed one by one within the same consumer
- // group.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
- // Stability: stable
- // Examples: 'myMessageGroup'
- MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
-
- // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.type" semantic conventions. It represents
- // the type of message.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
-
- // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.tag" semantic conventions. It represents the
- // secondary classifier of message besides topic.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'tagA'
- MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
-
- // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.keys" semantic conventions. It represents
- // the key(s) of message, another way to mark message besides message id.
- //
- // Type: string[]
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'keyA', 'keyB'
- MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
-
- // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
- // the "messaging.rocketmq.consumption_model" semantic conventions. It
- // represents the model of message consumption. This only applies to
- // consumer spans.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
-)
-
-var (
- // Normal message
- MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
- // FIFO message
- MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
- // Delay message
- MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
- // Transaction message
- MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
-)
-
-var (
- // Clustering consumption model
- MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
- // Broadcasting consumption model
- MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
-)
-
-// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.namespace" semantic conventions. It represents the
-// namespace of RocketMQ resources, resources in different namespaces are
-// individual.
-func MessagingRocketmqNamespace(val string) attribute.KeyValue {
- return MessagingRocketmqNamespaceKey.String(val)
-}
-
-// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.client_group" semantic conventions. It represents
-// the name of the RocketMQ producer/consumer group that is handling the
-// message. The client type is identified by the SpanKind.
-func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
- return MessagingRocketmqClientGroupKey.String(val)
-}
-
-// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
-// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
-// conventions. It represents the timestamp in milliseconds that the delay
-// message is expected to be delivered to consumer.
-func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
- return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
-}
-
-// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
-// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
-// conventions. It represents the delay time level for delay message, which
-// determines the message delay time.
-func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
- return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
-}
-
-// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.group" semantic conventions. It represents
-// the it is essential for FIFO message. Messages that belong to the same
-// message group are always processed one by one within the same consumer
-// group.
-func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
- return MessagingRocketmqMessageGroupKey.String(val)
-}
-
-// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
-// secondary classifier of message besides topic.
-func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
- return MessagingRocketmqMessageTagKey.String(val)
-}
-
-// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.keys" semantic conventions. It represents
-// the key(s) of message, another way to mark message besides message id.
-func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
- return MessagingRocketmqMessageKeysKey.StringSlice(val)
-}
-
-// Attributes describing URL.
-const (
- // URLSchemeKey is the attribute Key conforming to the "url.scheme"
- // semantic conventions. It represents the [URI
- // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
- // identifying the used protocol.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'https', 'ftp', 'telnet'
- URLSchemeKey = attribute.Key("url.scheme")
-
- // URLFullKey is the attribute Key conforming to the "url.full" semantic
- // conventions. It represents the absolute URL describing a network
- // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
- // '//localhost'
- // Note: For network calls, URL usually has
- // `scheme://host[:port][path][?query][#fragment]` format, where the
- // fragment is not transmitted over HTTP, but if it is known, it should be
- // included nevertheless.
- // `url.full` MUST NOT contain credentials passed via URL in form of
- // `https://username:password@www.example.com/`. In such case username and
- // password should be redacted and attribute's value should be
- // `https://REDACTED:REDACTED@www.example.com/`.
- // `url.full` SHOULD capture the absolute URL when it is available (or can
- // be reconstructed) and SHOULD NOT be validated or modified except for
- // sanitizing purposes.
- URLFullKey = attribute.Key("url.full")
-
- // URLPathKey is the attribute Key conforming to the "url.path" semantic
- // conventions. It represents the [URI
- // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/search'
- // Note: When missing, the value is assumed to be `/`
- URLPathKey = attribute.Key("url.path")
-
- // URLQueryKey is the attribute Key conforming to the "url.query" semantic
- // conventions. It represents the [URI
- // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'q=OpenTelemetry'
- // Note: Sensitive content provided in query string SHOULD be scrubbed when
- // instrumentations can identify it.
- URLQueryKey = attribute.Key("url.query")
-
- // URLFragmentKey is the attribute Key conforming to the "url.fragment"
- // semantic conventions. It represents the [URI
- // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'SemConv'
- URLFragmentKey = attribute.Key("url.fragment")
-)
-
-// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
-// semantic conventions. It represents the [URI
-// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
-// identifying the used protocol.
-func URLScheme(val string) attribute.KeyValue {
- return URLSchemeKey.String(val)
-}
-
-// URLFull returns an attribute KeyValue conforming to the "url.full"
-// semantic conventions. It represents the absolute URL describing a network
-// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
-func URLFull(val string) attribute.KeyValue {
- return URLFullKey.String(val)
-}
-
-// URLPath returns an attribute KeyValue conforming to the "url.path"
-// semantic conventions. It represents the [URI
-// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
-func URLPath(val string) attribute.KeyValue {
- return URLPathKey.String(val)
-}
-
-// URLQuery returns an attribute KeyValue conforming to the "url.query"
-// semantic conventions. It represents the [URI
-// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
-func URLQuery(val string) attribute.KeyValue {
- return URLQueryKey.String(val)
-}
-
-// URLFragment returns an attribute KeyValue conforming to the
-// "url.fragment" semantic conventions. It represents the [URI
-// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
-func URLFragment(val string) attribute.KeyValue {
- return URLFragmentKey.String(val)
-}
-
-// Describes user-agent attributes.
-const (
- // UserAgentOriginalKey is the attribute Key conforming to the
- // "user_agent.original" semantic conventions. It represents the value of
- // the [HTTP
- // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
- // header sent by the client.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
- UserAgentOriginalKey = attribute.Key("user_agent.original")
-)
-
-// UserAgentOriginal returns an attribute KeyValue conforming to the
-// "user_agent.original" semantic conventions. It represents the value of the
-// [HTTP
-// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
-// header sent by the client.
-func UserAgentOriginal(val string) attribute.KeyValue {
- return UserAgentOriginalKey.String(val)
-}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go
deleted file mode 100644
index 7cf424855e9..00000000000
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package semconv implements OpenTelemetry semantic conventions.
-//
-// OpenTelemetry semantic conventions are agreed standardized naming
-// patterns for OpenTelemetry things. This package represents the conventions
-// as of the v1.21.0 version of the OpenTelemetry specification.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go
deleted file mode 100644
index 93d3c1760c9..00000000000
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
-
-const (
- // ExceptionEventName is the name of the Span event representing an exception.
- ExceptionEventName = "exception"
-)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go
deleted file mode 100644
index 66ffd5989f3..00000000000
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
-
-// SchemaURL is the schema URL that matches the version of the semantic conventions
-// that this package defines. Semconv packages starting from v1.4.0 must declare
-// non-empty schema URL in the form https://opentelemetry.io/schemas/
-const SchemaURL = "https://opentelemetry.io/schemas/1.21.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md
new file mode 100644
index 00000000000..0b6cbe960cb
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.24.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.24.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.24.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go
new file mode 100644
index 00000000000..6e688345cbb
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go
@@ -0,0 +1,4387 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Describes FaaS attributes.
+const (
+ // FaaSInvokedNameKey is the attribute Key conforming to the
+ // "faas.invoked_name" semantic conventions. It represents the name of the
+ // invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'my-function'
+ // Note: SHOULD be equal to the `faas.name` resource attribute of the
+ // invoked function.
+ FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
+
+ // FaaSInvokedProviderKey is the attribute Key conforming to the
+ // "faas.invoked_provider" semantic conventions. It represents the cloud
+ // provider of the invoked function.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
+ // invoked function.
+ FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
+
+ // FaaSInvokedRegionKey is the attribute Key conforming to the
+ // "faas.invoked_region" semantic conventions. It represents the cloud
+ // region of the invoked function.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (For some cloud providers, like
+ // AWS or GCP, the region in which a function is hosted is essential to
+ // uniquely identify the function and also part of its endpoint. Since it's
+ // part of the endpoint being called, the region is always known to
+ // clients. In these cases, `faas.invoked_region` MUST be set accordingly.
+ // If the region is unknown to the client or not required for identifying
+ // the invoked function, setting `faas.invoked_region` is optional.)
+ // Stability: experimental
+ // Examples: 'eu-central-1'
+ // Note: SHOULD be equal to the `cloud.region` resource attribute of the
+ // invoked function.
+ FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
+
+ // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
+ // semantic conventions. It represents the type of the trigger which caused
+ // this function invocation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSTriggerKey = attribute.Key("faas.trigger")
+)
+
+var (
+ // Alibaba Cloud
+ FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
+ // Microsoft Azure
+ FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
+ // Google Cloud Platform
+ FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
+ // Tencent Cloud
+ FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
+)
+
+var (
+ // A response to some data source operation such as a database or filesystem read/write
+ FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
+ // To provide an answer to an inbound HTTP request
+ FaaSTriggerHTTP = FaaSTriggerKey.String("http")
+ // A function is set to be executed when messages are sent to a messaging system
+ FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
+ // A function is scheduled to be executed regularly
+ FaaSTriggerTimer = FaaSTriggerKey.String("timer")
+ // If none of the others apply
+ FaaSTriggerOther = FaaSTriggerKey.String("other")
+)
+
+// FaaSInvokedName returns an attribute KeyValue conforming to the
+// "faas.invoked_name" semantic conventions. It represents the name of the
+// invoked function.
+func FaaSInvokedName(val string) attribute.KeyValue {
+ return FaaSInvokedNameKey.String(val)
+}
+
+// FaaSInvokedRegion returns an attribute KeyValue conforming to the
+// "faas.invoked_region" semantic conventions. It represents the cloud region
+// of the invoked function.
+func FaaSInvokedRegion(val string) attribute.KeyValue {
+ return FaaSInvokedRegionKey.String(val)
+}
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the identifies the class / type of
+ // event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'browser.mouse.click', 'device.app.lifecycle'
+ // Note: Event names are subject to the same rules as [attribute
+ // names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md).
+ // Notably, event names are namespaced to avoid collisions and provide a
+ // clean separation of semantics for events in separate domains like
+ // browser, mobile, and kubernetes.
+ EventNameKey = attribute.Key("event.name")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the identifies the class / type of
+// event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// The attributes described in this section are rather generic. They may be
+// used in any Log Record they apply to.
+const (
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
+// Describes Log attributes
+const (
+ // LogIostreamKey is the attribute Key conforming to the "log.iostream"
+ // semantic conventions. It represents the stream associated with the log.
+ // See below for a list of well-known values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ LogIostreamKey = attribute.Key("log.iostream")
+)
+
+var (
+ // Logs from stdout stream
+ LogIostreamStdout = LogIostreamKey.String("stdout")
+ // Events from stderr stream
+ LogIostreamStderr = LogIostreamKey.String("stderr")
+)
+
+// A file to which log was emitted.
+const (
+ // LogFileNameKey is the attribute Key conforming to the "log.file.name"
+ // semantic conventions. It represents the basename of the file.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'audit.log'
+ LogFileNameKey = attribute.Key("log.file.name")
+
+ // LogFileNameResolvedKey is the attribute Key conforming to the
+ // "log.file.name_resolved" semantic conventions. It represents the
+ // basename of the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'uuid.log'
+ LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
+
+ // LogFilePathKey is the attribute Key conforming to the "log.file.path"
+ // semantic conventions. It represents the full path to the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/log/mysql/audit.log'
+ LogFilePathKey = attribute.Key("log.file.path")
+
+ // LogFilePathResolvedKey is the attribute Key conforming to the
+ // "log.file.path_resolved" semantic conventions. It represents the full
+ // path to the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/lib/docker/uuid.log'
+ LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
+)
+
+// LogFileName returns an attribute KeyValue conforming to the
+// "log.file.name" semantic conventions. It represents the basename of the
+// file.
+func LogFileName(val string) attribute.KeyValue {
+ return LogFileNameKey.String(val)
+}
+
+// LogFileNameResolved returns an attribute KeyValue conforming to the
+// "log.file.name_resolved" semantic conventions. It represents the basename of
+// the file, with symlinks resolved.
+func LogFileNameResolved(val string) attribute.KeyValue {
+ return LogFileNameResolvedKey.String(val)
+}
+
+// LogFilePath returns an attribute KeyValue conforming to the
+// "log.file.path" semantic conventions. It represents the full path to the
+// file.
+func LogFilePath(val string) attribute.KeyValue {
+ return LogFilePathKey.String(val)
+}
+
+// LogFilePathResolved returns an attribute KeyValue conforming to the
+// "log.file.path_resolved" semantic conventions. It represents the full path
+// to the file, with symlinks resolved.
+func LogFilePathResolved(val string) attribute.KeyValue {
+ return LogFilePathResolvedKey.String(val)
+}
+
+// Describes Database attributes
+const (
+ // PoolNameKey is the attribute Key conforming to the "pool.name" semantic
+ // conventions. It represents the name of the connection pool; unique
+ // within the instrumented application. In case the connection pool
+ // implementation doesn't provide a name, then the
+ // [db.connection_string](/docs/database/database-spans.md#connection-level-attributes)
+ // should be used
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'myDataSource'
+ PoolNameKey = attribute.Key("pool.name")
+
+ // StateKey is the attribute Key conforming to the "state" semantic
+ // conventions. It represents the state of a connection in the pool
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'idle'
+ StateKey = attribute.Key("state")
+)
+
+var (
+ // idle
+ StateIdle = StateKey.String("idle")
+ // used
+ StateUsed = StateKey.String("used")
+)
+
+// PoolName returns an attribute KeyValue conforming to the "pool.name"
+// semantic conventions. It represents the name of the connection pool; unique
+// within the instrumented application. In case the connection pool
+// implementation doesn't provide a name, then the
+// [db.connection_string](/docs/database/database-spans.md#connection-level-attributes)
+// should be used
+func PoolName(val string) attribute.KeyValue {
+ return PoolNameKey.String(val)
+}
+
+// ASP.NET Core attributes
+const (
+ // AspnetcoreDiagnosticsHandlerTypeKey is the attribute Key conforming to
+ // the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+ // represents the full type name of the
+ // [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+ // implementation that handled the exception.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if and only if the exception
+ // was handled by this handler.)
+ // Stability: experimental
+ // Examples: 'Contoso.MyHandler'
+ AspnetcoreDiagnosticsHandlerTypeKey = attribute.Key("aspnetcore.diagnostics.handler.type")
+
+ // AspnetcoreRateLimitingPolicyKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+ // the rate limiting policy name.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if the matched endpoint for the
+ // request had a rate-limiting policy.)
+ // Stability: experimental
+ // Examples: 'fixed', 'sliding', 'token'
+ AspnetcoreRateLimitingPolicyKey = attribute.Key("aspnetcore.rate_limiting.policy")
+
+ // AspnetcoreRateLimitingResultKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.result" semantic conventions. It represents
+ // the rate-limiting result, shows whether the lease was acquired or
+ // contains a rejection reason
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'acquired', 'request_canceled'
+ AspnetcoreRateLimitingResultKey = attribute.Key("aspnetcore.rate_limiting.result")
+
+ // AspnetcoreRequestIsUnhandledKey is the attribute Key conforming to the
+ // "aspnetcore.request.is_unhandled" semantic conventions. It represents
+ // the flag indicating if request was handled by the application pipeline.
+ //
+ // Type: boolean
+ // RequirementLevel: ConditionallyRequired (if and only if the request was
+ // not handled.)
+ // Stability: experimental
+ // Examples: True
+ AspnetcoreRequestIsUnhandledKey = attribute.Key("aspnetcore.request.is_unhandled")
+
+ // AspnetcoreRoutingIsFallbackKey is the attribute Key conforming to the
+ // "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+ // value that indicates whether the matched route is a fallback route.
+ //
+ // Type: boolean
+ // RequirementLevel: ConditionallyRequired (If and only if a route was
+ // successfully matched.)
+ // Stability: experimental
+ // Examples: True
+ AspnetcoreRoutingIsFallbackKey = attribute.Key("aspnetcore.routing.is_fallback")
+)
+
+var (
+ // Lease was acquired
+ AspnetcoreRateLimitingResultAcquired = AspnetcoreRateLimitingResultKey.String("acquired")
+ // Lease request was rejected by the endpoint limiter
+ AspnetcoreRateLimitingResultEndpointLimiter = AspnetcoreRateLimitingResultKey.String("endpoint_limiter")
+ // Lease request was rejected by the global limiter
+ AspnetcoreRateLimitingResultGlobalLimiter = AspnetcoreRateLimitingResultKey.String("global_limiter")
+ // Lease request was canceled
+ AspnetcoreRateLimitingResultRequestCanceled = AspnetcoreRateLimitingResultKey.String("request_canceled")
+)
+
+// AspnetcoreDiagnosticsHandlerType returns an attribute KeyValue conforming
+// to the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+// represents the full type name of the
+// [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+// implementation that handled the exception.
+func AspnetcoreDiagnosticsHandlerType(val string) attribute.KeyValue {
+ return AspnetcoreDiagnosticsHandlerTypeKey.String(val)
+}
+
+// AspnetcoreRateLimitingPolicy returns an attribute KeyValue conforming to
+// the "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+// the rate limiting policy name.
+func AspnetcoreRateLimitingPolicy(val string) attribute.KeyValue {
+ return AspnetcoreRateLimitingPolicyKey.String(val)
+}
+
+// AspnetcoreRequestIsUnhandled returns an attribute KeyValue conforming to
+// the "aspnetcore.request.is_unhandled" semantic conventions. It represents
+// the flag indicating if request was handled by the application pipeline.
+func AspnetcoreRequestIsUnhandled(val bool) attribute.KeyValue {
+ return AspnetcoreRequestIsUnhandledKey.Bool(val)
+}
+
+// AspnetcoreRoutingIsFallback returns an attribute KeyValue conforming to
+// the "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+// value that indicates whether the matched route is a fallback route.
+func AspnetcoreRoutingIsFallback(val bool) attribute.KeyValue {
+ return AspnetcoreRoutingIsFallbackKey.Bool(val)
+}
+
+// SignalR attributes
+const (
+ // SignalrConnectionStatusKey is the attribute Key conforming to the
+ // "signalr.connection.status" semantic conventions. It represents the
+ // signalR HTTP connection closure status.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'app_shutdown', 'timeout'
+ SignalrConnectionStatusKey = attribute.Key("signalr.connection.status")
+
+ // SignalrTransportKey is the attribute Key conforming to the
+ // "signalr.transport" semantic conventions. It represents the [SignalR
+ // transport
+ // type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'web_sockets', 'long_polling'
+ SignalrTransportKey = attribute.Key("signalr.transport")
+)
+
+var (
+ // The connection was closed normally
+ SignalrConnectionStatusNormalClosure = SignalrConnectionStatusKey.String("normal_closure")
+ // The connection was closed due to a timeout
+ SignalrConnectionStatusTimeout = SignalrConnectionStatusKey.String("timeout")
+ // The connection was closed because the app is shutting down
+ SignalrConnectionStatusAppShutdown = SignalrConnectionStatusKey.String("app_shutdown")
+)
+
+var (
+ // ServerSentEvents protocol
+ SignalrTransportServerSentEvents = SignalrTransportKey.String("server_sent_events")
+ // LongPolling protocol
+ SignalrTransportLongPolling = SignalrTransportKey.String("long_polling")
+ // WebSockets protocol
+ SignalrTransportWebSockets = SignalrTransportKey.String("web_sockets")
+)
+
+// Describes JVM buffer metric attributes.
+const (
+ // JvmBufferPoolNameKey is the attribute Key conforming to the
+ // "jvm.buffer.pool.name" semantic conventions. It represents the name of
+ // the buffer pool.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'mapped', 'direct'
+ // Note: Pool names are generally obtained via
+ // [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
+ JvmBufferPoolNameKey = attribute.Key("jvm.buffer.pool.name")
+)
+
+// JvmBufferPoolName returns an attribute KeyValue conforming to the
+// "jvm.buffer.pool.name" semantic conventions. It represents the name of the
+// buffer pool.
+func JvmBufferPoolName(val string) attribute.KeyValue {
+ return JvmBufferPoolNameKey.String(val)
+}
+
+// Describes JVM memory metric attributes.
+const (
+ // JvmMemoryPoolNameKey is the attribute Key conforming to the
+ // "jvm.memory.pool.name" semantic conventions. It represents the name of
+ // the memory pool.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: stable
+ // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
+ // Note: Pool names are generally obtained via
+ // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
+ JvmMemoryPoolNameKey = attribute.Key("jvm.memory.pool.name")
+
+ // JvmMemoryTypeKey is the attribute Key conforming to the
+ // "jvm.memory.type" semantic conventions. It represents the type of
+ // memory.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: stable
+ // Examples: 'heap', 'non_heap'
+ JvmMemoryTypeKey = attribute.Key("jvm.memory.type")
+)
+
+var (
+ // Heap memory
+ JvmMemoryTypeHeap = JvmMemoryTypeKey.String("heap")
+ // Non-heap memory
+ JvmMemoryTypeNonHeap = JvmMemoryTypeKey.String("non_heap")
+)
+
+// JvmMemoryPoolName returns an attribute KeyValue conforming to the
+// "jvm.memory.pool.name" semantic conventions. It represents the name of the
+// memory pool.
+func JvmMemoryPoolName(val string) attribute.KeyValue {
+ return JvmMemoryPoolNameKey.String(val)
+}
+
+// Describes System metric attributes
+const (
+ // SystemDeviceKey is the attribute Key conforming to the "system.device"
+ // semantic conventions. It represents the device identifier
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '(identifier)'
+ SystemDeviceKey = attribute.Key("system.device")
+)
+
+// SystemDevice returns an attribute KeyValue conforming to the
+// "system.device" semantic conventions. It represents the device identifier
+func SystemDevice(val string) attribute.KeyValue {
+ return SystemDeviceKey.String(val)
+}
+
+// Describes System CPU metric attributes
+const (
+ // SystemCPULogicalNumberKey is the attribute Key conforming to the
+ // "system.cpu.logical_number" semantic conventions. It represents the
+ // logical CPU number [0..n-1]
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1
+ SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number")
+
+ // SystemCPUStateKey is the attribute Key conforming to the
+ // "system.cpu.state" semantic conventions. It represents the state of the
+ // CPU
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle', 'interrupt'
+ SystemCPUStateKey = attribute.Key("system.cpu.state")
+)
+
+var (
+ // user
+ SystemCPUStateUser = SystemCPUStateKey.String("user")
+ // system
+ SystemCPUStateSystem = SystemCPUStateKey.String("system")
+ // nice
+ SystemCPUStateNice = SystemCPUStateKey.String("nice")
+ // idle
+ SystemCPUStateIdle = SystemCPUStateKey.String("idle")
+ // iowait
+ SystemCPUStateIowait = SystemCPUStateKey.String("iowait")
+ // interrupt
+ SystemCPUStateInterrupt = SystemCPUStateKey.String("interrupt")
+ // steal
+ SystemCPUStateSteal = SystemCPUStateKey.String("steal")
+)
+
+// SystemCPULogicalNumber returns an attribute KeyValue conforming to the
+// "system.cpu.logical_number" semantic conventions. It represents the logical
+// CPU number [0..n-1]
+func SystemCPULogicalNumber(val int) attribute.KeyValue {
+ return SystemCPULogicalNumberKey.Int(val)
+}
+
+// Describes System Memory metric attributes
+const (
+ // SystemMemoryStateKey is the attribute Key conforming to the
+ // "system.memory.state" semantic conventions. It represents the memory
+ // state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free', 'cached'
+ SystemMemoryStateKey = attribute.Key("system.memory.state")
+)
+
+var (
+ // used
+ SystemMemoryStateUsed = SystemMemoryStateKey.String("used")
+ // free
+ SystemMemoryStateFree = SystemMemoryStateKey.String("free")
+ // shared
+ SystemMemoryStateShared = SystemMemoryStateKey.String("shared")
+ // buffers
+ SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers")
+ // cached
+ SystemMemoryStateCached = SystemMemoryStateKey.String("cached")
+)
+
+// Describes System Memory Paging metric attributes
+const (
+ // SystemPagingDirectionKey is the attribute Key conforming to the
+ // "system.paging.direction" semantic conventions. It represents the paging
+ // access direction
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'in'
+ SystemPagingDirectionKey = attribute.Key("system.paging.direction")
+
+ // SystemPagingStateKey is the attribute Key conforming to the
+ // "system.paging.state" semantic conventions. It represents the memory
+ // paging state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free'
+ SystemPagingStateKey = attribute.Key("system.paging.state")
+
+ // SystemPagingTypeKey is the attribute Key conforming to the
+ // "system.paging.type" semantic conventions. It represents the memory
+ // paging type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'minor'
+ SystemPagingTypeKey = attribute.Key("system.paging.type")
+)
+
+var (
+ // in
+ SystemPagingDirectionIn = SystemPagingDirectionKey.String("in")
+ // out
+ SystemPagingDirectionOut = SystemPagingDirectionKey.String("out")
+)
+
+var (
+ // used
+ SystemPagingStateUsed = SystemPagingStateKey.String("used")
+ // free
+ SystemPagingStateFree = SystemPagingStateKey.String("free")
+)
+
+var (
+ // major
+ SystemPagingTypeMajor = SystemPagingTypeKey.String("major")
+ // minor
+ SystemPagingTypeMinor = SystemPagingTypeKey.String("minor")
+)
+
+// Describes Filesystem metric attributes
+const (
+ // SystemFilesystemModeKey is the attribute Key conforming to the
+ // "system.filesystem.mode" semantic conventions. It represents the
+ // filesystem mode
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'rw, ro'
+ SystemFilesystemModeKey = attribute.Key("system.filesystem.mode")
+
+ // SystemFilesystemMountpointKey is the attribute Key conforming to the
+ // "system.filesystem.mountpoint" semantic conventions. It represents the
+ // filesystem mount path
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/mnt/data'
+ SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint")
+
+ // SystemFilesystemStateKey is the attribute Key conforming to the
+ // "system.filesystem.state" semantic conventions. It represents the
+ // filesystem state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'used'
+ SystemFilesystemStateKey = attribute.Key("system.filesystem.state")
+
+ // SystemFilesystemTypeKey is the attribute Key conforming to the
+ // "system.filesystem.type" semantic conventions. It represents the
+ // filesystem type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ext4'
+ SystemFilesystemTypeKey = attribute.Key("system.filesystem.type")
+)
+
+var (
+ // used
+ SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used")
+ // free
+ SystemFilesystemStateFree = SystemFilesystemStateKey.String("free")
+ // reserved
+ SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved")
+)
+
+var (
+ // fat32
+ SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32")
+ // exfat
+ SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat")
+ // ntfs
+ SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs")
+ // refs
+ SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs")
+ // hfsplus
+ SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus")
+ // ext4
+ SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4")
+)
+
+// SystemFilesystemMode returns an attribute KeyValue conforming to the
+// "system.filesystem.mode" semantic conventions. It represents the filesystem
+// mode
+func SystemFilesystemMode(val string) attribute.KeyValue {
+ return SystemFilesystemModeKey.String(val)
+}
+
+// SystemFilesystemMountpoint returns an attribute KeyValue conforming to
+// the "system.filesystem.mountpoint" semantic conventions. It represents the
+// filesystem mount path
+func SystemFilesystemMountpoint(val string) attribute.KeyValue {
+ return SystemFilesystemMountpointKey.String(val)
+}
+
+// Describes Network metric attributes
+const (
+ // SystemNetworkStateKey is the attribute Key conforming to the
+ // "system.network.state" semantic conventions. It represents a stateless
+ // protocol MUST NOT set this attribute
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'close_wait'
+ SystemNetworkStateKey = attribute.Key("system.network.state")
+)
+
+var (
+ // close
+ SystemNetworkStateClose = SystemNetworkStateKey.String("close")
+ // close_wait
+ SystemNetworkStateCloseWait = SystemNetworkStateKey.String("close_wait")
+ // closing
+ SystemNetworkStateClosing = SystemNetworkStateKey.String("closing")
+ // delete
+ SystemNetworkStateDelete = SystemNetworkStateKey.String("delete")
+ // established
+ SystemNetworkStateEstablished = SystemNetworkStateKey.String("established")
+ // fin_wait_1
+ SystemNetworkStateFinWait1 = SystemNetworkStateKey.String("fin_wait_1")
+ // fin_wait_2
+ SystemNetworkStateFinWait2 = SystemNetworkStateKey.String("fin_wait_2")
+ // last_ack
+ SystemNetworkStateLastAck = SystemNetworkStateKey.String("last_ack")
+ // listen
+ SystemNetworkStateListen = SystemNetworkStateKey.String("listen")
+ // syn_recv
+ SystemNetworkStateSynRecv = SystemNetworkStateKey.String("syn_recv")
+ // syn_sent
+ SystemNetworkStateSynSent = SystemNetworkStateKey.String("syn_sent")
+ // time_wait
+ SystemNetworkStateTimeWait = SystemNetworkStateKey.String("time_wait")
+)
+
+// Describes System Process metric attributes
+const (
+ // SystemProcessesStatusKey is the attribute Key conforming to the
+ // "system.processes.status" semantic conventions. It represents the
+ // process state, e.g., [Linux Process State
+ // Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'running'
+ SystemProcessesStatusKey = attribute.Key("system.processes.status")
+)
+
+var (
+ // running
+ SystemProcessesStatusRunning = SystemProcessesStatusKey.String("running")
+ // sleeping
+ SystemProcessesStatusSleeping = SystemProcessesStatusKey.String("sleeping")
+ // stopped
+ SystemProcessesStatusStopped = SystemProcessesStatusKey.String("stopped")
+ // defunct
+ SystemProcessesStatusDefunct = SystemProcessesStatusKey.String("defunct")
+)
+
+// These attributes may be used to describe the client in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ClientAddressKey is the attribute Key conforming to the "client.address"
+ // semantic conventions. It represents the client address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.address` SHOULD represent the client address
+ // behind any intermediaries, for example proxies, if it's available.
+ ClientAddressKey = attribute.Key("client.address")
+
+ // ClientPortKey is the attribute Key conforming to the "client.port"
+ // semantic conventions. It represents the client port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.port` SHOULD represent the client port behind
+ // any intermediaries, for example proxies, if it's available.
+ ClientPortKey = attribute.Key("client.port")
+)
+
+// ClientAddress returns an attribute KeyValue conforming to the
+// "client.address" semantic conventions. It represents the client address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func ClientAddress(val string) attribute.KeyValue {
+ return ClientAddressKey.String(val)
+}
+
+// ClientPort returns an attribute KeyValue conforming to the "client.port"
+// semantic conventions. It represents the client port number.
+func ClientPort(val int) attribute.KeyValue {
+ return ClientPortKey.Int(val)
+}
+
+// The attributes used to describe telemetry in the context of databases.
+const (
+ // DBCassandraConsistencyLevelKey is the attribute Key conforming to the
+ // "db.cassandra.consistency_level" semantic conventions. It represents the
+ // consistency level of the query. Based on consistency values from
+ // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
+
+ // DBCassandraCoordinatorDCKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.dc" semantic conventions. It represents the
+ // data center of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-west-2'
+ DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
+
+ // DBCassandraCoordinatorIDKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.id" semantic conventions. It represents the ID
+ // of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
+ DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
+
+ // DBCassandraIdempotenceKey is the attribute Key conforming to the
+ // "db.cassandra.idempotence" semantic conventions. It represents the
+ // whether or not the query is idempotent.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
+
+ // DBCassandraPageSizeKey is the attribute Key conforming to the
+ // "db.cassandra.page_size" semantic conventions. It represents the fetch
+ // size used for paging, i.e. how many rows will be returned at once.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 5000
+ DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
+
+ // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming
+ // to the "db.cassandra.speculative_execution_count" semantic conventions.
+ // It represents the number of times a query was speculatively executed.
+ // Not set or `0` if the query was not executed speculatively.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 2
+ DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
+
+ // DBCassandraTableKey is the attribute Key conforming to the
+ // "db.cassandra.table" semantic conventions. It represents the name of the
+ // primary Cassandra table that the operation is acting upon, including the
+ // keyspace name (if applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mytable'
+ // Note: This mirrors the db.sql.table attribute but references cassandra
+ // rather than sql. It is not recommended to attempt any client-side
+ // parsing of `db.statement` just to get this property, but it should be
+ // set if it is provided by the library being instrumented. If the
+ // operation is acting upon an anonymous table, or more than one table,
+ // this value MUST NOT be set.
+ DBCassandraTableKey = attribute.Key("db.cassandra.table")
+
+ // DBConnectionStringKey is the attribute Key conforming to the
+ // "db.connection_string" semantic conventions. It represents the
+ // connection string used to connect to the database. It is recommended to
+ // remove embedded credentials.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;'
+ DBConnectionStringKey = attribute.Key("db.connection_string")
+
+ // DBCosmosDBClientIDKey is the attribute Key conforming to the
+ // "db.cosmosdb.client_id" semantic conventions. It represents the unique
+ // Cosmos client instance id.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
+ DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id")
+
+ // DBCosmosDBConnectionModeKey is the attribute Key conforming to the
+ // "db.cosmosdb.connection_mode" semantic conventions. It represents the
+ // cosmos client connection mode.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode")
+
+ // DBCosmosDBContainerKey is the attribute Key conforming to the
+ // "db.cosmosdb.container" semantic conventions. It represents the cosmos
+ // DB container name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'anystring'
+ DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container")
+
+ // DBCosmosDBOperationTypeKey is the attribute Key conforming to the
+ // "db.cosmosdb.operation_type" semantic conventions. It represents the
+ // cosmosDB Operation Type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type")
+
+ // DBCosmosDBRequestChargeKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+ // consumed for that operation
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 46.18, 1.0
+ DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge")
+
+ // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_content_length" semantic conventions. It represents
+ // the request payload size in bytes
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length")
+
+ // DBCosmosDBStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos
+ // DB status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 200, 201
+ DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code")
+
+ // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.sub_status_code" semantic conventions. It represents the
+ // cosmos DB sub status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000, 1002
+ DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code")
+
+ // DBElasticsearchClusterNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.cluster.name" semantic conventions. It represents the
+ // represents the identifier of an Elasticsearch cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e9106fc68e3044f0b1475b04bf4ffd5f'
+ DBElasticsearchClusterNameKey = attribute.Key("db.elasticsearch.cluster.name")
+
+ // DBElasticsearchNodeNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.node.name" semantic conventions. It represents the
+ // represents the human-readable identifier of the node/instance to which a
+ // request was routed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-0000000001'
+ DBElasticsearchNodeNameKey = attribute.Key("db.elasticsearch.node.name")
+
+ // DBInstanceIDKey is the attribute Key conforming to the "db.instance.id"
+ // semantic conventions. It represents an identifier (address, unique name,
+ // or any other identifier) of the database instance that is executing
+ // queries or mutations on the current connection. This is useful in cases
+ // where the database is running in a clustered environment and the
+ // instrumentation is able to record the node executing the query. The
+ // client may obtain this value in databases like MySQL using queries like
+ // `select @@hostname`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mysql-e26b99z.example.com'
+ DBInstanceIDKey = attribute.Key("db.instance.id")
+
+ // DBJDBCDriverClassnameKey is the attribute Key conforming to the
+ // "db.jdbc.driver_classname" semantic conventions. It represents the
+ // fully-qualified class name of the [Java Database Connectivity
+ // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/)
+ // driver used to connect.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'org.postgresql.Driver',
+ // 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
+ DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname")
+
+ // DBMongoDBCollectionKey is the attribute Key conforming to the
+ // "db.mongodb.collection" semantic conventions. It represents the MongoDB
+ // collection being accessed within the database stated in `db.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'customers', 'products'
+ DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection")
+
+ // DBMSSQLInstanceNameKey is the attribute Key conforming to the
+ // "db.mssql.instance_name" semantic conventions. It represents the
+ // Microsoft SQL Server [instance
+ // name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
+ // connecting to. This name is used to determine the port of a named
+ // instance.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MSSQLSERVER'
+ // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer
+ // required (but still recommended if non-standard).
+ DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
+
+ // DBNameKey is the attribute Key conforming to the "db.name" semantic
+ // conventions. It represents the this attribute is used to report the name
+ // of the database being accessed. For commands that switch the database,
+ // this should be set to the target database (even if the command fails).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'customers', 'main'
+ // Note: In some SQL databases, the database name to be used is called
+ // "schema name". In case there are multiple layers that could be
+ // considered for database name (e.g. Oracle instance name and schema
+ // name), the database name to be used is the more specific layer (e.g.
+ // Oracle schema name).
+ DBNameKey = attribute.Key("db.name")
+
+ // DBOperationKey is the attribute Key conforming to the "db.operation"
+ // semantic conventions. It represents the name of the operation being
+ // executed, e.g. the [MongoDB command
+ // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
+ // such as `findAndModify`, or the SQL keyword.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findAndModify', 'HMSET', 'SELECT'
+ // Note: When setting this to an SQL keyword, it is not recommended to
+ // attempt any client-side parsing of `db.statement` just to get this
+ // property, but it should be set if the operation name is provided by the
+ // library being instrumented. If the SQL statement has an ambiguous
+ // operation, or performs more than one operation, this value may be
+ // omitted.
+ DBOperationKey = attribute.Key("db.operation")
+
+ // DBRedisDBIndexKey is the attribute Key conforming to the
+ // "db.redis.database_index" semantic conventions. It represents the index
+ // of the database being accessed as used in the [`SELECT`
+ // command](https://redis.io/commands/select), provided as an integer. To
+ // be used instead of the generic `db.name` attribute.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1, 15
+ DBRedisDBIndexKey = attribute.Key("db.redis.database_index")
+
+ // DBSQLTableKey is the attribute Key conforming to the "db.sql.table"
+ // semantic conventions. It represents the name of the primary table that
+ // the operation is acting upon, including the database name (if
+ // applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'public.users', 'customers'
+ // Note: It is not recommended to attempt any client-side parsing of
+ // `db.statement` just to get this property, but it should be set if it is
+ // provided by the library being instrumented. If the operation is acting
+ // upon an anonymous table, or more than one table, this value MUST NOT be
+ // set.
+ DBSQLTableKey = attribute.Key("db.sql.table")
+
+ // DBStatementKey is the attribute Key conforming to the "db.statement"
+ // semantic conventions. It represents the database statement being
+ // executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
+ DBStatementKey = attribute.Key("db.statement")
+
+ // DBSystemKey is the attribute Key conforming to the "db.system" semantic
+ // conventions. It represents an identifier for the database management
+ // system (DBMS) product being used. See below for a list of well-known
+ // identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBSystemKey = attribute.Key("db.system")
+
+ // DBUserKey is the attribute Key conforming to the "db.user" semantic
+ // conventions. It represents the username for accessing the database.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'readonly_user', 'reporting_user'
+ DBUserKey = attribute.Key("db.user")
+)
+
+var (
+ // all
+ DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
+ // each_quorum
+ DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
+ // quorum
+ DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
+ // local_quorum
+ DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
+ // one
+ DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
+ // two
+ DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
+ // three
+ DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
+ // local_one
+ DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
+ // any
+ DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
+ // serial
+ DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
+ // local_serial
+ DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
+)
+
+var (
+ // Gateway (HTTP) connections mode
+ DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway")
+ // Direct connection
+ DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct")
+)
+
+var (
+ // invalid
+ DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid")
+ // create
+ DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create")
+ // patch
+ DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch")
+ // read
+ DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read")
+ // read_feed
+ DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed")
+ // delete
+ DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete")
+ // replace
+ DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace")
+ // execute
+ DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute")
+ // query
+ DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query")
+ // head
+ DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head")
+ // head_feed
+ DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed")
+ // upsert
+ DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert")
+ // batch
+ DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch")
+ // query_plan
+ DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan")
+ // execute_javascript
+ DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript")
+)
+
+var (
+ // Some other SQL database. Fallback only. See notes
+ DBSystemOtherSQL = DBSystemKey.String("other_sql")
+ // Microsoft SQL Server
+ DBSystemMSSQL = DBSystemKey.String("mssql")
+ // Microsoft SQL Server Compact
+ DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
+ // MySQL
+ DBSystemMySQL = DBSystemKey.String("mysql")
+ // Oracle Database
+ DBSystemOracle = DBSystemKey.String("oracle")
+ // IBM DB2
+ DBSystemDB2 = DBSystemKey.String("db2")
+ // PostgreSQL
+ DBSystemPostgreSQL = DBSystemKey.String("postgresql")
+ // Amazon Redshift
+ DBSystemRedshift = DBSystemKey.String("redshift")
+ // Apache Hive
+ DBSystemHive = DBSystemKey.String("hive")
+ // Cloudscape
+ DBSystemCloudscape = DBSystemKey.String("cloudscape")
+ // HyperSQL DataBase
+ DBSystemHSQLDB = DBSystemKey.String("hsqldb")
+ // Progress Database
+ DBSystemProgress = DBSystemKey.String("progress")
+ // SAP MaxDB
+ DBSystemMaxDB = DBSystemKey.String("maxdb")
+ // SAP HANA
+ DBSystemHanaDB = DBSystemKey.String("hanadb")
+ // Ingres
+ DBSystemIngres = DBSystemKey.String("ingres")
+ // FirstSQL
+ DBSystemFirstSQL = DBSystemKey.String("firstsql")
+ // EnterpriseDB
+ DBSystemEDB = DBSystemKey.String("edb")
+ // InterSystems Caché
+ DBSystemCache = DBSystemKey.String("cache")
+ // Adabas (Adaptable Database System)
+ DBSystemAdabas = DBSystemKey.String("adabas")
+ // Firebird
+ DBSystemFirebird = DBSystemKey.String("firebird")
+ // Apache Derby
+ DBSystemDerby = DBSystemKey.String("derby")
+ // FileMaker
+ DBSystemFilemaker = DBSystemKey.String("filemaker")
+ // Informix
+ DBSystemInformix = DBSystemKey.String("informix")
+ // InstantDB
+ DBSystemInstantDB = DBSystemKey.String("instantdb")
+ // InterBase
+ DBSystemInterbase = DBSystemKey.String("interbase")
+ // MariaDB
+ DBSystemMariaDB = DBSystemKey.String("mariadb")
+ // Netezza
+ DBSystemNetezza = DBSystemKey.String("netezza")
+ // Pervasive PSQL
+ DBSystemPervasive = DBSystemKey.String("pervasive")
+ // PointBase
+ DBSystemPointbase = DBSystemKey.String("pointbase")
+ // SQLite
+ DBSystemSqlite = DBSystemKey.String("sqlite")
+ // Sybase
+ DBSystemSybase = DBSystemKey.String("sybase")
+ // Teradata
+ DBSystemTeradata = DBSystemKey.String("teradata")
+ // Vertica
+ DBSystemVertica = DBSystemKey.String("vertica")
+ // H2
+ DBSystemH2 = DBSystemKey.String("h2")
+ // ColdFusion IMQ
+ DBSystemColdfusion = DBSystemKey.String("coldfusion")
+ // Apache Cassandra
+ DBSystemCassandra = DBSystemKey.String("cassandra")
+ // Apache HBase
+ DBSystemHBase = DBSystemKey.String("hbase")
+ // MongoDB
+ DBSystemMongoDB = DBSystemKey.String("mongodb")
+ // Redis
+ DBSystemRedis = DBSystemKey.String("redis")
+ // Couchbase
+ DBSystemCouchbase = DBSystemKey.String("couchbase")
+ // CouchDB
+ DBSystemCouchDB = DBSystemKey.String("couchdb")
+ // Microsoft Azure Cosmos DB
+ DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
+ // Amazon DynamoDB
+ DBSystemDynamoDB = DBSystemKey.String("dynamodb")
+ // Neo4j
+ DBSystemNeo4j = DBSystemKey.String("neo4j")
+ // Apache Geode
+ DBSystemGeode = DBSystemKey.String("geode")
+ // Elasticsearch
+ DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
+ // Memcached
+ DBSystemMemcached = DBSystemKey.String("memcached")
+ // CockroachDB
+ DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
+ // OpenSearch
+ DBSystemOpensearch = DBSystemKey.String("opensearch")
+ // ClickHouse
+ DBSystemClickhouse = DBSystemKey.String("clickhouse")
+ // Cloud Spanner
+ DBSystemSpanner = DBSystemKey.String("spanner")
+ // Trino
+ DBSystemTrino = DBSystemKey.String("trino")
+)
+
+// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.dc" semantic conventions. It represents the data
+// center of the coordinating node for a query.
+func DBCassandraCoordinatorDC(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorDCKey.String(val)
+}
+
+// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of
+// the coordinating node for a query.
+func DBCassandraCoordinatorID(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorIDKey.String(val)
+}
+
+// DBCassandraIdempotence returns an attribute KeyValue conforming to the
+// "db.cassandra.idempotence" semantic conventions. It represents the whether
+// or not the query is idempotent.
+func DBCassandraIdempotence(val bool) attribute.KeyValue {
+ return DBCassandraIdempotenceKey.Bool(val)
+}
+
+// DBCassandraPageSize returns an attribute KeyValue conforming to the
+// "db.cassandra.page_size" semantic conventions. It represents the fetch size
+// used for paging, i.e. how many rows will be returned at once.
+func DBCassandraPageSize(val int) attribute.KeyValue {
+ return DBCassandraPageSizeKey.Int(val)
+}
+
+// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue
+// conforming to the "db.cassandra.speculative_execution_count" semantic
+// conventions. It represents the number of times a query was speculatively
+// executed. Not set or `0` if the query was not executed speculatively.
+func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
+ return DBCassandraSpeculativeExecutionCountKey.Int(val)
+}
+
+// DBCassandraTable returns an attribute KeyValue conforming to the
+// "db.cassandra.table" semantic conventions. It represents the name of the
+// primary Cassandra table that the operation is acting upon, including the
+// keyspace name (if applicable).
+func DBCassandraTable(val string) attribute.KeyValue {
+ return DBCassandraTableKey.String(val)
+}
+
+// DBConnectionString returns an attribute KeyValue conforming to the
+// "db.connection_string" semantic conventions. It represents the connection
+// string used to connect to the database. It is recommended to remove embedded
+// credentials.
+func DBConnectionString(val string) attribute.KeyValue {
+ return DBConnectionStringKey.String(val)
+}
+
+// DBCosmosDBClientID returns an attribute KeyValue conforming to the
+// "db.cosmosdb.client_id" semantic conventions. It represents the unique
+// Cosmos client instance id.
+func DBCosmosDBClientID(val string) attribute.KeyValue {
+ return DBCosmosDBClientIDKey.String(val)
+}
+
+// DBCosmosDBContainer returns an attribute KeyValue conforming to the
+// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB
+// container name.
+func DBCosmosDBContainer(val string) attribute.KeyValue {
+ return DBCosmosDBContainerKey.String(val)
+}
+
+// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the
+// "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+// consumed for that operation
+func DBCosmosDBRequestCharge(val float64) attribute.KeyValue {
+ return DBCosmosDBRequestChargeKey.Float64(val)
+}
+
+// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming
+// to the "db.cosmosdb.request_content_length" semantic conventions. It
+// represents the request payload size in bytes
+func DBCosmosDBRequestContentLength(val int) attribute.KeyValue {
+ return DBCosmosDBRequestContentLengthKey.Int(val)
+}
+
+// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB
+// status code.
+func DBCosmosDBStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBStatusCodeKey.Int(val)
+}
+
+// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos
+// DB sub status code.
+func DBCosmosDBSubStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBSubStatusCodeKey.Int(val)
+}
+
+// DBElasticsearchClusterName returns an attribute KeyValue conforming to
+// the "db.elasticsearch.cluster.name" semantic conventions. It represents the
+// represents the identifier of an Elasticsearch cluster.
+func DBElasticsearchClusterName(val string) attribute.KeyValue {
+ return DBElasticsearchClusterNameKey.String(val)
+}
+
+// DBElasticsearchNodeName returns an attribute KeyValue conforming to the
+// "db.elasticsearch.node.name" semantic conventions. It represents the
+// represents the human-readable identifier of the node/instance to which a
+// request was routed.
+func DBElasticsearchNodeName(val string) attribute.KeyValue {
+ return DBElasticsearchNodeNameKey.String(val)
+}
+
+// DBInstanceID returns an attribute KeyValue conforming to the
+// "db.instance.id" semantic conventions. It represents an identifier (address,
+// unique name, or any other identifier) of the database instance that is
+// executing queries or mutations on the current connection. This is useful in
+// cases where the database is running in a clustered environment and the
+// instrumentation is able to record the node executing the query. The client
+// may obtain this value in databases like MySQL using queries like `select
+// @@hostname`.
+func DBInstanceID(val string) attribute.KeyValue {
+ return DBInstanceIDKey.String(val)
+}
+
+// DBJDBCDriverClassname returns an attribute KeyValue conforming to the
+// "db.jdbc.driver_classname" semantic conventions. It represents the
+// fully-qualified class name of the [Java Database Connectivity
+// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver
+// used to connect.
+func DBJDBCDriverClassname(val string) attribute.KeyValue {
+ return DBJDBCDriverClassnameKey.String(val)
+}
+
+// DBMongoDBCollection returns an attribute KeyValue conforming to the
+// "db.mongodb.collection" semantic conventions. It represents the MongoDB
+// collection being accessed within the database stated in `db.name`.
+func DBMongoDBCollection(val string) attribute.KeyValue {
+ return DBMongoDBCollectionKey.String(val)
+}
+
+// DBMSSQLInstanceName returns an attribute KeyValue conforming to the
+// "db.mssql.instance_name" semantic conventions. It represents the Microsoft
+// SQL Server [instance
+// name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
+// connecting to. This name is used to determine the port of a named instance.
+func DBMSSQLInstanceName(val string) attribute.KeyValue {
+ return DBMSSQLInstanceNameKey.String(val)
+}
+
+// DBName returns an attribute KeyValue conforming to the "db.name" semantic
+// conventions. It represents the this attribute is used to report the name of
+// the database being accessed. For commands that switch the database, this
+// should be set to the target database (even if the command fails).
+func DBName(val string) attribute.KeyValue {
+ return DBNameKey.String(val)
+}
+
+// DBOperation returns an attribute KeyValue conforming to the
+// "db.operation" semantic conventions. It represents the name of the operation
+// being executed, e.g. the [MongoDB command
+// name](https://docs.mongodb.com/manual/reference/command/#database-operations)
+// such as `findAndModify`, or the SQL keyword.
+func DBOperation(val string) attribute.KeyValue {
+ return DBOperationKey.String(val)
+}
+
+// DBRedisDBIndex returns an attribute KeyValue conforming to the
+// "db.redis.database_index" semantic conventions. It represents the index of
+// the database being accessed as used in the [`SELECT`
+// command](https://redis.io/commands/select), provided as an integer. To be
+// used instead of the generic `db.name` attribute.
+func DBRedisDBIndex(val int) attribute.KeyValue {
+ return DBRedisDBIndexKey.Int(val)
+}
+
+// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table"
+// semantic conventions. It represents the name of the primary table that the
+// operation is acting upon, including the database name (if applicable).
+func DBSQLTable(val string) attribute.KeyValue {
+ return DBSQLTableKey.String(val)
+}
+
+// DBStatement returns an attribute KeyValue conforming to the
+// "db.statement" semantic conventions. It represents the database statement
+// being executed.
+func DBStatement(val string) attribute.KeyValue {
+ return DBStatementKey.String(val)
+}
+
+// DBUser returns an attribute KeyValue conforming to the "db.user" semantic
+// conventions. It represents the username for accessing the database.
+func DBUser(val string) attribute.KeyValue {
+ return DBUserKey.String(val)
+}
+
+// Describes deprecated HTTP attributes.
+const (
+ // HTTPFlavorKey is the attribute Key conforming to the "http.flavor"
+ // semantic conventions.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorKey = attribute.Key("http.flavor")
+
+ // HTTPMethodKey is the attribute Key conforming to the "http.method"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'GET', 'POST', 'HEAD'
+ // Deprecated: use `http.request.method` instead.
+ HTTPMethodKey = attribute.Key("http.method")
+
+ // HTTPRequestContentLengthKey is the attribute Key conforming to the
+ // "http.request_content_length" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 3495
+ // Deprecated: use `http.request.header.content-length` instead.
+ HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
+
+ // HTTPResponseContentLengthKey is the attribute Key conforming to the
+ // "http.response_content_length" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 3495
+ // Deprecated: use `http.response.header.content-length` instead.
+ HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
+
+ // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'http', 'https'
+ // Deprecated: use `url.scheme` instead.
+ HTTPSchemeKey = attribute.Key("http.scheme")
+
+ // HTTPStatusCodeKey is the attribute Key conforming to the
+ // "http.status_code" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 200
+ // Deprecated: use `http.response.status_code` instead.
+ HTTPStatusCodeKey = attribute.Key("http.status_code")
+
+ // HTTPTargetKey is the attribute Key conforming to the "http.target"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '/search?q=OpenTelemetry#SemConv'
+ // Deprecated: use `url.path` and `url.query` instead.
+ HTTPTargetKey = attribute.Key("http.target")
+
+ // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
+ // conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
+ // Deprecated: use `url.full` instead.
+ HTTPURLKey = attribute.Key("http.url")
+
+ // HTTPUserAgentKey is the attribute Key conforming to the
+ // "http.user_agent" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1'
+ // Deprecated: use `user_agent.original` instead.
+ HTTPUserAgentKey = attribute.Key("http.user_agent")
+)
+
+var (
+ // HTTP/1.0
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0")
+ // HTTP/1.1
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1")
+ // HTTP/2
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0")
+ // HTTP/3
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0")
+ // SPDY protocol
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY")
+ // QUIC protocol
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC")
+)
+
+// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
+// semantic conventions.
+//
+// Deprecated: use `http.request.method` instead.
+func HTTPMethod(val string) attribute.KeyValue {
+ return HTTPMethodKey.String(val)
+}
+
+// HTTPRequestContentLength returns an attribute KeyValue conforming to the
+// "http.request_content_length" semantic conventions.
+//
+// Deprecated: use `http.request.header.content-length` instead.
+func HTTPRequestContentLength(val int) attribute.KeyValue {
+ return HTTPRequestContentLengthKey.Int(val)
+}
+
+// HTTPResponseContentLength returns an attribute KeyValue conforming to the
+// "http.response_content_length" semantic conventions.
+//
+// Deprecated: use `http.response.header.content-length` instead.
+func HTTPResponseContentLength(val int) attribute.KeyValue {
+ return HTTPResponseContentLengthKey.Int(val)
+}
+
+// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
+// semantic conventions.
+//
+// Deprecated: use `url.scheme` instead.
+func HTTPScheme(val string) attribute.KeyValue {
+ return HTTPSchemeKey.String(val)
+}
+
+// HTTPStatusCode returns an attribute KeyValue conforming to the
+// "http.status_code" semantic conventions.
+//
+// Deprecated: use `http.response.status_code` instead.
+func HTTPStatusCode(val int) attribute.KeyValue {
+ return HTTPStatusCodeKey.Int(val)
+}
+
+// HTTPTarget returns an attribute KeyValue conforming to the "http.target"
+// semantic conventions.
+//
+// Deprecated: use `url.path` and `url.query` instead.
+func HTTPTarget(val string) attribute.KeyValue {
+ return HTTPTargetKey.String(val)
+}
+
+// HTTPURL returns an attribute KeyValue conforming to the "http.url"
+// semantic conventions.
+//
+// Deprecated: use `url.full` instead.
+func HTTPURL(val string) attribute.KeyValue {
+ return HTTPURLKey.String(val)
+}
+
+// HTTPUserAgent returns an attribute KeyValue conforming to the
+// "http.user_agent" semantic conventions.
+//
+// Deprecated: use `user_agent.original` instead.
+func HTTPUserAgent(val string) attribute.KeyValue {
+ return HTTPUserAgentKey.String(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetHostNameKey is the attribute Key conforming to the "net.host.name"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'example.com'
+ // Deprecated: use `server.address`.
+ NetHostNameKey = attribute.Key("net.host.name")
+
+ // NetHostPortKey is the attribute Key conforming to the "net.host.port"
+ // semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 8080
+ // Deprecated: use `server.port`.
+ NetHostPortKey = attribute.Key("net.host.port")
+
+ // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'example.com'
+ // Deprecated: use `server.address` on client spans and `client.address` on
+ // server spans.
+ NetPeerNameKey = attribute.Key("net.peer.name")
+
+ // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
+ // semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 8080
+ // Deprecated: use `server.port` on client spans and `client.port` on
+ // server spans.
+ NetPeerPortKey = attribute.Key("net.peer.port")
+
+ // NetProtocolNameKey is the attribute Key conforming to the
+ // "net.protocol.name" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'amqp', 'http', 'mqtt'
+ // Deprecated: use `network.protocol.name`.
+ NetProtocolNameKey = attribute.Key("net.protocol.name")
+
+ // NetProtocolVersionKey is the attribute Key conforming to the
+ // "net.protocol.version" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '3.1.1'
+ // Deprecated: use `network.protocol.version`.
+ NetProtocolVersionKey = attribute.Key("net.protocol.version")
+
+ // NetSockFamilyKey is the attribute Key conforming to the
+ // "net.sock.family" semantic conventions.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyKey = attribute.Key("net.sock.family")
+
+ // NetSockHostAddrKey is the attribute Key conforming to the
+ // "net.sock.host.addr" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '/var/my.sock'
+ // Deprecated: use `network.local.address`.
+ NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
+
+ // NetSockHostPortKey is the attribute Key conforming to the
+ // "net.sock.host.port" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 8080
+ // Deprecated: use `network.local.port`.
+ NetSockHostPortKey = attribute.Key("net.sock.host.port")
+
+ // NetSockPeerAddrKey is the attribute Key conforming to the
+ // "net.sock.peer.addr" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '192.168.0.1'
+ // Deprecated: use `network.peer.address`.
+ NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
+
+ // NetSockPeerNameKey is the attribute Key conforming to the
+ // "net.sock.peer.name" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '/var/my.sock'
+ // Deprecated: no replacement at this time.
+ NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
+
+ // NetSockPeerPortKey is the attribute Key conforming to the
+ // "net.sock.peer.port" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 65531
+ // Deprecated: use `network.peer.port`.
+ NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
+
+ // NetTransportKey is the attribute Key conforming to the "net.transport"
+ // semantic conventions.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Deprecated: use `network.transport`.
+ NetTransportKey = attribute.Key("net.transport")
+)
+
+var (
+ // IPv4 address
+ //
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyInet = NetSockFamilyKey.String("inet")
+ // IPv6 address
+ //
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
+ // Unix domain socket path
+ //
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyUnix = NetSockFamilyKey.String("unix")
+)
+
+var (
+ // ip_tcp
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportTCP = NetTransportKey.String("ip_tcp")
+ // ip_udp
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportUDP = NetTransportKey.String("ip_udp")
+ // Named or anonymous pipe
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportPipe = NetTransportKey.String("pipe")
+ // In-process communication
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportInProc = NetTransportKey.String("inproc")
+ // Something else (non IP-based)
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportOther = NetTransportKey.String("other")
+)
+
+// NetHostName returns an attribute KeyValue conforming to the
+// "net.host.name" semantic conventions.
+//
+// Deprecated: use `server.address`.
+func NetHostName(val string) attribute.KeyValue {
+ return NetHostNameKey.String(val)
+}
+
+// NetHostPort returns an attribute KeyValue conforming to the
+// "net.host.port" semantic conventions.
+//
+// Deprecated: use `server.port`.
+func NetHostPort(val int) attribute.KeyValue {
+ return NetHostPortKey.Int(val)
+}
+
+// NetPeerName returns an attribute KeyValue conforming to the
+// "net.peer.name" semantic conventions.
+//
+// Deprecated: use `server.address` on client spans and `client.address` on
+// server spans.
+func NetPeerName(val string) attribute.KeyValue {
+ return NetPeerNameKey.String(val)
+}
+
+// NetPeerPort returns an attribute KeyValue conforming to the
+// "net.peer.port" semantic conventions.
+//
+// Deprecated: use `server.port` on client spans and `client.port` on server
+// spans.
+func NetPeerPort(val int) attribute.KeyValue {
+ return NetPeerPortKey.Int(val)
+}
+
+// NetProtocolName returns an attribute KeyValue conforming to the
+// "net.protocol.name" semantic conventions.
+//
+// Deprecated: use `network.protocol.name`.
+func NetProtocolName(val string) attribute.KeyValue {
+ return NetProtocolNameKey.String(val)
+}
+
+// NetProtocolVersion returns an attribute KeyValue conforming to the
+// "net.protocol.version" semantic conventions.
+//
+// Deprecated: use `network.protocol.version`.
+func NetProtocolVersion(val string) attribute.KeyValue {
+ return NetProtocolVersionKey.String(val)
+}
+
+// NetSockHostAddr returns an attribute KeyValue conforming to the
+// "net.sock.host.addr" semantic conventions.
+//
+// Deprecated: use `network.local.address`.
+func NetSockHostAddr(val string) attribute.KeyValue {
+ return NetSockHostAddrKey.String(val)
+}
+
+// NetSockHostPort returns an attribute KeyValue conforming to the
+// "net.sock.host.port" semantic conventions.
+//
+// Deprecated: use `network.local.port`.
+func NetSockHostPort(val int) attribute.KeyValue {
+ return NetSockHostPortKey.Int(val)
+}
+
+// NetSockPeerAddr returns an attribute KeyValue conforming to the
+// "net.sock.peer.addr" semantic conventions.
+//
+// Deprecated: use `network.peer.address`.
+func NetSockPeerAddr(val string) attribute.KeyValue {
+ return NetSockPeerAddrKey.String(val)
+}
+
+// NetSockPeerName returns an attribute KeyValue conforming to the
+// "net.sock.peer.name" semantic conventions.
+//
+// Deprecated: no replacement at this time.
+func NetSockPeerName(val string) attribute.KeyValue {
+ return NetSockPeerNameKey.String(val)
+}
+
+// NetSockPeerPort returns an attribute KeyValue conforming to the
+// "net.sock.peer.port" semantic conventions.
+//
+// Deprecated: use `network.peer.port`.
+func NetSockPeerPort(val int) attribute.KeyValue {
+ return NetSockPeerPortKey.Int(val)
+}
+
+// These attributes may be used to describe the receiver of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // DestinationAddressKey is the attribute Key conforming to the
+ // "destination.address" semantic conventions. It represents the
+ // destination address - domain name if available without reverse DNS
+ // lookup; otherwise, IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'destination.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the source side, and when communicating through
+ // an intermediary, `destination.address` SHOULD represent the destination
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ DestinationAddressKey = attribute.Key("destination.address")
+
+ // DestinationPortKey is the attribute Key conforming to the
+ // "destination.port" semantic conventions. It represents the destination
+ // port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ DestinationPortKey = attribute.Key("destination.port")
+)
+
+// DestinationAddress returns an attribute KeyValue conforming to the
+// "destination.address" semantic conventions. It represents the destination
+// address - domain name if available without reverse DNS lookup; otherwise, IP
+// address or Unix domain socket name.
+func DestinationAddress(val string) attribute.KeyValue {
+ return DestinationAddressKey.String(val)
+}
+
+// DestinationPort returns an attribute KeyValue conforming to the
+// "destination.port" semantic conventions. It represents the destination port
+// number
+func DestinationPort(val int) attribute.KeyValue {
+ return DestinationPortKey.Int(val)
+}
+
+// These attributes may be used for any disk related operation.
+const (
+ // DiskIoDirectionKey is the attribute Key conforming to the
+ // "disk.io.direction" semantic conventions. It represents the disk IO
+ // operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read'
+ DiskIoDirectionKey = attribute.Key("disk.io.direction")
+)
+
+var (
+ // read
+ DiskIoDirectionRead = DiskIoDirectionKey.String("read")
+ // write
+ DiskIoDirectionWrite = DiskIoDirectionKey.String("write")
+)
+
+// The shared attributes used to report an error.
+const (
+ // ErrorTypeKey is the attribute Key conforming to the "error.type"
+ // semantic conventions. It represents the describes a class of error the
+ // operation ended with.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'timeout', 'java.net.UnknownHostException',
+ // 'server_certificate_invalid', '500'
+ // Note: The `error.type` SHOULD be predictable and SHOULD have low
+ // cardinality.
+ // Instrumentations SHOULD document the list of errors they report.
+ //
+ // The cardinality of `error.type` within one instrumentation library
+ // SHOULD be low.
+ // Telemetry consumers that aggregate data from multiple instrumentation
+ // libraries and applications
+ // should be prepared for `error.type` to have high cardinality at query
+ // time when no
+ // additional filters are applied.
+ //
+ // If the operation has completed successfully, instrumentations SHOULD NOT
+ // set `error.type`.
+ //
+ // If a specific domain defines its own set of error identifiers (such as
+ // HTTP or gRPC status codes),
+ // it's RECOMMENDED to:
+ //
+ // * Use a domain-specific attribute
+ // * Set `error.type` to capture all errors, regardless of whether they are
+ // defined within the domain-specific set or not.
+ ErrorTypeKey = attribute.Key("error.type")
+)
+
+var (
+ // A fallback error value to be used when the instrumentation doesn't define a custom value
+ ErrorTypeOther = ErrorTypeKey.String("_OTHER")
+)
+
+// The shared attributes used to report a single exception associated with a
+// span or log.
+const (
+ // ExceptionEscapedKey is the attribute Key conforming to the
+ // "exception.escaped" semantic conventions. It represents the sHOULD be
+ // set to true if the exception event is recorded at a point where it is
+ // known that the exception is escaping the scope of the span.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: An exception is considered to have escaped (or left) the scope of
+ // a span,
+ // if that span is ended while the exception is still logically "in
+ // flight".
+ // This may be actually "in flight" in some languages (e.g. if the
+ // exception
+ // is passed to a Context manager's `__exit__` method in Python) but will
+ // usually be caught at the point of recording the exception in most
+ // languages.
+ //
+ // It is usually not possible to determine at the point where an exception
+ // is thrown
+ // whether it will escape the scope of a span.
+ // However, it is trivial to know that an exception
+ // will escape, if one checks for an active exception just before ending
+ // the span,
+ // as done in the [example for recording span
+ // exceptions](#recording-an-exception).
+ //
+ // It follows that an exception may still escape the scope of the span
+ // even if the `exception.escaped` attribute was not set or set to false,
+ // since the event might have been recorded at a time where it was not
+ // clear whether the exception will escape.
+ ExceptionEscapedKey = attribute.Key("exception.escaped")
+
+ // ExceptionMessageKey is the attribute Key conforming to the
+ // "exception.message" semantic conventions. It represents the exception
+ // message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Division by zero', "Can't convert 'int' object to str
+ // implicitly"
+ ExceptionMessageKey = attribute.Key("exception.message")
+
+ // ExceptionStacktraceKey is the attribute Key conforming to the
+ // "exception.stacktrace" semantic conventions. It represents a stacktrace
+ // as a string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
+ // exception\\n at '
+ // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
+
+ // ExceptionTypeKey is the attribute Key conforming to the "exception.type"
+ // semantic conventions. It represents the type of the exception (its
+ // fully-qualified class name, if applicable). The dynamic type of the
+ // exception should be preferred over the static type in languages that
+ // support it.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'java.net.ConnectException', 'OSError'
+ ExceptionTypeKey = attribute.Key("exception.type")
+)
+
+// ExceptionEscaped returns an attribute KeyValue conforming to the
+// "exception.escaped" semantic conventions. It represents the sHOULD be set to
+// true if the exception event is recorded at a point where it is known that
+// the exception is escaping the scope of the span.
+func ExceptionEscaped(val bool) attribute.KeyValue {
+ return ExceptionEscapedKey.Bool(val)
+}
+
+// ExceptionMessage returns an attribute KeyValue conforming to the
+// "exception.message" semantic conventions. It represents the exception
+// message.
+func ExceptionMessage(val string) attribute.KeyValue {
+ return ExceptionMessageKey.String(val)
+}
+
+// ExceptionStacktrace returns an attribute KeyValue conforming to the
+// "exception.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func ExceptionStacktrace(val string) attribute.KeyValue {
+ return ExceptionStacktraceKey.String(val)
+}
+
+// ExceptionType returns an attribute KeyValue conforming to the
+// "exception.type" semantic conventions. It represents the type of the
+// exception (its fully-qualified class name, if applicable). The dynamic type
+// of the exception should be preferred over the static type in languages that
+// support it.
+func ExceptionType(val string) attribute.KeyValue {
+ return ExceptionTypeKey.String(val)
+}
+
+// Semantic convention attributes in the HTTP namespace.
+const (
+ // HTTPRequestBodySizeKey is the attribute Key conforming to the
+ // "http.request.body.size" semantic conventions. It represents the size of
+ // the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
+
+ // HTTPRequestMethodKey is the attribute Key conforming to the
+ // "http.request.method" semantic conventions. It represents the hTTP
+ // request method.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ // Note: HTTP request method value SHOULD be "known" to the
+ // instrumentation.
+ // By default, this convention defines "known" methods as the ones listed
+ // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
+ // and the PATCH method defined in
+ // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
+ //
+ // If the HTTP request method is not known to instrumentation, it MUST set
+ // the `http.request.method` attribute to `_OTHER`.
+ //
+ // If the HTTP instrumentation could end up converting valid HTTP request
+ // methods to `_OTHER`, then it MUST provide a way to override
+ // the list of known HTTP methods. If this override is done via environment
+ // variable, then the environment variable MUST be named
+ // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
+ // list of case-sensitive known HTTP methods
+ // (this list MUST be a full override of the default known method, it is
+ // not a list of known methods in addition to the defaults).
+ //
+ // HTTP method names are case-sensitive and `http.request.method` attribute
+ // value MUST match a known HTTP method name exactly.
+ // Instrumentations for specific web frameworks that consider HTTP methods
+ // to be case insensitive, SHOULD populate a canonical equivalent.
+ // Tracing instrumentations that do so, MUST also set
+ // `http.request.method_original` to the original value.
+ HTTPRequestMethodKey = attribute.Key("http.request.method")
+
+ // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
+ // "http.request.method_original" semantic conventions. It represents the
+ // original HTTP method sent by the client in the request line.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GeT', 'ACL', 'foo'
+ HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
+
+ // HTTPRequestResendCountKey is the attribute Key conforming to the
+ // "http.request.resend_count" semantic conventions. It represents the
+ // ordinal number of request resending attempt (for any reason, including
+ // redirects).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3
+ // Note: The resend count SHOULD be updated each time an HTTP request gets
+ // resent by the client, regardless of what was the cause of the resending
+ // (e.g. redirection, authorization failure, 503 Server Unavailable,
+ // network issues, or any other).
+ HTTPRequestResendCountKey = attribute.Key("http.request.resend_count")
+
+ // HTTPResponseBodySizeKey is the attribute Key conforming to the
+ // "http.response.body.size" semantic conventions. It represents the size
+ // of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
+
+ // HTTPResponseStatusCodeKey is the attribute Key conforming to the
+ // "http.response.status_code" semantic conventions. It represents the
+ // [HTTP response status
+ // code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 200
+ HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route, that is, the path
+ // template in the format used by the respective server framework.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+var (
+ // CONNECT method
+ HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
+ // DELETE method
+ HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
+ // GET method
+ HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
+ // HEAD method
+ HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
+ // OPTIONS method
+ HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
+ // PATCH method
+ HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
+ // POST method
+ HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
+ // PUT method
+ HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
+ // TRACE method
+ HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
+ // Any HTTP method that the instrumentation has no prior knowledge of
+ HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
+)
+
+// HTTPRequestBodySize returns an attribute KeyValue conforming to the
+// "http.request.body.size" semantic conventions. It represents the size of the
+// request payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestBodySize(val int) attribute.KeyValue {
+ return HTTPRequestBodySizeKey.Int(val)
+}
+
+// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
+// "http.request.method_original" semantic conventions. It represents the
+// original HTTP method sent by the client in the request line.
+func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
+ return HTTPRequestMethodOriginalKey.String(val)
+}
+
+// HTTPRequestResendCount returns an attribute KeyValue conforming to the
+// "http.request.resend_count" semantic conventions. It represents the ordinal
+// number of request resending attempt (for any reason, including redirects).
+func HTTPRequestResendCount(val int) attribute.KeyValue {
+ return HTTPRequestResendCountKey.Int(val)
+}
+
+// HTTPResponseBodySize returns an attribute KeyValue conforming to the
+// "http.response.body.size" semantic conventions. It represents the size of
+// the response payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseBodySize(val int) attribute.KeyValue {
+ return HTTPResponseBodySizeKey.Int(val)
+}
+
+// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
+// "http.response.status_code" semantic conventions. It represents the [HTTP
+// response status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPResponseStatusCode(val int) attribute.KeyValue {
+ return HTTPResponseStatusCodeKey.Int(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route, that is, the path
+// template in the format used by the respective server framework.
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Attributes describing telemetry around messaging systems and messaging
+// activities.
+const (
+ // MessagingBatchMessageCountKey is the attribute Key conforming to the
+ // "messaging.batch.message_count" semantic conventions. It represents the
+ // number of messages sent, received, or processed in the scope of the
+ // batching operation.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1, 2
+ // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
+ // spans that operate with a single message. When a messaging client
+ // library supports both batch and single-message API for the same
+ // operation, instrumentations SHOULD use `messaging.batch.message_count`
+ // for batching APIs and SHOULD NOT use it for single-message APIs.
+ MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
+
+ // MessagingClientIDKey is the attribute Key conforming to the
+ // "messaging.client_id" semantic conventions. It represents a unique
+ // identifier for the client that consumes or produces a message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'client-5', 'myhost@8742@s8083jm'
+ MessagingClientIDKey = attribute.Key("messaging.client_id")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker doesn't have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationPublishAnonymousKey is the attribute Key conforming
+ // to the "messaging.destination_publish.anonymous" semantic conventions.
+ // It represents a boolean that is true if the publish message destination
+ // is anonymous (could be unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationPublishAnonymousKey = attribute.Key("messaging.destination_publish.anonymous")
+
+ // MessagingDestinationPublishNameKey is the attribute Key conforming to
+ // the "messaging.destination_publish.name" semantic conventions. It
+ // represents the name of the original destination the message was
+ // published to
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: The name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker doesn't have such notion, the original destination name
+ // SHOULD uniquely identify the broker.
+ MessagingDestinationPublishNameKey = attribute.Key("messaging.destination_publish.name")
+
+ // MessagingGCPPubsubMessageOrderingKeyKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions.
+ // It represents the ordering key for a given message. If the attribute is
+ // not present, the message does not have an ordering key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ordering_key'
+ MessagingGCPPubsubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key")
+
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
+ // the "messaging.kafka.destination.partition" semantic conventions. It
+ // represents the partition the message is sent to.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
+
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+
+ // MessagingMessageBodySizeKey is the attribute Key conforming to the
+ // "messaging.message.body.size" semantic conventions. It represents the
+ // size of the message body in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1439
+ // Note: This can refer to both the compressed or uncompressed body size.
+ // If both sizes are known, the uncompressed
+ // body size should be used.
+ MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the conversation ID identifying the conversation to which the message
+ // belongs, represented as a string. Sometimes called "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the
+ // "messaging.message.envelope.size" semantic conventions. It represents
+ // the size of the message body and metadata in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2738
+ // Note: This can refer to both the compressed or uncompressed size. If
+ // both sizes are known, the uncompressed
+ // size should be used.
+ MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size")
+
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingOperationKey is the attribute Key conforming to the
+ // "messaging.operation" semantic conventions. It represents a string
+ // identifying the kind of messaging operation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: If a custom value is used, it MUST be of low cardinality.
+ MessagingOperationKey = attribute.Key("messaging.operation")
+
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+
+ // MessagingSystemKey is the attribute Key conforming to the
+ // "messaging.system" semantic conventions. It represents an identifier for
+ // the messaging system being used. See below for a list of well-known
+ // identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingSystemKey = attribute.Key("messaging.system")
+)
+
+var (
+ // One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created
+ MessagingOperationPublish = MessagingOperationKey.String("publish")
+ // A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios
+ MessagingOperationCreate = MessagingOperationKey.String("create")
+ // One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages
+ MessagingOperationReceive = MessagingOperationKey.String("receive")
+ // One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs
+ MessagingOperationDeliver = MessagingOperationKey.String("deliver")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+var (
+ // Apache ActiveMQ
+ MessagingSystemActivemq = MessagingSystemKey.String("activemq")
+ // Amazon Simple Queue Service (SQS)
+ MessagingSystemAWSSqs = MessagingSystemKey.String("aws_sqs")
+ // Azure Event Grid
+ MessagingSystemAzureEventgrid = MessagingSystemKey.String("azure_eventgrid")
+ // Azure Event Hubs
+ MessagingSystemAzureEventhubs = MessagingSystemKey.String("azure_eventhubs")
+ // Azure Service Bus
+ MessagingSystemAzureServicebus = MessagingSystemKey.String("azure_servicebus")
+ // Google Cloud Pub/Sub
+ MessagingSystemGCPPubsub = MessagingSystemKey.String("gcp_pubsub")
+ // Java Message Service
+ MessagingSystemJms = MessagingSystemKey.String("jms")
+ // Apache Kafka
+ MessagingSystemKafka = MessagingSystemKey.String("kafka")
+ // RabbitMQ
+ MessagingSystemRabbitmq = MessagingSystemKey.String("rabbitmq")
+ // Apache RocketMQ
+ MessagingSystemRocketmq = MessagingSystemKey.String("rocketmq")
+)
+
+// MessagingBatchMessageCount returns an attribute KeyValue conforming to
+// the "messaging.batch.message_count" semantic conventions. It represents the
+// number of messages sent, received, or processed in the scope of the batching
+// operation.
+func MessagingBatchMessageCount(val int) attribute.KeyValue {
+ return MessagingBatchMessageCountKey.Int(val)
+}
+
+// MessagingClientID returns an attribute KeyValue conforming to the
+// "messaging.client_id" semantic conventions. It represents a unique
+// identifier for the client that consumes or produces a message.
+func MessagingClientID(val string) attribute.KeyValue {
+ return MessagingClientIDKey.String(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationPublishAnonymous returns an attribute KeyValue
+// conforming to the "messaging.destination_publish.anonymous" semantic
+// conventions. It represents a boolean that is true if the publish message
+// destination is anonymous (could be unnamed or have auto-generated name).
+func MessagingDestinationPublishAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationPublishAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationPublishName returns an attribute KeyValue conforming
+// to the "messaging.destination_publish.name" semantic conventions. It
+// represents the name of the original destination the message was published to
+func MessagingDestinationPublishName(val string) attribute.KeyValue {
+ return MessagingDestinationPublishNameKey.String(val)
+}
+
+// MessagingGCPPubsubMessageOrderingKey returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ordering_key" semantic
+// conventions. It represents the ordering key for a given message. If the
+// attribute is not present, the message does not have an ordering key.
+func MessagingGCPPubsubMessageOrderingKey(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageOrderingKeyKey.String(val)
+}
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaDestinationPartition returns an attribute KeyValue
+// conforming to the "messaging.kafka.destination.partition" semantic
+// conventions. It represents the partition the message is sent to.
+func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
+ return MessagingKafkaDestinationPartitionKey.Int(val)
+}
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// MessagingMessageBodySize returns an attribute KeyValue conforming to the
+// "messaging.message.body.size" semantic conventions. It represents the size
+// of the message body in bytes.
+func MessagingMessageBodySize(val int) attribute.KeyValue {
+ return MessagingMessageBodySizeKey.Int(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the conversation ID identifying the conversation to which the
+// message belongs, represented as a string. Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to
+// the "messaging.message.envelope.size" semantic conventions. It represents
+// the size of the message body and metadata in bytes.
+func MessagingMessageEnvelopeSize(val int) attribute.KeyValue {
+ return MessagingMessageEnvelopeSizeKey.Int(val)
+}
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetworkCarrierIccKey is the attribute Key conforming to the
+ // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+ // alpha-2 2-character country code associated with the mobile carrier
+ // network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'DE'
+ NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
+
+ // NetworkCarrierMccKey is the attribute Key conforming to the
+ // "network.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '310'
+ NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
+
+ // NetworkCarrierMncKey is the attribute Key conforming to the
+ // "network.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '001'
+ NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
+
+ // NetworkCarrierNameKey is the attribute Key conforming to the
+ // "network.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'sprint'
+ NetworkCarrierNameKey = attribute.Key("network.carrier.name")
+
+ // NetworkConnectionSubtypeKey is the attribute Key conforming to the
+ // "network.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'LTE'
+ NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
+
+ // NetworkConnectionTypeKey is the attribute Key conforming to the
+ // "network.connection.type" semantic conventions. It represents the
+ // internet connection type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'wifi'
+ NetworkConnectionTypeKey = attribute.Key("network.connection.type")
+
+ // NetworkIoDirectionKey is the attribute Key conforming to the
+ // "network.io.direction" semantic conventions. It represents the network
+ // IO operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'transmit'
+ NetworkIoDirectionKey = attribute.Key("network.io.direction")
+
+ // NetworkLocalAddressKey is the attribute Key conforming to the
+ // "network.local.address" semantic conventions. It represents the local
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkLocalAddressKey = attribute.Key("network.local.address")
+
+ // NetworkLocalPortKey is the attribute Key conforming to the
+ // "network.local.port" semantic conventions. It represents the local port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkLocalPortKey = attribute.Key("network.local.port")
+
+ // NetworkPeerAddressKey is the attribute Key conforming to the
+ // "network.peer.address" semantic conventions. It represents the peer
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkPeerAddressKey = attribute.Key("network.peer.address")
+
+ // NetworkPeerPortKey is the attribute Key conforming to the
+ // "network.peer.port" semantic conventions. It represents the peer port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkPeerPortKey = attribute.Key("network.peer.port")
+
+ // NetworkProtocolNameKey is the attribute Key conforming to the
+ // "network.protocol.name" semantic conventions. It represents the [OSI
+ // application layer](https://osi-model.com/application-layer/) or non-OSI
+ // equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkProtocolNameKey = attribute.Key("network.protocol.name")
+
+ // NetworkProtocolVersionKey is the attribute Key conforming to the
+ // "network.protocol.version" semantic conventions. It represents the
+ // version of the protocol specified in `network.protocol.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '3.1.1'
+ // Note: `network.protocol.version` refers to the version of the protocol
+ // used and might be different from the protocol client's version. If the
+ // HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`,
+ // this attribute should be set to `1.1`.
+ NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
+
+ // NetworkTransportKey is the attribute Key conforming to the
+ // "network.transport" semantic conventions. It represents the [OSI
+ // transport layer](https://osi-model.com/transport-layer/) or
+ // [inter-process communication
+ // method](https://wikipedia.org/wiki/Inter-process_communication).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tcp', 'udp'
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // Consider always setting the transport when setting a port number, since
+ // a port number is ambiguous without knowing the transport. For example
+ // different processes could be listening on TCP port 12345 and UDP port
+ // 12345.
+ NetworkTransportKey = attribute.Key("network.transport")
+
+ // NetworkTypeKey is the attribute Key conforming to the "network.type"
+ // semantic conventions. It represents the [OSI network
+ // layer](https://osi-model.com/network-layer/) or non-OSI equivalent.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'ipv4', 'ipv6'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkTypeKey = attribute.Key("network.type")
+)
+
+var (
+ // GPRS
+ NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
+)
+
+var (
+ // wifi
+ NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
+ // wired
+ NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
+ // cell
+ NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
+ // unavailable
+ NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
+ // unknown
+ NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
+)
+
+var (
+ // transmit
+ NetworkIoDirectionTransmit = NetworkIoDirectionKey.String("transmit")
+ // receive
+ NetworkIoDirectionReceive = NetworkIoDirectionKey.String("receive")
+)
+
+var (
+ // TCP
+ NetworkTransportTCP = NetworkTransportKey.String("tcp")
+ // UDP
+ NetworkTransportUDP = NetworkTransportKey.String("udp")
+ // Named or anonymous pipe
+ NetworkTransportPipe = NetworkTransportKey.String("pipe")
+ // Unix domain socket
+ NetworkTransportUnix = NetworkTransportKey.String("unix")
+)
+
+var (
+ // IPv4
+ NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
+ // IPv6
+ NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
+)
+
+// NetworkCarrierIcc returns an attribute KeyValue conforming to the
+// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetworkCarrierIcc(val string) attribute.KeyValue {
+ return NetworkCarrierIccKey.String(val)
+}
+
+// NetworkCarrierMcc returns an attribute KeyValue conforming to the
+// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
+// country code.
+func NetworkCarrierMcc(val string) attribute.KeyValue {
+ return NetworkCarrierMccKey.String(val)
+}
+
+// NetworkCarrierMnc returns an attribute KeyValue conforming to the
+// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
+// network code.
+func NetworkCarrierMnc(val string) attribute.KeyValue {
+ return NetworkCarrierMncKey.String(val)
+}
+
+// NetworkCarrierName returns an attribute KeyValue conforming to the
+// "network.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetworkCarrierName(val string) attribute.KeyValue {
+ return NetworkCarrierNameKey.String(val)
+}
+
+// NetworkLocalAddress returns an attribute KeyValue conforming to the
+// "network.local.address" semantic conventions. It represents the local
+// address of the network connection - IP address or Unix domain socket name.
+func NetworkLocalAddress(val string) attribute.KeyValue {
+ return NetworkLocalAddressKey.String(val)
+}
+
+// NetworkLocalPort returns an attribute KeyValue conforming to the
+// "network.local.port" semantic conventions. It represents the local port
+// number of the network connection.
+func NetworkLocalPort(val int) attribute.KeyValue {
+ return NetworkLocalPortKey.Int(val)
+}
+
+// NetworkPeerAddress returns an attribute KeyValue conforming to the
+// "network.peer.address" semantic conventions. It represents the peer address
+// of the network connection - IP address or Unix domain socket name.
+func NetworkPeerAddress(val string) attribute.KeyValue {
+ return NetworkPeerAddressKey.String(val)
+}
+
+// NetworkPeerPort returns an attribute KeyValue conforming to the
+// "network.peer.port" semantic conventions. It represents the peer port number
+// of the network connection.
+func NetworkPeerPort(val int) attribute.KeyValue {
+ return NetworkPeerPortKey.Int(val)
+}
+
+// NetworkProtocolName returns an attribute KeyValue conforming to the
+// "network.protocol.name" semantic conventions. It represents the [OSI
+// application layer](https://osi-model.com/application-layer/) or non-OSI
+// equivalent.
+func NetworkProtocolName(val string) attribute.KeyValue {
+ return NetworkProtocolNameKey.String(val)
+}
+
+// NetworkProtocolVersion returns an attribute KeyValue conforming to the
+// "network.protocol.version" semantic conventions. It represents the version
+// of the protocol specified in `network.protocol.name`.
+func NetworkProtocolVersion(val string) attribute.KeyValue {
+ return NetworkProtocolVersionKey.String(val)
+}
+
+// Attributes for remote procedure calls.
+const (
+ // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.connect_rpc.error_code" semantic conventions. It represents the
+ // [error codes](https://connect.build/docs/protocol/#error-codes) of the
+ // Connect request. Error codes are always string values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
+
+ // RPCGRPCStatusCodeKey is the attribute Key conforming to the
+ // "rpc.grpc.status_code" semantic conventions. It represents the [numeric
+ // status
+ // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of
+ // the gRPC request.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
+
+ // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_code" semantic conventions. It represents the
+ // `error.code` property of response if it is an error response.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: -32700, 100
+ RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
+
+ // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_message" semantic conventions. It represents the
+ // `error.message` property of response if it is an error response.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Parse error', 'User already exists'
+ RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
+
+ // RPCJsonrpcRequestIDKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+ // property of request or response. Since protocol allows id to be int,
+ // string, `null` or missing (for notifications), value is expected to be
+ // cast to string for simplicity. Use empty string in case of `null` value.
+ // Omit entirely if this is a notification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '10', 'request-7', ''
+ RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
+
+ // RPCJsonrpcVersionKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+ // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+ // doesn't specify this, the value can be omitted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2.0', '1.0'
+ RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
+
+ // RPCMethodKey is the attribute Key conforming to the "rpc.method"
+ // semantic conventions. It represents the name of the (logical) method
+ // being called, must be equal to the $method part in the span name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'exampleMethod'
+ // Note: This is the logical name of the method from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // method/function. The `code.function` attribute may be used to store the
+ // latter (e.g., method actually executing the call on the server side, RPC
+ // client stub method on the client side).
+ RPCMethodKey = attribute.Key("rpc.method")
+
+ // RPCServiceKey is the attribute Key conforming to the "rpc.service"
+ // semantic conventions. It represents the full (logical) name of the
+ // service being called, including its package name, if applicable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myservice.EchoService'
+ // Note: This is the logical name of the service from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // class. The `code.namespace` attribute may be used to store the latter
+ // (despite the attribute name, it may include a class name; e.g., class
+ // with method actually executing the call on the server side, RPC client
+ // stub class on the client side).
+ RPCServiceKey = attribute.Key("rpc.service")
+
+ // RPCSystemKey is the attribute Key conforming to the "rpc.system"
+ // semantic conventions. It represents a string identifying the remoting
+ // system. See below for a list of well-known identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCSystemKey = attribute.Key("rpc.system")
+)
+
+var (
+ // cancelled
+ RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
+ // unknown
+ RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
+ // invalid_argument
+ RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
+ // deadline_exceeded
+ RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
+ // not_found
+ RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
+ // already_exists
+ RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
+ // permission_denied
+ RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
+ // resource_exhausted
+ RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
+ // failed_precondition
+ RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
+ // aborted
+ RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
+ // out_of_range
+ RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
+ // unimplemented
+ RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
+ // internal
+ RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
+ // unavailable
+ RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
+ // data_loss
+ RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
+ // unauthenticated
+ RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
+)
+
+var (
+ // OK
+ RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
+ // CANCELLED
+ RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
+ // UNKNOWN
+ RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
+ // INVALID_ARGUMENT
+ RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
+ // DEADLINE_EXCEEDED
+ RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
+ // NOT_FOUND
+ RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
+ // ALREADY_EXISTS
+ RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
+ // PERMISSION_DENIED
+ RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
+ // RESOURCE_EXHAUSTED
+ RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
+ // FAILED_PRECONDITION
+ RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
+ // ABORTED
+ RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
+ // OUT_OF_RANGE
+ RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
+ // UNIMPLEMENTED
+ RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
+ // INTERNAL
+ RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
+ // UNAVAILABLE
+ RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
+ // DATA_LOSS
+ RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
+ // UNAUTHENTICATED
+ RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
+)
+
+var (
+ // gRPC
+ RPCSystemGRPC = RPCSystemKey.String("grpc")
+ // Java RMI
+ RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
+ // .NET WCF
+ RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
+ // Apache Dubbo
+ RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
+ // Connect RPC
+ RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
+)
+
+// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_code" semantic conventions. It represents the
+// `error.code` property of response if it is an error response.
+func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
+ return RPCJsonrpcErrorCodeKey.Int(val)
+}
+
+// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_message" semantic conventions. It represents the
+// `error.message` property of response if it is an error response.
+func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
+ return RPCJsonrpcErrorMessageKey.String(val)
+}
+
+// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+// property of request or response. Since protocol allows id to be int, string,
+// `null` or missing (for notifications), value is expected to be cast to
+// string for simplicity. Use empty string in case of `null` value. Omit
+// entirely if this is a notification.
+func RPCJsonrpcRequestID(val string) attribute.KeyValue {
+ return RPCJsonrpcRequestIDKey.String(val)
+}
+
+// RPCJsonrpcVersion returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+// doesn't specify this, the value can be omitted.
+func RPCJsonrpcVersion(val string) attribute.KeyValue {
+ return RPCJsonrpcVersionKey.String(val)
+}
+
+// RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
+// semantic conventions. It represents the name of the (logical) method being
+// called, must be equal to the $method part in the span name.
+func RPCMethod(val string) attribute.KeyValue {
+ return RPCMethodKey.String(val)
+}
+
+// RPCService returns an attribute KeyValue conforming to the "rpc.service"
+// semantic conventions. It represents the full (logical) name of the service
+// being called, including its package name, if applicable.
+func RPCService(val string) attribute.KeyValue {
+ return RPCServiceKey.String(val)
+}
+
+// These attributes may be used to describe the server in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ServerAddressKey is the attribute Key conforming to the "server.address"
+ // semantic conventions. It represents the server domain name if available
+ // without reverse DNS lookup; otherwise, IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.address` SHOULD represent the server address
+ // behind any intermediaries, for example proxies, if it's available.
+ ServerAddressKey = attribute.Key("server.address")
+
+ // ServerPortKey is the attribute Key conforming to the "server.port"
+ // semantic conventions. It represents the server port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.port` SHOULD represent the server port behind
+ // any intermediaries, for example proxies, if it's available.
+ ServerPortKey = attribute.Key("server.port")
+)
+
+// ServerAddress returns an attribute KeyValue conforming to the
+// "server.address" semantic conventions. It represents the server domain name
+// if available without reverse DNS lookup; otherwise, IP address or Unix
+// domain socket name.
+func ServerAddress(val string) attribute.KeyValue {
+ return ServerAddressKey.String(val)
+}
+
+// ServerPort returns an attribute KeyValue conforming to the "server.port"
+// semantic conventions. It represents the server port number.
+func ServerPort(val int) attribute.KeyValue {
+ return ServerPortKey.Int(val)
+}
+
+// These attributes may be used to describe the sender of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // SourceAddressKey is the attribute Key conforming to the "source.address"
+ // semantic conventions. It represents the source address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'source.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the destination side, and when communicating
+ // through an intermediary, `source.address` SHOULD represent the source
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ SourceAddressKey = attribute.Key("source.address")
+
+ // SourcePortKey is the attribute Key conforming to the "source.port"
+ // semantic conventions. It represents the source port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ SourcePortKey = attribute.Key("source.port")
+)
+
+// SourceAddress returns an attribute KeyValue conforming to the
+// "source.address" semantic conventions. It represents the source address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func SourceAddress(val string) attribute.KeyValue {
+ return SourceAddressKey.String(val)
+}
+
+// SourcePort returns an attribute KeyValue conforming to the "source.port"
+// semantic conventions. It represents the source port number
+func SourcePort(val int) attribute.KeyValue {
+ return SourcePortKey.Int(val)
+}
+
+// Semantic convention attributes in the TLS namespace.
+const (
+ // TLSCipherKey is the attribute Key conforming to the "tls.cipher"
+ // semantic conventions. It represents the string indicating the
+ // [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5)
+ // used during the current connection.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TLS_RSA_WITH_3DES_EDE_CBC_SHA',
+ // 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256'
+ // Note: The values allowed for `tls.cipher` MUST be one of the
+ // `Descriptions` of the [registered TLS Cipher
+ // Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4).
+ TLSCipherKey = attribute.Key("tls.cipher")
+
+ // TLSClientCertificateKey is the attribute Key conforming to the
+ // "tls.client.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the client. This is
+ // usually mutually-exclusive of `client.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSClientCertificateKey = attribute.Key("tls.client.certificate")
+
+ // TLSClientCertificateChainKey is the attribute Key conforming to the
+ // "tls.client.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the client. This is usually mutually-exclusive of
+ // `client.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain")
+
+ // TLSClientHashMd5Key is the attribute Key conforming to the
+ // "tls.client.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5")
+
+ // TLSClientHashSha1Key is the attribute Key conforming to the
+ // "tls.client.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1")
+
+ // TLSClientHashSha256Key is the attribute Key conforming to the
+ // "tls.client.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256")
+
+ // TLSClientIssuerKey is the attribute Key conforming to the
+ // "tls.client.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSClientIssuerKey = attribute.Key("tls.client.issuer")
+
+ // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3"
+ // semantic conventions. It represents a hash that identifies clients based
+ // on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSClientJa3Key = attribute.Key("tls.client.ja3")
+
+ // TLSClientNotAfterKey is the attribute Key conforming to the
+ // "tls.client.not_after" semantic conventions. It represents the date/Time
+ // indicating when client certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSClientNotAfterKey = attribute.Key("tls.client.not_after")
+
+ // TLSClientNotBeforeKey is the attribute Key conforming to the
+ // "tls.client.not_before" semantic conventions. It represents the
+ // date/Time indicating when client certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSClientNotBeforeKey = attribute.Key("tls.client.not_before")
+
+ // TLSClientServerNameKey is the attribute Key conforming to the
+ // "tls.client.server_name" semantic conventions. It represents the also
+ // called an SNI, this tells the server which hostname to which the client
+ // is attempting to connect to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry.io'
+ TLSClientServerNameKey = attribute.Key("tls.client.server_name")
+
+ // TLSClientSubjectKey is the attribute Key conforming to the
+ // "tls.client.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myclient, OU=Documentation Team, DC=example, DC=com'
+ TLSClientSubjectKey = attribute.Key("tls.client.subject")
+
+ // TLSClientSupportedCiphersKey is the attribute Key conforming to the
+ // "tls.client.supported_ciphers" semantic conventions. It represents the
+ // array of ciphers offered by the client during the client hello.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+ // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."'
+ TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers")
+
+ // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic
+ // conventions. It represents the string indicating the curve used for the
+ // given cipher, when applicable
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'secp256r1'
+ TLSCurveKey = attribute.Key("tls.curve")
+
+ // TLSEstablishedKey is the attribute Key conforming to the
+ // "tls.established" semantic conventions. It represents the boolean flag
+ // indicating if the TLS negotiation was successful and transitioned to an
+ // encrypted tunnel.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSEstablishedKey = attribute.Key("tls.established")
+
+ // TLSNextProtocolKey is the attribute Key conforming to the
+ // "tls.next_protocol" semantic conventions. It represents the string
+ // indicating the protocol being tunneled. Per the values in the [IANA
+ // registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+ // this string should be lower case.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'http/1.1'
+ TLSNextProtocolKey = attribute.Key("tls.next_protocol")
+
+ // TLSProtocolNameKey is the attribute Key conforming to the
+ // "tls.protocol.name" semantic conventions. It represents the normalized
+ // lowercase protocol name parsed from original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ TLSProtocolNameKey = attribute.Key("tls.protocol.name")
+
+ // TLSProtocolVersionKey is the attribute Key conforming to the
+ // "tls.protocol.version" semantic conventions. It represents the numeric
+ // part of the version parsed from the original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2', '3'
+ TLSProtocolVersionKey = attribute.Key("tls.protocol.version")
+
+ // TLSResumedKey is the attribute Key conforming to the "tls.resumed"
+ // semantic conventions. It represents the boolean flag indicating if this
+ // TLS connection was resumed from an existing TLS negotiation.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSResumedKey = attribute.Key("tls.resumed")
+
+ // TLSServerCertificateKey is the attribute Key conforming to the
+ // "tls.server.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the server. This is
+ // usually mutually-exclusive of `server.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSServerCertificateKey = attribute.Key("tls.server.certificate")
+
+ // TLSServerCertificateChainKey is the attribute Key conforming to the
+ // "tls.server.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the server. This is usually mutually-exclusive of
+ // `server.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain")
+
+ // TLSServerHashMd5Key is the attribute Key conforming to the
+ // "tls.server.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5")
+
+ // TLSServerHashSha1Key is the attribute Key conforming to the
+ // "tls.server.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1")
+
+ // TLSServerHashSha256Key is the attribute Key conforming to the
+ // "tls.server.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256")
+
+ // TLSServerIssuerKey is the attribute Key conforming to the
+ // "tls.server.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSServerIssuerKey = attribute.Key("tls.server.issuer")
+
+ // TLSServerJa3sKey is the attribute Key conforming to the
+ // "tls.server.ja3s" semantic conventions. It represents a hash that
+ // identifies servers based on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSServerJa3sKey = attribute.Key("tls.server.ja3s")
+
+ // TLSServerNotAfterKey is the attribute Key conforming to the
+ // "tls.server.not_after" semantic conventions. It represents the date/Time
+ // indicating when server certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSServerNotAfterKey = attribute.Key("tls.server.not_after")
+
+ // TLSServerNotBeforeKey is the attribute Key conforming to the
+ // "tls.server.not_before" semantic conventions. It represents the
+ // date/Time indicating when server certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSServerNotBeforeKey = attribute.Key("tls.server.not_before")
+
+ // TLSServerSubjectKey is the attribute Key conforming to the
+ // "tls.server.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // server.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myserver, OU=Documentation Team, DC=example, DC=com'
+ TLSServerSubjectKey = attribute.Key("tls.server.subject")
+)
+
+var (
+ // ssl
+ TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl")
+ // tls
+ TLSProtocolNameTLS = TLSProtocolNameKey.String("tls")
+)
+
+// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher"
+// semantic conventions. It represents the string indicating the
+// [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used
+// during the current connection.
+func TLSCipher(val string) attribute.KeyValue {
+ return TLSCipherKey.String(val)
+}
+
+// TLSClientCertificate returns an attribute KeyValue conforming to the
+// "tls.client.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the client. This is usually
+// mutually-exclusive of `client.certificate_chain` since this value also
+// exists in that list.
+func TLSClientCertificate(val string) attribute.KeyValue {
+ return TLSClientCertificateKey.String(val)
+}
+
+// TLSClientCertificateChain returns an attribute KeyValue conforming to the
+// "tls.client.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the client. This is usually mutually-exclusive of `client.certificate` since
+// that value should be the first certificate in the chain.
+func TLSClientCertificateChain(val ...string) attribute.KeyValue {
+ return TLSClientCertificateChainKey.StringSlice(val)
+}
+
+// TLSClientHashMd5 returns an attribute KeyValue conforming to the
+// "tls.client.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashMd5(val string) attribute.KeyValue {
+ return TLSClientHashMd5Key.String(val)
+}
+
+// TLSClientHashSha1 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha1(val string) attribute.KeyValue {
+ return TLSClientHashSha1Key.String(val)
+}
+
+// TLSClientHashSha256 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha256(val string) attribute.KeyValue {
+ return TLSClientHashSha256Key.String(val)
+}
+
+// TLSClientIssuer returns an attribute KeyValue conforming to the
+// "tls.client.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSClientIssuer(val string) attribute.KeyValue {
+ return TLSClientIssuerKey.String(val)
+}
+
+// TLSClientJa3 returns an attribute KeyValue conforming to the
+// "tls.client.ja3" semantic conventions. It represents a hash that identifies
+// clients based on how they perform an SSL/TLS handshake.
+func TLSClientJa3(val string) attribute.KeyValue {
+ return TLSClientJa3Key.String(val)
+}
+
+// TLSClientNotAfter returns an attribute KeyValue conforming to the
+// "tls.client.not_after" semantic conventions. It represents the date/Time
+// indicating when client certificate is no longer considered valid.
+func TLSClientNotAfter(val string) attribute.KeyValue {
+ return TLSClientNotAfterKey.String(val)
+}
+
+// TLSClientNotBefore returns an attribute KeyValue conforming to the
+// "tls.client.not_before" semantic conventions. It represents the date/Time
+// indicating when client certificate is first considered valid.
+func TLSClientNotBefore(val string) attribute.KeyValue {
+ return TLSClientNotBeforeKey.String(val)
+}
+
+// TLSClientServerName returns an attribute KeyValue conforming to the
+// "tls.client.server_name" semantic conventions. It represents the also called
+// an SNI, this tells the server which hostname to which the client is
+// attempting to connect to.
+func TLSClientServerName(val string) attribute.KeyValue {
+ return TLSClientServerNameKey.String(val)
+}
+
+// TLSClientSubject returns an attribute KeyValue conforming to the
+// "tls.client.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the client.
+func TLSClientSubject(val string) attribute.KeyValue {
+ return TLSClientSubjectKey.String(val)
+}
+
+// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the
+// "tls.client.supported_ciphers" semantic conventions. It represents the array
+// of ciphers offered by the client during the client hello.
+func TLSClientSupportedCiphers(val ...string) attribute.KeyValue {
+ return TLSClientSupportedCiphersKey.StringSlice(val)
+}
+
+// TLSCurve returns an attribute KeyValue conforming to the "tls.curve"
+// semantic conventions. It represents the string indicating the curve used for
+// the given cipher, when applicable
+func TLSCurve(val string) attribute.KeyValue {
+ return TLSCurveKey.String(val)
+}
+
+// TLSEstablished returns an attribute KeyValue conforming to the
+// "tls.established" semantic conventions. It represents the boolean flag
+// indicating if the TLS negotiation was successful and transitioned to an
+// encrypted tunnel.
+func TLSEstablished(val bool) attribute.KeyValue {
+ return TLSEstablishedKey.Bool(val)
+}
+
+// TLSNextProtocol returns an attribute KeyValue conforming to the
+// "tls.next_protocol" semantic conventions. It represents the string
+// indicating the protocol being tunneled. Per the values in the [IANA
+// registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+// this string should be lower case.
+func TLSNextProtocol(val string) attribute.KeyValue {
+ return TLSNextProtocolKey.String(val)
+}
+
+// TLSProtocolVersion returns an attribute KeyValue conforming to the
+// "tls.protocol.version" semantic conventions. It represents the numeric part
+// of the version parsed from the original string of the negotiated [SSL/TLS
+// protocol
+// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+func TLSProtocolVersion(val string) attribute.KeyValue {
+ return TLSProtocolVersionKey.String(val)
+}
+
+// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed"
+// semantic conventions. It represents the boolean flag indicating if this TLS
+// connection was resumed from an existing TLS negotiation.
+func TLSResumed(val bool) attribute.KeyValue {
+ return TLSResumedKey.Bool(val)
+}
+
+// TLSServerCertificate returns an attribute KeyValue conforming to the
+// "tls.server.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the server. This is usually
+// mutually-exclusive of `server.certificate_chain` since this value also
+// exists in that list.
+func TLSServerCertificate(val string) attribute.KeyValue {
+ return TLSServerCertificateKey.String(val)
+}
+
+// TLSServerCertificateChain returns an attribute KeyValue conforming to the
+// "tls.server.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the server. This is usually mutually-exclusive of `server.certificate` since
+// that value should be the first certificate in the chain.
+func TLSServerCertificateChain(val ...string) attribute.KeyValue {
+ return TLSServerCertificateChainKey.StringSlice(val)
+}
+
+// TLSServerHashMd5 returns an attribute KeyValue conforming to the
+// "tls.server.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashMd5(val string) attribute.KeyValue {
+ return TLSServerHashMd5Key.String(val)
+}
+
+// TLSServerHashSha1 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha1(val string) attribute.KeyValue {
+ return TLSServerHashSha1Key.String(val)
+}
+
+// TLSServerHashSha256 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha256(val string) attribute.KeyValue {
+ return TLSServerHashSha256Key.String(val)
+}
+
+// TLSServerIssuer returns an attribute KeyValue conforming to the
+// "tls.server.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSServerIssuer(val string) attribute.KeyValue {
+ return TLSServerIssuerKey.String(val)
+}
+
+// TLSServerJa3s returns an attribute KeyValue conforming to the
+// "tls.server.ja3s" semantic conventions. It represents a hash that identifies
+// servers based on how they perform an SSL/TLS handshake.
+func TLSServerJa3s(val string) attribute.KeyValue {
+ return TLSServerJa3sKey.String(val)
+}
+
+// TLSServerNotAfter returns an attribute KeyValue conforming to the
+// "tls.server.not_after" semantic conventions. It represents the date/Time
+// indicating when server certificate is no longer considered valid.
+func TLSServerNotAfter(val string) attribute.KeyValue {
+ return TLSServerNotAfterKey.String(val)
+}
+
+// TLSServerNotBefore returns an attribute KeyValue conforming to the
+// "tls.server.not_before" semantic conventions. It represents the date/Time
+// indicating when server certificate is first considered valid.
+func TLSServerNotBefore(val string) attribute.KeyValue {
+ return TLSServerNotBeforeKey.String(val)
+}
+
+// TLSServerSubject returns an attribute KeyValue conforming to the
+// "tls.server.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the server.
+func TLSServerSubject(val string) attribute.KeyValue {
+ return TLSServerSubjectKey.String(val)
+}
+
+// Attributes describing URL.
+const (
+ // URLFragmentKey is the attribute Key conforming to the "url.fragment"
+ // semantic conventions. It represents the [URI
+ // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'SemConv'
+ URLFragmentKey = attribute.Key("url.fragment")
+
+ // URLFullKey is the attribute Key conforming to the "url.full" semantic
+ // conventions. It represents the absolute URL describing a network
+ // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // '//localhost'
+ // Note: For network calls, URL usually has
+ // `scheme://host[:port][path][?query][#fragment]` format, where the
+ // fragment is not transmitted over HTTP, but if it is known, it SHOULD be
+ // included nevertheless.
+ // `url.full` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case username and
+ // password SHOULD be redacted and attribute's value SHOULD be
+ // `https://REDACTED:REDACTED@www.example.com/`.
+ // `url.full` SHOULD capture the absolute URL when it is available (or can
+ // be reconstructed) and SHOULD NOT be validated or modified except for
+ // sanitizing purposes.
+ URLFullKey = attribute.Key("url.full")
+
+ // URLPathKey is the attribute Key conforming to the "url.path" semantic
+ // conventions. It represents the [URI
+ // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/search'
+ URLPathKey = attribute.Key("url.path")
+
+ // URLQueryKey is the attribute Key conforming to the "url.query" semantic
+ // conventions. It represents the [URI
+ // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'q=OpenTelemetry'
+ // Note: Sensitive content provided in query string SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLQueryKey = attribute.Key("url.query")
+
+ // URLSchemeKey is the attribute Key conforming to the "url.scheme"
+ // semantic conventions. It represents the [URI
+ // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+ // identifying the used protocol.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https', 'ftp', 'telnet'
+ URLSchemeKey = attribute.Key("url.scheme")
+)
+
+// URLFragment returns an attribute KeyValue conforming to the
+// "url.fragment" semantic conventions. It represents the [URI
+// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+func URLFragment(val string) attribute.KeyValue {
+ return URLFragmentKey.String(val)
+}
+
+// URLFull returns an attribute KeyValue conforming to the "url.full"
+// semantic conventions. It represents the absolute URL describing a network
+// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+func URLFull(val string) attribute.KeyValue {
+ return URLFullKey.String(val)
+}
+
+// URLPath returns an attribute KeyValue conforming to the "url.path"
+// semantic conventions. It represents the [URI
+// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+func URLPath(val string) attribute.KeyValue {
+ return URLPathKey.String(val)
+}
+
+// URLQuery returns an attribute KeyValue conforming to the "url.query"
+// semantic conventions. It represents the [URI
+// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+func URLQuery(val string) attribute.KeyValue {
+ return URLQueryKey.String(val)
+}
+
+// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
+// semantic conventions. It represents the [URI
+// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+// identifying the used protocol.
+func URLScheme(val string) attribute.KeyValue {
+ return URLSchemeKey.String(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+)
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
+
+// Session is defined as the period of time encompassing all activities
+// performed by the application and the actions executed by the end user.
+// Consequently, a Session is represented as a collection of Logs, Events, and
+// Spans emitted by the Client Application throughout the Session's duration.
+// Each Session is assigned a unique identifier, which is included as an
+// attribute in the Logs, Events, and Spans generated during the Session's
+// lifecycle.
+// When a session reaches end of life, typically due to user inactivity or
+// session timeout, a new session identifier will be assigned. The previous
+// session identifier may be provided by the instrumentation so that telemetry
+// backends can link the two sessions.
+const (
+ // SessionIDKey is the attribute Key conforming to the "session.id"
+ // semantic conventions. It represents a unique id to identify a session.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionIDKey = attribute.Key("session.id")
+
+ // SessionPreviousIDKey is the attribute Key conforming to the
+ // "session.previous_id" semantic conventions. It represents the previous
+ // `session.id` for this user, when known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionPreviousIDKey = attribute.Key("session.previous_id")
+)
+
+// SessionID returns an attribute KeyValue conforming to the "session.id"
+// semantic conventions. It represents a unique id to identify a session.
+func SessionID(val string) attribute.KeyValue {
+ return SessionIDKey.String(val)
+}
+
+// SessionPreviousID returns an attribute KeyValue conforming to the
+// "session.previous_id" semantic conventions. It represents the previous
+// `session.id` for this user, when known.
+func SessionPreviousID(val string) attribute.KeyValue {
+ return SessionPreviousIDKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go
new file mode 100644
index 00000000000..d27e8a8f8b3
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the v1.24.0
+// version of the OpenTelemetry semantic conventions.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go
new file mode 100644
index 00000000000..6c019aafc3e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go
@@ -0,0 +1,200 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// This event represents an occurrence of a lifecycle transition on the iOS
+// platform.
+const (
+ // IosStateKey is the attribute Key conforming to the "ios.state" semantic
+ // conventions. It represents the this attribute represents the state the
+ // application has transitioned into at the occurrence of the event.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Note: The iOS lifecycle states are defined in the [UIApplicationDelegate
+ // documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902),
+ // and from which the `OS terminology` column values are derived.
+ IosStateKey = attribute.Key("ios.state")
+)
+
+var (
+ // The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`
+ IosStateActive = IosStateKey.String("active")
+ // The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`
+ IosStateInactive = IosStateKey.String("inactive")
+ // The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`
+ IosStateBackground = IosStateKey.String("background")
+ // The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`
+ IosStateForeground = IosStateKey.String("foreground")
+ // The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`
+ IosStateTerminate = IosStateKey.String("terminate")
+)
+
+// This event represents an occurrence of a lifecycle transition on the Android
+// platform.
+const (
+ // AndroidStateKey is the attribute Key conforming to the "android.state"
+ // semantic conventions. It represents the this attribute represents the
+ // state the application has transitioned into at the occurrence of the
+ // event.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Note: The Android lifecycle states are defined in [Activity lifecycle
+ // callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc),
+ // and from which the `OS identifiers` are derived.
+ AndroidStateKey = attribute.Key("android.state")
+)
+
+var (
+ // Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time
+ AndroidStateCreated = AndroidStateKey.String("created")
+ // Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state
+ AndroidStateBackground = AndroidStateKey.String("background")
+ // Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states
+ AndroidStateForeground = AndroidStateKey.String("foreground")
+)
+
+// This semantic convention defines the attributes used to represent a feature
+// flag evaluation as an event.
+const (
+ // FeatureFlagKeyKey is the attribute Key conforming to the
+ // "feature_flag.key" semantic conventions. It represents the unique
+ // identifier of the feature flag.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'logo-color'
+ FeatureFlagKeyKey = attribute.Key("feature_flag.key")
+
+ // FeatureFlagProviderNameKey is the attribute Key conforming to the
+ // "feature_flag.provider_name" semantic conventions. It represents the
+ // name of the service provider that performs the flag evaluation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'Flag Manager'
+ FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name")
+
+ // FeatureFlagVariantKey is the attribute Key conforming to the
+ // "feature_flag.variant" semantic conventions. It represents the sHOULD be
+ // a semantic identifier for a value. If one is unavailable, a stringified
+ // version of the value can be used.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'red', 'true', 'on'
+ // Note: A semantic identifier, commonly referred to as a variant, provides
+ // a means
+ // for referring to a value without including the value itself. This can
+ // provide additional context for understanding the meaning behind a value.
+ // For example, the variant `red` maybe be used for the value `#c05543`.
+ //
+ // A stringified version of the value can be used in situations where a
+ // semantic identifier is unavailable. String representation of the value
+ // should be determined by the implementer.
+ FeatureFlagVariantKey = attribute.Key("feature_flag.variant")
+)
+
+// FeatureFlagKey returns an attribute KeyValue conforming to the
+// "feature_flag.key" semantic conventions. It represents the unique identifier
+// of the feature flag.
+func FeatureFlagKey(val string) attribute.KeyValue {
+ return FeatureFlagKeyKey.String(val)
+}
+
+// FeatureFlagProviderName returns an attribute KeyValue conforming to the
+// "feature_flag.provider_name" semantic conventions. It represents the name of
+// the service provider that performs the flag evaluation.
+func FeatureFlagProviderName(val string) attribute.KeyValue {
+ return FeatureFlagProviderNameKey.String(val)
+}
+
+// FeatureFlagVariant returns an attribute KeyValue conforming to the
+// "feature_flag.variant" semantic conventions. It represents the sHOULD be a
+// semantic identifier for a value. If one is unavailable, a stringified
+// version of the value can be used.
+func FeatureFlagVariant(val string) attribute.KeyValue {
+ return FeatureFlagVariantKey.String(val)
+}
+
+// RPC received/sent message.
+const (
+ // MessageCompressedSizeKey is the attribute Key conforming to the
+ // "message.compressed_size" semantic conventions. It represents the
+ // compressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessageCompressedSizeKey = attribute.Key("message.compressed_size")
+
+ // MessageIDKey is the attribute Key conforming to the "message.id"
+ // semantic conventions. It represents the mUST be calculated as two
+ // different counters starting from `1` one for sent messages and one for
+ // received message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This way we guarantee that the values will be consistent between
+ // different implementations.
+ MessageIDKey = attribute.Key("message.id")
+
+ // MessageTypeKey is the attribute Key conforming to the "message.type"
+ // semantic conventions. It represents the whether this is a received or
+ // sent message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessageTypeKey = attribute.Key("message.type")
+
+ // MessageUncompressedSizeKey is the attribute Key conforming to the
+ // "message.uncompressed_size" semantic conventions. It represents the
+ // uncompressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
+)
+
+var (
+ // sent
+ MessageTypeSent = MessageTypeKey.String("SENT")
+ // received
+ MessageTypeReceived = MessageTypeKey.String("RECEIVED")
+)
+
+// MessageCompressedSize returns an attribute KeyValue conforming to the
+// "message.compressed_size" semantic conventions. It represents the compressed
+// size of the message in bytes.
+func MessageCompressedSize(val int) attribute.KeyValue {
+ return MessageCompressedSizeKey.Int(val)
+}
+
+// MessageID returns an attribute KeyValue conforming to the "message.id"
+// semantic conventions. It represents the mUST be calculated as two different
+// counters starting from `1` one for sent messages and one for received
+// message.
+func MessageID(val int) attribute.KeyValue {
+ return MessageIDKey.Int(val)
+}
+
+// MessageUncompressedSize returns an attribute KeyValue conforming to the
+// "message.uncompressed_size" semantic conventions. It represents the
+// uncompressed size of the message in bytes.
+func MessageUncompressedSize(val int) attribute.KeyValue {
+ return MessageUncompressedSizeKey.Int(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go
new file mode 100644
index 00000000000..7235bb51d9a
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go
new file mode 100644
index 00000000000..a6b953f625e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go
@@ -0,0 +1,1071 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+const (
+
+ // DBClientConnectionsUsage is the metric conforming to the
+ // "db.client.connections.usage" semantic conventions. It represents the number
+ // of connections that are currently in state described by the `state`
+ // attribute.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsUsageName = "db.client.connections.usage"
+ DBClientConnectionsUsageUnit = "{connection}"
+ DBClientConnectionsUsageDescription = "The number of connections that are currently in state described by the `state` attribute"
+
+ // DBClientConnectionsIdleMax is the metric conforming to the
+ // "db.client.connections.idle.max" semantic conventions. It represents the
+ // maximum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMaxName = "db.client.connections.idle.max"
+ DBClientConnectionsIdleMaxUnit = "{connection}"
+ DBClientConnectionsIdleMaxDescription = "The maximum number of idle open connections allowed"
+
+ // DBClientConnectionsIdleMin is the metric conforming to the
+ // "db.client.connections.idle.min" semantic conventions. It represents the
+ // minimum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMinName = "db.client.connections.idle.min"
+ DBClientConnectionsIdleMinUnit = "{connection}"
+ DBClientConnectionsIdleMinDescription = "The minimum number of idle open connections allowed"
+
+ // DBClientConnectionsMax is the metric conforming to the
+ // "db.client.connections.max" semantic conventions. It represents the maximum
+ // number of open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsMaxName = "db.client.connections.max"
+ DBClientConnectionsMaxUnit = "{connection}"
+ DBClientConnectionsMaxDescription = "The maximum number of open connections allowed"
+
+ // DBClientConnectionsPendingRequests is the metric conforming to the
+ // "db.client.connections.pending_requests" semantic conventions. It represents
+ // the number of pending requests for an open connection, cumulative for the
+ // entire pool.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionsPendingRequestsName = "db.client.connections.pending_requests"
+ DBClientConnectionsPendingRequestsUnit = "{request}"
+ DBClientConnectionsPendingRequestsDescription = "The number of pending requests for an open connection, cumulative for the entire pool"
+
+ // DBClientConnectionsTimeouts is the metric conforming to the
+ // "db.client.connections.timeouts" semantic conventions. It represents the
+ // number of connection timeouts that have occurred trying to obtain a
+ // connection from the pool.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionsTimeoutsName = "db.client.connections.timeouts"
+ DBClientConnectionsTimeoutsUnit = "{timeout}"
+ DBClientConnectionsTimeoutsDescription = "The number of connection timeouts that have occurred trying to obtain a connection from the pool"
+
+ // DBClientConnectionsCreateTime is the metric conforming to the
+ // "db.client.connections.create_time" semantic conventions. It represents the
+ // time it took to create a new connection.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsCreateTimeName = "db.client.connections.create_time"
+ DBClientConnectionsCreateTimeUnit = "ms"
+ DBClientConnectionsCreateTimeDescription = "The time it took to create a new connection"
+
+ // DBClientConnectionsWaitTime is the metric conforming to the
+ // "db.client.connections.wait_time" semantic conventions. It represents the
+ // time it took to obtain an open connection from the pool.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsWaitTimeName = "db.client.connections.wait_time"
+ DBClientConnectionsWaitTimeUnit = "ms"
+ DBClientConnectionsWaitTimeDescription = "The time it took to obtain an open connection from the pool"
+
+ // DBClientConnectionsUseTime is the metric conforming to the
+ // "db.client.connections.use_time" semantic conventions. It represents the
+ // time between borrowing a connection and returning it to the pool.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsUseTimeName = "db.client.connections.use_time"
+ DBClientConnectionsUseTimeUnit = "ms"
+ DBClientConnectionsUseTimeDescription = "The time between borrowing a connection and returning it to the pool"
+
+ // AspnetcoreRoutingMatchAttempts is the metric conforming to the
+ // "aspnetcore.routing.match_attempts" semantic conventions. It represents the
+ // number of requests that were attempted to be matched to an endpoint.
+ // Instrument: counter
+ // Unit: {match_attempt}
+ // Stability: Experimental
+ AspnetcoreRoutingMatchAttemptsName = "aspnetcore.routing.match_attempts"
+ AspnetcoreRoutingMatchAttemptsUnit = "{match_attempt}"
+ AspnetcoreRoutingMatchAttemptsDescription = "Number of requests that were attempted to be matched to an endpoint."
+
+ // AspnetcoreDiagnosticsExceptions is the metric conforming to the
+ // "aspnetcore.diagnostics.exceptions" semantic conventions. It represents the
+ // number of exceptions caught by exception handling middleware.
+ // Instrument: counter
+ // Unit: {exception}
+ // Stability: Experimental
+ AspnetcoreDiagnosticsExceptionsName = "aspnetcore.diagnostics.exceptions"
+ AspnetcoreDiagnosticsExceptionsUnit = "{exception}"
+ AspnetcoreDiagnosticsExceptionsDescription = "Number of exceptions caught by exception handling middleware."
+
+ // AspnetcoreRateLimitingActiveRequestLeases is the metric conforming to the
+ // "aspnetcore.rate_limiting.active_request_leases" semantic conventions. It
+ // represents the number of requests that are currently active on the server
+ // that hold a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ AspnetcoreRateLimitingActiveRequestLeasesName = "aspnetcore.rate_limiting.active_request_leases"
+ AspnetcoreRateLimitingActiveRequestLeasesUnit = "{request}"
+ AspnetcoreRateLimitingActiveRequestLeasesDescription = "Number of requests that are currently active on the server that hold a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequestLeaseDuration is the metric conforming to the
+ // "aspnetcore.rate_limiting.request_lease.duration" semantic conventions. It
+ // represents the duration of rate limiting lease held by requests on the
+ // server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ AspnetcoreRateLimitingRequestLeaseDurationName = "aspnetcore.rate_limiting.request_lease.duration"
+ AspnetcoreRateLimitingRequestLeaseDurationUnit = "s"
+ AspnetcoreRateLimitingRequestLeaseDurationDescription = "The duration of rate limiting lease held by requests on the server."
+
+ // AspnetcoreRateLimitingRequestTimeInQueue is the metric conforming to the
+ // "aspnetcore.rate_limiting.request.time_in_queue" semantic conventions. It
+ // represents the time the request spent in a queue waiting to acquire a rate
+ // limiting lease.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ AspnetcoreRateLimitingRequestTimeInQueueName = "aspnetcore.rate_limiting.request.time_in_queue"
+ AspnetcoreRateLimitingRequestTimeInQueueUnit = "s"
+ AspnetcoreRateLimitingRequestTimeInQueueDescription = "The time the request spent in a queue waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingQueuedRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.queued_requests" semantic conventions. It
+ // represents the number of requests that are currently queued, waiting to
+ // acquire a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ AspnetcoreRateLimitingQueuedRequestsName = "aspnetcore.rate_limiting.queued_requests"
+ AspnetcoreRateLimitingQueuedRequestsUnit = "{request}"
+ AspnetcoreRateLimitingQueuedRequestsDescription = "Number of requests that are currently queued, waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.requests" semantic conventions. It represents the
+ // number of requests that tried to acquire a rate limiting lease.
+ // Instrument: counter
+ // Unit: {request}
+ // Stability: Experimental
+ AspnetcoreRateLimitingRequestsName = "aspnetcore.rate_limiting.requests"
+ AspnetcoreRateLimitingRequestsUnit = "{request}"
+ AspnetcoreRateLimitingRequestsDescription = "Number of requests that tried to acquire a rate limiting lease."
+
+ // DNSLookupDuration is the metric conforming to the "dns.lookup.duration"
+ // semantic conventions. It represents the measures the time taken to perform a
+ // DNS lookup.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DNSLookupDurationName = "dns.lookup.duration"
+ DNSLookupDurationUnit = "s"
+ DNSLookupDurationDescription = "Measures the time taken to perform a DNS lookup."
+
+ // HTTPClientOpenConnections is the metric conforming to the
+ // "http.client.open_connections" semantic conventions. It represents the
+ // number of outbound HTTP connections that are currently active or idle on the
+ // client.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ HTTPClientOpenConnectionsName = "http.client.open_connections"
+ HTTPClientOpenConnectionsUnit = "{connection}"
+ HTTPClientOpenConnectionsDescription = "Number of outbound HTTP connections that are currently active or idle on the client."
+
+ // HTTPClientConnectionDuration is the metric conforming to the
+ // "http.client.connection.duration" semantic conventions. It represents the
+ // duration of the successfully established outbound HTTP connections.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ HTTPClientConnectionDurationName = "http.client.connection.duration"
+ HTTPClientConnectionDurationUnit = "s"
+ HTTPClientConnectionDurationDescription = "The duration of the successfully established outbound HTTP connections."
+
+ // HTTPClientActiveRequests is the metric conforming to the
+ // "http.client.active_requests" semantic conventions. It represents the number
+ // of active HTTP requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPClientActiveRequestsName = "http.client.active_requests"
+ HTTPClientActiveRequestsUnit = "{request}"
+ HTTPClientActiveRequestsDescription = "Number of active HTTP requests."
+
+ // HTTPClientRequestTimeInQueue is the metric conforming to the
+ // "http.client.request.time_in_queue" semantic conventions. It represents the
+ // amount of time requests spent on a queue waiting for an available
+ // connection.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ HTTPClientRequestTimeInQueueName = "http.client.request.time_in_queue"
+ HTTPClientRequestTimeInQueueUnit = "s"
+ HTTPClientRequestTimeInQueueDescription = "The amount of time requests spent on a queue waiting for an available connection."
+
+ // KestrelActiveConnections is the metric conforming to the
+ // "kestrel.active_connections" semantic conventions. It represents the number
+ // of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelActiveConnectionsName = "kestrel.active_connections"
+ KestrelActiveConnectionsUnit = "{connection}"
+ KestrelActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // KestrelConnectionDuration is the metric conforming to the
+ // "kestrel.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ KestrelConnectionDurationName = "kestrel.connection.duration"
+ KestrelConnectionDurationUnit = "s"
+ KestrelConnectionDurationDescription = "The duration of connections on the server."
+
+ // KestrelRejectedConnections is the metric conforming to the
+ // "kestrel.rejected_connections" semantic conventions. It represents the
+ // number of connections rejected by the server.
+ // Instrument: counter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelRejectedConnectionsName = "kestrel.rejected_connections"
+ KestrelRejectedConnectionsUnit = "{connection}"
+ KestrelRejectedConnectionsDescription = "Number of connections rejected by the server."
+
+ // KestrelQueuedConnections is the metric conforming to the
+ // "kestrel.queued_connections" semantic conventions. It represents the number
+ // of connections that are currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelQueuedConnectionsName = "kestrel.queued_connections"
+ KestrelQueuedConnectionsUnit = "{connection}"
+ KestrelQueuedConnectionsDescription = "Number of connections that are currently queued and are waiting to start."
+
+ // KestrelQueuedRequests is the metric conforming to the
+ // "kestrel.queued_requests" semantic conventions. It represents the number of
+ // HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are
+ // currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ KestrelQueuedRequestsName = "kestrel.queued_requests"
+ KestrelQueuedRequestsUnit = "{request}"
+ KestrelQueuedRequestsDescription = "Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start."
+
+ // KestrelUpgradedConnections is the metric conforming to the
+ // "kestrel.upgraded_connections" semantic conventions. It represents the
+ // number of connections that are currently upgraded (WebSockets). .
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelUpgradedConnectionsName = "kestrel.upgraded_connections"
+ KestrelUpgradedConnectionsUnit = "{connection}"
+ KestrelUpgradedConnectionsDescription = "Number of connections that are currently upgraded (WebSockets). ."
+
+ // KestrelTLSHandshakeDuration is the metric conforming to the
+ // "kestrel.tls_handshake.duration" semantic conventions. It represents the
+ // duration of TLS handshakes on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ KestrelTLSHandshakeDurationName = "kestrel.tls_handshake.duration"
+ KestrelTLSHandshakeDurationUnit = "s"
+ KestrelTLSHandshakeDurationDescription = "The duration of TLS handshakes on the server."
+
+ // KestrelActiveTLSHandshakes is the metric conforming to the
+ // "kestrel.active_tls_handshakes" semantic conventions. It represents the
+ // number of TLS handshakes that are currently in progress on the server.
+ // Instrument: updowncounter
+ // Unit: {handshake}
+ // Stability: Experimental
+ KestrelActiveTLSHandshakesName = "kestrel.active_tls_handshakes"
+ KestrelActiveTLSHandshakesUnit = "{handshake}"
+ KestrelActiveTLSHandshakesDescription = "Number of TLS handshakes that are currently in progress on the server."
+
+ // SignalrServerConnectionDuration is the metric conforming to the
+ // "signalr.server.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ SignalrServerConnectionDurationName = "signalr.server.connection.duration"
+ SignalrServerConnectionDurationUnit = "s"
+ SignalrServerConnectionDurationDescription = "The duration of connections on the server."
+
+ // SignalrServerActiveConnections is the metric conforming to the
+ // "signalr.server.active_connections" semantic conventions. It represents the
+ // number of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ SignalrServerActiveConnectionsName = "signalr.server.active_connections"
+ SignalrServerActiveConnectionsUnit = "{connection}"
+ SignalrServerActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // FaaSInvokeDuration is the metric conforming to the "faas.invoke_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's logic execution.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInvokeDurationName = "faas.invoke_duration"
+ FaaSInvokeDurationUnit = "s"
+ FaaSInvokeDurationDescription = "Measures the duration of the function's logic execution"
+
+ // FaaSInitDuration is the metric conforming to the "faas.init_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's initialization, such as a cold start.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInitDurationName = "faas.init_duration"
+ FaaSInitDurationUnit = "s"
+ FaaSInitDurationDescription = "Measures the duration of the function's initialization, such as a cold start"
+
+ // FaaSColdstarts is the metric conforming to the "faas.coldstarts" semantic
+ // conventions. It represents the number of invocation cold starts.
+ // Instrument: counter
+ // Unit: {coldstart}
+ // Stability: Experimental
+ FaaSColdstartsName = "faas.coldstarts"
+ FaaSColdstartsUnit = "{coldstart}"
+ FaaSColdstartsDescription = "Number of invocation cold starts"
+
+ // FaaSErrors is the metric conforming to the "faas.errors" semantic
+ // conventions. It represents the number of invocation errors.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ FaaSErrorsName = "faas.errors"
+ FaaSErrorsUnit = "{error}"
+ FaaSErrorsDescription = "Number of invocation errors"
+
+ // FaaSInvocations is the metric conforming to the "faas.invocations" semantic
+ // conventions. It represents the number of successful invocations.
+ // Instrument: counter
+ // Unit: {invocation}
+ // Stability: Experimental
+ FaaSInvocationsName = "faas.invocations"
+ FaaSInvocationsUnit = "{invocation}"
+ FaaSInvocationsDescription = "Number of successful invocations"
+
+ // FaaSTimeouts is the metric conforming to the "faas.timeouts" semantic
+ // conventions. It represents the number of invocation timeouts.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ FaaSTimeoutsName = "faas.timeouts"
+ FaaSTimeoutsUnit = "{timeout}"
+ FaaSTimeoutsDescription = "Number of invocation timeouts"
+
+ // FaaSMemUsage is the metric conforming to the "faas.mem_usage" semantic
+ // conventions. It represents the distribution of max memory usage per
+ // invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSMemUsageName = "faas.mem_usage"
+ FaaSMemUsageUnit = "By"
+ FaaSMemUsageDescription = "Distribution of max memory usage per invocation"
+
+ // FaaSCPUUsage is the metric conforming to the "faas.cpu_usage" semantic
+ // conventions. It represents the distribution of CPU usage per invocation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSCPUUsageName = "faas.cpu_usage"
+ FaaSCPUUsageUnit = "s"
+ FaaSCPUUsageDescription = "Distribution of CPU usage per invocation"
+
+ // FaaSNetIo is the metric conforming to the "faas.net_io" semantic
+ // conventions. It represents the distribution of net I/O usage per invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSNetIoName = "faas.net_io"
+ FaaSNetIoUnit = "By"
+ FaaSNetIoDescription = "Distribution of net I/O usage per invocation"
+
+ // HTTPServerRequestDuration is the metric conforming to the
+ // "http.server.request.duration" semantic conventions. It represents the
+ // duration of HTTP server requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPServerRequestDurationName = "http.server.request.duration"
+ HTTPServerRequestDurationUnit = "s"
+ HTTPServerRequestDurationDescription = "Duration of HTTP server requests."
+
+ // HTTPServerActiveRequests is the metric conforming to the
+ // "http.server.active_requests" semantic conventions. It represents the number
+ // of active HTTP server requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPServerActiveRequestsName = "http.server.active_requests"
+ HTTPServerActiveRequestsUnit = "{request}"
+ HTTPServerActiveRequestsDescription = "Number of active HTTP server requests."
+
+ // HTTPServerRequestBodySize is the metric conforming to the
+ // "http.server.request.body.size" semantic conventions. It represents the size
+ // of HTTP server request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerRequestBodySizeName = "http.server.request.body.size"
+ HTTPServerRequestBodySizeUnit = "By"
+ HTTPServerRequestBodySizeDescription = "Size of HTTP server request bodies."
+
+ // HTTPServerResponseBodySize is the metric conforming to the
+ // "http.server.response.body.size" semantic conventions. It represents the
+ // size of HTTP server response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerResponseBodySizeName = "http.server.response.body.size"
+ HTTPServerResponseBodySizeUnit = "By"
+ HTTPServerResponseBodySizeDescription = "Size of HTTP server response bodies."
+
+ // HTTPClientRequestDuration is the metric conforming to the
+ // "http.client.request.duration" semantic conventions. It represents the
+ // duration of HTTP client requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPClientRequestDurationName = "http.client.request.duration"
+ HTTPClientRequestDurationUnit = "s"
+ HTTPClientRequestDurationDescription = "Duration of HTTP client requests."
+
+ // HTTPClientRequestBodySize is the metric conforming to the
+ // "http.client.request.body.size" semantic conventions. It represents the size
+ // of HTTP client request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientRequestBodySizeName = "http.client.request.body.size"
+ HTTPClientRequestBodySizeUnit = "By"
+ HTTPClientRequestBodySizeDescription = "Size of HTTP client request bodies."
+
+ // HTTPClientResponseBodySize is the metric conforming to the
+ // "http.client.response.body.size" semantic conventions. It represents the
+ // size of HTTP client response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientResponseBodySizeName = "http.client.response.body.size"
+ HTTPClientResponseBodySizeUnit = "By"
+ HTTPClientResponseBodySizeDescription = "Size of HTTP client response bodies."
+
+ // JvmMemoryInit is the metric conforming to the "jvm.memory.init" semantic
+ // conventions. It represents the measure of initial memory requested.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmMemoryInitName = "jvm.memory.init"
+ JvmMemoryInitUnit = "By"
+ JvmMemoryInitDescription = "Measure of initial memory requested."
+
+ // JvmSystemCPUUtilization is the metric conforming to the
+ // "jvm.system.cpu.utilization" semantic conventions. It represents the recent
+ // CPU utilization for the whole system as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ JvmSystemCPUUtilizationName = "jvm.system.cpu.utilization"
+ JvmSystemCPUUtilizationUnit = "1"
+ JvmSystemCPUUtilizationDescription = "Recent CPU utilization for the whole system as reported by the JVM."
+
+ // JvmSystemCPULoad1m is the metric conforming to the "jvm.system.cpu.load_1m"
+ // semantic conventions. It represents the average CPU load of the whole system
+ // for the last minute as reported by the JVM.
+ // Instrument: gauge
+ // Unit: {run_queue_item}
+ // Stability: Experimental
+ JvmSystemCPULoad1mName = "jvm.system.cpu.load_1m"
+ JvmSystemCPULoad1mUnit = "{run_queue_item}"
+ JvmSystemCPULoad1mDescription = "Average CPU load of the whole system for the last minute as reported by the JVM."
+
+ // JvmBufferMemoryUsage is the metric conforming to the
+ // "jvm.buffer.memory.usage" semantic conventions. It represents the measure of
+ // memory used by buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryUsageName = "jvm.buffer.memory.usage"
+ JvmBufferMemoryUsageUnit = "By"
+ JvmBufferMemoryUsageDescription = "Measure of memory used by buffers."
+
+ // JvmBufferMemoryLimit is the metric conforming to the
+ // "jvm.buffer.memory.limit" semantic conventions. It represents the measure of
+ // total memory capacity of buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryLimitName = "jvm.buffer.memory.limit"
+ JvmBufferMemoryLimitUnit = "By"
+ JvmBufferMemoryLimitDescription = "Measure of total memory capacity of buffers."
+
+ // JvmBufferCount is the metric conforming to the "jvm.buffer.count" semantic
+ // conventions. It represents the number of buffers in the pool.
+ // Instrument: updowncounter
+ // Unit: {buffer}
+ // Stability: Experimental
+ JvmBufferCountName = "jvm.buffer.count"
+ JvmBufferCountUnit = "{buffer}"
+ JvmBufferCountDescription = "Number of buffers in the pool."
+
+ // JvmMemoryUsed is the metric conforming to the "jvm.memory.used" semantic
+ // conventions. It represents the measure of memory used.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedName = "jvm.memory.used"
+ JvmMemoryUsedUnit = "By"
+ JvmMemoryUsedDescription = "Measure of memory used."
+
+ // JvmMemoryCommitted is the metric conforming to the "jvm.memory.committed"
+ // semantic conventions. It represents the measure of memory committed.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryCommittedName = "jvm.memory.committed"
+ JvmMemoryCommittedUnit = "By"
+ JvmMemoryCommittedDescription = "Measure of memory committed."
+
+ // JvmMemoryLimit is the metric conforming to the "jvm.memory.limit" semantic
+ // conventions. It represents the measure of max obtainable memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryLimitName = "jvm.memory.limit"
+ JvmMemoryLimitUnit = "By"
+ JvmMemoryLimitDescription = "Measure of max obtainable memory."
+
+ // JvmMemoryUsedAfterLastGc is the metric conforming to the
+ // "jvm.memory.used_after_last_gc" semantic conventions. It represents the
+ // measure of memory used, as measured after the most recent garbage collection
+ // event on this pool.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedAfterLastGcName = "jvm.memory.used_after_last_gc"
+ JvmMemoryUsedAfterLastGcUnit = "By"
+ JvmMemoryUsedAfterLastGcDescription = "Measure of memory used, as measured after the most recent garbage collection event on this pool."
+
+ // JvmGcDuration is the metric conforming to the "jvm.gc.duration" semantic
+ // conventions. It represents the duration of JVM garbage collection actions.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ JvmGcDurationName = "jvm.gc.duration"
+ JvmGcDurationUnit = "s"
+ JvmGcDurationDescription = "Duration of JVM garbage collection actions."
+
+ // JvmThreadCount is the metric conforming to the "jvm.thread.count" semantic
+ // conventions. It represents the number of executing platform threads.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Stable
+ JvmThreadCountName = "jvm.thread.count"
+ JvmThreadCountUnit = "{thread}"
+ JvmThreadCountDescription = "Number of executing platform threads."
+
+ // JvmClassLoaded is the metric conforming to the "jvm.class.loaded" semantic
+ // conventions. It represents the number of classes loaded since JVM start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassLoadedName = "jvm.class.loaded"
+ JvmClassLoadedUnit = "{class}"
+ JvmClassLoadedDescription = "Number of classes loaded since JVM start."
+
+ // JvmClassUnloaded is the metric conforming to the "jvm.class.unloaded"
+ // semantic conventions. It represents the number of classes unloaded since JVM
+ // start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassUnloadedName = "jvm.class.unloaded"
+ JvmClassUnloadedUnit = "{class}"
+ JvmClassUnloadedDescription = "Number of classes unloaded since JVM start."
+
+ // JvmClassCount is the metric conforming to the "jvm.class.count" semantic
+ // conventions. It represents the number of classes currently loaded.
+ // Instrument: updowncounter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassCountName = "jvm.class.count"
+ JvmClassCountUnit = "{class}"
+ JvmClassCountDescription = "Number of classes currently loaded."
+
+ // JvmCPUCount is the metric conforming to the "jvm.cpu.count" semantic
+ // conventions. It represents the number of processors available to the Java
+ // virtual machine.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Stable
+ JvmCPUCountName = "jvm.cpu.count"
+ JvmCPUCountUnit = "{cpu}"
+ JvmCPUCountDescription = "Number of processors available to the Java virtual machine."
+
+ // JvmCPUTime is the metric conforming to the "jvm.cpu.time" semantic
+ // conventions. It represents the cPU time used by the process as reported by
+ // the JVM.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Stable
+ JvmCPUTimeName = "jvm.cpu.time"
+ JvmCPUTimeUnit = "s"
+ JvmCPUTimeDescription = "CPU time used by the process as reported by the JVM."
+
+ // JvmCPURecentUtilization is the metric conforming to the
+ // "jvm.cpu.recent_utilization" semantic conventions. It represents the recent
+ // CPU utilization for the process as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Stable
+ JvmCPURecentUtilizationName = "jvm.cpu.recent_utilization"
+ JvmCPURecentUtilizationUnit = "1"
+ JvmCPURecentUtilizationDescription = "Recent CPU utilization for the process as reported by the JVM."
+
+ // MessagingPublishDuration is the metric conforming to the
+ // "messaging.publish.duration" semantic conventions. It represents the
+ // measures the duration of publish operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingPublishDurationName = "messaging.publish.duration"
+ MessagingPublishDurationUnit = "s"
+ MessagingPublishDurationDescription = "Measures the duration of publish operation."
+
+ // MessagingReceiveDuration is the metric conforming to the
+ // "messaging.receive.duration" semantic conventions. It represents the
+ // measures the duration of receive operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingReceiveDurationName = "messaging.receive.duration"
+ MessagingReceiveDurationUnit = "s"
+ MessagingReceiveDurationDescription = "Measures the duration of receive operation."
+
+ // MessagingDeliverDuration is the metric conforming to the
+ // "messaging.deliver.duration" semantic conventions. It represents the
+ // measures the duration of deliver operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingDeliverDurationName = "messaging.deliver.duration"
+ MessagingDeliverDurationUnit = "s"
+ MessagingDeliverDurationDescription = "Measures the duration of deliver operation."
+
+ // MessagingPublishMessages is the metric conforming to the
+ // "messaging.publish.messages" semantic conventions. It represents the
+ // measures the number of published messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingPublishMessagesName = "messaging.publish.messages"
+ MessagingPublishMessagesUnit = "{message}"
+ MessagingPublishMessagesDescription = "Measures the number of published messages."
+
+ // MessagingReceiveMessages is the metric conforming to the
+ // "messaging.receive.messages" semantic conventions. It represents the
+ // measures the number of received messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingReceiveMessagesName = "messaging.receive.messages"
+ MessagingReceiveMessagesUnit = "{message}"
+ MessagingReceiveMessagesDescription = "Measures the number of received messages."
+
+ // MessagingDeliverMessages is the metric conforming to the
+ // "messaging.deliver.messages" semantic conventions. It represents the
+ // measures the number of delivered messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingDeliverMessagesName = "messaging.deliver.messages"
+ MessagingDeliverMessagesUnit = "{message}"
+ MessagingDeliverMessagesDescription = "Measures the number of delivered messages."
+
+ // RPCServerDuration is the metric conforming to the "rpc.server.duration"
+ // semantic conventions. It represents the measures the duration of inbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCServerDurationName = "rpc.server.duration"
+ RPCServerDurationUnit = "ms"
+ RPCServerDurationDescription = "Measures the duration of inbound RPC."
+
+ // RPCServerRequestSize is the metric conforming to the
+ // "rpc.server.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerRequestSizeName = "rpc.server.request.size"
+ RPCServerRequestSizeUnit = "By"
+ RPCServerRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCServerResponseSize is the metric conforming to the
+ // "rpc.server.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerResponseSizeName = "rpc.server.response.size"
+ RPCServerResponseSizeUnit = "By"
+ RPCServerResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCServerRequestsPerRPC is the metric conforming to the
+ // "rpc.server.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerRequestsPerRPCName = "rpc.server.requests_per_rpc"
+ RPCServerRequestsPerRPCUnit = "{count}"
+ RPCServerRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCServerResponsesPerRPC is the metric conforming to the
+ // "rpc.server.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerResponsesPerRPCName = "rpc.server.responses_per_rpc"
+ RPCServerResponsesPerRPCUnit = "{count}"
+ RPCServerResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // RPCClientDuration is the metric conforming to the "rpc.client.duration"
+ // semantic conventions. It represents the measures the duration of outbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCClientDurationName = "rpc.client.duration"
+ RPCClientDurationUnit = "ms"
+ RPCClientDurationDescription = "Measures the duration of outbound RPC."
+
+ // RPCClientRequestSize is the metric conforming to the
+ // "rpc.client.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientRequestSizeName = "rpc.client.request.size"
+ RPCClientRequestSizeUnit = "By"
+ RPCClientRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCClientResponseSize is the metric conforming to the
+ // "rpc.client.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientResponseSizeName = "rpc.client.response.size"
+ RPCClientResponseSizeUnit = "By"
+ RPCClientResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCClientRequestsPerRPC is the metric conforming to the
+ // "rpc.client.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientRequestsPerRPCName = "rpc.client.requests_per_rpc"
+ RPCClientRequestsPerRPCUnit = "{count}"
+ RPCClientRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCClientResponsesPerRPC is the metric conforming to the
+ // "rpc.client.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientResponsesPerRPCName = "rpc.client.responses_per_rpc"
+ RPCClientResponsesPerRPCUnit = "{count}"
+ RPCClientResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // SystemCPUTime is the metric conforming to the "system.cpu.time" semantic
+ // conventions. It represents the seconds each logical CPU spent on each mode.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemCPUTimeName = "system.cpu.time"
+ SystemCPUTimeUnit = "s"
+ SystemCPUTimeDescription = "Seconds each logical CPU spent on each mode"
+
+ // SystemCPUUtilization is the metric conforming to the
+ // "system.cpu.utilization" semantic conventions. It represents the difference
+ // in system.cpu.time since the last measurement, divided by the elapsed time
+ // and number of logical CPUs.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ SystemCPUUtilizationName = "system.cpu.utilization"
+ SystemCPUUtilizationUnit = "1"
+ SystemCPUUtilizationDescription = "Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs"
+
+ // SystemCPUFrequency is the metric conforming to the "system.cpu.frequency"
+ // semantic conventions. It represents the reports the current frequency of the
+ // CPU in Hz.
+ // Instrument: gauge
+ // Unit: {Hz}
+ // Stability: Experimental
+ SystemCPUFrequencyName = "system.cpu.frequency"
+ SystemCPUFrequencyUnit = "{Hz}"
+ SystemCPUFrequencyDescription = "Reports the current frequency of the CPU in Hz"
+
+ // SystemCPUPhysicalCount is the metric conforming to the
+ // "system.cpu.physical.count" semantic conventions. It represents the reports
+ // the number of actual physical processor cores on the hardware.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPUPhysicalCountName = "system.cpu.physical.count"
+ SystemCPUPhysicalCountUnit = "{cpu}"
+ SystemCPUPhysicalCountDescription = "Reports the number of actual physical processor cores on the hardware"
+
+ // SystemCPULogicalCount is the metric conforming to the
+ // "system.cpu.logical.count" semantic conventions. It represents the reports
+ // the number of logical (virtual) processor cores created by the operating
+ // system to manage multitasking.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPULogicalCountName = "system.cpu.logical.count"
+ SystemCPULogicalCountUnit = "{cpu}"
+ SystemCPULogicalCountDescription = "Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking"
+
+ // SystemMemoryUsage is the metric conforming to the "system.memory.usage"
+ // semantic conventions. It represents the reports memory in use by state.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryUsageName = "system.memory.usage"
+ SystemMemoryUsageUnit = "By"
+ SystemMemoryUsageDescription = "Reports memory in use by state."
+
+ // SystemMemoryLimit is the metric conforming to the "system.memory.limit"
+ // semantic conventions. It represents the total memory available in the
+ // system.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryLimitName = "system.memory.limit"
+ SystemMemoryLimitUnit = "By"
+ SystemMemoryLimitDescription = "Total memory available in the system."
+
+ // SystemMemoryUtilization is the metric conforming to the
+ // "system.memory.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemMemoryUtilizationName = "system.memory.utilization"
+ SystemMemoryUtilizationUnit = "1"
+
+ // SystemPagingUsage is the metric conforming to the "system.paging.usage"
+ // semantic conventions. It represents the unix swap or windows pagefile usage.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemPagingUsageName = "system.paging.usage"
+ SystemPagingUsageUnit = "By"
+ SystemPagingUsageDescription = "Unix swap or windows pagefile usage"
+
+ // SystemPagingUtilization is the metric conforming to the
+ // "system.paging.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingUtilizationName = "system.paging.utilization"
+ SystemPagingUtilizationUnit = "1"
+
+ // SystemPagingFaults is the metric conforming to the "system.paging.faults"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingFaultsName = "system.paging.faults"
+ SystemPagingFaultsUnit = "{fault}"
+
+ // SystemPagingOperations is the metric conforming to the
+ // "system.paging.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingOperationsName = "system.paging.operations"
+ SystemPagingOperationsUnit = "{operation}"
+
+ // SystemDiskIo is the metric conforming to the "system.disk.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskIoName = "system.disk.io"
+ SystemDiskIoUnit = "By"
+
+ // SystemDiskOperations is the metric conforming to the
+ // "system.disk.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskOperationsName = "system.disk.operations"
+ SystemDiskOperationsUnit = "{operation}"
+
+ // SystemDiskIoTime is the metric conforming to the "system.disk.io_time"
+ // semantic conventions. It represents the time disk spent activated.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskIoTimeName = "system.disk.io_time"
+ SystemDiskIoTimeUnit = "s"
+ SystemDiskIoTimeDescription = "Time disk spent activated"
+
+ // SystemDiskOperationTime is the metric conforming to the
+ // "system.disk.operation_time" semantic conventions. It represents the sum of
+ // the time each operation took to complete.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskOperationTimeName = "system.disk.operation_time"
+ SystemDiskOperationTimeUnit = "s"
+ SystemDiskOperationTimeDescription = "Sum of the time each operation took to complete"
+
+ // SystemDiskMerged is the metric conforming to the "system.disk.merged"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskMergedName = "system.disk.merged"
+ SystemDiskMergedUnit = "{operation}"
+
+ // SystemFilesystemUsage is the metric conforming to the
+ // "system.filesystem.usage" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUsageName = "system.filesystem.usage"
+ SystemFilesystemUsageUnit = "By"
+
+ // SystemFilesystemUtilization is the metric conforming to the
+ // "system.filesystem.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUtilizationName = "system.filesystem.utilization"
+ SystemFilesystemUtilizationUnit = "1"
+
+ // SystemNetworkDropped is the metric conforming to the
+ // "system.network.dropped" semantic conventions. It represents the count of
+ // packets that are dropped or discarded even though there was no error.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ SystemNetworkDroppedName = "system.network.dropped"
+ SystemNetworkDroppedUnit = "{packet}"
+ SystemNetworkDroppedDescription = "Count of packets that are dropped or discarded even though there was no error"
+
+ // SystemNetworkPackets is the metric conforming to the
+ // "system.network.packets" semantic conventions.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkPacketsName = "system.network.packets"
+ SystemNetworkPacketsUnit = "{packet}"
+
+ // SystemNetworkErrors is the metric conforming to the "system.network.errors"
+ // semantic conventions. It represents the count of network errors detected.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ SystemNetworkErrorsName = "system.network.errors"
+ SystemNetworkErrorsUnit = "{error}"
+ SystemNetworkErrorsDescription = "Count of network errors detected"
+
+ // SystemNetworkIo is the metric conforming to the "system.network.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkIoName = "system.network.io"
+ SystemNetworkIoUnit = "By"
+
+ // SystemNetworkConnections is the metric conforming to the
+ // "system.network.connections" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkConnectionsName = "system.network.connections"
+ SystemNetworkConnectionsUnit = "{connection}"
+
+ // SystemProcessesCount is the metric conforming to the
+ // "system.processes.count" semantic conventions. It represents the total
+ // number of processes in each state.
+ // Instrument: updowncounter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessesCountName = "system.processes.count"
+ SystemProcessesCountUnit = "{process}"
+ SystemProcessesCountDescription = "Total number of processes in each state"
+
+ // SystemProcessesCreated is the metric conforming to the
+ // "system.processes.created" semantic conventions. It represents the total
+ // number of processes created over uptime of the host.
+ // Instrument: counter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessesCreatedName = "system.processes.created"
+ SystemProcessesCreatedUnit = "{process}"
+ SystemProcessesCreatedDescription = "Total number of processes created over uptime of the host"
+
+ // SystemLinuxMemoryAvailable is the metric conforming to the
+ // "system.linux.memory.available" semantic conventions. It represents an
+ // estimate of how much memory is available for starting new applications,
+ // without causing swapping.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemLinuxMemoryAvailableName = "system.linux.memory.available"
+ SystemLinuxMemoryAvailableUnit = "By"
+ SystemLinuxMemoryAvailableDescription = "An estimate of how much memory is available for starting new applications, without causing swapping"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go
new file mode 100644
index 00000000000..d66bbe9c23d
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go
@@ -0,0 +1,2545 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// A cloud environment (e.g. GCP, Azure, AWS).
+const (
+ // CloudAccountIDKey is the attribute Key conforming to the
+ // "cloud.account.id" semantic conventions. It represents the cloud account
+ // ID the resource is assigned to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '111111111111', 'opentelemetry'
+ CloudAccountIDKey = attribute.Key("cloud.account.id")
+
+ // CloudAvailabilityZoneKey is the attribute Key conforming to the
+ // "cloud.availability_zone" semantic conventions. It represents the cloud
+ // regions often have multiple, isolated locations known as zones to
+ // increase availability. Availability zone represents the zone where the
+ // resource is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-east-1c'
+ // Note: Availability zones are called "zones" on Alibaba Cloud and Google
+ // Cloud.
+ CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone")
+
+ // CloudPlatformKey is the attribute Key conforming to the "cloud.platform"
+ // semantic conventions. It represents the cloud platform in use.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The prefix of the service SHOULD match the one specified in
+ // `cloud.provider`.
+ CloudPlatformKey = attribute.Key("cloud.platform")
+
+ // CloudProviderKey is the attribute Key conforming to the "cloud.provider"
+ // semantic conventions. It represents the name of the cloud provider.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ CloudProviderKey = attribute.Key("cloud.provider")
+
+ // CloudRegionKey is the attribute Key conforming to the "cloud.region"
+ // semantic conventions. It represents the geographical region the resource
+ // is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-central1', 'us-east-1'
+ // Note: Refer to your provider's docs to see the available regions, for
+ // example [Alibaba Cloud
+ // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS
+ // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/),
+ // [Azure
+ // regions](https://azure.microsoft.com/global-infrastructure/geographies/),
+ // [Google Cloud regions](https://cloud.google.com/about/locations), or
+ // [Tencent Cloud
+ // regions](https://www.tencentcloud.com/document/product/213/6091).
+ CloudRegionKey = attribute.Key("cloud.region")
+
+ // CloudResourceIDKey is the attribute Key conforming to the
+ // "cloud.resource_id" semantic conventions. It represents the cloud
+ // provider-specific native identifier of the monitored cloud resource
+ // (e.g. an
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // on AWS, a [fully qualified resource
+ // ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id)
+ // on Azure, a [full resource
+ // name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+ // on GCP)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function',
+ // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID',
+ // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/'
+ // Note: On some cloud providers, it may not be possible to determine the
+ // full ID at startup,
+ // so it may be necessary to set `cloud.resource_id` as a span attribute
+ // instead.
+ //
+ // The exact value to use for `cloud.resource_id` depends on the cloud
+ // provider.
+ // The following well-known definitions MUST be used if you set this
+ // attribute and they apply:
+ //
+ // * **AWS Lambda:** The function
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
+ // Take care not to use the "invoked ARN" directly but replace any
+ // [alias
+ // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
+ // with the resolved function version, as the same runtime instance may
+ // be invokable with
+ // multiple different aliases.
+ // * **GCP:** The [URI of the
+ // resource](https://cloud.google.com/iam/docs/full-resource-names)
+ // * **Azure:** The [Fully Qualified Resource
+ // ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id)
+ // of the invoked function,
+ // *not* the function app, having the form
+ // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`.
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider.
+ CloudResourceIDKey = attribute.Key("cloud.resource_id")
+)
+
+var (
+ // Alibaba Cloud Elastic Compute Service
+ CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
+ // Alibaba Cloud Function Compute
+ CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc")
+ // Red Hat OpenShift on Alibaba Cloud
+ CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift")
+ // AWS Elastic Compute Cloud
+ CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
+ // AWS Elastic Container Service
+ CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs")
+ // AWS Elastic Kubernetes Service
+ CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks")
+ // AWS Lambda
+ CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda")
+ // AWS Elastic Beanstalk
+ CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
+ // AWS App Runner
+ CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
+ // Red Hat OpenShift on AWS (ROSA)
+ CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift")
+ // Azure Virtual Machines
+ CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm")
+ // Azure Container Instances
+ CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances")
+ // Azure Kubernetes Service
+ CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks")
+ // Azure Functions
+ CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions")
+ // Azure App Service
+ CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
+ // Azure Red Hat OpenShift
+ CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
+ // Google Bare Metal Solution (BMS)
+ CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
+ // Google Cloud Compute Engine (GCE)
+ CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
+ // Google Cloud Run
+ CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run")
+ // Google Cloud Kubernetes Engine (GKE)
+ CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine")
+ // Google Cloud Functions (GCF)
+ CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
+ // Google Cloud App Engine (GAE)
+ CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
+ // Red Hat OpenShift on Google Cloud
+ CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift")
+ // Red Hat OpenShift on IBM Cloud
+ CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
+ // Tencent Cloud Cloud Virtual Machine (CVM)
+ CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm")
+ // Tencent Cloud Elastic Kubernetes Service (EKS)
+ CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks")
+ // Tencent Cloud Serverless Cloud Function (SCF)
+ CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf")
+)
+
+var (
+ // Alibaba Cloud
+ CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ CloudProviderAWS = CloudProviderKey.String("aws")
+ // Microsoft Azure
+ CloudProviderAzure = CloudProviderKey.String("azure")
+ // Google Cloud Platform
+ CloudProviderGCP = CloudProviderKey.String("gcp")
+ // Heroku Platform as a Service
+ CloudProviderHeroku = CloudProviderKey.String("heroku")
+ // IBM Cloud
+ CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
+ // Tencent Cloud
+ CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
+)
+
+// CloudAccountID returns an attribute KeyValue conforming to the
+// "cloud.account.id" semantic conventions. It represents the cloud account ID
+// the resource is assigned to.
+func CloudAccountID(val string) attribute.KeyValue {
+ return CloudAccountIDKey.String(val)
+}
+
+// CloudAvailabilityZone returns an attribute KeyValue conforming to the
+// "cloud.availability_zone" semantic conventions. It represents the cloud
+// regions often have multiple, isolated locations known as zones to increase
+// availability. Availability zone represents the zone where the resource is
+// running.
+func CloudAvailabilityZone(val string) attribute.KeyValue {
+ return CloudAvailabilityZoneKey.String(val)
+}
+
+// CloudRegion returns an attribute KeyValue conforming to the
+// "cloud.region" semantic conventions. It represents the geographical region
+// the resource is running.
+func CloudRegion(val string) attribute.KeyValue {
+ return CloudRegionKey.String(val)
+}
+
+// CloudResourceID returns an attribute KeyValue conforming to the
+// "cloud.resource_id" semantic conventions. It represents the cloud
+// provider-specific native identifier of the monitored cloud resource (e.g. an
+// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+// on AWS, a [fully qualified resource
+// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on
+// Azure, a [full resource
+// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+// on GCP)
+func CloudResourceID(val string) attribute.KeyValue {
+ return CloudResourceIDKey.String(val)
+}
+
+// A container instance.
+const (
+ // ContainerCommandKey is the attribute Key conforming to the
+ // "container.command" semantic conventions. It represents the command used
+ // to run the container (i.e. the command name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol'
+ // Note: If using embedded credentials or sensitive data, it is recommended
+ // to remove them to prevent potential leakage.
+ ContainerCommandKey = attribute.Key("container.command")
+
+ // ContainerCommandArgsKey is the attribute Key conforming to the
+ // "container.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) run by the
+ // container. [2]
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol, --config, config.yaml'
+ ContainerCommandArgsKey = attribute.Key("container.command_args")
+
+ // ContainerCommandLineKey is the attribute Key conforming to the
+ // "container.command_line" semantic conventions. It represents the full
+ // command run by the container as a single string representing the full
+ // command. [2]
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol --config config.yaml'
+ ContainerCommandLineKey = attribute.Key("container.command_line")
+
+ // ContainerIDKey is the attribute Key conforming to the "container.id"
+ // semantic conventions. It represents the container ID. Usually a UUID, as
+ // for example used to [identify Docker
+ // containers](https://docs.docker.com/engine/reference/run/#container-identification).
+ // The UUID might be abbreviated.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'a3bf90e006b2'
+ ContainerIDKey = attribute.Key("container.id")
+
+ // ContainerImageIDKey is the attribute Key conforming to the
+ // "container.image.id" semantic conventions. It represents the runtime
+ // specific image identifier. Usually a hash algorithm followed by a UUID.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
+ // Note: Docker defines a sha256 of the image id; `container.image.id`
+ // corresponds to the `Image` field from the Docker container inspect
+ // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
+ // endpoint.
+ // K8S defines a link to the container registry repository with digest
+ // `"imageID": "registry.azurecr.io
+ // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
+ // The ID is assinged by the container runtime and can vary in different
+ // environments. Consider using `oci.manifest.digest` if it is important to
+ // identify the same image in different environments/runtimes.
+ ContainerImageIDKey = attribute.Key("container.image.id")
+
+ // ContainerImageNameKey is the attribute Key conforming to the
+ // "container.image.name" semantic conventions. It represents the name of
+ // the image the container was built on.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gcr.io/opentelemetry/operator'
+ ContainerImageNameKey = attribute.Key("container.image.name")
+
+ // ContainerImageRepoDigestsKey is the attribute Key conforming to the
+ // "container.image.repo_digests" semantic conventions. It represents the
+ // repo digests of the container image as provided by the container
+ // runtime.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb',
+ // 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578'
+ // Note:
+ // [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect)
+ // and
+ // [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238)
+ // report those under the `RepoDigests` field.
+ ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests")
+
+ // ContainerImageTagsKey is the attribute Key conforming to the
+ // "container.image.tags" semantic conventions. It represents the container
+ // image tags. An example can be found in [Docker Image
+ // Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+ // Should be only the `` section of the full name for example from
+ // `registry.example.com/my-org/my-image:`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'v1.27.1', '3.5.7-0'
+ ContainerImageTagsKey = attribute.Key("container.image.tags")
+
+ // ContainerNameKey is the attribute Key conforming to the "container.name"
+ // semantic conventions. It represents the container name used by container
+ // runtime.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-autoconf'
+ ContainerNameKey = attribute.Key("container.name")
+
+ // ContainerRuntimeKey is the attribute Key conforming to the
+ // "container.runtime" semantic conventions. It represents the container
+ // runtime managing this container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'docker', 'containerd', 'rkt'
+ ContainerRuntimeKey = attribute.Key("container.runtime")
+)
+
+// ContainerCommand returns an attribute KeyValue conforming to the
+// "container.command" semantic conventions. It represents the command used to
+// run the container (i.e. the command name).
+func ContainerCommand(val string) attribute.KeyValue {
+ return ContainerCommandKey.String(val)
+}
+
+// ContainerCommandArgs returns an attribute KeyValue conforming to the
+// "container.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) run by the
+// container. [2]
+func ContainerCommandArgs(val ...string) attribute.KeyValue {
+ return ContainerCommandArgsKey.StringSlice(val)
+}
+
+// ContainerCommandLine returns an attribute KeyValue conforming to the
+// "container.command_line" semantic conventions. It represents the full
+// command run by the container as a single string representing the full
+// command. [2]
+func ContainerCommandLine(val string) attribute.KeyValue {
+ return ContainerCommandLineKey.String(val)
+}
+
+// ContainerID returns an attribute KeyValue conforming to the
+// "container.id" semantic conventions. It represents the container ID. Usually
+// a UUID, as for example used to [identify Docker
+// containers](https://docs.docker.com/engine/reference/run/#container-identification).
+// The UUID might be abbreviated.
+func ContainerID(val string) attribute.KeyValue {
+ return ContainerIDKey.String(val)
+}
+
+// ContainerImageID returns an attribute KeyValue conforming to the
+// "container.image.id" semantic conventions. It represents the runtime
+// specific image identifier. Usually a hash algorithm followed by a UUID.
+func ContainerImageID(val string) attribute.KeyValue {
+ return ContainerImageIDKey.String(val)
+}
+
+// ContainerImageName returns an attribute KeyValue conforming to the
+// "container.image.name" semantic conventions. It represents the name of the
+// image the container was built on.
+func ContainerImageName(val string) attribute.KeyValue {
+ return ContainerImageNameKey.String(val)
+}
+
+// ContainerImageRepoDigests returns an attribute KeyValue conforming to the
+// "container.image.repo_digests" semantic conventions. It represents the repo
+// digests of the container image as provided by the container runtime.
+func ContainerImageRepoDigests(val ...string) attribute.KeyValue {
+ return ContainerImageRepoDigestsKey.StringSlice(val)
+}
+
+// ContainerImageTags returns an attribute KeyValue conforming to the
+// "container.image.tags" semantic conventions. It represents the container
+// image tags. An example can be found in [Docker Image
+// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+// Should be only the `` section of the full name for example from
+// `registry.example.com/my-org/my-image:`.
+func ContainerImageTags(val ...string) attribute.KeyValue {
+ return ContainerImageTagsKey.StringSlice(val)
+}
+
+// ContainerName returns an attribute KeyValue conforming to the
+// "container.name" semantic conventions. It represents the container name used
+// by container runtime.
+func ContainerName(val string) attribute.KeyValue {
+ return ContainerNameKey.String(val)
+}
+
+// ContainerRuntime returns an attribute KeyValue conforming to the
+// "container.runtime" semantic conventions. It represents the container
+// runtime managing this container.
+func ContainerRuntime(val string) attribute.KeyValue {
+ return ContainerRuntimeKey.String(val)
+}
+
+// Describes device attributes.
+const (
+ // DeviceIDKey is the attribute Key conforming to the "device.id" semantic
+ // conventions. It represents a unique identifier representing the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092'
+ // Note: The device identifier MUST only be defined using the values
+ // outlined below. This value is not an advertising identifier and MUST NOT
+ // be used as such. On iOS (Swift or Objective-C), this value MUST be equal
+ // to the [vendor
+ // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
+ // On Android (Java or Kotlin), this value MUST be equal to the Firebase
+ // Installation ID or a globally unique UUID which is persisted across
+ // sessions in your application. More information can be found
+ // [here](https://developer.android.com/training/articles/user-data-ids) on
+ // best practices and exact implementation details. Caution should be taken
+ // when storing personal data or anything which can identify a user. GDPR
+ // and data protection laws may apply, ensure you do your own due
+ // diligence.
+ DeviceIDKey = attribute.Key("device.id")
+
+ // DeviceManufacturerKey is the attribute Key conforming to the
+ // "device.manufacturer" semantic conventions. It represents the name of
+ // the device manufacturer
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Apple', 'Samsung'
+ // Note: The Android OS provides this field via
+ // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER).
+ // iOS apps SHOULD hardcode the value `Apple`.
+ DeviceManufacturerKey = attribute.Key("device.manufacturer")
+
+ // DeviceModelIdentifierKey is the attribute Key conforming to the
+ // "device.model.identifier" semantic conventions. It represents the model
+ // identifier for the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone3,4', 'SM-G920F'
+ // Note: It's recommended this value represents a machine-readable version
+ // of the model identifier rather than the market or consumer-friendly name
+ // of the device.
+ DeviceModelIdentifierKey = attribute.Key("device.model.identifier")
+
+ // DeviceModelNameKey is the attribute Key conforming to the
+ // "device.model.name" semantic conventions. It represents the marketing
+ // name for the device model
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6'
+ // Note: It's recommended this value represents a human-readable version of
+ // the device model rather than a machine-readable alternative.
+ DeviceModelNameKey = attribute.Key("device.model.name")
+)
+
+// DeviceID returns an attribute KeyValue conforming to the "device.id"
+// semantic conventions. It represents a unique identifier representing the
+// device
+func DeviceID(val string) attribute.KeyValue {
+ return DeviceIDKey.String(val)
+}
+
+// DeviceManufacturer returns an attribute KeyValue conforming to the
+// "device.manufacturer" semantic conventions. It represents the name of the
+// device manufacturer
+func DeviceManufacturer(val string) attribute.KeyValue {
+ return DeviceManufacturerKey.String(val)
+}
+
+// DeviceModelIdentifier returns an attribute KeyValue conforming to the
+// "device.model.identifier" semantic conventions. It represents the model
+// identifier for the device
+func DeviceModelIdentifier(val string) attribute.KeyValue {
+ return DeviceModelIdentifierKey.String(val)
+}
+
+// DeviceModelName returns an attribute KeyValue conforming to the
+// "device.model.name" semantic conventions. It represents the marketing name
+// for the device model
+func DeviceModelName(val string) attribute.KeyValue {
+ return DeviceModelNameKey.String(val)
+}
+
+// A host is defined as a computing instance. For example, physical servers,
+// virtual machines, switches or disk array.
+const (
+ // HostArchKey is the attribute Key conforming to the "host.arch" semantic
+ // conventions. It represents the CPU architecture the host system is
+ // running on.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ HostArchKey = attribute.Key("host.arch")
+
+ // HostCPUCacheL2SizeKey is the attribute Key conforming to the
+ // "host.cpu.cache.l2.size" semantic conventions. It represents the amount
+ // of level 2 memory cache available to the processor (in Bytes).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12288000
+ HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size")
+
+ // HostCPUFamilyKey is the attribute Key conforming to the
+ // "host.cpu.family" semantic conventions. It represents the family or
+ // generation of the CPU.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', 'PA-RISC 1.1e'
+ HostCPUFamilyKey = attribute.Key("host.cpu.family")
+
+ // HostCPUModelIDKey is the attribute Key conforming to the
+ // "host.cpu.model.id" semantic conventions. It represents the model
+ // identifier. It provides more granular information about the CPU,
+ // distinguishing it from other CPUs within the same family.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', '9000/778/B180L'
+ HostCPUModelIDKey = attribute.Key("host.cpu.model.id")
+
+ // HostCPUModelNameKey is the attribute Key conforming to the
+ // "host.cpu.model.name" semantic conventions. It represents the model
+ // designation of the processor.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz'
+ HostCPUModelNameKey = attribute.Key("host.cpu.model.name")
+
+ // HostCPUSteppingKey is the attribute Key conforming to the
+ // "host.cpu.stepping" semantic conventions. It represents the stepping or
+ // core revisions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1
+ HostCPUSteppingKey = attribute.Key("host.cpu.stepping")
+
+ // HostCPUVendorIDKey is the attribute Key conforming to the
+ // "host.cpu.vendor.id" semantic conventions. It represents the processor
+ // manufacturer identifier. A maximum 12-character string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'GenuineIntel'
+ // Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor
+ // ID string in EBX, EDX and ECX registers. Writing these to memory in this
+ // order results in a 12-character string.
+ HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id")
+
+ // HostIDKey is the attribute Key conforming to the "host.id" semantic
+ // conventions. It represents the unique host ID. For Cloud, this must be
+ // the instance_id assigned by the cloud provider. For non-containerized
+ // systems, this should be the `machine-id`. See the table below for the
+ // sources to use to determine the `machine-id` based on operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'fdbf79e8af94cb7f9e8df36789187052'
+ HostIDKey = attribute.Key("host.id")
+
+ // HostImageIDKey is the attribute Key conforming to the "host.image.id"
+ // semantic conventions. It represents the vM image ID or host OS image ID.
+ // For Cloud, this value is from the provider.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ami-07b06b442921831e5'
+ HostImageIDKey = attribute.Key("host.image.id")
+
+ // HostImageNameKey is the attribute Key conforming to the
+ // "host.image.name" semantic conventions. It represents the name of the VM
+ // image or OS install the host was instantiated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905'
+ HostImageNameKey = attribute.Key("host.image.name")
+
+ // HostImageVersionKey is the attribute Key conforming to the
+ // "host.image.version" semantic conventions. It represents the version
+ // string of the VM image or host OS as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0.1'
+ HostImageVersionKey = attribute.Key("host.image.version")
+
+ // HostIPKey is the attribute Key conforming to the "host.ip" semantic
+ // conventions. It represents the available IP addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '192.168.1.140', 'fe80::abc2:4a28:737a:609e'
+ // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6
+ // addresses MUST be specified in the [RFC
+ // 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.
+ HostIPKey = attribute.Key("host.ip")
+
+ // HostMacKey is the attribute Key conforming to the "host.mac" semantic
+ // conventions. It represents the available MAC addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F'
+ // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal
+ // form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
+ // as hyphen-separated octets in uppercase hexadecimal form from most to
+ // least significant.
+ HostMacKey = attribute.Key("host.mac")
+
+ // HostNameKey is the attribute Key conforming to the "host.name" semantic
+ // conventions. It represents the name of the host. On Unix systems, it may
+ // contain what the hostname command returns, or the fully qualified
+ // hostname, or another name specified by the user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-test'
+ HostNameKey = attribute.Key("host.name")
+
+ // HostTypeKey is the attribute Key conforming to the "host.type" semantic
+ // conventions. It represents the type of host. For Cloud, this must be the
+ // machine type.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'n1-standard-1'
+ HostTypeKey = attribute.Key("host.type")
+)
+
+var (
+ // AMD64
+ HostArchAMD64 = HostArchKey.String("amd64")
+ // ARM32
+ HostArchARM32 = HostArchKey.String("arm32")
+ // ARM64
+ HostArchARM64 = HostArchKey.String("arm64")
+ // Itanium
+ HostArchIA64 = HostArchKey.String("ia64")
+ // 32-bit PowerPC
+ HostArchPPC32 = HostArchKey.String("ppc32")
+ // 64-bit PowerPC
+ HostArchPPC64 = HostArchKey.String("ppc64")
+ // IBM z/Architecture
+ HostArchS390x = HostArchKey.String("s390x")
+ // 32-bit x86
+ HostArchX86 = HostArchKey.String("x86")
+)
+
+// HostCPUCacheL2Size returns an attribute KeyValue conforming to the
+// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of
+// level 2 memory cache available to the processor (in Bytes).
+func HostCPUCacheL2Size(val int) attribute.KeyValue {
+ return HostCPUCacheL2SizeKey.Int(val)
+}
+
+// HostCPUFamily returns an attribute KeyValue conforming to the
+// "host.cpu.family" semantic conventions. It represents the family or
+// generation of the CPU.
+func HostCPUFamily(val string) attribute.KeyValue {
+ return HostCPUFamilyKey.String(val)
+}
+
+// HostCPUModelID returns an attribute KeyValue conforming to the
+// "host.cpu.model.id" semantic conventions. It represents the model
+// identifier. It provides more granular information about the CPU,
+// distinguishing it from other CPUs within the same family.
+func HostCPUModelID(val string) attribute.KeyValue {
+ return HostCPUModelIDKey.String(val)
+}
+
+// HostCPUModelName returns an attribute KeyValue conforming to the
+// "host.cpu.model.name" semantic conventions. It represents the model
+// designation of the processor.
+func HostCPUModelName(val string) attribute.KeyValue {
+ return HostCPUModelNameKey.String(val)
+}
+
+// HostCPUStepping returns an attribute KeyValue conforming to the
+// "host.cpu.stepping" semantic conventions. It represents the stepping or core
+// revisions.
+func HostCPUStepping(val int) attribute.KeyValue {
+ return HostCPUSteppingKey.Int(val)
+}
+
+// HostCPUVendorID returns an attribute KeyValue conforming to the
+// "host.cpu.vendor.id" semantic conventions. It represents the processor
+// manufacturer identifier. A maximum 12-character string.
+func HostCPUVendorID(val string) attribute.KeyValue {
+ return HostCPUVendorIDKey.String(val)
+}
+
+// HostID returns an attribute KeyValue conforming to the "host.id" semantic
+// conventions. It represents the unique host ID. For Cloud, this must be the
+// instance_id assigned by the cloud provider. For non-containerized systems,
+// this should be the `machine-id`. See the table below for the sources to use
+// to determine the `machine-id` based on operating system.
+func HostID(val string) attribute.KeyValue {
+ return HostIDKey.String(val)
+}
+
+// HostImageID returns an attribute KeyValue conforming to the
+// "host.image.id" semantic conventions. It represents the vM image ID or host
+// OS image ID. For Cloud, this value is from the provider.
+func HostImageID(val string) attribute.KeyValue {
+ return HostImageIDKey.String(val)
+}
+
+// HostImageName returns an attribute KeyValue conforming to the
+// "host.image.name" semantic conventions. It represents the name of the VM
+// image or OS install the host was instantiated from.
+func HostImageName(val string) attribute.KeyValue {
+ return HostImageNameKey.String(val)
+}
+
+// HostImageVersion returns an attribute KeyValue conforming to the
+// "host.image.version" semantic conventions. It represents the version string
+// of the VM image or host OS as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func HostImageVersion(val string) attribute.KeyValue {
+ return HostImageVersionKey.String(val)
+}
+
+// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic
+// conventions. It represents the available IP addresses of the host, excluding
+// loopback interfaces.
+func HostIP(val ...string) attribute.KeyValue {
+ return HostIPKey.StringSlice(val)
+}
+
+// HostMac returns an attribute KeyValue conforming to the "host.mac"
+// semantic conventions. It represents the available MAC addresses of the host,
+// excluding loopback interfaces.
+func HostMac(val ...string) attribute.KeyValue {
+ return HostMacKey.StringSlice(val)
+}
+
+// HostName returns an attribute KeyValue conforming to the "host.name"
+// semantic conventions. It represents the name of the host. On Unix systems,
+// it may contain what the hostname command returns, or the fully qualified
+// hostname, or another name specified by the user.
+func HostName(val string) attribute.KeyValue {
+ return HostNameKey.String(val)
+}
+
+// HostType returns an attribute KeyValue conforming to the "host.type"
+// semantic conventions. It represents the type of host. For Cloud, this must
+// be the machine type.
+func HostType(val string) attribute.KeyValue {
+ return HostTypeKey.String(val)
+}
+
+// Kubernetes resource attributes.
+const (
+ // K8SClusterNameKey is the attribute Key conforming to the
+ // "k8s.cluster.name" semantic conventions. It represents the name of the
+ // cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-cluster'
+ K8SClusterNameKey = attribute.Key("k8s.cluster.name")
+
+ // K8SClusterUIDKey is the attribute Key conforming to the
+ // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for
+ // the cluster, set to the UID of the `kube-system` namespace.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d'
+ // Note: K8S doesn't have support for obtaining a cluster ID. If this is
+ // ever
+ // added, we will recommend collecting the `k8s.cluster.uid` through the
+ // official APIs. In the meantime, we are able to use the `uid` of the
+ // `kube-system` namespace as a proxy for cluster ID. Read on for the
+ // rationale.
+ //
+ // Every object created in a K8S cluster is assigned a distinct UID. The
+ // `kube-system` namespace is used by Kubernetes itself and will exist
+ // for the lifetime of the cluster. Using the `uid` of the `kube-system`
+ // namespace is a reasonable proxy for the K8S ClusterID as it will only
+ // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
+ // UUIDs as standardized by
+ // [ISO/IEC 9834-8 and ITU-T
+ // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
+ // Which states:
+ //
+ // > If generated according to one of the mechanisms defined in Rec.
+ // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
+ // different from all other UUIDs generated before 3603 A.D., or is
+ // extremely likely to be different (depending on the mechanism chosen).
+ //
+ // Therefore, UIDs between clusters should be extremely unlikely to
+ // conflict.
+ K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
+
+ // K8SContainerNameKey is the attribute Key conforming to the
+ // "k8s.container.name" semantic conventions. It represents the name of the
+ // Container from Pod specification, must be unique within a Pod. Container
+ // runtime usually uses different globally unique name (`container.name`).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'redis'
+ K8SContainerNameKey = attribute.Key("k8s.container.name")
+
+ // K8SContainerRestartCountKey is the attribute Key conforming to the
+ // "k8s.container.restart_count" semantic conventions. It represents the
+ // number of times the container was restarted. This attribute can be used
+ // to identify a particular container (running or stopped) within a
+ // container spec.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 2
+ K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count")
+
+ // K8SCronJobNameKey is the attribute Key conforming to the
+ // "k8s.cronjob.name" semantic conventions. It represents the name of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
+
+ // K8SCronJobUIDKey is the attribute Key conforming to the
+ // "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
+
+ // K8SDaemonSetNameKey is the attribute Key conforming to the
+ // "k8s.daemonset.name" semantic conventions. It represents the name of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
+
+ // K8SDaemonSetUIDKey is the attribute Key conforming to the
+ // "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
+
+ // K8SDeploymentNameKey is the attribute Key conforming to the
+ // "k8s.deployment.name" semantic conventions. It represents the name of
+ // the Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
+
+ // K8SDeploymentUIDKey is the attribute Key conforming to the
+ // "k8s.deployment.uid" semantic conventions. It represents the UID of the
+ // Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
+
+ // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name"
+ // semantic conventions. It represents the name of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SJobNameKey = attribute.Key("k8s.job.name")
+
+ // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid"
+ // semantic conventions. It represents the UID of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SJobUIDKey = attribute.Key("k8s.job.uid")
+
+ // K8SNamespaceNameKey is the attribute Key conforming to the
+ // "k8s.namespace.name" semantic conventions. It represents the name of the
+ // namespace that the pod is running in.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'default'
+ K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
+
+ // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
+ // semantic conventions. It represents the name of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'node-1'
+ K8SNodeNameKey = attribute.Key("k8s.node.name")
+
+ // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid"
+ // semantic conventions. It represents the UID of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2'
+ K8SNodeUIDKey = attribute.Key("k8s.node.uid")
+
+ // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name"
+ // semantic conventions. It represents the name of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-pod-autoconf'
+ K8SPodNameKey = attribute.Key("k8s.pod.name")
+
+ // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid"
+ // semantic conventions. It represents the UID of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SPodUIDKey = attribute.Key("k8s.pod.uid")
+
+ // K8SReplicaSetNameKey is the attribute Key conforming to the
+ // "k8s.replicaset.name" semantic conventions. It represents the name of
+ // the ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
+
+ // K8SReplicaSetUIDKey is the attribute Key conforming to the
+ // "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+ // ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
+
+ // K8SStatefulSetNameKey is the attribute Key conforming to the
+ // "k8s.statefulset.name" semantic conventions. It represents the name of
+ // the StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
+
+ // K8SStatefulSetUIDKey is the attribute Key conforming to the
+ // "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+ // StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
+)
+
+// K8SClusterName returns an attribute KeyValue conforming to the
+// "k8s.cluster.name" semantic conventions. It represents the name of the
+// cluster.
+func K8SClusterName(val string) attribute.KeyValue {
+ return K8SClusterNameKey.String(val)
+}
+
+// K8SClusterUID returns an attribute KeyValue conforming to the
+// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
+// cluster, set to the UID of the `kube-system` namespace.
+func K8SClusterUID(val string) attribute.KeyValue {
+ return K8SClusterUIDKey.String(val)
+}
+
+// K8SContainerName returns an attribute KeyValue conforming to the
+// "k8s.container.name" semantic conventions. It represents the name of the
+// Container from Pod specification, must be unique within a Pod. Container
+// runtime usually uses different globally unique name (`container.name`).
+func K8SContainerName(val string) attribute.KeyValue {
+ return K8SContainerNameKey.String(val)
+}
+
+// K8SContainerRestartCount returns an attribute KeyValue conforming to the
+// "k8s.container.restart_count" semantic conventions. It represents the number
+// of times the container was restarted. This attribute can be used to identify
+// a particular container (running or stopped) within a container spec.
+func K8SContainerRestartCount(val int) attribute.KeyValue {
+ return K8SContainerRestartCountKey.Int(val)
+}
+
+// K8SCronJobName returns an attribute KeyValue conforming to the
+// "k8s.cronjob.name" semantic conventions. It represents the name of the
+// CronJob.
+func K8SCronJobName(val string) attribute.KeyValue {
+ return K8SCronJobNameKey.String(val)
+}
+
+// K8SCronJobUID returns an attribute KeyValue conforming to the
+// "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+// CronJob.
+func K8SCronJobUID(val string) attribute.KeyValue {
+ return K8SCronJobUIDKey.String(val)
+}
+
+// K8SDaemonSetName returns an attribute KeyValue conforming to the
+// "k8s.daemonset.name" semantic conventions. It represents the name of the
+// DaemonSet.
+func K8SDaemonSetName(val string) attribute.KeyValue {
+ return K8SDaemonSetNameKey.String(val)
+}
+
+// K8SDaemonSetUID returns an attribute KeyValue conforming to the
+// "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+// DaemonSet.
+func K8SDaemonSetUID(val string) attribute.KeyValue {
+ return K8SDaemonSetUIDKey.String(val)
+}
+
+// K8SDeploymentName returns an attribute KeyValue conforming to the
+// "k8s.deployment.name" semantic conventions. It represents the name of the
+// Deployment.
+func K8SDeploymentName(val string) attribute.KeyValue {
+ return K8SDeploymentNameKey.String(val)
+}
+
+// K8SDeploymentUID returns an attribute KeyValue conforming to the
+// "k8s.deployment.uid" semantic conventions. It represents the UID of the
+// Deployment.
+func K8SDeploymentUID(val string) attribute.KeyValue {
+ return K8SDeploymentUIDKey.String(val)
+}
+
+// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name"
+// semantic conventions. It represents the name of the Job.
+func K8SJobName(val string) attribute.KeyValue {
+ return K8SJobNameKey.String(val)
+}
+
+// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid"
+// semantic conventions. It represents the UID of the Job.
+func K8SJobUID(val string) attribute.KeyValue {
+ return K8SJobUIDKey.String(val)
+}
+
+// K8SNamespaceName returns an attribute KeyValue conforming to the
+// "k8s.namespace.name" semantic conventions. It represents the name of the
+// namespace that the pod is running in.
+func K8SNamespaceName(val string) attribute.KeyValue {
+ return K8SNamespaceNameKey.String(val)
+}
+
+// K8SNodeName returns an attribute KeyValue conforming to the
+// "k8s.node.name" semantic conventions. It represents the name of the Node.
+func K8SNodeName(val string) attribute.KeyValue {
+ return K8SNodeNameKey.String(val)
+}
+
+// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid"
+// semantic conventions. It represents the UID of the Node.
+func K8SNodeUID(val string) attribute.KeyValue {
+ return K8SNodeUIDKey.String(val)
+}
+
+// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name"
+// semantic conventions. It represents the name of the Pod.
+func K8SPodName(val string) attribute.KeyValue {
+ return K8SPodNameKey.String(val)
+}
+
+// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid"
+// semantic conventions. It represents the UID of the Pod.
+func K8SPodUID(val string) attribute.KeyValue {
+ return K8SPodUIDKey.String(val)
+}
+
+// K8SReplicaSetName returns an attribute KeyValue conforming to the
+// "k8s.replicaset.name" semantic conventions. It represents the name of the
+// ReplicaSet.
+func K8SReplicaSetName(val string) attribute.KeyValue {
+ return K8SReplicaSetNameKey.String(val)
+}
+
+// K8SReplicaSetUID returns an attribute KeyValue conforming to the
+// "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+// ReplicaSet.
+func K8SReplicaSetUID(val string) attribute.KeyValue {
+ return K8SReplicaSetUIDKey.String(val)
+}
+
+// K8SStatefulSetName returns an attribute KeyValue conforming to the
+// "k8s.statefulset.name" semantic conventions. It represents the name of the
+// StatefulSet.
+func K8SStatefulSetName(val string) attribute.KeyValue {
+ return K8SStatefulSetNameKey.String(val)
+}
+
+// K8SStatefulSetUID returns an attribute KeyValue conforming to the
+// "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+// StatefulSet.
+func K8SStatefulSetUID(val string) attribute.KeyValue {
+ return K8SStatefulSetUIDKey.String(val)
+}
+
+// An OCI image manifest.
+const (
+ // OciManifestDigestKey is the attribute Key conforming to the
+ // "oci.manifest.digest" semantic conventions. It represents the digest of
+ // the OCI image manifest. For container images specifically is the digest
+ // by which the container image is known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4'
+ // Note: Follows [OCI Image Manifest
+ // Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md),
+ // and specifically the [Digest
+ // property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
+ // An example can be found in [Example Image
+ // Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest).
+ OciManifestDigestKey = attribute.Key("oci.manifest.digest")
+)
+
+// OciManifestDigest returns an attribute KeyValue conforming to the
+// "oci.manifest.digest" semantic conventions. It represents the digest of the
+// OCI image manifest. For container images specifically is the digest by which
+// the container image is known.
+func OciManifestDigest(val string) attribute.KeyValue {
+ return OciManifestDigestKey.String(val)
+}
+
+// The operating system (OS) on which the process represented by this resource
+// is running.
+const (
+ // OSBuildIDKey is the attribute Key conforming to the "os.build_id"
+ // semantic conventions. It represents the unique identifier for a
+ // particular build or compilation of the operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TQ3C.230805.001.B2', '20E247', '22621'
+ OSBuildIDKey = attribute.Key("os.build_id")
+
+ // OSDescriptionKey is the attribute Key conforming to the "os.description"
+ // semantic conventions. It represents the human readable (not intended to
+ // be parsed) OS version information, like e.g. reported by `ver` or
+ // `lsb_release -a` commands.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1
+ // LTS'
+ OSDescriptionKey = attribute.Key("os.description")
+
+ // OSNameKey is the attribute Key conforming to the "os.name" semantic
+ // conventions. It represents the human readable operating system name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iOS', 'Android', 'Ubuntu'
+ OSNameKey = attribute.Key("os.name")
+
+ // OSTypeKey is the attribute Key conforming to the "os.type" semantic
+ // conventions. It represents the operating system type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ OSTypeKey = attribute.Key("os.type")
+
+ // OSVersionKey is the attribute Key conforming to the "os.version"
+ // semantic conventions. It represents the version string of the operating
+ // system as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.2.1', '18.04.1'
+ OSVersionKey = attribute.Key("os.version")
+)
+
+var (
+ // Microsoft Windows
+ OSTypeWindows = OSTypeKey.String("windows")
+ // Linux
+ OSTypeLinux = OSTypeKey.String("linux")
+ // Apple Darwin
+ OSTypeDarwin = OSTypeKey.String("darwin")
+ // FreeBSD
+ OSTypeFreeBSD = OSTypeKey.String("freebsd")
+ // NetBSD
+ OSTypeNetBSD = OSTypeKey.String("netbsd")
+ // OpenBSD
+ OSTypeOpenBSD = OSTypeKey.String("openbsd")
+ // DragonFly BSD
+ OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd")
+ // HP-UX (Hewlett Packard Unix)
+ OSTypeHPUX = OSTypeKey.String("hpux")
+ // AIX (Advanced Interactive eXecutive)
+ OSTypeAIX = OSTypeKey.String("aix")
+ // SunOS, Oracle Solaris
+ OSTypeSolaris = OSTypeKey.String("solaris")
+ // IBM z/OS
+ OSTypeZOS = OSTypeKey.String("z_os")
+)
+
+// OSBuildID returns an attribute KeyValue conforming to the "os.build_id"
+// semantic conventions. It represents the unique identifier for a particular
+// build or compilation of the operating system.
+func OSBuildID(val string) attribute.KeyValue {
+ return OSBuildIDKey.String(val)
+}
+
+// OSDescription returns an attribute KeyValue conforming to the
+// "os.description" semantic conventions. It represents the human readable (not
+// intended to be parsed) OS version information, like e.g. reported by `ver`
+// or `lsb_release -a` commands.
+func OSDescription(val string) attribute.KeyValue {
+ return OSDescriptionKey.String(val)
+}
+
+// OSName returns an attribute KeyValue conforming to the "os.name" semantic
+// conventions. It represents the human readable operating system name.
+func OSName(val string) attribute.KeyValue {
+ return OSNameKey.String(val)
+}
+
+// OSVersion returns an attribute KeyValue conforming to the "os.version"
+// semantic conventions. It represents the version string of the operating
+// system as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func OSVersion(val string) attribute.KeyValue {
+ return OSVersionKey.String(val)
+}
+
+// An operating system process.
+const (
+ // ProcessCommandKey is the attribute Key conforming to the
+ // "process.command" semantic conventions. It represents the command used
+ // to launch the process (i.e. the command name). On Linux based systems,
+ // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can
+ // be set to the first parameter extracted from `GetCommandLineW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otelcol'
+ ProcessCommandKey = attribute.Key("process.command")
+
+ // ProcessCommandArgsKey is the attribute Key conforming to the
+ // "process.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) as received
+ // by the process. On Linux-based systems (and some other Unixoid systems
+ // supporting procfs), can be set according to the list of null-delimited
+ // strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+ // this would be the full argv vector passed to `main`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otecol', '--config=config.yaml'
+ ProcessCommandArgsKey = attribute.Key("process.command_args")
+
+ // ProcessCommandLineKey is the attribute Key conforming to the
+ // "process.command_line" semantic conventions. It represents the full
+ // command used to launch the process as a single string representing the
+ // full command. On Windows, can be set to the result of `GetCommandLineW`.
+ // Do not set this if you have to assemble it just for monitoring; use
+ // `process.command_args` instead.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"'
+ ProcessCommandLineKey = attribute.Key("process.command_line")
+
+ // ProcessExecutableNameKey is the attribute Key conforming to the
+ // "process.executable.name" semantic conventions. It represents the name
+ // of the process executable. On Linux based systems, can be set to the
+ // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name
+ // of `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcol'
+ ProcessExecutableNameKey = attribute.Key("process.executable.name")
+
+ // ProcessExecutablePathKey is the attribute Key conforming to the
+ // "process.executable.path" semantic conventions. It represents the full
+ // path to the process executable. On Linux based systems, can be set to
+ // the target of `proc/[pid]/exe`. On Windows, can be set to the result of
+ // `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/bin/cmd/otelcol'
+ ProcessExecutablePathKey = attribute.Key("process.executable.path")
+
+ // ProcessOwnerKey is the attribute Key conforming to the "process.owner"
+ // semantic conventions. It represents the username of the user that owns
+ // the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessOwnerKey = attribute.Key("process.owner")
+
+ // ProcessParentPIDKey is the attribute Key conforming to the
+ // "process.parent_pid" semantic conventions. It represents the parent
+ // Process identifier (PPID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 111
+ ProcessParentPIDKey = attribute.Key("process.parent_pid")
+
+ // ProcessPIDKey is the attribute Key conforming to the "process.pid"
+ // semantic conventions. It represents the process identifier (PID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1234
+ ProcessPIDKey = attribute.Key("process.pid")
+
+ // ProcessRuntimeDescriptionKey is the attribute Key conforming to the
+ // "process.runtime.description" semantic conventions. It represents an
+ // additional description about the runtime of the process, for example a
+ // specific vendor customization of the runtime environment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0'
+ ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
+
+ // ProcessRuntimeNameKey is the attribute Key conforming to the
+ // "process.runtime.name" semantic conventions. It represents the name of
+ // the runtime of this process. For compiled native binaries, this SHOULD
+ // be the name of the compiler.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'OpenJDK Runtime Environment'
+ ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
+
+ // ProcessRuntimeVersionKey is the attribute Key conforming to the
+ // "process.runtime.version" semantic conventions. It represents the
+ // version of the runtime of this process, as returned by the runtime
+ // without modification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.0.2'
+ ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
+)
+
+// ProcessCommand returns an attribute KeyValue conforming to the
+// "process.command" semantic conventions. It represents the command used to
+// launch the process (i.e. the command name). On Linux based systems, can be
+// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to
+// the first parameter extracted from `GetCommandLineW`.
+func ProcessCommand(val string) attribute.KeyValue {
+ return ProcessCommandKey.String(val)
+}
+
+// ProcessCommandArgs returns an attribute KeyValue conforming to the
+// "process.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) as received by
+// the process. On Linux-based systems (and some other Unixoid systems
+// supporting procfs), can be set according to the list of null-delimited
+// strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+// this would be the full argv vector passed to `main`.
+func ProcessCommandArgs(val ...string) attribute.KeyValue {
+ return ProcessCommandArgsKey.StringSlice(val)
+}
+
+// ProcessCommandLine returns an attribute KeyValue conforming to the
+// "process.command_line" semantic conventions. It represents the full command
+// used to launch the process as a single string representing the full command.
+// On Windows, can be set to the result of `GetCommandLineW`. Do not set this
+// if you have to assemble it just for monitoring; use `process.command_args`
+// instead.
+func ProcessCommandLine(val string) attribute.KeyValue {
+ return ProcessCommandLineKey.String(val)
+}
+
+// ProcessExecutableName returns an attribute KeyValue conforming to the
+// "process.executable.name" semantic conventions. It represents the name of
+// the process executable. On Linux based systems, can be set to the `Name` in
+// `proc/[pid]/status`. On Windows, can be set to the base name of
+// `GetProcessImageFileNameW`.
+func ProcessExecutableName(val string) attribute.KeyValue {
+ return ProcessExecutableNameKey.String(val)
+}
+
+// ProcessExecutablePath returns an attribute KeyValue conforming to the
+// "process.executable.path" semantic conventions. It represents the full path
+// to the process executable. On Linux based systems, can be set to the target
+// of `proc/[pid]/exe`. On Windows, can be set to the result of
+// `GetProcessImageFileNameW`.
+func ProcessExecutablePath(val string) attribute.KeyValue {
+ return ProcessExecutablePathKey.String(val)
+}
+
+// ProcessOwner returns an attribute KeyValue conforming to the
+// "process.owner" semantic conventions. It represents the username of the user
+// that owns the process.
+func ProcessOwner(val string) attribute.KeyValue {
+ return ProcessOwnerKey.String(val)
+}
+
+// ProcessParentPID returns an attribute KeyValue conforming to the
+// "process.parent_pid" semantic conventions. It represents the parent Process
+// identifier (PPID).
+func ProcessParentPID(val int) attribute.KeyValue {
+ return ProcessParentPIDKey.Int(val)
+}
+
+// ProcessPID returns an attribute KeyValue conforming to the "process.pid"
+// semantic conventions. It represents the process identifier (PID).
+func ProcessPID(val int) attribute.KeyValue {
+ return ProcessPIDKey.Int(val)
+}
+
+// ProcessRuntimeDescription returns an attribute KeyValue conforming to the
+// "process.runtime.description" semantic conventions. It represents an
+// additional description about the runtime of the process, for example a
+// specific vendor customization of the runtime environment.
+func ProcessRuntimeDescription(val string) attribute.KeyValue {
+ return ProcessRuntimeDescriptionKey.String(val)
+}
+
+// ProcessRuntimeName returns an attribute KeyValue conforming to the
+// "process.runtime.name" semantic conventions. It represents the name of the
+// runtime of this process. For compiled native binaries, this SHOULD be the
+// name of the compiler.
+func ProcessRuntimeName(val string) attribute.KeyValue {
+ return ProcessRuntimeNameKey.String(val)
+}
+
+// ProcessRuntimeVersion returns an attribute KeyValue conforming to the
+// "process.runtime.version" semantic conventions. It represents the version of
+// the runtime of this process, as returned by the runtime without
+// modification.
+func ProcessRuntimeVersion(val string) attribute.KeyValue {
+ return ProcessRuntimeVersionKey.String(val)
+}
+
+// The Android platform on which the Android application is running.
+const (
+ // AndroidOSAPILevelKey is the attribute Key conforming to the
+ // "android.os.api_level" semantic conventions. It represents the uniquely
+ // identifies the framework API revision offered by a version
+ // (`os.version`) of the android operating system. More information can be
+ // found
+ // [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '33', '32'
+ AndroidOSAPILevelKey = attribute.Key("android.os.api_level")
+)
+
+// AndroidOSAPILevel returns an attribute KeyValue conforming to the
+// "android.os.api_level" semantic conventions. It represents the uniquely
+// identifies the framework API revision offered by a version (`os.version`) of
+// the android operating system. More information can be found
+// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+func AndroidOSAPILevel(val string) attribute.KeyValue {
+ return AndroidOSAPILevelKey.String(val)
+}
+
+// The web browser in which the application represented by the resource is
+// running. The `browser.*` attributes MUST be used only for resources that
+// represent applications running in a web browser (regardless of whether
+// running on a mobile or desktop device).
+const (
+ // BrowserBrandsKey is the attribute Key conforming to the "browser.brands"
+ // semantic conventions. It represents the array of brand name and version
+ // separated by a space
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.brands`).
+ BrowserBrandsKey = attribute.Key("browser.brands")
+
+ // BrowserLanguageKey is the attribute Key conforming to the
+ // "browser.language" semantic conventions. It represents the preferred
+ // language of the user using the browser
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'en', 'en-US', 'fr', 'fr-FR'
+ // Note: This value is intended to be taken from the Navigator API
+ // `navigator.language`.
+ BrowserLanguageKey = attribute.Key("browser.language")
+
+ // BrowserMobileKey is the attribute Key conforming to the "browser.mobile"
+ // semantic conventions. It represents a boolean that is true if the
+ // browser is running on a mobile device
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.mobile`). If unavailable, this attribute
+ // SHOULD be left unset.
+ BrowserMobileKey = attribute.Key("browser.mobile")
+
+ // BrowserPlatformKey is the attribute Key conforming to the
+ // "browser.platform" semantic conventions. It represents the platform on
+ // which the browser is running
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Windows', 'macOS', 'Android'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.platform`). If unavailable, the legacy
+ // `navigator.platform` API SHOULD NOT be used instead and this attribute
+ // SHOULD be left unset in order for the values to be consistent.
+ // The list of possible values is defined in the [W3C User-Agent Client
+ // Hints
+ // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
+ // Note that some (but not all) of these values can overlap with values in
+ // the [`os.type` and `os.name` attributes](./os.md). However, for
+ // consistency, the values in the `browser.platform` attribute should
+ // capture the exact value that the user agent provides.
+ BrowserPlatformKey = attribute.Key("browser.platform")
+)
+
+// BrowserBrands returns an attribute KeyValue conforming to the
+// "browser.brands" semantic conventions. It represents the array of brand name
+// and version separated by a space
+func BrowserBrands(val ...string) attribute.KeyValue {
+ return BrowserBrandsKey.StringSlice(val)
+}
+
+// BrowserLanguage returns an attribute KeyValue conforming to the
+// "browser.language" semantic conventions. It represents the preferred
+// language of the user using the browser
+func BrowserLanguage(val string) attribute.KeyValue {
+ return BrowserLanguageKey.String(val)
+}
+
+// BrowserMobile returns an attribute KeyValue conforming to the
+// "browser.mobile" semantic conventions. It represents a boolean that is true
+// if the browser is running on a mobile device
+func BrowserMobile(val bool) attribute.KeyValue {
+ return BrowserMobileKey.Bool(val)
+}
+
+// BrowserPlatform returns an attribute KeyValue conforming to the
+// "browser.platform" semantic conventions. It represents the platform on which
+// the browser is running
+func BrowserPlatform(val string) attribute.KeyValue {
+ return BrowserPlatformKey.String(val)
+}
+
+// Resources used by AWS Elastic Container Service (ECS).
+const (
+ // AWSECSClusterARNKey is the attribute Key conforming to the
+ // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
+ // [ECS
+ // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
+
+ // AWSECSContainerARNKey is the attribute Key conforming to the
+ // "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+ // Resource Name (ARN) of an [ECS container
+ // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'
+ AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn")
+
+ // AWSECSLaunchtypeKey is the attribute Key conforming to the
+ // "aws.ecs.launchtype" semantic conventions. It represents the [launch
+ // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // for an ECS task.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
+
+ // AWSECSTaskARNKey is the attribute Key conforming to the
+ // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an
+ // [ECS task
+ // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b'
+ AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn")
+
+ // AWSECSTaskFamilyKey is the attribute Key conforming to the
+ // "aws.ecs.task.family" semantic conventions. It represents the task
+ // definition family this task definition is a member of.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-family'
+ AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
+
+ // AWSECSTaskRevisionKey is the attribute Key conforming to the
+ // "aws.ecs.task.revision" semantic conventions. It represents the revision
+ // for this task definition.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '8', '26'
+ AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
+)
+
+var (
+ // ec2
+ AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2")
+ // fargate
+ AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate")
+)
+
+// AWSECSClusterARN returns an attribute KeyValue conforming to the
+// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS
+// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+func AWSECSClusterARN(val string) attribute.KeyValue {
+ return AWSECSClusterARNKey.String(val)
+}
+
+// AWSECSContainerARN returns an attribute KeyValue conforming to the
+// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+// Resource Name (ARN) of an [ECS container
+// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+func AWSECSContainerARN(val string) attribute.KeyValue {
+ return AWSECSContainerARNKey.String(val)
+}
+
+// AWSECSTaskARN returns an attribute KeyValue conforming to the
+// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS
+// task
+// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
+func AWSECSTaskARN(val string) attribute.KeyValue {
+ return AWSECSTaskARNKey.String(val)
+}
+
+// AWSECSTaskFamily returns an attribute KeyValue conforming to the
+// "aws.ecs.task.family" semantic conventions. It represents the task
+// definition family this task definition is a member of.
+func AWSECSTaskFamily(val string) attribute.KeyValue {
+ return AWSECSTaskFamilyKey.String(val)
+}
+
+// AWSECSTaskRevision returns an attribute KeyValue conforming to the
+// "aws.ecs.task.revision" semantic conventions. It represents the revision for
+// this task definition.
+func AWSECSTaskRevision(val string) attribute.KeyValue {
+ return AWSECSTaskRevisionKey.String(val)
+}
+
+// Resources used by AWS Elastic Kubernetes Service (EKS).
+const (
+ // AWSEKSClusterARNKey is the attribute Key conforming to the
+ // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an
+ // EKS cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
+)
+
+// AWSEKSClusterARN returns an attribute KeyValue conforming to the
+// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
+// cluster.
+func AWSEKSClusterARN(val string) attribute.KeyValue {
+ return AWSEKSClusterARNKey.String(val)
+}
+
+// Resources specific to Amazon Web Services.
+const (
+ // AWSLogGroupARNsKey is the attribute Key conforming to the
+ // "aws.log.group.arns" semantic conventions. It represents the Amazon
+ // Resource Name(s) (ARN) of the AWS log group(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'
+ // Note: See the [log group ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns")
+
+ // AWSLogGroupNamesKey is the attribute Key conforming to the
+ // "aws.log.group.names" semantic conventions. It represents the name(s) of
+ // the AWS log group(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/aws/lambda/my-function', 'opentelemetry-service'
+ // Note: Multiple log groups must be supported for cases like
+ // multi-container applications, where a single application has sidecar
+ // containers, and each write to their own log group.
+ AWSLogGroupNamesKey = attribute.Key("aws.log.group.names")
+
+ // AWSLogStreamARNsKey is the attribute Key conforming to the
+ // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of
+ // the AWS log stream(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ // Note: See the [log stream ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ // One log group can contain several log streams, so these ARNs necessarily
+ // identify both a log group and a log stream.
+ AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns")
+
+ // AWSLogStreamNamesKey is the attribute Key conforming to the
+ // "aws.log.stream.names" semantic conventions. It represents the name(s)
+ // of the AWS log stream(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
+)
+
+// AWSLogGroupARNs returns an attribute KeyValue conforming to the
+// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
+// Name(s) (ARN) of the AWS log group(s).
+func AWSLogGroupARNs(val ...string) attribute.KeyValue {
+ return AWSLogGroupARNsKey.StringSlice(val)
+}
+
+// AWSLogGroupNames returns an attribute KeyValue conforming to the
+// "aws.log.group.names" semantic conventions. It represents the name(s) of the
+// AWS log group(s) an application is writing to.
+func AWSLogGroupNames(val ...string) attribute.KeyValue {
+ return AWSLogGroupNamesKey.StringSlice(val)
+}
+
+// AWSLogStreamARNs returns an attribute KeyValue conforming to the
+// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
+// AWS log stream(s).
+func AWSLogStreamARNs(val ...string) attribute.KeyValue {
+ return AWSLogStreamARNsKey.StringSlice(val)
+}
+
+// AWSLogStreamNames returns an attribute KeyValue conforming to the
+// "aws.log.stream.names" semantic conventions. It represents the name(s) of
+// the AWS log stream(s) an application is writing to.
+func AWSLogStreamNames(val ...string) attribute.KeyValue {
+ return AWSLogStreamNamesKey.StringSlice(val)
+}
+
+// Resource used by Google Cloud Run.
+const (
+ // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.execution" semantic conventions. It represents the
+ // name of the Cloud Run
+ // [execution](https://cloud.google.com/run/docs/managing/job-executions)
+ // being run for the Job, as set by the
+ // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'job-name-xxxx', 'sample-job-mdw84'
+ GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
+
+ // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.task_index" semantic conventions. It represents the
+ // index for a task within an execution as provided by the
+ // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1
+ GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
+)
+
+// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
+// of the Cloud Run
+// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
+// run for the Job, as set by the
+// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobExecution(val string) attribute.KeyValue {
+ return GCPCloudRunJobExecutionKey.String(val)
+}
+
+// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
+// for a task within an execution as provided by the
+// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
+ return GCPCloudRunJobTaskIndexKey.Int(val)
+}
+
+// Resources used by Google Compute Engine (GCE).
+const (
+ // GCPGceInstanceHostnameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.hostname" semantic conventions. It represents the
+ // hostname of a GCE instance. This is the full value of the default or
+ // [custom
+ // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-host1234.example.com',
+ // 'sample-vm.us-west1-b.c.my-project.internal'
+ GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
+
+ // GCPGceInstanceNameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.name" semantic conventions. It represents the instance
+ // name of a GCE instance. This is the value provided by `host.name`, the
+ // visible name of the instance in the Cloud Console UI, and the prefix for
+ // the default hostname of the instance as defined by the [default internal
+ // DNS
+ // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-1', 'my-vm-name'
+ GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
+)
+
+// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
+// of a GCE instance. This is the full value of the default or [custom
+// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+func GCPGceInstanceHostname(val string) attribute.KeyValue {
+ return GCPGceInstanceHostnameKey.String(val)
+}
+
+// GCPGceInstanceName returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.name" semantic conventions. It represents the instance
+// name of a GCE instance. This is the value provided by `host.name`, the
+// visible name of the instance in the Cloud Console UI, and the prefix for the
+// default hostname of the instance as defined by the [default internal DNS
+// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+func GCPGceInstanceName(val string) attribute.KeyValue {
+ return GCPGceInstanceNameKey.String(val)
+}
+
+// Heroku dyno metadata
+const (
+ // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
+ // semantic conventions. It represents the unique identifier for the
+ // application
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da'
+ HerokuAppIDKey = attribute.Key("heroku.app.id")
+
+ // HerokuReleaseCommitKey is the attribute Key conforming to the
+ // "heroku.release.commit" semantic conventions. It represents the commit
+ // hash for the current release
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec'
+ HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
+
+ // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
+ // "heroku.release.creation_timestamp" semantic conventions. It represents
+ // the time and date the release was created
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2022-10-23T18:00:42Z'
+ HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
+)
+
+// HerokuAppID returns an attribute KeyValue conforming to the
+// "heroku.app.id" semantic conventions. It represents the unique identifier
+// for the application
+func HerokuAppID(val string) attribute.KeyValue {
+ return HerokuAppIDKey.String(val)
+}
+
+// HerokuReleaseCommit returns an attribute KeyValue conforming to the
+// "heroku.release.commit" semantic conventions. It represents the commit hash
+// for the current release
+func HerokuReleaseCommit(val string) attribute.KeyValue {
+ return HerokuReleaseCommitKey.String(val)
+}
+
+// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming
+// to the "heroku.release.creation_timestamp" semantic conventions. It
+// represents the time and date the release was created
+func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
+ return HerokuReleaseCreationTimestampKey.String(val)
+}
+
+// The software deployment.
+const (
+ // DeploymentEnvironmentKey is the attribute Key conforming to the
+ // "deployment.environment" semantic conventions. It represents the name of
+ // the [deployment
+ // environment](https://wikipedia.org/wiki/Deployment_environment) (aka
+ // deployment tier).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'staging', 'production'
+ // Note: `deployment.environment` does not affect the uniqueness
+ // constraints defined through
+ // the `service.namespace`, `service.name` and `service.instance.id`
+ // resource attributes.
+ // This implies that resources carrying the following attribute
+ // combinations MUST be
+ // considered to be identifying the same service:
+ //
+ // * `service.name=frontend`, `deployment.environment=production`
+ // * `service.name=frontend`, `deployment.environment=staging`.
+ DeploymentEnvironmentKey = attribute.Key("deployment.environment")
+)
+
+// DeploymentEnvironment returns an attribute KeyValue conforming to the
+// "deployment.environment" semantic conventions. It represents the name of the
+// [deployment environment](https://wikipedia.org/wiki/Deployment_environment)
+// (aka deployment tier).
+func DeploymentEnvironment(val string) attribute.KeyValue {
+ return DeploymentEnvironmentKey.String(val)
+}
+
+// A serverless instance.
+const (
+ // FaaSInstanceKey is the attribute Key conforming to the "faas.instance"
+ // semantic conventions. It represents the execution environment ID as a
+ // string, that will be potentially reused for other invocations to the
+ // same function/function version.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de'
+ // Note: * **AWS Lambda:** Use the (full) log stream name.
+ FaaSInstanceKey = attribute.Key("faas.instance")
+
+ // FaaSMaxMemoryKey is the attribute Key conforming to the
+ // "faas.max_memory" semantic conventions. It represents the amount of
+ // memory available to the serverless function converted to Bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 134217728
+ // Note: It's recommended to set this attribute since e.g. too little
+ // memory can easily stop a Java AWS Lambda function from working
+ // correctly. On AWS Lambda, the environment variable
+ // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must
+ // be multiplied by 1,048,576).
+ FaaSMaxMemoryKey = attribute.Key("faas.max_memory")
+
+ // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic
+ // conventions. It represents the name of the single function that this
+ // runtime instance executes.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'my-function', 'myazurefunctionapp/some-function-name'
+ // Note: This is the name of the function as configured/deployed on the
+ // FaaS
+ // platform and is usually different from the name of the callback
+ // function (which may be stored in the
+ // [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes)
+ // span attributes).
+ //
+ // For some cloud providers, the above definition is ambiguous. The
+ // following
+ // definition of function name MUST be used for this attribute
+ // (and consequently the span name) for the listed cloud
+ // providers/products:
+ //
+ // * **Azure:** The full name `/`, i.e., function app name
+ // followed by a forward slash followed by the function name (this form
+ // can also be seen in the resource JSON for the function).
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider (see also the `cloud.resource_id` attribute).
+ FaaSNameKey = attribute.Key("faas.name")
+
+ // FaaSVersionKey is the attribute Key conforming to the "faas.version"
+ // semantic conventions. It represents the immutable version of the
+ // function being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '26', 'pinkfroid-00002'
+ // Note: Depending on the cloud provider and platform, use:
+ //
+ // * **AWS Lambda:** The [function
+ // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
+ // (an integer represented as a decimal string).
+ // * **Google Cloud Run (Services):** The
+ // [revision](https://cloud.google.com/run/docs/managing/revisions)
+ // (i.e., the function name plus the revision suffix).
+ // * **Google Cloud Functions:** The value of the
+ // [`K_REVISION` environment
+ // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
+ // * **Azure Functions:** Not applicable. Do not set this attribute.
+ FaaSVersionKey = attribute.Key("faas.version")
+)
+
+// FaaSInstance returns an attribute KeyValue conforming to the
+// "faas.instance" semantic conventions. It represents the execution
+// environment ID as a string, that will be potentially reused for other
+// invocations to the same function/function version.
+func FaaSInstance(val string) attribute.KeyValue {
+ return FaaSInstanceKey.String(val)
+}
+
+// FaaSMaxMemory returns an attribute KeyValue conforming to the
+// "faas.max_memory" semantic conventions. It represents the amount of memory
+// available to the serverless function converted to Bytes.
+func FaaSMaxMemory(val int) attribute.KeyValue {
+ return FaaSMaxMemoryKey.Int(val)
+}
+
+// FaaSName returns an attribute KeyValue conforming to the "faas.name"
+// semantic conventions. It represents the name of the single function that
+// this runtime instance executes.
+func FaaSName(val string) attribute.KeyValue {
+ return FaaSNameKey.String(val)
+}
+
+// FaaSVersion returns an attribute KeyValue conforming to the
+// "faas.version" semantic conventions. It represents the immutable version of
+// the function being executed.
+func FaaSVersion(val string) attribute.KeyValue {
+ return FaaSVersionKey.String(val)
+}
+
+// A service instance.
+const (
+ // ServiceNameKey is the attribute Key conforming to the "service.name"
+ // semantic conventions. It represents the logical name of the service.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'shoppingcart'
+ // Note: MUST be the same for all instances of horizontally scaled
+ // services. If the value was not specified, SDKs MUST fallback to
+ // `unknown_service:` concatenated with
+ // [`process.executable.name`](process.md#process), e.g.
+ // `unknown_service:bash`. If `process.executable.name` is not available,
+ // the value MUST be set to `unknown_service`.
+ ServiceNameKey = attribute.Key("service.name")
+
+ // ServiceVersionKey is the attribute Key conforming to the
+ // "service.version" semantic conventions. It represents the version string
+ // of the service API or implementation. The format is not defined by these
+ // conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2.0.0', 'a01dbef8a'
+ ServiceVersionKey = attribute.Key("service.version")
+)
+
+// ServiceName returns an attribute KeyValue conforming to the
+// "service.name" semantic conventions. It represents the logical name of the
+// service.
+func ServiceName(val string) attribute.KeyValue {
+ return ServiceNameKey.String(val)
+}
+
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation. The format is not defined by these
+// conventions.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
+// A service instance.
+const (
+ // ServiceInstanceIDKey is the attribute Key conforming to the
+ // "service.instance.id" semantic conventions. It represents the string ID
+ // of the service instance.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-k8s-pod-deployment-1',
+ // '627cc493-f310-47de-96bd-71410b7dec09'
+ // Note: MUST be unique for each instance of the same
+ // `service.namespace,service.name` pair (in other words
+ // `service.namespace,service.name,service.instance.id` triplet MUST be
+ // globally unique). The ID helps to distinguish instances of the same
+ // service that exist at the same time (e.g. instances of a horizontally
+ // scaled service). It is preferable for the ID to be persistent and stay
+ // the same for the lifetime of the service instance, however it is
+ // acceptable that the ID is ephemeral and changes during important
+ // lifetime events for the service (e.g. service restarts). If the service
+ // has no inherent unique ID that can be used as the value of this
+ // attribute it is recommended to generate a random Version 1 or Version 4
+ // RFC 4122 UUID (services aiming for reproducible UUIDs may also use
+ // Version 5, see RFC 4122 for more recommendations).
+ ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceNamespaceKey is the attribute Key conforming to the
+ // "service.namespace" semantic conventions. It represents a namespace for
+ // `service.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Shop'
+ // Note: A string value having a meaning that helps to distinguish a group
+ // of services, for example the team name that owns a group of services.
+ // `service.name` is expected to be unique within the same namespace. If
+ // `service.namespace` is not specified in the Resource then `service.name`
+ // is expected to be unique for all services that have no explicit
+ // namespace defined (so the empty/unspecified namespace is simply one more
+ // valid namespace). Zero-length namespace string is assumed equal to
+ // unspecified namespace.
+ ServiceNamespaceKey = attribute.Key("service.namespace")
+)
+
+// ServiceInstanceID returns an attribute KeyValue conforming to the
+// "service.instance.id" semantic conventions. It represents the string ID of
+// the service instance.
+func ServiceInstanceID(val string) attribute.KeyValue {
+ return ServiceInstanceIDKey.String(val)
+}
+
+// ServiceNamespace returns an attribute KeyValue conforming to the
+// "service.namespace" semantic conventions. It represents a namespace for
+// `service.name`.
+func ServiceNamespace(val string) attribute.KeyValue {
+ return ServiceNamespaceKey.String(val)
+}
+
+// The telemetry SDK used to capture data recorded by the instrumentation
+// libraries.
+const (
+ // TelemetrySDKLanguageKey is the attribute Key conforming to the
+ // "telemetry.sdk.language" semantic conventions. It represents the
+ // language of the telemetry SDK.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
+
+ // TelemetrySDKNameKey is the attribute Key conforming to the
+ // "telemetry.sdk.name" semantic conventions. It represents the name of the
+ // telemetry SDK as defined above.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute
+ // to `opentelemetry`.
+ // If another SDK, like a fork or a vendor-provided implementation, is
+ // used, this SDK MUST set the
+ // `telemetry.sdk.name` attribute to the fully-qualified class or module
+ // name of this SDK's main entry point
+ // or another suitable identifier depending on the language.
+ // The identifier `opentelemetry` is reserved and MUST NOT be used in this
+ // case.
+ // All custom identifiers SHOULD be stable across different versions of an
+ // implementation.
+ TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
+
+ // TelemetrySDKVersionKey is the attribute Key conforming to the
+ // "telemetry.sdk.version" semantic conventions. It represents the version
+ // string of the telemetry SDK.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: '1.2.3'
+ TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
+)
+
+var (
+ // cpp
+ TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp")
+ // dotnet
+ TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet")
+ // erlang
+ TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang")
+ // go
+ TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go")
+ // java
+ TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java")
+ // nodejs
+ TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs")
+ // php
+ TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php")
+ // python
+ TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
+ // ruby
+ TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
+ // rust
+ TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
+ // swift
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
+ // webjs
+ TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs")
+)
+
+// TelemetrySDKName returns an attribute KeyValue conforming to the
+// "telemetry.sdk.name" semantic conventions. It represents the name of the
+// telemetry SDK as defined above.
+func TelemetrySDKName(val string) attribute.KeyValue {
+ return TelemetrySDKNameKey.String(val)
+}
+
+// TelemetrySDKVersion returns an attribute KeyValue conforming to the
+// "telemetry.sdk.version" semantic conventions. It represents the version
+// string of the telemetry SDK.
+func TelemetrySDKVersion(val string) attribute.KeyValue {
+ return TelemetrySDKVersionKey.String(val)
+}
+
+// The telemetry SDK used to capture data recorded by the instrumentation
+// libraries.
+const (
+ // TelemetryDistroNameKey is the attribute Key conforming to the
+ // "telemetry.distro.name" semantic conventions. It represents the name of
+ // the auto instrumentation agent or distribution, if used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'parts-unlimited-java'
+ // Note: Official auto instrumentation agents and distributions SHOULD set
+ // the `telemetry.distro.name` attribute to
+ // a string starting with `opentelemetry-`, e.g.
+ // `opentelemetry-java-instrumentation`.
+ TelemetryDistroNameKey = attribute.Key("telemetry.distro.name")
+
+ // TelemetryDistroVersionKey is the attribute Key conforming to the
+ // "telemetry.distro.version" semantic conventions. It represents the
+ // version string of the auto instrumentation agent or distribution, if
+ // used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2.3'
+ TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version")
+)
+
+// TelemetryDistroName returns an attribute KeyValue conforming to the
+// "telemetry.distro.name" semantic conventions. It represents the name of the
+// auto instrumentation agent or distribution, if used.
+func TelemetryDistroName(val string) attribute.KeyValue {
+ return TelemetryDistroNameKey.String(val)
+}
+
+// TelemetryDistroVersion returns an attribute KeyValue conforming to the
+// "telemetry.distro.version" semantic conventions. It represents the version
+// string of the auto instrumentation agent or distribution, if used.
+func TelemetryDistroVersion(val string) attribute.KeyValue {
+ return TelemetryDistroVersionKey.String(val)
+}
+
+// Resource describing the packaged software running the application code. Web
+// engines are typically executed using process.runtime.
+const (
+ // WebEngineDescriptionKey is the attribute Key conforming to the
+ // "webengine.description" semantic conventions. It represents the
+ // additional description of the web engine (e.g. detailed version and
+ // edition information).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) -
+ // 2.2.2.Final'
+ WebEngineDescriptionKey = attribute.Key("webengine.description")
+
+ // WebEngineNameKey is the attribute Key conforming to the "webengine.name"
+ // semantic conventions. It represents the name of the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'WildFly'
+ WebEngineNameKey = attribute.Key("webengine.name")
+
+ // WebEngineVersionKey is the attribute Key conforming to the
+ // "webengine.version" semantic conventions. It represents the version of
+ // the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '21.0.0'
+ WebEngineVersionKey = attribute.Key("webengine.version")
+)
+
+// WebEngineDescription returns an attribute KeyValue conforming to the
+// "webengine.description" semantic conventions. It represents the additional
+// description of the web engine (e.g. detailed version and edition
+// information).
+func WebEngineDescription(val string) attribute.KeyValue {
+ return WebEngineDescriptionKey.String(val)
+}
+
+// WebEngineName returns an attribute KeyValue conforming to the
+// "webengine.name" semantic conventions. It represents the name of the web
+// engine.
+func WebEngineName(val string) attribute.KeyValue {
+ return WebEngineNameKey.String(val)
+}
+
+// WebEngineVersion returns an attribute KeyValue conforming to the
+// "webengine.version" semantic conventions. It represents the version of the
+// web engine.
+func WebEngineVersion(val string) attribute.KeyValue {
+ return WebEngineVersionKey.String(val)
+}
+
+// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's
+// concepts.
+const (
+ // OTelScopeNameKey is the attribute Key conforming to the
+ // "otel.scope.name" semantic conventions. It represents the name of the
+ // instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ OTelScopeNameKey = attribute.Key("otel.scope.name")
+
+ // OTelScopeVersionKey is the attribute Key conforming to the
+ // "otel.scope.version" semantic conventions. It represents the version of
+ // the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.0.0'
+ OTelScopeVersionKey = attribute.Key("otel.scope.version")
+)
+
+// OTelScopeName returns an attribute KeyValue conforming to the
+// "otel.scope.name" semantic conventions. It represents the name of the
+// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+func OTelScopeName(val string) attribute.KeyValue {
+ return OTelScopeNameKey.String(val)
+}
+
+// OTelScopeVersion returns an attribute KeyValue conforming to the
+// "otel.scope.version" semantic conventions. It represents the version of the
+// instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+func OTelScopeVersion(val string) attribute.KeyValue {
+ return OTelScopeVersionKey.String(val)
+}
+
+// Span attributes used by non-OTLP exporters to represent OpenTelemetry
+// Scope's concepts.
+const (
+ // OTelLibraryNameKey is the attribute Key conforming to the
+ // "otel.library.name" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ // Deprecated: use the `otel.scope.name` attribute.
+ OTelLibraryNameKey = attribute.Key("otel.library.name")
+
+ // OTelLibraryVersionKey is the attribute Key conforming to the
+ // "otel.library.version" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '1.0.0'
+ // Deprecated: use the `otel.scope.version` attribute.
+ OTelLibraryVersionKey = attribute.Key("otel.library.version")
+)
+
+// OTelLibraryName returns an attribute KeyValue conforming to the
+// "otel.library.name" semantic conventions.
+//
+// Deprecated: use the `otel.scope.name` attribute.
+func OTelLibraryName(val string) attribute.KeyValue {
+ return OTelLibraryNameKey.String(val)
+}
+
+// OTelLibraryVersion returns an attribute KeyValue conforming to the
+// "otel.library.version" semantic conventions.
+//
+// Deprecated: use the `otel.scope.version` attribute.
+func OTelLibraryVersion(val string) attribute.KeyValue {
+ return OTelLibraryVersionKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go
new file mode 100644
index 00000000000..fe80b1731d0
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.24.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go
new file mode 100644
index 00000000000..c1718234e52
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go
@@ -0,0 +1,1323 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Operations that access some remote service.
+const (
+ // PeerServiceKey is the attribute Key conforming to the "peer.service"
+ // semantic conventions. It represents the
+ // [`service.name`](/docs/resource/README.md#service) of the remote
+ // service. SHOULD be equal to the actual `service.name` resource attribute
+ // of the remote service if any.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AuthTokenCache'
+ PeerServiceKey = attribute.Key("peer.service")
+)
+
+// PeerService returns an attribute KeyValue conforming to the
+// "peer.service" semantic conventions. It represents the
+// [`service.name`](/docs/resource/README.md#service) of the remote service.
+// SHOULD be equal to the actual `service.name` resource attribute of the
+// remote service if any.
+func PeerService(val string) attribute.KeyValue {
+ return PeerServiceKey.String(val)
+}
+
+// These attributes may be used for any operation with an authenticated and/or
+// authorized enduser.
+const (
+ // EnduserIDKey is the attribute Key conforming to the "enduser.id"
+ // semantic conventions. It represents the username or client_id extracted
+ // from the access token or
+ // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header
+ // in the inbound request from outside the system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'username'
+ EnduserIDKey = attribute.Key("enduser.id")
+
+ // EnduserRoleKey is the attribute Key conforming to the "enduser.role"
+ // semantic conventions. It represents the actual/assumed role the client
+ // is making the request under extracted from token or application security
+ // context.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'admin'
+ EnduserRoleKey = attribute.Key("enduser.role")
+
+ // EnduserScopeKey is the attribute Key conforming to the "enduser.scope"
+ // semantic conventions. It represents the scopes or granted authorities
+ // the client currently possesses extracted from token or application
+ // security context. The value would come from the scope associated with an
+ // [OAuth 2.0 Access
+ // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+ // value in a [SAML 2.0
+ // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read:message, write:files'
+ EnduserScopeKey = attribute.Key("enduser.scope")
+)
+
+// EnduserID returns an attribute KeyValue conforming to the "enduser.id"
+// semantic conventions. It represents the username or client_id extracted from
+// the access token or
+// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in
+// the inbound request from outside the system.
+func EnduserID(val string) attribute.KeyValue {
+ return EnduserIDKey.String(val)
+}
+
+// EnduserRole returns an attribute KeyValue conforming to the
+// "enduser.role" semantic conventions. It represents the actual/assumed role
+// the client is making the request under extracted from token or application
+// security context.
+func EnduserRole(val string) attribute.KeyValue {
+ return EnduserRoleKey.String(val)
+}
+
+// EnduserScope returns an attribute KeyValue conforming to the
+// "enduser.scope" semantic conventions. It represents the scopes or granted
+// authorities the client currently possesses extracted from token or
+// application security context. The value would come from the scope associated
+// with an [OAuth 2.0 Access
+// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+// value in a [SAML 2.0
+// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+func EnduserScope(val string) attribute.KeyValue {
+ return EnduserScopeKey.String(val)
+}
+
+// These attributes allow to report this unit of code and therefore to provide
+// more context about the span.
+const (
+ // CodeColumnKey is the attribute Key conforming to the "code.column"
+ // semantic conventions. It represents the column number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 16
+ CodeColumnKey = attribute.Key("code.column")
+
+ // CodeFilepathKey is the attribute Key conforming to the "code.filepath"
+ // semantic conventions. It represents the source code file name that
+ // identifies the code unit as uniquely as possible (preferably an absolute
+ // file path).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/local/MyApplication/content_root/app/index.php'
+ CodeFilepathKey = attribute.Key("code.filepath")
+
+ // CodeFunctionKey is the attribute Key conforming to the "code.function"
+ // semantic conventions. It represents the method or function name, or
+ // equivalent (usually rightmost part of the code unit's name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'serveRequest'
+ CodeFunctionKey = attribute.Key("code.function")
+
+ // CodeLineNumberKey is the attribute Key conforming to the "code.lineno"
+ // semantic conventions. It represents the line number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ CodeLineNumberKey = attribute.Key("code.lineno")
+
+ // CodeNamespaceKey is the attribute Key conforming to the "code.namespace"
+ // semantic conventions. It represents the "namespace" within which
+ // `code.function` is defined. Usually the qualified class or module name,
+ // such that `code.namespace` + some separator + `code.function` form a
+ // unique identifier for the code unit.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.example.MyHTTPService'
+ CodeNamespaceKey = attribute.Key("code.namespace")
+
+ // CodeStacktraceKey is the attribute Key conforming to the
+ // "code.stacktrace" semantic conventions. It represents a stacktrace as a
+ // string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'at
+ // com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ CodeStacktraceKey = attribute.Key("code.stacktrace")
+)
+
+// CodeColumn returns an attribute KeyValue conforming to the "code.column"
+// semantic conventions. It represents the column number in `code.filepath`
+// best representing the operation. It SHOULD point within the code unit named
+// in `code.function`.
+func CodeColumn(val int) attribute.KeyValue {
+ return CodeColumnKey.Int(val)
+}
+
+// CodeFilepath returns an attribute KeyValue conforming to the
+// "code.filepath" semantic conventions. It represents the source code file
+// name that identifies the code unit as uniquely as possible (preferably an
+// absolute file path).
+func CodeFilepath(val string) attribute.KeyValue {
+ return CodeFilepathKey.String(val)
+}
+
+// CodeFunction returns an attribute KeyValue conforming to the
+// "code.function" semantic conventions. It represents the method or function
+// name, or equivalent (usually rightmost part of the code unit's name).
+func CodeFunction(val string) attribute.KeyValue {
+ return CodeFunctionKey.String(val)
+}
+
+// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno"
+// semantic conventions. It represents the line number in `code.filepath` best
+// representing the operation. It SHOULD point within the code unit named in
+// `code.function`.
+func CodeLineNumber(val int) attribute.KeyValue {
+ return CodeLineNumberKey.Int(val)
+}
+
+// CodeNamespace returns an attribute KeyValue conforming to the
+// "code.namespace" semantic conventions. It represents the "namespace" within
+// which `code.function` is defined. Usually the qualified class or module
+// name, such that `code.namespace` + some separator + `code.function` form a
+// unique identifier for the code unit.
+func CodeNamespace(val string) attribute.KeyValue {
+ return CodeNamespaceKey.String(val)
+}
+
+// CodeStacktrace returns an attribute KeyValue conforming to the
+// "code.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func CodeStacktrace(val string) attribute.KeyValue {
+ return CodeStacktraceKey.String(val)
+}
+
+// These attributes may be used for any operation to store information about a
+// thread that started a span.
+const (
+ // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
+ // conventions. It represents the current "managed" thread ID (as opposed
+ // to OS thread ID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ ThreadIDKey = attribute.Key("thread.id")
+
+ // ThreadNameKey is the attribute Key conforming to the "thread.name"
+ // semantic conventions. It represents the current thread name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'main'
+ ThreadNameKey = attribute.Key("thread.name")
+)
+
+// ThreadID returns an attribute KeyValue conforming to the "thread.id"
+// semantic conventions. It represents the current "managed" thread ID (as
+// opposed to OS thread ID).
+func ThreadID(val int) attribute.KeyValue {
+ return ThreadIDKey.Int(val)
+}
+
+// ThreadName returns an attribute KeyValue conforming to the "thread.name"
+// semantic conventions. It represents the current thread name.
+func ThreadName(val string) attribute.KeyValue {
+ return ThreadNameKey.String(val)
+}
+
+// Span attributes used by AWS Lambda (in addition to general `faas`
+// attributes).
+const (
+ // AWSLambdaInvokedARNKey is the attribute Key conforming to the
+ // "aws.lambda.invoked_arn" semantic conventions. It represents the full
+ // invoked ARN as provided on the `Context` passed to the function
+ // (`Lambda-Runtime-Invoked-Function-ARN` header on the
+ // `/runtime/invocation/next` applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
+ // Note: This may be different from `cloud.resource_id` if an alias is
+ // involved.
+ AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
+)
+
+// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
+// "aws.lambda.invoked_arn" semantic conventions. It represents the full
+// invoked ARN as provided on the `Context` passed to the function
+// (`Lambda-Runtime-Invoked-Function-ARN` header on the
+// `/runtime/invocation/next` applicable).
+func AWSLambdaInvokedARN(val string) attribute.KeyValue {
+ return AWSLambdaInvokedARNKey.String(val)
+}
+
+// Attributes for CloudEvents. CloudEvents is a specification on how to define
+// event data in a standard way. These attributes can be attached to spans when
+// performing operations with CloudEvents, regardless of the protocol being
+// used.
+const (
+ // CloudeventsEventIDKey is the attribute Key conforming to the
+ // "cloudevents.event_id" semantic conventions. It represents the
+ // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+ // uniquely identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
+ CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
+
+ // CloudeventsEventSourceKey is the attribute Key conforming to the
+ // "cloudevents.event_source" semantic conventions. It represents the
+ // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+ // identifies the context in which an event happened.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'https://github.com/cloudevents',
+ // '/cloudevents/spec/pull/123', 'my-service'
+ CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
+
+ // CloudeventsEventSpecVersionKey is the attribute Key conforming to the
+ // "cloudevents.event_spec_version" semantic conventions. It represents the
+ // [version of the CloudEvents
+ // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+ // which the event uses.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.0'
+ CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
+
+ // CloudeventsEventSubjectKey is the attribute Key conforming to the
+ // "cloudevents.event_subject" semantic conventions. It represents the
+ // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+ // of the event in the context of the event producer (identified by
+ // source).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mynewfile.jpg'
+ CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
+
+ // CloudeventsEventTypeKey is the attribute Key conforming to the
+ // "cloudevents.event_type" semantic conventions. It represents the
+ // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+ // contains a value describing the type of event related to the originating
+ // occurrence.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.github.pull_request.opened',
+ // 'com.example.object.deleted.v2'
+ CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
+)
+
+// CloudeventsEventID returns an attribute KeyValue conforming to the
+// "cloudevents.event_id" semantic conventions. It represents the
+// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+// uniquely identifies the event.
+func CloudeventsEventID(val string) attribute.KeyValue {
+ return CloudeventsEventIDKey.String(val)
+}
+
+// CloudeventsEventSource returns an attribute KeyValue conforming to the
+// "cloudevents.event_source" semantic conventions. It represents the
+// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+// identifies the context in which an event happened.
+func CloudeventsEventSource(val string) attribute.KeyValue {
+ return CloudeventsEventSourceKey.String(val)
+}
+
+// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to
+// the "cloudevents.event_spec_version" semantic conventions. It represents the
+// [version of the CloudEvents
+// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+// which the event uses.
+func CloudeventsEventSpecVersion(val string) attribute.KeyValue {
+ return CloudeventsEventSpecVersionKey.String(val)
+}
+
+// CloudeventsEventSubject returns an attribute KeyValue conforming to the
+// "cloudevents.event_subject" semantic conventions. It represents the
+// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+// of the event in the context of the event producer (identified by source).
+func CloudeventsEventSubject(val string) attribute.KeyValue {
+ return CloudeventsEventSubjectKey.String(val)
+}
+
+// CloudeventsEventType returns an attribute KeyValue conforming to the
+// "cloudevents.event_type" semantic conventions. It represents the
+// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+// contains a value describing the type of event related to the originating
+// occurrence.
+func CloudeventsEventType(val string) attribute.KeyValue {
+ return CloudeventsEventTypeKey.String(val)
+}
+
+// Semantic conventions for the OpenTracing Shim
+const (
+ // OpentracingRefTypeKey is the attribute Key conforming to the
+ // "opentracing.ref_type" semantic conventions. It represents the
+ // parent-child Reference type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The causal relationship between a child Span and a parent Span.
+ OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
+)
+
+var (
+ // The parent Span depends on the child Span in some capacity
+ OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
+ // The parent Span doesn't depend in any way on the result of the child Span
+ OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
+)
+
+// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's
+// concepts.
+const (
+ // OTelStatusCodeKey is the attribute Key conforming to the
+ // "otel.status_code" semantic conventions. It represents the name of the
+ // code, either "OK" or "ERROR". MUST NOT be set if the status code is
+ // UNSET.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ OTelStatusCodeKey = attribute.Key("otel.status_code")
+
+ // OTelStatusDescriptionKey is the attribute Key conforming to the
+ // "otel.status_description" semantic conventions. It represents the
+ // description of the Status if it has a value, otherwise not set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'resource not found'
+ OTelStatusDescriptionKey = attribute.Key("otel.status_description")
+)
+
+var (
+ // The operation has been validated by an Application developer or Operator to have completed successfully
+ OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
+ // The operation contains an error
+ OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
+)
+
+// OTelStatusDescription returns an attribute KeyValue conforming to the
+// "otel.status_description" semantic conventions. It represents the
+// description of the Status if it has a value, otherwise not set.
+func OTelStatusDescription(val string) attribute.KeyValue {
+ return OTelStatusDescriptionKey.String(val)
+}
+
+// This semantic convention describes an instance of a function that runs
+// without provisioning or managing of servers (also known as serverless
+// functions or Function as a Service (FaaS)) with spans.
+const (
+ // FaaSInvocationIDKey is the attribute Key conforming to the
+ // "faas.invocation_id" semantic conventions. It represents the invocation
+ // ID of the current function invocation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
+ FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
+)
+
+// FaaSInvocationID returns an attribute KeyValue conforming to the
+// "faas.invocation_id" semantic conventions. It represents the invocation ID
+// of the current function invocation.
+func FaaSInvocationID(val string) attribute.KeyValue {
+ return FaaSInvocationIDKey.String(val)
+}
+
+// Semantic Convention for FaaS triggered as a response to some data source
+// operation such as a database or filesystem read/write.
+const (
+ // FaaSDocumentCollectionKey is the attribute Key conforming to the
+ // "faas.document.collection" semantic conventions. It represents the name
+ // of the source on which the triggering operation was performed. For
+ // example, in Cloud Storage or S3 corresponds to the bucket name, and in
+ // Cosmos DB to the database name.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'myBucketName', 'myDBName'
+ FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
+
+ // FaaSDocumentNameKey is the attribute Key conforming to the
+ // "faas.document.name" semantic conventions. It represents the document
+ // name/table subjected to the operation. For example, in Cloud Storage or
+ // S3 is the name of the file, and in Cosmos DB the table name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myFile.txt', 'myTableName'
+ FaaSDocumentNameKey = attribute.Key("faas.document.name")
+
+ // FaaSDocumentOperationKey is the attribute Key conforming to the
+ // "faas.document.operation" semantic conventions. It represents the
+ // describes the type of the operation that was performed on the data.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
+
+ // FaaSDocumentTimeKey is the attribute Key conforming to the
+ // "faas.document.time" semantic conventions. It represents a string
+ // containing the time when the data was accessed in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSDocumentTimeKey = attribute.Key("faas.document.time")
+)
+
+var (
+ // When a new object is created
+ FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
+ // When an object is modified
+ FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
+ // When an object is deleted
+ FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
+)
+
+// FaaSDocumentCollection returns an attribute KeyValue conforming to the
+// "faas.document.collection" semantic conventions. It represents the name of
+// the source on which the triggering operation was performed. For example, in
+// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
+// database name.
+func FaaSDocumentCollection(val string) attribute.KeyValue {
+ return FaaSDocumentCollectionKey.String(val)
+}
+
+// FaaSDocumentName returns an attribute KeyValue conforming to the
+// "faas.document.name" semantic conventions. It represents the document
+// name/table subjected to the operation. For example, in Cloud Storage or S3
+// is the name of the file, and in Cosmos DB the table name.
+func FaaSDocumentName(val string) attribute.KeyValue {
+ return FaaSDocumentNameKey.String(val)
+}
+
+// FaaSDocumentTime returns an attribute KeyValue conforming to the
+// "faas.document.time" semantic conventions. It represents a string containing
+// the time when the data was accessed in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSDocumentTime(val string) attribute.KeyValue {
+ return FaaSDocumentTimeKey.String(val)
+}
+
+// Semantic Convention for FaaS scheduled to be executed regularly.
+const (
+ // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
+ // conventions. It represents a string containing the schedule period as
+ // [Cron
+ // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0/5 * * * ? *'
+ FaaSCronKey = attribute.Key("faas.cron")
+
+ // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
+ // conventions. It represents a string containing the function invocation
+ // time in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSTimeKey = attribute.Key("faas.time")
+)
+
+// FaaSCron returns an attribute KeyValue conforming to the "faas.cron"
+// semantic conventions. It represents a string containing the schedule period
+// as [Cron
+// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+func FaaSCron(val string) attribute.KeyValue {
+ return FaaSCronKey.String(val)
+}
+
+// FaaSTime returns an attribute KeyValue conforming to the "faas.time"
+// semantic conventions. It represents a string containing the function
+// invocation time in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSTime(val string) attribute.KeyValue {
+ return FaaSTimeKey.String(val)
+}
+
+// Contains additional attributes for incoming FaaS spans.
+const (
+ // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
+ // semantic conventions. It represents a boolean that is true if the
+ // serverless function is executed for the first time (aka cold-start).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSColdstartKey = attribute.Key("faas.coldstart")
+)
+
+// FaaSColdstart returns an attribute KeyValue conforming to the
+// "faas.coldstart" semantic conventions. It represents a boolean that is true
+// if the serverless function is executed for the first time (aka cold-start).
+func FaaSColdstart(val bool) attribute.KeyValue {
+ return FaaSColdstartKey.Bool(val)
+}
+
+// The `aws` conventions apply to operations using the AWS SDK. They map
+// request or response parameters in AWS SDK API calls to attributes on a Span.
+// The conventions have been collected over time based on feedback from AWS
+// users of tracing and will continue to evolve as new interesting conventions
+// are found.
+// Some descriptions are also provided for populating general OpenTelemetry
+// semantic conventions based on these APIs.
+const (
+ // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
+ // semantic conventions. It represents the AWS request ID as returned in
+ // the response headers `x-amz-request-id` or `x-amz-requestid`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ'
+ AWSRequestIDKey = attribute.Key("aws.request_id")
+)
+
+// AWSRequestID returns an attribute KeyValue conforming to the
+// "aws.request_id" semantic conventions. It represents the AWS request ID as
+// returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
+func AWSRequestID(val string) attribute.KeyValue {
+ return AWSRequestIDKey.String(val)
+}
+
+// Attributes that exist for multiple DynamoDB request types.
+const (
+ // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
+ // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+ // value of the `AttributesToGet` request parameter.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'lives', 'id'
+ AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
+
+ // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
+ // "aws.dynamodb.consistent_read" semantic conventions. It represents the
+ // value of the `ConsistentRead` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
+
+ // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+ // JSON-serialized value of each item in the `ConsumedCapacity` response
+ // field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": {
+ // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" :
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table":
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number }, "TableName": "string",
+ // "WriteCapacityUnits": number }'
+ AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
+
+ // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
+ // "aws.dynamodb.index_name" semantic conventions. It represents the value
+ // of the `IndexName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'name_to_group'
+ AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
+
+ // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to
+ // the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+ // represents the JSON-serialized value of the `ItemCollectionMetrics`
+ // response field.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B":
+ // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": {
+ // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ],
+ // "NULL": boolean, "S": "string", "SS": [ "string" ] } },
+ // "SizeEstimateRangeGB": [ number ] } ] }'
+ AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
+
+ // AWSDynamoDBLimitKey is the attribute Key conforming to the
+ // "aws.dynamodb.limit" semantic conventions. It represents the value of
+ // the `Limit` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
+
+ // AWSDynamoDBProjectionKey is the attribute Key conforming to the
+ // "aws.dynamodb.projection" semantic conventions. It represents the value
+ // of the `ProjectionExpression` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Title', 'Title, Price, Color', 'Title, Description,
+ // RelatedItems, ProductReviews'
+ AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
+
+ // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to
+ // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
+ // represents the value of the `ProvisionedThroughput.ReadCapacityUnits`
+ // request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
+
+ // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming
+ // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions.
+ // It represents the value of the
+ // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
+
+ // AWSDynamoDBSelectKey is the attribute Key conforming to the
+ // "aws.dynamodb.select" semantic conventions. It represents the value of
+ // the `Select` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ALL_ATTRIBUTES', 'COUNT'
+ AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
+
+ // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_names" semantic conventions. It represents the keys
+ // in the `RequestItems` object field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'Cats'
+ AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
+)
+
+// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to
+// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+// value of the `AttributesToGet` request parameter.
+func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributesToGetKey.StringSlice(val)
+}
+
+// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
+// "aws.dynamodb.consistent_read" semantic conventions. It represents the value
+// of the `ConsistentRead` request parameter.
+func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
+ return AWSDynamoDBConsistentReadKey.Bool(val)
+}
+
+// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to
+// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+// JSON-serialized value of each item in the `ConsumedCapacity` response field.
+func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
+ return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
+}
+
+// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
+// "aws.dynamodb.index_name" semantic conventions. It represents the value of
+// the `IndexName` request parameter.
+func AWSDynamoDBIndexName(val string) attribute.KeyValue {
+ return AWSDynamoDBIndexNameKey.String(val)
+}
+
+// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming
+// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+// represents the JSON-serialized value of the `ItemCollectionMetrics` response
+// field.
+func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
+ return AWSDynamoDBItemCollectionMetricsKey.String(val)
+}
+
+// AWSDynamoDBLimit returns an attribute KeyValue conforming to the
+// "aws.dynamodb.limit" semantic conventions. It represents the value of the
+// `Limit` request parameter.
+func AWSDynamoDBLimit(val int) attribute.KeyValue {
+ return AWSDynamoDBLimitKey.Int(val)
+}
+
+// AWSDynamoDBProjection returns an attribute KeyValue conforming to the
+// "aws.dynamodb.projection" semantic conventions. It represents the value of
+// the `ProjectionExpression` request parameter.
+func AWSDynamoDBProjection(val string) attribute.KeyValue {
+ return AWSDynamoDBProjectionKey.String(val)
+}
+
+// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.ReadCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBSelect returns an attribute KeyValue conforming to the
+// "aws.dynamodb.select" semantic conventions. It represents the value of the
+// `Select` request parameter.
+func AWSDynamoDBSelect(val string) attribute.KeyValue {
+ return AWSDynamoDBSelectKey.String(val)
+}
+
+// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_names" semantic conventions. It represents the keys in
+// the `RequestItems` object field.
+func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
+ return AWSDynamoDBTableNamesKey.StringSlice(val)
+}
+
+// DynamoDB.CreateTable
+const (
+ // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `GlobalSecondaryIndexes` request field
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName":
+ // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
+ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
+
+ // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `LocalSecondaryIndexes` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexARN": "string", "IndexName": "string",
+ // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'
+ AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
+)
+
+// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_indexes" semantic
+// conventions. It represents the JSON-serialized value of each item of the
+// `GlobalSecondaryIndexes` request field
+func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming
+// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+// represents the JSON-serialized value of each item of the
+// `LocalSecondaryIndexes` request field.
+func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
+}
+
+// DynamoDB.ListTables
+const (
+ // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
+ // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents
+ // the value of the `ExclusiveStartTableName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'CatsTable'
+ AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
+
+ // AWSDynamoDBTableCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_count" semantic conventions. It represents the the
+ // number of items in the `TableNames` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 20
+ AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
+)
+
+// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming
+// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It
+// represents the value of the `ExclusiveStartTableName` request parameter.
+func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
+ return AWSDynamoDBExclusiveStartTableKey.String(val)
+}
+
+// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_count" semantic conventions. It represents the the
+// number of items in the `TableNames` response parameter.
+func AWSDynamoDBTableCount(val int) attribute.KeyValue {
+ return AWSDynamoDBTableCountKey.Int(val)
+}
+
+// DynamoDB.Query
+const (
+ // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
+ // "aws.dynamodb.scan_forward" semantic conventions. It represents the
+ // value of the `ScanIndexForward` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
+)
+
+// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
+// the `ScanIndexForward` request parameter.
+func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
+ return AWSDynamoDBScanForwardKey.Bool(val)
+}
+
+// DynamoDB.Scan
+const (
+ // AWSDynamoDBCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.count" semantic conventions. It represents the value of
+ // the `Count` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
+
+ // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.scanned_count" semantic conventions. It represents the
+ // value of the `ScannedCount` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 50
+ AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
+
+ // AWSDynamoDBSegmentKey is the attribute Key conforming to the
+ // "aws.dynamodb.segment" semantic conventions. It represents the value of
+ // the `Segment` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
+
+ // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
+ // "aws.dynamodb.total_segments" semantic conventions. It represents the
+ // value of the `TotalSegments` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
+)
+
+// AWSDynamoDBCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.count" semantic conventions. It represents the value of the
+// `Count` response parameter.
+func AWSDynamoDBCount(val int) attribute.KeyValue {
+ return AWSDynamoDBCountKey.Int(val)
+}
+
+// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scanned_count" semantic conventions. It represents the value
+// of the `ScannedCount` response parameter.
+func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
+ return AWSDynamoDBScannedCountKey.Int(val)
+}
+
+// AWSDynamoDBSegment returns an attribute KeyValue conforming to the
+// "aws.dynamodb.segment" semantic conventions. It represents the value of the
+// `Segment` request parameter.
+func AWSDynamoDBSegment(val int) attribute.KeyValue {
+ return AWSDynamoDBSegmentKey.Int(val)
+}
+
+// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
+// "aws.dynamodb.total_segments" semantic conventions. It represents the value
+// of the `TotalSegments` request parameter.
+func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
+ return AWSDynamoDBTotalSegmentsKey.Int(val)
+}
+
+// DynamoDB.UpdateTable
+const (
+ // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to
+ // the "aws.dynamodb.attribute_definitions" semantic conventions. It
+ // represents the JSON-serialized value of each item in the
+ // `AttributeDefinitions` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
+ AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
+
+ // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key
+ // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+ // conventions. It represents the JSON-serialized value of each item in the
+ // the `GlobalSecondaryIndexUpdates` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
+ // "ProvisionedThroughput": { "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
+)
+
+// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming
+// to the "aws.dynamodb.attribute_definitions" semantic conventions. It
+// represents the JSON-serialized value of each item in the
+// `AttributeDefinitions` request field.
+func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+// conventions. It represents the JSON-serialized value of each item in the the
+// `GlobalSecondaryIndexUpdates` request field.
+func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
+}
+
+// Attributes that exist for S3 request types.
+const (
+ // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
+ // semantic conventions. It represents the S3 bucket name the request
+ // refers to. Corresponds to the `--bucket` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'some-bucket-name'
+ // Note: The `bucket` attribute is applicable to all S3 operations that
+ // reference a bucket, i.e. that require the bucket name as a mandatory
+ // parameter.
+ // This applies to almost all S3 operations except `list-buckets`.
+ AWSS3BucketKey = attribute.Key("aws.s3.bucket")
+
+ // AWSS3CopySourceKey is the attribute Key conforming to the
+ // "aws.s3.copy_source" semantic conventions. It represents the source
+ // object (in the form `bucket`/`key`) for the copy operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `copy_source` attribute applies to S3 copy operations and
+ // corresponds to the `--copy-source` parameter
+ // of the [copy-object operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
+
+ // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
+ // semantic conventions. It represents the delete request container that
+ // specifies the objects to be deleted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean'
+ // Note: The `delete` attribute is only applicable to the
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // operation.
+ // The `delete` attribute corresponds to the `--delete` parameter of the
+ // [delete-objects operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
+ AWSS3DeleteKey = attribute.Key("aws.s3.delete")
+
+ // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
+ // conventions. It represents the S3 object key the request refers to.
+ // Corresponds to the `--key` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `key` attribute is applicable to all object-related S3
+ // operations, i.e. that require the object key as a mandatory parameter.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // -
+ // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
+ // -
+ // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
+ // -
+ // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
+ // -
+ // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
+ // -
+ // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3KeyKey = attribute.Key("aws.s3.key")
+
+ // AWSS3PartNumberKey is the attribute Key conforming to the
+ // "aws.s3.part_number" semantic conventions. It represents the part number
+ // of the part being uploaded in a multipart-upload operation. This is a
+ // positive integer between 1 and 10,000.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3456
+ // Note: The `part_number` attribute is only applicable to the
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // and
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ // operations.
+ // The `part_number` attribute corresponds to the `--part-number` parameter
+ // of the
+ // [upload-part operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
+ AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
+
+ // AWSS3UploadIDKey is the attribute Key conforming to the
+ // "aws.s3.upload_id" semantic conventions. It represents the upload ID
+ // that identifies the multipart upload.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ'
+ // Note: The `upload_id` attribute applies to S3 multipart-upload
+ // operations and corresponds to the `--upload-id` parameter
+ // of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // multipart operations.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
+)
+
+// AWSS3Bucket returns an attribute KeyValue conforming to the
+// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the
+// request refers to. Corresponds to the `--bucket` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Bucket(val string) attribute.KeyValue {
+ return AWSS3BucketKey.String(val)
+}
+
+// AWSS3CopySource returns an attribute KeyValue conforming to the
+// "aws.s3.copy_source" semantic conventions. It represents the source object
+// (in the form `bucket`/`key`) for the copy operation.
+func AWSS3CopySource(val string) attribute.KeyValue {
+ return AWSS3CopySourceKey.String(val)
+}
+
+// AWSS3Delete returns an attribute KeyValue conforming to the
+// "aws.s3.delete" semantic conventions. It represents the delete request
+// container that specifies the objects to be deleted.
+func AWSS3Delete(val string) attribute.KeyValue {
+ return AWSS3DeleteKey.String(val)
+}
+
+// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key"
+// semantic conventions. It represents the S3 object key the request refers to.
+// Corresponds to the `--key` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Key(val string) attribute.KeyValue {
+ return AWSS3KeyKey.String(val)
+}
+
+// AWSS3PartNumber returns an attribute KeyValue conforming to the
+// "aws.s3.part_number" semantic conventions. It represents the part number of
+// the part being uploaded in a multipart-upload operation. This is a positive
+// integer between 1 and 10,000.
+func AWSS3PartNumber(val int) attribute.KeyValue {
+ return AWSS3PartNumberKey.Int(val)
+}
+
+// AWSS3UploadID returns an attribute KeyValue conforming to the
+// "aws.s3.upload_id" semantic conventions. It represents the upload ID that
+// identifies the multipart upload.
+func AWSS3UploadID(val string) attribute.KeyValue {
+ return AWSS3UploadIDKey.String(val)
+}
+
+// Semantic conventions to apply when instrumenting the GraphQL implementation.
+// They map GraphQL operations to attributes on a Span.
+const (
+ // GraphqlDocumentKey is the attribute Key conforming to the
+ // "graphql.document" semantic conventions. It represents the GraphQL
+ // document being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
+ // Note: The value may be sanitized to exclude sensitive information.
+ GraphqlDocumentKey = attribute.Key("graphql.document")
+
+ // GraphqlOperationNameKey is the attribute Key conforming to the
+ // "graphql.operation.name" semantic conventions. It represents the name of
+ // the operation being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findBookByID'
+ GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
+
+ // GraphqlOperationTypeKey is the attribute Key conforming to the
+ // "graphql.operation.type" semantic conventions. It represents the type of
+ // the operation being executed.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query', 'mutation', 'subscription'
+ GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
+)
+
+var (
+ // GraphQL query
+ GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
+ // GraphQL mutation
+ GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
+ // GraphQL subscription
+ GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
+)
+
+// GraphqlDocument returns an attribute KeyValue conforming to the
+// "graphql.document" semantic conventions. It represents the GraphQL document
+// being executed.
+func GraphqlDocument(val string) attribute.KeyValue {
+ return GraphqlDocumentKey.String(val)
+}
+
+// GraphqlOperationName returns an attribute KeyValue conforming to the
+// "graphql.operation.name" semantic conventions. It represents the name of the
+// operation being executed.
+func GraphqlOperationName(val string) attribute.KeyValue {
+ return GraphqlOperationNameKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md
new file mode 100644
index 00000000000..2de1fc3c6be
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.26.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.26.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.26.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go
new file mode 100644
index 00000000000..d8dc822b263
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go
@@ -0,0 +1,8996 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// The Android platform on which the Android application is running.
+const (
+ // AndroidOSAPILevelKey is the attribute Key conforming to the
+ // "android.os.api_level" semantic conventions. It represents the uniquely
+ // identifies the framework API revision offered by a version
+ // (`os.version`) of the android operating system. More information can be
+ // found
+ // [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '33', '32'
+ AndroidOSAPILevelKey = attribute.Key("android.os.api_level")
+)
+
+// AndroidOSAPILevel returns an attribute KeyValue conforming to the
+// "android.os.api_level" semantic conventions. It represents the uniquely
+// identifies the framework API revision offered by a version (`os.version`) of
+// the android operating system. More information can be found
+// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+func AndroidOSAPILevel(val string) attribute.KeyValue {
+ return AndroidOSAPILevelKey.String(val)
+}
+
+// ASP.NET Core attributes
+const (
+ // AspnetcoreRateLimitingResultKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.result" semantic conventions. It represents
+ // the rate-limiting result, shows whether the lease was acquired or
+ // contains a rejection reason
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'acquired', 'request_canceled'
+ AspnetcoreRateLimitingResultKey = attribute.Key("aspnetcore.rate_limiting.result")
+
+ // AspnetcoreDiagnosticsHandlerTypeKey is the attribute Key conforming to
+ // the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+ // represents the full type name of the
+ // [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+ // implementation that handled the exception.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if and only if the exception
+ // was handled by this handler.)
+ // Stability: stable
+ // Examples: 'Contoso.MyHandler'
+ AspnetcoreDiagnosticsHandlerTypeKey = attribute.Key("aspnetcore.diagnostics.handler.type")
+
+ // AspnetcoreDiagnosticsExceptionResultKey is the attribute Key conforming
+ // to the "aspnetcore.diagnostics.exception.result" semantic conventions.
+ // It represents the aSP.NET Core exception middleware handling result
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'handled', 'unhandled'
+ AspnetcoreDiagnosticsExceptionResultKey = attribute.Key("aspnetcore.diagnostics.exception.result")
+
+ // AspnetcoreRateLimitingPolicyKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+ // the rate limiting policy name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'fixed', 'sliding', 'token'
+ AspnetcoreRateLimitingPolicyKey = attribute.Key("aspnetcore.rate_limiting.policy")
+
+ // AspnetcoreRequestIsUnhandledKey is the attribute Key conforming to the
+ // "aspnetcore.request.is_unhandled" semantic conventions. It represents
+ // the flag indicating if request was handled by the application pipeline.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: True
+ AspnetcoreRequestIsUnhandledKey = attribute.Key("aspnetcore.request.is_unhandled")
+
+ // AspnetcoreRoutingIsFallbackKey is the attribute Key conforming to the
+ // "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+ // value that indicates whether the matched route is a fallback route.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: True
+ AspnetcoreRoutingIsFallbackKey = attribute.Key("aspnetcore.routing.is_fallback")
+
+ // AspnetcoreRoutingMatchStatusKey is the attribute Key conforming to the
+ // "aspnetcore.routing.match_status" semantic conventions. It represents
+ // the match result - success or failure
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'success', 'failure'
+ AspnetcoreRoutingMatchStatusKey = attribute.Key("aspnetcore.routing.match_status")
+)
+
+var (
+ // Lease was acquired
+ AspnetcoreRateLimitingResultAcquired = AspnetcoreRateLimitingResultKey.String("acquired")
+ // Lease request was rejected by the endpoint limiter
+ AspnetcoreRateLimitingResultEndpointLimiter = AspnetcoreRateLimitingResultKey.String("endpoint_limiter")
+ // Lease request was rejected by the global limiter
+ AspnetcoreRateLimitingResultGlobalLimiter = AspnetcoreRateLimitingResultKey.String("global_limiter")
+ // Lease request was canceled
+ AspnetcoreRateLimitingResultRequestCanceled = AspnetcoreRateLimitingResultKey.String("request_canceled")
+)
+
+var (
+ // Exception was handled by the exception handling middleware
+ AspnetcoreDiagnosticsExceptionResultHandled = AspnetcoreDiagnosticsExceptionResultKey.String("handled")
+ // Exception was not handled by the exception handling middleware
+ AspnetcoreDiagnosticsExceptionResultUnhandled = AspnetcoreDiagnosticsExceptionResultKey.String("unhandled")
+ // Exception handling was skipped because the response had started
+ AspnetcoreDiagnosticsExceptionResultSkipped = AspnetcoreDiagnosticsExceptionResultKey.String("skipped")
+ // Exception handling didn't run because the request was aborted
+ AspnetcoreDiagnosticsExceptionResultAborted = AspnetcoreDiagnosticsExceptionResultKey.String("aborted")
+)
+
+var (
+ // Match succeeded
+ AspnetcoreRoutingMatchStatusSuccess = AspnetcoreRoutingMatchStatusKey.String("success")
+ // Match failed
+ AspnetcoreRoutingMatchStatusFailure = AspnetcoreRoutingMatchStatusKey.String("failure")
+)
+
+// AspnetcoreDiagnosticsHandlerType returns an attribute KeyValue conforming
+// to the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+// represents the full type name of the
+// [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+// implementation that handled the exception.
+func AspnetcoreDiagnosticsHandlerType(val string) attribute.KeyValue {
+ return AspnetcoreDiagnosticsHandlerTypeKey.String(val)
+}
+
+// AspnetcoreRateLimitingPolicy returns an attribute KeyValue conforming to
+// the "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+// the rate limiting policy name.
+func AspnetcoreRateLimitingPolicy(val string) attribute.KeyValue {
+ return AspnetcoreRateLimitingPolicyKey.String(val)
+}
+
+// AspnetcoreRequestIsUnhandled returns an attribute KeyValue conforming to
+// the "aspnetcore.request.is_unhandled" semantic conventions. It represents
+// the flag indicating if request was handled by the application pipeline.
+func AspnetcoreRequestIsUnhandled(val bool) attribute.KeyValue {
+ return AspnetcoreRequestIsUnhandledKey.Bool(val)
+}
+
+// AspnetcoreRoutingIsFallback returns an attribute KeyValue conforming to
+// the "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+// value that indicates whether the matched route is a fallback route.
+func AspnetcoreRoutingIsFallback(val bool) attribute.KeyValue {
+ return AspnetcoreRoutingIsFallbackKey.Bool(val)
+}
+
+// Generic attributes for AWS services.
+const (
+ // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
+ // semantic conventions. It represents the AWS request ID as returned in
+ // the response headers `x-amz-request-id` or `x-amz-requestid`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ'
+ AWSRequestIDKey = attribute.Key("aws.request_id")
+)
+
+// AWSRequestID returns an attribute KeyValue conforming to the
+// "aws.request_id" semantic conventions. It represents the AWS request ID as
+// returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
+func AWSRequestID(val string) attribute.KeyValue {
+ return AWSRequestIDKey.String(val)
+}
+
+// Attributes for AWS DynamoDB.
+const (
+ // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to
+ // the "aws.dynamodb.attribute_definitions" semantic conventions. It
+ // represents the JSON-serialized value of each item in the
+ // `AttributeDefinitions` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
+ AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
+
+ // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
+ // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+ // value of the `AttributesToGet` request parameter.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'lives', 'id'
+ AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
+
+ // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
+ // "aws.dynamodb.consistent_read" semantic conventions. It represents the
+ // value of the `ConsistentRead` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
+
+ // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+ // JSON-serialized value of each item in the `ConsumedCapacity` response
+ // field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": {
+ // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" :
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table":
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number }, "TableName": "string",
+ // "WriteCapacityUnits": number }'
+ AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
+
+ // AWSDynamoDBCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.count" semantic conventions. It represents the value of
+ // the `Count` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
+
+ // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
+ // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents
+ // the value of the `ExclusiveStartTableName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'CatsTable'
+ AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
+
+ // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key
+ // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+ // conventions. It represents the JSON-serialized value of each item in the
+ // `GlobalSecondaryIndexUpdates` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
+ // "ProvisionedThroughput": { "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
+
+ // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `GlobalSecondaryIndexes` request field
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName":
+ // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
+ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
+
+ // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
+ // "aws.dynamodb.index_name" semantic conventions. It represents the value
+ // of the `IndexName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'name_to_group'
+ AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
+
+ // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to
+ // the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+ // represents the JSON-serialized value of the `ItemCollectionMetrics`
+ // response field.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B":
+ // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": {
+ // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ],
+ // "NULL": boolean, "S": "string", "SS": [ "string" ] } },
+ // "SizeEstimateRangeGB": [ number ] } ] }'
+ AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
+
+ // AWSDynamoDBLimitKey is the attribute Key conforming to the
+ // "aws.dynamodb.limit" semantic conventions. It represents the value of
+ // the `Limit` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
+
+ // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `LocalSecondaryIndexes` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexARN": "string", "IndexName": "string",
+ // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'
+ AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
+
+ // AWSDynamoDBProjectionKey is the attribute Key conforming to the
+ // "aws.dynamodb.projection" semantic conventions. It represents the value
+ // of the `ProjectionExpression` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Title', 'Title, Price, Color', 'Title, Description,
+ // RelatedItems, ProductReviews'
+ AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
+
+ // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to
+ // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
+ // represents the value of the `ProvisionedThroughput.ReadCapacityUnits`
+ // request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
+
+ // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming
+ // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions.
+ // It represents the value of the
+ // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
+
+ // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
+ // "aws.dynamodb.scan_forward" semantic conventions. It represents the
+ // value of the `ScanIndexForward` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
+
+ // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.scanned_count" semantic conventions. It represents the
+ // value of the `ScannedCount` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 50
+ AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
+
+ // AWSDynamoDBSegmentKey is the attribute Key conforming to the
+ // "aws.dynamodb.segment" semantic conventions. It represents the value of
+ // the `Segment` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
+
+ // AWSDynamoDBSelectKey is the attribute Key conforming to the
+ // "aws.dynamodb.select" semantic conventions. It represents the value of
+ // the `Select` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ALL_ATTRIBUTES', 'COUNT'
+ AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
+
+ // AWSDynamoDBTableCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_count" semantic conventions. It represents the
+ // number of items in the `TableNames` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 20
+ AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
+
+ // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_names" semantic conventions. It represents the keys
+ // in the `RequestItems` object field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'Cats'
+ AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
+
+ // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
+ // "aws.dynamodb.total_segments" semantic conventions. It represents the
+ // value of the `TotalSegments` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
+)
+
+// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming
+// to the "aws.dynamodb.attribute_definitions" semantic conventions. It
+// represents the JSON-serialized value of each item in the
+// `AttributeDefinitions` request field.
+func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
+}
+
+// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to
+// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+// value of the `AttributesToGet` request parameter.
+func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributesToGetKey.StringSlice(val)
+}
+
+// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
+// "aws.dynamodb.consistent_read" semantic conventions. It represents the value
+// of the `ConsistentRead` request parameter.
+func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
+ return AWSDynamoDBConsistentReadKey.Bool(val)
+}
+
+// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to
+// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+// JSON-serialized value of each item in the `ConsumedCapacity` response field.
+func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
+ return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
+}
+
+// AWSDynamoDBCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.count" semantic conventions. It represents the value of the
+// `Count` response parameter.
+func AWSDynamoDBCount(val int) attribute.KeyValue {
+ return AWSDynamoDBCountKey.Int(val)
+}
+
+// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming
+// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It
+// represents the value of the `ExclusiveStartTableName` request parameter.
+func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
+ return AWSDynamoDBExclusiveStartTableKey.String(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+// conventions. It represents the JSON-serialized value of each item in the
+// `GlobalSecondaryIndexUpdates` request field.
+func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_indexes" semantic
+// conventions. It represents the JSON-serialized value of each item of the
+// `GlobalSecondaryIndexes` request field
+func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
+// "aws.dynamodb.index_name" semantic conventions. It represents the value of
+// the `IndexName` request parameter.
+func AWSDynamoDBIndexName(val string) attribute.KeyValue {
+ return AWSDynamoDBIndexNameKey.String(val)
+}
+
+// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming
+// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+// represents the JSON-serialized value of the `ItemCollectionMetrics` response
+// field.
+func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
+ return AWSDynamoDBItemCollectionMetricsKey.String(val)
+}
+
+// AWSDynamoDBLimit returns an attribute KeyValue conforming to the
+// "aws.dynamodb.limit" semantic conventions. It represents the value of the
+// `Limit` request parameter.
+func AWSDynamoDBLimit(val int) attribute.KeyValue {
+ return AWSDynamoDBLimitKey.Int(val)
+}
+
+// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming
+// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+// represents the JSON-serialized value of each item of the
+// `LocalSecondaryIndexes` request field.
+func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBProjection returns an attribute KeyValue conforming to the
+// "aws.dynamodb.projection" semantic conventions. It represents the value of
+// the `ProjectionExpression` request parameter.
+func AWSDynamoDBProjection(val string) attribute.KeyValue {
+ return AWSDynamoDBProjectionKey.String(val)
+}
+
+// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.ReadCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
+// the `ScanIndexForward` request parameter.
+func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
+ return AWSDynamoDBScanForwardKey.Bool(val)
+}
+
+// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scanned_count" semantic conventions. It represents the value
+// of the `ScannedCount` response parameter.
+func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
+ return AWSDynamoDBScannedCountKey.Int(val)
+}
+
+// AWSDynamoDBSegment returns an attribute KeyValue conforming to the
+// "aws.dynamodb.segment" semantic conventions. It represents the value of the
+// `Segment` request parameter.
+func AWSDynamoDBSegment(val int) attribute.KeyValue {
+ return AWSDynamoDBSegmentKey.Int(val)
+}
+
+// AWSDynamoDBSelect returns an attribute KeyValue conforming to the
+// "aws.dynamodb.select" semantic conventions. It represents the value of the
+// `Select` request parameter.
+func AWSDynamoDBSelect(val string) attribute.KeyValue {
+ return AWSDynamoDBSelectKey.String(val)
+}
+
+// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_count" semantic conventions. It represents the number of
+// items in the `TableNames` response parameter.
+func AWSDynamoDBTableCount(val int) attribute.KeyValue {
+ return AWSDynamoDBTableCountKey.Int(val)
+}
+
+// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_names" semantic conventions. It represents the keys in
+// the `RequestItems` object field.
+func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
+ return AWSDynamoDBTableNamesKey.StringSlice(val)
+}
+
+// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
+// "aws.dynamodb.total_segments" semantic conventions. It represents the value
+// of the `TotalSegments` request parameter.
+func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
+ return AWSDynamoDBTotalSegmentsKey.Int(val)
+}
+
+// Attributes for AWS Elastic Container Service (ECS).
+const (
+ // AWSECSTaskIDKey is the attribute Key conforming to the "aws.ecs.task.id"
+ // semantic conventions. It represents the ID of a running ECS task. The ID
+ // MUST be extracted from `task.arn`.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If and only if `task.arn` is
+ // populated.)
+ // Stability: experimental
+ // Examples: '10838bed-421f-43ef-870a-f43feacbbb5b',
+ // '23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd'
+ AWSECSTaskIDKey = attribute.Key("aws.ecs.task.id")
+
+ // AWSECSClusterARNKey is the attribute Key conforming to the
+ // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
+ // [ECS
+ // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
+
+ // AWSECSContainerARNKey is the attribute Key conforming to the
+ // "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+ // Resource Name (ARN) of an [ECS container
+ // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'
+ AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn")
+
+ // AWSECSLaunchtypeKey is the attribute Key conforming to the
+ // "aws.ecs.launchtype" semantic conventions. It represents the [launch
+ // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // for an ECS task.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
+
+ // AWSECSTaskARNKey is the attribute Key conforming to the
+ // "aws.ecs.task.arn" semantic conventions. It represents the ARN of a
+ // running [ECS
+ // task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b',
+ // 'arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd'
+ AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn")
+
+ // AWSECSTaskFamilyKey is the attribute Key conforming to the
+ // "aws.ecs.task.family" semantic conventions. It represents the family
+ // name of the [ECS task
+ // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+ // used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-family'
+ AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
+
+ // AWSECSTaskRevisionKey is the attribute Key conforming to the
+ // "aws.ecs.task.revision" semantic conventions. It represents the revision
+ // for the task definition used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '8', '26'
+ AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
+)
+
+var (
+ // ec2
+ AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2")
+ // fargate
+ AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate")
+)
+
+// AWSECSTaskID returns an attribute KeyValue conforming to the
+// "aws.ecs.task.id" semantic conventions. It represents the ID of a running
+// ECS task. The ID MUST be extracted from `task.arn`.
+func AWSECSTaskID(val string) attribute.KeyValue {
+ return AWSECSTaskIDKey.String(val)
+}
+
+// AWSECSClusterARN returns an attribute KeyValue conforming to the
+// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS
+// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+func AWSECSClusterARN(val string) attribute.KeyValue {
+ return AWSECSClusterARNKey.String(val)
+}
+
+// AWSECSContainerARN returns an attribute KeyValue conforming to the
+// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+// Resource Name (ARN) of an [ECS container
+// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+func AWSECSContainerARN(val string) attribute.KeyValue {
+ return AWSECSContainerARNKey.String(val)
+}
+
+// AWSECSTaskARN returns an attribute KeyValue conforming to the
+// "aws.ecs.task.arn" semantic conventions. It represents the ARN of a running
+// [ECS
+// task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids).
+func AWSECSTaskARN(val string) attribute.KeyValue {
+ return AWSECSTaskARNKey.String(val)
+}
+
+// AWSECSTaskFamily returns an attribute KeyValue conforming to the
+// "aws.ecs.task.family" semantic conventions. It represents the family name of
+// the [ECS task
+// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+// used to create the ECS task.
+func AWSECSTaskFamily(val string) attribute.KeyValue {
+ return AWSECSTaskFamilyKey.String(val)
+}
+
+// AWSECSTaskRevision returns an attribute KeyValue conforming to the
+// "aws.ecs.task.revision" semantic conventions. It represents the revision for
+// the task definition used to create the ECS task.
+func AWSECSTaskRevision(val string) attribute.KeyValue {
+ return AWSECSTaskRevisionKey.String(val)
+}
+
+// Attributes for AWS Elastic Kubernetes Service (EKS).
+const (
+ // AWSEKSClusterARNKey is the attribute Key conforming to the
+ // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an
+ // EKS cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
+)
+
+// AWSEKSClusterARN returns an attribute KeyValue conforming to the
+// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
+// cluster.
+func AWSEKSClusterARN(val string) attribute.KeyValue {
+ return AWSEKSClusterARNKey.String(val)
+}
+
+// Attributes for AWS Logs.
+const (
+ // AWSLogGroupARNsKey is the attribute Key conforming to the
+ // "aws.log.group.arns" semantic conventions. It represents the Amazon
+ // Resource Name(s) (ARN) of the AWS log group(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'
+ // Note: See the [log group ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns")
+
+ // AWSLogGroupNamesKey is the attribute Key conforming to the
+ // "aws.log.group.names" semantic conventions. It represents the name(s) of
+ // the AWS log group(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/aws/lambda/my-function', 'opentelemetry-service'
+ // Note: Multiple log groups must be supported for cases like
+ // multi-container applications, where a single application has sidecar
+ // containers, and each write to their own log group.
+ AWSLogGroupNamesKey = attribute.Key("aws.log.group.names")
+
+ // AWSLogStreamARNsKey is the attribute Key conforming to the
+ // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of
+ // the AWS log stream(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ // Note: See the [log stream ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ // One log group can contain several log streams, so these ARNs necessarily
+ // identify both a log group and a log stream.
+ AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns")
+
+ // AWSLogStreamNamesKey is the attribute Key conforming to the
+ // "aws.log.stream.names" semantic conventions. It represents the name(s)
+ // of the AWS log stream(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
+)
+
+// AWSLogGroupARNs returns an attribute KeyValue conforming to the
+// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
+// Name(s) (ARN) of the AWS log group(s).
+func AWSLogGroupARNs(val ...string) attribute.KeyValue {
+ return AWSLogGroupARNsKey.StringSlice(val)
+}
+
+// AWSLogGroupNames returns an attribute KeyValue conforming to the
+// "aws.log.group.names" semantic conventions. It represents the name(s) of the
+// AWS log group(s) an application is writing to.
+func AWSLogGroupNames(val ...string) attribute.KeyValue {
+ return AWSLogGroupNamesKey.StringSlice(val)
+}
+
+// AWSLogStreamARNs returns an attribute KeyValue conforming to the
+// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
+// AWS log stream(s).
+func AWSLogStreamARNs(val ...string) attribute.KeyValue {
+ return AWSLogStreamARNsKey.StringSlice(val)
+}
+
+// AWSLogStreamNames returns an attribute KeyValue conforming to the
+// "aws.log.stream.names" semantic conventions. It represents the name(s) of
+// the AWS log stream(s) an application is writing to.
+func AWSLogStreamNames(val ...string) attribute.KeyValue {
+ return AWSLogStreamNamesKey.StringSlice(val)
+}
+
+// Attributes for AWS Lambda.
+const (
+ // AWSLambdaInvokedARNKey is the attribute Key conforming to the
+ // "aws.lambda.invoked_arn" semantic conventions. It represents the full
+ // invoked ARN as provided on the `Context` passed to the function
+ // (`Lambda-Runtime-Invoked-Function-ARN` header on the
+ // `/runtime/invocation/next` applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
+ // Note: This may be different from `cloud.resource_id` if an alias is
+ // involved.
+ AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
+)
+
+// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
+// "aws.lambda.invoked_arn" semantic conventions. It represents the full
+// invoked ARN as provided on the `Context` passed to the function
+// (`Lambda-Runtime-Invoked-Function-ARN` header on the
+// `/runtime/invocation/next` applicable).
+func AWSLambdaInvokedARN(val string) attribute.KeyValue {
+ return AWSLambdaInvokedARNKey.String(val)
+}
+
+// Attributes for AWS S3.
+const (
+ // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
+ // semantic conventions. It represents the S3 bucket name the request
+ // refers to. Corresponds to the `--bucket` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'some-bucket-name'
+ // Note: The `bucket` attribute is applicable to all S3 operations that
+ // reference a bucket, i.e. that require the bucket name as a mandatory
+ // parameter.
+ // This applies to almost all S3 operations except `list-buckets`.
+ AWSS3BucketKey = attribute.Key("aws.s3.bucket")
+
+ // AWSS3CopySourceKey is the attribute Key conforming to the
+ // "aws.s3.copy_source" semantic conventions. It represents the source
+ // object (in the form `bucket`/`key`) for the copy operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `copy_source` attribute applies to S3 copy operations and
+ // corresponds to the `--copy-source` parameter
+ // of the [copy-object operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
+
+ // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
+ // semantic conventions. It represents the delete request container that
+ // specifies the objects to be deleted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean'
+ // Note: The `delete` attribute is only applicable to the
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // operation.
+ // The `delete` attribute corresponds to the `--delete` parameter of the
+ // [delete-objects operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
+ AWSS3DeleteKey = attribute.Key("aws.s3.delete")
+
+ // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
+ // conventions. It represents the S3 object key the request refers to.
+ // Corresponds to the `--key` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `key` attribute is applicable to all object-related S3
+ // operations, i.e. that require the object key as a mandatory parameter.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // -
+ // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
+ // -
+ // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
+ // -
+ // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
+ // -
+ // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
+ // -
+ // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3KeyKey = attribute.Key("aws.s3.key")
+
+ // AWSS3PartNumberKey is the attribute Key conforming to the
+ // "aws.s3.part_number" semantic conventions. It represents the part number
+ // of the part being uploaded in a multipart-upload operation. This is a
+ // positive integer between 1 and 10,000.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3456
+ // Note: The `part_number` attribute is only applicable to the
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // and
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ // operations.
+ // The `part_number` attribute corresponds to the `--part-number` parameter
+ // of the
+ // [upload-part operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
+ AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
+
+ // AWSS3UploadIDKey is the attribute Key conforming to the
+ // "aws.s3.upload_id" semantic conventions. It represents the upload ID
+ // that identifies the multipart upload.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ'
+ // Note: The `upload_id` attribute applies to S3 multipart-upload
+ // operations and corresponds to the `--upload-id` parameter
+ // of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // multipart operations.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
+)
+
+// AWSS3Bucket returns an attribute KeyValue conforming to the
+// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the
+// request refers to. Corresponds to the `--bucket` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Bucket(val string) attribute.KeyValue {
+ return AWSS3BucketKey.String(val)
+}
+
+// AWSS3CopySource returns an attribute KeyValue conforming to the
+// "aws.s3.copy_source" semantic conventions. It represents the source object
+// (in the form `bucket`/`key`) for the copy operation.
+func AWSS3CopySource(val string) attribute.KeyValue {
+ return AWSS3CopySourceKey.String(val)
+}
+
+// AWSS3Delete returns an attribute KeyValue conforming to the
+// "aws.s3.delete" semantic conventions. It represents the delete request
+// container that specifies the objects to be deleted.
+func AWSS3Delete(val string) attribute.KeyValue {
+ return AWSS3DeleteKey.String(val)
+}
+
+// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key"
+// semantic conventions. It represents the S3 object key the request refers to.
+// Corresponds to the `--key` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Key(val string) attribute.KeyValue {
+ return AWSS3KeyKey.String(val)
+}
+
+// AWSS3PartNumber returns an attribute KeyValue conforming to the
+// "aws.s3.part_number" semantic conventions. It represents the part number of
+// the part being uploaded in a multipart-upload operation. This is a positive
+// integer between 1 and 10,000.
+func AWSS3PartNumber(val int) attribute.KeyValue {
+ return AWSS3PartNumberKey.Int(val)
+}
+
+// AWSS3UploadID returns an attribute KeyValue conforming to the
+// "aws.s3.upload_id" semantic conventions. It represents the upload ID that
+// identifies the multipart upload.
+func AWSS3UploadID(val string) attribute.KeyValue {
+ return AWSS3UploadIDKey.String(val)
+}
+
+// The web browser attributes
+const (
+ // BrowserBrandsKey is the attribute Key conforming to the "browser.brands"
+ // semantic conventions. It represents the array of brand name and version
+ // separated by a space
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.brands`).
+ BrowserBrandsKey = attribute.Key("browser.brands")
+
+ // BrowserLanguageKey is the attribute Key conforming to the
+ // "browser.language" semantic conventions. It represents the preferred
+ // language of the user using the browser
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'en', 'en-US', 'fr', 'fr-FR'
+ // Note: This value is intended to be taken from the Navigator API
+ // `navigator.language`.
+ BrowserLanguageKey = attribute.Key("browser.language")
+
+ // BrowserMobileKey is the attribute Key conforming to the "browser.mobile"
+ // semantic conventions. It represents a boolean that is true if the
+ // browser is running on a mobile device
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.mobile`). If unavailable, this attribute
+ // SHOULD be left unset.
+ BrowserMobileKey = attribute.Key("browser.mobile")
+
+ // BrowserPlatformKey is the attribute Key conforming to the
+ // "browser.platform" semantic conventions. It represents the platform on
+ // which the browser is running
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Windows', 'macOS', 'Android'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.platform`). If unavailable, the legacy
+ // `navigator.platform` API SHOULD NOT be used instead and this attribute
+ // SHOULD be left unset in order for the values to be consistent.
+ // The list of possible values is defined in the [W3C User-Agent Client
+ // Hints
+ // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
+ // Note that some (but not all) of these values can overlap with values in
+ // the [`os.type` and `os.name` attributes](./os.md). However, for
+ // consistency, the values in the `browser.platform` attribute should
+ // capture the exact value that the user agent provides.
+ BrowserPlatformKey = attribute.Key("browser.platform")
+)
+
+// BrowserBrands returns an attribute KeyValue conforming to the
+// "browser.brands" semantic conventions. It represents the array of brand name
+// and version separated by a space
+func BrowserBrands(val ...string) attribute.KeyValue {
+ return BrowserBrandsKey.StringSlice(val)
+}
+
+// BrowserLanguage returns an attribute KeyValue conforming to the
+// "browser.language" semantic conventions. It represents the preferred
+// language of the user using the browser
+func BrowserLanguage(val string) attribute.KeyValue {
+ return BrowserLanguageKey.String(val)
+}
+
+// BrowserMobile returns an attribute KeyValue conforming to the
+// "browser.mobile" semantic conventions. It represents a boolean that is true
+// if the browser is running on a mobile device
+func BrowserMobile(val bool) attribute.KeyValue {
+ return BrowserMobileKey.Bool(val)
+}
+
+// BrowserPlatform returns an attribute KeyValue conforming to the
+// "browser.platform" semantic conventions. It represents the platform on which
+// the browser is running
+func BrowserPlatform(val string) attribute.KeyValue {
+ return BrowserPlatformKey.String(val)
+}
+
+// These attributes may be used to describe the client in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ClientAddressKey is the attribute Key conforming to the "client.address"
+ // semantic conventions. It represents the client address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.address` SHOULD represent the client address
+ // behind any intermediaries, for example proxies, if it's available.
+ ClientAddressKey = attribute.Key("client.address")
+
+ // ClientPortKey is the attribute Key conforming to the "client.port"
+ // semantic conventions. It represents the client port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.port` SHOULD represent the client port behind
+ // any intermediaries, for example proxies, if it's available.
+ ClientPortKey = attribute.Key("client.port")
+)
+
+// ClientAddress returns an attribute KeyValue conforming to the
+// "client.address" semantic conventions. It represents the client address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func ClientAddress(val string) attribute.KeyValue {
+ return ClientAddressKey.String(val)
+}
+
+// ClientPort returns an attribute KeyValue conforming to the "client.port"
+// semantic conventions. It represents the client port number.
+func ClientPort(val int) attribute.KeyValue {
+ return ClientPortKey.Int(val)
+}
+
+// A cloud environment (e.g. GCP, Azure, AWS).
+const (
+ // CloudAccountIDKey is the attribute Key conforming to the
+ // "cloud.account.id" semantic conventions. It represents the cloud account
+ // ID the resource is assigned to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '111111111111', 'opentelemetry'
+ CloudAccountIDKey = attribute.Key("cloud.account.id")
+
+ // CloudAvailabilityZoneKey is the attribute Key conforming to the
+ // "cloud.availability_zone" semantic conventions. It represents the cloud
+ // regions often have multiple, isolated locations known as zones to
+ // increase availability. Availability zone represents the zone where the
+ // resource is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-east-1c'
+ // Note: Availability zones are called "zones" on Alibaba Cloud and Google
+ // Cloud.
+ CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone")
+
+ // CloudPlatformKey is the attribute Key conforming to the "cloud.platform"
+ // semantic conventions. It represents the cloud platform in use.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The prefix of the service SHOULD match the one specified in
+ // `cloud.provider`.
+ CloudPlatformKey = attribute.Key("cloud.platform")
+
+ // CloudProviderKey is the attribute Key conforming to the "cloud.provider"
+ // semantic conventions. It represents the name of the cloud provider.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ CloudProviderKey = attribute.Key("cloud.provider")
+
+ // CloudRegionKey is the attribute Key conforming to the "cloud.region"
+ // semantic conventions. It represents the geographical region the resource
+ // is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-central1', 'us-east-1'
+ // Note: Refer to your provider's docs to see the available regions, for
+ // example [Alibaba Cloud
+ // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS
+ // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/),
+ // [Azure
+ // regions](https://azure.microsoft.com/global-infrastructure/geographies/),
+ // [Google Cloud regions](https://cloud.google.com/about/locations), or
+ // [Tencent Cloud
+ // regions](https://www.tencentcloud.com/document/product/213/6091).
+ CloudRegionKey = attribute.Key("cloud.region")
+
+ // CloudResourceIDKey is the attribute Key conforming to the
+ // "cloud.resource_id" semantic conventions. It represents the cloud
+ // provider-specific native identifier of the monitored cloud resource
+ // (e.g. an
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // on AWS, a [fully qualified resource
+ // ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id)
+ // on Azure, a [full resource
+ // name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+ // on GCP)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function',
+ // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID',
+ // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/'
+ // Note: On some cloud providers, it may not be possible to determine the
+ // full ID at startup,
+ // so it may be necessary to set `cloud.resource_id` as a span attribute
+ // instead.
+ //
+ // The exact value to use for `cloud.resource_id` depends on the cloud
+ // provider.
+ // The following well-known definitions MUST be used if you set this
+ // attribute and they apply:
+ //
+ // * **AWS Lambda:** The function
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
+ // Take care not to use the "invoked ARN" directly but replace any
+ // [alias
+ // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
+ // with the resolved function version, as the same runtime instance may
+ // be invokable with
+ // multiple different aliases.
+ // * **GCP:** The [URI of the
+ // resource](https://cloud.google.com/iam/docs/full-resource-names)
+ // * **Azure:** The [Fully Qualified Resource
+ // ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id)
+ // of the invoked function,
+ // *not* the function app, having the form
+ // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`.
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider.
+ CloudResourceIDKey = attribute.Key("cloud.resource_id")
+)
+
+var (
+ // Alibaba Cloud Elastic Compute Service
+ CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
+ // Alibaba Cloud Function Compute
+ CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc")
+ // Red Hat OpenShift on Alibaba Cloud
+ CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift")
+ // AWS Elastic Compute Cloud
+ CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
+ // AWS Elastic Container Service
+ CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs")
+ // AWS Elastic Kubernetes Service
+ CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks")
+ // AWS Lambda
+ CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda")
+ // AWS Elastic Beanstalk
+ CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
+ // AWS App Runner
+ CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
+ // Red Hat OpenShift on AWS (ROSA)
+ CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift")
+ // Azure Virtual Machines
+ CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm")
+ // Azure Container Apps
+ CloudPlatformAzureContainerApps = CloudPlatformKey.String("azure_container_apps")
+ // Azure Container Instances
+ CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances")
+ // Azure Kubernetes Service
+ CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks")
+ // Azure Functions
+ CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions")
+ // Azure App Service
+ CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
+ // Azure Red Hat OpenShift
+ CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
+ // Google Bare Metal Solution (BMS)
+ CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
+ // Google Cloud Compute Engine (GCE)
+ CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
+ // Google Cloud Run
+ CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run")
+ // Google Cloud Kubernetes Engine (GKE)
+ CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine")
+ // Google Cloud Functions (GCF)
+ CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
+ // Google Cloud App Engine (GAE)
+ CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
+ // Red Hat OpenShift on Google Cloud
+ CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift")
+ // Red Hat OpenShift on IBM Cloud
+ CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
+ // Tencent Cloud Cloud Virtual Machine (CVM)
+ CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm")
+ // Tencent Cloud Elastic Kubernetes Service (EKS)
+ CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks")
+ // Tencent Cloud Serverless Cloud Function (SCF)
+ CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf")
+)
+
+var (
+ // Alibaba Cloud
+ CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ CloudProviderAWS = CloudProviderKey.String("aws")
+ // Microsoft Azure
+ CloudProviderAzure = CloudProviderKey.String("azure")
+ // Google Cloud Platform
+ CloudProviderGCP = CloudProviderKey.String("gcp")
+ // Heroku Platform as a Service
+ CloudProviderHeroku = CloudProviderKey.String("heroku")
+ // IBM Cloud
+ CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
+ // Tencent Cloud
+ CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
+)
+
+// CloudAccountID returns an attribute KeyValue conforming to the
+// "cloud.account.id" semantic conventions. It represents the cloud account ID
+// the resource is assigned to.
+func CloudAccountID(val string) attribute.KeyValue {
+ return CloudAccountIDKey.String(val)
+}
+
+// CloudAvailabilityZone returns an attribute KeyValue conforming to the
+// "cloud.availability_zone" semantic conventions. It represents the cloud
+// regions often have multiple, isolated locations known as zones to increase
+// availability. Availability zone represents the zone where the resource is
+// running.
+func CloudAvailabilityZone(val string) attribute.KeyValue {
+ return CloudAvailabilityZoneKey.String(val)
+}
+
+// CloudRegion returns an attribute KeyValue conforming to the
+// "cloud.region" semantic conventions. It represents the geographical region
+// the resource is running.
+func CloudRegion(val string) attribute.KeyValue {
+ return CloudRegionKey.String(val)
+}
+
+// CloudResourceID returns an attribute KeyValue conforming to the
+// "cloud.resource_id" semantic conventions. It represents the cloud
+// provider-specific native identifier of the monitored cloud resource (e.g. an
+// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+// on AWS, a [fully qualified resource
+// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on
+// Azure, a [full resource
+// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+// on GCP)
+func CloudResourceID(val string) attribute.KeyValue {
+ return CloudResourceIDKey.String(val)
+}
+
+// Attributes for CloudEvents.
+const (
+ // CloudeventsEventIDKey is the attribute Key conforming to the
+ // "cloudevents.event_id" semantic conventions. It represents the
+ // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+ // uniquely identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
+ CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
+
+ // CloudeventsEventSourceKey is the attribute Key conforming to the
+ // "cloudevents.event_source" semantic conventions. It represents the
+ // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+ // identifies the context in which an event happened.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'https://github.com/cloudevents',
+ // '/cloudevents/spec/pull/123', 'my-service'
+ CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
+
+ // CloudeventsEventSpecVersionKey is the attribute Key conforming to the
+ // "cloudevents.event_spec_version" semantic conventions. It represents the
+ // [version of the CloudEvents
+ // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+ // which the event uses.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.0'
+ CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
+
+ // CloudeventsEventSubjectKey is the attribute Key conforming to the
+ // "cloudevents.event_subject" semantic conventions. It represents the
+ // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+ // of the event in the context of the event producer (identified by
+ // source).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mynewfile.jpg'
+ CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
+
+ // CloudeventsEventTypeKey is the attribute Key conforming to the
+ // "cloudevents.event_type" semantic conventions. It represents the
+ // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+ // contains a value describing the type of event related to the originating
+ // occurrence.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.github.pull_request.opened',
+ // 'com.example.object.deleted.v2'
+ CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
+)
+
+// CloudeventsEventID returns an attribute KeyValue conforming to the
+// "cloudevents.event_id" semantic conventions. It represents the
+// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+// uniquely identifies the event.
+func CloudeventsEventID(val string) attribute.KeyValue {
+ return CloudeventsEventIDKey.String(val)
+}
+
+// CloudeventsEventSource returns an attribute KeyValue conforming to the
+// "cloudevents.event_source" semantic conventions. It represents the
+// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+// identifies the context in which an event happened.
+func CloudeventsEventSource(val string) attribute.KeyValue {
+ return CloudeventsEventSourceKey.String(val)
+}
+
+// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to
+// the "cloudevents.event_spec_version" semantic conventions. It represents the
+// [version of the CloudEvents
+// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+// which the event uses.
+func CloudeventsEventSpecVersion(val string) attribute.KeyValue {
+ return CloudeventsEventSpecVersionKey.String(val)
+}
+
+// CloudeventsEventSubject returns an attribute KeyValue conforming to the
+// "cloudevents.event_subject" semantic conventions. It represents the
+// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+// of the event in the context of the event producer (identified by source).
+func CloudeventsEventSubject(val string) attribute.KeyValue {
+ return CloudeventsEventSubjectKey.String(val)
+}
+
+// CloudeventsEventType returns an attribute KeyValue conforming to the
+// "cloudevents.event_type" semantic conventions. It represents the
+// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+// contains a value describing the type of event related to the originating
+// occurrence.
+func CloudeventsEventType(val string) attribute.KeyValue {
+ return CloudeventsEventTypeKey.String(val)
+}
+
+// These attributes allow to report this unit of code and therefore to provide
+// more context about the span.
+const (
+ // CodeColumnKey is the attribute Key conforming to the "code.column"
+ // semantic conventions. It represents the column number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 16
+ CodeColumnKey = attribute.Key("code.column")
+
+ // CodeFilepathKey is the attribute Key conforming to the "code.filepath"
+ // semantic conventions. It represents the source code file name that
+ // identifies the code unit as uniquely as possible (preferably an absolute
+ // file path).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/local/MyApplication/content_root/app/index.php'
+ CodeFilepathKey = attribute.Key("code.filepath")
+
+ // CodeFunctionKey is the attribute Key conforming to the "code.function"
+ // semantic conventions. It represents the method or function name, or
+ // equivalent (usually rightmost part of the code unit's name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'serveRequest'
+ CodeFunctionKey = attribute.Key("code.function")
+
+ // CodeLineNumberKey is the attribute Key conforming to the "code.lineno"
+ // semantic conventions. It represents the line number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ CodeLineNumberKey = attribute.Key("code.lineno")
+
+ // CodeNamespaceKey is the attribute Key conforming to the "code.namespace"
+ // semantic conventions. It represents the "namespace" within which
+ // `code.function` is defined. Usually the qualified class or module name,
+ // such that `code.namespace` + some separator + `code.function` form a
+ // unique identifier for the code unit.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.example.MyHTTPService'
+ CodeNamespaceKey = attribute.Key("code.namespace")
+
+ // CodeStacktraceKey is the attribute Key conforming to the
+ // "code.stacktrace" semantic conventions. It represents a stacktrace as a
+ // string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'at
+ // com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ CodeStacktraceKey = attribute.Key("code.stacktrace")
+)
+
+// CodeColumn returns an attribute KeyValue conforming to the "code.column"
+// semantic conventions. It represents the column number in `code.filepath`
+// best representing the operation. It SHOULD point within the code unit named
+// in `code.function`.
+func CodeColumn(val int) attribute.KeyValue {
+ return CodeColumnKey.Int(val)
+}
+
+// CodeFilepath returns an attribute KeyValue conforming to the
+// "code.filepath" semantic conventions. It represents the source code file
+// name that identifies the code unit as uniquely as possible (preferably an
+// absolute file path).
+func CodeFilepath(val string) attribute.KeyValue {
+ return CodeFilepathKey.String(val)
+}
+
+// CodeFunction returns an attribute KeyValue conforming to the
+// "code.function" semantic conventions. It represents the method or function
+// name, or equivalent (usually rightmost part of the code unit's name).
+func CodeFunction(val string) attribute.KeyValue {
+ return CodeFunctionKey.String(val)
+}
+
+// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno"
+// semantic conventions. It represents the line number in `code.filepath` best
+// representing the operation. It SHOULD point within the code unit named in
+// `code.function`.
+func CodeLineNumber(val int) attribute.KeyValue {
+ return CodeLineNumberKey.Int(val)
+}
+
+// CodeNamespace returns an attribute KeyValue conforming to the
+// "code.namespace" semantic conventions. It represents the "namespace" within
+// which `code.function` is defined. Usually the qualified class or module
+// name, such that `code.namespace` + some separator + `code.function` form a
+// unique identifier for the code unit.
+func CodeNamespace(val string) attribute.KeyValue {
+ return CodeNamespaceKey.String(val)
+}
+
+// CodeStacktrace returns an attribute KeyValue conforming to the
+// "code.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func CodeStacktrace(val string) attribute.KeyValue {
+ return CodeStacktraceKey.String(val)
+}
+
+// A container instance.
+const (
+ // ContainerCommandKey is the attribute Key conforming to the
+ // "container.command" semantic conventions. It represents the command used
+ // to run the container (i.e. the command name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol'
+ // Note: If using embedded credentials or sensitive data, it is recommended
+ // to remove them to prevent potential leakage.
+ ContainerCommandKey = attribute.Key("container.command")
+
+ // ContainerCommandArgsKey is the attribute Key conforming to the
+ // "container.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) run by the
+ // container. [2]
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol, --config, config.yaml'
+ ContainerCommandArgsKey = attribute.Key("container.command_args")
+
+ // ContainerCommandLineKey is the attribute Key conforming to the
+ // "container.command_line" semantic conventions. It represents the full
+ // command run by the container as a single string representing the full
+ // command. [2]
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol --config config.yaml'
+ ContainerCommandLineKey = attribute.Key("container.command_line")
+
+ // ContainerCPUStateKey is the attribute Key conforming to the
+ // "container.cpu.state" semantic conventions. It represents the CPU state
+ // for this data point.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'user', 'kernel'
+ ContainerCPUStateKey = attribute.Key("container.cpu.state")
+
+ // ContainerIDKey is the attribute Key conforming to the "container.id"
+ // semantic conventions. It represents the container ID. Usually a UUID, as
+ // for example used to [identify Docker
+ // containers](https://docs.docker.com/engine/reference/run/#container-identification).
+ // The UUID might be abbreviated.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'a3bf90e006b2'
+ ContainerIDKey = attribute.Key("container.id")
+
+ // ContainerImageIDKey is the attribute Key conforming to the
+ // "container.image.id" semantic conventions. It represents the runtime
+ // specific image identifier. Usually a hash algorithm followed by a UUID.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
+ // Note: Docker defines a sha256 of the image id; `container.image.id`
+ // corresponds to the `Image` field from the Docker container inspect
+ // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
+ // endpoint.
+ // K8S defines a link to the container registry repository with digest
+ // `"imageID": "registry.azurecr.io
+ // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
+ // The ID is assigned by the container runtime and can vary in different
+ // environments. Consider using `oci.manifest.digest` if it is important to
+ // identify the same image in different environments/runtimes.
+ ContainerImageIDKey = attribute.Key("container.image.id")
+
+ // ContainerImageNameKey is the attribute Key conforming to the
+ // "container.image.name" semantic conventions. It represents the name of
+ // the image the container was built on.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gcr.io/opentelemetry/operator'
+ ContainerImageNameKey = attribute.Key("container.image.name")
+
+ // ContainerImageRepoDigestsKey is the attribute Key conforming to the
+ // "container.image.repo_digests" semantic conventions. It represents the
+ // repo digests of the container image as provided by the container
+ // runtime.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb',
+ // 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578'
+ // Note:
+ // [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect)
+ // and
+ // [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238)
+ // report those under the `RepoDigests` field.
+ ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests")
+
+ // ContainerImageTagsKey is the attribute Key conforming to the
+ // "container.image.tags" semantic conventions. It represents the container
+ // image tags. An example can be found in [Docker Image
+ // Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+ // Should be only the `` section of the full name for example from
+ // `registry.example.com/my-org/my-image:`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'v1.27.1', '3.5.7-0'
+ ContainerImageTagsKey = attribute.Key("container.image.tags")
+
+ // ContainerNameKey is the attribute Key conforming to the "container.name"
+ // semantic conventions. It represents the container name used by container
+ // runtime.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-autoconf'
+ ContainerNameKey = attribute.Key("container.name")
+
+ // ContainerRuntimeKey is the attribute Key conforming to the
+ // "container.runtime" semantic conventions. It represents the container
+ // runtime managing this container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'docker', 'containerd', 'rkt'
+ ContainerRuntimeKey = attribute.Key("container.runtime")
+)
+
+var (
+ // When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)
+ ContainerCPUStateUser = ContainerCPUStateKey.String("user")
+ // When CPU is used by the system (host OS)
+ ContainerCPUStateSystem = ContainerCPUStateKey.String("system")
+ // When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)
+ ContainerCPUStateKernel = ContainerCPUStateKey.String("kernel")
+)
+
+// ContainerCommand returns an attribute KeyValue conforming to the
+// "container.command" semantic conventions. It represents the command used to
+// run the container (i.e. the command name).
+func ContainerCommand(val string) attribute.KeyValue {
+ return ContainerCommandKey.String(val)
+}
+
+// ContainerCommandArgs returns an attribute KeyValue conforming to the
+// "container.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) run by the
+// container. [2]
+func ContainerCommandArgs(val ...string) attribute.KeyValue {
+ return ContainerCommandArgsKey.StringSlice(val)
+}
+
+// ContainerCommandLine returns an attribute KeyValue conforming to the
+// "container.command_line" semantic conventions. It represents the full
+// command run by the container as a single string representing the full
+// command. [2]
+func ContainerCommandLine(val string) attribute.KeyValue {
+ return ContainerCommandLineKey.String(val)
+}
+
+// ContainerID returns an attribute KeyValue conforming to the
+// "container.id" semantic conventions. It represents the container ID. Usually
+// a UUID, as for example used to [identify Docker
+// containers](https://docs.docker.com/engine/reference/run/#container-identification).
+// The UUID might be abbreviated.
+func ContainerID(val string) attribute.KeyValue {
+ return ContainerIDKey.String(val)
+}
+
+// ContainerImageID returns an attribute KeyValue conforming to the
+// "container.image.id" semantic conventions. It represents the runtime
+// specific image identifier. Usually a hash algorithm followed by a UUID.
+func ContainerImageID(val string) attribute.KeyValue {
+ return ContainerImageIDKey.String(val)
+}
+
+// ContainerImageName returns an attribute KeyValue conforming to the
+// "container.image.name" semantic conventions. It represents the name of the
+// image the container was built on.
+func ContainerImageName(val string) attribute.KeyValue {
+ return ContainerImageNameKey.String(val)
+}
+
+// ContainerImageRepoDigests returns an attribute KeyValue conforming to the
+// "container.image.repo_digests" semantic conventions. It represents the repo
+// digests of the container image as provided by the container runtime.
+func ContainerImageRepoDigests(val ...string) attribute.KeyValue {
+ return ContainerImageRepoDigestsKey.StringSlice(val)
+}
+
+// ContainerImageTags returns an attribute KeyValue conforming to the
+// "container.image.tags" semantic conventions. It represents the container
+// image tags. An example can be found in [Docker Image
+// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+// Should be only the `` section of the full name for example from
+// `registry.example.com/my-org/my-image:`.
+func ContainerImageTags(val ...string) attribute.KeyValue {
+ return ContainerImageTagsKey.StringSlice(val)
+}
+
+// ContainerName returns an attribute KeyValue conforming to the
+// "container.name" semantic conventions. It represents the container name used
+// by container runtime.
+func ContainerName(val string) attribute.KeyValue {
+ return ContainerNameKey.String(val)
+}
+
+// ContainerRuntime returns an attribute KeyValue conforming to the
+// "container.runtime" semantic conventions. It represents the container
+// runtime managing this container.
+func ContainerRuntime(val string) attribute.KeyValue {
+ return ContainerRuntimeKey.String(val)
+}
+
+// This group defines the attributes used to describe telemetry in the context
+// of databases.
+const (
+ // DBClientConnectionsPoolNameKey is the attribute Key conforming to the
+ // "db.client.connections.pool.name" semantic conventions. It represents
+ // the name of the connection pool; unique within the instrumented
+ // application. In case the connection pool implementation doesn't provide
+ // a name, instrumentation should use a combination of `server.address` and
+ // `server.port` attributes formatted as `server.address:server.port`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myDataSource'
+ DBClientConnectionsPoolNameKey = attribute.Key("db.client.connections.pool.name")
+
+ // DBClientConnectionsStateKey is the attribute Key conforming to the
+ // "db.client.connections.state" semantic conventions. It represents the
+ // state of a connection in the pool
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle'
+ DBClientConnectionsStateKey = attribute.Key("db.client.connections.state")
+
+ // DBCollectionNameKey is the attribute Key conforming to the
+ // "db.collection.name" semantic conventions. It represents the name of a
+ // collection (table, container) within the database.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'public.users', 'customers'
+ // Note: If the collection name is parsed from the query, it SHOULD match
+ // the value provided in the query and may be qualified with the schema and
+ // database name.
+ // It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ DBCollectionNameKey = attribute.Key("db.collection.name")
+
+ // DBNamespaceKey is the attribute Key conforming to the "db.namespace"
+ // semantic conventions. It represents the name of the database, fully
+ // qualified within the server address and port.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'customers', 'test.users'
+ // Note: If a database system has multiple namespace components, they
+ // SHOULD be concatenated (potentially using database system specific
+ // conventions) from most general to most specific namespace component, and
+ // more specific namespaces SHOULD NOT be captured without the more general
+ // namespaces, to ensure that "startswith" queries for the more general
+ // namespaces will be valid.
+ // Semantic conventions for individual database systems SHOULD document
+ // what `db.namespace` means in the context of that system.
+ // It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ DBNamespaceKey = attribute.Key("db.namespace")
+
+ // DBOperationNameKey is the attribute Key conforming to the
+ // "db.operation.name" semantic conventions. It represents the name of the
+ // operation or command being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findAndModify', 'HMSET', 'SELECT'
+ // Note: It is RECOMMENDED to capture the value as provided by the
+ // application without attempting to do any case normalization.
+ DBOperationNameKey = attribute.Key("db.operation.name")
+
+ // DBQueryTextKey is the attribute Key conforming to the "db.query.text"
+ // semantic conventions. It represents the database query being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'SELECT * FROM wuser_table where username = ?', 'SET mykey
+ // "WuValue"'
+ DBQueryTextKey = attribute.Key("db.query.text")
+
+ // DBSystemKey is the attribute Key conforming to the "db.system" semantic
+ // conventions. It represents the database management system (DBMS) product
+ // as identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The actual DBMS may differ from the one identified by the client.
+ // For example, when using PostgreSQL client libraries to connect to a
+ // CockroachDB, the `db.system` is set to `postgresql` based on the
+ // instrumentation's best knowledge.
+ DBSystemKey = attribute.Key("db.system")
+)
+
+var (
+ // idle
+ DBClientConnectionsStateIdle = DBClientConnectionsStateKey.String("idle")
+ // used
+ DBClientConnectionsStateUsed = DBClientConnectionsStateKey.String("used")
+)
+
+var (
+ // Some other SQL database. Fallback only. See notes
+ DBSystemOtherSQL = DBSystemKey.String("other_sql")
+ // Microsoft SQL Server
+ DBSystemMSSQL = DBSystemKey.String("mssql")
+ // Microsoft SQL Server Compact
+ DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
+ // MySQL
+ DBSystemMySQL = DBSystemKey.String("mysql")
+ // Oracle Database
+ DBSystemOracle = DBSystemKey.String("oracle")
+ // IBM DB2
+ DBSystemDB2 = DBSystemKey.String("db2")
+ // PostgreSQL
+ DBSystemPostgreSQL = DBSystemKey.String("postgresql")
+ // Amazon Redshift
+ DBSystemRedshift = DBSystemKey.String("redshift")
+ // Apache Hive
+ DBSystemHive = DBSystemKey.String("hive")
+ // Cloudscape
+ DBSystemCloudscape = DBSystemKey.String("cloudscape")
+ // HyperSQL DataBase
+ DBSystemHSQLDB = DBSystemKey.String("hsqldb")
+ // Progress Database
+ DBSystemProgress = DBSystemKey.String("progress")
+ // SAP MaxDB
+ DBSystemMaxDB = DBSystemKey.String("maxdb")
+ // SAP HANA
+ DBSystemHanaDB = DBSystemKey.String("hanadb")
+ // Ingres
+ DBSystemIngres = DBSystemKey.String("ingres")
+ // FirstSQL
+ DBSystemFirstSQL = DBSystemKey.String("firstsql")
+ // EnterpriseDB
+ DBSystemEDB = DBSystemKey.String("edb")
+ // InterSystems Caché
+ DBSystemCache = DBSystemKey.String("cache")
+ // Adabas (Adaptable Database System)
+ DBSystemAdabas = DBSystemKey.String("adabas")
+ // Firebird
+ DBSystemFirebird = DBSystemKey.String("firebird")
+ // Apache Derby
+ DBSystemDerby = DBSystemKey.String("derby")
+ // FileMaker
+ DBSystemFilemaker = DBSystemKey.String("filemaker")
+ // Informix
+ DBSystemInformix = DBSystemKey.String("informix")
+ // InstantDB
+ DBSystemInstantDB = DBSystemKey.String("instantdb")
+ // InterBase
+ DBSystemInterbase = DBSystemKey.String("interbase")
+ // MariaDB
+ DBSystemMariaDB = DBSystemKey.String("mariadb")
+ // Netezza
+ DBSystemNetezza = DBSystemKey.String("netezza")
+ // Pervasive PSQL
+ DBSystemPervasive = DBSystemKey.String("pervasive")
+ // PointBase
+ DBSystemPointbase = DBSystemKey.String("pointbase")
+ // SQLite
+ DBSystemSqlite = DBSystemKey.String("sqlite")
+ // Sybase
+ DBSystemSybase = DBSystemKey.String("sybase")
+ // Teradata
+ DBSystemTeradata = DBSystemKey.String("teradata")
+ // Vertica
+ DBSystemVertica = DBSystemKey.String("vertica")
+ // H2
+ DBSystemH2 = DBSystemKey.String("h2")
+ // ColdFusion IMQ
+ DBSystemColdfusion = DBSystemKey.String("coldfusion")
+ // Apache Cassandra
+ DBSystemCassandra = DBSystemKey.String("cassandra")
+ // Apache HBase
+ DBSystemHBase = DBSystemKey.String("hbase")
+ // MongoDB
+ DBSystemMongoDB = DBSystemKey.String("mongodb")
+ // Redis
+ DBSystemRedis = DBSystemKey.String("redis")
+ // Couchbase
+ DBSystemCouchbase = DBSystemKey.String("couchbase")
+ // CouchDB
+ DBSystemCouchDB = DBSystemKey.String("couchdb")
+ // Microsoft Azure Cosmos DB
+ DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
+ // Amazon DynamoDB
+ DBSystemDynamoDB = DBSystemKey.String("dynamodb")
+ // Neo4j
+ DBSystemNeo4j = DBSystemKey.String("neo4j")
+ // Apache Geode
+ DBSystemGeode = DBSystemKey.String("geode")
+ // Elasticsearch
+ DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
+ // Memcached
+ DBSystemMemcached = DBSystemKey.String("memcached")
+ // CockroachDB
+ DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
+ // OpenSearch
+ DBSystemOpensearch = DBSystemKey.String("opensearch")
+ // ClickHouse
+ DBSystemClickhouse = DBSystemKey.String("clickhouse")
+ // Cloud Spanner
+ DBSystemSpanner = DBSystemKey.String("spanner")
+ // Trino
+ DBSystemTrino = DBSystemKey.String("trino")
+)
+
+// DBClientConnectionsPoolName returns an attribute KeyValue conforming to
+// the "db.client.connections.pool.name" semantic conventions. It represents
+// the name of the connection pool; unique within the instrumented application.
+// In case the connection pool implementation doesn't provide a name,
+// instrumentation should use a combination of `server.address` and
+// `server.port` attributes formatted as `server.address:server.port`.
+func DBClientConnectionsPoolName(val string) attribute.KeyValue {
+ return DBClientConnectionsPoolNameKey.String(val)
+}
+
+// DBCollectionName returns an attribute KeyValue conforming to the
+// "db.collection.name" semantic conventions. It represents the name of a
+// collection (table, container) within the database.
+func DBCollectionName(val string) attribute.KeyValue {
+ return DBCollectionNameKey.String(val)
+}
+
+// DBNamespace returns an attribute KeyValue conforming to the
+// "db.namespace" semantic conventions. It represents the name of the database,
+// fully qualified within the server address and port.
+func DBNamespace(val string) attribute.KeyValue {
+ return DBNamespaceKey.String(val)
+}
+
+// DBOperationName returns an attribute KeyValue conforming to the
+// "db.operation.name" semantic conventions. It represents the name of the
+// operation or command being executed.
+func DBOperationName(val string) attribute.KeyValue {
+ return DBOperationNameKey.String(val)
+}
+
+// DBQueryText returns an attribute KeyValue conforming to the
+// "db.query.text" semantic conventions. It represents the database query being
+// executed.
+func DBQueryText(val string) attribute.KeyValue {
+ return DBQueryTextKey.String(val)
+}
+
+// This group defines attributes for Cassandra.
+const (
+ // DBCassandraConsistencyLevelKey is the attribute Key conforming to the
+ // "db.cassandra.consistency_level" semantic conventions. It represents the
+ // consistency level of the query. Based on consistency values from
+ // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
+
+ // DBCassandraCoordinatorDCKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.dc" semantic conventions. It represents the
+ // data center of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-west-2'
+ DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
+
+ // DBCassandraCoordinatorIDKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.id" semantic conventions. It represents the ID
+ // of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
+ DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
+
+ // DBCassandraIdempotenceKey is the attribute Key conforming to the
+ // "db.cassandra.idempotence" semantic conventions. It represents the
+ // whether or not the query is idempotent.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
+
+ // DBCassandraPageSizeKey is the attribute Key conforming to the
+ // "db.cassandra.page_size" semantic conventions. It represents the fetch
+ // size used for paging, i.e. how many rows will be returned at once.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 5000
+ DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
+
+ // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming
+ // to the "db.cassandra.speculative_execution_count" semantic conventions.
+ // It represents the number of times a query was speculatively executed.
+ // Not set or `0` if the query was not executed speculatively.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 2
+ DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
+)
+
+var (
+ // all
+ DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
+ // each_quorum
+ DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
+ // quorum
+ DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
+ // local_quorum
+ DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
+ // one
+ DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
+ // two
+ DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
+ // three
+ DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
+ // local_one
+ DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
+ // any
+ DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
+ // serial
+ DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
+ // local_serial
+ DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
+)
+
+// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.dc" semantic conventions. It represents the data
+// center of the coordinating node for a query.
+func DBCassandraCoordinatorDC(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorDCKey.String(val)
+}
+
+// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of
+// the coordinating node for a query.
+func DBCassandraCoordinatorID(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorIDKey.String(val)
+}
+
+// DBCassandraIdempotence returns an attribute KeyValue conforming to the
+// "db.cassandra.idempotence" semantic conventions. It represents the whether
+// or not the query is idempotent.
+func DBCassandraIdempotence(val bool) attribute.KeyValue {
+ return DBCassandraIdempotenceKey.Bool(val)
+}
+
+// DBCassandraPageSize returns an attribute KeyValue conforming to the
+// "db.cassandra.page_size" semantic conventions. It represents the fetch size
+// used for paging, i.e. how many rows will be returned at once.
+func DBCassandraPageSize(val int) attribute.KeyValue {
+ return DBCassandraPageSizeKey.Int(val)
+}
+
+// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue
+// conforming to the "db.cassandra.speculative_execution_count" semantic
+// conventions. It represents the number of times a query was speculatively
+// executed. Not set or `0` if the query was not executed speculatively.
+func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
+ return DBCassandraSpeculativeExecutionCountKey.Int(val)
+}
+
+// This group defines attributes for Azure Cosmos DB.
+const (
+ // DBCosmosDBClientIDKey is the attribute Key conforming to the
+ // "db.cosmosdb.client_id" semantic conventions. It represents the unique
+ // Cosmos client instance id.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
+ DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id")
+
+ // DBCosmosDBConnectionModeKey is the attribute Key conforming to the
+ // "db.cosmosdb.connection_mode" semantic conventions. It represents the
+ // cosmos client connection mode.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode")
+
+ // DBCosmosDBOperationTypeKey is the attribute Key conforming to the
+ // "db.cosmosdb.operation_type" semantic conventions. It represents the
+ // cosmosDB Operation Type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type")
+
+ // DBCosmosDBRequestChargeKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+ // consumed for that operation
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 46.18, 1.0
+ DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge")
+
+ // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_content_length" semantic conventions. It represents
+ // the request payload size in bytes
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length")
+
+ // DBCosmosDBStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos
+ // DB status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 200, 201
+ DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code")
+
+ // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.sub_status_code" semantic conventions. It represents the
+ // cosmos DB sub status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000, 1002
+ DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code")
+)
+
+var (
+ // Gateway (HTTP) connections mode
+ DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway")
+ // Direct connection
+ DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct")
+)
+
+var (
+ // invalid
+ DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid")
+ // create
+ DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create")
+ // patch
+ DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch")
+ // read
+ DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read")
+ // read_feed
+ DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed")
+ // delete
+ DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete")
+ // replace
+ DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace")
+ // execute
+ DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute")
+ // query
+ DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query")
+ // head
+ DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head")
+ // head_feed
+ DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed")
+ // upsert
+ DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert")
+ // batch
+ DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch")
+ // query_plan
+ DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan")
+ // execute_javascript
+ DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript")
+)
+
+// DBCosmosDBClientID returns an attribute KeyValue conforming to the
+// "db.cosmosdb.client_id" semantic conventions. It represents the unique
+// Cosmos client instance id.
+func DBCosmosDBClientID(val string) attribute.KeyValue {
+ return DBCosmosDBClientIDKey.String(val)
+}
+
+// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the
+// "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+// consumed for that operation
+func DBCosmosDBRequestCharge(val float64) attribute.KeyValue {
+ return DBCosmosDBRequestChargeKey.Float64(val)
+}
+
+// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming
+// to the "db.cosmosdb.request_content_length" semantic conventions. It
+// represents the request payload size in bytes
+func DBCosmosDBRequestContentLength(val int) attribute.KeyValue {
+ return DBCosmosDBRequestContentLengthKey.Int(val)
+}
+
+// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB
+// status code.
+func DBCosmosDBStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBStatusCodeKey.Int(val)
+}
+
+// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos
+// DB sub status code.
+func DBCosmosDBSubStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBSubStatusCodeKey.Int(val)
+}
+
+// This group defines attributes for Elasticsearch.
+const (
+ // DBElasticsearchClusterNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.cluster.name" semantic conventions. It represents the
+ // represents the identifier of an Elasticsearch cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e9106fc68e3044f0b1475b04bf4ffd5f'
+ DBElasticsearchClusterNameKey = attribute.Key("db.elasticsearch.cluster.name")
+
+ // DBElasticsearchNodeNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.node.name" semantic conventions. It represents the
+ // represents the human-readable identifier of the node/instance to which a
+ // request was routed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-0000000001'
+ DBElasticsearchNodeNameKey = attribute.Key("db.elasticsearch.node.name")
+)
+
+// DBElasticsearchClusterName returns an attribute KeyValue conforming to
+// the "db.elasticsearch.cluster.name" semantic conventions. It represents the
+// represents the identifier of an Elasticsearch cluster.
+func DBElasticsearchClusterName(val string) attribute.KeyValue {
+ return DBElasticsearchClusterNameKey.String(val)
+}
+
+// DBElasticsearchNodeName returns an attribute KeyValue conforming to the
+// "db.elasticsearch.node.name" semantic conventions. It represents the
+// represents the human-readable identifier of the node/instance to which a
+// request was routed.
+func DBElasticsearchNodeName(val string) attribute.KeyValue {
+ return DBElasticsearchNodeNameKey.String(val)
+}
+
+// Attributes for software deployments.
+const (
+ // DeploymentEnvironmentKey is the attribute Key conforming to the
+ // "deployment.environment" semantic conventions. It represents the name of
+ // the [deployment
+ // environment](https://wikipedia.org/wiki/Deployment_environment) (aka
+ // deployment tier).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'staging', 'production'
+ // Note: `deployment.environment` does not affect the uniqueness
+ // constraints defined through
+ // the `service.namespace`, `service.name` and `service.instance.id`
+ // resource attributes.
+ // This implies that resources carrying the following attribute
+ // combinations MUST be
+ // considered to be identifying the same service:
+ //
+ // * `service.name=frontend`, `deployment.environment=production`
+ // * `service.name=frontend`, `deployment.environment=staging`.
+ DeploymentEnvironmentKey = attribute.Key("deployment.environment")
+)
+
+// DeploymentEnvironment returns an attribute KeyValue conforming to the
+// "deployment.environment" semantic conventions. It represents the name of the
+// [deployment environment](https://wikipedia.org/wiki/Deployment_environment)
+// (aka deployment tier).
+func DeploymentEnvironment(val string) attribute.KeyValue {
+ return DeploymentEnvironmentKey.String(val)
+}
+
+// Attributes that represents an occurrence of a lifecycle transition on the
+// Android platform.
+const (
+ // AndroidStateKey is the attribute Key conforming to the "android.state"
+ // semantic conventions. It represents the deprecated use the
+ // `device.app.lifecycle` event definition including `android.state` as a
+ // payload field instead.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The Android lifecycle states are defined in [Activity lifecycle
+ // callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc),
+ // and from which the `OS identifiers` are derived.
+ AndroidStateKey = attribute.Key("android.state")
+)
+
+var (
+ // Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time
+ AndroidStateCreated = AndroidStateKey.String("created")
+ // Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state
+ AndroidStateBackground = AndroidStateKey.String("background")
+ // Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states
+ AndroidStateForeground = AndroidStateKey.String("foreground")
+)
+
+// These attributes may be used to describe the receiver of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // DestinationAddressKey is the attribute Key conforming to the
+ // "destination.address" semantic conventions. It represents the
+ // destination address - domain name if available without reverse DNS
+ // lookup; otherwise, IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'destination.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the source side, and when communicating through
+ // an intermediary, `destination.address` SHOULD represent the destination
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ DestinationAddressKey = attribute.Key("destination.address")
+
+ // DestinationPortKey is the attribute Key conforming to the
+ // "destination.port" semantic conventions. It represents the destination
+ // port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ DestinationPortKey = attribute.Key("destination.port")
+)
+
+// DestinationAddress returns an attribute KeyValue conforming to the
+// "destination.address" semantic conventions. It represents the destination
+// address - domain name if available without reverse DNS lookup; otherwise, IP
+// address or Unix domain socket name.
+func DestinationAddress(val string) attribute.KeyValue {
+ return DestinationAddressKey.String(val)
+}
+
+// DestinationPort returns an attribute KeyValue conforming to the
+// "destination.port" semantic conventions. It represents the destination port
+// number
+func DestinationPort(val int) attribute.KeyValue {
+ return DestinationPortKey.Int(val)
+}
+
+// Describes device attributes.
+const (
+ // DeviceIDKey is the attribute Key conforming to the "device.id" semantic
+ // conventions. It represents a unique identifier representing the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092'
+ // Note: The device identifier MUST only be defined using the values
+ // outlined below. This value is not an advertising identifier and MUST NOT
+ // be used as such. On iOS (Swift or Objective-C), this value MUST be equal
+ // to the [vendor
+ // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
+ // On Android (Java or Kotlin), this value MUST be equal to the Firebase
+ // Installation ID or a globally unique UUID which is persisted across
+ // sessions in your application. More information can be found
+ // [here](https://developer.android.com/training/articles/user-data-ids) on
+ // best practices and exact implementation details. Caution should be taken
+ // when storing personal data or anything which can identify a user. GDPR
+ // and data protection laws may apply, ensure you do your own due
+ // diligence.
+ DeviceIDKey = attribute.Key("device.id")
+
+ // DeviceManufacturerKey is the attribute Key conforming to the
+ // "device.manufacturer" semantic conventions. It represents the name of
+ // the device manufacturer
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Apple', 'Samsung'
+ // Note: The Android OS provides this field via
+ // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER).
+ // iOS apps SHOULD hardcode the value `Apple`.
+ DeviceManufacturerKey = attribute.Key("device.manufacturer")
+
+ // DeviceModelIdentifierKey is the attribute Key conforming to the
+ // "device.model.identifier" semantic conventions. It represents the model
+ // identifier for the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone3,4', 'SM-G920F'
+ // Note: It's recommended this value represents a machine-readable version
+ // of the model identifier rather than the market or consumer-friendly name
+ // of the device.
+ DeviceModelIdentifierKey = attribute.Key("device.model.identifier")
+
+ // DeviceModelNameKey is the attribute Key conforming to the
+ // "device.model.name" semantic conventions. It represents the marketing
+ // name for the device model
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6'
+ // Note: It's recommended this value represents a human-readable version of
+ // the device model rather than a machine-readable alternative.
+ DeviceModelNameKey = attribute.Key("device.model.name")
+)
+
+// DeviceID returns an attribute KeyValue conforming to the "device.id"
+// semantic conventions. It represents a unique identifier representing the
+// device
+func DeviceID(val string) attribute.KeyValue {
+ return DeviceIDKey.String(val)
+}
+
+// DeviceManufacturer returns an attribute KeyValue conforming to the
+// "device.manufacturer" semantic conventions. It represents the name of the
+// device manufacturer
+func DeviceManufacturer(val string) attribute.KeyValue {
+ return DeviceManufacturerKey.String(val)
+}
+
+// DeviceModelIdentifier returns an attribute KeyValue conforming to the
+// "device.model.identifier" semantic conventions. It represents the model
+// identifier for the device
+func DeviceModelIdentifier(val string) attribute.KeyValue {
+ return DeviceModelIdentifierKey.String(val)
+}
+
+// DeviceModelName returns an attribute KeyValue conforming to the
+// "device.model.name" semantic conventions. It represents the marketing name
+// for the device model
+func DeviceModelName(val string) attribute.KeyValue {
+ return DeviceModelNameKey.String(val)
+}
+
+// These attributes may be used for any disk related operation.
+const (
+ // DiskIoDirectionKey is the attribute Key conforming to the
+ // "disk.io.direction" semantic conventions. It represents the disk IO
+ // operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read'
+ DiskIoDirectionKey = attribute.Key("disk.io.direction")
+)
+
+var (
+ // read
+ DiskIoDirectionRead = DiskIoDirectionKey.String("read")
+ // write
+ DiskIoDirectionWrite = DiskIoDirectionKey.String("write")
+)
+
+// The shared attributes used to report a DNS query.
+const (
+ // DNSQuestionNameKey is the attribute Key conforming to the
+ // "dns.question.name" semantic conventions. It represents the name being
+ // queried.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'www.example.com', 'opentelemetry.io'
+ // Note: If the name field contains non-printable characters (below 32 or
+ // above 126), those characters should be represented as escaped base 10
+ // integers (\DDD). Back slashes and quotes should be escaped. Tabs,
+ // carriage returns, and line feeds should be converted to \t, \r, and \n
+ // respectively.
+ DNSQuestionNameKey = attribute.Key("dns.question.name")
+)
+
+// DNSQuestionName returns an attribute KeyValue conforming to the
+// "dns.question.name" semantic conventions. It represents the name being
+// queried.
+func DNSQuestionName(val string) attribute.KeyValue {
+ return DNSQuestionNameKey.String(val)
+}
+
+// Attributes for operations with an authenticated and/or authorized enduser.
+const (
+ // EnduserIDKey is the attribute Key conforming to the "enduser.id"
+ // semantic conventions. It represents the username or client_id extracted
+ // from the access token or
+ // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header
+ // in the inbound request from outside the system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'username'
+ EnduserIDKey = attribute.Key("enduser.id")
+
+ // EnduserRoleKey is the attribute Key conforming to the "enduser.role"
+ // semantic conventions. It represents the actual/assumed role the client
+ // is making the request under extracted from token or application security
+ // context.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'admin'
+ EnduserRoleKey = attribute.Key("enduser.role")
+
+ // EnduserScopeKey is the attribute Key conforming to the "enduser.scope"
+ // semantic conventions. It represents the scopes or granted authorities
+ // the client currently possesses extracted from token or application
+ // security context. The value would come from the scope associated with an
+ // [OAuth 2.0 Access
+ // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+ // value in a [SAML 2.0
+ // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read:message, write:files'
+ EnduserScopeKey = attribute.Key("enduser.scope")
+)
+
+// EnduserID returns an attribute KeyValue conforming to the "enduser.id"
+// semantic conventions. It represents the username or client_id extracted from
+// the access token or
+// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in
+// the inbound request from outside the system.
+func EnduserID(val string) attribute.KeyValue {
+ return EnduserIDKey.String(val)
+}
+
+// EnduserRole returns an attribute KeyValue conforming to the
+// "enduser.role" semantic conventions. It represents the actual/assumed role
+// the client is making the request under extracted from token or application
+// security context.
+func EnduserRole(val string) attribute.KeyValue {
+ return EnduserRoleKey.String(val)
+}
+
+// EnduserScope returns an attribute KeyValue conforming to the
+// "enduser.scope" semantic conventions. It represents the scopes or granted
+// authorities the client currently possesses extracted from token or
+// application security context. The value would come from the scope associated
+// with an [OAuth 2.0 Access
+// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+// value in a [SAML 2.0
+// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+func EnduserScope(val string) attribute.KeyValue {
+ return EnduserScopeKey.String(val)
+}
+
+// The shared attributes used to report an error.
+const (
+ // ErrorTypeKey is the attribute Key conforming to the "error.type"
+ // semantic conventions. It represents the describes a class of error the
+ // operation ended with.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'timeout', 'java.net.UnknownHostException',
+ // 'server_certificate_invalid', '500'
+ // Note: The `error.type` SHOULD be predictable, and SHOULD have low
+ // cardinality.
+ //
+ // When `error.type` is set to a type (e.g., an exception type), its
+ // canonical class name identifying the type within the artifact SHOULD be
+ // used.
+ //
+ // Instrumentations SHOULD document the list of errors they report.
+ //
+ // The cardinality of `error.type` within one instrumentation library
+ // SHOULD be low.
+ // Telemetry consumers that aggregate data from multiple instrumentation
+ // libraries and applications
+ // should be prepared for `error.type` to have high cardinality at query
+ // time when no
+ // additional filters are applied.
+ //
+ // If the operation has completed successfully, instrumentations SHOULD NOT
+ // set `error.type`.
+ //
+ // If a specific domain defines its own set of error identifiers (such as
+ // HTTP or gRPC status codes),
+ // it's RECOMMENDED to:
+ //
+ // * Use a domain-specific attribute
+ // * Set `error.type` to capture all errors, regardless of whether they are
+ // defined within the domain-specific set or not.
+ ErrorTypeKey = attribute.Key("error.type")
+)
+
+var (
+ // A fallback error value to be used when the instrumentation doesn't define a custom value
+ ErrorTypeOther = ErrorTypeKey.String("_OTHER")
+)
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the identifies the class / type of
+ // event.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'browser.mouse.click', 'device.app.lifecycle'
+ // Note: Event names are subject to the same rules as [attribute
+ // names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.33.0/specification/common/attribute-naming.md).
+ // Notably, event names are namespaced to avoid collisions and provide a
+ // clean separation of semantics for events in separate domains like
+ // browser, mobile, and kubernetes.
+ EventNameKey = attribute.Key("event.name")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the identifies the class / type of
+// event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// The shared attributes used to report a single exception associated with a
+// span or log.
+const (
+ // ExceptionEscapedKey is the attribute Key conforming to the
+ // "exception.escaped" semantic conventions. It represents the sHOULD be
+ // set to true if the exception event is recorded at a point where it is
+ // known that the exception is escaping the scope of the span.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Note: An exception is considered to have escaped (or left) the scope of
+ // a span,
+ // if that span is ended while the exception is still logically "in
+ // flight".
+ // This may be actually "in flight" in some languages (e.g. if the
+ // exception
+ // is passed to a Context manager's `__exit__` method in Python) but will
+ // usually be caught at the point of recording the exception in most
+ // languages.
+ //
+ // It is usually not possible to determine at the point where an exception
+ // is thrown
+ // whether it will escape the scope of a span.
+ // However, it is trivial to know that an exception
+ // will escape, if one checks for an active exception just before ending
+ // the span,
+ // as done in the [example for recording span
+ // exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception).
+ //
+ // It follows that an exception may still escape the scope of the span
+ // even if the `exception.escaped` attribute was not set or set to false,
+ // since the event might have been recorded at a time where it was not
+ // clear whether the exception will escape.
+ ExceptionEscapedKey = attribute.Key("exception.escaped")
+
+ // ExceptionMessageKey is the attribute Key conforming to the
+ // "exception.message" semantic conventions. It represents the exception
+ // message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Division by zero', "Can't convert 'int' object to str
+ // implicitly"
+ ExceptionMessageKey = attribute.Key("exception.message")
+
+ // ExceptionStacktraceKey is the attribute Key conforming to the
+ // "exception.stacktrace" semantic conventions. It represents a stacktrace
+ // as a string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
+ // exception\\n at '
+ // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
+
+ // ExceptionTypeKey is the attribute Key conforming to the "exception.type"
+ // semantic conventions. It represents the type of the exception (its
+ // fully-qualified class name, if applicable). The dynamic type of the
+ // exception should be preferred over the static type in languages that
+ // support it.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'java.net.ConnectException', 'OSError'
+ ExceptionTypeKey = attribute.Key("exception.type")
+)
+
+// ExceptionEscaped returns an attribute KeyValue conforming to the
+// "exception.escaped" semantic conventions. It represents the sHOULD be set to
+// true if the exception event is recorded at a point where it is known that
+// the exception is escaping the scope of the span.
+func ExceptionEscaped(val bool) attribute.KeyValue {
+ return ExceptionEscapedKey.Bool(val)
+}
+
+// ExceptionMessage returns an attribute KeyValue conforming to the
+// "exception.message" semantic conventions. It represents the exception
+// message.
+func ExceptionMessage(val string) attribute.KeyValue {
+ return ExceptionMessageKey.String(val)
+}
+
+// ExceptionStacktrace returns an attribute KeyValue conforming to the
+// "exception.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func ExceptionStacktrace(val string) attribute.KeyValue {
+ return ExceptionStacktraceKey.String(val)
+}
+
+// ExceptionType returns an attribute KeyValue conforming to the
+// "exception.type" semantic conventions. It represents the type of the
+// exception (its fully-qualified class name, if applicable). The dynamic type
+// of the exception should be preferred over the static type in languages that
+// support it.
+func ExceptionType(val string) attribute.KeyValue {
+ return ExceptionTypeKey.String(val)
+}
+
+// FaaS attributes
+const (
+ // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
+ // semantic conventions. It represents a boolean that is true if the
+ // serverless function is executed for the first time (aka cold-start).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSColdstartKey = attribute.Key("faas.coldstart")
+
+ // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
+ // conventions. It represents a string containing the schedule period as
+ // [Cron
+ // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0/5 * * * ? *'
+ FaaSCronKey = attribute.Key("faas.cron")
+
+ // FaaSDocumentCollectionKey is the attribute Key conforming to the
+ // "faas.document.collection" semantic conventions. It represents the name
+ // of the source on which the triggering operation was performed. For
+ // example, in Cloud Storage or S3 corresponds to the bucket name, and in
+ // Cosmos DB to the database name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myBucketName', 'myDBName'
+ FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
+
+ // FaaSDocumentNameKey is the attribute Key conforming to the
+ // "faas.document.name" semantic conventions. It represents the document
+ // name/table subjected to the operation. For example, in Cloud Storage or
+ // S3 is the name of the file, and in Cosmos DB the table name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myFile.txt', 'myTableName'
+ FaaSDocumentNameKey = attribute.Key("faas.document.name")
+
+ // FaaSDocumentOperationKey is the attribute Key conforming to the
+ // "faas.document.operation" semantic conventions. It represents the
+ // describes the type of the operation that was performed on the data.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
+
+ // FaaSDocumentTimeKey is the attribute Key conforming to the
+ // "faas.document.time" semantic conventions. It represents a string
+ // containing the time when the data was accessed in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSDocumentTimeKey = attribute.Key("faas.document.time")
+
+ // FaaSInstanceKey is the attribute Key conforming to the "faas.instance"
+ // semantic conventions. It represents the execution environment ID as a
+ // string, that will be potentially reused for other invocations to the
+ // same function/function version.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de'
+ // Note: * **AWS Lambda:** Use the (full) log stream name.
+ FaaSInstanceKey = attribute.Key("faas.instance")
+
+ // FaaSInvocationIDKey is the attribute Key conforming to the
+ // "faas.invocation_id" semantic conventions. It represents the invocation
+ // ID of the current function invocation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
+ FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
+
+ // FaaSInvokedNameKey is the attribute Key conforming to the
+ // "faas.invoked_name" semantic conventions. It represents the name of the
+ // invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-function'
+ // Note: SHOULD be equal to the `faas.name` resource attribute of the
+ // invoked function.
+ FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
+
+ // FaaSInvokedProviderKey is the attribute Key conforming to the
+ // "faas.invoked_provider" semantic conventions. It represents the cloud
+ // provider of the invoked function.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
+ // invoked function.
+ FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
+
+ // FaaSInvokedRegionKey is the attribute Key conforming to the
+ // "faas.invoked_region" semantic conventions. It represents the cloud
+ // region of the invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'eu-central-1'
+ // Note: SHOULD be equal to the `cloud.region` resource attribute of the
+ // invoked function.
+ FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
+
+ // FaaSMaxMemoryKey is the attribute Key conforming to the
+ // "faas.max_memory" semantic conventions. It represents the amount of
+ // memory available to the serverless function converted to Bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 134217728
+ // Note: It's recommended to set this attribute since e.g. too little
+ // memory can easily stop a Java AWS Lambda function from working
+ // correctly. On AWS Lambda, the environment variable
+ // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must
+ // be multiplied by 1,048,576).
+ FaaSMaxMemoryKey = attribute.Key("faas.max_memory")
+
+ // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic
+ // conventions. It represents the name of the single function that this
+ // runtime instance executes.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-function', 'myazurefunctionapp/some-function-name'
+ // Note: This is the name of the function as configured/deployed on the
+ // FaaS
+ // platform and is usually different from the name of the callback
+ // function (which may be stored in the
+ // [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes)
+ // span attributes).
+ //
+ // For some cloud providers, the above definition is ambiguous. The
+ // following
+ // definition of function name MUST be used for this attribute
+ // (and consequently the span name) for the listed cloud
+ // providers/products:
+ //
+ // * **Azure:** The full name `/`, i.e., function app name
+ // followed by a forward slash followed by the function name (this form
+ // can also be seen in the resource JSON for the function).
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider (see also the `cloud.resource_id` attribute).
+ FaaSNameKey = attribute.Key("faas.name")
+
+ // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
+ // conventions. It represents a string containing the function invocation
+ // time in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSTimeKey = attribute.Key("faas.time")
+
+ // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
+ // semantic conventions. It represents the type of the trigger which caused
+ // this function invocation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSTriggerKey = attribute.Key("faas.trigger")
+
+ // FaaSVersionKey is the attribute Key conforming to the "faas.version"
+ // semantic conventions. It represents the immutable version of the
+ // function being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '26', 'pinkfroid-00002'
+ // Note: Depending on the cloud provider and platform, use:
+ //
+ // * **AWS Lambda:** The [function
+ // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
+ // (an integer represented as a decimal string).
+ // * **Google Cloud Run (Services):** The
+ // [revision](https://cloud.google.com/run/docs/managing/revisions)
+ // (i.e., the function name plus the revision suffix).
+ // * **Google Cloud Functions:** The value of the
+ // [`K_REVISION` environment
+ // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
+ // * **Azure Functions:** Not applicable. Do not set this attribute.
+ FaaSVersionKey = attribute.Key("faas.version")
+)
+
+var (
+ // When a new object is created
+ FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
+ // When an object is modified
+ FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
+ // When an object is deleted
+ FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
+)
+
+var (
+ // Alibaba Cloud
+ FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
+ // Microsoft Azure
+ FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
+ // Google Cloud Platform
+ FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
+ // Tencent Cloud
+ FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
+)
+
+var (
+ // A response to some data source operation such as a database or filesystem read/write
+ FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
+ // To provide an answer to an inbound HTTP request
+ FaaSTriggerHTTP = FaaSTriggerKey.String("http")
+ // A function is set to be executed when messages are sent to a messaging system
+ FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
+ // A function is scheduled to be executed regularly
+ FaaSTriggerTimer = FaaSTriggerKey.String("timer")
+ // If none of the others apply
+ FaaSTriggerOther = FaaSTriggerKey.String("other")
+)
+
+// FaaSColdstart returns an attribute KeyValue conforming to the
+// "faas.coldstart" semantic conventions. It represents a boolean that is true
+// if the serverless function is executed for the first time (aka cold-start).
+func FaaSColdstart(val bool) attribute.KeyValue {
+ return FaaSColdstartKey.Bool(val)
+}
+
+// FaaSCron returns an attribute KeyValue conforming to the "faas.cron"
+// semantic conventions. It represents a string containing the schedule period
+// as [Cron
+// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+func FaaSCron(val string) attribute.KeyValue {
+ return FaaSCronKey.String(val)
+}
+
+// FaaSDocumentCollection returns an attribute KeyValue conforming to the
+// "faas.document.collection" semantic conventions. It represents the name of
+// the source on which the triggering operation was performed. For example, in
+// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
+// database name.
+func FaaSDocumentCollection(val string) attribute.KeyValue {
+ return FaaSDocumentCollectionKey.String(val)
+}
+
+// FaaSDocumentName returns an attribute KeyValue conforming to the
+// "faas.document.name" semantic conventions. It represents the document
+// name/table subjected to the operation. For example, in Cloud Storage or S3
+// is the name of the file, and in Cosmos DB the table name.
+func FaaSDocumentName(val string) attribute.KeyValue {
+ return FaaSDocumentNameKey.String(val)
+}
+
+// FaaSDocumentTime returns an attribute KeyValue conforming to the
+// "faas.document.time" semantic conventions. It represents a string containing
+// the time when the data was accessed in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSDocumentTime(val string) attribute.KeyValue {
+ return FaaSDocumentTimeKey.String(val)
+}
+
+// FaaSInstance returns an attribute KeyValue conforming to the
+// "faas.instance" semantic conventions. It represents the execution
+// environment ID as a string, that will be potentially reused for other
+// invocations to the same function/function version.
+func FaaSInstance(val string) attribute.KeyValue {
+ return FaaSInstanceKey.String(val)
+}
+
+// FaaSInvocationID returns an attribute KeyValue conforming to the
+// "faas.invocation_id" semantic conventions. It represents the invocation ID
+// of the current function invocation.
+func FaaSInvocationID(val string) attribute.KeyValue {
+ return FaaSInvocationIDKey.String(val)
+}
+
+// FaaSInvokedName returns an attribute KeyValue conforming to the
+// "faas.invoked_name" semantic conventions. It represents the name of the
+// invoked function.
+func FaaSInvokedName(val string) attribute.KeyValue {
+ return FaaSInvokedNameKey.String(val)
+}
+
+// FaaSInvokedRegion returns an attribute KeyValue conforming to the
+// "faas.invoked_region" semantic conventions. It represents the cloud region
+// of the invoked function.
+func FaaSInvokedRegion(val string) attribute.KeyValue {
+ return FaaSInvokedRegionKey.String(val)
+}
+
+// FaaSMaxMemory returns an attribute KeyValue conforming to the
+// "faas.max_memory" semantic conventions. It represents the amount of memory
+// available to the serverless function converted to Bytes.
+func FaaSMaxMemory(val int) attribute.KeyValue {
+ return FaaSMaxMemoryKey.Int(val)
+}
+
+// FaaSName returns an attribute KeyValue conforming to the "faas.name"
+// semantic conventions. It represents the name of the single function that
+// this runtime instance executes.
+func FaaSName(val string) attribute.KeyValue {
+ return FaaSNameKey.String(val)
+}
+
+// FaaSTime returns an attribute KeyValue conforming to the "faas.time"
+// semantic conventions. It represents a string containing the function
+// invocation time in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSTime(val string) attribute.KeyValue {
+ return FaaSTimeKey.String(val)
+}
+
+// FaaSVersion returns an attribute KeyValue conforming to the
+// "faas.version" semantic conventions. It represents the immutable version of
+// the function being executed.
+func FaaSVersion(val string) attribute.KeyValue {
+ return FaaSVersionKey.String(val)
+}
+
+// Attributes for Feature Flags.
+const (
+ // FeatureFlagKeyKey is the attribute Key conforming to the
+ // "feature_flag.key" semantic conventions. It represents the unique
+ // identifier of the feature flag.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logo-color'
+ FeatureFlagKeyKey = attribute.Key("feature_flag.key")
+
+ // FeatureFlagProviderNameKey is the attribute Key conforming to the
+ // "feature_flag.provider_name" semantic conventions. It represents the
+ // name of the service provider that performs the flag evaluation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Flag Manager'
+ FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name")
+
+ // FeatureFlagVariantKey is the attribute Key conforming to the
+ // "feature_flag.variant" semantic conventions. It represents the sHOULD be
+ // a semantic identifier for a value. If one is unavailable, a stringified
+ // version of the value can be used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'red', 'true', 'on'
+ // Note: A semantic identifier, commonly referred to as a variant, provides
+ // a means
+ // for referring to a value without including the value itself. This can
+ // provide additional context for understanding the meaning behind a value.
+ // For example, the variant `red` maybe be used for the value `#c05543`.
+ //
+ // A stringified version of the value can be used in situations where a
+ // semantic identifier is unavailable. String representation of the value
+ // should be determined by the implementer.
+ FeatureFlagVariantKey = attribute.Key("feature_flag.variant")
+)
+
+// FeatureFlagKey returns an attribute KeyValue conforming to the
+// "feature_flag.key" semantic conventions. It represents the unique identifier
+// of the feature flag.
+func FeatureFlagKey(val string) attribute.KeyValue {
+ return FeatureFlagKeyKey.String(val)
+}
+
+// FeatureFlagProviderName returns an attribute KeyValue conforming to the
+// "feature_flag.provider_name" semantic conventions. It represents the name of
+// the service provider that performs the flag evaluation.
+func FeatureFlagProviderName(val string) attribute.KeyValue {
+ return FeatureFlagProviderNameKey.String(val)
+}
+
+// FeatureFlagVariant returns an attribute KeyValue conforming to the
+// "feature_flag.variant" semantic conventions. It represents the sHOULD be a
+// semantic identifier for a value. If one is unavailable, a stringified
+// version of the value can be used.
+func FeatureFlagVariant(val string) attribute.KeyValue {
+ return FeatureFlagVariantKey.String(val)
+}
+
+// Describes file attributes.
+const (
+ // FileDirectoryKey is the attribute Key conforming to the "file.directory"
+ // semantic conventions. It represents the directory where the file is
+ // located. It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/home/user', 'C:\\Program Files\\MyApp'
+ FileDirectoryKey = attribute.Key("file.directory")
+
+ // FileExtensionKey is the attribute Key conforming to the "file.extension"
+ // semantic conventions. It represents the file extension, excluding the
+ // leading dot.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'png', 'gz'
+ // Note: When the file name has multiple extensions (example.tar.gz), only
+ // the last one should be captured ("gz", not "tar.gz").
+ FileExtensionKey = attribute.Key("file.extension")
+
+ // FileNameKey is the attribute Key conforming to the "file.name" semantic
+ // conventions. It represents the name of the file including the extension,
+ // without the directory.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'example.png'
+ FileNameKey = attribute.Key("file.name")
+
+ // FilePathKey is the attribute Key conforming to the "file.path" semantic
+ // conventions. It represents the full path to the file, including the file
+ // name. It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/home/alice/example.png', 'C:\\Program
+ // Files\\MyApp\\myapp.exe'
+ FilePathKey = attribute.Key("file.path")
+
+ // FileSizeKey is the attribute Key conforming to the "file.size" semantic
+ // conventions. It represents the file size in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FileSizeKey = attribute.Key("file.size")
+)
+
+// FileDirectory returns an attribute KeyValue conforming to the
+// "file.directory" semantic conventions. It represents the directory where the
+// file is located. It should include the drive letter, when appropriate.
+func FileDirectory(val string) attribute.KeyValue {
+ return FileDirectoryKey.String(val)
+}
+
+// FileExtension returns an attribute KeyValue conforming to the
+// "file.extension" semantic conventions. It represents the file extension,
+// excluding the leading dot.
+func FileExtension(val string) attribute.KeyValue {
+ return FileExtensionKey.String(val)
+}
+
+// FileName returns an attribute KeyValue conforming to the "file.name"
+// semantic conventions. It represents the name of the file including the
+// extension, without the directory.
+func FileName(val string) attribute.KeyValue {
+ return FileNameKey.String(val)
+}
+
+// FilePath returns an attribute KeyValue conforming to the "file.path"
+// semantic conventions. It represents the full path to the file, including the
+// file name. It should include the drive letter, when appropriate.
+func FilePath(val string) attribute.KeyValue {
+ return FilePathKey.String(val)
+}
+
+// FileSize returns an attribute KeyValue conforming to the "file.size"
+// semantic conventions. It represents the file size in bytes.
+func FileSize(val int) attribute.KeyValue {
+ return FileSizeKey.Int(val)
+}
+
+// Attributes for Google Cloud Run.
+const (
+ // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.execution" semantic conventions. It represents the
+ // name of the Cloud Run
+ // [execution](https://cloud.google.com/run/docs/managing/job-executions)
+ // being run for the Job, as set by the
+ // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'job-name-xxxx', 'sample-job-mdw84'
+ GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
+
+ // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.task_index" semantic conventions. It represents the
+ // index for a task within an execution as provided by the
+ // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1
+ GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
+)
+
+// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
+// of the Cloud Run
+// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
+// run for the Job, as set by the
+// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobExecution(val string) attribute.KeyValue {
+ return GCPCloudRunJobExecutionKey.String(val)
+}
+
+// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
+// for a task within an execution as provided by the
+// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
+ return GCPCloudRunJobTaskIndexKey.Int(val)
+}
+
+// Attributes for Google Compute Engine (GCE).
+const (
+ // GCPGceInstanceHostnameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.hostname" semantic conventions. It represents the
+ // hostname of a GCE instance. This is the full value of the default or
+ // [custom
+ // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-host1234.example.com',
+ // 'sample-vm.us-west1-b.c.my-project.internal'
+ GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
+
+ // GCPGceInstanceNameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.name" semantic conventions. It represents the instance
+ // name of a GCE instance. This is the value provided by `host.name`, the
+ // visible name of the instance in the Cloud Console UI, and the prefix for
+ // the default hostname of the instance as defined by the [default internal
+ // DNS
+ // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-1', 'my-vm-name'
+ GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
+)
+
+// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
+// of a GCE instance. This is the full value of the default or [custom
+// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+func GCPGceInstanceHostname(val string) attribute.KeyValue {
+ return GCPGceInstanceHostnameKey.String(val)
+}
+
+// GCPGceInstanceName returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.name" semantic conventions. It represents the instance
+// name of a GCE instance. This is the value provided by `host.name`, the
+// visible name of the instance in the Cloud Console UI, and the prefix for the
+// default hostname of the instance as defined by the [default internal DNS
+// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+func GCPGceInstanceName(val string) attribute.KeyValue {
+ return GCPGceInstanceNameKey.String(val)
+}
+
+// The attributes used to describe telemetry in the context of LLM (Large
+// Language Models) requests and responses.
+const (
+ // GenAiCompletionKey is the attribute Key conforming to the
+ // "gen_ai.completion" semantic conventions. It represents the full
+ // response received from the LLM.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: "[{'role': 'assistant', 'content': 'The capital of France is
+ // Paris.'}]"
+ // Note: It's RECOMMENDED to format completions as JSON string matching
+ // [OpenAI messages
+ // format](https://platform.openai.com/docs/guides/text-generation)
+ GenAiCompletionKey = attribute.Key("gen_ai.completion")
+
+ // GenAiPromptKey is the attribute Key conforming to the "gen_ai.prompt"
+ // semantic conventions. It represents the full prompt sent to an LLM.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: "[{'role': 'user', 'content': 'What is the capital of
+ // France?'}]"
+ // Note: It's RECOMMENDED to format prompts as JSON string matching [OpenAI
+ // messages
+ // format](https://platform.openai.com/docs/guides/text-generation)
+ GenAiPromptKey = attribute.Key("gen_ai.prompt")
+
+ // GenAiRequestMaxTokensKey is the attribute Key conforming to the
+ // "gen_ai.request.max_tokens" semantic conventions. It represents the
+ // maximum number of tokens the LLM generates for a request.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ GenAiRequestMaxTokensKey = attribute.Key("gen_ai.request.max_tokens")
+
+ // GenAiRequestModelKey is the attribute Key conforming to the
+ // "gen_ai.request.model" semantic conventions. It represents the name of
+ // the LLM a request is being made to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gpt-4'
+ GenAiRequestModelKey = attribute.Key("gen_ai.request.model")
+
+ // GenAiRequestTemperatureKey is the attribute Key conforming to the
+ // "gen_ai.request.temperature" semantic conventions. It represents the
+ // temperature setting for the LLM request.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0.0
+ GenAiRequestTemperatureKey = attribute.Key("gen_ai.request.temperature")
+
+ // GenAiRequestTopPKey is the attribute Key conforming to the
+ // "gen_ai.request.top_p" semantic conventions. It represents the top_p
+ // sampling setting for the LLM request.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0
+ GenAiRequestTopPKey = attribute.Key("gen_ai.request.top_p")
+
+ // GenAiResponseFinishReasonsKey is the attribute Key conforming to the
+ // "gen_ai.response.finish_reasons" semantic conventions. It represents the
+ // array of reasons the model stopped generating tokens, corresponding to
+ // each generation received.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'stop'
+ GenAiResponseFinishReasonsKey = attribute.Key("gen_ai.response.finish_reasons")
+
+ // GenAiResponseIDKey is the attribute Key conforming to the
+ // "gen_ai.response.id" semantic conventions. It represents the unique
+ // identifier for the completion.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'chatcmpl-123'
+ GenAiResponseIDKey = attribute.Key("gen_ai.response.id")
+
+ // GenAiResponseModelKey is the attribute Key conforming to the
+ // "gen_ai.response.model" semantic conventions. It represents the name of
+ // the LLM a response was generated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gpt-4-0613'
+ GenAiResponseModelKey = attribute.Key("gen_ai.response.model")
+
+ // GenAiSystemKey is the attribute Key conforming to the "gen_ai.system"
+ // semantic conventions. It represents the Generative AI product as
+ // identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'openai'
+ // Note: The actual GenAI product may differ from the one identified by the
+ // client. For example, when using OpenAI client libraries to communicate
+ // with Mistral, the `gen_ai.system` is set to `openai` based on the
+ // instrumentation's best knowledge.
+ GenAiSystemKey = attribute.Key("gen_ai.system")
+
+ // GenAiUsageCompletionTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.completion_tokens" semantic conventions. It represents the
+ // number of tokens used in the LLM response (completion).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 180
+ GenAiUsageCompletionTokensKey = attribute.Key("gen_ai.usage.completion_tokens")
+
+ // GenAiUsagePromptTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.prompt_tokens" semantic conventions. It represents the
+ // number of tokens used in the LLM prompt.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ GenAiUsagePromptTokensKey = attribute.Key("gen_ai.usage.prompt_tokens")
+)
+
+var (
+ // OpenAI
+ GenAiSystemOpenai = GenAiSystemKey.String("openai")
+)
+
+// GenAiCompletion returns an attribute KeyValue conforming to the
+// "gen_ai.completion" semantic conventions. It represents the full response
+// received from the LLM.
+func GenAiCompletion(val string) attribute.KeyValue {
+ return GenAiCompletionKey.String(val)
+}
+
+// GenAiPrompt returns an attribute KeyValue conforming to the
+// "gen_ai.prompt" semantic conventions. It represents the full prompt sent to
+// an LLM.
+func GenAiPrompt(val string) attribute.KeyValue {
+ return GenAiPromptKey.String(val)
+}
+
+// GenAiRequestMaxTokens returns an attribute KeyValue conforming to the
+// "gen_ai.request.max_tokens" semantic conventions. It represents the maximum
+// number of tokens the LLM generates for a request.
+func GenAiRequestMaxTokens(val int) attribute.KeyValue {
+ return GenAiRequestMaxTokensKey.Int(val)
+}
+
+// GenAiRequestModel returns an attribute KeyValue conforming to the
+// "gen_ai.request.model" semantic conventions. It represents the name of the
+// LLM a request is being made to.
+func GenAiRequestModel(val string) attribute.KeyValue {
+ return GenAiRequestModelKey.String(val)
+}
+
+// GenAiRequestTemperature returns an attribute KeyValue conforming to the
+// "gen_ai.request.temperature" semantic conventions. It represents the
+// temperature setting for the LLM request.
+func GenAiRequestTemperature(val float64) attribute.KeyValue {
+ return GenAiRequestTemperatureKey.Float64(val)
+}
+
+// GenAiRequestTopP returns an attribute KeyValue conforming to the
+// "gen_ai.request.top_p" semantic conventions. It represents the top_p
+// sampling setting for the LLM request.
+func GenAiRequestTopP(val float64) attribute.KeyValue {
+ return GenAiRequestTopPKey.Float64(val)
+}
+
+// GenAiResponseFinishReasons returns an attribute KeyValue conforming to
+// the "gen_ai.response.finish_reasons" semantic conventions. It represents the
+// array of reasons the model stopped generating tokens, corresponding to each
+// generation received.
+func GenAiResponseFinishReasons(val ...string) attribute.KeyValue {
+ return GenAiResponseFinishReasonsKey.StringSlice(val)
+}
+
+// GenAiResponseID returns an attribute KeyValue conforming to the
+// "gen_ai.response.id" semantic conventions. It represents the unique
+// identifier for the completion.
+func GenAiResponseID(val string) attribute.KeyValue {
+ return GenAiResponseIDKey.String(val)
+}
+
+// GenAiResponseModel returns an attribute KeyValue conforming to the
+// "gen_ai.response.model" semantic conventions. It represents the name of the
+// LLM a response was generated from.
+func GenAiResponseModel(val string) attribute.KeyValue {
+ return GenAiResponseModelKey.String(val)
+}
+
+// GenAiUsageCompletionTokens returns an attribute KeyValue conforming to
+// the "gen_ai.usage.completion_tokens" semantic conventions. It represents the
+// number of tokens used in the LLM response (completion).
+func GenAiUsageCompletionTokens(val int) attribute.KeyValue {
+ return GenAiUsageCompletionTokensKey.Int(val)
+}
+
+// GenAiUsagePromptTokens returns an attribute KeyValue conforming to the
+// "gen_ai.usage.prompt_tokens" semantic conventions. It represents the number
+// of tokens used in the LLM prompt.
+func GenAiUsagePromptTokens(val int) attribute.KeyValue {
+ return GenAiUsagePromptTokensKey.Int(val)
+}
+
+// Attributes for GraphQL.
+const (
+ // GraphqlDocumentKey is the attribute Key conforming to the
+ // "graphql.document" semantic conventions. It represents the GraphQL
+ // document being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
+ // Note: The value may be sanitized to exclude sensitive information.
+ GraphqlDocumentKey = attribute.Key("graphql.document")
+
+ // GraphqlOperationNameKey is the attribute Key conforming to the
+ // "graphql.operation.name" semantic conventions. It represents the name of
+ // the operation being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findBookByID'
+ GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
+
+ // GraphqlOperationTypeKey is the attribute Key conforming to the
+ // "graphql.operation.type" semantic conventions. It represents the type of
+ // the operation being executed.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query', 'mutation', 'subscription'
+ GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
+)
+
+var (
+ // GraphQL query
+ GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
+ // GraphQL mutation
+ GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
+ // GraphQL subscription
+ GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
+)
+
+// GraphqlDocument returns an attribute KeyValue conforming to the
+// "graphql.document" semantic conventions. It represents the GraphQL document
+// being executed.
+func GraphqlDocument(val string) attribute.KeyValue {
+ return GraphqlDocumentKey.String(val)
+}
+
+// GraphqlOperationName returns an attribute KeyValue conforming to the
+// "graphql.operation.name" semantic conventions. It represents the name of the
+// operation being executed.
+func GraphqlOperationName(val string) attribute.KeyValue {
+ return GraphqlOperationNameKey.String(val)
+}
+
+// Attributes for the Android platform on which the Android application is
+// running.
+const (
+ // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
+ // semantic conventions. It represents the unique identifier for the
+ // application
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da'
+ HerokuAppIDKey = attribute.Key("heroku.app.id")
+
+ // HerokuReleaseCommitKey is the attribute Key conforming to the
+ // "heroku.release.commit" semantic conventions. It represents the commit
+ // hash for the current release
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec'
+ HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
+
+ // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
+ // "heroku.release.creation_timestamp" semantic conventions. It represents
+ // the time and date the release was created
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2022-10-23T18:00:42Z'
+ HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
+)
+
+// HerokuAppID returns an attribute KeyValue conforming to the
+// "heroku.app.id" semantic conventions. It represents the unique identifier
+// for the application
+func HerokuAppID(val string) attribute.KeyValue {
+ return HerokuAppIDKey.String(val)
+}
+
+// HerokuReleaseCommit returns an attribute KeyValue conforming to the
+// "heroku.release.commit" semantic conventions. It represents the commit hash
+// for the current release
+func HerokuReleaseCommit(val string) attribute.KeyValue {
+ return HerokuReleaseCommitKey.String(val)
+}
+
+// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming
+// to the "heroku.release.creation_timestamp" semantic conventions. It
+// represents the time and date the release was created
+func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
+ return HerokuReleaseCreationTimestampKey.String(val)
+}
+
+// A host is defined as a computing instance. For example, physical servers,
+// virtual machines, switches or disk array.
+const (
+ // HostArchKey is the attribute Key conforming to the "host.arch" semantic
+ // conventions. It represents the CPU architecture the host system is
+ // running on.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ HostArchKey = attribute.Key("host.arch")
+
+ // HostCPUCacheL2SizeKey is the attribute Key conforming to the
+ // "host.cpu.cache.l2.size" semantic conventions. It represents the amount
+ // of level 2 memory cache available to the processor (in Bytes).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12288000
+ HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size")
+
+ // HostCPUFamilyKey is the attribute Key conforming to the
+ // "host.cpu.family" semantic conventions. It represents the family or
+ // generation of the CPU.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', 'PA-RISC 1.1e'
+ HostCPUFamilyKey = attribute.Key("host.cpu.family")
+
+ // HostCPUModelIDKey is the attribute Key conforming to the
+ // "host.cpu.model.id" semantic conventions. It represents the model
+ // identifier. It provides more granular information about the CPU,
+ // distinguishing it from other CPUs within the same family.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', '9000/778/B180L'
+ HostCPUModelIDKey = attribute.Key("host.cpu.model.id")
+
+ // HostCPUModelNameKey is the attribute Key conforming to the
+ // "host.cpu.model.name" semantic conventions. It represents the model
+ // designation of the processor.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz'
+ HostCPUModelNameKey = attribute.Key("host.cpu.model.name")
+
+ // HostCPUSteppingKey is the attribute Key conforming to the
+ // "host.cpu.stepping" semantic conventions. It represents the stepping or
+ // core revisions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1', 'r1p1'
+ HostCPUSteppingKey = attribute.Key("host.cpu.stepping")
+
+ // HostCPUVendorIDKey is the attribute Key conforming to the
+ // "host.cpu.vendor.id" semantic conventions. It represents the processor
+ // manufacturer identifier. A maximum 12-character string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'GenuineIntel'
+ // Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor
+ // ID string in EBX, EDX and ECX registers. Writing these to memory in this
+ // order results in a 12-character string.
+ HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id")
+
+ // HostIDKey is the attribute Key conforming to the "host.id" semantic
+ // conventions. It represents the unique host ID. For Cloud, this must be
+ // the instance_id assigned by the cloud provider. For non-containerized
+ // systems, this should be the `machine-id`. See the table below for the
+ // sources to use to determine the `machine-id` based on operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'fdbf79e8af94cb7f9e8df36789187052'
+ HostIDKey = attribute.Key("host.id")
+
+ // HostImageIDKey is the attribute Key conforming to the "host.image.id"
+ // semantic conventions. It represents the vM image ID or host OS image ID.
+ // For Cloud, this value is from the provider.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ami-07b06b442921831e5'
+ HostImageIDKey = attribute.Key("host.image.id")
+
+ // HostImageNameKey is the attribute Key conforming to the
+ // "host.image.name" semantic conventions. It represents the name of the VM
+ // image or OS install the host was instantiated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905'
+ HostImageNameKey = attribute.Key("host.image.name")
+
+ // HostImageVersionKey is the attribute Key conforming to the
+ // "host.image.version" semantic conventions. It represents the version
+ // string of the VM image or host OS as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0.1'
+ HostImageVersionKey = attribute.Key("host.image.version")
+
+ // HostIPKey is the attribute Key conforming to the "host.ip" semantic
+ // conventions. It represents the available IP addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '192.168.1.140', 'fe80::abc2:4a28:737a:609e'
+ // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6
+ // addresses MUST be specified in the [RFC
+ // 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.
+ HostIPKey = attribute.Key("host.ip")
+
+ // HostMacKey is the attribute Key conforming to the "host.mac" semantic
+ // conventions. It represents the available MAC addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F'
+ // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal
+ // form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
+ // as hyphen-separated octets in uppercase hexadecimal form from most to
+ // least significant.
+ HostMacKey = attribute.Key("host.mac")
+
+ // HostNameKey is the attribute Key conforming to the "host.name" semantic
+ // conventions. It represents the name of the host. On Unix systems, it may
+ // contain what the hostname command returns, or the fully qualified
+ // hostname, or another name specified by the user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-test'
+ HostNameKey = attribute.Key("host.name")
+
+ // HostTypeKey is the attribute Key conforming to the "host.type" semantic
+ // conventions. It represents the type of host. For Cloud, this must be the
+ // machine type.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'n1-standard-1'
+ HostTypeKey = attribute.Key("host.type")
+)
+
+var (
+ // AMD64
+ HostArchAMD64 = HostArchKey.String("amd64")
+ // ARM32
+ HostArchARM32 = HostArchKey.String("arm32")
+ // ARM64
+ HostArchARM64 = HostArchKey.String("arm64")
+ // Itanium
+ HostArchIA64 = HostArchKey.String("ia64")
+ // 32-bit PowerPC
+ HostArchPPC32 = HostArchKey.String("ppc32")
+ // 64-bit PowerPC
+ HostArchPPC64 = HostArchKey.String("ppc64")
+ // IBM z/Architecture
+ HostArchS390x = HostArchKey.String("s390x")
+ // 32-bit x86
+ HostArchX86 = HostArchKey.String("x86")
+)
+
+// HostCPUCacheL2Size returns an attribute KeyValue conforming to the
+// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of
+// level 2 memory cache available to the processor (in Bytes).
+func HostCPUCacheL2Size(val int) attribute.KeyValue {
+ return HostCPUCacheL2SizeKey.Int(val)
+}
+
+// HostCPUFamily returns an attribute KeyValue conforming to the
+// "host.cpu.family" semantic conventions. It represents the family or
+// generation of the CPU.
+func HostCPUFamily(val string) attribute.KeyValue {
+ return HostCPUFamilyKey.String(val)
+}
+
+// HostCPUModelID returns an attribute KeyValue conforming to the
+// "host.cpu.model.id" semantic conventions. It represents the model
+// identifier. It provides more granular information about the CPU,
+// distinguishing it from other CPUs within the same family.
+func HostCPUModelID(val string) attribute.KeyValue {
+ return HostCPUModelIDKey.String(val)
+}
+
+// HostCPUModelName returns an attribute KeyValue conforming to the
+// "host.cpu.model.name" semantic conventions. It represents the model
+// designation of the processor.
+func HostCPUModelName(val string) attribute.KeyValue {
+ return HostCPUModelNameKey.String(val)
+}
+
+// HostCPUStepping returns an attribute KeyValue conforming to the
+// "host.cpu.stepping" semantic conventions. It represents the stepping or core
+// revisions.
+func HostCPUStepping(val string) attribute.KeyValue {
+ return HostCPUSteppingKey.String(val)
+}
+
+// HostCPUVendorID returns an attribute KeyValue conforming to the
+// "host.cpu.vendor.id" semantic conventions. It represents the processor
+// manufacturer identifier. A maximum 12-character string.
+func HostCPUVendorID(val string) attribute.KeyValue {
+ return HostCPUVendorIDKey.String(val)
+}
+
+// HostID returns an attribute KeyValue conforming to the "host.id" semantic
+// conventions. It represents the unique host ID. For Cloud, this must be the
+// instance_id assigned by the cloud provider. For non-containerized systems,
+// this should be the `machine-id`. See the table below for the sources to use
+// to determine the `machine-id` based on operating system.
+func HostID(val string) attribute.KeyValue {
+ return HostIDKey.String(val)
+}
+
+// HostImageID returns an attribute KeyValue conforming to the
+// "host.image.id" semantic conventions. It represents the vM image ID or host
+// OS image ID. For Cloud, this value is from the provider.
+func HostImageID(val string) attribute.KeyValue {
+ return HostImageIDKey.String(val)
+}
+
+// HostImageName returns an attribute KeyValue conforming to the
+// "host.image.name" semantic conventions. It represents the name of the VM
+// image or OS install the host was instantiated from.
+func HostImageName(val string) attribute.KeyValue {
+ return HostImageNameKey.String(val)
+}
+
+// HostImageVersion returns an attribute KeyValue conforming to the
+// "host.image.version" semantic conventions. It represents the version string
+// of the VM image or host OS as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func HostImageVersion(val string) attribute.KeyValue {
+ return HostImageVersionKey.String(val)
+}
+
+// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic
+// conventions. It represents the available IP addresses of the host, excluding
+// loopback interfaces.
+func HostIP(val ...string) attribute.KeyValue {
+ return HostIPKey.StringSlice(val)
+}
+
+// HostMac returns an attribute KeyValue conforming to the "host.mac"
+// semantic conventions. It represents the available MAC addresses of the host,
+// excluding loopback interfaces.
+func HostMac(val ...string) attribute.KeyValue {
+ return HostMacKey.StringSlice(val)
+}
+
+// HostName returns an attribute KeyValue conforming to the "host.name"
+// semantic conventions. It represents the name of the host. On Unix systems,
+// it may contain what the hostname command returns, or the fully qualified
+// hostname, or another name specified by the user.
+func HostName(val string) attribute.KeyValue {
+ return HostNameKey.String(val)
+}
+
+// HostType returns an attribute KeyValue conforming to the "host.type"
+// semantic conventions. It represents the type of host. For Cloud, this must
+// be the machine type.
+func HostType(val string) attribute.KeyValue {
+ return HostTypeKey.String(val)
+}
+
+// Semantic convention attributes in the HTTP namespace.
+const (
+ // HTTPConnectionStateKey is the attribute Key conforming to the
+ // "http.connection.state" semantic conventions. It represents the state of
+ // the HTTP connection in the HTTP connection pool.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'active', 'idle'
+ HTTPConnectionStateKey = attribute.Key("http.connection.state")
+
+ // HTTPRequestBodySizeKey is the attribute Key conforming to the
+ // "http.request.body.size" semantic conventions. It represents the size of
+ // the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
+
+ // HTTPRequestMethodKey is the attribute Key conforming to the
+ // "http.request.method" semantic conventions. It represents the hTTP
+ // request method.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ // Note: HTTP request method value SHOULD be "known" to the
+ // instrumentation.
+ // By default, this convention defines "known" methods as the ones listed
+ // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
+ // and the PATCH method defined in
+ // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
+ //
+ // If the HTTP request method is not known to instrumentation, it MUST set
+ // the `http.request.method` attribute to `_OTHER`.
+ //
+ // If the HTTP instrumentation could end up converting valid HTTP request
+ // methods to `_OTHER`, then it MUST provide a way to override
+ // the list of known HTTP methods. If this override is done via environment
+ // variable, then the environment variable MUST be named
+ // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
+ // list of case-sensitive known HTTP methods
+ // (this list MUST be a full override of the default known method, it is
+ // not a list of known methods in addition to the defaults).
+ //
+ // HTTP method names are case-sensitive and `http.request.method` attribute
+ // value MUST match a known HTTP method name exactly.
+ // Instrumentations for specific web frameworks that consider HTTP methods
+ // to be case insensitive, SHOULD populate a canonical equivalent.
+ // Tracing instrumentations that do so, MUST also set
+ // `http.request.method_original` to the original value.
+ HTTPRequestMethodKey = attribute.Key("http.request.method")
+
+ // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
+ // "http.request.method_original" semantic conventions. It represents the
+ // original HTTP method sent by the client in the request line.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GeT', 'ACL', 'foo'
+ HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
+
+ // HTTPRequestResendCountKey is the attribute Key conforming to the
+ // "http.request.resend_count" semantic conventions. It represents the
+ // ordinal number of request resending attempt (for any reason, including
+ // redirects).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3
+ // Note: The resend count SHOULD be updated each time an HTTP request gets
+ // resent by the client, regardless of what was the cause of the resending
+ // (e.g. redirection, authorization failure, 503 Server Unavailable,
+ // network issues, or any other).
+ HTTPRequestResendCountKey = attribute.Key("http.request.resend_count")
+
+ // HTTPRequestSizeKey is the attribute Key conforming to the
+ // "http.request.size" semantic conventions. It represents the total size
+ // of the request in bytes. This should be the total number of bytes sent
+ // over the wire, including the request line (HTTP/1.1), framing (HTTP/2
+ // and HTTP/3), headers, and request body if any.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1437
+ HTTPRequestSizeKey = attribute.Key("http.request.size")
+
+ // HTTPResponseBodySizeKey is the attribute Key conforming to the
+ // "http.response.body.size" semantic conventions. It represents the size
+ // of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
+
+ // HTTPResponseSizeKey is the attribute Key conforming to the
+ // "http.response.size" semantic conventions. It represents the total size
+ // of the response in bytes. This should be the total number of bytes sent
+ // over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and
+ // HTTP/3), headers, and response body and trailers if any.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1437
+ HTTPResponseSizeKey = attribute.Key("http.response.size")
+
+ // HTTPResponseStatusCodeKey is the attribute Key conforming to the
+ // "http.response.status_code" semantic conventions. It represents the
+ // [HTTP response status
+ // code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 200
+ HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route, that is, the path
+ // template in the format used by the respective server framework.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+var (
+ // active state
+ HTTPConnectionStateActive = HTTPConnectionStateKey.String("active")
+ // idle state
+ HTTPConnectionStateIdle = HTTPConnectionStateKey.String("idle")
+)
+
+var (
+ // CONNECT method
+ HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
+ // DELETE method
+ HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
+ // GET method
+ HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
+ // HEAD method
+ HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
+ // OPTIONS method
+ HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
+ // PATCH method
+ HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
+ // POST method
+ HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
+ // PUT method
+ HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
+ // TRACE method
+ HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
+ // Any HTTP method that the instrumentation has no prior knowledge of
+ HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
+)
+
+// HTTPRequestBodySize returns an attribute KeyValue conforming to the
+// "http.request.body.size" semantic conventions. It represents the size of the
+// request payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestBodySize(val int) attribute.KeyValue {
+ return HTTPRequestBodySizeKey.Int(val)
+}
+
+// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
+// "http.request.method_original" semantic conventions. It represents the
+// original HTTP method sent by the client in the request line.
+func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
+ return HTTPRequestMethodOriginalKey.String(val)
+}
+
+// HTTPRequestResendCount returns an attribute KeyValue conforming to the
+// "http.request.resend_count" semantic conventions. It represents the ordinal
+// number of request resending attempt (for any reason, including redirects).
+func HTTPRequestResendCount(val int) attribute.KeyValue {
+ return HTTPRequestResendCountKey.Int(val)
+}
+
+// HTTPRequestSize returns an attribute KeyValue conforming to the
+// "http.request.size" semantic conventions. It represents the total size of
+// the request in bytes. This should be the total number of bytes sent over the
+// wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+// headers, and request body if any.
+func HTTPRequestSize(val int) attribute.KeyValue {
+ return HTTPRequestSizeKey.Int(val)
+}
+
+// HTTPResponseBodySize returns an attribute KeyValue conforming to the
+// "http.response.body.size" semantic conventions. It represents the size of
+// the response payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseBodySize(val int) attribute.KeyValue {
+ return HTTPResponseBodySizeKey.Int(val)
+}
+
+// HTTPResponseSize returns an attribute KeyValue conforming to the
+// "http.response.size" semantic conventions. It represents the total size of
+// the response in bytes. This should be the total number of bytes sent over
+// the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+// headers, and response body and trailers if any.
+func HTTPResponseSize(val int) attribute.KeyValue {
+ return HTTPResponseSizeKey.Int(val)
+}
+
+// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
+// "http.response.status_code" semantic conventions. It represents the [HTTP
+// response status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPResponseStatusCode(val int) attribute.KeyValue {
+ return HTTPResponseStatusCodeKey.Int(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route, that is, the path
+// template in the format used by the respective server framework.
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Java Virtual machine related attributes.
+const (
+ // JvmBufferPoolNameKey is the attribute Key conforming to the
+ // "jvm.buffer.pool.name" semantic conventions. It represents the name of
+ // the buffer pool.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mapped', 'direct'
+ // Note: Pool names are generally obtained via
+ // [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
+ JvmBufferPoolNameKey = attribute.Key("jvm.buffer.pool.name")
+
+ // JvmGcActionKey is the attribute Key conforming to the "jvm.gc.action"
+ // semantic conventions. It represents the name of the garbage collector
+ // action.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'end of minor GC', 'end of major GC'
+ // Note: Garbage collector action is generally obtained via
+ // [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).
+ JvmGcActionKey = attribute.Key("jvm.gc.action")
+
+ // JvmGcNameKey is the attribute Key conforming to the "jvm.gc.name"
+ // semantic conventions. It represents the name of the garbage collector.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'G1 Young Generation', 'G1 Old Generation'
+ // Note: Garbage collector name is generally obtained via
+ // [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).
+ JvmGcNameKey = attribute.Key("jvm.gc.name")
+
+ // JvmMemoryPoolNameKey is the attribute Key conforming to the
+ // "jvm.memory.pool.name" semantic conventions. It represents the name of
+ // the memory pool.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
+ // Note: Pool names are generally obtained via
+ // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
+ JvmMemoryPoolNameKey = attribute.Key("jvm.memory.pool.name")
+
+ // JvmMemoryTypeKey is the attribute Key conforming to the
+ // "jvm.memory.type" semantic conventions. It represents the type of
+ // memory.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'heap', 'non_heap'
+ JvmMemoryTypeKey = attribute.Key("jvm.memory.type")
+
+ // JvmThreadDaemonKey is the attribute Key conforming to the
+ // "jvm.thread.daemon" semantic conventions. It represents the whether the
+ // thread is daemon or not.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ JvmThreadDaemonKey = attribute.Key("jvm.thread.daemon")
+
+ // JvmThreadStateKey is the attribute Key conforming to the
+ // "jvm.thread.state" semantic conventions. It represents the state of the
+ // thread.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'runnable', 'blocked'
+ JvmThreadStateKey = attribute.Key("jvm.thread.state")
+)
+
+var (
+ // Heap memory
+ JvmMemoryTypeHeap = JvmMemoryTypeKey.String("heap")
+ // Non-heap memory
+ JvmMemoryTypeNonHeap = JvmMemoryTypeKey.String("non_heap")
+)
+
+var (
+ // A thread that has not yet started is in this state
+ JvmThreadStateNew = JvmThreadStateKey.String("new")
+ // A thread executing in the Java virtual machine is in this state
+ JvmThreadStateRunnable = JvmThreadStateKey.String("runnable")
+ // A thread that is blocked waiting for a monitor lock is in this state
+ JvmThreadStateBlocked = JvmThreadStateKey.String("blocked")
+ // A thread that is waiting indefinitely for another thread to perform a particular action is in this state
+ JvmThreadStateWaiting = JvmThreadStateKey.String("waiting")
+ // A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state
+ JvmThreadStateTimedWaiting = JvmThreadStateKey.String("timed_waiting")
+ // A thread that has exited is in this state
+ JvmThreadStateTerminated = JvmThreadStateKey.String("terminated")
+)
+
+// JvmBufferPoolName returns an attribute KeyValue conforming to the
+// "jvm.buffer.pool.name" semantic conventions. It represents the name of the
+// buffer pool.
+func JvmBufferPoolName(val string) attribute.KeyValue {
+ return JvmBufferPoolNameKey.String(val)
+}
+
+// JvmGcAction returns an attribute KeyValue conforming to the
+// "jvm.gc.action" semantic conventions. It represents the name of the garbage
+// collector action.
+func JvmGcAction(val string) attribute.KeyValue {
+ return JvmGcActionKey.String(val)
+}
+
+// JvmGcName returns an attribute KeyValue conforming to the "jvm.gc.name"
+// semantic conventions. It represents the name of the garbage collector.
+func JvmGcName(val string) attribute.KeyValue {
+ return JvmGcNameKey.String(val)
+}
+
+// JvmMemoryPoolName returns an attribute KeyValue conforming to the
+// "jvm.memory.pool.name" semantic conventions. It represents the name of the
+// memory pool.
+func JvmMemoryPoolName(val string) attribute.KeyValue {
+ return JvmMemoryPoolNameKey.String(val)
+}
+
+// JvmThreadDaemon returns an attribute KeyValue conforming to the
+// "jvm.thread.daemon" semantic conventions. It represents the whether the
+// thread is daemon or not.
+func JvmThreadDaemon(val bool) attribute.KeyValue {
+ return JvmThreadDaemonKey.Bool(val)
+}
+
+// Kubernetes resource attributes.
+const (
+ // K8SClusterNameKey is the attribute Key conforming to the
+ // "k8s.cluster.name" semantic conventions. It represents the name of the
+ // cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-cluster'
+ K8SClusterNameKey = attribute.Key("k8s.cluster.name")
+
+ // K8SClusterUIDKey is the attribute Key conforming to the
+ // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for
+ // the cluster, set to the UID of the `kube-system` namespace.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d'
+ // Note: K8S doesn't have support for obtaining a cluster ID. If this is
+ // ever
+ // added, we will recommend collecting the `k8s.cluster.uid` through the
+ // official APIs. In the meantime, we are able to use the `uid` of the
+ // `kube-system` namespace as a proxy for cluster ID. Read on for the
+ // rationale.
+ //
+ // Every object created in a K8S cluster is assigned a distinct UID. The
+ // `kube-system` namespace is used by Kubernetes itself and will exist
+ // for the lifetime of the cluster. Using the `uid` of the `kube-system`
+ // namespace is a reasonable proxy for the K8S ClusterID as it will only
+ // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
+ // UUIDs as standardized by
+ // [ISO/IEC 9834-8 and ITU-T
+ // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
+ // Which states:
+ //
+ // > If generated according to one of the mechanisms defined in Rec.
+ // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
+ // different from all other UUIDs generated before 3603 A.D., or is
+ // extremely likely to be different (depending on the mechanism chosen).
+ //
+ // Therefore, UIDs between clusters should be extremely unlikely to
+ // conflict.
+ K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
+
+ // K8SContainerNameKey is the attribute Key conforming to the
+ // "k8s.container.name" semantic conventions. It represents the name of the
+ // Container from Pod specification, must be unique within a Pod. Container
+ // runtime usually uses different globally unique name (`container.name`).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'redis'
+ K8SContainerNameKey = attribute.Key("k8s.container.name")
+
+ // K8SContainerRestartCountKey is the attribute Key conforming to the
+ // "k8s.container.restart_count" semantic conventions. It represents the
+ // number of times the container was restarted. This attribute can be used
+ // to identify a particular container (running or stopped) within a
+ // container spec.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count")
+
+ // K8SContainerStatusLastTerminatedReasonKey is the attribute Key
+ // conforming to the "k8s.container.status.last_terminated_reason" semantic
+ // conventions. It represents the last terminated reason of the Container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Evicted', 'Error'
+ K8SContainerStatusLastTerminatedReasonKey = attribute.Key("k8s.container.status.last_terminated_reason")
+
+ // K8SCronJobNameKey is the attribute Key conforming to the
+ // "k8s.cronjob.name" semantic conventions. It represents the name of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
+
+ // K8SCronJobUIDKey is the attribute Key conforming to the
+ // "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
+
+ // K8SDaemonSetNameKey is the attribute Key conforming to the
+ // "k8s.daemonset.name" semantic conventions. It represents the name of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
+
+ // K8SDaemonSetUIDKey is the attribute Key conforming to the
+ // "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
+
+ // K8SDeploymentNameKey is the attribute Key conforming to the
+ // "k8s.deployment.name" semantic conventions. It represents the name of
+ // the Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
+
+ // K8SDeploymentUIDKey is the attribute Key conforming to the
+ // "k8s.deployment.uid" semantic conventions. It represents the UID of the
+ // Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
+
+ // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name"
+ // semantic conventions. It represents the name of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SJobNameKey = attribute.Key("k8s.job.name")
+
+ // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid"
+ // semantic conventions. It represents the UID of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SJobUIDKey = attribute.Key("k8s.job.uid")
+
+ // K8SNamespaceNameKey is the attribute Key conforming to the
+ // "k8s.namespace.name" semantic conventions. It represents the name of the
+ // namespace that the pod is running in.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'default'
+ K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
+
+ // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
+ // semantic conventions. It represents the name of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'node-1'
+ K8SNodeNameKey = attribute.Key("k8s.node.name")
+
+ // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid"
+ // semantic conventions. It represents the UID of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2'
+ K8SNodeUIDKey = attribute.Key("k8s.node.uid")
+
+ // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name"
+ // semantic conventions. It represents the name of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-pod-autoconf'
+ K8SPodNameKey = attribute.Key("k8s.pod.name")
+
+ // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid"
+ // semantic conventions. It represents the UID of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SPodUIDKey = attribute.Key("k8s.pod.uid")
+
+ // K8SReplicaSetNameKey is the attribute Key conforming to the
+ // "k8s.replicaset.name" semantic conventions. It represents the name of
+ // the ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
+
+ // K8SReplicaSetUIDKey is the attribute Key conforming to the
+ // "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+ // ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
+
+ // K8SStatefulSetNameKey is the attribute Key conforming to the
+ // "k8s.statefulset.name" semantic conventions. It represents the name of
+ // the StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
+
+ // K8SStatefulSetUIDKey is the attribute Key conforming to the
+ // "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+ // StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
+)
+
+// K8SClusterName returns an attribute KeyValue conforming to the
+// "k8s.cluster.name" semantic conventions. It represents the name of the
+// cluster.
+func K8SClusterName(val string) attribute.KeyValue {
+ return K8SClusterNameKey.String(val)
+}
+
+// K8SClusterUID returns an attribute KeyValue conforming to the
+// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
+// cluster, set to the UID of the `kube-system` namespace.
+func K8SClusterUID(val string) attribute.KeyValue {
+ return K8SClusterUIDKey.String(val)
+}
+
+// K8SContainerName returns an attribute KeyValue conforming to the
+// "k8s.container.name" semantic conventions. It represents the name of the
+// Container from Pod specification, must be unique within a Pod. Container
+// runtime usually uses different globally unique name (`container.name`).
+func K8SContainerName(val string) attribute.KeyValue {
+ return K8SContainerNameKey.String(val)
+}
+
+// K8SContainerRestartCount returns an attribute KeyValue conforming to the
+// "k8s.container.restart_count" semantic conventions. It represents the number
+// of times the container was restarted. This attribute can be used to identify
+// a particular container (running or stopped) within a container spec.
+func K8SContainerRestartCount(val int) attribute.KeyValue {
+ return K8SContainerRestartCountKey.Int(val)
+}
+
+// K8SContainerStatusLastTerminatedReason returns an attribute KeyValue
+// conforming to the "k8s.container.status.last_terminated_reason" semantic
+// conventions. It represents the last terminated reason of the Container.
+func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue {
+ return K8SContainerStatusLastTerminatedReasonKey.String(val)
+}
+
+// K8SCronJobName returns an attribute KeyValue conforming to the
+// "k8s.cronjob.name" semantic conventions. It represents the name of the
+// CronJob.
+func K8SCronJobName(val string) attribute.KeyValue {
+ return K8SCronJobNameKey.String(val)
+}
+
+// K8SCronJobUID returns an attribute KeyValue conforming to the
+// "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+// CronJob.
+func K8SCronJobUID(val string) attribute.KeyValue {
+ return K8SCronJobUIDKey.String(val)
+}
+
+// K8SDaemonSetName returns an attribute KeyValue conforming to the
+// "k8s.daemonset.name" semantic conventions. It represents the name of the
+// DaemonSet.
+func K8SDaemonSetName(val string) attribute.KeyValue {
+ return K8SDaemonSetNameKey.String(val)
+}
+
+// K8SDaemonSetUID returns an attribute KeyValue conforming to the
+// "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+// DaemonSet.
+func K8SDaemonSetUID(val string) attribute.KeyValue {
+ return K8SDaemonSetUIDKey.String(val)
+}
+
+// K8SDeploymentName returns an attribute KeyValue conforming to the
+// "k8s.deployment.name" semantic conventions. It represents the name of the
+// Deployment.
+func K8SDeploymentName(val string) attribute.KeyValue {
+ return K8SDeploymentNameKey.String(val)
+}
+
+// K8SDeploymentUID returns an attribute KeyValue conforming to the
+// "k8s.deployment.uid" semantic conventions. It represents the UID of the
+// Deployment.
+func K8SDeploymentUID(val string) attribute.KeyValue {
+ return K8SDeploymentUIDKey.String(val)
+}
+
+// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name"
+// semantic conventions. It represents the name of the Job.
+func K8SJobName(val string) attribute.KeyValue {
+ return K8SJobNameKey.String(val)
+}
+
+// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid"
+// semantic conventions. It represents the UID of the Job.
+func K8SJobUID(val string) attribute.KeyValue {
+ return K8SJobUIDKey.String(val)
+}
+
+// K8SNamespaceName returns an attribute KeyValue conforming to the
+// "k8s.namespace.name" semantic conventions. It represents the name of the
+// namespace that the pod is running in.
+func K8SNamespaceName(val string) attribute.KeyValue {
+ return K8SNamespaceNameKey.String(val)
+}
+
+// K8SNodeName returns an attribute KeyValue conforming to the
+// "k8s.node.name" semantic conventions. It represents the name of the Node.
+func K8SNodeName(val string) attribute.KeyValue {
+ return K8SNodeNameKey.String(val)
+}
+
+// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid"
+// semantic conventions. It represents the UID of the Node.
+func K8SNodeUID(val string) attribute.KeyValue {
+ return K8SNodeUIDKey.String(val)
+}
+
+// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name"
+// semantic conventions. It represents the name of the Pod.
+func K8SPodName(val string) attribute.KeyValue {
+ return K8SPodNameKey.String(val)
+}
+
+// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid"
+// semantic conventions. It represents the UID of the Pod.
+func K8SPodUID(val string) attribute.KeyValue {
+ return K8SPodUIDKey.String(val)
+}
+
+// K8SReplicaSetName returns an attribute KeyValue conforming to the
+// "k8s.replicaset.name" semantic conventions. It represents the name of the
+// ReplicaSet.
+func K8SReplicaSetName(val string) attribute.KeyValue {
+ return K8SReplicaSetNameKey.String(val)
+}
+
+// K8SReplicaSetUID returns an attribute KeyValue conforming to the
+// "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+// ReplicaSet.
+func K8SReplicaSetUID(val string) attribute.KeyValue {
+ return K8SReplicaSetUIDKey.String(val)
+}
+
+// K8SStatefulSetName returns an attribute KeyValue conforming to the
+// "k8s.statefulset.name" semantic conventions. It represents the name of the
+// StatefulSet.
+func K8SStatefulSetName(val string) attribute.KeyValue {
+ return K8SStatefulSetNameKey.String(val)
+}
+
+// K8SStatefulSetUID returns an attribute KeyValue conforming to the
+// "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+// StatefulSet.
+func K8SStatefulSetUID(val string) attribute.KeyValue {
+ return K8SStatefulSetUIDKey.String(val)
+}
+
+// Log attributes
+const (
+ // LogIostreamKey is the attribute Key conforming to the "log.iostream"
+ // semantic conventions. It represents the stream associated with the log.
+ // See below for a list of well-known values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ LogIostreamKey = attribute.Key("log.iostream")
+)
+
+var (
+ // Logs from stdout stream
+ LogIostreamStdout = LogIostreamKey.String("stdout")
+ // Events from stderr stream
+ LogIostreamStderr = LogIostreamKey.String("stderr")
+)
+
+// Attributes for a file to which log was emitted.
+const (
+ // LogFileNameKey is the attribute Key conforming to the "log.file.name"
+ // semantic conventions. It represents the basename of the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'audit.log'
+ LogFileNameKey = attribute.Key("log.file.name")
+
+ // LogFileNameResolvedKey is the attribute Key conforming to the
+ // "log.file.name_resolved" semantic conventions. It represents the
+ // basename of the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'uuid.log'
+ LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
+
+ // LogFilePathKey is the attribute Key conforming to the "log.file.path"
+ // semantic conventions. It represents the full path to the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/log/mysql/audit.log'
+ LogFilePathKey = attribute.Key("log.file.path")
+
+ // LogFilePathResolvedKey is the attribute Key conforming to the
+ // "log.file.path_resolved" semantic conventions. It represents the full
+ // path to the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/lib/docker/uuid.log'
+ LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
+)
+
+// LogFileName returns an attribute KeyValue conforming to the
+// "log.file.name" semantic conventions. It represents the basename of the
+// file.
+func LogFileName(val string) attribute.KeyValue {
+ return LogFileNameKey.String(val)
+}
+
+// LogFileNameResolved returns an attribute KeyValue conforming to the
+// "log.file.name_resolved" semantic conventions. It represents the basename of
+// the file, with symlinks resolved.
+func LogFileNameResolved(val string) attribute.KeyValue {
+ return LogFileNameResolvedKey.String(val)
+}
+
+// LogFilePath returns an attribute KeyValue conforming to the
+// "log.file.path" semantic conventions. It represents the full path to the
+// file.
+func LogFilePath(val string) attribute.KeyValue {
+ return LogFilePathKey.String(val)
+}
+
+// LogFilePathResolved returns an attribute KeyValue conforming to the
+// "log.file.path_resolved" semantic conventions. It represents the full path
+// to the file, with symlinks resolved.
+func LogFilePathResolved(val string) attribute.KeyValue {
+ return LogFilePathResolvedKey.String(val)
+}
+
+// The generic attributes that may be used in any Log Record.
+const (
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
+// Attributes describing telemetry around messaging systems and messaging
+// activities.
+const (
+ // MessagingBatchMessageCountKey is the attribute Key conforming to the
+ // "messaging.batch.message_count" semantic conventions. It represents the
+ // number of messages sent, received, or processed in the scope of the
+ // batching operation.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1, 2
+ // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
+ // spans that operate with a single message. When a messaging client
+ // library supports both batch and single-message API for the same
+ // operation, instrumentations SHOULD use `messaging.batch.message_count`
+ // for batching APIs and SHOULD NOT use it for single-message APIs.
+ MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
+
+ // MessagingClientIDKey is the attribute Key conforming to the
+ // "messaging.client.id" semantic conventions. It represents a unique
+ // identifier for the client that consumes or produces a message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'client-5', 'myhost@8742@s8083jm'
+ MessagingClientIDKey = attribute.Key("messaging.client.id")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker doesn't have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationPartitionIDKey is the attribute Key conforming to
+ // the "messaging.destination.partition.id" semantic conventions. It
+ // represents the identifier of the partition messages are sent to or
+ // received from, unique within the `messaging.destination.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1'
+ MessagingDestinationPartitionIDKey = attribute.Key("messaging.destination.partition.id")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationPublishAnonymousKey is the attribute Key conforming
+ // to the "messaging.destination_publish.anonymous" semantic conventions.
+ // It represents a boolean that is true if the publish message destination
+ // is anonymous (could be unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationPublishAnonymousKey = attribute.Key("messaging.destination_publish.anonymous")
+
+ // MessagingDestinationPublishNameKey is the attribute Key conforming to
+ // the "messaging.destination_publish.name" semantic conventions. It
+ // represents the name of the original destination the message was
+ // published to
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: The name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker doesn't have such notion, the original destination name
+ // SHOULD uniquely identify the broker.
+ MessagingDestinationPublishNameKey = attribute.Key("messaging.destination_publish.name")
+
+ // MessagingMessageBodySizeKey is the attribute Key conforming to the
+ // "messaging.message.body.size" semantic conventions. It represents the
+ // size of the message body in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1439
+ // Note: This can refer to both the compressed or uncompressed body size.
+ // If both sizes are known, the uncompressed
+ // body size should be used.
+ MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the conversation ID identifying the conversation to which the message
+ // belongs, represented as a string. Sometimes called "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the
+ // "messaging.message.envelope.size" semantic conventions. It represents
+ // the size of the message body and metadata in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2738
+ // Note: This can refer to both the compressed or uncompressed size. If
+ // both sizes are known, the uncompressed
+ // size should be used.
+ MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size")
+
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingOperationNameKey is the attribute Key conforming to the
+ // "messaging.operation.name" semantic conventions. It represents the
+ // system-specific name of the messaging operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ack', 'nack', 'send'
+ MessagingOperationNameKey = attribute.Key("messaging.operation.name")
+
+ // MessagingOperationTypeKey is the attribute Key conforming to the
+ // "messaging.operation.type" semantic conventions. It represents a string
+ // identifying the type of the messaging operation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: If a custom value is used, it MUST be of low cardinality.
+ MessagingOperationTypeKey = attribute.Key("messaging.operation.type")
+
+ // MessagingSystemKey is the attribute Key conforming to the
+ // "messaging.system" semantic conventions. It represents the messaging
+ // system as identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The actual messaging system may differ from the one known by the
+ // client. For example, when using Kafka client libraries to communicate
+ // with Azure Event Hubs, the `messaging.system` is set to `kafka` based on
+ // the instrumentation's best knowledge.
+ MessagingSystemKey = attribute.Key("messaging.system")
+)
+
+var (
+ // One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created
+ MessagingOperationTypePublish = MessagingOperationTypeKey.String("publish")
+ // A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios
+ MessagingOperationTypeCreate = MessagingOperationTypeKey.String("create")
+ // One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages
+ MessagingOperationTypeReceive = MessagingOperationTypeKey.String("receive")
+ // One or more messages are delivered to or processed by a consumer
+ MessagingOperationTypeDeliver = MessagingOperationTypeKey.String("process")
+ // One or more messages are settled
+ MessagingOperationTypeSettle = MessagingOperationTypeKey.String("settle")
+)
+
+var (
+ // Apache ActiveMQ
+ MessagingSystemActivemq = MessagingSystemKey.String("activemq")
+ // Amazon Simple Queue Service (SQS)
+ MessagingSystemAWSSqs = MessagingSystemKey.String("aws_sqs")
+ // Azure Event Grid
+ MessagingSystemEventgrid = MessagingSystemKey.String("eventgrid")
+ // Azure Event Hubs
+ MessagingSystemEventhubs = MessagingSystemKey.String("eventhubs")
+ // Azure Service Bus
+ MessagingSystemServicebus = MessagingSystemKey.String("servicebus")
+ // Google Cloud Pub/Sub
+ MessagingSystemGCPPubsub = MessagingSystemKey.String("gcp_pubsub")
+ // Java Message Service
+ MessagingSystemJms = MessagingSystemKey.String("jms")
+ // Apache Kafka
+ MessagingSystemKafka = MessagingSystemKey.String("kafka")
+ // RabbitMQ
+ MessagingSystemRabbitmq = MessagingSystemKey.String("rabbitmq")
+ // Apache RocketMQ
+ MessagingSystemRocketmq = MessagingSystemKey.String("rocketmq")
+)
+
+// MessagingBatchMessageCount returns an attribute KeyValue conforming to
+// the "messaging.batch.message_count" semantic conventions. It represents the
+// number of messages sent, received, or processed in the scope of the batching
+// operation.
+func MessagingBatchMessageCount(val int) attribute.KeyValue {
+ return MessagingBatchMessageCountKey.Int(val)
+}
+
+// MessagingClientID returns an attribute KeyValue conforming to the
+// "messaging.client.id" semantic conventions. It represents a unique
+// identifier for the client that consumes or produces a message.
+func MessagingClientID(val string) attribute.KeyValue {
+ return MessagingClientIDKey.String(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationPartitionID returns an attribute KeyValue conforming
+// to the "messaging.destination.partition.id" semantic conventions. It
+// represents the identifier of the partition messages are sent to or received
+// from, unique within the `messaging.destination.name`.
+func MessagingDestinationPartitionID(val string) attribute.KeyValue {
+ return MessagingDestinationPartitionIDKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationPublishAnonymous returns an attribute KeyValue
+// conforming to the "messaging.destination_publish.anonymous" semantic
+// conventions. It represents a boolean that is true if the publish message
+// destination is anonymous (could be unnamed or have auto-generated name).
+func MessagingDestinationPublishAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationPublishAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationPublishName returns an attribute KeyValue conforming
+// to the "messaging.destination_publish.name" semantic conventions. It
+// represents the name of the original destination the message was published to
+func MessagingDestinationPublishName(val string) attribute.KeyValue {
+ return MessagingDestinationPublishNameKey.String(val)
+}
+
+// MessagingMessageBodySize returns an attribute KeyValue conforming to the
+// "messaging.message.body.size" semantic conventions. It represents the size
+// of the message body in bytes.
+func MessagingMessageBodySize(val int) attribute.KeyValue {
+ return MessagingMessageBodySizeKey.Int(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the conversation ID identifying the conversation to which the
+// message belongs, represented as a string. Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to
+// the "messaging.message.envelope.size" semantic conventions. It represents
+// the size of the message body and metadata in bytes.
+func MessagingMessageEnvelopeSize(val int) attribute.KeyValue {
+ return MessagingMessageEnvelopeSizeKey.Int(val)
+}
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingOperationName returns an attribute KeyValue conforming to the
+// "messaging.operation.name" semantic conventions. It represents the
+// system-specific name of the messaging operation.
+func MessagingOperationName(val string) attribute.KeyValue {
+ return MessagingOperationNameKey.String(val)
+}
+
+// This group describes attributes specific to Apache Kafka.
+const (
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+)
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// This group describes attributes specific to RabbitMQ.
+const (
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+
+ // MessagingRabbitmqMessageDeliveryTagKey is the attribute Key conforming
+ // to the "messaging.rabbitmq.message.delivery_tag" semantic conventions.
+ // It represents the rabbitMQ message delivery tag
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 123
+ MessagingRabbitmqMessageDeliveryTagKey = attribute.Key("messaging.rabbitmq.message.delivery_tag")
+)
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// MessagingRabbitmqMessageDeliveryTag returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.message.delivery_tag" semantic
+// conventions. It represents the rabbitMQ message delivery tag
+func MessagingRabbitmqMessageDeliveryTag(val int) attribute.KeyValue {
+ return MessagingRabbitmqMessageDeliveryTagKey.Int(val)
+}
+
+// This group describes attributes specific to RocketMQ.
+const (
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// This group describes attributes specific to GCP Pub/Sub.
+const (
+ // MessagingGCPPubsubMessageAckDeadlineKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions.
+ // It represents the ack deadline in seconds set for the modify ack
+ // deadline request.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ MessagingGCPPubsubMessageAckDeadlineKey = attribute.Key("messaging.gcp_pubsub.message.ack_deadline")
+
+ // MessagingGCPPubsubMessageAckIDKey is the attribute Key conforming to the
+ // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It
+ // represents the ack id for a given message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ack_id'
+ MessagingGCPPubsubMessageAckIDKey = attribute.Key("messaging.gcp_pubsub.message.ack_id")
+
+ // MessagingGCPPubsubMessageDeliveryAttemptKey is the attribute Key
+ // conforming to the "messaging.gcp_pubsub.message.delivery_attempt"
+ // semantic conventions. It represents the delivery attempt for a given
+ // message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingGCPPubsubMessageDeliveryAttemptKey = attribute.Key("messaging.gcp_pubsub.message.delivery_attempt")
+
+ // MessagingGCPPubsubMessageOrderingKeyKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions.
+ // It represents the ordering key for a given message. If the attribute is
+ // not present, the message does not have an ordering key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ordering_key'
+ MessagingGCPPubsubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key")
+)
+
+// MessagingGCPPubsubMessageAckDeadline returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ack_deadline" semantic
+// conventions. It represents the ack deadline in seconds set for the modify
+// ack deadline request.
+func MessagingGCPPubsubMessageAckDeadline(val int) attribute.KeyValue {
+ return MessagingGCPPubsubMessageAckDeadlineKey.Int(val)
+}
+
+// MessagingGCPPubsubMessageAckID returns an attribute KeyValue conforming
+// to the "messaging.gcp_pubsub.message.ack_id" semantic conventions. It
+// represents the ack id for a given message.
+func MessagingGCPPubsubMessageAckID(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageAckIDKey.String(val)
+}
+
+// MessagingGCPPubsubMessageDeliveryAttempt returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.delivery_attempt" semantic
+// conventions. It represents the delivery attempt for a given message.
+func MessagingGCPPubsubMessageDeliveryAttempt(val int) attribute.KeyValue {
+ return MessagingGCPPubsubMessageDeliveryAttemptKey.Int(val)
+}
+
+// MessagingGCPPubsubMessageOrderingKey returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ordering_key" semantic
+// conventions. It represents the ordering key for a given message. If the
+// attribute is not present, the message does not have an ordering key.
+func MessagingGCPPubsubMessageOrderingKey(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageOrderingKeyKey.String(val)
+}
+
+// This group describes attributes specific to Azure Service Bus.
+const (
+ // MessagingServicebusDestinationSubscriptionNameKey is the attribute Key
+ // conforming to the "messaging.servicebus.destination.subscription_name"
+ // semantic conventions. It represents the name of the subscription in the
+ // topic messages are received from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mySubscription'
+ MessagingServicebusDestinationSubscriptionNameKey = attribute.Key("messaging.servicebus.destination.subscription_name")
+
+ // MessagingServicebusDispositionStatusKey is the attribute Key conforming
+ // to the "messaging.servicebus.disposition_status" semantic conventions.
+ // It represents the describes the [settlement
+ // type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingServicebusDispositionStatusKey = attribute.Key("messaging.servicebus.disposition_status")
+
+ // MessagingServicebusMessageDeliveryCountKey is the attribute Key
+ // conforming to the "messaging.servicebus.message.delivery_count" semantic
+ // conventions. It represents the number of deliveries that have been
+ // attempted for this message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingServicebusMessageDeliveryCountKey = attribute.Key("messaging.servicebus.message.delivery_count")
+
+ // MessagingServicebusMessageEnqueuedTimeKey is the attribute Key
+ // conforming to the "messaging.servicebus.message.enqueued_time" semantic
+ // conventions. It represents the UTC epoch seconds at which the message
+ // has been accepted and stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1701393730
+ MessagingServicebusMessageEnqueuedTimeKey = attribute.Key("messaging.servicebus.message.enqueued_time")
+)
+
+var (
+ // Message is completed
+ MessagingServicebusDispositionStatusComplete = MessagingServicebusDispositionStatusKey.String("complete")
+ // Message is abandoned
+ MessagingServicebusDispositionStatusAbandon = MessagingServicebusDispositionStatusKey.String("abandon")
+ // Message is sent to dead letter queue
+ MessagingServicebusDispositionStatusDeadLetter = MessagingServicebusDispositionStatusKey.String("dead_letter")
+ // Message is deferred
+ MessagingServicebusDispositionStatusDefer = MessagingServicebusDispositionStatusKey.String("defer")
+)
+
+// MessagingServicebusDestinationSubscriptionName returns an attribute
+// KeyValue conforming to the
+// "messaging.servicebus.destination.subscription_name" semantic conventions.
+// It represents the name of the subscription in the topic messages are
+// received from.
+func MessagingServicebusDestinationSubscriptionName(val string) attribute.KeyValue {
+ return MessagingServicebusDestinationSubscriptionNameKey.String(val)
+}
+
+// MessagingServicebusMessageDeliveryCount returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.delivery_count" semantic
+// conventions. It represents the number of deliveries that have been attempted
+// for this message.
+func MessagingServicebusMessageDeliveryCount(val int) attribute.KeyValue {
+ return MessagingServicebusMessageDeliveryCountKey.Int(val)
+}
+
+// MessagingServicebusMessageEnqueuedTime returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.enqueued_time" semantic
+// conventions. It represents the UTC epoch seconds at which the message has
+// been accepted and stored in the entity.
+func MessagingServicebusMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingServicebusMessageEnqueuedTimeKey.Int(val)
+}
+
+// This group describes attributes specific to Azure Event Hubs.
+const (
+ // MessagingEventhubsConsumerGroupKey is the attribute Key conforming to
+ // the "messaging.eventhubs.consumer.group" semantic conventions. It
+ // represents the name of the consumer group the event consumer is
+ // associated with.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'indexer'
+ MessagingEventhubsConsumerGroupKey = attribute.Key("messaging.eventhubs.consumer.group")
+
+ // MessagingEventhubsMessageEnqueuedTimeKey is the attribute Key conforming
+ // to the "messaging.eventhubs.message.enqueued_time" semantic conventions.
+ // It represents the UTC epoch seconds at which the message has been
+ // accepted and stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1701393730
+ MessagingEventhubsMessageEnqueuedTimeKey = attribute.Key("messaging.eventhubs.message.enqueued_time")
+)
+
+// MessagingEventhubsConsumerGroup returns an attribute KeyValue conforming
+// to the "messaging.eventhubs.consumer.group" semantic conventions. It
+// represents the name of the consumer group the event consumer is associated
+// with.
+func MessagingEventhubsConsumerGroup(val string) attribute.KeyValue {
+ return MessagingEventhubsConsumerGroupKey.String(val)
+}
+
+// MessagingEventhubsMessageEnqueuedTime returns an attribute KeyValue
+// conforming to the "messaging.eventhubs.message.enqueued_time" semantic
+// conventions. It represents the UTC epoch seconds at which the message has
+// been accepted and stored in the entity.
+func MessagingEventhubsMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingEventhubsMessageEnqueuedTimeKey.Int(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetworkCarrierIccKey is the attribute Key conforming to the
+ // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+ // alpha-2 2-character country code associated with the mobile carrier
+ // network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'DE'
+ NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
+
+ // NetworkCarrierMccKey is the attribute Key conforming to the
+ // "network.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '310'
+ NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
+
+ // NetworkCarrierMncKey is the attribute Key conforming to the
+ // "network.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '001'
+ NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
+
+ // NetworkCarrierNameKey is the attribute Key conforming to the
+ // "network.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'sprint'
+ NetworkCarrierNameKey = attribute.Key("network.carrier.name")
+
+ // NetworkConnectionSubtypeKey is the attribute Key conforming to the
+ // "network.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'LTE'
+ NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
+
+ // NetworkConnectionTypeKey is the attribute Key conforming to the
+ // "network.connection.type" semantic conventions. It represents the
+ // internet connection type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'wifi'
+ NetworkConnectionTypeKey = attribute.Key("network.connection.type")
+
+ // NetworkIoDirectionKey is the attribute Key conforming to the
+ // "network.io.direction" semantic conventions. It represents the network
+ // IO operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'transmit'
+ NetworkIoDirectionKey = attribute.Key("network.io.direction")
+
+ // NetworkLocalAddressKey is the attribute Key conforming to the
+ // "network.local.address" semantic conventions. It represents the local
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkLocalAddressKey = attribute.Key("network.local.address")
+
+ // NetworkLocalPortKey is the attribute Key conforming to the
+ // "network.local.port" semantic conventions. It represents the local port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkLocalPortKey = attribute.Key("network.local.port")
+
+ // NetworkPeerAddressKey is the attribute Key conforming to the
+ // "network.peer.address" semantic conventions. It represents the peer
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkPeerAddressKey = attribute.Key("network.peer.address")
+
+ // NetworkPeerPortKey is the attribute Key conforming to the
+ // "network.peer.port" semantic conventions. It represents the peer port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkPeerPortKey = attribute.Key("network.peer.port")
+
+ // NetworkProtocolNameKey is the attribute Key conforming to the
+ // "network.protocol.name" semantic conventions. It represents the [OSI
+ // application layer](https://osi-model.com/application-layer/) or non-OSI
+ // equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkProtocolNameKey = attribute.Key("network.protocol.name")
+
+ // NetworkProtocolVersionKey is the attribute Key conforming to the
+ // "network.protocol.version" semantic conventions. It represents the
+ // actual version of the protocol used for network communication.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.1', '2'
+ // Note: If protocol version is subject to negotiation (for example using
+ // [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute
+ // SHOULD be set to the negotiated version. If the actual protocol version
+ // is not known, this attribute SHOULD NOT be set.
+ NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
+
+ // NetworkTransportKey is the attribute Key conforming to the
+ // "network.transport" semantic conventions. It represents the [OSI
+ // transport layer](https://osi-model.com/transport-layer/) or
+ // [inter-process communication
+ // method](https://wikipedia.org/wiki/Inter-process_communication).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tcp', 'udp'
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // Consider always setting the transport when setting a port number, since
+ // a port number is ambiguous without knowing the transport. For example
+ // different processes could be listening on TCP port 12345 and UDP port
+ // 12345.
+ NetworkTransportKey = attribute.Key("network.transport")
+
+ // NetworkTypeKey is the attribute Key conforming to the "network.type"
+ // semantic conventions. It represents the [OSI network
+ // layer](https://osi-model.com/network-layer/) or non-OSI equivalent.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'ipv4', 'ipv6'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkTypeKey = attribute.Key("network.type")
+)
+
+var (
+ // GPRS
+ NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
+)
+
+var (
+ // wifi
+ NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
+ // wired
+ NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
+ // cell
+ NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
+ // unavailable
+ NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
+ // unknown
+ NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
+)
+
+var (
+ // transmit
+ NetworkIoDirectionTransmit = NetworkIoDirectionKey.String("transmit")
+ // receive
+ NetworkIoDirectionReceive = NetworkIoDirectionKey.String("receive")
+)
+
+var (
+ // TCP
+ NetworkTransportTCP = NetworkTransportKey.String("tcp")
+ // UDP
+ NetworkTransportUDP = NetworkTransportKey.String("udp")
+ // Named or anonymous pipe
+ NetworkTransportPipe = NetworkTransportKey.String("pipe")
+ // Unix domain socket
+ NetworkTransportUnix = NetworkTransportKey.String("unix")
+)
+
+var (
+ // IPv4
+ NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
+ // IPv6
+ NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
+)
+
+// NetworkCarrierIcc returns an attribute KeyValue conforming to the
+// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetworkCarrierIcc(val string) attribute.KeyValue {
+ return NetworkCarrierIccKey.String(val)
+}
+
+// NetworkCarrierMcc returns an attribute KeyValue conforming to the
+// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
+// country code.
+func NetworkCarrierMcc(val string) attribute.KeyValue {
+ return NetworkCarrierMccKey.String(val)
+}
+
+// NetworkCarrierMnc returns an attribute KeyValue conforming to the
+// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
+// network code.
+func NetworkCarrierMnc(val string) attribute.KeyValue {
+ return NetworkCarrierMncKey.String(val)
+}
+
+// NetworkCarrierName returns an attribute KeyValue conforming to the
+// "network.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetworkCarrierName(val string) attribute.KeyValue {
+ return NetworkCarrierNameKey.String(val)
+}
+
+// NetworkLocalAddress returns an attribute KeyValue conforming to the
+// "network.local.address" semantic conventions. It represents the local
+// address of the network connection - IP address or Unix domain socket name.
+func NetworkLocalAddress(val string) attribute.KeyValue {
+ return NetworkLocalAddressKey.String(val)
+}
+
+// NetworkLocalPort returns an attribute KeyValue conforming to the
+// "network.local.port" semantic conventions. It represents the local port
+// number of the network connection.
+func NetworkLocalPort(val int) attribute.KeyValue {
+ return NetworkLocalPortKey.Int(val)
+}
+
+// NetworkPeerAddress returns an attribute KeyValue conforming to the
+// "network.peer.address" semantic conventions. It represents the peer address
+// of the network connection - IP address or Unix domain socket name.
+func NetworkPeerAddress(val string) attribute.KeyValue {
+ return NetworkPeerAddressKey.String(val)
+}
+
+// NetworkPeerPort returns an attribute KeyValue conforming to the
+// "network.peer.port" semantic conventions. It represents the peer port number
+// of the network connection.
+func NetworkPeerPort(val int) attribute.KeyValue {
+ return NetworkPeerPortKey.Int(val)
+}
+
+// NetworkProtocolName returns an attribute KeyValue conforming to the
+// "network.protocol.name" semantic conventions. It represents the [OSI
+// application layer](https://osi-model.com/application-layer/) or non-OSI
+// equivalent.
+func NetworkProtocolName(val string) attribute.KeyValue {
+ return NetworkProtocolNameKey.String(val)
+}
+
+// NetworkProtocolVersion returns an attribute KeyValue conforming to the
+// "network.protocol.version" semantic conventions. It represents the actual
+// version of the protocol used for network communication.
+func NetworkProtocolVersion(val string) attribute.KeyValue {
+ return NetworkProtocolVersionKey.String(val)
+}
+
+// An OCI image manifest.
+const (
+ // OciManifestDigestKey is the attribute Key conforming to the
+ // "oci.manifest.digest" semantic conventions. It represents the digest of
+ // the OCI image manifest. For container images specifically is the digest
+ // by which the container image is known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4'
+ // Note: Follows [OCI Image Manifest
+ // Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md),
+ // and specifically the [Digest
+ // property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
+ // An example can be found in [Example Image
+ // Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest).
+ OciManifestDigestKey = attribute.Key("oci.manifest.digest")
+)
+
+// OciManifestDigest returns an attribute KeyValue conforming to the
+// "oci.manifest.digest" semantic conventions. It represents the digest of the
+// OCI image manifest. For container images specifically is the digest by which
+// the container image is known.
+func OciManifestDigest(val string) attribute.KeyValue {
+ return OciManifestDigestKey.String(val)
+}
+
+// Attributes used by the OpenTracing Shim layer.
+const (
+ // OpentracingRefTypeKey is the attribute Key conforming to the
+ // "opentracing.ref_type" semantic conventions. It represents the
+ // parent-child Reference type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The causal relationship between a child Span and a parent Span.
+ OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
+)
+
+var (
+ // The parent Span depends on the child Span in some capacity
+ OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
+ // The parent Span doesn't depend in any way on the result of the child Span
+ OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
+)
+
+// The operating system (OS) on which the process represented by this resource
+// is running.
+const (
+ // OSBuildIDKey is the attribute Key conforming to the "os.build_id"
+ // semantic conventions. It represents the unique identifier for a
+ // particular build or compilation of the operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TQ3C.230805.001.B2', '20E247', '22621'
+ OSBuildIDKey = attribute.Key("os.build_id")
+
+ // OSDescriptionKey is the attribute Key conforming to the "os.description"
+ // semantic conventions. It represents the human readable (not intended to
+ // be parsed) OS version information, like e.g. reported by `ver` or
+ // `lsb_release -a` commands.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1
+ // LTS'
+ OSDescriptionKey = attribute.Key("os.description")
+
+ // OSNameKey is the attribute Key conforming to the "os.name" semantic
+ // conventions. It represents the human readable operating system name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iOS', 'Android', 'Ubuntu'
+ OSNameKey = attribute.Key("os.name")
+
+ // OSTypeKey is the attribute Key conforming to the "os.type" semantic
+ // conventions. It represents the operating system type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ OSTypeKey = attribute.Key("os.type")
+
+ // OSVersionKey is the attribute Key conforming to the "os.version"
+ // semantic conventions. It represents the version string of the operating
+ // system as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.2.1', '18.04.1'
+ OSVersionKey = attribute.Key("os.version")
+)
+
+var (
+ // Microsoft Windows
+ OSTypeWindows = OSTypeKey.String("windows")
+ // Linux
+ OSTypeLinux = OSTypeKey.String("linux")
+ // Apple Darwin
+ OSTypeDarwin = OSTypeKey.String("darwin")
+ // FreeBSD
+ OSTypeFreeBSD = OSTypeKey.String("freebsd")
+ // NetBSD
+ OSTypeNetBSD = OSTypeKey.String("netbsd")
+ // OpenBSD
+ OSTypeOpenBSD = OSTypeKey.String("openbsd")
+ // DragonFly BSD
+ OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd")
+ // HP-UX (Hewlett Packard Unix)
+ OSTypeHPUX = OSTypeKey.String("hpux")
+ // AIX (Advanced Interactive eXecutive)
+ OSTypeAIX = OSTypeKey.String("aix")
+ // SunOS, Oracle Solaris
+ OSTypeSolaris = OSTypeKey.String("solaris")
+ // IBM z/OS
+ OSTypeZOS = OSTypeKey.String("z_os")
+)
+
+// OSBuildID returns an attribute KeyValue conforming to the "os.build_id"
+// semantic conventions. It represents the unique identifier for a particular
+// build or compilation of the operating system.
+func OSBuildID(val string) attribute.KeyValue {
+ return OSBuildIDKey.String(val)
+}
+
+// OSDescription returns an attribute KeyValue conforming to the
+// "os.description" semantic conventions. It represents the human readable (not
+// intended to be parsed) OS version information, like e.g. reported by `ver`
+// or `lsb_release -a` commands.
+func OSDescription(val string) attribute.KeyValue {
+ return OSDescriptionKey.String(val)
+}
+
+// OSName returns an attribute KeyValue conforming to the "os.name" semantic
+// conventions. It represents the human readable operating system name.
+func OSName(val string) attribute.KeyValue {
+ return OSNameKey.String(val)
+}
+
+// OSVersion returns an attribute KeyValue conforming to the "os.version"
+// semantic conventions. It represents the version string of the operating
+// system as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func OSVersion(val string) attribute.KeyValue {
+ return OSVersionKey.String(val)
+}
+
+// Attributes reserved for OpenTelemetry
+const (
+ // OTelStatusCodeKey is the attribute Key conforming to the
+ // "otel.status_code" semantic conventions. It represents the name of the
+ // code, either "OK" or "ERROR". MUST NOT be set if the status code is
+ // UNSET.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ OTelStatusCodeKey = attribute.Key("otel.status_code")
+
+ // OTelStatusDescriptionKey is the attribute Key conforming to the
+ // "otel.status_description" semantic conventions. It represents the
+ // description of the Status if it has a value, otherwise not set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'resource not found'
+ OTelStatusDescriptionKey = attribute.Key("otel.status_description")
+)
+
+var (
+ // The operation has been validated by an Application developer or Operator to have completed successfully
+ OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
+ // The operation contains an error
+ OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
+)
+
+// OTelStatusDescription returns an attribute KeyValue conforming to the
+// "otel.status_description" semantic conventions. It represents the
+// description of the Status if it has a value, otherwise not set.
+func OTelStatusDescription(val string) attribute.KeyValue {
+ return OTelStatusDescriptionKey.String(val)
+}
+
+// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's
+// concepts.
+const (
+ // OTelScopeNameKey is the attribute Key conforming to the
+ // "otel.scope.name" semantic conventions. It represents the name of the
+ // instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ OTelScopeNameKey = attribute.Key("otel.scope.name")
+
+ // OTelScopeVersionKey is the attribute Key conforming to the
+ // "otel.scope.version" semantic conventions. It represents the version of
+ // the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.0.0'
+ OTelScopeVersionKey = attribute.Key("otel.scope.version")
+)
+
+// OTelScopeName returns an attribute KeyValue conforming to the
+// "otel.scope.name" semantic conventions. It represents the name of the
+// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+func OTelScopeName(val string) attribute.KeyValue {
+ return OTelScopeNameKey.String(val)
+}
+
+// OTelScopeVersion returns an attribute KeyValue conforming to the
+// "otel.scope.version" semantic conventions. It represents the version of the
+// instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+func OTelScopeVersion(val string) attribute.KeyValue {
+ return OTelScopeVersionKey.String(val)
+}
+
+// Operations that access some remote service.
+const (
+ // PeerServiceKey is the attribute Key conforming to the "peer.service"
+ // semantic conventions. It represents the
+ // [`service.name`](/docs/resource/README.md#service) of the remote
+ // service. SHOULD be equal to the actual `service.name` resource attribute
+ // of the remote service if any.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AuthTokenCache'
+ PeerServiceKey = attribute.Key("peer.service")
+)
+
+// PeerService returns an attribute KeyValue conforming to the
+// "peer.service" semantic conventions. It represents the
+// [`service.name`](/docs/resource/README.md#service) of the remote service.
+// SHOULD be equal to the actual `service.name` resource attribute of the
+// remote service if any.
+func PeerService(val string) attribute.KeyValue {
+ return PeerServiceKey.String(val)
+}
+
+// An operating system process.
+const (
+ // ProcessCommandKey is the attribute Key conforming to the
+ // "process.command" semantic conventions. It represents the command used
+ // to launch the process (i.e. the command name). On Linux based systems,
+ // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can
+ // be set to the first parameter extracted from `GetCommandLineW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otelcol'
+ ProcessCommandKey = attribute.Key("process.command")
+
+ // ProcessCommandArgsKey is the attribute Key conforming to the
+ // "process.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) as received
+ // by the process. On Linux-based systems (and some other Unixoid systems
+ // supporting procfs), can be set according to the list of null-delimited
+ // strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+ // this would be the full argv vector passed to `main`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otecol', '--config=config.yaml'
+ ProcessCommandArgsKey = attribute.Key("process.command_args")
+
+ // ProcessCommandLineKey is the attribute Key conforming to the
+ // "process.command_line" semantic conventions. It represents the full
+ // command used to launch the process as a single string representing the
+ // full command. On Windows, can be set to the result of `GetCommandLineW`.
+ // Do not set this if you have to assemble it just for monitoring; use
+ // `process.command_args` instead.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"'
+ ProcessCommandLineKey = attribute.Key("process.command_line")
+
+ // ProcessContextSwitchTypeKey is the attribute Key conforming to the
+ // "process.context_switch_type" semantic conventions. It represents the
+ // specifies whether the context switches for this data point were
+ // voluntary or involuntary.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessContextSwitchTypeKey = attribute.Key("process.context_switch_type")
+
+ // ProcessCreationTimeKey is the attribute Key conforming to the
+ // "process.creation.time" semantic conventions. It represents the date and
+ // time the process was created, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2023-11-21T09:25:34.853Z'
+ ProcessCreationTimeKey = attribute.Key("process.creation.time")
+
+ // ProcessExecutableNameKey is the attribute Key conforming to the
+ // "process.executable.name" semantic conventions. It represents the name
+ // of the process executable. On Linux based systems, can be set to the
+ // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name
+ // of `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcol'
+ ProcessExecutableNameKey = attribute.Key("process.executable.name")
+
+ // ProcessExecutablePathKey is the attribute Key conforming to the
+ // "process.executable.path" semantic conventions. It represents the full
+ // path to the process executable. On Linux based systems, can be set to
+ // the target of `proc/[pid]/exe`. On Windows, can be set to the result of
+ // `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/bin/cmd/otelcol'
+ ProcessExecutablePathKey = attribute.Key("process.executable.path")
+
+ // ProcessExitCodeKey is the attribute Key conforming to the
+ // "process.exit.code" semantic conventions. It represents the exit code of
+ // the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 127
+ ProcessExitCodeKey = attribute.Key("process.exit.code")
+
+ // ProcessExitTimeKey is the attribute Key conforming to the
+ // "process.exit.time" semantic conventions. It represents the date and
+ // time the process exited, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2023-11-21T09:26:12.315Z'
+ ProcessExitTimeKey = attribute.Key("process.exit.time")
+
+ // ProcessGroupLeaderPIDKey is the attribute Key conforming to the
+ // "process.group_leader.pid" semantic conventions. It represents the PID
+ // of the process's group leader. This is also the process group ID (PGID)
+ // of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 23
+ ProcessGroupLeaderPIDKey = attribute.Key("process.group_leader.pid")
+
+ // ProcessInteractiveKey is the attribute Key conforming to the
+ // "process.interactive" semantic conventions. It represents the whether
+ // the process is connected to an interactive shell.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessInteractiveKey = attribute.Key("process.interactive")
+
+ // ProcessOwnerKey is the attribute Key conforming to the "process.owner"
+ // semantic conventions. It represents the username of the user that owns
+ // the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessOwnerKey = attribute.Key("process.owner")
+
+ // ProcessPagingFaultTypeKey is the attribute Key conforming to the
+ // "process.paging.fault_type" semantic conventions. It represents the type
+ // of page fault for this data point. Type `major` is for major/hard page
+ // faults, and `minor` is for minor/soft page faults.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessPagingFaultTypeKey = attribute.Key("process.paging.fault_type")
+
+ // ProcessParentPIDKey is the attribute Key conforming to the
+ // "process.parent_pid" semantic conventions. It represents the parent
+ // Process identifier (PPID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 111
+ ProcessParentPIDKey = attribute.Key("process.parent_pid")
+
+ // ProcessPIDKey is the attribute Key conforming to the "process.pid"
+ // semantic conventions. It represents the process identifier (PID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1234
+ ProcessPIDKey = attribute.Key("process.pid")
+
+ // ProcessRealUserIDKey is the attribute Key conforming to the
+ // "process.real_user.id" semantic conventions. It represents the real user
+ // ID (RUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000
+ ProcessRealUserIDKey = attribute.Key("process.real_user.id")
+
+ // ProcessRealUserNameKey is the attribute Key conforming to the
+ // "process.real_user.name" semantic conventions. It represents the
+ // username of the real user of the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'operator'
+ ProcessRealUserNameKey = attribute.Key("process.real_user.name")
+
+ // ProcessRuntimeDescriptionKey is the attribute Key conforming to the
+ // "process.runtime.description" semantic conventions. It represents an
+ // additional description about the runtime of the process, for example a
+ // specific vendor customization of the runtime environment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0'
+ ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
+
+ // ProcessRuntimeNameKey is the attribute Key conforming to the
+ // "process.runtime.name" semantic conventions. It represents the name of
+ // the runtime of this process. For compiled native binaries, this SHOULD
+ // be the name of the compiler.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'OpenJDK Runtime Environment'
+ ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
+
+ // ProcessRuntimeVersionKey is the attribute Key conforming to the
+ // "process.runtime.version" semantic conventions. It represents the
+ // version of the runtime of this process, as returned by the runtime
+ // without modification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.0.2'
+ ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
+
+ // ProcessSavedUserIDKey is the attribute Key conforming to the
+ // "process.saved_user.id" semantic conventions. It represents the saved
+ // user ID (SUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1002
+ ProcessSavedUserIDKey = attribute.Key("process.saved_user.id")
+
+ // ProcessSavedUserNameKey is the attribute Key conforming to the
+ // "process.saved_user.name" semantic conventions. It represents the
+ // username of the saved user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'operator'
+ ProcessSavedUserNameKey = attribute.Key("process.saved_user.name")
+
+ // ProcessSessionLeaderPIDKey is the attribute Key conforming to the
+ // "process.session_leader.pid" semantic conventions. It represents the PID
+ // of the process's session leader. This is also the session ID (SID) of
+ // the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 14
+ ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid")
+
+ // ProcessUserIDKey is the attribute Key conforming to the
+ // "process.user.id" semantic conventions. It represents the effective user
+ // ID (EUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1001
+ ProcessUserIDKey = attribute.Key("process.user.id")
+
+ // ProcessUserNameKey is the attribute Key conforming to the
+ // "process.user.name" semantic conventions. It represents the username of
+ // the effective user of the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessUserNameKey = attribute.Key("process.user.name")
+
+ // ProcessVpidKey is the attribute Key conforming to the "process.vpid"
+ // semantic conventions. It represents the virtual process identifier.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12
+ // Note: The process ID within a PID namespace. This is not necessarily
+ // unique across all processes on the host but it is unique within the
+ // process namespace that the process exists within.
+ ProcessVpidKey = attribute.Key("process.vpid")
+)
+
+var (
+ // voluntary
+ ProcessContextSwitchTypeVoluntary = ProcessContextSwitchTypeKey.String("voluntary")
+ // involuntary
+ ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary")
+)
+
+var (
+ // major
+ ProcessPagingFaultTypeMajor = ProcessPagingFaultTypeKey.String("major")
+ // minor
+ ProcessPagingFaultTypeMinor = ProcessPagingFaultTypeKey.String("minor")
+)
+
+// ProcessCommand returns an attribute KeyValue conforming to the
+// "process.command" semantic conventions. It represents the command used to
+// launch the process (i.e. the command name). On Linux based systems, can be
+// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to
+// the first parameter extracted from `GetCommandLineW`.
+func ProcessCommand(val string) attribute.KeyValue {
+ return ProcessCommandKey.String(val)
+}
+
+// ProcessCommandArgs returns an attribute KeyValue conforming to the
+// "process.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) as received by
+// the process. On Linux-based systems (and some other Unixoid systems
+// supporting procfs), can be set according to the list of null-delimited
+// strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+// this would be the full argv vector passed to `main`.
+func ProcessCommandArgs(val ...string) attribute.KeyValue {
+ return ProcessCommandArgsKey.StringSlice(val)
+}
+
+// ProcessCommandLine returns an attribute KeyValue conforming to the
+// "process.command_line" semantic conventions. It represents the full command
+// used to launch the process as a single string representing the full command.
+// On Windows, can be set to the result of `GetCommandLineW`. Do not set this
+// if you have to assemble it just for monitoring; use `process.command_args`
+// instead.
+func ProcessCommandLine(val string) attribute.KeyValue {
+ return ProcessCommandLineKey.String(val)
+}
+
+// ProcessCreationTime returns an attribute KeyValue conforming to the
+// "process.creation.time" semantic conventions. It represents the date and
+// time the process was created, in ISO 8601 format.
+func ProcessCreationTime(val string) attribute.KeyValue {
+ return ProcessCreationTimeKey.String(val)
+}
+
+// ProcessExecutableName returns an attribute KeyValue conforming to the
+// "process.executable.name" semantic conventions. It represents the name of
+// the process executable. On Linux based systems, can be set to the `Name` in
+// `proc/[pid]/status`. On Windows, can be set to the base name of
+// `GetProcessImageFileNameW`.
+func ProcessExecutableName(val string) attribute.KeyValue {
+ return ProcessExecutableNameKey.String(val)
+}
+
+// ProcessExecutablePath returns an attribute KeyValue conforming to the
+// "process.executable.path" semantic conventions. It represents the full path
+// to the process executable. On Linux based systems, can be set to the target
+// of `proc/[pid]/exe`. On Windows, can be set to the result of
+// `GetProcessImageFileNameW`.
+func ProcessExecutablePath(val string) attribute.KeyValue {
+ return ProcessExecutablePathKey.String(val)
+}
+
+// ProcessExitCode returns an attribute KeyValue conforming to the
+// "process.exit.code" semantic conventions. It represents the exit code of the
+// process.
+func ProcessExitCode(val int) attribute.KeyValue {
+ return ProcessExitCodeKey.Int(val)
+}
+
+// ProcessExitTime returns an attribute KeyValue conforming to the
+// "process.exit.time" semantic conventions. It represents the date and time
+// the process exited, in ISO 8601 format.
+func ProcessExitTime(val string) attribute.KeyValue {
+ return ProcessExitTimeKey.String(val)
+}
+
+// ProcessGroupLeaderPID returns an attribute KeyValue conforming to the
+// "process.group_leader.pid" semantic conventions. It represents the PID of
+// the process's group leader. This is also the process group ID (PGID) of the
+// process.
+func ProcessGroupLeaderPID(val int) attribute.KeyValue {
+ return ProcessGroupLeaderPIDKey.Int(val)
+}
+
+// ProcessInteractive returns an attribute KeyValue conforming to the
+// "process.interactive" semantic conventions. It represents the whether the
+// process is connected to an interactive shell.
+func ProcessInteractive(val bool) attribute.KeyValue {
+ return ProcessInteractiveKey.Bool(val)
+}
+
+// ProcessOwner returns an attribute KeyValue conforming to the
+// "process.owner" semantic conventions. It represents the username of the user
+// that owns the process.
+func ProcessOwner(val string) attribute.KeyValue {
+ return ProcessOwnerKey.String(val)
+}
+
+// ProcessParentPID returns an attribute KeyValue conforming to the
+// "process.parent_pid" semantic conventions. It represents the parent Process
+// identifier (PPID).
+func ProcessParentPID(val int) attribute.KeyValue {
+ return ProcessParentPIDKey.Int(val)
+}
+
+// ProcessPID returns an attribute KeyValue conforming to the "process.pid"
+// semantic conventions. It represents the process identifier (PID).
+func ProcessPID(val int) attribute.KeyValue {
+ return ProcessPIDKey.Int(val)
+}
+
+// ProcessRealUserID returns an attribute KeyValue conforming to the
+// "process.real_user.id" semantic conventions. It represents the real user ID
+// (RUID) of the process.
+func ProcessRealUserID(val int) attribute.KeyValue {
+ return ProcessRealUserIDKey.Int(val)
+}
+
+// ProcessRealUserName returns an attribute KeyValue conforming to the
+// "process.real_user.name" semantic conventions. It represents the username of
+// the real user of the process.
+func ProcessRealUserName(val string) attribute.KeyValue {
+ return ProcessRealUserNameKey.String(val)
+}
+
+// ProcessRuntimeDescription returns an attribute KeyValue conforming to the
+// "process.runtime.description" semantic conventions. It represents an
+// additional description about the runtime of the process, for example a
+// specific vendor customization of the runtime environment.
+func ProcessRuntimeDescription(val string) attribute.KeyValue {
+ return ProcessRuntimeDescriptionKey.String(val)
+}
+
+// ProcessRuntimeName returns an attribute KeyValue conforming to the
+// "process.runtime.name" semantic conventions. It represents the name of the
+// runtime of this process. For compiled native binaries, this SHOULD be the
+// name of the compiler.
+func ProcessRuntimeName(val string) attribute.KeyValue {
+ return ProcessRuntimeNameKey.String(val)
+}
+
+// ProcessRuntimeVersion returns an attribute KeyValue conforming to the
+// "process.runtime.version" semantic conventions. It represents the version of
+// the runtime of this process, as returned by the runtime without
+// modification.
+func ProcessRuntimeVersion(val string) attribute.KeyValue {
+ return ProcessRuntimeVersionKey.String(val)
+}
+
+// ProcessSavedUserID returns an attribute KeyValue conforming to the
+// "process.saved_user.id" semantic conventions. It represents the saved user
+// ID (SUID) of the process.
+func ProcessSavedUserID(val int) attribute.KeyValue {
+ return ProcessSavedUserIDKey.Int(val)
+}
+
+// ProcessSavedUserName returns an attribute KeyValue conforming to the
+// "process.saved_user.name" semantic conventions. It represents the username
+// of the saved user.
+func ProcessSavedUserName(val string) attribute.KeyValue {
+ return ProcessSavedUserNameKey.String(val)
+}
+
+// ProcessSessionLeaderPID returns an attribute KeyValue conforming to the
+// "process.session_leader.pid" semantic conventions. It represents the PID of
+// the process's session leader. This is also the session ID (SID) of the
+// process.
+func ProcessSessionLeaderPID(val int) attribute.KeyValue {
+ return ProcessSessionLeaderPIDKey.Int(val)
+}
+
+// ProcessUserID returns an attribute KeyValue conforming to the
+// "process.user.id" semantic conventions. It represents the effective user ID
+// (EUID) of the process.
+func ProcessUserID(val int) attribute.KeyValue {
+ return ProcessUserIDKey.Int(val)
+}
+
+// ProcessUserName returns an attribute KeyValue conforming to the
+// "process.user.name" semantic conventions. It represents the username of the
+// effective user of the process.
+func ProcessUserName(val string) attribute.KeyValue {
+ return ProcessUserNameKey.String(val)
+}
+
+// ProcessVpid returns an attribute KeyValue conforming to the
+// "process.vpid" semantic conventions. It represents the virtual process
+// identifier.
+func ProcessVpid(val int) attribute.KeyValue {
+ return ProcessVpidKey.Int(val)
+}
+
+// Attributes for process CPU
+const (
+ // ProcessCPUStateKey is the attribute Key conforming to the
+ // "process.cpu.state" semantic conventions. It represents the CPU state of
+ // the process.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessCPUStateKey = attribute.Key("process.cpu.state")
+)
+
+var (
+ // system
+ ProcessCPUStateSystem = ProcessCPUStateKey.String("system")
+ // user
+ ProcessCPUStateUser = ProcessCPUStateKey.String("user")
+ // wait
+ ProcessCPUStateWait = ProcessCPUStateKey.String("wait")
+)
+
+// Attributes for remote procedure calls.
+const (
+ // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.connect_rpc.error_code" semantic conventions. It represents the
+ // [error codes](https://connect.build/docs/protocol/#error-codes) of the
+ // Connect request. Error codes are always string values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
+
+ // RPCGRPCStatusCodeKey is the attribute Key conforming to the
+ // "rpc.grpc.status_code" semantic conventions. It represents the [numeric
+ // status
+ // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of
+ // the gRPC request.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
+
+ // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_code" semantic conventions. It represents the
+ // `error.code` property of response if it is an error response.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: -32700, 100
+ RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
+
+ // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_message" semantic conventions. It represents the
+ // `error.message` property of response if it is an error response.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Parse error', 'User already exists'
+ RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
+
+ // RPCJsonrpcRequestIDKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+ // property of request or response. Since protocol allows id to be int,
+ // string, `null` or missing (for notifications), value is expected to be
+ // cast to string for simplicity. Use empty string in case of `null` value.
+ // Omit entirely if this is a notification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '10', 'request-7', ''
+ RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
+
+ // RPCJsonrpcVersionKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+ // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+ // doesn't specify this, the value can be omitted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2.0', '1.0'
+ RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
+
+ // RPCMessageCompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.compressed_size" semantic conventions. It represents the
+ // compressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageCompressedSizeKey = attribute.Key("rpc.message.compressed_size")
+
+ // RPCMessageIDKey is the attribute Key conforming to the "rpc.message.id"
+ // semantic conventions. It represents the mUST be calculated as two
+ // different counters starting from `1` one for sent messages and one for
+ // received message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This way we guarantee that the values will be consistent between
+ // different implementations.
+ RPCMessageIDKey = attribute.Key("rpc.message.id")
+
+ // RPCMessageTypeKey is the attribute Key conforming to the
+ // "rpc.message.type" semantic conventions. It represents the whether this
+ // is a received or sent message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageTypeKey = attribute.Key("rpc.message.type")
+
+ // RPCMessageUncompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.uncompressed_size" semantic conventions. It represents the
+ // uncompressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size")
+
+ // RPCMethodKey is the attribute Key conforming to the "rpc.method"
+ // semantic conventions. It represents the name of the (logical) method
+ // being called, must be equal to the $method part in the span name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'exampleMethod'
+ // Note: This is the logical name of the method from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // method/function. The `code.function` attribute may be used to store the
+ // latter (e.g., method actually executing the call on the server side, RPC
+ // client stub method on the client side).
+ RPCMethodKey = attribute.Key("rpc.method")
+
+ // RPCServiceKey is the attribute Key conforming to the "rpc.service"
+ // semantic conventions. It represents the full (logical) name of the
+ // service being called, including its package name, if applicable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myservice.EchoService'
+ // Note: This is the logical name of the service from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // class. The `code.namespace` attribute may be used to store the latter
+ // (despite the attribute name, it may include a class name; e.g., class
+ // with method actually executing the call on the server side, RPC client
+ // stub class on the client side).
+ RPCServiceKey = attribute.Key("rpc.service")
+
+ // RPCSystemKey is the attribute Key conforming to the "rpc.system"
+ // semantic conventions. It represents a string identifying the remoting
+ // system. See below for a list of well-known identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCSystemKey = attribute.Key("rpc.system")
+)
+
+var (
+ // cancelled
+ RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
+ // unknown
+ RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
+ // invalid_argument
+ RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
+ // deadline_exceeded
+ RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
+ // not_found
+ RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
+ // already_exists
+ RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
+ // permission_denied
+ RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
+ // resource_exhausted
+ RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
+ // failed_precondition
+ RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
+ // aborted
+ RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
+ // out_of_range
+ RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
+ // unimplemented
+ RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
+ // internal
+ RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
+ // unavailable
+ RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
+ // data_loss
+ RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
+ // unauthenticated
+ RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
+)
+
+var (
+ // OK
+ RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
+ // CANCELLED
+ RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
+ // UNKNOWN
+ RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
+ // INVALID_ARGUMENT
+ RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
+ // DEADLINE_EXCEEDED
+ RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
+ // NOT_FOUND
+ RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
+ // ALREADY_EXISTS
+ RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
+ // PERMISSION_DENIED
+ RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
+ // RESOURCE_EXHAUSTED
+ RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
+ // FAILED_PRECONDITION
+ RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
+ // ABORTED
+ RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
+ // OUT_OF_RANGE
+ RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
+ // UNIMPLEMENTED
+ RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
+ // INTERNAL
+ RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
+ // UNAVAILABLE
+ RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
+ // DATA_LOSS
+ RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
+ // UNAUTHENTICATED
+ RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
+)
+
+var (
+ // sent
+ RPCMessageTypeSent = RPCMessageTypeKey.String("SENT")
+ // received
+ RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED")
+)
+
+var (
+ // gRPC
+ RPCSystemGRPC = RPCSystemKey.String("grpc")
+ // Java RMI
+ RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
+ // .NET WCF
+ RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
+ // Apache Dubbo
+ RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
+ // Connect RPC
+ RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
+)
+
+// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_code" semantic conventions. It represents the
+// `error.code` property of response if it is an error response.
+func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
+ return RPCJsonrpcErrorCodeKey.Int(val)
+}
+
+// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_message" semantic conventions. It represents the
+// `error.message` property of response if it is an error response.
+func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
+ return RPCJsonrpcErrorMessageKey.String(val)
+}
+
+// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+// property of request or response. Since protocol allows id to be int, string,
+// `null` or missing (for notifications), value is expected to be cast to
+// string for simplicity. Use empty string in case of `null` value. Omit
+// entirely if this is a notification.
+func RPCJsonrpcRequestID(val string) attribute.KeyValue {
+ return RPCJsonrpcRequestIDKey.String(val)
+}
+
+// RPCJsonrpcVersion returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+// doesn't specify this, the value can be omitted.
+func RPCJsonrpcVersion(val string) attribute.KeyValue {
+ return RPCJsonrpcVersionKey.String(val)
+}
+
+// RPCMessageCompressedSize returns an attribute KeyValue conforming to the
+// "rpc.message.compressed_size" semantic conventions. It represents the
+// compressed size of the message in bytes.
+func RPCMessageCompressedSize(val int) attribute.KeyValue {
+ return RPCMessageCompressedSizeKey.Int(val)
+}
+
+// RPCMessageID returns an attribute KeyValue conforming to the
+// "rpc.message.id" semantic conventions. It represents the mUST be calculated
+// as two different counters starting from `1` one for sent messages and one
+// for received message.
+func RPCMessageID(val int) attribute.KeyValue {
+ return RPCMessageIDKey.Int(val)
+}
+
+// RPCMessageUncompressedSize returns an attribute KeyValue conforming to
+// the "rpc.message.uncompressed_size" semantic conventions. It represents the
+// uncompressed size of the message in bytes.
+func RPCMessageUncompressedSize(val int) attribute.KeyValue {
+ return RPCMessageUncompressedSizeKey.Int(val)
+}
+
+// RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
+// semantic conventions. It represents the name of the (logical) method being
+// called, must be equal to the $method part in the span name.
+func RPCMethod(val string) attribute.KeyValue {
+ return RPCMethodKey.String(val)
+}
+
+// RPCService returns an attribute KeyValue conforming to the "rpc.service"
+// semantic conventions. It represents the full (logical) name of the service
+// being called, including its package name, if applicable.
+func RPCService(val string) attribute.KeyValue {
+ return RPCServiceKey.String(val)
+}
+
+// These attributes may be used to describe the server in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ServerAddressKey is the attribute Key conforming to the "server.address"
+ // semantic conventions. It represents the server domain name if available
+ // without reverse DNS lookup; otherwise, IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.address` SHOULD represent the server address
+ // behind any intermediaries, for example proxies, if it's available.
+ ServerAddressKey = attribute.Key("server.address")
+
+ // ServerPortKey is the attribute Key conforming to the "server.port"
+ // semantic conventions. It represents the server port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.port` SHOULD represent the server port behind
+ // any intermediaries, for example proxies, if it's available.
+ ServerPortKey = attribute.Key("server.port")
+)
+
+// ServerAddress returns an attribute KeyValue conforming to the
+// "server.address" semantic conventions. It represents the server domain name
+// if available without reverse DNS lookup; otherwise, IP address or Unix
+// domain socket name.
+func ServerAddress(val string) attribute.KeyValue {
+ return ServerAddressKey.String(val)
+}
+
+// ServerPort returns an attribute KeyValue conforming to the "server.port"
+// semantic conventions. It represents the server port number.
+func ServerPort(val int) attribute.KeyValue {
+ return ServerPortKey.Int(val)
+}
+
+// A service instance.
+const (
+ // ServiceInstanceIDKey is the attribute Key conforming to the
+ // "service.instance.id" semantic conventions. It represents the string ID
+ // of the service instance.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '627cc493-f310-47de-96bd-71410b7dec09'
+ // Note: MUST be unique for each instance of the same
+ // `service.namespace,service.name` pair (in other words
+ // `service.namespace,service.name,service.instance.id` triplet MUST be
+ // globally unique). The ID helps to
+ // distinguish instances of the same service that exist at the same time
+ // (e.g. instances of a horizontally scaled
+ // service).
+ //
+ // Implementations, such as SDKs, are recommended to generate a random
+ // Version 1 or Version 4 [RFC
+ // 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an
+ // inherent unique ID as the source of
+ // this value if stability is desirable. In that case, the ID SHOULD be
+ // used as source of a UUID Version 5 and
+ // SHOULD use the following UUID as the namespace:
+ // `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.
+ //
+ // UUIDs are typically recommended, as only an opaque value for the
+ // purposes of identifying a service instance is
+ // needed. Similar to what can be seen in the man page for the
+ // [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/machine-id.html)
+ // file, the underlying
+ // data, such as pod name and namespace should be treated as confidential,
+ // being the user's choice to expose it
+ // or not via another resource attribute.
+ //
+ // For applications running behind an application server (like unicorn), we
+ // do not recommend using one identifier
+ // for all processes participating in the application. Instead, it's
+ // recommended each division (e.g. a worker
+ // thread in unicorn) to have its own instance.id.
+ //
+ // It's not recommended for a Collector to set `service.instance.id` if it
+ // can't unambiguously determine the
+ // service instance that is generating that telemetry. For instance,
+ // creating an UUID based on `pod.name` will
+ // likely be wrong, as the Collector might not know from which container
+ // within that pod the telemetry originated.
+ // However, Collectors can set the `service.instance.id` if they can
+ // unambiguously determine the service instance
+ // for that telemetry. This is typically the case for scraping receivers,
+ // as they know the target address and
+ // port.
+ ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceNameKey is the attribute Key conforming to the "service.name"
+ // semantic conventions. It represents the logical name of the service.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'shoppingcart'
+ // Note: MUST be the same for all instances of horizontally scaled
+ // services. If the value was not specified, SDKs MUST fallback to
+ // `unknown_service:` concatenated with
+ // [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If
+ // `process.executable.name` is not available, the value MUST be set to
+ // `unknown_service`.
+ ServiceNameKey = attribute.Key("service.name")
+
+ // ServiceNamespaceKey is the attribute Key conforming to the
+ // "service.namespace" semantic conventions. It represents a namespace for
+ // `service.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Shop'
+ // Note: A string value having a meaning that helps to distinguish a group
+ // of services, for example the team name that owns a group of services.
+ // `service.name` is expected to be unique within the same namespace. If
+ // `service.namespace` is not specified in the Resource then `service.name`
+ // is expected to be unique for all services that have no explicit
+ // namespace defined (so the empty/unspecified namespace is simply one more
+ // valid namespace). Zero-length namespace string is assumed equal to
+ // unspecified namespace.
+ ServiceNamespaceKey = attribute.Key("service.namespace")
+
+ // ServiceVersionKey is the attribute Key conforming to the
+ // "service.version" semantic conventions. It represents the version string
+ // of the service API or implementation. The format is not defined by these
+ // conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '2.0.0', 'a01dbef8a'
+ ServiceVersionKey = attribute.Key("service.version")
+)
+
+// ServiceInstanceID returns an attribute KeyValue conforming to the
+// "service.instance.id" semantic conventions. It represents the string ID of
+// the service instance.
+func ServiceInstanceID(val string) attribute.KeyValue {
+ return ServiceInstanceIDKey.String(val)
+}
+
+// ServiceName returns an attribute KeyValue conforming to the
+// "service.name" semantic conventions. It represents the logical name of the
+// service.
+func ServiceName(val string) attribute.KeyValue {
+ return ServiceNameKey.String(val)
+}
+
+// ServiceNamespace returns an attribute KeyValue conforming to the
+// "service.namespace" semantic conventions. It represents a namespace for
+// `service.name`.
+func ServiceNamespace(val string) attribute.KeyValue {
+ return ServiceNamespaceKey.String(val)
+}
+
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation. The format is not defined by these
+// conventions.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
+// Session is defined as the period of time encompassing all activities
+// performed by the application and the actions executed by the end user.
+// Consequently, a Session is represented as a collection of Logs, Events, and
+// Spans emitted by the Client Application throughout the Session's duration.
+// Each Session is assigned a unique identifier, which is included as an
+// attribute in the Logs, Events, and Spans generated during the Session's
+// lifecycle.
+// When a session reaches end of life, typically due to user inactivity or
+// session timeout, a new session identifier will be assigned. The previous
+// session identifier may be provided by the instrumentation so that telemetry
+// backends can link the two sessions.
+const (
+ // SessionIDKey is the attribute Key conforming to the "session.id"
+ // semantic conventions. It represents a unique id to identify a session.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionIDKey = attribute.Key("session.id")
+
+ // SessionPreviousIDKey is the attribute Key conforming to the
+ // "session.previous_id" semantic conventions. It represents the previous
+ // `session.id` for this user, when known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionPreviousIDKey = attribute.Key("session.previous_id")
+)
+
+// SessionID returns an attribute KeyValue conforming to the "session.id"
+// semantic conventions. It represents a unique id to identify a session.
+func SessionID(val string) attribute.KeyValue {
+ return SessionIDKey.String(val)
+}
+
+// SessionPreviousID returns an attribute KeyValue conforming to the
+// "session.previous_id" semantic conventions. It represents the previous
+// `session.id` for this user, when known.
+func SessionPreviousID(val string) attribute.KeyValue {
+ return SessionPreviousIDKey.String(val)
+}
+
+// SignalR attributes
+const (
+ // SignalrConnectionStatusKey is the attribute Key conforming to the
+ // "signalr.connection.status" semantic conventions. It represents the
+ // signalR HTTP connection closure status.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'app_shutdown', 'timeout'
+ SignalrConnectionStatusKey = attribute.Key("signalr.connection.status")
+
+ // SignalrTransportKey is the attribute Key conforming to the
+ // "signalr.transport" semantic conventions. It represents the [SignalR
+ // transport
+ // type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'web_sockets', 'long_polling'
+ SignalrTransportKey = attribute.Key("signalr.transport")
+)
+
+var (
+ // The connection was closed normally
+ SignalrConnectionStatusNormalClosure = SignalrConnectionStatusKey.String("normal_closure")
+ // The connection was closed due to a timeout
+ SignalrConnectionStatusTimeout = SignalrConnectionStatusKey.String("timeout")
+ // The connection was closed because the app is shutting down
+ SignalrConnectionStatusAppShutdown = SignalrConnectionStatusKey.String("app_shutdown")
+)
+
+var (
+ // ServerSentEvents protocol
+ SignalrTransportServerSentEvents = SignalrTransportKey.String("server_sent_events")
+ // LongPolling protocol
+ SignalrTransportLongPolling = SignalrTransportKey.String("long_polling")
+ // WebSockets protocol
+ SignalrTransportWebSockets = SignalrTransportKey.String("web_sockets")
+)
+
+// These attributes may be used to describe the sender of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // SourceAddressKey is the attribute Key conforming to the "source.address"
+ // semantic conventions. It represents the source address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'source.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the destination side, and when communicating
+ // through an intermediary, `source.address` SHOULD represent the source
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ SourceAddressKey = attribute.Key("source.address")
+
+ // SourcePortKey is the attribute Key conforming to the "source.port"
+ // semantic conventions. It represents the source port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ SourcePortKey = attribute.Key("source.port")
+)
+
+// SourceAddress returns an attribute KeyValue conforming to the
+// "source.address" semantic conventions. It represents the source address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func SourceAddress(val string) attribute.KeyValue {
+ return SourceAddressKey.String(val)
+}
+
+// SourcePort returns an attribute KeyValue conforming to the "source.port"
+// semantic conventions. It represents the source port number
+func SourcePort(val int) attribute.KeyValue {
+ return SourcePortKey.Int(val)
+}
+
+// Describes System attributes
+const (
+ // SystemDeviceKey is the attribute Key conforming to the "system.device"
+ // semantic conventions. It represents the device identifier
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '(identifier)'
+ SystemDeviceKey = attribute.Key("system.device")
+)
+
+// SystemDevice returns an attribute KeyValue conforming to the
+// "system.device" semantic conventions. It represents the device identifier
+func SystemDevice(val string) attribute.KeyValue {
+ return SystemDeviceKey.String(val)
+}
+
+// Describes System CPU attributes
+const (
+ // SystemCPULogicalNumberKey is the attribute Key conforming to the
+ // "system.cpu.logical_number" semantic conventions. It represents the
+ // logical CPU number [0..n-1]
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1
+ SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number")
+
+ // SystemCPUStateKey is the attribute Key conforming to the
+ // "system.cpu.state" semantic conventions. It represents the state of the
+ // CPU
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle', 'interrupt'
+ SystemCPUStateKey = attribute.Key("system.cpu.state")
+)
+
+var (
+ // user
+ SystemCPUStateUser = SystemCPUStateKey.String("user")
+ // system
+ SystemCPUStateSystem = SystemCPUStateKey.String("system")
+ // nice
+ SystemCPUStateNice = SystemCPUStateKey.String("nice")
+ // idle
+ SystemCPUStateIdle = SystemCPUStateKey.String("idle")
+ // iowait
+ SystemCPUStateIowait = SystemCPUStateKey.String("iowait")
+ // interrupt
+ SystemCPUStateInterrupt = SystemCPUStateKey.String("interrupt")
+ // steal
+ SystemCPUStateSteal = SystemCPUStateKey.String("steal")
+)
+
+// SystemCPULogicalNumber returns an attribute KeyValue conforming to the
+// "system.cpu.logical_number" semantic conventions. It represents the logical
+// CPU number [0..n-1]
+func SystemCPULogicalNumber(val int) attribute.KeyValue {
+ return SystemCPULogicalNumberKey.Int(val)
+}
+
+// Describes System Memory attributes
+const (
+ // SystemMemoryStateKey is the attribute Key conforming to the
+ // "system.memory.state" semantic conventions. It represents the memory
+ // state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free', 'cached'
+ SystemMemoryStateKey = attribute.Key("system.memory.state")
+)
+
+var (
+ // used
+ SystemMemoryStateUsed = SystemMemoryStateKey.String("used")
+ // free
+ SystemMemoryStateFree = SystemMemoryStateKey.String("free")
+ // shared
+ SystemMemoryStateShared = SystemMemoryStateKey.String("shared")
+ // buffers
+ SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers")
+ // cached
+ SystemMemoryStateCached = SystemMemoryStateKey.String("cached")
+)
+
+// Describes System Memory Paging attributes
+const (
+ // SystemPagingDirectionKey is the attribute Key conforming to the
+ // "system.paging.direction" semantic conventions. It represents the paging
+ // access direction
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'in'
+ SystemPagingDirectionKey = attribute.Key("system.paging.direction")
+
+ // SystemPagingStateKey is the attribute Key conforming to the
+ // "system.paging.state" semantic conventions. It represents the memory
+ // paging state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free'
+ SystemPagingStateKey = attribute.Key("system.paging.state")
+
+ // SystemPagingTypeKey is the attribute Key conforming to the
+ // "system.paging.type" semantic conventions. It represents the memory
+ // paging type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'minor'
+ SystemPagingTypeKey = attribute.Key("system.paging.type")
+)
+
+var (
+ // in
+ SystemPagingDirectionIn = SystemPagingDirectionKey.String("in")
+ // out
+ SystemPagingDirectionOut = SystemPagingDirectionKey.String("out")
+)
+
+var (
+ // used
+ SystemPagingStateUsed = SystemPagingStateKey.String("used")
+ // free
+ SystemPagingStateFree = SystemPagingStateKey.String("free")
+)
+
+var (
+ // major
+ SystemPagingTypeMajor = SystemPagingTypeKey.String("major")
+ // minor
+ SystemPagingTypeMinor = SystemPagingTypeKey.String("minor")
+)
+
+// Describes Filesystem attributes
+const (
+ // SystemFilesystemModeKey is the attribute Key conforming to the
+ // "system.filesystem.mode" semantic conventions. It represents the
+ // filesystem mode
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'rw, ro'
+ SystemFilesystemModeKey = attribute.Key("system.filesystem.mode")
+
+ // SystemFilesystemMountpointKey is the attribute Key conforming to the
+ // "system.filesystem.mountpoint" semantic conventions. It represents the
+ // filesystem mount path
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/mnt/data'
+ SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint")
+
+ // SystemFilesystemStateKey is the attribute Key conforming to the
+ // "system.filesystem.state" semantic conventions. It represents the
+ // filesystem state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'used'
+ SystemFilesystemStateKey = attribute.Key("system.filesystem.state")
+
+ // SystemFilesystemTypeKey is the attribute Key conforming to the
+ // "system.filesystem.type" semantic conventions. It represents the
+ // filesystem type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ext4'
+ SystemFilesystemTypeKey = attribute.Key("system.filesystem.type")
+)
+
+var (
+ // used
+ SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used")
+ // free
+ SystemFilesystemStateFree = SystemFilesystemStateKey.String("free")
+ // reserved
+ SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved")
+)
+
+var (
+ // fat32
+ SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32")
+ // exfat
+ SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat")
+ // ntfs
+ SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs")
+ // refs
+ SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs")
+ // hfsplus
+ SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus")
+ // ext4
+ SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4")
+)
+
+// SystemFilesystemMode returns an attribute KeyValue conforming to the
+// "system.filesystem.mode" semantic conventions. It represents the filesystem
+// mode
+func SystemFilesystemMode(val string) attribute.KeyValue {
+ return SystemFilesystemModeKey.String(val)
+}
+
+// SystemFilesystemMountpoint returns an attribute KeyValue conforming to
+// the "system.filesystem.mountpoint" semantic conventions. It represents the
+// filesystem mount path
+func SystemFilesystemMountpoint(val string) attribute.KeyValue {
+ return SystemFilesystemMountpointKey.String(val)
+}
+
+// Describes Network attributes
+const (
+ // SystemNetworkStateKey is the attribute Key conforming to the
+ // "system.network.state" semantic conventions. It represents a stateless
+ // protocol MUST NOT set this attribute
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'close_wait'
+ SystemNetworkStateKey = attribute.Key("system.network.state")
+)
+
+var (
+ // close
+ SystemNetworkStateClose = SystemNetworkStateKey.String("close")
+ // close_wait
+ SystemNetworkStateCloseWait = SystemNetworkStateKey.String("close_wait")
+ // closing
+ SystemNetworkStateClosing = SystemNetworkStateKey.String("closing")
+ // delete
+ SystemNetworkStateDelete = SystemNetworkStateKey.String("delete")
+ // established
+ SystemNetworkStateEstablished = SystemNetworkStateKey.String("established")
+ // fin_wait_1
+ SystemNetworkStateFinWait1 = SystemNetworkStateKey.String("fin_wait_1")
+ // fin_wait_2
+ SystemNetworkStateFinWait2 = SystemNetworkStateKey.String("fin_wait_2")
+ // last_ack
+ SystemNetworkStateLastAck = SystemNetworkStateKey.String("last_ack")
+ // listen
+ SystemNetworkStateListen = SystemNetworkStateKey.String("listen")
+ // syn_recv
+ SystemNetworkStateSynRecv = SystemNetworkStateKey.String("syn_recv")
+ // syn_sent
+ SystemNetworkStateSynSent = SystemNetworkStateKey.String("syn_sent")
+ // time_wait
+ SystemNetworkStateTimeWait = SystemNetworkStateKey.String("time_wait")
+)
+
+// Describes System Process attributes
+const (
+ // SystemProcessStatusKey is the attribute Key conforming to the
+ // "system.process.status" semantic conventions. It represents the process
+ // state, e.g., [Linux Process State
+ // Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'running'
+ SystemProcessStatusKey = attribute.Key("system.process.status")
+)
+
+var (
+ // running
+ SystemProcessStatusRunning = SystemProcessStatusKey.String("running")
+ // sleeping
+ SystemProcessStatusSleeping = SystemProcessStatusKey.String("sleeping")
+ // stopped
+ SystemProcessStatusStopped = SystemProcessStatusKey.String("stopped")
+ // defunct
+ SystemProcessStatusDefunct = SystemProcessStatusKey.String("defunct")
+)
+
+// Attributes for telemetry SDK.
+const (
+ // TelemetrySDKLanguageKey is the attribute Key conforming to the
+ // "telemetry.sdk.language" semantic conventions. It represents the
+ // language of the telemetry SDK.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
+
+ // TelemetrySDKNameKey is the attribute Key conforming to the
+ // "telemetry.sdk.name" semantic conventions. It represents the name of the
+ // telemetry SDK as defined above.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'opentelemetry'
+ // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute
+ // to `opentelemetry`.
+ // If another SDK, like a fork or a vendor-provided implementation, is
+ // used, this SDK MUST set the
+ // `telemetry.sdk.name` attribute to the fully-qualified class or module
+ // name of this SDK's main entry point
+ // or another suitable identifier depending on the language.
+ // The identifier `opentelemetry` is reserved and MUST NOT be used in this
+ // case.
+ // All custom identifiers SHOULD be stable across different versions of an
+ // implementation.
+ TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
+
+ // TelemetrySDKVersionKey is the attribute Key conforming to the
+ // "telemetry.sdk.version" semantic conventions. It represents the version
+ // string of the telemetry SDK.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: '1.2.3'
+ TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
+
+ // TelemetryDistroNameKey is the attribute Key conforming to the
+ // "telemetry.distro.name" semantic conventions. It represents the name of
+ // the auto instrumentation agent or distribution, if used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'parts-unlimited-java'
+ // Note: Official auto instrumentation agents and distributions SHOULD set
+ // the `telemetry.distro.name` attribute to
+ // a string starting with `opentelemetry-`, e.g.
+ // `opentelemetry-java-instrumentation`.
+ TelemetryDistroNameKey = attribute.Key("telemetry.distro.name")
+
+ // TelemetryDistroVersionKey is the attribute Key conforming to the
+ // "telemetry.distro.version" semantic conventions. It represents the
+ // version string of the auto instrumentation agent or distribution, if
+ // used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2.3'
+ TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version")
+)
+
+var (
+ // cpp
+ TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp")
+ // dotnet
+ TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet")
+ // erlang
+ TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang")
+ // go
+ TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go")
+ // java
+ TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java")
+ // nodejs
+ TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs")
+ // php
+ TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php")
+ // python
+ TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
+ // ruby
+ TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
+ // rust
+ TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
+ // swift
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
+ // webjs
+ TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs")
+)
+
+// TelemetrySDKName returns an attribute KeyValue conforming to the
+// "telemetry.sdk.name" semantic conventions. It represents the name of the
+// telemetry SDK as defined above.
+func TelemetrySDKName(val string) attribute.KeyValue {
+ return TelemetrySDKNameKey.String(val)
+}
+
+// TelemetrySDKVersion returns an attribute KeyValue conforming to the
+// "telemetry.sdk.version" semantic conventions. It represents the version
+// string of the telemetry SDK.
+func TelemetrySDKVersion(val string) attribute.KeyValue {
+ return TelemetrySDKVersionKey.String(val)
+}
+
+// TelemetryDistroName returns an attribute KeyValue conforming to the
+// "telemetry.distro.name" semantic conventions. It represents the name of the
+// auto instrumentation agent or distribution, if used.
+func TelemetryDistroName(val string) attribute.KeyValue {
+ return TelemetryDistroNameKey.String(val)
+}
+
+// TelemetryDistroVersion returns an attribute KeyValue conforming to the
+// "telemetry.distro.version" semantic conventions. It represents the version
+// string of the auto instrumentation agent or distribution, if used.
+func TelemetryDistroVersion(val string) attribute.KeyValue {
+ return TelemetryDistroVersionKey.String(val)
+}
+
+// These attributes may be used for any operation to store information about a
+// thread that started a span.
+const (
+ // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
+ // conventions. It represents the current "managed" thread ID (as opposed
+ // to OS thread ID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ ThreadIDKey = attribute.Key("thread.id")
+
+ // ThreadNameKey is the attribute Key conforming to the "thread.name"
+ // semantic conventions. It represents the current thread name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'main'
+ ThreadNameKey = attribute.Key("thread.name")
+)
+
+// ThreadID returns an attribute KeyValue conforming to the "thread.id"
+// semantic conventions. It represents the current "managed" thread ID (as
+// opposed to OS thread ID).
+func ThreadID(val int) attribute.KeyValue {
+ return ThreadIDKey.Int(val)
+}
+
+// ThreadName returns an attribute KeyValue conforming to the "thread.name"
+// semantic conventions. It represents the current thread name.
+func ThreadName(val string) attribute.KeyValue {
+ return ThreadNameKey.String(val)
+}
+
+// Semantic convention attributes in the TLS namespace.
+const (
+ // TLSCipherKey is the attribute Key conforming to the "tls.cipher"
+ // semantic conventions. It represents the string indicating the
+ // [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5)
+ // used during the current connection.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TLS_RSA_WITH_3DES_EDE_CBC_SHA',
+ // 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256'
+ // Note: The values allowed for `tls.cipher` MUST be one of the
+ // `Descriptions` of the [registered TLS Cipher
+ // Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4).
+ TLSCipherKey = attribute.Key("tls.cipher")
+
+ // TLSClientCertificateKey is the attribute Key conforming to the
+ // "tls.client.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the client. This is
+ // usually mutually-exclusive of `client.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSClientCertificateKey = attribute.Key("tls.client.certificate")
+
+ // TLSClientCertificateChainKey is the attribute Key conforming to the
+ // "tls.client.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the client. This is usually mutually-exclusive of
+ // `client.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain")
+
+ // TLSClientHashMd5Key is the attribute Key conforming to the
+ // "tls.client.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5")
+
+ // TLSClientHashSha1Key is the attribute Key conforming to the
+ // "tls.client.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1")
+
+ // TLSClientHashSha256Key is the attribute Key conforming to the
+ // "tls.client.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256")
+
+ // TLSClientIssuerKey is the attribute Key conforming to the
+ // "tls.client.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSClientIssuerKey = attribute.Key("tls.client.issuer")
+
+ // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3"
+ // semantic conventions. It represents a hash that identifies clients based
+ // on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSClientJa3Key = attribute.Key("tls.client.ja3")
+
+ // TLSClientNotAfterKey is the attribute Key conforming to the
+ // "tls.client.not_after" semantic conventions. It represents the date/Time
+ // indicating when client certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSClientNotAfterKey = attribute.Key("tls.client.not_after")
+
+ // TLSClientNotBeforeKey is the attribute Key conforming to the
+ // "tls.client.not_before" semantic conventions. It represents the
+ // date/Time indicating when client certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSClientNotBeforeKey = attribute.Key("tls.client.not_before")
+
+ // TLSClientServerNameKey is the attribute Key conforming to the
+ // "tls.client.server_name" semantic conventions. It represents the also
+ // called an SNI, this tells the server which hostname to which the client
+ // is attempting to connect to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry.io'
+ TLSClientServerNameKey = attribute.Key("tls.client.server_name")
+
+ // TLSClientSubjectKey is the attribute Key conforming to the
+ // "tls.client.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myclient, OU=Documentation Team, DC=example, DC=com'
+ TLSClientSubjectKey = attribute.Key("tls.client.subject")
+
+ // TLSClientSupportedCiphersKey is the attribute Key conforming to the
+ // "tls.client.supported_ciphers" semantic conventions. It represents the
+ // array of ciphers offered by the client during the client hello.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+ // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."'
+ TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers")
+
+ // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic
+ // conventions. It represents the string indicating the curve used for the
+ // given cipher, when applicable
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'secp256r1'
+ TLSCurveKey = attribute.Key("tls.curve")
+
+ // TLSEstablishedKey is the attribute Key conforming to the
+ // "tls.established" semantic conventions. It represents the boolean flag
+ // indicating if the TLS negotiation was successful and transitioned to an
+ // encrypted tunnel.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSEstablishedKey = attribute.Key("tls.established")
+
+ // TLSNextProtocolKey is the attribute Key conforming to the
+ // "tls.next_protocol" semantic conventions. It represents the string
+ // indicating the protocol being tunneled. Per the values in the [IANA
+ // registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+ // this string should be lower case.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'http/1.1'
+ TLSNextProtocolKey = attribute.Key("tls.next_protocol")
+
+ // TLSProtocolNameKey is the attribute Key conforming to the
+ // "tls.protocol.name" semantic conventions. It represents the normalized
+ // lowercase protocol name parsed from original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ TLSProtocolNameKey = attribute.Key("tls.protocol.name")
+
+ // TLSProtocolVersionKey is the attribute Key conforming to the
+ // "tls.protocol.version" semantic conventions. It represents the numeric
+ // part of the version parsed from the original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2', '3'
+ TLSProtocolVersionKey = attribute.Key("tls.protocol.version")
+
+ // TLSResumedKey is the attribute Key conforming to the "tls.resumed"
+ // semantic conventions. It represents the boolean flag indicating if this
+ // TLS connection was resumed from an existing TLS negotiation.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSResumedKey = attribute.Key("tls.resumed")
+
+ // TLSServerCertificateKey is the attribute Key conforming to the
+ // "tls.server.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the server. This is
+ // usually mutually-exclusive of `server.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSServerCertificateKey = attribute.Key("tls.server.certificate")
+
+ // TLSServerCertificateChainKey is the attribute Key conforming to the
+ // "tls.server.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the server. This is usually mutually-exclusive of
+ // `server.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain")
+
+ // TLSServerHashMd5Key is the attribute Key conforming to the
+ // "tls.server.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5")
+
+ // TLSServerHashSha1Key is the attribute Key conforming to the
+ // "tls.server.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1")
+
+ // TLSServerHashSha256Key is the attribute Key conforming to the
+ // "tls.server.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256")
+
+ // TLSServerIssuerKey is the attribute Key conforming to the
+ // "tls.server.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSServerIssuerKey = attribute.Key("tls.server.issuer")
+
+ // TLSServerJa3sKey is the attribute Key conforming to the
+ // "tls.server.ja3s" semantic conventions. It represents a hash that
+ // identifies servers based on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSServerJa3sKey = attribute.Key("tls.server.ja3s")
+
+ // TLSServerNotAfterKey is the attribute Key conforming to the
+ // "tls.server.not_after" semantic conventions. It represents the date/Time
+ // indicating when server certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSServerNotAfterKey = attribute.Key("tls.server.not_after")
+
+ // TLSServerNotBeforeKey is the attribute Key conforming to the
+ // "tls.server.not_before" semantic conventions. It represents the
+ // date/Time indicating when server certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSServerNotBeforeKey = attribute.Key("tls.server.not_before")
+
+ // TLSServerSubjectKey is the attribute Key conforming to the
+ // "tls.server.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // server.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myserver, OU=Documentation Team, DC=example, DC=com'
+ TLSServerSubjectKey = attribute.Key("tls.server.subject")
+)
+
+var (
+ // ssl
+ TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl")
+ // tls
+ TLSProtocolNameTLS = TLSProtocolNameKey.String("tls")
+)
+
+// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher"
+// semantic conventions. It represents the string indicating the
+// [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used
+// during the current connection.
+func TLSCipher(val string) attribute.KeyValue {
+ return TLSCipherKey.String(val)
+}
+
+// TLSClientCertificate returns an attribute KeyValue conforming to the
+// "tls.client.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the client. This is usually
+// mutually-exclusive of `client.certificate_chain` since this value also
+// exists in that list.
+func TLSClientCertificate(val string) attribute.KeyValue {
+ return TLSClientCertificateKey.String(val)
+}
+
+// TLSClientCertificateChain returns an attribute KeyValue conforming to the
+// "tls.client.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the client. This is usually mutually-exclusive of `client.certificate` since
+// that value should be the first certificate in the chain.
+func TLSClientCertificateChain(val ...string) attribute.KeyValue {
+ return TLSClientCertificateChainKey.StringSlice(val)
+}
+
+// TLSClientHashMd5 returns an attribute KeyValue conforming to the
+// "tls.client.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashMd5(val string) attribute.KeyValue {
+ return TLSClientHashMd5Key.String(val)
+}
+
+// TLSClientHashSha1 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha1(val string) attribute.KeyValue {
+ return TLSClientHashSha1Key.String(val)
+}
+
+// TLSClientHashSha256 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha256(val string) attribute.KeyValue {
+ return TLSClientHashSha256Key.String(val)
+}
+
+// TLSClientIssuer returns an attribute KeyValue conforming to the
+// "tls.client.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSClientIssuer(val string) attribute.KeyValue {
+ return TLSClientIssuerKey.String(val)
+}
+
+// TLSClientJa3 returns an attribute KeyValue conforming to the
+// "tls.client.ja3" semantic conventions. It represents a hash that identifies
+// clients based on how they perform an SSL/TLS handshake.
+func TLSClientJa3(val string) attribute.KeyValue {
+ return TLSClientJa3Key.String(val)
+}
+
+// TLSClientNotAfter returns an attribute KeyValue conforming to the
+// "tls.client.not_after" semantic conventions. It represents the date/Time
+// indicating when client certificate is no longer considered valid.
+func TLSClientNotAfter(val string) attribute.KeyValue {
+ return TLSClientNotAfterKey.String(val)
+}
+
+// TLSClientNotBefore returns an attribute KeyValue conforming to the
+// "tls.client.not_before" semantic conventions. It represents the date/Time
+// indicating when client certificate is first considered valid.
+func TLSClientNotBefore(val string) attribute.KeyValue {
+ return TLSClientNotBeforeKey.String(val)
+}
+
+// TLSClientServerName returns an attribute KeyValue conforming to the
+// "tls.client.server_name" semantic conventions. It represents the also called
+// an SNI, this tells the server which hostname to which the client is
+// attempting to connect to.
+func TLSClientServerName(val string) attribute.KeyValue {
+ return TLSClientServerNameKey.String(val)
+}
+
+// TLSClientSubject returns an attribute KeyValue conforming to the
+// "tls.client.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the client.
+func TLSClientSubject(val string) attribute.KeyValue {
+ return TLSClientSubjectKey.String(val)
+}
+
+// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the
+// "tls.client.supported_ciphers" semantic conventions. It represents the array
+// of ciphers offered by the client during the client hello.
+func TLSClientSupportedCiphers(val ...string) attribute.KeyValue {
+ return TLSClientSupportedCiphersKey.StringSlice(val)
+}
+
+// TLSCurve returns an attribute KeyValue conforming to the "tls.curve"
+// semantic conventions. It represents the string indicating the curve used for
+// the given cipher, when applicable
+func TLSCurve(val string) attribute.KeyValue {
+ return TLSCurveKey.String(val)
+}
+
+// TLSEstablished returns an attribute KeyValue conforming to the
+// "tls.established" semantic conventions. It represents the boolean flag
+// indicating if the TLS negotiation was successful and transitioned to an
+// encrypted tunnel.
+func TLSEstablished(val bool) attribute.KeyValue {
+ return TLSEstablishedKey.Bool(val)
+}
+
+// TLSNextProtocol returns an attribute KeyValue conforming to the
+// "tls.next_protocol" semantic conventions. It represents the string
+// indicating the protocol being tunneled. Per the values in the [IANA
+// registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+// this string should be lower case.
+func TLSNextProtocol(val string) attribute.KeyValue {
+ return TLSNextProtocolKey.String(val)
+}
+
+// TLSProtocolVersion returns an attribute KeyValue conforming to the
+// "tls.protocol.version" semantic conventions. It represents the numeric part
+// of the version parsed from the original string of the negotiated [SSL/TLS
+// protocol
+// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+func TLSProtocolVersion(val string) attribute.KeyValue {
+ return TLSProtocolVersionKey.String(val)
+}
+
+// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed"
+// semantic conventions. It represents the boolean flag indicating if this TLS
+// connection was resumed from an existing TLS negotiation.
+func TLSResumed(val bool) attribute.KeyValue {
+ return TLSResumedKey.Bool(val)
+}
+
+// TLSServerCertificate returns an attribute KeyValue conforming to the
+// "tls.server.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the server. This is usually
+// mutually-exclusive of `server.certificate_chain` since this value also
+// exists in that list.
+func TLSServerCertificate(val string) attribute.KeyValue {
+ return TLSServerCertificateKey.String(val)
+}
+
+// TLSServerCertificateChain returns an attribute KeyValue conforming to the
+// "tls.server.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the server. This is usually mutually-exclusive of `server.certificate` since
+// that value should be the first certificate in the chain.
+func TLSServerCertificateChain(val ...string) attribute.KeyValue {
+ return TLSServerCertificateChainKey.StringSlice(val)
+}
+
+// TLSServerHashMd5 returns an attribute KeyValue conforming to the
+// "tls.server.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashMd5(val string) attribute.KeyValue {
+ return TLSServerHashMd5Key.String(val)
+}
+
+// TLSServerHashSha1 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha1(val string) attribute.KeyValue {
+ return TLSServerHashSha1Key.String(val)
+}
+
+// TLSServerHashSha256 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha256(val string) attribute.KeyValue {
+ return TLSServerHashSha256Key.String(val)
+}
+
+// TLSServerIssuer returns an attribute KeyValue conforming to the
+// "tls.server.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSServerIssuer(val string) attribute.KeyValue {
+ return TLSServerIssuerKey.String(val)
+}
+
+// TLSServerJa3s returns an attribute KeyValue conforming to the
+// "tls.server.ja3s" semantic conventions. It represents a hash that identifies
+// servers based on how they perform an SSL/TLS handshake.
+func TLSServerJa3s(val string) attribute.KeyValue {
+ return TLSServerJa3sKey.String(val)
+}
+
+// TLSServerNotAfter returns an attribute KeyValue conforming to the
+// "tls.server.not_after" semantic conventions. It represents the date/Time
+// indicating when server certificate is no longer considered valid.
+func TLSServerNotAfter(val string) attribute.KeyValue {
+ return TLSServerNotAfterKey.String(val)
+}
+
+// TLSServerNotBefore returns an attribute KeyValue conforming to the
+// "tls.server.not_before" semantic conventions. It represents the date/Time
+// indicating when server certificate is first considered valid.
+func TLSServerNotBefore(val string) attribute.KeyValue {
+ return TLSServerNotBeforeKey.String(val)
+}
+
+// TLSServerSubject returns an attribute KeyValue conforming to the
+// "tls.server.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the server.
+func TLSServerSubject(val string) attribute.KeyValue {
+ return TLSServerSubjectKey.String(val)
+}
+
+// Attributes describing URL.
+const (
+ // URLDomainKey is the attribute Key conforming to the "url.domain"
+ // semantic conventions. It represents the domain extracted from the
+ // `url.full`, such as "opentelemetry.io".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'www.foo.bar', 'opentelemetry.io', '3.12.167.2',
+ // '[1080:0:0:0:8:800:200C:417A]'
+ // Note: In some cases a URL may refer to an IP and/or port directly,
+ // without a domain name. In this case, the IP address would go to the
+ // domain field. If the URL contains a [literal IPv6
+ // address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by
+ // `[` and `]`, the `[` and `]` characters should also be captured in the
+ // domain field.
+ URLDomainKey = attribute.Key("url.domain")
+
+ // URLExtensionKey is the attribute Key conforming to the "url.extension"
+ // semantic conventions. It represents the file extension extracted from
+ // the `url.full`, excluding the leading dot.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'png', 'gz'
+ // Note: The file extension is only set if it exists, as not every url has
+ // a file extension. When the file name has multiple extensions
+ // `example.tar.gz`, only the last one should be captured `gz`, not
+ // `tar.gz`.
+ URLExtensionKey = attribute.Key("url.extension")
+
+ // URLFragmentKey is the attribute Key conforming to the "url.fragment"
+ // semantic conventions. It represents the [URI
+ // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'SemConv'
+ URLFragmentKey = attribute.Key("url.fragment")
+
+ // URLFullKey is the attribute Key conforming to the "url.full" semantic
+ // conventions. It represents the absolute URL describing a network
+ // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // '//localhost'
+ // Note: For network calls, URL usually has
+ // `scheme://host[:port][path][?query][#fragment]` format, where the
+ // fragment is not transmitted over HTTP, but if it is known, it SHOULD be
+ // included nevertheless.
+ // `url.full` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case username and
+ // password SHOULD be redacted and attribute's value SHOULD be
+ // `https://REDACTED:REDACTED@www.example.com/`.
+ // `url.full` SHOULD capture the absolute URL when it is available (or can
+ // be reconstructed). Sensitive content provided in `url.full` SHOULD be
+ // scrubbed when instrumentations can identify it.
+ URLFullKey = attribute.Key("url.full")
+
+ // URLOriginalKey is the attribute Key conforming to the "url.original"
+ // semantic conventions. It represents the unmodified original URL as seen
+ // in the event source.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // 'search?q=OpenTelemetry'
+ // Note: In network monitoring, the observed URL may be a full URL, whereas
+ // in access logs, the URL is often just represented as a path. This field
+ // is meant to represent the URL as it was observed, complete or not.
+ // `url.original` might contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case password and
+ // username SHOULD NOT be redacted and attribute's value SHOULD remain the
+ // same.
+ URLOriginalKey = attribute.Key("url.original")
+
+ // URLPathKey is the attribute Key conforming to the "url.path" semantic
+ // conventions. It represents the [URI
+ // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/search'
+ // Note: Sensitive content provided in `url.path` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLPathKey = attribute.Key("url.path")
+
+ // URLPortKey is the attribute Key conforming to the "url.port" semantic
+ // conventions. It represents the port extracted from the `url.full`
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 443
+ URLPortKey = attribute.Key("url.port")
+
+ // URLQueryKey is the attribute Key conforming to the "url.query" semantic
+ // conventions. It represents the [URI
+ // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'q=OpenTelemetry'
+ // Note: Sensitive content provided in `url.query` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLQueryKey = attribute.Key("url.query")
+
+ // URLRegisteredDomainKey is the attribute Key conforming to the
+ // "url.registered_domain" semantic conventions. It represents the highest
+ // registered url domain, stripped of the subdomain.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'example.com', 'foo.co.uk'
+ // Note: This value can be determined precisely with the [public suffix
+ // list](http://publicsuffix.org). For example, the registered domain for
+ // `foo.example.com` is `example.com`. Trying to approximate this by simply
+ // taking the last two labels will not work well for TLDs such as `co.uk`.
+ URLRegisteredDomainKey = attribute.Key("url.registered_domain")
+
+ // URLSchemeKey is the attribute Key conforming to the "url.scheme"
+ // semantic conventions. It represents the [URI
+ // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+ // identifying the used protocol.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https', 'ftp', 'telnet'
+ URLSchemeKey = attribute.Key("url.scheme")
+
+ // URLSubdomainKey is the attribute Key conforming to the "url.subdomain"
+ // semantic conventions. It represents the subdomain portion of a fully
+ // qualified domain name includes all of the names except the host name
+ // under the registered_domain. In a partially qualified domain, or if the
+ // qualification level of the full name cannot be determined, subdomain
+ // contains all of the names below the registered domain.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'east', 'sub2.sub1'
+ // Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If
+ // the domain has multiple levels of subdomain, such as
+ // `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`,
+ // with no trailing period.
+ URLSubdomainKey = attribute.Key("url.subdomain")
+
+ // URLTemplateKey is the attribute Key conforming to the "url.template"
+ // semantic conventions. It represents the low-cardinality template of an
+ // [absolute path
+ // reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/users/{id}', '/users/:id', '/users?id={id}'
+ URLTemplateKey = attribute.Key("url.template")
+
+ // URLTopLevelDomainKey is the attribute Key conforming to the
+ // "url.top_level_domain" semantic conventions. It represents the effective
+ // top level domain (eTLD), also known as the domain suffix, is the last
+ // part of the domain name. For example, the top level domain for
+ // example.com is `com`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com', 'co.uk'
+ // Note: This value can be determined precisely with the [public suffix
+ // list](http://publicsuffix.org).
+ URLTopLevelDomainKey = attribute.Key("url.top_level_domain")
+)
+
+// URLDomain returns an attribute KeyValue conforming to the "url.domain"
+// semantic conventions. It represents the domain extracted from the
+// `url.full`, such as "opentelemetry.io".
+func URLDomain(val string) attribute.KeyValue {
+ return URLDomainKey.String(val)
+}
+
+// URLExtension returns an attribute KeyValue conforming to the
+// "url.extension" semantic conventions. It represents the file extension
+// extracted from the `url.full`, excluding the leading dot.
+func URLExtension(val string) attribute.KeyValue {
+ return URLExtensionKey.String(val)
+}
+
+// URLFragment returns an attribute KeyValue conforming to the
+// "url.fragment" semantic conventions. It represents the [URI
+// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+func URLFragment(val string) attribute.KeyValue {
+ return URLFragmentKey.String(val)
+}
+
+// URLFull returns an attribute KeyValue conforming to the "url.full"
+// semantic conventions. It represents the absolute URL describing a network
+// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+func URLFull(val string) attribute.KeyValue {
+ return URLFullKey.String(val)
+}
+
+// URLOriginal returns an attribute KeyValue conforming to the
+// "url.original" semantic conventions. It represents the unmodified original
+// URL as seen in the event source.
+func URLOriginal(val string) attribute.KeyValue {
+ return URLOriginalKey.String(val)
+}
+
+// URLPath returns an attribute KeyValue conforming to the "url.path"
+// semantic conventions. It represents the [URI
+// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+func URLPath(val string) attribute.KeyValue {
+ return URLPathKey.String(val)
+}
+
+// URLPort returns an attribute KeyValue conforming to the "url.port"
+// semantic conventions. It represents the port extracted from the `url.full`
+func URLPort(val int) attribute.KeyValue {
+ return URLPortKey.Int(val)
+}
+
+// URLQuery returns an attribute KeyValue conforming to the "url.query"
+// semantic conventions. It represents the [URI
+// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+func URLQuery(val string) attribute.KeyValue {
+ return URLQueryKey.String(val)
+}
+
+// URLRegisteredDomain returns an attribute KeyValue conforming to the
+// "url.registered_domain" semantic conventions. It represents the highest
+// registered url domain, stripped of the subdomain.
+func URLRegisteredDomain(val string) attribute.KeyValue {
+ return URLRegisteredDomainKey.String(val)
+}
+
+// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
+// semantic conventions. It represents the [URI
+// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+// identifying the used protocol.
+func URLScheme(val string) attribute.KeyValue {
+ return URLSchemeKey.String(val)
+}
+
+// URLSubdomain returns an attribute KeyValue conforming to the
+// "url.subdomain" semantic conventions. It represents the subdomain portion of
+// a fully qualified domain name includes all of the names except the host name
+// under the registered_domain. In a partially qualified domain, or if the
+// qualification level of the full name cannot be determined, subdomain
+// contains all of the names below the registered domain.
+func URLSubdomain(val string) attribute.KeyValue {
+ return URLSubdomainKey.String(val)
+}
+
+// URLTemplate returns an attribute KeyValue conforming to the
+// "url.template" semantic conventions. It represents the low-cardinality
+// template of an [absolute path
+// reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2).
+func URLTemplate(val string) attribute.KeyValue {
+ return URLTemplateKey.String(val)
+}
+
+// URLTopLevelDomain returns an attribute KeyValue conforming to the
+// "url.top_level_domain" semantic conventions. It represents the effective top
+// level domain (eTLD), also known as the domain suffix, is the last part of
+// the domain name. For example, the top level domain for example.com is `com`.
+func URLTopLevelDomain(val string) attribute.KeyValue {
+ return URLTopLevelDomainKey.String(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentNameKey is the attribute Key conforming to the
+ // "user_agent.name" semantic conventions. It represents the name of the
+ // user-agent extracted from original. Usually refers to the browser's
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Safari', 'YourApp'
+ // Note: [Example](https://www.whatsmyua.info) of extracting browser's name
+ // from original string. In the case of using a user-agent for non-browser
+ // products, such as microservices with multiple names/versions inside the
+ // `user_agent.original`, the most significant name SHOULD be selected. In
+ // such a scenario it should align with `user_agent.version`
+ UserAgentNameKey = attribute.Key("user_agent.name")
+
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1', 'YourApp/1.0.0
+ // grpc-java-okhttp/1.27.2'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+
+ // UserAgentVersionKey is the attribute Key conforming to the
+ // "user_agent.version" semantic conventions. It represents the version of
+ // the user-agent extracted from original. Usually refers to the browser's
+ // version
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.1.2', '1.0.0'
+ // Note: [Example](https://www.whatsmyua.info) of extracting browser's
+ // version from original string. In the case of using a user-agent for
+ // non-browser products, such as microservices with multiple names/versions
+ // inside the `user_agent.original`, the most significant version SHOULD be
+ // selected. In such a scenario it should align with `user_agent.name`
+ UserAgentVersionKey = attribute.Key("user_agent.version")
+)
+
+// UserAgentName returns an attribute KeyValue conforming to the
+// "user_agent.name" semantic conventions. It represents the name of the
+// user-agent extracted from original. Usually refers to the browser's name.
+func UserAgentName(val string) attribute.KeyValue {
+ return UserAgentNameKey.String(val)
+}
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
+
+// UserAgentVersion returns an attribute KeyValue conforming to the
+// "user_agent.version" semantic conventions. It represents the version of the
+// user-agent extracted from original. Usually refers to the browser's version
+func UserAgentVersion(val string) attribute.KeyValue {
+ return UserAgentVersionKey.String(val)
+}
+
+// The attributes used to describe the packaged software running the
+// application code.
+const (
+ // WebEngineDescriptionKey is the attribute Key conforming to the
+ // "webengine.description" semantic conventions. It represents the
+ // additional description of the web engine (e.g. detailed version and
+ // edition information).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) -
+ // 2.2.2.Final'
+ WebEngineDescriptionKey = attribute.Key("webengine.description")
+
+ // WebEngineNameKey is the attribute Key conforming to the "webengine.name"
+ // semantic conventions. It represents the name of the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly'
+ WebEngineNameKey = attribute.Key("webengine.name")
+
+ // WebEngineVersionKey is the attribute Key conforming to the
+ // "webengine.version" semantic conventions. It represents the version of
+ // the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '21.0.0'
+ WebEngineVersionKey = attribute.Key("webengine.version")
+)
+
+// WebEngineDescription returns an attribute KeyValue conforming to the
+// "webengine.description" semantic conventions. It represents the additional
+// description of the web engine (e.g. detailed version and edition
+// information).
+func WebEngineDescription(val string) attribute.KeyValue {
+ return WebEngineDescriptionKey.String(val)
+}
+
+// WebEngineName returns an attribute KeyValue conforming to the
+// "webengine.name" semantic conventions. It represents the name of the web
+// engine.
+func WebEngineName(val string) attribute.KeyValue {
+ return WebEngineNameKey.String(val)
+}
+
+// WebEngineVersion returns an attribute KeyValue conforming to the
+// "webengine.version" semantic conventions. It represents the version of the
+// web engine.
+func WebEngineVersion(val string) attribute.KeyValue {
+ return WebEngineVersionKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go
new file mode 100644
index 00000000000..d031bbea784
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the v1.26.0
+// version of the OpenTelemetry semantic conventions.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go
new file mode 100644
index 00000000000..bfaee0d56e3
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go
new file mode 100644
index 00000000000..fcdb9f48596
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go
@@ -0,0 +1,1307 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+const (
+
+ // ContainerCPUTime is the metric conforming to the "container.cpu.time"
+ // semantic conventions. It represents the total CPU time consumed.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ ContainerCPUTimeName = "container.cpu.time"
+ ContainerCPUTimeUnit = "s"
+ ContainerCPUTimeDescription = "Total CPU time consumed"
+
+ // ContainerMemoryUsage is the metric conforming to the
+ // "container.memory.usage" semantic conventions. It represents the memory
+ // usage of the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerMemoryUsageName = "container.memory.usage"
+ ContainerMemoryUsageUnit = "By"
+ ContainerMemoryUsageDescription = "Memory usage of the container."
+
+ // ContainerDiskIo is the metric conforming to the "container.disk.io" semantic
+ // conventions. It represents the disk bytes for the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerDiskIoName = "container.disk.io"
+ ContainerDiskIoUnit = "By"
+ ContainerDiskIoDescription = "Disk bytes for the container."
+
+ // ContainerNetworkIo is the metric conforming to the "container.network.io"
+ // semantic conventions. It represents the network bytes for the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerNetworkIoName = "container.network.io"
+ ContainerNetworkIoUnit = "By"
+ ContainerNetworkIoDescription = "Network bytes for the container."
+
+ // DBClientOperationDuration is the metric conforming to the
+ // "db.client.operation.duration" semantic conventions. It represents the
+ // duration of database client operations.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientOperationDurationName = "db.client.operation.duration"
+ DBClientOperationDurationUnit = "s"
+ DBClientOperationDurationDescription = "Duration of database client operations."
+
+ // DBClientConnectionCount is the metric conforming to the
+ // "db.client.connection.count" semantic conventions. It represents the number
+ // of connections that are currently in state described by the `state`
+ // attribute.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionCountName = "db.client.connection.count"
+ DBClientConnectionCountUnit = "{connection}"
+ DBClientConnectionCountDescription = "The number of connections that are currently in state described by the `state` attribute"
+
+ // DBClientConnectionIdleMax is the metric conforming to the
+ // "db.client.connection.idle.max" semantic conventions. It represents the
+ // maximum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionIdleMaxName = "db.client.connection.idle.max"
+ DBClientConnectionIdleMaxUnit = "{connection}"
+ DBClientConnectionIdleMaxDescription = "The maximum number of idle open connections allowed"
+
+ // DBClientConnectionIdleMin is the metric conforming to the
+ // "db.client.connection.idle.min" semantic conventions. It represents the
+ // minimum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionIdleMinName = "db.client.connection.idle.min"
+ DBClientConnectionIdleMinUnit = "{connection}"
+ DBClientConnectionIdleMinDescription = "The minimum number of idle open connections allowed"
+
+ // DBClientConnectionMax is the metric conforming to the
+ // "db.client.connection.max" semantic conventions. It represents the maximum
+ // number of open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionMaxName = "db.client.connection.max"
+ DBClientConnectionMaxUnit = "{connection}"
+ DBClientConnectionMaxDescription = "The maximum number of open connections allowed"
+
+ // DBClientConnectionPendingRequests is the metric conforming to the
+ // "db.client.connection.pending_requests" semantic conventions. It represents
+ // the number of pending requests for an open connection, cumulative for the
+ // entire pool.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionPendingRequestsName = "db.client.connection.pending_requests"
+ DBClientConnectionPendingRequestsUnit = "{request}"
+ DBClientConnectionPendingRequestsDescription = "The number of pending requests for an open connection, cumulative for the entire pool"
+
+ // DBClientConnectionTimeouts is the metric conforming to the
+ // "db.client.connection.timeouts" semantic conventions. It represents the
+ // number of connection timeouts that have occurred trying to obtain a
+ // connection from the pool.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionTimeoutsName = "db.client.connection.timeouts"
+ DBClientConnectionTimeoutsUnit = "{timeout}"
+ DBClientConnectionTimeoutsDescription = "The number of connection timeouts that have occurred trying to obtain a connection from the pool"
+
+ // DBClientConnectionCreateTime is the metric conforming to the
+ // "db.client.connection.create_time" semantic conventions. It represents the
+ // time it took to create a new connection.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionCreateTimeName = "db.client.connection.create_time"
+ DBClientConnectionCreateTimeUnit = "s"
+ DBClientConnectionCreateTimeDescription = "The time it took to create a new connection"
+
+ // DBClientConnectionWaitTime is the metric conforming to the
+ // "db.client.connection.wait_time" semantic conventions. It represents the
+ // time it took to obtain an open connection from the pool.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionWaitTimeName = "db.client.connection.wait_time"
+ DBClientConnectionWaitTimeUnit = "s"
+ DBClientConnectionWaitTimeDescription = "The time it took to obtain an open connection from the pool"
+
+ // DBClientConnectionUseTime is the metric conforming to the
+ // "db.client.connection.use_time" semantic conventions. It represents the time
+ // between borrowing a connection and returning it to the pool.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionUseTimeName = "db.client.connection.use_time"
+ DBClientConnectionUseTimeUnit = "s"
+ DBClientConnectionUseTimeDescription = "The time between borrowing a connection and returning it to the pool"
+
+ // DBClientConnectionsUsage is the metric conforming to the
+ // "db.client.connections.usage" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.count` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsUsageName = "db.client.connections.usage"
+ DBClientConnectionsUsageUnit = "{connection}"
+ DBClientConnectionsUsageDescription = "Deprecated, use `db.client.connection.count` instead."
+
+ // DBClientConnectionsIdleMax is the metric conforming to the
+ // "db.client.connections.idle.max" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.idle.max` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMaxName = "db.client.connections.idle.max"
+ DBClientConnectionsIdleMaxUnit = "{connection}"
+ DBClientConnectionsIdleMaxDescription = "Deprecated, use `db.client.connection.idle.max` instead."
+
+ // DBClientConnectionsIdleMin is the metric conforming to the
+ // "db.client.connections.idle.min" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.idle.min` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMinName = "db.client.connections.idle.min"
+ DBClientConnectionsIdleMinUnit = "{connection}"
+ DBClientConnectionsIdleMinDescription = "Deprecated, use `db.client.connection.idle.min` instead."
+
+ // DBClientConnectionsMax is the metric conforming to the
+ // "db.client.connections.max" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.max` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsMaxName = "db.client.connections.max"
+ DBClientConnectionsMaxUnit = "{connection}"
+ DBClientConnectionsMaxDescription = "Deprecated, use `db.client.connection.max` instead."
+
+ // DBClientConnectionsPendingRequests is the metric conforming to the
+ // "db.client.connections.pending_requests" semantic conventions. It represents
+ // the deprecated, use `db.client.connection.pending_requests` instead.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionsPendingRequestsName = "db.client.connections.pending_requests"
+ DBClientConnectionsPendingRequestsUnit = "{request}"
+ DBClientConnectionsPendingRequestsDescription = "Deprecated, use `db.client.connection.pending_requests` instead."
+
+ // DBClientConnectionsTimeouts is the metric conforming to the
+ // "db.client.connections.timeouts" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.timeouts` instead.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionsTimeoutsName = "db.client.connections.timeouts"
+ DBClientConnectionsTimeoutsUnit = "{timeout}"
+ DBClientConnectionsTimeoutsDescription = "Deprecated, use `db.client.connection.timeouts` instead."
+
+ // DBClientConnectionsCreateTime is the metric conforming to the
+ // "db.client.connections.create_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.create_time` instead. Note: the unit
+ // also changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsCreateTimeName = "db.client.connections.create_time"
+ DBClientConnectionsCreateTimeUnit = "ms"
+ DBClientConnectionsCreateTimeDescription = "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DBClientConnectionsWaitTime is the metric conforming to the
+ // "db.client.connections.wait_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.wait_time` instead. Note: the unit
+ // also changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsWaitTimeName = "db.client.connections.wait_time"
+ DBClientConnectionsWaitTimeUnit = "ms"
+ DBClientConnectionsWaitTimeDescription = "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DBClientConnectionsUseTime is the metric conforming to the
+ // "db.client.connections.use_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.use_time` instead. Note: the unit also
+ // changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsUseTimeName = "db.client.connections.use_time"
+ DBClientConnectionsUseTimeUnit = "ms"
+ DBClientConnectionsUseTimeDescription = "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DNSLookupDuration is the metric conforming to the "dns.lookup.duration"
+ // semantic conventions. It represents the measures the time taken to perform a
+ // DNS lookup.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DNSLookupDurationName = "dns.lookup.duration"
+ DNSLookupDurationUnit = "s"
+ DNSLookupDurationDescription = "Measures the time taken to perform a DNS lookup."
+
+ // AspnetcoreRoutingMatchAttempts is the metric conforming to the
+ // "aspnetcore.routing.match_attempts" semantic conventions. It represents the
+ // number of requests that were attempted to be matched to an endpoint.
+ // Instrument: counter
+ // Unit: {match_attempt}
+ // Stability: Stable
+ AspnetcoreRoutingMatchAttemptsName = "aspnetcore.routing.match_attempts"
+ AspnetcoreRoutingMatchAttemptsUnit = "{match_attempt}"
+ AspnetcoreRoutingMatchAttemptsDescription = "Number of requests that were attempted to be matched to an endpoint."
+
+ // AspnetcoreDiagnosticsExceptions is the metric conforming to the
+ // "aspnetcore.diagnostics.exceptions" semantic conventions. It represents the
+ // number of exceptions caught by exception handling middleware.
+ // Instrument: counter
+ // Unit: {exception}
+ // Stability: Stable
+ AspnetcoreDiagnosticsExceptionsName = "aspnetcore.diagnostics.exceptions"
+ AspnetcoreDiagnosticsExceptionsUnit = "{exception}"
+ AspnetcoreDiagnosticsExceptionsDescription = "Number of exceptions caught by exception handling middleware."
+
+ // AspnetcoreRateLimitingActiveRequestLeases is the metric conforming to the
+ // "aspnetcore.rate_limiting.active_request_leases" semantic conventions. It
+ // represents the number of requests that are currently active on the server
+ // that hold a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingActiveRequestLeasesName = "aspnetcore.rate_limiting.active_request_leases"
+ AspnetcoreRateLimitingActiveRequestLeasesUnit = "{request}"
+ AspnetcoreRateLimitingActiveRequestLeasesDescription = "Number of requests that are currently active on the server that hold a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequestLeaseDuration is the metric conforming to the
+ // "aspnetcore.rate_limiting.request_lease.duration" semantic conventions. It
+ // represents the duration of rate limiting lease held by requests on the
+ // server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestLeaseDurationName = "aspnetcore.rate_limiting.request_lease.duration"
+ AspnetcoreRateLimitingRequestLeaseDurationUnit = "s"
+ AspnetcoreRateLimitingRequestLeaseDurationDescription = "The duration of rate limiting lease held by requests on the server."
+
+ // AspnetcoreRateLimitingRequestTimeInQueue is the metric conforming to the
+ // "aspnetcore.rate_limiting.request.time_in_queue" semantic conventions. It
+ // represents the time the request spent in a queue waiting to acquire a rate
+ // limiting lease.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestTimeInQueueName = "aspnetcore.rate_limiting.request.time_in_queue"
+ AspnetcoreRateLimitingRequestTimeInQueueUnit = "s"
+ AspnetcoreRateLimitingRequestTimeInQueueDescription = "The time the request spent in a queue waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingQueuedRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.queued_requests" semantic conventions. It
+ // represents the number of requests that are currently queued, waiting to
+ // acquire a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingQueuedRequestsName = "aspnetcore.rate_limiting.queued_requests"
+ AspnetcoreRateLimitingQueuedRequestsUnit = "{request}"
+ AspnetcoreRateLimitingQueuedRequestsDescription = "Number of requests that are currently queued, waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.requests" semantic conventions. It represents the
+ // number of requests that tried to acquire a rate limiting lease.
+ // Instrument: counter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestsName = "aspnetcore.rate_limiting.requests"
+ AspnetcoreRateLimitingRequestsUnit = "{request}"
+ AspnetcoreRateLimitingRequestsDescription = "Number of requests that tried to acquire a rate limiting lease."
+
+ // KestrelActiveConnections is the metric conforming to the
+ // "kestrel.active_connections" semantic conventions. It represents the number
+ // of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelActiveConnectionsName = "kestrel.active_connections"
+ KestrelActiveConnectionsUnit = "{connection}"
+ KestrelActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // KestrelConnectionDuration is the metric conforming to the
+ // "kestrel.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ KestrelConnectionDurationName = "kestrel.connection.duration"
+ KestrelConnectionDurationUnit = "s"
+ KestrelConnectionDurationDescription = "The duration of connections on the server."
+
+ // KestrelRejectedConnections is the metric conforming to the
+ // "kestrel.rejected_connections" semantic conventions. It represents the
+ // number of connections rejected by the server.
+ // Instrument: counter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelRejectedConnectionsName = "kestrel.rejected_connections"
+ KestrelRejectedConnectionsUnit = "{connection}"
+ KestrelRejectedConnectionsDescription = "Number of connections rejected by the server."
+
+ // KestrelQueuedConnections is the metric conforming to the
+ // "kestrel.queued_connections" semantic conventions. It represents the number
+ // of connections that are currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelQueuedConnectionsName = "kestrel.queued_connections"
+ KestrelQueuedConnectionsUnit = "{connection}"
+ KestrelQueuedConnectionsDescription = "Number of connections that are currently queued and are waiting to start."
+
+ // KestrelQueuedRequests is the metric conforming to the
+ // "kestrel.queued_requests" semantic conventions. It represents the number of
+ // HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are
+ // currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ KestrelQueuedRequestsName = "kestrel.queued_requests"
+ KestrelQueuedRequestsUnit = "{request}"
+ KestrelQueuedRequestsDescription = "Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start."
+
+ // KestrelUpgradedConnections is the metric conforming to the
+ // "kestrel.upgraded_connections" semantic conventions. It represents the
+ // number of connections that are currently upgraded (WebSockets). .
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelUpgradedConnectionsName = "kestrel.upgraded_connections"
+ KestrelUpgradedConnectionsUnit = "{connection}"
+ KestrelUpgradedConnectionsDescription = "Number of connections that are currently upgraded (WebSockets). ."
+
+ // KestrelTLSHandshakeDuration is the metric conforming to the
+ // "kestrel.tls_handshake.duration" semantic conventions. It represents the
+ // duration of TLS handshakes on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ KestrelTLSHandshakeDurationName = "kestrel.tls_handshake.duration"
+ KestrelTLSHandshakeDurationUnit = "s"
+ KestrelTLSHandshakeDurationDescription = "The duration of TLS handshakes on the server."
+
+ // KestrelActiveTLSHandshakes is the metric conforming to the
+ // "kestrel.active_tls_handshakes" semantic conventions. It represents the
+ // number of TLS handshakes that are currently in progress on the server.
+ // Instrument: updowncounter
+ // Unit: {handshake}
+ // Stability: Stable
+ KestrelActiveTLSHandshakesName = "kestrel.active_tls_handshakes"
+ KestrelActiveTLSHandshakesUnit = "{handshake}"
+ KestrelActiveTLSHandshakesDescription = "Number of TLS handshakes that are currently in progress on the server."
+
+ // SignalrServerConnectionDuration is the metric conforming to the
+ // "signalr.server.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ SignalrServerConnectionDurationName = "signalr.server.connection.duration"
+ SignalrServerConnectionDurationUnit = "s"
+ SignalrServerConnectionDurationDescription = "The duration of connections on the server."
+
+ // SignalrServerActiveConnections is the metric conforming to the
+ // "signalr.server.active_connections" semantic conventions. It represents the
+ // number of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ SignalrServerActiveConnectionsName = "signalr.server.active_connections"
+ SignalrServerActiveConnectionsUnit = "{connection}"
+ SignalrServerActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // FaaSInvokeDuration is the metric conforming to the "faas.invoke_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's logic execution.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInvokeDurationName = "faas.invoke_duration"
+ FaaSInvokeDurationUnit = "s"
+ FaaSInvokeDurationDescription = "Measures the duration of the function's logic execution"
+
+ // FaaSInitDuration is the metric conforming to the "faas.init_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's initialization, such as a cold start.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInitDurationName = "faas.init_duration"
+ FaaSInitDurationUnit = "s"
+ FaaSInitDurationDescription = "Measures the duration of the function's initialization, such as a cold start"
+
+ // FaaSColdstarts is the metric conforming to the "faas.coldstarts" semantic
+ // conventions. It represents the number of invocation cold starts.
+ // Instrument: counter
+ // Unit: {coldstart}
+ // Stability: Experimental
+ FaaSColdstartsName = "faas.coldstarts"
+ FaaSColdstartsUnit = "{coldstart}"
+ FaaSColdstartsDescription = "Number of invocation cold starts"
+
+ // FaaSErrors is the metric conforming to the "faas.errors" semantic
+ // conventions. It represents the number of invocation errors.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ FaaSErrorsName = "faas.errors"
+ FaaSErrorsUnit = "{error}"
+ FaaSErrorsDescription = "Number of invocation errors"
+
+ // FaaSInvocations is the metric conforming to the "faas.invocations" semantic
+ // conventions. It represents the number of successful invocations.
+ // Instrument: counter
+ // Unit: {invocation}
+ // Stability: Experimental
+ FaaSInvocationsName = "faas.invocations"
+ FaaSInvocationsUnit = "{invocation}"
+ FaaSInvocationsDescription = "Number of successful invocations"
+
+ // FaaSTimeouts is the metric conforming to the "faas.timeouts" semantic
+ // conventions. It represents the number of invocation timeouts.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ FaaSTimeoutsName = "faas.timeouts"
+ FaaSTimeoutsUnit = "{timeout}"
+ FaaSTimeoutsDescription = "Number of invocation timeouts"
+
+ // FaaSMemUsage is the metric conforming to the "faas.mem_usage" semantic
+ // conventions. It represents the distribution of max memory usage per
+ // invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSMemUsageName = "faas.mem_usage"
+ FaaSMemUsageUnit = "By"
+ FaaSMemUsageDescription = "Distribution of max memory usage per invocation"
+
+ // FaaSCPUUsage is the metric conforming to the "faas.cpu_usage" semantic
+ // conventions. It represents the distribution of CPU usage per invocation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSCPUUsageName = "faas.cpu_usage"
+ FaaSCPUUsageUnit = "s"
+ FaaSCPUUsageDescription = "Distribution of CPU usage per invocation"
+
+ // FaaSNetIo is the metric conforming to the "faas.net_io" semantic
+ // conventions. It represents the distribution of net I/O usage per invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSNetIoName = "faas.net_io"
+ FaaSNetIoUnit = "By"
+ FaaSNetIoDescription = "Distribution of net I/O usage per invocation"
+
+ // HTTPServerRequestDuration is the metric conforming to the
+ // "http.server.request.duration" semantic conventions. It represents the
+ // duration of HTTP server requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPServerRequestDurationName = "http.server.request.duration"
+ HTTPServerRequestDurationUnit = "s"
+ HTTPServerRequestDurationDescription = "Duration of HTTP server requests."
+
+ // HTTPServerActiveRequests is the metric conforming to the
+ // "http.server.active_requests" semantic conventions. It represents the number
+ // of active HTTP server requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPServerActiveRequestsName = "http.server.active_requests"
+ HTTPServerActiveRequestsUnit = "{request}"
+ HTTPServerActiveRequestsDescription = "Number of active HTTP server requests."
+
+ // HTTPServerRequestBodySize is the metric conforming to the
+ // "http.server.request.body.size" semantic conventions. It represents the size
+ // of HTTP server request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerRequestBodySizeName = "http.server.request.body.size"
+ HTTPServerRequestBodySizeUnit = "By"
+ HTTPServerRequestBodySizeDescription = "Size of HTTP server request bodies."
+
+ // HTTPServerResponseBodySize is the metric conforming to the
+ // "http.server.response.body.size" semantic conventions. It represents the
+ // size of HTTP server response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerResponseBodySizeName = "http.server.response.body.size"
+ HTTPServerResponseBodySizeUnit = "By"
+ HTTPServerResponseBodySizeDescription = "Size of HTTP server response bodies."
+
+ // HTTPClientRequestDuration is the metric conforming to the
+ // "http.client.request.duration" semantic conventions. It represents the
+ // duration of HTTP client requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPClientRequestDurationName = "http.client.request.duration"
+ HTTPClientRequestDurationUnit = "s"
+ HTTPClientRequestDurationDescription = "Duration of HTTP client requests."
+
+ // HTTPClientRequestBodySize is the metric conforming to the
+ // "http.client.request.body.size" semantic conventions. It represents the size
+ // of HTTP client request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientRequestBodySizeName = "http.client.request.body.size"
+ HTTPClientRequestBodySizeUnit = "By"
+ HTTPClientRequestBodySizeDescription = "Size of HTTP client request bodies."
+
+ // HTTPClientResponseBodySize is the metric conforming to the
+ // "http.client.response.body.size" semantic conventions. It represents the
+ // size of HTTP client response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientResponseBodySizeName = "http.client.response.body.size"
+ HTTPClientResponseBodySizeUnit = "By"
+ HTTPClientResponseBodySizeDescription = "Size of HTTP client response bodies."
+
+ // HTTPClientOpenConnections is the metric conforming to the
+ // "http.client.open_connections" semantic conventions. It represents the
+ // number of outbound HTTP connections that are currently active or idle on the
+ // client.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ HTTPClientOpenConnectionsName = "http.client.open_connections"
+ HTTPClientOpenConnectionsUnit = "{connection}"
+ HTTPClientOpenConnectionsDescription = "Number of outbound HTTP connections that are currently active or idle on the client."
+
+ // HTTPClientConnectionDuration is the metric conforming to the
+ // "http.client.connection.duration" semantic conventions. It represents the
+ // duration of the successfully established outbound HTTP connections.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ HTTPClientConnectionDurationName = "http.client.connection.duration"
+ HTTPClientConnectionDurationUnit = "s"
+ HTTPClientConnectionDurationDescription = "The duration of the successfully established outbound HTTP connections."
+
+ // HTTPClientActiveRequests is the metric conforming to the
+ // "http.client.active_requests" semantic conventions. It represents the number
+ // of active HTTP requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPClientActiveRequestsName = "http.client.active_requests"
+ HTTPClientActiveRequestsUnit = "{request}"
+ HTTPClientActiveRequestsDescription = "Number of active HTTP requests."
+
+ // JvmMemoryInit is the metric conforming to the "jvm.memory.init" semantic
+ // conventions. It represents the measure of initial memory requested.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmMemoryInitName = "jvm.memory.init"
+ JvmMemoryInitUnit = "By"
+ JvmMemoryInitDescription = "Measure of initial memory requested."
+
+ // JvmSystemCPUUtilization is the metric conforming to the
+ // "jvm.system.cpu.utilization" semantic conventions. It represents the recent
+ // CPU utilization for the whole system as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ JvmSystemCPUUtilizationName = "jvm.system.cpu.utilization"
+ JvmSystemCPUUtilizationUnit = "1"
+ JvmSystemCPUUtilizationDescription = "Recent CPU utilization for the whole system as reported by the JVM."
+
+ // JvmSystemCPULoad1m is the metric conforming to the "jvm.system.cpu.load_1m"
+ // semantic conventions. It represents the average CPU load of the whole system
+ // for the last minute as reported by the JVM.
+ // Instrument: gauge
+ // Unit: {run_queue_item}
+ // Stability: Experimental
+ JvmSystemCPULoad1mName = "jvm.system.cpu.load_1m"
+ JvmSystemCPULoad1mUnit = "{run_queue_item}"
+ JvmSystemCPULoad1mDescription = "Average CPU load of the whole system for the last minute as reported by the JVM."
+
+ // JvmBufferMemoryUsage is the metric conforming to the
+ // "jvm.buffer.memory.usage" semantic conventions. It represents the measure of
+ // memory used by buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryUsageName = "jvm.buffer.memory.usage"
+ JvmBufferMemoryUsageUnit = "By"
+ JvmBufferMemoryUsageDescription = "Measure of memory used by buffers."
+
+ // JvmBufferMemoryLimit is the metric conforming to the
+ // "jvm.buffer.memory.limit" semantic conventions. It represents the measure of
+ // total memory capacity of buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryLimitName = "jvm.buffer.memory.limit"
+ JvmBufferMemoryLimitUnit = "By"
+ JvmBufferMemoryLimitDescription = "Measure of total memory capacity of buffers."
+
+ // JvmBufferCount is the metric conforming to the "jvm.buffer.count" semantic
+ // conventions. It represents the number of buffers in the pool.
+ // Instrument: updowncounter
+ // Unit: {buffer}
+ // Stability: Experimental
+ JvmBufferCountName = "jvm.buffer.count"
+ JvmBufferCountUnit = "{buffer}"
+ JvmBufferCountDescription = "Number of buffers in the pool."
+
+ // JvmMemoryUsed is the metric conforming to the "jvm.memory.used" semantic
+ // conventions. It represents the measure of memory used.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedName = "jvm.memory.used"
+ JvmMemoryUsedUnit = "By"
+ JvmMemoryUsedDescription = "Measure of memory used."
+
+ // JvmMemoryCommitted is the metric conforming to the "jvm.memory.committed"
+ // semantic conventions. It represents the measure of memory committed.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryCommittedName = "jvm.memory.committed"
+ JvmMemoryCommittedUnit = "By"
+ JvmMemoryCommittedDescription = "Measure of memory committed."
+
+ // JvmMemoryLimit is the metric conforming to the "jvm.memory.limit" semantic
+ // conventions. It represents the measure of max obtainable memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryLimitName = "jvm.memory.limit"
+ JvmMemoryLimitUnit = "By"
+ JvmMemoryLimitDescription = "Measure of max obtainable memory."
+
+ // JvmMemoryUsedAfterLastGc is the metric conforming to the
+ // "jvm.memory.used_after_last_gc" semantic conventions. It represents the
+ // measure of memory used, as measured after the most recent garbage collection
+ // event on this pool.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedAfterLastGcName = "jvm.memory.used_after_last_gc"
+ JvmMemoryUsedAfterLastGcUnit = "By"
+ JvmMemoryUsedAfterLastGcDescription = "Measure of memory used, as measured after the most recent garbage collection event on this pool."
+
+ // JvmGcDuration is the metric conforming to the "jvm.gc.duration" semantic
+ // conventions. It represents the duration of JVM garbage collection actions.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ JvmGcDurationName = "jvm.gc.duration"
+ JvmGcDurationUnit = "s"
+ JvmGcDurationDescription = "Duration of JVM garbage collection actions."
+
+ // JvmThreadCount is the metric conforming to the "jvm.thread.count" semantic
+ // conventions. It represents the number of executing platform threads.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Stable
+ JvmThreadCountName = "jvm.thread.count"
+ JvmThreadCountUnit = "{thread}"
+ JvmThreadCountDescription = "Number of executing platform threads."
+
+ // JvmClassLoaded is the metric conforming to the "jvm.class.loaded" semantic
+ // conventions. It represents the number of classes loaded since JVM start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassLoadedName = "jvm.class.loaded"
+ JvmClassLoadedUnit = "{class}"
+ JvmClassLoadedDescription = "Number of classes loaded since JVM start."
+
+ // JvmClassUnloaded is the metric conforming to the "jvm.class.unloaded"
+ // semantic conventions. It represents the number of classes unloaded since JVM
+ // start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassUnloadedName = "jvm.class.unloaded"
+ JvmClassUnloadedUnit = "{class}"
+ JvmClassUnloadedDescription = "Number of classes unloaded since JVM start."
+
+ // JvmClassCount is the metric conforming to the "jvm.class.count" semantic
+ // conventions. It represents the number of classes currently loaded.
+ // Instrument: updowncounter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassCountName = "jvm.class.count"
+ JvmClassCountUnit = "{class}"
+ JvmClassCountDescription = "Number of classes currently loaded."
+
+ // JvmCPUCount is the metric conforming to the "jvm.cpu.count" semantic
+ // conventions. It represents the number of processors available to the Java
+ // virtual machine.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Stable
+ JvmCPUCountName = "jvm.cpu.count"
+ JvmCPUCountUnit = "{cpu}"
+ JvmCPUCountDescription = "Number of processors available to the Java virtual machine."
+
+ // JvmCPUTime is the metric conforming to the "jvm.cpu.time" semantic
+ // conventions. It represents the cPU time used by the process as reported by
+ // the JVM.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Stable
+ JvmCPUTimeName = "jvm.cpu.time"
+ JvmCPUTimeUnit = "s"
+ JvmCPUTimeDescription = "CPU time used by the process as reported by the JVM."
+
+ // JvmCPURecentUtilization is the metric conforming to the
+ // "jvm.cpu.recent_utilization" semantic conventions. It represents the recent
+ // CPU utilization for the process as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Stable
+ JvmCPURecentUtilizationName = "jvm.cpu.recent_utilization"
+ JvmCPURecentUtilizationUnit = "1"
+ JvmCPURecentUtilizationDescription = "Recent CPU utilization for the process as reported by the JVM."
+
+ // MessagingPublishDuration is the metric conforming to the
+ // "messaging.publish.duration" semantic conventions. It represents the
+ // measures the duration of publish operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingPublishDurationName = "messaging.publish.duration"
+ MessagingPublishDurationUnit = "s"
+ MessagingPublishDurationDescription = "Measures the duration of publish operation."
+
+ // MessagingReceiveDuration is the metric conforming to the
+ // "messaging.receive.duration" semantic conventions. It represents the
+ // measures the duration of receive operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingReceiveDurationName = "messaging.receive.duration"
+ MessagingReceiveDurationUnit = "s"
+ MessagingReceiveDurationDescription = "Measures the duration of receive operation."
+
+ // MessagingProcessDuration is the metric conforming to the
+ // "messaging.process.duration" semantic conventions. It represents the
+ // measures the duration of process operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingProcessDurationName = "messaging.process.duration"
+ MessagingProcessDurationUnit = "s"
+ MessagingProcessDurationDescription = "Measures the duration of process operation."
+
+ // MessagingPublishMessages is the metric conforming to the
+ // "messaging.publish.messages" semantic conventions. It represents the
+ // measures the number of published messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingPublishMessagesName = "messaging.publish.messages"
+ MessagingPublishMessagesUnit = "{message}"
+ MessagingPublishMessagesDescription = "Measures the number of published messages."
+
+ // MessagingReceiveMessages is the metric conforming to the
+ // "messaging.receive.messages" semantic conventions. It represents the
+ // measures the number of received messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingReceiveMessagesName = "messaging.receive.messages"
+ MessagingReceiveMessagesUnit = "{message}"
+ MessagingReceiveMessagesDescription = "Measures the number of received messages."
+
+ // MessagingProcessMessages is the metric conforming to the
+ // "messaging.process.messages" semantic conventions. It represents the
+ // measures the number of processed messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingProcessMessagesName = "messaging.process.messages"
+ MessagingProcessMessagesUnit = "{message}"
+ MessagingProcessMessagesDescription = "Measures the number of processed messages."
+
+ // ProcessCPUTime is the metric conforming to the "process.cpu.time" semantic
+ // conventions. It represents the total CPU seconds broken down by different
+ // states.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ ProcessCPUTimeName = "process.cpu.time"
+ ProcessCPUTimeUnit = "s"
+ ProcessCPUTimeDescription = "Total CPU seconds broken down by different states."
+
+ // ProcessCPUUtilization is the metric conforming to the
+ // "process.cpu.utilization" semantic conventions. It represents the difference
+ // in process.cpu.time since the last measurement, divided by the elapsed time
+ // and number of CPUs available to the process.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ ProcessCPUUtilizationName = "process.cpu.utilization"
+ ProcessCPUUtilizationUnit = "1"
+ ProcessCPUUtilizationDescription = "Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process."
+
+ // ProcessMemoryUsage is the metric conforming to the "process.memory.usage"
+ // semantic conventions. It represents the amount of physical memory in use.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ ProcessMemoryUsageName = "process.memory.usage"
+ ProcessMemoryUsageUnit = "By"
+ ProcessMemoryUsageDescription = "The amount of physical memory in use."
+
+ // ProcessMemoryVirtual is the metric conforming to the
+ // "process.memory.virtual" semantic conventions. It represents the amount of
+ // committed virtual memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ ProcessMemoryVirtualName = "process.memory.virtual"
+ ProcessMemoryVirtualUnit = "By"
+ ProcessMemoryVirtualDescription = "The amount of committed virtual memory."
+
+ // ProcessDiskIo is the metric conforming to the "process.disk.io" semantic
+ // conventions. It represents the disk bytes transferred.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ProcessDiskIoName = "process.disk.io"
+ ProcessDiskIoUnit = "By"
+ ProcessDiskIoDescription = "Disk bytes transferred."
+
+ // ProcessNetworkIo is the metric conforming to the "process.network.io"
+ // semantic conventions. It represents the network bytes transferred.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ProcessNetworkIoName = "process.network.io"
+ ProcessNetworkIoUnit = "By"
+ ProcessNetworkIoDescription = "Network bytes transferred."
+
+ // ProcessThreadCount is the metric conforming to the "process.thread.count"
+ // semantic conventions. It represents the process threads count.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Experimental
+ ProcessThreadCountName = "process.thread.count"
+ ProcessThreadCountUnit = "{thread}"
+ ProcessThreadCountDescription = "Process threads count."
+
+ // ProcessOpenFileDescriptorCount is the metric conforming to the
+ // "process.open_file_descriptor.count" semantic conventions. It represents the
+ // number of file descriptors in use by the process.
+ // Instrument: updowncounter
+ // Unit: {count}
+ // Stability: Experimental
+ ProcessOpenFileDescriptorCountName = "process.open_file_descriptor.count"
+ ProcessOpenFileDescriptorCountUnit = "{count}"
+ ProcessOpenFileDescriptorCountDescription = "Number of file descriptors in use by the process."
+
+ // ProcessContextSwitches is the metric conforming to the
+ // "process.context_switches" semantic conventions. It represents the number of
+ // times the process has been context switched.
+ // Instrument: counter
+ // Unit: {count}
+ // Stability: Experimental
+ ProcessContextSwitchesName = "process.context_switches"
+ ProcessContextSwitchesUnit = "{count}"
+ ProcessContextSwitchesDescription = "Number of times the process has been context switched."
+
+ // ProcessPagingFaults is the metric conforming to the "process.paging.faults"
+ // semantic conventions. It represents the number of page faults the process
+ // has made.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ ProcessPagingFaultsName = "process.paging.faults"
+ ProcessPagingFaultsUnit = "{fault}"
+ ProcessPagingFaultsDescription = "Number of page faults the process has made."
+
+ // RPCServerDuration is the metric conforming to the "rpc.server.duration"
+ // semantic conventions. It represents the measures the duration of inbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCServerDurationName = "rpc.server.duration"
+ RPCServerDurationUnit = "ms"
+ RPCServerDurationDescription = "Measures the duration of inbound RPC."
+
+ // RPCServerRequestSize is the metric conforming to the
+ // "rpc.server.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerRequestSizeName = "rpc.server.request.size"
+ RPCServerRequestSizeUnit = "By"
+ RPCServerRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCServerResponseSize is the metric conforming to the
+ // "rpc.server.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerResponseSizeName = "rpc.server.response.size"
+ RPCServerResponseSizeUnit = "By"
+ RPCServerResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCServerRequestsPerRPC is the metric conforming to the
+ // "rpc.server.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerRequestsPerRPCName = "rpc.server.requests_per_rpc"
+ RPCServerRequestsPerRPCUnit = "{count}"
+ RPCServerRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCServerResponsesPerRPC is the metric conforming to the
+ // "rpc.server.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerResponsesPerRPCName = "rpc.server.responses_per_rpc"
+ RPCServerResponsesPerRPCUnit = "{count}"
+ RPCServerResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // RPCClientDuration is the metric conforming to the "rpc.client.duration"
+ // semantic conventions. It represents the measures the duration of outbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCClientDurationName = "rpc.client.duration"
+ RPCClientDurationUnit = "ms"
+ RPCClientDurationDescription = "Measures the duration of outbound RPC."
+
+ // RPCClientRequestSize is the metric conforming to the
+ // "rpc.client.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientRequestSizeName = "rpc.client.request.size"
+ RPCClientRequestSizeUnit = "By"
+ RPCClientRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCClientResponseSize is the metric conforming to the
+ // "rpc.client.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientResponseSizeName = "rpc.client.response.size"
+ RPCClientResponseSizeUnit = "By"
+ RPCClientResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCClientRequestsPerRPC is the metric conforming to the
+ // "rpc.client.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientRequestsPerRPCName = "rpc.client.requests_per_rpc"
+ RPCClientRequestsPerRPCUnit = "{count}"
+ RPCClientRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCClientResponsesPerRPC is the metric conforming to the
+ // "rpc.client.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientResponsesPerRPCName = "rpc.client.responses_per_rpc"
+ RPCClientResponsesPerRPCUnit = "{count}"
+ RPCClientResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // SystemCPUTime is the metric conforming to the "system.cpu.time" semantic
+ // conventions. It represents the seconds each logical CPU spent on each mode.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemCPUTimeName = "system.cpu.time"
+ SystemCPUTimeUnit = "s"
+ SystemCPUTimeDescription = "Seconds each logical CPU spent on each mode"
+
+ // SystemCPUUtilization is the metric conforming to the
+ // "system.cpu.utilization" semantic conventions. It represents the difference
+ // in system.cpu.time since the last measurement, divided by the elapsed time
+ // and number of logical CPUs.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ SystemCPUUtilizationName = "system.cpu.utilization"
+ SystemCPUUtilizationUnit = "1"
+ SystemCPUUtilizationDescription = "Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs"
+
+ // SystemCPUFrequency is the metric conforming to the "system.cpu.frequency"
+ // semantic conventions. It represents the reports the current frequency of the
+ // CPU in Hz.
+ // Instrument: gauge
+ // Unit: {Hz}
+ // Stability: Experimental
+ SystemCPUFrequencyName = "system.cpu.frequency"
+ SystemCPUFrequencyUnit = "{Hz}"
+ SystemCPUFrequencyDescription = "Reports the current frequency of the CPU in Hz"
+
+ // SystemCPUPhysicalCount is the metric conforming to the
+ // "system.cpu.physical.count" semantic conventions. It represents the reports
+ // the number of actual physical processor cores on the hardware.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPUPhysicalCountName = "system.cpu.physical.count"
+ SystemCPUPhysicalCountUnit = "{cpu}"
+ SystemCPUPhysicalCountDescription = "Reports the number of actual physical processor cores on the hardware"
+
+ // SystemCPULogicalCount is the metric conforming to the
+ // "system.cpu.logical.count" semantic conventions. It represents the reports
+ // the number of logical (virtual) processor cores created by the operating
+ // system to manage multitasking.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPULogicalCountName = "system.cpu.logical.count"
+ SystemCPULogicalCountUnit = "{cpu}"
+ SystemCPULogicalCountDescription = "Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking"
+
+ // SystemMemoryUsage is the metric conforming to the "system.memory.usage"
+ // semantic conventions. It represents the reports memory in use by state.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryUsageName = "system.memory.usage"
+ SystemMemoryUsageUnit = "By"
+ SystemMemoryUsageDescription = "Reports memory in use by state."
+
+ // SystemMemoryLimit is the metric conforming to the "system.memory.limit"
+ // semantic conventions. It represents the total memory available in the
+ // system.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryLimitName = "system.memory.limit"
+ SystemMemoryLimitUnit = "By"
+ SystemMemoryLimitDescription = "Total memory available in the system."
+
+ // SystemMemoryShared is the metric conforming to the "system.memory.shared"
+ // semantic conventions. It represents the shared memory used (mostly by
+ // tmpfs).
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemorySharedName = "system.memory.shared"
+ SystemMemorySharedUnit = "By"
+ SystemMemorySharedDescription = "Shared memory used (mostly by tmpfs)."
+
+ // SystemMemoryUtilization is the metric conforming to the
+ // "system.memory.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemMemoryUtilizationName = "system.memory.utilization"
+ SystemMemoryUtilizationUnit = "1"
+
+ // SystemPagingUsage is the metric conforming to the "system.paging.usage"
+ // semantic conventions. It represents the unix swap or windows pagefile usage.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemPagingUsageName = "system.paging.usage"
+ SystemPagingUsageUnit = "By"
+ SystemPagingUsageDescription = "Unix swap or windows pagefile usage"
+
+ // SystemPagingUtilization is the metric conforming to the
+ // "system.paging.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingUtilizationName = "system.paging.utilization"
+ SystemPagingUtilizationUnit = "1"
+
+ // SystemPagingFaults is the metric conforming to the "system.paging.faults"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingFaultsName = "system.paging.faults"
+ SystemPagingFaultsUnit = "{fault}"
+
+ // SystemPagingOperations is the metric conforming to the
+ // "system.paging.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingOperationsName = "system.paging.operations"
+ SystemPagingOperationsUnit = "{operation}"
+
+ // SystemDiskIo is the metric conforming to the "system.disk.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskIoName = "system.disk.io"
+ SystemDiskIoUnit = "By"
+
+ // SystemDiskOperations is the metric conforming to the
+ // "system.disk.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskOperationsName = "system.disk.operations"
+ SystemDiskOperationsUnit = "{operation}"
+
+ // SystemDiskIoTime is the metric conforming to the "system.disk.io_time"
+ // semantic conventions. It represents the time disk spent activated.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskIoTimeName = "system.disk.io_time"
+ SystemDiskIoTimeUnit = "s"
+ SystemDiskIoTimeDescription = "Time disk spent activated"
+
+ // SystemDiskOperationTime is the metric conforming to the
+ // "system.disk.operation_time" semantic conventions. It represents the sum of
+ // the time each operation took to complete.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskOperationTimeName = "system.disk.operation_time"
+ SystemDiskOperationTimeUnit = "s"
+ SystemDiskOperationTimeDescription = "Sum of the time each operation took to complete"
+
+ // SystemDiskMerged is the metric conforming to the "system.disk.merged"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskMergedName = "system.disk.merged"
+ SystemDiskMergedUnit = "{operation}"
+
+ // SystemFilesystemUsage is the metric conforming to the
+ // "system.filesystem.usage" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUsageName = "system.filesystem.usage"
+ SystemFilesystemUsageUnit = "By"
+
+ // SystemFilesystemUtilization is the metric conforming to the
+ // "system.filesystem.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUtilizationName = "system.filesystem.utilization"
+ SystemFilesystemUtilizationUnit = "1"
+
+ // SystemNetworkDropped is the metric conforming to the
+ // "system.network.dropped" semantic conventions. It represents the count of
+ // packets that are dropped or discarded even though there was no error.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ SystemNetworkDroppedName = "system.network.dropped"
+ SystemNetworkDroppedUnit = "{packet}"
+ SystemNetworkDroppedDescription = "Count of packets that are dropped or discarded even though there was no error"
+
+ // SystemNetworkPackets is the metric conforming to the
+ // "system.network.packets" semantic conventions.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkPacketsName = "system.network.packets"
+ SystemNetworkPacketsUnit = "{packet}"
+
+ // SystemNetworkErrors is the metric conforming to the "system.network.errors"
+ // semantic conventions. It represents the count of network errors detected.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ SystemNetworkErrorsName = "system.network.errors"
+ SystemNetworkErrorsUnit = "{error}"
+ SystemNetworkErrorsDescription = "Count of network errors detected"
+
+ // SystemNetworkIo is the metric conforming to the "system.network.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkIoName = "system.network.io"
+ SystemNetworkIoUnit = "By"
+
+ // SystemNetworkConnections is the metric conforming to the
+ // "system.network.connections" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkConnectionsName = "system.network.connections"
+ SystemNetworkConnectionsUnit = "{connection}"
+
+ // SystemProcessCount is the metric conforming to the "system.process.count"
+ // semantic conventions. It represents the total number of processes in each
+ // state.
+ // Instrument: updowncounter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessCountName = "system.process.count"
+ SystemProcessCountUnit = "{process}"
+ SystemProcessCountDescription = "Total number of processes in each state"
+
+ // SystemProcessCreated is the metric conforming to the
+ // "system.process.created" semantic conventions. It represents the total
+ // number of processes created over uptime of the host.
+ // Instrument: counter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessCreatedName = "system.process.created"
+ SystemProcessCreatedUnit = "{process}"
+ SystemProcessCreatedDescription = "Total number of processes created over uptime of the host"
+
+ // SystemLinuxMemoryAvailable is the metric conforming to the
+ // "system.linux.memory.available" semantic conventions. It represents an
+ // estimate of how much memory is available for starting new applications,
+ // without causing swapping.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemLinuxMemoryAvailableName = "system.linux.memory.available"
+ SystemLinuxMemoryAvailableUnit = "By"
+ SystemLinuxMemoryAvailableDescription = "An estimate of how much memory is available for starting new applications, without causing swapping"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go
new file mode 100644
index 00000000000..4c87c7adcc7
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.26.0"
diff --git a/vendor/go.opentelemetry.io/otel/trace.go b/vendor/go.opentelemetry.io/otel/trace.go
index caf7249de85..6836c65478b 100644
--- a/vendor/go.opentelemetry.io/otel/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/trace/README.md b/vendor/go.opentelemetry.io/otel/trace/README.md
new file mode 100644
index 00000000000..58ccaba69b1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/README.md
@@ -0,0 +1,3 @@
+# Trace API
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace)](https://pkg.go.dev/go.opentelemetry.io/otel/trace)
diff --git a/vendor/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go
index 3aadc66cf7a..273d58e0014 100644
--- a/vendor/go.opentelemetry.io/otel/trace/config.go
+++ b/vendor/go.opentelemetry.io/otel/trace/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go
index 76f9a083c40..5650a174b4a 100644
--- a/vendor/go.opentelemetry.io/otel/trace/context.go
+++ b/vendor/go.opentelemetry.io/otel/trace/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -47,12 +36,12 @@ func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) conte
// performs no operations is returned.
func SpanFromContext(ctx context.Context) Span {
if ctx == nil {
- return noopSpan{}
+ return noopSpanInstance
}
if span, ok := ctx.Value(currentSpanKey).(Span); ok {
return span
}
- return noopSpan{}
+ return noopSpanInstance
}
// SpanContextFromContext returns the current Span's SpanContext.
diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go
index 440f3d7565a..d661c5d100f 100644
--- a/vendor/go.opentelemetry.io/otel/trace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/trace/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package trace provides an implementation of the tracing part of the
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/README.md b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
new file mode 100644
index 00000000000..7754a239ee6
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
@@ -0,0 +1,3 @@
+# Trace Embedded
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/trace/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
index 898db5a7546..3e359a00bf4 100644
--- a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package embedded provides interfaces embedded within the [OpenTelemetry
// trace API].
diff --git a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
index 88fcb81611f..c00221e7be9 100644
--- a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
+++ b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go
index c125491caeb..ca20e9997ab 100644
--- a/vendor/go.opentelemetry.io/otel/trace/noop.go
+++ b/vendor/go.opentelemetry.io/otel/trace/noop.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -52,7 +41,7 @@ func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption
span := SpanFromContext(ctx)
if _, ok := span.(nonRecordingSpan); !ok {
// span is likely already a noopSpan, but let's be sure
- span = noopSpan{}
+ span = noopSpanInstance
}
return ContextWithSpan(ctx, span), span
}
@@ -60,7 +49,7 @@ func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption
// noopSpan is an implementation of Span that performs no operations.
type noopSpan struct{ embedded.Span }
-var _ Span = noopSpan{}
+var noopSpanInstance Span = noopSpan{}
// SpanContext returns an empty span context.
func (noopSpan) SpanContext() SpanContext { return SpanContext{} }
@@ -86,6 +75,9 @@ func (noopSpan) RecordError(error, ...EventOption) {}
// AddEvent does nothing.
func (noopSpan) AddEvent(string, ...EventOption) {}
+// AddLink does nothing.
+func (noopSpan) AddLink(Link) {}
+
// SetName does nothing.
func (noopSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop/README.md b/vendor/go.opentelemetry.io/otel/trace/noop/README.md
new file mode 100644
index 00000000000..cd382c82a1a
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/noop/README.md
@@ -0,0 +1,3 @@
+# Trace Noop
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace/noop)](https://pkg.go.dev/go.opentelemetry.io/otel/trace/noop)
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
index 7f485543c47..64a4f1b362f 100644
--- a/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
+++ b/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package noop provides an implementation of the OpenTelemetry trace API that
// produces no telemetry and minimizes used computation resources.
@@ -78,11 +67,13 @@ func (t Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption)
span = Span{sc: sc}
} else {
// No parent, return a No-Op span with an empty span context.
- span = Span{}
+ span = noopSpanInstance
}
return trace.ContextWithSpan(ctx, span), span
}
+var noopSpanInstance trace.Span = Span{}
+
// Span is an OpenTelemetry No-Op Span.
type Span struct {
embedded.Span
@@ -111,6 +102,9 @@ func (Span) RecordError(error, ...trace.EventOption) {}
// AddEvent does nothing.
func (Span) AddEvent(string, ...trace.EventOption) {}
+// AddLink does nothing.
+func (Span) AddLink(trace.Link) {}
+
// SetName does nothing.
func (Span) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go
index 26a4b2260ec..28877d4ab4d 100644
--- a/vendor/go.opentelemetry.io/otel/trace/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -361,6 +350,12 @@ type Span interface {
// AddEvent adds an event with the provided name and options.
AddEvent(name string, options ...EventOption)
+ // AddLink adds a link.
+ // Adding links at span creation using WithLinks is preferred to calling AddLink
+ // later, for contexts that are available during span creation, because head
+ // sampling decisions can only consider information present during span creation.
+ AddLink(link Link)
+
// IsRecording returns the recording state of the Span. It will return
// true if the Span is active and events can be recorded.
IsRecording() bool
diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
index d1e47ca2faa..20b5cf24332 100644
--- a/vendor/go.opentelemetry.io/otel/trace/tracestate.go
+++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
@@ -1,36 +1,19 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
import (
"encoding/json"
"fmt"
- "regexp"
"strings"
)
const (
maxListMembers = 32
- listDelimiter = ","
-
- // based on the W3C Trace Context specification, see
- // https://www.w3.org/TR/trace-context-1/#tracestate-header
- noTenantKeyFormat = `[a-z][_0-9a-z\-\*\/]*`
- withTenantKeyFormat = `[a-z0-9][_0-9a-z\-\*\/]*@[a-z][_0-9a-z\-\*\/]*`
- valueFormat = `[\x20-\x2b\x2d-\x3c\x3e-\x7e]*[\x21-\x2b\x2d-\x3c\x3e-\x7e]`
+ listDelimiters = ","
+ memberDelimiter = "="
errInvalidKey errorConst = "invalid tracestate key"
errInvalidValue errorConst = "invalid tracestate value"
@@ -39,43 +22,128 @@ const (
errDuplicate errorConst = "duplicate list-member in tracestate"
)
-var (
- noTenantKeyRe = regexp.MustCompile(`^` + noTenantKeyFormat + `$`)
- withTenantKeyRe = regexp.MustCompile(`^` + withTenantKeyFormat + `$`)
- valueRe = regexp.MustCompile(`^` + valueFormat + `$`)
- memberRe = regexp.MustCompile(`^\s*((?:` + noTenantKeyFormat + `)|(?:` + withTenantKeyFormat + `))=(` + valueFormat + `)\s*$`)
-)
-
type member struct {
Key string
Value string
}
-func newMember(key, value string) (member, error) {
- if len(key) > 256 {
- return member{}, fmt.Errorf("%w: %s", errInvalidKey, key)
+// according to (chr = %x20 / (nblk-char = %x21-2B / %x2D-3C / %x3E-7E) )
+// means (chr = %x20-2B / %x2D-3C / %x3E-7E) .
+func checkValueChar(v byte) bool {
+ return v >= '\x20' && v <= '\x7e' && v != '\x2c' && v != '\x3d'
+}
+
+// according to (nblk-chr = %x21-2B / %x2D-3C / %x3E-7E) .
+func checkValueLast(v byte) bool {
+ return v >= '\x21' && v <= '\x7e' && v != '\x2c' && v != '\x3d'
+}
+
+// based on the W3C Trace Context specification
+//
+// value = (0*255(chr)) nblk-chr
+// nblk-chr = %x21-2B / %x2D-3C / %x3E-7E
+// chr = %x20 / nblk-chr
+//
+// see https://www.w3.org/TR/trace-context-1/#value
+func checkValue(val string) bool {
+ n := len(val)
+ if n == 0 || n > 256 {
+ return false
}
- if !noTenantKeyRe.MatchString(key) {
- if !withTenantKeyRe.MatchString(key) {
- return member{}, fmt.Errorf("%w: %s", errInvalidKey, key)
+ for i := 0; i < n-1; i++ {
+ if !checkValueChar(val[i]) {
+ return false
}
- atIndex := strings.LastIndex(key, "@")
- if atIndex > 241 || len(key)-1-atIndex > 14 {
- return member{}, fmt.Errorf("%w: %s", errInvalidKey, key)
+ }
+ return checkValueLast(val[n-1])
+}
+
+func checkKeyRemain(key string) bool {
+ // ( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
+ for _, v := range key {
+ if isAlphaNum(byte(v)) {
+ continue
}
+ switch v {
+ case '_', '-', '*', '/':
+ continue
+ }
+ return false
}
- if len(value) > 256 || !valueRe.MatchString(value) {
- return member{}, fmt.Errorf("%w: %s", errInvalidValue, value)
+ return true
+}
+
+// according to
+//
+// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+//
+// param n is remain part length, should be 255 in simple-key or 13 in system-id.
+func checkKeyPart(key string, n int) bool {
+ if len(key) == 0 {
+ return false
+ }
+ first := key[0] // key's first char
+ ret := len(key[1:]) <= n
+ ret = ret && first >= 'a' && first <= 'z'
+ return ret && checkKeyRemain(key[1:])
+}
+
+func isAlphaNum(c byte) bool {
+ if c >= 'a' && c <= 'z' {
+ return true
+ }
+ return c >= '0' && c <= '9'
+}
+
+// according to
+//
+// tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
+//
+// param n is remain part length, should be 240 exactly.
+func checkKeyTenant(key string, n int) bool {
+ if len(key) == 0 {
+ return false
+ }
+ return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:])
+}
+
+// based on the W3C Trace Context specification
+//
+// key = simple-key / multi-tenant-key
+// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// multi-tenant-key = tenant-id "@" system-id
+// tenant-id = ( lcalpha / DIGIT ) (0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// lcalpha = %x61-7A ; a-z
+//
+// see https://www.w3.org/TR/trace-context-1/#tracestate-header.
+func checkKey(key string) bool {
+ tenant, system, ok := strings.Cut(key, "@")
+ if !ok {
+ return checkKeyPart(key, 255)
+ }
+ return checkKeyTenant(tenant, 240) && checkKeyPart(system, 13)
+}
+
+func newMember(key, value string) (member, error) {
+ if !checkKey(key) {
+ return member{}, errInvalidKey
+ }
+ if !checkValue(value) {
+ return member{}, errInvalidValue
}
return member{Key: key, Value: value}, nil
}
func parseMember(m string) (member, error) {
- matches := memberRe.FindStringSubmatch(m)
- if len(matches) != 3 {
+ key, val, ok := strings.Cut(m, memberDelimiter)
+ if !ok {
return member{}, fmt.Errorf("%w: %s", errInvalidMember, m)
}
- result, e := newMember(matches[1], matches[2])
+ key = strings.TrimLeft(key, " \t")
+ val = strings.TrimRight(val, " \t")
+ result, e := newMember(key, val)
if e != nil {
return member{}, fmt.Errorf("%w: %s", errInvalidMember, m)
}
@@ -85,7 +153,7 @@ func parseMember(m string) (member, error) {
// String encodes member into a string compliant with the W3C Trace Context
// specification.
func (m member) String() string {
- return fmt.Sprintf("%s=%s", m.Key, m.Value)
+ return m.Key + "=" + m.Value
}
// TraceState provides additional vendor-specific trace identification
@@ -109,8 +177,8 @@ var _ json.Marshaler = TraceState{}
// ParseTraceState attempts to decode a TraceState from the passed
// string. It returns an error if the input is invalid according to the W3C
// Trace Context specification.
-func ParseTraceState(tracestate string) (TraceState, error) {
- if tracestate == "" {
+func ParseTraceState(ts string) (TraceState, error) {
+ if ts == "" {
return TraceState{}, nil
}
@@ -120,7 +188,9 @@ func ParseTraceState(tracestate string) (TraceState, error) {
var members []member
found := make(map[string]struct{})
- for _, memberStr := range strings.Split(tracestate, listDelimiter) {
+ for ts != "" {
+ var memberStr string
+ memberStr, ts, _ = strings.Cut(ts, listDelimiters)
if len(memberStr) == 0 {
continue
}
@@ -153,11 +223,29 @@ func (ts TraceState) MarshalJSON() ([]byte, error) {
// Trace Context specification. The returned string will be invalid if the
// TraceState contains any invalid members.
func (ts TraceState) String() string {
- members := make([]string, len(ts.list))
- for i, m := range ts.list {
- members[i] = m.String()
+ if len(ts.list) == 0 {
+ return ""
+ }
+ var n int
+ n += len(ts.list) // member delimiters: '='
+ n += len(ts.list) - 1 // list delimiters: ','
+ for _, mem := range ts.list {
+ n += len(mem.Key)
+ n += len(mem.Value)
}
- return strings.Join(members, listDelimiter)
+
+ var sb strings.Builder
+ sb.Grow(n)
+ _, _ = sb.WriteString(ts.list[0].Key)
+ _ = sb.WriteByte('=')
+ _, _ = sb.WriteString(ts.list[0].Value)
+ for i := 1; i < len(ts.list); i++ {
+ _ = sb.WriteByte(listDelimiters[0])
+ _, _ = sb.WriteString(ts.list[i].Key)
+ _ = sb.WriteByte('=')
+ _, _ = sb.WriteString(ts.list[i].Value)
+ }
+ return sb.String()
}
// Get returns the value paired with key from the corresponding TraceState
@@ -189,15 +277,25 @@ func (ts TraceState) Insert(key, value string) (TraceState, error) {
if err != nil {
return ts, err
}
-
- cTS := ts.Delete(key)
- if cTS.Len()+1 <= maxListMembers {
- cTS.list = append(cTS.list, member{})
+ n := len(ts.list)
+ found := n
+ for i := range ts.list {
+ if ts.list[i].Key == key {
+ found = i
+ }
+ }
+ cTS := TraceState{}
+ if found == n && n < maxListMembers {
+ cTS.list = make([]member, n+1)
+ } else {
+ cTS.list = make([]member, n)
}
- // When the number of members exceeds capacity, drop the "right-most".
- copy(cTS.list[1:], cTS.list)
cTS.list[0] = m
-
+ // When the number of members exceeds capacity, drop the "right-most".
+ copy(cTS.list[1:], ts.list[0:found])
+ if found < n {
+ copy(cTS.list[1+found:], ts.list[found+1:])
+ }
return cTS, nil
}
diff --git a/vendor/go.opentelemetry.io/otel/verify_examples.sh b/vendor/go.opentelemetry.io/otel/verify_examples.sh
index dbb61a42279..e57bf57fce8 100644
--- a/vendor/go.opentelemetry.io/otel/verify_examples.sh
+++ b/vendor/go.opentelemetry.io/otel/verify_examples.sh
@@ -1,18 +1,7 @@
#!/bin/bash
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
diff --git a/vendor/go.opentelemetry.io/otel/verify_readmes.sh b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
new file mode 100644
index 00000000000..1e87855eeaa
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+set -euo pipefail
+
+dirs=$(find . -type d -not -path "*/internal*" -not -path "*/test*" -not -path "*/example*" -not -path "*/.*" | sort)
+
+missingReadme=false
+for dir in $dirs; do
+ if [ ! -f "$dir/README.md" ]; then
+ echo "couldn't find README.md for $dir"
+ missingReadme=true
+ fi
+done
+
+if [ "$missingReadme" = true ] ; then
+ echo "Error: some READMEs couldn't be found."
+ exit 1
+fi
diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go
index 5a92f1d4b6c..ab28960524b 100644
--- a/vendor/go.opentelemetry.io/otel/version.go
+++ b/vendor/go.opentelemetry.io/otel/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
// Version is the current release version of OpenTelemetry in use.
func Version() string {
- return "1.20.0"
+ return "1.28.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml
index 82366e79981..241cfc82a8d 100644
--- a/vendor/go.opentelemetry.io/otel/versions.yaml
+++ b/vendor/go.opentelemetry.io/otel/versions.yaml
@@ -1,33 +1,27 @@
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
module-sets:
stable-v1:
- version: v1.20.0
+ version: v1.28.0
modules:
- go.opentelemetry.io/otel
+ - go.opentelemetry.io/otel/bridge/opencensus
+ - go.opentelemetry.io/otel/bridge/opencensus/test
- go.opentelemetry.io/otel/bridge/opentracing
- go.opentelemetry.io/otel/bridge/opentracing/test
- go.opentelemetry.io/otel/example/dice
- - go.opentelemetry.io/otel/example/fib
- go.opentelemetry.io/otel/example/namedtracer
+ - go.opentelemetry.io/otel/example/opencensus
- go.opentelemetry.io/otel/example/otel-collector
- go.opentelemetry.io/otel/example/passthrough
- go.opentelemetry.io/otel/example/zipkin
+ - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
+ - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
- go.opentelemetry.io/otel/exporters/otlp/otlptrace
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
+ - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
- go.opentelemetry.io/otel/exporters/stdout/stdouttrace
- go.opentelemetry.io/otel/exporters/zipkin
- go.opentelemetry.io/otel/metric
@@ -35,21 +29,21 @@ module-sets:
- go.opentelemetry.io/otel/sdk/metric
- go.opentelemetry.io/otel/trace
experimental-metrics:
- version: v0.43.0
+ version: v0.50.0
modules:
- - go.opentelemetry.io/otel/bridge/opencensus
- - go.opentelemetry.io/otel/bridge/opencensus/test
- - go.opentelemetry.io/otel/example/opencensus
- go.opentelemetry.io/otel/example/prometheus
- - go.opentelemetry.io/otel/example/view
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
- go.opentelemetry.io/otel/exporters/prometheus
- - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
+ experimental-logs:
+ version: v0.4.0
+ modules:
+ - go.opentelemetry.io/otel/log
+ - go.opentelemetry.io/otel/sdk/log
+ - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
+ - go.opentelemetry.io/otel/exporters/stdout/stdoutlog
experimental-schema:
- version: v0.0.7
+ version: v0.0.8
modules:
- go.opentelemetry.io/otel/schema
excluded-modules:
- go.opentelemetry.io/otel/internal/tools
+ - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc
diff --git a/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go b/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go
index 51a499816a6..d7099c35bc4 100644
--- a/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go
+++ b/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go
@@ -36,6 +36,78 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
+// SpanFlags represents constants used to interpret the
+// Span.flags field, which is protobuf 'fixed32' type and is to
+// be used as bit-fields. Each non-zero value defined in this enum is
+// a bit-mask. To extract the bit-field, for example, use an
+// expression like:
+//
+// (span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK)
+//
+// See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
+//
+// Note that Span flags were introduced in version 1.1 of the
+// OpenTelemetry protocol. Older Span producers do not set this
+// field, consequently consumers should not rely on the absence of a
+// particular flag bit to indicate the presence of a particular feature.
+type SpanFlags int32
+
+const (
+ // The zero value for the enum. Should not be used for comparisons.
+ // Instead use bitwise "and" with the appropriate mask as shown above.
+ SpanFlags_SPAN_FLAGS_DO_NOT_USE SpanFlags = 0
+ // Bits 0-7 are used for trace flags.
+ SpanFlags_SPAN_FLAGS_TRACE_FLAGS_MASK SpanFlags = 255
+ // Bits 8 and 9 are used to indicate that the parent span or link span is remote.
+ // Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known.
+ // Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote.
+ SpanFlags_SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK SpanFlags = 256
+ SpanFlags_SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK SpanFlags = 512
+)
+
+// Enum value maps for SpanFlags.
+var (
+ SpanFlags_name = map[int32]string{
+ 0: "SPAN_FLAGS_DO_NOT_USE",
+ 255: "SPAN_FLAGS_TRACE_FLAGS_MASK",
+ 256: "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK",
+ 512: "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK",
+ }
+ SpanFlags_value = map[string]int32{
+ "SPAN_FLAGS_DO_NOT_USE": 0,
+ "SPAN_FLAGS_TRACE_FLAGS_MASK": 255,
+ "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK": 256,
+ "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK": 512,
+ }
+)
+
+func (x SpanFlags) Enum() *SpanFlags {
+ p := new(SpanFlags)
+ *p = x
+ return p
+}
+
+func (x SpanFlags) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (SpanFlags) Descriptor() protoreflect.EnumDescriptor {
+ return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0].Descriptor()
+}
+
+func (SpanFlags) Type() protoreflect.EnumType {
+ return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0]
+}
+
+func (x SpanFlags) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use SpanFlags.Descriptor instead.
+func (SpanFlags) EnumDescriptor() ([]byte, []int) {
+ return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{0}
+}
+
// SpanKind is the type of span. Can be used to specify additional relationships between spans
// in addition to a parent/child relationship.
type Span_SpanKind int32
@@ -94,11 +166,11 @@ func (x Span_SpanKind) String() string {
}
func (Span_SpanKind) Descriptor() protoreflect.EnumDescriptor {
- return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0].Descriptor()
+ return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1].Descriptor()
}
func (Span_SpanKind) Type() protoreflect.EnumType {
- return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0]
+ return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1]
}
func (x Span_SpanKind) Number() protoreflect.EnumNumber {
@@ -149,11 +221,11 @@ func (x Status_StatusCode) String() string {
}
func (Status_StatusCode) Descriptor() protoreflect.EnumDescriptor {
- return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1].Descriptor()
+ return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[2].Descriptor()
}
func (Status_StatusCode) Type() protoreflect.EnumType {
- return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1]
+ return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[2]
}
func (x Status_StatusCode) Number() protoreflect.EnumNumber {
@@ -238,6 +310,9 @@ type ResourceSpans struct {
Resource *v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
// A list of ScopeSpans that originate from a resource.
ScopeSpans []*ScopeSpans `protobuf:"bytes,2,rep,name=scope_spans,json=scopeSpans,proto3" json:"scope_spans,omitempty"`
+ // The Schema URL, if known. This is the identifier of the Schema that the resource data
+ // is recorded in. To learn more about Schema URL see
+ // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to the data in the "resource" field. It does not apply
// to the data in the "scope_spans" field which have their own schema_url field.
SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"`
@@ -308,6 +383,9 @@ type ScopeSpans struct {
Scope *v11.InstrumentationScope `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"`
// A list of Spans that originate from an instrumentation scope.
Spans []*Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"`
+ // The Schema URL, if known. This is the identifier of the Schema that the span data
+ // is recorded in. To learn more about Schema URL see
+ // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to all spans and span events in the "spans" field.
SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"`
}
@@ -394,6 +472,28 @@ type Span struct {
// The `span_id` of this span's parent span. If this is a root span, then this
// field must be empty. The ID is an 8-byte array.
ParentSpanId []byte `protobuf:"bytes,4,opt,name=parent_span_id,json=parentSpanId,proto3" json:"parent_span_id,omitempty"`
+ // Flags, a bit field.
+ //
+ // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
+ // Context specification. To read the 8-bit W3C trace flag, use
+ // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
+ //
+ // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
+ //
+ // Bits 8 and 9 represent the 3 states of whether a span's parent
+ // is remote. The states are (unknown, is not remote, is remote).
+ // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
+ // To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
+ //
+ // When creating span messages, if the message is logically forwarded from another source
+ // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD
+ // be copied as-is. If creating from a source that does not have an equivalent flags field
+ // (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST
+ // be set to zero.
+ // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
+ //
+ // [Optional].
+ Flags uint32 `protobuf:"fixed32,16,opt,name=flags,proto3" json:"flags,omitempty"`
// A description of the span's operation.
//
// For example, the name can be a qualified method name or a file name
@@ -517,6 +617,13 @@ func (x *Span) GetParentSpanId() []byte {
return nil
}
+func (x *Span) GetFlags() uint32 {
+ if x != nil {
+ return x.Flags
+ }
+ return 0
+}
+
func (x *Span) GetName() string {
if x != nil {
return x.Name
@@ -757,6 +864,24 @@ type Span_Link struct {
// dropped_attributes_count is the number of dropped attributes. If the value is 0,
// then no attributes were dropped.
DroppedAttributesCount uint32 `protobuf:"varint,5,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"`
+ // Flags, a bit field.
+ //
+ // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
+ // Context specification. To read the 8-bit W3C trace flag, use
+ // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
+ //
+ // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
+ //
+ // Bits 8 and 9 represent the 3 states of whether the link is remote.
+ // The states are (unknown, is not remote, is remote).
+ // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
+ // To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
+ //
+ // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
+ // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero.
+ //
+ // [Optional].
+ Flags uint32 `protobuf:"fixed32,6,opt,name=flags,proto3" json:"flags,omitempty"`
}
func (x *Span_Link) Reset() {
@@ -826,6 +951,13 @@ func (x *Span_Link) GetDroppedAttributesCount() uint32 {
return 0
}
+func (x *Span_Link) GetFlags() uint32 {
+ if x != nil {
+ return x.Flags
+ }
+ return 0
+}
+
var File_opentelemetry_proto_trace_v1_trace_proto protoreflect.FileDescriptor
var file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = []byte{
@@ -869,7 +1001,7 @@ var file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = []byte{
0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x05,
0x73, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f,
0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x55, 0x72, 0x6c, 0x22, 0x9c, 0x0a, 0x0a, 0x04, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x19, 0x0a,
+ 0x61, 0x55, 0x72, 0x6c, 0x22, 0xc8, 0x0a, 0x0a, 0x04, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x19, 0x0a,
0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e,
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49,
@@ -877,101 +1009,113 @@ var file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = []byte{
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61,
0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x70, 0x61,
0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65,
- 0x6e, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04,
- 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65,
- 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x53,
- 0x70, 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x2f, 0x0a,
- 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78,
- 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x06, 0x52, 0x11, 0x73, 0x74, 0x61,
- 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x2b,
- 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f,
- 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0f, 0x65, 0x6e, 0x64, 0x54,
- 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x47, 0x0a, 0x0a, 0x61,
- 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
- 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62,
- 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f,
- 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74,
- 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41,
- 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x40,
- 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28,
- 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70,
- 0x61, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
- 0x12, 0x30, 0x0a, 0x14, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e,
- 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75,
- 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
- 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b,
- 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e,
- 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x43, 0x6f, 0x75, 0x6e,
- 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
- 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a,
- 0xc4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d,
- 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12,
- 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
- 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
- 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f,
- 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65,
- 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
- 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xde, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12,
- 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70,
- 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61,
- 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61,
- 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53,
- 0x74, 0x61, 0x74, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74,
- 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63,
- 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a,
- 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
- 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52,
- 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x08, 0x53, 0x70, 0x61, 0x6e,
- 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e,
- 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x54,
- 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41, 0x4e, 0x5f,
- 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x14, 0x0a,
- 0x10, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e,
- 0x54, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44,
- 0x5f, 0x50, 0x52, 0x4f, 0x44, 0x55, 0x43, 0x45, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53,
- 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x55, 0x4d, 0x45,
- 0x52, 0x10, 0x05, 0x22, 0xbd, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18,
- 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c,
- 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61,
- 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61,
- 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x4e, 0x0a,
- 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53,
- 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54,
- 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44,
- 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53,
- 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x4a, 0x04, 0x08,
- 0x01, 0x10, 0x02, 0x42, 0x77, 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67,
+ 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x12,
+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e,
+ 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b,
+ 0x69, 0x6e, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d,
+ 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28,
+ 0x06, 0x52, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78,
+ 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x2b, 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
+ 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x06,
+ 0x52, 0x0f, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e,
+ 0x6f, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18,
+ 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a,
+ 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72,
+ 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
+ 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72,
+ 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43,
+ 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0b,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65,
+ 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c,
+ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b,
+ 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72,
- 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f,
- 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c,
- 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
- 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1c,
- 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x33,
+ 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x4c, 0x69, 0x6e, 0x6b,
+ 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x72, 0x6f, 0x70, 0x70,
+ 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e,
+ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x4c, 0x69, 0x6e,
+ 0x6b, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
+ 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72,
+ 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0xc4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12,
+ 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e,
+ 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69,
+ 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e,
+ 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65,
+ 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xf4, 0x01, 0x0a,
+ 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69,
+ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64,
+ 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x61,
+ 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
+ 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b,
+ 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a,
+ 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x66, 0x6c,
+ 0x61, 0x67, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x08, 0x53, 0x70, 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64,
+ 0x12, 0x19, 0x0a, 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e,
+ 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x53,
+ 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41,
+ 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44,
+ 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41,
+ 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12,
+ 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x50, 0x52, 0x4f,
+ 0x44, 0x55, 0x43, 0x45, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f,
+ 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x55, 0x4d, 0x45, 0x52, 0x10, 0x05, 0x22,
+ 0xbd, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
+ 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43,
+ 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x4e, 0x0a, 0x0a, 0x53, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55,
+ 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54, 0x10, 0x00, 0x12, 0x12,
+ 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4b,
+ 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44,
+ 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x2a,
+ 0x9c, 0x01, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x19, 0x0a,
+ 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x4f, 0x5f, 0x4e,
+ 0x4f, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1b, 0x53, 0x50, 0x41, 0x4e,
+ 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x46, 0x4c, 0x41,
+ 0x47, 0x53, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x10, 0xff, 0x01, 0x12, 0x2a, 0x0a, 0x25, 0x53, 0x50,
+ 0x41, 0x4e, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x58, 0x54,
+ 0x5f, 0x48, 0x41, 0x53, 0x5f, 0x49, 0x53, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4d,
+ 0x41, 0x53, 0x4b, 0x10, 0x80, 0x02, 0x12, 0x26, 0x0a, 0x21, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x46,
+ 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x58, 0x54, 0x5f, 0x49, 0x53, 0x5f,
+ 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x10, 0x80, 0x04, 0x42, 0x77,
+ 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
+ 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76,
+ 0x31, 0x42, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
+ 0x27, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
+ 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f,
+ 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1c, 0x4f, 0x70, 0x65, 0x6e, 0x54,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54,
+ 0x72, 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -986,36 +1130,37 @@ func file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP() []byte {
return file_opentelemetry_proto_trace_v1_trace_proto_rawDescData
}
-var file_opentelemetry_proto_trace_v1_trace_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_opentelemetry_proto_trace_v1_trace_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_opentelemetry_proto_trace_v1_trace_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_opentelemetry_proto_trace_v1_trace_proto_goTypes = []interface{}{
- (Span_SpanKind)(0), // 0: opentelemetry.proto.trace.v1.Span.SpanKind
- (Status_StatusCode)(0), // 1: opentelemetry.proto.trace.v1.Status.StatusCode
- (*TracesData)(nil), // 2: opentelemetry.proto.trace.v1.TracesData
- (*ResourceSpans)(nil), // 3: opentelemetry.proto.trace.v1.ResourceSpans
- (*ScopeSpans)(nil), // 4: opentelemetry.proto.trace.v1.ScopeSpans
- (*Span)(nil), // 5: opentelemetry.proto.trace.v1.Span
- (*Status)(nil), // 6: opentelemetry.proto.trace.v1.Status
- (*Span_Event)(nil), // 7: opentelemetry.proto.trace.v1.Span.Event
- (*Span_Link)(nil), // 8: opentelemetry.proto.trace.v1.Span.Link
- (*v1.Resource)(nil), // 9: opentelemetry.proto.resource.v1.Resource
- (*v11.InstrumentationScope)(nil), // 10: opentelemetry.proto.common.v1.InstrumentationScope
- (*v11.KeyValue)(nil), // 11: opentelemetry.proto.common.v1.KeyValue
+ (SpanFlags)(0), // 0: opentelemetry.proto.trace.v1.SpanFlags
+ (Span_SpanKind)(0), // 1: opentelemetry.proto.trace.v1.Span.SpanKind
+ (Status_StatusCode)(0), // 2: opentelemetry.proto.trace.v1.Status.StatusCode
+ (*TracesData)(nil), // 3: opentelemetry.proto.trace.v1.TracesData
+ (*ResourceSpans)(nil), // 4: opentelemetry.proto.trace.v1.ResourceSpans
+ (*ScopeSpans)(nil), // 5: opentelemetry.proto.trace.v1.ScopeSpans
+ (*Span)(nil), // 6: opentelemetry.proto.trace.v1.Span
+ (*Status)(nil), // 7: opentelemetry.proto.trace.v1.Status
+ (*Span_Event)(nil), // 8: opentelemetry.proto.trace.v1.Span.Event
+ (*Span_Link)(nil), // 9: opentelemetry.proto.trace.v1.Span.Link
+ (*v1.Resource)(nil), // 10: opentelemetry.proto.resource.v1.Resource
+ (*v11.InstrumentationScope)(nil), // 11: opentelemetry.proto.common.v1.InstrumentationScope
+ (*v11.KeyValue)(nil), // 12: opentelemetry.proto.common.v1.KeyValue
}
var file_opentelemetry_proto_trace_v1_trace_proto_depIdxs = []int32{
- 3, // 0: opentelemetry.proto.trace.v1.TracesData.resource_spans:type_name -> opentelemetry.proto.trace.v1.ResourceSpans
- 9, // 1: opentelemetry.proto.trace.v1.ResourceSpans.resource:type_name -> opentelemetry.proto.resource.v1.Resource
- 4, // 2: opentelemetry.proto.trace.v1.ResourceSpans.scope_spans:type_name -> opentelemetry.proto.trace.v1.ScopeSpans
- 10, // 3: opentelemetry.proto.trace.v1.ScopeSpans.scope:type_name -> opentelemetry.proto.common.v1.InstrumentationScope
- 5, // 4: opentelemetry.proto.trace.v1.ScopeSpans.spans:type_name -> opentelemetry.proto.trace.v1.Span
- 0, // 5: opentelemetry.proto.trace.v1.Span.kind:type_name -> opentelemetry.proto.trace.v1.Span.SpanKind
- 11, // 6: opentelemetry.proto.trace.v1.Span.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
- 7, // 7: opentelemetry.proto.trace.v1.Span.events:type_name -> opentelemetry.proto.trace.v1.Span.Event
- 8, // 8: opentelemetry.proto.trace.v1.Span.links:type_name -> opentelemetry.proto.trace.v1.Span.Link
- 6, // 9: opentelemetry.proto.trace.v1.Span.status:type_name -> opentelemetry.proto.trace.v1.Status
- 1, // 10: opentelemetry.proto.trace.v1.Status.code:type_name -> opentelemetry.proto.trace.v1.Status.StatusCode
- 11, // 11: opentelemetry.proto.trace.v1.Span.Event.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
- 11, // 12: opentelemetry.proto.trace.v1.Span.Link.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
+ 4, // 0: opentelemetry.proto.trace.v1.TracesData.resource_spans:type_name -> opentelemetry.proto.trace.v1.ResourceSpans
+ 10, // 1: opentelemetry.proto.trace.v1.ResourceSpans.resource:type_name -> opentelemetry.proto.resource.v1.Resource
+ 5, // 2: opentelemetry.proto.trace.v1.ResourceSpans.scope_spans:type_name -> opentelemetry.proto.trace.v1.ScopeSpans
+ 11, // 3: opentelemetry.proto.trace.v1.ScopeSpans.scope:type_name -> opentelemetry.proto.common.v1.InstrumentationScope
+ 6, // 4: opentelemetry.proto.trace.v1.ScopeSpans.spans:type_name -> opentelemetry.proto.trace.v1.Span
+ 1, // 5: opentelemetry.proto.trace.v1.Span.kind:type_name -> opentelemetry.proto.trace.v1.Span.SpanKind
+ 12, // 6: opentelemetry.proto.trace.v1.Span.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
+ 8, // 7: opentelemetry.proto.trace.v1.Span.events:type_name -> opentelemetry.proto.trace.v1.Span.Event
+ 9, // 8: opentelemetry.proto.trace.v1.Span.links:type_name -> opentelemetry.proto.trace.v1.Span.Link
+ 7, // 9: opentelemetry.proto.trace.v1.Span.status:type_name -> opentelemetry.proto.trace.v1.Status
+ 2, // 10: opentelemetry.proto.trace.v1.Status.code:type_name -> opentelemetry.proto.trace.v1.Status.StatusCode
+ 12, // 11: opentelemetry.proto.trace.v1.Span.Event.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
+ 12, // 12: opentelemetry.proto.trace.v1.Span.Link.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
13, // [13:13] is the sub-list for method output_type
13, // [13:13] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
@@ -1119,7 +1264,7 @@ func file_opentelemetry_proto_trace_v1_trace_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_opentelemetry_proto_trace_v1_trace_proto_rawDesc,
- NumEnums: 2,
+ NumEnums: 3,
NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
diff --git a/vendor/golang.org/x/text/cases/cases.go b/vendor/golang.org/x/text/cases/cases.go
new file mode 100644
index 00000000000..752cdf03167
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/cases.go
@@ -0,0 +1,162 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:generate go run gen.go gen_trieval.go
+
+// Package cases provides general and language-specific case mappers.
+package cases // import "golang.org/x/text/cases"
+
+import (
+ "golang.org/x/text/language"
+ "golang.org/x/text/transform"
+)
+
+// References:
+// - Unicode Reference Manual Chapter 3.13, 4.2, and 5.18.
+// - https://www.unicode.org/reports/tr29/
+// - https://www.unicode.org/Public/6.3.0/ucd/CaseFolding.txt
+// - https://www.unicode.org/Public/6.3.0/ucd/SpecialCasing.txt
+// - https://www.unicode.org/Public/6.3.0/ucd/DerivedCoreProperties.txt
+// - https://www.unicode.org/Public/6.3.0/ucd/auxiliary/WordBreakProperty.txt
+// - https://www.unicode.org/Public/6.3.0/ucd/auxiliary/WordBreakTest.txt
+// - http://userguide.icu-project.org/transforms/casemappings
+
+// TODO:
+// - Case folding
+// - Wide and Narrow?
+// - Segmenter option for title casing.
+// - ASCII fast paths
+// - Encode Soft-Dotted property within trie somehow.
+
+// A Caser transforms given input to a certain case. It implements
+// transform.Transformer.
+//
+// A Caser may be stateful and should therefore not be shared between
+// goroutines.
+type Caser struct {
+ t transform.SpanningTransformer
+}
+
+// Bytes returns a new byte slice with the result of converting b to the case
+// form implemented by c.
+func (c Caser) Bytes(b []byte) []byte {
+ b, _, _ = transform.Bytes(c.t, b)
+ return b
+}
+
+// String returns a string with the result of transforming s to the case form
+// implemented by c.
+func (c Caser) String(s string) string {
+ s, _, _ = transform.String(c.t, s)
+ return s
+}
+
+// Reset resets the Caser to be reused for new input after a previous call to
+// Transform.
+func (c Caser) Reset() { c.t.Reset() }
+
+// Transform implements the transform.Transformer interface and transforms the
+// given input to the case form implemented by c.
+func (c Caser) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ return c.t.Transform(dst, src, atEOF)
+}
+
+// Span implements the transform.SpanningTransformer interface.
+func (c Caser) Span(src []byte, atEOF bool) (n int, err error) {
+ return c.t.Span(src, atEOF)
+}
+
+// Upper returns a Caser for language-specific uppercasing.
+func Upper(t language.Tag, opts ...Option) Caser {
+ return Caser{makeUpper(t, getOpts(opts...))}
+}
+
+// Lower returns a Caser for language-specific lowercasing.
+func Lower(t language.Tag, opts ...Option) Caser {
+ return Caser{makeLower(t, getOpts(opts...))}
+}
+
+// Title returns a Caser for language-specific title casing. It uses an
+// approximation of the default Unicode Word Break algorithm.
+func Title(t language.Tag, opts ...Option) Caser {
+ return Caser{makeTitle(t, getOpts(opts...))}
+}
+
+// Fold returns a Caser that implements Unicode case folding. The returned Caser
+// is stateless and safe to use concurrently by multiple goroutines.
+//
+// Case folding does not normalize the input and may not preserve a normal form.
+// Use the collate or search package for more convenient and linguistically
+// sound comparisons. Use golang.org/x/text/secure/precis for string comparisons
+// where security aspects are a concern.
+func Fold(opts ...Option) Caser {
+ return Caser{makeFold(getOpts(opts...))}
+}
+
+// An Option is used to modify the behavior of a Caser.
+type Option func(o options) options
+
+// TODO: consider these options to take a boolean as well, like FinalSigma.
+// The advantage of using this approach is that other providers of a lower-case
+// algorithm could set different defaults by prefixing a user-provided slice
+// of options with their own. This is handy, for instance, for the precis
+// package which would override the default to not handle the Greek final sigma.
+
+var (
+ // NoLower disables the lowercasing of non-leading letters for a title
+ // caser.
+ NoLower Option = noLower
+
+ // Compact omits mappings in case folding for characters that would grow the
+ // input. (Unimplemented.)
+ Compact Option = compact
+)
+
+// TODO: option to preserve a normal form, if applicable?
+
+type options struct {
+ noLower bool
+ simple bool
+
+ // TODO: segmenter, max ignorable, alternative versions, etc.
+
+ ignoreFinalSigma bool
+}
+
+func getOpts(o ...Option) (res options) {
+ for _, f := range o {
+ res = f(res)
+ }
+ return
+}
+
+func noLower(o options) options {
+ o.noLower = true
+ return o
+}
+
+func compact(o options) options {
+ o.simple = true
+ return o
+}
+
+// HandleFinalSigma specifies whether the special handling of Greek final sigma
+// should be enabled. Unicode prescribes handling the Greek final sigma for all
+// locales, but standards like IDNA and PRECIS override this default.
+func HandleFinalSigma(enable bool) Option {
+ if enable {
+ return handleFinalSigma
+ }
+ return ignoreFinalSigma
+}
+
+func ignoreFinalSigma(o options) options {
+ o.ignoreFinalSigma = true
+ return o
+}
+
+func handleFinalSigma(o options) options {
+ o.ignoreFinalSigma = false
+ return o
+}
diff --git a/vendor/golang.org/x/text/cases/context.go b/vendor/golang.org/x/text/cases/context.go
new file mode 100644
index 00000000000..e9aa9e1936f
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/context.go
@@ -0,0 +1,376 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cases
+
+import "golang.org/x/text/transform"
+
+// A context is used for iterating over source bytes, fetching case info and
+// writing to a destination buffer.
+//
+// Casing operations may need more than one rune of context to decide how a rune
+// should be cased. Casing implementations should call checkpoint on context
+// whenever it is known to be safe to return the runes processed so far.
+//
+// It is recommended for implementations to not allow for more than 30 case
+// ignorables as lookahead (analogous to the limit in norm) and to use state if
+// unbounded lookahead is needed for cased runes.
+type context struct {
+ dst, src []byte
+ atEOF bool
+
+ pDst int // pDst points past the last written rune in dst.
+ pSrc int // pSrc points to the start of the currently scanned rune.
+
+ // checkpoints safe to return in Transform, where nDst <= pDst and nSrc <= pSrc.
+ nDst, nSrc int
+ err error
+
+ sz int // size of current rune
+ info info // case information of currently scanned rune
+
+ // State preserved across calls to Transform.
+ isMidWord bool // false if next cased letter needs to be title-cased.
+}
+
+func (c *context) Reset() {
+ c.isMidWord = false
+}
+
+// ret returns the return values for the Transform method. It checks whether
+// there were insufficient bytes in src to complete and introduces an error
+// accordingly, if necessary.
+func (c *context) ret() (nDst, nSrc int, err error) {
+ if c.err != nil || c.nSrc == len(c.src) {
+ return c.nDst, c.nSrc, c.err
+ }
+ // This point is only reached by mappers if there was no short destination
+ // buffer. This means that the source buffer was exhausted and that c.sz was
+ // set to 0 by next.
+ if c.atEOF && c.pSrc == len(c.src) {
+ return c.pDst, c.pSrc, nil
+ }
+ return c.nDst, c.nSrc, transform.ErrShortSrc
+}
+
+// retSpan returns the return values for the Span method. It checks whether
+// there were insufficient bytes in src to complete and introduces an error
+// accordingly, if necessary.
+func (c *context) retSpan() (n int, err error) {
+ _, nSrc, err := c.ret()
+ return nSrc, err
+}
+
+// checkpoint sets the return value buffer points for Transform to the current
+// positions.
+func (c *context) checkpoint() {
+ if c.err == nil {
+ c.nDst, c.nSrc = c.pDst, c.pSrc+c.sz
+ }
+}
+
+// unreadRune causes the last rune read by next to be reread on the next
+// invocation of next. Only one unreadRune may be called after a call to next.
+func (c *context) unreadRune() {
+ c.sz = 0
+}
+
+func (c *context) next() bool {
+ c.pSrc += c.sz
+ if c.pSrc == len(c.src) || c.err != nil {
+ c.info, c.sz = 0, 0
+ return false
+ }
+ v, sz := trie.lookup(c.src[c.pSrc:])
+ c.info, c.sz = info(v), sz
+ if c.sz == 0 {
+ if c.atEOF {
+ // A zero size means we have an incomplete rune. If we are atEOF,
+ // this means it is an illegal rune, which we will consume one
+ // byte at a time.
+ c.sz = 1
+ } else {
+ c.err = transform.ErrShortSrc
+ return false
+ }
+ }
+ return true
+}
+
+// writeBytes adds bytes to dst.
+func (c *context) writeBytes(b []byte) bool {
+ if len(c.dst)-c.pDst < len(b) {
+ c.err = transform.ErrShortDst
+ return false
+ }
+ // This loop is faster than using copy.
+ for _, ch := range b {
+ c.dst[c.pDst] = ch
+ c.pDst++
+ }
+ return true
+}
+
+// writeString writes the given string to dst.
+func (c *context) writeString(s string) bool {
+ if len(c.dst)-c.pDst < len(s) {
+ c.err = transform.ErrShortDst
+ return false
+ }
+ // This loop is faster than using copy.
+ for i := 0; i < len(s); i++ {
+ c.dst[c.pDst] = s[i]
+ c.pDst++
+ }
+ return true
+}
+
+// copy writes the current rune to dst.
+func (c *context) copy() bool {
+ return c.writeBytes(c.src[c.pSrc : c.pSrc+c.sz])
+}
+
+// copyXOR copies the current rune to dst and modifies it by applying the XOR
+// pattern of the case info. It is the responsibility of the caller to ensure
+// that this is a rune with a XOR pattern defined.
+func (c *context) copyXOR() bool {
+ if !c.copy() {
+ return false
+ }
+ if c.info&xorIndexBit == 0 {
+ // Fast path for 6-bit XOR pattern, which covers most cases.
+ c.dst[c.pDst-1] ^= byte(c.info >> xorShift)
+ } else {
+ // Interpret XOR bits as an index.
+ // TODO: test performance for unrolling this loop. Verify that we have
+ // at least two bytes and at most three.
+ idx := c.info >> xorShift
+ for p := c.pDst - 1; ; p-- {
+ c.dst[p] ^= xorData[idx]
+ idx--
+ if xorData[idx] == 0 {
+ break
+ }
+ }
+ }
+ return true
+}
+
+// hasPrefix returns true if src[pSrc:] starts with the given string.
+func (c *context) hasPrefix(s string) bool {
+ b := c.src[c.pSrc:]
+ if len(b) < len(s) {
+ return false
+ }
+ for i, c := range b[:len(s)] {
+ if c != s[i] {
+ return false
+ }
+ }
+ return true
+}
+
+// caseType returns an info with only the case bits, normalized to either
+// cLower, cUpper, cTitle or cUncased.
+func (c *context) caseType() info {
+ cm := c.info & 0x7
+ if cm < 4 {
+ return cm
+ }
+ if cm >= cXORCase {
+ // xor the last bit of the rune with the case type bits.
+ b := c.src[c.pSrc+c.sz-1]
+ return info(b&1) ^ cm&0x3
+ }
+ if cm == cIgnorableCased {
+ return cLower
+ }
+ return cUncased
+}
+
+// lower writes the lowercase version of the current rune to dst.
+func lower(c *context) bool {
+ ct := c.caseType()
+ if c.info&hasMappingMask == 0 || ct == cLower {
+ return c.copy()
+ }
+ if c.info&exceptionBit == 0 {
+ return c.copyXOR()
+ }
+ e := exceptions[c.info>>exceptionShift:]
+ offset := 2 + e[0]&lengthMask // size of header + fold string
+ if nLower := (e[1] >> lengthBits) & lengthMask; nLower != noChange {
+ return c.writeString(e[offset : offset+nLower])
+ }
+ return c.copy()
+}
+
+func isLower(c *context) bool {
+ ct := c.caseType()
+ if c.info&hasMappingMask == 0 || ct == cLower {
+ return true
+ }
+ if c.info&exceptionBit == 0 {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ e := exceptions[c.info>>exceptionShift:]
+ if nLower := (e[1] >> lengthBits) & lengthMask; nLower != noChange {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ return true
+}
+
+// upper writes the uppercase version of the current rune to dst.
+func upper(c *context) bool {
+ ct := c.caseType()
+ if c.info&hasMappingMask == 0 || ct == cUpper {
+ return c.copy()
+ }
+ if c.info&exceptionBit == 0 {
+ return c.copyXOR()
+ }
+ e := exceptions[c.info>>exceptionShift:]
+ offset := 2 + e[0]&lengthMask // size of header + fold string
+ // Get length of first special case mapping.
+ n := (e[1] >> lengthBits) & lengthMask
+ if ct == cTitle {
+ // The first special case mapping is for lower. Set n to the second.
+ if n == noChange {
+ n = 0
+ }
+ n, e = e[1]&lengthMask, e[n:]
+ }
+ if n != noChange {
+ return c.writeString(e[offset : offset+n])
+ }
+ return c.copy()
+}
+
+// isUpper writes the isUppercase version of the current rune to dst.
+func isUpper(c *context) bool {
+ ct := c.caseType()
+ if c.info&hasMappingMask == 0 || ct == cUpper {
+ return true
+ }
+ if c.info&exceptionBit == 0 {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ e := exceptions[c.info>>exceptionShift:]
+ // Get length of first special case mapping.
+ n := (e[1] >> lengthBits) & lengthMask
+ if ct == cTitle {
+ n = e[1] & lengthMask
+ }
+ if n != noChange {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ return true
+}
+
+// title writes the title case version of the current rune to dst.
+func title(c *context) bool {
+ ct := c.caseType()
+ if c.info&hasMappingMask == 0 || ct == cTitle {
+ return c.copy()
+ }
+ if c.info&exceptionBit == 0 {
+ if ct == cLower {
+ return c.copyXOR()
+ }
+ return c.copy()
+ }
+ // Get the exception data.
+ e := exceptions[c.info>>exceptionShift:]
+ offset := 2 + e[0]&lengthMask // size of header + fold string
+
+ nFirst := (e[1] >> lengthBits) & lengthMask
+ if nTitle := e[1] & lengthMask; nTitle != noChange {
+ if nFirst != noChange {
+ e = e[nFirst:]
+ }
+ return c.writeString(e[offset : offset+nTitle])
+ }
+ if ct == cLower && nFirst != noChange {
+ // Use the uppercase version instead.
+ return c.writeString(e[offset : offset+nFirst])
+ }
+ // Already in correct case.
+ return c.copy()
+}
+
+// isTitle reports whether the current rune is in title case.
+func isTitle(c *context) bool {
+ ct := c.caseType()
+ if c.info&hasMappingMask == 0 || ct == cTitle {
+ return true
+ }
+ if c.info&exceptionBit == 0 {
+ if ct == cLower {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ return true
+ }
+ // Get the exception data.
+ e := exceptions[c.info>>exceptionShift:]
+ if nTitle := e[1] & lengthMask; nTitle != noChange {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ nFirst := (e[1] >> lengthBits) & lengthMask
+ if ct == cLower && nFirst != noChange {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ return true
+}
+
+// foldFull writes the foldFull version of the current rune to dst.
+func foldFull(c *context) bool {
+ if c.info&hasMappingMask == 0 {
+ return c.copy()
+ }
+ ct := c.caseType()
+ if c.info&exceptionBit == 0 {
+ if ct != cLower || c.info&inverseFoldBit != 0 {
+ return c.copyXOR()
+ }
+ return c.copy()
+ }
+ e := exceptions[c.info>>exceptionShift:]
+ n := e[0] & lengthMask
+ if n == 0 {
+ if ct == cLower {
+ return c.copy()
+ }
+ n = (e[1] >> lengthBits) & lengthMask
+ }
+ return c.writeString(e[2 : 2+n])
+}
+
+// isFoldFull reports whether the current run is mapped to foldFull
+func isFoldFull(c *context) bool {
+ if c.info&hasMappingMask == 0 {
+ return true
+ }
+ ct := c.caseType()
+ if c.info&exceptionBit == 0 {
+ if ct != cLower || c.info&inverseFoldBit != 0 {
+ c.err = transform.ErrEndOfSpan
+ return false
+ }
+ return true
+ }
+ e := exceptions[c.info>>exceptionShift:]
+ n := e[0] & lengthMask
+ if n == 0 && ct == cLower {
+ return true
+ }
+ c.err = transform.ErrEndOfSpan
+ return false
+}
diff --git a/vendor/golang.org/x/text/cases/fold.go b/vendor/golang.org/x/text/cases/fold.go
new file mode 100644
index 00000000000..85cc434fac0
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/fold.go
@@ -0,0 +1,34 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cases
+
+import "golang.org/x/text/transform"
+
+type caseFolder struct{ transform.NopResetter }
+
+// caseFolder implements the Transformer interface for doing case folding.
+func (t *caseFolder) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ c := context{dst: dst, src: src, atEOF: atEOF}
+ for c.next() {
+ foldFull(&c)
+ c.checkpoint()
+ }
+ return c.ret()
+}
+
+func (t *caseFolder) Span(src []byte, atEOF bool) (n int, err error) {
+ c := context{src: src, atEOF: atEOF}
+ for c.next() && isFoldFull(&c) {
+ c.checkpoint()
+ }
+ return c.retSpan()
+}
+
+func makeFold(o options) transform.SpanningTransformer {
+ // TODO: Special case folding, through option Language, Special/Turkic, or
+ // both.
+ // TODO: Implement Compact options.
+ return &caseFolder{}
+}
diff --git a/vendor/golang.org/x/text/cases/icu.go b/vendor/golang.org/x/text/cases/icu.go
new file mode 100644
index 00000000000..db7c237ccff
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/icu.go
@@ -0,0 +1,61 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build icu
+
+package cases
+
+// Ideally these functions would be defined in a test file, but go test doesn't
+// allow CGO in tests. The build tag should ensure either way that these
+// functions will not end up in the package.
+
+// TODO: Ensure that the correct ICU version is set.
+
+/*
+#cgo LDFLAGS: -licui18n.57 -licuuc.57
+#include
+#include
+#include
+#include
+#include
+*/
+import "C"
+
+import "unsafe"
+
+func doICU(tag, caser, input string) string {
+ err := C.UErrorCode(0)
+ loc := C.CString(tag)
+ cm := C.ucasemap_open(loc, C.uint32_t(0), &err)
+
+ buf := make([]byte, len(input)*4)
+ dst := (*C.char)(unsafe.Pointer(&buf[0]))
+ src := C.CString(input)
+
+ cn := C.int32_t(0)
+
+ switch caser {
+ case "fold":
+ cn = C.ucasemap_utf8FoldCase(cm,
+ dst, C.int32_t(len(buf)),
+ src, C.int32_t(len(input)),
+ &err)
+ case "lower":
+ cn = C.ucasemap_utf8ToLower(cm,
+ dst, C.int32_t(len(buf)),
+ src, C.int32_t(len(input)),
+ &err)
+ case "upper":
+ cn = C.ucasemap_utf8ToUpper(cm,
+ dst, C.int32_t(len(buf)),
+ src, C.int32_t(len(input)),
+ &err)
+ case "title":
+ cn = C.ucasemap_utf8ToTitle(cm,
+ dst, C.int32_t(len(buf)),
+ src, C.int32_t(len(input)),
+ &err)
+ }
+ return string(buf[:cn])
+}
diff --git a/vendor/golang.org/x/text/cases/info.go b/vendor/golang.org/x/text/cases/info.go
new file mode 100644
index 00000000000..87a7c3e9557
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/info.go
@@ -0,0 +1,82 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cases
+
+func (c info) cccVal() info {
+ if c&exceptionBit != 0 {
+ return info(exceptions[c>>exceptionShift]) & cccMask
+ }
+ return c & cccMask
+}
+
+func (c info) cccType() info {
+ ccc := c.cccVal()
+ if ccc <= cccZero {
+ return cccZero
+ }
+ return ccc
+}
+
+// TODO: Implement full Unicode breaking algorithm:
+// 1) Implement breaking in separate package.
+// 2) Use the breaker here.
+// 3) Compare table size and performance of using the more generic breaker.
+//
+// Note that we can extend the current algorithm to be much more accurate. This
+// only makes sense, though, if the performance and/or space penalty of using
+// the generic breaker is big. Extra data will only be needed for non-cased
+// runes, which means there are sufficient bits left in the caseType.
+// ICU prohibits breaking in such cases as well.
+
+// For the purpose of title casing we use an approximation of the Unicode Word
+// Breaking algorithm defined in Annex #29:
+// https://www.unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table.
+//
+// For our approximation, we group the Word Break types into the following
+// categories, with associated rules:
+//
+// 1) Letter:
+// ALetter, Hebrew_Letter, Numeric, ExtendNumLet, Extend, Format_FE, ZWJ.
+// Rule: Never break between consecutive runes of this category.
+//
+// 2) Mid:
+// MidLetter, MidNumLet, Single_Quote.
+// (Cf. case-ignorable: MidLetter, MidNumLet, Single_Quote or cat is Mn,
+// Me, Cf, Lm or Sk).
+// Rule: Don't break between Letter and Mid, but break between two Mids.
+//
+// 3) Break:
+// Any other category: NewLine, MidNum, CR, LF, Double_Quote, Katakana, and
+// Other.
+// These categories should always result in a break between two cased letters.
+// Rule: Always break.
+//
+// Note 1: the Katakana and MidNum categories can, in esoteric cases, result in
+// preventing a break between two cased letters. For now we will ignore this
+// (e.g. [ALetter] [ExtendNumLet] [Katakana] [ExtendNumLet] [ALetter] and
+// [ALetter] [Numeric] [MidNum] [Numeric] [ALetter].)
+//
+// Note 2: the rule for Mid is very approximate, but works in most cases. To
+// improve, we could store the categories in the trie value and use a FA to
+// manage breaks. See TODO comment above.
+//
+// Note 3: according to the spec, it is possible for the Extend category to
+// introduce breaks between other categories grouped in Letter. However, this
+// is undesirable for our purposes. ICU prevents breaks in such cases as well.
+
+// isBreak returns whether this rune should introduce a break.
+func (c info) isBreak() bool {
+ return c.cccVal() == cccBreak
+}
+
+// isLetter returns whether the rune is of break type ALetter, Hebrew_Letter,
+// Numeric, ExtendNumLet, or Extend.
+func (c info) isLetter() bool {
+ ccc := c.cccVal()
+ if ccc == cccZero {
+ return !c.isCaseIgnorable()
+ }
+ return ccc != cccBreak
+}
diff --git a/vendor/golang.org/x/text/cases/map.go b/vendor/golang.org/x/text/cases/map.go
new file mode 100644
index 00000000000..0f7c6a14bb7
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/map.go
@@ -0,0 +1,816 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cases
+
+// This file contains the definitions of case mappings for all supported
+// languages. The rules for the language-specific tailorings were taken and
+// modified from the CLDR transform definitions in common/transforms.
+
+import (
+ "strings"
+ "unicode"
+ "unicode/utf8"
+
+ "golang.org/x/text/internal"
+ "golang.org/x/text/language"
+ "golang.org/x/text/transform"
+ "golang.org/x/text/unicode/norm"
+)
+
+// A mapFunc takes a context set to the current rune and writes the mapped
+// version to the same context. It may advance the context to the next rune. It
+// returns whether a checkpoint is possible: whether the pDst bytes written to
+// dst so far won't need changing as we see more source bytes.
+type mapFunc func(*context) bool
+
+// A spanFunc takes a context set to the current rune and returns whether this
+// rune would be altered when written to the output. It may advance the context
+// to the next rune. It returns whether a checkpoint is possible.
+type spanFunc func(*context) bool
+
+// maxIgnorable defines the maximum number of ignorables to consider for
+// lookahead operations.
+const maxIgnorable = 30
+
+// supported lists the language tags for which we have tailorings.
+const supported = "und af az el lt nl tr"
+
+func init() {
+ tags := []language.Tag{}
+ for _, s := range strings.Split(supported, " ") {
+ tags = append(tags, language.MustParse(s))
+ }
+ matcher = internal.NewInheritanceMatcher(tags)
+ Supported = language.NewCoverage(tags)
+}
+
+var (
+ matcher *internal.InheritanceMatcher
+
+ Supported language.Coverage
+
+ // We keep the following lists separate, instead of having a single per-
+ // language struct, to give the compiler a chance to remove unused code.
+
+ // Some uppercase mappers are stateless, so we can precompute the
+ // Transformers and save a bit on runtime allocations.
+ upperFunc = []struct {
+ upper mapFunc
+ span spanFunc
+ }{
+ {nil, nil}, // und
+ {nil, nil}, // af
+ {aztrUpper(upper), isUpper}, // az
+ {elUpper, noSpan}, // el
+ {ltUpper(upper), noSpan}, // lt
+ {nil, nil}, // nl
+ {aztrUpper(upper), isUpper}, // tr
+ }
+
+ undUpper transform.SpanningTransformer = &undUpperCaser{}
+ undLower transform.SpanningTransformer = &undLowerCaser{}
+ undLowerIgnoreSigma transform.SpanningTransformer = &undLowerIgnoreSigmaCaser{}
+
+ lowerFunc = []mapFunc{
+ nil, // und
+ nil, // af
+ aztrLower, // az
+ nil, // el
+ ltLower, // lt
+ nil, // nl
+ aztrLower, // tr
+ }
+
+ titleInfos = []struct {
+ title mapFunc
+ lower mapFunc
+ titleSpan spanFunc
+ rewrite func(*context)
+ }{
+ {title, lower, isTitle, nil}, // und
+ {title, lower, isTitle, afnlRewrite}, // af
+ {aztrUpper(title), aztrLower, isTitle, nil}, // az
+ {title, lower, isTitle, nil}, // el
+ {ltUpper(title), ltLower, noSpan, nil}, // lt
+ {nlTitle, lower, nlTitleSpan, afnlRewrite}, // nl
+ {aztrUpper(title), aztrLower, isTitle, nil}, // tr
+ }
+)
+
+func makeUpper(t language.Tag, o options) transform.SpanningTransformer {
+ _, i, _ := matcher.Match(t)
+ f := upperFunc[i].upper
+ if f == nil {
+ return undUpper
+ }
+ return &simpleCaser{f: f, span: upperFunc[i].span}
+}
+
+func makeLower(t language.Tag, o options) transform.SpanningTransformer {
+ _, i, _ := matcher.Match(t)
+ f := lowerFunc[i]
+ if f == nil {
+ if o.ignoreFinalSigma {
+ return undLowerIgnoreSigma
+ }
+ return undLower
+ }
+ if o.ignoreFinalSigma {
+ return &simpleCaser{f: f, span: isLower}
+ }
+ return &lowerCaser{
+ first: f,
+ midWord: finalSigma(f),
+ }
+}
+
+func makeTitle(t language.Tag, o options) transform.SpanningTransformer {
+ _, i, _ := matcher.Match(t)
+ x := &titleInfos[i]
+ lower := x.lower
+ if o.noLower {
+ lower = (*context).copy
+ } else if !o.ignoreFinalSigma {
+ lower = finalSigma(lower)
+ }
+ return &titleCaser{
+ title: x.title,
+ lower: lower,
+ titleSpan: x.titleSpan,
+ rewrite: x.rewrite,
+ }
+}
+
+func noSpan(c *context) bool {
+ c.err = transform.ErrEndOfSpan
+ return false
+}
+
+// TODO: consider a similar special case for the fast majority lower case. This
+// is a bit more involved so will require some more precise benchmarking to
+// justify it.
+
+type undUpperCaser struct{ transform.NopResetter }
+
+// undUpperCaser implements the Transformer interface for doing an upper case
+// mapping for the root locale (und). It eliminates the need for an allocation
+// as it prevents escaping by not using function pointers.
+func (t undUpperCaser) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ c := context{dst: dst, src: src, atEOF: atEOF}
+ for c.next() {
+ upper(&c)
+ c.checkpoint()
+ }
+ return c.ret()
+}
+
+func (t undUpperCaser) Span(src []byte, atEOF bool) (n int, err error) {
+ c := context{src: src, atEOF: atEOF}
+ for c.next() && isUpper(&c) {
+ c.checkpoint()
+ }
+ return c.retSpan()
+}
+
+// undLowerIgnoreSigmaCaser implements the Transformer interface for doing
+// a lower case mapping for the root locale (und) ignoring final sigma
+// handling. This casing algorithm is used in some performance-critical packages
+// like secure/precis and x/net/http/idna, which warrants its special-casing.
+type undLowerIgnoreSigmaCaser struct{ transform.NopResetter }
+
+func (t undLowerIgnoreSigmaCaser) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ c := context{dst: dst, src: src, atEOF: atEOF}
+ for c.next() && lower(&c) {
+ c.checkpoint()
+ }
+ return c.ret()
+
+}
+
+// Span implements a generic lower-casing. This is possible as isLower works
+// for all lowercasing variants. All lowercase variants only vary in how they
+// transform a non-lowercase letter. They will never change an already lowercase
+// letter. In addition, there is no state.
+func (t undLowerIgnoreSigmaCaser) Span(src []byte, atEOF bool) (n int, err error) {
+ c := context{src: src, atEOF: atEOF}
+ for c.next() && isLower(&c) {
+ c.checkpoint()
+ }
+ return c.retSpan()
+}
+
+type simpleCaser struct {
+ context
+ f mapFunc
+ span spanFunc
+}
+
+// simpleCaser implements the Transformer interface for doing a case operation
+// on a rune-by-rune basis.
+func (t *simpleCaser) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ c := context{dst: dst, src: src, atEOF: atEOF}
+ for c.next() && t.f(&c) {
+ c.checkpoint()
+ }
+ return c.ret()
+}
+
+func (t *simpleCaser) Span(src []byte, atEOF bool) (n int, err error) {
+ c := context{src: src, atEOF: atEOF}
+ for c.next() && t.span(&c) {
+ c.checkpoint()
+ }
+ return c.retSpan()
+}
+
+// undLowerCaser implements the Transformer interface for doing a lower case
+// mapping for the root locale (und) ignoring final sigma handling. This casing
+// algorithm is used in some performance-critical packages like secure/precis
+// and x/net/http/idna, which warrants its special-casing.
+type undLowerCaser struct{ transform.NopResetter }
+
+func (t undLowerCaser) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ c := context{dst: dst, src: src, atEOF: atEOF}
+
+ for isInterWord := true; c.next(); {
+ if isInterWord {
+ if c.info.isCased() {
+ if !lower(&c) {
+ break
+ }
+ isInterWord = false
+ } else if !c.copy() {
+ break
+ }
+ } else {
+ if c.info.isNotCasedAndNotCaseIgnorable() {
+ if !c.copy() {
+ break
+ }
+ isInterWord = true
+ } else if !c.hasPrefix("Σ") {
+ if !lower(&c) {
+ break
+ }
+ } else if !finalSigmaBody(&c) {
+ break
+ }
+ }
+ c.checkpoint()
+ }
+ return c.ret()
+}
+
+func (t undLowerCaser) Span(src []byte, atEOF bool) (n int, err error) {
+ c := context{src: src, atEOF: atEOF}
+ for c.next() && isLower(&c) {
+ c.checkpoint()
+ }
+ return c.retSpan()
+}
+
+// lowerCaser implements the Transformer interface. The default Unicode lower
+// casing requires different treatment for the first and subsequent characters
+// of a word, most notably to handle the Greek final Sigma.
+type lowerCaser struct {
+ undLowerIgnoreSigmaCaser
+
+ context
+
+ first, midWord mapFunc
+}
+
+func (t *lowerCaser) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ t.context = context{dst: dst, src: src, atEOF: atEOF}
+ c := &t.context
+
+ for isInterWord := true; c.next(); {
+ if isInterWord {
+ if c.info.isCased() {
+ if !t.first(c) {
+ break
+ }
+ isInterWord = false
+ } else if !c.copy() {
+ break
+ }
+ } else {
+ if c.info.isNotCasedAndNotCaseIgnorable() {
+ if !c.copy() {
+ break
+ }
+ isInterWord = true
+ } else if !t.midWord(c) {
+ break
+ }
+ }
+ c.checkpoint()
+ }
+ return c.ret()
+}
+
+// titleCaser implements the Transformer interface. Title casing algorithms
+// distinguish between the first letter of a word and subsequent letters of the
+// same word. It uses state to avoid requiring a potentially infinite lookahead.
+type titleCaser struct {
+ context
+
+ // rune mappings used by the actual casing algorithms.
+ title mapFunc
+ lower mapFunc
+ titleSpan spanFunc
+
+ rewrite func(*context)
+}
+
+// Transform implements the standard Unicode title case algorithm as defined in
+// Chapter 3 of The Unicode Standard:
+// toTitlecase(X): Find the word boundaries in X according to Unicode Standard
+// Annex #29, "Unicode Text Segmentation." For each word boundary, find the
+// first cased character F following the word boundary. If F exists, map F to
+// Titlecase_Mapping(F); then map all characters C between F and the following
+// word boundary to Lowercase_Mapping(C).
+func (t *titleCaser) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
+ t.context = context{dst: dst, src: src, atEOF: atEOF, isMidWord: t.isMidWord}
+ c := &t.context
+
+ if !c.next() {
+ return c.ret()
+ }
+
+ for {
+ p := c.info
+ if t.rewrite != nil {
+ t.rewrite(c)
+ }
+
+ wasMid := p.isMid()
+ // Break out of this loop on failure to ensure we do not modify the
+ // state incorrectly.
+ if p.isCased() {
+ if !c.isMidWord {
+ if !t.title(c) {
+ break
+ }
+ c.isMidWord = true
+ } else if !t.lower(c) {
+ break
+ }
+ } else if !c.copy() {
+ break
+ } else if p.isBreak() {
+ c.isMidWord = false
+ }
+
+ // As we save the state of the transformer, it is safe to call
+ // checkpoint after any successful write.
+ if !(c.isMidWord && wasMid) {
+ c.checkpoint()
+ }
+
+ if !c.next() {
+ break
+ }
+ if wasMid && c.info.isMid() {
+ c.isMidWord = false
+ }
+ }
+ return c.ret()
+}
+
+func (t *titleCaser) Span(src []byte, atEOF bool) (n int, err error) {
+ t.context = context{src: src, atEOF: atEOF, isMidWord: t.isMidWord}
+ c := &t.context
+
+ if !c.next() {
+ return c.retSpan()
+ }
+
+ for {
+ p := c.info
+ if t.rewrite != nil {
+ t.rewrite(c)
+ }
+
+ wasMid := p.isMid()
+ // Break out of this loop on failure to ensure we do not modify the
+ // state incorrectly.
+ if p.isCased() {
+ if !c.isMidWord {
+ if !t.titleSpan(c) {
+ break
+ }
+ c.isMidWord = true
+ } else if !isLower(c) {
+ break
+ }
+ } else if p.isBreak() {
+ c.isMidWord = false
+ }
+ // As we save the state of the transformer, it is safe to call
+ // checkpoint after any successful write.
+ if !(c.isMidWord && wasMid) {
+ c.checkpoint()
+ }
+
+ if !c.next() {
+ break
+ }
+ if wasMid && c.info.isMid() {
+ c.isMidWord = false
+ }
+ }
+ return c.retSpan()
+}
+
+// finalSigma adds Greek final Sigma handing to another casing function. It
+// determines whether a lowercased sigma should be σ or ς, by looking ahead for
+// case-ignorables and a cased letters.
+func finalSigma(f mapFunc) mapFunc {
+ return func(c *context) bool {
+ if !c.hasPrefix("Σ") {
+ return f(c)
+ }
+ return finalSigmaBody(c)
+ }
+}
+
+func finalSigmaBody(c *context) bool {
+ // Current rune must be ∑.
+
+ // ::NFD();
+ // # 03A3; 03C2; 03A3; 03A3; Final_Sigma; # GREEK CAPITAL LETTER SIGMA
+ // Σ } [:case-ignorable:]* [:cased:] → σ;
+ // [:cased:] [:case-ignorable:]* { Σ → ς;
+ // ::Any-Lower;
+ // ::NFC();
+
+ p := c.pDst
+ c.writeString("ς")
+
+ // TODO: we should do this here, but right now this will never have an
+ // effect as this is called when the prefix is Sigma, whereas Dutch and
+ // Afrikaans only test for an apostrophe.
+ //
+ // if t.rewrite != nil {
+ // t.rewrite(c)
+ // }
+
+ // We need to do one more iteration after maxIgnorable, as a cased
+ // letter is not an ignorable and may modify the result.
+ wasMid := false
+ for i := 0; i < maxIgnorable+1; i++ {
+ if !c.next() {
+ return false
+ }
+ if !c.info.isCaseIgnorable() {
+ // All Midword runes are also case ignorable, so we are
+ // guaranteed to have a letter or word break here. As we are
+ // unreading the run, there is no need to unset c.isMidWord;
+ // the title caser will handle this.
+ if c.info.isCased() {
+ // p+1 is guaranteed to be in bounds: if writing ς was
+ // successful, p+1 will contain the second byte of ς. If not,
+ // this function will have returned after c.next returned false.
+ c.dst[p+1]++ // ς → σ
+ }
+ c.unreadRune()
+ return true
+ }
+ // A case ignorable may also introduce a word break, so we may need
+ // to continue searching even after detecting a break.
+ isMid := c.info.isMid()
+ if (wasMid && isMid) || c.info.isBreak() {
+ c.isMidWord = false
+ }
+ wasMid = isMid
+ c.copy()
+ }
+ return true
+}
+
+// finalSigmaSpan would be the same as isLower.
+
+// elUpper implements Greek upper casing, which entails removing a predefined
+// set of non-blocked modifiers. Note that these accents should not be removed
+// for title casing!
+// Example: "Οδός" -> "ΟΔΟΣ".
+func elUpper(c *context) bool {
+ // From CLDR:
+ // [:Greek:] [^[:ccc=Not_Reordered:][:ccc=Above:]]*? { [\u0313\u0314\u0301\u0300\u0306\u0342\u0308\u0304] → ;
+ // [:Greek:] [^[:ccc=Not_Reordered:][:ccc=Iota_Subscript:]]*? { \u0345 → ;
+
+ r, _ := utf8.DecodeRune(c.src[c.pSrc:])
+ oldPDst := c.pDst
+ if !upper(c) {
+ return false
+ }
+ if !unicode.Is(unicode.Greek, r) {
+ return true
+ }
+ i := 0
+ // Take the properties of the uppercased rune that is already written to the
+ // destination. This saves us the trouble of having to uppercase the
+ // decomposed rune again.
+ if b := norm.NFD.Properties(c.dst[oldPDst:]).Decomposition(); b != nil {
+ // Restore the destination position and process the decomposed rune.
+ r, sz := utf8.DecodeRune(b)
+ if r <= 0xFF { // See A.6.1
+ return true
+ }
+ c.pDst = oldPDst
+ // Insert the first rune and ignore the modifiers. See A.6.2.
+ c.writeBytes(b[:sz])
+ i = len(b[sz:]) / 2 // Greek modifiers are always of length 2.
+ }
+
+ for ; i < maxIgnorable && c.next(); i++ {
+ switch r, _ := utf8.DecodeRune(c.src[c.pSrc:]); r {
+ // Above and Iota Subscript
+ case 0x0300, // U+0300 COMBINING GRAVE ACCENT
+ 0x0301, // U+0301 COMBINING ACUTE ACCENT
+ 0x0304, // U+0304 COMBINING MACRON
+ 0x0306, // U+0306 COMBINING BREVE
+ 0x0308, // U+0308 COMBINING DIAERESIS
+ 0x0313, // U+0313 COMBINING COMMA ABOVE
+ 0x0314, // U+0314 COMBINING REVERSED COMMA ABOVE
+ 0x0342, // U+0342 COMBINING GREEK PERISPOMENI
+ 0x0345: // U+0345 COMBINING GREEK YPOGEGRAMMENI
+ // No-op. Gobble the modifier.
+
+ default:
+ switch v, _ := trie.lookup(c.src[c.pSrc:]); info(v).cccType() {
+ case cccZero:
+ c.unreadRune()
+ return true
+
+ // We don't need to test for IotaSubscript as the only rune that
+ // qualifies (U+0345) was already excluded in the switch statement
+ // above. See A.4.
+
+ case cccAbove:
+ return c.copy()
+ default:
+ // Some other modifier. We're still allowed to gobble Greek
+ // modifiers after this.
+ c.copy()
+ }
+ }
+ }
+ return i == maxIgnorable
+}
+
+// TODO: implement elUpperSpan (low-priority: complex and infrequent).
+
+func ltLower(c *context) bool {
+ // From CLDR:
+ // # Introduce an explicit dot above when lowercasing capital I's and J's
+ // # whenever there are more accents above.
+ // # (of the accents used in Lithuanian: grave, acute, tilde above, and ogonek)
+ // # 0049; 0069 0307; 0049; 0049; lt More_Above; # LATIN CAPITAL LETTER I
+ // # 004A; 006A 0307; 004A; 004A; lt More_Above; # LATIN CAPITAL LETTER J
+ // # 012E; 012F 0307; 012E; 012E; lt More_Above; # LATIN CAPITAL LETTER I WITH OGONEK
+ // # 00CC; 0069 0307 0300; 00CC; 00CC; lt; # LATIN CAPITAL LETTER I WITH GRAVE
+ // # 00CD; 0069 0307 0301; 00CD; 00CD; lt; # LATIN CAPITAL LETTER I WITH ACUTE
+ // # 0128; 0069 0307 0303; 0128; 0128; lt; # LATIN CAPITAL LETTER I WITH TILDE
+ // ::NFD();
+ // I } [^[:ccc=Not_Reordered:][:ccc=Above:]]* [:ccc=Above:] → i \u0307;
+ // J } [^[:ccc=Not_Reordered:][:ccc=Above:]]* [:ccc=Above:] → j \u0307;
+ // I \u0328 (Į) } [^[:ccc=Not_Reordered:][:ccc=Above:]]* [:ccc=Above:] → i \u0328 \u0307;
+ // I \u0300 (Ì) → i \u0307 \u0300;
+ // I \u0301 (Í) → i \u0307 \u0301;
+ // I \u0303 (Ĩ) → i \u0307 \u0303;
+ // ::Any-Lower();
+ // ::NFC();
+
+ i := 0
+ if r := c.src[c.pSrc]; r < utf8.RuneSelf {
+ lower(c)
+ if r != 'I' && r != 'J' {
+ return true
+ }
+ } else {
+ p := norm.NFD.Properties(c.src[c.pSrc:])
+ if d := p.Decomposition(); len(d) >= 3 && (d[0] == 'I' || d[0] == 'J') {
+ // UTF-8 optimization: the decomposition will only have an above
+ // modifier if the last rune of the decomposition is in [U+300-U+311].
+ // In all other cases, a decomposition starting with I is always
+ // an I followed by modifiers that are not cased themselves. See A.2.
+ if d[1] == 0xCC && d[2] <= 0x91 { // A.2.4.
+ if !c.writeBytes(d[:1]) {
+ return false
+ }
+ c.dst[c.pDst-1] += 'a' - 'A' // lower
+
+ // Assumption: modifier never changes on lowercase. See A.1.
+ // Assumption: all modifiers added have CCC = Above. See A.2.3.
+ return c.writeString("\u0307") && c.writeBytes(d[1:])
+ }
+ // In all other cases the additional modifiers will have a CCC
+ // that is less than 230 (Above). We will insert the U+0307, if
+ // needed, after these modifiers so that a string in FCD form
+ // will remain so. See A.2.2.
+ lower(c)
+ i = 1
+ } else {
+ return lower(c)
+ }
+ }
+
+ for ; i < maxIgnorable && c.next(); i++ {
+ switch c.info.cccType() {
+ case cccZero:
+ c.unreadRune()
+ return true
+ case cccAbove:
+ return c.writeString("\u0307") && c.copy() // See A.1.
+ default:
+ c.copy() // See A.1.
+ }
+ }
+ return i == maxIgnorable
+}
+
+// ltLowerSpan would be the same as isLower.
+
+func ltUpper(f mapFunc) mapFunc {
+ return func(c *context) bool {
+ // Unicode:
+ // 0307; 0307; ; ; lt After_Soft_Dotted; # COMBINING DOT ABOVE
+ //
+ // From CLDR:
+ // # Remove \u0307 following soft-dotteds (i, j, and the like), with possible
+ // # intervening non-230 marks.
+ // ::NFD();
+ // [:Soft_Dotted:] [^[:ccc=Not_Reordered:][:ccc=Above:]]* { \u0307 → ;
+ // ::Any-Upper();
+ // ::NFC();
+
+ // TODO: See A.5. A soft-dotted rune never has an exception. This would
+ // allow us to overload the exception bit and encode this property in
+ // info. Need to measure performance impact of this.
+ r, _ := utf8.DecodeRune(c.src[c.pSrc:])
+ oldPDst := c.pDst
+ if !f(c) {
+ return false
+ }
+ if !unicode.Is(unicode.Soft_Dotted, r) {
+ return true
+ }
+
+ // We don't need to do an NFD normalization, as a soft-dotted rune never
+ // contains U+0307. See A.3.
+
+ i := 0
+ for ; i < maxIgnorable && c.next(); i++ {
+ switch c.info.cccType() {
+ case cccZero:
+ c.unreadRune()
+ return true
+ case cccAbove:
+ if c.hasPrefix("\u0307") {
+ // We don't do a full NFC, but rather combine runes for
+ // some of the common cases. (Returning NFC or
+ // preserving normal form is neither a requirement nor
+ // a possibility anyway).
+ if !c.next() {
+ return false
+ }
+ if c.dst[oldPDst] == 'I' && c.pDst == oldPDst+1 && c.src[c.pSrc] == 0xcc {
+ s := ""
+ switch c.src[c.pSrc+1] {
+ case 0x80: // U+0300 COMBINING GRAVE ACCENT
+ s = "\u00cc" // U+00CC LATIN CAPITAL LETTER I WITH GRAVE
+ case 0x81: // U+0301 COMBINING ACUTE ACCENT
+ s = "\u00cd" // U+00CD LATIN CAPITAL LETTER I WITH ACUTE
+ case 0x83: // U+0303 COMBINING TILDE
+ s = "\u0128" // U+0128 LATIN CAPITAL LETTER I WITH TILDE
+ case 0x88: // U+0308 COMBINING DIAERESIS
+ s = "\u00cf" // U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS
+ default:
+ }
+ if s != "" {
+ c.pDst = oldPDst
+ return c.writeString(s)
+ }
+ }
+ }
+ return c.copy()
+ default:
+ c.copy()
+ }
+ }
+ return i == maxIgnorable
+ }
+}
+
+// TODO: implement ltUpperSpan (low priority: complex and infrequent).
+
+func aztrUpper(f mapFunc) mapFunc {
+ return func(c *context) bool {
+ // i→İ;
+ if c.src[c.pSrc] == 'i' {
+ return c.writeString("İ")
+ }
+ return f(c)
+ }
+}
+
+func aztrLower(c *context) (done bool) {
+ // From CLDR:
+ // # I and i-dotless; I-dot and i are case pairs in Turkish and Azeri
+ // # 0130; 0069; 0130; 0130; tr; # LATIN CAPITAL LETTER I WITH DOT ABOVE
+ // İ→i;
+ // # When lowercasing, remove dot_above in the sequence I + dot_above, which will turn into i.
+ // # This matches the behavior of the canonically equivalent I-dot_above
+ // # 0307; ; 0307; 0307; tr After_I; # COMBINING DOT ABOVE
+ // # When lowercasing, unless an I is before a dot_above, it turns into a dotless i.
+ // # 0049; 0131; 0049; 0049; tr Not_Before_Dot; # LATIN CAPITAL LETTER I
+ // I([^[:ccc=Not_Reordered:][:ccc=Above:]]*)\u0307 → i$1 ;
+ // I→ı ;
+ // ::Any-Lower();
+ if c.hasPrefix("\u0130") { // İ
+ return c.writeString("i")
+ }
+ if c.src[c.pSrc] != 'I' {
+ return lower(c)
+ }
+
+ // We ignore the lower-case I for now, but insert it later when we know
+ // which form we need.
+ start := c.pSrc + c.sz
+
+ i := 0
+Loop:
+ // We check for up to n ignorables before \u0307. As \u0307 is an
+ // ignorable as well, n is maxIgnorable-1.
+ for ; i < maxIgnorable && c.next(); i++ {
+ switch c.info.cccType() {
+ case cccAbove:
+ if c.hasPrefix("\u0307") {
+ return c.writeString("i") && c.writeBytes(c.src[start:c.pSrc]) // ignore U+0307
+ }
+ done = true
+ break Loop
+ case cccZero:
+ c.unreadRune()
+ done = true
+ break Loop
+ default:
+ // We'll write this rune after we know which starter to use.
+ }
+ }
+ if i == maxIgnorable {
+ done = true
+ }
+ return c.writeString("ı") && c.writeBytes(c.src[start:c.pSrc+c.sz]) && done
+}
+
+// aztrLowerSpan would be the same as isLower.
+
+func nlTitle(c *context) bool {
+ // From CLDR:
+ // # Special titlecasing for Dutch initial "ij".
+ // ::Any-Title();
+ // # Fix up Ij at the beginning of a "word" (per Any-Title, notUAX #29)
+ // [:^WB=ALetter:] [:WB=Extend:]* [[:WB=MidLetter:][:WB=MidNumLet:]]? { Ij } → IJ ;
+ if c.src[c.pSrc] != 'I' && c.src[c.pSrc] != 'i' {
+ return title(c)
+ }
+
+ if !c.writeString("I") || !c.next() {
+ return false
+ }
+ if c.src[c.pSrc] == 'j' || c.src[c.pSrc] == 'J' {
+ return c.writeString("J")
+ }
+ c.unreadRune()
+ return true
+}
+
+func nlTitleSpan(c *context) bool {
+ // From CLDR:
+ // # Special titlecasing for Dutch initial "ij".
+ // ::Any-Title();
+ // # Fix up Ij at the beginning of a "word" (per Any-Title, notUAX #29)
+ // [:^WB=ALetter:] [:WB=Extend:]* [[:WB=MidLetter:][:WB=MidNumLet:]]? { Ij } → IJ ;
+ if c.src[c.pSrc] != 'I' {
+ return isTitle(c)
+ }
+ if !c.next() || c.src[c.pSrc] == 'j' {
+ return false
+ }
+ if c.src[c.pSrc] != 'J' {
+ c.unreadRune()
+ }
+ return true
+}
+
+// Not part of CLDR, but see https://unicode.org/cldr/trac/ticket/7078.
+func afnlRewrite(c *context) {
+ if c.hasPrefix("'") || c.hasPrefix("’") {
+ c.isMidWord = true
+ }
+}
diff --git a/vendor/golang.org/x/text/cases/tables10.0.0.go b/vendor/golang.org/x/text/cases/tables10.0.0.go
new file mode 100644
index 00000000000..bd28ae145d4
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/tables10.0.0.go
@@ -0,0 +1,2255 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+//go:build go1.10 && !go1.13
+
+package cases
+
+// UnicodeVersion is the Unicode version from which the tables in this package are derived.
+const UnicodeVersion = "10.0.0"
+
+var xorData string = "" + // Size: 185 bytes
+ "\x00\x06\x07\x00\x01?\x00\x0f\x03\x00\x0f\x12\x00\x0f\x1f\x00\x0f\x1d" +
+ "\x00\x01\x13\x00\x0f\x16\x00\x0f\x0b\x00\x0f3\x00\x0f7\x00\x01#\x00\x0f?" +
+ "\x00\x0e'\x00\x0f/\x00\x0e>\x00\x0f*\x00\x0c&\x00\x0c*\x00\x0c;\x00\x0c9" +
+ "\x00\x0c%\x00\x01\x08\x00\x03\x0d\x00\x03\x09\x00\x02\x06\x00\x02\x02" +
+ "\x00\x02\x0c\x00\x01\x00\x00\x01\x03\x00\x01\x01\x00\x01 \x00\x01\x0c" +
+ "\x00\x01\x10\x00\x03\x10\x00\x036 \x00\x037 \x00\x0b#\x10\x00\x0b 0\x00" +
+ "\x0b!\x10\x00\x0b!0\x00\x0b(\x04\x00\x03\x04\x1e\x00\x03\x0a\x00\x02:" +
+ "\x00\x02>\x00\x02,\x00\x02\x00\x00\x02\x10\x00\x01<\x00\x01&\x00\x01*" +
+ "\x00\x01.\x00\x010\x003 \x00\x01\x18\x00\x01(\x00\x01\x1e\x00\x01\x22"
+
+var exceptions string = "" + // Size: 2068 bytes
+ "\x00\x12\x12μΜΜ\x12\x12ssSSSs\x13\x18i̇i̇\x10\x09II\x13\x1bʼnʼNʼN\x11" +
+ "\x09sSS\x12\x12dždžDž\x12\x12dždžDŽ\x10\x12DŽDž\x12\x12ljljLj\x12\x12ljljLJ\x10\x12LJLj" +
+ "\x12\x12njnjNj\x12\x12njnjNJ\x10\x12NJNj\x13\x1bǰJ̌J̌\x12\x12dzdzDz\x12\x12dzdzDZ\x10" +
+ "\x12DZDz\x13\x18ⱥⱥ\x13\x18ⱦⱦ\x10\x1bⱾⱾ\x10\x1bⱿⱿ\x10\x1bⱯⱯ\x10\x1bⱭⱭ\x10" +
+ "\x1bⱰⱰ\x10\x1bꞫꞫ\x10\x1bꞬꞬ\x10\x1bꞍꞍ\x10\x1bꞪꞪ\x10\x1bꞮꞮ\x10\x1bⱢⱢ\x10" +
+ "\x1bꞭꞭ\x10\x1bⱮⱮ\x10\x1bⱤⱤ\x10\x1bꞱꞱ\x10\x1bꞲꞲ\x10\x1bꞰꞰ2\x12ιΙΙ\x166ΐ" +
+ "Ϊ́Ϊ́\x166ΰΫ́Ϋ́\x12\x12σΣΣ\x12\x12βΒΒ\x12\x12θΘΘ\x12\x12φΦΦ\x12" +
+ "\x12πΠΠ\x12\x12κΚΚ\x12\x12ρΡΡ\x12\x12εΕΕ\x14$եւԵՒԵւ\x12\x12вВВ\x12\x12дД" +
+ "Д\x12\x12оОО\x12\x12сСС\x12\x12тТТ\x12\x12тТТ\x12\x12ъЪЪ\x12\x12ѣѢѢ\x13" +
+ "\x1bꙋꙊꙊ\x13\x1bẖH̱H̱\x13\x1bẗT̈T̈\x13\x1bẘW̊W̊\x13\x1bẙY̊Y̊\x13\x1ba" +
+ "ʾAʾAʾ\x13\x1bṡṠṠ\x12\x10ssß\x14$ὐΥ̓Υ̓\x166ὒΥ̓̀Υ̓̀\x166ὔΥ̓́Υ̓́\x166" +
+ "ὖΥ̓͂Υ̓͂\x15+ἀιἈΙᾈ\x15+ἁιἉΙᾉ\x15+ἂιἊΙᾊ\x15+ἃιἋΙᾋ\x15+ἄιἌΙᾌ\x15+ἅιἍΙᾍ" +
+ "\x15+ἆιἎΙᾎ\x15+ἇιἏΙᾏ\x15\x1dἀιᾀἈΙ\x15\x1dἁιᾁἉΙ\x15\x1dἂιᾂἊΙ\x15\x1dἃιᾃἋΙ" +
+ "\x15\x1dἄιᾄἌΙ\x15\x1dἅιᾅἍΙ\x15\x1dἆιᾆἎΙ\x15\x1dἇιᾇἏΙ\x15+ἠιἨΙᾘ\x15+ἡιἩΙᾙ" +
+ "\x15+ἢιἪΙᾚ\x15+ἣιἫΙᾛ\x15+ἤιἬΙᾜ\x15+ἥιἭΙᾝ\x15+ἦιἮΙᾞ\x15+ἧιἯΙᾟ\x15\x1dἠιᾐἨ" +
+ "Ι\x15\x1dἡιᾑἩΙ\x15\x1dἢιᾒἪΙ\x15\x1dἣιᾓἫΙ\x15\x1dἤιᾔἬΙ\x15\x1dἥιᾕἭΙ\x15" +
+ "\x1dἦιᾖἮΙ\x15\x1dἧιᾗἯΙ\x15+ὠιὨΙᾨ\x15+ὡιὩΙᾩ\x15+ὢιὪΙᾪ\x15+ὣιὫΙᾫ\x15+ὤιὬΙᾬ" +
+ "\x15+ὥιὭΙᾭ\x15+ὦιὮΙᾮ\x15+ὧιὯΙᾯ\x15\x1dὠιᾠὨΙ\x15\x1dὡιᾡὩΙ\x15\x1dὢιᾢὪΙ" +
+ "\x15\x1dὣιᾣὫΙ\x15\x1dὤιᾤὬΙ\x15\x1dὥιᾥὭΙ\x15\x1dὦιᾦὮΙ\x15\x1dὧιᾧὯΙ\x15-ὰι" +
+ "ᾺΙᾺͅ\x14#αιΑΙᾼ\x14$άιΆΙΆͅ\x14$ᾶΑ͂Α͂\x166ᾶιΑ͂Ιᾼ͂\x14\x1cαιᾳΑΙ\x12" +
+ "\x12ιΙΙ\x15-ὴιῊΙῊͅ\x14#ηιΗΙῌ\x14$ήιΉΙΉͅ\x14$ῆΗ͂Η͂\x166ῆιΗ͂Ιῌ͂\x14\x1c" +
+ "ηιῃΗΙ\x166ῒΪ̀Ϊ̀\x166ΐΪ́Ϊ́\x14$ῖΙ͂Ι͂\x166ῗΪ͂Ϊ͂\x166ῢΫ̀Ϋ" +
+ "̀\x166ΰΫ́Ϋ́\x14$ῤΡ̓Ρ̓\x14$ῦΥ͂Υ͂\x166ῧΫ͂Ϋ͂\x15-ὼιῺΙῺͅ\x14#ωιΩΙ" +
+ "ῼ\x14$ώιΏΙΏͅ\x14$ῶΩ͂Ω͂\x166ῶιΩ͂Ιῼ͂\x14\x1cωιῳΩΙ\x12\x10ωω\x11\x08kk" +
+ "\x12\x10åå\x12\x10ɫɫ\x12\x10ɽɽ\x10\x12ȺȺ\x10\x12ȾȾ\x12\x10ɑɑ\x12\x10ɱɱ" +
+ "\x12\x10ɐɐ\x12\x10ɒɒ\x12\x10ȿȿ\x12\x10ɀɀ\x12\x10ɥɥ\x12\x10ɦɦ\x12\x10ɜɜ" +
+ "\x12\x10ɡɡ\x12\x10ɬɬ\x12\x10ɪɪ\x12\x10ʞʞ\x12\x10ʇʇ\x12\x10ʝʝ\x12\x12ffFF" +
+ "Ff\x12\x12fiFIFi\x12\x12flFLFl\x13\x1bffiFFIFfi\x13\x1bfflFFLFfl\x12\x12" +
+ "stSTSt\x12\x12stSTSt\x14$մնՄՆՄն\x14$մեՄԵՄե\x14$միՄԻՄի\x14$վնՎՆՎն\x14$մխՄ" +
+ "ԽՄխ"
+
+// lookup returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookup(s []byte) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupUnsafe(s []byte) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// lookupString returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookupString(s string) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupStringUnsafe(s string) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// caseTrie. Total size: 11892 bytes (11.61 KiB). Checksum: c6f15484b7653775.
+type caseTrie struct{}
+
+func newCaseTrie(i int) *caseTrie {
+ return &caseTrie{}
+}
+
+// lookupValue determines the type of block n and looks up the value for b.
+func (t *caseTrie) lookupValue(n uint32, b byte) uint16 {
+ switch {
+ case n < 18:
+ return uint16(caseValues[n<<6+uint32(b)])
+ default:
+ n -= 18
+ return uint16(sparse.lookup(n, b))
+ }
+}
+
+// caseValues: 20 blocks, 1280 entries, 2560 bytes
+// The third block is the zero block.
+var caseValues = [1280]uint16{
+ // Block 0x0, offset 0x0
+ 0x27: 0x0054,
+ 0x2e: 0x0054,
+ 0x30: 0x0010, 0x31: 0x0010, 0x32: 0x0010, 0x33: 0x0010, 0x34: 0x0010, 0x35: 0x0010,
+ 0x36: 0x0010, 0x37: 0x0010, 0x38: 0x0010, 0x39: 0x0010, 0x3a: 0x0054,
+ // Block 0x1, offset 0x40
+ 0x41: 0x2013, 0x42: 0x2013, 0x43: 0x2013, 0x44: 0x2013, 0x45: 0x2013,
+ 0x46: 0x2013, 0x47: 0x2013, 0x48: 0x2013, 0x49: 0x2013, 0x4a: 0x2013, 0x4b: 0x2013,
+ 0x4c: 0x2013, 0x4d: 0x2013, 0x4e: 0x2013, 0x4f: 0x2013, 0x50: 0x2013, 0x51: 0x2013,
+ 0x52: 0x2013, 0x53: 0x2013, 0x54: 0x2013, 0x55: 0x2013, 0x56: 0x2013, 0x57: 0x2013,
+ 0x58: 0x2013, 0x59: 0x2013, 0x5a: 0x2013,
+ 0x5e: 0x0004, 0x5f: 0x0010, 0x60: 0x0004, 0x61: 0x2012, 0x62: 0x2012, 0x63: 0x2012,
+ 0x64: 0x2012, 0x65: 0x2012, 0x66: 0x2012, 0x67: 0x2012, 0x68: 0x2012, 0x69: 0x2012,
+ 0x6a: 0x2012, 0x6b: 0x2012, 0x6c: 0x2012, 0x6d: 0x2012, 0x6e: 0x2012, 0x6f: 0x2012,
+ 0x70: 0x2012, 0x71: 0x2012, 0x72: 0x2012, 0x73: 0x2012, 0x74: 0x2012, 0x75: 0x2012,
+ 0x76: 0x2012, 0x77: 0x2012, 0x78: 0x2012, 0x79: 0x2012, 0x7a: 0x2012,
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc0: 0x0852, 0xc1: 0x0b53, 0xc2: 0x0113, 0xc3: 0x0112, 0xc4: 0x0113, 0xc5: 0x0112,
+ 0xc6: 0x0b53, 0xc7: 0x0f13, 0xc8: 0x0f12, 0xc9: 0x0e53, 0xca: 0x1153, 0xcb: 0x0713,
+ 0xcc: 0x0712, 0xcd: 0x0012, 0xce: 0x1453, 0xcf: 0x1753, 0xd0: 0x1a53, 0xd1: 0x0313,
+ 0xd2: 0x0312, 0xd3: 0x1d53, 0xd4: 0x2053, 0xd5: 0x2352, 0xd6: 0x2653, 0xd7: 0x2653,
+ 0xd8: 0x0113, 0xd9: 0x0112, 0xda: 0x2952, 0xdb: 0x0012, 0xdc: 0x1d53, 0xdd: 0x2c53,
+ 0xde: 0x2f52, 0xdf: 0x3253, 0xe0: 0x0113, 0xe1: 0x0112, 0xe2: 0x0113, 0xe3: 0x0112,
+ 0xe4: 0x0113, 0xe5: 0x0112, 0xe6: 0x3553, 0xe7: 0x0f13, 0xe8: 0x0f12, 0xe9: 0x3853,
+ 0xea: 0x0012, 0xeb: 0x0012, 0xec: 0x0113, 0xed: 0x0112, 0xee: 0x3553, 0xef: 0x1f13,
+ 0xf0: 0x1f12, 0xf1: 0x3b53, 0xf2: 0x3e53, 0xf3: 0x0713, 0xf4: 0x0712, 0xf5: 0x0313,
+ 0xf6: 0x0312, 0xf7: 0x4153, 0xf8: 0x0113, 0xf9: 0x0112, 0xfa: 0x0012, 0xfb: 0x0010,
+ 0xfc: 0x0113, 0xfd: 0x0112, 0xfe: 0x0012, 0xff: 0x4452,
+ // Block 0x4, offset 0x100
+ 0x100: 0x0010, 0x101: 0x0010, 0x102: 0x0010, 0x103: 0x0010, 0x104: 0x02db, 0x105: 0x0359,
+ 0x106: 0x03da, 0x107: 0x043b, 0x108: 0x04b9, 0x109: 0x053a, 0x10a: 0x059b, 0x10b: 0x0619,
+ 0x10c: 0x069a, 0x10d: 0x0313, 0x10e: 0x0312, 0x10f: 0x1f13, 0x110: 0x1f12, 0x111: 0x0313,
+ 0x112: 0x0312, 0x113: 0x0713, 0x114: 0x0712, 0x115: 0x0313, 0x116: 0x0312, 0x117: 0x0f13,
+ 0x118: 0x0f12, 0x119: 0x0313, 0x11a: 0x0312, 0x11b: 0x0713, 0x11c: 0x0712, 0x11d: 0x1452,
+ 0x11e: 0x0113, 0x11f: 0x0112, 0x120: 0x0113, 0x121: 0x0112, 0x122: 0x0113, 0x123: 0x0112,
+ 0x124: 0x0113, 0x125: 0x0112, 0x126: 0x0113, 0x127: 0x0112, 0x128: 0x0113, 0x129: 0x0112,
+ 0x12a: 0x0113, 0x12b: 0x0112, 0x12c: 0x0113, 0x12d: 0x0112, 0x12e: 0x0113, 0x12f: 0x0112,
+ 0x130: 0x06fa, 0x131: 0x07ab, 0x132: 0x0829, 0x133: 0x08aa, 0x134: 0x0113, 0x135: 0x0112,
+ 0x136: 0x2353, 0x137: 0x4453, 0x138: 0x0113, 0x139: 0x0112, 0x13a: 0x0113, 0x13b: 0x0112,
+ 0x13c: 0x0113, 0x13d: 0x0112, 0x13e: 0x0113, 0x13f: 0x0112,
+ // Block 0x5, offset 0x140
+ 0x140: 0x0a8a, 0x141: 0x0313, 0x142: 0x0312, 0x143: 0x0853, 0x144: 0x4753, 0x145: 0x4a53,
+ 0x146: 0x0113, 0x147: 0x0112, 0x148: 0x0113, 0x149: 0x0112, 0x14a: 0x0113, 0x14b: 0x0112,
+ 0x14c: 0x0113, 0x14d: 0x0112, 0x14e: 0x0113, 0x14f: 0x0112, 0x150: 0x0b0a, 0x151: 0x0b8a,
+ 0x152: 0x0c0a, 0x153: 0x0b52, 0x154: 0x0b52, 0x155: 0x0012, 0x156: 0x0e52, 0x157: 0x1152,
+ 0x158: 0x0012, 0x159: 0x1752, 0x15a: 0x0012, 0x15b: 0x1a52, 0x15c: 0x0c8a, 0x15d: 0x0012,
+ 0x15e: 0x0012, 0x15f: 0x0012, 0x160: 0x1d52, 0x161: 0x0d0a, 0x162: 0x0012, 0x163: 0x2052,
+ 0x164: 0x0012, 0x165: 0x0d8a, 0x166: 0x0e0a, 0x167: 0x0012, 0x168: 0x2652, 0x169: 0x2652,
+ 0x16a: 0x0e8a, 0x16b: 0x0f0a, 0x16c: 0x0f8a, 0x16d: 0x0012, 0x16e: 0x0012, 0x16f: 0x1d52,
+ 0x170: 0x0012, 0x171: 0x100a, 0x172: 0x2c52, 0x173: 0x0012, 0x174: 0x0012, 0x175: 0x3252,
+ 0x176: 0x0012, 0x177: 0x0012, 0x178: 0x0012, 0x179: 0x0012, 0x17a: 0x0012, 0x17b: 0x0012,
+ 0x17c: 0x0012, 0x17d: 0x108a, 0x17e: 0x0012, 0x17f: 0x0012,
+ // Block 0x6, offset 0x180
+ 0x180: 0x3552, 0x181: 0x0012, 0x182: 0x0012, 0x183: 0x3852, 0x184: 0x0012, 0x185: 0x0012,
+ 0x186: 0x0012, 0x187: 0x110a, 0x188: 0x3552, 0x189: 0x4752, 0x18a: 0x3b52, 0x18b: 0x3e52,
+ 0x18c: 0x4a52, 0x18d: 0x0012, 0x18e: 0x0012, 0x18f: 0x0012, 0x190: 0x0012, 0x191: 0x0012,
+ 0x192: 0x4152, 0x193: 0x0012, 0x194: 0x0010, 0x195: 0x0012, 0x196: 0x0012, 0x197: 0x0012,
+ 0x198: 0x0012, 0x199: 0x0012, 0x19a: 0x0012, 0x19b: 0x0012, 0x19c: 0x0012, 0x19d: 0x118a,
+ 0x19e: 0x120a, 0x19f: 0x0012, 0x1a0: 0x0012, 0x1a1: 0x0012, 0x1a2: 0x0012, 0x1a3: 0x0012,
+ 0x1a4: 0x0012, 0x1a5: 0x0012, 0x1a6: 0x0012, 0x1a7: 0x0012, 0x1a8: 0x0012, 0x1a9: 0x0012,
+ 0x1aa: 0x0012, 0x1ab: 0x0012, 0x1ac: 0x0012, 0x1ad: 0x0012, 0x1ae: 0x0012, 0x1af: 0x0012,
+ 0x1b0: 0x0015, 0x1b1: 0x0015, 0x1b2: 0x0015, 0x1b3: 0x0015, 0x1b4: 0x0015, 0x1b5: 0x0015,
+ 0x1b6: 0x0015, 0x1b7: 0x0015, 0x1b8: 0x0015, 0x1b9: 0x0014, 0x1ba: 0x0014, 0x1bb: 0x0014,
+ 0x1bc: 0x0014, 0x1bd: 0x0014, 0x1be: 0x0014, 0x1bf: 0x0014,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x0024, 0x1c1: 0x0024, 0x1c2: 0x0024, 0x1c3: 0x0024, 0x1c4: 0x0024, 0x1c5: 0x128d,
+ 0x1c6: 0x0024, 0x1c7: 0x0034, 0x1c8: 0x0034, 0x1c9: 0x0034, 0x1ca: 0x0024, 0x1cb: 0x0024,
+ 0x1cc: 0x0024, 0x1cd: 0x0034, 0x1ce: 0x0034, 0x1cf: 0x0014, 0x1d0: 0x0024, 0x1d1: 0x0024,
+ 0x1d2: 0x0024, 0x1d3: 0x0034, 0x1d4: 0x0034, 0x1d5: 0x0034, 0x1d6: 0x0034, 0x1d7: 0x0024,
+ 0x1d8: 0x0034, 0x1d9: 0x0034, 0x1da: 0x0034, 0x1db: 0x0024, 0x1dc: 0x0034, 0x1dd: 0x0034,
+ 0x1de: 0x0034, 0x1df: 0x0034, 0x1e0: 0x0034, 0x1e1: 0x0034, 0x1e2: 0x0034, 0x1e3: 0x0024,
+ 0x1e4: 0x0024, 0x1e5: 0x0024, 0x1e6: 0x0024, 0x1e7: 0x0024, 0x1e8: 0x0024, 0x1e9: 0x0024,
+ 0x1ea: 0x0024, 0x1eb: 0x0024, 0x1ec: 0x0024, 0x1ed: 0x0024, 0x1ee: 0x0024, 0x1ef: 0x0024,
+ 0x1f0: 0x0113, 0x1f1: 0x0112, 0x1f2: 0x0113, 0x1f3: 0x0112, 0x1f4: 0x0014, 0x1f5: 0x0004,
+ 0x1f6: 0x0113, 0x1f7: 0x0112, 0x1fa: 0x0015, 0x1fb: 0x4d52,
+ 0x1fc: 0x5052, 0x1fd: 0x5052, 0x1ff: 0x5353,
+ // Block 0x8, offset 0x200
+ 0x204: 0x0004, 0x205: 0x0004,
+ 0x206: 0x2a13, 0x207: 0x0054, 0x208: 0x2513, 0x209: 0x2713, 0x20a: 0x2513,
+ 0x20c: 0x5653, 0x20e: 0x5953, 0x20f: 0x5c53, 0x210: 0x130a, 0x211: 0x2013,
+ 0x212: 0x2013, 0x213: 0x2013, 0x214: 0x2013, 0x215: 0x2013, 0x216: 0x2013, 0x217: 0x2013,
+ 0x218: 0x2013, 0x219: 0x2013, 0x21a: 0x2013, 0x21b: 0x2013, 0x21c: 0x2013, 0x21d: 0x2013,
+ 0x21e: 0x2013, 0x21f: 0x2013, 0x220: 0x5f53, 0x221: 0x5f53, 0x223: 0x5f53,
+ 0x224: 0x5f53, 0x225: 0x5f53, 0x226: 0x5f53, 0x227: 0x5f53, 0x228: 0x5f53, 0x229: 0x5f53,
+ 0x22a: 0x5f53, 0x22b: 0x5f53, 0x22c: 0x2a12, 0x22d: 0x2512, 0x22e: 0x2712, 0x22f: 0x2512,
+ 0x230: 0x144a, 0x231: 0x2012, 0x232: 0x2012, 0x233: 0x2012, 0x234: 0x2012, 0x235: 0x2012,
+ 0x236: 0x2012, 0x237: 0x2012, 0x238: 0x2012, 0x239: 0x2012, 0x23a: 0x2012, 0x23b: 0x2012,
+ 0x23c: 0x2012, 0x23d: 0x2012, 0x23e: 0x2012, 0x23f: 0x2012,
+ // Block 0x9, offset 0x240
+ 0x240: 0x5f52, 0x241: 0x5f52, 0x242: 0x158a, 0x243: 0x5f52, 0x244: 0x5f52, 0x245: 0x5f52,
+ 0x246: 0x5f52, 0x247: 0x5f52, 0x248: 0x5f52, 0x249: 0x5f52, 0x24a: 0x5f52, 0x24b: 0x5f52,
+ 0x24c: 0x5652, 0x24d: 0x5952, 0x24e: 0x5c52, 0x24f: 0x1813, 0x250: 0x160a, 0x251: 0x168a,
+ 0x252: 0x0013, 0x253: 0x0013, 0x254: 0x0013, 0x255: 0x170a, 0x256: 0x178a, 0x257: 0x1812,
+ 0x258: 0x0113, 0x259: 0x0112, 0x25a: 0x0113, 0x25b: 0x0112, 0x25c: 0x0113, 0x25d: 0x0112,
+ 0x25e: 0x0113, 0x25f: 0x0112, 0x260: 0x0113, 0x261: 0x0112, 0x262: 0x0113, 0x263: 0x0112,
+ 0x264: 0x0113, 0x265: 0x0112, 0x266: 0x0113, 0x267: 0x0112, 0x268: 0x0113, 0x269: 0x0112,
+ 0x26a: 0x0113, 0x26b: 0x0112, 0x26c: 0x0113, 0x26d: 0x0112, 0x26e: 0x0113, 0x26f: 0x0112,
+ 0x270: 0x180a, 0x271: 0x188a, 0x272: 0x0b12, 0x273: 0x5352, 0x274: 0x6253, 0x275: 0x190a,
+ 0x277: 0x0f13, 0x278: 0x0f12, 0x279: 0x0b13, 0x27a: 0x0113, 0x27b: 0x0112,
+ 0x27c: 0x0012, 0x27d: 0x4d53, 0x27e: 0x5053, 0x27f: 0x5053,
+ // Block 0xa, offset 0x280
+ 0x280: 0x0812, 0x281: 0x0812, 0x282: 0x0812, 0x283: 0x0812, 0x284: 0x0812, 0x285: 0x0812,
+ 0x288: 0x0813, 0x289: 0x0813, 0x28a: 0x0813, 0x28b: 0x0813,
+ 0x28c: 0x0813, 0x28d: 0x0813, 0x290: 0x239a, 0x291: 0x0812,
+ 0x292: 0x247a, 0x293: 0x0812, 0x294: 0x25ba, 0x295: 0x0812, 0x296: 0x26fa, 0x297: 0x0812,
+ 0x299: 0x0813, 0x29b: 0x0813, 0x29d: 0x0813,
+ 0x29f: 0x0813, 0x2a0: 0x0812, 0x2a1: 0x0812, 0x2a2: 0x0812, 0x2a3: 0x0812,
+ 0x2a4: 0x0812, 0x2a5: 0x0812, 0x2a6: 0x0812, 0x2a7: 0x0812, 0x2a8: 0x0813, 0x2a9: 0x0813,
+ 0x2aa: 0x0813, 0x2ab: 0x0813, 0x2ac: 0x0813, 0x2ad: 0x0813, 0x2ae: 0x0813, 0x2af: 0x0813,
+ 0x2b0: 0x8b52, 0x2b1: 0x8b52, 0x2b2: 0x8e52, 0x2b3: 0x8e52, 0x2b4: 0x9152, 0x2b5: 0x9152,
+ 0x2b6: 0x9452, 0x2b7: 0x9452, 0x2b8: 0x9752, 0x2b9: 0x9752, 0x2ba: 0x9a52, 0x2bb: 0x9a52,
+ 0x2bc: 0x4d52, 0x2bd: 0x4d52,
+ // Block 0xb, offset 0x2c0
+ 0x2c0: 0x283a, 0x2c1: 0x292a, 0x2c2: 0x2a1a, 0x2c3: 0x2b0a, 0x2c4: 0x2bfa, 0x2c5: 0x2cea,
+ 0x2c6: 0x2dda, 0x2c7: 0x2eca, 0x2c8: 0x2fb9, 0x2c9: 0x30a9, 0x2ca: 0x3199, 0x2cb: 0x3289,
+ 0x2cc: 0x3379, 0x2cd: 0x3469, 0x2ce: 0x3559, 0x2cf: 0x3649, 0x2d0: 0x373a, 0x2d1: 0x382a,
+ 0x2d2: 0x391a, 0x2d3: 0x3a0a, 0x2d4: 0x3afa, 0x2d5: 0x3bea, 0x2d6: 0x3cda, 0x2d7: 0x3dca,
+ 0x2d8: 0x3eb9, 0x2d9: 0x3fa9, 0x2da: 0x4099, 0x2db: 0x4189, 0x2dc: 0x4279, 0x2dd: 0x4369,
+ 0x2de: 0x4459, 0x2df: 0x4549, 0x2e0: 0x463a, 0x2e1: 0x472a, 0x2e2: 0x481a, 0x2e3: 0x490a,
+ 0x2e4: 0x49fa, 0x2e5: 0x4aea, 0x2e6: 0x4bda, 0x2e7: 0x4cca, 0x2e8: 0x4db9, 0x2e9: 0x4ea9,
+ 0x2ea: 0x4f99, 0x2eb: 0x5089, 0x2ec: 0x5179, 0x2ed: 0x5269, 0x2ee: 0x5359, 0x2ef: 0x5449,
+ 0x2f0: 0x0812, 0x2f1: 0x0812, 0x2f2: 0x553a, 0x2f3: 0x564a, 0x2f4: 0x571a,
+ 0x2f6: 0x57fa, 0x2f7: 0x58da, 0x2f8: 0x0813, 0x2f9: 0x0813, 0x2fa: 0x8b53, 0x2fb: 0x8b53,
+ 0x2fc: 0x5a19, 0x2fd: 0x0004, 0x2fe: 0x5aea, 0x2ff: 0x0004,
+ // Block 0xc, offset 0x300
+ 0x300: 0x0004, 0x301: 0x0004, 0x302: 0x5b6a, 0x303: 0x5c7a, 0x304: 0x5d4a,
+ 0x306: 0x5e2a, 0x307: 0x5f0a, 0x308: 0x8e53, 0x309: 0x8e53, 0x30a: 0x9153, 0x30b: 0x9153,
+ 0x30c: 0x6049, 0x30d: 0x0004, 0x30e: 0x0004, 0x30f: 0x0004, 0x310: 0x0812, 0x311: 0x0812,
+ 0x312: 0x611a, 0x313: 0x625a, 0x316: 0x639a, 0x317: 0x647a,
+ 0x318: 0x0813, 0x319: 0x0813, 0x31a: 0x9453, 0x31b: 0x9453, 0x31d: 0x0004,
+ 0x31e: 0x0004, 0x31f: 0x0004, 0x320: 0x0812, 0x321: 0x0812, 0x322: 0x65ba, 0x323: 0x66fa,
+ 0x324: 0x683a, 0x325: 0x0912, 0x326: 0x691a, 0x327: 0x69fa, 0x328: 0x0813, 0x329: 0x0813,
+ 0x32a: 0x9a53, 0x32b: 0x9a53, 0x32c: 0x0913, 0x32d: 0x0004, 0x32e: 0x0004, 0x32f: 0x0004,
+ 0x332: 0x6b3a, 0x333: 0x6c4a, 0x334: 0x6d1a,
+ 0x336: 0x6dfa, 0x337: 0x6eda, 0x338: 0x9753, 0x339: 0x9753, 0x33a: 0x4d53, 0x33b: 0x4d53,
+ 0x33c: 0x7019, 0x33d: 0x0004, 0x33e: 0x0004,
+ // Block 0xd, offset 0x340
+ 0x342: 0x0013,
+ 0x347: 0x0013, 0x34a: 0x0012, 0x34b: 0x0013,
+ 0x34c: 0x0013, 0x34d: 0x0013, 0x34e: 0x0012, 0x34f: 0x0012, 0x350: 0x0013, 0x351: 0x0013,
+ 0x352: 0x0013, 0x353: 0x0012, 0x355: 0x0013,
+ 0x359: 0x0013, 0x35a: 0x0013, 0x35b: 0x0013, 0x35c: 0x0013, 0x35d: 0x0013,
+ 0x364: 0x0013, 0x366: 0x70eb, 0x368: 0x0013,
+ 0x36a: 0x714b, 0x36b: 0x718b, 0x36c: 0x0013, 0x36d: 0x0013, 0x36f: 0x0012,
+ 0x370: 0x0013, 0x371: 0x0013, 0x372: 0x9d53, 0x373: 0x0013, 0x374: 0x0012, 0x375: 0x0010,
+ 0x376: 0x0010, 0x377: 0x0010, 0x378: 0x0010, 0x379: 0x0012,
+ 0x37c: 0x0012, 0x37d: 0x0012, 0x37e: 0x0013, 0x37f: 0x0013,
+ // Block 0xe, offset 0x380
+ 0x380: 0x1a13, 0x381: 0x1a13, 0x382: 0x1e13, 0x383: 0x1e13, 0x384: 0x1a13, 0x385: 0x1a13,
+ 0x386: 0x2613, 0x387: 0x2613, 0x388: 0x2a13, 0x389: 0x2a13, 0x38a: 0x2e13, 0x38b: 0x2e13,
+ 0x38c: 0x2a13, 0x38d: 0x2a13, 0x38e: 0x2613, 0x38f: 0x2613, 0x390: 0xa052, 0x391: 0xa052,
+ 0x392: 0xa352, 0x393: 0xa352, 0x394: 0xa652, 0x395: 0xa652, 0x396: 0xa352, 0x397: 0xa352,
+ 0x398: 0xa052, 0x399: 0xa052, 0x39a: 0x1a12, 0x39b: 0x1a12, 0x39c: 0x1e12, 0x39d: 0x1e12,
+ 0x39e: 0x1a12, 0x39f: 0x1a12, 0x3a0: 0x2612, 0x3a1: 0x2612, 0x3a2: 0x2a12, 0x3a3: 0x2a12,
+ 0x3a4: 0x2e12, 0x3a5: 0x2e12, 0x3a6: 0x2a12, 0x3a7: 0x2a12, 0x3a8: 0x2612, 0x3a9: 0x2612,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x6552, 0x3c1: 0x6552, 0x3c2: 0x6552, 0x3c3: 0x6552, 0x3c4: 0x6552, 0x3c5: 0x6552,
+ 0x3c6: 0x6552, 0x3c7: 0x6552, 0x3c8: 0x6552, 0x3c9: 0x6552, 0x3ca: 0x6552, 0x3cb: 0x6552,
+ 0x3cc: 0x6552, 0x3cd: 0x6552, 0x3ce: 0x6552, 0x3cf: 0x6552, 0x3d0: 0xa952, 0x3d1: 0xa952,
+ 0x3d2: 0xa952, 0x3d3: 0xa952, 0x3d4: 0xa952, 0x3d5: 0xa952, 0x3d6: 0xa952, 0x3d7: 0xa952,
+ 0x3d8: 0xa952, 0x3d9: 0xa952, 0x3da: 0xa952, 0x3db: 0xa952, 0x3dc: 0xa952, 0x3dd: 0xa952,
+ 0x3de: 0xa952, 0x3e0: 0x0113, 0x3e1: 0x0112, 0x3e2: 0x71eb, 0x3e3: 0x8853,
+ 0x3e4: 0x724b, 0x3e5: 0x72aa, 0x3e6: 0x730a, 0x3e7: 0x0f13, 0x3e8: 0x0f12, 0x3e9: 0x0313,
+ 0x3ea: 0x0312, 0x3eb: 0x0713, 0x3ec: 0x0712, 0x3ed: 0x736b, 0x3ee: 0x73cb, 0x3ef: 0x742b,
+ 0x3f0: 0x748b, 0x3f1: 0x0012, 0x3f2: 0x0113, 0x3f3: 0x0112, 0x3f4: 0x0012, 0x3f5: 0x0313,
+ 0x3f6: 0x0312, 0x3f7: 0x0012, 0x3f8: 0x0012, 0x3f9: 0x0012, 0x3fa: 0x0012, 0x3fb: 0x0012,
+ 0x3fc: 0x0015, 0x3fd: 0x0015, 0x3fe: 0x74eb, 0x3ff: 0x754b,
+ // Block 0x10, offset 0x400
+ 0x400: 0x0113, 0x401: 0x0112, 0x402: 0x0113, 0x403: 0x0112, 0x404: 0x0113, 0x405: 0x0112,
+ 0x406: 0x0113, 0x407: 0x0112, 0x408: 0x0014, 0x409: 0x0014, 0x40a: 0x0014, 0x40b: 0x0713,
+ 0x40c: 0x0712, 0x40d: 0x75ab, 0x40e: 0x0012, 0x40f: 0x0010, 0x410: 0x0113, 0x411: 0x0112,
+ 0x412: 0x0113, 0x413: 0x0112, 0x414: 0x0012, 0x415: 0x0012, 0x416: 0x0113, 0x417: 0x0112,
+ 0x418: 0x0113, 0x419: 0x0112, 0x41a: 0x0113, 0x41b: 0x0112, 0x41c: 0x0113, 0x41d: 0x0112,
+ 0x41e: 0x0113, 0x41f: 0x0112, 0x420: 0x0113, 0x421: 0x0112, 0x422: 0x0113, 0x423: 0x0112,
+ 0x424: 0x0113, 0x425: 0x0112, 0x426: 0x0113, 0x427: 0x0112, 0x428: 0x0113, 0x429: 0x0112,
+ 0x42a: 0x760b, 0x42b: 0x766b, 0x42c: 0x76cb, 0x42d: 0x772b, 0x42e: 0x778b,
+ 0x430: 0x77eb, 0x431: 0x784b, 0x432: 0x78ab, 0x433: 0xac53, 0x434: 0x0113, 0x435: 0x0112,
+ 0x436: 0x0113, 0x437: 0x0112,
+ // Block 0x11, offset 0x440
+ 0x440: 0x790a, 0x441: 0x798a, 0x442: 0x7a0a, 0x443: 0x7a8a, 0x444: 0x7b3a, 0x445: 0x7bea,
+ 0x446: 0x7c6a,
+ 0x453: 0x7cea, 0x454: 0x7dca, 0x455: 0x7eaa, 0x456: 0x7f8a, 0x457: 0x806a,
+ 0x45d: 0x0010,
+ 0x45e: 0x0034, 0x45f: 0x0010, 0x460: 0x0010, 0x461: 0x0010, 0x462: 0x0010, 0x463: 0x0010,
+ 0x464: 0x0010, 0x465: 0x0010, 0x466: 0x0010, 0x467: 0x0010, 0x468: 0x0010,
+ 0x46a: 0x0010, 0x46b: 0x0010, 0x46c: 0x0010, 0x46d: 0x0010, 0x46e: 0x0010, 0x46f: 0x0010,
+ 0x470: 0x0010, 0x471: 0x0010, 0x472: 0x0010, 0x473: 0x0010, 0x474: 0x0010, 0x475: 0x0010,
+ 0x476: 0x0010, 0x478: 0x0010, 0x479: 0x0010, 0x47a: 0x0010, 0x47b: 0x0010,
+ 0x47c: 0x0010, 0x47e: 0x0010,
+ // Block 0x12, offset 0x480
+ 0x480: 0x2213, 0x481: 0x2213, 0x482: 0x2613, 0x483: 0x2613, 0x484: 0x2213, 0x485: 0x2213,
+ 0x486: 0x2e13, 0x487: 0x2e13, 0x488: 0x2213, 0x489: 0x2213, 0x48a: 0x2613, 0x48b: 0x2613,
+ 0x48c: 0x2213, 0x48d: 0x2213, 0x48e: 0x3e13, 0x48f: 0x3e13, 0x490: 0x2213, 0x491: 0x2213,
+ 0x492: 0x2613, 0x493: 0x2613, 0x494: 0x2213, 0x495: 0x2213, 0x496: 0x2e13, 0x497: 0x2e13,
+ 0x498: 0x2213, 0x499: 0x2213, 0x49a: 0x2613, 0x49b: 0x2613, 0x49c: 0x2213, 0x49d: 0x2213,
+ 0x49e: 0xb553, 0x49f: 0xb553, 0x4a0: 0xb853, 0x4a1: 0xb853, 0x4a2: 0x2212, 0x4a3: 0x2212,
+ 0x4a4: 0x2612, 0x4a5: 0x2612, 0x4a6: 0x2212, 0x4a7: 0x2212, 0x4a8: 0x2e12, 0x4a9: 0x2e12,
+ 0x4aa: 0x2212, 0x4ab: 0x2212, 0x4ac: 0x2612, 0x4ad: 0x2612, 0x4ae: 0x2212, 0x4af: 0x2212,
+ 0x4b0: 0x3e12, 0x4b1: 0x3e12, 0x4b2: 0x2212, 0x4b3: 0x2212, 0x4b4: 0x2612, 0x4b5: 0x2612,
+ 0x4b6: 0x2212, 0x4b7: 0x2212, 0x4b8: 0x2e12, 0x4b9: 0x2e12, 0x4ba: 0x2212, 0x4bb: 0x2212,
+ 0x4bc: 0x2612, 0x4bd: 0x2612, 0x4be: 0x2212, 0x4bf: 0x2212,
+ // Block 0x13, offset 0x4c0
+ 0x4c2: 0x0010,
+ 0x4c7: 0x0010, 0x4c9: 0x0010, 0x4cb: 0x0010,
+ 0x4cd: 0x0010, 0x4ce: 0x0010, 0x4cf: 0x0010, 0x4d1: 0x0010,
+ 0x4d2: 0x0010, 0x4d4: 0x0010, 0x4d7: 0x0010,
+ 0x4d9: 0x0010, 0x4db: 0x0010, 0x4dd: 0x0010,
+ 0x4df: 0x0010, 0x4e1: 0x0010, 0x4e2: 0x0010,
+ 0x4e4: 0x0010, 0x4e7: 0x0010, 0x4e8: 0x0010, 0x4e9: 0x0010,
+ 0x4ea: 0x0010, 0x4ec: 0x0010, 0x4ed: 0x0010, 0x4ee: 0x0010, 0x4ef: 0x0010,
+ 0x4f0: 0x0010, 0x4f1: 0x0010, 0x4f2: 0x0010, 0x4f4: 0x0010, 0x4f5: 0x0010,
+ 0x4f6: 0x0010, 0x4f7: 0x0010, 0x4f9: 0x0010, 0x4fa: 0x0010, 0x4fb: 0x0010,
+ 0x4fc: 0x0010, 0x4fe: 0x0010,
+}
+
+// caseIndex: 25 blocks, 1600 entries, 3200 bytes
+// Block 0 is the zero block.
+var caseIndex = [1600]uint16{
+ // Block 0x0, offset 0x0
+ // Block 0x1, offset 0x40
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc2: 0x12, 0xc3: 0x13, 0xc4: 0x14, 0xc5: 0x15, 0xc6: 0x01, 0xc7: 0x02,
+ 0xc8: 0x16, 0xc9: 0x03, 0xca: 0x04, 0xcb: 0x17, 0xcc: 0x18, 0xcd: 0x05, 0xce: 0x06, 0xcf: 0x07,
+ 0xd0: 0x19, 0xd1: 0x1a, 0xd2: 0x1b, 0xd3: 0x1c, 0xd4: 0x1d, 0xd5: 0x1e, 0xd6: 0x1f, 0xd7: 0x20,
+ 0xd8: 0x21, 0xd9: 0x22, 0xda: 0x23, 0xdb: 0x24, 0xdc: 0x25, 0xdd: 0x26, 0xde: 0x27, 0xdf: 0x28,
+ 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05,
+ 0xea: 0x06, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x08, 0xef: 0x09,
+ 0xf0: 0x14, 0xf3: 0x16,
+ // Block 0x4, offset 0x100
+ 0x120: 0x29, 0x121: 0x2a, 0x122: 0x2b, 0x123: 0x2c, 0x124: 0x2d, 0x125: 0x2e, 0x126: 0x2f, 0x127: 0x30,
+ 0x128: 0x31, 0x129: 0x32, 0x12a: 0x33, 0x12b: 0x34, 0x12c: 0x35, 0x12d: 0x36, 0x12e: 0x37, 0x12f: 0x38,
+ 0x130: 0x39, 0x131: 0x3a, 0x132: 0x3b, 0x133: 0x3c, 0x134: 0x3d, 0x135: 0x3e, 0x136: 0x3f, 0x137: 0x40,
+ 0x138: 0x41, 0x139: 0x42, 0x13a: 0x43, 0x13b: 0x44, 0x13c: 0x45, 0x13d: 0x46, 0x13e: 0x47, 0x13f: 0x48,
+ // Block 0x5, offset 0x140
+ 0x140: 0x49, 0x141: 0x4a, 0x142: 0x4b, 0x143: 0x4c, 0x144: 0x23, 0x145: 0x23, 0x146: 0x23, 0x147: 0x23,
+ 0x148: 0x23, 0x149: 0x4d, 0x14a: 0x4e, 0x14b: 0x4f, 0x14c: 0x50, 0x14d: 0x51, 0x14e: 0x52, 0x14f: 0x53,
+ 0x150: 0x54, 0x151: 0x23, 0x152: 0x23, 0x153: 0x23, 0x154: 0x23, 0x155: 0x23, 0x156: 0x23, 0x157: 0x23,
+ 0x158: 0x23, 0x159: 0x55, 0x15a: 0x56, 0x15b: 0x57, 0x15c: 0x58, 0x15d: 0x59, 0x15e: 0x5a, 0x15f: 0x5b,
+ 0x160: 0x5c, 0x161: 0x5d, 0x162: 0x5e, 0x163: 0x5f, 0x164: 0x60, 0x165: 0x61, 0x167: 0x62,
+ 0x168: 0x63, 0x169: 0x64, 0x16a: 0x65, 0x16c: 0x66, 0x16d: 0x67, 0x16e: 0x68, 0x16f: 0x69,
+ 0x170: 0x6a, 0x171: 0x6b, 0x172: 0x6c, 0x173: 0x6d, 0x174: 0x6e, 0x175: 0x6f, 0x176: 0x70, 0x177: 0x71,
+ 0x178: 0x72, 0x179: 0x72, 0x17a: 0x73, 0x17b: 0x72, 0x17c: 0x74, 0x17d: 0x08, 0x17e: 0x09, 0x17f: 0x0a,
+ // Block 0x6, offset 0x180
+ 0x180: 0x75, 0x181: 0x76, 0x182: 0x77, 0x183: 0x78, 0x184: 0x0b, 0x185: 0x79, 0x186: 0x7a,
+ 0x192: 0x7b, 0x193: 0x0c,
+ 0x1b0: 0x7c, 0x1b1: 0x0d, 0x1b2: 0x72, 0x1b3: 0x7d, 0x1b4: 0x7e, 0x1b5: 0x7f, 0x1b6: 0x80, 0x1b7: 0x81,
+ 0x1b8: 0x82,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x83, 0x1c2: 0x84, 0x1c3: 0x85, 0x1c4: 0x86, 0x1c5: 0x23, 0x1c6: 0x87,
+ // Block 0x8, offset 0x200
+ 0x200: 0x88, 0x201: 0x23, 0x202: 0x23, 0x203: 0x23, 0x204: 0x23, 0x205: 0x23, 0x206: 0x23, 0x207: 0x23,
+ 0x208: 0x23, 0x209: 0x23, 0x20a: 0x23, 0x20b: 0x23, 0x20c: 0x23, 0x20d: 0x23, 0x20e: 0x23, 0x20f: 0x23,
+ 0x210: 0x23, 0x211: 0x23, 0x212: 0x89, 0x213: 0x8a, 0x214: 0x23, 0x215: 0x23, 0x216: 0x23, 0x217: 0x23,
+ 0x218: 0x8b, 0x219: 0x8c, 0x21a: 0x8d, 0x21b: 0x8e, 0x21c: 0x8f, 0x21d: 0x90, 0x21e: 0x0e, 0x21f: 0x91,
+ 0x220: 0x92, 0x221: 0x93, 0x222: 0x23, 0x223: 0x94, 0x224: 0x95, 0x225: 0x96, 0x226: 0x97, 0x227: 0x98,
+ 0x228: 0x99, 0x229: 0x9a, 0x22a: 0x9b, 0x22b: 0x9c, 0x22c: 0x9d, 0x22d: 0x9e, 0x22e: 0x9f, 0x22f: 0xa0,
+ 0x230: 0x23, 0x231: 0x23, 0x232: 0x23, 0x233: 0x23, 0x234: 0x23, 0x235: 0x23, 0x236: 0x23, 0x237: 0x23,
+ 0x238: 0x23, 0x239: 0x23, 0x23a: 0x23, 0x23b: 0x23, 0x23c: 0x23, 0x23d: 0x23, 0x23e: 0x23, 0x23f: 0x23,
+ // Block 0x9, offset 0x240
+ 0x240: 0x23, 0x241: 0x23, 0x242: 0x23, 0x243: 0x23, 0x244: 0x23, 0x245: 0x23, 0x246: 0x23, 0x247: 0x23,
+ 0x248: 0x23, 0x249: 0x23, 0x24a: 0x23, 0x24b: 0x23, 0x24c: 0x23, 0x24d: 0x23, 0x24e: 0x23, 0x24f: 0x23,
+ 0x250: 0x23, 0x251: 0x23, 0x252: 0x23, 0x253: 0x23, 0x254: 0x23, 0x255: 0x23, 0x256: 0x23, 0x257: 0x23,
+ 0x258: 0x23, 0x259: 0x23, 0x25a: 0x23, 0x25b: 0x23, 0x25c: 0x23, 0x25d: 0x23, 0x25e: 0x23, 0x25f: 0x23,
+ 0x260: 0x23, 0x261: 0x23, 0x262: 0x23, 0x263: 0x23, 0x264: 0x23, 0x265: 0x23, 0x266: 0x23, 0x267: 0x23,
+ 0x268: 0x23, 0x269: 0x23, 0x26a: 0x23, 0x26b: 0x23, 0x26c: 0x23, 0x26d: 0x23, 0x26e: 0x23, 0x26f: 0x23,
+ 0x270: 0x23, 0x271: 0x23, 0x272: 0x23, 0x273: 0x23, 0x274: 0x23, 0x275: 0x23, 0x276: 0x23, 0x277: 0x23,
+ 0x278: 0x23, 0x279: 0x23, 0x27a: 0x23, 0x27b: 0x23, 0x27c: 0x23, 0x27d: 0x23, 0x27e: 0x23, 0x27f: 0x23,
+ // Block 0xa, offset 0x280
+ 0x280: 0x23, 0x281: 0x23, 0x282: 0x23, 0x283: 0x23, 0x284: 0x23, 0x285: 0x23, 0x286: 0x23, 0x287: 0x23,
+ 0x288: 0x23, 0x289: 0x23, 0x28a: 0x23, 0x28b: 0x23, 0x28c: 0x23, 0x28d: 0x23, 0x28e: 0x23, 0x28f: 0x23,
+ 0x290: 0x23, 0x291: 0x23, 0x292: 0x23, 0x293: 0x23, 0x294: 0x23, 0x295: 0x23, 0x296: 0x23, 0x297: 0x23,
+ 0x298: 0x23, 0x299: 0x23, 0x29a: 0x23, 0x29b: 0x23, 0x29c: 0x23, 0x29d: 0x23, 0x29e: 0xa1, 0x29f: 0xa2,
+ // Block 0xb, offset 0x2c0
+ 0x2ec: 0x0f, 0x2ed: 0xa3, 0x2ee: 0xa4, 0x2ef: 0xa5,
+ 0x2f0: 0x23, 0x2f1: 0x23, 0x2f2: 0x23, 0x2f3: 0x23, 0x2f4: 0xa6, 0x2f5: 0xa7, 0x2f6: 0xa8, 0x2f7: 0xa9,
+ 0x2f8: 0xaa, 0x2f9: 0xab, 0x2fa: 0x23, 0x2fb: 0xac, 0x2fc: 0xad, 0x2fd: 0xae, 0x2fe: 0xaf, 0x2ff: 0xb0,
+ // Block 0xc, offset 0x300
+ 0x300: 0xb1, 0x301: 0xb2, 0x302: 0x23, 0x303: 0xb3, 0x305: 0xb4, 0x307: 0xb5,
+ 0x30a: 0xb6, 0x30b: 0xb7, 0x30c: 0xb8, 0x30d: 0xb9, 0x30e: 0xba, 0x30f: 0xbb,
+ 0x310: 0xbc, 0x311: 0xbd, 0x312: 0xbe, 0x313: 0xbf, 0x314: 0xc0, 0x315: 0xc1,
+ 0x318: 0x23, 0x319: 0x23, 0x31a: 0x23, 0x31b: 0x23, 0x31c: 0xc2, 0x31d: 0xc3,
+ 0x320: 0xc4, 0x321: 0xc5, 0x322: 0xc6, 0x323: 0xc7, 0x324: 0xc8, 0x326: 0xc9,
+ 0x328: 0xca, 0x329: 0xcb, 0x32a: 0xcc, 0x32b: 0xcd, 0x32c: 0x5f, 0x32d: 0xce, 0x32e: 0xcf,
+ 0x330: 0x23, 0x331: 0xd0, 0x332: 0xd1, 0x333: 0xd2,
+ // Block 0xd, offset 0x340
+ 0x340: 0xd3, 0x341: 0xd4, 0x342: 0xd5, 0x343: 0xd6, 0x344: 0xd7, 0x345: 0xd8, 0x346: 0xd9, 0x347: 0xda,
+ 0x348: 0xdb, 0x34a: 0xdc, 0x34b: 0xdd, 0x34c: 0xde, 0x34d: 0xdf,
+ 0x350: 0xe0, 0x351: 0xe1, 0x352: 0xe2, 0x353: 0xe3, 0x356: 0xe4, 0x357: 0xe5,
+ 0x358: 0xe6, 0x359: 0xe7, 0x35a: 0xe8, 0x35b: 0xe9, 0x35c: 0xea,
+ 0x362: 0xeb, 0x363: 0xec,
+ 0x368: 0xed, 0x369: 0xee, 0x36a: 0xef, 0x36b: 0xf0,
+ 0x370: 0xf1, 0x371: 0xf2, 0x372: 0xf3, 0x374: 0xf4, 0x375: 0xf5,
+ // Block 0xe, offset 0x380
+ 0x380: 0x23, 0x381: 0x23, 0x382: 0x23, 0x383: 0x23, 0x384: 0x23, 0x385: 0x23, 0x386: 0x23, 0x387: 0x23,
+ 0x388: 0x23, 0x389: 0x23, 0x38a: 0x23, 0x38b: 0x23, 0x38c: 0x23, 0x38d: 0x23, 0x38e: 0xf6,
+ 0x390: 0x23, 0x391: 0xf7, 0x392: 0x23, 0x393: 0x23, 0x394: 0x23, 0x395: 0xf8,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x23, 0x3c1: 0x23, 0x3c2: 0x23, 0x3c3: 0x23, 0x3c4: 0x23, 0x3c5: 0x23, 0x3c6: 0x23, 0x3c7: 0x23,
+ 0x3c8: 0x23, 0x3c9: 0x23, 0x3ca: 0x23, 0x3cb: 0x23, 0x3cc: 0x23, 0x3cd: 0x23, 0x3ce: 0x23, 0x3cf: 0x23,
+ 0x3d0: 0xf7,
+ // Block 0x10, offset 0x400
+ 0x410: 0x23, 0x411: 0x23, 0x412: 0x23, 0x413: 0x23, 0x414: 0x23, 0x415: 0x23, 0x416: 0x23, 0x417: 0x23,
+ 0x418: 0x23, 0x419: 0xf9,
+ // Block 0x11, offset 0x440
+ 0x460: 0x23, 0x461: 0x23, 0x462: 0x23, 0x463: 0x23, 0x464: 0x23, 0x465: 0x23, 0x466: 0x23, 0x467: 0x23,
+ 0x468: 0xf0, 0x469: 0xfa, 0x46b: 0xfb, 0x46c: 0xfc, 0x46d: 0xfd, 0x46e: 0xfe,
+ 0x47c: 0x23, 0x47d: 0xff, 0x47e: 0x100, 0x47f: 0x101,
+ // Block 0x12, offset 0x480
+ 0x4b0: 0x23, 0x4b1: 0x102, 0x4b2: 0x103,
+ // Block 0x13, offset 0x4c0
+ 0x4c5: 0x104, 0x4c6: 0x105,
+ 0x4c9: 0x106,
+ 0x4d0: 0x107, 0x4d1: 0x108, 0x4d2: 0x109, 0x4d3: 0x10a, 0x4d4: 0x10b, 0x4d5: 0x10c, 0x4d6: 0x10d, 0x4d7: 0x10e,
+ 0x4d8: 0x10f, 0x4d9: 0x110, 0x4da: 0x111, 0x4db: 0x112, 0x4dc: 0x113, 0x4dd: 0x114, 0x4de: 0x115, 0x4df: 0x116,
+ 0x4e8: 0x117, 0x4e9: 0x118, 0x4ea: 0x119,
+ // Block 0x14, offset 0x500
+ 0x500: 0x11a,
+ 0x520: 0x23, 0x521: 0x23, 0x522: 0x23, 0x523: 0x11b, 0x524: 0x10, 0x525: 0x11c,
+ 0x538: 0x11d, 0x539: 0x11, 0x53a: 0x11e,
+ // Block 0x15, offset 0x540
+ 0x544: 0x11f, 0x545: 0x120, 0x546: 0x121,
+ 0x54f: 0x122,
+ // Block 0x16, offset 0x580
+ 0x590: 0x0a, 0x591: 0x0b, 0x592: 0x0c, 0x593: 0x0d, 0x594: 0x0e, 0x596: 0x0f,
+ 0x59b: 0x10, 0x59d: 0x11, 0x59e: 0x12, 0x59f: 0x13,
+ // Block 0x17, offset 0x5c0
+ 0x5c0: 0x123, 0x5c1: 0x124, 0x5c4: 0x124, 0x5c5: 0x124, 0x5c6: 0x124, 0x5c7: 0x125,
+ // Block 0x18, offset 0x600
+ 0x620: 0x15,
+}
+
+// sparseOffsets: 277 entries, 554 bytes
+var sparseOffsets = []uint16{0x0, 0x9, 0xf, 0x18, 0x24, 0x2e, 0x35, 0x38, 0x3c, 0x3f, 0x43, 0x4d, 0x4f, 0x54, 0x64, 0x6b, 0x70, 0x7e, 0x7f, 0x8d, 0x9c, 0xa6, 0xa9, 0xaf, 0xb7, 0xba, 0xbc, 0xca, 0xd0, 0xde, 0xe9, 0xf5, 0x100, 0x10c, 0x116, 0x122, 0x12d, 0x139, 0x145, 0x14d, 0x155, 0x15f, 0x16a, 0x176, 0x17d, 0x188, 0x18d, 0x195, 0x198, 0x19d, 0x1a1, 0x1a5, 0x1ac, 0x1b5, 0x1bd, 0x1be, 0x1c7, 0x1ce, 0x1d6, 0x1dc, 0x1e2, 0x1e7, 0x1eb, 0x1ee, 0x1f0, 0x1f3, 0x1f8, 0x1f9, 0x1fb, 0x1fd, 0x1ff, 0x206, 0x20b, 0x20f, 0x218, 0x21b, 0x21e, 0x224, 0x225, 0x230, 0x231, 0x232, 0x237, 0x244, 0x24c, 0x254, 0x25d, 0x266, 0x26f, 0x274, 0x277, 0x280, 0x28d, 0x28f, 0x296, 0x298, 0x2a4, 0x2a5, 0x2b0, 0x2b8, 0x2c0, 0x2c6, 0x2c7, 0x2d5, 0x2da, 0x2dd, 0x2e2, 0x2e6, 0x2ec, 0x2f1, 0x2f4, 0x2f9, 0x2fe, 0x2ff, 0x305, 0x307, 0x308, 0x30a, 0x30c, 0x30f, 0x310, 0x312, 0x315, 0x31b, 0x31f, 0x321, 0x326, 0x32d, 0x331, 0x33a, 0x33b, 0x343, 0x347, 0x34c, 0x354, 0x35a, 0x360, 0x36a, 0x36f, 0x378, 0x37e, 0x385, 0x389, 0x391, 0x393, 0x395, 0x398, 0x39a, 0x39c, 0x39d, 0x39e, 0x3a0, 0x3a2, 0x3a8, 0x3ad, 0x3af, 0x3b5, 0x3b8, 0x3ba, 0x3c0, 0x3c5, 0x3c7, 0x3c8, 0x3c9, 0x3ca, 0x3cc, 0x3ce, 0x3d0, 0x3d3, 0x3d5, 0x3d8, 0x3e0, 0x3e3, 0x3e7, 0x3ef, 0x3f1, 0x3f2, 0x3f3, 0x3f5, 0x3fb, 0x3fd, 0x3fe, 0x400, 0x402, 0x404, 0x411, 0x412, 0x413, 0x417, 0x419, 0x41a, 0x41b, 0x41c, 0x41d, 0x421, 0x425, 0x42b, 0x42d, 0x434, 0x437, 0x43b, 0x441, 0x44a, 0x450, 0x456, 0x460, 0x46a, 0x46c, 0x473, 0x479, 0x47f, 0x485, 0x488, 0x48e, 0x491, 0x499, 0x49a, 0x4a1, 0x4a2, 0x4a5, 0x4af, 0x4b5, 0x4bb, 0x4bc, 0x4c2, 0x4c5, 0x4cd, 0x4d4, 0x4db, 0x4dc, 0x4dd, 0x4de, 0x4df, 0x4e1, 0x4e3, 0x4e5, 0x4e9, 0x4ea, 0x4ec, 0x4ed, 0x4ee, 0x4f0, 0x4f5, 0x4fa, 0x4fe, 0x4ff, 0x502, 0x506, 0x511, 0x515, 0x51d, 0x522, 0x526, 0x529, 0x52d, 0x530, 0x533, 0x538, 0x53c, 0x540, 0x544, 0x548, 0x54a, 0x54c, 0x54f, 0x554, 0x556, 0x55b, 0x564, 0x569, 0x56a, 0x56d, 0x56e, 0x56f, 0x571, 0x572, 0x573}
+
+// sparseValues: 1395 entries, 5580 bytes
+var sparseValues = [1395]valueRange{
+ // Block 0x0, offset 0x0
+ {value: 0x0004, lo: 0xa8, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xaa},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0004, lo: 0xaf, hi: 0xaf},
+ {value: 0x0004, lo: 0xb4, hi: 0xb4},
+ {value: 0x001a, lo: 0xb5, hi: 0xb5},
+ {value: 0x0054, lo: 0xb7, hi: 0xb7},
+ {value: 0x0004, lo: 0xb8, hi: 0xb8},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ // Block 0x1, offset 0x9
+ {value: 0x2013, lo: 0x80, hi: 0x96},
+ {value: 0x2013, lo: 0x98, hi: 0x9e},
+ {value: 0x009a, lo: 0x9f, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xb6},
+ {value: 0x2012, lo: 0xb8, hi: 0xbe},
+ {value: 0x0252, lo: 0xbf, hi: 0xbf},
+ // Block 0x2, offset 0xf
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x011b, lo: 0xb0, hi: 0xb0},
+ {value: 0x019a, lo: 0xb1, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb7},
+ {value: 0x0012, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x0553, lo: 0xbf, hi: 0xbf},
+ // Block 0x3, offset 0x18
+ {value: 0x0552, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x01da, lo: 0x89, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xb7},
+ {value: 0x0253, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x028a, lo: 0xbf, hi: 0xbf},
+ // Block 0x4, offset 0x24
+ {value: 0x0117, lo: 0x80, hi: 0x9f},
+ {value: 0x2f53, lo: 0xa0, hi: 0xa0},
+ {value: 0x0012, lo: 0xa1, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xb3},
+ {value: 0x0012, lo: 0xb4, hi: 0xb9},
+ {value: 0x090b, lo: 0xba, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x2953, lo: 0xbd, hi: 0xbd},
+ {value: 0x098b, lo: 0xbe, hi: 0xbe},
+ {value: 0x0a0a, lo: 0xbf, hi: 0xbf},
+ // Block 0x5, offset 0x2e
+ {value: 0x0015, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x97},
+ {value: 0x0004, lo: 0x98, hi: 0x9d},
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0015, lo: 0xa0, hi: 0xa4},
+ {value: 0x0004, lo: 0xa5, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xbf},
+ // Block 0x6, offset 0x35
+ {value: 0x0024, lo: 0x80, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbf},
+ // Block 0x7, offset 0x38
+ {value: 0x6553, lo: 0x80, hi: 0x8f},
+ {value: 0x2013, lo: 0x90, hi: 0x9f},
+ {value: 0x5f53, lo: 0xa0, hi: 0xaf},
+ {value: 0x2012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8, offset 0x3c
+ {value: 0x5f52, lo: 0x80, hi: 0x8f},
+ {value: 0x6552, lo: 0x90, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x9, offset 0x3f
+ {value: 0x0117, lo: 0x80, hi: 0x81},
+ {value: 0x0024, lo: 0x83, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xbf},
+ // Block 0xa, offset 0x43
+ {value: 0x0f13, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0716, lo: 0x8b, hi: 0x8c},
+ {value: 0x0316, lo: 0x8d, hi: 0x8e},
+ {value: 0x0f12, lo: 0x8f, hi: 0x8f},
+ {value: 0x0117, lo: 0x90, hi: 0xbf},
+ // Block 0xb, offset 0x4d
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x6553, lo: 0xb1, hi: 0xbf},
+ // Block 0xc, offset 0x4f
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6853, lo: 0x90, hi: 0x96},
+ {value: 0x0014, lo: 0x99, hi: 0x99},
+ {value: 0x6552, lo: 0xa1, hi: 0xaf},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0xd, offset 0x54
+ {value: 0x6852, lo: 0x80, hi: 0x86},
+ {value: 0x198a, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0024, lo: 0x92, hi: 0x95},
+ {value: 0x0034, lo: 0x96, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x99},
+ {value: 0x0034, lo: 0x9a, hi: 0x9b},
+ {value: 0x0024, lo: 0x9c, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa7},
+ {value: 0x0024, lo: 0xa8, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xbd},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xe, offset 0x64
+ {value: 0x0034, lo: 0x81, hi: 0x82},
+ {value: 0x0024, lo: 0x84, hi: 0x84},
+ {value: 0x0034, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb3},
+ {value: 0x0054, lo: 0xb4, hi: 0xb4},
+ // Block 0xf, offset 0x6b
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0024, lo: 0x90, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0014, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x10, offset 0x70
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9c},
+ {value: 0x0024, lo: 0x9d, hi: 0x9e},
+ {value: 0x0034, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x11, offset 0x7e
+ {value: 0x0010, lo: 0x80, hi: 0xbf},
+ // Block 0x12, offset 0x7f
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0024, lo: 0x9f, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x13, offset 0x8d
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0034, lo: 0xb1, hi: 0xb1},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0024, lo: 0xbf, hi: 0xbf},
+ // Block 0x14, offset 0x9c
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0024, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x88},
+ {value: 0x0024, lo: 0x89, hi: 0x8a},
+ {value: 0x0010, lo: 0x8d, hi: 0xbf},
+ // Block 0x15, offset 0xa6
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x16, offset 0xa9
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xb1},
+ {value: 0x0034, lo: 0xb2, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ // Block 0x17, offset 0xaf
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x99},
+ {value: 0x0014, lo: 0x9a, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0xa3},
+ {value: 0x0014, lo: 0xa4, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xad},
+ // Block 0x18, offset 0xb7
+ {value: 0x0010, lo: 0x80, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0xa0, hi: 0xaa},
+ // Block 0x19, offset 0xba
+ {value: 0x0010, lo: 0xa0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbd},
+ // Block 0x1a, offset 0xbc
+ {value: 0x0024, lo: 0x94, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0024, lo: 0xaa, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbf},
+ // Block 0x1b, offset 0xca
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1c, offset 0xd0
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0x1d, offset 0xde
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb6, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1e, offset 0xe9
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xb1},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ // Block 0x1f, offset 0xf5
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x20, offset 0x100
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x99, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x21, offset 0x10c
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x22, offset 0x116
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x85},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xbf},
+ // Block 0x23, offset 0x122
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x24, offset 0x12d
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x25, offset 0x139
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0010, lo: 0xa8, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x26, offset 0x145
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x27, offset 0x14d
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb9},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbf},
+ // Block 0x28, offset 0x155
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x88},
+ {value: 0x0014, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x29, offset 0x15f
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x2a, offset 0x16a
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb2},
+ // Block 0x2b, offset 0x176
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x2c, offset 0x17d
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x94, hi: 0x97},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xba, hi: 0xbf},
+ // Block 0x2d, offset 0x188
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x96},
+ {value: 0x0010, lo: 0x9a, hi: 0xb1},
+ {value: 0x0010, lo: 0xb3, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x2e, offset 0x18d
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x94},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9f},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ // Block 0x2f, offset 0x195
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ // Block 0x30, offset 0x198
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x31, offset 0x19d
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xb9},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ // Block 0x32, offset 0x1a1
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x33, offset 0x1a5
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0034, lo: 0x98, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0034, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x34, offset 0x1ac
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xac},
+ {value: 0x0034, lo: 0xb1, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xba, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x35, offset 0x1b5
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0024, lo: 0x82, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x86, hi: 0x87},
+ {value: 0x0010, lo: 0x88, hi: 0x8c},
+ {value: 0x0014, lo: 0x8d, hi: 0x97},
+ {value: 0x0014, lo: 0x99, hi: 0xbc},
+ // Block 0x36, offset 0x1bd
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ // Block 0x37, offset 0x1be
+ {value: 0x0010, lo: 0xab, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbe},
+ // Block 0x38, offset 0x1c7
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x96, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x99},
+ {value: 0x0014, lo: 0x9e, hi: 0xa0},
+ {value: 0x0010, lo: 0xa2, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xad},
+ {value: 0x0014, lo: 0xb1, hi: 0xb4},
+ // Block 0x39, offset 0x1ce
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x6c53, lo: 0xa0, hi: 0xbf},
+ // Block 0x3a, offset 0x1d6
+ {value: 0x7053, lo: 0x80, hi: 0x85},
+ {value: 0x7053, lo: 0x87, hi: 0x87},
+ {value: 0x7053, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xba},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x3b, offset 0x1dc
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x9a, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x3c, offset 0x1e2
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x3d, offset 0x1e7
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x82, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3e, offset 0x1eb
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3f, offset 0x1ee
+ {value: 0x0010, lo: 0x80, hi: 0x9a},
+ {value: 0x0024, lo: 0x9d, hi: 0x9f},
+ // Block 0x40, offset 0x1f0
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x7453, lo: 0xa0, hi: 0xaf},
+ {value: 0x7853, lo: 0xb0, hi: 0xbf},
+ // Block 0x41, offset 0x1f3
+ {value: 0x7c53, lo: 0x80, hi: 0x8f},
+ {value: 0x8053, lo: 0x90, hi: 0x9f},
+ {value: 0x7c53, lo: 0xa0, hi: 0xaf},
+ {value: 0x0813, lo: 0xb0, hi: 0xb5},
+ {value: 0x0892, lo: 0xb8, hi: 0xbd},
+ // Block 0x42, offset 0x1f8
+ {value: 0x0010, lo: 0x81, hi: 0xbf},
+ // Block 0x43, offset 0x1f9
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0010, lo: 0xaf, hi: 0xbf},
+ // Block 0x44, offset 0x1fb
+ {value: 0x0010, lo: 0x81, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x45, offset 0x1fd
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb8},
+ // Block 0x46, offset 0x1ff
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0034, lo: 0x94, hi: 0x94},
+ {value: 0x0010, lo: 0xa0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ // Block 0x47, offset 0x206
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xac},
+ {value: 0x0010, lo: 0xae, hi: 0xb0},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ // Block 0x48, offset 0x20b
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x49, offset 0x20f
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x89, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0014, lo: 0x93, hi: 0x93},
+ {value: 0x0004, lo: 0x97, hi: 0x97},
+ {value: 0x0024, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0x4a, offset 0x218
+ {value: 0x0014, lo: 0x8b, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x4b, offset 0x21b
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb7},
+ // Block 0x4c, offset 0x21e
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x4d, offset 0x224
+ {value: 0x0010, lo: 0x80, hi: 0xb5},
+ // Block 0x4e, offset 0x225
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbb},
+ // Block 0x4f, offset 0x230
+ {value: 0x0010, lo: 0x86, hi: 0x8f},
+ // Block 0x50, offset 0x231
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x51, offset 0x232
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ // Block 0x52, offset 0x237
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x9e},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xac},
+ {value: 0x0010, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xbc},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x53, offset 0x244
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xa7, hi: 0xa7},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ {value: 0x0034, lo: 0xb5, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbc},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0x54, offset 0x24c
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x55, offset 0x254
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0030, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xab, hi: 0xab},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ {value: 0x0024, lo: 0xad, hi: 0xb3},
+ // Block 0x56, offset 0x25d
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0030, lo: 0xaa, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbf},
+ // Block 0x57, offset 0x266
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0030, lo: 0xb2, hi: 0xb3},
+ // Block 0x58, offset 0x26f
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0x59, offset 0x274
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8d, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x5a, offset 0x277
+ {value: 0x1a6a, lo: 0x80, hi: 0x80},
+ {value: 0x1aea, lo: 0x81, hi: 0x81},
+ {value: 0x1b6a, lo: 0x82, hi: 0x82},
+ {value: 0x1bea, lo: 0x83, hi: 0x83},
+ {value: 0x1c6a, lo: 0x84, hi: 0x84},
+ {value: 0x1cea, lo: 0x85, hi: 0x85},
+ {value: 0x1d6a, lo: 0x86, hi: 0x86},
+ {value: 0x1dea, lo: 0x87, hi: 0x87},
+ {value: 0x1e6a, lo: 0x88, hi: 0x88},
+ // Block 0x5b, offset 0x280
+ {value: 0x0024, lo: 0x90, hi: 0x92},
+ {value: 0x0034, lo: 0x94, hi: 0x99},
+ {value: 0x0024, lo: 0x9a, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9f},
+ {value: 0x0024, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xb3},
+ {value: 0x0024, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb7},
+ {value: 0x0024, lo: 0xb8, hi: 0xb9},
+ // Block 0x5c, offset 0x28d
+ {value: 0x0012, lo: 0x80, hi: 0xab},
+ {value: 0x0015, lo: 0xac, hi: 0xbf},
+ // Block 0x5d, offset 0x28f
+ {value: 0x0015, lo: 0x80, hi: 0xaa},
+ {value: 0x0012, lo: 0xab, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb8},
+ {value: 0x8452, lo: 0xb9, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbc},
+ {value: 0x8852, lo: 0xbd, hi: 0xbd},
+ {value: 0x0012, lo: 0xbe, hi: 0xbf},
+ // Block 0x5e, offset 0x296
+ {value: 0x0012, lo: 0x80, hi: 0x9a},
+ {value: 0x0015, lo: 0x9b, hi: 0xbf},
+ // Block 0x5f, offset 0x298
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0024, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb9},
+ {value: 0x0024, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbd},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x60, offset 0x2a4
+ {value: 0x0117, lo: 0x80, hi: 0xbf},
+ // Block 0x61, offset 0x2a5
+ {value: 0x0117, lo: 0x80, hi: 0x95},
+ {value: 0x1f1a, lo: 0x96, hi: 0x96},
+ {value: 0x1fca, lo: 0x97, hi: 0x97},
+ {value: 0x207a, lo: 0x98, hi: 0x98},
+ {value: 0x212a, lo: 0x99, hi: 0x99},
+ {value: 0x21da, lo: 0x9a, hi: 0x9a},
+ {value: 0x228a, lo: 0x9b, hi: 0x9b},
+ {value: 0x0012, lo: 0x9c, hi: 0x9d},
+ {value: 0x233b, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0x9f, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x62, offset 0x2b0
+ {value: 0x0812, lo: 0x80, hi: 0x87},
+ {value: 0x0813, lo: 0x88, hi: 0x8f},
+ {value: 0x0812, lo: 0x90, hi: 0x95},
+ {value: 0x0813, lo: 0x98, hi: 0x9d},
+ {value: 0x0812, lo: 0xa0, hi: 0xa7},
+ {value: 0x0813, lo: 0xa8, hi: 0xaf},
+ {value: 0x0812, lo: 0xb0, hi: 0xb7},
+ {value: 0x0813, lo: 0xb8, hi: 0xbf},
+ // Block 0x63, offset 0x2b8
+ {value: 0x0004, lo: 0x8b, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8f},
+ {value: 0x0054, lo: 0x98, hi: 0x99},
+ {value: 0x0054, lo: 0xa4, hi: 0xa4},
+ {value: 0x0054, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xaa, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xaf},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x64, offset 0x2c0
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x94, hi: 0x94},
+ {value: 0x0014, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa6, hi: 0xaf},
+ {value: 0x0015, lo: 0xb1, hi: 0xb1},
+ {value: 0x0015, lo: 0xbf, hi: 0xbf},
+ // Block 0x65, offset 0x2c6
+ {value: 0x0015, lo: 0x90, hi: 0x9c},
+ // Block 0x66, offset 0x2c7
+ {value: 0x0024, lo: 0x90, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0xa0},
+ {value: 0x0024, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa4},
+ {value: 0x0034, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ // Block 0x67, offset 0x2d5
+ {value: 0x0016, lo: 0x85, hi: 0x86},
+ {value: 0x0012, lo: 0x87, hi: 0x89},
+ {value: 0x9d52, lo: 0x8e, hi: 0x8e},
+ {value: 0x1013, lo: 0xa0, hi: 0xaf},
+ {value: 0x1012, lo: 0xb0, hi: 0xbf},
+ // Block 0x68, offset 0x2da
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x88},
+ // Block 0x69, offset 0x2dd
+ {value: 0xa053, lo: 0xb6, hi: 0xb7},
+ {value: 0xa353, lo: 0xb8, hi: 0xb9},
+ {value: 0xa653, lo: 0xba, hi: 0xbb},
+ {value: 0xa353, lo: 0xbc, hi: 0xbd},
+ {value: 0xa053, lo: 0xbe, hi: 0xbf},
+ // Block 0x6a, offset 0x2e2
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6553, lo: 0x90, hi: 0x9f},
+ {value: 0xa953, lo: 0xa0, hi: 0xae},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0x6b, offset 0x2e6
+ {value: 0x0117, lo: 0x80, hi: 0xa3},
+ {value: 0x0012, lo: 0xa4, hi: 0xa4},
+ {value: 0x0716, lo: 0xab, hi: 0xac},
+ {value: 0x0316, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb3},
+ // Block 0x6c, offset 0x2ec
+ {value: 0x6c52, lo: 0x80, hi: 0x9f},
+ {value: 0x7052, lo: 0xa0, hi: 0xa5},
+ {value: 0x7052, lo: 0xa7, hi: 0xa7},
+ {value: 0x7052, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x6d, offset 0x2f1
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x6e, offset 0x2f4
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0010, lo: 0xb0, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x6f, offset 0x2f9
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9e},
+ {value: 0x0024, lo: 0xa0, hi: 0xbf},
+ // Block 0x70, offset 0x2fe
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ // Block 0x71, offset 0x2ff
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0xaa, hi: 0xad},
+ {value: 0x0030, lo: 0xae, hi: 0xaf},
+ {value: 0x0004, lo: 0xb1, hi: 0xb5},
+ {value: 0x0014, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ // Block 0x72, offset 0x305
+ {value: 0x0034, lo: 0x99, hi: 0x9a},
+ {value: 0x0004, lo: 0x9b, hi: 0x9e},
+ // Block 0x73, offset 0x307
+ {value: 0x0004, lo: 0xbc, hi: 0xbe},
+ // Block 0x74, offset 0x308
+ {value: 0x0010, lo: 0x85, hi: 0xae},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x75, offset 0x30a
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0010, lo: 0xa0, hi: 0xba},
+ // Block 0x76, offset 0x30c
+ {value: 0x0010, lo: 0x80, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0xbf},
+ // Block 0x77, offset 0x30f
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ // Block 0x78, offset 0x310
+ {value: 0x0010, lo: 0x90, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x79, offset 0x312
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0xab},
+ // Block 0x7a, offset 0x315
+ {value: 0x0117, lo: 0x80, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb2},
+ {value: 0x0024, lo: 0xb4, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x7b, offset 0x31b
+ {value: 0x0117, lo: 0x80, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9d},
+ {value: 0x0024, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x7c, offset 0x31f
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb1},
+ // Block 0x7d, offset 0x321
+ {value: 0x0004, lo: 0x80, hi: 0x96},
+ {value: 0x0014, lo: 0x97, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xaf},
+ {value: 0x0012, lo: 0xb0, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xbf},
+ // Block 0x7e, offset 0x326
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x0015, lo: 0xb0, hi: 0xb0},
+ {value: 0x0012, lo: 0xb1, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x8453, lo: 0xbd, hi: 0xbd},
+ {value: 0x0117, lo: 0xbe, hi: 0xbf},
+ // Block 0x7f, offset 0x32d
+ {value: 0x0010, lo: 0xb7, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbf},
+ // Block 0x80, offset 0x331
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x8c, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ // Block 0x81, offset 0x33a
+ {value: 0x0010, lo: 0x80, hi: 0xb3},
+ // Block 0x82, offset 0x33b
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xa0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb7},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x83, offset 0x343
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x84, offset 0x347
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0x92},
+ {value: 0x0030, lo: 0x93, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0x85, offset 0x34c
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x86, offset 0x354
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0004, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x87, offset 0x35a
+ {value: 0x0010, lo: 0x80, hi: 0xa8},
+ {value: 0x0014, lo: 0xa9, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0x88, offset 0x360
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x89, offset 0x36a
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0024, lo: 0xbe, hi: 0xbf},
+ // Block 0x8a, offset 0x36f
+ {value: 0x0024, lo: 0x81, hi: 0x81},
+ {value: 0x0004, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ // Block 0x8b, offset 0x378
+ {value: 0x0010, lo: 0x81, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x8e},
+ {value: 0x0010, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8c, offset 0x37e
+ {value: 0x0012, lo: 0x80, hi: 0x92},
+ {value: 0xac52, lo: 0x93, hi: 0x93},
+ {value: 0x0012, lo: 0x94, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa5},
+ {value: 0x74d2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8d, offset 0x385
+ {value: 0x78d2, lo: 0x80, hi: 0x8f},
+ {value: 0x7cd2, lo: 0x90, hi: 0x9f},
+ {value: 0x80d2, lo: 0xa0, hi: 0xaf},
+ {value: 0x7cd2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8e, offset 0x389
+ {value: 0x0010, lo: 0x80, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x8f, offset 0x391
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x90, offset 0x393
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x8b, hi: 0xbb},
+ // Block 0x91, offset 0x395
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0xbf},
+ // Block 0x92, offset 0x398
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0004, lo: 0xb2, hi: 0xbf},
+ // Block 0x93, offset 0x39a
+ {value: 0x0004, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x93, hi: 0xbf},
+ // Block 0x94, offset 0x39c
+ {value: 0x0010, lo: 0x80, hi: 0xbd},
+ // Block 0x95, offset 0x39d
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0x96, offset 0x39e
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0xbf},
+ // Block 0x97, offset 0x3a0
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0xb0, hi: 0xbb},
+ // Block 0x98, offset 0x3a2
+ {value: 0x0014, lo: 0x80, hi: 0x8f},
+ {value: 0x0054, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0xa0, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xad},
+ {value: 0x0024, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ // Block 0x99, offset 0x3a8
+ {value: 0x0010, lo: 0x8d, hi: 0x8f},
+ {value: 0x0054, lo: 0x92, hi: 0x92},
+ {value: 0x0054, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0xb0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0x9a, offset 0x3ad
+ {value: 0x0010, lo: 0x80, hi: 0xbc},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x9b, offset 0x3af
+ {value: 0x0054, lo: 0x87, hi: 0x87},
+ {value: 0x0054, lo: 0x8e, hi: 0x8e},
+ {value: 0x0054, lo: 0x9a, hi: 0x9a},
+ {value: 0x5f53, lo: 0xa1, hi: 0xba},
+ {value: 0x0004, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9c, offset 0x3b5
+ {value: 0x0004, lo: 0x80, hi: 0x80},
+ {value: 0x5f52, lo: 0x81, hi: 0x9a},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ // Block 0x9d, offset 0x3b8
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbe},
+ // Block 0x9e, offset 0x3ba
+ {value: 0x0010, lo: 0x82, hi: 0x87},
+ {value: 0x0010, lo: 0x8a, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0x97},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0004, lo: 0xa3, hi: 0xa3},
+ {value: 0x0014, lo: 0xb9, hi: 0xbb},
+ // Block 0x9f, offset 0x3c0
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0010, lo: 0x8d, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xba},
+ {value: 0x0010, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xa0, offset 0x3c5
+ {value: 0x0010, lo: 0x80, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x9d},
+ // Block 0xa1, offset 0x3c7
+ {value: 0x0010, lo: 0x80, hi: 0xba},
+ // Block 0xa2, offset 0x3c8
+ {value: 0x0010, lo: 0x80, hi: 0xb4},
+ // Block 0xa3, offset 0x3c9
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0xa4, offset 0x3ca
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa5, offset 0x3cc
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ // Block 0xa6, offset 0x3ce
+ {value: 0x0010, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xad, hi: 0xbf},
+ // Block 0xa7, offset 0x3d0
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0xb5},
+ {value: 0x0024, lo: 0xb6, hi: 0xba},
+ // Block 0xa8, offset 0x3d3
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa9, offset 0x3d5
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x91, hi: 0x95},
+ // Block 0xaa, offset 0x3d8
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x97},
+ {value: 0xaf53, lo: 0x98, hi: 0x9f},
+ {value: 0xb253, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbf},
+ // Block 0xab, offset 0x3e0
+ {value: 0xaf52, lo: 0x80, hi: 0x87},
+ {value: 0xb252, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xac, offset 0x3e3
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0xb253, lo: 0xb0, hi: 0xb7},
+ {value: 0xaf53, lo: 0xb8, hi: 0xbf},
+ // Block 0xad, offset 0x3e7
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x93},
+ {value: 0xb252, lo: 0x98, hi: 0x9f},
+ {value: 0xaf52, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbb},
+ // Block 0xae, offset 0x3ef
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xaf, offset 0x3f1
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ // Block 0xb0, offset 0x3f2
+ {value: 0x0010, lo: 0x80, hi: 0xb6},
+ // Block 0xb1, offset 0x3f3
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ // Block 0xb2, offset 0x3f5
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xb3, offset 0x3fb
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xb4, offset 0x3fd
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ // Block 0xb5, offset 0x3fe
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ // Block 0xb6, offset 0x400
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb9},
+ // Block 0xb7, offset 0x402
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0xb8, offset 0x404
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x8e, hi: 0x8e},
+ {value: 0x0024, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x99, hi: 0xb3},
+ {value: 0x0024, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xb9, offset 0x411
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0xba, offset 0x412
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ // Block 0xbb, offset 0x413
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ // Block 0xbc, offset 0x417
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ // Block 0xbd, offset 0x419
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ // Block 0xbe, offset 0x41a
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ // Block 0xbf, offset 0x41b
+ {value: 0x5653, lo: 0x80, hi: 0xb2},
+ // Block 0xc0, offset 0x41c
+ {value: 0x5652, lo: 0x80, hi: 0xb2},
+ // Block 0xc1, offset 0x41d
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xc2, offset 0x421
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xc3, offset 0x425
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ // Block 0xc4, offset 0x42b
+ {value: 0x0010, lo: 0x90, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc5, offset 0x42d
+ {value: 0x0024, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0xc6, offset 0x434
+ {value: 0x0010, lo: 0x90, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ // Block 0xc7, offset 0x437
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xc8, offset 0x43b
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ // Block 0xc9, offset 0x441
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb4},
+ {value: 0x0030, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xb7},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0xca, offset 0x44a
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xcb, offset 0x450
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa2},
+ {value: 0x0014, lo: 0xa3, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xcc, offset 0x456
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xcd, offset 0x460
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0030, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9d, hi: 0xa3},
+ {value: 0x0024, lo: 0xa6, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ // Block 0xce, offset 0x46a
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xcf, offset 0x46c
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd0, offset 0x473
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xd1, offset 0x479
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd2, offset 0x47f
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd3, offset 0x485
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x98, hi: 0x9b},
+ {value: 0x0014, lo: 0x9c, hi: 0x9d},
+ // Block 0xd4, offset 0x488
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd5, offset 0x48e
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd6, offset 0x491
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0014, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb5},
+ {value: 0x0030, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0xd7, offset 0x499
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ // Block 0xd8, offset 0x49a
+ {value: 0x0014, lo: 0x9d, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xd9, offset 0x4a1
+ {value: 0x5f53, lo: 0xa0, hi: 0xbf},
+ // Block 0xda, offset 0x4a2
+ {value: 0x5f52, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xdb, offset 0x4a5
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x89, hi: 0x8a},
+ {value: 0x0010, lo: 0x8b, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbe},
+ // Block 0xdc, offset 0x4af
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0014, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x98},
+ {value: 0x0014, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0xbf},
+ // Block 0xdd, offset 0x4b5
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x86, hi: 0x89},
+ {value: 0x0014, lo: 0x8a, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x99},
+ // Block 0xde, offset 0x4bb
+ {value: 0x0010, lo: 0x80, hi: 0xb8},
+ // Block 0xdf, offset 0x4bc
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xe0, offset 0x4c2
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0xe1, offset 0x4c5
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0014, lo: 0x92, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xa9},
+ {value: 0x0014, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0xe2, offset 0x4cd
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb6},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xe3, offset 0x4d4
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xe4, offset 0x4db
+ {value: 0x0010, lo: 0x80, hi: 0x99},
+ // Block 0xe5, offset 0x4dc
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ // Block 0xe6, offset 0x4dd
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ // Block 0xe7, offset 0x4de
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ // Block 0xe8, offset 0x4df
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xe9, offset 0x4e1
+ {value: 0x0010, lo: 0x90, hi: 0xad},
+ {value: 0x0034, lo: 0xb0, hi: 0xb4},
+ // Block 0xea, offset 0x4e3
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ // Block 0xeb, offset 0x4e5
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa3, hi: 0xb7},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xec, offset 0x4e9
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ // Block 0xed, offset 0x4ea
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0xbe},
+ // Block 0xee, offset 0x4ec
+ {value: 0x0014, lo: 0x8f, hi: 0x9f},
+ // Block 0xef, offset 0x4ed
+ {value: 0x0014, lo: 0xa0, hi: 0xa1},
+ // Block 0xf0, offset 0x4ee
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbc},
+ // Block 0xf1, offset 0x4f0
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0034, lo: 0x9e, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa3},
+ // Block 0xf2, offset 0x4f5
+ {value: 0x0030, lo: 0xa5, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xa9},
+ {value: 0x0030, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbf},
+ // Block 0xf3, offset 0x4fa
+ {value: 0x0034, lo: 0x80, hi: 0x82},
+ {value: 0x0024, lo: 0x85, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8b},
+ {value: 0x0024, lo: 0xaa, hi: 0xad},
+ // Block 0xf4, offset 0x4fe
+ {value: 0x0024, lo: 0x82, hi: 0x84},
+ // Block 0xf5, offset 0x4ff
+ {value: 0x0013, lo: 0x80, hi: 0x99},
+ {value: 0x0012, lo: 0x9a, hi: 0xb3},
+ {value: 0x0013, lo: 0xb4, hi: 0xbf},
+ // Block 0xf6, offset 0x502
+ {value: 0x0013, lo: 0x80, hi: 0x8d},
+ {value: 0x0012, lo: 0x8e, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0xa7},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0xf7, offset 0x506
+ {value: 0x0013, lo: 0x80, hi: 0x81},
+ {value: 0x0012, lo: 0x82, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0x9c},
+ {value: 0x0013, lo: 0x9e, hi: 0x9f},
+ {value: 0x0013, lo: 0xa2, hi: 0xa2},
+ {value: 0x0013, lo: 0xa5, hi: 0xa6},
+ {value: 0x0013, lo: 0xa9, hi: 0xac},
+ {value: 0x0013, lo: 0xae, hi: 0xb5},
+ {value: 0x0012, lo: 0xb6, hi: 0xb9},
+ {value: 0x0012, lo: 0xbb, hi: 0xbb},
+ {value: 0x0012, lo: 0xbd, hi: 0xbf},
+ // Block 0xf8, offset 0x511
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0012, lo: 0x85, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0xf9, offset 0x515
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0013, lo: 0x84, hi: 0x85},
+ {value: 0x0013, lo: 0x87, hi: 0x8a},
+ {value: 0x0013, lo: 0x8d, hi: 0x94},
+ {value: 0x0013, lo: 0x96, hi: 0x9c},
+ {value: 0x0012, lo: 0x9e, hi: 0xb7},
+ {value: 0x0013, lo: 0xb8, hi: 0xb9},
+ {value: 0x0013, lo: 0xbb, hi: 0xbe},
+ // Block 0xfa, offset 0x51d
+ {value: 0x0013, lo: 0x80, hi: 0x84},
+ {value: 0x0013, lo: 0x86, hi: 0x86},
+ {value: 0x0013, lo: 0x8a, hi: 0x90},
+ {value: 0x0012, lo: 0x92, hi: 0xab},
+ {value: 0x0013, lo: 0xac, hi: 0xbf},
+ // Block 0xfb, offset 0x522
+ {value: 0x0013, lo: 0x80, hi: 0x85},
+ {value: 0x0012, lo: 0x86, hi: 0x9f},
+ {value: 0x0013, lo: 0xa0, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbf},
+ // Block 0xfc, offset 0x526
+ {value: 0x0012, lo: 0x80, hi: 0x93},
+ {value: 0x0013, lo: 0x94, hi: 0xad},
+ {value: 0x0012, lo: 0xae, hi: 0xbf},
+ // Block 0xfd, offset 0x529
+ {value: 0x0012, lo: 0x80, hi: 0x87},
+ {value: 0x0013, lo: 0x88, hi: 0xa1},
+ {value: 0x0012, lo: 0xa2, hi: 0xbb},
+ {value: 0x0013, lo: 0xbc, hi: 0xbf},
+ // Block 0xfe, offset 0x52d
+ {value: 0x0013, lo: 0x80, hi: 0x95},
+ {value: 0x0012, lo: 0x96, hi: 0xaf},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0xff, offset 0x530
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0012, lo: 0x8a, hi: 0xa5},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x100, offset 0x533
+ {value: 0x0013, lo: 0x80, hi: 0x80},
+ {value: 0x0012, lo: 0x82, hi: 0x9a},
+ {value: 0x0012, lo: 0x9c, hi: 0xa1},
+ {value: 0x0013, lo: 0xa2, hi: 0xba},
+ {value: 0x0012, lo: 0xbc, hi: 0xbf},
+ // Block 0x101, offset 0x538
+ {value: 0x0012, lo: 0x80, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0xb4},
+ {value: 0x0012, lo: 0xb6, hi: 0xbf},
+ // Block 0x102, offset 0x53c
+ {value: 0x0012, lo: 0x80, hi: 0x8e},
+ {value: 0x0012, lo: 0x90, hi: 0x95},
+ {value: 0x0013, lo: 0x96, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x103, offset 0x540
+ {value: 0x0012, lo: 0x80, hi: 0x88},
+ {value: 0x0012, lo: 0x8a, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x104, offset 0x544
+ {value: 0x0012, lo: 0x80, hi: 0x82},
+ {value: 0x0012, lo: 0x84, hi: 0x89},
+ {value: 0x0017, lo: 0x8a, hi: 0x8b},
+ {value: 0x0010, lo: 0x8e, hi: 0xbf},
+ // Block 0x105, offset 0x548
+ {value: 0x0014, lo: 0x80, hi: 0xb6},
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x106, offset 0x54a
+ {value: 0x0014, lo: 0x80, hi: 0xac},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x107, offset 0x54c
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x9b, hi: 0x9f},
+ {value: 0x0014, lo: 0xa1, hi: 0xaf},
+ // Block 0x108, offset 0x54f
+ {value: 0x0024, lo: 0x80, hi: 0x86},
+ {value: 0x0024, lo: 0x88, hi: 0x98},
+ {value: 0x0024, lo: 0x9b, hi: 0xa1},
+ {value: 0x0024, lo: 0xa3, hi: 0xa4},
+ {value: 0x0024, lo: 0xa6, hi: 0xaa},
+ // Block 0x109, offset 0x554
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0034, lo: 0x90, hi: 0x96},
+ // Block 0x10a, offset 0x556
+ {value: 0xb552, lo: 0x80, hi: 0x81},
+ {value: 0xb852, lo: 0x82, hi: 0x83},
+ {value: 0x0024, lo: 0x84, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x10b, offset 0x55b
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x9f},
+ {value: 0x0010, lo: 0xa1, hi: 0xa2},
+ {value: 0x0010, lo: 0xa4, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb7},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ // Block 0x10c, offset 0x564
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x9b},
+ {value: 0x0010, lo: 0xa1, hi: 0xa3},
+ {value: 0x0010, lo: 0xa5, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xbb},
+ // Block 0x10d, offset 0x569
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x10e, offset 0x56a
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x10f, offset 0x56d
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ // Block 0x110, offset 0x56e
+ {value: 0x0004, lo: 0xbb, hi: 0xbf},
+ // Block 0x111, offset 0x56f
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0014, lo: 0xa0, hi: 0xbf},
+ // Block 0x112, offset 0x571
+ {value: 0x0014, lo: 0x80, hi: 0xbf},
+ // Block 0x113, offset 0x572
+ {value: 0x0014, lo: 0x80, hi: 0xaf},
+}
+
+// Total table size 14177 bytes (13KiB); checksum: F17D40E8
diff --git a/vendor/golang.org/x/text/cases/tables11.0.0.go b/vendor/golang.org/x/text/cases/tables11.0.0.go
new file mode 100644
index 00000000000..ce00ce37250
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/tables11.0.0.go
@@ -0,0 +1,2316 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+//go:build go1.13 && !go1.14
+
+package cases
+
+// UnicodeVersion is the Unicode version from which the tables in this package are derived.
+const UnicodeVersion = "11.0.0"
+
+var xorData string = "" + // Size: 188 bytes
+ "\x00\x06\x07\x00\x01?\x00\x0f\x03\x00\x0f\x12\x00\x0f\x1f\x00\x0f\x1d" +
+ "\x00\x01\x13\x00\x0f\x16\x00\x0f\x0b\x00\x0f3\x00\x0f7\x00\x01#\x00\x0f?" +
+ "\x00\x0e'\x00\x0f/\x00\x0e>\x00\x0f*\x00\x0c&\x00\x0c*\x00\x0c;\x00\x0c9" +
+ "\x00\x0c%\x00\x01\x08\x00\x03\x0d\x00\x03\x09\x00\x02\x06\x00\x02\x02" +
+ "\x00\x02\x0c\x00\x01\x00\x00\x01\x03\x00\x01\x01\x00\x01 \x00\x01\x0c" +
+ "\x00\x01\x10\x00\x03\x10\x00\x036 \x00\x037 \x00\x0b#\x10\x00\x0b 0\x00" +
+ "\x0b!\x10\x00\x0b!0\x001\x00\x00\x0b(\x04\x00\x03\x04\x1e\x00\x03\x0a" +
+ "\x00\x02:\x00\x02>\x00\x02,\x00\x02\x00\x00\x02\x10\x00\x01<\x00\x01&" +
+ "\x00\x01*\x00\x01.\x00\x010\x003 \x00\x01\x18\x00\x01(\x00\x01\x1e\x00" +
+ "\x01\x22"
+
+var exceptions string = "" + // Size: 2436 bytes
+ "\x00\x12\x12μΜΜ\x12\x12ssSSSs\x13\x18i̇i̇\x10\x09II\x13\x1bʼnʼNʼN\x11" +
+ "\x09sSS\x12\x12dždžDž\x12\x12dždžDŽ\x10\x12DŽDž\x12\x12ljljLj\x12\x12ljljLJ\x10\x12LJLj" +
+ "\x12\x12njnjNj\x12\x12njnjNJ\x10\x12NJNj\x13\x1bǰJ̌J̌\x12\x12dzdzDz\x12\x12dzdzDZ\x10" +
+ "\x12DZDz\x13\x18ⱥⱥ\x13\x18ⱦⱦ\x10\x1bⱾⱾ\x10\x1bⱿⱿ\x10\x1bⱯⱯ\x10\x1bⱭⱭ\x10" +
+ "\x1bⱰⱰ\x10\x1bꞫꞫ\x10\x1bꞬꞬ\x10\x1bꞍꞍ\x10\x1bꞪꞪ\x10\x1bꞮꞮ\x10\x1bⱢⱢ\x10" +
+ "\x1bꞭꞭ\x10\x1bⱮⱮ\x10\x1bⱤⱤ\x10\x1bꞱꞱ\x10\x1bꞲꞲ\x10\x1bꞰꞰ2\x12ιΙΙ\x166ΐ" +
+ "Ϊ́Ϊ́\x166ΰΫ́Ϋ́\x12\x12σΣΣ\x12\x12βΒΒ\x12\x12θΘΘ\x12\x12φΦΦ\x12" +
+ "\x12πΠΠ\x12\x12κΚΚ\x12\x12ρΡΡ\x12\x12εΕΕ\x14$եւԵՒԵւ\x10\x1bᲐა\x10\x1bᲑბ" +
+ "\x10\x1bᲒგ\x10\x1bᲓდ\x10\x1bᲔე\x10\x1bᲕვ\x10\x1bᲖზ\x10\x1bᲗთ\x10\x1bᲘი" +
+ "\x10\x1bᲙკ\x10\x1bᲚლ\x10\x1bᲛმ\x10\x1bᲜნ\x10\x1bᲝო\x10\x1bᲞპ\x10\x1bᲟჟ" +
+ "\x10\x1bᲠრ\x10\x1bᲡს\x10\x1bᲢტ\x10\x1bᲣუ\x10\x1bᲤფ\x10\x1bᲥქ\x10\x1bᲦღ" +
+ "\x10\x1bᲧყ\x10\x1bᲨშ\x10\x1bᲩჩ\x10\x1bᲪც\x10\x1bᲫძ\x10\x1bᲬწ\x10\x1bᲭჭ" +
+ "\x10\x1bᲮხ\x10\x1bᲯჯ\x10\x1bᲰჰ\x10\x1bᲱჱ\x10\x1bᲲჲ\x10\x1bᲳჳ\x10\x1bᲴჴ" +
+ "\x10\x1bᲵჵ\x10\x1bᲶჶ\x10\x1bᲷჷ\x10\x1bᲸჸ\x10\x1bᲹჹ\x10\x1bᲺჺ\x10\x1bᲽჽ" +
+ "\x10\x1bᲾჾ\x10\x1bᲿჿ\x12\x12вВВ\x12\x12дДД\x12\x12оОО\x12\x12сСС\x12\x12" +
+ "тТТ\x12\x12тТТ\x12\x12ъЪЪ\x12\x12ѣѢѢ\x13\x1bꙋꙊꙊ\x13\x1bẖH̱H̱\x13\x1bẗ" +
+ "T̈T̈\x13\x1bẘW̊W̊\x13\x1bẙY̊Y̊\x13\x1baʾAʾAʾ\x13\x1bṡṠṠ\x12\x10ssß\x14" +
+ "$ὐΥ̓Υ̓\x166ὒΥ̓̀Υ̓̀\x166ὔΥ̓́Υ̓́\x166ὖΥ̓͂Υ̓͂\x15+ἀιἈΙᾈ\x15+ἁιἉΙᾉ" +
+ "\x15+ἂιἊΙᾊ\x15+ἃιἋΙᾋ\x15+ἄιἌΙᾌ\x15+ἅιἍΙᾍ\x15+ἆιἎΙᾎ\x15+ἇιἏΙᾏ\x15\x1dἀιᾀἈ" +
+ "Ι\x15\x1dἁιᾁἉΙ\x15\x1dἂιᾂἊΙ\x15\x1dἃιᾃἋΙ\x15\x1dἄιᾄἌΙ\x15\x1dἅιᾅἍΙ\x15" +
+ "\x1dἆιᾆἎΙ\x15\x1dἇιᾇἏΙ\x15+ἠιἨΙᾘ\x15+ἡιἩΙᾙ\x15+ἢιἪΙᾚ\x15+ἣιἫΙᾛ\x15+ἤιἬΙᾜ" +
+ "\x15+ἥιἭΙᾝ\x15+ἦιἮΙᾞ\x15+ἧιἯΙᾟ\x15\x1dἠιᾐἨΙ\x15\x1dἡιᾑἩΙ\x15\x1dἢιᾒἪΙ" +
+ "\x15\x1dἣιᾓἫΙ\x15\x1dἤιᾔἬΙ\x15\x1dἥιᾕἭΙ\x15\x1dἦιᾖἮΙ\x15\x1dἧιᾗἯΙ\x15+ὠι" +
+ "ὨΙᾨ\x15+ὡιὩΙᾩ\x15+ὢιὪΙᾪ\x15+ὣιὫΙᾫ\x15+ὤιὬΙᾬ\x15+ὥιὭΙᾭ\x15+ὦιὮΙᾮ\x15+ὧι" +
+ "ὯΙᾯ\x15\x1dὠιᾠὨΙ\x15\x1dὡιᾡὩΙ\x15\x1dὢιᾢὪΙ\x15\x1dὣιᾣὫΙ\x15\x1dὤιᾤὬΙ" +
+ "\x15\x1dὥιᾥὭΙ\x15\x1dὦιᾦὮΙ\x15\x1dὧιᾧὯΙ\x15-ὰιᾺΙᾺͅ\x14#αιΑΙᾼ\x14$άιΆΙΆͅ" +
+ "\x14$ᾶΑ͂Α͂\x166ᾶιΑ͂Ιᾼ͂\x14\x1cαιᾳΑΙ\x12\x12ιΙΙ\x15-ὴιῊΙῊͅ\x14#ηιΗΙῌ" +
+ "\x14$ήιΉΙΉͅ\x14$ῆΗ͂Η͂\x166ῆιΗ͂Ιῌ͂\x14\x1cηιῃΗΙ\x166ῒΪ̀Ϊ̀\x166ΐΙ" +
+ "̈́Ϊ́\x14$ῖΙ͂Ι͂\x166ῗΪ͂Ϊ͂\x166ῢΫ̀Ϋ̀\x166ΰΫ́Ϋ́\x14$ῤΡ̓Ρ̓" +
+ "\x14$ῦΥ͂Υ͂\x166ῧΫ͂Ϋ͂\x15-ὼιῺΙῺͅ\x14#ωιΩΙῼ\x14$ώιΏΙΏͅ\x14$ῶΩ͂Ω͂\x16" +
+ "6ῶιΩ͂Ιῼ͂\x14\x1cωιῳΩΙ\x12\x10ωω\x11\x08kk\x12\x10åå\x12\x10ɫɫ\x12\x10ɽ" +
+ "ɽ\x10\x12ȺȺ\x10\x12ȾȾ\x12\x10ɑɑ\x12\x10ɱɱ\x12\x10ɐɐ\x12\x10ɒɒ\x12\x10ȿȿ" +
+ "\x12\x10ɀɀ\x12\x10ɥɥ\x12\x10ɦɦ\x12\x10ɜɜ\x12\x10ɡɡ\x12\x10ɬɬ\x12\x10ɪɪ" +
+ "\x12\x10ʞʞ\x12\x10ʇʇ\x12\x10ʝʝ\x12\x12ffFFFf\x12\x12fiFIFi\x12\x12flFLFl" +
+ "\x13\x1bffiFFIFfi\x13\x1bfflFFLFfl\x12\x12stSTSt\x12\x12stSTSt\x14$մնՄՆՄ" +
+ "ն\x14$մեՄԵՄե\x14$միՄԻՄի\x14$վնՎՆՎն\x14$մխՄԽՄխ"
+
+// lookup returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookup(s []byte) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupUnsafe(s []byte) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// lookupString returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookupString(s string) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupStringUnsafe(s string) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// caseTrie. Total size: 12250 bytes (11.96 KiB). Checksum: 53ff6cb7321675e1.
+type caseTrie struct{}
+
+func newCaseTrie(i int) *caseTrie {
+ return &caseTrie{}
+}
+
+// lookupValue determines the type of block n and looks up the value for b.
+func (t *caseTrie) lookupValue(n uint32, b byte) uint16 {
+ switch {
+ case n < 20:
+ return uint16(caseValues[n<<6+uint32(b)])
+ default:
+ n -= 20
+ return uint16(sparse.lookup(n, b))
+ }
+}
+
+// caseValues: 22 blocks, 1408 entries, 2816 bytes
+// The third block is the zero block.
+var caseValues = [1408]uint16{
+ // Block 0x0, offset 0x0
+ 0x27: 0x0054,
+ 0x2e: 0x0054,
+ 0x30: 0x0010, 0x31: 0x0010, 0x32: 0x0010, 0x33: 0x0010, 0x34: 0x0010, 0x35: 0x0010,
+ 0x36: 0x0010, 0x37: 0x0010, 0x38: 0x0010, 0x39: 0x0010, 0x3a: 0x0054,
+ // Block 0x1, offset 0x40
+ 0x41: 0x2013, 0x42: 0x2013, 0x43: 0x2013, 0x44: 0x2013, 0x45: 0x2013,
+ 0x46: 0x2013, 0x47: 0x2013, 0x48: 0x2013, 0x49: 0x2013, 0x4a: 0x2013, 0x4b: 0x2013,
+ 0x4c: 0x2013, 0x4d: 0x2013, 0x4e: 0x2013, 0x4f: 0x2013, 0x50: 0x2013, 0x51: 0x2013,
+ 0x52: 0x2013, 0x53: 0x2013, 0x54: 0x2013, 0x55: 0x2013, 0x56: 0x2013, 0x57: 0x2013,
+ 0x58: 0x2013, 0x59: 0x2013, 0x5a: 0x2013,
+ 0x5e: 0x0004, 0x5f: 0x0010, 0x60: 0x0004, 0x61: 0x2012, 0x62: 0x2012, 0x63: 0x2012,
+ 0x64: 0x2012, 0x65: 0x2012, 0x66: 0x2012, 0x67: 0x2012, 0x68: 0x2012, 0x69: 0x2012,
+ 0x6a: 0x2012, 0x6b: 0x2012, 0x6c: 0x2012, 0x6d: 0x2012, 0x6e: 0x2012, 0x6f: 0x2012,
+ 0x70: 0x2012, 0x71: 0x2012, 0x72: 0x2012, 0x73: 0x2012, 0x74: 0x2012, 0x75: 0x2012,
+ 0x76: 0x2012, 0x77: 0x2012, 0x78: 0x2012, 0x79: 0x2012, 0x7a: 0x2012,
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc0: 0x0852, 0xc1: 0x0b53, 0xc2: 0x0113, 0xc3: 0x0112, 0xc4: 0x0113, 0xc5: 0x0112,
+ 0xc6: 0x0b53, 0xc7: 0x0f13, 0xc8: 0x0f12, 0xc9: 0x0e53, 0xca: 0x1153, 0xcb: 0x0713,
+ 0xcc: 0x0712, 0xcd: 0x0012, 0xce: 0x1453, 0xcf: 0x1753, 0xd0: 0x1a53, 0xd1: 0x0313,
+ 0xd2: 0x0312, 0xd3: 0x1d53, 0xd4: 0x2053, 0xd5: 0x2352, 0xd6: 0x2653, 0xd7: 0x2653,
+ 0xd8: 0x0113, 0xd9: 0x0112, 0xda: 0x2952, 0xdb: 0x0012, 0xdc: 0x1d53, 0xdd: 0x2c53,
+ 0xde: 0x2f52, 0xdf: 0x3253, 0xe0: 0x0113, 0xe1: 0x0112, 0xe2: 0x0113, 0xe3: 0x0112,
+ 0xe4: 0x0113, 0xe5: 0x0112, 0xe6: 0x3553, 0xe7: 0x0f13, 0xe8: 0x0f12, 0xe9: 0x3853,
+ 0xea: 0x0012, 0xeb: 0x0012, 0xec: 0x0113, 0xed: 0x0112, 0xee: 0x3553, 0xef: 0x1f13,
+ 0xf0: 0x1f12, 0xf1: 0x3b53, 0xf2: 0x3e53, 0xf3: 0x0713, 0xf4: 0x0712, 0xf5: 0x0313,
+ 0xf6: 0x0312, 0xf7: 0x4153, 0xf8: 0x0113, 0xf9: 0x0112, 0xfa: 0x0012, 0xfb: 0x0010,
+ 0xfc: 0x0113, 0xfd: 0x0112, 0xfe: 0x0012, 0xff: 0x4452,
+ // Block 0x4, offset 0x100
+ 0x100: 0x0010, 0x101: 0x0010, 0x102: 0x0010, 0x103: 0x0010, 0x104: 0x02db, 0x105: 0x0359,
+ 0x106: 0x03da, 0x107: 0x043b, 0x108: 0x04b9, 0x109: 0x053a, 0x10a: 0x059b, 0x10b: 0x0619,
+ 0x10c: 0x069a, 0x10d: 0x0313, 0x10e: 0x0312, 0x10f: 0x1f13, 0x110: 0x1f12, 0x111: 0x0313,
+ 0x112: 0x0312, 0x113: 0x0713, 0x114: 0x0712, 0x115: 0x0313, 0x116: 0x0312, 0x117: 0x0f13,
+ 0x118: 0x0f12, 0x119: 0x0313, 0x11a: 0x0312, 0x11b: 0x0713, 0x11c: 0x0712, 0x11d: 0x1452,
+ 0x11e: 0x0113, 0x11f: 0x0112, 0x120: 0x0113, 0x121: 0x0112, 0x122: 0x0113, 0x123: 0x0112,
+ 0x124: 0x0113, 0x125: 0x0112, 0x126: 0x0113, 0x127: 0x0112, 0x128: 0x0113, 0x129: 0x0112,
+ 0x12a: 0x0113, 0x12b: 0x0112, 0x12c: 0x0113, 0x12d: 0x0112, 0x12e: 0x0113, 0x12f: 0x0112,
+ 0x130: 0x06fa, 0x131: 0x07ab, 0x132: 0x0829, 0x133: 0x08aa, 0x134: 0x0113, 0x135: 0x0112,
+ 0x136: 0x2353, 0x137: 0x4453, 0x138: 0x0113, 0x139: 0x0112, 0x13a: 0x0113, 0x13b: 0x0112,
+ 0x13c: 0x0113, 0x13d: 0x0112, 0x13e: 0x0113, 0x13f: 0x0112,
+ // Block 0x5, offset 0x140
+ 0x140: 0x0a8a, 0x141: 0x0313, 0x142: 0x0312, 0x143: 0x0853, 0x144: 0x4753, 0x145: 0x4a53,
+ 0x146: 0x0113, 0x147: 0x0112, 0x148: 0x0113, 0x149: 0x0112, 0x14a: 0x0113, 0x14b: 0x0112,
+ 0x14c: 0x0113, 0x14d: 0x0112, 0x14e: 0x0113, 0x14f: 0x0112, 0x150: 0x0b0a, 0x151: 0x0b8a,
+ 0x152: 0x0c0a, 0x153: 0x0b52, 0x154: 0x0b52, 0x155: 0x0012, 0x156: 0x0e52, 0x157: 0x1152,
+ 0x158: 0x0012, 0x159: 0x1752, 0x15a: 0x0012, 0x15b: 0x1a52, 0x15c: 0x0c8a, 0x15d: 0x0012,
+ 0x15e: 0x0012, 0x15f: 0x0012, 0x160: 0x1d52, 0x161: 0x0d0a, 0x162: 0x0012, 0x163: 0x2052,
+ 0x164: 0x0012, 0x165: 0x0d8a, 0x166: 0x0e0a, 0x167: 0x0012, 0x168: 0x2652, 0x169: 0x2652,
+ 0x16a: 0x0e8a, 0x16b: 0x0f0a, 0x16c: 0x0f8a, 0x16d: 0x0012, 0x16e: 0x0012, 0x16f: 0x1d52,
+ 0x170: 0x0012, 0x171: 0x100a, 0x172: 0x2c52, 0x173: 0x0012, 0x174: 0x0012, 0x175: 0x3252,
+ 0x176: 0x0012, 0x177: 0x0012, 0x178: 0x0012, 0x179: 0x0012, 0x17a: 0x0012, 0x17b: 0x0012,
+ 0x17c: 0x0012, 0x17d: 0x108a, 0x17e: 0x0012, 0x17f: 0x0012,
+ // Block 0x6, offset 0x180
+ 0x180: 0x3552, 0x181: 0x0012, 0x182: 0x0012, 0x183: 0x3852, 0x184: 0x0012, 0x185: 0x0012,
+ 0x186: 0x0012, 0x187: 0x110a, 0x188: 0x3552, 0x189: 0x4752, 0x18a: 0x3b52, 0x18b: 0x3e52,
+ 0x18c: 0x4a52, 0x18d: 0x0012, 0x18e: 0x0012, 0x18f: 0x0012, 0x190: 0x0012, 0x191: 0x0012,
+ 0x192: 0x4152, 0x193: 0x0012, 0x194: 0x0010, 0x195: 0x0012, 0x196: 0x0012, 0x197: 0x0012,
+ 0x198: 0x0012, 0x199: 0x0012, 0x19a: 0x0012, 0x19b: 0x0012, 0x19c: 0x0012, 0x19d: 0x118a,
+ 0x19e: 0x120a, 0x19f: 0x0012, 0x1a0: 0x0012, 0x1a1: 0x0012, 0x1a2: 0x0012, 0x1a3: 0x0012,
+ 0x1a4: 0x0012, 0x1a5: 0x0012, 0x1a6: 0x0012, 0x1a7: 0x0012, 0x1a8: 0x0012, 0x1a9: 0x0012,
+ 0x1aa: 0x0012, 0x1ab: 0x0012, 0x1ac: 0x0012, 0x1ad: 0x0012, 0x1ae: 0x0012, 0x1af: 0x0012,
+ 0x1b0: 0x0015, 0x1b1: 0x0015, 0x1b2: 0x0015, 0x1b3: 0x0015, 0x1b4: 0x0015, 0x1b5: 0x0015,
+ 0x1b6: 0x0015, 0x1b7: 0x0015, 0x1b8: 0x0015, 0x1b9: 0x0014, 0x1ba: 0x0014, 0x1bb: 0x0014,
+ 0x1bc: 0x0014, 0x1bd: 0x0014, 0x1be: 0x0014, 0x1bf: 0x0014,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x0024, 0x1c1: 0x0024, 0x1c2: 0x0024, 0x1c3: 0x0024, 0x1c4: 0x0024, 0x1c5: 0x128d,
+ 0x1c6: 0x0024, 0x1c7: 0x0034, 0x1c8: 0x0034, 0x1c9: 0x0034, 0x1ca: 0x0024, 0x1cb: 0x0024,
+ 0x1cc: 0x0024, 0x1cd: 0x0034, 0x1ce: 0x0034, 0x1cf: 0x0014, 0x1d0: 0x0024, 0x1d1: 0x0024,
+ 0x1d2: 0x0024, 0x1d3: 0x0034, 0x1d4: 0x0034, 0x1d5: 0x0034, 0x1d6: 0x0034, 0x1d7: 0x0024,
+ 0x1d8: 0x0034, 0x1d9: 0x0034, 0x1da: 0x0034, 0x1db: 0x0024, 0x1dc: 0x0034, 0x1dd: 0x0034,
+ 0x1de: 0x0034, 0x1df: 0x0034, 0x1e0: 0x0034, 0x1e1: 0x0034, 0x1e2: 0x0034, 0x1e3: 0x0024,
+ 0x1e4: 0x0024, 0x1e5: 0x0024, 0x1e6: 0x0024, 0x1e7: 0x0024, 0x1e8: 0x0024, 0x1e9: 0x0024,
+ 0x1ea: 0x0024, 0x1eb: 0x0024, 0x1ec: 0x0024, 0x1ed: 0x0024, 0x1ee: 0x0024, 0x1ef: 0x0024,
+ 0x1f0: 0x0113, 0x1f1: 0x0112, 0x1f2: 0x0113, 0x1f3: 0x0112, 0x1f4: 0x0014, 0x1f5: 0x0004,
+ 0x1f6: 0x0113, 0x1f7: 0x0112, 0x1fa: 0x0015, 0x1fb: 0x4d52,
+ 0x1fc: 0x5052, 0x1fd: 0x5052, 0x1ff: 0x5353,
+ // Block 0x8, offset 0x200
+ 0x204: 0x0004, 0x205: 0x0004,
+ 0x206: 0x2a13, 0x207: 0x0054, 0x208: 0x2513, 0x209: 0x2713, 0x20a: 0x2513,
+ 0x20c: 0x5653, 0x20e: 0x5953, 0x20f: 0x5c53, 0x210: 0x130a, 0x211: 0x2013,
+ 0x212: 0x2013, 0x213: 0x2013, 0x214: 0x2013, 0x215: 0x2013, 0x216: 0x2013, 0x217: 0x2013,
+ 0x218: 0x2013, 0x219: 0x2013, 0x21a: 0x2013, 0x21b: 0x2013, 0x21c: 0x2013, 0x21d: 0x2013,
+ 0x21e: 0x2013, 0x21f: 0x2013, 0x220: 0x5f53, 0x221: 0x5f53, 0x223: 0x5f53,
+ 0x224: 0x5f53, 0x225: 0x5f53, 0x226: 0x5f53, 0x227: 0x5f53, 0x228: 0x5f53, 0x229: 0x5f53,
+ 0x22a: 0x5f53, 0x22b: 0x5f53, 0x22c: 0x2a12, 0x22d: 0x2512, 0x22e: 0x2712, 0x22f: 0x2512,
+ 0x230: 0x144a, 0x231: 0x2012, 0x232: 0x2012, 0x233: 0x2012, 0x234: 0x2012, 0x235: 0x2012,
+ 0x236: 0x2012, 0x237: 0x2012, 0x238: 0x2012, 0x239: 0x2012, 0x23a: 0x2012, 0x23b: 0x2012,
+ 0x23c: 0x2012, 0x23d: 0x2012, 0x23e: 0x2012, 0x23f: 0x2012,
+ // Block 0x9, offset 0x240
+ 0x240: 0x5f52, 0x241: 0x5f52, 0x242: 0x158a, 0x243: 0x5f52, 0x244: 0x5f52, 0x245: 0x5f52,
+ 0x246: 0x5f52, 0x247: 0x5f52, 0x248: 0x5f52, 0x249: 0x5f52, 0x24a: 0x5f52, 0x24b: 0x5f52,
+ 0x24c: 0x5652, 0x24d: 0x5952, 0x24e: 0x5c52, 0x24f: 0x1813, 0x250: 0x160a, 0x251: 0x168a,
+ 0x252: 0x0013, 0x253: 0x0013, 0x254: 0x0013, 0x255: 0x170a, 0x256: 0x178a, 0x257: 0x1812,
+ 0x258: 0x0113, 0x259: 0x0112, 0x25a: 0x0113, 0x25b: 0x0112, 0x25c: 0x0113, 0x25d: 0x0112,
+ 0x25e: 0x0113, 0x25f: 0x0112, 0x260: 0x0113, 0x261: 0x0112, 0x262: 0x0113, 0x263: 0x0112,
+ 0x264: 0x0113, 0x265: 0x0112, 0x266: 0x0113, 0x267: 0x0112, 0x268: 0x0113, 0x269: 0x0112,
+ 0x26a: 0x0113, 0x26b: 0x0112, 0x26c: 0x0113, 0x26d: 0x0112, 0x26e: 0x0113, 0x26f: 0x0112,
+ 0x270: 0x180a, 0x271: 0x188a, 0x272: 0x0b12, 0x273: 0x5352, 0x274: 0x6253, 0x275: 0x190a,
+ 0x277: 0x0f13, 0x278: 0x0f12, 0x279: 0x0b13, 0x27a: 0x0113, 0x27b: 0x0112,
+ 0x27c: 0x0012, 0x27d: 0x4d53, 0x27e: 0x5053, 0x27f: 0x5053,
+ // Block 0xa, offset 0x280
+ 0x280: 0x6852, 0x281: 0x6852, 0x282: 0x6852, 0x283: 0x6852, 0x284: 0x6852, 0x285: 0x6852,
+ 0x286: 0x6852, 0x287: 0x198a, 0x288: 0x0012,
+ 0x291: 0x0034,
+ 0x292: 0x0024, 0x293: 0x0024, 0x294: 0x0024, 0x295: 0x0024, 0x296: 0x0034, 0x297: 0x0024,
+ 0x298: 0x0024, 0x299: 0x0024, 0x29a: 0x0034, 0x29b: 0x0034, 0x29c: 0x0024, 0x29d: 0x0024,
+ 0x29e: 0x0024, 0x29f: 0x0024, 0x2a0: 0x0024, 0x2a1: 0x0024, 0x2a2: 0x0034, 0x2a3: 0x0034,
+ 0x2a4: 0x0034, 0x2a5: 0x0034, 0x2a6: 0x0034, 0x2a7: 0x0034, 0x2a8: 0x0024, 0x2a9: 0x0024,
+ 0x2aa: 0x0034, 0x2ab: 0x0024, 0x2ac: 0x0024, 0x2ad: 0x0034, 0x2ae: 0x0034, 0x2af: 0x0024,
+ 0x2b0: 0x0034, 0x2b1: 0x0034, 0x2b2: 0x0034, 0x2b3: 0x0034, 0x2b4: 0x0034, 0x2b5: 0x0034,
+ 0x2b6: 0x0034, 0x2b7: 0x0034, 0x2b8: 0x0034, 0x2b9: 0x0034, 0x2ba: 0x0034, 0x2bb: 0x0034,
+ 0x2bc: 0x0034, 0x2bd: 0x0034, 0x2bf: 0x0034,
+ // Block 0xb, offset 0x2c0
+ 0x2c0: 0x7053, 0x2c1: 0x7053, 0x2c2: 0x7053, 0x2c3: 0x7053, 0x2c4: 0x7053, 0x2c5: 0x7053,
+ 0x2c7: 0x7053,
+ 0x2cd: 0x7053, 0x2d0: 0x1a6a, 0x2d1: 0x1aea,
+ 0x2d2: 0x1b6a, 0x2d3: 0x1bea, 0x2d4: 0x1c6a, 0x2d5: 0x1cea, 0x2d6: 0x1d6a, 0x2d7: 0x1dea,
+ 0x2d8: 0x1e6a, 0x2d9: 0x1eea, 0x2da: 0x1f6a, 0x2db: 0x1fea, 0x2dc: 0x206a, 0x2dd: 0x20ea,
+ 0x2de: 0x216a, 0x2df: 0x21ea, 0x2e0: 0x226a, 0x2e1: 0x22ea, 0x2e2: 0x236a, 0x2e3: 0x23ea,
+ 0x2e4: 0x246a, 0x2e5: 0x24ea, 0x2e6: 0x256a, 0x2e7: 0x25ea, 0x2e8: 0x266a, 0x2e9: 0x26ea,
+ 0x2ea: 0x276a, 0x2eb: 0x27ea, 0x2ec: 0x286a, 0x2ed: 0x28ea, 0x2ee: 0x296a, 0x2ef: 0x29ea,
+ 0x2f0: 0x2a6a, 0x2f1: 0x2aea, 0x2f2: 0x2b6a, 0x2f3: 0x2bea, 0x2f4: 0x2c6a, 0x2f5: 0x2cea,
+ 0x2f6: 0x2d6a, 0x2f7: 0x2dea, 0x2f8: 0x2e6a, 0x2f9: 0x2eea, 0x2fa: 0x2f6a,
+ 0x2fc: 0x0014, 0x2fd: 0x2fea, 0x2fe: 0x306a, 0x2ff: 0x30ea,
+ // Block 0xc, offset 0x300
+ 0x300: 0x0812, 0x301: 0x0812, 0x302: 0x0812, 0x303: 0x0812, 0x304: 0x0812, 0x305: 0x0812,
+ 0x308: 0x0813, 0x309: 0x0813, 0x30a: 0x0813, 0x30b: 0x0813,
+ 0x30c: 0x0813, 0x30d: 0x0813, 0x310: 0x3a9a, 0x311: 0x0812,
+ 0x312: 0x3b7a, 0x313: 0x0812, 0x314: 0x3cba, 0x315: 0x0812, 0x316: 0x3dfa, 0x317: 0x0812,
+ 0x319: 0x0813, 0x31b: 0x0813, 0x31d: 0x0813,
+ 0x31f: 0x0813, 0x320: 0x0812, 0x321: 0x0812, 0x322: 0x0812, 0x323: 0x0812,
+ 0x324: 0x0812, 0x325: 0x0812, 0x326: 0x0812, 0x327: 0x0812, 0x328: 0x0813, 0x329: 0x0813,
+ 0x32a: 0x0813, 0x32b: 0x0813, 0x32c: 0x0813, 0x32d: 0x0813, 0x32e: 0x0813, 0x32f: 0x0813,
+ 0x330: 0x8e52, 0x331: 0x8e52, 0x332: 0x9152, 0x333: 0x9152, 0x334: 0x9452, 0x335: 0x9452,
+ 0x336: 0x9752, 0x337: 0x9752, 0x338: 0x9a52, 0x339: 0x9a52, 0x33a: 0x9d52, 0x33b: 0x9d52,
+ 0x33c: 0x4d52, 0x33d: 0x4d52,
+ // Block 0xd, offset 0x340
+ 0x340: 0x3f3a, 0x341: 0x402a, 0x342: 0x411a, 0x343: 0x420a, 0x344: 0x42fa, 0x345: 0x43ea,
+ 0x346: 0x44da, 0x347: 0x45ca, 0x348: 0x46b9, 0x349: 0x47a9, 0x34a: 0x4899, 0x34b: 0x4989,
+ 0x34c: 0x4a79, 0x34d: 0x4b69, 0x34e: 0x4c59, 0x34f: 0x4d49, 0x350: 0x4e3a, 0x351: 0x4f2a,
+ 0x352: 0x501a, 0x353: 0x510a, 0x354: 0x51fa, 0x355: 0x52ea, 0x356: 0x53da, 0x357: 0x54ca,
+ 0x358: 0x55b9, 0x359: 0x56a9, 0x35a: 0x5799, 0x35b: 0x5889, 0x35c: 0x5979, 0x35d: 0x5a69,
+ 0x35e: 0x5b59, 0x35f: 0x5c49, 0x360: 0x5d3a, 0x361: 0x5e2a, 0x362: 0x5f1a, 0x363: 0x600a,
+ 0x364: 0x60fa, 0x365: 0x61ea, 0x366: 0x62da, 0x367: 0x63ca, 0x368: 0x64b9, 0x369: 0x65a9,
+ 0x36a: 0x6699, 0x36b: 0x6789, 0x36c: 0x6879, 0x36d: 0x6969, 0x36e: 0x6a59, 0x36f: 0x6b49,
+ 0x370: 0x0812, 0x371: 0x0812, 0x372: 0x6c3a, 0x373: 0x6d4a, 0x374: 0x6e1a,
+ 0x376: 0x6efa, 0x377: 0x6fda, 0x378: 0x0813, 0x379: 0x0813, 0x37a: 0x8e53, 0x37b: 0x8e53,
+ 0x37c: 0x7119, 0x37d: 0x0004, 0x37e: 0x71ea, 0x37f: 0x0004,
+ // Block 0xe, offset 0x380
+ 0x380: 0x0004, 0x381: 0x0004, 0x382: 0x726a, 0x383: 0x737a, 0x384: 0x744a,
+ 0x386: 0x752a, 0x387: 0x760a, 0x388: 0x9153, 0x389: 0x9153, 0x38a: 0x9453, 0x38b: 0x9453,
+ 0x38c: 0x7749, 0x38d: 0x0004, 0x38e: 0x0004, 0x38f: 0x0004, 0x390: 0x0812, 0x391: 0x0812,
+ 0x392: 0x781a, 0x393: 0x795a, 0x396: 0x7a9a, 0x397: 0x7b7a,
+ 0x398: 0x0813, 0x399: 0x0813, 0x39a: 0x9753, 0x39b: 0x9753, 0x39d: 0x0004,
+ 0x39e: 0x0004, 0x39f: 0x0004, 0x3a0: 0x0812, 0x3a1: 0x0812, 0x3a2: 0x7cba, 0x3a3: 0x7dfa,
+ 0x3a4: 0x7f3a, 0x3a5: 0x0912, 0x3a6: 0x801a, 0x3a7: 0x80fa, 0x3a8: 0x0813, 0x3a9: 0x0813,
+ 0x3aa: 0x9d53, 0x3ab: 0x9d53, 0x3ac: 0x0913, 0x3ad: 0x0004, 0x3ae: 0x0004, 0x3af: 0x0004,
+ 0x3b2: 0x823a, 0x3b3: 0x834a, 0x3b4: 0x841a,
+ 0x3b6: 0x84fa, 0x3b7: 0x85da, 0x3b8: 0x9a53, 0x3b9: 0x9a53, 0x3ba: 0x4d53, 0x3bb: 0x4d53,
+ 0x3bc: 0x8719, 0x3bd: 0x0004, 0x3be: 0x0004,
+ // Block 0xf, offset 0x3c0
+ 0x3c2: 0x0013,
+ 0x3c7: 0x0013, 0x3ca: 0x0012, 0x3cb: 0x0013,
+ 0x3cc: 0x0013, 0x3cd: 0x0013, 0x3ce: 0x0012, 0x3cf: 0x0012, 0x3d0: 0x0013, 0x3d1: 0x0013,
+ 0x3d2: 0x0013, 0x3d3: 0x0012, 0x3d5: 0x0013,
+ 0x3d9: 0x0013, 0x3da: 0x0013, 0x3db: 0x0013, 0x3dc: 0x0013, 0x3dd: 0x0013,
+ 0x3e4: 0x0013, 0x3e6: 0x87eb, 0x3e8: 0x0013,
+ 0x3ea: 0x884b, 0x3eb: 0x888b, 0x3ec: 0x0013, 0x3ed: 0x0013, 0x3ef: 0x0012,
+ 0x3f0: 0x0013, 0x3f1: 0x0013, 0x3f2: 0xa053, 0x3f3: 0x0013, 0x3f4: 0x0012, 0x3f5: 0x0010,
+ 0x3f6: 0x0010, 0x3f7: 0x0010, 0x3f8: 0x0010, 0x3f9: 0x0012,
+ 0x3fc: 0x0012, 0x3fd: 0x0012, 0x3fe: 0x0013, 0x3ff: 0x0013,
+ // Block 0x10, offset 0x400
+ 0x400: 0x1a13, 0x401: 0x1a13, 0x402: 0x1e13, 0x403: 0x1e13, 0x404: 0x1a13, 0x405: 0x1a13,
+ 0x406: 0x2613, 0x407: 0x2613, 0x408: 0x2a13, 0x409: 0x2a13, 0x40a: 0x2e13, 0x40b: 0x2e13,
+ 0x40c: 0x2a13, 0x40d: 0x2a13, 0x40e: 0x2613, 0x40f: 0x2613, 0x410: 0xa352, 0x411: 0xa352,
+ 0x412: 0xa652, 0x413: 0xa652, 0x414: 0xa952, 0x415: 0xa952, 0x416: 0xa652, 0x417: 0xa652,
+ 0x418: 0xa352, 0x419: 0xa352, 0x41a: 0x1a12, 0x41b: 0x1a12, 0x41c: 0x1e12, 0x41d: 0x1e12,
+ 0x41e: 0x1a12, 0x41f: 0x1a12, 0x420: 0x2612, 0x421: 0x2612, 0x422: 0x2a12, 0x423: 0x2a12,
+ 0x424: 0x2e12, 0x425: 0x2e12, 0x426: 0x2a12, 0x427: 0x2a12, 0x428: 0x2612, 0x429: 0x2612,
+ // Block 0x11, offset 0x440
+ 0x440: 0x6552, 0x441: 0x6552, 0x442: 0x6552, 0x443: 0x6552, 0x444: 0x6552, 0x445: 0x6552,
+ 0x446: 0x6552, 0x447: 0x6552, 0x448: 0x6552, 0x449: 0x6552, 0x44a: 0x6552, 0x44b: 0x6552,
+ 0x44c: 0x6552, 0x44d: 0x6552, 0x44e: 0x6552, 0x44f: 0x6552, 0x450: 0xac52, 0x451: 0xac52,
+ 0x452: 0xac52, 0x453: 0xac52, 0x454: 0xac52, 0x455: 0xac52, 0x456: 0xac52, 0x457: 0xac52,
+ 0x458: 0xac52, 0x459: 0xac52, 0x45a: 0xac52, 0x45b: 0xac52, 0x45c: 0xac52, 0x45d: 0xac52,
+ 0x45e: 0xac52, 0x460: 0x0113, 0x461: 0x0112, 0x462: 0x88eb, 0x463: 0x8b53,
+ 0x464: 0x894b, 0x465: 0x89aa, 0x466: 0x8a0a, 0x467: 0x0f13, 0x468: 0x0f12, 0x469: 0x0313,
+ 0x46a: 0x0312, 0x46b: 0x0713, 0x46c: 0x0712, 0x46d: 0x8a6b, 0x46e: 0x8acb, 0x46f: 0x8b2b,
+ 0x470: 0x8b8b, 0x471: 0x0012, 0x472: 0x0113, 0x473: 0x0112, 0x474: 0x0012, 0x475: 0x0313,
+ 0x476: 0x0312, 0x477: 0x0012, 0x478: 0x0012, 0x479: 0x0012, 0x47a: 0x0012, 0x47b: 0x0012,
+ 0x47c: 0x0015, 0x47d: 0x0015, 0x47e: 0x8beb, 0x47f: 0x8c4b,
+ // Block 0x12, offset 0x480
+ 0x480: 0x0113, 0x481: 0x0112, 0x482: 0x0113, 0x483: 0x0112, 0x484: 0x0113, 0x485: 0x0112,
+ 0x486: 0x0113, 0x487: 0x0112, 0x488: 0x0014, 0x489: 0x0014, 0x48a: 0x0014, 0x48b: 0x0713,
+ 0x48c: 0x0712, 0x48d: 0x8cab, 0x48e: 0x0012, 0x48f: 0x0010, 0x490: 0x0113, 0x491: 0x0112,
+ 0x492: 0x0113, 0x493: 0x0112, 0x494: 0x0012, 0x495: 0x0012, 0x496: 0x0113, 0x497: 0x0112,
+ 0x498: 0x0113, 0x499: 0x0112, 0x49a: 0x0113, 0x49b: 0x0112, 0x49c: 0x0113, 0x49d: 0x0112,
+ 0x49e: 0x0113, 0x49f: 0x0112, 0x4a0: 0x0113, 0x4a1: 0x0112, 0x4a2: 0x0113, 0x4a3: 0x0112,
+ 0x4a4: 0x0113, 0x4a5: 0x0112, 0x4a6: 0x0113, 0x4a7: 0x0112, 0x4a8: 0x0113, 0x4a9: 0x0112,
+ 0x4aa: 0x8d0b, 0x4ab: 0x8d6b, 0x4ac: 0x8dcb, 0x4ad: 0x8e2b, 0x4ae: 0x8e8b, 0x4af: 0x0012,
+ 0x4b0: 0x8eeb, 0x4b1: 0x8f4b, 0x4b2: 0x8fab, 0x4b3: 0xaf53, 0x4b4: 0x0113, 0x4b5: 0x0112,
+ 0x4b6: 0x0113, 0x4b7: 0x0112, 0x4b8: 0x0113, 0x4b9: 0x0112,
+ // Block 0x13, offset 0x4c0
+ 0x4c0: 0x900a, 0x4c1: 0x908a, 0x4c2: 0x910a, 0x4c3: 0x918a, 0x4c4: 0x923a, 0x4c5: 0x92ea,
+ 0x4c6: 0x936a,
+ 0x4d3: 0x93ea, 0x4d4: 0x94ca, 0x4d5: 0x95aa, 0x4d6: 0x968a, 0x4d7: 0x976a,
+ 0x4dd: 0x0010,
+ 0x4de: 0x0034, 0x4df: 0x0010, 0x4e0: 0x0010, 0x4e1: 0x0010, 0x4e2: 0x0010, 0x4e3: 0x0010,
+ 0x4e4: 0x0010, 0x4e5: 0x0010, 0x4e6: 0x0010, 0x4e7: 0x0010, 0x4e8: 0x0010,
+ 0x4ea: 0x0010, 0x4eb: 0x0010, 0x4ec: 0x0010, 0x4ed: 0x0010, 0x4ee: 0x0010, 0x4ef: 0x0010,
+ 0x4f0: 0x0010, 0x4f1: 0x0010, 0x4f2: 0x0010, 0x4f3: 0x0010, 0x4f4: 0x0010, 0x4f5: 0x0010,
+ 0x4f6: 0x0010, 0x4f8: 0x0010, 0x4f9: 0x0010, 0x4fa: 0x0010, 0x4fb: 0x0010,
+ 0x4fc: 0x0010, 0x4fe: 0x0010,
+ // Block 0x14, offset 0x500
+ 0x500: 0x2213, 0x501: 0x2213, 0x502: 0x2613, 0x503: 0x2613, 0x504: 0x2213, 0x505: 0x2213,
+ 0x506: 0x2e13, 0x507: 0x2e13, 0x508: 0x2213, 0x509: 0x2213, 0x50a: 0x2613, 0x50b: 0x2613,
+ 0x50c: 0x2213, 0x50d: 0x2213, 0x50e: 0x3e13, 0x50f: 0x3e13, 0x510: 0x2213, 0x511: 0x2213,
+ 0x512: 0x2613, 0x513: 0x2613, 0x514: 0x2213, 0x515: 0x2213, 0x516: 0x2e13, 0x517: 0x2e13,
+ 0x518: 0x2213, 0x519: 0x2213, 0x51a: 0x2613, 0x51b: 0x2613, 0x51c: 0x2213, 0x51d: 0x2213,
+ 0x51e: 0xb853, 0x51f: 0xb853, 0x520: 0xbb53, 0x521: 0xbb53, 0x522: 0x2212, 0x523: 0x2212,
+ 0x524: 0x2612, 0x525: 0x2612, 0x526: 0x2212, 0x527: 0x2212, 0x528: 0x2e12, 0x529: 0x2e12,
+ 0x52a: 0x2212, 0x52b: 0x2212, 0x52c: 0x2612, 0x52d: 0x2612, 0x52e: 0x2212, 0x52f: 0x2212,
+ 0x530: 0x3e12, 0x531: 0x3e12, 0x532: 0x2212, 0x533: 0x2212, 0x534: 0x2612, 0x535: 0x2612,
+ 0x536: 0x2212, 0x537: 0x2212, 0x538: 0x2e12, 0x539: 0x2e12, 0x53a: 0x2212, 0x53b: 0x2212,
+ 0x53c: 0x2612, 0x53d: 0x2612, 0x53e: 0x2212, 0x53f: 0x2212,
+ // Block 0x15, offset 0x540
+ 0x542: 0x0010,
+ 0x547: 0x0010, 0x549: 0x0010, 0x54b: 0x0010,
+ 0x54d: 0x0010, 0x54e: 0x0010, 0x54f: 0x0010, 0x551: 0x0010,
+ 0x552: 0x0010, 0x554: 0x0010, 0x557: 0x0010,
+ 0x559: 0x0010, 0x55b: 0x0010, 0x55d: 0x0010,
+ 0x55f: 0x0010, 0x561: 0x0010, 0x562: 0x0010,
+ 0x564: 0x0010, 0x567: 0x0010, 0x568: 0x0010, 0x569: 0x0010,
+ 0x56a: 0x0010, 0x56c: 0x0010, 0x56d: 0x0010, 0x56e: 0x0010, 0x56f: 0x0010,
+ 0x570: 0x0010, 0x571: 0x0010, 0x572: 0x0010, 0x574: 0x0010, 0x575: 0x0010,
+ 0x576: 0x0010, 0x577: 0x0010, 0x579: 0x0010, 0x57a: 0x0010, 0x57b: 0x0010,
+ 0x57c: 0x0010, 0x57e: 0x0010,
+}
+
+// caseIndex: 25 blocks, 1600 entries, 3200 bytes
+// Block 0 is the zero block.
+var caseIndex = [1600]uint16{
+ // Block 0x0, offset 0x0
+ // Block 0x1, offset 0x40
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc2: 0x14, 0xc3: 0x15, 0xc4: 0x16, 0xc5: 0x17, 0xc6: 0x01, 0xc7: 0x02,
+ 0xc8: 0x18, 0xc9: 0x03, 0xca: 0x04, 0xcb: 0x19, 0xcc: 0x1a, 0xcd: 0x05, 0xce: 0x06, 0xcf: 0x07,
+ 0xd0: 0x1b, 0xd1: 0x1c, 0xd2: 0x1d, 0xd3: 0x1e, 0xd4: 0x1f, 0xd5: 0x20, 0xd6: 0x08, 0xd7: 0x21,
+ 0xd8: 0x22, 0xd9: 0x23, 0xda: 0x24, 0xdb: 0x25, 0xdc: 0x26, 0xdd: 0x27, 0xde: 0x28, 0xdf: 0x29,
+ 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05,
+ 0xea: 0x06, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x08, 0xef: 0x09,
+ 0xf0: 0x14, 0xf3: 0x16,
+ // Block 0x4, offset 0x100
+ 0x120: 0x2a, 0x121: 0x2b, 0x122: 0x2c, 0x123: 0x2d, 0x124: 0x2e, 0x125: 0x2f, 0x126: 0x30, 0x127: 0x31,
+ 0x128: 0x32, 0x129: 0x33, 0x12a: 0x34, 0x12b: 0x35, 0x12c: 0x36, 0x12d: 0x37, 0x12e: 0x38, 0x12f: 0x39,
+ 0x130: 0x3a, 0x131: 0x3b, 0x132: 0x3c, 0x133: 0x3d, 0x134: 0x3e, 0x135: 0x3f, 0x136: 0x40, 0x137: 0x41,
+ 0x138: 0x42, 0x139: 0x43, 0x13a: 0x44, 0x13b: 0x45, 0x13c: 0x46, 0x13d: 0x47, 0x13e: 0x48, 0x13f: 0x49,
+ // Block 0x5, offset 0x140
+ 0x140: 0x4a, 0x141: 0x4b, 0x142: 0x4c, 0x143: 0x09, 0x144: 0x24, 0x145: 0x24, 0x146: 0x24, 0x147: 0x24,
+ 0x148: 0x24, 0x149: 0x4d, 0x14a: 0x4e, 0x14b: 0x4f, 0x14c: 0x50, 0x14d: 0x51, 0x14e: 0x52, 0x14f: 0x53,
+ 0x150: 0x54, 0x151: 0x24, 0x152: 0x24, 0x153: 0x24, 0x154: 0x24, 0x155: 0x24, 0x156: 0x24, 0x157: 0x24,
+ 0x158: 0x24, 0x159: 0x55, 0x15a: 0x56, 0x15b: 0x57, 0x15c: 0x58, 0x15d: 0x59, 0x15e: 0x5a, 0x15f: 0x5b,
+ 0x160: 0x5c, 0x161: 0x5d, 0x162: 0x5e, 0x163: 0x5f, 0x164: 0x60, 0x165: 0x61, 0x167: 0x62,
+ 0x168: 0x63, 0x169: 0x64, 0x16a: 0x65, 0x16c: 0x66, 0x16d: 0x67, 0x16e: 0x68, 0x16f: 0x69,
+ 0x170: 0x6a, 0x171: 0x6b, 0x172: 0x6c, 0x173: 0x6d, 0x174: 0x6e, 0x175: 0x6f, 0x176: 0x70, 0x177: 0x71,
+ 0x178: 0x72, 0x179: 0x72, 0x17a: 0x73, 0x17b: 0x72, 0x17c: 0x74, 0x17d: 0x0a, 0x17e: 0x0b, 0x17f: 0x0c,
+ // Block 0x6, offset 0x180
+ 0x180: 0x75, 0x181: 0x76, 0x182: 0x77, 0x183: 0x78, 0x184: 0x0d, 0x185: 0x79, 0x186: 0x7a,
+ 0x192: 0x7b, 0x193: 0x0e,
+ 0x1b0: 0x7c, 0x1b1: 0x0f, 0x1b2: 0x72, 0x1b3: 0x7d, 0x1b4: 0x7e, 0x1b5: 0x7f, 0x1b6: 0x80, 0x1b7: 0x81,
+ 0x1b8: 0x82,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x83, 0x1c2: 0x84, 0x1c3: 0x85, 0x1c4: 0x86, 0x1c5: 0x24, 0x1c6: 0x87,
+ // Block 0x8, offset 0x200
+ 0x200: 0x88, 0x201: 0x24, 0x202: 0x24, 0x203: 0x24, 0x204: 0x24, 0x205: 0x24, 0x206: 0x24, 0x207: 0x24,
+ 0x208: 0x24, 0x209: 0x24, 0x20a: 0x24, 0x20b: 0x24, 0x20c: 0x24, 0x20d: 0x24, 0x20e: 0x24, 0x20f: 0x24,
+ 0x210: 0x24, 0x211: 0x24, 0x212: 0x89, 0x213: 0x8a, 0x214: 0x24, 0x215: 0x24, 0x216: 0x24, 0x217: 0x24,
+ 0x218: 0x8b, 0x219: 0x8c, 0x21a: 0x8d, 0x21b: 0x8e, 0x21c: 0x8f, 0x21d: 0x90, 0x21e: 0x10, 0x21f: 0x91,
+ 0x220: 0x92, 0x221: 0x93, 0x222: 0x24, 0x223: 0x94, 0x224: 0x95, 0x225: 0x96, 0x226: 0x97, 0x227: 0x98,
+ 0x228: 0x99, 0x229: 0x9a, 0x22a: 0x9b, 0x22b: 0x9c, 0x22c: 0x9d, 0x22d: 0x9e, 0x22e: 0x9f, 0x22f: 0xa0,
+ 0x230: 0x24, 0x231: 0x24, 0x232: 0x24, 0x233: 0x24, 0x234: 0x24, 0x235: 0x24, 0x236: 0x24, 0x237: 0x24,
+ 0x238: 0x24, 0x239: 0x24, 0x23a: 0x24, 0x23b: 0x24, 0x23c: 0x24, 0x23d: 0x24, 0x23e: 0x24, 0x23f: 0x24,
+ // Block 0x9, offset 0x240
+ 0x240: 0x24, 0x241: 0x24, 0x242: 0x24, 0x243: 0x24, 0x244: 0x24, 0x245: 0x24, 0x246: 0x24, 0x247: 0x24,
+ 0x248: 0x24, 0x249: 0x24, 0x24a: 0x24, 0x24b: 0x24, 0x24c: 0x24, 0x24d: 0x24, 0x24e: 0x24, 0x24f: 0x24,
+ 0x250: 0x24, 0x251: 0x24, 0x252: 0x24, 0x253: 0x24, 0x254: 0x24, 0x255: 0x24, 0x256: 0x24, 0x257: 0x24,
+ 0x258: 0x24, 0x259: 0x24, 0x25a: 0x24, 0x25b: 0x24, 0x25c: 0x24, 0x25d: 0x24, 0x25e: 0x24, 0x25f: 0x24,
+ 0x260: 0x24, 0x261: 0x24, 0x262: 0x24, 0x263: 0x24, 0x264: 0x24, 0x265: 0x24, 0x266: 0x24, 0x267: 0x24,
+ 0x268: 0x24, 0x269: 0x24, 0x26a: 0x24, 0x26b: 0x24, 0x26c: 0x24, 0x26d: 0x24, 0x26e: 0x24, 0x26f: 0x24,
+ 0x270: 0x24, 0x271: 0x24, 0x272: 0x24, 0x273: 0x24, 0x274: 0x24, 0x275: 0x24, 0x276: 0x24, 0x277: 0x24,
+ 0x278: 0x24, 0x279: 0x24, 0x27a: 0x24, 0x27b: 0x24, 0x27c: 0x24, 0x27d: 0x24, 0x27e: 0x24, 0x27f: 0x24,
+ // Block 0xa, offset 0x280
+ 0x280: 0x24, 0x281: 0x24, 0x282: 0x24, 0x283: 0x24, 0x284: 0x24, 0x285: 0x24, 0x286: 0x24, 0x287: 0x24,
+ 0x288: 0x24, 0x289: 0x24, 0x28a: 0x24, 0x28b: 0x24, 0x28c: 0x24, 0x28d: 0x24, 0x28e: 0x24, 0x28f: 0x24,
+ 0x290: 0x24, 0x291: 0x24, 0x292: 0x24, 0x293: 0x24, 0x294: 0x24, 0x295: 0x24, 0x296: 0x24, 0x297: 0x24,
+ 0x298: 0x24, 0x299: 0x24, 0x29a: 0x24, 0x29b: 0x24, 0x29c: 0x24, 0x29d: 0x24, 0x29e: 0xa1, 0x29f: 0xa2,
+ // Block 0xb, offset 0x2c0
+ 0x2ec: 0x11, 0x2ed: 0xa3, 0x2ee: 0xa4, 0x2ef: 0xa5,
+ 0x2f0: 0x24, 0x2f1: 0x24, 0x2f2: 0x24, 0x2f3: 0x24, 0x2f4: 0xa6, 0x2f5: 0xa7, 0x2f6: 0xa8, 0x2f7: 0xa9,
+ 0x2f8: 0xaa, 0x2f9: 0xab, 0x2fa: 0x24, 0x2fb: 0xac, 0x2fc: 0xad, 0x2fd: 0xae, 0x2fe: 0xaf, 0x2ff: 0xb0,
+ // Block 0xc, offset 0x300
+ 0x300: 0xb1, 0x301: 0xb2, 0x302: 0x24, 0x303: 0xb3, 0x305: 0xb4, 0x307: 0xb5,
+ 0x30a: 0xb6, 0x30b: 0xb7, 0x30c: 0xb8, 0x30d: 0xb9, 0x30e: 0xba, 0x30f: 0xbb,
+ 0x310: 0xbc, 0x311: 0xbd, 0x312: 0xbe, 0x313: 0xbf, 0x314: 0xc0, 0x315: 0xc1,
+ 0x318: 0x24, 0x319: 0x24, 0x31a: 0x24, 0x31b: 0x24, 0x31c: 0xc2, 0x31d: 0xc3,
+ 0x320: 0xc4, 0x321: 0xc5, 0x322: 0xc6, 0x323: 0xc7, 0x324: 0xc8, 0x326: 0xc9,
+ 0x328: 0xca, 0x329: 0xcb, 0x32a: 0xcc, 0x32b: 0xcd, 0x32c: 0x5f, 0x32d: 0xce, 0x32e: 0xcf,
+ 0x330: 0x24, 0x331: 0xd0, 0x332: 0xd1, 0x333: 0xd2, 0x334: 0xd3,
+ 0x33c: 0xd4, 0x33d: 0xd5,
+ // Block 0xd, offset 0x340
+ 0x340: 0xd6, 0x341: 0xd7, 0x342: 0xd8, 0x343: 0xd9, 0x344: 0xda, 0x345: 0xdb, 0x346: 0xdc, 0x347: 0xdd,
+ 0x348: 0xde, 0x34a: 0xdf, 0x34b: 0xe0, 0x34c: 0xe1, 0x34d: 0xe2,
+ 0x350: 0xe3, 0x351: 0xe4, 0x352: 0xe5, 0x353: 0xe6, 0x356: 0xe7, 0x357: 0xe8,
+ 0x358: 0xe9, 0x359: 0xea, 0x35a: 0xeb, 0x35b: 0xec, 0x35c: 0xed,
+ 0x360: 0xee, 0x362: 0xef, 0x363: 0xf0,
+ 0x368: 0xf1, 0x369: 0xf2, 0x36a: 0xf3, 0x36b: 0xf4,
+ 0x370: 0xf5, 0x371: 0xf6, 0x372: 0xf7, 0x374: 0xf8, 0x375: 0xf9, 0x376: 0xfa,
+ 0x37b: 0xfb,
+ // Block 0xe, offset 0x380
+ 0x380: 0x24, 0x381: 0x24, 0x382: 0x24, 0x383: 0x24, 0x384: 0x24, 0x385: 0x24, 0x386: 0x24, 0x387: 0x24,
+ 0x388: 0x24, 0x389: 0x24, 0x38a: 0x24, 0x38b: 0x24, 0x38c: 0x24, 0x38d: 0x24, 0x38e: 0xfc,
+ 0x390: 0x24, 0x391: 0xfd, 0x392: 0x24, 0x393: 0x24, 0x394: 0x24, 0x395: 0xfe,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x24, 0x3c1: 0x24, 0x3c2: 0x24, 0x3c3: 0x24, 0x3c4: 0x24, 0x3c5: 0x24, 0x3c6: 0x24, 0x3c7: 0x24,
+ 0x3c8: 0x24, 0x3c9: 0x24, 0x3ca: 0x24, 0x3cb: 0x24, 0x3cc: 0x24, 0x3cd: 0x24, 0x3ce: 0x24, 0x3cf: 0x24,
+ 0x3d0: 0xfd,
+ // Block 0x10, offset 0x400
+ 0x410: 0x24, 0x411: 0x24, 0x412: 0x24, 0x413: 0x24, 0x414: 0x24, 0x415: 0x24, 0x416: 0x24, 0x417: 0x24,
+ 0x418: 0x24, 0x419: 0xff,
+ // Block 0x11, offset 0x440
+ 0x460: 0x24, 0x461: 0x24, 0x462: 0x24, 0x463: 0x24, 0x464: 0x24, 0x465: 0x24, 0x466: 0x24, 0x467: 0x24,
+ 0x468: 0xf4, 0x469: 0x100, 0x46b: 0x101, 0x46c: 0x102, 0x46d: 0x103, 0x46e: 0x104,
+ 0x479: 0x105, 0x47c: 0x24, 0x47d: 0x106, 0x47e: 0x107, 0x47f: 0x108,
+ // Block 0x12, offset 0x480
+ 0x4b0: 0x24, 0x4b1: 0x109, 0x4b2: 0x10a,
+ // Block 0x13, offset 0x4c0
+ 0x4c5: 0x10b, 0x4c6: 0x10c,
+ 0x4c9: 0x10d,
+ 0x4d0: 0x10e, 0x4d1: 0x10f, 0x4d2: 0x110, 0x4d3: 0x111, 0x4d4: 0x112, 0x4d5: 0x113, 0x4d6: 0x114, 0x4d7: 0x115,
+ 0x4d8: 0x116, 0x4d9: 0x117, 0x4da: 0x118, 0x4db: 0x119, 0x4dc: 0x11a, 0x4dd: 0x11b, 0x4de: 0x11c, 0x4df: 0x11d,
+ 0x4e8: 0x11e, 0x4e9: 0x11f, 0x4ea: 0x120,
+ // Block 0x14, offset 0x500
+ 0x500: 0x121,
+ 0x520: 0x24, 0x521: 0x24, 0x522: 0x24, 0x523: 0x122, 0x524: 0x12, 0x525: 0x123,
+ 0x538: 0x124, 0x539: 0x13, 0x53a: 0x125,
+ // Block 0x15, offset 0x540
+ 0x544: 0x126, 0x545: 0x127, 0x546: 0x128,
+ 0x54f: 0x129,
+ // Block 0x16, offset 0x580
+ 0x590: 0x0a, 0x591: 0x0b, 0x592: 0x0c, 0x593: 0x0d, 0x594: 0x0e, 0x596: 0x0f,
+ 0x59b: 0x10, 0x59d: 0x11, 0x59e: 0x12, 0x59f: 0x13,
+ // Block 0x17, offset 0x5c0
+ 0x5c0: 0x12a, 0x5c1: 0x12b, 0x5c4: 0x12b, 0x5c5: 0x12b, 0x5c6: 0x12b, 0x5c7: 0x12c,
+ // Block 0x18, offset 0x600
+ 0x620: 0x15,
+}
+
+// sparseOffsets: 282 entries, 564 bytes
+var sparseOffsets = []uint16{0x0, 0x9, 0xf, 0x18, 0x24, 0x2e, 0x35, 0x38, 0x3c, 0x3f, 0x43, 0x4d, 0x4f, 0x57, 0x5e, 0x63, 0x71, 0x72, 0x80, 0x8f, 0x99, 0x9c, 0xa3, 0xab, 0xae, 0xb0, 0xbf, 0xc5, 0xd3, 0xde, 0xeb, 0xf6, 0x102, 0x10c, 0x118, 0x123, 0x12f, 0x13b, 0x143, 0x14c, 0x156, 0x161, 0x16d, 0x174, 0x17f, 0x184, 0x18c, 0x18f, 0x194, 0x198, 0x19c, 0x1a3, 0x1ac, 0x1b4, 0x1b5, 0x1be, 0x1c5, 0x1cd, 0x1d3, 0x1d8, 0x1dc, 0x1df, 0x1e1, 0x1e4, 0x1e9, 0x1ea, 0x1ec, 0x1ee, 0x1f0, 0x1f7, 0x1fc, 0x200, 0x209, 0x20c, 0x20f, 0x215, 0x216, 0x221, 0x222, 0x223, 0x228, 0x235, 0x23d, 0x245, 0x24e, 0x257, 0x260, 0x265, 0x268, 0x273, 0x280, 0x282, 0x289, 0x28b, 0x297, 0x298, 0x2a3, 0x2ab, 0x2b3, 0x2b9, 0x2ba, 0x2c8, 0x2cd, 0x2d0, 0x2d5, 0x2d9, 0x2df, 0x2e4, 0x2e7, 0x2ec, 0x2f1, 0x2f2, 0x2f8, 0x2fa, 0x2fb, 0x2fd, 0x2ff, 0x302, 0x303, 0x305, 0x308, 0x30e, 0x312, 0x314, 0x319, 0x320, 0x324, 0x32d, 0x32e, 0x337, 0x33b, 0x340, 0x348, 0x34e, 0x354, 0x35e, 0x363, 0x36c, 0x372, 0x379, 0x37d, 0x385, 0x387, 0x389, 0x38c, 0x38e, 0x390, 0x391, 0x392, 0x394, 0x396, 0x39c, 0x3a1, 0x3a3, 0x3a9, 0x3ac, 0x3ae, 0x3b4, 0x3b9, 0x3bb, 0x3bc, 0x3bd, 0x3be, 0x3c0, 0x3c2, 0x3c4, 0x3c7, 0x3c9, 0x3cc, 0x3d4, 0x3d7, 0x3db, 0x3e3, 0x3e5, 0x3e6, 0x3e7, 0x3e9, 0x3ef, 0x3f1, 0x3f2, 0x3f4, 0x3f6, 0x3f8, 0x405, 0x406, 0x407, 0x40b, 0x40d, 0x40e, 0x40f, 0x410, 0x411, 0x414, 0x417, 0x41d, 0x421, 0x425, 0x42b, 0x42e, 0x435, 0x439, 0x43d, 0x444, 0x44d, 0x453, 0x459, 0x463, 0x46d, 0x46f, 0x477, 0x47d, 0x483, 0x489, 0x48c, 0x492, 0x495, 0x49d, 0x49e, 0x4a5, 0x4a9, 0x4aa, 0x4ad, 0x4b5, 0x4bb, 0x4c2, 0x4c3, 0x4c9, 0x4cc, 0x4d4, 0x4db, 0x4e5, 0x4ed, 0x4f0, 0x4f1, 0x4f2, 0x4f3, 0x4f4, 0x4f6, 0x4f8, 0x4fa, 0x4fe, 0x4ff, 0x501, 0x503, 0x504, 0x505, 0x507, 0x50c, 0x511, 0x515, 0x516, 0x519, 0x51d, 0x528, 0x52c, 0x534, 0x539, 0x53d, 0x540, 0x544, 0x547, 0x54a, 0x54f, 0x553, 0x557, 0x55b, 0x55f, 0x561, 0x563, 0x566, 0x56b, 0x56d, 0x572, 0x57b, 0x580, 0x581, 0x584, 0x585, 0x586, 0x588, 0x589, 0x58a}
+
+// sparseValues: 1418 entries, 5672 bytes
+var sparseValues = [1418]valueRange{
+ // Block 0x0, offset 0x0
+ {value: 0x0004, lo: 0xa8, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xaa},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0004, lo: 0xaf, hi: 0xaf},
+ {value: 0x0004, lo: 0xb4, hi: 0xb4},
+ {value: 0x001a, lo: 0xb5, hi: 0xb5},
+ {value: 0x0054, lo: 0xb7, hi: 0xb7},
+ {value: 0x0004, lo: 0xb8, hi: 0xb8},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ // Block 0x1, offset 0x9
+ {value: 0x2013, lo: 0x80, hi: 0x96},
+ {value: 0x2013, lo: 0x98, hi: 0x9e},
+ {value: 0x009a, lo: 0x9f, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xb6},
+ {value: 0x2012, lo: 0xb8, hi: 0xbe},
+ {value: 0x0252, lo: 0xbf, hi: 0xbf},
+ // Block 0x2, offset 0xf
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x011b, lo: 0xb0, hi: 0xb0},
+ {value: 0x019a, lo: 0xb1, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb7},
+ {value: 0x0012, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x0553, lo: 0xbf, hi: 0xbf},
+ // Block 0x3, offset 0x18
+ {value: 0x0552, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x01da, lo: 0x89, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xb7},
+ {value: 0x0253, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x028a, lo: 0xbf, hi: 0xbf},
+ // Block 0x4, offset 0x24
+ {value: 0x0117, lo: 0x80, hi: 0x9f},
+ {value: 0x2f53, lo: 0xa0, hi: 0xa0},
+ {value: 0x0012, lo: 0xa1, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xb3},
+ {value: 0x0012, lo: 0xb4, hi: 0xb9},
+ {value: 0x090b, lo: 0xba, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x2953, lo: 0xbd, hi: 0xbd},
+ {value: 0x098b, lo: 0xbe, hi: 0xbe},
+ {value: 0x0a0a, lo: 0xbf, hi: 0xbf},
+ // Block 0x5, offset 0x2e
+ {value: 0x0015, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x97},
+ {value: 0x0004, lo: 0x98, hi: 0x9d},
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0015, lo: 0xa0, hi: 0xa4},
+ {value: 0x0004, lo: 0xa5, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xbf},
+ // Block 0x6, offset 0x35
+ {value: 0x0024, lo: 0x80, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbf},
+ // Block 0x7, offset 0x38
+ {value: 0x6553, lo: 0x80, hi: 0x8f},
+ {value: 0x2013, lo: 0x90, hi: 0x9f},
+ {value: 0x5f53, lo: 0xa0, hi: 0xaf},
+ {value: 0x2012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8, offset 0x3c
+ {value: 0x5f52, lo: 0x80, hi: 0x8f},
+ {value: 0x6552, lo: 0x90, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x9, offset 0x3f
+ {value: 0x0117, lo: 0x80, hi: 0x81},
+ {value: 0x0024, lo: 0x83, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xbf},
+ // Block 0xa, offset 0x43
+ {value: 0x0f13, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0716, lo: 0x8b, hi: 0x8c},
+ {value: 0x0316, lo: 0x8d, hi: 0x8e},
+ {value: 0x0f12, lo: 0x8f, hi: 0x8f},
+ {value: 0x0117, lo: 0x90, hi: 0xbf},
+ // Block 0xb, offset 0x4d
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x6553, lo: 0xb1, hi: 0xbf},
+ // Block 0xc, offset 0x4f
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6853, lo: 0x90, hi: 0x96},
+ {value: 0x0014, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9b, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0xa0, hi: 0xa0},
+ {value: 0x6552, lo: 0xa1, hi: 0xaf},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0xd, offset 0x57
+ {value: 0x0034, lo: 0x81, hi: 0x82},
+ {value: 0x0024, lo: 0x84, hi: 0x84},
+ {value: 0x0034, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xaa},
+ {value: 0x0010, lo: 0xaf, hi: 0xb3},
+ {value: 0x0054, lo: 0xb4, hi: 0xb4},
+ // Block 0xe, offset 0x5e
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0024, lo: 0x90, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0014, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xf, offset 0x63
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9c},
+ {value: 0x0024, lo: 0x9d, hi: 0x9e},
+ {value: 0x0034, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x10, offset 0x71
+ {value: 0x0010, lo: 0x80, hi: 0xbf},
+ // Block 0x11, offset 0x72
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0024, lo: 0x9f, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x12, offset 0x80
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0034, lo: 0xb1, hi: 0xb1},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0024, lo: 0xbf, hi: 0xbf},
+ // Block 0x13, offset 0x8f
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0024, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x88},
+ {value: 0x0024, lo: 0x89, hi: 0x8a},
+ {value: 0x0010, lo: 0x8d, hi: 0xbf},
+ // Block 0x14, offset 0x99
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x15, offset 0x9c
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xb1},
+ {value: 0x0034, lo: 0xb2, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0x16, offset 0xa3
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x99},
+ {value: 0x0014, lo: 0x9a, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0xa3},
+ {value: 0x0014, lo: 0xa4, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xad},
+ // Block 0x17, offset 0xab
+ {value: 0x0010, lo: 0x80, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0xa0, hi: 0xaa},
+ // Block 0x18, offset 0xae
+ {value: 0x0010, lo: 0xa0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbd},
+ // Block 0x19, offset 0xb0
+ {value: 0x0034, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0024, lo: 0xaa, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbf},
+ // Block 0x1a, offset 0xbf
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1b, offset 0xc5
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0x1c, offset 0xd3
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb6, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1d, offset 0xde
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xb1},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ // Block 0x1e, offset 0xeb
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x1f, offset 0xf6
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x99, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x20, offset 0x102
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x21, offset 0x10c
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x85},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xbf},
+ // Block 0x22, offset 0x118
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x23, offset 0x123
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x24, offset 0x12f
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0010, lo: 0xa8, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x25, offset 0x13b
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x26, offset 0x143
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb9},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbf},
+ // Block 0x27, offset 0x14c
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x88},
+ {value: 0x0014, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x28, offset 0x156
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x29, offset 0x161
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb2},
+ // Block 0x2a, offset 0x16d
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x2b, offset 0x174
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x94, hi: 0x97},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xba, hi: 0xbf},
+ // Block 0x2c, offset 0x17f
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x96},
+ {value: 0x0010, lo: 0x9a, hi: 0xb1},
+ {value: 0x0010, lo: 0xb3, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x2d, offset 0x184
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x94},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9f},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ // Block 0x2e, offset 0x18c
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ // Block 0x2f, offset 0x18f
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x30, offset 0x194
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xb9},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ // Block 0x31, offset 0x198
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x32, offset 0x19c
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0034, lo: 0x98, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0034, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x33, offset 0x1a3
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xac},
+ {value: 0x0034, lo: 0xb1, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xba, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x34, offset 0x1ac
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0024, lo: 0x82, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x86, hi: 0x87},
+ {value: 0x0010, lo: 0x88, hi: 0x8c},
+ {value: 0x0014, lo: 0x8d, hi: 0x97},
+ {value: 0x0014, lo: 0x99, hi: 0xbc},
+ // Block 0x35, offset 0x1b4
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ // Block 0x36, offset 0x1b5
+ {value: 0x0010, lo: 0xab, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbe},
+ // Block 0x37, offset 0x1be
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x96, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x99},
+ {value: 0x0014, lo: 0x9e, hi: 0xa0},
+ {value: 0x0010, lo: 0xa2, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xad},
+ {value: 0x0014, lo: 0xb1, hi: 0xb4},
+ // Block 0x38, offset 0x1c5
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x6c53, lo: 0xa0, hi: 0xbf},
+ // Block 0x39, offset 0x1cd
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x9a, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x3a, offset 0x1d3
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x3b, offset 0x1d8
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x82, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3c, offset 0x1dc
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3d, offset 0x1df
+ {value: 0x0010, lo: 0x80, hi: 0x9a},
+ {value: 0x0024, lo: 0x9d, hi: 0x9f},
+ // Block 0x3e, offset 0x1e1
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x7453, lo: 0xa0, hi: 0xaf},
+ {value: 0x7853, lo: 0xb0, hi: 0xbf},
+ // Block 0x3f, offset 0x1e4
+ {value: 0x7c53, lo: 0x80, hi: 0x8f},
+ {value: 0x8053, lo: 0x90, hi: 0x9f},
+ {value: 0x7c53, lo: 0xa0, hi: 0xaf},
+ {value: 0x0813, lo: 0xb0, hi: 0xb5},
+ {value: 0x0892, lo: 0xb8, hi: 0xbd},
+ // Block 0x40, offset 0x1e9
+ {value: 0x0010, lo: 0x81, hi: 0xbf},
+ // Block 0x41, offset 0x1ea
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0010, lo: 0xaf, hi: 0xbf},
+ // Block 0x42, offset 0x1ec
+ {value: 0x0010, lo: 0x81, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x43, offset 0x1ee
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb8},
+ // Block 0x44, offset 0x1f0
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0034, lo: 0x94, hi: 0x94},
+ {value: 0x0010, lo: 0xa0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ // Block 0x45, offset 0x1f7
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xac},
+ {value: 0x0010, lo: 0xae, hi: 0xb0},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ // Block 0x46, offset 0x1fc
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x47, offset 0x200
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x89, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0014, lo: 0x93, hi: 0x93},
+ {value: 0x0004, lo: 0x97, hi: 0x97},
+ {value: 0x0024, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0x48, offset 0x209
+ {value: 0x0014, lo: 0x8b, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x49, offset 0x20c
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb8},
+ // Block 0x4a, offset 0x20f
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x4b, offset 0x215
+ {value: 0x0010, lo: 0x80, hi: 0xb5},
+ // Block 0x4c, offset 0x216
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbb},
+ // Block 0x4d, offset 0x221
+ {value: 0x0010, lo: 0x86, hi: 0x8f},
+ // Block 0x4e, offset 0x222
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x4f, offset 0x223
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ // Block 0x50, offset 0x228
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x9e},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xac},
+ {value: 0x0010, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xbc},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x51, offset 0x235
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xa7, hi: 0xa7},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ {value: 0x0034, lo: 0xb5, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbc},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0x52, offset 0x23d
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x53, offset 0x245
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0030, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xab, hi: 0xab},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ {value: 0x0024, lo: 0xad, hi: 0xb3},
+ // Block 0x54, offset 0x24e
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0030, lo: 0xaa, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbf},
+ // Block 0x55, offset 0x257
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0030, lo: 0xb2, hi: 0xb3},
+ // Block 0x56, offset 0x260
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0x57, offset 0x265
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8d, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x58, offset 0x268
+ {value: 0x316a, lo: 0x80, hi: 0x80},
+ {value: 0x31ea, lo: 0x81, hi: 0x81},
+ {value: 0x326a, lo: 0x82, hi: 0x82},
+ {value: 0x32ea, lo: 0x83, hi: 0x83},
+ {value: 0x336a, lo: 0x84, hi: 0x84},
+ {value: 0x33ea, lo: 0x85, hi: 0x85},
+ {value: 0x346a, lo: 0x86, hi: 0x86},
+ {value: 0x34ea, lo: 0x87, hi: 0x87},
+ {value: 0x356a, lo: 0x88, hi: 0x88},
+ {value: 0x8353, lo: 0x90, hi: 0xba},
+ {value: 0x8353, lo: 0xbd, hi: 0xbf},
+ // Block 0x59, offset 0x273
+ {value: 0x0024, lo: 0x90, hi: 0x92},
+ {value: 0x0034, lo: 0x94, hi: 0x99},
+ {value: 0x0024, lo: 0x9a, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9f},
+ {value: 0x0024, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xb3},
+ {value: 0x0024, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb7},
+ {value: 0x0024, lo: 0xb8, hi: 0xb9},
+ // Block 0x5a, offset 0x280
+ {value: 0x0012, lo: 0x80, hi: 0xab},
+ {value: 0x0015, lo: 0xac, hi: 0xbf},
+ // Block 0x5b, offset 0x282
+ {value: 0x0015, lo: 0x80, hi: 0xaa},
+ {value: 0x0012, lo: 0xab, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb8},
+ {value: 0x8752, lo: 0xb9, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbc},
+ {value: 0x8b52, lo: 0xbd, hi: 0xbd},
+ {value: 0x0012, lo: 0xbe, hi: 0xbf},
+ // Block 0x5c, offset 0x289
+ {value: 0x0012, lo: 0x80, hi: 0x9a},
+ {value: 0x0015, lo: 0x9b, hi: 0xbf},
+ // Block 0x5d, offset 0x28b
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0024, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb9},
+ {value: 0x0024, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbd},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x5e, offset 0x297
+ {value: 0x0117, lo: 0x80, hi: 0xbf},
+ // Block 0x5f, offset 0x298
+ {value: 0x0117, lo: 0x80, hi: 0x95},
+ {value: 0x361a, lo: 0x96, hi: 0x96},
+ {value: 0x36ca, lo: 0x97, hi: 0x97},
+ {value: 0x377a, lo: 0x98, hi: 0x98},
+ {value: 0x382a, lo: 0x99, hi: 0x99},
+ {value: 0x38da, lo: 0x9a, hi: 0x9a},
+ {value: 0x398a, lo: 0x9b, hi: 0x9b},
+ {value: 0x0012, lo: 0x9c, hi: 0x9d},
+ {value: 0x3a3b, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0x9f, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x60, offset 0x2a3
+ {value: 0x0812, lo: 0x80, hi: 0x87},
+ {value: 0x0813, lo: 0x88, hi: 0x8f},
+ {value: 0x0812, lo: 0x90, hi: 0x95},
+ {value: 0x0813, lo: 0x98, hi: 0x9d},
+ {value: 0x0812, lo: 0xa0, hi: 0xa7},
+ {value: 0x0813, lo: 0xa8, hi: 0xaf},
+ {value: 0x0812, lo: 0xb0, hi: 0xb7},
+ {value: 0x0813, lo: 0xb8, hi: 0xbf},
+ // Block 0x61, offset 0x2ab
+ {value: 0x0004, lo: 0x8b, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8f},
+ {value: 0x0054, lo: 0x98, hi: 0x99},
+ {value: 0x0054, lo: 0xa4, hi: 0xa4},
+ {value: 0x0054, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xaa, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xaf},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x62, offset 0x2b3
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x94, hi: 0x94},
+ {value: 0x0014, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa6, hi: 0xaf},
+ {value: 0x0015, lo: 0xb1, hi: 0xb1},
+ {value: 0x0015, lo: 0xbf, hi: 0xbf},
+ // Block 0x63, offset 0x2b9
+ {value: 0x0015, lo: 0x90, hi: 0x9c},
+ // Block 0x64, offset 0x2ba
+ {value: 0x0024, lo: 0x90, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0xa0},
+ {value: 0x0024, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa4},
+ {value: 0x0034, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ // Block 0x65, offset 0x2c8
+ {value: 0x0016, lo: 0x85, hi: 0x86},
+ {value: 0x0012, lo: 0x87, hi: 0x89},
+ {value: 0xa052, lo: 0x8e, hi: 0x8e},
+ {value: 0x1013, lo: 0xa0, hi: 0xaf},
+ {value: 0x1012, lo: 0xb0, hi: 0xbf},
+ // Block 0x66, offset 0x2cd
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x88},
+ // Block 0x67, offset 0x2d0
+ {value: 0xa353, lo: 0xb6, hi: 0xb7},
+ {value: 0xa653, lo: 0xb8, hi: 0xb9},
+ {value: 0xa953, lo: 0xba, hi: 0xbb},
+ {value: 0xa653, lo: 0xbc, hi: 0xbd},
+ {value: 0xa353, lo: 0xbe, hi: 0xbf},
+ // Block 0x68, offset 0x2d5
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6553, lo: 0x90, hi: 0x9f},
+ {value: 0xac53, lo: 0xa0, hi: 0xae},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0x69, offset 0x2d9
+ {value: 0x0117, lo: 0x80, hi: 0xa3},
+ {value: 0x0012, lo: 0xa4, hi: 0xa4},
+ {value: 0x0716, lo: 0xab, hi: 0xac},
+ {value: 0x0316, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb3},
+ // Block 0x6a, offset 0x2df
+ {value: 0x6c52, lo: 0x80, hi: 0x9f},
+ {value: 0x7052, lo: 0xa0, hi: 0xa5},
+ {value: 0x7052, lo: 0xa7, hi: 0xa7},
+ {value: 0x7052, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x6b, offset 0x2e4
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x6c, offset 0x2e7
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0010, lo: 0xb0, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x6d, offset 0x2ec
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9e},
+ {value: 0x0024, lo: 0xa0, hi: 0xbf},
+ // Block 0x6e, offset 0x2f1
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ // Block 0x6f, offset 0x2f2
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0xaa, hi: 0xad},
+ {value: 0x0030, lo: 0xae, hi: 0xaf},
+ {value: 0x0004, lo: 0xb1, hi: 0xb5},
+ {value: 0x0014, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ // Block 0x70, offset 0x2f8
+ {value: 0x0034, lo: 0x99, hi: 0x9a},
+ {value: 0x0004, lo: 0x9b, hi: 0x9e},
+ // Block 0x71, offset 0x2fa
+ {value: 0x0004, lo: 0xbc, hi: 0xbe},
+ // Block 0x72, offset 0x2fb
+ {value: 0x0010, lo: 0x85, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x73, offset 0x2fd
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0010, lo: 0xa0, hi: 0xba},
+ // Block 0x74, offset 0x2ff
+ {value: 0x0010, lo: 0x80, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0xbf},
+ // Block 0x75, offset 0x302
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ // Block 0x76, offset 0x303
+ {value: 0x0010, lo: 0x90, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x77, offset 0x305
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0xab},
+ // Block 0x78, offset 0x308
+ {value: 0x0117, lo: 0x80, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb2},
+ {value: 0x0024, lo: 0xb4, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x79, offset 0x30e
+ {value: 0x0117, lo: 0x80, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9d},
+ {value: 0x0024, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x7a, offset 0x312
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb1},
+ // Block 0x7b, offset 0x314
+ {value: 0x0004, lo: 0x80, hi: 0x96},
+ {value: 0x0014, lo: 0x97, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xaf},
+ {value: 0x0012, lo: 0xb0, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xbf},
+ // Block 0x7c, offset 0x319
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x0015, lo: 0xb0, hi: 0xb0},
+ {value: 0x0012, lo: 0xb1, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x8753, lo: 0xbd, hi: 0xbd},
+ {value: 0x0117, lo: 0xbe, hi: 0xbf},
+ // Block 0x7d, offset 0x320
+ {value: 0x0010, lo: 0xb7, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbf},
+ // Block 0x7e, offset 0x324
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x8c, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ // Block 0x7f, offset 0x32d
+ {value: 0x0010, lo: 0x80, hi: 0xb3},
+ // Block 0x80, offset 0x32e
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xa0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb7},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x81, offset 0x337
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x82, offset 0x33b
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0x92},
+ {value: 0x0030, lo: 0x93, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0x83, offset 0x340
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x84, offset 0x348
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0004, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x85, offset 0x34e
+ {value: 0x0010, lo: 0x80, hi: 0xa8},
+ {value: 0x0014, lo: 0xa9, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0x86, offset 0x354
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x87, offset 0x35e
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0024, lo: 0xbe, hi: 0xbf},
+ // Block 0x88, offset 0x363
+ {value: 0x0024, lo: 0x81, hi: 0x81},
+ {value: 0x0004, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ // Block 0x89, offset 0x36c
+ {value: 0x0010, lo: 0x81, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x8e},
+ {value: 0x0010, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8a, offset 0x372
+ {value: 0x0012, lo: 0x80, hi: 0x92},
+ {value: 0xaf52, lo: 0x93, hi: 0x93},
+ {value: 0x0012, lo: 0x94, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa5},
+ {value: 0x74d2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8b, offset 0x379
+ {value: 0x78d2, lo: 0x80, hi: 0x8f},
+ {value: 0x7cd2, lo: 0x90, hi: 0x9f},
+ {value: 0x80d2, lo: 0xa0, hi: 0xaf},
+ {value: 0x7cd2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8c, offset 0x37d
+ {value: 0x0010, lo: 0x80, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x8d, offset 0x385
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x8e, offset 0x387
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x8b, hi: 0xbb},
+ // Block 0x8f, offset 0x389
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0xbf},
+ // Block 0x90, offset 0x38c
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0004, lo: 0xb2, hi: 0xbf},
+ // Block 0x91, offset 0x38e
+ {value: 0x0004, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x93, hi: 0xbf},
+ // Block 0x92, offset 0x390
+ {value: 0x0010, lo: 0x80, hi: 0xbd},
+ // Block 0x93, offset 0x391
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0x94, offset 0x392
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0xbf},
+ // Block 0x95, offset 0x394
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0xb0, hi: 0xbb},
+ // Block 0x96, offset 0x396
+ {value: 0x0014, lo: 0x80, hi: 0x8f},
+ {value: 0x0054, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0xa0, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xad},
+ {value: 0x0024, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ // Block 0x97, offset 0x39c
+ {value: 0x0010, lo: 0x8d, hi: 0x8f},
+ {value: 0x0054, lo: 0x92, hi: 0x92},
+ {value: 0x0054, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0xb0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0x98, offset 0x3a1
+ {value: 0x0010, lo: 0x80, hi: 0xbc},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x99, offset 0x3a3
+ {value: 0x0054, lo: 0x87, hi: 0x87},
+ {value: 0x0054, lo: 0x8e, hi: 0x8e},
+ {value: 0x0054, lo: 0x9a, hi: 0x9a},
+ {value: 0x5f53, lo: 0xa1, hi: 0xba},
+ {value: 0x0004, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9a, offset 0x3a9
+ {value: 0x0004, lo: 0x80, hi: 0x80},
+ {value: 0x5f52, lo: 0x81, hi: 0x9a},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ // Block 0x9b, offset 0x3ac
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbe},
+ // Block 0x9c, offset 0x3ae
+ {value: 0x0010, lo: 0x82, hi: 0x87},
+ {value: 0x0010, lo: 0x8a, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0x97},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0004, lo: 0xa3, hi: 0xa3},
+ {value: 0x0014, lo: 0xb9, hi: 0xbb},
+ // Block 0x9d, offset 0x3b4
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0010, lo: 0x8d, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xba},
+ {value: 0x0010, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9e, offset 0x3b9
+ {value: 0x0010, lo: 0x80, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x9d},
+ // Block 0x9f, offset 0x3bb
+ {value: 0x0010, lo: 0x80, hi: 0xba},
+ // Block 0xa0, offset 0x3bc
+ {value: 0x0010, lo: 0x80, hi: 0xb4},
+ // Block 0xa1, offset 0x3bd
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0xa2, offset 0x3be
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa3, offset 0x3c0
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ // Block 0xa4, offset 0x3c2
+ {value: 0x0010, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xad, hi: 0xbf},
+ // Block 0xa5, offset 0x3c4
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0xb5},
+ {value: 0x0024, lo: 0xb6, hi: 0xba},
+ // Block 0xa6, offset 0x3c7
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa7, offset 0x3c9
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x91, hi: 0x95},
+ // Block 0xa8, offset 0x3cc
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x97},
+ {value: 0xb253, lo: 0x98, hi: 0x9f},
+ {value: 0xb553, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbf},
+ // Block 0xa9, offset 0x3d4
+ {value: 0xb252, lo: 0x80, hi: 0x87},
+ {value: 0xb552, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xaa, offset 0x3d7
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0xb553, lo: 0xb0, hi: 0xb7},
+ {value: 0xb253, lo: 0xb8, hi: 0xbf},
+ // Block 0xab, offset 0x3db
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x93},
+ {value: 0xb552, lo: 0x98, hi: 0x9f},
+ {value: 0xb252, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbb},
+ // Block 0xac, offset 0x3e3
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xad, offset 0x3e5
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ // Block 0xae, offset 0x3e6
+ {value: 0x0010, lo: 0x80, hi: 0xb6},
+ // Block 0xaf, offset 0x3e7
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ // Block 0xb0, offset 0x3e9
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xb1, offset 0x3ef
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xb2, offset 0x3f1
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ // Block 0xb3, offset 0x3f2
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ // Block 0xb4, offset 0x3f4
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb9},
+ // Block 0xb5, offset 0x3f6
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0xb6, offset 0x3f8
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x8e, hi: 0x8e},
+ {value: 0x0024, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x99, hi: 0xb5},
+ {value: 0x0024, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xb7, offset 0x405
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0xb8, offset 0x406
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ // Block 0xb9, offset 0x407
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ // Block 0xba, offset 0x40b
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ // Block 0xbb, offset 0x40d
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ // Block 0xbc, offset 0x40e
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ // Block 0xbd, offset 0x40f
+ {value: 0x5653, lo: 0x80, hi: 0xb2},
+ // Block 0xbe, offset 0x410
+ {value: 0x5652, lo: 0x80, hi: 0xb2},
+ // Block 0xbf, offset 0x411
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc0, offset 0x414
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xc1, offset 0x417
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x87},
+ {value: 0x0024, lo: 0x88, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x8b},
+ {value: 0x0024, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ // Block 0xc2, offset 0x41d
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xc3, offset 0x421
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xc4, offset 0x425
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ // Block 0xc5, offset 0x42b
+ {value: 0x0014, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc6, offset 0x42e
+ {value: 0x0024, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0xc7, offset 0x435
+ {value: 0x0010, lo: 0x84, hi: 0x86},
+ {value: 0x0010, lo: 0x90, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ // Block 0xc8, offset 0x439
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xc9, offset 0x43d
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x89, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ // Block 0xca, offset 0x444
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb4},
+ {value: 0x0030, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xb7},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0xcb, offset 0x44d
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xcc, offset 0x453
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa2},
+ {value: 0x0014, lo: 0xa3, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xcd, offset 0x459
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xce, offset 0x463
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0030, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9d, hi: 0xa3},
+ {value: 0x0024, lo: 0xa6, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ // Block 0xcf, offset 0x46d
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xd0, offset 0x46f
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0x9e, hi: 0x9e},
+ // Block 0xd1, offset 0x477
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xd2, offset 0x47d
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd3, offset 0x483
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd4, offset 0x489
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x98, hi: 0x9b},
+ {value: 0x0014, lo: 0x9c, hi: 0x9d},
+ // Block 0xd5, offset 0x48c
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd6, offset 0x492
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd7, offset 0x495
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0014, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb5},
+ {value: 0x0030, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0xd8, offset 0x49d
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ // Block 0xd9, offset 0x49e
+ {value: 0x0014, lo: 0x9d, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xda, offset 0x4a5
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ // Block 0xdb, offset 0x4a9
+ {value: 0x5f53, lo: 0xa0, hi: 0xbf},
+ // Block 0xdc, offset 0x4aa
+ {value: 0x5f52, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xdd, offset 0x4ad
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x8a},
+ {value: 0x0010, lo: 0x8b, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbe},
+ // Block 0xde, offset 0x4b5
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0014, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x98},
+ {value: 0x0014, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0xbf},
+ // Block 0xdf, offset 0x4bb
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x86, hi: 0x89},
+ {value: 0x0014, lo: 0x8a, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9d, hi: 0x9d},
+ // Block 0xe0, offset 0x4c2
+ {value: 0x0010, lo: 0x80, hi: 0xb8},
+ // Block 0xe1, offset 0x4c3
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xe2, offset 0x4c9
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0xe3, offset 0x4cc
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0014, lo: 0x92, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xa9},
+ {value: 0x0014, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0xe4, offset 0x4d4
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb6},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xe5, offset 0x4db
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa5},
+ {value: 0x0010, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xbf},
+ // Block 0xe6, offset 0x4e5
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0014, lo: 0x90, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0x96},
+ {value: 0x0034, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xe7, offset 0x4ed
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ // Block 0xe8, offset 0x4f0
+ {value: 0x0010, lo: 0x80, hi: 0x99},
+ // Block 0xe9, offset 0x4f1
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ // Block 0xea, offset 0x4f2
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ // Block 0xeb, offset 0x4f3
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ // Block 0xec, offset 0x4f4
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xed, offset 0x4f6
+ {value: 0x0010, lo: 0x90, hi: 0xad},
+ {value: 0x0034, lo: 0xb0, hi: 0xb4},
+ // Block 0xee, offset 0x4f8
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ // Block 0xef, offset 0x4fa
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa3, hi: 0xb7},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xf0, offset 0x4fe
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ // Block 0xf1, offset 0x4ff
+ {value: 0x2013, lo: 0x80, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xbf},
+ // Block 0xf2, offset 0x501
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0xbe},
+ // Block 0xf3, offset 0x503
+ {value: 0x0014, lo: 0x8f, hi: 0x9f},
+ // Block 0xf4, offset 0x504
+ {value: 0x0014, lo: 0xa0, hi: 0xa1},
+ // Block 0xf5, offset 0x505
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbc},
+ // Block 0xf6, offset 0x507
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0034, lo: 0x9e, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa3},
+ // Block 0xf7, offset 0x50c
+ {value: 0x0030, lo: 0xa5, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xa9},
+ {value: 0x0030, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbf},
+ // Block 0xf8, offset 0x511
+ {value: 0x0034, lo: 0x80, hi: 0x82},
+ {value: 0x0024, lo: 0x85, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8b},
+ {value: 0x0024, lo: 0xaa, hi: 0xad},
+ // Block 0xf9, offset 0x515
+ {value: 0x0024, lo: 0x82, hi: 0x84},
+ // Block 0xfa, offset 0x516
+ {value: 0x0013, lo: 0x80, hi: 0x99},
+ {value: 0x0012, lo: 0x9a, hi: 0xb3},
+ {value: 0x0013, lo: 0xb4, hi: 0xbf},
+ // Block 0xfb, offset 0x519
+ {value: 0x0013, lo: 0x80, hi: 0x8d},
+ {value: 0x0012, lo: 0x8e, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0xa7},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0xfc, offset 0x51d
+ {value: 0x0013, lo: 0x80, hi: 0x81},
+ {value: 0x0012, lo: 0x82, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0x9c},
+ {value: 0x0013, lo: 0x9e, hi: 0x9f},
+ {value: 0x0013, lo: 0xa2, hi: 0xa2},
+ {value: 0x0013, lo: 0xa5, hi: 0xa6},
+ {value: 0x0013, lo: 0xa9, hi: 0xac},
+ {value: 0x0013, lo: 0xae, hi: 0xb5},
+ {value: 0x0012, lo: 0xb6, hi: 0xb9},
+ {value: 0x0012, lo: 0xbb, hi: 0xbb},
+ {value: 0x0012, lo: 0xbd, hi: 0xbf},
+ // Block 0xfd, offset 0x528
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0012, lo: 0x85, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0xfe, offset 0x52c
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0013, lo: 0x84, hi: 0x85},
+ {value: 0x0013, lo: 0x87, hi: 0x8a},
+ {value: 0x0013, lo: 0x8d, hi: 0x94},
+ {value: 0x0013, lo: 0x96, hi: 0x9c},
+ {value: 0x0012, lo: 0x9e, hi: 0xb7},
+ {value: 0x0013, lo: 0xb8, hi: 0xb9},
+ {value: 0x0013, lo: 0xbb, hi: 0xbe},
+ // Block 0xff, offset 0x534
+ {value: 0x0013, lo: 0x80, hi: 0x84},
+ {value: 0x0013, lo: 0x86, hi: 0x86},
+ {value: 0x0013, lo: 0x8a, hi: 0x90},
+ {value: 0x0012, lo: 0x92, hi: 0xab},
+ {value: 0x0013, lo: 0xac, hi: 0xbf},
+ // Block 0x100, offset 0x539
+ {value: 0x0013, lo: 0x80, hi: 0x85},
+ {value: 0x0012, lo: 0x86, hi: 0x9f},
+ {value: 0x0013, lo: 0xa0, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbf},
+ // Block 0x101, offset 0x53d
+ {value: 0x0012, lo: 0x80, hi: 0x93},
+ {value: 0x0013, lo: 0x94, hi: 0xad},
+ {value: 0x0012, lo: 0xae, hi: 0xbf},
+ // Block 0x102, offset 0x540
+ {value: 0x0012, lo: 0x80, hi: 0x87},
+ {value: 0x0013, lo: 0x88, hi: 0xa1},
+ {value: 0x0012, lo: 0xa2, hi: 0xbb},
+ {value: 0x0013, lo: 0xbc, hi: 0xbf},
+ // Block 0x103, offset 0x544
+ {value: 0x0013, lo: 0x80, hi: 0x95},
+ {value: 0x0012, lo: 0x96, hi: 0xaf},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x104, offset 0x547
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0012, lo: 0x8a, hi: 0xa5},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x105, offset 0x54a
+ {value: 0x0013, lo: 0x80, hi: 0x80},
+ {value: 0x0012, lo: 0x82, hi: 0x9a},
+ {value: 0x0012, lo: 0x9c, hi: 0xa1},
+ {value: 0x0013, lo: 0xa2, hi: 0xba},
+ {value: 0x0012, lo: 0xbc, hi: 0xbf},
+ // Block 0x106, offset 0x54f
+ {value: 0x0012, lo: 0x80, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0xb4},
+ {value: 0x0012, lo: 0xb6, hi: 0xbf},
+ // Block 0x107, offset 0x553
+ {value: 0x0012, lo: 0x80, hi: 0x8e},
+ {value: 0x0012, lo: 0x90, hi: 0x95},
+ {value: 0x0013, lo: 0x96, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x108, offset 0x557
+ {value: 0x0012, lo: 0x80, hi: 0x88},
+ {value: 0x0012, lo: 0x8a, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x109, offset 0x55b
+ {value: 0x0012, lo: 0x80, hi: 0x82},
+ {value: 0x0012, lo: 0x84, hi: 0x89},
+ {value: 0x0017, lo: 0x8a, hi: 0x8b},
+ {value: 0x0010, lo: 0x8e, hi: 0xbf},
+ // Block 0x10a, offset 0x55f
+ {value: 0x0014, lo: 0x80, hi: 0xb6},
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x10b, offset 0x561
+ {value: 0x0014, lo: 0x80, hi: 0xac},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x10c, offset 0x563
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x9b, hi: 0x9f},
+ {value: 0x0014, lo: 0xa1, hi: 0xaf},
+ // Block 0x10d, offset 0x566
+ {value: 0x0024, lo: 0x80, hi: 0x86},
+ {value: 0x0024, lo: 0x88, hi: 0x98},
+ {value: 0x0024, lo: 0x9b, hi: 0xa1},
+ {value: 0x0024, lo: 0xa3, hi: 0xa4},
+ {value: 0x0024, lo: 0xa6, hi: 0xaa},
+ // Block 0x10e, offset 0x56b
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0034, lo: 0x90, hi: 0x96},
+ // Block 0x10f, offset 0x56d
+ {value: 0xb852, lo: 0x80, hi: 0x81},
+ {value: 0xbb52, lo: 0x82, hi: 0x83},
+ {value: 0x0024, lo: 0x84, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x110, offset 0x572
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x9f},
+ {value: 0x0010, lo: 0xa1, hi: 0xa2},
+ {value: 0x0010, lo: 0xa4, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb7},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ // Block 0x111, offset 0x57b
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x9b},
+ {value: 0x0010, lo: 0xa1, hi: 0xa3},
+ {value: 0x0010, lo: 0xa5, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xbb},
+ // Block 0x112, offset 0x580
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x113, offset 0x581
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x114, offset 0x584
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ // Block 0x115, offset 0x585
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x116, offset 0x586
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0014, lo: 0xa0, hi: 0xbf},
+ // Block 0x117, offset 0x588
+ {value: 0x0014, lo: 0x80, hi: 0xbf},
+ // Block 0x118, offset 0x589
+ {value: 0x0014, lo: 0x80, hi: 0xaf},
+}
+
+// Total table size 14906 bytes (14KiB); checksum: 362795C7
diff --git a/vendor/golang.org/x/text/cases/tables12.0.0.go b/vendor/golang.org/x/text/cases/tables12.0.0.go
new file mode 100644
index 00000000000..84d841b149c
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/tables12.0.0.go
@@ -0,0 +1,2359 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+//go:build go1.14 && !go1.16
+
+package cases
+
+// UnicodeVersion is the Unicode version from which the tables in this package are derived.
+const UnicodeVersion = "12.0.0"
+
+var xorData string = "" + // Size: 192 bytes
+ "\x00\x06\x07\x00\x01?\x00\x0f\x03\x00\x0f\x12\x00\x0f\x1f\x00\x0f\x1d" +
+ "\x00\x01\x13\x00\x0f\x16\x00\x0f\x0b\x00\x0f3\x00\x0f7\x00\x01#\x00\x0f?" +
+ "\x00\x0e'\x00\x0f/\x00\x0e>\x00\x0f*\x00\x0c&\x00\x0c*\x00\x0c;\x00\x0c9" +
+ "\x00\x0c%\x00\x01\x08\x00\x03\x0d\x00\x03\x09\x00\x02\x06\x00\x02\x02" +
+ "\x00\x02\x0c\x00\x01\x00\x00\x01\x03\x00\x01\x01\x00\x01 \x00\x01\x0c" +
+ "\x00\x01\x10\x00\x03\x10\x00\x036 \x00\x037 \x00\x0b#\x10\x00\x0b 0\x00" +
+ "\x0b!\x10\x00\x0b!0\x001\x00\x00\x0b(\x04\x00\x03\x04\x1e\x00\x0b)\x08" +
+ "\x00\x03\x0a\x00\x02:\x00\x02>\x00\x02,\x00\x02\x00\x00\x02\x10\x00\x01<" +
+ "\x00\x01&\x00\x01*\x00\x01.\x00\x010\x003 \x00\x01\x18\x00\x01(\x00\x01" +
+ "\x1e\x00\x01\x22"
+
+var exceptions string = "" + // Size: 2450 bytes
+ "\x00\x12\x12μΜΜ\x12\x12ssSSSs\x13\x18i̇i̇\x10\x09II\x13\x1bʼnʼNʼN\x11" +
+ "\x09sSS\x12\x12dždžDž\x12\x12dždžDŽ\x10\x12DŽDž\x12\x12ljljLj\x12\x12ljljLJ\x10\x12LJLj" +
+ "\x12\x12njnjNj\x12\x12njnjNJ\x10\x12NJNj\x13\x1bǰJ̌J̌\x12\x12dzdzDz\x12\x12dzdzDZ\x10" +
+ "\x12DZDz\x13\x18ⱥⱥ\x13\x18ⱦⱦ\x10\x1bⱾⱾ\x10\x1bⱿⱿ\x10\x1bⱯⱯ\x10\x1bⱭⱭ\x10" +
+ "\x1bⱰⱰ\x10\x1bꞫꞫ\x10\x1bꞬꞬ\x10\x1bꞍꞍ\x10\x1bꞪꞪ\x10\x1bꞮꞮ\x10\x1bⱢⱢ\x10" +
+ "\x1bꞭꞭ\x10\x1bⱮⱮ\x10\x1bⱤⱤ\x10\x1bꟅꟅ\x10\x1bꞱꞱ\x10\x1bꞲꞲ\x10\x1bꞰꞰ2\x12ι" +
+ "ΙΙ\x166ΐΪ́Ϊ́\x166ΰΫ́Ϋ́\x12\x12σΣΣ\x12\x12βΒΒ\x12\x12θΘΘ\x12\x12" +
+ "φΦΦ\x12\x12πΠΠ\x12\x12κΚΚ\x12\x12ρΡΡ\x12\x12εΕΕ\x14$եւԵՒԵւ\x10\x1bᲐა" +
+ "\x10\x1bᲑბ\x10\x1bᲒგ\x10\x1bᲓდ\x10\x1bᲔე\x10\x1bᲕვ\x10\x1bᲖზ\x10\x1bᲗთ" +
+ "\x10\x1bᲘი\x10\x1bᲙკ\x10\x1bᲚლ\x10\x1bᲛმ\x10\x1bᲜნ\x10\x1bᲝო\x10\x1bᲞპ" +
+ "\x10\x1bᲟჟ\x10\x1bᲠრ\x10\x1bᲡს\x10\x1bᲢტ\x10\x1bᲣუ\x10\x1bᲤფ\x10\x1bᲥქ" +
+ "\x10\x1bᲦღ\x10\x1bᲧყ\x10\x1bᲨშ\x10\x1bᲩჩ\x10\x1bᲪც\x10\x1bᲫძ\x10\x1bᲬწ" +
+ "\x10\x1bᲭჭ\x10\x1bᲮხ\x10\x1bᲯჯ\x10\x1bᲰჰ\x10\x1bᲱჱ\x10\x1bᲲჲ\x10\x1bᲳჳ" +
+ "\x10\x1bᲴჴ\x10\x1bᲵჵ\x10\x1bᲶჶ\x10\x1bᲷჷ\x10\x1bᲸჸ\x10\x1bᲹჹ\x10\x1bᲺჺ" +
+ "\x10\x1bᲽჽ\x10\x1bᲾჾ\x10\x1bᲿჿ\x12\x12вВВ\x12\x12дДД\x12\x12оОО\x12\x12с" +
+ "СС\x12\x12тТТ\x12\x12тТТ\x12\x12ъЪЪ\x12\x12ѣѢѢ\x13\x1bꙋꙊꙊ\x13\x1bẖH̱H̱" +
+ "\x13\x1bẗT̈T̈\x13\x1bẘW̊W̊\x13\x1bẙY̊Y̊\x13\x1baʾAʾAʾ\x13\x1bṡṠṠ\x12" +
+ "\x10ssß\x14$ὐΥ̓Υ̓\x166ὒΥ̓̀Υ̓̀\x166ὔΥ̓́Υ̓́\x166ὖΥ̓͂Υ̓͂\x15+ἀιἈΙᾈ" +
+ "\x15+ἁιἉΙᾉ\x15+ἂιἊΙᾊ\x15+ἃιἋΙᾋ\x15+ἄιἌΙᾌ\x15+ἅιἍΙᾍ\x15+ἆιἎΙᾎ\x15+ἇιἏΙᾏ" +
+ "\x15\x1dἀιᾀἈΙ\x15\x1dἁιᾁἉΙ\x15\x1dἂιᾂἊΙ\x15\x1dἃιᾃἋΙ\x15\x1dἄιᾄἌΙ\x15" +
+ "\x1dἅιᾅἍΙ\x15\x1dἆιᾆἎΙ\x15\x1dἇιᾇἏΙ\x15+ἠιἨΙᾘ\x15+ἡιἩΙᾙ\x15+ἢιἪΙᾚ\x15+ἣι" +
+ "ἫΙᾛ\x15+ἤιἬΙᾜ\x15+ἥιἭΙᾝ\x15+ἦιἮΙᾞ\x15+ἧιἯΙᾟ\x15\x1dἠιᾐἨΙ\x15\x1dἡιᾑἩΙ" +
+ "\x15\x1dἢιᾒἪΙ\x15\x1dἣιᾓἫΙ\x15\x1dἤιᾔἬΙ\x15\x1dἥιᾕἭΙ\x15\x1dἦιᾖἮΙ\x15" +
+ "\x1dἧιᾗἯΙ\x15+ὠιὨΙᾨ\x15+ὡιὩΙᾩ\x15+ὢιὪΙᾪ\x15+ὣιὫΙᾫ\x15+ὤιὬΙᾬ\x15+ὥιὭΙᾭ" +
+ "\x15+ὦιὮΙᾮ\x15+ὧιὯΙᾯ\x15\x1dὠιᾠὨΙ\x15\x1dὡιᾡὩΙ\x15\x1dὢιᾢὪΙ\x15\x1dὣιᾣὫΙ" +
+ "\x15\x1dὤιᾤὬΙ\x15\x1dὥιᾥὭΙ\x15\x1dὦιᾦὮΙ\x15\x1dὧιᾧὯΙ\x15-ὰιᾺΙᾺͅ\x14#αιΑΙ" +
+ "ᾼ\x14$άιΆΙΆͅ\x14$ᾶΑ͂Α͂\x166ᾶιΑ͂Ιᾼ͂\x14\x1cαιᾳΑΙ\x12\x12ιΙΙ\x15-ὴιῊΙ" +
+ "Ὴͅ\x14#ηιΗΙῌ\x14$ήιΉΙΉͅ\x14$ῆΗ͂Η͂\x166ῆιΗ͂Ιῌ͂\x14\x1cηιῃΗΙ\x166ῒΙ" +
+ "̈̀Ϊ̀\x166ΐΪ́Ϊ́\x14$ῖΙ͂Ι͂\x166ῗΪ͂Ϊ͂\x166ῢΫ̀Ϋ̀\x166ΰΫ́Ϋ" +
+ "́\x14$ῤΡ̓Ρ̓\x14$ῦΥ͂Υ͂\x166ῧΫ͂Ϋ͂\x15-ὼιῺΙῺͅ\x14#ωιΩΙῼ\x14$ώιΏΙΏͅ" +
+ "\x14$ῶΩ͂Ω͂\x166ῶιΩ͂Ιῼ͂\x14\x1cωιῳΩΙ\x12\x10ωω\x11\x08kk\x12\x10åå\x12" +
+ "\x10ɫɫ\x12\x10ɽɽ\x10\x12ȺȺ\x10\x12ȾȾ\x12\x10ɑɑ\x12\x10ɱɱ\x12\x10ɐɐ\x12" +
+ "\x10ɒɒ\x12\x10ȿȿ\x12\x10ɀɀ\x12\x10ɥɥ\x12\x10ɦɦ\x12\x10ɜɜ\x12\x10ɡɡ\x12" +
+ "\x10ɬɬ\x12\x10ɪɪ\x12\x10ʞʞ\x12\x10ʇʇ\x12\x10ʝʝ\x12\x10ʂʂ\x12\x12ffFFFf" +
+ "\x12\x12fiFIFi\x12\x12flFLFl\x13\x1bffiFFIFfi\x13\x1bfflFFLFfl\x12\x12st" +
+ "STSt\x12\x12stSTSt\x14$մնՄՆՄն\x14$մեՄԵՄե\x14$միՄԻՄի\x14$վնՎՆՎն\x14$մխՄԽՄ" +
+ "խ"
+
+// lookup returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookup(s []byte) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupUnsafe(s []byte) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// lookupString returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookupString(s string) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupStringUnsafe(s string) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// caseTrie. Total size: 12396 bytes (12.11 KiB). Checksum: c0656238384c3da1.
+type caseTrie struct{}
+
+func newCaseTrie(i int) *caseTrie {
+ return &caseTrie{}
+}
+
+// lookupValue determines the type of block n and looks up the value for b.
+func (t *caseTrie) lookupValue(n uint32, b byte) uint16 {
+ switch {
+ case n < 20:
+ return uint16(caseValues[n<<6+uint32(b)])
+ default:
+ n -= 20
+ return uint16(sparse.lookup(n, b))
+ }
+}
+
+// caseValues: 22 blocks, 1408 entries, 2816 bytes
+// The third block is the zero block.
+var caseValues = [1408]uint16{
+ // Block 0x0, offset 0x0
+ 0x27: 0x0054,
+ 0x2e: 0x0054,
+ 0x30: 0x0010, 0x31: 0x0010, 0x32: 0x0010, 0x33: 0x0010, 0x34: 0x0010, 0x35: 0x0010,
+ 0x36: 0x0010, 0x37: 0x0010, 0x38: 0x0010, 0x39: 0x0010, 0x3a: 0x0054,
+ // Block 0x1, offset 0x40
+ 0x41: 0x2013, 0x42: 0x2013, 0x43: 0x2013, 0x44: 0x2013, 0x45: 0x2013,
+ 0x46: 0x2013, 0x47: 0x2013, 0x48: 0x2013, 0x49: 0x2013, 0x4a: 0x2013, 0x4b: 0x2013,
+ 0x4c: 0x2013, 0x4d: 0x2013, 0x4e: 0x2013, 0x4f: 0x2013, 0x50: 0x2013, 0x51: 0x2013,
+ 0x52: 0x2013, 0x53: 0x2013, 0x54: 0x2013, 0x55: 0x2013, 0x56: 0x2013, 0x57: 0x2013,
+ 0x58: 0x2013, 0x59: 0x2013, 0x5a: 0x2013,
+ 0x5e: 0x0004, 0x5f: 0x0010, 0x60: 0x0004, 0x61: 0x2012, 0x62: 0x2012, 0x63: 0x2012,
+ 0x64: 0x2012, 0x65: 0x2012, 0x66: 0x2012, 0x67: 0x2012, 0x68: 0x2012, 0x69: 0x2012,
+ 0x6a: 0x2012, 0x6b: 0x2012, 0x6c: 0x2012, 0x6d: 0x2012, 0x6e: 0x2012, 0x6f: 0x2012,
+ 0x70: 0x2012, 0x71: 0x2012, 0x72: 0x2012, 0x73: 0x2012, 0x74: 0x2012, 0x75: 0x2012,
+ 0x76: 0x2012, 0x77: 0x2012, 0x78: 0x2012, 0x79: 0x2012, 0x7a: 0x2012,
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc0: 0x0852, 0xc1: 0x0b53, 0xc2: 0x0113, 0xc3: 0x0112, 0xc4: 0x0113, 0xc5: 0x0112,
+ 0xc6: 0x0b53, 0xc7: 0x0f13, 0xc8: 0x0f12, 0xc9: 0x0e53, 0xca: 0x1153, 0xcb: 0x0713,
+ 0xcc: 0x0712, 0xcd: 0x0012, 0xce: 0x1453, 0xcf: 0x1753, 0xd0: 0x1a53, 0xd1: 0x0313,
+ 0xd2: 0x0312, 0xd3: 0x1d53, 0xd4: 0x2053, 0xd5: 0x2352, 0xd6: 0x2653, 0xd7: 0x2653,
+ 0xd8: 0x0113, 0xd9: 0x0112, 0xda: 0x2952, 0xdb: 0x0012, 0xdc: 0x1d53, 0xdd: 0x2c53,
+ 0xde: 0x2f52, 0xdf: 0x3253, 0xe0: 0x0113, 0xe1: 0x0112, 0xe2: 0x0113, 0xe3: 0x0112,
+ 0xe4: 0x0113, 0xe5: 0x0112, 0xe6: 0x3553, 0xe7: 0x0f13, 0xe8: 0x0f12, 0xe9: 0x3853,
+ 0xea: 0x0012, 0xeb: 0x0012, 0xec: 0x0113, 0xed: 0x0112, 0xee: 0x3553, 0xef: 0x1f13,
+ 0xf0: 0x1f12, 0xf1: 0x3b53, 0xf2: 0x3e53, 0xf3: 0x0713, 0xf4: 0x0712, 0xf5: 0x0313,
+ 0xf6: 0x0312, 0xf7: 0x4153, 0xf8: 0x0113, 0xf9: 0x0112, 0xfa: 0x0012, 0xfb: 0x0010,
+ 0xfc: 0x0113, 0xfd: 0x0112, 0xfe: 0x0012, 0xff: 0x4452,
+ // Block 0x4, offset 0x100
+ 0x100: 0x0010, 0x101: 0x0010, 0x102: 0x0010, 0x103: 0x0010, 0x104: 0x02db, 0x105: 0x0359,
+ 0x106: 0x03da, 0x107: 0x043b, 0x108: 0x04b9, 0x109: 0x053a, 0x10a: 0x059b, 0x10b: 0x0619,
+ 0x10c: 0x069a, 0x10d: 0x0313, 0x10e: 0x0312, 0x10f: 0x1f13, 0x110: 0x1f12, 0x111: 0x0313,
+ 0x112: 0x0312, 0x113: 0x0713, 0x114: 0x0712, 0x115: 0x0313, 0x116: 0x0312, 0x117: 0x0f13,
+ 0x118: 0x0f12, 0x119: 0x0313, 0x11a: 0x0312, 0x11b: 0x0713, 0x11c: 0x0712, 0x11d: 0x1452,
+ 0x11e: 0x0113, 0x11f: 0x0112, 0x120: 0x0113, 0x121: 0x0112, 0x122: 0x0113, 0x123: 0x0112,
+ 0x124: 0x0113, 0x125: 0x0112, 0x126: 0x0113, 0x127: 0x0112, 0x128: 0x0113, 0x129: 0x0112,
+ 0x12a: 0x0113, 0x12b: 0x0112, 0x12c: 0x0113, 0x12d: 0x0112, 0x12e: 0x0113, 0x12f: 0x0112,
+ 0x130: 0x06fa, 0x131: 0x07ab, 0x132: 0x0829, 0x133: 0x08aa, 0x134: 0x0113, 0x135: 0x0112,
+ 0x136: 0x2353, 0x137: 0x4453, 0x138: 0x0113, 0x139: 0x0112, 0x13a: 0x0113, 0x13b: 0x0112,
+ 0x13c: 0x0113, 0x13d: 0x0112, 0x13e: 0x0113, 0x13f: 0x0112,
+ // Block 0x5, offset 0x140
+ 0x140: 0x0a8a, 0x141: 0x0313, 0x142: 0x0312, 0x143: 0x0853, 0x144: 0x4753, 0x145: 0x4a53,
+ 0x146: 0x0113, 0x147: 0x0112, 0x148: 0x0113, 0x149: 0x0112, 0x14a: 0x0113, 0x14b: 0x0112,
+ 0x14c: 0x0113, 0x14d: 0x0112, 0x14e: 0x0113, 0x14f: 0x0112, 0x150: 0x0b0a, 0x151: 0x0b8a,
+ 0x152: 0x0c0a, 0x153: 0x0b52, 0x154: 0x0b52, 0x155: 0x0012, 0x156: 0x0e52, 0x157: 0x1152,
+ 0x158: 0x0012, 0x159: 0x1752, 0x15a: 0x0012, 0x15b: 0x1a52, 0x15c: 0x0c8a, 0x15d: 0x0012,
+ 0x15e: 0x0012, 0x15f: 0x0012, 0x160: 0x1d52, 0x161: 0x0d0a, 0x162: 0x0012, 0x163: 0x2052,
+ 0x164: 0x0012, 0x165: 0x0d8a, 0x166: 0x0e0a, 0x167: 0x0012, 0x168: 0x2652, 0x169: 0x2652,
+ 0x16a: 0x0e8a, 0x16b: 0x0f0a, 0x16c: 0x0f8a, 0x16d: 0x0012, 0x16e: 0x0012, 0x16f: 0x1d52,
+ 0x170: 0x0012, 0x171: 0x100a, 0x172: 0x2c52, 0x173: 0x0012, 0x174: 0x0012, 0x175: 0x3252,
+ 0x176: 0x0012, 0x177: 0x0012, 0x178: 0x0012, 0x179: 0x0012, 0x17a: 0x0012, 0x17b: 0x0012,
+ 0x17c: 0x0012, 0x17d: 0x108a, 0x17e: 0x0012, 0x17f: 0x0012,
+ // Block 0x6, offset 0x180
+ 0x180: 0x3552, 0x181: 0x0012, 0x182: 0x110a, 0x183: 0x3852, 0x184: 0x0012, 0x185: 0x0012,
+ 0x186: 0x0012, 0x187: 0x118a, 0x188: 0x3552, 0x189: 0x4752, 0x18a: 0x3b52, 0x18b: 0x3e52,
+ 0x18c: 0x4a52, 0x18d: 0x0012, 0x18e: 0x0012, 0x18f: 0x0012, 0x190: 0x0012, 0x191: 0x0012,
+ 0x192: 0x4152, 0x193: 0x0012, 0x194: 0x0010, 0x195: 0x0012, 0x196: 0x0012, 0x197: 0x0012,
+ 0x198: 0x0012, 0x199: 0x0012, 0x19a: 0x0012, 0x19b: 0x0012, 0x19c: 0x0012, 0x19d: 0x120a,
+ 0x19e: 0x128a, 0x19f: 0x0012, 0x1a0: 0x0012, 0x1a1: 0x0012, 0x1a2: 0x0012, 0x1a3: 0x0012,
+ 0x1a4: 0x0012, 0x1a5: 0x0012, 0x1a6: 0x0012, 0x1a7: 0x0012, 0x1a8: 0x0012, 0x1a9: 0x0012,
+ 0x1aa: 0x0012, 0x1ab: 0x0012, 0x1ac: 0x0012, 0x1ad: 0x0012, 0x1ae: 0x0012, 0x1af: 0x0012,
+ 0x1b0: 0x0015, 0x1b1: 0x0015, 0x1b2: 0x0015, 0x1b3: 0x0015, 0x1b4: 0x0015, 0x1b5: 0x0015,
+ 0x1b6: 0x0015, 0x1b7: 0x0015, 0x1b8: 0x0015, 0x1b9: 0x0014, 0x1ba: 0x0014, 0x1bb: 0x0014,
+ 0x1bc: 0x0014, 0x1bd: 0x0014, 0x1be: 0x0014, 0x1bf: 0x0014,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x0024, 0x1c1: 0x0024, 0x1c2: 0x0024, 0x1c3: 0x0024, 0x1c4: 0x0024, 0x1c5: 0x130d,
+ 0x1c6: 0x0024, 0x1c7: 0x0034, 0x1c8: 0x0034, 0x1c9: 0x0034, 0x1ca: 0x0024, 0x1cb: 0x0024,
+ 0x1cc: 0x0024, 0x1cd: 0x0034, 0x1ce: 0x0034, 0x1cf: 0x0014, 0x1d0: 0x0024, 0x1d1: 0x0024,
+ 0x1d2: 0x0024, 0x1d3: 0x0034, 0x1d4: 0x0034, 0x1d5: 0x0034, 0x1d6: 0x0034, 0x1d7: 0x0024,
+ 0x1d8: 0x0034, 0x1d9: 0x0034, 0x1da: 0x0034, 0x1db: 0x0024, 0x1dc: 0x0034, 0x1dd: 0x0034,
+ 0x1de: 0x0034, 0x1df: 0x0034, 0x1e0: 0x0034, 0x1e1: 0x0034, 0x1e2: 0x0034, 0x1e3: 0x0024,
+ 0x1e4: 0x0024, 0x1e5: 0x0024, 0x1e6: 0x0024, 0x1e7: 0x0024, 0x1e8: 0x0024, 0x1e9: 0x0024,
+ 0x1ea: 0x0024, 0x1eb: 0x0024, 0x1ec: 0x0024, 0x1ed: 0x0024, 0x1ee: 0x0024, 0x1ef: 0x0024,
+ 0x1f0: 0x0113, 0x1f1: 0x0112, 0x1f2: 0x0113, 0x1f3: 0x0112, 0x1f4: 0x0014, 0x1f5: 0x0004,
+ 0x1f6: 0x0113, 0x1f7: 0x0112, 0x1fa: 0x0015, 0x1fb: 0x4d52,
+ 0x1fc: 0x5052, 0x1fd: 0x5052, 0x1ff: 0x5353,
+ // Block 0x8, offset 0x200
+ 0x204: 0x0004, 0x205: 0x0004,
+ 0x206: 0x2a13, 0x207: 0x0054, 0x208: 0x2513, 0x209: 0x2713, 0x20a: 0x2513,
+ 0x20c: 0x5653, 0x20e: 0x5953, 0x20f: 0x5c53, 0x210: 0x138a, 0x211: 0x2013,
+ 0x212: 0x2013, 0x213: 0x2013, 0x214: 0x2013, 0x215: 0x2013, 0x216: 0x2013, 0x217: 0x2013,
+ 0x218: 0x2013, 0x219: 0x2013, 0x21a: 0x2013, 0x21b: 0x2013, 0x21c: 0x2013, 0x21d: 0x2013,
+ 0x21e: 0x2013, 0x21f: 0x2013, 0x220: 0x5f53, 0x221: 0x5f53, 0x223: 0x5f53,
+ 0x224: 0x5f53, 0x225: 0x5f53, 0x226: 0x5f53, 0x227: 0x5f53, 0x228: 0x5f53, 0x229: 0x5f53,
+ 0x22a: 0x5f53, 0x22b: 0x5f53, 0x22c: 0x2a12, 0x22d: 0x2512, 0x22e: 0x2712, 0x22f: 0x2512,
+ 0x230: 0x14ca, 0x231: 0x2012, 0x232: 0x2012, 0x233: 0x2012, 0x234: 0x2012, 0x235: 0x2012,
+ 0x236: 0x2012, 0x237: 0x2012, 0x238: 0x2012, 0x239: 0x2012, 0x23a: 0x2012, 0x23b: 0x2012,
+ 0x23c: 0x2012, 0x23d: 0x2012, 0x23e: 0x2012, 0x23f: 0x2012,
+ // Block 0x9, offset 0x240
+ 0x240: 0x5f52, 0x241: 0x5f52, 0x242: 0x160a, 0x243: 0x5f52, 0x244: 0x5f52, 0x245: 0x5f52,
+ 0x246: 0x5f52, 0x247: 0x5f52, 0x248: 0x5f52, 0x249: 0x5f52, 0x24a: 0x5f52, 0x24b: 0x5f52,
+ 0x24c: 0x5652, 0x24d: 0x5952, 0x24e: 0x5c52, 0x24f: 0x1813, 0x250: 0x168a, 0x251: 0x170a,
+ 0x252: 0x0013, 0x253: 0x0013, 0x254: 0x0013, 0x255: 0x178a, 0x256: 0x180a, 0x257: 0x1812,
+ 0x258: 0x0113, 0x259: 0x0112, 0x25a: 0x0113, 0x25b: 0x0112, 0x25c: 0x0113, 0x25d: 0x0112,
+ 0x25e: 0x0113, 0x25f: 0x0112, 0x260: 0x0113, 0x261: 0x0112, 0x262: 0x0113, 0x263: 0x0112,
+ 0x264: 0x0113, 0x265: 0x0112, 0x266: 0x0113, 0x267: 0x0112, 0x268: 0x0113, 0x269: 0x0112,
+ 0x26a: 0x0113, 0x26b: 0x0112, 0x26c: 0x0113, 0x26d: 0x0112, 0x26e: 0x0113, 0x26f: 0x0112,
+ 0x270: 0x188a, 0x271: 0x190a, 0x272: 0x0b12, 0x273: 0x5352, 0x274: 0x6253, 0x275: 0x198a,
+ 0x277: 0x0f13, 0x278: 0x0f12, 0x279: 0x0b13, 0x27a: 0x0113, 0x27b: 0x0112,
+ 0x27c: 0x0012, 0x27d: 0x4d53, 0x27e: 0x5053, 0x27f: 0x5053,
+ // Block 0xa, offset 0x280
+ 0x280: 0x6852, 0x281: 0x6852, 0x282: 0x6852, 0x283: 0x6852, 0x284: 0x6852, 0x285: 0x6852,
+ 0x286: 0x6852, 0x287: 0x1a0a, 0x288: 0x0012,
+ 0x291: 0x0034,
+ 0x292: 0x0024, 0x293: 0x0024, 0x294: 0x0024, 0x295: 0x0024, 0x296: 0x0034, 0x297: 0x0024,
+ 0x298: 0x0024, 0x299: 0x0024, 0x29a: 0x0034, 0x29b: 0x0034, 0x29c: 0x0024, 0x29d: 0x0024,
+ 0x29e: 0x0024, 0x29f: 0x0024, 0x2a0: 0x0024, 0x2a1: 0x0024, 0x2a2: 0x0034, 0x2a3: 0x0034,
+ 0x2a4: 0x0034, 0x2a5: 0x0034, 0x2a6: 0x0034, 0x2a7: 0x0034, 0x2a8: 0x0024, 0x2a9: 0x0024,
+ 0x2aa: 0x0034, 0x2ab: 0x0024, 0x2ac: 0x0024, 0x2ad: 0x0034, 0x2ae: 0x0034, 0x2af: 0x0024,
+ 0x2b0: 0x0034, 0x2b1: 0x0034, 0x2b2: 0x0034, 0x2b3: 0x0034, 0x2b4: 0x0034, 0x2b5: 0x0034,
+ 0x2b6: 0x0034, 0x2b7: 0x0034, 0x2b8: 0x0034, 0x2b9: 0x0034, 0x2ba: 0x0034, 0x2bb: 0x0034,
+ 0x2bc: 0x0034, 0x2bd: 0x0034, 0x2bf: 0x0034,
+ // Block 0xb, offset 0x2c0
+ 0x2c0: 0x7053, 0x2c1: 0x7053, 0x2c2: 0x7053, 0x2c3: 0x7053, 0x2c4: 0x7053, 0x2c5: 0x7053,
+ 0x2c7: 0x7053,
+ 0x2cd: 0x7053, 0x2d0: 0x1aea, 0x2d1: 0x1b6a,
+ 0x2d2: 0x1bea, 0x2d3: 0x1c6a, 0x2d4: 0x1cea, 0x2d5: 0x1d6a, 0x2d6: 0x1dea, 0x2d7: 0x1e6a,
+ 0x2d8: 0x1eea, 0x2d9: 0x1f6a, 0x2da: 0x1fea, 0x2db: 0x206a, 0x2dc: 0x20ea, 0x2dd: 0x216a,
+ 0x2de: 0x21ea, 0x2df: 0x226a, 0x2e0: 0x22ea, 0x2e1: 0x236a, 0x2e2: 0x23ea, 0x2e3: 0x246a,
+ 0x2e4: 0x24ea, 0x2e5: 0x256a, 0x2e6: 0x25ea, 0x2e7: 0x266a, 0x2e8: 0x26ea, 0x2e9: 0x276a,
+ 0x2ea: 0x27ea, 0x2eb: 0x286a, 0x2ec: 0x28ea, 0x2ed: 0x296a, 0x2ee: 0x29ea, 0x2ef: 0x2a6a,
+ 0x2f0: 0x2aea, 0x2f1: 0x2b6a, 0x2f2: 0x2bea, 0x2f3: 0x2c6a, 0x2f4: 0x2cea, 0x2f5: 0x2d6a,
+ 0x2f6: 0x2dea, 0x2f7: 0x2e6a, 0x2f8: 0x2eea, 0x2f9: 0x2f6a, 0x2fa: 0x2fea,
+ 0x2fc: 0x0014, 0x2fd: 0x306a, 0x2fe: 0x30ea, 0x2ff: 0x316a,
+ // Block 0xc, offset 0x300
+ 0x300: 0x0812, 0x301: 0x0812, 0x302: 0x0812, 0x303: 0x0812, 0x304: 0x0812, 0x305: 0x0812,
+ 0x308: 0x0813, 0x309: 0x0813, 0x30a: 0x0813, 0x30b: 0x0813,
+ 0x30c: 0x0813, 0x30d: 0x0813, 0x310: 0x3b1a, 0x311: 0x0812,
+ 0x312: 0x3bfa, 0x313: 0x0812, 0x314: 0x3d3a, 0x315: 0x0812, 0x316: 0x3e7a, 0x317: 0x0812,
+ 0x319: 0x0813, 0x31b: 0x0813, 0x31d: 0x0813,
+ 0x31f: 0x0813, 0x320: 0x0812, 0x321: 0x0812, 0x322: 0x0812, 0x323: 0x0812,
+ 0x324: 0x0812, 0x325: 0x0812, 0x326: 0x0812, 0x327: 0x0812, 0x328: 0x0813, 0x329: 0x0813,
+ 0x32a: 0x0813, 0x32b: 0x0813, 0x32c: 0x0813, 0x32d: 0x0813, 0x32e: 0x0813, 0x32f: 0x0813,
+ 0x330: 0x9252, 0x331: 0x9252, 0x332: 0x9552, 0x333: 0x9552, 0x334: 0x9852, 0x335: 0x9852,
+ 0x336: 0x9b52, 0x337: 0x9b52, 0x338: 0x9e52, 0x339: 0x9e52, 0x33a: 0xa152, 0x33b: 0xa152,
+ 0x33c: 0x4d52, 0x33d: 0x4d52,
+ // Block 0xd, offset 0x340
+ 0x340: 0x3fba, 0x341: 0x40aa, 0x342: 0x419a, 0x343: 0x428a, 0x344: 0x437a, 0x345: 0x446a,
+ 0x346: 0x455a, 0x347: 0x464a, 0x348: 0x4739, 0x349: 0x4829, 0x34a: 0x4919, 0x34b: 0x4a09,
+ 0x34c: 0x4af9, 0x34d: 0x4be9, 0x34e: 0x4cd9, 0x34f: 0x4dc9, 0x350: 0x4eba, 0x351: 0x4faa,
+ 0x352: 0x509a, 0x353: 0x518a, 0x354: 0x527a, 0x355: 0x536a, 0x356: 0x545a, 0x357: 0x554a,
+ 0x358: 0x5639, 0x359: 0x5729, 0x35a: 0x5819, 0x35b: 0x5909, 0x35c: 0x59f9, 0x35d: 0x5ae9,
+ 0x35e: 0x5bd9, 0x35f: 0x5cc9, 0x360: 0x5dba, 0x361: 0x5eaa, 0x362: 0x5f9a, 0x363: 0x608a,
+ 0x364: 0x617a, 0x365: 0x626a, 0x366: 0x635a, 0x367: 0x644a, 0x368: 0x6539, 0x369: 0x6629,
+ 0x36a: 0x6719, 0x36b: 0x6809, 0x36c: 0x68f9, 0x36d: 0x69e9, 0x36e: 0x6ad9, 0x36f: 0x6bc9,
+ 0x370: 0x0812, 0x371: 0x0812, 0x372: 0x6cba, 0x373: 0x6dca, 0x374: 0x6e9a,
+ 0x376: 0x6f7a, 0x377: 0x705a, 0x378: 0x0813, 0x379: 0x0813, 0x37a: 0x9253, 0x37b: 0x9253,
+ 0x37c: 0x7199, 0x37d: 0x0004, 0x37e: 0x726a, 0x37f: 0x0004,
+ // Block 0xe, offset 0x380
+ 0x380: 0x0004, 0x381: 0x0004, 0x382: 0x72ea, 0x383: 0x73fa, 0x384: 0x74ca,
+ 0x386: 0x75aa, 0x387: 0x768a, 0x388: 0x9553, 0x389: 0x9553, 0x38a: 0x9853, 0x38b: 0x9853,
+ 0x38c: 0x77c9, 0x38d: 0x0004, 0x38e: 0x0004, 0x38f: 0x0004, 0x390: 0x0812, 0x391: 0x0812,
+ 0x392: 0x789a, 0x393: 0x79da, 0x396: 0x7b1a, 0x397: 0x7bfa,
+ 0x398: 0x0813, 0x399: 0x0813, 0x39a: 0x9b53, 0x39b: 0x9b53, 0x39d: 0x0004,
+ 0x39e: 0x0004, 0x39f: 0x0004, 0x3a0: 0x0812, 0x3a1: 0x0812, 0x3a2: 0x7d3a, 0x3a3: 0x7e7a,
+ 0x3a4: 0x7fba, 0x3a5: 0x0912, 0x3a6: 0x809a, 0x3a7: 0x817a, 0x3a8: 0x0813, 0x3a9: 0x0813,
+ 0x3aa: 0xa153, 0x3ab: 0xa153, 0x3ac: 0x0913, 0x3ad: 0x0004, 0x3ae: 0x0004, 0x3af: 0x0004,
+ 0x3b2: 0x82ba, 0x3b3: 0x83ca, 0x3b4: 0x849a,
+ 0x3b6: 0x857a, 0x3b7: 0x865a, 0x3b8: 0x9e53, 0x3b9: 0x9e53, 0x3ba: 0x4d53, 0x3bb: 0x4d53,
+ 0x3bc: 0x8799, 0x3bd: 0x0004, 0x3be: 0x0004,
+ // Block 0xf, offset 0x3c0
+ 0x3c2: 0x0013,
+ 0x3c7: 0x0013, 0x3ca: 0x0012, 0x3cb: 0x0013,
+ 0x3cc: 0x0013, 0x3cd: 0x0013, 0x3ce: 0x0012, 0x3cf: 0x0012, 0x3d0: 0x0013, 0x3d1: 0x0013,
+ 0x3d2: 0x0013, 0x3d3: 0x0012, 0x3d5: 0x0013,
+ 0x3d9: 0x0013, 0x3da: 0x0013, 0x3db: 0x0013, 0x3dc: 0x0013, 0x3dd: 0x0013,
+ 0x3e4: 0x0013, 0x3e6: 0x886b, 0x3e8: 0x0013,
+ 0x3ea: 0x88cb, 0x3eb: 0x890b, 0x3ec: 0x0013, 0x3ed: 0x0013, 0x3ef: 0x0012,
+ 0x3f0: 0x0013, 0x3f1: 0x0013, 0x3f2: 0xa453, 0x3f3: 0x0013, 0x3f4: 0x0012, 0x3f5: 0x0010,
+ 0x3f6: 0x0010, 0x3f7: 0x0010, 0x3f8: 0x0010, 0x3f9: 0x0012,
+ 0x3fc: 0x0012, 0x3fd: 0x0012, 0x3fe: 0x0013, 0x3ff: 0x0013,
+ // Block 0x10, offset 0x400
+ 0x400: 0x1a13, 0x401: 0x1a13, 0x402: 0x1e13, 0x403: 0x1e13, 0x404: 0x1a13, 0x405: 0x1a13,
+ 0x406: 0x2613, 0x407: 0x2613, 0x408: 0x2a13, 0x409: 0x2a13, 0x40a: 0x2e13, 0x40b: 0x2e13,
+ 0x40c: 0x2a13, 0x40d: 0x2a13, 0x40e: 0x2613, 0x40f: 0x2613, 0x410: 0xa752, 0x411: 0xa752,
+ 0x412: 0xaa52, 0x413: 0xaa52, 0x414: 0xad52, 0x415: 0xad52, 0x416: 0xaa52, 0x417: 0xaa52,
+ 0x418: 0xa752, 0x419: 0xa752, 0x41a: 0x1a12, 0x41b: 0x1a12, 0x41c: 0x1e12, 0x41d: 0x1e12,
+ 0x41e: 0x1a12, 0x41f: 0x1a12, 0x420: 0x2612, 0x421: 0x2612, 0x422: 0x2a12, 0x423: 0x2a12,
+ 0x424: 0x2e12, 0x425: 0x2e12, 0x426: 0x2a12, 0x427: 0x2a12, 0x428: 0x2612, 0x429: 0x2612,
+ // Block 0x11, offset 0x440
+ 0x440: 0x6552, 0x441: 0x6552, 0x442: 0x6552, 0x443: 0x6552, 0x444: 0x6552, 0x445: 0x6552,
+ 0x446: 0x6552, 0x447: 0x6552, 0x448: 0x6552, 0x449: 0x6552, 0x44a: 0x6552, 0x44b: 0x6552,
+ 0x44c: 0x6552, 0x44d: 0x6552, 0x44e: 0x6552, 0x44f: 0x6552, 0x450: 0xb052, 0x451: 0xb052,
+ 0x452: 0xb052, 0x453: 0xb052, 0x454: 0xb052, 0x455: 0xb052, 0x456: 0xb052, 0x457: 0xb052,
+ 0x458: 0xb052, 0x459: 0xb052, 0x45a: 0xb052, 0x45b: 0xb052, 0x45c: 0xb052, 0x45d: 0xb052,
+ 0x45e: 0xb052, 0x460: 0x0113, 0x461: 0x0112, 0x462: 0x896b, 0x463: 0x8b53,
+ 0x464: 0x89cb, 0x465: 0x8a2a, 0x466: 0x8a8a, 0x467: 0x0f13, 0x468: 0x0f12, 0x469: 0x0313,
+ 0x46a: 0x0312, 0x46b: 0x0713, 0x46c: 0x0712, 0x46d: 0x8aeb, 0x46e: 0x8b4b, 0x46f: 0x8bab,
+ 0x470: 0x8c0b, 0x471: 0x0012, 0x472: 0x0113, 0x473: 0x0112, 0x474: 0x0012, 0x475: 0x0313,
+ 0x476: 0x0312, 0x477: 0x0012, 0x478: 0x0012, 0x479: 0x0012, 0x47a: 0x0012, 0x47b: 0x0012,
+ 0x47c: 0x0015, 0x47d: 0x0015, 0x47e: 0x8c6b, 0x47f: 0x8ccb,
+ // Block 0x12, offset 0x480
+ 0x480: 0x0113, 0x481: 0x0112, 0x482: 0x0113, 0x483: 0x0112, 0x484: 0x0113, 0x485: 0x0112,
+ 0x486: 0x0113, 0x487: 0x0112, 0x488: 0x0014, 0x489: 0x0014, 0x48a: 0x0014, 0x48b: 0x0713,
+ 0x48c: 0x0712, 0x48d: 0x8d2b, 0x48e: 0x0012, 0x48f: 0x0010, 0x490: 0x0113, 0x491: 0x0112,
+ 0x492: 0x0113, 0x493: 0x0112, 0x494: 0x6552, 0x495: 0x0012, 0x496: 0x0113, 0x497: 0x0112,
+ 0x498: 0x0113, 0x499: 0x0112, 0x49a: 0x0113, 0x49b: 0x0112, 0x49c: 0x0113, 0x49d: 0x0112,
+ 0x49e: 0x0113, 0x49f: 0x0112, 0x4a0: 0x0113, 0x4a1: 0x0112, 0x4a2: 0x0113, 0x4a3: 0x0112,
+ 0x4a4: 0x0113, 0x4a5: 0x0112, 0x4a6: 0x0113, 0x4a7: 0x0112, 0x4a8: 0x0113, 0x4a9: 0x0112,
+ 0x4aa: 0x8d8b, 0x4ab: 0x8deb, 0x4ac: 0x8e4b, 0x4ad: 0x8eab, 0x4ae: 0x8f0b, 0x4af: 0x0012,
+ 0x4b0: 0x8f6b, 0x4b1: 0x8fcb, 0x4b2: 0x902b, 0x4b3: 0xb353, 0x4b4: 0x0113, 0x4b5: 0x0112,
+ 0x4b6: 0x0113, 0x4b7: 0x0112, 0x4b8: 0x0113, 0x4b9: 0x0112, 0x4ba: 0x0113, 0x4bb: 0x0112,
+ 0x4bc: 0x0113, 0x4bd: 0x0112, 0x4be: 0x0113, 0x4bf: 0x0112,
+ // Block 0x13, offset 0x4c0
+ 0x4c0: 0x90ea, 0x4c1: 0x916a, 0x4c2: 0x91ea, 0x4c3: 0x926a, 0x4c4: 0x931a, 0x4c5: 0x93ca,
+ 0x4c6: 0x944a,
+ 0x4d3: 0x94ca, 0x4d4: 0x95aa, 0x4d5: 0x968a, 0x4d6: 0x976a, 0x4d7: 0x984a,
+ 0x4dd: 0x0010,
+ 0x4de: 0x0034, 0x4df: 0x0010, 0x4e0: 0x0010, 0x4e1: 0x0010, 0x4e2: 0x0010, 0x4e3: 0x0010,
+ 0x4e4: 0x0010, 0x4e5: 0x0010, 0x4e6: 0x0010, 0x4e7: 0x0010, 0x4e8: 0x0010,
+ 0x4ea: 0x0010, 0x4eb: 0x0010, 0x4ec: 0x0010, 0x4ed: 0x0010, 0x4ee: 0x0010, 0x4ef: 0x0010,
+ 0x4f0: 0x0010, 0x4f1: 0x0010, 0x4f2: 0x0010, 0x4f3: 0x0010, 0x4f4: 0x0010, 0x4f5: 0x0010,
+ 0x4f6: 0x0010, 0x4f8: 0x0010, 0x4f9: 0x0010, 0x4fa: 0x0010, 0x4fb: 0x0010,
+ 0x4fc: 0x0010, 0x4fe: 0x0010,
+ // Block 0x14, offset 0x500
+ 0x500: 0x2213, 0x501: 0x2213, 0x502: 0x2613, 0x503: 0x2613, 0x504: 0x2213, 0x505: 0x2213,
+ 0x506: 0x2e13, 0x507: 0x2e13, 0x508: 0x2213, 0x509: 0x2213, 0x50a: 0x2613, 0x50b: 0x2613,
+ 0x50c: 0x2213, 0x50d: 0x2213, 0x50e: 0x3e13, 0x50f: 0x3e13, 0x510: 0x2213, 0x511: 0x2213,
+ 0x512: 0x2613, 0x513: 0x2613, 0x514: 0x2213, 0x515: 0x2213, 0x516: 0x2e13, 0x517: 0x2e13,
+ 0x518: 0x2213, 0x519: 0x2213, 0x51a: 0x2613, 0x51b: 0x2613, 0x51c: 0x2213, 0x51d: 0x2213,
+ 0x51e: 0xbc53, 0x51f: 0xbc53, 0x520: 0xbf53, 0x521: 0xbf53, 0x522: 0x2212, 0x523: 0x2212,
+ 0x524: 0x2612, 0x525: 0x2612, 0x526: 0x2212, 0x527: 0x2212, 0x528: 0x2e12, 0x529: 0x2e12,
+ 0x52a: 0x2212, 0x52b: 0x2212, 0x52c: 0x2612, 0x52d: 0x2612, 0x52e: 0x2212, 0x52f: 0x2212,
+ 0x530: 0x3e12, 0x531: 0x3e12, 0x532: 0x2212, 0x533: 0x2212, 0x534: 0x2612, 0x535: 0x2612,
+ 0x536: 0x2212, 0x537: 0x2212, 0x538: 0x2e12, 0x539: 0x2e12, 0x53a: 0x2212, 0x53b: 0x2212,
+ 0x53c: 0x2612, 0x53d: 0x2612, 0x53e: 0x2212, 0x53f: 0x2212,
+ // Block 0x15, offset 0x540
+ 0x542: 0x0010,
+ 0x547: 0x0010, 0x549: 0x0010, 0x54b: 0x0010,
+ 0x54d: 0x0010, 0x54e: 0x0010, 0x54f: 0x0010, 0x551: 0x0010,
+ 0x552: 0x0010, 0x554: 0x0010, 0x557: 0x0010,
+ 0x559: 0x0010, 0x55b: 0x0010, 0x55d: 0x0010,
+ 0x55f: 0x0010, 0x561: 0x0010, 0x562: 0x0010,
+ 0x564: 0x0010, 0x567: 0x0010, 0x568: 0x0010, 0x569: 0x0010,
+ 0x56a: 0x0010, 0x56c: 0x0010, 0x56d: 0x0010, 0x56e: 0x0010, 0x56f: 0x0010,
+ 0x570: 0x0010, 0x571: 0x0010, 0x572: 0x0010, 0x574: 0x0010, 0x575: 0x0010,
+ 0x576: 0x0010, 0x577: 0x0010, 0x579: 0x0010, 0x57a: 0x0010, 0x57b: 0x0010,
+ 0x57c: 0x0010, 0x57e: 0x0010,
+}
+
+// caseIndex: 25 blocks, 1600 entries, 3200 bytes
+// Block 0 is the zero block.
+var caseIndex = [1600]uint16{
+ // Block 0x0, offset 0x0
+ // Block 0x1, offset 0x40
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc2: 0x14, 0xc3: 0x15, 0xc4: 0x16, 0xc5: 0x17, 0xc6: 0x01, 0xc7: 0x02,
+ 0xc8: 0x18, 0xc9: 0x03, 0xca: 0x04, 0xcb: 0x19, 0xcc: 0x1a, 0xcd: 0x05, 0xce: 0x06, 0xcf: 0x07,
+ 0xd0: 0x1b, 0xd1: 0x1c, 0xd2: 0x1d, 0xd3: 0x1e, 0xd4: 0x1f, 0xd5: 0x20, 0xd6: 0x08, 0xd7: 0x21,
+ 0xd8: 0x22, 0xd9: 0x23, 0xda: 0x24, 0xdb: 0x25, 0xdc: 0x26, 0xdd: 0x27, 0xde: 0x28, 0xdf: 0x29,
+ 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05,
+ 0xea: 0x06, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x08, 0xef: 0x09,
+ 0xf0: 0x14, 0xf3: 0x16,
+ // Block 0x4, offset 0x100
+ 0x120: 0x2a, 0x121: 0x2b, 0x122: 0x2c, 0x123: 0x2d, 0x124: 0x2e, 0x125: 0x2f, 0x126: 0x30, 0x127: 0x31,
+ 0x128: 0x32, 0x129: 0x33, 0x12a: 0x34, 0x12b: 0x35, 0x12c: 0x36, 0x12d: 0x37, 0x12e: 0x38, 0x12f: 0x39,
+ 0x130: 0x3a, 0x131: 0x3b, 0x132: 0x3c, 0x133: 0x3d, 0x134: 0x3e, 0x135: 0x3f, 0x136: 0x40, 0x137: 0x41,
+ 0x138: 0x42, 0x139: 0x43, 0x13a: 0x44, 0x13b: 0x45, 0x13c: 0x46, 0x13d: 0x47, 0x13e: 0x48, 0x13f: 0x49,
+ // Block 0x5, offset 0x140
+ 0x140: 0x4a, 0x141: 0x4b, 0x142: 0x4c, 0x143: 0x09, 0x144: 0x24, 0x145: 0x24, 0x146: 0x24, 0x147: 0x24,
+ 0x148: 0x24, 0x149: 0x4d, 0x14a: 0x4e, 0x14b: 0x4f, 0x14c: 0x50, 0x14d: 0x51, 0x14e: 0x52, 0x14f: 0x53,
+ 0x150: 0x54, 0x151: 0x24, 0x152: 0x24, 0x153: 0x24, 0x154: 0x24, 0x155: 0x24, 0x156: 0x24, 0x157: 0x24,
+ 0x158: 0x24, 0x159: 0x55, 0x15a: 0x56, 0x15b: 0x57, 0x15c: 0x58, 0x15d: 0x59, 0x15e: 0x5a, 0x15f: 0x5b,
+ 0x160: 0x5c, 0x161: 0x5d, 0x162: 0x5e, 0x163: 0x5f, 0x164: 0x60, 0x165: 0x61, 0x167: 0x62,
+ 0x168: 0x63, 0x169: 0x64, 0x16a: 0x65, 0x16c: 0x66, 0x16d: 0x67, 0x16e: 0x68, 0x16f: 0x69,
+ 0x170: 0x6a, 0x171: 0x6b, 0x172: 0x6c, 0x173: 0x6d, 0x174: 0x6e, 0x175: 0x6f, 0x176: 0x70, 0x177: 0x71,
+ 0x178: 0x72, 0x179: 0x72, 0x17a: 0x73, 0x17b: 0x72, 0x17c: 0x74, 0x17d: 0x0a, 0x17e: 0x0b, 0x17f: 0x0c,
+ // Block 0x6, offset 0x180
+ 0x180: 0x75, 0x181: 0x76, 0x182: 0x77, 0x183: 0x78, 0x184: 0x0d, 0x185: 0x79, 0x186: 0x7a,
+ 0x192: 0x7b, 0x193: 0x0e,
+ 0x1b0: 0x7c, 0x1b1: 0x0f, 0x1b2: 0x72, 0x1b3: 0x7d, 0x1b4: 0x7e, 0x1b5: 0x7f, 0x1b6: 0x80, 0x1b7: 0x81,
+ 0x1b8: 0x82,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x83, 0x1c2: 0x84, 0x1c3: 0x85, 0x1c4: 0x86, 0x1c5: 0x24, 0x1c6: 0x87,
+ // Block 0x8, offset 0x200
+ 0x200: 0x88, 0x201: 0x24, 0x202: 0x24, 0x203: 0x24, 0x204: 0x24, 0x205: 0x24, 0x206: 0x24, 0x207: 0x24,
+ 0x208: 0x24, 0x209: 0x24, 0x20a: 0x24, 0x20b: 0x24, 0x20c: 0x24, 0x20d: 0x24, 0x20e: 0x24, 0x20f: 0x24,
+ 0x210: 0x24, 0x211: 0x24, 0x212: 0x89, 0x213: 0x8a, 0x214: 0x24, 0x215: 0x24, 0x216: 0x24, 0x217: 0x24,
+ 0x218: 0x8b, 0x219: 0x8c, 0x21a: 0x8d, 0x21b: 0x8e, 0x21c: 0x8f, 0x21d: 0x90, 0x21e: 0x10, 0x21f: 0x91,
+ 0x220: 0x92, 0x221: 0x93, 0x222: 0x24, 0x223: 0x94, 0x224: 0x95, 0x225: 0x96, 0x226: 0x97, 0x227: 0x98,
+ 0x228: 0x99, 0x229: 0x9a, 0x22a: 0x9b, 0x22b: 0x9c, 0x22c: 0x9d, 0x22d: 0x9e, 0x22e: 0x9f, 0x22f: 0xa0,
+ 0x230: 0x24, 0x231: 0x24, 0x232: 0x24, 0x233: 0x24, 0x234: 0x24, 0x235: 0x24, 0x236: 0x24, 0x237: 0x24,
+ 0x238: 0x24, 0x239: 0x24, 0x23a: 0x24, 0x23b: 0x24, 0x23c: 0x24, 0x23d: 0x24, 0x23e: 0x24, 0x23f: 0x24,
+ // Block 0x9, offset 0x240
+ 0x240: 0x24, 0x241: 0x24, 0x242: 0x24, 0x243: 0x24, 0x244: 0x24, 0x245: 0x24, 0x246: 0x24, 0x247: 0x24,
+ 0x248: 0x24, 0x249: 0x24, 0x24a: 0x24, 0x24b: 0x24, 0x24c: 0x24, 0x24d: 0x24, 0x24e: 0x24, 0x24f: 0x24,
+ 0x250: 0x24, 0x251: 0x24, 0x252: 0x24, 0x253: 0x24, 0x254: 0x24, 0x255: 0x24, 0x256: 0x24, 0x257: 0x24,
+ 0x258: 0x24, 0x259: 0x24, 0x25a: 0x24, 0x25b: 0x24, 0x25c: 0x24, 0x25d: 0x24, 0x25e: 0x24, 0x25f: 0x24,
+ 0x260: 0x24, 0x261: 0x24, 0x262: 0x24, 0x263: 0x24, 0x264: 0x24, 0x265: 0x24, 0x266: 0x24, 0x267: 0x24,
+ 0x268: 0x24, 0x269: 0x24, 0x26a: 0x24, 0x26b: 0x24, 0x26c: 0x24, 0x26d: 0x24, 0x26e: 0x24, 0x26f: 0x24,
+ 0x270: 0x24, 0x271: 0x24, 0x272: 0x24, 0x273: 0x24, 0x274: 0x24, 0x275: 0x24, 0x276: 0x24, 0x277: 0x24,
+ 0x278: 0x24, 0x279: 0x24, 0x27a: 0x24, 0x27b: 0x24, 0x27c: 0x24, 0x27d: 0x24, 0x27e: 0x24, 0x27f: 0x24,
+ // Block 0xa, offset 0x280
+ 0x280: 0x24, 0x281: 0x24, 0x282: 0x24, 0x283: 0x24, 0x284: 0x24, 0x285: 0x24, 0x286: 0x24, 0x287: 0x24,
+ 0x288: 0x24, 0x289: 0x24, 0x28a: 0x24, 0x28b: 0x24, 0x28c: 0x24, 0x28d: 0x24, 0x28e: 0x24, 0x28f: 0x24,
+ 0x290: 0x24, 0x291: 0x24, 0x292: 0x24, 0x293: 0x24, 0x294: 0x24, 0x295: 0x24, 0x296: 0x24, 0x297: 0x24,
+ 0x298: 0x24, 0x299: 0x24, 0x29a: 0x24, 0x29b: 0x24, 0x29c: 0x24, 0x29d: 0x24, 0x29e: 0xa1, 0x29f: 0xa2,
+ // Block 0xb, offset 0x2c0
+ 0x2ec: 0x11, 0x2ed: 0xa3, 0x2ee: 0xa4, 0x2ef: 0xa5,
+ 0x2f0: 0x24, 0x2f1: 0x24, 0x2f2: 0x24, 0x2f3: 0x24, 0x2f4: 0xa6, 0x2f5: 0xa7, 0x2f6: 0xa8, 0x2f7: 0xa9,
+ 0x2f8: 0xaa, 0x2f9: 0xab, 0x2fa: 0x24, 0x2fb: 0xac, 0x2fc: 0xad, 0x2fd: 0xae, 0x2fe: 0xaf, 0x2ff: 0xb0,
+ // Block 0xc, offset 0x300
+ 0x300: 0xb1, 0x301: 0xb2, 0x302: 0x24, 0x303: 0xb3, 0x305: 0xb4, 0x307: 0xb5,
+ 0x30a: 0xb6, 0x30b: 0xb7, 0x30c: 0xb8, 0x30d: 0xb9, 0x30e: 0xba, 0x30f: 0xbb,
+ 0x310: 0xbc, 0x311: 0xbd, 0x312: 0xbe, 0x313: 0xbf, 0x314: 0xc0, 0x315: 0xc1,
+ 0x318: 0x24, 0x319: 0x24, 0x31a: 0x24, 0x31b: 0x24, 0x31c: 0xc2, 0x31d: 0xc3,
+ 0x320: 0xc4, 0x321: 0xc5, 0x322: 0xc6, 0x323: 0xc7, 0x324: 0xc8, 0x326: 0xc9,
+ 0x328: 0xca, 0x329: 0xcb, 0x32a: 0xcc, 0x32b: 0xcd, 0x32c: 0x5f, 0x32d: 0xce, 0x32e: 0xcf,
+ 0x330: 0x24, 0x331: 0xd0, 0x332: 0xd1, 0x333: 0xd2, 0x334: 0xd3,
+ 0x33c: 0xd4, 0x33d: 0xd5, 0x33f: 0xd6,
+ // Block 0xd, offset 0x340
+ 0x340: 0xd7, 0x341: 0xd8, 0x342: 0xd9, 0x343: 0xda, 0x344: 0xdb, 0x345: 0xdc, 0x346: 0xdd, 0x347: 0xde,
+ 0x348: 0xdf, 0x34a: 0xe0, 0x34b: 0xe1, 0x34c: 0xe2, 0x34d: 0xe3,
+ 0x350: 0xe4, 0x351: 0xe5, 0x352: 0xe6, 0x353: 0xe7, 0x356: 0xe8, 0x357: 0xe9,
+ 0x358: 0xea, 0x359: 0xeb, 0x35a: 0xec, 0x35b: 0xed, 0x35c: 0xee,
+ 0x360: 0xef, 0x362: 0xf0, 0x363: 0xf1, 0x366: 0xf2, 0x367: 0xf3,
+ 0x368: 0xf4, 0x369: 0xf5, 0x36a: 0xf6, 0x36b: 0xf7,
+ 0x370: 0xf8, 0x371: 0xf9, 0x372: 0xfa, 0x374: 0xfb, 0x375: 0xfc, 0x376: 0xfd,
+ 0x37b: 0xfe,
+ // Block 0xe, offset 0x380
+ 0x380: 0x24, 0x381: 0x24, 0x382: 0x24, 0x383: 0x24, 0x384: 0x24, 0x385: 0x24, 0x386: 0x24, 0x387: 0x24,
+ 0x388: 0x24, 0x389: 0x24, 0x38a: 0x24, 0x38b: 0x24, 0x38c: 0x24, 0x38d: 0x24, 0x38e: 0xff,
+ 0x390: 0x24, 0x391: 0x100, 0x392: 0x24, 0x393: 0x24, 0x394: 0x24, 0x395: 0x101,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x24, 0x3c1: 0x24, 0x3c2: 0x24, 0x3c3: 0x24, 0x3c4: 0x24, 0x3c5: 0x24, 0x3c6: 0x24, 0x3c7: 0x24,
+ 0x3c8: 0x24, 0x3c9: 0x24, 0x3ca: 0x24, 0x3cb: 0x24, 0x3cc: 0x24, 0x3cd: 0x24, 0x3ce: 0x24, 0x3cf: 0x24,
+ 0x3d0: 0x102,
+ // Block 0x10, offset 0x400
+ 0x410: 0x24, 0x411: 0x24, 0x412: 0x24, 0x413: 0x24, 0x414: 0x24, 0x415: 0x24, 0x416: 0x24, 0x417: 0x24,
+ 0x418: 0x24, 0x419: 0x103,
+ // Block 0x11, offset 0x440
+ 0x460: 0x24, 0x461: 0x24, 0x462: 0x24, 0x463: 0x24, 0x464: 0x24, 0x465: 0x24, 0x466: 0x24, 0x467: 0x24,
+ 0x468: 0xf7, 0x469: 0x104, 0x46b: 0x105, 0x46c: 0x106, 0x46d: 0x107, 0x46e: 0x108,
+ 0x479: 0x109, 0x47c: 0x24, 0x47d: 0x10a, 0x47e: 0x10b, 0x47f: 0x10c,
+ // Block 0x12, offset 0x480
+ 0x4b0: 0x24, 0x4b1: 0x10d, 0x4b2: 0x10e,
+ // Block 0x13, offset 0x4c0
+ 0x4c5: 0x10f, 0x4c6: 0x110,
+ 0x4c9: 0x111,
+ 0x4d0: 0x112, 0x4d1: 0x113, 0x4d2: 0x114, 0x4d3: 0x115, 0x4d4: 0x116, 0x4d5: 0x117, 0x4d6: 0x118, 0x4d7: 0x119,
+ 0x4d8: 0x11a, 0x4d9: 0x11b, 0x4da: 0x11c, 0x4db: 0x11d, 0x4dc: 0x11e, 0x4dd: 0x11f, 0x4de: 0x120, 0x4df: 0x121,
+ 0x4e8: 0x122, 0x4e9: 0x123, 0x4ea: 0x124,
+ // Block 0x14, offset 0x500
+ 0x500: 0x125, 0x504: 0x126, 0x505: 0x127,
+ 0x50b: 0x128,
+ 0x520: 0x24, 0x521: 0x24, 0x522: 0x24, 0x523: 0x129, 0x524: 0x12, 0x525: 0x12a,
+ 0x538: 0x12b, 0x539: 0x13, 0x53a: 0x12c,
+ // Block 0x15, offset 0x540
+ 0x544: 0x12d, 0x545: 0x12e, 0x546: 0x12f,
+ 0x54f: 0x130,
+ // Block 0x16, offset 0x580
+ 0x590: 0x0a, 0x591: 0x0b, 0x592: 0x0c, 0x593: 0x0d, 0x594: 0x0e, 0x596: 0x0f,
+ 0x59b: 0x10, 0x59d: 0x11, 0x59e: 0x12, 0x59f: 0x13,
+ // Block 0x17, offset 0x5c0
+ 0x5c0: 0x131, 0x5c1: 0x132, 0x5c4: 0x132, 0x5c5: 0x132, 0x5c6: 0x132, 0x5c7: 0x133,
+ // Block 0x18, offset 0x600
+ 0x620: 0x15,
+}
+
+// sparseOffsets: 289 entries, 578 bytes
+var sparseOffsets = []uint16{0x0, 0x9, 0xf, 0x18, 0x24, 0x2e, 0x35, 0x38, 0x3c, 0x3f, 0x43, 0x4d, 0x4f, 0x57, 0x5e, 0x63, 0x71, 0x72, 0x80, 0x8f, 0x99, 0x9c, 0xa3, 0xab, 0xae, 0xb0, 0xbf, 0xc5, 0xd3, 0xde, 0xeb, 0xf6, 0x102, 0x10c, 0x118, 0x123, 0x12f, 0x13b, 0x143, 0x14c, 0x156, 0x161, 0x16d, 0x174, 0x17f, 0x184, 0x18c, 0x18f, 0x194, 0x198, 0x19c, 0x1a3, 0x1ac, 0x1b4, 0x1b5, 0x1be, 0x1c5, 0x1cd, 0x1d3, 0x1d8, 0x1dc, 0x1df, 0x1e1, 0x1e4, 0x1e9, 0x1ea, 0x1ec, 0x1ee, 0x1f0, 0x1f7, 0x1fc, 0x200, 0x209, 0x20c, 0x20f, 0x215, 0x216, 0x221, 0x222, 0x223, 0x228, 0x235, 0x23d, 0x245, 0x24e, 0x257, 0x260, 0x265, 0x268, 0x273, 0x281, 0x283, 0x28a, 0x28e, 0x29a, 0x29b, 0x2a6, 0x2ae, 0x2b6, 0x2bc, 0x2bd, 0x2cb, 0x2d0, 0x2d3, 0x2d8, 0x2dc, 0x2e2, 0x2e7, 0x2ea, 0x2ef, 0x2f4, 0x2f5, 0x2fb, 0x2fd, 0x2fe, 0x300, 0x302, 0x305, 0x306, 0x308, 0x30b, 0x311, 0x315, 0x317, 0x31c, 0x323, 0x32b, 0x334, 0x335, 0x33e, 0x342, 0x347, 0x34f, 0x355, 0x35b, 0x365, 0x36a, 0x373, 0x379, 0x380, 0x384, 0x38c, 0x38e, 0x390, 0x393, 0x395, 0x397, 0x398, 0x399, 0x39b, 0x39d, 0x3a3, 0x3a8, 0x3aa, 0x3b1, 0x3b4, 0x3b6, 0x3bc, 0x3c1, 0x3c3, 0x3c4, 0x3c5, 0x3c6, 0x3c8, 0x3ca, 0x3cc, 0x3cf, 0x3d1, 0x3d4, 0x3dc, 0x3df, 0x3e3, 0x3eb, 0x3ed, 0x3ee, 0x3ef, 0x3f1, 0x3f7, 0x3f9, 0x3fa, 0x3fc, 0x3fe, 0x400, 0x40d, 0x40e, 0x40f, 0x413, 0x415, 0x416, 0x417, 0x418, 0x419, 0x41c, 0x41f, 0x425, 0x426, 0x42a, 0x42e, 0x434, 0x437, 0x43e, 0x442, 0x446, 0x44d, 0x456, 0x45c, 0x462, 0x46c, 0x476, 0x478, 0x481, 0x487, 0x48d, 0x493, 0x496, 0x49c, 0x49f, 0x4a8, 0x4a9, 0x4b0, 0x4b4, 0x4b5, 0x4b8, 0x4ba, 0x4c1, 0x4c9, 0x4cf, 0x4d5, 0x4d6, 0x4dc, 0x4df, 0x4e7, 0x4ee, 0x4f8, 0x500, 0x503, 0x504, 0x505, 0x506, 0x508, 0x509, 0x50b, 0x50d, 0x50f, 0x513, 0x514, 0x516, 0x519, 0x51b, 0x51d, 0x51f, 0x524, 0x529, 0x52d, 0x52e, 0x531, 0x535, 0x540, 0x544, 0x54c, 0x551, 0x555, 0x558, 0x55c, 0x55f, 0x562, 0x567, 0x56b, 0x56f, 0x573, 0x577, 0x579, 0x57b, 0x57e, 0x583, 0x586, 0x588, 0x58b, 0x58d, 0x593, 0x59c, 0x5a1, 0x5a2, 0x5a5, 0x5a6, 0x5a7, 0x5a9, 0x5aa, 0x5ab}
+
+// sparseValues: 1451 entries, 5804 bytes
+var sparseValues = [1451]valueRange{
+ // Block 0x0, offset 0x0
+ {value: 0x0004, lo: 0xa8, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xaa},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0004, lo: 0xaf, hi: 0xaf},
+ {value: 0x0004, lo: 0xb4, hi: 0xb4},
+ {value: 0x001a, lo: 0xb5, hi: 0xb5},
+ {value: 0x0054, lo: 0xb7, hi: 0xb7},
+ {value: 0x0004, lo: 0xb8, hi: 0xb8},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ // Block 0x1, offset 0x9
+ {value: 0x2013, lo: 0x80, hi: 0x96},
+ {value: 0x2013, lo: 0x98, hi: 0x9e},
+ {value: 0x009a, lo: 0x9f, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xb6},
+ {value: 0x2012, lo: 0xb8, hi: 0xbe},
+ {value: 0x0252, lo: 0xbf, hi: 0xbf},
+ // Block 0x2, offset 0xf
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x011b, lo: 0xb0, hi: 0xb0},
+ {value: 0x019a, lo: 0xb1, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb7},
+ {value: 0x0012, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x0553, lo: 0xbf, hi: 0xbf},
+ // Block 0x3, offset 0x18
+ {value: 0x0552, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x01da, lo: 0x89, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xb7},
+ {value: 0x0253, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x028a, lo: 0xbf, hi: 0xbf},
+ // Block 0x4, offset 0x24
+ {value: 0x0117, lo: 0x80, hi: 0x9f},
+ {value: 0x2f53, lo: 0xa0, hi: 0xa0},
+ {value: 0x0012, lo: 0xa1, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xb3},
+ {value: 0x0012, lo: 0xb4, hi: 0xb9},
+ {value: 0x090b, lo: 0xba, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x2953, lo: 0xbd, hi: 0xbd},
+ {value: 0x098b, lo: 0xbe, hi: 0xbe},
+ {value: 0x0a0a, lo: 0xbf, hi: 0xbf},
+ // Block 0x5, offset 0x2e
+ {value: 0x0015, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x97},
+ {value: 0x0004, lo: 0x98, hi: 0x9d},
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0015, lo: 0xa0, hi: 0xa4},
+ {value: 0x0004, lo: 0xa5, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xbf},
+ // Block 0x6, offset 0x35
+ {value: 0x0024, lo: 0x80, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbf},
+ // Block 0x7, offset 0x38
+ {value: 0x6553, lo: 0x80, hi: 0x8f},
+ {value: 0x2013, lo: 0x90, hi: 0x9f},
+ {value: 0x5f53, lo: 0xa0, hi: 0xaf},
+ {value: 0x2012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8, offset 0x3c
+ {value: 0x5f52, lo: 0x80, hi: 0x8f},
+ {value: 0x6552, lo: 0x90, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x9, offset 0x3f
+ {value: 0x0117, lo: 0x80, hi: 0x81},
+ {value: 0x0024, lo: 0x83, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xbf},
+ // Block 0xa, offset 0x43
+ {value: 0x0f13, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0716, lo: 0x8b, hi: 0x8c},
+ {value: 0x0316, lo: 0x8d, hi: 0x8e},
+ {value: 0x0f12, lo: 0x8f, hi: 0x8f},
+ {value: 0x0117, lo: 0x90, hi: 0xbf},
+ // Block 0xb, offset 0x4d
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x6553, lo: 0xb1, hi: 0xbf},
+ // Block 0xc, offset 0x4f
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6853, lo: 0x90, hi: 0x96},
+ {value: 0x0014, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9b, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0xa0, hi: 0xa0},
+ {value: 0x6552, lo: 0xa1, hi: 0xaf},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0xd, offset 0x57
+ {value: 0x0034, lo: 0x81, hi: 0x82},
+ {value: 0x0024, lo: 0x84, hi: 0x84},
+ {value: 0x0034, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xaa},
+ {value: 0x0010, lo: 0xaf, hi: 0xb3},
+ {value: 0x0054, lo: 0xb4, hi: 0xb4},
+ // Block 0xe, offset 0x5e
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0024, lo: 0x90, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0014, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xf, offset 0x63
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9c},
+ {value: 0x0024, lo: 0x9d, hi: 0x9e},
+ {value: 0x0034, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x10, offset 0x71
+ {value: 0x0010, lo: 0x80, hi: 0xbf},
+ // Block 0x11, offset 0x72
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0024, lo: 0x9f, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x12, offset 0x80
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0034, lo: 0xb1, hi: 0xb1},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0024, lo: 0xbf, hi: 0xbf},
+ // Block 0x13, offset 0x8f
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0024, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x88},
+ {value: 0x0024, lo: 0x89, hi: 0x8a},
+ {value: 0x0010, lo: 0x8d, hi: 0xbf},
+ // Block 0x14, offset 0x99
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x15, offset 0x9c
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xb1},
+ {value: 0x0034, lo: 0xb2, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0x16, offset 0xa3
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x99},
+ {value: 0x0014, lo: 0x9a, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0xa3},
+ {value: 0x0014, lo: 0xa4, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xad},
+ // Block 0x17, offset 0xab
+ {value: 0x0010, lo: 0x80, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0xa0, hi: 0xaa},
+ // Block 0x18, offset 0xae
+ {value: 0x0010, lo: 0xa0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbd},
+ // Block 0x19, offset 0xb0
+ {value: 0x0034, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0024, lo: 0xaa, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbf},
+ // Block 0x1a, offset 0xbf
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1b, offset 0xc5
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0x1c, offset 0xd3
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb6, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1d, offset 0xde
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xb1},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ // Block 0x1e, offset 0xeb
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x1f, offset 0xf6
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x99, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x20, offset 0x102
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x21, offset 0x10c
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x85},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xbf},
+ // Block 0x22, offset 0x118
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x23, offset 0x123
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x24, offset 0x12f
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0010, lo: 0xa8, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x25, offset 0x13b
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x26, offset 0x143
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb9},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbf},
+ // Block 0x27, offset 0x14c
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x88},
+ {value: 0x0014, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x28, offset 0x156
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x29, offset 0x161
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb2},
+ // Block 0x2a, offset 0x16d
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x2b, offset 0x174
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x94, hi: 0x97},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xba, hi: 0xbf},
+ // Block 0x2c, offset 0x17f
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x96},
+ {value: 0x0010, lo: 0x9a, hi: 0xb1},
+ {value: 0x0010, lo: 0xb3, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x2d, offset 0x184
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x94},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9f},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ // Block 0x2e, offset 0x18c
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ // Block 0x2f, offset 0x18f
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x30, offset 0x194
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ // Block 0x31, offset 0x198
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x32, offset 0x19c
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0034, lo: 0x98, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0034, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x33, offset 0x1a3
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xac},
+ {value: 0x0034, lo: 0xb1, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xba, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x34, offset 0x1ac
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0024, lo: 0x82, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x86, hi: 0x87},
+ {value: 0x0010, lo: 0x88, hi: 0x8c},
+ {value: 0x0014, lo: 0x8d, hi: 0x97},
+ {value: 0x0014, lo: 0x99, hi: 0xbc},
+ // Block 0x35, offset 0x1b4
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ // Block 0x36, offset 0x1b5
+ {value: 0x0010, lo: 0xab, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbe},
+ // Block 0x37, offset 0x1be
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x96, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x99},
+ {value: 0x0014, lo: 0x9e, hi: 0xa0},
+ {value: 0x0010, lo: 0xa2, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xad},
+ {value: 0x0014, lo: 0xb1, hi: 0xb4},
+ // Block 0x38, offset 0x1c5
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x6c53, lo: 0xa0, hi: 0xbf},
+ // Block 0x39, offset 0x1cd
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x9a, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x3a, offset 0x1d3
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x3b, offset 0x1d8
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x82, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3c, offset 0x1dc
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3d, offset 0x1df
+ {value: 0x0010, lo: 0x80, hi: 0x9a},
+ {value: 0x0024, lo: 0x9d, hi: 0x9f},
+ // Block 0x3e, offset 0x1e1
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x7453, lo: 0xa0, hi: 0xaf},
+ {value: 0x7853, lo: 0xb0, hi: 0xbf},
+ // Block 0x3f, offset 0x1e4
+ {value: 0x7c53, lo: 0x80, hi: 0x8f},
+ {value: 0x8053, lo: 0x90, hi: 0x9f},
+ {value: 0x7c53, lo: 0xa0, hi: 0xaf},
+ {value: 0x0813, lo: 0xb0, hi: 0xb5},
+ {value: 0x0892, lo: 0xb8, hi: 0xbd},
+ // Block 0x40, offset 0x1e9
+ {value: 0x0010, lo: 0x81, hi: 0xbf},
+ // Block 0x41, offset 0x1ea
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0010, lo: 0xaf, hi: 0xbf},
+ // Block 0x42, offset 0x1ec
+ {value: 0x0010, lo: 0x81, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x43, offset 0x1ee
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb8},
+ // Block 0x44, offset 0x1f0
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0034, lo: 0x94, hi: 0x94},
+ {value: 0x0010, lo: 0xa0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ // Block 0x45, offset 0x1f7
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xac},
+ {value: 0x0010, lo: 0xae, hi: 0xb0},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ // Block 0x46, offset 0x1fc
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x47, offset 0x200
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x89, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0014, lo: 0x93, hi: 0x93},
+ {value: 0x0004, lo: 0x97, hi: 0x97},
+ {value: 0x0024, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0x48, offset 0x209
+ {value: 0x0014, lo: 0x8b, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x49, offset 0x20c
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb8},
+ // Block 0x4a, offset 0x20f
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x4b, offset 0x215
+ {value: 0x0010, lo: 0x80, hi: 0xb5},
+ // Block 0x4c, offset 0x216
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbb},
+ // Block 0x4d, offset 0x221
+ {value: 0x0010, lo: 0x86, hi: 0x8f},
+ // Block 0x4e, offset 0x222
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x4f, offset 0x223
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ // Block 0x50, offset 0x228
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x9e},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xac},
+ {value: 0x0010, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xbc},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x51, offset 0x235
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xa7, hi: 0xa7},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ {value: 0x0034, lo: 0xb5, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbc},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0x52, offset 0x23d
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x53, offset 0x245
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0030, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xab, hi: 0xab},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ {value: 0x0024, lo: 0xad, hi: 0xb3},
+ // Block 0x54, offset 0x24e
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0030, lo: 0xaa, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbf},
+ // Block 0x55, offset 0x257
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0030, lo: 0xb2, hi: 0xb3},
+ // Block 0x56, offset 0x260
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0x57, offset 0x265
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8d, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x58, offset 0x268
+ {value: 0x31ea, lo: 0x80, hi: 0x80},
+ {value: 0x326a, lo: 0x81, hi: 0x81},
+ {value: 0x32ea, lo: 0x82, hi: 0x82},
+ {value: 0x336a, lo: 0x83, hi: 0x83},
+ {value: 0x33ea, lo: 0x84, hi: 0x84},
+ {value: 0x346a, lo: 0x85, hi: 0x85},
+ {value: 0x34ea, lo: 0x86, hi: 0x86},
+ {value: 0x356a, lo: 0x87, hi: 0x87},
+ {value: 0x35ea, lo: 0x88, hi: 0x88},
+ {value: 0x8353, lo: 0x90, hi: 0xba},
+ {value: 0x8353, lo: 0xbd, hi: 0xbf},
+ // Block 0x59, offset 0x273
+ {value: 0x0024, lo: 0x90, hi: 0x92},
+ {value: 0x0034, lo: 0x94, hi: 0x99},
+ {value: 0x0024, lo: 0x9a, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9f},
+ {value: 0x0024, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xb3},
+ {value: 0x0024, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb7},
+ {value: 0x0024, lo: 0xb8, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xba},
+ // Block 0x5a, offset 0x281
+ {value: 0x0012, lo: 0x80, hi: 0xab},
+ {value: 0x0015, lo: 0xac, hi: 0xbf},
+ // Block 0x5b, offset 0x283
+ {value: 0x0015, lo: 0x80, hi: 0xaa},
+ {value: 0x0012, lo: 0xab, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb8},
+ {value: 0x8752, lo: 0xb9, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbc},
+ {value: 0x8b52, lo: 0xbd, hi: 0xbd},
+ {value: 0x0012, lo: 0xbe, hi: 0xbf},
+ // Block 0x5c, offset 0x28a
+ {value: 0x0012, lo: 0x80, hi: 0x8d},
+ {value: 0x8f52, lo: 0x8e, hi: 0x8e},
+ {value: 0x0012, lo: 0x8f, hi: 0x9a},
+ {value: 0x0015, lo: 0x9b, hi: 0xbf},
+ // Block 0x5d, offset 0x28e
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0024, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb9},
+ {value: 0x0024, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbd},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x5e, offset 0x29a
+ {value: 0x0117, lo: 0x80, hi: 0xbf},
+ // Block 0x5f, offset 0x29b
+ {value: 0x0117, lo: 0x80, hi: 0x95},
+ {value: 0x369a, lo: 0x96, hi: 0x96},
+ {value: 0x374a, lo: 0x97, hi: 0x97},
+ {value: 0x37fa, lo: 0x98, hi: 0x98},
+ {value: 0x38aa, lo: 0x99, hi: 0x99},
+ {value: 0x395a, lo: 0x9a, hi: 0x9a},
+ {value: 0x3a0a, lo: 0x9b, hi: 0x9b},
+ {value: 0x0012, lo: 0x9c, hi: 0x9d},
+ {value: 0x3abb, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0x9f, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x60, offset 0x2a6
+ {value: 0x0812, lo: 0x80, hi: 0x87},
+ {value: 0x0813, lo: 0x88, hi: 0x8f},
+ {value: 0x0812, lo: 0x90, hi: 0x95},
+ {value: 0x0813, lo: 0x98, hi: 0x9d},
+ {value: 0x0812, lo: 0xa0, hi: 0xa7},
+ {value: 0x0813, lo: 0xa8, hi: 0xaf},
+ {value: 0x0812, lo: 0xb0, hi: 0xb7},
+ {value: 0x0813, lo: 0xb8, hi: 0xbf},
+ // Block 0x61, offset 0x2ae
+ {value: 0x0004, lo: 0x8b, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8f},
+ {value: 0x0054, lo: 0x98, hi: 0x99},
+ {value: 0x0054, lo: 0xa4, hi: 0xa4},
+ {value: 0x0054, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xaa, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xaf},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x62, offset 0x2b6
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x94, hi: 0x94},
+ {value: 0x0014, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa6, hi: 0xaf},
+ {value: 0x0015, lo: 0xb1, hi: 0xb1},
+ {value: 0x0015, lo: 0xbf, hi: 0xbf},
+ // Block 0x63, offset 0x2bc
+ {value: 0x0015, lo: 0x90, hi: 0x9c},
+ // Block 0x64, offset 0x2bd
+ {value: 0x0024, lo: 0x90, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0xa0},
+ {value: 0x0024, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa4},
+ {value: 0x0034, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ // Block 0x65, offset 0x2cb
+ {value: 0x0016, lo: 0x85, hi: 0x86},
+ {value: 0x0012, lo: 0x87, hi: 0x89},
+ {value: 0xa452, lo: 0x8e, hi: 0x8e},
+ {value: 0x1013, lo: 0xa0, hi: 0xaf},
+ {value: 0x1012, lo: 0xb0, hi: 0xbf},
+ // Block 0x66, offset 0x2d0
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x88},
+ // Block 0x67, offset 0x2d3
+ {value: 0xa753, lo: 0xb6, hi: 0xb7},
+ {value: 0xaa53, lo: 0xb8, hi: 0xb9},
+ {value: 0xad53, lo: 0xba, hi: 0xbb},
+ {value: 0xaa53, lo: 0xbc, hi: 0xbd},
+ {value: 0xa753, lo: 0xbe, hi: 0xbf},
+ // Block 0x68, offset 0x2d8
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6553, lo: 0x90, hi: 0x9f},
+ {value: 0xb053, lo: 0xa0, hi: 0xae},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0x69, offset 0x2dc
+ {value: 0x0117, lo: 0x80, hi: 0xa3},
+ {value: 0x0012, lo: 0xa4, hi: 0xa4},
+ {value: 0x0716, lo: 0xab, hi: 0xac},
+ {value: 0x0316, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb3},
+ // Block 0x6a, offset 0x2e2
+ {value: 0x6c52, lo: 0x80, hi: 0x9f},
+ {value: 0x7052, lo: 0xa0, hi: 0xa5},
+ {value: 0x7052, lo: 0xa7, hi: 0xa7},
+ {value: 0x7052, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x6b, offset 0x2e7
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x6c, offset 0x2ea
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0010, lo: 0xb0, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x6d, offset 0x2ef
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9e},
+ {value: 0x0024, lo: 0xa0, hi: 0xbf},
+ // Block 0x6e, offset 0x2f4
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ // Block 0x6f, offset 0x2f5
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0xaa, hi: 0xad},
+ {value: 0x0030, lo: 0xae, hi: 0xaf},
+ {value: 0x0004, lo: 0xb1, hi: 0xb5},
+ {value: 0x0014, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ // Block 0x70, offset 0x2fb
+ {value: 0x0034, lo: 0x99, hi: 0x9a},
+ {value: 0x0004, lo: 0x9b, hi: 0x9e},
+ // Block 0x71, offset 0x2fd
+ {value: 0x0004, lo: 0xbc, hi: 0xbe},
+ // Block 0x72, offset 0x2fe
+ {value: 0x0010, lo: 0x85, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x73, offset 0x300
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0010, lo: 0xa0, hi: 0xba},
+ // Block 0x74, offset 0x302
+ {value: 0x0010, lo: 0x80, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0xbf},
+ // Block 0x75, offset 0x305
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ // Block 0x76, offset 0x306
+ {value: 0x0010, lo: 0x90, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x77, offset 0x308
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0xab},
+ // Block 0x78, offset 0x30b
+ {value: 0x0117, lo: 0x80, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb2},
+ {value: 0x0024, lo: 0xb4, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x79, offset 0x311
+ {value: 0x0117, lo: 0x80, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9d},
+ {value: 0x0024, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x7a, offset 0x315
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb1},
+ // Block 0x7b, offset 0x317
+ {value: 0x0004, lo: 0x80, hi: 0x96},
+ {value: 0x0014, lo: 0x97, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xaf},
+ {value: 0x0012, lo: 0xb0, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xbf},
+ // Block 0x7c, offset 0x31c
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x0015, lo: 0xb0, hi: 0xb0},
+ {value: 0x0012, lo: 0xb1, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x8753, lo: 0xbd, hi: 0xbd},
+ {value: 0x0117, lo: 0xbe, hi: 0xbf},
+ // Block 0x7d, offset 0x323
+ {value: 0x0117, lo: 0x82, hi: 0x83},
+ {value: 0x6553, lo: 0x84, hi: 0x84},
+ {value: 0x908b, lo: 0x85, hi: 0x85},
+ {value: 0x8f53, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0xb7, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbf},
+ // Block 0x7e, offset 0x32b
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x8c, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ // Block 0x7f, offset 0x334
+ {value: 0x0010, lo: 0x80, hi: 0xb3},
+ // Block 0x80, offset 0x335
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xa0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb7},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x81, offset 0x33e
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x82, offset 0x342
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0x92},
+ {value: 0x0030, lo: 0x93, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0x83, offset 0x347
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x84, offset 0x34f
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0004, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x85, offset 0x355
+ {value: 0x0010, lo: 0x80, hi: 0xa8},
+ {value: 0x0014, lo: 0xa9, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0x86, offset 0x35b
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x87, offset 0x365
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0024, lo: 0xbe, hi: 0xbf},
+ // Block 0x88, offset 0x36a
+ {value: 0x0024, lo: 0x81, hi: 0x81},
+ {value: 0x0004, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ // Block 0x89, offset 0x373
+ {value: 0x0010, lo: 0x81, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x8e},
+ {value: 0x0010, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8a, offset 0x379
+ {value: 0x0012, lo: 0x80, hi: 0x92},
+ {value: 0xb352, lo: 0x93, hi: 0x93},
+ {value: 0x0012, lo: 0x94, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa7},
+ {value: 0x74d2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8b, offset 0x380
+ {value: 0x78d2, lo: 0x80, hi: 0x8f},
+ {value: 0x7cd2, lo: 0x90, hi: 0x9f},
+ {value: 0x80d2, lo: 0xa0, hi: 0xaf},
+ {value: 0x7cd2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8c, offset 0x384
+ {value: 0x0010, lo: 0x80, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x8d, offset 0x38c
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x8e, offset 0x38e
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x8b, hi: 0xbb},
+ // Block 0x8f, offset 0x390
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0xbf},
+ // Block 0x90, offset 0x393
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0004, lo: 0xb2, hi: 0xbf},
+ // Block 0x91, offset 0x395
+ {value: 0x0004, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x93, hi: 0xbf},
+ // Block 0x92, offset 0x397
+ {value: 0x0010, lo: 0x80, hi: 0xbd},
+ // Block 0x93, offset 0x398
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0x94, offset 0x399
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0xbf},
+ // Block 0x95, offset 0x39b
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0xb0, hi: 0xbb},
+ // Block 0x96, offset 0x39d
+ {value: 0x0014, lo: 0x80, hi: 0x8f},
+ {value: 0x0054, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0xa0, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xad},
+ {value: 0x0024, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ // Block 0x97, offset 0x3a3
+ {value: 0x0010, lo: 0x8d, hi: 0x8f},
+ {value: 0x0054, lo: 0x92, hi: 0x92},
+ {value: 0x0054, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0xb0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0x98, offset 0x3a8
+ {value: 0x0010, lo: 0x80, hi: 0xbc},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x99, offset 0x3aa
+ {value: 0x0054, lo: 0x87, hi: 0x87},
+ {value: 0x0054, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0054, lo: 0x9a, hi: 0x9a},
+ {value: 0x5f53, lo: 0xa1, hi: 0xba},
+ {value: 0x0004, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9a, offset 0x3b1
+ {value: 0x0004, lo: 0x80, hi: 0x80},
+ {value: 0x5f52, lo: 0x81, hi: 0x9a},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ // Block 0x9b, offset 0x3b4
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbe},
+ // Block 0x9c, offset 0x3b6
+ {value: 0x0010, lo: 0x82, hi: 0x87},
+ {value: 0x0010, lo: 0x8a, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0x97},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0004, lo: 0xa3, hi: 0xa3},
+ {value: 0x0014, lo: 0xb9, hi: 0xbb},
+ // Block 0x9d, offset 0x3bc
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0010, lo: 0x8d, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xba},
+ {value: 0x0010, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9e, offset 0x3c1
+ {value: 0x0010, lo: 0x80, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x9d},
+ // Block 0x9f, offset 0x3c3
+ {value: 0x0010, lo: 0x80, hi: 0xba},
+ // Block 0xa0, offset 0x3c4
+ {value: 0x0010, lo: 0x80, hi: 0xb4},
+ // Block 0xa1, offset 0x3c5
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0xa2, offset 0x3c6
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa3, offset 0x3c8
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ // Block 0xa4, offset 0x3ca
+ {value: 0x0010, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xad, hi: 0xbf},
+ // Block 0xa5, offset 0x3cc
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0xb5},
+ {value: 0x0024, lo: 0xb6, hi: 0xba},
+ // Block 0xa6, offset 0x3cf
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa7, offset 0x3d1
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x91, hi: 0x95},
+ // Block 0xa8, offset 0x3d4
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x97},
+ {value: 0xb653, lo: 0x98, hi: 0x9f},
+ {value: 0xb953, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbf},
+ // Block 0xa9, offset 0x3dc
+ {value: 0xb652, lo: 0x80, hi: 0x87},
+ {value: 0xb952, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xaa, offset 0x3df
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0xb953, lo: 0xb0, hi: 0xb7},
+ {value: 0xb653, lo: 0xb8, hi: 0xbf},
+ // Block 0xab, offset 0x3e3
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x93},
+ {value: 0xb952, lo: 0x98, hi: 0x9f},
+ {value: 0xb652, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbb},
+ // Block 0xac, offset 0x3eb
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xad, offset 0x3ed
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ // Block 0xae, offset 0x3ee
+ {value: 0x0010, lo: 0x80, hi: 0xb6},
+ // Block 0xaf, offset 0x3ef
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ // Block 0xb0, offset 0x3f1
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xb1, offset 0x3f7
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xb2, offset 0x3f9
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ // Block 0xb3, offset 0x3fa
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ // Block 0xb4, offset 0x3fc
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb9},
+ // Block 0xb5, offset 0x3fe
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0xb6, offset 0x400
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x8e, hi: 0x8e},
+ {value: 0x0024, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x99, hi: 0xb5},
+ {value: 0x0024, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xb7, offset 0x40d
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0xb8, offset 0x40e
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ // Block 0xb9, offset 0x40f
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ // Block 0xba, offset 0x413
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ // Block 0xbb, offset 0x415
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ // Block 0xbc, offset 0x416
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ // Block 0xbd, offset 0x417
+ {value: 0x5653, lo: 0x80, hi: 0xb2},
+ // Block 0xbe, offset 0x418
+ {value: 0x5652, lo: 0x80, hi: 0xb2},
+ // Block 0xbf, offset 0x419
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc0, offset 0x41c
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xc1, offset 0x41f
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x87},
+ {value: 0x0024, lo: 0x88, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x8b},
+ {value: 0x0024, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ // Block 0xc2, offset 0x425
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xc3, offset 0x426
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xc4, offset 0x42a
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xc5, offset 0x42e
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ // Block 0xc6, offset 0x434
+ {value: 0x0014, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc7, offset 0x437
+ {value: 0x0024, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0xc8, offset 0x43e
+ {value: 0x0010, lo: 0x84, hi: 0x86},
+ {value: 0x0010, lo: 0x90, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ // Block 0xc9, offset 0x442
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xca, offset 0x446
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x89, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ // Block 0xcb, offset 0x44d
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb4},
+ {value: 0x0030, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xb7},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0xcc, offset 0x456
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xcd, offset 0x45c
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa2},
+ {value: 0x0014, lo: 0xa3, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xce, offset 0x462
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xcf, offset 0x46c
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0030, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9d, hi: 0xa3},
+ {value: 0x0024, lo: 0xa6, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ // Block 0xd0, offset 0x476
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xd1, offset 0x478
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0x9f, hi: 0x9f},
+ // Block 0xd2, offset 0x481
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xd3, offset 0x487
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd4, offset 0x48d
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd5, offset 0x493
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x98, hi: 0x9b},
+ {value: 0x0014, lo: 0x9c, hi: 0x9d},
+ // Block 0xd6, offset 0x496
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd7, offset 0x49c
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd8, offset 0x49f
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0014, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb5},
+ {value: 0x0030, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ // Block 0xd9, offset 0x4a8
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ // Block 0xda, offset 0x4a9
+ {value: 0x0014, lo: 0x9d, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xdb, offset 0x4b0
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ // Block 0xdc, offset 0x4b4
+ {value: 0x5f53, lo: 0xa0, hi: 0xbf},
+ // Block 0xdd, offset 0x4b5
+ {value: 0x5f52, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xde, offset 0x4b8
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ {value: 0x0010, lo: 0xaa, hi: 0xbf},
+ // Block 0xdf, offset 0x4ba
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0014, lo: 0x94, hi: 0x97},
+ {value: 0x0014, lo: 0x9a, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0x9f},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ // Block 0xe0, offset 0x4c1
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x8a},
+ {value: 0x0010, lo: 0x8b, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbe},
+ // Block 0xe1, offset 0x4c9
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0014, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x98},
+ {value: 0x0014, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0xbf},
+ // Block 0xe2, offset 0x4cf
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0014, lo: 0x8a, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9d, hi: 0x9d},
+ // Block 0xe3, offset 0x4d5
+ {value: 0x0010, lo: 0x80, hi: 0xb8},
+ // Block 0xe4, offset 0x4d6
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xe5, offset 0x4dc
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0xe6, offset 0x4df
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0014, lo: 0x92, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xa9},
+ {value: 0x0014, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0xe7, offset 0x4e7
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb6},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xe8, offset 0x4ee
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa5},
+ {value: 0x0010, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xbf},
+ // Block 0xe9, offset 0x4f8
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0014, lo: 0x90, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0x96},
+ {value: 0x0034, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xea, offset 0x500
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ // Block 0xeb, offset 0x503
+ {value: 0x0010, lo: 0x80, hi: 0x99},
+ // Block 0xec, offset 0x504
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ // Block 0xed, offset 0x505
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ // Block 0xee, offset 0x506
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ {value: 0x0014, lo: 0xb0, hi: 0xb8},
+ // Block 0xef, offset 0x508
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ // Block 0xf0, offset 0x509
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xf1, offset 0x50b
+ {value: 0x0010, lo: 0x90, hi: 0xad},
+ {value: 0x0034, lo: 0xb0, hi: 0xb4},
+ // Block 0xf2, offset 0x50d
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ // Block 0xf3, offset 0x50f
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa3, hi: 0xb7},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xf4, offset 0x513
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ // Block 0xf5, offset 0x514
+ {value: 0x2013, lo: 0x80, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xbf},
+ // Block 0xf6, offset 0x516
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xf7, offset 0x519
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0014, lo: 0x8f, hi: 0x9f},
+ // Block 0xf8, offset 0x51b
+ {value: 0x0014, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa3, hi: 0xa3},
+ // Block 0xf9, offset 0x51d
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbc},
+ // Block 0xfa, offset 0x51f
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0034, lo: 0x9e, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa3},
+ // Block 0xfb, offset 0x524
+ {value: 0x0030, lo: 0xa5, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xa9},
+ {value: 0x0030, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbf},
+ // Block 0xfc, offset 0x529
+ {value: 0x0034, lo: 0x80, hi: 0x82},
+ {value: 0x0024, lo: 0x85, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8b},
+ {value: 0x0024, lo: 0xaa, hi: 0xad},
+ // Block 0xfd, offset 0x52d
+ {value: 0x0024, lo: 0x82, hi: 0x84},
+ // Block 0xfe, offset 0x52e
+ {value: 0x0013, lo: 0x80, hi: 0x99},
+ {value: 0x0012, lo: 0x9a, hi: 0xb3},
+ {value: 0x0013, lo: 0xb4, hi: 0xbf},
+ // Block 0xff, offset 0x531
+ {value: 0x0013, lo: 0x80, hi: 0x8d},
+ {value: 0x0012, lo: 0x8e, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0xa7},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x100, offset 0x535
+ {value: 0x0013, lo: 0x80, hi: 0x81},
+ {value: 0x0012, lo: 0x82, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0x9c},
+ {value: 0x0013, lo: 0x9e, hi: 0x9f},
+ {value: 0x0013, lo: 0xa2, hi: 0xa2},
+ {value: 0x0013, lo: 0xa5, hi: 0xa6},
+ {value: 0x0013, lo: 0xa9, hi: 0xac},
+ {value: 0x0013, lo: 0xae, hi: 0xb5},
+ {value: 0x0012, lo: 0xb6, hi: 0xb9},
+ {value: 0x0012, lo: 0xbb, hi: 0xbb},
+ {value: 0x0012, lo: 0xbd, hi: 0xbf},
+ // Block 0x101, offset 0x540
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0012, lo: 0x85, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x102, offset 0x544
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0013, lo: 0x84, hi: 0x85},
+ {value: 0x0013, lo: 0x87, hi: 0x8a},
+ {value: 0x0013, lo: 0x8d, hi: 0x94},
+ {value: 0x0013, lo: 0x96, hi: 0x9c},
+ {value: 0x0012, lo: 0x9e, hi: 0xb7},
+ {value: 0x0013, lo: 0xb8, hi: 0xb9},
+ {value: 0x0013, lo: 0xbb, hi: 0xbe},
+ // Block 0x103, offset 0x54c
+ {value: 0x0013, lo: 0x80, hi: 0x84},
+ {value: 0x0013, lo: 0x86, hi: 0x86},
+ {value: 0x0013, lo: 0x8a, hi: 0x90},
+ {value: 0x0012, lo: 0x92, hi: 0xab},
+ {value: 0x0013, lo: 0xac, hi: 0xbf},
+ // Block 0x104, offset 0x551
+ {value: 0x0013, lo: 0x80, hi: 0x85},
+ {value: 0x0012, lo: 0x86, hi: 0x9f},
+ {value: 0x0013, lo: 0xa0, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbf},
+ // Block 0x105, offset 0x555
+ {value: 0x0012, lo: 0x80, hi: 0x93},
+ {value: 0x0013, lo: 0x94, hi: 0xad},
+ {value: 0x0012, lo: 0xae, hi: 0xbf},
+ // Block 0x106, offset 0x558
+ {value: 0x0012, lo: 0x80, hi: 0x87},
+ {value: 0x0013, lo: 0x88, hi: 0xa1},
+ {value: 0x0012, lo: 0xa2, hi: 0xbb},
+ {value: 0x0013, lo: 0xbc, hi: 0xbf},
+ // Block 0x107, offset 0x55c
+ {value: 0x0013, lo: 0x80, hi: 0x95},
+ {value: 0x0012, lo: 0x96, hi: 0xaf},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x108, offset 0x55f
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0012, lo: 0x8a, hi: 0xa5},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x109, offset 0x562
+ {value: 0x0013, lo: 0x80, hi: 0x80},
+ {value: 0x0012, lo: 0x82, hi: 0x9a},
+ {value: 0x0012, lo: 0x9c, hi: 0xa1},
+ {value: 0x0013, lo: 0xa2, hi: 0xba},
+ {value: 0x0012, lo: 0xbc, hi: 0xbf},
+ // Block 0x10a, offset 0x567
+ {value: 0x0012, lo: 0x80, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0xb4},
+ {value: 0x0012, lo: 0xb6, hi: 0xbf},
+ // Block 0x10b, offset 0x56b
+ {value: 0x0012, lo: 0x80, hi: 0x8e},
+ {value: 0x0012, lo: 0x90, hi: 0x95},
+ {value: 0x0013, lo: 0x96, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x10c, offset 0x56f
+ {value: 0x0012, lo: 0x80, hi: 0x88},
+ {value: 0x0012, lo: 0x8a, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x10d, offset 0x573
+ {value: 0x0012, lo: 0x80, hi: 0x82},
+ {value: 0x0012, lo: 0x84, hi: 0x89},
+ {value: 0x0017, lo: 0x8a, hi: 0x8b},
+ {value: 0x0010, lo: 0x8e, hi: 0xbf},
+ // Block 0x10e, offset 0x577
+ {value: 0x0014, lo: 0x80, hi: 0xb6},
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x10f, offset 0x579
+ {value: 0x0014, lo: 0x80, hi: 0xac},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x110, offset 0x57b
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x9b, hi: 0x9f},
+ {value: 0x0014, lo: 0xa1, hi: 0xaf},
+ // Block 0x111, offset 0x57e
+ {value: 0x0024, lo: 0x80, hi: 0x86},
+ {value: 0x0024, lo: 0x88, hi: 0x98},
+ {value: 0x0024, lo: 0x9b, hi: 0xa1},
+ {value: 0x0024, lo: 0xa3, hi: 0xa4},
+ {value: 0x0024, lo: 0xa6, hi: 0xaa},
+ // Block 0x112, offset 0x583
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ // Block 0x113, offset 0x586
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ // Block 0x114, offset 0x588
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0024, lo: 0xac, hi: 0xaf},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x115, offset 0x58b
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0034, lo: 0x90, hi: 0x96},
+ // Block 0x116, offset 0x58d
+ {value: 0xbc52, lo: 0x80, hi: 0x81},
+ {value: 0xbf52, lo: 0x82, hi: 0x83},
+ {value: 0x0024, lo: 0x84, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x117, offset 0x593
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x9f},
+ {value: 0x0010, lo: 0xa1, hi: 0xa2},
+ {value: 0x0010, lo: 0xa4, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb7},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ // Block 0x118, offset 0x59c
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x9b},
+ {value: 0x0010, lo: 0xa1, hi: 0xa3},
+ {value: 0x0010, lo: 0xa5, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xbb},
+ // Block 0x119, offset 0x5a1
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x11a, offset 0x5a2
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x11b, offset 0x5a5
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ // Block 0x11c, offset 0x5a6
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x11d, offset 0x5a7
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0014, lo: 0xa0, hi: 0xbf},
+ // Block 0x11e, offset 0x5a9
+ {value: 0x0014, lo: 0x80, hi: 0xbf},
+ // Block 0x11f, offset 0x5aa
+ {value: 0x0014, lo: 0x80, hi: 0xaf},
+}
+
+// Total table size 15070 bytes (14KiB); checksum: 1EB13752
diff --git a/vendor/golang.org/x/text/cases/tables13.0.0.go b/vendor/golang.org/x/text/cases/tables13.0.0.go
new file mode 100644
index 00000000000..6187e6b4628
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/tables13.0.0.go
@@ -0,0 +1,2399 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+//go:build go1.16 && !go1.21
+
+package cases
+
+// UnicodeVersion is the Unicode version from which the tables in this package are derived.
+const UnicodeVersion = "13.0.0"
+
+var xorData string = "" + // Size: 192 bytes
+ "\x00\x06\x07\x00\x01?\x00\x0f\x03\x00\x0f\x12\x00\x0f\x1f\x00\x0f\x1d" +
+ "\x00\x01\x13\x00\x0f\x16\x00\x0f\x0b\x00\x0f3\x00\x0f7\x00\x01#\x00\x0f?" +
+ "\x00\x0e'\x00\x0f/\x00\x0e>\x00\x0f*\x00\x0c&\x00\x0c*\x00\x0c;\x00\x0c9" +
+ "\x00\x0c%\x00\x01\x08\x00\x03\x0d\x00\x03\x09\x00\x02\x06\x00\x02\x02" +
+ "\x00\x02\x0c\x00\x01\x00\x00\x01\x03\x00\x01\x01\x00\x01 \x00\x01\x0c" +
+ "\x00\x01\x10\x00\x03\x10\x00\x036 \x00\x037 \x00\x0b#\x10\x00\x0b 0\x00" +
+ "\x0b!\x10\x00\x0b!0\x001\x00\x00\x0b(\x04\x00\x03\x04\x1e\x00\x0b)\x08" +
+ "\x00\x03\x0a\x00\x02:\x00\x02>\x00\x02,\x00\x02\x00\x00\x02\x10\x00\x01<" +
+ "\x00\x01&\x00\x01*\x00\x01.\x00\x010\x003 \x00\x01\x18\x00\x01(\x00\x01" +
+ "\x1e\x00\x01\x22"
+
+var exceptions string = "" + // Size: 2450 bytes
+ "\x00\x12\x12μΜΜ\x12\x12ssSSSs\x13\x18i̇i̇\x10\x09II\x13\x1bʼnʼNʼN\x11" +
+ "\x09sSS\x12\x12dždžDž\x12\x12dždžDŽ\x10\x12DŽDž\x12\x12ljljLj\x12\x12ljljLJ\x10\x12LJLj" +
+ "\x12\x12njnjNj\x12\x12njnjNJ\x10\x12NJNj\x13\x1bǰJ̌J̌\x12\x12dzdzDz\x12\x12dzdzDZ\x10" +
+ "\x12DZDz\x13\x18ⱥⱥ\x13\x18ⱦⱦ\x10\x1bⱾⱾ\x10\x1bⱿⱿ\x10\x1bⱯⱯ\x10\x1bⱭⱭ\x10" +
+ "\x1bⱰⱰ\x10\x1bꞫꞫ\x10\x1bꞬꞬ\x10\x1bꞍꞍ\x10\x1bꞪꞪ\x10\x1bꞮꞮ\x10\x1bⱢⱢ\x10" +
+ "\x1bꞭꞭ\x10\x1bⱮⱮ\x10\x1bⱤⱤ\x10\x1bꟅꟅ\x10\x1bꞱꞱ\x10\x1bꞲꞲ\x10\x1bꞰꞰ2\x12ι" +
+ "ΙΙ\x166ΐΪ́Ϊ́\x166ΰΫ́Ϋ́\x12\x12σΣΣ\x12\x12βΒΒ\x12\x12θΘΘ\x12\x12" +
+ "φΦΦ\x12\x12πΠΠ\x12\x12κΚΚ\x12\x12ρΡΡ\x12\x12εΕΕ\x14$եւԵՒԵւ\x10\x1bᲐა" +
+ "\x10\x1bᲑბ\x10\x1bᲒგ\x10\x1bᲓდ\x10\x1bᲔე\x10\x1bᲕვ\x10\x1bᲖზ\x10\x1bᲗთ" +
+ "\x10\x1bᲘი\x10\x1bᲙკ\x10\x1bᲚლ\x10\x1bᲛმ\x10\x1bᲜნ\x10\x1bᲝო\x10\x1bᲞპ" +
+ "\x10\x1bᲟჟ\x10\x1bᲠრ\x10\x1bᲡს\x10\x1bᲢტ\x10\x1bᲣუ\x10\x1bᲤფ\x10\x1bᲥქ" +
+ "\x10\x1bᲦღ\x10\x1bᲧყ\x10\x1bᲨშ\x10\x1bᲩჩ\x10\x1bᲪც\x10\x1bᲫძ\x10\x1bᲬწ" +
+ "\x10\x1bᲭჭ\x10\x1bᲮხ\x10\x1bᲯჯ\x10\x1bᲰჰ\x10\x1bᲱჱ\x10\x1bᲲჲ\x10\x1bᲳჳ" +
+ "\x10\x1bᲴჴ\x10\x1bᲵჵ\x10\x1bᲶჶ\x10\x1bᲷჷ\x10\x1bᲸჸ\x10\x1bᲹჹ\x10\x1bᲺჺ" +
+ "\x10\x1bᲽჽ\x10\x1bᲾჾ\x10\x1bᲿჿ\x12\x12вВВ\x12\x12дДД\x12\x12оОО\x12\x12с" +
+ "СС\x12\x12тТТ\x12\x12тТТ\x12\x12ъЪЪ\x12\x12ѣѢѢ\x13\x1bꙋꙊꙊ\x13\x1bẖH̱H̱" +
+ "\x13\x1bẗT̈T̈\x13\x1bẘW̊W̊\x13\x1bẙY̊Y̊\x13\x1baʾAʾAʾ\x13\x1bṡṠṠ\x12" +
+ "\x10ssß\x14$ὐΥ̓Υ̓\x166ὒΥ̓̀Υ̓̀\x166ὔΥ̓́Υ̓́\x166ὖΥ̓͂Υ̓͂\x15+ἀιἈΙᾈ" +
+ "\x15+ἁιἉΙᾉ\x15+ἂιἊΙᾊ\x15+ἃιἋΙᾋ\x15+ἄιἌΙᾌ\x15+ἅιἍΙᾍ\x15+ἆιἎΙᾎ\x15+ἇιἏΙᾏ" +
+ "\x15\x1dἀιᾀἈΙ\x15\x1dἁιᾁἉΙ\x15\x1dἂιᾂἊΙ\x15\x1dἃιᾃἋΙ\x15\x1dἄιᾄἌΙ\x15" +
+ "\x1dἅιᾅἍΙ\x15\x1dἆιᾆἎΙ\x15\x1dἇιᾇἏΙ\x15+ἠιἨΙᾘ\x15+ἡιἩΙᾙ\x15+ἢιἪΙᾚ\x15+ἣι" +
+ "ἫΙᾛ\x15+ἤιἬΙᾜ\x15+ἥιἭΙᾝ\x15+ἦιἮΙᾞ\x15+ἧιἯΙᾟ\x15\x1dἠιᾐἨΙ\x15\x1dἡιᾑἩΙ" +
+ "\x15\x1dἢιᾒἪΙ\x15\x1dἣιᾓἫΙ\x15\x1dἤιᾔἬΙ\x15\x1dἥιᾕἭΙ\x15\x1dἦιᾖἮΙ\x15" +
+ "\x1dἧιᾗἯΙ\x15+ὠιὨΙᾨ\x15+ὡιὩΙᾩ\x15+ὢιὪΙᾪ\x15+ὣιὫΙᾫ\x15+ὤιὬΙᾬ\x15+ὥιὭΙᾭ" +
+ "\x15+ὦιὮΙᾮ\x15+ὧιὯΙᾯ\x15\x1dὠιᾠὨΙ\x15\x1dὡιᾡὩΙ\x15\x1dὢιᾢὪΙ\x15\x1dὣιᾣὫΙ" +
+ "\x15\x1dὤιᾤὬΙ\x15\x1dὥιᾥὭΙ\x15\x1dὦιᾦὮΙ\x15\x1dὧιᾧὯΙ\x15-ὰιᾺΙᾺͅ\x14#αιΑΙ" +
+ "ᾼ\x14$άιΆΙΆͅ\x14$ᾶΑ͂Α͂\x166ᾶιΑ͂Ιᾼ͂\x14\x1cαιᾳΑΙ\x12\x12ιΙΙ\x15-ὴιῊΙ" +
+ "Ὴͅ\x14#ηιΗΙῌ\x14$ήιΉΙΉͅ\x14$ῆΗ͂Η͂\x166ῆιΗ͂Ιῌ͂\x14\x1cηιῃΗΙ\x166ῒΙ" +
+ "̈̀Ϊ̀\x166ΐΪ́Ϊ́\x14$ῖΙ͂Ι͂\x166ῗΪ͂Ϊ͂\x166ῢΫ̀Ϋ̀\x166ΰΫ́Ϋ" +
+ "́\x14$ῤΡ̓Ρ̓\x14$ῦΥ͂Υ͂\x166ῧΫ͂Ϋ͂\x15-ὼιῺΙῺͅ\x14#ωιΩΙῼ\x14$ώιΏΙΏͅ" +
+ "\x14$ῶΩ͂Ω͂\x166ῶιΩ͂Ιῼ͂\x14\x1cωιῳΩΙ\x12\x10ωω\x11\x08kk\x12\x10åå\x12" +
+ "\x10ɫɫ\x12\x10ɽɽ\x10\x12ȺȺ\x10\x12ȾȾ\x12\x10ɑɑ\x12\x10ɱɱ\x12\x10ɐɐ\x12" +
+ "\x10ɒɒ\x12\x10ȿȿ\x12\x10ɀɀ\x12\x10ɥɥ\x12\x10ɦɦ\x12\x10ɜɜ\x12\x10ɡɡ\x12" +
+ "\x10ɬɬ\x12\x10ɪɪ\x12\x10ʞʞ\x12\x10ʇʇ\x12\x10ʝʝ\x12\x10ʂʂ\x12\x12ffFFFf" +
+ "\x12\x12fiFIFi\x12\x12flFLFl\x13\x1bffiFFIFfi\x13\x1bfflFFLFfl\x12\x12st" +
+ "STSt\x12\x12stSTSt\x14$մնՄՆՄն\x14$մեՄԵՄե\x14$միՄԻՄի\x14$վնՎՆՎն\x14$մխՄԽՄ" +
+ "խ"
+
+// lookup returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookup(s []byte) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupUnsafe(s []byte) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// lookupString returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookupString(s string) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupStringUnsafe(s string) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// caseTrie. Total size: 12538 bytes (12.24 KiB). Checksum: af4dfa7d60c71d4c.
+type caseTrie struct{}
+
+func newCaseTrie(i int) *caseTrie {
+ return &caseTrie{}
+}
+
+// lookupValue determines the type of block n and looks up the value for b.
+func (t *caseTrie) lookupValue(n uint32, b byte) uint16 {
+ switch {
+ case n < 20:
+ return uint16(caseValues[n<<6+uint32(b)])
+ default:
+ n -= 20
+ return uint16(sparse.lookup(n, b))
+ }
+}
+
+// caseValues: 22 blocks, 1408 entries, 2816 bytes
+// The third block is the zero block.
+var caseValues = [1408]uint16{
+ // Block 0x0, offset 0x0
+ 0x27: 0x0054,
+ 0x2e: 0x0054,
+ 0x30: 0x0010, 0x31: 0x0010, 0x32: 0x0010, 0x33: 0x0010, 0x34: 0x0010, 0x35: 0x0010,
+ 0x36: 0x0010, 0x37: 0x0010, 0x38: 0x0010, 0x39: 0x0010, 0x3a: 0x0054,
+ // Block 0x1, offset 0x40
+ 0x41: 0x2013, 0x42: 0x2013, 0x43: 0x2013, 0x44: 0x2013, 0x45: 0x2013,
+ 0x46: 0x2013, 0x47: 0x2013, 0x48: 0x2013, 0x49: 0x2013, 0x4a: 0x2013, 0x4b: 0x2013,
+ 0x4c: 0x2013, 0x4d: 0x2013, 0x4e: 0x2013, 0x4f: 0x2013, 0x50: 0x2013, 0x51: 0x2013,
+ 0x52: 0x2013, 0x53: 0x2013, 0x54: 0x2013, 0x55: 0x2013, 0x56: 0x2013, 0x57: 0x2013,
+ 0x58: 0x2013, 0x59: 0x2013, 0x5a: 0x2013,
+ 0x5e: 0x0004, 0x5f: 0x0010, 0x60: 0x0004, 0x61: 0x2012, 0x62: 0x2012, 0x63: 0x2012,
+ 0x64: 0x2012, 0x65: 0x2012, 0x66: 0x2012, 0x67: 0x2012, 0x68: 0x2012, 0x69: 0x2012,
+ 0x6a: 0x2012, 0x6b: 0x2012, 0x6c: 0x2012, 0x6d: 0x2012, 0x6e: 0x2012, 0x6f: 0x2012,
+ 0x70: 0x2012, 0x71: 0x2012, 0x72: 0x2012, 0x73: 0x2012, 0x74: 0x2012, 0x75: 0x2012,
+ 0x76: 0x2012, 0x77: 0x2012, 0x78: 0x2012, 0x79: 0x2012, 0x7a: 0x2012,
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc0: 0x0852, 0xc1: 0x0b53, 0xc2: 0x0113, 0xc3: 0x0112, 0xc4: 0x0113, 0xc5: 0x0112,
+ 0xc6: 0x0b53, 0xc7: 0x0f13, 0xc8: 0x0f12, 0xc9: 0x0e53, 0xca: 0x1153, 0xcb: 0x0713,
+ 0xcc: 0x0712, 0xcd: 0x0012, 0xce: 0x1453, 0xcf: 0x1753, 0xd0: 0x1a53, 0xd1: 0x0313,
+ 0xd2: 0x0312, 0xd3: 0x1d53, 0xd4: 0x2053, 0xd5: 0x2352, 0xd6: 0x2653, 0xd7: 0x2653,
+ 0xd8: 0x0113, 0xd9: 0x0112, 0xda: 0x2952, 0xdb: 0x0012, 0xdc: 0x1d53, 0xdd: 0x2c53,
+ 0xde: 0x2f52, 0xdf: 0x3253, 0xe0: 0x0113, 0xe1: 0x0112, 0xe2: 0x0113, 0xe3: 0x0112,
+ 0xe4: 0x0113, 0xe5: 0x0112, 0xe6: 0x3553, 0xe7: 0x0f13, 0xe8: 0x0f12, 0xe9: 0x3853,
+ 0xea: 0x0012, 0xeb: 0x0012, 0xec: 0x0113, 0xed: 0x0112, 0xee: 0x3553, 0xef: 0x1f13,
+ 0xf0: 0x1f12, 0xf1: 0x3b53, 0xf2: 0x3e53, 0xf3: 0x0713, 0xf4: 0x0712, 0xf5: 0x0313,
+ 0xf6: 0x0312, 0xf7: 0x4153, 0xf8: 0x0113, 0xf9: 0x0112, 0xfa: 0x0012, 0xfb: 0x0010,
+ 0xfc: 0x0113, 0xfd: 0x0112, 0xfe: 0x0012, 0xff: 0x4452,
+ // Block 0x4, offset 0x100
+ 0x100: 0x0010, 0x101: 0x0010, 0x102: 0x0010, 0x103: 0x0010, 0x104: 0x02db, 0x105: 0x0359,
+ 0x106: 0x03da, 0x107: 0x043b, 0x108: 0x04b9, 0x109: 0x053a, 0x10a: 0x059b, 0x10b: 0x0619,
+ 0x10c: 0x069a, 0x10d: 0x0313, 0x10e: 0x0312, 0x10f: 0x1f13, 0x110: 0x1f12, 0x111: 0x0313,
+ 0x112: 0x0312, 0x113: 0x0713, 0x114: 0x0712, 0x115: 0x0313, 0x116: 0x0312, 0x117: 0x0f13,
+ 0x118: 0x0f12, 0x119: 0x0313, 0x11a: 0x0312, 0x11b: 0x0713, 0x11c: 0x0712, 0x11d: 0x1452,
+ 0x11e: 0x0113, 0x11f: 0x0112, 0x120: 0x0113, 0x121: 0x0112, 0x122: 0x0113, 0x123: 0x0112,
+ 0x124: 0x0113, 0x125: 0x0112, 0x126: 0x0113, 0x127: 0x0112, 0x128: 0x0113, 0x129: 0x0112,
+ 0x12a: 0x0113, 0x12b: 0x0112, 0x12c: 0x0113, 0x12d: 0x0112, 0x12e: 0x0113, 0x12f: 0x0112,
+ 0x130: 0x06fa, 0x131: 0x07ab, 0x132: 0x0829, 0x133: 0x08aa, 0x134: 0x0113, 0x135: 0x0112,
+ 0x136: 0x2353, 0x137: 0x4453, 0x138: 0x0113, 0x139: 0x0112, 0x13a: 0x0113, 0x13b: 0x0112,
+ 0x13c: 0x0113, 0x13d: 0x0112, 0x13e: 0x0113, 0x13f: 0x0112,
+ // Block 0x5, offset 0x140
+ 0x140: 0x0a8a, 0x141: 0x0313, 0x142: 0x0312, 0x143: 0x0853, 0x144: 0x4753, 0x145: 0x4a53,
+ 0x146: 0x0113, 0x147: 0x0112, 0x148: 0x0113, 0x149: 0x0112, 0x14a: 0x0113, 0x14b: 0x0112,
+ 0x14c: 0x0113, 0x14d: 0x0112, 0x14e: 0x0113, 0x14f: 0x0112, 0x150: 0x0b0a, 0x151: 0x0b8a,
+ 0x152: 0x0c0a, 0x153: 0x0b52, 0x154: 0x0b52, 0x155: 0x0012, 0x156: 0x0e52, 0x157: 0x1152,
+ 0x158: 0x0012, 0x159: 0x1752, 0x15a: 0x0012, 0x15b: 0x1a52, 0x15c: 0x0c8a, 0x15d: 0x0012,
+ 0x15e: 0x0012, 0x15f: 0x0012, 0x160: 0x1d52, 0x161: 0x0d0a, 0x162: 0x0012, 0x163: 0x2052,
+ 0x164: 0x0012, 0x165: 0x0d8a, 0x166: 0x0e0a, 0x167: 0x0012, 0x168: 0x2652, 0x169: 0x2652,
+ 0x16a: 0x0e8a, 0x16b: 0x0f0a, 0x16c: 0x0f8a, 0x16d: 0x0012, 0x16e: 0x0012, 0x16f: 0x1d52,
+ 0x170: 0x0012, 0x171: 0x100a, 0x172: 0x2c52, 0x173: 0x0012, 0x174: 0x0012, 0x175: 0x3252,
+ 0x176: 0x0012, 0x177: 0x0012, 0x178: 0x0012, 0x179: 0x0012, 0x17a: 0x0012, 0x17b: 0x0012,
+ 0x17c: 0x0012, 0x17d: 0x108a, 0x17e: 0x0012, 0x17f: 0x0012,
+ // Block 0x6, offset 0x180
+ 0x180: 0x3552, 0x181: 0x0012, 0x182: 0x110a, 0x183: 0x3852, 0x184: 0x0012, 0x185: 0x0012,
+ 0x186: 0x0012, 0x187: 0x118a, 0x188: 0x3552, 0x189: 0x4752, 0x18a: 0x3b52, 0x18b: 0x3e52,
+ 0x18c: 0x4a52, 0x18d: 0x0012, 0x18e: 0x0012, 0x18f: 0x0012, 0x190: 0x0012, 0x191: 0x0012,
+ 0x192: 0x4152, 0x193: 0x0012, 0x194: 0x0010, 0x195: 0x0012, 0x196: 0x0012, 0x197: 0x0012,
+ 0x198: 0x0012, 0x199: 0x0012, 0x19a: 0x0012, 0x19b: 0x0012, 0x19c: 0x0012, 0x19d: 0x120a,
+ 0x19e: 0x128a, 0x19f: 0x0012, 0x1a0: 0x0012, 0x1a1: 0x0012, 0x1a2: 0x0012, 0x1a3: 0x0012,
+ 0x1a4: 0x0012, 0x1a5: 0x0012, 0x1a6: 0x0012, 0x1a7: 0x0012, 0x1a8: 0x0012, 0x1a9: 0x0012,
+ 0x1aa: 0x0012, 0x1ab: 0x0012, 0x1ac: 0x0012, 0x1ad: 0x0012, 0x1ae: 0x0012, 0x1af: 0x0012,
+ 0x1b0: 0x0015, 0x1b1: 0x0015, 0x1b2: 0x0015, 0x1b3: 0x0015, 0x1b4: 0x0015, 0x1b5: 0x0015,
+ 0x1b6: 0x0015, 0x1b7: 0x0015, 0x1b8: 0x0015, 0x1b9: 0x0014, 0x1ba: 0x0014, 0x1bb: 0x0014,
+ 0x1bc: 0x0014, 0x1bd: 0x0014, 0x1be: 0x0014, 0x1bf: 0x0014,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x0024, 0x1c1: 0x0024, 0x1c2: 0x0024, 0x1c3: 0x0024, 0x1c4: 0x0024, 0x1c5: 0x130d,
+ 0x1c6: 0x0024, 0x1c7: 0x0034, 0x1c8: 0x0034, 0x1c9: 0x0034, 0x1ca: 0x0024, 0x1cb: 0x0024,
+ 0x1cc: 0x0024, 0x1cd: 0x0034, 0x1ce: 0x0034, 0x1cf: 0x0014, 0x1d0: 0x0024, 0x1d1: 0x0024,
+ 0x1d2: 0x0024, 0x1d3: 0x0034, 0x1d4: 0x0034, 0x1d5: 0x0034, 0x1d6: 0x0034, 0x1d7: 0x0024,
+ 0x1d8: 0x0034, 0x1d9: 0x0034, 0x1da: 0x0034, 0x1db: 0x0024, 0x1dc: 0x0034, 0x1dd: 0x0034,
+ 0x1de: 0x0034, 0x1df: 0x0034, 0x1e0: 0x0034, 0x1e1: 0x0034, 0x1e2: 0x0034, 0x1e3: 0x0024,
+ 0x1e4: 0x0024, 0x1e5: 0x0024, 0x1e6: 0x0024, 0x1e7: 0x0024, 0x1e8: 0x0024, 0x1e9: 0x0024,
+ 0x1ea: 0x0024, 0x1eb: 0x0024, 0x1ec: 0x0024, 0x1ed: 0x0024, 0x1ee: 0x0024, 0x1ef: 0x0024,
+ 0x1f0: 0x0113, 0x1f1: 0x0112, 0x1f2: 0x0113, 0x1f3: 0x0112, 0x1f4: 0x0014, 0x1f5: 0x0004,
+ 0x1f6: 0x0113, 0x1f7: 0x0112, 0x1fa: 0x0015, 0x1fb: 0x4d52,
+ 0x1fc: 0x5052, 0x1fd: 0x5052, 0x1ff: 0x5353,
+ // Block 0x8, offset 0x200
+ 0x204: 0x0004, 0x205: 0x0004,
+ 0x206: 0x2a13, 0x207: 0x0054, 0x208: 0x2513, 0x209: 0x2713, 0x20a: 0x2513,
+ 0x20c: 0x5653, 0x20e: 0x5953, 0x20f: 0x5c53, 0x210: 0x138a, 0x211: 0x2013,
+ 0x212: 0x2013, 0x213: 0x2013, 0x214: 0x2013, 0x215: 0x2013, 0x216: 0x2013, 0x217: 0x2013,
+ 0x218: 0x2013, 0x219: 0x2013, 0x21a: 0x2013, 0x21b: 0x2013, 0x21c: 0x2013, 0x21d: 0x2013,
+ 0x21e: 0x2013, 0x21f: 0x2013, 0x220: 0x5f53, 0x221: 0x5f53, 0x223: 0x5f53,
+ 0x224: 0x5f53, 0x225: 0x5f53, 0x226: 0x5f53, 0x227: 0x5f53, 0x228: 0x5f53, 0x229: 0x5f53,
+ 0x22a: 0x5f53, 0x22b: 0x5f53, 0x22c: 0x2a12, 0x22d: 0x2512, 0x22e: 0x2712, 0x22f: 0x2512,
+ 0x230: 0x14ca, 0x231: 0x2012, 0x232: 0x2012, 0x233: 0x2012, 0x234: 0x2012, 0x235: 0x2012,
+ 0x236: 0x2012, 0x237: 0x2012, 0x238: 0x2012, 0x239: 0x2012, 0x23a: 0x2012, 0x23b: 0x2012,
+ 0x23c: 0x2012, 0x23d: 0x2012, 0x23e: 0x2012, 0x23f: 0x2012,
+ // Block 0x9, offset 0x240
+ 0x240: 0x5f52, 0x241: 0x5f52, 0x242: 0x160a, 0x243: 0x5f52, 0x244: 0x5f52, 0x245: 0x5f52,
+ 0x246: 0x5f52, 0x247: 0x5f52, 0x248: 0x5f52, 0x249: 0x5f52, 0x24a: 0x5f52, 0x24b: 0x5f52,
+ 0x24c: 0x5652, 0x24d: 0x5952, 0x24e: 0x5c52, 0x24f: 0x1813, 0x250: 0x168a, 0x251: 0x170a,
+ 0x252: 0x0013, 0x253: 0x0013, 0x254: 0x0013, 0x255: 0x178a, 0x256: 0x180a, 0x257: 0x1812,
+ 0x258: 0x0113, 0x259: 0x0112, 0x25a: 0x0113, 0x25b: 0x0112, 0x25c: 0x0113, 0x25d: 0x0112,
+ 0x25e: 0x0113, 0x25f: 0x0112, 0x260: 0x0113, 0x261: 0x0112, 0x262: 0x0113, 0x263: 0x0112,
+ 0x264: 0x0113, 0x265: 0x0112, 0x266: 0x0113, 0x267: 0x0112, 0x268: 0x0113, 0x269: 0x0112,
+ 0x26a: 0x0113, 0x26b: 0x0112, 0x26c: 0x0113, 0x26d: 0x0112, 0x26e: 0x0113, 0x26f: 0x0112,
+ 0x270: 0x188a, 0x271: 0x190a, 0x272: 0x0b12, 0x273: 0x5352, 0x274: 0x6253, 0x275: 0x198a,
+ 0x277: 0x0f13, 0x278: 0x0f12, 0x279: 0x0b13, 0x27a: 0x0113, 0x27b: 0x0112,
+ 0x27c: 0x0012, 0x27d: 0x4d53, 0x27e: 0x5053, 0x27f: 0x5053,
+ // Block 0xa, offset 0x280
+ 0x280: 0x6852, 0x281: 0x6852, 0x282: 0x6852, 0x283: 0x6852, 0x284: 0x6852, 0x285: 0x6852,
+ 0x286: 0x6852, 0x287: 0x1a0a, 0x288: 0x0012, 0x28a: 0x0010,
+ 0x291: 0x0034,
+ 0x292: 0x0024, 0x293: 0x0024, 0x294: 0x0024, 0x295: 0x0024, 0x296: 0x0034, 0x297: 0x0024,
+ 0x298: 0x0024, 0x299: 0x0024, 0x29a: 0x0034, 0x29b: 0x0034, 0x29c: 0x0024, 0x29d: 0x0024,
+ 0x29e: 0x0024, 0x29f: 0x0024, 0x2a0: 0x0024, 0x2a1: 0x0024, 0x2a2: 0x0034, 0x2a3: 0x0034,
+ 0x2a4: 0x0034, 0x2a5: 0x0034, 0x2a6: 0x0034, 0x2a7: 0x0034, 0x2a8: 0x0024, 0x2a9: 0x0024,
+ 0x2aa: 0x0034, 0x2ab: 0x0024, 0x2ac: 0x0024, 0x2ad: 0x0034, 0x2ae: 0x0034, 0x2af: 0x0024,
+ 0x2b0: 0x0034, 0x2b1: 0x0034, 0x2b2: 0x0034, 0x2b3: 0x0034, 0x2b4: 0x0034, 0x2b5: 0x0034,
+ 0x2b6: 0x0034, 0x2b7: 0x0034, 0x2b8: 0x0034, 0x2b9: 0x0034, 0x2ba: 0x0034, 0x2bb: 0x0034,
+ 0x2bc: 0x0034, 0x2bd: 0x0034, 0x2bf: 0x0034,
+ // Block 0xb, offset 0x2c0
+ 0x2c0: 0x7053, 0x2c1: 0x7053, 0x2c2: 0x7053, 0x2c3: 0x7053, 0x2c4: 0x7053, 0x2c5: 0x7053,
+ 0x2c7: 0x7053,
+ 0x2cd: 0x7053, 0x2d0: 0x1aea, 0x2d1: 0x1b6a,
+ 0x2d2: 0x1bea, 0x2d3: 0x1c6a, 0x2d4: 0x1cea, 0x2d5: 0x1d6a, 0x2d6: 0x1dea, 0x2d7: 0x1e6a,
+ 0x2d8: 0x1eea, 0x2d9: 0x1f6a, 0x2da: 0x1fea, 0x2db: 0x206a, 0x2dc: 0x20ea, 0x2dd: 0x216a,
+ 0x2de: 0x21ea, 0x2df: 0x226a, 0x2e0: 0x22ea, 0x2e1: 0x236a, 0x2e2: 0x23ea, 0x2e3: 0x246a,
+ 0x2e4: 0x24ea, 0x2e5: 0x256a, 0x2e6: 0x25ea, 0x2e7: 0x266a, 0x2e8: 0x26ea, 0x2e9: 0x276a,
+ 0x2ea: 0x27ea, 0x2eb: 0x286a, 0x2ec: 0x28ea, 0x2ed: 0x296a, 0x2ee: 0x29ea, 0x2ef: 0x2a6a,
+ 0x2f0: 0x2aea, 0x2f1: 0x2b6a, 0x2f2: 0x2bea, 0x2f3: 0x2c6a, 0x2f4: 0x2cea, 0x2f5: 0x2d6a,
+ 0x2f6: 0x2dea, 0x2f7: 0x2e6a, 0x2f8: 0x2eea, 0x2f9: 0x2f6a, 0x2fa: 0x2fea,
+ 0x2fc: 0x0014, 0x2fd: 0x306a, 0x2fe: 0x30ea, 0x2ff: 0x316a,
+ // Block 0xc, offset 0x300
+ 0x300: 0x0812, 0x301: 0x0812, 0x302: 0x0812, 0x303: 0x0812, 0x304: 0x0812, 0x305: 0x0812,
+ 0x308: 0x0813, 0x309: 0x0813, 0x30a: 0x0813, 0x30b: 0x0813,
+ 0x30c: 0x0813, 0x30d: 0x0813, 0x310: 0x3b1a, 0x311: 0x0812,
+ 0x312: 0x3bfa, 0x313: 0x0812, 0x314: 0x3d3a, 0x315: 0x0812, 0x316: 0x3e7a, 0x317: 0x0812,
+ 0x319: 0x0813, 0x31b: 0x0813, 0x31d: 0x0813,
+ 0x31f: 0x0813, 0x320: 0x0812, 0x321: 0x0812, 0x322: 0x0812, 0x323: 0x0812,
+ 0x324: 0x0812, 0x325: 0x0812, 0x326: 0x0812, 0x327: 0x0812, 0x328: 0x0813, 0x329: 0x0813,
+ 0x32a: 0x0813, 0x32b: 0x0813, 0x32c: 0x0813, 0x32d: 0x0813, 0x32e: 0x0813, 0x32f: 0x0813,
+ 0x330: 0x9252, 0x331: 0x9252, 0x332: 0x9552, 0x333: 0x9552, 0x334: 0x9852, 0x335: 0x9852,
+ 0x336: 0x9b52, 0x337: 0x9b52, 0x338: 0x9e52, 0x339: 0x9e52, 0x33a: 0xa152, 0x33b: 0xa152,
+ 0x33c: 0x4d52, 0x33d: 0x4d52,
+ // Block 0xd, offset 0x340
+ 0x340: 0x3fba, 0x341: 0x40aa, 0x342: 0x419a, 0x343: 0x428a, 0x344: 0x437a, 0x345: 0x446a,
+ 0x346: 0x455a, 0x347: 0x464a, 0x348: 0x4739, 0x349: 0x4829, 0x34a: 0x4919, 0x34b: 0x4a09,
+ 0x34c: 0x4af9, 0x34d: 0x4be9, 0x34e: 0x4cd9, 0x34f: 0x4dc9, 0x350: 0x4eba, 0x351: 0x4faa,
+ 0x352: 0x509a, 0x353: 0x518a, 0x354: 0x527a, 0x355: 0x536a, 0x356: 0x545a, 0x357: 0x554a,
+ 0x358: 0x5639, 0x359: 0x5729, 0x35a: 0x5819, 0x35b: 0x5909, 0x35c: 0x59f9, 0x35d: 0x5ae9,
+ 0x35e: 0x5bd9, 0x35f: 0x5cc9, 0x360: 0x5dba, 0x361: 0x5eaa, 0x362: 0x5f9a, 0x363: 0x608a,
+ 0x364: 0x617a, 0x365: 0x626a, 0x366: 0x635a, 0x367: 0x644a, 0x368: 0x6539, 0x369: 0x6629,
+ 0x36a: 0x6719, 0x36b: 0x6809, 0x36c: 0x68f9, 0x36d: 0x69e9, 0x36e: 0x6ad9, 0x36f: 0x6bc9,
+ 0x370: 0x0812, 0x371: 0x0812, 0x372: 0x6cba, 0x373: 0x6dca, 0x374: 0x6e9a,
+ 0x376: 0x6f7a, 0x377: 0x705a, 0x378: 0x0813, 0x379: 0x0813, 0x37a: 0x9253, 0x37b: 0x9253,
+ 0x37c: 0x7199, 0x37d: 0x0004, 0x37e: 0x726a, 0x37f: 0x0004,
+ // Block 0xe, offset 0x380
+ 0x380: 0x0004, 0x381: 0x0004, 0x382: 0x72ea, 0x383: 0x73fa, 0x384: 0x74ca,
+ 0x386: 0x75aa, 0x387: 0x768a, 0x388: 0x9553, 0x389: 0x9553, 0x38a: 0x9853, 0x38b: 0x9853,
+ 0x38c: 0x77c9, 0x38d: 0x0004, 0x38e: 0x0004, 0x38f: 0x0004, 0x390: 0x0812, 0x391: 0x0812,
+ 0x392: 0x789a, 0x393: 0x79da, 0x396: 0x7b1a, 0x397: 0x7bfa,
+ 0x398: 0x0813, 0x399: 0x0813, 0x39a: 0x9b53, 0x39b: 0x9b53, 0x39d: 0x0004,
+ 0x39e: 0x0004, 0x39f: 0x0004, 0x3a0: 0x0812, 0x3a1: 0x0812, 0x3a2: 0x7d3a, 0x3a3: 0x7e7a,
+ 0x3a4: 0x7fba, 0x3a5: 0x0912, 0x3a6: 0x809a, 0x3a7: 0x817a, 0x3a8: 0x0813, 0x3a9: 0x0813,
+ 0x3aa: 0xa153, 0x3ab: 0xa153, 0x3ac: 0x0913, 0x3ad: 0x0004, 0x3ae: 0x0004, 0x3af: 0x0004,
+ 0x3b2: 0x82ba, 0x3b3: 0x83ca, 0x3b4: 0x849a,
+ 0x3b6: 0x857a, 0x3b7: 0x865a, 0x3b8: 0x9e53, 0x3b9: 0x9e53, 0x3ba: 0x4d53, 0x3bb: 0x4d53,
+ 0x3bc: 0x8799, 0x3bd: 0x0004, 0x3be: 0x0004,
+ // Block 0xf, offset 0x3c0
+ 0x3c2: 0x0013,
+ 0x3c7: 0x0013, 0x3ca: 0x0012, 0x3cb: 0x0013,
+ 0x3cc: 0x0013, 0x3cd: 0x0013, 0x3ce: 0x0012, 0x3cf: 0x0012, 0x3d0: 0x0013, 0x3d1: 0x0013,
+ 0x3d2: 0x0013, 0x3d3: 0x0012, 0x3d5: 0x0013,
+ 0x3d9: 0x0013, 0x3da: 0x0013, 0x3db: 0x0013, 0x3dc: 0x0013, 0x3dd: 0x0013,
+ 0x3e4: 0x0013, 0x3e6: 0x886b, 0x3e8: 0x0013,
+ 0x3ea: 0x88cb, 0x3eb: 0x890b, 0x3ec: 0x0013, 0x3ed: 0x0013, 0x3ef: 0x0012,
+ 0x3f0: 0x0013, 0x3f1: 0x0013, 0x3f2: 0xa453, 0x3f3: 0x0013, 0x3f4: 0x0012, 0x3f5: 0x0010,
+ 0x3f6: 0x0010, 0x3f7: 0x0010, 0x3f8: 0x0010, 0x3f9: 0x0012,
+ 0x3fc: 0x0012, 0x3fd: 0x0012, 0x3fe: 0x0013, 0x3ff: 0x0013,
+ // Block 0x10, offset 0x400
+ 0x400: 0x1a13, 0x401: 0x1a13, 0x402: 0x1e13, 0x403: 0x1e13, 0x404: 0x1a13, 0x405: 0x1a13,
+ 0x406: 0x2613, 0x407: 0x2613, 0x408: 0x2a13, 0x409: 0x2a13, 0x40a: 0x2e13, 0x40b: 0x2e13,
+ 0x40c: 0x2a13, 0x40d: 0x2a13, 0x40e: 0x2613, 0x40f: 0x2613, 0x410: 0xa752, 0x411: 0xa752,
+ 0x412: 0xaa52, 0x413: 0xaa52, 0x414: 0xad52, 0x415: 0xad52, 0x416: 0xaa52, 0x417: 0xaa52,
+ 0x418: 0xa752, 0x419: 0xa752, 0x41a: 0x1a12, 0x41b: 0x1a12, 0x41c: 0x1e12, 0x41d: 0x1e12,
+ 0x41e: 0x1a12, 0x41f: 0x1a12, 0x420: 0x2612, 0x421: 0x2612, 0x422: 0x2a12, 0x423: 0x2a12,
+ 0x424: 0x2e12, 0x425: 0x2e12, 0x426: 0x2a12, 0x427: 0x2a12, 0x428: 0x2612, 0x429: 0x2612,
+ // Block 0x11, offset 0x440
+ 0x440: 0x6552, 0x441: 0x6552, 0x442: 0x6552, 0x443: 0x6552, 0x444: 0x6552, 0x445: 0x6552,
+ 0x446: 0x6552, 0x447: 0x6552, 0x448: 0x6552, 0x449: 0x6552, 0x44a: 0x6552, 0x44b: 0x6552,
+ 0x44c: 0x6552, 0x44d: 0x6552, 0x44e: 0x6552, 0x44f: 0x6552, 0x450: 0xb052, 0x451: 0xb052,
+ 0x452: 0xb052, 0x453: 0xb052, 0x454: 0xb052, 0x455: 0xb052, 0x456: 0xb052, 0x457: 0xb052,
+ 0x458: 0xb052, 0x459: 0xb052, 0x45a: 0xb052, 0x45b: 0xb052, 0x45c: 0xb052, 0x45d: 0xb052,
+ 0x45e: 0xb052, 0x460: 0x0113, 0x461: 0x0112, 0x462: 0x896b, 0x463: 0x8b53,
+ 0x464: 0x89cb, 0x465: 0x8a2a, 0x466: 0x8a8a, 0x467: 0x0f13, 0x468: 0x0f12, 0x469: 0x0313,
+ 0x46a: 0x0312, 0x46b: 0x0713, 0x46c: 0x0712, 0x46d: 0x8aeb, 0x46e: 0x8b4b, 0x46f: 0x8bab,
+ 0x470: 0x8c0b, 0x471: 0x0012, 0x472: 0x0113, 0x473: 0x0112, 0x474: 0x0012, 0x475: 0x0313,
+ 0x476: 0x0312, 0x477: 0x0012, 0x478: 0x0012, 0x479: 0x0012, 0x47a: 0x0012, 0x47b: 0x0012,
+ 0x47c: 0x0015, 0x47d: 0x0015, 0x47e: 0x8c6b, 0x47f: 0x8ccb,
+ // Block 0x12, offset 0x480
+ 0x480: 0x0113, 0x481: 0x0112, 0x482: 0x0113, 0x483: 0x0112, 0x484: 0x0113, 0x485: 0x0112,
+ 0x486: 0x0113, 0x487: 0x0112, 0x488: 0x0014, 0x489: 0x0014, 0x48a: 0x0014, 0x48b: 0x0713,
+ 0x48c: 0x0712, 0x48d: 0x8d2b, 0x48e: 0x0012, 0x48f: 0x0010, 0x490: 0x0113, 0x491: 0x0112,
+ 0x492: 0x0113, 0x493: 0x0112, 0x494: 0x6552, 0x495: 0x0012, 0x496: 0x0113, 0x497: 0x0112,
+ 0x498: 0x0113, 0x499: 0x0112, 0x49a: 0x0113, 0x49b: 0x0112, 0x49c: 0x0113, 0x49d: 0x0112,
+ 0x49e: 0x0113, 0x49f: 0x0112, 0x4a0: 0x0113, 0x4a1: 0x0112, 0x4a2: 0x0113, 0x4a3: 0x0112,
+ 0x4a4: 0x0113, 0x4a5: 0x0112, 0x4a6: 0x0113, 0x4a7: 0x0112, 0x4a8: 0x0113, 0x4a9: 0x0112,
+ 0x4aa: 0x8d8b, 0x4ab: 0x8deb, 0x4ac: 0x8e4b, 0x4ad: 0x8eab, 0x4ae: 0x8f0b, 0x4af: 0x0012,
+ 0x4b0: 0x8f6b, 0x4b1: 0x8fcb, 0x4b2: 0x902b, 0x4b3: 0xb353, 0x4b4: 0x0113, 0x4b5: 0x0112,
+ 0x4b6: 0x0113, 0x4b7: 0x0112, 0x4b8: 0x0113, 0x4b9: 0x0112, 0x4ba: 0x0113, 0x4bb: 0x0112,
+ 0x4bc: 0x0113, 0x4bd: 0x0112, 0x4be: 0x0113, 0x4bf: 0x0112,
+ // Block 0x13, offset 0x4c0
+ 0x4c0: 0x90ea, 0x4c1: 0x916a, 0x4c2: 0x91ea, 0x4c3: 0x926a, 0x4c4: 0x931a, 0x4c5: 0x93ca,
+ 0x4c6: 0x944a,
+ 0x4d3: 0x94ca, 0x4d4: 0x95aa, 0x4d5: 0x968a, 0x4d6: 0x976a, 0x4d7: 0x984a,
+ 0x4dd: 0x0010,
+ 0x4de: 0x0034, 0x4df: 0x0010, 0x4e0: 0x0010, 0x4e1: 0x0010, 0x4e2: 0x0010, 0x4e3: 0x0010,
+ 0x4e4: 0x0010, 0x4e5: 0x0010, 0x4e6: 0x0010, 0x4e7: 0x0010, 0x4e8: 0x0010,
+ 0x4ea: 0x0010, 0x4eb: 0x0010, 0x4ec: 0x0010, 0x4ed: 0x0010, 0x4ee: 0x0010, 0x4ef: 0x0010,
+ 0x4f0: 0x0010, 0x4f1: 0x0010, 0x4f2: 0x0010, 0x4f3: 0x0010, 0x4f4: 0x0010, 0x4f5: 0x0010,
+ 0x4f6: 0x0010, 0x4f8: 0x0010, 0x4f9: 0x0010, 0x4fa: 0x0010, 0x4fb: 0x0010,
+ 0x4fc: 0x0010, 0x4fe: 0x0010,
+ // Block 0x14, offset 0x500
+ 0x500: 0x2213, 0x501: 0x2213, 0x502: 0x2613, 0x503: 0x2613, 0x504: 0x2213, 0x505: 0x2213,
+ 0x506: 0x2e13, 0x507: 0x2e13, 0x508: 0x2213, 0x509: 0x2213, 0x50a: 0x2613, 0x50b: 0x2613,
+ 0x50c: 0x2213, 0x50d: 0x2213, 0x50e: 0x3e13, 0x50f: 0x3e13, 0x510: 0x2213, 0x511: 0x2213,
+ 0x512: 0x2613, 0x513: 0x2613, 0x514: 0x2213, 0x515: 0x2213, 0x516: 0x2e13, 0x517: 0x2e13,
+ 0x518: 0x2213, 0x519: 0x2213, 0x51a: 0x2613, 0x51b: 0x2613, 0x51c: 0x2213, 0x51d: 0x2213,
+ 0x51e: 0xbc53, 0x51f: 0xbc53, 0x520: 0xbf53, 0x521: 0xbf53, 0x522: 0x2212, 0x523: 0x2212,
+ 0x524: 0x2612, 0x525: 0x2612, 0x526: 0x2212, 0x527: 0x2212, 0x528: 0x2e12, 0x529: 0x2e12,
+ 0x52a: 0x2212, 0x52b: 0x2212, 0x52c: 0x2612, 0x52d: 0x2612, 0x52e: 0x2212, 0x52f: 0x2212,
+ 0x530: 0x3e12, 0x531: 0x3e12, 0x532: 0x2212, 0x533: 0x2212, 0x534: 0x2612, 0x535: 0x2612,
+ 0x536: 0x2212, 0x537: 0x2212, 0x538: 0x2e12, 0x539: 0x2e12, 0x53a: 0x2212, 0x53b: 0x2212,
+ 0x53c: 0x2612, 0x53d: 0x2612, 0x53e: 0x2212, 0x53f: 0x2212,
+ // Block 0x15, offset 0x540
+ 0x542: 0x0010,
+ 0x547: 0x0010, 0x549: 0x0010, 0x54b: 0x0010,
+ 0x54d: 0x0010, 0x54e: 0x0010, 0x54f: 0x0010, 0x551: 0x0010,
+ 0x552: 0x0010, 0x554: 0x0010, 0x557: 0x0010,
+ 0x559: 0x0010, 0x55b: 0x0010, 0x55d: 0x0010,
+ 0x55f: 0x0010, 0x561: 0x0010, 0x562: 0x0010,
+ 0x564: 0x0010, 0x567: 0x0010, 0x568: 0x0010, 0x569: 0x0010,
+ 0x56a: 0x0010, 0x56c: 0x0010, 0x56d: 0x0010, 0x56e: 0x0010, 0x56f: 0x0010,
+ 0x570: 0x0010, 0x571: 0x0010, 0x572: 0x0010, 0x574: 0x0010, 0x575: 0x0010,
+ 0x576: 0x0010, 0x577: 0x0010, 0x579: 0x0010, 0x57a: 0x0010, 0x57b: 0x0010,
+ 0x57c: 0x0010, 0x57e: 0x0010,
+}
+
+// caseIndex: 25 blocks, 1600 entries, 3200 bytes
+// Block 0 is the zero block.
+var caseIndex = [1600]uint16{
+ // Block 0x0, offset 0x0
+ // Block 0x1, offset 0x40
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc2: 0x14, 0xc3: 0x15, 0xc4: 0x16, 0xc5: 0x17, 0xc6: 0x01, 0xc7: 0x02,
+ 0xc8: 0x18, 0xc9: 0x03, 0xca: 0x04, 0xcb: 0x19, 0xcc: 0x1a, 0xcd: 0x05, 0xce: 0x06, 0xcf: 0x07,
+ 0xd0: 0x1b, 0xd1: 0x1c, 0xd2: 0x1d, 0xd3: 0x1e, 0xd4: 0x1f, 0xd5: 0x20, 0xd6: 0x08, 0xd7: 0x21,
+ 0xd8: 0x22, 0xd9: 0x23, 0xda: 0x24, 0xdb: 0x25, 0xdc: 0x26, 0xdd: 0x27, 0xde: 0x28, 0xdf: 0x29,
+ 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05,
+ 0xea: 0x06, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x08, 0xef: 0x09,
+ 0xf0: 0x14, 0xf3: 0x16,
+ // Block 0x4, offset 0x100
+ 0x120: 0x2a, 0x121: 0x2b, 0x122: 0x2c, 0x123: 0x2d, 0x124: 0x2e, 0x125: 0x2f, 0x126: 0x30, 0x127: 0x31,
+ 0x128: 0x32, 0x129: 0x33, 0x12a: 0x34, 0x12b: 0x35, 0x12c: 0x36, 0x12d: 0x37, 0x12e: 0x38, 0x12f: 0x39,
+ 0x130: 0x3a, 0x131: 0x3b, 0x132: 0x3c, 0x133: 0x3d, 0x134: 0x3e, 0x135: 0x3f, 0x136: 0x40, 0x137: 0x41,
+ 0x138: 0x42, 0x139: 0x43, 0x13a: 0x44, 0x13b: 0x45, 0x13c: 0x46, 0x13d: 0x47, 0x13e: 0x48, 0x13f: 0x49,
+ // Block 0x5, offset 0x140
+ 0x140: 0x4a, 0x141: 0x4b, 0x142: 0x4c, 0x143: 0x09, 0x144: 0x24, 0x145: 0x24, 0x146: 0x24, 0x147: 0x24,
+ 0x148: 0x24, 0x149: 0x4d, 0x14a: 0x4e, 0x14b: 0x4f, 0x14c: 0x50, 0x14d: 0x51, 0x14e: 0x52, 0x14f: 0x53,
+ 0x150: 0x54, 0x151: 0x24, 0x152: 0x24, 0x153: 0x24, 0x154: 0x24, 0x155: 0x24, 0x156: 0x24, 0x157: 0x24,
+ 0x158: 0x24, 0x159: 0x55, 0x15a: 0x56, 0x15b: 0x57, 0x15c: 0x58, 0x15d: 0x59, 0x15e: 0x5a, 0x15f: 0x5b,
+ 0x160: 0x5c, 0x161: 0x5d, 0x162: 0x5e, 0x163: 0x5f, 0x164: 0x60, 0x165: 0x61, 0x167: 0x62,
+ 0x168: 0x63, 0x169: 0x64, 0x16a: 0x65, 0x16b: 0x66, 0x16c: 0x67, 0x16d: 0x68, 0x16e: 0x69, 0x16f: 0x6a,
+ 0x170: 0x6b, 0x171: 0x6c, 0x172: 0x6d, 0x173: 0x6e, 0x174: 0x6f, 0x175: 0x70, 0x176: 0x71, 0x177: 0x72,
+ 0x178: 0x73, 0x179: 0x73, 0x17a: 0x74, 0x17b: 0x73, 0x17c: 0x75, 0x17d: 0x0a, 0x17e: 0x0b, 0x17f: 0x0c,
+ // Block 0x6, offset 0x180
+ 0x180: 0x76, 0x181: 0x77, 0x182: 0x78, 0x183: 0x79, 0x184: 0x0d, 0x185: 0x7a, 0x186: 0x7b,
+ 0x192: 0x7c, 0x193: 0x0e,
+ 0x1b0: 0x7d, 0x1b1: 0x0f, 0x1b2: 0x73, 0x1b3: 0x7e, 0x1b4: 0x7f, 0x1b5: 0x80, 0x1b6: 0x81, 0x1b7: 0x82,
+ 0x1b8: 0x83,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x84, 0x1c2: 0x85, 0x1c3: 0x86, 0x1c4: 0x87, 0x1c5: 0x24, 0x1c6: 0x88,
+ // Block 0x8, offset 0x200
+ 0x200: 0x89, 0x201: 0x24, 0x202: 0x24, 0x203: 0x24, 0x204: 0x24, 0x205: 0x24, 0x206: 0x24, 0x207: 0x24,
+ 0x208: 0x24, 0x209: 0x24, 0x20a: 0x24, 0x20b: 0x24, 0x20c: 0x24, 0x20d: 0x24, 0x20e: 0x24, 0x20f: 0x24,
+ 0x210: 0x24, 0x211: 0x24, 0x212: 0x8a, 0x213: 0x8b, 0x214: 0x24, 0x215: 0x24, 0x216: 0x24, 0x217: 0x24,
+ 0x218: 0x8c, 0x219: 0x8d, 0x21a: 0x8e, 0x21b: 0x8f, 0x21c: 0x90, 0x21d: 0x91, 0x21e: 0x10, 0x21f: 0x92,
+ 0x220: 0x93, 0x221: 0x94, 0x222: 0x24, 0x223: 0x95, 0x224: 0x96, 0x225: 0x97, 0x226: 0x98, 0x227: 0x99,
+ 0x228: 0x9a, 0x229: 0x9b, 0x22a: 0x9c, 0x22b: 0x9d, 0x22c: 0x9e, 0x22d: 0x9f, 0x22e: 0xa0, 0x22f: 0xa1,
+ 0x230: 0x24, 0x231: 0x24, 0x232: 0x24, 0x233: 0x24, 0x234: 0x24, 0x235: 0x24, 0x236: 0x24, 0x237: 0x24,
+ 0x238: 0x24, 0x239: 0x24, 0x23a: 0x24, 0x23b: 0x24, 0x23c: 0x24, 0x23d: 0x24, 0x23e: 0x24, 0x23f: 0x24,
+ // Block 0x9, offset 0x240
+ 0x240: 0x24, 0x241: 0x24, 0x242: 0x24, 0x243: 0x24, 0x244: 0x24, 0x245: 0x24, 0x246: 0x24, 0x247: 0x24,
+ 0x248: 0x24, 0x249: 0x24, 0x24a: 0x24, 0x24b: 0x24, 0x24c: 0x24, 0x24d: 0x24, 0x24e: 0x24, 0x24f: 0x24,
+ 0x250: 0x24, 0x251: 0x24, 0x252: 0x24, 0x253: 0x24, 0x254: 0x24, 0x255: 0x24, 0x256: 0x24, 0x257: 0x24,
+ 0x258: 0x24, 0x259: 0x24, 0x25a: 0x24, 0x25b: 0x24, 0x25c: 0x24, 0x25d: 0x24, 0x25e: 0x24, 0x25f: 0x24,
+ 0x260: 0x24, 0x261: 0x24, 0x262: 0x24, 0x263: 0x24, 0x264: 0x24, 0x265: 0x24, 0x266: 0x24, 0x267: 0x24,
+ 0x268: 0x24, 0x269: 0x24, 0x26a: 0x24, 0x26b: 0x24, 0x26c: 0x24, 0x26d: 0x24, 0x26e: 0x24, 0x26f: 0x24,
+ 0x270: 0x24, 0x271: 0x24, 0x272: 0x24, 0x273: 0x24, 0x274: 0x24, 0x275: 0x24, 0x276: 0x24, 0x277: 0x24,
+ 0x278: 0x24, 0x279: 0x24, 0x27a: 0x24, 0x27b: 0x24, 0x27c: 0x24, 0x27d: 0x24, 0x27e: 0x24, 0x27f: 0x24,
+ // Block 0xa, offset 0x280
+ 0x280: 0x24, 0x281: 0x24, 0x282: 0x24, 0x283: 0x24, 0x284: 0x24, 0x285: 0x24, 0x286: 0x24, 0x287: 0x24,
+ 0x288: 0x24, 0x289: 0x24, 0x28a: 0x24, 0x28b: 0x24, 0x28c: 0x24, 0x28d: 0x24, 0x28e: 0x24, 0x28f: 0x24,
+ 0x290: 0x24, 0x291: 0x24, 0x292: 0x24, 0x293: 0x24, 0x294: 0x24, 0x295: 0x24, 0x296: 0x24, 0x297: 0x24,
+ 0x298: 0x24, 0x299: 0x24, 0x29a: 0x24, 0x29b: 0x24, 0x29c: 0x24, 0x29d: 0x24, 0x29e: 0xa2, 0x29f: 0xa3,
+ // Block 0xb, offset 0x2c0
+ 0x2ec: 0x11, 0x2ed: 0xa4, 0x2ee: 0xa5, 0x2ef: 0xa6,
+ 0x2f0: 0x24, 0x2f1: 0x24, 0x2f2: 0x24, 0x2f3: 0x24, 0x2f4: 0xa7, 0x2f5: 0xa8, 0x2f6: 0xa9, 0x2f7: 0xaa,
+ 0x2f8: 0xab, 0x2f9: 0xac, 0x2fa: 0x24, 0x2fb: 0xad, 0x2fc: 0xae, 0x2fd: 0xaf, 0x2fe: 0xb0, 0x2ff: 0xb1,
+ // Block 0xc, offset 0x300
+ 0x300: 0xb2, 0x301: 0xb3, 0x302: 0x24, 0x303: 0xb4, 0x305: 0xb5, 0x307: 0xb6,
+ 0x30a: 0xb7, 0x30b: 0xb8, 0x30c: 0xb9, 0x30d: 0xba, 0x30e: 0xbb, 0x30f: 0xbc,
+ 0x310: 0xbd, 0x311: 0xbe, 0x312: 0xbf, 0x313: 0xc0, 0x314: 0xc1, 0x315: 0xc2,
+ 0x318: 0x24, 0x319: 0x24, 0x31a: 0x24, 0x31b: 0x24, 0x31c: 0xc3, 0x31d: 0xc4,
+ 0x320: 0xc5, 0x321: 0xc6, 0x322: 0xc7, 0x323: 0xc8, 0x324: 0xc9, 0x326: 0xca,
+ 0x328: 0xcb, 0x329: 0xcc, 0x32a: 0xcd, 0x32b: 0xce, 0x32c: 0x5f, 0x32d: 0xcf, 0x32e: 0xd0,
+ 0x330: 0x24, 0x331: 0xd1, 0x332: 0xd2, 0x333: 0xd3, 0x334: 0xd4,
+ 0x33a: 0xd5, 0x33c: 0xd6, 0x33d: 0xd7, 0x33e: 0xd8, 0x33f: 0xd9,
+ // Block 0xd, offset 0x340
+ 0x340: 0xda, 0x341: 0xdb, 0x342: 0xdc, 0x343: 0xdd, 0x344: 0xde, 0x345: 0xdf, 0x346: 0xe0, 0x347: 0xe1,
+ 0x348: 0xe2, 0x34a: 0xe3, 0x34b: 0xe4, 0x34c: 0xe5, 0x34d: 0xe6,
+ 0x350: 0xe7, 0x351: 0xe8, 0x352: 0xe9, 0x353: 0xea, 0x356: 0xeb, 0x357: 0xec,
+ 0x358: 0xed, 0x359: 0xee, 0x35a: 0xef, 0x35b: 0xf0, 0x35c: 0xf1,
+ 0x360: 0xf2, 0x362: 0xf3, 0x363: 0xf4, 0x364: 0xf5, 0x365: 0xf6, 0x366: 0xf7, 0x367: 0xf8,
+ 0x368: 0xf9, 0x369: 0xfa, 0x36a: 0xfb, 0x36b: 0xfc,
+ 0x370: 0xfd, 0x371: 0xfe, 0x372: 0xff, 0x374: 0x100, 0x375: 0x101, 0x376: 0x102,
+ 0x37b: 0x103, 0x37e: 0x104,
+ // Block 0xe, offset 0x380
+ 0x380: 0x24, 0x381: 0x24, 0x382: 0x24, 0x383: 0x24, 0x384: 0x24, 0x385: 0x24, 0x386: 0x24, 0x387: 0x24,
+ 0x388: 0x24, 0x389: 0x24, 0x38a: 0x24, 0x38b: 0x24, 0x38c: 0x24, 0x38d: 0x24, 0x38e: 0x105,
+ 0x390: 0x24, 0x391: 0x106, 0x392: 0x24, 0x393: 0x24, 0x394: 0x24, 0x395: 0x107,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x24, 0x3c1: 0x24, 0x3c2: 0x24, 0x3c3: 0x24, 0x3c4: 0x24, 0x3c5: 0x24, 0x3c6: 0x24, 0x3c7: 0x24,
+ 0x3c8: 0x24, 0x3c9: 0x24, 0x3ca: 0x24, 0x3cb: 0x24, 0x3cc: 0x24, 0x3cd: 0x24, 0x3ce: 0x24, 0x3cf: 0x24,
+ 0x3d0: 0x108,
+ // Block 0x10, offset 0x400
+ 0x410: 0x24, 0x411: 0x24, 0x412: 0x24, 0x413: 0x24, 0x414: 0x24, 0x415: 0x24, 0x416: 0x24, 0x417: 0x24,
+ 0x418: 0x24, 0x419: 0x109,
+ // Block 0x11, offset 0x440
+ 0x460: 0x24, 0x461: 0x24, 0x462: 0x24, 0x463: 0x24, 0x464: 0x24, 0x465: 0x24, 0x466: 0x24, 0x467: 0x24,
+ 0x468: 0xfc, 0x469: 0x10a, 0x46b: 0x10b, 0x46c: 0x10c, 0x46d: 0x10d, 0x46e: 0x10e,
+ 0x479: 0x10f, 0x47c: 0x24, 0x47d: 0x110, 0x47e: 0x111, 0x47f: 0x112,
+ // Block 0x12, offset 0x480
+ 0x4b0: 0x24, 0x4b1: 0x113, 0x4b2: 0x114,
+ // Block 0x13, offset 0x4c0
+ 0x4c5: 0x115, 0x4c6: 0x116,
+ 0x4c9: 0x117,
+ 0x4d0: 0x118, 0x4d1: 0x119, 0x4d2: 0x11a, 0x4d3: 0x11b, 0x4d4: 0x11c, 0x4d5: 0x11d, 0x4d6: 0x11e, 0x4d7: 0x11f,
+ 0x4d8: 0x120, 0x4d9: 0x121, 0x4da: 0x122, 0x4db: 0x123, 0x4dc: 0x124, 0x4dd: 0x125, 0x4de: 0x126, 0x4df: 0x127,
+ 0x4e8: 0x128, 0x4e9: 0x129, 0x4ea: 0x12a,
+ // Block 0x14, offset 0x500
+ 0x500: 0x12b, 0x504: 0x12c, 0x505: 0x12d,
+ 0x50b: 0x12e,
+ 0x520: 0x24, 0x521: 0x24, 0x522: 0x24, 0x523: 0x12f, 0x524: 0x12, 0x525: 0x130,
+ 0x538: 0x131, 0x539: 0x13, 0x53a: 0x132,
+ // Block 0x15, offset 0x540
+ 0x544: 0x133, 0x545: 0x134, 0x546: 0x135,
+ 0x54f: 0x136,
+ 0x56f: 0x137,
+ // Block 0x16, offset 0x580
+ 0x590: 0x0a, 0x591: 0x0b, 0x592: 0x0c, 0x593: 0x0d, 0x594: 0x0e, 0x596: 0x0f,
+ 0x59b: 0x10, 0x59d: 0x11, 0x59e: 0x12, 0x59f: 0x13,
+ // Block 0x17, offset 0x5c0
+ 0x5c0: 0x138, 0x5c1: 0x139, 0x5c4: 0x139, 0x5c5: 0x139, 0x5c6: 0x139, 0x5c7: 0x13a,
+ // Block 0x18, offset 0x600
+ 0x620: 0x15,
+}
+
+// sparseOffsets: 296 entries, 592 bytes
+var sparseOffsets = []uint16{0x0, 0x9, 0xf, 0x18, 0x24, 0x2e, 0x34, 0x37, 0x3b, 0x3e, 0x42, 0x4c, 0x4e, 0x57, 0x5e, 0x63, 0x71, 0x72, 0x80, 0x8f, 0x99, 0x9c, 0xa3, 0xab, 0xae, 0xb0, 0xc0, 0xc6, 0xd4, 0xdf, 0xec, 0xf7, 0x103, 0x10d, 0x119, 0x124, 0x130, 0x13c, 0x144, 0x14d, 0x157, 0x162, 0x16e, 0x174, 0x17f, 0x185, 0x18d, 0x190, 0x195, 0x199, 0x19d, 0x1a4, 0x1ad, 0x1b5, 0x1b6, 0x1bf, 0x1c6, 0x1ce, 0x1d4, 0x1d9, 0x1dd, 0x1e0, 0x1e2, 0x1e5, 0x1ea, 0x1eb, 0x1ed, 0x1ef, 0x1f1, 0x1f8, 0x1fd, 0x201, 0x20a, 0x20d, 0x210, 0x216, 0x217, 0x222, 0x223, 0x224, 0x229, 0x236, 0x23f, 0x240, 0x248, 0x251, 0x25a, 0x263, 0x268, 0x26b, 0x276, 0x284, 0x286, 0x28d, 0x291, 0x29d, 0x29e, 0x2a9, 0x2b1, 0x2b9, 0x2bf, 0x2c0, 0x2ce, 0x2d3, 0x2d6, 0x2db, 0x2df, 0x2e5, 0x2ea, 0x2ed, 0x2f2, 0x2f7, 0x2f8, 0x2fe, 0x300, 0x301, 0x303, 0x305, 0x308, 0x309, 0x30b, 0x30e, 0x314, 0x318, 0x31a, 0x31f, 0x326, 0x331, 0x33b, 0x33c, 0x345, 0x349, 0x34e, 0x356, 0x35c, 0x362, 0x36c, 0x371, 0x37a, 0x380, 0x389, 0x38d, 0x395, 0x397, 0x399, 0x39c, 0x39e, 0x3a0, 0x3a1, 0x3a2, 0x3a4, 0x3a6, 0x3ac, 0x3b1, 0x3b3, 0x3ba, 0x3bd, 0x3bf, 0x3c5, 0x3ca, 0x3cc, 0x3cd, 0x3ce, 0x3cf, 0x3d1, 0x3d3, 0x3d5, 0x3d8, 0x3da, 0x3dd, 0x3e5, 0x3e8, 0x3ec, 0x3f4, 0x3f6, 0x3f7, 0x3f8, 0x3fa, 0x400, 0x402, 0x403, 0x405, 0x407, 0x409, 0x416, 0x417, 0x418, 0x41c, 0x41e, 0x41f, 0x420, 0x421, 0x422, 0x425, 0x428, 0x42b, 0x431, 0x432, 0x434, 0x438, 0x43c, 0x442, 0x445, 0x44c, 0x450, 0x454, 0x45d, 0x466, 0x46c, 0x472, 0x47c, 0x486, 0x488, 0x491, 0x497, 0x49d, 0x4a3, 0x4a6, 0x4ac, 0x4af, 0x4b8, 0x4b9, 0x4c0, 0x4c4, 0x4c5, 0x4c8, 0x4d2, 0x4d5, 0x4d7, 0x4de, 0x4e6, 0x4ec, 0x4f2, 0x4f3, 0x4f9, 0x4fc, 0x504, 0x50b, 0x515, 0x51d, 0x520, 0x521, 0x522, 0x523, 0x524, 0x526, 0x527, 0x529, 0x52b, 0x52d, 0x531, 0x532, 0x534, 0x537, 0x539, 0x53c, 0x53e, 0x543, 0x548, 0x54c, 0x54d, 0x550, 0x554, 0x55f, 0x563, 0x56b, 0x570, 0x574, 0x577, 0x57b, 0x57e, 0x581, 0x586, 0x58a, 0x58e, 0x592, 0x596, 0x598, 0x59a, 0x59d, 0x5a2, 0x5a5, 0x5a7, 0x5aa, 0x5ac, 0x5b2, 0x5bb, 0x5c0, 0x5c1, 0x5c4, 0x5c5, 0x5c6, 0x5c7, 0x5c9, 0x5ca, 0x5cb}
+
+// sparseValues: 1483 entries, 5932 bytes
+var sparseValues = [1483]valueRange{
+ // Block 0x0, offset 0x0
+ {value: 0x0004, lo: 0xa8, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xaa},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0004, lo: 0xaf, hi: 0xaf},
+ {value: 0x0004, lo: 0xb4, hi: 0xb4},
+ {value: 0x001a, lo: 0xb5, hi: 0xb5},
+ {value: 0x0054, lo: 0xb7, hi: 0xb7},
+ {value: 0x0004, lo: 0xb8, hi: 0xb8},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ // Block 0x1, offset 0x9
+ {value: 0x2013, lo: 0x80, hi: 0x96},
+ {value: 0x2013, lo: 0x98, hi: 0x9e},
+ {value: 0x009a, lo: 0x9f, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xb6},
+ {value: 0x2012, lo: 0xb8, hi: 0xbe},
+ {value: 0x0252, lo: 0xbf, hi: 0xbf},
+ // Block 0x2, offset 0xf
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x011b, lo: 0xb0, hi: 0xb0},
+ {value: 0x019a, lo: 0xb1, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb7},
+ {value: 0x0012, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x0553, lo: 0xbf, hi: 0xbf},
+ // Block 0x3, offset 0x18
+ {value: 0x0552, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x01da, lo: 0x89, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xb7},
+ {value: 0x0253, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x028a, lo: 0xbf, hi: 0xbf},
+ // Block 0x4, offset 0x24
+ {value: 0x0117, lo: 0x80, hi: 0x9f},
+ {value: 0x2f53, lo: 0xa0, hi: 0xa0},
+ {value: 0x0012, lo: 0xa1, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xb3},
+ {value: 0x0012, lo: 0xb4, hi: 0xb9},
+ {value: 0x090b, lo: 0xba, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x2953, lo: 0xbd, hi: 0xbd},
+ {value: 0x098b, lo: 0xbe, hi: 0xbe},
+ {value: 0x0a0a, lo: 0xbf, hi: 0xbf},
+ // Block 0x5, offset 0x2e
+ {value: 0x0015, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x97},
+ {value: 0x0004, lo: 0x98, hi: 0x9d},
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0015, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xbf},
+ // Block 0x6, offset 0x34
+ {value: 0x0024, lo: 0x80, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbf},
+ // Block 0x7, offset 0x37
+ {value: 0x6553, lo: 0x80, hi: 0x8f},
+ {value: 0x2013, lo: 0x90, hi: 0x9f},
+ {value: 0x5f53, lo: 0xa0, hi: 0xaf},
+ {value: 0x2012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8, offset 0x3b
+ {value: 0x5f52, lo: 0x80, hi: 0x8f},
+ {value: 0x6552, lo: 0x90, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x9, offset 0x3e
+ {value: 0x0117, lo: 0x80, hi: 0x81},
+ {value: 0x0024, lo: 0x83, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xbf},
+ // Block 0xa, offset 0x42
+ {value: 0x0f13, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0716, lo: 0x8b, hi: 0x8c},
+ {value: 0x0316, lo: 0x8d, hi: 0x8e},
+ {value: 0x0f12, lo: 0x8f, hi: 0x8f},
+ {value: 0x0117, lo: 0x90, hi: 0xbf},
+ // Block 0xb, offset 0x4c
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x6553, lo: 0xb1, hi: 0xbf},
+ // Block 0xc, offset 0x4e
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6853, lo: 0x90, hi: 0x96},
+ {value: 0x0014, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0054, lo: 0x9f, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa0},
+ {value: 0x6552, lo: 0xa1, hi: 0xaf},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0xd, offset 0x57
+ {value: 0x0034, lo: 0x81, hi: 0x82},
+ {value: 0x0024, lo: 0x84, hi: 0x84},
+ {value: 0x0034, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xaa},
+ {value: 0x0010, lo: 0xaf, hi: 0xb3},
+ {value: 0x0054, lo: 0xb4, hi: 0xb4},
+ // Block 0xe, offset 0x5e
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0024, lo: 0x90, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0014, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xf, offset 0x63
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9c},
+ {value: 0x0024, lo: 0x9d, hi: 0x9e},
+ {value: 0x0034, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x10, offset 0x71
+ {value: 0x0010, lo: 0x80, hi: 0xbf},
+ // Block 0x11, offset 0x72
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0024, lo: 0x9f, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x12, offset 0x80
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0034, lo: 0xb1, hi: 0xb1},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0024, lo: 0xbf, hi: 0xbf},
+ // Block 0x13, offset 0x8f
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0024, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x88},
+ {value: 0x0024, lo: 0x89, hi: 0x8a},
+ {value: 0x0010, lo: 0x8d, hi: 0xbf},
+ // Block 0x14, offset 0x99
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x15, offset 0x9c
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xb1},
+ {value: 0x0034, lo: 0xb2, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0x16, offset 0xa3
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x99},
+ {value: 0x0014, lo: 0x9a, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0xa3},
+ {value: 0x0014, lo: 0xa4, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xad},
+ // Block 0x17, offset 0xab
+ {value: 0x0010, lo: 0x80, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0xa0, hi: 0xaa},
+ // Block 0x18, offset 0xae
+ {value: 0x0010, lo: 0xa0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0x19, offset 0xb0
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0034, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0024, lo: 0xaa, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbf},
+ // Block 0x1a, offset 0xc0
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1b, offset 0xc6
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0x1c, offset 0xd4
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb6, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1d, offset 0xdf
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xb1},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ // Block 0x1e, offset 0xec
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x1f, offset 0xf7
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x99, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x20, offset 0x103
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x21, offset 0x10d
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x85},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xbf},
+ // Block 0x22, offset 0x119
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x23, offset 0x124
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x24, offset 0x130
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0010, lo: 0xa8, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x25, offset 0x13c
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x26, offset 0x144
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb9},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbf},
+ // Block 0x27, offset 0x14d
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x88},
+ {value: 0x0014, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x28, offset 0x157
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x29, offset 0x162
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb2},
+ // Block 0x2a, offset 0x16e
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x2b, offset 0x174
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x94, hi: 0x97},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xba, hi: 0xbf},
+ // Block 0x2c, offset 0x17f
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x96},
+ {value: 0x0010, lo: 0x9a, hi: 0xb1},
+ {value: 0x0010, lo: 0xb3, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x2d, offset 0x185
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x94},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9f},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ // Block 0x2e, offset 0x18d
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ // Block 0x2f, offset 0x190
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x30, offset 0x195
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ // Block 0x31, offset 0x199
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x32, offset 0x19d
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0034, lo: 0x98, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0034, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x33, offset 0x1a4
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xac},
+ {value: 0x0034, lo: 0xb1, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xba, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x34, offset 0x1ad
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0024, lo: 0x82, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x86, hi: 0x87},
+ {value: 0x0010, lo: 0x88, hi: 0x8c},
+ {value: 0x0014, lo: 0x8d, hi: 0x97},
+ {value: 0x0014, lo: 0x99, hi: 0xbc},
+ // Block 0x35, offset 0x1b5
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ // Block 0x36, offset 0x1b6
+ {value: 0x0010, lo: 0xab, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbe},
+ // Block 0x37, offset 0x1bf
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x96, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x99},
+ {value: 0x0014, lo: 0x9e, hi: 0xa0},
+ {value: 0x0010, lo: 0xa2, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xad},
+ {value: 0x0014, lo: 0xb1, hi: 0xb4},
+ // Block 0x38, offset 0x1c6
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x6c53, lo: 0xa0, hi: 0xbf},
+ // Block 0x39, offset 0x1ce
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x9a, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x3a, offset 0x1d4
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x3b, offset 0x1d9
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x82, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3c, offset 0x1dd
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3d, offset 0x1e0
+ {value: 0x0010, lo: 0x80, hi: 0x9a},
+ {value: 0x0024, lo: 0x9d, hi: 0x9f},
+ // Block 0x3e, offset 0x1e2
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x7453, lo: 0xa0, hi: 0xaf},
+ {value: 0x7853, lo: 0xb0, hi: 0xbf},
+ // Block 0x3f, offset 0x1e5
+ {value: 0x7c53, lo: 0x80, hi: 0x8f},
+ {value: 0x8053, lo: 0x90, hi: 0x9f},
+ {value: 0x7c53, lo: 0xa0, hi: 0xaf},
+ {value: 0x0813, lo: 0xb0, hi: 0xb5},
+ {value: 0x0892, lo: 0xb8, hi: 0xbd},
+ // Block 0x40, offset 0x1ea
+ {value: 0x0010, lo: 0x81, hi: 0xbf},
+ // Block 0x41, offset 0x1eb
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0010, lo: 0xaf, hi: 0xbf},
+ // Block 0x42, offset 0x1ed
+ {value: 0x0010, lo: 0x81, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x43, offset 0x1ef
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb8},
+ // Block 0x44, offset 0x1f1
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0034, lo: 0x94, hi: 0x94},
+ {value: 0x0010, lo: 0xa0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ // Block 0x45, offset 0x1f8
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xac},
+ {value: 0x0010, lo: 0xae, hi: 0xb0},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ // Block 0x46, offset 0x1fd
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x47, offset 0x201
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x89, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0014, lo: 0x93, hi: 0x93},
+ {value: 0x0004, lo: 0x97, hi: 0x97},
+ {value: 0x0024, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0x48, offset 0x20a
+ {value: 0x0014, lo: 0x8b, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x49, offset 0x20d
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb8},
+ // Block 0x4a, offset 0x210
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x4b, offset 0x216
+ {value: 0x0010, lo: 0x80, hi: 0xb5},
+ // Block 0x4c, offset 0x217
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbb},
+ // Block 0x4d, offset 0x222
+ {value: 0x0010, lo: 0x86, hi: 0x8f},
+ // Block 0x4e, offset 0x223
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x4f, offset 0x224
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ // Block 0x50, offset 0x229
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x9e},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xac},
+ {value: 0x0010, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xbc},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x51, offset 0x236
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xa7, hi: 0xa7},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ {value: 0x0034, lo: 0xb5, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbc},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x52, offset 0x23f
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ // Block 0x53, offset 0x240
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x54, offset 0x248
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0030, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xab, hi: 0xab},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ {value: 0x0024, lo: 0xad, hi: 0xb3},
+ // Block 0x55, offset 0x251
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0030, lo: 0xaa, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbf},
+ // Block 0x56, offset 0x25a
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0030, lo: 0xb2, hi: 0xb3},
+ // Block 0x57, offset 0x263
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0x58, offset 0x268
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8d, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x59, offset 0x26b
+ {value: 0x31ea, lo: 0x80, hi: 0x80},
+ {value: 0x326a, lo: 0x81, hi: 0x81},
+ {value: 0x32ea, lo: 0x82, hi: 0x82},
+ {value: 0x336a, lo: 0x83, hi: 0x83},
+ {value: 0x33ea, lo: 0x84, hi: 0x84},
+ {value: 0x346a, lo: 0x85, hi: 0x85},
+ {value: 0x34ea, lo: 0x86, hi: 0x86},
+ {value: 0x356a, lo: 0x87, hi: 0x87},
+ {value: 0x35ea, lo: 0x88, hi: 0x88},
+ {value: 0x8353, lo: 0x90, hi: 0xba},
+ {value: 0x8353, lo: 0xbd, hi: 0xbf},
+ // Block 0x5a, offset 0x276
+ {value: 0x0024, lo: 0x90, hi: 0x92},
+ {value: 0x0034, lo: 0x94, hi: 0x99},
+ {value: 0x0024, lo: 0x9a, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9f},
+ {value: 0x0024, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xb3},
+ {value: 0x0024, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb7},
+ {value: 0x0024, lo: 0xb8, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xba},
+ // Block 0x5b, offset 0x284
+ {value: 0x0012, lo: 0x80, hi: 0xab},
+ {value: 0x0015, lo: 0xac, hi: 0xbf},
+ // Block 0x5c, offset 0x286
+ {value: 0x0015, lo: 0x80, hi: 0xaa},
+ {value: 0x0012, lo: 0xab, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb8},
+ {value: 0x8752, lo: 0xb9, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbc},
+ {value: 0x8b52, lo: 0xbd, hi: 0xbd},
+ {value: 0x0012, lo: 0xbe, hi: 0xbf},
+ // Block 0x5d, offset 0x28d
+ {value: 0x0012, lo: 0x80, hi: 0x8d},
+ {value: 0x8f52, lo: 0x8e, hi: 0x8e},
+ {value: 0x0012, lo: 0x8f, hi: 0x9a},
+ {value: 0x0015, lo: 0x9b, hi: 0xbf},
+ // Block 0x5e, offset 0x291
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0024, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb9},
+ {value: 0x0024, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbd},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x5f, offset 0x29d
+ {value: 0x0117, lo: 0x80, hi: 0xbf},
+ // Block 0x60, offset 0x29e
+ {value: 0x0117, lo: 0x80, hi: 0x95},
+ {value: 0x369a, lo: 0x96, hi: 0x96},
+ {value: 0x374a, lo: 0x97, hi: 0x97},
+ {value: 0x37fa, lo: 0x98, hi: 0x98},
+ {value: 0x38aa, lo: 0x99, hi: 0x99},
+ {value: 0x395a, lo: 0x9a, hi: 0x9a},
+ {value: 0x3a0a, lo: 0x9b, hi: 0x9b},
+ {value: 0x0012, lo: 0x9c, hi: 0x9d},
+ {value: 0x3abb, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0x9f, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x61, offset 0x2a9
+ {value: 0x0812, lo: 0x80, hi: 0x87},
+ {value: 0x0813, lo: 0x88, hi: 0x8f},
+ {value: 0x0812, lo: 0x90, hi: 0x95},
+ {value: 0x0813, lo: 0x98, hi: 0x9d},
+ {value: 0x0812, lo: 0xa0, hi: 0xa7},
+ {value: 0x0813, lo: 0xa8, hi: 0xaf},
+ {value: 0x0812, lo: 0xb0, hi: 0xb7},
+ {value: 0x0813, lo: 0xb8, hi: 0xbf},
+ // Block 0x62, offset 0x2b1
+ {value: 0x0004, lo: 0x8b, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8f},
+ {value: 0x0054, lo: 0x98, hi: 0x99},
+ {value: 0x0054, lo: 0xa4, hi: 0xa4},
+ {value: 0x0054, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xaa, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xaf},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x63, offset 0x2b9
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x94, hi: 0x94},
+ {value: 0x0014, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa6, hi: 0xaf},
+ {value: 0x0015, lo: 0xb1, hi: 0xb1},
+ {value: 0x0015, lo: 0xbf, hi: 0xbf},
+ // Block 0x64, offset 0x2bf
+ {value: 0x0015, lo: 0x90, hi: 0x9c},
+ // Block 0x65, offset 0x2c0
+ {value: 0x0024, lo: 0x90, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0xa0},
+ {value: 0x0024, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa4},
+ {value: 0x0034, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ // Block 0x66, offset 0x2ce
+ {value: 0x0016, lo: 0x85, hi: 0x86},
+ {value: 0x0012, lo: 0x87, hi: 0x89},
+ {value: 0xa452, lo: 0x8e, hi: 0x8e},
+ {value: 0x1013, lo: 0xa0, hi: 0xaf},
+ {value: 0x1012, lo: 0xb0, hi: 0xbf},
+ // Block 0x67, offset 0x2d3
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x88},
+ // Block 0x68, offset 0x2d6
+ {value: 0xa753, lo: 0xb6, hi: 0xb7},
+ {value: 0xaa53, lo: 0xb8, hi: 0xb9},
+ {value: 0xad53, lo: 0xba, hi: 0xbb},
+ {value: 0xaa53, lo: 0xbc, hi: 0xbd},
+ {value: 0xa753, lo: 0xbe, hi: 0xbf},
+ // Block 0x69, offset 0x2db
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6553, lo: 0x90, hi: 0x9f},
+ {value: 0xb053, lo: 0xa0, hi: 0xae},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0x6a, offset 0x2df
+ {value: 0x0117, lo: 0x80, hi: 0xa3},
+ {value: 0x0012, lo: 0xa4, hi: 0xa4},
+ {value: 0x0716, lo: 0xab, hi: 0xac},
+ {value: 0x0316, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb3},
+ // Block 0x6b, offset 0x2e5
+ {value: 0x6c52, lo: 0x80, hi: 0x9f},
+ {value: 0x7052, lo: 0xa0, hi: 0xa5},
+ {value: 0x7052, lo: 0xa7, hi: 0xa7},
+ {value: 0x7052, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x6c, offset 0x2ea
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x6d, offset 0x2ed
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0010, lo: 0xb0, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x6e, offset 0x2f2
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9e},
+ {value: 0x0024, lo: 0xa0, hi: 0xbf},
+ // Block 0x6f, offset 0x2f7
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ // Block 0x70, offset 0x2f8
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0xaa, hi: 0xad},
+ {value: 0x0030, lo: 0xae, hi: 0xaf},
+ {value: 0x0004, lo: 0xb1, hi: 0xb5},
+ {value: 0x0014, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ // Block 0x71, offset 0x2fe
+ {value: 0x0034, lo: 0x99, hi: 0x9a},
+ {value: 0x0004, lo: 0x9b, hi: 0x9e},
+ // Block 0x72, offset 0x300
+ {value: 0x0004, lo: 0xbc, hi: 0xbe},
+ // Block 0x73, offset 0x301
+ {value: 0x0010, lo: 0x85, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x74, offset 0x303
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x75, offset 0x305
+ {value: 0x0010, lo: 0x80, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0xbf},
+ // Block 0x76, offset 0x308
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ // Block 0x77, offset 0x309
+ {value: 0x0010, lo: 0x90, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x78, offset 0x30b
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0xab},
+ // Block 0x79, offset 0x30e
+ {value: 0x0117, lo: 0x80, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb2},
+ {value: 0x0024, lo: 0xb4, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x7a, offset 0x314
+ {value: 0x0117, lo: 0x80, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9d},
+ {value: 0x0024, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x7b, offset 0x318
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb1},
+ // Block 0x7c, offset 0x31a
+ {value: 0x0004, lo: 0x80, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xaf},
+ {value: 0x0012, lo: 0xb0, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xbf},
+ // Block 0x7d, offset 0x31f
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x0015, lo: 0xb0, hi: 0xb0},
+ {value: 0x0012, lo: 0xb1, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x8753, lo: 0xbd, hi: 0xbd},
+ {value: 0x0117, lo: 0xbe, hi: 0xbf},
+ // Block 0x7e, offset 0x326
+ {value: 0x0117, lo: 0x82, hi: 0x83},
+ {value: 0x6553, lo: 0x84, hi: 0x84},
+ {value: 0x908b, lo: 0x85, hi: 0x85},
+ {value: 0x8f53, lo: 0x86, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0316, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbf},
+ // Block 0x7f, offset 0x331
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x8c, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ // Block 0x80, offset 0x33b
+ {value: 0x0010, lo: 0x80, hi: 0xb3},
+ // Block 0x81, offset 0x33c
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xa0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb7},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x82, offset 0x345
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x83, offset 0x349
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0x92},
+ {value: 0x0030, lo: 0x93, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0x84, offset 0x34e
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x85, offset 0x356
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0004, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x86, offset 0x35c
+ {value: 0x0010, lo: 0x80, hi: 0xa8},
+ {value: 0x0014, lo: 0xa9, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0x87, offset 0x362
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x88, offset 0x36c
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0024, lo: 0xbe, hi: 0xbf},
+ // Block 0x89, offset 0x371
+ {value: 0x0024, lo: 0x81, hi: 0x81},
+ {value: 0x0004, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ // Block 0x8a, offset 0x37a
+ {value: 0x0010, lo: 0x81, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x8e},
+ {value: 0x0010, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8b, offset 0x380
+ {value: 0x0012, lo: 0x80, hi: 0x92},
+ {value: 0xb352, lo: 0x93, hi: 0x93},
+ {value: 0x0012, lo: 0x94, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa8},
+ {value: 0x0014, lo: 0xa9, hi: 0xa9},
+ {value: 0x0004, lo: 0xaa, hi: 0xab},
+ {value: 0x74d2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8c, offset 0x389
+ {value: 0x78d2, lo: 0x80, hi: 0x8f},
+ {value: 0x7cd2, lo: 0x90, hi: 0x9f},
+ {value: 0x80d2, lo: 0xa0, hi: 0xaf},
+ {value: 0x7cd2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8d, offset 0x38d
+ {value: 0x0010, lo: 0x80, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x8e, offset 0x395
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x8f, offset 0x397
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x8b, hi: 0xbb},
+ // Block 0x90, offset 0x399
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0xbf},
+ // Block 0x91, offset 0x39c
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0004, lo: 0xb2, hi: 0xbf},
+ // Block 0x92, offset 0x39e
+ {value: 0x0004, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x93, hi: 0xbf},
+ // Block 0x93, offset 0x3a0
+ {value: 0x0010, lo: 0x80, hi: 0xbd},
+ // Block 0x94, offset 0x3a1
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0x95, offset 0x3a2
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0xbf},
+ // Block 0x96, offset 0x3a4
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0xb0, hi: 0xbb},
+ // Block 0x97, offset 0x3a6
+ {value: 0x0014, lo: 0x80, hi: 0x8f},
+ {value: 0x0054, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0xa0, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xad},
+ {value: 0x0024, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ // Block 0x98, offset 0x3ac
+ {value: 0x0010, lo: 0x8d, hi: 0x8f},
+ {value: 0x0054, lo: 0x92, hi: 0x92},
+ {value: 0x0054, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0xb0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0x99, offset 0x3b1
+ {value: 0x0010, lo: 0x80, hi: 0xbc},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x9a, offset 0x3b3
+ {value: 0x0054, lo: 0x87, hi: 0x87},
+ {value: 0x0054, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0054, lo: 0x9a, hi: 0x9a},
+ {value: 0x5f53, lo: 0xa1, hi: 0xba},
+ {value: 0x0004, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9b, offset 0x3ba
+ {value: 0x0004, lo: 0x80, hi: 0x80},
+ {value: 0x5f52, lo: 0x81, hi: 0x9a},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ // Block 0x9c, offset 0x3bd
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbe},
+ // Block 0x9d, offset 0x3bf
+ {value: 0x0010, lo: 0x82, hi: 0x87},
+ {value: 0x0010, lo: 0x8a, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0x97},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0004, lo: 0xa3, hi: 0xa3},
+ {value: 0x0014, lo: 0xb9, hi: 0xbb},
+ // Block 0x9e, offset 0x3c5
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0010, lo: 0x8d, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xba},
+ {value: 0x0010, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9f, offset 0x3ca
+ {value: 0x0010, lo: 0x80, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x9d},
+ // Block 0xa0, offset 0x3cc
+ {value: 0x0010, lo: 0x80, hi: 0xba},
+ // Block 0xa1, offset 0x3cd
+ {value: 0x0010, lo: 0x80, hi: 0xb4},
+ // Block 0xa2, offset 0x3ce
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0xa3, offset 0x3cf
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa4, offset 0x3d1
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ // Block 0xa5, offset 0x3d3
+ {value: 0x0010, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xad, hi: 0xbf},
+ // Block 0xa6, offset 0x3d5
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0xb5},
+ {value: 0x0024, lo: 0xb6, hi: 0xba},
+ // Block 0xa7, offset 0x3d8
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa8, offset 0x3da
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x91, hi: 0x95},
+ // Block 0xa9, offset 0x3dd
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x97},
+ {value: 0xb653, lo: 0x98, hi: 0x9f},
+ {value: 0xb953, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbf},
+ // Block 0xaa, offset 0x3e5
+ {value: 0xb652, lo: 0x80, hi: 0x87},
+ {value: 0xb952, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xab, offset 0x3e8
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0xb953, lo: 0xb0, hi: 0xb7},
+ {value: 0xb653, lo: 0xb8, hi: 0xbf},
+ // Block 0xac, offset 0x3ec
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x93},
+ {value: 0xb952, lo: 0x98, hi: 0x9f},
+ {value: 0xb652, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbb},
+ // Block 0xad, offset 0x3f4
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xae, offset 0x3f6
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ // Block 0xaf, offset 0x3f7
+ {value: 0x0010, lo: 0x80, hi: 0xb6},
+ // Block 0xb0, offset 0x3f8
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ // Block 0xb1, offset 0x3fa
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xb2, offset 0x400
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xb3, offset 0x402
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ // Block 0xb4, offset 0x403
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ // Block 0xb5, offset 0x405
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb9},
+ // Block 0xb6, offset 0x407
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0xb7, offset 0x409
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x8e, hi: 0x8e},
+ {value: 0x0024, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x99, hi: 0xb5},
+ {value: 0x0024, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xb8, offset 0x416
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0xb9, offset 0x417
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ // Block 0xba, offset 0x418
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ // Block 0xbb, offset 0x41c
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ // Block 0xbc, offset 0x41e
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ // Block 0xbd, offset 0x41f
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ // Block 0xbe, offset 0x420
+ {value: 0x5653, lo: 0x80, hi: 0xb2},
+ // Block 0xbf, offset 0x421
+ {value: 0x5652, lo: 0x80, hi: 0xb2},
+ // Block 0xc0, offset 0x422
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc1, offset 0x425
+ {value: 0x0010, lo: 0x80, hi: 0xa9},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ // Block 0xc2, offset 0x428
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xc3, offset 0x42b
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x87},
+ {value: 0x0024, lo: 0x88, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x8b},
+ {value: 0x0024, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ // Block 0xc4, offset 0x431
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xc5, offset 0x432
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xc6, offset 0x434
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xc7, offset 0x438
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xc8, offset 0x43c
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ // Block 0xc9, offset 0x442
+ {value: 0x0014, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xca, offset 0x445
+ {value: 0x0024, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0xcb, offset 0x44c
+ {value: 0x0010, lo: 0x84, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ // Block 0xcc, offset 0x450
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xcd, offset 0x454
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x89, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ // Block 0xce, offset 0x45d
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb4},
+ {value: 0x0030, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xb7},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0xcf, offset 0x466
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xd0, offset 0x46c
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa2},
+ {value: 0x0014, lo: 0xa3, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xd1, offset 0x472
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xd2, offset 0x47c
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0030, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9d, hi: 0xa3},
+ {value: 0x0024, lo: 0xa6, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ // Block 0xd3, offset 0x486
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xd4, offset 0x488
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ // Block 0xd5, offset 0x491
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xd6, offset 0x497
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd7, offset 0x49d
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd8, offset 0x4a3
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x98, hi: 0x9b},
+ {value: 0x0014, lo: 0x9c, hi: 0x9d},
+ // Block 0xd9, offset 0x4a6
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xda, offset 0x4ac
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xdb, offset 0x4af
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0014, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb5},
+ {value: 0x0030, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ // Block 0xdc, offset 0x4b8
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ // Block 0xdd, offset 0x4b9
+ {value: 0x0014, lo: 0x9d, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xde, offset 0x4c0
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ // Block 0xdf, offset 0x4c4
+ {value: 0x5f53, lo: 0xa0, hi: 0xbf},
+ // Block 0xe0, offset 0x4c5
+ {value: 0x5f52, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xe1, offset 0x4c8
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8c, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ {value: 0x0030, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xe2, offset 0x4d2
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0034, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xe3, offset 0x4d5
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ {value: 0x0010, lo: 0xaa, hi: 0xbf},
+ // Block 0xe4, offset 0x4d7
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0014, lo: 0x94, hi: 0x97},
+ {value: 0x0014, lo: 0x9a, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0x9f},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ // Block 0xe5, offset 0x4de
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x8a},
+ {value: 0x0010, lo: 0x8b, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbe},
+ // Block 0xe6, offset 0x4e6
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0014, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x98},
+ {value: 0x0014, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0xbf},
+ // Block 0xe7, offset 0x4ec
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0014, lo: 0x8a, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9d, hi: 0x9d},
+ // Block 0xe8, offset 0x4f2
+ {value: 0x0010, lo: 0x80, hi: 0xb8},
+ // Block 0xe9, offset 0x4f3
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xea, offset 0x4f9
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0xeb, offset 0x4fc
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0014, lo: 0x92, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xa9},
+ {value: 0x0014, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0xec, offset 0x504
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb6},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xed, offset 0x50b
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa5},
+ {value: 0x0010, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xbf},
+ // Block 0xee, offset 0x515
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0014, lo: 0x90, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0x96},
+ {value: 0x0034, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xef, offset 0x51d
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ // Block 0xf0, offset 0x520
+ {value: 0x0010, lo: 0xb0, hi: 0xb0},
+ // Block 0xf1, offset 0x521
+ {value: 0x0010, lo: 0x80, hi: 0x99},
+ // Block 0xf2, offset 0x522
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ // Block 0xf3, offset 0x523
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ // Block 0xf4, offset 0x524
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ {value: 0x0014, lo: 0xb0, hi: 0xb8},
+ // Block 0xf5, offset 0x526
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ // Block 0xf6, offset 0x527
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xf7, offset 0x529
+ {value: 0x0010, lo: 0x90, hi: 0xad},
+ {value: 0x0034, lo: 0xb0, hi: 0xb4},
+ // Block 0xf8, offset 0x52b
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ // Block 0xf9, offset 0x52d
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa3, hi: 0xb7},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xfa, offset 0x531
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ // Block 0xfb, offset 0x532
+ {value: 0x2013, lo: 0x80, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xbf},
+ // Block 0xfc, offset 0x534
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xfd, offset 0x537
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0014, lo: 0x8f, hi: 0x9f},
+ // Block 0xfe, offset 0x539
+ {value: 0x0014, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa3, hi: 0xa4},
+ {value: 0x0030, lo: 0xb0, hi: 0xb1},
+ // Block 0xff, offset 0x53c
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbc},
+ // Block 0x100, offset 0x53e
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0034, lo: 0x9e, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa3},
+ // Block 0x101, offset 0x543
+ {value: 0x0030, lo: 0xa5, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xa9},
+ {value: 0x0030, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbf},
+ // Block 0x102, offset 0x548
+ {value: 0x0034, lo: 0x80, hi: 0x82},
+ {value: 0x0024, lo: 0x85, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8b},
+ {value: 0x0024, lo: 0xaa, hi: 0xad},
+ // Block 0x103, offset 0x54c
+ {value: 0x0024, lo: 0x82, hi: 0x84},
+ // Block 0x104, offset 0x54d
+ {value: 0x0013, lo: 0x80, hi: 0x99},
+ {value: 0x0012, lo: 0x9a, hi: 0xb3},
+ {value: 0x0013, lo: 0xb4, hi: 0xbf},
+ // Block 0x105, offset 0x550
+ {value: 0x0013, lo: 0x80, hi: 0x8d},
+ {value: 0x0012, lo: 0x8e, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0xa7},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x106, offset 0x554
+ {value: 0x0013, lo: 0x80, hi: 0x81},
+ {value: 0x0012, lo: 0x82, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0x9c},
+ {value: 0x0013, lo: 0x9e, hi: 0x9f},
+ {value: 0x0013, lo: 0xa2, hi: 0xa2},
+ {value: 0x0013, lo: 0xa5, hi: 0xa6},
+ {value: 0x0013, lo: 0xa9, hi: 0xac},
+ {value: 0x0013, lo: 0xae, hi: 0xb5},
+ {value: 0x0012, lo: 0xb6, hi: 0xb9},
+ {value: 0x0012, lo: 0xbb, hi: 0xbb},
+ {value: 0x0012, lo: 0xbd, hi: 0xbf},
+ // Block 0x107, offset 0x55f
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0012, lo: 0x85, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x108, offset 0x563
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0013, lo: 0x84, hi: 0x85},
+ {value: 0x0013, lo: 0x87, hi: 0x8a},
+ {value: 0x0013, lo: 0x8d, hi: 0x94},
+ {value: 0x0013, lo: 0x96, hi: 0x9c},
+ {value: 0x0012, lo: 0x9e, hi: 0xb7},
+ {value: 0x0013, lo: 0xb8, hi: 0xb9},
+ {value: 0x0013, lo: 0xbb, hi: 0xbe},
+ // Block 0x109, offset 0x56b
+ {value: 0x0013, lo: 0x80, hi: 0x84},
+ {value: 0x0013, lo: 0x86, hi: 0x86},
+ {value: 0x0013, lo: 0x8a, hi: 0x90},
+ {value: 0x0012, lo: 0x92, hi: 0xab},
+ {value: 0x0013, lo: 0xac, hi: 0xbf},
+ // Block 0x10a, offset 0x570
+ {value: 0x0013, lo: 0x80, hi: 0x85},
+ {value: 0x0012, lo: 0x86, hi: 0x9f},
+ {value: 0x0013, lo: 0xa0, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbf},
+ // Block 0x10b, offset 0x574
+ {value: 0x0012, lo: 0x80, hi: 0x93},
+ {value: 0x0013, lo: 0x94, hi: 0xad},
+ {value: 0x0012, lo: 0xae, hi: 0xbf},
+ // Block 0x10c, offset 0x577
+ {value: 0x0012, lo: 0x80, hi: 0x87},
+ {value: 0x0013, lo: 0x88, hi: 0xa1},
+ {value: 0x0012, lo: 0xa2, hi: 0xbb},
+ {value: 0x0013, lo: 0xbc, hi: 0xbf},
+ // Block 0x10d, offset 0x57b
+ {value: 0x0013, lo: 0x80, hi: 0x95},
+ {value: 0x0012, lo: 0x96, hi: 0xaf},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x10e, offset 0x57e
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0012, lo: 0x8a, hi: 0xa5},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x10f, offset 0x581
+ {value: 0x0013, lo: 0x80, hi: 0x80},
+ {value: 0x0012, lo: 0x82, hi: 0x9a},
+ {value: 0x0012, lo: 0x9c, hi: 0xa1},
+ {value: 0x0013, lo: 0xa2, hi: 0xba},
+ {value: 0x0012, lo: 0xbc, hi: 0xbf},
+ // Block 0x110, offset 0x586
+ {value: 0x0012, lo: 0x80, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0xb4},
+ {value: 0x0012, lo: 0xb6, hi: 0xbf},
+ // Block 0x111, offset 0x58a
+ {value: 0x0012, lo: 0x80, hi: 0x8e},
+ {value: 0x0012, lo: 0x90, hi: 0x95},
+ {value: 0x0013, lo: 0x96, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x112, offset 0x58e
+ {value: 0x0012, lo: 0x80, hi: 0x88},
+ {value: 0x0012, lo: 0x8a, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x113, offset 0x592
+ {value: 0x0012, lo: 0x80, hi: 0x82},
+ {value: 0x0012, lo: 0x84, hi: 0x89},
+ {value: 0x0017, lo: 0x8a, hi: 0x8b},
+ {value: 0x0010, lo: 0x8e, hi: 0xbf},
+ // Block 0x114, offset 0x596
+ {value: 0x0014, lo: 0x80, hi: 0xb6},
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x115, offset 0x598
+ {value: 0x0014, lo: 0x80, hi: 0xac},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x116, offset 0x59a
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x9b, hi: 0x9f},
+ {value: 0x0014, lo: 0xa1, hi: 0xaf},
+ // Block 0x117, offset 0x59d
+ {value: 0x0024, lo: 0x80, hi: 0x86},
+ {value: 0x0024, lo: 0x88, hi: 0x98},
+ {value: 0x0024, lo: 0x9b, hi: 0xa1},
+ {value: 0x0024, lo: 0xa3, hi: 0xa4},
+ {value: 0x0024, lo: 0xa6, hi: 0xaa},
+ // Block 0x118, offset 0x5a2
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ // Block 0x119, offset 0x5a5
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ // Block 0x11a, offset 0x5a7
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0024, lo: 0xac, hi: 0xaf},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x11b, offset 0x5aa
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0034, lo: 0x90, hi: 0x96},
+ // Block 0x11c, offset 0x5ac
+ {value: 0xbc52, lo: 0x80, hi: 0x81},
+ {value: 0xbf52, lo: 0x82, hi: 0x83},
+ {value: 0x0024, lo: 0x84, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x11d, offset 0x5b2
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x9f},
+ {value: 0x0010, lo: 0xa1, hi: 0xa2},
+ {value: 0x0010, lo: 0xa4, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb7},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ // Block 0x11e, offset 0x5bb
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x9b},
+ {value: 0x0010, lo: 0xa1, hi: 0xa3},
+ {value: 0x0010, lo: 0xa5, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xbb},
+ // Block 0x11f, offset 0x5c0
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x120, offset 0x5c1
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x121, offset 0x5c4
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ // Block 0x122, offset 0x5c5
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x123, offset 0x5c6
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x124, offset 0x5c7
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0014, lo: 0xa0, hi: 0xbf},
+ // Block 0x125, offset 0x5c9
+ {value: 0x0014, lo: 0x80, hi: 0xbf},
+ // Block 0x126, offset 0x5ca
+ {value: 0x0014, lo: 0x80, hi: 0xaf},
+}
+
+// Total table size 15212 bytes (14KiB); checksum: 1EB13752
diff --git a/vendor/golang.org/x/text/cases/tables15.0.0.go b/vendor/golang.org/x/text/cases/tables15.0.0.go
new file mode 100644
index 00000000000..aee0f310851
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/tables15.0.0.go
@@ -0,0 +1,2527 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+//go:build go1.21
+
+package cases
+
+// UnicodeVersion is the Unicode version from which the tables in this package are derived.
+const UnicodeVersion = "15.0.0"
+
+var xorData string = "" + // Size: 213 bytes
+ "\x00\x06\x07\x00\x01?\x00\x0f\x03\x00\x0f\x12\x00\x0f\x1f\x00\x0f\x1d" +
+ "\x00\x01\x13\x00\x0f\x16\x00\x0f\x0b\x00\x0f3\x00\x0f7\x00\x01#\x00\x0f?" +
+ "\x00\x0e'\x00\x0f/\x00\x0e>\x00\x0f*\x00\x0c&\x00\x0c*\x00\x0c;\x00\x0c9" +
+ "\x00\x0c%\x00\x01\x08\x00\x03\x0d\x00\x03\x09\x00\x02\x06\x00\x02\x02" +
+ "\x00\x02\x0c\x00\x01\x00\x00\x01\x03\x00\x01\x01\x00\x01 \x00\x01\x0c" +
+ "\x00\x01\x10\x00\x03\x10\x00\x036 \x00\x037 \x00\x0b#\x10\x00\x0b 0\x00" +
+ "\x0b!\x10\x00\x0b!0\x001\x00\x00\x0b(\x04\x00\x03\x04\x1e\x00\x0b)\x08" +
+ "\x00\x03\x0a\x00\x02:\x00\x02>\x00\x02,\x00\x02\x00\x00\x02\x10\x00\x01<" +
+ "\x00\x01&\x00\x01*\x00\x01.\x00\x010\x003 \x00\x01\x18\x00\x01(\x00\x03'" +
+ "\x00\x03)\x00\x03+\x00\x03/\x00\x03\x19\x00\x03\x1b\x00\x03\x1f\x00\x01" +
+ "\x1e\x00\x01\x22"
+
+var exceptions string = "" + // Size: 2450 bytes
+ "\x00\x12\x12μΜΜ\x12\x12ssSSSs\x13\x18i̇i̇\x10\x09II\x13\x1bʼnʼNʼN\x11" +
+ "\x09sSS\x12\x12dždžDž\x12\x12dždžDŽ\x10\x12DŽDž\x12\x12ljljLj\x12\x12ljljLJ\x10\x12LJLj" +
+ "\x12\x12njnjNj\x12\x12njnjNJ\x10\x12NJNj\x13\x1bǰJ̌J̌\x12\x12dzdzDz\x12\x12dzdzDZ\x10" +
+ "\x12DZDz\x13\x18ⱥⱥ\x13\x18ⱦⱦ\x10\x1bⱾⱾ\x10\x1bⱿⱿ\x10\x1bⱯⱯ\x10\x1bⱭⱭ\x10" +
+ "\x1bⱰⱰ\x10\x1bꞫꞫ\x10\x1bꞬꞬ\x10\x1bꞍꞍ\x10\x1bꞪꞪ\x10\x1bꞮꞮ\x10\x1bⱢⱢ\x10" +
+ "\x1bꞭꞭ\x10\x1bⱮⱮ\x10\x1bⱤⱤ\x10\x1bꟅꟅ\x10\x1bꞱꞱ\x10\x1bꞲꞲ\x10\x1bꞰꞰ2\x12ι" +
+ "ΙΙ\x166ΐΪ́Ϊ́\x166ΰΫ́Ϋ́\x12\x12σΣΣ\x12\x12βΒΒ\x12\x12θΘΘ\x12\x12" +
+ "φΦΦ\x12\x12πΠΠ\x12\x12κΚΚ\x12\x12ρΡΡ\x12\x12εΕΕ\x14$եւԵՒԵւ\x10\x1bᲐა" +
+ "\x10\x1bᲑბ\x10\x1bᲒგ\x10\x1bᲓდ\x10\x1bᲔე\x10\x1bᲕვ\x10\x1bᲖზ\x10\x1bᲗთ" +
+ "\x10\x1bᲘი\x10\x1bᲙკ\x10\x1bᲚლ\x10\x1bᲛმ\x10\x1bᲜნ\x10\x1bᲝო\x10\x1bᲞპ" +
+ "\x10\x1bᲟჟ\x10\x1bᲠრ\x10\x1bᲡს\x10\x1bᲢტ\x10\x1bᲣუ\x10\x1bᲤფ\x10\x1bᲥქ" +
+ "\x10\x1bᲦღ\x10\x1bᲧყ\x10\x1bᲨშ\x10\x1bᲩჩ\x10\x1bᲪც\x10\x1bᲫძ\x10\x1bᲬწ" +
+ "\x10\x1bᲭჭ\x10\x1bᲮხ\x10\x1bᲯჯ\x10\x1bᲰჰ\x10\x1bᲱჱ\x10\x1bᲲჲ\x10\x1bᲳჳ" +
+ "\x10\x1bᲴჴ\x10\x1bᲵჵ\x10\x1bᲶჶ\x10\x1bᲷჷ\x10\x1bᲸჸ\x10\x1bᲹჹ\x10\x1bᲺჺ" +
+ "\x10\x1bᲽჽ\x10\x1bᲾჾ\x10\x1bᲿჿ\x12\x12вВВ\x12\x12дДД\x12\x12оОО\x12\x12с" +
+ "СС\x12\x12тТТ\x12\x12тТТ\x12\x12ъЪЪ\x12\x12ѣѢѢ\x13\x1bꙋꙊꙊ\x13\x1bẖH̱H̱" +
+ "\x13\x1bẗT̈T̈\x13\x1bẘW̊W̊\x13\x1bẙY̊Y̊\x13\x1baʾAʾAʾ\x13\x1bṡṠṠ\x12" +
+ "\x10ssß\x14$ὐΥ̓Υ̓\x166ὒΥ̓̀Υ̓̀\x166ὔΥ̓́Υ̓́\x166ὖΥ̓͂Υ̓͂\x15+ἀιἈΙᾈ" +
+ "\x15+ἁιἉΙᾉ\x15+ἂιἊΙᾊ\x15+ἃιἋΙᾋ\x15+ἄιἌΙᾌ\x15+ἅιἍΙᾍ\x15+ἆιἎΙᾎ\x15+ἇιἏΙᾏ" +
+ "\x15\x1dἀιᾀἈΙ\x15\x1dἁιᾁἉΙ\x15\x1dἂιᾂἊΙ\x15\x1dἃιᾃἋΙ\x15\x1dἄιᾄἌΙ\x15" +
+ "\x1dἅιᾅἍΙ\x15\x1dἆιᾆἎΙ\x15\x1dἇιᾇἏΙ\x15+ἠιἨΙᾘ\x15+ἡιἩΙᾙ\x15+ἢιἪΙᾚ\x15+ἣι" +
+ "ἫΙᾛ\x15+ἤιἬΙᾜ\x15+ἥιἭΙᾝ\x15+ἦιἮΙᾞ\x15+ἧιἯΙᾟ\x15\x1dἠιᾐἨΙ\x15\x1dἡιᾑἩΙ" +
+ "\x15\x1dἢιᾒἪΙ\x15\x1dἣιᾓἫΙ\x15\x1dἤιᾔἬΙ\x15\x1dἥιᾕἭΙ\x15\x1dἦιᾖἮΙ\x15" +
+ "\x1dἧιᾗἯΙ\x15+ὠιὨΙᾨ\x15+ὡιὩΙᾩ\x15+ὢιὪΙᾪ\x15+ὣιὫΙᾫ\x15+ὤιὬΙᾬ\x15+ὥιὭΙᾭ" +
+ "\x15+ὦιὮΙᾮ\x15+ὧιὯΙᾯ\x15\x1dὠιᾠὨΙ\x15\x1dὡιᾡὩΙ\x15\x1dὢιᾢὪΙ\x15\x1dὣιᾣὫΙ" +
+ "\x15\x1dὤιᾤὬΙ\x15\x1dὥιᾥὭΙ\x15\x1dὦιᾦὮΙ\x15\x1dὧιᾧὯΙ\x15-ὰιᾺΙᾺͅ\x14#αιΑΙ" +
+ "ᾼ\x14$άιΆΙΆͅ\x14$ᾶΑ͂Α͂\x166ᾶιΑ͂Ιᾼ͂\x14\x1cαιᾳΑΙ\x12\x12ιΙΙ\x15-ὴιῊΙ" +
+ "Ὴͅ\x14#ηιΗΙῌ\x14$ήιΉΙΉͅ\x14$ῆΗ͂Η͂\x166ῆιΗ͂Ιῌ͂\x14\x1cηιῃΗΙ\x166ῒΙ" +
+ "̈̀Ϊ̀\x166ΐΪ́Ϊ́\x14$ῖΙ͂Ι͂\x166ῗΪ͂Ϊ͂\x166ῢΫ̀Ϋ̀\x166ΰΫ́Ϋ" +
+ "́\x14$ῤΡ̓Ρ̓\x14$ῦΥ͂Υ͂\x166ῧΫ͂Ϋ͂\x15-ὼιῺΙῺͅ\x14#ωιΩΙῼ\x14$ώιΏΙΏͅ" +
+ "\x14$ῶΩ͂Ω͂\x166ῶιΩ͂Ιῼ͂\x14\x1cωιῳΩΙ\x12\x10ωω\x11\x08kk\x12\x10åå\x12" +
+ "\x10ɫɫ\x12\x10ɽɽ\x10\x12ȺȺ\x10\x12ȾȾ\x12\x10ɑɑ\x12\x10ɱɱ\x12\x10ɐɐ\x12" +
+ "\x10ɒɒ\x12\x10ȿȿ\x12\x10ɀɀ\x12\x10ɥɥ\x12\x10ɦɦ\x12\x10ɜɜ\x12\x10ɡɡ\x12" +
+ "\x10ɬɬ\x12\x10ɪɪ\x12\x10ʞʞ\x12\x10ʇʇ\x12\x10ʝʝ\x12\x10ʂʂ\x12\x12ffFFFf" +
+ "\x12\x12fiFIFi\x12\x12flFLFl\x13\x1bffiFFIFfi\x13\x1bfflFFLFfl\x12\x12st" +
+ "STSt\x12\x12stSTSt\x14$մնՄՆՄն\x14$մեՄԵՄե\x14$միՄԻՄի\x14$վնՎՆՎն\x14$մխՄԽՄ" +
+ "խ"
+
+// lookup returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookup(s []byte) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupUnsafe(s []byte) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// lookupString returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookupString(s string) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupStringUnsafe(s string) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// caseTrie. Total size: 13398 bytes (13.08 KiB). Checksum: 544af6e6b1b70931.
+type caseTrie struct{}
+
+func newCaseTrie(i int) *caseTrie {
+ return &caseTrie{}
+}
+
+// lookupValue determines the type of block n and looks up the value for b.
+func (t *caseTrie) lookupValue(n uint32, b byte) uint16 {
+ switch {
+ case n < 22:
+ return uint16(caseValues[n<<6+uint32(b)])
+ default:
+ n -= 22
+ return uint16(sparse.lookup(n, b))
+ }
+}
+
+// caseValues: 24 blocks, 1536 entries, 3072 bytes
+// The third block is the zero block.
+var caseValues = [1536]uint16{
+ // Block 0x0, offset 0x0
+ 0x27: 0x0054,
+ 0x2e: 0x0054,
+ 0x30: 0x0010, 0x31: 0x0010, 0x32: 0x0010, 0x33: 0x0010, 0x34: 0x0010, 0x35: 0x0010,
+ 0x36: 0x0010, 0x37: 0x0010, 0x38: 0x0010, 0x39: 0x0010, 0x3a: 0x0054,
+ // Block 0x1, offset 0x40
+ 0x41: 0x2013, 0x42: 0x2013, 0x43: 0x2013, 0x44: 0x2013, 0x45: 0x2013,
+ 0x46: 0x2013, 0x47: 0x2013, 0x48: 0x2013, 0x49: 0x2013, 0x4a: 0x2013, 0x4b: 0x2013,
+ 0x4c: 0x2013, 0x4d: 0x2013, 0x4e: 0x2013, 0x4f: 0x2013, 0x50: 0x2013, 0x51: 0x2013,
+ 0x52: 0x2013, 0x53: 0x2013, 0x54: 0x2013, 0x55: 0x2013, 0x56: 0x2013, 0x57: 0x2013,
+ 0x58: 0x2013, 0x59: 0x2013, 0x5a: 0x2013,
+ 0x5e: 0x0004, 0x5f: 0x0010, 0x60: 0x0004, 0x61: 0x2012, 0x62: 0x2012, 0x63: 0x2012,
+ 0x64: 0x2012, 0x65: 0x2012, 0x66: 0x2012, 0x67: 0x2012, 0x68: 0x2012, 0x69: 0x2012,
+ 0x6a: 0x2012, 0x6b: 0x2012, 0x6c: 0x2012, 0x6d: 0x2012, 0x6e: 0x2012, 0x6f: 0x2012,
+ 0x70: 0x2012, 0x71: 0x2012, 0x72: 0x2012, 0x73: 0x2012, 0x74: 0x2012, 0x75: 0x2012,
+ 0x76: 0x2012, 0x77: 0x2012, 0x78: 0x2012, 0x79: 0x2012, 0x7a: 0x2012,
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc0: 0x0852, 0xc1: 0x0b53, 0xc2: 0x0113, 0xc3: 0x0112, 0xc4: 0x0113, 0xc5: 0x0112,
+ 0xc6: 0x0b53, 0xc7: 0x0f13, 0xc8: 0x0f12, 0xc9: 0x0e53, 0xca: 0x1153, 0xcb: 0x0713,
+ 0xcc: 0x0712, 0xcd: 0x0012, 0xce: 0x1453, 0xcf: 0x1753, 0xd0: 0x1a53, 0xd1: 0x0313,
+ 0xd2: 0x0312, 0xd3: 0x1d53, 0xd4: 0x2053, 0xd5: 0x2352, 0xd6: 0x2653, 0xd7: 0x2653,
+ 0xd8: 0x0113, 0xd9: 0x0112, 0xda: 0x2952, 0xdb: 0x0012, 0xdc: 0x1d53, 0xdd: 0x2c53,
+ 0xde: 0x2f52, 0xdf: 0x3253, 0xe0: 0x0113, 0xe1: 0x0112, 0xe2: 0x0113, 0xe3: 0x0112,
+ 0xe4: 0x0113, 0xe5: 0x0112, 0xe6: 0x3553, 0xe7: 0x0f13, 0xe8: 0x0f12, 0xe9: 0x3853,
+ 0xea: 0x0012, 0xeb: 0x0012, 0xec: 0x0113, 0xed: 0x0112, 0xee: 0x3553, 0xef: 0x1f13,
+ 0xf0: 0x1f12, 0xf1: 0x3b53, 0xf2: 0x3e53, 0xf3: 0x0713, 0xf4: 0x0712, 0xf5: 0x0313,
+ 0xf6: 0x0312, 0xf7: 0x4153, 0xf8: 0x0113, 0xf9: 0x0112, 0xfa: 0x0012, 0xfb: 0x0010,
+ 0xfc: 0x0113, 0xfd: 0x0112, 0xfe: 0x0012, 0xff: 0x4452,
+ // Block 0x4, offset 0x100
+ 0x100: 0x0010, 0x101: 0x0010, 0x102: 0x0010, 0x103: 0x0010, 0x104: 0x02db, 0x105: 0x0359,
+ 0x106: 0x03da, 0x107: 0x043b, 0x108: 0x04b9, 0x109: 0x053a, 0x10a: 0x059b, 0x10b: 0x0619,
+ 0x10c: 0x069a, 0x10d: 0x0313, 0x10e: 0x0312, 0x10f: 0x1f13, 0x110: 0x1f12, 0x111: 0x0313,
+ 0x112: 0x0312, 0x113: 0x0713, 0x114: 0x0712, 0x115: 0x0313, 0x116: 0x0312, 0x117: 0x0f13,
+ 0x118: 0x0f12, 0x119: 0x0313, 0x11a: 0x0312, 0x11b: 0x0713, 0x11c: 0x0712, 0x11d: 0x1452,
+ 0x11e: 0x0113, 0x11f: 0x0112, 0x120: 0x0113, 0x121: 0x0112, 0x122: 0x0113, 0x123: 0x0112,
+ 0x124: 0x0113, 0x125: 0x0112, 0x126: 0x0113, 0x127: 0x0112, 0x128: 0x0113, 0x129: 0x0112,
+ 0x12a: 0x0113, 0x12b: 0x0112, 0x12c: 0x0113, 0x12d: 0x0112, 0x12e: 0x0113, 0x12f: 0x0112,
+ 0x130: 0x06fa, 0x131: 0x07ab, 0x132: 0x0829, 0x133: 0x08aa, 0x134: 0x0113, 0x135: 0x0112,
+ 0x136: 0x2353, 0x137: 0x4453, 0x138: 0x0113, 0x139: 0x0112, 0x13a: 0x0113, 0x13b: 0x0112,
+ 0x13c: 0x0113, 0x13d: 0x0112, 0x13e: 0x0113, 0x13f: 0x0112,
+ // Block 0x5, offset 0x140
+ 0x140: 0x0a8a, 0x141: 0x0313, 0x142: 0x0312, 0x143: 0x0853, 0x144: 0x4753, 0x145: 0x4a53,
+ 0x146: 0x0113, 0x147: 0x0112, 0x148: 0x0113, 0x149: 0x0112, 0x14a: 0x0113, 0x14b: 0x0112,
+ 0x14c: 0x0113, 0x14d: 0x0112, 0x14e: 0x0113, 0x14f: 0x0112, 0x150: 0x0b0a, 0x151: 0x0b8a,
+ 0x152: 0x0c0a, 0x153: 0x0b52, 0x154: 0x0b52, 0x155: 0x0012, 0x156: 0x0e52, 0x157: 0x1152,
+ 0x158: 0x0012, 0x159: 0x1752, 0x15a: 0x0012, 0x15b: 0x1a52, 0x15c: 0x0c8a, 0x15d: 0x0012,
+ 0x15e: 0x0012, 0x15f: 0x0012, 0x160: 0x1d52, 0x161: 0x0d0a, 0x162: 0x0012, 0x163: 0x2052,
+ 0x164: 0x0012, 0x165: 0x0d8a, 0x166: 0x0e0a, 0x167: 0x0012, 0x168: 0x2652, 0x169: 0x2652,
+ 0x16a: 0x0e8a, 0x16b: 0x0f0a, 0x16c: 0x0f8a, 0x16d: 0x0012, 0x16e: 0x0012, 0x16f: 0x1d52,
+ 0x170: 0x0012, 0x171: 0x100a, 0x172: 0x2c52, 0x173: 0x0012, 0x174: 0x0012, 0x175: 0x3252,
+ 0x176: 0x0012, 0x177: 0x0012, 0x178: 0x0012, 0x179: 0x0012, 0x17a: 0x0012, 0x17b: 0x0012,
+ 0x17c: 0x0012, 0x17d: 0x108a, 0x17e: 0x0012, 0x17f: 0x0012,
+ // Block 0x6, offset 0x180
+ 0x180: 0x3552, 0x181: 0x0012, 0x182: 0x110a, 0x183: 0x3852, 0x184: 0x0012, 0x185: 0x0012,
+ 0x186: 0x0012, 0x187: 0x118a, 0x188: 0x3552, 0x189: 0x4752, 0x18a: 0x3b52, 0x18b: 0x3e52,
+ 0x18c: 0x4a52, 0x18d: 0x0012, 0x18e: 0x0012, 0x18f: 0x0012, 0x190: 0x0012, 0x191: 0x0012,
+ 0x192: 0x4152, 0x193: 0x0012, 0x194: 0x0010, 0x195: 0x0012, 0x196: 0x0012, 0x197: 0x0012,
+ 0x198: 0x0012, 0x199: 0x0012, 0x19a: 0x0012, 0x19b: 0x0012, 0x19c: 0x0012, 0x19d: 0x120a,
+ 0x19e: 0x128a, 0x19f: 0x0012, 0x1a0: 0x0012, 0x1a1: 0x0012, 0x1a2: 0x0012, 0x1a3: 0x0012,
+ 0x1a4: 0x0012, 0x1a5: 0x0012, 0x1a6: 0x0012, 0x1a7: 0x0012, 0x1a8: 0x0012, 0x1a9: 0x0012,
+ 0x1aa: 0x0012, 0x1ab: 0x0012, 0x1ac: 0x0012, 0x1ad: 0x0012, 0x1ae: 0x0012, 0x1af: 0x0012,
+ 0x1b0: 0x0015, 0x1b1: 0x0015, 0x1b2: 0x0015, 0x1b3: 0x0015, 0x1b4: 0x0015, 0x1b5: 0x0015,
+ 0x1b6: 0x0015, 0x1b7: 0x0015, 0x1b8: 0x0015, 0x1b9: 0x0014, 0x1ba: 0x0014, 0x1bb: 0x0014,
+ 0x1bc: 0x0014, 0x1bd: 0x0014, 0x1be: 0x0014, 0x1bf: 0x0014,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x0024, 0x1c1: 0x0024, 0x1c2: 0x0024, 0x1c3: 0x0024, 0x1c4: 0x0024, 0x1c5: 0x130d,
+ 0x1c6: 0x0024, 0x1c7: 0x0034, 0x1c8: 0x0034, 0x1c9: 0x0034, 0x1ca: 0x0024, 0x1cb: 0x0024,
+ 0x1cc: 0x0024, 0x1cd: 0x0034, 0x1ce: 0x0034, 0x1cf: 0x0014, 0x1d0: 0x0024, 0x1d1: 0x0024,
+ 0x1d2: 0x0024, 0x1d3: 0x0034, 0x1d4: 0x0034, 0x1d5: 0x0034, 0x1d6: 0x0034, 0x1d7: 0x0024,
+ 0x1d8: 0x0034, 0x1d9: 0x0034, 0x1da: 0x0034, 0x1db: 0x0024, 0x1dc: 0x0034, 0x1dd: 0x0034,
+ 0x1de: 0x0034, 0x1df: 0x0034, 0x1e0: 0x0034, 0x1e1: 0x0034, 0x1e2: 0x0034, 0x1e3: 0x0024,
+ 0x1e4: 0x0024, 0x1e5: 0x0024, 0x1e6: 0x0024, 0x1e7: 0x0024, 0x1e8: 0x0024, 0x1e9: 0x0024,
+ 0x1ea: 0x0024, 0x1eb: 0x0024, 0x1ec: 0x0024, 0x1ed: 0x0024, 0x1ee: 0x0024, 0x1ef: 0x0024,
+ 0x1f0: 0x0113, 0x1f1: 0x0112, 0x1f2: 0x0113, 0x1f3: 0x0112, 0x1f4: 0x0014, 0x1f5: 0x0004,
+ 0x1f6: 0x0113, 0x1f7: 0x0112, 0x1fa: 0x0015, 0x1fb: 0x4d52,
+ 0x1fc: 0x5052, 0x1fd: 0x5052, 0x1ff: 0x5353,
+ // Block 0x8, offset 0x200
+ 0x204: 0x0004, 0x205: 0x0004,
+ 0x206: 0x2a13, 0x207: 0x0054, 0x208: 0x2513, 0x209: 0x2713, 0x20a: 0x2513,
+ 0x20c: 0x5653, 0x20e: 0x5953, 0x20f: 0x5c53, 0x210: 0x138a, 0x211: 0x2013,
+ 0x212: 0x2013, 0x213: 0x2013, 0x214: 0x2013, 0x215: 0x2013, 0x216: 0x2013, 0x217: 0x2013,
+ 0x218: 0x2013, 0x219: 0x2013, 0x21a: 0x2013, 0x21b: 0x2013, 0x21c: 0x2013, 0x21d: 0x2013,
+ 0x21e: 0x2013, 0x21f: 0x2013, 0x220: 0x5f53, 0x221: 0x5f53, 0x223: 0x5f53,
+ 0x224: 0x5f53, 0x225: 0x5f53, 0x226: 0x5f53, 0x227: 0x5f53, 0x228: 0x5f53, 0x229: 0x5f53,
+ 0x22a: 0x5f53, 0x22b: 0x5f53, 0x22c: 0x2a12, 0x22d: 0x2512, 0x22e: 0x2712, 0x22f: 0x2512,
+ 0x230: 0x14ca, 0x231: 0x2012, 0x232: 0x2012, 0x233: 0x2012, 0x234: 0x2012, 0x235: 0x2012,
+ 0x236: 0x2012, 0x237: 0x2012, 0x238: 0x2012, 0x239: 0x2012, 0x23a: 0x2012, 0x23b: 0x2012,
+ 0x23c: 0x2012, 0x23d: 0x2012, 0x23e: 0x2012, 0x23f: 0x2012,
+ // Block 0x9, offset 0x240
+ 0x240: 0x5f52, 0x241: 0x5f52, 0x242: 0x160a, 0x243: 0x5f52, 0x244: 0x5f52, 0x245: 0x5f52,
+ 0x246: 0x5f52, 0x247: 0x5f52, 0x248: 0x5f52, 0x249: 0x5f52, 0x24a: 0x5f52, 0x24b: 0x5f52,
+ 0x24c: 0x5652, 0x24d: 0x5952, 0x24e: 0x5c52, 0x24f: 0x1813, 0x250: 0x168a, 0x251: 0x170a,
+ 0x252: 0x0013, 0x253: 0x0013, 0x254: 0x0013, 0x255: 0x178a, 0x256: 0x180a, 0x257: 0x1812,
+ 0x258: 0x0113, 0x259: 0x0112, 0x25a: 0x0113, 0x25b: 0x0112, 0x25c: 0x0113, 0x25d: 0x0112,
+ 0x25e: 0x0113, 0x25f: 0x0112, 0x260: 0x0113, 0x261: 0x0112, 0x262: 0x0113, 0x263: 0x0112,
+ 0x264: 0x0113, 0x265: 0x0112, 0x266: 0x0113, 0x267: 0x0112, 0x268: 0x0113, 0x269: 0x0112,
+ 0x26a: 0x0113, 0x26b: 0x0112, 0x26c: 0x0113, 0x26d: 0x0112, 0x26e: 0x0113, 0x26f: 0x0112,
+ 0x270: 0x188a, 0x271: 0x190a, 0x272: 0x0b12, 0x273: 0x5352, 0x274: 0x6253, 0x275: 0x198a,
+ 0x277: 0x0f13, 0x278: 0x0f12, 0x279: 0x0b13, 0x27a: 0x0113, 0x27b: 0x0112,
+ 0x27c: 0x0012, 0x27d: 0x4d53, 0x27e: 0x5053, 0x27f: 0x5053,
+ // Block 0xa, offset 0x280
+ 0x280: 0x6852, 0x281: 0x6852, 0x282: 0x6852, 0x283: 0x6852, 0x284: 0x6852, 0x285: 0x6852,
+ 0x286: 0x6852, 0x287: 0x1a0a, 0x288: 0x0012, 0x28a: 0x0010,
+ 0x291: 0x0034,
+ 0x292: 0x0024, 0x293: 0x0024, 0x294: 0x0024, 0x295: 0x0024, 0x296: 0x0034, 0x297: 0x0024,
+ 0x298: 0x0024, 0x299: 0x0024, 0x29a: 0x0034, 0x29b: 0x0034, 0x29c: 0x0024, 0x29d: 0x0024,
+ 0x29e: 0x0024, 0x29f: 0x0024, 0x2a0: 0x0024, 0x2a1: 0x0024, 0x2a2: 0x0034, 0x2a3: 0x0034,
+ 0x2a4: 0x0034, 0x2a5: 0x0034, 0x2a6: 0x0034, 0x2a7: 0x0034, 0x2a8: 0x0024, 0x2a9: 0x0024,
+ 0x2aa: 0x0034, 0x2ab: 0x0024, 0x2ac: 0x0024, 0x2ad: 0x0034, 0x2ae: 0x0034, 0x2af: 0x0024,
+ 0x2b0: 0x0034, 0x2b1: 0x0034, 0x2b2: 0x0034, 0x2b3: 0x0034, 0x2b4: 0x0034, 0x2b5: 0x0034,
+ 0x2b6: 0x0034, 0x2b7: 0x0034, 0x2b8: 0x0034, 0x2b9: 0x0034, 0x2ba: 0x0034, 0x2bb: 0x0034,
+ 0x2bc: 0x0034, 0x2bd: 0x0034, 0x2bf: 0x0034,
+ // Block 0xb, offset 0x2c0
+ 0x2c0: 0x0010, 0x2c1: 0x0010, 0x2c2: 0x0010, 0x2c3: 0x0010, 0x2c4: 0x0010, 0x2c5: 0x0010,
+ 0x2c6: 0x0010, 0x2c7: 0x0010, 0x2c8: 0x0010, 0x2c9: 0x0014, 0x2ca: 0x0024, 0x2cb: 0x0024,
+ 0x2cc: 0x0024, 0x2cd: 0x0024, 0x2ce: 0x0024, 0x2cf: 0x0034, 0x2d0: 0x0034, 0x2d1: 0x0034,
+ 0x2d2: 0x0034, 0x2d3: 0x0034, 0x2d4: 0x0024, 0x2d5: 0x0024, 0x2d6: 0x0024, 0x2d7: 0x0024,
+ 0x2d8: 0x0024, 0x2d9: 0x0024, 0x2da: 0x0024, 0x2db: 0x0024, 0x2dc: 0x0024, 0x2dd: 0x0024,
+ 0x2de: 0x0024, 0x2df: 0x0024, 0x2e0: 0x0024, 0x2e1: 0x0024, 0x2e2: 0x0014, 0x2e3: 0x0034,
+ 0x2e4: 0x0024, 0x2e5: 0x0024, 0x2e6: 0x0034, 0x2e7: 0x0024, 0x2e8: 0x0024, 0x2e9: 0x0034,
+ 0x2ea: 0x0024, 0x2eb: 0x0024, 0x2ec: 0x0024, 0x2ed: 0x0034, 0x2ee: 0x0034, 0x2ef: 0x0034,
+ 0x2f0: 0x0034, 0x2f1: 0x0034, 0x2f2: 0x0034, 0x2f3: 0x0024, 0x2f4: 0x0024, 0x2f5: 0x0024,
+ 0x2f6: 0x0034, 0x2f7: 0x0024, 0x2f8: 0x0024, 0x2f9: 0x0034, 0x2fa: 0x0034, 0x2fb: 0x0024,
+ 0x2fc: 0x0024, 0x2fd: 0x0024, 0x2fe: 0x0024, 0x2ff: 0x0024,
+ // Block 0xc, offset 0x300
+ 0x300: 0x7053, 0x301: 0x7053, 0x302: 0x7053, 0x303: 0x7053, 0x304: 0x7053, 0x305: 0x7053,
+ 0x307: 0x7053,
+ 0x30d: 0x7053, 0x310: 0x1aea, 0x311: 0x1b6a,
+ 0x312: 0x1bea, 0x313: 0x1c6a, 0x314: 0x1cea, 0x315: 0x1d6a, 0x316: 0x1dea, 0x317: 0x1e6a,
+ 0x318: 0x1eea, 0x319: 0x1f6a, 0x31a: 0x1fea, 0x31b: 0x206a, 0x31c: 0x20ea, 0x31d: 0x216a,
+ 0x31e: 0x21ea, 0x31f: 0x226a, 0x320: 0x22ea, 0x321: 0x236a, 0x322: 0x23ea, 0x323: 0x246a,
+ 0x324: 0x24ea, 0x325: 0x256a, 0x326: 0x25ea, 0x327: 0x266a, 0x328: 0x26ea, 0x329: 0x276a,
+ 0x32a: 0x27ea, 0x32b: 0x286a, 0x32c: 0x28ea, 0x32d: 0x296a, 0x32e: 0x29ea, 0x32f: 0x2a6a,
+ 0x330: 0x2aea, 0x331: 0x2b6a, 0x332: 0x2bea, 0x333: 0x2c6a, 0x334: 0x2cea, 0x335: 0x2d6a,
+ 0x336: 0x2dea, 0x337: 0x2e6a, 0x338: 0x2eea, 0x339: 0x2f6a, 0x33a: 0x2fea,
+ 0x33c: 0x0015, 0x33d: 0x306a, 0x33e: 0x30ea, 0x33f: 0x316a,
+ // Block 0xd, offset 0x340
+ 0x340: 0x0812, 0x341: 0x0812, 0x342: 0x0812, 0x343: 0x0812, 0x344: 0x0812, 0x345: 0x0812,
+ 0x348: 0x0813, 0x349: 0x0813, 0x34a: 0x0813, 0x34b: 0x0813,
+ 0x34c: 0x0813, 0x34d: 0x0813, 0x350: 0x3b1a, 0x351: 0x0812,
+ 0x352: 0x3bfa, 0x353: 0x0812, 0x354: 0x3d3a, 0x355: 0x0812, 0x356: 0x3e7a, 0x357: 0x0812,
+ 0x359: 0x0813, 0x35b: 0x0813, 0x35d: 0x0813,
+ 0x35f: 0x0813, 0x360: 0x0812, 0x361: 0x0812, 0x362: 0x0812, 0x363: 0x0812,
+ 0x364: 0x0812, 0x365: 0x0812, 0x366: 0x0812, 0x367: 0x0812, 0x368: 0x0813, 0x369: 0x0813,
+ 0x36a: 0x0813, 0x36b: 0x0813, 0x36c: 0x0813, 0x36d: 0x0813, 0x36e: 0x0813, 0x36f: 0x0813,
+ 0x370: 0x9252, 0x371: 0x9252, 0x372: 0x9552, 0x373: 0x9552, 0x374: 0x9852, 0x375: 0x9852,
+ 0x376: 0x9b52, 0x377: 0x9b52, 0x378: 0x9e52, 0x379: 0x9e52, 0x37a: 0xa152, 0x37b: 0xa152,
+ 0x37c: 0x4d52, 0x37d: 0x4d52,
+ // Block 0xe, offset 0x380
+ 0x380: 0x3fba, 0x381: 0x40aa, 0x382: 0x419a, 0x383: 0x428a, 0x384: 0x437a, 0x385: 0x446a,
+ 0x386: 0x455a, 0x387: 0x464a, 0x388: 0x4739, 0x389: 0x4829, 0x38a: 0x4919, 0x38b: 0x4a09,
+ 0x38c: 0x4af9, 0x38d: 0x4be9, 0x38e: 0x4cd9, 0x38f: 0x4dc9, 0x390: 0x4eba, 0x391: 0x4faa,
+ 0x392: 0x509a, 0x393: 0x518a, 0x394: 0x527a, 0x395: 0x536a, 0x396: 0x545a, 0x397: 0x554a,
+ 0x398: 0x5639, 0x399: 0x5729, 0x39a: 0x5819, 0x39b: 0x5909, 0x39c: 0x59f9, 0x39d: 0x5ae9,
+ 0x39e: 0x5bd9, 0x39f: 0x5cc9, 0x3a0: 0x5dba, 0x3a1: 0x5eaa, 0x3a2: 0x5f9a, 0x3a3: 0x608a,
+ 0x3a4: 0x617a, 0x3a5: 0x626a, 0x3a6: 0x635a, 0x3a7: 0x644a, 0x3a8: 0x6539, 0x3a9: 0x6629,
+ 0x3aa: 0x6719, 0x3ab: 0x6809, 0x3ac: 0x68f9, 0x3ad: 0x69e9, 0x3ae: 0x6ad9, 0x3af: 0x6bc9,
+ 0x3b0: 0x0812, 0x3b1: 0x0812, 0x3b2: 0x6cba, 0x3b3: 0x6dca, 0x3b4: 0x6e9a,
+ 0x3b6: 0x6f7a, 0x3b7: 0x705a, 0x3b8: 0x0813, 0x3b9: 0x0813, 0x3ba: 0x9253, 0x3bb: 0x9253,
+ 0x3bc: 0x7199, 0x3bd: 0x0004, 0x3be: 0x726a, 0x3bf: 0x0004,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x0004, 0x3c1: 0x0004, 0x3c2: 0x72ea, 0x3c3: 0x73fa, 0x3c4: 0x74ca,
+ 0x3c6: 0x75aa, 0x3c7: 0x768a, 0x3c8: 0x9553, 0x3c9: 0x9553, 0x3ca: 0x9853, 0x3cb: 0x9853,
+ 0x3cc: 0x77c9, 0x3cd: 0x0004, 0x3ce: 0x0004, 0x3cf: 0x0004, 0x3d0: 0x0812, 0x3d1: 0x0812,
+ 0x3d2: 0x789a, 0x3d3: 0x79da, 0x3d6: 0x7b1a, 0x3d7: 0x7bfa,
+ 0x3d8: 0x0813, 0x3d9: 0x0813, 0x3da: 0x9b53, 0x3db: 0x9b53, 0x3dd: 0x0004,
+ 0x3de: 0x0004, 0x3df: 0x0004, 0x3e0: 0x0812, 0x3e1: 0x0812, 0x3e2: 0x7d3a, 0x3e3: 0x7e7a,
+ 0x3e4: 0x7fba, 0x3e5: 0x0912, 0x3e6: 0x809a, 0x3e7: 0x817a, 0x3e8: 0x0813, 0x3e9: 0x0813,
+ 0x3ea: 0xa153, 0x3eb: 0xa153, 0x3ec: 0x0913, 0x3ed: 0x0004, 0x3ee: 0x0004, 0x3ef: 0x0004,
+ 0x3f2: 0x82ba, 0x3f3: 0x83ca, 0x3f4: 0x849a,
+ 0x3f6: 0x857a, 0x3f7: 0x865a, 0x3f8: 0x9e53, 0x3f9: 0x9e53, 0x3fa: 0x4d53, 0x3fb: 0x4d53,
+ 0x3fc: 0x8799, 0x3fd: 0x0004, 0x3fe: 0x0004,
+ // Block 0x10, offset 0x400
+ 0x402: 0x0013,
+ 0x407: 0x0013, 0x40a: 0x0012, 0x40b: 0x0013,
+ 0x40c: 0x0013, 0x40d: 0x0013, 0x40e: 0x0012, 0x40f: 0x0012, 0x410: 0x0013, 0x411: 0x0013,
+ 0x412: 0x0013, 0x413: 0x0012, 0x415: 0x0013,
+ 0x419: 0x0013, 0x41a: 0x0013, 0x41b: 0x0013, 0x41c: 0x0013, 0x41d: 0x0013,
+ 0x424: 0x0013, 0x426: 0x886b, 0x428: 0x0013,
+ 0x42a: 0x88cb, 0x42b: 0x890b, 0x42c: 0x0013, 0x42d: 0x0013, 0x42f: 0x0012,
+ 0x430: 0x0013, 0x431: 0x0013, 0x432: 0xa453, 0x433: 0x0013, 0x434: 0x0012, 0x435: 0x0010,
+ 0x436: 0x0010, 0x437: 0x0010, 0x438: 0x0010, 0x439: 0x0012,
+ 0x43c: 0x0012, 0x43d: 0x0012, 0x43e: 0x0013, 0x43f: 0x0013,
+ // Block 0x11, offset 0x440
+ 0x440: 0x1a13, 0x441: 0x1a13, 0x442: 0x1e13, 0x443: 0x1e13, 0x444: 0x1a13, 0x445: 0x1a13,
+ 0x446: 0x2613, 0x447: 0x2613, 0x448: 0x2a13, 0x449: 0x2a13, 0x44a: 0x2e13, 0x44b: 0x2e13,
+ 0x44c: 0x2a13, 0x44d: 0x2a13, 0x44e: 0x2613, 0x44f: 0x2613, 0x450: 0xa752, 0x451: 0xa752,
+ 0x452: 0xaa52, 0x453: 0xaa52, 0x454: 0xad52, 0x455: 0xad52, 0x456: 0xaa52, 0x457: 0xaa52,
+ 0x458: 0xa752, 0x459: 0xa752, 0x45a: 0x1a12, 0x45b: 0x1a12, 0x45c: 0x1e12, 0x45d: 0x1e12,
+ 0x45e: 0x1a12, 0x45f: 0x1a12, 0x460: 0x2612, 0x461: 0x2612, 0x462: 0x2a12, 0x463: 0x2a12,
+ 0x464: 0x2e12, 0x465: 0x2e12, 0x466: 0x2a12, 0x467: 0x2a12, 0x468: 0x2612, 0x469: 0x2612,
+ // Block 0x12, offset 0x480
+ 0x480: 0x6552, 0x481: 0x6552, 0x482: 0x6552, 0x483: 0x6552, 0x484: 0x6552, 0x485: 0x6552,
+ 0x486: 0x6552, 0x487: 0x6552, 0x488: 0x6552, 0x489: 0x6552, 0x48a: 0x6552, 0x48b: 0x6552,
+ 0x48c: 0x6552, 0x48d: 0x6552, 0x48e: 0x6552, 0x48f: 0x6552, 0x490: 0xb052, 0x491: 0xb052,
+ 0x492: 0xb052, 0x493: 0xb052, 0x494: 0xb052, 0x495: 0xb052, 0x496: 0xb052, 0x497: 0xb052,
+ 0x498: 0xb052, 0x499: 0xb052, 0x49a: 0xb052, 0x49b: 0xb052, 0x49c: 0xb052, 0x49d: 0xb052,
+ 0x49e: 0xb052, 0x49f: 0xb052, 0x4a0: 0x0113, 0x4a1: 0x0112, 0x4a2: 0x896b, 0x4a3: 0x8b53,
+ 0x4a4: 0x89cb, 0x4a5: 0x8a2a, 0x4a6: 0x8a8a, 0x4a7: 0x0f13, 0x4a8: 0x0f12, 0x4a9: 0x0313,
+ 0x4aa: 0x0312, 0x4ab: 0x0713, 0x4ac: 0x0712, 0x4ad: 0x8aeb, 0x4ae: 0x8b4b, 0x4af: 0x8bab,
+ 0x4b0: 0x8c0b, 0x4b1: 0x0012, 0x4b2: 0x0113, 0x4b3: 0x0112, 0x4b4: 0x0012, 0x4b5: 0x0313,
+ 0x4b6: 0x0312, 0x4b7: 0x0012, 0x4b8: 0x0012, 0x4b9: 0x0012, 0x4ba: 0x0012, 0x4bb: 0x0012,
+ 0x4bc: 0x0015, 0x4bd: 0x0015, 0x4be: 0x8c6b, 0x4bf: 0x8ccb,
+ // Block 0x13, offset 0x4c0
+ 0x4c0: 0x0113, 0x4c1: 0x0112, 0x4c2: 0x0113, 0x4c3: 0x0112, 0x4c4: 0x0113, 0x4c5: 0x0112,
+ 0x4c6: 0x0113, 0x4c7: 0x0112, 0x4c8: 0x0014, 0x4c9: 0x0014, 0x4ca: 0x0014, 0x4cb: 0x0713,
+ 0x4cc: 0x0712, 0x4cd: 0x8d2b, 0x4ce: 0x0012, 0x4cf: 0x0010, 0x4d0: 0x0113, 0x4d1: 0x0112,
+ 0x4d2: 0x0113, 0x4d3: 0x0112, 0x4d4: 0x6552, 0x4d5: 0x0012, 0x4d6: 0x0113, 0x4d7: 0x0112,
+ 0x4d8: 0x0113, 0x4d9: 0x0112, 0x4da: 0x0113, 0x4db: 0x0112, 0x4dc: 0x0113, 0x4dd: 0x0112,
+ 0x4de: 0x0113, 0x4df: 0x0112, 0x4e0: 0x0113, 0x4e1: 0x0112, 0x4e2: 0x0113, 0x4e3: 0x0112,
+ 0x4e4: 0x0113, 0x4e5: 0x0112, 0x4e6: 0x0113, 0x4e7: 0x0112, 0x4e8: 0x0113, 0x4e9: 0x0112,
+ 0x4ea: 0x8d8b, 0x4eb: 0x8deb, 0x4ec: 0x8e4b, 0x4ed: 0x8eab, 0x4ee: 0x8f0b, 0x4ef: 0x0012,
+ 0x4f0: 0x8f6b, 0x4f1: 0x8fcb, 0x4f2: 0x902b, 0x4f3: 0xb353, 0x4f4: 0x0113, 0x4f5: 0x0112,
+ 0x4f6: 0x0113, 0x4f7: 0x0112, 0x4f8: 0x0113, 0x4f9: 0x0112, 0x4fa: 0x0113, 0x4fb: 0x0112,
+ 0x4fc: 0x0113, 0x4fd: 0x0112, 0x4fe: 0x0113, 0x4ff: 0x0112,
+ // Block 0x14, offset 0x500
+ 0x500: 0x90ea, 0x501: 0x916a, 0x502: 0x91ea, 0x503: 0x926a, 0x504: 0x931a, 0x505: 0x93ca,
+ 0x506: 0x944a,
+ 0x513: 0x94ca, 0x514: 0x95aa, 0x515: 0x968a, 0x516: 0x976a, 0x517: 0x984a,
+ 0x51d: 0x0010,
+ 0x51e: 0x0034, 0x51f: 0x0010, 0x520: 0x0010, 0x521: 0x0010, 0x522: 0x0010, 0x523: 0x0010,
+ 0x524: 0x0010, 0x525: 0x0010, 0x526: 0x0010, 0x527: 0x0010, 0x528: 0x0010,
+ 0x52a: 0x0010, 0x52b: 0x0010, 0x52c: 0x0010, 0x52d: 0x0010, 0x52e: 0x0010, 0x52f: 0x0010,
+ 0x530: 0x0010, 0x531: 0x0010, 0x532: 0x0010, 0x533: 0x0010, 0x534: 0x0010, 0x535: 0x0010,
+ 0x536: 0x0010, 0x538: 0x0010, 0x539: 0x0010, 0x53a: 0x0010, 0x53b: 0x0010,
+ 0x53c: 0x0010, 0x53e: 0x0010,
+ // Block 0x15, offset 0x540
+ 0x540: 0x2713, 0x541: 0x2913, 0x542: 0x2b13, 0x543: 0x2913, 0x544: 0x2f13, 0x545: 0x2913,
+ 0x546: 0x2b13, 0x547: 0x2913, 0x548: 0x2713, 0x549: 0x3913, 0x54a: 0x3b13,
+ 0x54c: 0x3f13, 0x54d: 0x3913, 0x54e: 0x3b13, 0x54f: 0x3913, 0x550: 0x2713, 0x551: 0x2913,
+ 0x552: 0x2b13, 0x554: 0x2f13, 0x555: 0x2913, 0x557: 0xbc52,
+ 0x558: 0xbf52, 0x559: 0xc252, 0x55a: 0xbf52, 0x55b: 0xc552, 0x55c: 0xbf52, 0x55d: 0xc252,
+ 0x55e: 0xbf52, 0x55f: 0xbc52, 0x560: 0xc852, 0x561: 0xcb52, 0x563: 0xce52,
+ 0x564: 0xc852, 0x565: 0xcb52, 0x566: 0xc852, 0x567: 0x2712, 0x568: 0x2912, 0x569: 0x2b12,
+ 0x56a: 0x2912, 0x56b: 0x2f12, 0x56c: 0x2912, 0x56d: 0x2b12, 0x56e: 0x2912, 0x56f: 0x2712,
+ 0x570: 0x3912, 0x571: 0x3b12, 0x573: 0x3f12, 0x574: 0x3912, 0x575: 0x3b12,
+ 0x576: 0x3912, 0x577: 0x2712, 0x578: 0x2912, 0x579: 0x2b12, 0x57b: 0x2f12,
+ 0x57c: 0x2912,
+ // Block 0x16, offset 0x580
+ 0x580: 0x2213, 0x581: 0x2213, 0x582: 0x2613, 0x583: 0x2613, 0x584: 0x2213, 0x585: 0x2213,
+ 0x586: 0x2e13, 0x587: 0x2e13, 0x588: 0x2213, 0x589: 0x2213, 0x58a: 0x2613, 0x58b: 0x2613,
+ 0x58c: 0x2213, 0x58d: 0x2213, 0x58e: 0x3e13, 0x58f: 0x3e13, 0x590: 0x2213, 0x591: 0x2213,
+ 0x592: 0x2613, 0x593: 0x2613, 0x594: 0x2213, 0x595: 0x2213, 0x596: 0x2e13, 0x597: 0x2e13,
+ 0x598: 0x2213, 0x599: 0x2213, 0x59a: 0x2613, 0x59b: 0x2613, 0x59c: 0x2213, 0x59d: 0x2213,
+ 0x59e: 0xd153, 0x59f: 0xd153, 0x5a0: 0xd453, 0x5a1: 0xd453, 0x5a2: 0x2212, 0x5a3: 0x2212,
+ 0x5a4: 0x2612, 0x5a5: 0x2612, 0x5a6: 0x2212, 0x5a7: 0x2212, 0x5a8: 0x2e12, 0x5a9: 0x2e12,
+ 0x5aa: 0x2212, 0x5ab: 0x2212, 0x5ac: 0x2612, 0x5ad: 0x2612, 0x5ae: 0x2212, 0x5af: 0x2212,
+ 0x5b0: 0x3e12, 0x5b1: 0x3e12, 0x5b2: 0x2212, 0x5b3: 0x2212, 0x5b4: 0x2612, 0x5b5: 0x2612,
+ 0x5b6: 0x2212, 0x5b7: 0x2212, 0x5b8: 0x2e12, 0x5b9: 0x2e12, 0x5ba: 0x2212, 0x5bb: 0x2212,
+ 0x5bc: 0x2612, 0x5bd: 0x2612, 0x5be: 0x2212, 0x5bf: 0x2212,
+ // Block 0x17, offset 0x5c0
+ 0x5c2: 0x0010,
+ 0x5c7: 0x0010, 0x5c9: 0x0010, 0x5cb: 0x0010,
+ 0x5cd: 0x0010, 0x5ce: 0x0010, 0x5cf: 0x0010, 0x5d1: 0x0010,
+ 0x5d2: 0x0010, 0x5d4: 0x0010, 0x5d7: 0x0010,
+ 0x5d9: 0x0010, 0x5db: 0x0010, 0x5dd: 0x0010,
+ 0x5df: 0x0010, 0x5e1: 0x0010, 0x5e2: 0x0010,
+ 0x5e4: 0x0010, 0x5e7: 0x0010, 0x5e8: 0x0010, 0x5e9: 0x0010,
+ 0x5ea: 0x0010, 0x5ec: 0x0010, 0x5ed: 0x0010, 0x5ee: 0x0010, 0x5ef: 0x0010,
+ 0x5f0: 0x0010, 0x5f1: 0x0010, 0x5f2: 0x0010, 0x5f4: 0x0010, 0x5f5: 0x0010,
+ 0x5f6: 0x0010, 0x5f7: 0x0010, 0x5f9: 0x0010, 0x5fa: 0x0010, 0x5fb: 0x0010,
+ 0x5fc: 0x0010, 0x5fe: 0x0010,
+}
+
+// caseIndex: 27 blocks, 1728 entries, 3456 bytes
+// Block 0 is the zero block.
+var caseIndex = [1728]uint16{
+ // Block 0x0, offset 0x0
+ // Block 0x1, offset 0x40
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc2: 0x16, 0xc3: 0x17, 0xc4: 0x18, 0xc5: 0x19, 0xc6: 0x01, 0xc7: 0x02,
+ 0xc8: 0x1a, 0xc9: 0x03, 0xca: 0x04, 0xcb: 0x1b, 0xcc: 0x1c, 0xcd: 0x05, 0xce: 0x06, 0xcf: 0x07,
+ 0xd0: 0x1d, 0xd1: 0x1e, 0xd2: 0x1f, 0xd3: 0x20, 0xd4: 0x21, 0xd5: 0x22, 0xd6: 0x08, 0xd7: 0x23,
+ 0xd8: 0x24, 0xd9: 0x25, 0xda: 0x26, 0xdb: 0x27, 0xdc: 0x28, 0xdd: 0x29, 0xde: 0x2a, 0xdf: 0x2b,
+ 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05,
+ 0xea: 0x06, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x08, 0xef: 0x09,
+ 0xf0: 0x16, 0xf3: 0x18,
+ // Block 0x4, offset 0x100
+ 0x120: 0x2c, 0x121: 0x2d, 0x122: 0x2e, 0x123: 0x09, 0x124: 0x2f, 0x125: 0x30, 0x126: 0x31, 0x127: 0x32,
+ 0x128: 0x33, 0x129: 0x34, 0x12a: 0x35, 0x12b: 0x36, 0x12c: 0x37, 0x12d: 0x38, 0x12e: 0x39, 0x12f: 0x3a,
+ 0x130: 0x3b, 0x131: 0x3c, 0x132: 0x3d, 0x133: 0x3e, 0x134: 0x3f, 0x135: 0x40, 0x136: 0x41, 0x137: 0x42,
+ 0x138: 0x43, 0x139: 0x44, 0x13a: 0x45, 0x13b: 0x46, 0x13c: 0x47, 0x13d: 0x48, 0x13e: 0x49, 0x13f: 0x4a,
+ // Block 0x5, offset 0x140
+ 0x140: 0x4b, 0x141: 0x4c, 0x142: 0x4d, 0x143: 0x0a, 0x144: 0x26, 0x145: 0x26, 0x146: 0x26, 0x147: 0x26,
+ 0x148: 0x26, 0x149: 0x4e, 0x14a: 0x4f, 0x14b: 0x50, 0x14c: 0x51, 0x14d: 0x52, 0x14e: 0x53, 0x14f: 0x54,
+ 0x150: 0x55, 0x151: 0x26, 0x152: 0x26, 0x153: 0x26, 0x154: 0x26, 0x155: 0x26, 0x156: 0x26, 0x157: 0x26,
+ 0x158: 0x26, 0x159: 0x56, 0x15a: 0x57, 0x15b: 0x58, 0x15c: 0x59, 0x15d: 0x5a, 0x15e: 0x5b, 0x15f: 0x5c,
+ 0x160: 0x5d, 0x161: 0x5e, 0x162: 0x5f, 0x163: 0x60, 0x164: 0x61, 0x165: 0x62, 0x167: 0x63,
+ 0x168: 0x64, 0x169: 0x65, 0x16a: 0x66, 0x16b: 0x67, 0x16c: 0x68, 0x16d: 0x69, 0x16e: 0x6a, 0x16f: 0x6b,
+ 0x170: 0x6c, 0x171: 0x6d, 0x172: 0x6e, 0x173: 0x6f, 0x174: 0x70, 0x175: 0x71, 0x176: 0x72, 0x177: 0x73,
+ 0x178: 0x74, 0x179: 0x74, 0x17a: 0x75, 0x17b: 0x74, 0x17c: 0x76, 0x17d: 0x0b, 0x17e: 0x0c, 0x17f: 0x0d,
+ // Block 0x6, offset 0x180
+ 0x180: 0x77, 0x181: 0x78, 0x182: 0x79, 0x183: 0x7a, 0x184: 0x0e, 0x185: 0x7b, 0x186: 0x7c,
+ 0x192: 0x7d, 0x193: 0x0f,
+ 0x1b0: 0x7e, 0x1b1: 0x10, 0x1b2: 0x74, 0x1b3: 0x7f, 0x1b4: 0x80, 0x1b5: 0x81, 0x1b6: 0x82, 0x1b7: 0x83,
+ 0x1b8: 0x84,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x85, 0x1c2: 0x86, 0x1c3: 0x87, 0x1c4: 0x88, 0x1c5: 0x26, 0x1c6: 0x89,
+ // Block 0x8, offset 0x200
+ 0x200: 0x8a, 0x201: 0x26, 0x202: 0x26, 0x203: 0x26, 0x204: 0x26, 0x205: 0x26, 0x206: 0x26, 0x207: 0x26,
+ 0x208: 0x26, 0x209: 0x26, 0x20a: 0x26, 0x20b: 0x26, 0x20c: 0x26, 0x20d: 0x26, 0x20e: 0x26, 0x20f: 0x26,
+ 0x210: 0x26, 0x211: 0x26, 0x212: 0x8b, 0x213: 0x8c, 0x214: 0x26, 0x215: 0x26, 0x216: 0x26, 0x217: 0x26,
+ 0x218: 0x8d, 0x219: 0x8e, 0x21a: 0x8f, 0x21b: 0x90, 0x21c: 0x91, 0x21d: 0x92, 0x21e: 0x11, 0x21f: 0x93,
+ 0x220: 0x94, 0x221: 0x95, 0x222: 0x26, 0x223: 0x96, 0x224: 0x97, 0x225: 0x98, 0x226: 0x99, 0x227: 0x9a,
+ 0x228: 0x9b, 0x229: 0x9c, 0x22a: 0x9d, 0x22b: 0x9e, 0x22c: 0x9f, 0x22d: 0xa0, 0x22e: 0xa1, 0x22f: 0xa2,
+ 0x230: 0x26, 0x231: 0x26, 0x232: 0x26, 0x233: 0x26, 0x234: 0x26, 0x235: 0x26, 0x236: 0x26, 0x237: 0x26,
+ 0x238: 0x26, 0x239: 0x26, 0x23a: 0x26, 0x23b: 0x26, 0x23c: 0x26, 0x23d: 0x26, 0x23e: 0x26, 0x23f: 0x26,
+ // Block 0x9, offset 0x240
+ 0x240: 0x26, 0x241: 0x26, 0x242: 0x26, 0x243: 0x26, 0x244: 0x26, 0x245: 0x26, 0x246: 0x26, 0x247: 0x26,
+ 0x248: 0x26, 0x249: 0x26, 0x24a: 0x26, 0x24b: 0x26, 0x24c: 0x26, 0x24d: 0x26, 0x24e: 0x26, 0x24f: 0x26,
+ 0x250: 0x26, 0x251: 0x26, 0x252: 0x26, 0x253: 0x26, 0x254: 0x26, 0x255: 0x26, 0x256: 0x26, 0x257: 0x26,
+ 0x258: 0x26, 0x259: 0x26, 0x25a: 0x26, 0x25b: 0x26, 0x25c: 0x26, 0x25d: 0x26, 0x25e: 0x26, 0x25f: 0x26,
+ 0x260: 0x26, 0x261: 0x26, 0x262: 0x26, 0x263: 0x26, 0x264: 0x26, 0x265: 0x26, 0x266: 0x26, 0x267: 0x26,
+ 0x268: 0x26, 0x269: 0x26, 0x26a: 0x26, 0x26b: 0x26, 0x26c: 0x26, 0x26d: 0x26, 0x26e: 0x26, 0x26f: 0x26,
+ 0x270: 0x26, 0x271: 0x26, 0x272: 0x26, 0x273: 0x26, 0x274: 0x26, 0x275: 0x26, 0x276: 0x26, 0x277: 0x26,
+ 0x278: 0x26, 0x279: 0x26, 0x27a: 0x26, 0x27b: 0x26, 0x27c: 0x26, 0x27d: 0x26, 0x27e: 0x26, 0x27f: 0x26,
+ // Block 0xa, offset 0x280
+ 0x280: 0x26, 0x281: 0x26, 0x282: 0x26, 0x283: 0x26, 0x284: 0x26, 0x285: 0x26, 0x286: 0x26, 0x287: 0x26,
+ 0x288: 0x26, 0x289: 0x26, 0x28a: 0x26, 0x28b: 0x26, 0x28c: 0x26, 0x28d: 0x26, 0x28e: 0x26, 0x28f: 0x26,
+ 0x290: 0x26, 0x291: 0x26, 0x292: 0x26, 0x293: 0x26, 0x294: 0x26, 0x295: 0x26, 0x296: 0x26, 0x297: 0x26,
+ 0x298: 0x26, 0x299: 0x26, 0x29a: 0x26, 0x29b: 0x26, 0x29c: 0x26, 0x29d: 0x26, 0x29e: 0xa3, 0x29f: 0xa4,
+ // Block 0xb, offset 0x2c0
+ 0x2ec: 0x12, 0x2ed: 0xa5, 0x2ee: 0xa6, 0x2ef: 0xa7,
+ 0x2f0: 0x26, 0x2f1: 0x26, 0x2f2: 0x26, 0x2f3: 0x26, 0x2f4: 0xa8, 0x2f5: 0xa9, 0x2f6: 0xaa, 0x2f7: 0xab,
+ 0x2f8: 0xac, 0x2f9: 0xad, 0x2fa: 0x26, 0x2fb: 0xae, 0x2fc: 0xaf, 0x2fd: 0xb0, 0x2fe: 0xb1, 0x2ff: 0xb2,
+ // Block 0xc, offset 0x300
+ 0x300: 0xb3, 0x301: 0xb4, 0x302: 0x26, 0x303: 0xb5, 0x305: 0xb6, 0x307: 0xb7,
+ 0x30a: 0xb8, 0x30b: 0xb9, 0x30c: 0xba, 0x30d: 0xbb, 0x30e: 0xbc, 0x30f: 0xbd,
+ 0x310: 0xbe, 0x311: 0xbf, 0x312: 0xc0, 0x313: 0xc1, 0x314: 0xc2, 0x315: 0xc3, 0x316: 0x13,
+ 0x318: 0x26, 0x319: 0x26, 0x31a: 0x26, 0x31b: 0x26, 0x31c: 0xc4, 0x31d: 0xc5, 0x31e: 0xc6,
+ 0x320: 0xc7, 0x321: 0xc8, 0x322: 0xc9, 0x323: 0xca, 0x324: 0xcb, 0x326: 0xcc,
+ 0x328: 0xcd, 0x329: 0xce, 0x32a: 0xcf, 0x32b: 0xd0, 0x32c: 0x60, 0x32d: 0xd1, 0x32e: 0xd2,
+ 0x330: 0x26, 0x331: 0xd3, 0x332: 0xd4, 0x333: 0xd5, 0x334: 0xd6,
+ 0x33a: 0xd7, 0x33b: 0xd8, 0x33c: 0xd9, 0x33d: 0xda, 0x33e: 0xdb, 0x33f: 0xdc,
+ // Block 0xd, offset 0x340
+ 0x340: 0xdd, 0x341: 0xde, 0x342: 0xdf, 0x343: 0xe0, 0x344: 0xe1, 0x345: 0xe2, 0x346: 0xe3, 0x347: 0xe4,
+ 0x348: 0xe5, 0x349: 0xe6, 0x34a: 0xe7, 0x34b: 0xe8, 0x34c: 0xe9, 0x34d: 0xea,
+ 0x350: 0xeb, 0x351: 0xec, 0x352: 0xed, 0x353: 0xee, 0x356: 0xef, 0x357: 0xf0,
+ 0x358: 0xf1, 0x359: 0xf2, 0x35a: 0xf3, 0x35b: 0xf4, 0x35c: 0xf5,
+ 0x360: 0xf6, 0x362: 0xf7, 0x363: 0xf8, 0x364: 0xf9, 0x365: 0xfa, 0x366: 0xfb, 0x367: 0xfc,
+ 0x368: 0xfd, 0x369: 0xfe, 0x36a: 0xff, 0x36b: 0x100,
+ 0x370: 0x101, 0x371: 0x102, 0x372: 0x103, 0x374: 0x104, 0x375: 0x105, 0x376: 0x106,
+ 0x37b: 0x107, 0x37c: 0x108, 0x37d: 0x109, 0x37e: 0x10a,
+ // Block 0xe, offset 0x380
+ 0x380: 0x26, 0x381: 0x26, 0x382: 0x26, 0x383: 0x26, 0x384: 0x26, 0x385: 0x26, 0x386: 0x26, 0x387: 0x26,
+ 0x388: 0x26, 0x389: 0x26, 0x38a: 0x26, 0x38b: 0x26, 0x38c: 0x26, 0x38d: 0x26, 0x38e: 0x10b,
+ 0x390: 0x26, 0x391: 0x10c, 0x392: 0x26, 0x393: 0x26, 0x394: 0x26, 0x395: 0x10d,
+ 0x3be: 0xa9, 0x3bf: 0x10e,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x26, 0x3c1: 0x26, 0x3c2: 0x26, 0x3c3: 0x26, 0x3c4: 0x26, 0x3c5: 0x26, 0x3c6: 0x26, 0x3c7: 0x26,
+ 0x3c8: 0x26, 0x3c9: 0x26, 0x3ca: 0x26, 0x3cb: 0x26, 0x3cc: 0x26, 0x3cd: 0x26, 0x3ce: 0x26, 0x3cf: 0x26,
+ 0x3d0: 0x10f, 0x3d1: 0x110,
+ // Block 0x10, offset 0x400
+ 0x410: 0x26, 0x411: 0x26, 0x412: 0x26, 0x413: 0x26, 0x414: 0x26, 0x415: 0x26, 0x416: 0x26, 0x417: 0x26,
+ 0x418: 0x26, 0x419: 0x111,
+ // Block 0x11, offset 0x440
+ 0x460: 0x26, 0x461: 0x26, 0x462: 0x26, 0x463: 0x26, 0x464: 0x26, 0x465: 0x26, 0x466: 0x26, 0x467: 0x26,
+ 0x468: 0x100, 0x469: 0x112, 0x46a: 0x113, 0x46b: 0x114, 0x46c: 0x115, 0x46d: 0x116, 0x46e: 0x117,
+ 0x479: 0x118, 0x47c: 0x26, 0x47d: 0x119, 0x47e: 0x11a, 0x47f: 0x11b,
+ // Block 0x12, offset 0x480
+ 0x4bf: 0x11c,
+ // Block 0x13, offset 0x4c0
+ 0x4f0: 0x26, 0x4f1: 0x11d, 0x4f2: 0x11e,
+ // Block 0x14, offset 0x500
+ 0x53c: 0x11f, 0x53d: 0x120,
+ // Block 0x15, offset 0x540
+ 0x545: 0x121, 0x546: 0x122,
+ 0x549: 0x123,
+ 0x550: 0x124, 0x551: 0x125, 0x552: 0x126, 0x553: 0x127, 0x554: 0x128, 0x555: 0x129, 0x556: 0x12a, 0x557: 0x12b,
+ 0x558: 0x12c, 0x559: 0x12d, 0x55a: 0x12e, 0x55b: 0x12f, 0x55c: 0x130, 0x55d: 0x131, 0x55e: 0x132, 0x55f: 0x133,
+ 0x568: 0x134, 0x569: 0x135, 0x56a: 0x136,
+ 0x57c: 0x137,
+ // Block 0x16, offset 0x580
+ 0x580: 0x138, 0x581: 0x139, 0x582: 0x13a, 0x584: 0x13b, 0x585: 0x13c,
+ 0x58a: 0x13d, 0x58b: 0x13e,
+ 0x593: 0x13f,
+ 0x59f: 0x140,
+ 0x5a0: 0x26, 0x5a1: 0x26, 0x5a2: 0x26, 0x5a3: 0x141, 0x5a4: 0x14, 0x5a5: 0x142,
+ 0x5b8: 0x143, 0x5b9: 0x15, 0x5ba: 0x144,
+ // Block 0x17, offset 0x5c0
+ 0x5c4: 0x145, 0x5c5: 0x146, 0x5c6: 0x147,
+ 0x5cf: 0x148,
+ 0x5ef: 0x149,
+ // Block 0x18, offset 0x600
+ 0x610: 0x0a, 0x611: 0x0b, 0x612: 0x0c, 0x613: 0x0d, 0x614: 0x0e, 0x616: 0x0f,
+ 0x61a: 0x10, 0x61b: 0x11, 0x61c: 0x12, 0x61d: 0x13, 0x61e: 0x14, 0x61f: 0x15,
+ // Block 0x19, offset 0x640
+ 0x640: 0x14a, 0x641: 0x14b, 0x644: 0x14b, 0x645: 0x14b, 0x646: 0x14b, 0x647: 0x14c,
+ // Block 0x1a, offset 0x680
+ 0x6a0: 0x17,
+}
+
+// sparseOffsets: 312 entries, 624 bytes
+var sparseOffsets = []uint16{0x0, 0x9, 0xf, 0x18, 0x24, 0x2e, 0x34, 0x37, 0x3b, 0x3e, 0x42, 0x4c, 0x4e, 0x57, 0x5e, 0x63, 0x71, 0x72, 0x80, 0x8f, 0x99, 0x9c, 0xa3, 0xab, 0xaf, 0xb7, 0xbd, 0xcb, 0xd6, 0xe3, 0xee, 0xfa, 0x104, 0x110, 0x11b, 0x127, 0x133, 0x13b, 0x145, 0x150, 0x15b, 0x167, 0x16d, 0x178, 0x17e, 0x186, 0x189, 0x18e, 0x192, 0x196, 0x19d, 0x1a6, 0x1ae, 0x1af, 0x1b8, 0x1bf, 0x1c7, 0x1cd, 0x1d2, 0x1d6, 0x1d9, 0x1db, 0x1de, 0x1e3, 0x1e4, 0x1e6, 0x1e8, 0x1ea, 0x1f1, 0x1f6, 0x1fa, 0x203, 0x206, 0x209, 0x20f, 0x210, 0x21b, 0x21c, 0x21d, 0x222, 0x22f, 0x238, 0x23e, 0x246, 0x24f, 0x258, 0x261, 0x266, 0x269, 0x274, 0x282, 0x284, 0x28b, 0x28f, 0x29b, 0x29c, 0x2a7, 0x2af, 0x2b7, 0x2bd, 0x2be, 0x2cc, 0x2d1, 0x2d4, 0x2d9, 0x2dd, 0x2e3, 0x2e8, 0x2eb, 0x2f0, 0x2f5, 0x2f6, 0x2fc, 0x2fe, 0x2ff, 0x301, 0x303, 0x306, 0x307, 0x309, 0x30c, 0x312, 0x316, 0x318, 0x31d, 0x324, 0x334, 0x33e, 0x33f, 0x348, 0x34c, 0x351, 0x359, 0x35f, 0x365, 0x36f, 0x374, 0x37d, 0x383, 0x38c, 0x390, 0x398, 0x39a, 0x39c, 0x39f, 0x3a1, 0x3a3, 0x3a4, 0x3a5, 0x3a7, 0x3a9, 0x3af, 0x3b4, 0x3b6, 0x3bd, 0x3c0, 0x3c2, 0x3c8, 0x3cd, 0x3cf, 0x3d0, 0x3d1, 0x3d2, 0x3d4, 0x3d6, 0x3d8, 0x3db, 0x3dd, 0x3e0, 0x3e8, 0x3eb, 0x3ef, 0x3f7, 0x3f9, 0x409, 0x40a, 0x40c, 0x411, 0x417, 0x419, 0x41a, 0x41c, 0x41e, 0x420, 0x42d, 0x42e, 0x42f, 0x433, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43c, 0x43f, 0x440, 0x443, 0x44a, 0x450, 0x452, 0x456, 0x45e, 0x464, 0x468, 0x46f, 0x473, 0x477, 0x480, 0x48a, 0x48c, 0x492, 0x498, 0x4a2, 0x4ac, 0x4ae, 0x4b7, 0x4bd, 0x4c3, 0x4c9, 0x4cc, 0x4d2, 0x4d5, 0x4de, 0x4df, 0x4e6, 0x4ea, 0x4eb, 0x4ee, 0x4f8, 0x4fb, 0x4fd, 0x504, 0x50c, 0x512, 0x519, 0x51a, 0x520, 0x523, 0x52b, 0x532, 0x53c, 0x544, 0x547, 0x54c, 0x550, 0x551, 0x552, 0x553, 0x554, 0x555, 0x557, 0x55a, 0x55b, 0x55e, 0x55f, 0x562, 0x564, 0x568, 0x569, 0x56b, 0x56e, 0x570, 0x573, 0x576, 0x578, 0x57d, 0x57f, 0x580, 0x585, 0x589, 0x58a, 0x58d, 0x591, 0x59c, 0x5a0, 0x5a8, 0x5ad, 0x5b1, 0x5b4, 0x5b8, 0x5bb, 0x5be, 0x5c3, 0x5c7, 0x5cb, 0x5cf, 0x5d3, 0x5d5, 0x5d7, 0x5da, 0x5de, 0x5e4, 0x5e5, 0x5e6, 0x5e9, 0x5eb, 0x5ed, 0x5f0, 0x5f5, 0x5f9, 0x5fb, 0x601, 0x60a, 0x60f, 0x610, 0x613, 0x614, 0x615, 0x616, 0x618, 0x619, 0x61a}
+
+// sparseValues: 1562 entries, 6248 bytes
+var sparseValues = [1562]valueRange{
+ // Block 0x0, offset 0x0
+ {value: 0x0004, lo: 0xa8, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xaa},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0004, lo: 0xaf, hi: 0xaf},
+ {value: 0x0004, lo: 0xb4, hi: 0xb4},
+ {value: 0x001a, lo: 0xb5, hi: 0xb5},
+ {value: 0x0054, lo: 0xb7, hi: 0xb7},
+ {value: 0x0004, lo: 0xb8, hi: 0xb8},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ // Block 0x1, offset 0x9
+ {value: 0x2013, lo: 0x80, hi: 0x96},
+ {value: 0x2013, lo: 0x98, hi: 0x9e},
+ {value: 0x009a, lo: 0x9f, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xb6},
+ {value: 0x2012, lo: 0xb8, hi: 0xbe},
+ {value: 0x0252, lo: 0xbf, hi: 0xbf},
+ // Block 0x2, offset 0xf
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x011b, lo: 0xb0, hi: 0xb0},
+ {value: 0x019a, lo: 0xb1, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb7},
+ {value: 0x0012, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x0553, lo: 0xbf, hi: 0xbf},
+ // Block 0x3, offset 0x18
+ {value: 0x0552, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x01da, lo: 0x89, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xb7},
+ {value: 0x0253, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x028a, lo: 0xbf, hi: 0xbf},
+ // Block 0x4, offset 0x24
+ {value: 0x0117, lo: 0x80, hi: 0x9f},
+ {value: 0x2f53, lo: 0xa0, hi: 0xa0},
+ {value: 0x0012, lo: 0xa1, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xb3},
+ {value: 0x0012, lo: 0xb4, hi: 0xb9},
+ {value: 0x090b, lo: 0xba, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x2953, lo: 0xbd, hi: 0xbd},
+ {value: 0x098b, lo: 0xbe, hi: 0xbe},
+ {value: 0x0a0a, lo: 0xbf, hi: 0xbf},
+ // Block 0x5, offset 0x2e
+ {value: 0x0015, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x97},
+ {value: 0x0004, lo: 0x98, hi: 0x9d},
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0015, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xbf},
+ // Block 0x6, offset 0x34
+ {value: 0x0024, lo: 0x80, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbf},
+ // Block 0x7, offset 0x37
+ {value: 0x6553, lo: 0x80, hi: 0x8f},
+ {value: 0x2013, lo: 0x90, hi: 0x9f},
+ {value: 0x5f53, lo: 0xa0, hi: 0xaf},
+ {value: 0x2012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8, offset 0x3b
+ {value: 0x5f52, lo: 0x80, hi: 0x8f},
+ {value: 0x6552, lo: 0x90, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x9, offset 0x3e
+ {value: 0x0117, lo: 0x80, hi: 0x81},
+ {value: 0x0024, lo: 0x83, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xbf},
+ // Block 0xa, offset 0x42
+ {value: 0x0f13, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0716, lo: 0x8b, hi: 0x8c},
+ {value: 0x0316, lo: 0x8d, hi: 0x8e},
+ {value: 0x0f12, lo: 0x8f, hi: 0x8f},
+ {value: 0x0117, lo: 0x90, hi: 0xbf},
+ // Block 0xb, offset 0x4c
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x6553, lo: 0xb1, hi: 0xbf},
+ // Block 0xc, offset 0x4e
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6853, lo: 0x90, hi: 0x96},
+ {value: 0x0014, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0054, lo: 0x9f, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa0},
+ {value: 0x6552, lo: 0xa1, hi: 0xaf},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0xd, offset 0x57
+ {value: 0x0034, lo: 0x81, hi: 0x82},
+ {value: 0x0024, lo: 0x84, hi: 0x84},
+ {value: 0x0034, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xaa},
+ {value: 0x0010, lo: 0xaf, hi: 0xb3},
+ {value: 0x0054, lo: 0xb4, hi: 0xb4},
+ // Block 0xe, offset 0x5e
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0024, lo: 0x90, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0014, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xf, offset 0x63
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9c},
+ {value: 0x0024, lo: 0x9d, hi: 0x9e},
+ {value: 0x0034, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x10, offset 0x71
+ {value: 0x0010, lo: 0x80, hi: 0xbf},
+ // Block 0x11, offset 0x72
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0024, lo: 0x9f, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x12, offset 0x80
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0034, lo: 0xb1, hi: 0xb1},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0024, lo: 0xbf, hi: 0xbf},
+ // Block 0x13, offset 0x8f
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0024, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x88},
+ {value: 0x0024, lo: 0x89, hi: 0x8a},
+ {value: 0x0010, lo: 0x8d, hi: 0xbf},
+ // Block 0x14, offset 0x99
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x15, offset 0x9c
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xb1},
+ {value: 0x0034, lo: 0xb2, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0x16, offset 0xa3
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x99},
+ {value: 0x0014, lo: 0x9a, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0xa3},
+ {value: 0x0014, lo: 0xa4, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xad},
+ // Block 0x17, offset 0xab
+ {value: 0x0010, lo: 0x80, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0xa0, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x18, offset 0xaf
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0004, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x8e},
+ {value: 0x0014, lo: 0x90, hi: 0x91},
+ {value: 0x0024, lo: 0x98, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x9b},
+ {value: 0x0024, lo: 0x9c, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x19, offset 0xb7
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1a, offset 0xbd
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0x1b, offset 0xcb
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb6, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1c, offset 0xd6
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xb1},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ // Block 0x1d, offset 0xe3
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x1e, offset 0xee
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x99, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x1f, offset 0xfa
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x20, offset 0x104
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x85},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xbf},
+ // Block 0x21, offset 0x110
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x22, offset 0x11b
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x23, offset 0x127
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0010, lo: 0xa8, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x24, offset 0x133
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x25, offset 0x13b
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbf},
+ // Block 0x26, offset 0x145
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x88},
+ {value: 0x0014, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9a},
+ {value: 0x0010, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x27, offset 0x150
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x28, offset 0x15b
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x9d, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb3},
+ // Block 0x29, offset 0x167
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x2a, offset 0x16d
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x94, hi: 0x97},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xba, hi: 0xbf},
+ // Block 0x2b, offset 0x178
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x96},
+ {value: 0x0010, lo: 0x9a, hi: 0xb1},
+ {value: 0x0010, lo: 0xb3, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x2c, offset 0x17e
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x94},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9f},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ // Block 0x2d, offset 0x186
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ // Block 0x2e, offset 0x189
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x2f, offset 0x18e
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ // Block 0x30, offset 0x192
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x31, offset 0x196
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0034, lo: 0x98, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0034, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x32, offset 0x19d
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xac},
+ {value: 0x0034, lo: 0xb1, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xba, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x33, offset 0x1a6
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0024, lo: 0x82, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x86, hi: 0x87},
+ {value: 0x0010, lo: 0x88, hi: 0x8c},
+ {value: 0x0014, lo: 0x8d, hi: 0x97},
+ {value: 0x0014, lo: 0x99, hi: 0xbc},
+ // Block 0x34, offset 0x1ae
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ // Block 0x35, offset 0x1af
+ {value: 0x0010, lo: 0xab, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbe},
+ // Block 0x36, offset 0x1b8
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x96, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x99},
+ {value: 0x0014, lo: 0x9e, hi: 0xa0},
+ {value: 0x0010, lo: 0xa2, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xad},
+ {value: 0x0014, lo: 0xb1, hi: 0xb4},
+ // Block 0x37, offset 0x1bf
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x6c53, lo: 0xa0, hi: 0xbf},
+ // Block 0x38, offset 0x1c7
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x9a, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x39, offset 0x1cd
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x3a, offset 0x1d2
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x82, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3b, offset 0x1d6
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3c, offset 0x1d9
+ {value: 0x0010, lo: 0x80, hi: 0x9a},
+ {value: 0x0024, lo: 0x9d, hi: 0x9f},
+ // Block 0x3d, offset 0x1db
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x7453, lo: 0xa0, hi: 0xaf},
+ {value: 0x7853, lo: 0xb0, hi: 0xbf},
+ // Block 0x3e, offset 0x1de
+ {value: 0x7c53, lo: 0x80, hi: 0x8f},
+ {value: 0x8053, lo: 0x90, hi: 0x9f},
+ {value: 0x7c53, lo: 0xa0, hi: 0xaf},
+ {value: 0x0813, lo: 0xb0, hi: 0xb5},
+ {value: 0x0892, lo: 0xb8, hi: 0xbd},
+ // Block 0x3f, offset 0x1e3
+ {value: 0x0010, lo: 0x81, hi: 0xbf},
+ // Block 0x40, offset 0x1e4
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0010, lo: 0xaf, hi: 0xbf},
+ // Block 0x41, offset 0x1e6
+ {value: 0x0010, lo: 0x81, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x42, offset 0x1e8
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb8},
+ // Block 0x43, offset 0x1ea
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0034, lo: 0x94, hi: 0x94},
+ {value: 0x0030, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x9f, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0030, lo: 0xb4, hi: 0xb4},
+ // Block 0x44, offset 0x1f1
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xac},
+ {value: 0x0010, lo: 0xae, hi: 0xb0},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ // Block 0x45, offset 0x1f6
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x46, offset 0x1fa
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x89, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0014, lo: 0x93, hi: 0x93},
+ {value: 0x0004, lo: 0x97, hi: 0x97},
+ {value: 0x0024, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0x47, offset 0x203
+ {value: 0x0014, lo: 0x8b, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x48, offset 0x206
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb8},
+ // Block 0x49, offset 0x209
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x4a, offset 0x20f
+ {value: 0x0010, lo: 0x80, hi: 0xb5},
+ // Block 0x4b, offset 0x210
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbb},
+ // Block 0x4c, offset 0x21b
+ {value: 0x0010, lo: 0x86, hi: 0x8f},
+ // Block 0x4d, offset 0x21c
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x4e, offset 0x21d
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ // Block 0x4f, offset 0x222
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x9e},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xac},
+ {value: 0x0010, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xbc},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x50, offset 0x22f
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xa7, hi: 0xa7},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ {value: 0x0034, lo: 0xb5, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbc},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x51, offset 0x238
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0024, lo: 0x81, hi: 0x82},
+ {value: 0x0034, lo: 0x83, hi: 0x84},
+ {value: 0x0024, lo: 0x85, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0024, lo: 0x8b, hi: 0x8e},
+ // Block 0x52, offset 0x23e
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x53, offset 0x246
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0030, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xab, hi: 0xab},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ {value: 0x0024, lo: 0xad, hi: 0xb3},
+ // Block 0x54, offset 0x24f
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0030, lo: 0xaa, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbf},
+ // Block 0x55, offset 0x258
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0030, lo: 0xb2, hi: 0xb3},
+ // Block 0x56, offset 0x261
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0x57, offset 0x266
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8d, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x58, offset 0x269
+ {value: 0x31ea, lo: 0x80, hi: 0x80},
+ {value: 0x326a, lo: 0x81, hi: 0x81},
+ {value: 0x32ea, lo: 0x82, hi: 0x82},
+ {value: 0x336a, lo: 0x83, hi: 0x83},
+ {value: 0x33ea, lo: 0x84, hi: 0x84},
+ {value: 0x346a, lo: 0x85, hi: 0x85},
+ {value: 0x34ea, lo: 0x86, hi: 0x86},
+ {value: 0x356a, lo: 0x87, hi: 0x87},
+ {value: 0x35ea, lo: 0x88, hi: 0x88},
+ {value: 0x8353, lo: 0x90, hi: 0xba},
+ {value: 0x8353, lo: 0xbd, hi: 0xbf},
+ // Block 0x59, offset 0x274
+ {value: 0x0024, lo: 0x90, hi: 0x92},
+ {value: 0x0034, lo: 0x94, hi: 0x99},
+ {value: 0x0024, lo: 0x9a, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9f},
+ {value: 0x0024, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xb3},
+ {value: 0x0024, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb7},
+ {value: 0x0024, lo: 0xb8, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xba},
+ // Block 0x5a, offset 0x282
+ {value: 0x0012, lo: 0x80, hi: 0xab},
+ {value: 0x0015, lo: 0xac, hi: 0xbf},
+ // Block 0x5b, offset 0x284
+ {value: 0x0015, lo: 0x80, hi: 0xaa},
+ {value: 0x0012, lo: 0xab, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb8},
+ {value: 0x8752, lo: 0xb9, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbc},
+ {value: 0x8b52, lo: 0xbd, hi: 0xbd},
+ {value: 0x0012, lo: 0xbe, hi: 0xbf},
+ // Block 0x5c, offset 0x28b
+ {value: 0x0012, lo: 0x80, hi: 0x8d},
+ {value: 0x8f52, lo: 0x8e, hi: 0x8e},
+ {value: 0x0012, lo: 0x8f, hi: 0x9a},
+ {value: 0x0015, lo: 0x9b, hi: 0xbf},
+ // Block 0x5d, offset 0x28f
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0024, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbd},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x5e, offset 0x29b
+ {value: 0x0117, lo: 0x80, hi: 0xbf},
+ // Block 0x5f, offset 0x29c
+ {value: 0x0117, lo: 0x80, hi: 0x95},
+ {value: 0x369a, lo: 0x96, hi: 0x96},
+ {value: 0x374a, lo: 0x97, hi: 0x97},
+ {value: 0x37fa, lo: 0x98, hi: 0x98},
+ {value: 0x38aa, lo: 0x99, hi: 0x99},
+ {value: 0x395a, lo: 0x9a, hi: 0x9a},
+ {value: 0x3a0a, lo: 0x9b, hi: 0x9b},
+ {value: 0x0012, lo: 0x9c, hi: 0x9d},
+ {value: 0x3abb, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0x9f, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x60, offset 0x2a7
+ {value: 0x0812, lo: 0x80, hi: 0x87},
+ {value: 0x0813, lo: 0x88, hi: 0x8f},
+ {value: 0x0812, lo: 0x90, hi: 0x95},
+ {value: 0x0813, lo: 0x98, hi: 0x9d},
+ {value: 0x0812, lo: 0xa0, hi: 0xa7},
+ {value: 0x0813, lo: 0xa8, hi: 0xaf},
+ {value: 0x0812, lo: 0xb0, hi: 0xb7},
+ {value: 0x0813, lo: 0xb8, hi: 0xbf},
+ // Block 0x61, offset 0x2af
+ {value: 0x0004, lo: 0x8b, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8f},
+ {value: 0x0054, lo: 0x98, hi: 0x99},
+ {value: 0x0054, lo: 0xa4, hi: 0xa4},
+ {value: 0x0054, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xaa, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xaf},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x62, offset 0x2b7
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x94, hi: 0x94},
+ {value: 0x0014, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa6, hi: 0xaf},
+ {value: 0x0015, lo: 0xb1, hi: 0xb1},
+ {value: 0x0015, lo: 0xbf, hi: 0xbf},
+ // Block 0x63, offset 0x2bd
+ {value: 0x0015, lo: 0x90, hi: 0x9c},
+ // Block 0x64, offset 0x2be
+ {value: 0x0024, lo: 0x90, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0xa0},
+ {value: 0x0024, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa4},
+ {value: 0x0034, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ // Block 0x65, offset 0x2cc
+ {value: 0x0016, lo: 0x85, hi: 0x86},
+ {value: 0x0012, lo: 0x87, hi: 0x89},
+ {value: 0xa452, lo: 0x8e, hi: 0x8e},
+ {value: 0x1013, lo: 0xa0, hi: 0xaf},
+ {value: 0x1012, lo: 0xb0, hi: 0xbf},
+ // Block 0x66, offset 0x2d1
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x88},
+ // Block 0x67, offset 0x2d4
+ {value: 0xa753, lo: 0xb6, hi: 0xb7},
+ {value: 0xaa53, lo: 0xb8, hi: 0xb9},
+ {value: 0xad53, lo: 0xba, hi: 0xbb},
+ {value: 0xaa53, lo: 0xbc, hi: 0xbd},
+ {value: 0xa753, lo: 0xbe, hi: 0xbf},
+ // Block 0x68, offset 0x2d9
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6553, lo: 0x90, hi: 0x9f},
+ {value: 0xb053, lo: 0xa0, hi: 0xaf},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0x69, offset 0x2dd
+ {value: 0x0117, lo: 0x80, hi: 0xa3},
+ {value: 0x0012, lo: 0xa4, hi: 0xa4},
+ {value: 0x0716, lo: 0xab, hi: 0xac},
+ {value: 0x0316, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb3},
+ // Block 0x6a, offset 0x2e3
+ {value: 0x6c52, lo: 0x80, hi: 0x9f},
+ {value: 0x7052, lo: 0xa0, hi: 0xa5},
+ {value: 0x7052, lo: 0xa7, hi: 0xa7},
+ {value: 0x7052, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x6b, offset 0x2e8
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x6c, offset 0x2eb
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0010, lo: 0xb0, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x6d, offset 0x2f0
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9e},
+ {value: 0x0024, lo: 0xa0, hi: 0xbf},
+ // Block 0x6e, offset 0x2f5
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ // Block 0x6f, offset 0x2f6
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0xaa, hi: 0xad},
+ {value: 0x0030, lo: 0xae, hi: 0xaf},
+ {value: 0x0004, lo: 0xb1, hi: 0xb5},
+ {value: 0x0014, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ // Block 0x70, offset 0x2fc
+ {value: 0x0034, lo: 0x99, hi: 0x9a},
+ {value: 0x0004, lo: 0x9b, hi: 0x9e},
+ // Block 0x71, offset 0x2fe
+ {value: 0x0004, lo: 0xbc, hi: 0xbe},
+ // Block 0x72, offset 0x2ff
+ {value: 0x0010, lo: 0x85, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x73, offset 0x301
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x74, offset 0x303
+ {value: 0x0010, lo: 0x80, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0xbf},
+ // Block 0x75, offset 0x306
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ // Block 0x76, offset 0x307
+ {value: 0x0010, lo: 0x90, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x77, offset 0x309
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0xab},
+ // Block 0x78, offset 0x30c
+ {value: 0x0117, lo: 0x80, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb2},
+ {value: 0x0024, lo: 0xb4, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x79, offset 0x312
+ {value: 0x0117, lo: 0x80, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9d},
+ {value: 0x0024, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x7a, offset 0x316
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb1},
+ // Block 0x7b, offset 0x318
+ {value: 0x0004, lo: 0x80, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xaf},
+ {value: 0x0012, lo: 0xb0, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xbf},
+ // Block 0x7c, offset 0x31d
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x0015, lo: 0xb0, hi: 0xb0},
+ {value: 0x0012, lo: 0xb1, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x8753, lo: 0xbd, hi: 0xbd},
+ {value: 0x0117, lo: 0xbe, hi: 0xbf},
+ // Block 0x7d, offset 0x324
+ {value: 0x0117, lo: 0x80, hi: 0x83},
+ {value: 0x6553, lo: 0x84, hi: 0x84},
+ {value: 0x908b, lo: 0x85, hi: 0x85},
+ {value: 0x8f53, lo: 0x86, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0117, lo: 0x90, hi: 0x91},
+ {value: 0x0012, lo: 0x93, hi: 0x93},
+ {value: 0x0012, lo: 0x95, hi: 0x95},
+ {value: 0x0117, lo: 0x96, hi: 0x99},
+ {value: 0x0015, lo: 0xb2, hi: 0xb4},
+ {value: 0x0316, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbf},
+ // Block 0x7e, offset 0x334
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x8c, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ // Block 0x7f, offset 0x33e
+ {value: 0x0010, lo: 0x80, hi: 0xb3},
+ // Block 0x80, offset 0x33f
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xa0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb7},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x81, offset 0x348
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x82, offset 0x34c
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0x92},
+ {value: 0x0030, lo: 0x93, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0x83, offset 0x351
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x84, offset 0x359
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0004, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x85, offset 0x35f
+ {value: 0x0010, lo: 0x80, hi: 0xa8},
+ {value: 0x0014, lo: 0xa9, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0x86, offset 0x365
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x87, offset 0x36f
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0024, lo: 0xbe, hi: 0xbf},
+ // Block 0x88, offset 0x374
+ {value: 0x0024, lo: 0x81, hi: 0x81},
+ {value: 0x0004, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ // Block 0x89, offset 0x37d
+ {value: 0x0010, lo: 0x81, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x8e},
+ {value: 0x0010, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8a, offset 0x383
+ {value: 0x0012, lo: 0x80, hi: 0x92},
+ {value: 0xb352, lo: 0x93, hi: 0x93},
+ {value: 0x0012, lo: 0x94, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa8},
+ {value: 0x0015, lo: 0xa9, hi: 0xa9},
+ {value: 0x0004, lo: 0xaa, hi: 0xab},
+ {value: 0x74d2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8b, offset 0x38c
+ {value: 0x78d2, lo: 0x80, hi: 0x8f},
+ {value: 0x7cd2, lo: 0x90, hi: 0x9f},
+ {value: 0x80d2, lo: 0xa0, hi: 0xaf},
+ {value: 0x7cd2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8c, offset 0x390
+ {value: 0x0010, lo: 0x80, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x8d, offset 0x398
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x8e, offset 0x39a
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x8b, hi: 0xbb},
+ // Block 0x8f, offset 0x39c
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0xbf},
+ // Block 0x90, offset 0x39f
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0004, lo: 0xb2, hi: 0xbf},
+ // Block 0x91, offset 0x3a1
+ {value: 0x0004, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x93, hi: 0xbf},
+ // Block 0x92, offset 0x3a3
+ {value: 0x0010, lo: 0x80, hi: 0xbd},
+ // Block 0x93, offset 0x3a4
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0x94, offset 0x3a5
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0xbf},
+ // Block 0x95, offset 0x3a7
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0xb0, hi: 0xbb},
+ // Block 0x96, offset 0x3a9
+ {value: 0x0014, lo: 0x80, hi: 0x8f},
+ {value: 0x0054, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0xa0, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xad},
+ {value: 0x0024, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ // Block 0x97, offset 0x3af
+ {value: 0x0010, lo: 0x8d, hi: 0x8f},
+ {value: 0x0054, lo: 0x92, hi: 0x92},
+ {value: 0x0054, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0xb0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0x98, offset 0x3b4
+ {value: 0x0010, lo: 0x80, hi: 0xbc},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x99, offset 0x3b6
+ {value: 0x0054, lo: 0x87, hi: 0x87},
+ {value: 0x0054, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0054, lo: 0x9a, hi: 0x9a},
+ {value: 0x5f53, lo: 0xa1, hi: 0xba},
+ {value: 0x0004, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9a, offset 0x3bd
+ {value: 0x0004, lo: 0x80, hi: 0x80},
+ {value: 0x5f52, lo: 0x81, hi: 0x9a},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ // Block 0x9b, offset 0x3c0
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbe},
+ // Block 0x9c, offset 0x3c2
+ {value: 0x0010, lo: 0x82, hi: 0x87},
+ {value: 0x0010, lo: 0x8a, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0x97},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0004, lo: 0xa3, hi: 0xa3},
+ {value: 0x0014, lo: 0xb9, hi: 0xbb},
+ // Block 0x9d, offset 0x3c8
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0010, lo: 0x8d, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xba},
+ {value: 0x0010, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9e, offset 0x3cd
+ {value: 0x0010, lo: 0x80, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x9d},
+ // Block 0x9f, offset 0x3cf
+ {value: 0x0010, lo: 0x80, hi: 0xba},
+ // Block 0xa0, offset 0x3d0
+ {value: 0x0010, lo: 0x80, hi: 0xb4},
+ // Block 0xa1, offset 0x3d1
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0xa2, offset 0x3d2
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa3, offset 0x3d4
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ // Block 0xa4, offset 0x3d6
+ {value: 0x0010, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xad, hi: 0xbf},
+ // Block 0xa5, offset 0x3d8
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0xb5},
+ {value: 0x0024, lo: 0xb6, hi: 0xba},
+ // Block 0xa6, offset 0x3db
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa7, offset 0x3dd
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x91, hi: 0x95},
+ // Block 0xa8, offset 0x3e0
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x97},
+ {value: 0xb653, lo: 0x98, hi: 0x9f},
+ {value: 0xb953, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbf},
+ // Block 0xa9, offset 0x3e8
+ {value: 0xb652, lo: 0x80, hi: 0x87},
+ {value: 0xb952, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xaa, offset 0x3eb
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0xb953, lo: 0xb0, hi: 0xb7},
+ {value: 0xb653, lo: 0xb8, hi: 0xbf},
+ // Block 0xab, offset 0x3ef
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x93},
+ {value: 0xb952, lo: 0x98, hi: 0x9f},
+ {value: 0xb652, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbb},
+ // Block 0xac, offset 0x3f7
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xad, offset 0x3f9
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0xbc53, lo: 0xb0, hi: 0xb0},
+ {value: 0xbf53, lo: 0xb1, hi: 0xb1},
+ {value: 0xc253, lo: 0xb2, hi: 0xb2},
+ {value: 0xbf53, lo: 0xb3, hi: 0xb3},
+ {value: 0xc553, lo: 0xb4, hi: 0xb4},
+ {value: 0xbf53, lo: 0xb5, hi: 0xb5},
+ {value: 0xc253, lo: 0xb6, hi: 0xb6},
+ {value: 0xbf53, lo: 0xb7, hi: 0xb7},
+ {value: 0xbc53, lo: 0xb8, hi: 0xb8},
+ {value: 0xc853, lo: 0xb9, hi: 0xb9},
+ {value: 0xcb53, lo: 0xba, hi: 0xba},
+ {value: 0xce53, lo: 0xbc, hi: 0xbc},
+ {value: 0xc853, lo: 0xbd, hi: 0xbd},
+ {value: 0xcb53, lo: 0xbe, hi: 0xbe},
+ {value: 0xc853, lo: 0xbf, hi: 0xbf},
+ // Block 0xae, offset 0x409
+ {value: 0x0010, lo: 0x80, hi: 0xb6},
+ // Block 0xaf, offset 0x40a
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ // Block 0xb0, offset 0x40c
+ {value: 0x0015, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0015, lo: 0x83, hi: 0x85},
+ {value: 0x0015, lo: 0x87, hi: 0xb0},
+ {value: 0x0015, lo: 0xb2, hi: 0xba},
+ // Block 0xb1, offset 0x411
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xb2, offset 0x417
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xb3, offset 0x419
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ // Block 0xb4, offset 0x41a
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ // Block 0xb5, offset 0x41c
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb9},
+ // Block 0xb6, offset 0x41e
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0xb7, offset 0x420
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x8e, hi: 0x8e},
+ {value: 0x0024, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x99, hi: 0xb5},
+ {value: 0x0024, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xb8, offset 0x42d
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0xb9, offset 0x42e
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ // Block 0xba, offset 0x42f
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ // Block 0xbb, offset 0x433
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ // Block 0xbc, offset 0x435
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ // Block 0xbd, offset 0x436
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ // Block 0xbe, offset 0x437
+ {value: 0x5653, lo: 0x80, hi: 0xb2},
+ // Block 0xbf, offset 0x438
+ {value: 0x5652, lo: 0x80, hi: 0xb2},
+ // Block 0xc0, offset 0x439
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc1, offset 0x43c
+ {value: 0x0010, lo: 0x80, hi: 0xa9},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ // Block 0xc2, offset 0x43f
+ {value: 0x0034, lo: 0xbd, hi: 0xbf},
+ // Block 0xc3, offset 0x440
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xc4, offset 0x443
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x87},
+ {value: 0x0024, lo: 0x88, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x8b},
+ {value: 0x0024, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xc5, offset 0x44a
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0024, lo: 0x82, hi: 0x82},
+ {value: 0x0034, lo: 0x83, hi: 0x83},
+ {value: 0x0024, lo: 0x84, hi: 0x84},
+ {value: 0x0034, lo: 0x85, hi: 0x85},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xc6, offset 0x450
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xc7, offset 0x452
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xc8, offset 0x456
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xc9, offset 0x45e
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ // Block 0xca, offset 0x464
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xcb, offset 0x468
+ {value: 0x0024, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0xcc, offset 0x46f
+ {value: 0x0010, lo: 0x84, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ // Block 0xcd, offset 0x473
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xce, offset 0x477
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x89, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ // Block 0xcf, offset 0x480
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb4},
+ {value: 0x0030, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xb7},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xd0, offset 0x48a
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ // Block 0xd1, offset 0x48c
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xd2, offset 0x492
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa2},
+ {value: 0x0014, lo: 0xa3, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xd3, offset 0x498
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xd4, offset 0x4a2
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0030, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9d, hi: 0xa3},
+ {value: 0x0024, lo: 0xa6, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ // Block 0xd5, offset 0x4ac
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xd6, offset 0x4ae
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ // Block 0xd7, offset 0x4b7
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xd8, offset 0x4bd
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd9, offset 0x4c3
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xda, offset 0x4c9
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x98, hi: 0x9b},
+ {value: 0x0014, lo: 0x9c, hi: 0x9d},
+ // Block 0xdb, offset 0x4cc
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xdc, offset 0x4d2
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xdd, offset 0x4d5
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0014, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb5},
+ {value: 0x0030, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ // Block 0xde, offset 0x4de
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ // Block 0xdf, offset 0x4df
+ {value: 0x0014, lo: 0x9d, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xe0, offset 0x4e6
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ // Block 0xe1, offset 0x4ea
+ {value: 0x5f53, lo: 0xa0, hi: 0xbf},
+ // Block 0xe2, offset 0x4eb
+ {value: 0x5f52, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xe3, offset 0x4ee
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8c, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ {value: 0x0030, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xe4, offset 0x4f8
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0034, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xe5, offset 0x4fb
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ {value: 0x0010, lo: 0xaa, hi: 0xbf},
+ // Block 0xe6, offset 0x4fd
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0014, lo: 0x94, hi: 0x97},
+ {value: 0x0014, lo: 0x9a, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0x9f},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ // Block 0xe7, offset 0x504
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x8a},
+ {value: 0x0010, lo: 0x8b, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbb, hi: 0xbe},
+ // Block 0xe8, offset 0x50c
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0014, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x98},
+ {value: 0x0014, lo: 0x99, hi: 0x9b},
+ {value: 0x0010, lo: 0x9c, hi: 0xbf},
+ // Block 0xe9, offset 0x512
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0014, lo: 0x8a, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x99},
+ {value: 0x0010, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xea, offset 0x519
+ {value: 0x0010, lo: 0x80, hi: 0xb8},
+ // Block 0xeb, offset 0x51a
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xec, offset 0x520
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0xed, offset 0x523
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0014, lo: 0x92, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xa9},
+ {value: 0x0014, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0xee, offset 0x52b
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb6},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xef, offset 0x532
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa5},
+ {value: 0x0010, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xbf},
+ // Block 0xf0, offset 0x53c
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0014, lo: 0x90, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0x96},
+ {value: 0x0034, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xf1, offset 0x544
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ // Block 0xf2, offset 0x547
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xba},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0xf3, offset 0x54c
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0030, lo: 0x81, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xf4, offset 0x550
+ {value: 0x0010, lo: 0xb0, hi: 0xb0},
+ // Block 0xf5, offset 0x551
+ {value: 0x0010, lo: 0x80, hi: 0x99},
+ // Block 0xf6, offset 0x552
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ // Block 0xf7, offset 0x553
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ // Block 0xf8, offset 0x554
+ {value: 0x0010, lo: 0x80, hi: 0xb0},
+ // Block 0xf9, offset 0x555
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xbf},
+ // Block 0xfa, offset 0x557
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x95},
+ // Block 0xfb, offset 0x55a
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ // Block 0xfc, offset 0x55b
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xfd, offset 0x55e
+ {value: 0x0010, lo: 0x80, hi: 0xbe},
+ // Block 0xfe, offset 0x55f
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x90, hi: 0xad},
+ {value: 0x0034, lo: 0xb0, hi: 0xb4},
+ // Block 0xff, offset 0x562
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ // Block 0x100, offset 0x564
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa3, hi: 0xb7},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x101, offset 0x568
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ // Block 0x102, offset 0x569
+ {value: 0x2013, lo: 0x80, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xbf},
+ // Block 0x103, offset 0x56b
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0x104, offset 0x56e
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0014, lo: 0x8f, hi: 0x9f},
+ // Block 0x105, offset 0x570
+ {value: 0x0014, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa3, hi: 0xa4},
+ {value: 0x0030, lo: 0xb0, hi: 0xb1},
+ // Block 0x106, offset 0x573
+ {value: 0x0004, lo: 0xb0, hi: 0xb3},
+ {value: 0x0004, lo: 0xb5, hi: 0xbb},
+ {value: 0x0004, lo: 0xbd, hi: 0xbe},
+ // Block 0x107, offset 0x576
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbc},
+ // Block 0x108, offset 0x578
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0034, lo: 0x9e, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa3},
+ // Block 0x109, offset 0x57d
+ {value: 0x0014, lo: 0x80, hi: 0xad},
+ {value: 0x0014, lo: 0xb0, hi: 0xbf},
+ // Block 0x10a, offset 0x57f
+ {value: 0x0014, lo: 0x80, hi: 0x86},
+ // Block 0x10b, offset 0x580
+ {value: 0x0030, lo: 0xa5, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xa9},
+ {value: 0x0030, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbf},
+ // Block 0x10c, offset 0x585
+ {value: 0x0034, lo: 0x80, hi: 0x82},
+ {value: 0x0024, lo: 0x85, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8b},
+ {value: 0x0024, lo: 0xaa, hi: 0xad},
+ // Block 0x10d, offset 0x589
+ {value: 0x0024, lo: 0x82, hi: 0x84},
+ // Block 0x10e, offset 0x58a
+ {value: 0x0013, lo: 0x80, hi: 0x99},
+ {value: 0x0012, lo: 0x9a, hi: 0xb3},
+ {value: 0x0013, lo: 0xb4, hi: 0xbf},
+ // Block 0x10f, offset 0x58d
+ {value: 0x0013, lo: 0x80, hi: 0x8d},
+ {value: 0x0012, lo: 0x8e, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0xa7},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x110, offset 0x591
+ {value: 0x0013, lo: 0x80, hi: 0x81},
+ {value: 0x0012, lo: 0x82, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0x9c},
+ {value: 0x0013, lo: 0x9e, hi: 0x9f},
+ {value: 0x0013, lo: 0xa2, hi: 0xa2},
+ {value: 0x0013, lo: 0xa5, hi: 0xa6},
+ {value: 0x0013, lo: 0xa9, hi: 0xac},
+ {value: 0x0013, lo: 0xae, hi: 0xb5},
+ {value: 0x0012, lo: 0xb6, hi: 0xb9},
+ {value: 0x0012, lo: 0xbb, hi: 0xbb},
+ {value: 0x0012, lo: 0xbd, hi: 0xbf},
+ // Block 0x111, offset 0x59c
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0012, lo: 0x85, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x112, offset 0x5a0
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0013, lo: 0x84, hi: 0x85},
+ {value: 0x0013, lo: 0x87, hi: 0x8a},
+ {value: 0x0013, lo: 0x8d, hi: 0x94},
+ {value: 0x0013, lo: 0x96, hi: 0x9c},
+ {value: 0x0012, lo: 0x9e, hi: 0xb7},
+ {value: 0x0013, lo: 0xb8, hi: 0xb9},
+ {value: 0x0013, lo: 0xbb, hi: 0xbe},
+ // Block 0x113, offset 0x5a8
+ {value: 0x0013, lo: 0x80, hi: 0x84},
+ {value: 0x0013, lo: 0x86, hi: 0x86},
+ {value: 0x0013, lo: 0x8a, hi: 0x90},
+ {value: 0x0012, lo: 0x92, hi: 0xab},
+ {value: 0x0013, lo: 0xac, hi: 0xbf},
+ // Block 0x114, offset 0x5ad
+ {value: 0x0013, lo: 0x80, hi: 0x85},
+ {value: 0x0012, lo: 0x86, hi: 0x9f},
+ {value: 0x0013, lo: 0xa0, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbf},
+ // Block 0x115, offset 0x5b1
+ {value: 0x0012, lo: 0x80, hi: 0x93},
+ {value: 0x0013, lo: 0x94, hi: 0xad},
+ {value: 0x0012, lo: 0xae, hi: 0xbf},
+ // Block 0x116, offset 0x5b4
+ {value: 0x0012, lo: 0x80, hi: 0x87},
+ {value: 0x0013, lo: 0x88, hi: 0xa1},
+ {value: 0x0012, lo: 0xa2, hi: 0xbb},
+ {value: 0x0013, lo: 0xbc, hi: 0xbf},
+ // Block 0x117, offset 0x5b8
+ {value: 0x0013, lo: 0x80, hi: 0x95},
+ {value: 0x0012, lo: 0x96, hi: 0xaf},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x118, offset 0x5bb
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0012, lo: 0x8a, hi: 0xa5},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0x119, offset 0x5be
+ {value: 0x0013, lo: 0x80, hi: 0x80},
+ {value: 0x0012, lo: 0x82, hi: 0x9a},
+ {value: 0x0012, lo: 0x9c, hi: 0xa1},
+ {value: 0x0013, lo: 0xa2, hi: 0xba},
+ {value: 0x0012, lo: 0xbc, hi: 0xbf},
+ // Block 0x11a, offset 0x5c3
+ {value: 0x0012, lo: 0x80, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0xb4},
+ {value: 0x0012, lo: 0xb6, hi: 0xbf},
+ // Block 0x11b, offset 0x5c7
+ {value: 0x0012, lo: 0x80, hi: 0x8e},
+ {value: 0x0012, lo: 0x90, hi: 0x95},
+ {value: 0x0013, lo: 0x96, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x11c, offset 0x5cb
+ {value: 0x0012, lo: 0x80, hi: 0x88},
+ {value: 0x0012, lo: 0x8a, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0x11d, offset 0x5cf
+ {value: 0x0012, lo: 0x80, hi: 0x82},
+ {value: 0x0012, lo: 0x84, hi: 0x89},
+ {value: 0x0017, lo: 0x8a, hi: 0x8b},
+ {value: 0x0010, lo: 0x8e, hi: 0xbf},
+ // Block 0x11e, offset 0x5d3
+ {value: 0x0014, lo: 0x80, hi: 0xb6},
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x11f, offset 0x5d5
+ {value: 0x0014, lo: 0x80, hi: 0xac},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x120, offset 0x5d7
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x9b, hi: 0x9f},
+ {value: 0x0014, lo: 0xa1, hi: 0xaf},
+ // Block 0x121, offset 0x5da
+ {value: 0x0012, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8a, hi: 0x8a},
+ {value: 0x0012, lo: 0x8b, hi: 0x9e},
+ {value: 0x0012, lo: 0xa5, hi: 0xaa},
+ // Block 0x122, offset 0x5de
+ {value: 0x0024, lo: 0x80, hi: 0x86},
+ {value: 0x0024, lo: 0x88, hi: 0x98},
+ {value: 0x0024, lo: 0x9b, hi: 0xa1},
+ {value: 0x0024, lo: 0xa3, hi: 0xa4},
+ {value: 0x0024, lo: 0xa6, hi: 0xaa},
+ {value: 0x0015, lo: 0xb0, hi: 0xbf},
+ // Block 0x123, offset 0x5e4
+ {value: 0x0015, lo: 0x80, hi: 0xad},
+ // Block 0x124, offset 0x5e5
+ {value: 0x0024, lo: 0x8f, hi: 0x8f},
+ // Block 0x125, offset 0x5e6
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ // Block 0x126, offset 0x5e9
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ // Block 0x127, offset 0x5eb
+ {value: 0x0010, lo: 0x90, hi: 0xad},
+ {value: 0x0024, lo: 0xae, hi: 0xae},
+ // Block 0x128, offset 0x5ed
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0024, lo: 0xac, hi: 0xaf},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x129, offset 0x5f0
+ {value: 0x0010, lo: 0x90, hi: 0xaa},
+ {value: 0x0014, lo: 0xab, hi: 0xab},
+ {value: 0x0034, lo: 0xac, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x12a, offset 0x5f5
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xab},
+ {value: 0x0010, lo: 0xad, hi: 0xae},
+ {value: 0x0010, lo: 0xb0, hi: 0xbe},
+ // Block 0x12b, offset 0x5f9
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0034, lo: 0x90, hi: 0x96},
+ // Block 0x12c, offset 0x5fb
+ {value: 0xd152, lo: 0x80, hi: 0x81},
+ {value: 0xd452, lo: 0x82, hi: 0x83},
+ {value: 0x0024, lo: 0x84, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x12d, offset 0x601
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x9f},
+ {value: 0x0010, lo: 0xa1, hi: 0xa2},
+ {value: 0x0010, lo: 0xa4, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb7},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ // Block 0x12e, offset 0x60a
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x9b},
+ {value: 0x0010, lo: 0xa1, hi: 0xa3},
+ {value: 0x0010, lo: 0xa5, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xbb},
+ // Block 0x12f, offset 0x60f
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x130, offset 0x610
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x131, offset 0x613
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ // Block 0x132, offset 0x614
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x133, offset 0x615
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x134, offset 0x616
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0014, lo: 0xa0, hi: 0xbf},
+ // Block 0x135, offset 0x618
+ {value: 0x0014, lo: 0x80, hi: 0xbf},
+ // Block 0x136, offset 0x619
+ {value: 0x0014, lo: 0x80, hi: 0xaf},
+}
+
+// Total table size 16093 bytes (15KiB); checksum: EE91C452
diff --git a/vendor/golang.org/x/text/cases/tables9.0.0.go b/vendor/golang.org/x/text/cases/tables9.0.0.go
new file mode 100644
index 00000000000..3aeb7be6d0e
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/tables9.0.0.go
@@ -0,0 +1,2215 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+//go:build !go1.10
+
+package cases
+
+// UnicodeVersion is the Unicode version from which the tables in this package are derived.
+const UnicodeVersion = "9.0.0"
+
+var xorData string = "" + // Size: 185 bytes
+ "\x00\x06\x07\x00\x01?\x00\x0f\x03\x00\x0f\x12\x00\x0f\x1f\x00\x0f\x1d" +
+ "\x00\x01\x13\x00\x0f\x16\x00\x0f\x0b\x00\x0f3\x00\x0f7\x00\x01#\x00\x0f?" +
+ "\x00\x0e'\x00\x0f/\x00\x0e>\x00\x0f*\x00\x0c&\x00\x0c*\x00\x0c;\x00\x0c9" +
+ "\x00\x0c%\x00\x01\x08\x00\x03\x0d\x00\x03\x09\x00\x02\x06\x00\x02\x02" +
+ "\x00\x02\x0c\x00\x01\x00\x00\x01\x03\x00\x01\x01\x00\x01 \x00\x01\x0c" +
+ "\x00\x01\x10\x00\x03\x10\x00\x036 \x00\x037 \x00\x0b#\x10\x00\x0b 0\x00" +
+ "\x0b!\x10\x00\x0b!0\x00\x0b(\x04\x00\x03\x04\x1e\x00\x03\x0a\x00\x02:" +
+ "\x00\x02>\x00\x02,\x00\x02\x00\x00\x02\x10\x00\x01<\x00\x01&\x00\x01*" +
+ "\x00\x01.\x00\x010\x003 \x00\x01\x18\x00\x01(\x00\x01\x1e\x00\x01\x22"
+
+var exceptions string = "" + // Size: 2068 bytes
+ "\x00\x12\x12μΜΜ\x12\x12ssSSSs\x13\x18i̇i̇\x10\x09II\x13\x1bʼnʼNʼN\x11" +
+ "\x09sSS\x12\x12dždžDž\x12\x12dždžDŽ\x10\x12DŽDž\x12\x12ljljLj\x12\x12ljljLJ\x10\x12LJLj" +
+ "\x12\x12njnjNj\x12\x12njnjNJ\x10\x12NJNj\x13\x1bǰJ̌J̌\x12\x12dzdzDz\x12\x12dzdzDZ\x10" +
+ "\x12DZDz\x13\x18ⱥⱥ\x13\x18ⱦⱦ\x10\x1bⱾⱾ\x10\x1bⱿⱿ\x10\x1bⱯⱯ\x10\x1bⱭⱭ\x10" +
+ "\x1bⱰⱰ\x10\x1bꞫꞫ\x10\x1bꞬꞬ\x10\x1bꞍꞍ\x10\x1bꞪꞪ\x10\x1bꞮꞮ\x10\x1bⱢⱢ\x10" +
+ "\x1bꞭꞭ\x10\x1bⱮⱮ\x10\x1bⱤⱤ\x10\x1bꞱꞱ\x10\x1bꞲꞲ\x10\x1bꞰꞰ2\x12ιΙΙ\x166ΐ" +
+ "Ϊ́Ϊ́\x166ΰΫ́Ϋ́\x12\x12σΣΣ\x12\x12βΒΒ\x12\x12θΘΘ\x12\x12φΦΦ\x12" +
+ "\x12πΠΠ\x12\x12κΚΚ\x12\x12ρΡΡ\x12\x12εΕΕ\x14$եւԵՒԵւ\x12\x12вВВ\x12\x12дД" +
+ "Д\x12\x12оОО\x12\x12сСС\x12\x12тТТ\x12\x12тТТ\x12\x12ъЪЪ\x12\x12ѣѢѢ\x13" +
+ "\x1bꙋꙊꙊ\x13\x1bẖH̱H̱\x13\x1bẗT̈T̈\x13\x1bẘW̊W̊\x13\x1bẙY̊Y̊\x13\x1ba" +
+ "ʾAʾAʾ\x13\x1bṡṠṠ\x12\x10ssß\x14$ὐΥ̓Υ̓\x166ὒΥ̓̀Υ̓̀\x166ὔΥ̓́Υ̓́\x166" +
+ "ὖΥ̓͂Υ̓͂\x15+ἀιἈΙᾈ\x15+ἁιἉΙᾉ\x15+ἂιἊΙᾊ\x15+ἃιἋΙᾋ\x15+ἄιἌΙᾌ\x15+ἅιἍΙᾍ" +
+ "\x15+ἆιἎΙᾎ\x15+ἇιἏΙᾏ\x15\x1dἀιᾀἈΙ\x15\x1dἁιᾁἉΙ\x15\x1dἂιᾂἊΙ\x15\x1dἃιᾃἋΙ" +
+ "\x15\x1dἄιᾄἌΙ\x15\x1dἅιᾅἍΙ\x15\x1dἆιᾆἎΙ\x15\x1dἇιᾇἏΙ\x15+ἠιἨΙᾘ\x15+ἡιἩΙᾙ" +
+ "\x15+ἢιἪΙᾚ\x15+ἣιἫΙᾛ\x15+ἤιἬΙᾜ\x15+ἥιἭΙᾝ\x15+ἦιἮΙᾞ\x15+ἧιἯΙᾟ\x15\x1dἠιᾐἨ" +
+ "Ι\x15\x1dἡιᾑἩΙ\x15\x1dἢιᾒἪΙ\x15\x1dἣιᾓἫΙ\x15\x1dἤιᾔἬΙ\x15\x1dἥιᾕἭΙ\x15" +
+ "\x1dἦιᾖἮΙ\x15\x1dἧιᾗἯΙ\x15+ὠιὨΙᾨ\x15+ὡιὩΙᾩ\x15+ὢιὪΙᾪ\x15+ὣιὫΙᾫ\x15+ὤιὬΙᾬ" +
+ "\x15+ὥιὭΙᾭ\x15+ὦιὮΙᾮ\x15+ὧιὯΙᾯ\x15\x1dὠιᾠὨΙ\x15\x1dὡιᾡὩΙ\x15\x1dὢιᾢὪΙ" +
+ "\x15\x1dὣιᾣὫΙ\x15\x1dὤιᾤὬΙ\x15\x1dὥιᾥὭΙ\x15\x1dὦιᾦὮΙ\x15\x1dὧιᾧὯΙ\x15-ὰι" +
+ "ᾺΙᾺͅ\x14#αιΑΙᾼ\x14$άιΆΙΆͅ\x14$ᾶΑ͂Α͂\x166ᾶιΑ͂Ιᾼ͂\x14\x1cαιᾳΑΙ\x12" +
+ "\x12ιΙΙ\x15-ὴιῊΙῊͅ\x14#ηιΗΙῌ\x14$ήιΉΙΉͅ\x14$ῆΗ͂Η͂\x166ῆιΗ͂Ιῌ͂\x14\x1c" +
+ "ηιῃΗΙ\x166ῒΪ̀Ϊ̀\x166ΐΪ́Ϊ́\x14$ῖΙ͂Ι͂\x166ῗΪ͂Ϊ͂\x166ῢΫ̀Ϋ" +
+ "̀\x166ΰΫ́Ϋ́\x14$ῤΡ̓Ρ̓\x14$ῦΥ͂Υ͂\x166ῧΫ͂Ϋ͂\x15-ὼιῺΙῺͅ\x14#ωιΩΙ" +
+ "ῼ\x14$ώιΏΙΏͅ\x14$ῶΩ͂Ω͂\x166ῶιΩ͂Ιῼ͂\x14\x1cωιῳΩΙ\x12\x10ωω\x11\x08kk" +
+ "\x12\x10åå\x12\x10ɫɫ\x12\x10ɽɽ\x10\x12ȺȺ\x10\x12ȾȾ\x12\x10ɑɑ\x12\x10ɱɱ" +
+ "\x12\x10ɐɐ\x12\x10ɒɒ\x12\x10ȿȿ\x12\x10ɀɀ\x12\x10ɥɥ\x12\x10ɦɦ\x12\x10ɜɜ" +
+ "\x12\x10ɡɡ\x12\x10ɬɬ\x12\x10ɪɪ\x12\x10ʞʞ\x12\x10ʇʇ\x12\x10ʝʝ\x12\x12ffFF" +
+ "Ff\x12\x12fiFIFi\x12\x12flFLFl\x13\x1bffiFFIFfi\x13\x1bfflFFLFfl\x12\x12" +
+ "stSTSt\x12\x12stSTSt\x14$մնՄՆՄն\x14$մեՄԵՄե\x14$միՄԻՄի\x14$վնՎՆՎն\x14$մխՄ" +
+ "ԽՄխ"
+
+// lookup returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookup(s []byte) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupUnsafe(s []byte) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// lookupString returns the trie value for the first UTF-8 encoding in s and
+// the width in bytes of this encoding. The size will be 0 if s does not
+// hold enough bytes to complete the encoding. len(s) must be greater than 0.
+func (t *caseTrie) lookupString(s string) (v uint16, sz int) {
+ c0 := s[0]
+ switch {
+ case c0 < 0x80: // is ASCII
+ return caseValues[c0], 1
+ case c0 < 0xC2:
+ return 0, 1 // Illegal UTF-8: not a starter, not ASCII.
+ case c0 < 0xE0: // 2-byte UTF-8
+ if len(s) < 2 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c1), 2
+ case c0 < 0xF0: // 3-byte UTF-8
+ if len(s) < 3 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c2), 3
+ case c0 < 0xF8: // 4-byte UTF-8
+ if len(s) < 4 {
+ return 0, 0
+ }
+ i := caseIndex[c0]
+ c1 := s[1]
+ if c1 < 0x80 || 0xC0 <= c1 {
+ return 0, 1 // Illegal UTF-8: not a continuation byte.
+ }
+ o := uint32(i)<<6 + uint32(c1)
+ i = caseIndex[o]
+ c2 := s[2]
+ if c2 < 0x80 || 0xC0 <= c2 {
+ return 0, 2 // Illegal UTF-8: not a continuation byte.
+ }
+ o = uint32(i)<<6 + uint32(c2)
+ i = caseIndex[o]
+ c3 := s[3]
+ if c3 < 0x80 || 0xC0 <= c3 {
+ return 0, 3 // Illegal UTF-8: not a continuation byte.
+ }
+ return t.lookupValue(uint32(i), c3), 4
+ }
+ // Illegal rune
+ return 0, 1
+}
+
+// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s.
+// s must start with a full and valid UTF-8 encoded rune.
+func (t *caseTrie) lookupStringUnsafe(s string) uint16 {
+ c0 := s[0]
+ if c0 < 0x80 { // is ASCII
+ return caseValues[c0]
+ }
+ i := caseIndex[c0]
+ if c0 < 0xE0 { // 2-byte UTF-8
+ return t.lookupValue(uint32(i), s[1])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[1])]
+ if c0 < 0xF0 { // 3-byte UTF-8
+ return t.lookupValue(uint32(i), s[2])
+ }
+ i = caseIndex[uint32(i)<<6+uint32(s[2])]
+ if c0 < 0xF8 { // 4-byte UTF-8
+ return t.lookupValue(uint32(i), s[3])
+ }
+ return 0
+}
+
+// caseTrie. Total size: 11742 bytes (11.47 KiB). Checksum: 795fe57ee5135873.
+type caseTrie struct{}
+
+func newCaseTrie(i int) *caseTrie {
+ return &caseTrie{}
+}
+
+// lookupValue determines the type of block n and looks up the value for b.
+func (t *caseTrie) lookupValue(n uint32, b byte) uint16 {
+ switch {
+ case n < 18:
+ return uint16(caseValues[n<<6+uint32(b)])
+ default:
+ n -= 18
+ return uint16(sparse.lookup(n, b))
+ }
+}
+
+// caseValues: 20 blocks, 1280 entries, 2560 bytes
+// The third block is the zero block.
+var caseValues = [1280]uint16{
+ // Block 0x0, offset 0x0
+ 0x27: 0x0054,
+ 0x2e: 0x0054,
+ 0x30: 0x0010, 0x31: 0x0010, 0x32: 0x0010, 0x33: 0x0010, 0x34: 0x0010, 0x35: 0x0010,
+ 0x36: 0x0010, 0x37: 0x0010, 0x38: 0x0010, 0x39: 0x0010, 0x3a: 0x0054,
+ // Block 0x1, offset 0x40
+ 0x41: 0x2013, 0x42: 0x2013, 0x43: 0x2013, 0x44: 0x2013, 0x45: 0x2013,
+ 0x46: 0x2013, 0x47: 0x2013, 0x48: 0x2013, 0x49: 0x2013, 0x4a: 0x2013, 0x4b: 0x2013,
+ 0x4c: 0x2013, 0x4d: 0x2013, 0x4e: 0x2013, 0x4f: 0x2013, 0x50: 0x2013, 0x51: 0x2013,
+ 0x52: 0x2013, 0x53: 0x2013, 0x54: 0x2013, 0x55: 0x2013, 0x56: 0x2013, 0x57: 0x2013,
+ 0x58: 0x2013, 0x59: 0x2013, 0x5a: 0x2013,
+ 0x5e: 0x0004, 0x5f: 0x0010, 0x60: 0x0004, 0x61: 0x2012, 0x62: 0x2012, 0x63: 0x2012,
+ 0x64: 0x2012, 0x65: 0x2012, 0x66: 0x2012, 0x67: 0x2012, 0x68: 0x2012, 0x69: 0x2012,
+ 0x6a: 0x2012, 0x6b: 0x2012, 0x6c: 0x2012, 0x6d: 0x2012, 0x6e: 0x2012, 0x6f: 0x2012,
+ 0x70: 0x2012, 0x71: 0x2012, 0x72: 0x2012, 0x73: 0x2012, 0x74: 0x2012, 0x75: 0x2012,
+ 0x76: 0x2012, 0x77: 0x2012, 0x78: 0x2012, 0x79: 0x2012, 0x7a: 0x2012,
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc0: 0x0852, 0xc1: 0x0b53, 0xc2: 0x0113, 0xc3: 0x0112, 0xc4: 0x0113, 0xc5: 0x0112,
+ 0xc6: 0x0b53, 0xc7: 0x0f13, 0xc8: 0x0f12, 0xc9: 0x0e53, 0xca: 0x1153, 0xcb: 0x0713,
+ 0xcc: 0x0712, 0xcd: 0x0012, 0xce: 0x1453, 0xcf: 0x1753, 0xd0: 0x1a53, 0xd1: 0x0313,
+ 0xd2: 0x0312, 0xd3: 0x1d53, 0xd4: 0x2053, 0xd5: 0x2352, 0xd6: 0x2653, 0xd7: 0x2653,
+ 0xd8: 0x0113, 0xd9: 0x0112, 0xda: 0x2952, 0xdb: 0x0012, 0xdc: 0x1d53, 0xdd: 0x2c53,
+ 0xde: 0x2f52, 0xdf: 0x3253, 0xe0: 0x0113, 0xe1: 0x0112, 0xe2: 0x0113, 0xe3: 0x0112,
+ 0xe4: 0x0113, 0xe5: 0x0112, 0xe6: 0x3553, 0xe7: 0x0f13, 0xe8: 0x0f12, 0xe9: 0x3853,
+ 0xea: 0x0012, 0xeb: 0x0012, 0xec: 0x0113, 0xed: 0x0112, 0xee: 0x3553, 0xef: 0x1f13,
+ 0xf0: 0x1f12, 0xf1: 0x3b53, 0xf2: 0x3e53, 0xf3: 0x0713, 0xf4: 0x0712, 0xf5: 0x0313,
+ 0xf6: 0x0312, 0xf7: 0x4153, 0xf8: 0x0113, 0xf9: 0x0112, 0xfa: 0x0012, 0xfb: 0x0010,
+ 0xfc: 0x0113, 0xfd: 0x0112, 0xfe: 0x0012, 0xff: 0x4452,
+ // Block 0x4, offset 0x100
+ 0x100: 0x0010, 0x101: 0x0010, 0x102: 0x0010, 0x103: 0x0010, 0x104: 0x02db, 0x105: 0x0359,
+ 0x106: 0x03da, 0x107: 0x043b, 0x108: 0x04b9, 0x109: 0x053a, 0x10a: 0x059b, 0x10b: 0x0619,
+ 0x10c: 0x069a, 0x10d: 0x0313, 0x10e: 0x0312, 0x10f: 0x1f13, 0x110: 0x1f12, 0x111: 0x0313,
+ 0x112: 0x0312, 0x113: 0x0713, 0x114: 0x0712, 0x115: 0x0313, 0x116: 0x0312, 0x117: 0x0f13,
+ 0x118: 0x0f12, 0x119: 0x0313, 0x11a: 0x0312, 0x11b: 0x0713, 0x11c: 0x0712, 0x11d: 0x1452,
+ 0x11e: 0x0113, 0x11f: 0x0112, 0x120: 0x0113, 0x121: 0x0112, 0x122: 0x0113, 0x123: 0x0112,
+ 0x124: 0x0113, 0x125: 0x0112, 0x126: 0x0113, 0x127: 0x0112, 0x128: 0x0113, 0x129: 0x0112,
+ 0x12a: 0x0113, 0x12b: 0x0112, 0x12c: 0x0113, 0x12d: 0x0112, 0x12e: 0x0113, 0x12f: 0x0112,
+ 0x130: 0x06fa, 0x131: 0x07ab, 0x132: 0x0829, 0x133: 0x08aa, 0x134: 0x0113, 0x135: 0x0112,
+ 0x136: 0x2353, 0x137: 0x4453, 0x138: 0x0113, 0x139: 0x0112, 0x13a: 0x0113, 0x13b: 0x0112,
+ 0x13c: 0x0113, 0x13d: 0x0112, 0x13e: 0x0113, 0x13f: 0x0112,
+ // Block 0x5, offset 0x140
+ 0x140: 0x0a8a, 0x141: 0x0313, 0x142: 0x0312, 0x143: 0x0853, 0x144: 0x4753, 0x145: 0x4a53,
+ 0x146: 0x0113, 0x147: 0x0112, 0x148: 0x0113, 0x149: 0x0112, 0x14a: 0x0113, 0x14b: 0x0112,
+ 0x14c: 0x0113, 0x14d: 0x0112, 0x14e: 0x0113, 0x14f: 0x0112, 0x150: 0x0b0a, 0x151: 0x0b8a,
+ 0x152: 0x0c0a, 0x153: 0x0b52, 0x154: 0x0b52, 0x155: 0x0012, 0x156: 0x0e52, 0x157: 0x1152,
+ 0x158: 0x0012, 0x159: 0x1752, 0x15a: 0x0012, 0x15b: 0x1a52, 0x15c: 0x0c8a, 0x15d: 0x0012,
+ 0x15e: 0x0012, 0x15f: 0x0012, 0x160: 0x1d52, 0x161: 0x0d0a, 0x162: 0x0012, 0x163: 0x2052,
+ 0x164: 0x0012, 0x165: 0x0d8a, 0x166: 0x0e0a, 0x167: 0x0012, 0x168: 0x2652, 0x169: 0x2652,
+ 0x16a: 0x0e8a, 0x16b: 0x0f0a, 0x16c: 0x0f8a, 0x16d: 0x0012, 0x16e: 0x0012, 0x16f: 0x1d52,
+ 0x170: 0x0012, 0x171: 0x100a, 0x172: 0x2c52, 0x173: 0x0012, 0x174: 0x0012, 0x175: 0x3252,
+ 0x176: 0x0012, 0x177: 0x0012, 0x178: 0x0012, 0x179: 0x0012, 0x17a: 0x0012, 0x17b: 0x0012,
+ 0x17c: 0x0012, 0x17d: 0x108a, 0x17e: 0x0012, 0x17f: 0x0012,
+ // Block 0x6, offset 0x180
+ 0x180: 0x3552, 0x181: 0x0012, 0x182: 0x0012, 0x183: 0x3852, 0x184: 0x0012, 0x185: 0x0012,
+ 0x186: 0x0012, 0x187: 0x110a, 0x188: 0x3552, 0x189: 0x4752, 0x18a: 0x3b52, 0x18b: 0x3e52,
+ 0x18c: 0x4a52, 0x18d: 0x0012, 0x18e: 0x0012, 0x18f: 0x0012, 0x190: 0x0012, 0x191: 0x0012,
+ 0x192: 0x4152, 0x193: 0x0012, 0x194: 0x0010, 0x195: 0x0012, 0x196: 0x0012, 0x197: 0x0012,
+ 0x198: 0x0012, 0x199: 0x0012, 0x19a: 0x0012, 0x19b: 0x0012, 0x19c: 0x0012, 0x19d: 0x118a,
+ 0x19e: 0x120a, 0x19f: 0x0012, 0x1a0: 0x0012, 0x1a1: 0x0012, 0x1a2: 0x0012, 0x1a3: 0x0012,
+ 0x1a4: 0x0012, 0x1a5: 0x0012, 0x1a6: 0x0012, 0x1a7: 0x0012, 0x1a8: 0x0012, 0x1a9: 0x0012,
+ 0x1aa: 0x0012, 0x1ab: 0x0012, 0x1ac: 0x0012, 0x1ad: 0x0012, 0x1ae: 0x0012, 0x1af: 0x0012,
+ 0x1b0: 0x0015, 0x1b1: 0x0015, 0x1b2: 0x0015, 0x1b3: 0x0015, 0x1b4: 0x0015, 0x1b5: 0x0015,
+ 0x1b6: 0x0015, 0x1b7: 0x0015, 0x1b8: 0x0015, 0x1b9: 0x0014, 0x1ba: 0x0014, 0x1bb: 0x0014,
+ 0x1bc: 0x0014, 0x1bd: 0x0014, 0x1be: 0x0014, 0x1bf: 0x0014,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x0024, 0x1c1: 0x0024, 0x1c2: 0x0024, 0x1c3: 0x0024, 0x1c4: 0x0024, 0x1c5: 0x128d,
+ 0x1c6: 0x0024, 0x1c7: 0x0034, 0x1c8: 0x0034, 0x1c9: 0x0034, 0x1ca: 0x0024, 0x1cb: 0x0024,
+ 0x1cc: 0x0024, 0x1cd: 0x0034, 0x1ce: 0x0034, 0x1cf: 0x0014, 0x1d0: 0x0024, 0x1d1: 0x0024,
+ 0x1d2: 0x0024, 0x1d3: 0x0034, 0x1d4: 0x0034, 0x1d5: 0x0034, 0x1d6: 0x0034, 0x1d7: 0x0024,
+ 0x1d8: 0x0034, 0x1d9: 0x0034, 0x1da: 0x0034, 0x1db: 0x0024, 0x1dc: 0x0034, 0x1dd: 0x0034,
+ 0x1de: 0x0034, 0x1df: 0x0034, 0x1e0: 0x0034, 0x1e1: 0x0034, 0x1e2: 0x0034, 0x1e3: 0x0024,
+ 0x1e4: 0x0024, 0x1e5: 0x0024, 0x1e6: 0x0024, 0x1e7: 0x0024, 0x1e8: 0x0024, 0x1e9: 0x0024,
+ 0x1ea: 0x0024, 0x1eb: 0x0024, 0x1ec: 0x0024, 0x1ed: 0x0024, 0x1ee: 0x0024, 0x1ef: 0x0024,
+ 0x1f0: 0x0113, 0x1f1: 0x0112, 0x1f2: 0x0113, 0x1f3: 0x0112, 0x1f4: 0x0014, 0x1f5: 0x0004,
+ 0x1f6: 0x0113, 0x1f7: 0x0112, 0x1fa: 0x0015, 0x1fb: 0x4d52,
+ 0x1fc: 0x5052, 0x1fd: 0x5052, 0x1ff: 0x5353,
+ // Block 0x8, offset 0x200
+ 0x204: 0x0004, 0x205: 0x0004,
+ 0x206: 0x2a13, 0x207: 0x0054, 0x208: 0x2513, 0x209: 0x2713, 0x20a: 0x2513,
+ 0x20c: 0x5653, 0x20e: 0x5953, 0x20f: 0x5c53, 0x210: 0x130a, 0x211: 0x2013,
+ 0x212: 0x2013, 0x213: 0x2013, 0x214: 0x2013, 0x215: 0x2013, 0x216: 0x2013, 0x217: 0x2013,
+ 0x218: 0x2013, 0x219: 0x2013, 0x21a: 0x2013, 0x21b: 0x2013, 0x21c: 0x2013, 0x21d: 0x2013,
+ 0x21e: 0x2013, 0x21f: 0x2013, 0x220: 0x5f53, 0x221: 0x5f53, 0x223: 0x5f53,
+ 0x224: 0x5f53, 0x225: 0x5f53, 0x226: 0x5f53, 0x227: 0x5f53, 0x228: 0x5f53, 0x229: 0x5f53,
+ 0x22a: 0x5f53, 0x22b: 0x5f53, 0x22c: 0x2a12, 0x22d: 0x2512, 0x22e: 0x2712, 0x22f: 0x2512,
+ 0x230: 0x144a, 0x231: 0x2012, 0x232: 0x2012, 0x233: 0x2012, 0x234: 0x2012, 0x235: 0x2012,
+ 0x236: 0x2012, 0x237: 0x2012, 0x238: 0x2012, 0x239: 0x2012, 0x23a: 0x2012, 0x23b: 0x2012,
+ 0x23c: 0x2012, 0x23d: 0x2012, 0x23e: 0x2012, 0x23f: 0x2012,
+ // Block 0x9, offset 0x240
+ 0x240: 0x5f52, 0x241: 0x5f52, 0x242: 0x158a, 0x243: 0x5f52, 0x244: 0x5f52, 0x245: 0x5f52,
+ 0x246: 0x5f52, 0x247: 0x5f52, 0x248: 0x5f52, 0x249: 0x5f52, 0x24a: 0x5f52, 0x24b: 0x5f52,
+ 0x24c: 0x5652, 0x24d: 0x5952, 0x24e: 0x5c52, 0x24f: 0x1813, 0x250: 0x160a, 0x251: 0x168a,
+ 0x252: 0x0013, 0x253: 0x0013, 0x254: 0x0013, 0x255: 0x170a, 0x256: 0x178a, 0x257: 0x1812,
+ 0x258: 0x0113, 0x259: 0x0112, 0x25a: 0x0113, 0x25b: 0x0112, 0x25c: 0x0113, 0x25d: 0x0112,
+ 0x25e: 0x0113, 0x25f: 0x0112, 0x260: 0x0113, 0x261: 0x0112, 0x262: 0x0113, 0x263: 0x0112,
+ 0x264: 0x0113, 0x265: 0x0112, 0x266: 0x0113, 0x267: 0x0112, 0x268: 0x0113, 0x269: 0x0112,
+ 0x26a: 0x0113, 0x26b: 0x0112, 0x26c: 0x0113, 0x26d: 0x0112, 0x26e: 0x0113, 0x26f: 0x0112,
+ 0x270: 0x180a, 0x271: 0x188a, 0x272: 0x0b12, 0x273: 0x5352, 0x274: 0x6253, 0x275: 0x190a,
+ 0x277: 0x0f13, 0x278: 0x0f12, 0x279: 0x0b13, 0x27a: 0x0113, 0x27b: 0x0112,
+ 0x27c: 0x0012, 0x27d: 0x4d53, 0x27e: 0x5053, 0x27f: 0x5053,
+ // Block 0xa, offset 0x280
+ 0x280: 0x0812, 0x281: 0x0812, 0x282: 0x0812, 0x283: 0x0812, 0x284: 0x0812, 0x285: 0x0812,
+ 0x288: 0x0813, 0x289: 0x0813, 0x28a: 0x0813, 0x28b: 0x0813,
+ 0x28c: 0x0813, 0x28d: 0x0813, 0x290: 0x239a, 0x291: 0x0812,
+ 0x292: 0x247a, 0x293: 0x0812, 0x294: 0x25ba, 0x295: 0x0812, 0x296: 0x26fa, 0x297: 0x0812,
+ 0x299: 0x0813, 0x29b: 0x0813, 0x29d: 0x0813,
+ 0x29f: 0x0813, 0x2a0: 0x0812, 0x2a1: 0x0812, 0x2a2: 0x0812, 0x2a3: 0x0812,
+ 0x2a4: 0x0812, 0x2a5: 0x0812, 0x2a6: 0x0812, 0x2a7: 0x0812, 0x2a8: 0x0813, 0x2a9: 0x0813,
+ 0x2aa: 0x0813, 0x2ab: 0x0813, 0x2ac: 0x0813, 0x2ad: 0x0813, 0x2ae: 0x0813, 0x2af: 0x0813,
+ 0x2b0: 0x8b52, 0x2b1: 0x8b52, 0x2b2: 0x8e52, 0x2b3: 0x8e52, 0x2b4: 0x9152, 0x2b5: 0x9152,
+ 0x2b6: 0x9452, 0x2b7: 0x9452, 0x2b8: 0x9752, 0x2b9: 0x9752, 0x2ba: 0x9a52, 0x2bb: 0x9a52,
+ 0x2bc: 0x4d52, 0x2bd: 0x4d52,
+ // Block 0xb, offset 0x2c0
+ 0x2c0: 0x283a, 0x2c1: 0x292a, 0x2c2: 0x2a1a, 0x2c3: 0x2b0a, 0x2c4: 0x2bfa, 0x2c5: 0x2cea,
+ 0x2c6: 0x2dda, 0x2c7: 0x2eca, 0x2c8: 0x2fb9, 0x2c9: 0x30a9, 0x2ca: 0x3199, 0x2cb: 0x3289,
+ 0x2cc: 0x3379, 0x2cd: 0x3469, 0x2ce: 0x3559, 0x2cf: 0x3649, 0x2d0: 0x373a, 0x2d1: 0x382a,
+ 0x2d2: 0x391a, 0x2d3: 0x3a0a, 0x2d4: 0x3afa, 0x2d5: 0x3bea, 0x2d6: 0x3cda, 0x2d7: 0x3dca,
+ 0x2d8: 0x3eb9, 0x2d9: 0x3fa9, 0x2da: 0x4099, 0x2db: 0x4189, 0x2dc: 0x4279, 0x2dd: 0x4369,
+ 0x2de: 0x4459, 0x2df: 0x4549, 0x2e0: 0x463a, 0x2e1: 0x472a, 0x2e2: 0x481a, 0x2e3: 0x490a,
+ 0x2e4: 0x49fa, 0x2e5: 0x4aea, 0x2e6: 0x4bda, 0x2e7: 0x4cca, 0x2e8: 0x4db9, 0x2e9: 0x4ea9,
+ 0x2ea: 0x4f99, 0x2eb: 0x5089, 0x2ec: 0x5179, 0x2ed: 0x5269, 0x2ee: 0x5359, 0x2ef: 0x5449,
+ 0x2f0: 0x0812, 0x2f1: 0x0812, 0x2f2: 0x553a, 0x2f3: 0x564a, 0x2f4: 0x571a,
+ 0x2f6: 0x57fa, 0x2f7: 0x58da, 0x2f8: 0x0813, 0x2f9: 0x0813, 0x2fa: 0x8b53, 0x2fb: 0x8b53,
+ 0x2fc: 0x5a19, 0x2fd: 0x0004, 0x2fe: 0x5aea, 0x2ff: 0x0004,
+ // Block 0xc, offset 0x300
+ 0x300: 0x0004, 0x301: 0x0004, 0x302: 0x5b6a, 0x303: 0x5c7a, 0x304: 0x5d4a,
+ 0x306: 0x5e2a, 0x307: 0x5f0a, 0x308: 0x8e53, 0x309: 0x8e53, 0x30a: 0x9153, 0x30b: 0x9153,
+ 0x30c: 0x6049, 0x30d: 0x0004, 0x30e: 0x0004, 0x30f: 0x0004, 0x310: 0x0812, 0x311: 0x0812,
+ 0x312: 0x611a, 0x313: 0x625a, 0x316: 0x639a, 0x317: 0x647a,
+ 0x318: 0x0813, 0x319: 0x0813, 0x31a: 0x9453, 0x31b: 0x9453, 0x31d: 0x0004,
+ 0x31e: 0x0004, 0x31f: 0x0004, 0x320: 0x0812, 0x321: 0x0812, 0x322: 0x65ba, 0x323: 0x66fa,
+ 0x324: 0x683a, 0x325: 0x0912, 0x326: 0x691a, 0x327: 0x69fa, 0x328: 0x0813, 0x329: 0x0813,
+ 0x32a: 0x9a53, 0x32b: 0x9a53, 0x32c: 0x0913, 0x32d: 0x0004, 0x32e: 0x0004, 0x32f: 0x0004,
+ 0x332: 0x6b3a, 0x333: 0x6c4a, 0x334: 0x6d1a,
+ 0x336: 0x6dfa, 0x337: 0x6eda, 0x338: 0x9753, 0x339: 0x9753, 0x33a: 0x4d53, 0x33b: 0x4d53,
+ 0x33c: 0x7019, 0x33d: 0x0004, 0x33e: 0x0004,
+ // Block 0xd, offset 0x340
+ 0x342: 0x0013,
+ 0x347: 0x0013, 0x34a: 0x0012, 0x34b: 0x0013,
+ 0x34c: 0x0013, 0x34d: 0x0013, 0x34e: 0x0012, 0x34f: 0x0012, 0x350: 0x0013, 0x351: 0x0013,
+ 0x352: 0x0013, 0x353: 0x0012, 0x355: 0x0013,
+ 0x359: 0x0013, 0x35a: 0x0013, 0x35b: 0x0013, 0x35c: 0x0013, 0x35d: 0x0013,
+ 0x364: 0x0013, 0x366: 0x70eb, 0x368: 0x0013,
+ 0x36a: 0x714b, 0x36b: 0x718b, 0x36c: 0x0013, 0x36d: 0x0013, 0x36f: 0x0012,
+ 0x370: 0x0013, 0x371: 0x0013, 0x372: 0x9d53, 0x373: 0x0013, 0x374: 0x0012, 0x375: 0x0010,
+ 0x376: 0x0010, 0x377: 0x0010, 0x378: 0x0010, 0x379: 0x0012,
+ 0x37c: 0x0012, 0x37d: 0x0012, 0x37e: 0x0013, 0x37f: 0x0013,
+ // Block 0xe, offset 0x380
+ 0x380: 0x1a13, 0x381: 0x1a13, 0x382: 0x1e13, 0x383: 0x1e13, 0x384: 0x1a13, 0x385: 0x1a13,
+ 0x386: 0x2613, 0x387: 0x2613, 0x388: 0x2a13, 0x389: 0x2a13, 0x38a: 0x2e13, 0x38b: 0x2e13,
+ 0x38c: 0x2a13, 0x38d: 0x2a13, 0x38e: 0x2613, 0x38f: 0x2613, 0x390: 0xa052, 0x391: 0xa052,
+ 0x392: 0xa352, 0x393: 0xa352, 0x394: 0xa652, 0x395: 0xa652, 0x396: 0xa352, 0x397: 0xa352,
+ 0x398: 0xa052, 0x399: 0xa052, 0x39a: 0x1a12, 0x39b: 0x1a12, 0x39c: 0x1e12, 0x39d: 0x1e12,
+ 0x39e: 0x1a12, 0x39f: 0x1a12, 0x3a0: 0x2612, 0x3a1: 0x2612, 0x3a2: 0x2a12, 0x3a3: 0x2a12,
+ 0x3a4: 0x2e12, 0x3a5: 0x2e12, 0x3a6: 0x2a12, 0x3a7: 0x2a12, 0x3a8: 0x2612, 0x3a9: 0x2612,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x6552, 0x3c1: 0x6552, 0x3c2: 0x6552, 0x3c3: 0x6552, 0x3c4: 0x6552, 0x3c5: 0x6552,
+ 0x3c6: 0x6552, 0x3c7: 0x6552, 0x3c8: 0x6552, 0x3c9: 0x6552, 0x3ca: 0x6552, 0x3cb: 0x6552,
+ 0x3cc: 0x6552, 0x3cd: 0x6552, 0x3ce: 0x6552, 0x3cf: 0x6552, 0x3d0: 0xa952, 0x3d1: 0xa952,
+ 0x3d2: 0xa952, 0x3d3: 0xa952, 0x3d4: 0xa952, 0x3d5: 0xa952, 0x3d6: 0xa952, 0x3d7: 0xa952,
+ 0x3d8: 0xa952, 0x3d9: 0xa952, 0x3da: 0xa952, 0x3db: 0xa952, 0x3dc: 0xa952, 0x3dd: 0xa952,
+ 0x3de: 0xa952, 0x3e0: 0x0113, 0x3e1: 0x0112, 0x3e2: 0x71eb, 0x3e3: 0x8853,
+ 0x3e4: 0x724b, 0x3e5: 0x72aa, 0x3e6: 0x730a, 0x3e7: 0x0f13, 0x3e8: 0x0f12, 0x3e9: 0x0313,
+ 0x3ea: 0x0312, 0x3eb: 0x0713, 0x3ec: 0x0712, 0x3ed: 0x736b, 0x3ee: 0x73cb, 0x3ef: 0x742b,
+ 0x3f0: 0x748b, 0x3f1: 0x0012, 0x3f2: 0x0113, 0x3f3: 0x0112, 0x3f4: 0x0012, 0x3f5: 0x0313,
+ 0x3f6: 0x0312, 0x3f7: 0x0012, 0x3f8: 0x0012, 0x3f9: 0x0012, 0x3fa: 0x0012, 0x3fb: 0x0012,
+ 0x3fc: 0x0015, 0x3fd: 0x0015, 0x3fe: 0x74eb, 0x3ff: 0x754b,
+ // Block 0x10, offset 0x400
+ 0x400: 0x0113, 0x401: 0x0112, 0x402: 0x0113, 0x403: 0x0112, 0x404: 0x0113, 0x405: 0x0112,
+ 0x406: 0x0113, 0x407: 0x0112, 0x408: 0x0014, 0x409: 0x0004, 0x40a: 0x0004, 0x40b: 0x0713,
+ 0x40c: 0x0712, 0x40d: 0x75ab, 0x40e: 0x0012, 0x40f: 0x0010, 0x410: 0x0113, 0x411: 0x0112,
+ 0x412: 0x0113, 0x413: 0x0112, 0x414: 0x0012, 0x415: 0x0012, 0x416: 0x0113, 0x417: 0x0112,
+ 0x418: 0x0113, 0x419: 0x0112, 0x41a: 0x0113, 0x41b: 0x0112, 0x41c: 0x0113, 0x41d: 0x0112,
+ 0x41e: 0x0113, 0x41f: 0x0112, 0x420: 0x0113, 0x421: 0x0112, 0x422: 0x0113, 0x423: 0x0112,
+ 0x424: 0x0113, 0x425: 0x0112, 0x426: 0x0113, 0x427: 0x0112, 0x428: 0x0113, 0x429: 0x0112,
+ 0x42a: 0x760b, 0x42b: 0x766b, 0x42c: 0x76cb, 0x42d: 0x772b, 0x42e: 0x778b,
+ 0x430: 0x77eb, 0x431: 0x784b, 0x432: 0x78ab, 0x433: 0xac53, 0x434: 0x0113, 0x435: 0x0112,
+ 0x436: 0x0113, 0x437: 0x0112,
+ // Block 0x11, offset 0x440
+ 0x440: 0x790a, 0x441: 0x798a, 0x442: 0x7a0a, 0x443: 0x7a8a, 0x444: 0x7b3a, 0x445: 0x7bea,
+ 0x446: 0x7c6a,
+ 0x453: 0x7cea, 0x454: 0x7dca, 0x455: 0x7eaa, 0x456: 0x7f8a, 0x457: 0x806a,
+ 0x45d: 0x0010,
+ 0x45e: 0x0034, 0x45f: 0x0010, 0x460: 0x0010, 0x461: 0x0010, 0x462: 0x0010, 0x463: 0x0010,
+ 0x464: 0x0010, 0x465: 0x0010, 0x466: 0x0010, 0x467: 0x0010, 0x468: 0x0010,
+ 0x46a: 0x0010, 0x46b: 0x0010, 0x46c: 0x0010, 0x46d: 0x0010, 0x46e: 0x0010, 0x46f: 0x0010,
+ 0x470: 0x0010, 0x471: 0x0010, 0x472: 0x0010, 0x473: 0x0010, 0x474: 0x0010, 0x475: 0x0010,
+ 0x476: 0x0010, 0x478: 0x0010, 0x479: 0x0010, 0x47a: 0x0010, 0x47b: 0x0010,
+ 0x47c: 0x0010, 0x47e: 0x0010,
+ // Block 0x12, offset 0x480
+ 0x480: 0x2213, 0x481: 0x2213, 0x482: 0x2613, 0x483: 0x2613, 0x484: 0x2213, 0x485: 0x2213,
+ 0x486: 0x2e13, 0x487: 0x2e13, 0x488: 0x2213, 0x489: 0x2213, 0x48a: 0x2613, 0x48b: 0x2613,
+ 0x48c: 0x2213, 0x48d: 0x2213, 0x48e: 0x3e13, 0x48f: 0x3e13, 0x490: 0x2213, 0x491: 0x2213,
+ 0x492: 0x2613, 0x493: 0x2613, 0x494: 0x2213, 0x495: 0x2213, 0x496: 0x2e13, 0x497: 0x2e13,
+ 0x498: 0x2213, 0x499: 0x2213, 0x49a: 0x2613, 0x49b: 0x2613, 0x49c: 0x2213, 0x49d: 0x2213,
+ 0x49e: 0xb553, 0x49f: 0xb553, 0x4a0: 0xb853, 0x4a1: 0xb853, 0x4a2: 0x2212, 0x4a3: 0x2212,
+ 0x4a4: 0x2612, 0x4a5: 0x2612, 0x4a6: 0x2212, 0x4a7: 0x2212, 0x4a8: 0x2e12, 0x4a9: 0x2e12,
+ 0x4aa: 0x2212, 0x4ab: 0x2212, 0x4ac: 0x2612, 0x4ad: 0x2612, 0x4ae: 0x2212, 0x4af: 0x2212,
+ 0x4b0: 0x3e12, 0x4b1: 0x3e12, 0x4b2: 0x2212, 0x4b3: 0x2212, 0x4b4: 0x2612, 0x4b5: 0x2612,
+ 0x4b6: 0x2212, 0x4b7: 0x2212, 0x4b8: 0x2e12, 0x4b9: 0x2e12, 0x4ba: 0x2212, 0x4bb: 0x2212,
+ 0x4bc: 0x2612, 0x4bd: 0x2612, 0x4be: 0x2212, 0x4bf: 0x2212,
+ // Block 0x13, offset 0x4c0
+ 0x4c2: 0x0010,
+ 0x4c7: 0x0010, 0x4c9: 0x0010, 0x4cb: 0x0010,
+ 0x4cd: 0x0010, 0x4ce: 0x0010, 0x4cf: 0x0010, 0x4d1: 0x0010,
+ 0x4d2: 0x0010, 0x4d4: 0x0010, 0x4d7: 0x0010,
+ 0x4d9: 0x0010, 0x4db: 0x0010, 0x4dd: 0x0010,
+ 0x4df: 0x0010, 0x4e1: 0x0010, 0x4e2: 0x0010,
+ 0x4e4: 0x0010, 0x4e7: 0x0010, 0x4e8: 0x0010, 0x4e9: 0x0010,
+ 0x4ea: 0x0010, 0x4ec: 0x0010, 0x4ed: 0x0010, 0x4ee: 0x0010, 0x4ef: 0x0010,
+ 0x4f0: 0x0010, 0x4f1: 0x0010, 0x4f2: 0x0010, 0x4f4: 0x0010, 0x4f5: 0x0010,
+ 0x4f6: 0x0010, 0x4f7: 0x0010, 0x4f9: 0x0010, 0x4fa: 0x0010, 0x4fb: 0x0010,
+ 0x4fc: 0x0010, 0x4fe: 0x0010,
+}
+
+// caseIndex: 25 blocks, 1600 entries, 3200 bytes
+// Block 0 is the zero block.
+var caseIndex = [1600]uint16{
+ // Block 0x0, offset 0x0
+ // Block 0x1, offset 0x40
+ // Block 0x2, offset 0x80
+ // Block 0x3, offset 0xc0
+ 0xc2: 0x12, 0xc3: 0x13, 0xc4: 0x14, 0xc5: 0x15, 0xc6: 0x01, 0xc7: 0x02,
+ 0xc8: 0x16, 0xc9: 0x03, 0xca: 0x04, 0xcb: 0x17, 0xcc: 0x18, 0xcd: 0x05, 0xce: 0x06, 0xcf: 0x07,
+ 0xd0: 0x19, 0xd1: 0x1a, 0xd2: 0x1b, 0xd3: 0x1c, 0xd4: 0x1d, 0xd5: 0x1e, 0xd6: 0x1f, 0xd7: 0x20,
+ 0xd8: 0x21, 0xd9: 0x22, 0xda: 0x23, 0xdb: 0x24, 0xdc: 0x25, 0xdd: 0x26, 0xde: 0x27, 0xdf: 0x28,
+ 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05,
+ 0xea: 0x06, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x08, 0xef: 0x09,
+ 0xf0: 0x14, 0xf3: 0x16,
+ // Block 0x4, offset 0x100
+ 0x120: 0x29, 0x121: 0x2a, 0x122: 0x2b, 0x123: 0x2c, 0x124: 0x2d, 0x125: 0x2e, 0x126: 0x2f, 0x127: 0x30,
+ 0x128: 0x31, 0x129: 0x32, 0x12a: 0x33, 0x12b: 0x34, 0x12c: 0x35, 0x12d: 0x36, 0x12e: 0x37, 0x12f: 0x38,
+ 0x130: 0x39, 0x131: 0x3a, 0x132: 0x3b, 0x133: 0x3c, 0x134: 0x3d, 0x135: 0x3e, 0x136: 0x3f, 0x137: 0x40,
+ 0x138: 0x41, 0x139: 0x42, 0x13a: 0x43, 0x13b: 0x44, 0x13c: 0x45, 0x13d: 0x46, 0x13e: 0x47, 0x13f: 0x48,
+ // Block 0x5, offset 0x140
+ 0x140: 0x49, 0x141: 0x4a, 0x142: 0x4b, 0x143: 0x4c, 0x144: 0x23, 0x145: 0x23, 0x146: 0x23, 0x147: 0x23,
+ 0x148: 0x23, 0x149: 0x4d, 0x14a: 0x4e, 0x14b: 0x4f, 0x14c: 0x50, 0x14d: 0x51, 0x14e: 0x52, 0x14f: 0x53,
+ 0x150: 0x54, 0x151: 0x23, 0x152: 0x23, 0x153: 0x23, 0x154: 0x23, 0x155: 0x23, 0x156: 0x23, 0x157: 0x23,
+ 0x158: 0x23, 0x159: 0x55, 0x15a: 0x56, 0x15b: 0x57, 0x15c: 0x58, 0x15d: 0x59, 0x15e: 0x5a, 0x15f: 0x5b,
+ 0x160: 0x5c, 0x161: 0x5d, 0x162: 0x5e, 0x163: 0x5f, 0x164: 0x60, 0x165: 0x61, 0x167: 0x62,
+ 0x168: 0x63, 0x169: 0x64, 0x16a: 0x65, 0x16c: 0x66, 0x16d: 0x67, 0x16e: 0x68, 0x16f: 0x69,
+ 0x170: 0x6a, 0x171: 0x6b, 0x172: 0x6c, 0x173: 0x6d, 0x174: 0x6e, 0x175: 0x6f, 0x176: 0x70, 0x177: 0x71,
+ 0x178: 0x72, 0x179: 0x72, 0x17a: 0x73, 0x17b: 0x72, 0x17c: 0x74, 0x17d: 0x08, 0x17e: 0x09, 0x17f: 0x0a,
+ // Block 0x6, offset 0x180
+ 0x180: 0x75, 0x181: 0x76, 0x182: 0x77, 0x183: 0x78, 0x184: 0x0b, 0x185: 0x79, 0x186: 0x7a,
+ 0x192: 0x7b, 0x193: 0x0c,
+ 0x1b0: 0x7c, 0x1b1: 0x0d, 0x1b2: 0x72, 0x1b3: 0x7d, 0x1b4: 0x7e, 0x1b5: 0x7f, 0x1b6: 0x80, 0x1b7: 0x81,
+ 0x1b8: 0x82,
+ // Block 0x7, offset 0x1c0
+ 0x1c0: 0x83, 0x1c2: 0x84, 0x1c3: 0x85, 0x1c4: 0x86, 0x1c5: 0x23, 0x1c6: 0x87,
+ // Block 0x8, offset 0x200
+ 0x200: 0x88, 0x201: 0x23, 0x202: 0x23, 0x203: 0x23, 0x204: 0x23, 0x205: 0x23, 0x206: 0x23, 0x207: 0x23,
+ 0x208: 0x23, 0x209: 0x23, 0x20a: 0x23, 0x20b: 0x23, 0x20c: 0x23, 0x20d: 0x23, 0x20e: 0x23, 0x20f: 0x23,
+ 0x210: 0x23, 0x211: 0x23, 0x212: 0x89, 0x213: 0x8a, 0x214: 0x23, 0x215: 0x23, 0x216: 0x23, 0x217: 0x23,
+ 0x218: 0x8b, 0x219: 0x8c, 0x21a: 0x8d, 0x21b: 0x8e, 0x21c: 0x8f, 0x21d: 0x90, 0x21e: 0x0e, 0x21f: 0x91,
+ 0x220: 0x92, 0x221: 0x93, 0x222: 0x23, 0x223: 0x94, 0x224: 0x95, 0x225: 0x96, 0x226: 0x97, 0x227: 0x98,
+ 0x228: 0x99, 0x229: 0x9a, 0x22a: 0x9b, 0x22b: 0x9c, 0x22c: 0x9d, 0x22d: 0x9e, 0x22e: 0x9f, 0x22f: 0xa0,
+ 0x230: 0x23, 0x231: 0x23, 0x232: 0x23, 0x233: 0x23, 0x234: 0x23, 0x235: 0x23, 0x236: 0x23, 0x237: 0x23,
+ 0x238: 0x23, 0x239: 0x23, 0x23a: 0x23, 0x23b: 0x23, 0x23c: 0x23, 0x23d: 0x23, 0x23e: 0x23, 0x23f: 0x23,
+ // Block 0x9, offset 0x240
+ 0x240: 0x23, 0x241: 0x23, 0x242: 0x23, 0x243: 0x23, 0x244: 0x23, 0x245: 0x23, 0x246: 0x23, 0x247: 0x23,
+ 0x248: 0x23, 0x249: 0x23, 0x24a: 0x23, 0x24b: 0x23, 0x24c: 0x23, 0x24d: 0x23, 0x24e: 0x23, 0x24f: 0x23,
+ 0x250: 0x23, 0x251: 0x23, 0x252: 0x23, 0x253: 0x23, 0x254: 0x23, 0x255: 0x23, 0x256: 0x23, 0x257: 0x23,
+ 0x258: 0x23, 0x259: 0x23, 0x25a: 0x23, 0x25b: 0x23, 0x25c: 0x23, 0x25d: 0x23, 0x25e: 0x23, 0x25f: 0x23,
+ 0x260: 0x23, 0x261: 0x23, 0x262: 0x23, 0x263: 0x23, 0x264: 0x23, 0x265: 0x23, 0x266: 0x23, 0x267: 0x23,
+ 0x268: 0x23, 0x269: 0x23, 0x26a: 0x23, 0x26b: 0x23, 0x26c: 0x23, 0x26d: 0x23, 0x26e: 0x23, 0x26f: 0x23,
+ 0x270: 0x23, 0x271: 0x23, 0x272: 0x23, 0x273: 0x23, 0x274: 0x23, 0x275: 0x23, 0x276: 0x23, 0x277: 0x23,
+ 0x278: 0x23, 0x279: 0x23, 0x27a: 0x23, 0x27b: 0x23, 0x27c: 0x23, 0x27d: 0x23, 0x27e: 0x23, 0x27f: 0x23,
+ // Block 0xa, offset 0x280
+ 0x280: 0x23, 0x281: 0x23, 0x282: 0x23, 0x283: 0x23, 0x284: 0x23, 0x285: 0x23, 0x286: 0x23, 0x287: 0x23,
+ 0x288: 0x23, 0x289: 0x23, 0x28a: 0x23, 0x28b: 0x23, 0x28c: 0x23, 0x28d: 0x23, 0x28e: 0x23, 0x28f: 0x23,
+ 0x290: 0x23, 0x291: 0x23, 0x292: 0x23, 0x293: 0x23, 0x294: 0x23, 0x295: 0x23, 0x296: 0x23, 0x297: 0x23,
+ 0x298: 0x23, 0x299: 0x23, 0x29a: 0x23, 0x29b: 0x23, 0x29c: 0x23, 0x29d: 0x23, 0x29e: 0xa1, 0x29f: 0xa2,
+ // Block 0xb, offset 0x2c0
+ 0x2ec: 0x0f, 0x2ed: 0xa3, 0x2ee: 0xa4, 0x2ef: 0xa5,
+ 0x2f0: 0x23, 0x2f1: 0x23, 0x2f2: 0x23, 0x2f3: 0x23, 0x2f4: 0xa6, 0x2f5: 0xa7, 0x2f6: 0xa8, 0x2f7: 0xa9,
+ 0x2f8: 0xaa, 0x2f9: 0xab, 0x2fa: 0x23, 0x2fb: 0xac, 0x2fc: 0xad, 0x2fd: 0xae, 0x2fe: 0xaf, 0x2ff: 0xb0,
+ // Block 0xc, offset 0x300
+ 0x300: 0xb1, 0x301: 0xb2, 0x302: 0x23, 0x303: 0xb3, 0x305: 0xb4, 0x307: 0xb5,
+ 0x30a: 0xb6, 0x30b: 0xb7, 0x30c: 0xb8, 0x30d: 0xb9, 0x30e: 0xba, 0x30f: 0xbb,
+ 0x310: 0xbc, 0x311: 0xbd, 0x312: 0xbe, 0x313: 0xbf, 0x314: 0xc0, 0x315: 0xc1,
+ 0x318: 0x23, 0x319: 0x23, 0x31a: 0x23, 0x31b: 0x23, 0x31c: 0xc2, 0x31d: 0xc3,
+ 0x320: 0xc4, 0x321: 0xc5, 0x322: 0xc6, 0x323: 0xc7, 0x324: 0xc8, 0x326: 0xc9,
+ 0x328: 0xca, 0x329: 0xcb, 0x32a: 0xcc, 0x32b: 0xcd, 0x32c: 0x5f, 0x32d: 0xce, 0x32e: 0xcf,
+ 0x330: 0x23, 0x331: 0xd0, 0x332: 0xd1, 0x333: 0xd2,
+ // Block 0xd, offset 0x340
+ 0x340: 0xd3, 0x341: 0xd4, 0x342: 0xd5, 0x343: 0xd6, 0x344: 0xd7, 0x345: 0xd8, 0x346: 0xd9, 0x347: 0xda,
+ 0x348: 0xdb, 0x34a: 0xdc, 0x34b: 0xdd, 0x34c: 0xde, 0x34d: 0xdf,
+ 0x350: 0xe0, 0x351: 0xe1, 0x352: 0xe2, 0x353: 0xe3, 0x356: 0xe4, 0x357: 0xe5,
+ 0x358: 0xe6, 0x359: 0xe7, 0x35a: 0xe8, 0x35b: 0xe9, 0x35c: 0xea,
+ 0x362: 0xeb, 0x363: 0xec,
+ 0x36b: 0xed,
+ 0x370: 0xee, 0x371: 0xef, 0x372: 0xf0,
+ // Block 0xe, offset 0x380
+ 0x380: 0x23, 0x381: 0x23, 0x382: 0x23, 0x383: 0x23, 0x384: 0x23, 0x385: 0x23, 0x386: 0x23, 0x387: 0x23,
+ 0x388: 0x23, 0x389: 0x23, 0x38a: 0x23, 0x38b: 0x23, 0x38c: 0x23, 0x38d: 0x23, 0x38e: 0xf1,
+ 0x390: 0x23, 0x391: 0xf2, 0x392: 0x23, 0x393: 0x23, 0x394: 0x23, 0x395: 0xf3,
+ // Block 0xf, offset 0x3c0
+ 0x3c0: 0x23, 0x3c1: 0x23, 0x3c2: 0x23, 0x3c3: 0x23, 0x3c4: 0x23, 0x3c5: 0x23, 0x3c6: 0x23, 0x3c7: 0x23,
+ 0x3c8: 0x23, 0x3c9: 0x23, 0x3ca: 0x23, 0x3cb: 0x23, 0x3cc: 0x23, 0x3cd: 0x23, 0x3ce: 0x23, 0x3cf: 0x23,
+ 0x3d0: 0xf2,
+ // Block 0x10, offset 0x400
+ 0x410: 0x23, 0x411: 0x23, 0x412: 0x23, 0x413: 0x23, 0x414: 0x23, 0x415: 0x23, 0x416: 0x23, 0x417: 0x23,
+ 0x418: 0x23, 0x419: 0xf4,
+ // Block 0x11, offset 0x440
+ 0x460: 0x23, 0x461: 0x23, 0x462: 0x23, 0x463: 0x23, 0x464: 0x23, 0x465: 0x23, 0x466: 0x23, 0x467: 0x23,
+ 0x468: 0xed, 0x469: 0xf5, 0x46b: 0xf6, 0x46c: 0xf7, 0x46d: 0xf8, 0x46e: 0xf9,
+ 0x47c: 0x23, 0x47d: 0xfa, 0x47e: 0xfb, 0x47f: 0xfc,
+ // Block 0x12, offset 0x480
+ 0x4b0: 0x23, 0x4b1: 0xfd, 0x4b2: 0xfe,
+ // Block 0x13, offset 0x4c0
+ 0x4c5: 0xff, 0x4c6: 0x100,
+ 0x4c9: 0x101,
+ 0x4d0: 0x102, 0x4d1: 0x103, 0x4d2: 0x104, 0x4d3: 0x105, 0x4d4: 0x106, 0x4d5: 0x107, 0x4d6: 0x108, 0x4d7: 0x109,
+ 0x4d8: 0x10a, 0x4d9: 0x10b, 0x4da: 0x10c, 0x4db: 0x10d, 0x4dc: 0x10e, 0x4dd: 0x10f, 0x4de: 0x110, 0x4df: 0x111,
+ 0x4e8: 0x112, 0x4e9: 0x113, 0x4ea: 0x114,
+ // Block 0x14, offset 0x500
+ 0x500: 0x115,
+ 0x520: 0x23, 0x521: 0x23, 0x522: 0x23, 0x523: 0x116, 0x524: 0x10, 0x525: 0x117,
+ 0x538: 0x118, 0x539: 0x11, 0x53a: 0x119,
+ // Block 0x15, offset 0x540
+ 0x544: 0x11a, 0x545: 0x11b, 0x546: 0x11c,
+ 0x54f: 0x11d,
+ // Block 0x16, offset 0x580
+ 0x590: 0x0a, 0x591: 0x0b, 0x592: 0x0c, 0x593: 0x0d, 0x594: 0x0e, 0x596: 0x0f,
+ 0x59b: 0x10, 0x59d: 0x11, 0x59e: 0x12, 0x59f: 0x13,
+ // Block 0x17, offset 0x5c0
+ 0x5c0: 0x11e, 0x5c1: 0x11f, 0x5c4: 0x11f, 0x5c5: 0x11f, 0x5c6: 0x11f, 0x5c7: 0x120,
+ // Block 0x18, offset 0x600
+ 0x620: 0x15,
+}
+
+// sparseOffsets: 272 entries, 544 bytes
+var sparseOffsets = []uint16{0x0, 0x9, 0xf, 0x18, 0x24, 0x2e, 0x3a, 0x3d, 0x41, 0x44, 0x48, 0x52, 0x54, 0x59, 0x69, 0x70, 0x75, 0x83, 0x84, 0x92, 0xa1, 0xab, 0xae, 0xb4, 0xbc, 0xbe, 0xc0, 0xce, 0xd4, 0xe2, 0xed, 0xf8, 0x103, 0x10f, 0x119, 0x124, 0x12f, 0x13b, 0x147, 0x14f, 0x157, 0x161, 0x16c, 0x178, 0x17e, 0x189, 0x18e, 0x196, 0x199, 0x19e, 0x1a2, 0x1a6, 0x1ad, 0x1b6, 0x1be, 0x1bf, 0x1c8, 0x1cf, 0x1d7, 0x1dd, 0x1e3, 0x1e8, 0x1ec, 0x1ef, 0x1f1, 0x1f4, 0x1f9, 0x1fa, 0x1fc, 0x1fe, 0x200, 0x207, 0x20c, 0x210, 0x219, 0x21c, 0x21f, 0x225, 0x226, 0x231, 0x232, 0x233, 0x238, 0x245, 0x24d, 0x255, 0x25e, 0x267, 0x270, 0x275, 0x278, 0x281, 0x28e, 0x290, 0x297, 0x299, 0x2a4, 0x2a5, 0x2b0, 0x2b8, 0x2c0, 0x2c6, 0x2c7, 0x2d5, 0x2da, 0x2dd, 0x2e2, 0x2e6, 0x2ec, 0x2f1, 0x2f4, 0x2f9, 0x2fe, 0x2ff, 0x305, 0x307, 0x308, 0x30a, 0x30c, 0x30f, 0x310, 0x312, 0x315, 0x31b, 0x31f, 0x321, 0x327, 0x32e, 0x332, 0x33b, 0x33c, 0x344, 0x348, 0x34d, 0x355, 0x35b, 0x361, 0x36b, 0x370, 0x379, 0x37f, 0x386, 0x38a, 0x392, 0x394, 0x396, 0x399, 0x39b, 0x39d, 0x39e, 0x39f, 0x3a1, 0x3a3, 0x3a9, 0x3ae, 0x3b0, 0x3b6, 0x3b9, 0x3bb, 0x3c1, 0x3c6, 0x3c8, 0x3c9, 0x3ca, 0x3cb, 0x3cd, 0x3cf, 0x3d1, 0x3d4, 0x3d6, 0x3d9, 0x3e1, 0x3e4, 0x3e8, 0x3f0, 0x3f2, 0x3f3, 0x3f4, 0x3f6, 0x3fc, 0x3fe, 0x3ff, 0x401, 0x403, 0x405, 0x412, 0x413, 0x414, 0x418, 0x41a, 0x41b, 0x41c, 0x41d, 0x41e, 0x422, 0x426, 0x42c, 0x42e, 0x435, 0x438, 0x43c, 0x442, 0x44b, 0x451, 0x457, 0x461, 0x46b, 0x46d, 0x474, 0x47a, 0x480, 0x486, 0x489, 0x48f, 0x492, 0x49a, 0x49b, 0x4a2, 0x4a3, 0x4a6, 0x4a7, 0x4ad, 0x4b0, 0x4b8, 0x4b9, 0x4ba, 0x4bb, 0x4bc, 0x4be, 0x4c0, 0x4c2, 0x4c6, 0x4c7, 0x4c9, 0x4ca, 0x4cb, 0x4cd, 0x4d2, 0x4d7, 0x4db, 0x4dc, 0x4df, 0x4e3, 0x4ee, 0x4f2, 0x4fa, 0x4ff, 0x503, 0x506, 0x50a, 0x50d, 0x510, 0x515, 0x519, 0x51d, 0x521, 0x525, 0x527, 0x529, 0x52c, 0x531, 0x533, 0x538, 0x541, 0x546, 0x547, 0x54a, 0x54b, 0x54c, 0x54e, 0x54f, 0x550}
+
+// sparseValues: 1360 entries, 5440 bytes
+var sparseValues = [1360]valueRange{
+ // Block 0x0, offset 0x0
+ {value: 0x0004, lo: 0xa8, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xaa},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0004, lo: 0xaf, hi: 0xaf},
+ {value: 0x0004, lo: 0xb4, hi: 0xb4},
+ {value: 0x001a, lo: 0xb5, hi: 0xb5},
+ {value: 0x0054, lo: 0xb7, hi: 0xb7},
+ {value: 0x0004, lo: 0xb8, hi: 0xb8},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ // Block 0x1, offset 0x9
+ {value: 0x2013, lo: 0x80, hi: 0x96},
+ {value: 0x2013, lo: 0x98, hi: 0x9e},
+ {value: 0x009a, lo: 0x9f, hi: 0x9f},
+ {value: 0x2012, lo: 0xa0, hi: 0xb6},
+ {value: 0x2012, lo: 0xb8, hi: 0xbe},
+ {value: 0x0252, lo: 0xbf, hi: 0xbf},
+ // Block 0x2, offset 0xf
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x011b, lo: 0xb0, hi: 0xb0},
+ {value: 0x019a, lo: 0xb1, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb7},
+ {value: 0x0012, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x0553, lo: 0xbf, hi: 0xbf},
+ // Block 0x3, offset 0x18
+ {value: 0x0552, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x01da, lo: 0x89, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xb7},
+ {value: 0x0253, lo: 0xb8, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x0316, lo: 0xbd, hi: 0xbe},
+ {value: 0x028a, lo: 0xbf, hi: 0xbf},
+ // Block 0x4, offset 0x24
+ {value: 0x0117, lo: 0x80, hi: 0x9f},
+ {value: 0x2f53, lo: 0xa0, hi: 0xa0},
+ {value: 0x0012, lo: 0xa1, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xb3},
+ {value: 0x0012, lo: 0xb4, hi: 0xb9},
+ {value: 0x090b, lo: 0xba, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x2953, lo: 0xbd, hi: 0xbd},
+ {value: 0x098b, lo: 0xbe, hi: 0xbe},
+ {value: 0x0a0a, lo: 0xbf, hi: 0xbf},
+ // Block 0x5, offset 0x2e
+ {value: 0x0015, lo: 0x80, hi: 0x81},
+ {value: 0x0004, lo: 0x82, hi: 0x85},
+ {value: 0x0014, lo: 0x86, hi: 0x91},
+ {value: 0x0004, lo: 0x92, hi: 0x96},
+ {value: 0x0054, lo: 0x97, hi: 0x97},
+ {value: 0x0004, lo: 0x98, hi: 0x9f},
+ {value: 0x0015, lo: 0xa0, hi: 0xa4},
+ {value: 0x0004, lo: 0xa5, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xac},
+ {value: 0x0004, lo: 0xad, hi: 0xad},
+ {value: 0x0014, lo: 0xae, hi: 0xae},
+ {value: 0x0004, lo: 0xaf, hi: 0xbf},
+ // Block 0x6, offset 0x3a
+ {value: 0x0024, lo: 0x80, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbf},
+ // Block 0x7, offset 0x3d
+ {value: 0x6553, lo: 0x80, hi: 0x8f},
+ {value: 0x2013, lo: 0x90, hi: 0x9f},
+ {value: 0x5f53, lo: 0xa0, hi: 0xaf},
+ {value: 0x2012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8, offset 0x41
+ {value: 0x5f52, lo: 0x80, hi: 0x8f},
+ {value: 0x6552, lo: 0x90, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x9, offset 0x44
+ {value: 0x0117, lo: 0x80, hi: 0x81},
+ {value: 0x0024, lo: 0x83, hi: 0x87},
+ {value: 0x0014, lo: 0x88, hi: 0x89},
+ {value: 0x0117, lo: 0x8a, hi: 0xbf},
+ // Block 0xa, offset 0x48
+ {value: 0x0f13, lo: 0x80, hi: 0x80},
+ {value: 0x0316, lo: 0x81, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0316, lo: 0x85, hi: 0x86},
+ {value: 0x0f16, lo: 0x87, hi: 0x88},
+ {value: 0x0316, lo: 0x89, hi: 0x8a},
+ {value: 0x0716, lo: 0x8b, hi: 0x8c},
+ {value: 0x0316, lo: 0x8d, hi: 0x8e},
+ {value: 0x0f12, lo: 0x8f, hi: 0x8f},
+ {value: 0x0117, lo: 0x90, hi: 0xbf},
+ // Block 0xb, offset 0x52
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x6553, lo: 0xb1, hi: 0xbf},
+ // Block 0xc, offset 0x54
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6853, lo: 0x90, hi: 0x96},
+ {value: 0x0014, lo: 0x99, hi: 0x99},
+ {value: 0x6552, lo: 0xa1, hi: 0xaf},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0xd, offset 0x59
+ {value: 0x6852, lo: 0x80, hi: 0x86},
+ {value: 0x198a, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0024, lo: 0x92, hi: 0x95},
+ {value: 0x0034, lo: 0x96, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x99},
+ {value: 0x0034, lo: 0x9a, hi: 0x9b},
+ {value: 0x0024, lo: 0x9c, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa7},
+ {value: 0x0024, lo: 0xa8, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xbd},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xe, offset 0x69
+ {value: 0x0034, lo: 0x81, hi: 0x82},
+ {value: 0x0024, lo: 0x84, hi: 0x84},
+ {value: 0x0034, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb3},
+ {value: 0x0054, lo: 0xb4, hi: 0xb4},
+ // Block 0xf, offset 0x70
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0024, lo: 0x90, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0014, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x10, offset 0x75
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x8a},
+ {value: 0x0034, lo: 0x8b, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9c},
+ {value: 0x0024, lo: 0x9d, hi: 0x9e},
+ {value: 0x0034, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0034, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x11, offset 0x83
+ {value: 0x0010, lo: 0x80, hi: 0xbf},
+ // Block 0x12, offset 0x84
+ {value: 0x0010, lo: 0x80, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0024, lo: 0x9f, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xaa, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x13, offset 0x92
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0034, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0034, lo: 0xb1, hi: 0xb1},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbc},
+ {value: 0x0024, lo: 0xbd, hi: 0xbd},
+ {value: 0x0034, lo: 0xbe, hi: 0xbe},
+ {value: 0x0024, lo: 0xbf, hi: 0xbf},
+ // Block 0x14, offset 0xa1
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0024, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x88},
+ {value: 0x0024, lo: 0x89, hi: 0x8a},
+ {value: 0x0010, lo: 0x8d, hi: 0xbf},
+ // Block 0x15, offset 0xab
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x16, offset 0xae
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0024, lo: 0xab, hi: 0xb1},
+ {value: 0x0034, lo: 0xb2, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ // Block 0x17, offset 0xb4
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0024, lo: 0x96, hi: 0x99},
+ {value: 0x0014, lo: 0x9a, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0xa3},
+ {value: 0x0014, lo: 0xa4, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xad},
+ // Block 0x18, offset 0xbc
+ {value: 0x0010, lo: 0x80, hi: 0x98},
+ {value: 0x0034, lo: 0x99, hi: 0x9b},
+ // Block 0x19, offset 0xbe
+ {value: 0x0010, lo: 0xa0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbd},
+ // Block 0x1a, offset 0xc0
+ {value: 0x0024, lo: 0x94, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0034, lo: 0xa3, hi: 0xa3},
+ {value: 0x0024, lo: 0xa4, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0024, lo: 0xaa, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xb2},
+ {value: 0x0024, lo: 0xb3, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbf},
+ // Block 0x1b, offset 0xce
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1c, offset 0xd4
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0024, lo: 0x93, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x98, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0x1d, offset 0xe2
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb6, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x1e, offset 0xed
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xb1},
+ // Block 0x1f, offset 0xf8
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x20, offset 0x103
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x91, hi: 0x91},
+ {value: 0x0010, lo: 0x99, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x21, offset 0x10f
+ {value: 0x0014, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x22, offset 0x119
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x85},
+ {value: 0x0014, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x89, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ // Block 0x23, offset 0x124
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x24, offset 0x12f
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9c, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ // Block 0x25, offset 0x13b
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8a},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ {value: 0x0010, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0010, lo: 0xa8, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x26, offset 0x147
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x82},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x27, offset 0x14f
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb9},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbf},
+ // Block 0x28, offset 0x157
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x88},
+ {value: 0x0014, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0034, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ // Block 0x29, offset 0x161
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x2a, offset 0x16c
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x95, hi: 0x96},
+ {value: 0x0010, lo: 0x9e, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb1, hi: 0xb2},
+ // Block 0x2b, offset 0x178
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0xba},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x2c, offset 0x17e
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8e, hi: 0x8e},
+ {value: 0x0010, lo: 0x94, hi: 0x97},
+ {value: 0x0010, lo: 0x9f, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa3},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xba, hi: 0xbf},
+ // Block 0x2d, offset 0x189
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x96},
+ {value: 0x0010, lo: 0x9a, hi: 0xb1},
+ {value: 0x0010, lo: 0xb3, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x2e, offset 0x18e
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x8f, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x94},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9f},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ // Block 0x2f, offset 0x196
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xba},
+ // Block 0x30, offset 0x199
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x87},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x31, offset 0x19e
+ {value: 0x0014, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb4, hi: 0xb7},
+ {value: 0x0034, lo: 0xb8, hi: 0xb9},
+ {value: 0x0014, lo: 0xbb, hi: 0xbc},
+ // Block 0x32, offset 0x1a2
+ {value: 0x0004, lo: 0x86, hi: 0x86},
+ {value: 0x0034, lo: 0x88, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x33, offset 0x1a6
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0034, lo: 0x98, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0034, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x34, offset 0x1ad
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xac},
+ {value: 0x0034, lo: 0xb1, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xba, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x35, offset 0x1b6
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0024, lo: 0x82, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0024, lo: 0x86, hi: 0x87},
+ {value: 0x0010, lo: 0x88, hi: 0x8c},
+ {value: 0x0014, lo: 0x8d, hi: 0x97},
+ {value: 0x0014, lo: 0x99, hi: 0xbc},
+ // Block 0x36, offset 0x1be
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ // Block 0x37, offset 0x1bf
+ {value: 0x0010, lo: 0xab, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ {value: 0x0010, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbe},
+ // Block 0x38, offset 0x1c8
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x96, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x99},
+ {value: 0x0014, lo: 0x9e, hi: 0xa0},
+ {value: 0x0010, lo: 0xa2, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xad},
+ {value: 0x0014, lo: 0xb1, hi: 0xb4},
+ // Block 0x39, offset 0x1cf
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x6c53, lo: 0xa0, hi: 0xbf},
+ // Block 0x3a, offset 0x1d7
+ {value: 0x7053, lo: 0x80, hi: 0x85},
+ {value: 0x7053, lo: 0x87, hi: 0x87},
+ {value: 0x7053, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xba},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x3b, offset 0x1dd
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x9a, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x3c, offset 0x1e3
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x3d, offset 0x1e8
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x82, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3e, offset 0x1ec
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0010, lo: 0x92, hi: 0x95},
+ {value: 0x0010, lo: 0x98, hi: 0xbf},
+ // Block 0x3f, offset 0x1ef
+ {value: 0x0010, lo: 0x80, hi: 0x9a},
+ {value: 0x0024, lo: 0x9d, hi: 0x9f},
+ // Block 0x40, offset 0x1f1
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x7453, lo: 0xa0, hi: 0xaf},
+ {value: 0x7853, lo: 0xb0, hi: 0xbf},
+ // Block 0x41, offset 0x1f4
+ {value: 0x7c53, lo: 0x80, hi: 0x8f},
+ {value: 0x8053, lo: 0x90, hi: 0x9f},
+ {value: 0x7c53, lo: 0xa0, hi: 0xaf},
+ {value: 0x0813, lo: 0xb0, hi: 0xb5},
+ {value: 0x0892, lo: 0xb8, hi: 0xbd},
+ // Block 0x42, offset 0x1f9
+ {value: 0x0010, lo: 0x81, hi: 0xbf},
+ // Block 0x43, offset 0x1fa
+ {value: 0x0010, lo: 0x80, hi: 0xac},
+ {value: 0x0010, lo: 0xaf, hi: 0xbf},
+ // Block 0x44, offset 0x1fc
+ {value: 0x0010, lo: 0x81, hi: 0x9a},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x45, offset 0x1fe
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xae, hi: 0xb8},
+ // Block 0x46, offset 0x200
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ {value: 0x0010, lo: 0x8e, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0034, lo: 0x94, hi: 0x94},
+ {value: 0x0010, lo: 0xa0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ // Block 0x47, offset 0x207
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0014, lo: 0x92, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xac},
+ {value: 0x0010, lo: 0xae, hi: 0xb0},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ // Block 0x48, offset 0x20c
+ {value: 0x0014, lo: 0xb4, hi: 0xb5},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0x49, offset 0x210
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0014, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0014, lo: 0x89, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x92},
+ {value: 0x0014, lo: 0x93, hi: 0x93},
+ {value: 0x0004, lo: 0x97, hi: 0x97},
+ {value: 0x0024, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0x4a, offset 0x219
+ {value: 0x0014, lo: 0x8b, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x4b, offset 0x21c
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb7},
+ // Block 0x4c, offset 0x21f
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x4d, offset 0x225
+ {value: 0x0010, lo: 0x80, hi: 0xb5},
+ // Block 0x4e, offset 0x226
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xb9},
+ {value: 0x0024, lo: 0xba, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbb},
+ // Block 0x4f, offset 0x231
+ {value: 0x0010, lo: 0x86, hi: 0x8f},
+ // Block 0x50, offset 0x232
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x51, offset 0x233
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0024, lo: 0x97, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x98},
+ {value: 0x0010, lo: 0x99, hi: 0x9a},
+ {value: 0x0014, lo: 0x9b, hi: 0x9b},
+ // Block 0x52, offset 0x238
+ {value: 0x0010, lo: 0x95, hi: 0x95},
+ {value: 0x0014, lo: 0x96, hi: 0x96},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0014, lo: 0x98, hi: 0x9e},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa2},
+ {value: 0x0010, lo: 0xa3, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xac},
+ {value: 0x0010, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0024, lo: 0xb5, hi: 0xbc},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x53, offset 0x245
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xa7, hi: 0xa7},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ {value: 0x0034, lo: 0xb5, hi: 0xba},
+ {value: 0x0024, lo: 0xbb, hi: 0xbc},
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0x54, offset 0x24d
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x55, offset 0x255
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x83},
+ {value: 0x0030, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x8b},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xab, hi: 0xab},
+ {value: 0x0034, lo: 0xac, hi: 0xac},
+ {value: 0x0024, lo: 0xad, hi: 0xb3},
+ // Block 0x56, offset 0x25e
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0030, lo: 0xaa, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xbf},
+ // Block 0x57, offset 0x267
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa9},
+ {value: 0x0010, lo: 0xaa, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0030, lo: 0xb2, hi: 0xb3},
+ // Block 0x58, offset 0x270
+ {value: 0x0010, lo: 0x80, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0x59, offset 0x275
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8d, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x5a, offset 0x278
+ {value: 0x1a6a, lo: 0x80, hi: 0x80},
+ {value: 0x1aea, lo: 0x81, hi: 0x81},
+ {value: 0x1b6a, lo: 0x82, hi: 0x82},
+ {value: 0x1bea, lo: 0x83, hi: 0x83},
+ {value: 0x1c6a, lo: 0x84, hi: 0x84},
+ {value: 0x1cea, lo: 0x85, hi: 0x85},
+ {value: 0x1d6a, lo: 0x86, hi: 0x86},
+ {value: 0x1dea, lo: 0x87, hi: 0x87},
+ {value: 0x1e6a, lo: 0x88, hi: 0x88},
+ // Block 0x5b, offset 0x281
+ {value: 0x0024, lo: 0x90, hi: 0x92},
+ {value: 0x0034, lo: 0x94, hi: 0x99},
+ {value: 0x0024, lo: 0x9a, hi: 0x9b},
+ {value: 0x0034, lo: 0x9c, hi: 0x9f},
+ {value: 0x0024, lo: 0xa0, hi: 0xa0},
+ {value: 0x0010, lo: 0xa1, hi: 0xa1},
+ {value: 0x0034, lo: 0xa2, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xb3},
+ {value: 0x0024, lo: 0xb4, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb6},
+ {value: 0x0024, lo: 0xb8, hi: 0xb9},
+ // Block 0x5c, offset 0x28e
+ {value: 0x0012, lo: 0x80, hi: 0xab},
+ {value: 0x0015, lo: 0xac, hi: 0xbf},
+ // Block 0x5d, offset 0x290
+ {value: 0x0015, lo: 0x80, hi: 0xaa},
+ {value: 0x0012, lo: 0xab, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb8},
+ {value: 0x8452, lo: 0xb9, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbc},
+ {value: 0x8852, lo: 0xbd, hi: 0xbd},
+ {value: 0x0012, lo: 0xbe, hi: 0xbf},
+ // Block 0x5e, offset 0x297
+ {value: 0x0012, lo: 0x80, hi: 0x9a},
+ {value: 0x0015, lo: 0x9b, hi: 0xbf},
+ // Block 0x5f, offset 0x299
+ {value: 0x0024, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0024, lo: 0x83, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0024, lo: 0x8b, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x90},
+ {value: 0x0024, lo: 0x91, hi: 0xb5},
+ {value: 0x0024, lo: 0xbb, hi: 0xbb},
+ {value: 0x0034, lo: 0xbc, hi: 0xbd},
+ {value: 0x0024, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x60, offset 0x2a4
+ {value: 0x0117, lo: 0x80, hi: 0xbf},
+ // Block 0x61, offset 0x2a5
+ {value: 0x0117, lo: 0x80, hi: 0x95},
+ {value: 0x1f1a, lo: 0x96, hi: 0x96},
+ {value: 0x1fca, lo: 0x97, hi: 0x97},
+ {value: 0x207a, lo: 0x98, hi: 0x98},
+ {value: 0x212a, lo: 0x99, hi: 0x99},
+ {value: 0x21da, lo: 0x9a, hi: 0x9a},
+ {value: 0x228a, lo: 0x9b, hi: 0x9b},
+ {value: 0x0012, lo: 0x9c, hi: 0x9d},
+ {value: 0x233b, lo: 0x9e, hi: 0x9e},
+ {value: 0x0012, lo: 0x9f, hi: 0x9f},
+ {value: 0x0117, lo: 0xa0, hi: 0xbf},
+ // Block 0x62, offset 0x2b0
+ {value: 0x0812, lo: 0x80, hi: 0x87},
+ {value: 0x0813, lo: 0x88, hi: 0x8f},
+ {value: 0x0812, lo: 0x90, hi: 0x95},
+ {value: 0x0813, lo: 0x98, hi: 0x9d},
+ {value: 0x0812, lo: 0xa0, hi: 0xa7},
+ {value: 0x0813, lo: 0xa8, hi: 0xaf},
+ {value: 0x0812, lo: 0xb0, hi: 0xb7},
+ {value: 0x0813, lo: 0xb8, hi: 0xbf},
+ // Block 0x63, offset 0x2b8
+ {value: 0x0004, lo: 0x8b, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8f},
+ {value: 0x0054, lo: 0x98, hi: 0x99},
+ {value: 0x0054, lo: 0xa4, hi: 0xa4},
+ {value: 0x0054, lo: 0xa7, hi: 0xa7},
+ {value: 0x0014, lo: 0xaa, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xaf},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x64, offset 0x2c0
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x94, hi: 0x94},
+ {value: 0x0014, lo: 0xa0, hi: 0xa4},
+ {value: 0x0014, lo: 0xa6, hi: 0xaf},
+ {value: 0x0015, lo: 0xb1, hi: 0xb1},
+ {value: 0x0015, lo: 0xbf, hi: 0xbf},
+ // Block 0x65, offset 0x2c6
+ {value: 0x0015, lo: 0x90, hi: 0x9c},
+ // Block 0x66, offset 0x2c7
+ {value: 0x0024, lo: 0x90, hi: 0x91},
+ {value: 0x0034, lo: 0x92, hi: 0x93},
+ {value: 0x0024, lo: 0x94, hi: 0x97},
+ {value: 0x0034, lo: 0x98, hi: 0x9a},
+ {value: 0x0024, lo: 0x9b, hi: 0x9c},
+ {value: 0x0014, lo: 0x9d, hi: 0xa0},
+ {value: 0x0024, lo: 0xa1, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa4},
+ {value: 0x0034, lo: 0xa5, hi: 0xa6},
+ {value: 0x0024, lo: 0xa7, hi: 0xa7},
+ {value: 0x0034, lo: 0xa8, hi: 0xa8},
+ {value: 0x0024, lo: 0xa9, hi: 0xa9},
+ {value: 0x0034, lo: 0xaa, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ // Block 0x67, offset 0x2d5
+ {value: 0x0016, lo: 0x85, hi: 0x86},
+ {value: 0x0012, lo: 0x87, hi: 0x89},
+ {value: 0x9d52, lo: 0x8e, hi: 0x8e},
+ {value: 0x1013, lo: 0xa0, hi: 0xaf},
+ {value: 0x1012, lo: 0xb0, hi: 0xbf},
+ // Block 0x68, offset 0x2da
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0716, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x88},
+ // Block 0x69, offset 0x2dd
+ {value: 0xa053, lo: 0xb6, hi: 0xb7},
+ {value: 0xa353, lo: 0xb8, hi: 0xb9},
+ {value: 0xa653, lo: 0xba, hi: 0xbb},
+ {value: 0xa353, lo: 0xbc, hi: 0xbd},
+ {value: 0xa053, lo: 0xbe, hi: 0xbf},
+ // Block 0x6a, offset 0x2e2
+ {value: 0x3013, lo: 0x80, hi: 0x8f},
+ {value: 0x6553, lo: 0x90, hi: 0x9f},
+ {value: 0xa953, lo: 0xa0, hi: 0xae},
+ {value: 0x3012, lo: 0xb0, hi: 0xbf},
+ // Block 0x6b, offset 0x2e6
+ {value: 0x0117, lo: 0x80, hi: 0xa3},
+ {value: 0x0012, lo: 0xa4, hi: 0xa4},
+ {value: 0x0716, lo: 0xab, hi: 0xac},
+ {value: 0x0316, lo: 0xad, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xb3},
+ // Block 0x6c, offset 0x2ec
+ {value: 0x6c52, lo: 0x80, hi: 0x9f},
+ {value: 0x7052, lo: 0xa0, hi: 0xa5},
+ {value: 0x7052, lo: 0xa7, hi: 0xa7},
+ {value: 0x7052, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x6d, offset 0x2f1
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0x6e, offset 0x2f4
+ {value: 0x0010, lo: 0x80, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0010, lo: 0xb0, hi: 0xb6},
+ {value: 0x0010, lo: 0xb8, hi: 0xbe},
+ // Block 0x6f, offset 0x2f9
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x8e},
+ {value: 0x0010, lo: 0x90, hi: 0x96},
+ {value: 0x0010, lo: 0x98, hi: 0x9e},
+ {value: 0x0024, lo: 0xa0, hi: 0xbf},
+ // Block 0x70, offset 0x2fe
+ {value: 0x0014, lo: 0xaf, hi: 0xaf},
+ // Block 0x71, offset 0x2ff
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0xaa, hi: 0xad},
+ {value: 0x0030, lo: 0xae, hi: 0xaf},
+ {value: 0x0004, lo: 0xb1, hi: 0xb5},
+ {value: 0x0014, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ // Block 0x72, offset 0x305
+ {value: 0x0034, lo: 0x99, hi: 0x9a},
+ {value: 0x0004, lo: 0x9b, hi: 0x9e},
+ // Block 0x73, offset 0x307
+ {value: 0x0004, lo: 0xbc, hi: 0xbe},
+ // Block 0x74, offset 0x308
+ {value: 0x0010, lo: 0x85, hi: 0xad},
+ {value: 0x0010, lo: 0xb1, hi: 0xbf},
+ // Block 0x75, offset 0x30a
+ {value: 0x0010, lo: 0x80, hi: 0x8e},
+ {value: 0x0010, lo: 0xa0, hi: 0xba},
+ // Block 0x76, offset 0x30c
+ {value: 0x0010, lo: 0x80, hi: 0x94},
+ {value: 0x0014, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0x96, hi: 0xbf},
+ // Block 0x77, offset 0x30f
+ {value: 0x0010, lo: 0x80, hi: 0x8c},
+ // Block 0x78, offset 0x310
+ {value: 0x0010, lo: 0x90, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ // Block 0x79, offset 0x312
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0xab},
+ // Block 0x7a, offset 0x315
+ {value: 0x0117, lo: 0x80, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xae},
+ {value: 0x0024, lo: 0xaf, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb2},
+ {value: 0x0024, lo: 0xb4, hi: 0xbd},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x7b, offset 0x31b
+ {value: 0x0117, lo: 0x80, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9d},
+ {value: 0x0024, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0x7c, offset 0x31f
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb1},
+ // Block 0x7d, offset 0x321
+ {value: 0x0004, lo: 0x80, hi: 0x96},
+ {value: 0x0014, lo: 0x97, hi: 0x9f},
+ {value: 0x0004, lo: 0xa0, hi: 0xa1},
+ {value: 0x0117, lo: 0xa2, hi: 0xaf},
+ {value: 0x0012, lo: 0xb0, hi: 0xb1},
+ {value: 0x0117, lo: 0xb2, hi: 0xbf},
+ // Block 0x7e, offset 0x327
+ {value: 0x0117, lo: 0x80, hi: 0xaf},
+ {value: 0x0015, lo: 0xb0, hi: 0xb0},
+ {value: 0x0012, lo: 0xb1, hi: 0xb8},
+ {value: 0x0316, lo: 0xb9, hi: 0xba},
+ {value: 0x0716, lo: 0xbb, hi: 0xbc},
+ {value: 0x8453, lo: 0xbd, hi: 0xbd},
+ {value: 0x0117, lo: 0xbe, hi: 0xbf},
+ // Block 0x7f, offset 0x32e
+ {value: 0x0010, lo: 0xb7, hi: 0xb7},
+ {value: 0x0015, lo: 0xb8, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbf},
+ // Block 0x80, offset 0x332
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0014, lo: 0x82, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8b},
+ {value: 0x0010, lo: 0x8c, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa6},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ // Block 0x81, offset 0x33b
+ {value: 0x0010, lo: 0x80, hi: 0xb3},
+ // Block 0x82, offset 0x33c
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0034, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x85, hi: 0x85},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0024, lo: 0xa0, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb7},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x83, offset 0x344
+ {value: 0x0010, lo: 0x80, hi: 0xa5},
+ {value: 0x0014, lo: 0xa6, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x84, offset 0x348
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0014, lo: 0x87, hi: 0x91},
+ {value: 0x0010, lo: 0x92, hi: 0x92},
+ {value: 0x0030, lo: 0x93, hi: 0x93},
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0x85, offset 0x34d
+ {value: 0x0014, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xb9},
+ {value: 0x0010, lo: 0xba, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0x86, offset 0x355
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0004, lo: 0xa6, hi: 0xa6},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x87, offset 0x35b
+ {value: 0x0010, lo: 0x80, hi: 0xa8},
+ {value: 0x0014, lo: 0xa9, hi: 0xae},
+ {value: 0x0010, lo: 0xaf, hi: 0xb0},
+ {value: 0x0014, lo: 0xb1, hi: 0xb2},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0x88, offset 0x361
+ {value: 0x0010, lo: 0x80, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x8b},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0010, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbd},
+ // Block 0x89, offset 0x36b
+ {value: 0x0024, lo: 0xb0, hi: 0xb0},
+ {value: 0x0024, lo: 0xb2, hi: 0xb3},
+ {value: 0x0034, lo: 0xb4, hi: 0xb4},
+ {value: 0x0024, lo: 0xb7, hi: 0xb8},
+ {value: 0x0024, lo: 0xbe, hi: 0xbf},
+ // Block 0x8a, offset 0x370
+ {value: 0x0024, lo: 0x81, hi: 0x81},
+ {value: 0x0004, lo: 0x9d, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xab},
+ {value: 0x0014, lo: 0xac, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb2, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ // Block 0x8b, offset 0x379
+ {value: 0x0010, lo: 0x81, hi: 0x86},
+ {value: 0x0010, lo: 0x89, hi: 0x8e},
+ {value: 0x0010, lo: 0x91, hi: 0x96},
+ {value: 0x0010, lo: 0xa0, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0x8c, offset 0x37f
+ {value: 0x0012, lo: 0x80, hi: 0x92},
+ {value: 0xac52, lo: 0x93, hi: 0x93},
+ {value: 0x0012, lo: 0x94, hi: 0x9a},
+ {value: 0x0004, lo: 0x9b, hi: 0x9b},
+ {value: 0x0015, lo: 0x9c, hi: 0x9f},
+ {value: 0x0012, lo: 0xa0, hi: 0xa5},
+ {value: 0x74d2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8d, offset 0x386
+ {value: 0x78d2, lo: 0x80, hi: 0x8f},
+ {value: 0x7cd2, lo: 0x90, hi: 0x9f},
+ {value: 0x80d2, lo: 0xa0, hi: 0xaf},
+ {value: 0x7cd2, lo: 0xb0, hi: 0xbf},
+ // Block 0x8e, offset 0x38a
+ {value: 0x0010, lo: 0x80, hi: 0xa4},
+ {value: 0x0014, lo: 0xa5, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa7},
+ {value: 0x0014, lo: 0xa8, hi: 0xa8},
+ {value: 0x0010, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0034, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0x8f, offset 0x392
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0x90, offset 0x394
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x8b, hi: 0xbb},
+ // Block 0x91, offset 0x396
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x86, hi: 0xbf},
+ // Block 0x92, offset 0x399
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0004, lo: 0xb2, hi: 0xbf},
+ // Block 0x93, offset 0x39b
+ {value: 0x0004, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x93, hi: 0xbf},
+ // Block 0x94, offset 0x39d
+ {value: 0x0010, lo: 0x80, hi: 0xbd},
+ // Block 0x95, offset 0x39e
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0x96, offset 0x39f
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0xbf},
+ // Block 0x97, offset 0x3a1
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0xb0, hi: 0xbb},
+ // Block 0x98, offset 0x3a3
+ {value: 0x0014, lo: 0x80, hi: 0x8f},
+ {value: 0x0054, lo: 0x93, hi: 0x93},
+ {value: 0x0024, lo: 0xa0, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xad},
+ {value: 0x0024, lo: 0xae, hi: 0xaf},
+ {value: 0x0010, lo: 0xb3, hi: 0xb4},
+ // Block 0x99, offset 0x3a9
+ {value: 0x0010, lo: 0x8d, hi: 0x8f},
+ {value: 0x0054, lo: 0x92, hi: 0x92},
+ {value: 0x0054, lo: 0x95, hi: 0x95},
+ {value: 0x0010, lo: 0xb0, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0x9a, offset 0x3ae
+ {value: 0x0010, lo: 0x80, hi: 0xbc},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0x9b, offset 0x3b0
+ {value: 0x0054, lo: 0x87, hi: 0x87},
+ {value: 0x0054, lo: 0x8e, hi: 0x8e},
+ {value: 0x0054, lo: 0x9a, hi: 0x9a},
+ {value: 0x5f53, lo: 0xa1, hi: 0xba},
+ {value: 0x0004, lo: 0xbe, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0x9c, offset 0x3b6
+ {value: 0x0004, lo: 0x80, hi: 0x80},
+ {value: 0x5f52, lo: 0x81, hi: 0x9a},
+ {value: 0x0004, lo: 0xb0, hi: 0xb0},
+ // Block 0x9d, offset 0x3b9
+ {value: 0x0014, lo: 0x9e, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xbe},
+ // Block 0x9e, offset 0x3bb
+ {value: 0x0010, lo: 0x82, hi: 0x87},
+ {value: 0x0010, lo: 0x8a, hi: 0x8f},
+ {value: 0x0010, lo: 0x92, hi: 0x97},
+ {value: 0x0010, lo: 0x9a, hi: 0x9c},
+ {value: 0x0004, lo: 0xa3, hi: 0xa3},
+ {value: 0x0014, lo: 0xb9, hi: 0xbb},
+ // Block 0x9f, offset 0x3c1
+ {value: 0x0010, lo: 0x80, hi: 0x8b},
+ {value: 0x0010, lo: 0x8d, hi: 0xa6},
+ {value: 0x0010, lo: 0xa8, hi: 0xba},
+ {value: 0x0010, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xa0, offset 0x3c6
+ {value: 0x0010, lo: 0x80, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x9d},
+ // Block 0xa1, offset 0x3c8
+ {value: 0x0010, lo: 0x80, hi: 0xba},
+ // Block 0xa2, offset 0x3c9
+ {value: 0x0010, lo: 0x80, hi: 0xb4},
+ // Block 0xa3, offset 0x3ca
+ {value: 0x0034, lo: 0xbd, hi: 0xbd},
+ // Block 0xa4, offset 0x3cb
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa5, offset 0x3cd
+ {value: 0x0010, lo: 0x80, hi: 0x90},
+ {value: 0x0034, lo: 0xa0, hi: 0xa0},
+ // Block 0xa6, offset 0x3cf
+ {value: 0x0010, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xa7, offset 0x3d1
+ {value: 0x0010, lo: 0x80, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0xb5},
+ {value: 0x0024, lo: 0xb6, hi: 0xba},
+ // Block 0xa8, offset 0x3d4
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xbf},
+ // Block 0xa9, offset 0x3d6
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x91, hi: 0x95},
+ // Block 0xaa, offset 0x3d9
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x97},
+ {value: 0xaf53, lo: 0x98, hi: 0x9f},
+ {value: 0xb253, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbf},
+ // Block 0xab, offset 0x3e1
+ {value: 0xaf52, lo: 0x80, hi: 0x87},
+ {value: 0xb252, lo: 0x88, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0xbf},
+ // Block 0xac, offset 0x3e4
+ {value: 0x0010, lo: 0x80, hi: 0x9d},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0xb253, lo: 0xb0, hi: 0xb7},
+ {value: 0xaf53, lo: 0xb8, hi: 0xbf},
+ // Block 0xad, offset 0x3e8
+ {value: 0x2813, lo: 0x80, hi: 0x87},
+ {value: 0x3813, lo: 0x88, hi: 0x8f},
+ {value: 0x2813, lo: 0x90, hi: 0x93},
+ {value: 0xb252, lo: 0x98, hi: 0x9f},
+ {value: 0xaf52, lo: 0xa0, hi: 0xa7},
+ {value: 0x2812, lo: 0xa8, hi: 0xaf},
+ {value: 0x3812, lo: 0xb0, hi: 0xb7},
+ {value: 0x2812, lo: 0xb8, hi: 0xbb},
+ // Block 0xae, offset 0x3f0
+ {value: 0x0010, lo: 0x80, hi: 0xa7},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xaf, offset 0x3f2
+ {value: 0x0010, lo: 0x80, hi: 0xa3},
+ // Block 0xb0, offset 0x3f3
+ {value: 0x0010, lo: 0x80, hi: 0xb6},
+ // Block 0xb1, offset 0x3f4
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xa7},
+ // Block 0xb2, offset 0x3f6
+ {value: 0x0010, lo: 0x80, hi: 0x85},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xb5},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0010, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xb3, offset 0x3fc
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb6},
+ // Block 0xb4, offset 0x3fe
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ // Block 0xb5, offset 0x3ff
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb5},
+ // Block 0xb6, offset 0x401
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb9},
+ // Block 0xb7, offset 0x403
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0010, lo: 0xbe, hi: 0xbf},
+ // Block 0xb8, offset 0x405
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x83},
+ {value: 0x0014, lo: 0x85, hi: 0x86},
+ {value: 0x0014, lo: 0x8c, hi: 0x8c},
+ {value: 0x0034, lo: 0x8d, hi: 0x8d},
+ {value: 0x0014, lo: 0x8e, hi: 0x8e},
+ {value: 0x0024, lo: 0x8f, hi: 0x8f},
+ {value: 0x0010, lo: 0x90, hi: 0x93},
+ {value: 0x0010, lo: 0x95, hi: 0x97},
+ {value: 0x0010, lo: 0x99, hi: 0xb3},
+ {value: 0x0024, lo: 0xb8, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xb9, offset 0x412
+ {value: 0x0010, lo: 0xa0, hi: 0xbc},
+ // Block 0xba, offset 0x413
+ {value: 0x0010, lo: 0x80, hi: 0x9c},
+ // Block 0xbb, offset 0x414
+ {value: 0x0010, lo: 0x80, hi: 0x87},
+ {value: 0x0010, lo: 0x89, hi: 0xa4},
+ {value: 0x0024, lo: 0xa5, hi: 0xa5},
+ {value: 0x0034, lo: 0xa6, hi: 0xa6},
+ // Block 0xbc, offset 0x418
+ {value: 0x0010, lo: 0x80, hi: 0x95},
+ {value: 0x0010, lo: 0xa0, hi: 0xb2},
+ // Block 0xbd, offset 0x41a
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ // Block 0xbe, offset 0x41b
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ // Block 0xbf, offset 0x41c
+ {value: 0x5653, lo: 0x80, hi: 0xb2},
+ // Block 0xc0, offset 0x41d
+ {value: 0x5652, lo: 0x80, hi: 0xb2},
+ // Block 0xc1, offset 0x41e
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xc2, offset 0x422
+ {value: 0x0014, lo: 0x80, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0xa6, hi: 0xaf},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xc3, offset 0x426
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb6},
+ {value: 0x0010, lo: 0xb7, hi: 0xb8},
+ {value: 0x0034, lo: 0xb9, hi: 0xba},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ // Block 0xc4, offset 0x42c
+ {value: 0x0010, lo: 0x90, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xc5, offset 0x42e
+ {value: 0x0024, lo: 0x80, hi: 0x82},
+ {value: 0x0010, lo: 0x83, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb4},
+ {value: 0x0010, lo: 0xb6, hi: 0xbf},
+ // Block 0xc6, offset 0x435
+ {value: 0x0010, lo: 0x90, hi: 0xb2},
+ {value: 0x0034, lo: 0xb3, hi: 0xb3},
+ {value: 0x0010, lo: 0xb6, hi: 0xb6},
+ // Block 0xc7, offset 0x438
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0xb5},
+ {value: 0x0014, lo: 0xb6, hi: 0xbe},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xc8, offset 0x43c
+ {value: 0x0030, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0014, lo: 0x8b, hi: 0x8c},
+ {value: 0x0010, lo: 0x90, hi: 0x9a},
+ {value: 0x0010, lo: 0x9c, hi: 0x9c},
+ // Block 0xc9, offset 0x442
+ {value: 0x0010, lo: 0x80, hi: 0x91},
+ {value: 0x0010, lo: 0x93, hi: 0xae},
+ {value: 0x0014, lo: 0xaf, hi: 0xb1},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0014, lo: 0xb4, hi: 0xb4},
+ {value: 0x0030, lo: 0xb5, hi: 0xb5},
+ {value: 0x0034, lo: 0xb6, hi: 0xb6},
+ {value: 0x0014, lo: 0xb7, hi: 0xb7},
+ {value: 0x0014, lo: 0xbe, hi: 0xbe},
+ // Block 0xca, offset 0x44b
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ {value: 0x0010, lo: 0x88, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0x8d},
+ {value: 0x0010, lo: 0x8f, hi: 0x9d},
+ {value: 0x0010, lo: 0x9f, hi: 0xa8},
+ {value: 0x0010, lo: 0xb0, hi: 0xbf},
+ // Block 0xcb, offset 0x451
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0014, lo: 0x9f, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa2},
+ {value: 0x0014, lo: 0xa3, hi: 0xa8},
+ {value: 0x0034, lo: 0xa9, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xcc, offset 0x457
+ {value: 0x0014, lo: 0x80, hi: 0x81},
+ {value: 0x0010, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x8c},
+ {value: 0x0010, lo: 0x8f, hi: 0x90},
+ {value: 0x0010, lo: 0x93, hi: 0xa8},
+ {value: 0x0010, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb5, hi: 0xb9},
+ {value: 0x0034, lo: 0xbc, hi: 0xbc},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xcd, offset 0x461
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x84},
+ {value: 0x0010, lo: 0x87, hi: 0x88},
+ {value: 0x0010, lo: 0x8b, hi: 0x8c},
+ {value: 0x0030, lo: 0x8d, hi: 0x8d},
+ {value: 0x0010, lo: 0x90, hi: 0x90},
+ {value: 0x0010, lo: 0x97, hi: 0x97},
+ {value: 0x0010, lo: 0x9d, hi: 0xa3},
+ {value: 0x0024, lo: 0xa6, hi: 0xac},
+ {value: 0x0024, lo: 0xb0, hi: 0xb4},
+ // Block 0xce, offset 0x46b
+ {value: 0x0010, lo: 0x80, hi: 0xb7},
+ {value: 0x0014, lo: 0xb8, hi: 0xbf},
+ // Block 0xcf, offset 0x46d
+ {value: 0x0010, lo: 0x80, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x82},
+ {value: 0x0014, lo: 0x83, hi: 0x84},
+ {value: 0x0010, lo: 0x85, hi: 0x85},
+ {value: 0x0034, lo: 0x86, hi: 0x86},
+ {value: 0x0010, lo: 0x87, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd0, offset 0x474
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xb8},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0014, lo: 0xba, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbe},
+ {value: 0x0014, lo: 0xbf, hi: 0xbf},
+ // Block 0xd1, offset 0x47a
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x81, hi: 0x81},
+ {value: 0x0034, lo: 0x82, hi: 0x83},
+ {value: 0x0010, lo: 0x84, hi: 0x85},
+ {value: 0x0010, lo: 0x87, hi: 0x87},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd2, offset 0x480
+ {value: 0x0010, lo: 0x80, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb5},
+ {value: 0x0010, lo: 0xb8, hi: 0xbb},
+ {value: 0x0014, lo: 0xbc, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd3, offset 0x486
+ {value: 0x0034, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x98, hi: 0x9b},
+ {value: 0x0014, lo: 0x9c, hi: 0x9d},
+ // Block 0xd4, offset 0x489
+ {value: 0x0010, lo: 0x80, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0010, lo: 0xbb, hi: 0xbc},
+ {value: 0x0014, lo: 0xbd, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xd5, offset 0x48f
+ {value: 0x0014, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x84, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0xd6, offset 0x492
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0014, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xac, hi: 0xac},
+ {value: 0x0014, lo: 0xad, hi: 0xad},
+ {value: 0x0010, lo: 0xae, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb5},
+ {value: 0x0030, lo: 0xb6, hi: 0xb6},
+ {value: 0x0034, lo: 0xb7, hi: 0xb7},
+ // Block 0xd7, offset 0x49a
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ // Block 0xd8, offset 0x49b
+ {value: 0x0014, lo: 0x9d, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa1},
+ {value: 0x0014, lo: 0xa2, hi: 0xa5},
+ {value: 0x0010, lo: 0xa6, hi: 0xa6},
+ {value: 0x0014, lo: 0xa7, hi: 0xaa},
+ {value: 0x0034, lo: 0xab, hi: 0xab},
+ {value: 0x0010, lo: 0xb0, hi: 0xb9},
+ // Block 0xd9, offset 0x4a2
+ {value: 0x5f53, lo: 0xa0, hi: 0xbf},
+ // Block 0xda, offset 0x4a3
+ {value: 0x5f52, lo: 0x80, hi: 0x9f},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ {value: 0x0010, lo: 0xbf, hi: 0xbf},
+ // Block 0xdb, offset 0x4a6
+ {value: 0x0010, lo: 0x80, hi: 0xb8},
+ // Block 0xdc, offset 0x4a7
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x8a, hi: 0xaf},
+ {value: 0x0014, lo: 0xb0, hi: 0xb6},
+ {value: 0x0014, lo: 0xb8, hi: 0xbd},
+ {value: 0x0010, lo: 0xbe, hi: 0xbe},
+ {value: 0x0034, lo: 0xbf, hi: 0xbf},
+ // Block 0xdd, offset 0x4ad
+ {value: 0x0010, lo: 0x80, hi: 0x80},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xb2, hi: 0xbf},
+ // Block 0xde, offset 0x4b0
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ {value: 0x0014, lo: 0x92, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xa9},
+ {value: 0x0014, lo: 0xaa, hi: 0xb0},
+ {value: 0x0010, lo: 0xb1, hi: 0xb1},
+ {value: 0x0014, lo: 0xb2, hi: 0xb3},
+ {value: 0x0010, lo: 0xb4, hi: 0xb4},
+ {value: 0x0014, lo: 0xb5, hi: 0xb6},
+ // Block 0xdf, offset 0x4b8
+ {value: 0x0010, lo: 0x80, hi: 0x99},
+ // Block 0xe0, offset 0x4b9
+ {value: 0x0010, lo: 0x80, hi: 0xae},
+ // Block 0xe1, offset 0x4ba
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ // Block 0xe2, offset 0x4bb
+ {value: 0x0010, lo: 0x80, hi: 0x86},
+ // Block 0xe3, offset 0x4bc
+ {value: 0x0010, lo: 0x80, hi: 0x9e},
+ {value: 0x0010, lo: 0xa0, hi: 0xa9},
+ // Block 0xe4, offset 0x4be
+ {value: 0x0010, lo: 0x90, hi: 0xad},
+ {value: 0x0034, lo: 0xb0, hi: 0xb4},
+ // Block 0xe5, offset 0x4c0
+ {value: 0x0010, lo: 0x80, hi: 0xaf},
+ {value: 0x0024, lo: 0xb0, hi: 0xb6},
+ // Block 0xe6, offset 0x4c2
+ {value: 0x0014, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0010, lo: 0xa3, hi: 0xb7},
+ {value: 0x0010, lo: 0xbd, hi: 0xbf},
+ // Block 0xe7, offset 0x4c6
+ {value: 0x0010, lo: 0x80, hi: 0x8f},
+ // Block 0xe8, offset 0x4c7
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0010, lo: 0x90, hi: 0xbe},
+ // Block 0xe9, offset 0x4c9
+ {value: 0x0014, lo: 0x8f, hi: 0x9f},
+ // Block 0xea, offset 0x4ca
+ {value: 0x0014, lo: 0xa0, hi: 0xa0},
+ // Block 0xeb, offset 0x4cb
+ {value: 0x0010, lo: 0x80, hi: 0xaa},
+ {value: 0x0010, lo: 0xb0, hi: 0xbc},
+ // Block 0xec, offset 0x4cd
+ {value: 0x0010, lo: 0x80, hi: 0x88},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ {value: 0x0014, lo: 0x9d, hi: 0x9d},
+ {value: 0x0034, lo: 0x9e, hi: 0x9e},
+ {value: 0x0014, lo: 0xa0, hi: 0xa3},
+ // Block 0xed, offset 0x4d2
+ {value: 0x0030, lo: 0xa5, hi: 0xa6},
+ {value: 0x0034, lo: 0xa7, hi: 0xa9},
+ {value: 0x0030, lo: 0xad, hi: 0xb2},
+ {value: 0x0014, lo: 0xb3, hi: 0xba},
+ {value: 0x0034, lo: 0xbb, hi: 0xbf},
+ // Block 0xee, offset 0x4d7
+ {value: 0x0034, lo: 0x80, hi: 0x82},
+ {value: 0x0024, lo: 0x85, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8b},
+ {value: 0x0024, lo: 0xaa, hi: 0xad},
+ // Block 0xef, offset 0x4db
+ {value: 0x0024, lo: 0x82, hi: 0x84},
+ // Block 0xf0, offset 0x4dc
+ {value: 0x0013, lo: 0x80, hi: 0x99},
+ {value: 0x0012, lo: 0x9a, hi: 0xb3},
+ {value: 0x0013, lo: 0xb4, hi: 0xbf},
+ // Block 0xf1, offset 0x4df
+ {value: 0x0013, lo: 0x80, hi: 0x8d},
+ {value: 0x0012, lo: 0x8e, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0xa7},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0xf2, offset 0x4e3
+ {value: 0x0013, lo: 0x80, hi: 0x81},
+ {value: 0x0012, lo: 0x82, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0x9c},
+ {value: 0x0013, lo: 0x9e, hi: 0x9f},
+ {value: 0x0013, lo: 0xa2, hi: 0xa2},
+ {value: 0x0013, lo: 0xa5, hi: 0xa6},
+ {value: 0x0013, lo: 0xa9, hi: 0xac},
+ {value: 0x0013, lo: 0xae, hi: 0xb5},
+ {value: 0x0012, lo: 0xb6, hi: 0xb9},
+ {value: 0x0012, lo: 0xbb, hi: 0xbb},
+ {value: 0x0012, lo: 0xbd, hi: 0xbf},
+ // Block 0xf3, offset 0x4ee
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0012, lo: 0x85, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0xf4, offset 0x4f2
+ {value: 0x0012, lo: 0x80, hi: 0x83},
+ {value: 0x0013, lo: 0x84, hi: 0x85},
+ {value: 0x0013, lo: 0x87, hi: 0x8a},
+ {value: 0x0013, lo: 0x8d, hi: 0x94},
+ {value: 0x0013, lo: 0x96, hi: 0x9c},
+ {value: 0x0012, lo: 0x9e, hi: 0xb7},
+ {value: 0x0013, lo: 0xb8, hi: 0xb9},
+ {value: 0x0013, lo: 0xbb, hi: 0xbe},
+ // Block 0xf5, offset 0x4fa
+ {value: 0x0013, lo: 0x80, hi: 0x84},
+ {value: 0x0013, lo: 0x86, hi: 0x86},
+ {value: 0x0013, lo: 0x8a, hi: 0x90},
+ {value: 0x0012, lo: 0x92, hi: 0xab},
+ {value: 0x0013, lo: 0xac, hi: 0xbf},
+ // Block 0xf6, offset 0x4ff
+ {value: 0x0013, lo: 0x80, hi: 0x85},
+ {value: 0x0012, lo: 0x86, hi: 0x9f},
+ {value: 0x0013, lo: 0xa0, hi: 0xb9},
+ {value: 0x0012, lo: 0xba, hi: 0xbf},
+ // Block 0xf7, offset 0x503
+ {value: 0x0012, lo: 0x80, hi: 0x93},
+ {value: 0x0013, lo: 0x94, hi: 0xad},
+ {value: 0x0012, lo: 0xae, hi: 0xbf},
+ // Block 0xf8, offset 0x506
+ {value: 0x0012, lo: 0x80, hi: 0x87},
+ {value: 0x0013, lo: 0x88, hi: 0xa1},
+ {value: 0x0012, lo: 0xa2, hi: 0xbb},
+ {value: 0x0013, lo: 0xbc, hi: 0xbf},
+ // Block 0xf9, offset 0x50a
+ {value: 0x0013, lo: 0x80, hi: 0x95},
+ {value: 0x0012, lo: 0x96, hi: 0xaf},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0xfa, offset 0x50d
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0012, lo: 0x8a, hi: 0xa5},
+ {value: 0x0013, lo: 0xa8, hi: 0xbf},
+ // Block 0xfb, offset 0x510
+ {value: 0x0013, lo: 0x80, hi: 0x80},
+ {value: 0x0012, lo: 0x82, hi: 0x9a},
+ {value: 0x0012, lo: 0x9c, hi: 0xa1},
+ {value: 0x0013, lo: 0xa2, hi: 0xba},
+ {value: 0x0012, lo: 0xbc, hi: 0xbf},
+ // Block 0xfc, offset 0x515
+ {value: 0x0012, lo: 0x80, hi: 0x94},
+ {value: 0x0012, lo: 0x96, hi: 0x9b},
+ {value: 0x0013, lo: 0x9c, hi: 0xb4},
+ {value: 0x0012, lo: 0xb6, hi: 0xbf},
+ // Block 0xfd, offset 0x519
+ {value: 0x0012, lo: 0x80, hi: 0x8e},
+ {value: 0x0012, lo: 0x90, hi: 0x95},
+ {value: 0x0013, lo: 0x96, hi: 0xae},
+ {value: 0x0012, lo: 0xb0, hi: 0xbf},
+ // Block 0xfe, offset 0x51d
+ {value: 0x0012, lo: 0x80, hi: 0x88},
+ {value: 0x0012, lo: 0x8a, hi: 0x8f},
+ {value: 0x0013, lo: 0x90, hi: 0xa8},
+ {value: 0x0012, lo: 0xaa, hi: 0xbf},
+ // Block 0xff, offset 0x521
+ {value: 0x0012, lo: 0x80, hi: 0x82},
+ {value: 0x0012, lo: 0x84, hi: 0x89},
+ {value: 0x0017, lo: 0x8a, hi: 0x8b},
+ {value: 0x0010, lo: 0x8e, hi: 0xbf},
+ // Block 0x100, offset 0x525
+ {value: 0x0014, lo: 0x80, hi: 0xb6},
+ {value: 0x0014, lo: 0xbb, hi: 0xbf},
+ // Block 0x101, offset 0x527
+ {value: 0x0014, lo: 0x80, hi: 0xac},
+ {value: 0x0014, lo: 0xb5, hi: 0xb5},
+ // Block 0x102, offset 0x529
+ {value: 0x0014, lo: 0x84, hi: 0x84},
+ {value: 0x0014, lo: 0x9b, hi: 0x9f},
+ {value: 0x0014, lo: 0xa1, hi: 0xaf},
+ // Block 0x103, offset 0x52c
+ {value: 0x0024, lo: 0x80, hi: 0x86},
+ {value: 0x0024, lo: 0x88, hi: 0x98},
+ {value: 0x0024, lo: 0x9b, hi: 0xa1},
+ {value: 0x0024, lo: 0xa3, hi: 0xa4},
+ {value: 0x0024, lo: 0xa6, hi: 0xaa},
+ // Block 0x104, offset 0x531
+ {value: 0x0010, lo: 0x80, hi: 0x84},
+ {value: 0x0034, lo: 0x90, hi: 0x96},
+ // Block 0x105, offset 0x533
+ {value: 0xb552, lo: 0x80, hi: 0x81},
+ {value: 0xb852, lo: 0x82, hi: 0x83},
+ {value: 0x0024, lo: 0x84, hi: 0x89},
+ {value: 0x0034, lo: 0x8a, hi: 0x8a},
+ {value: 0x0010, lo: 0x90, hi: 0x99},
+ // Block 0x106, offset 0x538
+ {value: 0x0010, lo: 0x80, hi: 0x83},
+ {value: 0x0010, lo: 0x85, hi: 0x9f},
+ {value: 0x0010, lo: 0xa1, hi: 0xa2},
+ {value: 0x0010, lo: 0xa4, hi: 0xa4},
+ {value: 0x0010, lo: 0xa7, hi: 0xa7},
+ {value: 0x0010, lo: 0xa9, hi: 0xb2},
+ {value: 0x0010, lo: 0xb4, hi: 0xb7},
+ {value: 0x0010, lo: 0xb9, hi: 0xb9},
+ {value: 0x0010, lo: 0xbb, hi: 0xbb},
+ // Block 0x107, offset 0x541
+ {value: 0x0010, lo: 0x80, hi: 0x89},
+ {value: 0x0010, lo: 0x8b, hi: 0x9b},
+ {value: 0x0010, lo: 0xa1, hi: 0xa3},
+ {value: 0x0010, lo: 0xa5, hi: 0xa9},
+ {value: 0x0010, lo: 0xab, hi: 0xbb},
+ // Block 0x108, offset 0x546
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x109, offset 0x547
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ {value: 0x0013, lo: 0x90, hi: 0xa9},
+ {value: 0x0013, lo: 0xb0, hi: 0xbf},
+ // Block 0x10a, offset 0x54a
+ {value: 0x0013, lo: 0x80, hi: 0x89},
+ // Block 0x10b, offset 0x54b
+ {value: 0x0004, lo: 0xbb, hi: 0xbf},
+ // Block 0x10c, offset 0x54c
+ {value: 0x0014, lo: 0x81, hi: 0x81},
+ {value: 0x0014, lo: 0xa0, hi: 0xbf},
+ // Block 0x10d, offset 0x54e
+ {value: 0x0014, lo: 0x80, hi: 0xbf},
+ // Block 0x10e, offset 0x54f
+ {value: 0x0014, lo: 0x80, hi: 0xaf},
+}
+
+// Total table size 14027 bytes (13KiB); checksum: F17D40E8
diff --git a/vendor/golang.org/x/text/cases/trieval.go b/vendor/golang.org/x/text/cases/trieval.go
new file mode 100644
index 00000000000..4e4d13fe5d1
--- /dev/null
+++ b/vendor/golang.org/x/text/cases/trieval.go
@@ -0,0 +1,217 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package cases
+
+// This file contains definitions for interpreting the trie value of the case
+// trie generated by "go run gen*.go". It is shared by both the generator
+// program and the resultant package. Sharing is achieved by the generator
+// copying gen_trieval.go to trieval.go and changing what's above this comment.
+
+// info holds case information for a single rune. It is the value returned
+// by a trie lookup. Most mapping information can be stored in a single 16-bit
+// value. If not, for example when a rune is mapped to multiple runes, the value
+// stores some basic case data and an index into an array with additional data.
+//
+// The per-rune values have the following format:
+//
+// if (exception) {
+// 15..4 unsigned exception index
+// } else {
+// 15..8 XOR pattern or index to XOR pattern for case mapping
+// Only 13..8 are used for XOR patterns.
+// 7 inverseFold (fold to upper, not to lower)
+// 6 index: interpret the XOR pattern as an index
+// or isMid if case mode is cIgnorableUncased.
+// 5..4 CCC: zero (normal or break), above or other
+// }
+// 3 exception: interpret this value as an exception index
+// (TODO: is this bit necessary? Probably implied from case mode.)
+// 2..0 case mode
+//
+// For the non-exceptional cases, a rune must be either uncased, lowercase or
+// uppercase. If the rune is cased, the XOR pattern maps either a lowercase
+// rune to uppercase or an uppercase rune to lowercase (applied to the 10
+// least-significant bits of the rune).
+//
+// See the definitions below for a more detailed description of the various
+// bits.
+type info uint16
+
+const (
+ casedMask = 0x0003
+ fullCasedMask = 0x0007
+ ignorableMask = 0x0006
+ ignorableValue = 0x0004
+
+ inverseFoldBit = 1 << 7
+ isMidBit = 1 << 6
+
+ exceptionBit = 1 << 3
+ exceptionShift = 4
+ numExceptionBits = 12
+
+ xorIndexBit = 1 << 6
+ xorShift = 8
+
+ // There is no mapping if all xor bits and the exception bit are zero.
+ hasMappingMask = 0xff80 | exceptionBit
+)
+
+// The case mode bits encodes the case type of a rune. This includes uncased,
+// title, upper and lower case and case ignorable. (For a definition of these
+// terms see Chapter 3 of The Unicode Standard Core Specification.) In some rare
+// cases, a rune can be both cased and case-ignorable. This is encoded by
+// cIgnorableCased. A rune of this type is always lower case. Some runes are
+// cased while not having a mapping.
+//
+// A common pattern for scripts in the Unicode standard is for upper and lower
+// case runes to alternate for increasing rune values (e.g. the accented Latin
+// ranges starting from U+0100 and U+1E00 among others and some Cyrillic
+// characters). We use this property by defining a cXORCase mode, where the case
+// mode (always upper or lower case) is derived from the rune value. As the XOR
+// pattern for case mappings is often identical for successive runes, using
+// cXORCase can result in large series of identical trie values. This, in turn,
+// allows us to better compress the trie blocks.
+const (
+ cUncased info = iota // 000
+ cTitle // 001
+ cLower // 010
+ cUpper // 011
+ cIgnorableUncased // 100
+ cIgnorableCased // 101 // lower case if mappings exist
+ cXORCase // 11x // case is cLower | ((rune&1) ^ x)
+
+ maxCaseMode = cUpper
+)
+
+func (c info) isCased() bool {
+ return c&casedMask != 0
+}
+
+func (c info) isCaseIgnorable() bool {
+ return c&ignorableMask == ignorableValue
+}
+
+func (c info) isNotCasedAndNotCaseIgnorable() bool {
+ return c&fullCasedMask == 0
+}
+
+func (c info) isCaseIgnorableAndNotCased() bool {
+ return c&fullCasedMask == cIgnorableUncased
+}
+
+func (c info) isMid() bool {
+ return c&(fullCasedMask|isMidBit) == isMidBit|cIgnorableUncased
+}
+
+// The case mapping implementation will need to know about various Canonical
+// Combining Class (CCC) values. We encode two of these in the trie value:
+// cccZero (0) and cccAbove (230). If the value is cccOther, it means that
+// CCC(r) > 0, but not 230. A value of cccBreak means that CCC(r) == 0 and that
+// the rune also has the break category Break (see below).
+const (
+ cccBreak info = iota << 4
+ cccZero
+ cccAbove
+ cccOther
+
+ cccMask = cccBreak | cccZero | cccAbove | cccOther
+)
+
+const (
+ starter = 0
+ above = 230
+ iotaSubscript = 240
+)
+
+// The exceptions slice holds data that does not fit in a normal info entry.
+// The entry is pointed to by the exception index in an entry. It has the
+// following format:
+//
+// Header:
+//
+// byte 0:
+// 7..6 unused
+// 5..4 CCC type (same bits as entry)
+// 3 unused
+// 2..0 length of fold
+//
+// byte 1:
+// 7..6 unused
+// 5..3 length of 1st mapping of case type
+// 2..0 length of 2nd mapping of case type
+//
+// case 1st 2nd
+// lower -> upper, title
+// upper -> lower, title
+// title -> lower, upper
+//
+// Lengths with the value 0x7 indicate no value and implies no change.
+// A length of 0 indicates a mapping to zero-length string.
+//
+// Body bytes:
+//
+// case folding bytes
+// lowercase mapping bytes
+// uppercase mapping bytes
+// titlecase mapping bytes
+// closure mapping bytes (for NFKC_Casefold). (TODO)
+//
+// Fallbacks:
+//
+// missing fold -> lower
+// missing title -> upper
+// all missing -> original rune
+//
+// exceptions starts with a dummy byte to enforce that there is no zero index
+// value.
+const (
+ lengthMask = 0x07
+ lengthBits = 3
+ noChange = 0
+)
+
+// References to generated trie.
+
+var trie = newCaseTrie(0)
+
+var sparse = sparseBlocks{
+ values: sparseValues[:],
+ offsets: sparseOffsets[:],
+}
+
+// Sparse block lookup code.
+
+// valueRange is an entry in a sparse block.
+type valueRange struct {
+ value uint16
+ lo, hi byte
+}
+
+type sparseBlocks struct {
+ values []valueRange
+ offsets []uint16
+}
+
+// lookup returns the value from values block n for byte b using binary search.
+func (s *sparseBlocks) lookup(n uint32, b byte) uint16 {
+ lo := s.offsets[n]
+ hi := s.offsets[n+1]
+ for lo < hi {
+ m := lo + (hi-lo)/2
+ r := s.values[m]
+ if r.lo <= b && b <= r.hi {
+ return r.value
+ }
+ if b < r.lo {
+ hi = m
+ } else {
+ lo = m + 1
+ }
+ }
+ return 0
+}
+
+// lastRuneForTesting is the last rune used for testing. Everything after this
+// is boring.
+const lastRuneForTesting = rune(0x1FFFF)
diff --git a/vendor/google.golang.org/grpc/README.md b/vendor/google.golang.org/grpc/README.md
index ab0fbb79b86..b572707c623 100644
--- a/vendor/google.golang.org/grpc/README.md
+++ b/vendor/google.golang.org/grpc/README.md
@@ -10,7 +10,7 @@ RPC framework that puts mobile and HTTP/2 first. For more information see the
## Prerequisites
-- **[Go][]**: any one of the **three latest major** [releases][go-releases].
+- **[Go][]**: any one of the **two latest major** [releases][go-releases].
## Installation
diff --git a/vendor/google.golang.org/grpc/pickfirst.go b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go
similarity index 89%
rename from vendor/google.golang.org/grpc/pickfirst.go
rename to vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go
index 8853626614e..07527603f1d 100644
--- a/vendor/google.golang.org/grpc/pickfirst.go
+++ b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go
@@ -16,26 +16,36 @@
*
*/
-package grpc
+// Package pickfirst contains the pick_first load balancing policy.
+package pickfirst
import (
"encoding/json"
"errors"
"fmt"
+ "math/rand"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/connectivity"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/internal"
internalgrpclog "google.golang.org/grpc/internal/grpclog"
- "google.golang.org/grpc/internal/grpcrand"
"google.golang.org/grpc/internal/pretty"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/serviceconfig"
)
+func init() {
+ balancer.Register(pickfirstBuilder{})
+ internal.ShuffleAddressListForTesting = func(n int, swap func(i, j int)) { rand.Shuffle(n, swap) }
+}
+
+var logger = grpclog.Component("pick-first-lb")
+
const (
- // PickFirstBalancerName is the name of the pick_first balancer.
- PickFirstBalancerName = "pick_first"
- logPrefix = "[pick-first-lb %p] "
+ // Name is the name of the pick_first balancer.
+ Name = "pick_first"
+ logPrefix = "[pick-first-lb %p] "
)
type pickfirstBuilder struct{}
@@ -47,7 +57,7 @@ func (pickfirstBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions)
}
func (pickfirstBuilder) Name() string {
- return PickFirstBalancerName
+ return Name
}
type pfConfig struct {
@@ -93,6 +103,12 @@ func (b *pickfirstBalancer) ResolverError(err error) {
})
}
+type Shuffler interface {
+ ShuffleAddressListForTesting(n int, swap func(i, j int))
+}
+
+func ShuffleAddressListForTesting(n int, swap func(i, j int)) { rand.Shuffle(n, swap) }
+
func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState) error {
if len(state.ResolverState.Addresses) == 0 && len(state.ResolverState.Endpoints) == 0 {
// The resolver reported an empty address list. Treat it like an error by
@@ -124,7 +140,7 @@ func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState
// within each endpoint. - A61
if cfg.ShuffleAddressList {
endpoints = append([]resolver.Endpoint{}, endpoints...)
- grpcrand.Shuffle(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] })
+ internal.ShuffleAddressListForTesting.(func(int, func(int, int)))(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] })
}
// "Flatten the list by concatenating the ordered list of addresses for each
@@ -145,7 +161,7 @@ func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState
addrs = state.ResolverState.Addresses
if cfg.ShuffleAddressList {
addrs = append([]resolver.Address{}, addrs...)
- grpcrand.Shuffle(len(addrs), func(i, j int) { addrs[i], addrs[j] = addrs[j], addrs[i] })
+ rand.Shuffle(len(addrs), func(i, j int) { addrs[i], addrs[j] = addrs[j], addrs[i] })
}
}
diff --git a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go
index f7031ad2251..260255d31b6 100644
--- a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go
+++ b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go
@@ -22,12 +22,12 @@
package roundrobin
import (
+ "math/rand"
"sync/atomic"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/base"
"google.golang.org/grpc/grpclog"
- "google.golang.org/grpc/internal/grpcrand"
)
// Name is the name of round_robin balancer.
@@ -60,7 +60,7 @@ func (*rrPickerBuilder) Build(info base.PickerBuildInfo) balancer.Picker {
// Start at a random index, as the same RR balancer rebuilds a new
// picker when SubConn states change, and we don't want to apply excess
// load to the first server in the list.
- next: uint32(grpcrand.Intn(len(scs))),
+ next: uint32(rand.Intn(len(scs))),
}
}
diff --git a/vendor/google.golang.org/grpc/balancer_wrapper.go b/vendor/google.golang.org/grpc/balancer_wrapper.go
index af39b8a4c73..4161fdf47a8 100644
--- a/vendor/google.golang.org/grpc/balancer_wrapper.go
+++ b/vendor/google.golang.org/grpc/balancer_wrapper.go
@@ -198,6 +198,10 @@ func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resol
func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) {
ccb.cc.mu.Lock()
defer ccb.cc.mu.Unlock()
+ if ccb.cc.conns == nil {
+ // The CC has been closed; ignore this update.
+ return
+ }
ccb.mu.Lock()
if ccb.closed {
diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go
index 1afb1e84ac0..63c639e4fe9 100644
--- a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go
+++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go
@@ -18,7 +18,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.33.0
+// protoc-gen-go v1.34.1
// protoc v4.25.2
// source: grpc/binlog/v1/binarylog.proto
diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go
index 2359f94b8a4..423be7b43b0 100644
--- a/vendor/google.golang.org/grpc/clientconn.go
+++ b/vendor/google.golang.org/grpc/clientconn.go
@@ -31,6 +31,7 @@ import (
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/base"
+ "google.golang.org/grpc/balancer/pickfirst"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/internal"
@@ -72,6 +73,8 @@ var (
// invalidDefaultServiceConfigErrPrefix is used to prefix the json parsing error for the default
// service config.
invalidDefaultServiceConfigErrPrefix = "grpc: the provided default service config is invalid"
+ // PickFirstBalancerName is the name of the pick_first balancer.
+ PickFirstBalancerName = pickfirst.Name
)
// The following errors are returned from Dial and DialContext
@@ -152,6 +155,16 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error)
for _, opt := range opts {
opt.apply(&cc.dopts)
}
+
+ // Determine the resolver to use.
+ if err := cc.initParsedTargetAndResolverBuilder(); err != nil {
+ return nil, err
+ }
+
+ for _, opt := range globalPerTargetDialOptions {
+ opt.DialOptionForTarget(cc.parsedTarget.URL).apply(&cc.dopts)
+ }
+
chainUnaryClientInterceptors(cc)
chainStreamClientInterceptors(cc)
@@ -160,7 +173,7 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error)
}
if cc.dopts.defaultServiceConfigRawJSON != nil {
- scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON)
+ scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON, cc.dopts.maxCallAttempts)
if scpr.Err != nil {
return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, scpr.Err)
}
@@ -168,25 +181,16 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error)
}
cc.mkp = cc.dopts.copts.KeepaliveParams
- // Register ClientConn with channelz.
- cc.channelzRegistration(target)
-
- // TODO: Ideally it should be impossible to error from this function after
- // channelz registration. This will require removing some channelz logs
- // from the following functions that can error. Errors can be returned to
- // the user, and successful logs can be emitted here, after the checks have
- // passed and channelz is subsequently registered.
-
- // Determine the resolver to use.
- if err := cc.parseTargetAndFindResolver(); err != nil {
- channelz.RemoveEntry(cc.channelz.ID)
- return nil, err
- }
- if err = cc.determineAuthority(); err != nil {
- channelz.RemoveEntry(cc.channelz.ID)
+ if err = cc.initAuthority(); err != nil {
return nil, err
}
+ // Register ClientConn with channelz. Note that this is only done after
+ // channel creation cannot fail.
+ cc.channelzRegistration(target)
+ channelz.Infof(logger, cc.channelz, "parsed dial target is: %#v", cc.parsedTarget)
+ channelz.Infof(logger, cc.channelz, "Channel authority set to %q", cc.authority)
+
cc.csMgr = newConnectivityStateManager(cc.ctx, cc.channelz)
cc.pickerWrapper = newPickerWrapper(cc.dopts.copts.StatsHandlers)
@@ -587,11 +591,11 @@ type ClientConn struct {
// The following are initialized at dial time, and are read-only after that.
target string // User's dial target.
- parsedTarget resolver.Target // See parseTargetAndFindResolver().
- authority string // See determineAuthority().
+ parsedTarget resolver.Target // See initParsedTargetAndResolverBuilder().
+ authority string // See initAuthority().
dopts dialOptions // Default and user specified dial options.
channelz *channelz.Channel // Channelz object.
- resolverBuilder resolver.Builder // See parseTargetAndFindResolver().
+ resolverBuilder resolver.Builder // See initParsedTargetAndResolverBuilder().
idlenessMgr *idle.Manager
// The following provide their own synchronization, and therefore don't
@@ -692,8 +696,7 @@ func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error {
var emptyServiceConfig *ServiceConfig
func init() {
- balancer.Register(pickfirstBuilder{})
- cfg := parseServiceConfig("{}")
+ cfg := parseServiceConfig("{}", defaultMaxCallAttempts)
if cfg.Err != nil {
panic(fmt.Sprintf("impossible error parsing empty service config: %v", cfg.Err))
}
@@ -1673,22 +1676,19 @@ func (cc *ClientConn) connectionError() error {
return cc.lastConnectionError
}
-// parseTargetAndFindResolver parses the user's dial target and stores the
-// parsed target in `cc.parsedTarget`.
+// initParsedTargetAndResolverBuilder parses the user's dial target and stores
+// the parsed target in `cc.parsedTarget`.
//
// The resolver to use is determined based on the scheme in the parsed target
// and the same is stored in `cc.resolverBuilder`.
//
// Doesn't grab cc.mu as this method is expected to be called only at Dial time.
-func (cc *ClientConn) parseTargetAndFindResolver() error {
- channelz.Infof(logger, cc.channelz, "original dial target is: %q", cc.target)
+func (cc *ClientConn) initParsedTargetAndResolverBuilder() error {
+ logger.Infof("original dial target is: %q", cc.target)
var rb resolver.Builder
parsedTarget, err := parseTarget(cc.target)
- if err != nil {
- channelz.Infof(logger, cc.channelz, "dial target %q parse failed: %v", cc.target, err)
- } else {
- channelz.Infof(logger, cc.channelz, "parsed dial target is: %#v", parsedTarget)
+ if err == nil {
rb = cc.getResolver(parsedTarget.URL.Scheme)
if rb != nil {
cc.parsedTarget = parsedTarget
@@ -1707,15 +1707,12 @@ func (cc *ClientConn) parseTargetAndFindResolver() error {
defScheme = resolver.GetDefaultScheme()
}
- channelz.Infof(logger, cc.channelz, "fallback to scheme %q", defScheme)
canonicalTarget := defScheme + ":///" + cc.target
parsedTarget, err = parseTarget(canonicalTarget)
if err != nil {
- channelz.Infof(logger, cc.channelz, "dial target %q parse failed: %v", canonicalTarget, err)
return err
}
- channelz.Infof(logger, cc.channelz, "parsed dial target is: %+v", parsedTarget)
rb = cc.getResolver(parsedTarget.URL.Scheme)
if rb == nil {
return fmt.Errorf("could not get resolver for default scheme: %q", parsedTarget.URL.Scheme)
@@ -1805,7 +1802,7 @@ func encodeAuthority(authority string) string {
// credentials do not match the authority configured through the dial option.
//
// Doesn't grab cc.mu as this method is expected to be called only at Dial time.
-func (cc *ClientConn) determineAuthority() error {
+func (cc *ClientConn) initAuthority() error {
dopts := cc.dopts
// Historically, we had two options for users to specify the serverName or
// authority for a channel. One was through the transport credentials
@@ -1838,6 +1835,5 @@ func (cc *ClientConn) determineAuthority() error {
} else {
cc.authority = encodeAuthority(endpoint)
}
- channelz.Infof(logger, cc.channelz, "Channel authority set to %q", cc.authority)
return nil
}
diff --git a/vendor/google.golang.org/grpc/credentials/tls.go b/vendor/google.golang.org/grpc/credentials/tls.go
index 5dafd34edf9..4114358545e 100644
--- a/vendor/google.golang.org/grpc/credentials/tls.go
+++ b/vendor/google.golang.org/grpc/credentials/tls.go
@@ -27,9 +27,13 @@ import (
"net/url"
"os"
+ "google.golang.org/grpc/grpclog"
credinternal "google.golang.org/grpc/internal/credentials"
+ "google.golang.org/grpc/internal/envconfig"
)
+var logger = grpclog.Component("credentials")
+
// TLSInfo contains the auth information for a TLS authenticated connection.
// It implements the AuthInfo interface.
type TLSInfo struct {
@@ -112,6 +116,22 @@ func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawCon
conn.Close()
return nil, nil, ctx.Err()
}
+
+ // The negotiated protocol can be either of the following:
+ // 1. h2: When the server supports ALPN. Only HTTP/2 can be negotiated since
+ // it is the only protocol advertised by the client during the handshake.
+ // The tls library ensures that the server chooses a protocol advertised
+ // by the client.
+ // 2. "" (empty string): If the server doesn't support ALPN. ALPN is a requirement
+ // for using HTTP/2 over TLS. We can terminate the connection immediately.
+ np := conn.ConnectionState().NegotiatedProtocol
+ if np == "" {
+ if envconfig.EnforceALPNEnabled {
+ conn.Close()
+ return nil, nil, fmt.Errorf("credentials: cannot check peer: missing selected ALPN property")
+ }
+ logger.Warningf("Allowing TLS connection to server %q with ALPN disabled. TLS connections to servers with ALPN disabled will be disallowed in future grpc-go releases", cfg.ServerName)
+ }
tlsInfo := TLSInfo{
State: conn.ConnectionState(),
CommonAuthInfo: CommonAuthInfo{
@@ -131,8 +151,20 @@ func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error)
conn.Close()
return nil, nil, err
}
+ cs := conn.ConnectionState()
+ // The negotiated application protocol can be empty only if the client doesn't
+ // support ALPN. In such cases, we can close the connection since ALPN is required
+ // for using HTTP/2 over TLS.
+ if cs.NegotiatedProtocol == "" {
+ if envconfig.EnforceALPNEnabled {
+ conn.Close()
+ return nil, nil, fmt.Errorf("credentials: cannot check peer: missing selected ALPN property")
+ } else if logger.V(2) {
+ logger.Info("Allowing TLS connection from client with ALPN disabled. TLS connections with ALPN disabled will be disallowed in future grpc-go releases")
+ }
+ }
tlsInfo := TLSInfo{
- State: conn.ConnectionState(),
+ State: cs,
CommonAuthInfo: CommonAuthInfo{
SecurityLevel: PrivacyAndIntegrity,
},
diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go
index 00273702b69..f5453d48a53 100644
--- a/vendor/google.golang.org/grpc/dialoptions.go
+++ b/vendor/google.golang.org/grpc/dialoptions.go
@@ -21,6 +21,7 @@ package grpc
import (
"context"
"net"
+ "net/url"
"time"
"google.golang.org/grpc/backoff"
@@ -36,6 +37,11 @@ import (
"google.golang.org/grpc/stats"
)
+const (
+ // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#limits-on-retries-and-hedges
+ defaultMaxCallAttempts = 5
+)
+
func init() {
internal.AddGlobalDialOptions = func(opt ...DialOption) {
globalDialOptions = append(globalDialOptions, opt...)
@@ -43,6 +49,14 @@ func init() {
internal.ClearGlobalDialOptions = func() {
globalDialOptions = nil
}
+ internal.AddGlobalPerTargetDialOptions = func(opt any) {
+ if ptdo, ok := opt.(perTargetDialOption); ok {
+ globalPerTargetDialOptions = append(globalPerTargetDialOptions, ptdo)
+ }
+ }
+ internal.ClearGlobalPerTargetDialOptions = func() {
+ globalPerTargetDialOptions = nil
+ }
internal.WithBinaryLogger = withBinaryLogger
internal.JoinDialOptions = newJoinDialOption
internal.DisableGlobalDialOptions = newDisableGlobalDialOptions
@@ -80,6 +94,7 @@ type dialOptions struct {
idleTimeout time.Duration
recvBufferPool SharedBufferPool
defaultScheme string
+ maxCallAttempts int
}
// DialOption configures how we set up the connection.
@@ -89,6 +104,19 @@ type DialOption interface {
var globalDialOptions []DialOption
+// perTargetDialOption takes a parsed target and returns a dial option to apply.
+//
+// This gets called after NewClient() parses the target, and allows per target
+// configuration set through a returned DialOption. The DialOption will not take
+// effect if specifies a resolver builder, as that Dial Option is factored in
+// while parsing target.
+type perTargetDialOption interface {
+ // DialOption returns a Dial Option to apply.
+ DialOptionForTarget(parsedTarget url.URL) DialOption
+}
+
+var globalPerTargetDialOptions []perTargetDialOption
+
// EmptyDialOption does not alter the dial configuration. It can be embedded in
// another structure to build custom dial options.
//
@@ -655,6 +683,7 @@ func defaultDialOptions() dialOptions {
idleTimeout: 30 * time.Minute,
recvBufferPool: nopBufferPool{},
defaultScheme: "dns",
+ maxCallAttempts: defaultMaxCallAttempts,
}
}
@@ -712,6 +741,23 @@ func WithIdleTimeout(d time.Duration) DialOption {
})
}
+// WithMaxCallAttempts returns a DialOption that configures the maximum number
+// of attempts per call (including retries and hedging) using the channel.
+// Service owners may specify a higher value for these parameters, but higher
+// values will be treated as equal to the maximum value by the client
+// implementation. This mitigates security concerns related to the service
+// config being transferred to the client via DNS.
+//
+// A value of 5 will be used if this dial option is not set or n < 2.
+func WithMaxCallAttempts(n int) DialOption {
+ return newFuncDialOption(func(o *dialOptions) {
+ if n < 2 {
+ n = defaultMaxCallAttempts
+ }
+ o.maxCallAttempts = n
+ })
+}
+
// WithRecvBufferPool returns a DialOption that configures the ClientConn
// to use the provided shared buffer pool for parsing incoming messages. Depending
// on the application's workload, this could result in reduced memory allocation.
diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go
index 6a93475a7fb..38b88350735 100644
--- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go
+++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go
@@ -17,7 +17,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.33.0
+// protoc-gen-go v1.34.1
// protoc v4.25.2
// source: grpc/health/v1/health.proto
diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go
index 8f793e6e89f..51b736ba06e 100644
--- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go
+++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go
@@ -17,7 +17,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
-// - protoc-gen-go-grpc v1.3.0
+// - protoc-gen-go-grpc v1.4.0
// - protoc v4.25.2
// source: grpc/health/v1/health.proto
@@ -43,6 +43,10 @@ const (
// HealthClient is the client API for Health service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+//
+// Health is gRPC's mechanism for checking whether a server is able to handle
+// RPCs. Its semantics are documented in
+// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
type HealthClient interface {
// Check gets the health of the specified service. If the requested service
// is unknown, the call will fail with status NOT_FOUND. If the caller does
@@ -126,6 +130,10 @@ func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) {
// HealthServer is the server API for Health service.
// All implementations should embed UnimplementedHealthServer
// for forward compatibility
+//
+// Health is gRPC's mechanism for checking whether a server is able to handle
+// RPCs. Its semantics are documented in
+// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
type HealthServer interface {
// Check gets the health of the specified service. If the requested service
// is unknown, the call will fail with status NOT_FOUND. If the caller does
diff --git a/vendor/google.golang.org/grpc/internal/backoff/backoff.go b/vendor/google.golang.org/grpc/internal/backoff/backoff.go
index fed1c011a32..b15cf482d29 100644
--- a/vendor/google.golang.org/grpc/internal/backoff/backoff.go
+++ b/vendor/google.golang.org/grpc/internal/backoff/backoff.go
@@ -25,10 +25,10 @@ package backoff
import (
"context"
"errors"
+ "math/rand"
"time"
grpcbackoff "google.golang.org/grpc/backoff"
- "google.golang.org/grpc/internal/grpcrand"
)
// Strategy defines the methodology for backing off after a grpc connection
@@ -67,7 +67,7 @@ func (bc Exponential) Backoff(retries int) time.Duration {
}
// Randomize backoff delays so that if a cluster of requests start at
// the same time, they won't operate in lockstep.
- backoff *= 1 + bc.Config.Jitter*(grpcrand.Float64()*2-1)
+ backoff *= 1 + bc.Config.Jitter*(rand.Float64()*2-1)
if backoff < 0 {
return 0
}
diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go
index 9c915d9e4b2..d9064871394 100644
--- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go
+++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go
@@ -40,6 +40,12 @@ var (
// ALTSMaxConcurrentHandshakes is the maximum number of concurrent ALTS
// handshakes that can be performed.
ALTSMaxConcurrentHandshakes = uint64FromEnv("GRPC_ALTS_MAX_CONCURRENT_HANDSHAKES", 100, 1, 100)
+ // EnforceALPNEnabled is set if TLS connections to servers with ALPN disabled
+ // should be rejected. The HTTP/2 protocol requires ALPN to be enabled, this
+ // option is present for backward compatibility. This option may be overridden
+ // by setting the environment variable "GRPC_ENFORCE_ALPN_ENABLED" to "true"
+ // or "false".
+ EnforceALPNEnabled = boolFromEnv("GRPC_ENFORCE_ALPN_ENABLED", false)
)
func boolFromEnv(envVar string, def bool) bool {
diff --git a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go
deleted file mode 100644
index 0126d6b5108..00000000000
--- a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go
+++ /dev/null
@@ -1,100 +0,0 @@
-//go:build !go1.21
-
-// TODO: when this file is deleted (after Go 1.20 support is dropped), delete
-// all of grpcrand and call the rand package directly.
-
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// Package grpcrand implements math/rand functions in a concurrent-safe way
-// with a global random source, independent of math/rand's global source.
-package grpcrand
-
-import (
- "math/rand"
- "sync"
- "time"
-)
-
-var (
- r = rand.New(rand.NewSource(time.Now().UnixNano()))
- mu sync.Mutex
-)
-
-// Int implements rand.Int on the grpcrand global source.
-func Int() int {
- mu.Lock()
- defer mu.Unlock()
- return r.Int()
-}
-
-// Int63n implements rand.Int63n on the grpcrand global source.
-func Int63n(n int64) int64 {
- mu.Lock()
- defer mu.Unlock()
- return r.Int63n(n)
-}
-
-// Intn implements rand.Intn on the grpcrand global source.
-func Intn(n int) int {
- mu.Lock()
- defer mu.Unlock()
- return r.Intn(n)
-}
-
-// Int31n implements rand.Int31n on the grpcrand global source.
-func Int31n(n int32) int32 {
- mu.Lock()
- defer mu.Unlock()
- return r.Int31n(n)
-}
-
-// Float64 implements rand.Float64 on the grpcrand global source.
-func Float64() float64 {
- mu.Lock()
- defer mu.Unlock()
- return r.Float64()
-}
-
-// Uint64 implements rand.Uint64 on the grpcrand global source.
-func Uint64() uint64 {
- mu.Lock()
- defer mu.Unlock()
- return r.Uint64()
-}
-
-// Uint32 implements rand.Uint32 on the grpcrand global source.
-func Uint32() uint32 {
- mu.Lock()
- defer mu.Unlock()
- return r.Uint32()
-}
-
-// ExpFloat64 implements rand.ExpFloat64 on the grpcrand global source.
-func ExpFloat64() float64 {
- mu.Lock()
- defer mu.Unlock()
- return r.ExpFloat64()
-}
-
-// Shuffle implements rand.Shuffle on the grpcrand global source.
-var Shuffle = func(n int, f func(int, int)) {
- mu.Lock()
- defer mu.Unlock()
- r.Shuffle(n, f)
-}
diff --git a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand_go1.21.go b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand_go1.21.go
deleted file mode 100644
index c37299af1ef..00000000000
--- a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand_go1.21.go
+++ /dev/null
@@ -1,73 +0,0 @@
-//go:build go1.21
-
-/*
- *
- * Copyright 2024 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// Package grpcrand implements math/rand functions in a concurrent-safe way
-// with a global random source, independent of math/rand's global source.
-package grpcrand
-
-import "math/rand"
-
-// This implementation will be used for Go version 1.21 or newer.
-// For older versions, the original implementation with mutex will be used.
-
-// Int implements rand.Int on the grpcrand global source.
-func Int() int {
- return rand.Int()
-}
-
-// Int63n implements rand.Int63n on the grpcrand global source.
-func Int63n(n int64) int64 {
- return rand.Int63n(n)
-}
-
-// Intn implements rand.Intn on the grpcrand global source.
-func Intn(n int) int {
- return rand.Intn(n)
-}
-
-// Int31n implements rand.Int31n on the grpcrand global source.
-func Int31n(n int32) int32 {
- return rand.Int31n(n)
-}
-
-// Float64 implements rand.Float64 on the grpcrand global source.
-func Float64() float64 {
- return rand.Float64()
-}
-
-// Uint64 implements rand.Uint64 on the grpcrand global source.
-func Uint64() uint64 {
- return rand.Uint64()
-}
-
-// Uint32 implements rand.Uint32 on the grpcrand global source.
-func Uint32() uint32 {
- return rand.Uint32()
-}
-
-// ExpFloat64 implements rand.ExpFloat64 on the grpcrand global source.
-func ExpFloat64() float64 {
- return rand.ExpFloat64()
-}
-
-// Shuffle implements rand.Shuffle on the grpcrand global source.
-var Shuffle = func(n int, f func(int, int)) {
- rand.Shuffle(n, f)
-}
diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go
index 48d24bdb4e6..5d665398692 100644
--- a/vendor/google.golang.org/grpc/internal/internal.go
+++ b/vendor/google.golang.org/grpc/internal/internal.go
@@ -106,6 +106,14 @@ var (
// This is used in the 1.0 release of gcp/observability, and thus must not be
// deleted or changed.
ClearGlobalDialOptions func()
+
+ // AddGlobalPerTargetDialOptions adds a PerTargetDialOption that will be
+ // configured for newly created ClientConns.
+ AddGlobalPerTargetDialOptions any // func (opt any)
+ // ClearGlobalPerTargetDialOptions clears the slice of global late apply
+ // dial options.
+ ClearGlobalPerTargetDialOptions func()
+
// JoinDialOptions combines the dial options passed as arguments into a
// single dial option.
JoinDialOptions any // func(...grpc.DialOption) grpc.DialOption
@@ -126,7 +134,8 @@ var (
// deleted or changed.
BinaryLogger any // func(binarylog.Logger) grpc.ServerOption
- // SubscribeToConnectivityStateChanges adds a grpcsync.Subscriber to a provided grpc.ClientConn
+ // SubscribeToConnectivityStateChanges adds a grpcsync.Subscriber to a
+ // provided grpc.ClientConn.
SubscribeToConnectivityStateChanges any // func(*grpc.ClientConn, grpcsync.Subscriber)
// NewXDSResolverWithConfigForTesting creates a new xds resolver builder using
@@ -184,25 +193,25 @@ var (
ChannelzTurnOffForTesting func()
- // TriggerXDSResourceNameNotFoundForTesting triggers the resource-not-found
- // error for a given resource type and name. This is usually triggered when
- // the associated watch timer fires. For testing purposes, having this
- // function makes events more predictable than relying on timer events.
- TriggerXDSResourceNameNotFoundForTesting any // func(func(xdsresource.Type, string), string, string) error
+ // TriggerXDSResourceNotFoundForTesting causes the provided xDS Client to
+ // invoke resource-not-found error for the given resource type and name.
+ TriggerXDSResourceNotFoundForTesting any // func(xdsclient.XDSClient, xdsresource.Type, string) error
- // TriggerXDSResourceNameNotFoundClient invokes the testing xDS Client
- // singleton to invoke resource not found for a resource type name and
- // resource name.
- TriggerXDSResourceNameNotFoundClient any // func(string, string) error
-
- // FromOutgoingContextRaw returns the un-merged, intermediary contents of metadata.rawMD.
+ // FromOutgoingContextRaw returns the un-merged, intermediary contents of
+ // metadata.rawMD.
FromOutgoingContextRaw any // func(context.Context) (metadata.MD, [][]string, bool)
- // UserSetDefaultScheme is set to true if the user has overridden the default resolver scheme.
+ // UserSetDefaultScheme is set to true if the user has overridden the
+ // default resolver scheme.
UserSetDefaultScheme bool = false
+
+ // ShuffleAddressListForTesting pseudo-randomizes the order of addresses. n
+ // is the number of elements. swap swaps the elements with indexes i and j.
+ ShuffleAddressListForTesting any // func(n int, swap func(i, j int))
)
-// HealthChecker defines the signature of the client-side LB channel health checking function.
+// HealthChecker defines the signature of the client-side LB channel health
+// checking function.
//
// The implementation is expected to create a health checking RPC stream by
// calling newStream(), watch for the health status of serviceName, and report
diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go
index f3f52a59a86..4552db16b02 100644
--- a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go
+++ b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go
@@ -24,6 +24,7 @@ import (
"context"
"encoding/json"
"fmt"
+ "math/rand"
"net"
"os"
"strconv"
@@ -35,7 +36,6 @@ import (
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal/backoff"
"google.golang.org/grpc/internal/envconfig"
- "google.golang.org/grpc/internal/grpcrand"
"google.golang.org/grpc/internal/resolver/dns/internal"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/serviceconfig"
@@ -63,6 +63,8 @@ var (
func init() {
resolver.Register(NewBuilder())
internal.TimeAfterFunc = time.After
+ internal.TimeNowFunc = time.Now
+ internal.TimeUntilFunc = time.Until
internal.NewNetResolver = newNetResolver
internal.AddressDialer = addressDialer
}
@@ -209,12 +211,12 @@ func (d *dnsResolver) watcher() {
err = d.cc.UpdateState(*state)
}
- var waitTime time.Duration
+ var nextResolutionTime time.Time
if err == nil {
// Success resolving, wait for the next ResolveNow. However, also wait 30
// seconds at the very least to prevent constantly re-resolving.
backoffIndex = 1
- waitTime = MinResolutionInterval
+ nextResolutionTime = internal.TimeNowFunc().Add(MinResolutionInterval)
select {
case <-d.ctx.Done():
return
@@ -223,13 +225,13 @@ func (d *dnsResolver) watcher() {
} else {
// Poll on an error found in DNS Resolver or an error received from
// ClientConn.
- waitTime = backoff.DefaultExponential.Backoff(backoffIndex)
+ nextResolutionTime = internal.TimeNowFunc().Add(backoff.DefaultExponential.Backoff(backoffIndex))
backoffIndex++
}
select {
case <-d.ctx.Done():
return
- case <-internal.TimeAfterFunc(waitTime):
+ case <-internal.TimeAfterFunc(internal.TimeUntilFunc(nextResolutionTime)):
}
}
}
@@ -423,7 +425,7 @@ func chosenByPercentage(a *int) bool {
if a == nil {
return true
}
- return grpcrand.Intn(100)+1 <= *a
+ return rand.Intn(100)+1 <= *a
}
func canaryingSC(js string) string {
diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go b/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go
index a7ecaf8d522..c0eae4f5f83 100644
--- a/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go
+++ b/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go
@@ -51,11 +51,22 @@ var (
// The following vars are overridden from tests.
var (
// TimeAfterFunc is used by the DNS resolver to wait for the given duration
- // to elapse. In non-test code, this is implemented by time.After. In test
+ // to elapse. In non-test code, this is implemented by time.After. In test
// code, this can be used to control the amount of time the resolver is
// blocked waiting for the duration to elapse.
TimeAfterFunc func(time.Duration) <-chan time.Time
+ // TimeNowFunc is used by the DNS resolver to get the current time.
+ // In non-test code, this is implemented by time.Now. In test code,
+ // this can be used to control the current time for the resolver.
+ TimeNowFunc func() time.Time
+
+ // TimeUntilFunc is used by the DNS resolver to calculate the remaining
+ // wait time for re-resolution. In non-test code, this is implemented by
+ // time.Until. In test code, this can be used to control the remaining
+ // time for resolver to wait for re-resolution.
+ TimeUntilFunc func(time.Time) time.Duration
+
// NewNetResolver returns the net.Resolver instance for the given target.
NewNetResolver func(string) (NetResolver, error)
diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go
index cab0e2d3d44..b7091165b50 100644
--- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go
+++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go
@@ -25,6 +25,7 @@ import (
"fmt"
"io"
"math"
+ "math/rand"
"net"
"net/http"
"strconv"
@@ -43,7 +44,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/internal/channelz"
- "google.golang.org/grpc/internal/grpcrand"
"google.golang.org/grpc/internal/grpcsync"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
@@ -1440,7 +1440,7 @@ func getJitter(v time.Duration) time.Duration {
}
// Generate a jitter between +/- 10% of the value.
r := int64(v / 10)
- j := grpcrand.Int63n(2*r) - r
+ j := rand.Int63n(2*r) - r
return time.Duration(j)
}
diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go
index 6c01a9b359c..1e9485fd6e2 100644
--- a/vendor/google.golang.org/grpc/metadata/metadata.go
+++ b/vendor/google.golang.org/grpc/metadata/metadata.go
@@ -90,21 +90,6 @@ func Pairs(kv ...string) MD {
return md
}
-// String implements the Stringer interface for pretty-printing a MD.
-// Ordering of the values is non-deterministic as it ranges over a map.
-func (md MD) String() string {
- var sb strings.Builder
- fmt.Fprintf(&sb, "MD{")
- for k, v := range md {
- if sb.Len() > 3 {
- fmt.Fprintf(&sb, ", ")
- }
- fmt.Fprintf(&sb, "%s=[%s]", k, strings.Join(v, ", "))
- }
- fmt.Fprintf(&sb, "}")
- return sb.String()
-}
-
// Len returns the number of items in md.
func (md MD) Len() int {
return len(md)
diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go
index 56e8aba783f..bdaa2130e48 100644
--- a/vendor/google.golang.org/grpc/picker_wrapper.go
+++ b/vendor/google.golang.org/grpc/picker_wrapper.go
@@ -22,7 +22,7 @@ import (
"context"
"fmt"
"io"
- "sync"
+ "sync/atomic"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/codes"
@@ -33,35 +33,43 @@ import (
"google.golang.org/grpc/status"
)
+// pickerGeneration stores a picker and a channel used to signal that a picker
+// newer than this one is available.
+type pickerGeneration struct {
+ // picker is the picker produced by the LB policy. May be nil if a picker
+ // has never been produced.
+ picker balancer.Picker
+ // blockingCh is closed when the picker has been invalidated because there
+ // is a new one available.
+ blockingCh chan struct{}
+}
+
// pickerWrapper is a wrapper of balancer.Picker. It blocks on certain pick
// actions and unblock when there's a picker update.
type pickerWrapper struct {
- mu sync.Mutex
- done bool
- blockingCh chan struct{}
- picker balancer.Picker
+ // If pickerGen holds a nil pointer, the pickerWrapper is closed.
+ pickerGen atomic.Pointer[pickerGeneration]
statsHandlers []stats.Handler // to record blocking picker calls
}
func newPickerWrapper(statsHandlers []stats.Handler) *pickerWrapper {
- return &pickerWrapper{
- blockingCh: make(chan struct{}),
+ pw := &pickerWrapper{
statsHandlers: statsHandlers,
}
+ pw.pickerGen.Store(&pickerGeneration{
+ blockingCh: make(chan struct{}),
+ })
+ return pw
}
-// updatePicker is called by UpdateBalancerState. It unblocks all blocked pick.
+// updatePicker is called by UpdateState calls from the LB policy. It
+// unblocks all blocked pick.
func (pw *pickerWrapper) updatePicker(p balancer.Picker) {
- pw.mu.Lock()
- if pw.done {
- pw.mu.Unlock()
- return
- }
- pw.picker = p
- // pw.blockingCh should never be nil.
- close(pw.blockingCh)
- pw.blockingCh = make(chan struct{})
- pw.mu.Unlock()
+ old := pw.pickerGen.Swap(&pickerGeneration{
+ picker: p,
+ blockingCh: make(chan struct{}),
+ })
+ close(old.blockingCh)
}
// doneChannelzWrapper performs the following:
@@ -98,20 +106,17 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.
var lastPickErr error
for {
- pw.mu.Lock()
- if pw.done {
- pw.mu.Unlock()
+ pg := pw.pickerGen.Load()
+ if pg == nil {
return nil, balancer.PickResult{}, ErrClientConnClosing
}
-
- if pw.picker == nil {
- ch = pw.blockingCh
+ if pg.picker == nil {
+ ch = pg.blockingCh
}
- if ch == pw.blockingCh {
+ if ch == pg.blockingCh {
// This could happen when either:
// - pw.picker is nil (the previous if condition), or
- // - has called pick on the current picker.
- pw.mu.Unlock()
+ // - we have already called pick on the current picker.
select {
case <-ctx.Done():
var errStr string
@@ -145,9 +150,8 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.
}
}
- ch = pw.blockingCh
- p := pw.picker
- pw.mu.Unlock()
+ ch = pg.blockingCh
+ p := pg.picker
pickResult, err := p.Pick(info)
if err != nil {
@@ -197,24 +201,15 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.
}
func (pw *pickerWrapper) close() {
- pw.mu.Lock()
- defer pw.mu.Unlock()
- if pw.done {
- return
- }
- pw.done = true
- close(pw.blockingCh)
+ old := pw.pickerGen.Swap(nil)
+ close(old.blockingCh)
}
// reset clears the pickerWrapper and prepares it for being used again when idle
// mode is exited.
func (pw *pickerWrapper) reset() {
- pw.mu.Lock()
- defer pw.mu.Unlock()
- if pw.done {
- return
- }
- pw.blockingCh = make(chan struct{})
+ old := pw.pickerGen.Swap(&pickerGeneration{blockingCh: make(chan struct{})})
+ close(old.blockingCh)
}
// dropError is a wrapper error that indicates the LB policy wishes to drop the
diff --git a/vendor/google.golang.org/grpc/resolver_wrapper.go b/vendor/google.golang.org/grpc/resolver_wrapper.go
index 9dcc9780f89..c5fb45236fa 100644
--- a/vendor/google.golang.org/grpc/resolver_wrapper.go
+++ b/vendor/google.golang.org/grpc/resolver_wrapper.go
@@ -171,7 +171,7 @@ func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) {
// ParseServiceConfig is called by resolver implementations to parse a JSON
// representation of the service config.
func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult {
- return parseServiceConfig(scJSON)
+ return parseServiceConfig(scJSON, ccr.cc.dopts.maxCallAttempts)
}
// addChannelzTraceEvent adds a channelz trace event containing the new
diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go
index 9da8fc8027d..2671c5ef69f 100644
--- a/vendor/google.golang.org/grpc/service_config.go
+++ b/vendor/google.golang.org/grpc/service_config.go
@@ -26,6 +26,7 @@ import (
"time"
"google.golang.org/grpc/balancer"
+ "google.golang.org/grpc/balancer/pickfirst"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/internal"
"google.golang.org/grpc/internal/balancer/gracefulswitch"
@@ -163,9 +164,11 @@ type jsonSC struct {
}
func init() {
- internal.ParseServiceConfig = parseServiceConfig
+ internal.ParseServiceConfig = func(js string) *serviceconfig.ParseResult {
+ return parseServiceConfig(js, defaultMaxCallAttempts)
+ }
}
-func parseServiceConfig(js string) *serviceconfig.ParseResult {
+func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult {
if len(js) == 0 {
return &serviceconfig.ParseResult{Err: fmt.Errorf("no JSON service config provided")}
}
@@ -183,12 +186,12 @@ func parseServiceConfig(js string) *serviceconfig.ParseResult {
}
c := rsc.LoadBalancingConfig
if c == nil {
- name := PickFirstBalancerName
+ name := pickfirst.Name
if rsc.LoadBalancingPolicy != nil {
name = *rsc.LoadBalancingPolicy
}
if balancer.Get(name) == nil {
- name = PickFirstBalancerName
+ name = pickfirst.Name
}
cfg := []map[string]any{{name: struct{}{}}}
strCfg, err := json.Marshal(cfg)
@@ -218,7 +221,7 @@ func parseServiceConfig(js string) *serviceconfig.ParseResult {
WaitForReady: m.WaitForReady,
Timeout: (*time.Duration)(m.Timeout),
}
- if mc.RetryPolicy, err = convertRetryPolicy(m.RetryPolicy); err != nil {
+ if mc.RetryPolicy, err = convertRetryPolicy(m.RetryPolicy, maxAttempts); err != nil {
logger.Warningf("grpc: unmarshalling service config %s: %v", js, err)
return &serviceconfig.ParseResult{Err: err}
}
@@ -264,7 +267,7 @@ func parseServiceConfig(js string) *serviceconfig.ParseResult {
return &serviceconfig.ParseResult{Config: &sc}
}
-func convertRetryPolicy(jrp *jsonRetryPolicy) (p *internalserviceconfig.RetryPolicy, err error) {
+func convertRetryPolicy(jrp *jsonRetryPolicy, maxAttempts int) (p *internalserviceconfig.RetryPolicy, err error) {
if jrp == nil {
return nil, nil
}
@@ -278,17 +281,16 @@ func convertRetryPolicy(jrp *jsonRetryPolicy) (p *internalserviceconfig.RetryPol
return nil, nil
}
+ if jrp.MaxAttempts < maxAttempts {
+ maxAttempts = jrp.MaxAttempts
+ }
rp := &internalserviceconfig.RetryPolicy{
- MaxAttempts: jrp.MaxAttempts,
+ MaxAttempts: maxAttempts,
InitialBackoff: time.Duration(jrp.InitialBackoff),
MaxBackoff: time.Duration(jrp.MaxBackoff),
BackoffMultiplier: jrp.BackoffMultiplier,
RetryableStatusCodes: make(map[codes.Code]bool),
}
- if rp.MaxAttempts > 5 {
- // TODO(retry): Make the max maxAttempts configurable.
- rp.MaxAttempts = 5
- }
for _, code := range jrp.RetryableStatusCodes {
rp.RetryableStatusCodes[code] = true
}
diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go
index b54563e81cd..8051ef5b514 100644
--- a/vendor/google.golang.org/grpc/stream.go
+++ b/vendor/google.golang.org/grpc/stream.go
@@ -23,6 +23,7 @@ import (
"errors"
"io"
"math"
+ "math/rand"
"strconv"
"sync"
"time"
@@ -34,7 +35,6 @@ import (
"google.golang.org/grpc/internal/balancerload"
"google.golang.org/grpc/internal/binarylog"
"google.golang.org/grpc/internal/channelz"
- "google.golang.org/grpc/internal/grpcrand"
"google.golang.org/grpc/internal/grpcutil"
imetadata "google.golang.org/grpc/internal/metadata"
iresolver "google.golang.org/grpc/internal/resolver"
@@ -699,7 +699,7 @@ func (a *csAttempt) shouldRetry(err error) (bool, error) {
if max := float64(rp.MaxBackoff); cur > max {
cur = max
}
- dur = time.Duration(grpcrand.Int63n(int64(cur)))
+ dur = time.Duration(rand.Int63n(int64(cur)))
cs.numRetriesSincePushback++
}
diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go
index e1806e76000..bafaef99be9 100644
--- a/vendor/google.golang.org/grpc/version.go
+++ b/vendor/google.golang.org/grpc/version.go
@@ -19,4 +19,4 @@
package grpc
// Version is the current grpc version.
-const Version = "1.64.0"
+const Version = "1.65.0"
diff --git a/vendor/github.com/evanphx/json-patch/.gitignore b/vendor/gopkg.in/evanphx/json-patch.v4/.gitignore
similarity index 100%
rename from vendor/github.com/evanphx/json-patch/.gitignore
rename to vendor/gopkg.in/evanphx/json-patch.v4/.gitignore
diff --git a/vendor/github.com/evanphx/json-patch/LICENSE b/vendor/gopkg.in/evanphx/json-patch.v4/LICENSE
similarity index 100%
rename from vendor/github.com/evanphx/json-patch/LICENSE
rename to vendor/gopkg.in/evanphx/json-patch.v4/LICENSE
diff --git a/vendor/github.com/evanphx/json-patch/README.md b/vendor/gopkg.in/evanphx/json-patch.v4/README.md
similarity index 97%
rename from vendor/github.com/evanphx/json-patch/README.md
rename to vendor/gopkg.in/evanphx/json-patch.v4/README.md
index 97e319b21bf..28e35169375 100644
--- a/vendor/github.com/evanphx/json-patch/README.md
+++ b/vendor/gopkg.in/evanphx/json-patch.v4/README.md
@@ -4,7 +4,7 @@
well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396).
[![GoDoc](https://godoc.org/github.com/evanphx/json-patch?status.svg)](http://godoc.org/github.com/evanphx/json-patch)
-[![Build Status](https://github.com/evanphx/json-patch/actions/workflows/go.yml/badge.svg)](https://github.com/evanphx/json-patch/actions/workflows/go.yml)
+[![Build Status](https://travis-ci.org/evanphx/json-patch.svg?branch=master)](https://travis-ci.org/evanphx/json-patch)
[![Report Card](https://goreportcard.com/badge/github.com/evanphx/json-patch)](https://goreportcard.com/report/github.com/evanphx/json-patch)
# Get It!
@@ -314,4 +314,4 @@ go test -cover ./...
```
Builds for pull requests are tested automatically
-using [GitHub Actions](https://github.com/evanphx/json-patch/actions/workflows/go.yml).
+using [TravisCI](https://travis-ci.org/evanphx/json-patch).
diff --git a/vendor/github.com/evanphx/json-patch/errors.go b/vendor/gopkg.in/evanphx/json-patch.v4/errors.go
similarity index 100%
rename from vendor/github.com/evanphx/json-patch/errors.go
rename to vendor/gopkg.in/evanphx/json-patch.v4/errors.go
diff --git a/vendor/github.com/evanphx/json-patch/merge.go b/vendor/gopkg.in/evanphx/json-patch.v4/merge.go
similarity index 100%
rename from vendor/github.com/evanphx/json-patch/merge.go
rename to vendor/gopkg.in/evanphx/json-patch.v4/merge.go
diff --git a/vendor/github.com/evanphx/json-patch/patch.go b/vendor/gopkg.in/evanphx/json-patch.v4/patch.go
similarity index 99%
rename from vendor/github.com/evanphx/json-patch/patch.go
rename to vendor/gopkg.in/evanphx/json-patch.v4/patch.go
index cd0274e1e4a..dc2b7e51e60 100644
--- a/vendor/github.com/evanphx/json-patch/patch.go
+++ b/vendor/gopkg.in/evanphx/json-patch.v4/patch.go
@@ -359,7 +359,7 @@ func findObject(pd *container, path string) (container, string) {
next, ok := doc.get(decodePatchKey(part))
- if next == nil || ok != nil || next.raw == nil {
+ if next == nil || ok != nil {
return nil, ""
}
@@ -688,7 +688,7 @@ func (p Patch) test(doc *container, op Operation) error {
}
if val == nil {
- if op.value() == nil || op.value().raw == nil {
+ if op.value().raw == nil {
return nil
}
return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
diff --git a/vendor/k8s.io/api/admission/v1/doc.go b/vendor/k8s.io/api/admission/v1/doc.go
index cbc6bb59dd9..e7df9f629c3 100644
--- a/vendor/k8s.io/api/admission/v1/doc.go
+++ b/vendor/k8s.io/api/admission/v1/doc.go
@@ -17,7 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=false
-
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=admission.k8s.io
package v1 // import "k8s.io/api/admission/v1"
diff --git a/vendor/k8s.io/api/admission/v1/generated.proto b/vendor/k8s.io/api/admission/v1/generated.proto
index 941deb4fb4b..9648aa58fbc 100644
--- a/vendor/k8s.io/api/admission/v1/generated.proto
+++ b/vendor/k8s.io/api/admission/v1/generated.proto
@@ -38,10 +38,10 @@ message AdmissionRequest {
optional string uid = 1;
// Kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale)
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 2;
// Resource is the fully-qualified resource being requested (for example, v1.pods)
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 3;
// SubResource is the subresource being requested, if any (for example, "status" or "scale")
// +optional
@@ -58,7 +58,7 @@ message AdmissionRequest {
//
// See documentation for the "matchPolicy" field in the webhook configuration type for more details.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind requestKind = 13;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind requestKind = 13;
// RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
// If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
@@ -71,7 +71,7 @@ message AdmissionRequest {
//
// See documentation for the "matchPolicy" field in the webhook configuration type.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource requestResource = 14;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource requestResource = 14;
// RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")
// If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.
@@ -93,15 +93,15 @@ message AdmissionRequest {
optional string operation = 7;
// UserInfo is information about the requesting user
- optional k8s.io.api.authentication.v1.UserInfo userInfo = 8;
+ optional .k8s.io.api.authentication.v1.UserInfo userInfo = 8;
// Object is the object from the incoming request.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension object = 9;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 9;
// OldObject is the existing object. Only populated for DELETE and UPDATE requests.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 10;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 10;
// DryRun indicates that modifications will definitely not be persisted for this request.
// Defaults to false.
@@ -114,7 +114,7 @@ message AdmissionRequest {
// Operation might be a CREATE, in which case the Options will a
// `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension options = 12;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension options = 12;
}
// AdmissionResponse describes an admission response.
@@ -129,7 +129,7 @@ message AdmissionResponse {
// Result contains extra details into why an admission request was denied.
// This field IS NOT consulted in any way if "Allowed" is "true".
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 3;
// The patch body. Currently we only support "JSONPatch" which implements RFC 6902.
// +optional
diff --git a/vendor/k8s.io/api/admission/v1/types.go b/vendor/k8s.io/api/admission/v1/types.go
index 556fd1ad54d..2def92da5b3 100644
--- a/vendor/k8s.io/api/admission/v1/types.go
+++ b/vendor/k8s.io/api/admission/v1/types.go
@@ -24,6 +24,7 @@ import (
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// AdmissionReview describes an admission review request/response.
type AdmissionReview struct {
diff --git a/vendor/k8s.io/api/admission/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/admission/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..ac81d993c60
--- /dev/null
+++ b/vendor/k8s.io/api/admission/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,28 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *AdmissionReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
diff --git a/vendor/k8s.io/api/admission/v1beta1/generated.proto b/vendor/k8s.io/api/admission/v1beta1/generated.proto
index ff0fa46d252..d27c05b727e 100644
--- a/vendor/k8s.io/api/admission/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/admission/v1beta1/generated.proto
@@ -38,10 +38,10 @@ message AdmissionRequest {
optional string uid = 1;
// Kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale)
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 2;
// Resource is the fully-qualified resource being requested (for example, v1.pods)
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 3;
// SubResource is the subresource being requested, if any (for example, "status" or "scale")
// +optional
@@ -58,7 +58,7 @@ message AdmissionRequest {
//
// See documentation for the "matchPolicy" field in the webhook configuration type for more details.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind requestKind = 13;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind requestKind = 13;
// RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).
// If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.
@@ -71,7 +71,7 @@ message AdmissionRequest {
//
// See documentation for the "matchPolicy" field in the webhook configuration type.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource requestResource = 14;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource requestResource = 14;
// RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")
// If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.
@@ -93,15 +93,15 @@ message AdmissionRequest {
optional string operation = 7;
// UserInfo is information about the requesting user
- optional k8s.io.api.authentication.v1.UserInfo userInfo = 8;
+ optional .k8s.io.api.authentication.v1.UserInfo userInfo = 8;
// Object is the object from the incoming request.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension object = 9;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 9;
// OldObject is the existing object. Only populated for DELETE and UPDATE requests.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 10;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension oldObject = 10;
// DryRun indicates that modifications will definitely not be persisted for this request.
// Defaults to false.
@@ -114,7 +114,7 @@ message AdmissionRequest {
// Operation might be a CREATE, in which case the Options will a
// `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension options = 12;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension options = 12;
}
// AdmissionResponse describes an admission response.
@@ -129,7 +129,7 @@ message AdmissionResponse {
// Result contains extra details into why an admission request was denied.
// This field IS NOT consulted in any way if "Allowed" is "true".
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 3;
// The patch body. Currently we only support "JSONPatch" which implements RFC 6902.
// +optional
diff --git a/vendor/k8s.io/api/admissionregistration/v1/doc.go b/vendor/k8s.io/api/admissionregistration/v1/doc.go
index c3940f090c8..ca0086188a3 100644
--- a/vendor/k8s.io/api/admissionregistration/v1/doc.go
+++ b/vendor/k8s.io/api/admissionregistration/v1/doc.go
@@ -17,6 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=admissionregistration.k8s.io
// Package v1 is the v1 version of the API.
diff --git a/vendor/k8s.io/api/admissionregistration/v1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1/generated.proto
index 44589007a23..e856e9eaf2f 100644
--- a/vendor/k8s.io/api/admissionregistration/v1/generated.proto
+++ b/vendor/k8s.io/api/admissionregistration/v1/generated.proto
@@ -156,7 +156,7 @@ message MatchResources {
//
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 1;
// ObjectSelector decides whether to run the validation based on if the
// object has matching labels. objectSelector is evaluated against both
@@ -170,7 +170,7 @@ message MatchResources {
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 2;
// ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
// The policy cares about an operation if it matches _any_ Rule.
@@ -290,7 +290,7 @@ message MutatingWebhook {
//
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
// ObjectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
@@ -304,7 +304,7 @@ message MutatingWebhook {
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 11;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 11;
// SideEffects states whether this webhook has side effects.
// Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown).
@@ -374,7 +374,7 @@ message MutatingWebhook {
message MutatingWebhookConfiguration {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Webhooks is a list of webhooks and the affected resources and operations.
// +optional
@@ -390,7 +390,7 @@ message MutatingWebhookConfigurationList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of MutatingWebhookConfiguration.
repeated MutatingWebhookConfiguration items = 2;
@@ -463,7 +463,7 @@ message ParamRef {
// mutually exclusive properties. If one is set, the other must be unset.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
// `parameterNotFoundAction` controls the behavior of the binding when the resource
// exists, and name or selector is valid, but there are no parameters
@@ -570,16 +570,11 @@ message TypeChecking {
repeated ExpressionWarning expressionWarnings = 1;
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +genclient
-// +genclient:nonNamespaced
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
// ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.
message ValidatingAdmissionPolicy {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the ValidatingAdmissionPolicy.
optional ValidatingAdmissionPolicySpec spec = 2;
@@ -606,7 +601,7 @@ message ValidatingAdmissionPolicy {
message ValidatingAdmissionPolicyBinding {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the ValidatingAdmissionPolicyBinding.
optional ValidatingAdmissionPolicyBindingSpec spec = 2;
@@ -617,7 +612,7 @@ message ValidatingAdmissionPolicyBindingList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of PolicyBinding.
repeated ValidatingAdmissionPolicyBinding items = 2;
@@ -688,14 +683,12 @@ message ValidatingAdmissionPolicyBindingSpec {
repeated string validationActions = 4;
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
// ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy.
message ValidatingAdmissionPolicyList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ValidatingAdmissionPolicy.
repeated ValidatingAdmissionPolicy items = 2;
@@ -800,7 +793,7 @@ message ValidatingAdmissionPolicyStatus {
// +optional
// +listType=map
// +listMapKey=type
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3;
}
// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
@@ -891,7 +884,7 @@ message ValidatingWebhook {
//
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
// ObjectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
@@ -905,7 +898,7 @@ message ValidatingWebhook {
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 10;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 10;
// SideEffects states whether this webhook has side effects.
// Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown).
@@ -957,7 +950,7 @@ message ValidatingWebhook {
message ValidatingWebhookConfiguration {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Webhooks is a list of webhooks and the affected resources and operations.
// +optional
@@ -973,7 +966,7 @@ message ValidatingWebhookConfigurationList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ValidatingWebhookConfiguration.
repeated ValidatingWebhookConfiguration items = 2;
diff --git a/vendor/k8s.io/api/admissionregistration/v1/types.go b/vendor/k8s.io/api/admissionregistration/v1/types.go
index b9ce1f0335c..4efeb26748c 100644
--- a/vendor/k8s.io/api/admissionregistration/v1/types.go
+++ b/vendor/k8s.io/api/admissionregistration/v1/types.go
@@ -137,6 +137,7 @@ const (
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.30
+
// ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.
type ValidatingAdmissionPolicy struct {
metav1.TypeMeta `json:",inline"`
@@ -195,6 +196,7 @@ type ExpressionWarning struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.30
+
// ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy.
type ValidatingAdmissionPolicyList struct {
metav1.TypeMeta `json:",inline"`
@@ -713,6 +715,7 @@ type NamedRuleWithOperations struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.16
// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.
type ValidatingWebhookConfiguration struct {
@@ -730,6 +733,7 @@ type ValidatingWebhookConfiguration struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.16
// ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.
type ValidatingWebhookConfigurationList struct {
@@ -745,6 +749,7 @@ type ValidatingWebhookConfigurationList struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.16
// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.
type MutatingWebhookConfiguration struct {
@@ -762,6 +767,7 @@ type MutatingWebhookConfiguration struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.16
// MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.
type MutatingWebhookConfigurationList struct {
diff --git a/vendor/k8s.io/api/admissionregistration/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/admissionregistration/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..0862bb1f2d3
--- /dev/null
+++ b/vendor/k8s.io/api/admissionregistration/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,70 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *MutatingWebhookConfiguration) APILifecycleIntroduced() (major, minor int) {
+ return 1, 16
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *MutatingWebhookConfigurationList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 16
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ValidatingAdmissionPolicy) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ValidatingAdmissionPolicyBinding) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ValidatingAdmissionPolicyBindingList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ValidatingAdmissionPolicyList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ValidatingWebhookConfiguration) APILifecycleIntroduced() (major, minor int) {
+ return 1, 16
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ValidatingWebhookConfigurationList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 16
+}
diff --git a/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto
index db02dd929f0..d5974d5ec4c 100644
--- a/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto
@@ -156,7 +156,7 @@ message MatchResources {
//
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 1;
// ObjectSelector decides whether to run the validation based on if the
// object has matching labels. objectSelector is evaluated against both
@@ -170,7 +170,7 @@ message MatchResources {
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 2;
// ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
// The policy cares about an operation if it matches _any_ Rule.
@@ -211,7 +211,7 @@ message NamedRuleWithOperations {
repeated string resourceNames = 1;
// RuleWithOperations is a tuple of Operations and Resources.
- optional k8s.io.api.admissionregistration.v1.RuleWithOperations ruleWithOperations = 2;
+ optional .k8s.io.api.admissionregistration.v1.RuleWithOperations ruleWithOperations = 2;
}
// ParamKind is a tuple of Group Kind and Version.
@@ -267,7 +267,7 @@ message ParamRef {
// mutually exclusive properties. If one is set, the other must be unset.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
// `parameterNotFoundAction` controls the behavior of the binding when the resource
// exists, and name or selector is valid, but there are no parameters
@@ -295,7 +295,7 @@ message TypeChecking {
message ValidatingAdmissionPolicy {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the ValidatingAdmissionPolicy.
optional ValidatingAdmissionPolicySpec spec = 2;
@@ -322,7 +322,7 @@ message ValidatingAdmissionPolicy {
message ValidatingAdmissionPolicyBinding {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the ValidatingAdmissionPolicyBinding.
optional ValidatingAdmissionPolicyBindingSpec spec = 2;
@@ -333,7 +333,7 @@ message ValidatingAdmissionPolicyBindingList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of PolicyBinding.
repeated ValidatingAdmissionPolicyBinding items = 2;
@@ -409,7 +409,7 @@ message ValidatingAdmissionPolicyList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ValidatingAdmissionPolicy.
repeated ValidatingAdmissionPolicy items = 2;
@@ -514,7 +514,7 @@ message ValidatingAdmissionPolicyStatus {
// +optional
// +listType=map
// +listMapKey=type
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3;
}
// Validation specifies the CEL expression which is used to apply the validation.
diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto
index 91479acc20b..30f99f64d0f 100644
--- a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto
@@ -157,7 +157,7 @@ message MatchResources {
//
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 1;
// ObjectSelector decides whether to run the validation based on if the
// object has matching labels. objectSelector is evaluated against both
@@ -171,7 +171,7 @@ message MatchResources {
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 2;
// ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
// The policy cares about an operation if it matches _any_ Rule.
@@ -223,7 +223,7 @@ message MutatingWebhook {
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
// +listType=atomic
- repeated k8s.io.api.admissionregistration.v1.RuleWithOperations rules = 3;
+ repeated .k8s.io.api.admissionregistration.v1.RuleWithOperations rules = 3;
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
// allowed values are Ignore or Fail. Defaults to Ignore.
@@ -291,7 +291,7 @@ message MutatingWebhook {
//
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
// ObjectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
@@ -305,7 +305,7 @@ message MutatingWebhook {
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 11;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 11;
// SideEffects states whether this webhook has side effects.
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
@@ -379,7 +379,7 @@ message MutatingWebhook {
message MutatingWebhookConfiguration {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Webhooks is a list of webhooks and the affected resources and operations.
// +optional
@@ -395,7 +395,7 @@ message MutatingWebhookConfigurationList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of MutatingWebhookConfiguration.
repeated MutatingWebhookConfiguration items = 2;
@@ -410,7 +410,7 @@ message NamedRuleWithOperations {
repeated string resourceNames = 1;
// RuleWithOperations is a tuple of Operations and Resources.
- optional k8s.io.api.admissionregistration.v1.RuleWithOperations ruleWithOperations = 2;
+ optional .k8s.io.api.admissionregistration.v1.RuleWithOperations ruleWithOperations = 2;
}
// ParamKind is a tuple of Group Kind and Version.
@@ -468,7 +468,7 @@ message ParamRef {
// mutually exclusive properties. If one is set, the other must be unset.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
// `parameterNotFoundAction` controls the behavior of the binding when the resource
// exists, and name or selector is valid, but there are no parameters
@@ -523,7 +523,7 @@ message TypeChecking {
message ValidatingAdmissionPolicy {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the ValidatingAdmissionPolicy.
optional ValidatingAdmissionPolicySpec spec = 2;
@@ -550,7 +550,7 @@ message ValidatingAdmissionPolicy {
message ValidatingAdmissionPolicyBinding {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the ValidatingAdmissionPolicyBinding.
optional ValidatingAdmissionPolicyBindingSpec spec = 2;
@@ -561,7 +561,7 @@ message ValidatingAdmissionPolicyBindingList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of PolicyBinding.
repeated ValidatingAdmissionPolicyBinding items = 2;
@@ -639,7 +639,7 @@ message ValidatingAdmissionPolicyList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ValidatingAdmissionPolicy.
repeated ValidatingAdmissionPolicy items = 2;
@@ -744,7 +744,7 @@ message ValidatingAdmissionPolicyStatus {
// +optional
// +listType=map
// +listMapKey=type
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3;
}
// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
@@ -767,7 +767,7 @@ message ValidatingWebhook {
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
// +listType=atomic
- repeated k8s.io.api.admissionregistration.v1.RuleWithOperations rules = 3;
+ repeated .k8s.io.api.admissionregistration.v1.RuleWithOperations rules = 3;
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
// allowed values are Ignore or Fail. Defaults to Ignore.
@@ -835,7 +835,7 @@ message ValidatingWebhook {
//
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
// ObjectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
@@ -849,7 +849,7 @@ message ValidatingWebhook {
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 10;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 10;
// SideEffects states whether this webhook has side effects.
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
@@ -906,7 +906,7 @@ message ValidatingWebhook {
message ValidatingWebhookConfiguration {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Webhooks is a list of webhooks and the affected resources and operations.
// +optional
@@ -922,7 +922,7 @@ message ValidatingWebhookConfigurationList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ValidatingWebhookConfiguration.
repeated ValidatingWebhookConfiguration items = 2;
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/v1/doc.go b/vendor/k8s.io/api/apidiscovery/v2/doc.go
similarity index 71%
rename from vendor/k8s.io/apiserver/pkg/apis/config/v1/doc.go
rename to vendor/k8s.io/api/apidiscovery/v2/doc.go
index b1a18ccab57..4f3ad5f139d 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/config/v1/doc.go
+++ b/vendor/k8s.io/api/apidiscovery/v2/doc.go
@@ -1,5 +1,5 @@
/*
-Copyright 2018 The Kubernetes Authors.
+Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// +k8s:conversion-gen=k8s.io/apiserver/pkg/apis/config
// +k8s:deepcopy-gen=package
-// +k8s:defaulter-gen=TypeMeta
-// +groupName=apiserver.config.k8s.io
+// +k8s:protobuf-gen=package
+// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
+// +groupName=apidiscovery.k8s.io
-// Package v1 is the v1 version of the API.
-package v1
+package v2 // import "k8s.io/api/apidiscovery/v2"
diff --git a/vendor/k8s.io/api/apidiscovery/v2/generated.pb.go b/vendor/k8s.io/api/apidiscovery/v2/generated.pb.go
new file mode 100644
index 00000000000..5c37feaa2ea
--- /dev/null
+++ b/vendor/k8s.io/api/apidiscovery/v2/generated.pb.go
@@ -0,0 +1,1742 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: k8s.io/api/apidiscovery/v2/generated.proto
+
+package v2
+
+import (
+ fmt "fmt"
+
+ io "io"
+
+ proto "github.com/gogo/protobuf/proto"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ math "math"
+ math_bits "math/bits"
+ reflect "reflect"
+ strings "strings"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+func (m *APIGroupDiscovery) Reset() { *m = APIGroupDiscovery{} }
+func (*APIGroupDiscovery) ProtoMessage() {}
+func (*APIGroupDiscovery) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e0b7287280068d8f, []int{0}
+}
+func (m *APIGroupDiscovery) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *APIGroupDiscovery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *APIGroupDiscovery) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_APIGroupDiscovery.Merge(m, src)
+}
+func (m *APIGroupDiscovery) XXX_Size() int {
+ return m.Size()
+}
+func (m *APIGroupDiscovery) XXX_DiscardUnknown() {
+ xxx_messageInfo_APIGroupDiscovery.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_APIGroupDiscovery proto.InternalMessageInfo
+
+func (m *APIGroupDiscoveryList) Reset() { *m = APIGroupDiscoveryList{} }
+func (*APIGroupDiscoveryList) ProtoMessage() {}
+func (*APIGroupDiscoveryList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e0b7287280068d8f, []int{1}
+}
+func (m *APIGroupDiscoveryList) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *APIGroupDiscoveryList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *APIGroupDiscoveryList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_APIGroupDiscoveryList.Merge(m, src)
+}
+func (m *APIGroupDiscoveryList) XXX_Size() int {
+ return m.Size()
+}
+func (m *APIGroupDiscoveryList) XXX_DiscardUnknown() {
+ xxx_messageInfo_APIGroupDiscoveryList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_APIGroupDiscoveryList proto.InternalMessageInfo
+
+func (m *APIResourceDiscovery) Reset() { *m = APIResourceDiscovery{} }
+func (*APIResourceDiscovery) ProtoMessage() {}
+func (*APIResourceDiscovery) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e0b7287280068d8f, []int{2}
+}
+func (m *APIResourceDiscovery) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *APIResourceDiscovery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *APIResourceDiscovery) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_APIResourceDiscovery.Merge(m, src)
+}
+func (m *APIResourceDiscovery) XXX_Size() int {
+ return m.Size()
+}
+func (m *APIResourceDiscovery) XXX_DiscardUnknown() {
+ xxx_messageInfo_APIResourceDiscovery.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_APIResourceDiscovery proto.InternalMessageInfo
+
+func (m *APISubresourceDiscovery) Reset() { *m = APISubresourceDiscovery{} }
+func (*APISubresourceDiscovery) ProtoMessage() {}
+func (*APISubresourceDiscovery) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e0b7287280068d8f, []int{3}
+}
+func (m *APISubresourceDiscovery) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *APISubresourceDiscovery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *APISubresourceDiscovery) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_APISubresourceDiscovery.Merge(m, src)
+}
+func (m *APISubresourceDiscovery) XXX_Size() int {
+ return m.Size()
+}
+func (m *APISubresourceDiscovery) XXX_DiscardUnknown() {
+ xxx_messageInfo_APISubresourceDiscovery.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_APISubresourceDiscovery proto.InternalMessageInfo
+
+func (m *APIVersionDiscovery) Reset() { *m = APIVersionDiscovery{} }
+func (*APIVersionDiscovery) ProtoMessage() {}
+func (*APIVersionDiscovery) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e0b7287280068d8f, []int{4}
+}
+func (m *APIVersionDiscovery) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *APIVersionDiscovery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *APIVersionDiscovery) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_APIVersionDiscovery.Merge(m, src)
+}
+func (m *APIVersionDiscovery) XXX_Size() int {
+ return m.Size()
+}
+func (m *APIVersionDiscovery) XXX_DiscardUnknown() {
+ xxx_messageInfo_APIVersionDiscovery.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_APIVersionDiscovery proto.InternalMessageInfo
+
+func init() {
+ proto.RegisterType((*APIGroupDiscovery)(nil), "k8s.io.api.apidiscovery.v2.APIGroupDiscovery")
+ proto.RegisterType((*APIGroupDiscoveryList)(nil), "k8s.io.api.apidiscovery.v2.APIGroupDiscoveryList")
+ proto.RegisterType((*APIResourceDiscovery)(nil), "k8s.io.api.apidiscovery.v2.APIResourceDiscovery")
+ proto.RegisterType((*APISubresourceDiscovery)(nil), "k8s.io.api.apidiscovery.v2.APISubresourceDiscovery")
+ proto.RegisterType((*APIVersionDiscovery)(nil), "k8s.io.api.apidiscovery.v2.APIVersionDiscovery")
+}
+
+func init() {
+ proto.RegisterFile("k8s.io/api/apidiscovery/v2/generated.proto", fileDescriptor_e0b7287280068d8f)
+}
+
+var fileDescriptor_e0b7287280068d8f = []byte{
+ // 736 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x4e, 0xdb, 0x4c,
+ 0x14, 0x8d, 0x09, 0xf9, 0x48, 0x26, 0xc9, 0xd7, 0x30, 0x80, 0x6a, 0x65, 0xe1, 0xa0, 0x6c, 0x4a,
+ 0xab, 0x32, 0x86, 0x94, 0xa2, 0x2e, 0x9b, 0x94, 0xb6, 0x8a, 0xfa, 0x87, 0x26, 0x15, 0x8b, 0xaa,
+ 0x95, 0xea, 0x38, 0x83, 0xe3, 0x82, 0x7f, 0x34, 0xe3, 0x44, 0x62, 0xd7, 0x47, 0xe8, 0x13, 0xf4,
+ 0x79, 0xe8, 0x8e, 0x05, 0x0b, 0x56, 0x51, 0x49, 0x77, 0x7d, 0x04, 0x56, 0xd5, 0x8c, 0xc7, 0x3f,
+ 0x21, 0x44, 0x41, 0x5d, 0x74, 0x81, 0x84, 0xcf, 0x9c, 0x73, 0xee, 0x3d, 0xd7, 0xd7, 0x13, 0xf0,
+ 0xe0, 0xe8, 0x09, 0x43, 0xb6, 0xa7, 0x1b, 0xbe, 0xcd, 0xff, 0x7a, 0x36, 0x33, 0xbd, 0x21, 0xa1,
+ 0x27, 0xfa, 0xb0, 0xa1, 0x5b, 0xc4, 0x25, 0xd4, 0x08, 0x48, 0x0f, 0xf9, 0xd4, 0x0b, 0x3c, 0x58,
+ 0x0d, 0xb9, 0xc8, 0xf0, 0x6d, 0x94, 0xe6, 0xa2, 0x61, 0xa3, 0xba, 0x69, 0xd9, 0x41, 0x7f, 0xd0,
+ 0x45, 0xa6, 0xe7, 0xe8, 0x96, 0x67, 0x79, 0xba, 0x90, 0x74, 0x07, 0x87, 0xe2, 0x49, 0x3c, 0x88,
+ 0xff, 0x42, 0xab, 0xea, 0x4e, 0x52, 0xd6, 0x31, 0xcc, 0xbe, 0xed, 0xf2, 0x92, 0xfe, 0x91, 0xc5,
+ 0x01, 0xa6, 0x3b, 0x24, 0x30, 0xf4, 0xe1, 0xf6, 0xf5, 0x06, 0xaa, 0xfa, 0x2c, 0x15, 0x1d, 0xb8,
+ 0x81, 0xed, 0x90, 0x29, 0xc1, 0xee, 0x3c, 0x01, 0x33, 0xfb, 0xc4, 0x31, 0xae, 0xeb, 0xea, 0xe7,
+ 0x0a, 0x58, 0x6e, 0xee, 0xb7, 0x5f, 0x52, 0x6f, 0xe0, 0xef, 0x45, 0x31, 0xe1, 0x67, 0x90, 0xe7,
+ 0x9d, 0xf5, 0x8c, 0xc0, 0x50, 0x95, 0x75, 0x65, 0xa3, 0xd8, 0xd8, 0x42, 0xc9, 0x48, 0xe2, 0x02,
+ 0xc8, 0x3f, 0xb2, 0x38, 0xc0, 0x10, 0x67, 0xa3, 0xe1, 0x36, 0x7a, 0xd7, 0xfd, 0x42, 0xcc, 0xe0,
+ 0x0d, 0x09, 0x8c, 0x16, 0x3c, 0x1d, 0xd5, 0x32, 0xe3, 0x51, 0x0d, 0x24, 0x18, 0x8e, 0x5d, 0xe1,
+ 0x27, 0x90, 0x1f, 0x12, 0xca, 0x6c, 0xcf, 0x65, 0xea, 0xc2, 0x7a, 0x76, 0xa3, 0xd8, 0xd0, 0xd1,
+ 0xec, 0xa1, 0xa3, 0xe6, 0x7e, 0xfb, 0x20, 0xa4, 0xc7, 0x4d, 0xb6, 0x2a, 0xb2, 0x40, 0x5e, 0x9e,
+ 0x30, 0x1c, 0x5b, 0xd6, 0x7f, 0x28, 0x60, 0x6d, 0x2a, 0xd6, 0x6b, 0x9b, 0x05, 0xf0, 0xe3, 0x54,
+ 0x34, 0x74, 0xbb, 0x68, 0x5c, 0x2d, 0x82, 0xc5, 0x75, 0x23, 0x24, 0x15, 0x0b, 0x83, 0x9c, 0x1d,
+ 0x10, 0x27, 0xca, 0xb4, 0x39, 0x27, 0xd3, 0x64, 0x7f, 0xad, 0xb2, 0x74, 0xce, 0xb5, 0xb9, 0x07,
+ 0x0e, 0xad, 0xea, 0xdf, 0x17, 0xc1, 0x6a, 0x73, 0xbf, 0x8d, 0x09, 0xf3, 0x06, 0xd4, 0x24, 0xc9,
+ 0x5b, 0x7a, 0x08, 0xf2, 0x54, 0x82, 0x22, 0x4a, 0x21, 0x69, 0x2d, 0x22, 0xe3, 0x98, 0x01, 0x8f,
+ 0x41, 0x89, 0x12, 0xe6, 0x7b, 0x2e, 0x23, 0xaf, 0x6c, 0xb7, 0xa7, 0x2e, 0x88, 0xf0, 0xbb, 0xb7,
+ 0x0b, 0x2f, 0x1a, 0x95, 0x73, 0xe6, 0xea, 0x56, 0x65, 0x3c, 0xaa, 0x95, 0x70, 0xca, 0x0f, 0x4f,
+ 0xb8, 0xc3, 0x1d, 0x90, 0x63, 0xa6, 0xe7, 0x13, 0x35, 0x2b, 0x1a, 0xd3, 0xa2, 0x64, 0x1d, 0x0e,
+ 0x5e, 0x8d, 0x6a, 0xe5, 0xa8, 0x43, 0x01, 0xe0, 0x90, 0x0c, 0xf7, 0x40, 0x85, 0xd9, 0xae, 0x35,
+ 0x38, 0x36, 0x68, 0x74, 0xae, 0x2e, 0x0a, 0x03, 0x55, 0x1a, 0x54, 0x3a, 0xd7, 0xce, 0xf1, 0x94,
+ 0x02, 0xd6, 0x40, 0x6e, 0x48, 0x68, 0x97, 0xa9, 0xb9, 0xf5, 0xec, 0x46, 0xa1, 0x55, 0xe0, 0x75,
+ 0x0f, 0x38, 0x80, 0x43, 0x1c, 0x22, 0x00, 0x58, 0xdf, 0xa3, 0xc1, 0x5b, 0xc3, 0x21, 0x4c, 0xfd,
+ 0x4f, 0xb0, 0xfe, 0xe7, 0xab, 0xda, 0x89, 0x51, 0x9c, 0x62, 0x70, 0xbe, 0x69, 0x04, 0xc4, 0xf2,
+ 0xa8, 0x4d, 0x98, 0xba, 0x94, 0xf0, 0x9f, 0xc5, 0x28, 0x4e, 0x31, 0xa0, 0x03, 0x4a, 0x6c, 0xd0,
+ 0x8d, 0x26, 0xcf, 0xd4, 0xbc, 0x58, 0x86, 0x47, 0x73, 0x96, 0xa1, 0x93, 0x48, 0x92, 0x95, 0x58,
+ 0x95, 0xb9, 0x4b, 0xa9, 0x53, 0x86, 0x27, 0xec, 0xeb, 0xe7, 0x0b, 0xe0, 0xee, 0x0c, 0x3d, 0x7c,
+ 0x0c, 0x8a, 0x29, 0xae, 0x5c, 0x93, 0x15, 0x69, 0x5a, 0x4c, 0x49, 0x70, 0x9a, 0xf7, 0x8f, 0x97,
+ 0x85, 0x81, 0xb2, 0x61, 0x9a, 0xc4, 0x0f, 0x48, 0xef, 0xfd, 0x89, 0x4f, 0x98, 0x9a, 0x15, 0x03,
+ 0xfb, 0xdb, 0x72, 0x6b, 0x32, 0x5e, 0xb9, 0x99, 0x36, 0xc5, 0x93, 0x35, 0x92, 0x2d, 0x59, 0xbc,
+ 0x79, 0x4b, 0xea, 0xbf, 0x15, 0xb0, 0x72, 0xc3, 0xbd, 0x03, 0xef, 0x83, 0x25, 0x79, 0xcf, 0xc8,
+ 0x71, 0xde, 0x91, 0xf5, 0x96, 0x24, 0x15, 0x47, 0xe7, 0xd0, 0x00, 0x85, 0x64, 0x0b, 0xc2, 0x2b,
+ 0x61, 0x6b, 0xce, 0x16, 0x4c, 0x7d, 0xe6, 0xad, 0x65, 0x69, 0x5f, 0xc0, 0xf1, 0xfb, 0x4f, 0x5c,
+ 0xe1, 0x73, 0x50, 0x38, 0xa4, 0x84, 0xf5, 0x5d, 0xc2, 0x98, 0xfc, 0xd8, 0xee, 0x45, 0x82, 0x17,
+ 0xd1, 0xc1, 0xd5, 0xa8, 0x06, 0x63, 0xc3, 0x18, 0xc5, 0x89, 0xb2, 0xf5, 0xf4, 0xf4, 0x52, 0xcb,
+ 0x9c, 0x5d, 0x6a, 0x99, 0x8b, 0x4b, 0x2d, 0xf3, 0x75, 0xac, 0x29, 0xa7, 0x63, 0x4d, 0x39, 0x1b,
+ 0x6b, 0xca, 0xc5, 0x58, 0x53, 0x7e, 0x8e, 0x35, 0xe5, 0xdb, 0x2f, 0x2d, 0xf3, 0xa1, 0x3a, 0xfb,
+ 0x37, 0xf4, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x35, 0x6a, 0x0f, 0x60, 0x07, 0x00, 0x00,
+}
+
+func (m *APIGroupDiscovery) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *APIGroupDiscovery) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *APIGroupDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Versions) > 0 {
+ for iNdEx := len(m.Versions) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Versions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *APIGroupDiscoveryList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *APIGroupDiscoveryList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *APIGroupDiscoveryList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Items) > 0 {
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *APIResourceDiscovery) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *APIResourceDiscovery) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *APIResourceDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Subresources) > 0 {
+ for iNdEx := len(m.Subresources) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Subresources[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x42
+ }
+ }
+ if len(m.Categories) > 0 {
+ for iNdEx := len(m.Categories) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Categories[iNdEx])
+ copy(dAtA[i:], m.Categories[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Categories[iNdEx])))
+ i--
+ dAtA[i] = 0x3a
+ }
+ }
+ if len(m.ShortNames) > 0 {
+ for iNdEx := len(m.ShortNames) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.ShortNames[iNdEx])
+ copy(dAtA[i:], m.ShortNames[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.ShortNames[iNdEx])))
+ i--
+ dAtA[i] = 0x32
+ }
+ }
+ if len(m.Verbs) > 0 {
+ for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Verbs[iNdEx])
+ copy(dAtA[i:], m.Verbs[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx])))
+ i--
+ dAtA[i] = 0x2a
+ }
+ }
+ i -= len(m.SingularResource)
+ copy(dAtA[i:], m.SingularResource)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.SingularResource)))
+ i--
+ dAtA[i] = 0x22
+ i -= len(m.Scope)
+ copy(dAtA[i:], m.Scope)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Scope)))
+ i--
+ dAtA[i] = 0x1a
+ if m.ResponseKind != nil {
+ {
+ size, err := m.ResponseKind.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ i -= len(m.Resource)
+ copy(dAtA[i:], m.Resource)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *APISubresourceDiscovery) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *APISubresourceDiscovery) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *APISubresourceDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Verbs) > 0 {
+ for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Verbs[iNdEx])
+ copy(dAtA[i:], m.Verbs[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx])))
+ i--
+ dAtA[i] = 0x22
+ }
+ }
+ if len(m.AcceptedTypes) > 0 {
+ for iNdEx := len(m.AcceptedTypes) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.AcceptedTypes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
+ }
+ }
+ if m.ResponseKind != nil {
+ {
+ size, err := m.ResponseKind.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ i -= len(m.Subresource)
+ copy(dAtA[i:], m.Subresource)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subresource)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *APIVersionDiscovery) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *APIVersionDiscovery) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *APIVersionDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.Freshness)
+ copy(dAtA[i:], m.Freshness)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Freshness)))
+ i--
+ dAtA[i] = 0x1a
+ if len(m.Resources) > 0 {
+ for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ i -= len(m.Version)
+ copy(dAtA[i:], m.Version)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ offset -= sovGenerated(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *APIGroupDiscovery) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Versions) > 0 {
+ for _, e := range m.Versions {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *APIGroupDiscoveryList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *APIResourceDiscovery) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Resource)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.ResponseKind != nil {
+ l = m.ResponseKind.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ l = len(m.Scope)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.SingularResource)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Verbs) > 0 {
+ for _, s := range m.Verbs {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ if len(m.ShortNames) > 0 {
+ for _, s := range m.ShortNames {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ if len(m.Categories) > 0 {
+ for _, s := range m.Categories {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ if len(m.Subresources) > 0 {
+ for _, e := range m.Subresources {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *APISubresourceDiscovery) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Subresource)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.ResponseKind != nil {
+ l = m.ResponseKind.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if len(m.AcceptedTypes) > 0 {
+ for _, e := range m.AcceptedTypes {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ if len(m.Verbs) > 0 {
+ for _, s := range m.Verbs {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *APIVersionDiscovery) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Version)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Resources) > 0 {
+ for _, e := range m.Resources {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ l = len(m.Freshness)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func sovGenerated(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozGenerated(x uint64) (n int) {
+ return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (this *APIGroupDiscovery) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForVersions := "[]APIVersionDiscovery{"
+ for _, f := range this.Versions {
+ repeatedStringForVersions += strings.Replace(strings.Replace(f.String(), "APIVersionDiscovery", "APIVersionDiscovery", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForVersions += "}"
+ s := strings.Join([]string{`&APIGroupDiscovery{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Versions:` + repeatedStringForVersions + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *APIGroupDiscoveryList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForItems := "[]APIGroupDiscovery{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "APIGroupDiscovery", "APIGroupDiscovery", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&APIGroupDiscoveryList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *APIResourceDiscovery) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForSubresources := "[]APISubresourceDiscovery{"
+ for _, f := range this.Subresources {
+ repeatedStringForSubresources += strings.Replace(strings.Replace(f.String(), "APISubresourceDiscovery", "APISubresourceDiscovery", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForSubresources += "}"
+ s := strings.Join([]string{`&APIResourceDiscovery{`,
+ `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`,
+ `ResponseKind:` + strings.Replace(fmt.Sprintf("%v", this.ResponseKind), "GroupVersionKind", "v1.GroupVersionKind", 1) + `,`,
+ `Scope:` + fmt.Sprintf("%v", this.Scope) + `,`,
+ `SingularResource:` + fmt.Sprintf("%v", this.SingularResource) + `,`,
+ `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`,
+ `ShortNames:` + fmt.Sprintf("%v", this.ShortNames) + `,`,
+ `Categories:` + fmt.Sprintf("%v", this.Categories) + `,`,
+ `Subresources:` + repeatedStringForSubresources + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *APISubresourceDiscovery) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForAcceptedTypes := "[]GroupVersionKind{"
+ for _, f := range this.AcceptedTypes {
+ repeatedStringForAcceptedTypes += fmt.Sprintf("%v", f) + ","
+ }
+ repeatedStringForAcceptedTypes += "}"
+ s := strings.Join([]string{`&APISubresourceDiscovery{`,
+ `Subresource:` + fmt.Sprintf("%v", this.Subresource) + `,`,
+ `ResponseKind:` + strings.Replace(fmt.Sprintf("%v", this.ResponseKind), "GroupVersionKind", "v1.GroupVersionKind", 1) + `,`,
+ `AcceptedTypes:` + repeatedStringForAcceptedTypes + `,`,
+ `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *APIVersionDiscovery) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForResources := "[]APIResourceDiscovery{"
+ for _, f := range this.Resources {
+ repeatedStringForResources += strings.Replace(strings.Replace(f.String(), "APIResourceDiscovery", "APIResourceDiscovery", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForResources += "}"
+ s := strings.Join([]string{`&APIVersionDiscovery{`,
+ `Version:` + fmt.Sprintf("%v", this.Version) + `,`,
+ `Resources:` + repeatedStringForResources + `,`,
+ `Freshness:` + fmt.Sprintf("%v", this.Freshness) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
+}
+func (m *APIGroupDiscovery) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: APIGroupDiscovery: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: APIGroupDiscovery: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Versions = append(m.Versions, APIVersionDiscovery{})
+ if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *APIGroupDiscoveryList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: APIGroupDiscoveryList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: APIGroupDiscoveryList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, APIGroupDiscovery{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *APIResourceDiscovery) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: APIResourceDiscovery: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: APIResourceDiscovery: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Resource = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ResponseKind", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.ResponseKind == nil {
+ m.ResponseKind = &v1.GroupVersionKind{}
+ }
+ if err := m.ResponseKind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Scope = ResourceScope(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SingularResource", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.SingularResource = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Verbs", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ShortNames", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ShortNames = append(m.ShortNames, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Categories", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Categories = append(m.Categories, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 8:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Subresources", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Subresources = append(m.Subresources, APISubresourceDiscovery{})
+ if err := m.Subresources[len(m.Subresources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *APISubresourceDiscovery) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: APISubresourceDiscovery: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: APISubresourceDiscovery: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Subresource", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Subresource = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ResponseKind", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.ResponseKind == nil {
+ m.ResponseKind = &v1.GroupVersionKind{}
+ }
+ if err := m.ResponseKind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AcceptedTypes", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.AcceptedTypes = append(m.AcceptedTypes, v1.GroupVersionKind{})
+ if err := m.AcceptedTypes[len(m.AcceptedTypes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Verbs", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *APIVersionDiscovery) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: APIVersionDiscovery: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: APIVersionDiscovery: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Version = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Resources = append(m.Resources, APIResourceDiscovery{})
+ if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Freshness", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Freshness = DiscoveryFreshness(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipGenerated(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ depth := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ case 1:
+ iNdEx += 8
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if length < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ iNdEx += length
+ case 3:
+ depth++
+ case 4:
+ if depth == 0 {
+ return 0, ErrUnexpectedEndOfGroupGenerated
+ }
+ depth--
+ case 5:
+ iNdEx += 4
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ if depth == 0 {
+ return iNdEx, nil
+ }
+ }
+ return 0, io.ErrUnexpectedEOF
+}
+
+var (
+ ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
+ ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
+)
diff --git a/vendor/k8s.io/api/apidiscovery/v2/generated.proto b/vendor/k8s.io/api/apidiscovery/v2/generated.proto
new file mode 100644
index 00000000000..62f2d7f2c11
--- /dev/null
+++ b/vendor/k8s.io/api/apidiscovery/v2/generated.proto
@@ -0,0 +1,156 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+// This file was autogenerated by go-to-protobuf. Do not edit it manually!
+
+syntax = "proto2";
+
+package k8s.io.api.apidiscovery.v2;
+
+import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
+
+// Package-wide variables from generator "generated".
+option go_package = "k8s.io/api/apidiscovery/v2";
+
+// APIGroupDiscovery holds information about which resources are being served for all version of the API Group.
+// It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version.
+// Versions are in descending order of preference, with the first version being the preferred entry.
+message APIGroupDiscovery {
+ // Standard object's metadata.
+ // The only field completed will be name. For instance, resourceVersion will be empty.
+ // name is the name of the API group whose discovery information is presented here.
+ // name is allowed to be "" to represent the legacy, ungroupified resources.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // versions are the versions supported in this group. They are sorted in descending order of preference,
+ // with the preferred version being the first entry.
+ // +listType=map
+ // +listMapKey=version
+ repeated APIVersionDiscovery versions = 2;
+}
+
+// APIGroupDiscoveryList is a resource containing a list of APIGroupDiscovery.
+// This is one of the types able to be returned from the /api and /apis endpoint and contains an aggregated
+// list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers)
+// that a cluster supports.
+message APIGroupDiscoveryList {
+ // ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // items is the list of groups for discovery. The groups are listed in priority order.
+ repeated APIGroupDiscovery items = 2;
+}
+
+// APIResourceDiscovery provides information about an API resource for discovery.
+message APIResourceDiscovery {
+ // resource is the plural name of the resource. This is used in the URL path and is the unique identifier
+ // for this resource across all versions in the API group.
+ // Resources with non-empty groups are located at /apis///
+ // Resources with empty groups are located at /api/v1/
+ optional string resource = 1;
+
+ // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
+ // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior.
+ // This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2;
+
+ // scope indicates the scope of a resource, either Cluster or Namespaced
+ optional string scope = 3;
+
+ // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely.
+ // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence.
+ // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals.
+ // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name.
+ optional string singularResource = 4;
+
+ // verbs is a list of supported API operation types (this includes
+ // but is not limited to get, list, watch, create, update, patch,
+ // delete, deletecollection, and proxy).
+ // +listType=set
+ repeated string verbs = 5;
+
+ // shortNames is a list of suggested short names of the resource.
+ // +listType=set
+ repeated string shortNames = 6;
+
+ // categories is a list of the grouped resources this resource belongs to (e.g. 'all').
+ // Clients may use this to simplify acting on multiple resource types at once.
+ // +listType=set
+ repeated string categories = 7;
+
+ // subresources is a list of subresources provided by this resource. Subresources are located at /apis////name-of-instance/
+ // +listType=map
+ // +listMapKey=subresource
+ repeated APISubresourceDiscovery subresources = 8;
+}
+
+// APISubresourceDiscovery provides information about an API subresource for discovery.
+message APISubresourceDiscovery {
+ // subresource is the name of the subresource. This is used in the URL path and is the unique identifier
+ // for this resource across all versions.
+ optional string subresource = 1;
+
+ // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
+ // Some subresources do not return normal resources, these will have null or empty return types.
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2;
+
+ // acceptedTypes describes the kinds that this endpoint accepts.
+ // Subresources may accept the standard content types or define
+ // custom negotiation schemes. The list may not be exhaustive for
+ // all operations.
+ // +listType=map
+ // +listMapKey=group
+ // +listMapKey=version
+ // +listMapKey=kind
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind acceptedTypes = 3;
+
+ // verbs is a list of supported API operation types (this includes
+ // but is not limited to get, list, watch, create, update, patch,
+ // delete, deletecollection, and proxy). Subresources may define
+ // custom verbs outside the standard Kubernetes verb set. Clients
+ // should expect the behavior of standard verbs to align with
+ // Kubernetes interaction conventions.
+ // +listType=set
+ repeated string verbs = 4;
+}
+
+// APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group.
+message APIVersionDiscovery {
+ // version is the name of the version within a group version.
+ optional string version = 1;
+
+ // resources is a list of APIResourceDiscovery objects for the corresponding group version.
+ // +listType=map
+ // +listMapKey=resource
+ repeated APIResourceDiscovery resources = 2;
+
+ // freshness marks whether a group version's discovery document is up to date.
+ // "Current" indicates the discovery document was recently
+ // refreshed. "Stale" indicates the discovery document could not
+ // be retrieved and the returned discovery document may be
+ // significantly out of date. Clients that require the latest
+ // version of the discovery information be retrieved before
+ // performing an operation should not use the aggregated document
+ optional string freshness = 3;
+}
+
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/register.go b/vendor/k8s.io/api/apidiscovery/v2/register.go
similarity index 73%
rename from vendor/k8s.io/apiserver/pkg/apis/config/register.go
rename to vendor/k8s.io/api/apidiscovery/v2/register.go
index 6a0aae8e560..dd759defce5 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/config/register.go
+++ b/vendor/k8s.io/api/apidiscovery/v2/register.go
@@ -1,5 +1,5 @@
/*
-Copyright 2018 The Kubernetes Authors.
+Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,40 +14,43 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package config
+package v2
import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
-var (
- // SchemeBuilder points to a list of functions added to Scheme.
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- // AddToScheme adds this group to a scheme.
- AddToScheme = SchemeBuilder.AddToScheme
-)
-
-// GroupName is the group name use in this package.
-const GroupName = "apiserver.config.k8s.io"
+// GroupName is the group name for this API.
+const GroupName = "apidiscovery.k8s.io"
-// SchemeGroupVersion is group version used to register these objects.
-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2"}
-// Kind takes an unqualified kind and returns a Group qualified GroupKind.
+// Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
-// Resource takes an unqualified resource and returns a Group qualified GroupResource.
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
+var (
+ // SchemeBuilder installs the api group to a scheme
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ // AddToScheme adds api to a scheme
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
- // TODO this will get cleaned up with the scheme types are fixed
scheme.AddKnownTypes(SchemeGroupVersion,
- &EncryptionConfiguration{},
+ &APIGroupDiscoveryList{},
+ &APIGroupDiscovery{},
)
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
diff --git a/vendor/k8s.io/api/apidiscovery/v2/types.go b/vendor/k8s.io/api/apidiscovery/v2/types.go
new file mode 100644
index 00000000000..449679b61d0
--- /dev/null
+++ b/vendor/k8s.io/api/apidiscovery/v2/types.go
@@ -0,0 +1,157 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v2
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.30
+
+// APIGroupDiscoveryList is a resource containing a list of APIGroupDiscovery.
+// This is one of the types able to be returned from the /api and /apis endpoint and contains an aggregated
+// list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers)
+// that a cluster supports.
+type APIGroupDiscoveryList struct {
+ v1.TypeMeta `json:",inline"`
+ // ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // items is the list of groups for discovery. The groups are listed in priority order.
+ Items []APIGroupDiscovery `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.30
+
+// APIGroupDiscovery holds information about which resources are being served for all version of the API Group.
+// It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version.
+// Versions are in descending order of preference, with the first version being the preferred entry.
+type APIGroupDiscovery struct {
+ v1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // The only field completed will be name. For instance, resourceVersion will be empty.
+ // name is the name of the API group whose discovery information is presented here.
+ // name is allowed to be "" to represent the legacy, ungroupified resources.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // versions are the versions supported in this group. They are sorted in descending order of preference,
+ // with the preferred version being the first entry.
+ // +listType=map
+ // +listMapKey=version
+ Versions []APIVersionDiscovery `json:"versions,omitempty" protobuf:"bytes,2,rep,name=versions"`
+}
+
+// APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group.
+type APIVersionDiscovery struct {
+ // version is the name of the version within a group version.
+ Version string `json:"version" protobuf:"bytes,1,opt,name=version"`
+ // resources is a list of APIResourceDiscovery objects for the corresponding group version.
+ // +listType=map
+ // +listMapKey=resource
+ Resources []APIResourceDiscovery `json:"resources,omitempty" protobuf:"bytes,2,rep,name=resources"`
+ // freshness marks whether a group version's discovery document is up to date.
+ // "Current" indicates the discovery document was recently
+ // refreshed. "Stale" indicates the discovery document could not
+ // be retrieved and the returned discovery document may be
+ // significantly out of date. Clients that require the latest
+ // version of the discovery information be retrieved before
+ // performing an operation should not use the aggregated document
+ Freshness DiscoveryFreshness `json:"freshness,omitempty" protobuf:"bytes,3,opt,name=freshness"`
+}
+
+// APIResourceDiscovery provides information about an API resource for discovery.
+type APIResourceDiscovery struct {
+ // resource is the plural name of the resource. This is used in the URL path and is the unique identifier
+ // for this resource across all versions in the API group.
+ // Resources with non-empty groups are located at /apis///
+ // Resources with empty groups are located at /api/v1/
+ Resource string `json:"resource" protobuf:"bytes,1,opt,name=resource"`
+ // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
+ // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior.
+ // This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource
+ ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"`
+ // scope indicates the scope of a resource, either Cluster or Namespaced
+ Scope ResourceScope `json:"scope" protobuf:"bytes,3,opt,name=scope"`
+ // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely.
+ // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence.
+ // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals.
+ // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name.
+ SingularResource string `json:"singularResource" protobuf:"bytes,4,opt,name=singularResource"`
+ // verbs is a list of supported API operation types (this includes
+ // but is not limited to get, list, watch, create, update, patch,
+ // delete, deletecollection, and proxy).
+ // +listType=set
+ Verbs []string `json:"verbs" protobuf:"bytes,5,opt,name=verbs"`
+ // shortNames is a list of suggested short names of the resource.
+ // +listType=set
+ ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,6,rep,name=shortNames"`
+ // categories is a list of the grouped resources this resource belongs to (e.g. 'all').
+ // Clients may use this to simplify acting on multiple resource types at once.
+ // +listType=set
+ Categories []string `json:"categories,omitempty" protobuf:"bytes,7,rep,name=categories"`
+ // subresources is a list of subresources provided by this resource. Subresources are located at /apis////name-of-instance/
+ // +listType=map
+ // +listMapKey=subresource
+ Subresources []APISubresourceDiscovery `json:"subresources,omitempty" protobuf:"bytes,8,rep,name=subresources"`
+}
+
+// ResourceScope is an enum defining the different scopes available to a resource.
+type ResourceScope string
+
+const (
+ ScopeCluster ResourceScope = "Cluster"
+ ScopeNamespace ResourceScope = "Namespaced"
+)
+
+// DiscoveryFreshness is an enum defining whether the Discovery document published by an apiservice is up to date (fresh).
+type DiscoveryFreshness string
+
+const (
+ DiscoveryFreshnessCurrent DiscoveryFreshness = "Current"
+ DiscoveryFreshnessStale DiscoveryFreshness = "Stale"
+)
+
+// APISubresourceDiscovery provides information about an API subresource for discovery.
+type APISubresourceDiscovery struct {
+ // subresource is the name of the subresource. This is used in the URL path and is the unique identifier
+ // for this resource across all versions.
+ Subresource string `json:"subresource" protobuf:"bytes,1,opt,name=subresource"`
+ // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
+ // Some subresources do not return normal resources, these will have null or empty return types.
+ ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"`
+ // acceptedTypes describes the kinds that this endpoint accepts.
+ // Subresources may accept the standard content types or define
+ // custom negotiation schemes. The list may not be exhaustive for
+ // all operations.
+ // +listType=map
+ // +listMapKey=group
+ // +listMapKey=version
+ // +listMapKey=kind
+ AcceptedTypes []v1.GroupVersionKind `json:"acceptedTypes,omitempty" protobuf:"bytes,3,rep,name=acceptedTypes"`
+ // verbs is a list of supported API operation types (this includes
+ // but is not limited to get, list, watch, create, update, patch,
+ // delete, deletecollection, and proxy). Subresources may define
+ // custom verbs outside the standard Kubernetes verb set. Clients
+ // should expect the behavior of standard verbs to align with
+ // Kubernetes interaction conventions.
+ // +listType=set
+ Verbs []string `json:"verbs" protobuf:"bytes,4,opt,name=verbs"`
+}
diff --git a/vendor/k8s.io/api/apidiscovery/v2/zz_generated.deepcopy.go b/vendor/k8s.io/api/apidiscovery/v2/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..029aeeab8c8
--- /dev/null
+++ b/vendor/k8s.io/api/apidiscovery/v2/zz_generated.deepcopy.go
@@ -0,0 +1,190 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package v2
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *APIGroupDiscovery) DeepCopyInto(out *APIGroupDiscovery) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Versions != nil {
+ in, out := &in.Versions, &out.Versions
+ *out = make([]APIVersionDiscovery, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIGroupDiscovery.
+func (in *APIGroupDiscovery) DeepCopy() *APIGroupDiscovery {
+ if in == nil {
+ return nil
+ }
+ out := new(APIGroupDiscovery)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *APIGroupDiscovery) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *APIGroupDiscoveryList) DeepCopyInto(out *APIGroupDiscoveryList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]APIGroupDiscovery, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIGroupDiscoveryList.
+func (in *APIGroupDiscoveryList) DeepCopy() *APIGroupDiscoveryList {
+ if in == nil {
+ return nil
+ }
+ out := new(APIGroupDiscoveryList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *APIGroupDiscoveryList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *APIResourceDiscovery) DeepCopyInto(out *APIResourceDiscovery) {
+ *out = *in
+ if in.ResponseKind != nil {
+ in, out := &in.ResponseKind, &out.ResponseKind
+ *out = new(v1.GroupVersionKind)
+ **out = **in
+ }
+ if in.Verbs != nil {
+ in, out := &in.Verbs, &out.Verbs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.ShortNames != nil {
+ in, out := &in.ShortNames, &out.ShortNames
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Categories != nil {
+ in, out := &in.Categories, &out.Categories
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Subresources != nil {
+ in, out := &in.Subresources, &out.Subresources
+ *out = make([]APISubresourceDiscovery, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceDiscovery.
+func (in *APIResourceDiscovery) DeepCopy() *APIResourceDiscovery {
+ if in == nil {
+ return nil
+ }
+ out := new(APIResourceDiscovery)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *APISubresourceDiscovery) DeepCopyInto(out *APISubresourceDiscovery) {
+ *out = *in
+ if in.ResponseKind != nil {
+ in, out := &in.ResponseKind, &out.ResponseKind
+ *out = new(v1.GroupVersionKind)
+ **out = **in
+ }
+ if in.AcceptedTypes != nil {
+ in, out := &in.AcceptedTypes, &out.AcceptedTypes
+ *out = make([]v1.GroupVersionKind, len(*in))
+ copy(*out, *in)
+ }
+ if in.Verbs != nil {
+ in, out := &in.Verbs, &out.Verbs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APISubresourceDiscovery.
+func (in *APISubresourceDiscovery) DeepCopy() *APISubresourceDiscovery {
+ if in == nil {
+ return nil
+ }
+ out := new(APISubresourceDiscovery)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *APIVersionDiscovery) DeepCopyInto(out *APIVersionDiscovery) {
+ *out = *in
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]APIResourceDiscovery, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIVersionDiscovery.
+func (in *APIVersionDiscovery) DeepCopy() *APIVersionDiscovery {
+ if in == nil {
+ return nil
+ }
+ out := new(APIVersionDiscovery)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/vendor/k8s.io/api/apidiscovery/v2/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/apidiscovery/v2/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..b7132c647d0
--- /dev/null
+++ b/vendor/k8s.io/api/apidiscovery/v2/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v2
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *APIGroupDiscovery) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *APIGroupDiscoveryList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto b/vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto
index a09af750ba3..e9ae88072a5 100644
--- a/vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto
+++ b/vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto
@@ -38,7 +38,7 @@ message APIGroupDiscovery {
// name is allowed to be "" to represent the legacy, ungroupified resources.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// versions are the versions supported in this group. They are sorted in descending order of preference,
// with the preferred version being the first entry.
@@ -55,7 +55,7 @@ message APIGroupDiscoveryList {
// ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of groups for discovery. The groups are listed in priority order.
repeated APIGroupDiscovery items = 2;
@@ -72,7 +72,7 @@ message APIResourceDiscovery {
// responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
// APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior.
// This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2;
// scope indicates the scope of a resource, either Cluster or Namespaced
optional string scope = 3;
@@ -112,7 +112,7 @@ message APISubresourceDiscovery {
// responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns.
// Some subresources do not return normal resources, these will have null or empty return types.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2;
// acceptedTypes describes the kinds that this endpoint accepts.
// Subresources may accept the standard content types or define
@@ -122,7 +122,7 @@ message APISubresourceDiscovery {
// +listMapKey=group
// +listMapKey=version
// +listMapKey=kind
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind acceptedTypes = 3;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind acceptedTypes = 3;
// verbs is a list of supported API operation types (this includes
// but is not limited to get, list, watch, create, update, patch,
diff --git a/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto b/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto
index ef442904802..8a77860720f 100644
--- a/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto
@@ -52,7 +52,7 @@ message ServerStorageVersion {
// Storage version of a specific resource.
message StorageVersion {
// The name is ..
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec is an empty spec. It is here to comply with Kubernetes API style.
optional StorageVersionSpec spec = 2;
@@ -77,7 +77,7 @@ message StorageVersionCondition {
optional int64 observedGeneration = 3;
// Last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// The reason for the condition's last transition.
// +required
@@ -93,7 +93,7 @@ message StorageVersionList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items holds a list of StorageVersion
repeated StorageVersion items = 2;
diff --git a/vendor/k8s.io/api/apps/v1/doc.go b/vendor/k8s.io/api/apps/v1/doc.go
index 61dc97bde52..d189e860f2c 100644
--- a/vendor/k8s.io/api/apps/v1/doc.go
+++ b/vendor/k8s.io/api/apps/v1/doc.go
@@ -17,5 +17,6 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
package v1 // import "k8s.io/api/apps/v1"
diff --git a/vendor/k8s.io/api/apps/v1/generated.proto b/vendor/k8s.io/api/apps/v1/generated.proto
index 90014168615..d864f2eebf2 100644
--- a/vendor/k8s.io/api/apps/v1/generated.proto
+++ b/vendor/k8s.io/api/apps/v1/generated.proto
@@ -43,10 +43,10 @@ message ControllerRevision {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Data is the serialized representation of the state.
- optional k8s.io.apimachinery.pkg.runtime.RawExtension data = 2;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension data = 2;
// Revision indicates the revision of the state represented by Data.
optional int64 revision = 3;
@@ -56,7 +56,7 @@ message ControllerRevision {
message ControllerRevisionList {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of ControllerRevisions
repeated ControllerRevision items = 2;
@@ -67,7 +67,7 @@ message DaemonSet {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The desired behavior of this daemon set.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -93,7 +93,7 @@ message DaemonSetCondition {
// Last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -109,7 +109,7 @@ message DaemonSetList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// A list of daemon sets.
repeated DaemonSet items = 2;
@@ -121,7 +121,7 @@ message DaemonSetSpec {
// Must match in order to be controlled.
// It must match the pod template's labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1;
// An object that describes the pod that will be created.
// The DaemonSet will create exactly one copy of this pod on every node
@@ -129,7 +129,7 @@ message DaemonSetSpec {
// selector is specified).
// The only allowed template.spec.restartPolicy value is "Always".
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
- optional k8s.io.api.core.v1.PodTemplateSpec template = 2;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 2;
// An update strategy to replace existing DaemonSet pods with new pods.
// +optional
@@ -225,7 +225,7 @@ message Deployment {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the Deployment.
// +optional
@@ -245,10 +245,10 @@ message DeploymentCondition {
optional string status = 2;
// The last time this condition was updated.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
// Last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
// The reason for the condition's last transition.
optional string reason = 4;
@@ -261,7 +261,7 @@ message DeploymentCondition {
message DeploymentList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of Deployments.
repeated Deployment items = 2;
@@ -277,11 +277,11 @@ message DeploymentSpec {
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// It must match the pod template's labels.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// Template describes the pods that will be created.
// The only allowed template.spec.restartPolicy value is "Always".
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
// The deployment strategy to use to replace existing pods with new ones.
// +optional
@@ -376,7 +376,7 @@ message ReplicaSet {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the ReplicaSet.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -402,7 +402,7 @@ message ReplicaSetCondition {
// The last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -418,7 +418,7 @@ message ReplicaSetList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ReplicaSets.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
@@ -444,13 +444,13 @@ message ReplicaSetSpec {
// Label keys and values that must match in order to be controlled by this replica set.
// It must match the pod template's labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
// +optional
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
}
// ReplicaSetStatus represents the current status of a ReplicaSet.
@@ -501,7 +501,7 @@ message RollingUpdateDaemonSet {
// 70% of original number of DaemonSet pods are available at all times during
// the update.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of nodes with an existing available DaemonSet pod that
// can have an updated DaemonSet pod during during an update.
@@ -522,7 +522,7 @@ message RollingUpdateDaemonSet {
// so resource intensive daemonsets should take into account that they may
// cause evictions during disruption.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
}
// Spec to control the desired behavior of rolling update.
@@ -538,7 +538,7 @@ message RollingUpdateDeployment {
// that the total number of pods available at all times during the update is at
// least 70% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of pods that can be scheduled above the desired number of
// pods.
@@ -552,7 +552,7 @@ message RollingUpdateDeployment {
// new ReplicaSet can be scaled up further, ensuring that total number of pods running
// at any time during the update is at most 130% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
}
// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
@@ -572,7 +572,7 @@ message RollingUpdateStatefulSetStrategy {
// Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
// will be counted towards MaxUnavailable.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2;
}
// StatefulSet represents a set of pods with consistent identities.
@@ -586,7 +586,7 @@ message StatefulSet {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired identities of pods in this set.
// +optional
@@ -608,7 +608,7 @@ message StatefulSetCondition {
// Last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -624,7 +624,7 @@ message StatefulSetList {
// Standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of stateful sets.
repeated StatefulSet items = 2;
@@ -675,7 +675,7 @@ message StatefulSetSpec {
// selector is a label query over pods that should match the replica count.
// It must match the pod template's labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// template is the object that describes the pod that will be created if
// insufficient replicas are detected. Each pod stamped out by the StatefulSet
@@ -684,7 +684,7 @@ message StatefulSetSpec {
// -. For example, a pod in a StatefulSet named
// "web" with index number "3" would be named "web-3".
// The only allowed template.spec.restartPolicy value is "Always".
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
// volumeClaimTemplates is a list of claims that pods are allowed to reference.
// The StatefulSet controller is responsible for mapping network identities to
@@ -695,7 +695,7 @@ message StatefulSetSpec {
// TODO: Define the behavior if a claim already exists with the same name.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
+ repeated .k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
// serviceName is the name of the service that governs this StatefulSet.
// This service must exist before the StatefulSet, and is responsible for
@@ -738,14 +738,13 @@ message StatefulSetSpec {
// policy allows the lifecycle to be altered, for example by deleting persistent
// volume claims when their stateful set is deleted, or when their pod is scaled
// down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled,
- // which is alpha. +optional
+ // which is beta.
+ // +optional
optional StatefulSetPersistentVolumeClaimRetentionPolicy persistentVolumeClaimRetentionPolicy = 10;
// ordinals controls the numbering of replica indices in a StatefulSet. The
// default ordinals behavior assigns a "0" index to the first replica and
- // increments the index by one for each additional replica requested. Using
- // the ordinals field requires the StatefulSetStartOrdinal feature gate to be
- // enabled, which is beta.
+ // increments the index by one for each additional replica requested.
// +optional
optional StatefulSetOrdinals ordinals = 11;
}
diff --git a/vendor/k8s.io/api/apps/v1/types.go b/vendor/k8s.io/api/apps/v1/types.go
index 96ff6209869..e942cd526ec 100644
--- a/vendor/k8s.io/api/apps/v1/types.go
+++ b/vendor/k8s.io/api/apps/v1/types.go
@@ -37,6 +37,7 @@ const (
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// StatefulSet represents a set of pods with consistent identities.
// Identities are defined as:
@@ -255,14 +256,13 @@ type StatefulSetSpec struct {
// policy allows the lifecycle to be altered, for example by deleting persistent
// volume claims when their stateful set is deleted, or when their pod is scaled
// down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled,
- // which is alpha. +optional
+ // which is beta.
+ // +optional
PersistentVolumeClaimRetentionPolicy *StatefulSetPersistentVolumeClaimRetentionPolicy `json:"persistentVolumeClaimRetentionPolicy,omitempty" protobuf:"bytes,10,opt,name=persistentVolumeClaimRetentionPolicy"`
// ordinals controls the numbering of replica indices in a StatefulSet. The
// default ordinals behavior assigns a "0" index to the first replica and
- // increments the index by one for each additional replica requested. Using
- // the ordinals field requires the StatefulSetStartOrdinal feature gate to be
- // enabled, which is beta.
+ // increments the index by one for each additional replica requested.
// +optional
Ordinals *StatefulSetOrdinals `json:"ordinals,omitempty" protobuf:"bytes,11,opt,name=ordinals"`
}
@@ -335,6 +335,7 @@ type StatefulSetCondition struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// StatefulSetList is a collection of StatefulSets.
type StatefulSetList struct {
@@ -353,6 +354,7 @@ type StatefulSetList struct {
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// Deployment enables declarative updates for Pods and ReplicaSets.
type Deployment struct {
@@ -555,6 +557,7 @@ type DeploymentCondition struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// DeploymentList is a list of Deployments.
type DeploymentList struct {
@@ -747,6 +750,7 @@ type DaemonSetCondition struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// DaemonSet represents the configuration of a daemon set.
type DaemonSet struct {
@@ -778,6 +782,7 @@ const (
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// DaemonSetList is a collection of daemon sets.
type DaemonSetList struct {
@@ -796,6 +801,7 @@ type DaemonSetList struct {
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// ReplicaSet ensures that a specified number of pod replicas are running at any given time.
type ReplicaSet struct {
@@ -823,6 +829,7 @@ type ReplicaSet struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// ReplicaSetList is a collection of ReplicaSets.
type ReplicaSetList struct {
@@ -925,6 +932,7 @@ type ReplicaSetCondition struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// ControllerRevision implements an immutable snapshot of state data. Clients
// are responsible for serializing and deserializing the objects that contain
@@ -950,6 +958,7 @@ type ControllerRevision struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.9
// ControllerRevisionList is a resource containing a list of ControllerRevision objects.
type ControllerRevisionList struct {
diff --git a/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go
index 6676da06403..f3e221a0e95 100644
--- a/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go
@@ -354,8 +354,8 @@ var map_StatefulSetSpec = map[string]string{
"updateStrategy": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.",
"revisionHistoryLimit": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.",
"minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)",
- "persistentVolumeClaimRetentionPolicy": "persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent volume claims created from volumeClaimTemplates. By default, all persistent volume claims are created as needed and retained until manually deleted. This policy allows the lifecycle to be altered, for example by deleting persistent volume claims when their stateful set is deleted, or when their pod is scaled down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha. +optional",
- "ordinals": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is beta.",
+ "persistentVolumeClaimRetentionPolicy": "persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent volume claims created from volumeClaimTemplates. By default, all persistent volume claims are created as needed and retained until manually deleted. This policy allows the lifecycle to be altered, for example by deleting persistent volume claims when their stateful set is deleted, or when their pod is scaled down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is beta.",
+ "ordinals": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested.",
}
func (StatefulSetSpec) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/apps/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/apps/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..34a036b6252
--- /dev/null
+++ b/vendor/k8s.io/api/apps/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,82 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ControllerRevision) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ControllerRevisionList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *DaemonSet) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *DaemonSetList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Deployment) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *DeploymentList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ReplicaSet) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ReplicaSetList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *StatefulSet) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *StatefulSetList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 9
+}
diff --git a/vendor/k8s.io/api/apps/v1beta1/generated.proto b/vendor/k8s.io/api/apps/v1beta1/generated.proto
index 8965622257d..4b0fa366cfa 100644
--- a/vendor/k8s.io/api/apps/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/apps/v1beta1/generated.proto
@@ -45,10 +45,10 @@ message ControllerRevision {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// data is the serialized representation of the state.
- optional k8s.io.apimachinery.pkg.runtime.RawExtension data = 2;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension data = 2;
// revision indicates the revision of the state represented by Data.
optional int64 revision = 3;
@@ -58,7 +58,7 @@ message ControllerRevision {
message ControllerRevisionList {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of ControllerRevisions
repeated ControllerRevision items = 2;
@@ -70,7 +70,7 @@ message ControllerRevisionList {
message Deployment {
// Standard object metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the Deployment.
// +optional
@@ -90,10 +90,10 @@ message DeploymentCondition {
optional string status = 2;
// The last time this condition was updated.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
// Last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
// The reason for the condition's last transition.
optional string reason = 4;
@@ -106,7 +106,7 @@ message DeploymentCondition {
message DeploymentList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of Deployments.
repeated Deployment items = 2;
@@ -136,11 +136,11 @@ message DeploymentSpec {
// selector is the label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// Template describes the pods that will be created.
// The only allowed template.spec.restartPolicy value is "Always".
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
// The deployment strategy to use to replace existing pods with new ones.
// +optional
@@ -254,7 +254,7 @@ message RollingUpdateDeployment {
// that the total number of pods available at all times during the update is at
// least 70% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of pods that can be scheduled above the desired number of
// pods.
@@ -268,7 +268,7 @@ message RollingUpdateDeployment {
// new ReplicaSet can be scaled up further, ensuring that total number of pods running
// at any time during the update is at most 130% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
}
// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
@@ -287,14 +287,14 @@ message RollingUpdateStatefulSetStrategy {
// Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
// will be counted towards MaxUnavailable.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2;
}
// Scale represents a scaling request for a resource.
message Scale {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
// +optional
@@ -342,7 +342,7 @@ message ScaleStatus {
// map to the same storage identity.
message StatefulSet {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired identities of pods in this set.
// +optional
@@ -364,7 +364,7 @@ message StatefulSetCondition {
// Last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -378,7 +378,7 @@ message StatefulSetCondition {
// StatefulSetList is a collection of StatefulSets.
message StatefulSetList {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated StatefulSet items = 2;
}
@@ -429,7 +429,7 @@ message StatefulSetSpec {
// If empty, defaulted to labels on the pod template.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// template is the object that describes the pod that will be created if
// insufficient replicas are detected. Each pod stamped out by the StatefulSet
@@ -437,7 +437,7 @@ message StatefulSetSpec {
// of the StatefulSet. Each pod will be named with the format
// -. For example, a pod in a StatefulSet named
// "web" with index number "3" would be named "web-3".
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
// volumeClaimTemplates is a list of claims that pods are allowed to reference.
// The StatefulSet controller is responsible for mapping network identities to
@@ -448,7 +448,7 @@ message StatefulSetSpec {
// TODO: Define the behavior if a claim already exists with the same name.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
+ repeated .k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
// serviceName is the name of the service that governs this StatefulSet.
// This service must exist before the StatefulSet, and is responsible for
@@ -493,9 +493,7 @@ message StatefulSetSpec {
// ordinals controls the numbering of replica indices in a StatefulSet. The
// default ordinals behavior assigns a "0" index to the first replica and
- // increments the index by one for each additional replica requested. Using
- // the ordinals field requires the StatefulSetStartOrdinal feature gate to be
- // enabled, which is beta.
+ // increments the index by one for each additional replica requested.
// +optional
optional StatefulSetOrdinals ordinals = 11;
}
diff --git a/vendor/k8s.io/api/apps/v1beta1/types.go b/vendor/k8s.io/api/apps/v1beta1/types.go
index bdf9f93a9b7..07bfa88c5f3 100644
--- a/vendor/k8s.io/api/apps/v1beta1/types.go
+++ b/vendor/k8s.io/api/apps/v1beta1/types.go
@@ -297,9 +297,7 @@ type StatefulSetSpec struct {
// ordinals controls the numbering of replica indices in a StatefulSet. The
// default ordinals behavior assigns a "0" index to the first replica and
- // increments the index by one for each additional replica requested. Using
- // the ordinals field requires the StatefulSetStartOrdinal feature gate to be
- // enabled, which is beta.
+ // increments the index by one for each additional replica requested.
// +optional
Ordinals *StatefulSetOrdinals `json:"ordinals,omitempty" protobuf:"bytes,11,opt,name=ordinals"`
}
diff --git a/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go
index a62e9869d68..9e7fb1adc2f 100644
--- a/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go
@@ -259,7 +259,7 @@ var map_StatefulSetSpec = map[string]string{
"revisionHistoryLimit": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.",
"minReadySeconds": "minReadySeconds is the minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)",
"persistentVolumeClaimRetentionPolicy": "PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from the StatefulSet VolumeClaimTemplates. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha.",
- "ordinals": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is beta.",
+ "ordinals": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested.",
}
func (StatefulSetSpec) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/apps/v1beta2/generated.proto b/vendor/k8s.io/api/apps/v1beta2/generated.proto
index 3ae8a80094a..d3db8956e8b 100644
--- a/vendor/k8s.io/api/apps/v1beta2/generated.proto
+++ b/vendor/k8s.io/api/apps/v1beta2/generated.proto
@@ -45,10 +45,10 @@ message ControllerRevision {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Data is the serialized representation of the state.
- optional k8s.io.apimachinery.pkg.runtime.RawExtension data = 2;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension data = 2;
// Revision indicates the revision of the state represented by Data.
optional int64 revision = 3;
@@ -58,7 +58,7 @@ message ControllerRevision {
message ControllerRevisionList {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of ControllerRevisions
repeated ControllerRevision items = 2;
@@ -71,7 +71,7 @@ message DaemonSet {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The desired behavior of this daemon set.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -97,7 +97,7 @@ message DaemonSetCondition {
// Last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -113,7 +113,7 @@ message DaemonSetList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// A list of daemon sets.
repeated DaemonSet items = 2;
@@ -125,7 +125,7 @@ message DaemonSetSpec {
// Must match in order to be controlled.
// It must match the pod template's labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1;
// An object that describes the pod that will be created.
// The DaemonSet will create exactly one copy of this pod on every node
@@ -133,7 +133,7 @@ message DaemonSetSpec {
// selector is specified).
// The only allowed template.spec.restartPolicy value is "Always".
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
- optional k8s.io.api.core.v1.PodTemplateSpec template = 2;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 2;
// An update strategy to replace existing DaemonSet pods with new pods.
// +optional
@@ -230,7 +230,7 @@ message DaemonSetUpdateStrategy {
message Deployment {
// Standard object metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the Deployment.
// +optional
@@ -250,10 +250,10 @@ message DeploymentCondition {
optional string status = 2;
// The last time this condition was updated.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
// Last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
// The reason for the condition's last transition.
optional string reason = 4;
@@ -266,7 +266,7 @@ message DeploymentCondition {
message DeploymentList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of Deployments.
repeated Deployment items = 2;
@@ -282,11 +282,11 @@ message DeploymentSpec {
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// It must match the pod template's labels.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// Template describes the pods that will be created.
// The only allowed template.spec.restartPolicy value is "Always".
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
// The deployment strategy to use to replace existing pods with new ones.
// +optional
@@ -382,7 +382,7 @@ message ReplicaSet {
// be the same as the Pod(s) that the ReplicaSet manages.
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the ReplicaSet.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -408,7 +408,7 @@ message ReplicaSetCondition {
// The last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -424,7 +424,7 @@ message ReplicaSetList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ReplicaSets.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
@@ -450,13 +450,13 @@ message ReplicaSetSpec {
// Label keys and values that must match in order to be controlled by this replica set.
// It must match the pod template's labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
// +optional
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
}
// ReplicaSetStatus represents the current status of a ReplicaSet.
@@ -507,7 +507,7 @@ message RollingUpdateDaemonSet {
// 70% of original number of DaemonSet pods are available at all times during
// the update.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of nodes with an existing available DaemonSet pod that
// can have an updated DaemonSet pod during during an update.
@@ -528,7 +528,7 @@ message RollingUpdateDaemonSet {
// so resource intensive daemonsets should take into account that they may
// cause evictions during disruption.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
}
// Spec to control the desired behavior of rolling update.
@@ -544,7 +544,7 @@ message RollingUpdateDeployment {
// that the total number of pods available at all times during the update is at
// least 70% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of pods that can be scheduled above the desired number of
// pods.
@@ -558,7 +558,7 @@ message RollingUpdateDeployment {
// new ReplicaSet can be scaled up further, ensuring that total number of pods running
// at any time during the update is at most 130% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
}
// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
@@ -578,14 +578,14 @@ message RollingUpdateStatefulSetStrategy {
// Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
// will be counted towards MaxUnavailable.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2;
}
// Scale represents a scaling request for a resource.
message Scale {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
// +optional
@@ -634,7 +634,7 @@ message ScaleStatus {
// map to the same storage identity.
message StatefulSet {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired identities of pods in this set.
// +optional
@@ -656,7 +656,7 @@ message StatefulSetCondition {
// Last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -670,7 +670,7 @@ message StatefulSetCondition {
// StatefulSetList is a collection of StatefulSets.
message StatefulSetList {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated StatefulSet items = 2;
}
@@ -720,7 +720,7 @@ message StatefulSetSpec {
// selector is a label query over pods that should match the replica count.
// It must match the pod template's labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// template is the object that describes the pod that will be created if
// insufficient replicas are detected. Each pod stamped out by the StatefulSet
@@ -729,7 +729,7 @@ message StatefulSetSpec {
// -. For example, a pod in a StatefulSet named
// "web" with index number "3" would be named "web-3".
// The only allowed template.spec.restartPolicy value is "Always".
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
// volumeClaimTemplates is a list of claims that pods are allowed to reference.
// The StatefulSet controller is responsible for mapping network identities to
@@ -740,7 +740,7 @@ message StatefulSetSpec {
// TODO: Define the behavior if a claim already exists with the same name.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
+ repeated .k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
// serviceName is the name of the service that governs this StatefulSet.
// This service must exist before the StatefulSet, and is responsible for
@@ -785,9 +785,7 @@ message StatefulSetSpec {
// ordinals controls the numbering of replica indices in a StatefulSet. The
// default ordinals behavior assigns a "0" index to the first replica and
- // increments the index by one for each additional replica requested. Using
- // the ordinals field requires the StatefulSetStartOrdinal feature gate to be
- // enabled, which is beta.
+ // increments the index by one for each additional replica requested.
// +optional
optional StatefulSetOrdinals ordinals = 11;
}
diff --git a/vendor/k8s.io/api/apps/v1beta2/types.go b/vendor/k8s.io/api/apps/v1beta2/types.go
index 6981c2a1758..f93a5bea7e1 100644
--- a/vendor/k8s.io/api/apps/v1beta2/types.go
+++ b/vendor/k8s.io/api/apps/v1beta2/types.go
@@ -307,9 +307,7 @@ type StatefulSetSpec struct {
// ordinals controls the numbering of replica indices in a StatefulSet. The
// default ordinals behavior assigns a "0" index to the first replica and
- // increments the index by one for each additional replica requested. Using
- // the ordinals field requires the StatefulSetStartOrdinal feature gate to be
- // enabled, which is beta.
+ // increments the index by one for each additional replica requested.
// +optional
Ordinals *StatefulSetOrdinals `json:"ordinals,omitempty" protobuf:"bytes,11,opt,name=ordinals"`
}
diff --git a/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go b/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go
index d7e92099155..0b8fe34af15 100644
--- a/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go
@@ -383,7 +383,7 @@ var map_StatefulSetSpec = map[string]string{
"revisionHistoryLimit": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.",
"minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)",
"persistentVolumeClaimRetentionPolicy": "PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from the StatefulSet VolumeClaimTemplates. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha.",
- "ordinals": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is beta.",
+ "ordinals": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested.",
}
func (StatefulSetSpec) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/authentication/v1/doc.go b/vendor/k8s.io/api/authentication/v1/doc.go
index 1614265bdfa..3bdc89badcd 100644
--- a/vendor/k8s.io/api/authentication/v1/doc.go
+++ b/vendor/k8s.io/api/authentication/v1/doc.go
@@ -18,5 +18,6 @@ limitations under the License.
// +k8s:protobuf-gen=package
// +groupName=authentication.k8s.io
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
package v1 // import "k8s.io/api/authentication/v1"
diff --git a/vendor/k8s.io/api/authentication/v1/generated.proto b/vendor/k8s.io/api/authentication/v1/generated.proto
index 1fe2f4f2cec..ae9763576ca 100644
--- a/vendor/k8s.io/api/authentication/v1/generated.proto
+++ b/vendor/k8s.io/api/authentication/v1/generated.proto
@@ -63,7 +63,7 @@ message SelfSubjectReview {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Status is filled in by the server with the user attributes.
optional SelfSubjectReviewStatus status = 2;
@@ -81,7 +81,7 @@ message TokenRequest {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional TokenRequestSpec spec = 2;
@@ -123,7 +123,7 @@ message TokenRequestStatus {
optional string token = 1;
// ExpirationTimestamp is the time of expiration of the returned token.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2;
}
// TokenReview attempts to authenticate a token to a known user.
@@ -133,7 +133,7 @@ message TokenReview {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional TokenReviewSpec spec = 2;
diff --git a/vendor/k8s.io/api/authentication/v1/types.go b/vendor/k8s.io/api/authentication/v1/types.go
index 4f4400e305c..2dc0707c4fa 100644
--- a/vendor/k8s.io/api/authentication/v1/types.go
+++ b/vendor/k8s.io/api/authentication/v1/types.go
@@ -45,6 +45,7 @@ const (
// +genclient:nonNamespaced
// +genclient:onlyVerbs=create
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.6
// TokenReview attempts to authenticate a token to a known user.
// Note: TokenReview requests may be cached by the webhook token authenticator
@@ -134,6 +135,7 @@ func (t ExtraValue) String() string {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.10
// TokenRequest requests a token for a given service account.
type TokenRequest struct {
@@ -206,6 +208,7 @@ type BoundObjectReference struct {
// +genclient:nonNamespaced
// +genclient:onlyVerbs=create
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.28
// SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request.
// When using impersonation, users will receive the user info of the user being impersonated. If impersonation or
diff --git a/vendor/k8s.io/api/authentication/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/authentication/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..b612bdec486
--- /dev/null
+++ b/vendor/k8s.io/api/authentication/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,40 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *SelfSubjectReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 28
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *TokenRequest) APILifecycleIntroduced() (major, minor int) {
+ return 1, 10
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *TokenReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 6
+}
diff --git a/vendor/k8s.io/api/authentication/v1alpha1/generated.proto b/vendor/k8s.io/api/authentication/v1alpha1/generated.proto
index 51d9252440c..4585e5cdd32 100644
--- a/vendor/k8s.io/api/authentication/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/authentication/v1alpha1/generated.proto
@@ -36,7 +36,7 @@ message SelfSubjectReview {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Status is filled in by the server with the user attributes.
optional SelfSubjectReviewStatus status = 2;
@@ -46,6 +46,6 @@ message SelfSubjectReview {
message SelfSubjectReviewStatus {
// User attributes of the user making this request.
// +optional
- optional k8s.io.api.authentication.v1.UserInfo userInfo = 1;
+ optional .k8s.io.api.authentication.v1.UserInfo userInfo = 1;
}
diff --git a/vendor/k8s.io/api/authentication/v1beta1/generated.proto b/vendor/k8s.io/api/authentication/v1beta1/generated.proto
index 61658245d42..d0f6fe4402d 100644
--- a/vendor/k8s.io/api/authentication/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/authentication/v1beta1/generated.proto
@@ -45,7 +45,7 @@ message SelfSubjectReview {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Status is filled in by the server with the user attributes.
optional SelfSubjectReviewStatus status = 2;
@@ -55,7 +55,7 @@ message SelfSubjectReview {
message SelfSubjectReviewStatus {
// User attributes of the user making this request.
// +optional
- optional k8s.io.api.authentication.v1.UserInfo userInfo = 1;
+ optional .k8s.io.api.authentication.v1.UserInfo userInfo = 1;
}
// TokenReview attempts to authenticate a token to a known user.
@@ -65,7 +65,7 @@ message TokenReview {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional TokenReviewSpec spec = 2;
diff --git a/vendor/k8s.io/api/authorization/v1/doc.go b/vendor/k8s.io/api/authorization/v1/doc.go
index cf100e6b754..77e5a19c4c8 100644
--- a/vendor/k8s.io/api/authorization/v1/doc.go
+++ b/vendor/k8s.io/api/authorization/v1/doc.go
@@ -17,7 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
-
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=authorization.k8s.io
package v1 // import "k8s.io/api/authorization/v1"
diff --git a/vendor/k8s.io/api/authorization/v1/generated.pb.go b/vendor/k8s.io/api/authorization/v1/generated.pb.go
index dfa109b4249..aed9a3a4761 100644
--- a/vendor/k8s.io/api/authorization/v1/generated.pb.go
+++ b/vendor/k8s.io/api/authorization/v1/generated.pb.go
@@ -26,6 +26,7 @@ import (
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
math "math"
math_bits "math/bits"
@@ -72,10 +73,66 @@ func (m *ExtraValue) XXX_DiscardUnknown() {
var xxx_messageInfo_ExtraValue proto.InternalMessageInfo
+func (m *FieldSelectorAttributes) Reset() { *m = FieldSelectorAttributes{} }
+func (*FieldSelectorAttributes) ProtoMessage() {}
+func (*FieldSelectorAttributes) Descriptor() ([]byte, []int) {
+ return fileDescriptor_aafd0e5e70cec678, []int{1}
+}
+func (m *FieldSelectorAttributes) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *FieldSelectorAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *FieldSelectorAttributes) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FieldSelectorAttributes.Merge(m, src)
+}
+func (m *FieldSelectorAttributes) XXX_Size() int {
+ return m.Size()
+}
+func (m *FieldSelectorAttributes) XXX_DiscardUnknown() {
+ xxx_messageInfo_FieldSelectorAttributes.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FieldSelectorAttributes proto.InternalMessageInfo
+
+func (m *LabelSelectorAttributes) Reset() { *m = LabelSelectorAttributes{} }
+func (*LabelSelectorAttributes) ProtoMessage() {}
+func (*LabelSelectorAttributes) Descriptor() ([]byte, []int) {
+ return fileDescriptor_aafd0e5e70cec678, []int{2}
+}
+func (m *LabelSelectorAttributes) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *LabelSelectorAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *LabelSelectorAttributes) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LabelSelectorAttributes.Merge(m, src)
+}
+func (m *LabelSelectorAttributes) XXX_Size() int {
+ return m.Size()
+}
+func (m *LabelSelectorAttributes) XXX_DiscardUnknown() {
+ xxx_messageInfo_LabelSelectorAttributes.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LabelSelectorAttributes proto.InternalMessageInfo
+
func (m *LocalSubjectAccessReview) Reset() { *m = LocalSubjectAccessReview{} }
func (*LocalSubjectAccessReview) ProtoMessage() {}
func (*LocalSubjectAccessReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{1}
+ return fileDescriptor_aafd0e5e70cec678, []int{3}
}
func (m *LocalSubjectAccessReview) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -103,7 +160,7 @@ var xxx_messageInfo_LocalSubjectAccessReview proto.InternalMessageInfo
func (m *NonResourceAttributes) Reset() { *m = NonResourceAttributes{} }
func (*NonResourceAttributes) ProtoMessage() {}
func (*NonResourceAttributes) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{2}
+ return fileDescriptor_aafd0e5e70cec678, []int{4}
}
func (m *NonResourceAttributes) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -131,7 +188,7 @@ var xxx_messageInfo_NonResourceAttributes proto.InternalMessageInfo
func (m *NonResourceRule) Reset() { *m = NonResourceRule{} }
func (*NonResourceRule) ProtoMessage() {}
func (*NonResourceRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{3}
+ return fileDescriptor_aafd0e5e70cec678, []int{5}
}
func (m *NonResourceRule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -159,7 +216,7 @@ var xxx_messageInfo_NonResourceRule proto.InternalMessageInfo
func (m *ResourceAttributes) Reset() { *m = ResourceAttributes{} }
func (*ResourceAttributes) ProtoMessage() {}
func (*ResourceAttributes) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{4}
+ return fileDescriptor_aafd0e5e70cec678, []int{6}
}
func (m *ResourceAttributes) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -187,7 +244,7 @@ var xxx_messageInfo_ResourceAttributes proto.InternalMessageInfo
func (m *ResourceRule) Reset() { *m = ResourceRule{} }
func (*ResourceRule) ProtoMessage() {}
func (*ResourceRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{5}
+ return fileDescriptor_aafd0e5e70cec678, []int{7}
}
func (m *ResourceRule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -215,7 +272,7 @@ var xxx_messageInfo_ResourceRule proto.InternalMessageInfo
func (m *SelfSubjectAccessReview) Reset() { *m = SelfSubjectAccessReview{} }
func (*SelfSubjectAccessReview) ProtoMessage() {}
func (*SelfSubjectAccessReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{6}
+ return fileDescriptor_aafd0e5e70cec678, []int{8}
}
func (m *SelfSubjectAccessReview) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -243,7 +300,7 @@ var xxx_messageInfo_SelfSubjectAccessReview proto.InternalMessageInfo
func (m *SelfSubjectAccessReviewSpec) Reset() { *m = SelfSubjectAccessReviewSpec{} }
func (*SelfSubjectAccessReviewSpec) ProtoMessage() {}
func (*SelfSubjectAccessReviewSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{7}
+ return fileDescriptor_aafd0e5e70cec678, []int{9}
}
func (m *SelfSubjectAccessReviewSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -271,7 +328,7 @@ var xxx_messageInfo_SelfSubjectAccessReviewSpec proto.InternalMessageInfo
func (m *SelfSubjectRulesReview) Reset() { *m = SelfSubjectRulesReview{} }
func (*SelfSubjectRulesReview) ProtoMessage() {}
func (*SelfSubjectRulesReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{8}
+ return fileDescriptor_aafd0e5e70cec678, []int{10}
}
func (m *SelfSubjectRulesReview) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -299,7 +356,7 @@ var xxx_messageInfo_SelfSubjectRulesReview proto.InternalMessageInfo
func (m *SelfSubjectRulesReviewSpec) Reset() { *m = SelfSubjectRulesReviewSpec{} }
func (*SelfSubjectRulesReviewSpec) ProtoMessage() {}
func (*SelfSubjectRulesReviewSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{9}
+ return fileDescriptor_aafd0e5e70cec678, []int{11}
}
func (m *SelfSubjectRulesReviewSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -327,7 +384,7 @@ var xxx_messageInfo_SelfSubjectRulesReviewSpec proto.InternalMessageInfo
func (m *SubjectAccessReview) Reset() { *m = SubjectAccessReview{} }
func (*SubjectAccessReview) ProtoMessage() {}
func (*SubjectAccessReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{10}
+ return fileDescriptor_aafd0e5e70cec678, []int{12}
}
func (m *SubjectAccessReview) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -355,7 +412,7 @@ var xxx_messageInfo_SubjectAccessReview proto.InternalMessageInfo
func (m *SubjectAccessReviewSpec) Reset() { *m = SubjectAccessReviewSpec{} }
func (*SubjectAccessReviewSpec) ProtoMessage() {}
func (*SubjectAccessReviewSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{11}
+ return fileDescriptor_aafd0e5e70cec678, []int{13}
}
func (m *SubjectAccessReviewSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -383,7 +440,7 @@ var xxx_messageInfo_SubjectAccessReviewSpec proto.InternalMessageInfo
func (m *SubjectAccessReviewStatus) Reset() { *m = SubjectAccessReviewStatus{} }
func (*SubjectAccessReviewStatus) ProtoMessage() {}
func (*SubjectAccessReviewStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{12}
+ return fileDescriptor_aafd0e5e70cec678, []int{14}
}
func (m *SubjectAccessReviewStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -411,7 +468,7 @@ var xxx_messageInfo_SubjectAccessReviewStatus proto.InternalMessageInfo
func (m *SubjectRulesReviewStatus) Reset() { *m = SubjectRulesReviewStatus{} }
func (*SubjectRulesReviewStatus) ProtoMessage() {}
func (*SubjectRulesReviewStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{13}
+ return fileDescriptor_aafd0e5e70cec678, []int{15}
}
func (m *SubjectRulesReviewStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -438,6 +495,8 @@ var xxx_messageInfo_SubjectRulesReviewStatus proto.InternalMessageInfo
func init() {
proto.RegisterType((*ExtraValue)(nil), "k8s.io.api.authorization.v1.ExtraValue")
+ proto.RegisterType((*FieldSelectorAttributes)(nil), "k8s.io.api.authorization.v1.FieldSelectorAttributes")
+ proto.RegisterType((*LabelSelectorAttributes)(nil), "k8s.io.api.authorization.v1.LabelSelectorAttributes")
proto.RegisterType((*LocalSubjectAccessReview)(nil), "k8s.io.api.authorization.v1.LocalSubjectAccessReview")
proto.RegisterType((*NonResourceAttributes)(nil), "k8s.io.api.authorization.v1.NonResourceAttributes")
proto.RegisterType((*NonResourceRule)(nil), "k8s.io.api.authorization.v1.NonResourceRule")
@@ -459,78 +518,85 @@ func init() {
}
var fileDescriptor_aafd0e5e70cec678 = []byte{
- // 1126 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
- 0x14, 0xf7, 0xfa, 0x4f, 0x6a, 0x3f, 0x37, 0x24, 0x9d, 0x28, 0xcd, 0x36, 0x11, 0x76, 0xb4, 0x48,
- 0x90, 0xaa, 0x65, 0x97, 0x58, 0x6d, 0x13, 0x55, 0xaa, 0x90, 0xad, 0x46, 0x28, 0x52, 0x5b, 0xaa,
- 0x89, 0x12, 0x89, 0x22, 0x10, 0xe3, 0xf5, 0xc4, 0x5e, 0x62, 0xef, 0x2e, 0x3b, 0xbb, 0x0e, 0xe1,
- 0x54, 0x89, 0x2f, 0xc0, 0x91, 0x03, 0x07, 0xbe, 0x01, 0x17, 0x24, 0x6e, 0x1c, 0x38, 0xa0, 0x1c,
- 0x7b, 0x2c, 0x12, 0xb2, 0xc8, 0x72, 0xe6, 0x3b, 0xa0, 0x99, 0x1d, 0x7b, 0xd7, 0xc9, 0xda, 0x8d,
- 0x39, 0xd0, 0x4b, 0x6f, 0xde, 0xf7, 0xfb, 0xbd, 0x37, 0x6f, 0xde, 0xbf, 0x79, 0x86, 0x5b, 0x47,
- 0xdb, 0x4c, 0xb7, 0x1c, 0x83, 0xb8, 0x96, 0x41, 0x02, 0xbf, 0xe3, 0x78, 0xd6, 0x37, 0xc4, 0xb7,
- 0x1c, 0xdb, 0xe8, 0x6f, 0x1a, 0x6d, 0x6a, 0x53, 0x8f, 0xf8, 0xb4, 0xa5, 0xbb, 0x9e, 0xe3, 0x3b,
- 0x68, 0x2d, 0x22, 0xeb, 0xc4, 0xb5, 0xf4, 0x31, 0xb2, 0xde, 0xdf, 0x5c, 0x7d, 0xbf, 0x6d, 0xf9,
- 0x9d, 0xa0, 0xa9, 0x9b, 0x4e, 0xcf, 0x68, 0x3b, 0x6d, 0xc7, 0x10, 0x3a, 0xcd, 0xe0, 0x50, 0x7c,
- 0x89, 0x0f, 0xf1, 0x2b, 0xb2, 0xb5, 0x7a, 0x27, 0x3e, 0xb8, 0x47, 0xcc, 0x8e, 0x65, 0x53, 0xef,
- 0xc4, 0x70, 0x8f, 0xda, 0x5c, 0xc0, 0x8c, 0x1e, 0xf5, 0x49, 0x8a, 0x07, 0xab, 0xc6, 0x24, 0x2d,
- 0x2f, 0xb0, 0x7d, 0xab, 0x47, 0x2f, 0x28, 0xdc, 0x7b, 0x95, 0x02, 0x33, 0x3b, 0xb4, 0x47, 0xce,
- 0xeb, 0x69, 0x5b, 0x00, 0x3b, 0x5f, 0xfb, 0x1e, 0x39, 0x20, 0xdd, 0x80, 0xa2, 0x2a, 0x14, 0x2c,
- 0x9f, 0xf6, 0x98, 0xaa, 0xac, 0xe7, 0x36, 0x4a, 0x8d, 0x52, 0x38, 0xa8, 0x16, 0x76, 0xb9, 0x00,
- 0x47, 0xf2, 0xfb, 0xc5, 0xef, 0x7f, 0xac, 0x66, 0x9e, 0xff, 0xb9, 0x9e, 0xd1, 0x7e, 0xce, 0x82,
- 0xfa, 0xc8, 0x31, 0x49, 0x77, 0x2f, 0x68, 0x7e, 0x49, 0x4d, 0xbf, 0x6e, 0x9a, 0x94, 0x31, 0x4c,
- 0xfb, 0x16, 0x3d, 0x46, 0x5f, 0x40, 0x91, 0xdf, 0xac, 0x45, 0x7c, 0xa2, 0x2a, 0xeb, 0xca, 0x46,
- 0xb9, 0xf6, 0x81, 0x1e, 0xc7, 0x74, 0xe4, 0xa0, 0xee, 0x1e, 0xb5, 0xb9, 0x80, 0xe9, 0x9c, 0xad,
- 0xf7, 0x37, 0xf5, 0x8f, 0x85, 0xad, 0xc7, 0xd4, 0x27, 0x0d, 0x74, 0x3a, 0xa8, 0x66, 0xc2, 0x41,
- 0x15, 0x62, 0x19, 0x1e, 0x59, 0x45, 0x07, 0x90, 0x67, 0x2e, 0x35, 0xd5, 0xac, 0xb0, 0x7e, 0x47,
- 0x9f, 0x92, 0x31, 0x3d, 0xc5, 0xc3, 0x3d, 0x97, 0x9a, 0x8d, 0xab, 0xf2, 0x84, 0x3c, 0xff, 0xc2,
- 0xc2, 0x1e, 0xfa, 0x1c, 0xe6, 0x98, 0x4f, 0xfc, 0x80, 0xa9, 0x39, 0x61, 0xf9, 0xde, 0xcc, 0x96,
- 0x85, 0x76, 0xe3, 0x2d, 0x69, 0x7b, 0x2e, 0xfa, 0xc6, 0xd2, 0xaa, 0xf6, 0x29, 0x2c, 0x3f, 0x71,
- 0x6c, 0x4c, 0x99, 0x13, 0x78, 0x26, 0xad, 0xfb, 0xbe, 0x67, 0x35, 0x03, 0x9f, 0x32, 0xb4, 0x0e,
- 0x79, 0x97, 0xf8, 0x1d, 0x11, 0xae, 0x52, 0xec, 0xda, 0x53, 0xe2, 0x77, 0xb0, 0x40, 0x38, 0xa3,
- 0x4f, 0xbd, 0xa6, 0xb8, 0x72, 0x82, 0x71, 0x40, 0xbd, 0x26, 0x16, 0x88, 0xf6, 0x15, 0x2c, 0x24,
- 0x8c, 0xe3, 0xa0, 0x2b, 0x32, 0xca, 0xa1, 0xb1, 0x8c, 0x72, 0x0d, 0x86, 0x23, 0x39, 0x7a, 0x00,
- 0x0b, 0x76, 0xac, 0xb3, 0x8f, 0x1f, 0x31, 0x35, 0x2b, 0xa8, 0x4b, 0xe1, 0xa0, 0x9a, 0x34, 0xc7,
- 0x21, 0x7c, 0x9e, 0xab, 0xfd, 0x9a, 0x05, 0x94, 0x72, 0x1b, 0x03, 0x4a, 0x36, 0xe9, 0x51, 0xe6,
- 0x12, 0x93, 0xca, 0x2b, 0x5d, 0x93, 0x0e, 0x97, 0x9e, 0x0c, 0x01, 0x1c, 0x73, 0x5e, 0x7d, 0x39,
- 0xf4, 0x0e, 0x14, 0xda, 0x9e, 0x13, 0xb8, 0x22, 0x31, 0xa5, 0xc6, 0xbc, 0xa4, 0x14, 0x3e, 0xe2,
- 0x42, 0x1c, 0x61, 0xe8, 0x26, 0x5c, 0xe9, 0x53, 0x8f, 0x59, 0x8e, 0xad, 0xe6, 0x05, 0x6d, 0x41,
- 0xd2, 0xae, 0x1c, 0x44, 0x62, 0x3c, 0xc4, 0xd1, 0x6d, 0x28, 0x7a, 0xd2, 0x71, 0xb5, 0x20, 0xb8,
- 0x8b, 0x92, 0x5b, 0x1c, 0x45, 0x70, 0xc4, 0x40, 0x77, 0xa1, 0xcc, 0x82, 0xe6, 0x48, 0x61, 0x4e,
- 0x28, 0x2c, 0x49, 0x85, 0xf2, 0x5e, 0x0c, 0xe1, 0x24, 0x8f, 0x5f, 0x8b, 0xdf, 0x51, 0xbd, 0x32,
- 0x7e, 0x2d, 0x1e, 0x02, 0x2c, 0x10, 0xed, 0x37, 0x05, 0xae, 0xce, 0x96, 0xb1, 0x5b, 0x50, 0x22,
- 0xae, 0x25, 0xae, 0x3d, 0xcc, 0xd5, 0x3c, 0x8f, 0x6b, 0xfd, 0xe9, 0x6e, 0x24, 0xc4, 0x31, 0xce,
- 0xc9, 0x43, 0x67, 0x78, 0x49, 0x8f, 0xc8, 0xc3, 0x23, 0x19, 0x8e, 0x71, 0xb4, 0x05, 0xf3, 0xc3,
- 0x0f, 0x91, 0x24, 0x35, 0x2f, 0x14, 0xae, 0x85, 0x83, 0xea, 0x3c, 0x4e, 0x02, 0x78, 0x9c, 0xa7,
- 0xfd, 0x92, 0x85, 0x95, 0x3d, 0xda, 0x3d, 0x7c, 0x3d, 0xb3, 0xe0, 0xd9, 0xd8, 0x2c, 0xd8, 0x9e,
- 0xde, 0xb1, 0xe9, 0x5e, 0xbe, 0xb6, 0x79, 0xf0, 0x43, 0x16, 0xd6, 0xa6, 0xf8, 0x84, 0x8e, 0x01,
- 0x79, 0x17, 0xda, 0x4b, 0xc6, 0xd1, 0x98, 0xea, 0xcb, 0xc5, 0xae, 0x6c, 0x5c, 0x0f, 0x07, 0xd5,
- 0x94, 0x6e, 0xc5, 0x29, 0x47, 0xa0, 0x6f, 0x15, 0x58, 0xb6, 0xd3, 0x26, 0x95, 0x0c, 0x73, 0x6d,
- 0xea, 0xe1, 0xa9, 0x33, 0xae, 0x71, 0x23, 0x1c, 0x54, 0xd3, 0xc7, 0x1f, 0x4e, 0x3f, 0x8b, 0xbf,
- 0x32, 0xd7, 0x13, 0xe1, 0xe1, 0x0d, 0xf2, 0xff, 0xd5, 0xd5, 0x27, 0x63, 0x75, 0xb5, 0x75, 0xd9,
- 0xba, 0x4a, 0x38, 0x39, 0xb1, 0xac, 0x3e, 0x3b, 0x57, 0x56, 0x77, 0x2f, 0x53, 0x56, 0x49, 0xc3,
- 0xd3, 0xab, 0xea, 0x31, 0xac, 0x4e, 0x76, 0x68, 0xe6, 0xe1, 0xac, 0xfd, 0x94, 0x85, 0xa5, 0x37,
- 0xcf, 0xfc, 0x2c, 0x6d, 0xfd, 0x7b, 0x1e, 0x56, 0xde, 0xb4, 0xf4, 0xa4, 0x45, 0x27, 0x60, 0xd4,
- 0x93, 0xcf, 0xf8, 0x28, 0x39, 0xfb, 0x8c, 0x7a, 0x58, 0x20, 0x48, 0x83, 0xb9, 0x76, 0xf4, 0xba,
- 0x45, 0xef, 0x0f, 0xf0, 0x00, 0xcb, 0xa7, 0x4d, 0x22, 0xa8, 0x05, 0x05, 0xca, 0xf7, 0x56, 0xb5,
- 0xb0, 0x9e, 0xdb, 0x28, 0xd7, 0x3e, 0xfc, 0x2f, 0x95, 0xa1, 0x8b, 0xcd, 0x77, 0xc7, 0xf6, 0xbd,
- 0x93, 0x78, 0x9d, 0x10, 0x32, 0x1c, 0x19, 0x47, 0x6f, 0x43, 0x2e, 0xb0, 0x5a, 0xf2, 0xb5, 0x2f,
- 0x4b, 0x4a, 0x6e, 0x7f, 0xf7, 0x21, 0xe6, 0xf2, 0x55, 0x22, 0x97, 0x67, 0x61, 0x02, 0x2d, 0x42,
- 0xee, 0x88, 0x9e, 0x44, 0x0d, 0x85, 0xf9, 0x4f, 0xf4, 0x00, 0x0a, 0x7d, 0xbe, 0x57, 0xcb, 0xf8,
- 0xbe, 0x37, 0xd5, 0xc9, 0x78, 0x0d, 0xc7, 0x91, 0xd6, 0xfd, 0xec, 0xb6, 0xa2, 0xfd, 0xa1, 0xc0,
- 0x8d, 0x89, 0xe5, 0xc7, 0xd7, 0x1d, 0xd2, 0xed, 0x3a, 0xc7, 0xb4, 0x25, 0x8e, 0x2d, 0xc6, 0xeb,
- 0x4e, 0x3d, 0x12, 0xe3, 0x21, 0x8e, 0xde, 0x85, 0xb9, 0x16, 0xb5, 0x2d, 0xda, 0x12, 0x8b, 0x51,
- 0x31, 0xae, 0xdc, 0x87, 0x42, 0x8a, 0x25, 0xca, 0x79, 0x1e, 0x25, 0xcc, 0xb1, 0xe5, 0x2a, 0x36,
- 0xe2, 0x61, 0x21, 0xc5, 0x12, 0x45, 0x75, 0x58, 0xa0, 0xdc, 0x4d, 0xe1, 0xff, 0x8e, 0xe7, 0x39,
- 0xc3, 0x8c, 0xae, 0x48, 0x85, 0x85, 0x9d, 0x71, 0x18, 0x9f, 0xe7, 0x6b, 0xff, 0x64, 0x41, 0x9d,
- 0x34, 0xda, 0xd0, 0x61, 0xbc, 0x8b, 0x08, 0x50, 0xac, 0x43, 0xe5, 0xda, 0xcd, 0x4b, 0x35, 0x08,
- 0xd7, 0x68, 0x2c, 0x4b, 0x47, 0xe6, 0x93, 0xd2, 0xc4, 0xea, 0x22, 0x3e, 0x91, 0x07, 0x8b, 0xf6,
- 0xf8, 0xce, 0x1c, 0x2d, 0x55, 0xe5, 0xda, 0xed, 0xcb, 0xb6, 0x83, 0x38, 0x4d, 0x95, 0xa7, 0x2d,
- 0x9e, 0x03, 0x18, 0xbe, 0x60, 0x1f, 0xd5, 0x00, 0x2c, 0xdb, 0x74, 0x7a, 0x6e, 0x97, 0xfa, 0x54,
- 0x84, 0xad, 0x18, 0xcf, 0xc1, 0xdd, 0x11, 0x82, 0x13, 0xac, 0xb4, 0x78, 0xe7, 0x67, 0x8b, 0x77,
- 0xa3, 0x7e, 0x7a, 0x56, 0xc9, 0xbc, 0x38, 0xab, 0x64, 0x5e, 0x9e, 0x55, 0x32, 0xcf, 0xc3, 0x8a,
- 0x72, 0x1a, 0x56, 0x94, 0x17, 0x61, 0x45, 0x79, 0x19, 0x56, 0x94, 0xbf, 0xc2, 0x8a, 0xf2, 0xdd,
- 0xdf, 0x95, 0xcc, 0xb3, 0xb5, 0x29, 0xff, 0x94, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x45, 0x6f,
- 0xe0, 0x61, 0x47, 0x0f, 0x00, 0x00,
+ // 1247 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6f, 0x1b, 0xc5,
+ 0x17, 0xf7, 0xfa, 0x47, 0x62, 0x8f, 0xe3, 0x6f, 0xd2, 0xc9, 0x37, 0xcd, 0x36, 0x11, 0x76, 0x64,
+ 0x24, 0x48, 0xd5, 0xb2, 0x26, 0x51, 0xdb, 0x44, 0x95, 0x0a, 0xf2, 0xaa, 0x01, 0x45, 0x4a, 0x4b,
+ 0x35, 0x51, 0x22, 0x51, 0x04, 0x62, 0xbc, 0x9e, 0xd8, 0x4b, 0xec, 0xdd, 0xed, 0xcc, 0xac, 0xd3,
+ 0x70, 0xaa, 0xc4, 0x3f, 0xc0, 0x91, 0x43, 0x0f, 0xfc, 0x07, 0x5c, 0x90, 0xb8, 0x73, 0x40, 0x11,
+ 0xa7, 0x1e, 0x8b, 0x84, 0x2c, 0x62, 0xce, 0xfc, 0x0f, 0x68, 0x66, 0xc7, 0xde, 0xdd, 0xc4, 0x76,
+ 0x6d, 0x0e, 0x94, 0x43, 0x6f, 0x9e, 0xf7, 0x79, 0xbf, 0xe7, 0xbd, 0xb7, 0x6f, 0x0c, 0x6e, 0x1c,
+ 0x6f, 0x33, 0xc3, 0x76, 0x2b, 0xd8, 0xb3, 0x2b, 0xd8, 0xe7, 0x4d, 0x97, 0xda, 0x5f, 0x63, 0x6e,
+ 0xbb, 0x4e, 0xa5, 0xb3, 0x51, 0x69, 0x10, 0x87, 0x50, 0xcc, 0x49, 0xdd, 0xf0, 0xa8, 0xcb, 0x5d,
+ 0xb8, 0x1a, 0x30, 0x1b, 0xd8, 0xb3, 0x8d, 0x18, 0xb3, 0xd1, 0xd9, 0x58, 0x79, 0xaf, 0x61, 0xf3,
+ 0xa6, 0x5f, 0x33, 0x2c, 0xb7, 0x5d, 0x69, 0xb8, 0x0d, 0xb7, 0x22, 0x65, 0x6a, 0xfe, 0x91, 0x3c,
+ 0xc9, 0x83, 0xfc, 0x15, 0xe8, 0x5a, 0xb9, 0x15, 0x1a, 0x6e, 0x63, 0xab, 0x69, 0x3b, 0x84, 0x9e,
+ 0x56, 0xbc, 0xe3, 0x86, 0x20, 0xb0, 0x4a, 0x9b, 0x70, 0x3c, 0xc4, 0x83, 0x95, 0xca, 0x28, 0x29,
+ 0xea, 0x3b, 0xdc, 0x6e, 0x93, 0x4b, 0x02, 0x77, 0x5e, 0x25, 0xc0, 0xac, 0x26, 0x69, 0xe3, 0x8b,
+ 0x72, 0xe5, 0x2d, 0x00, 0x76, 0x9e, 0x72, 0x8a, 0x0f, 0x71, 0xcb, 0x27, 0xb0, 0x04, 0x32, 0x36,
+ 0x27, 0x6d, 0xa6, 0x6b, 0x6b, 0xa9, 0xf5, 0x9c, 0x99, 0xeb, 0x75, 0x4b, 0x99, 0x5d, 0x41, 0x40,
+ 0x01, 0xfd, 0x6e, 0xf6, 0xbb, 0xef, 0x4b, 0x89, 0x67, 0xbf, 0xaf, 0x25, 0xca, 0xbf, 0x6a, 0x60,
+ 0xf9, 0x23, 0x9b, 0xb4, 0xea, 0xfb, 0xa4, 0x45, 0x2c, 0xee, 0xd2, 0x2a, 0xe7, 0xd4, 0xae, 0xf9,
+ 0x9c, 0x30, 0x78, 0x1b, 0xe4, 0x29, 0x3e, 0xe9, 0x03, 0xba, 0xb6, 0xa6, 0xad, 0xe7, 0xcc, 0xc5,
+ 0xb3, 0x6e, 0x29, 0xd1, 0xeb, 0x96, 0xf2, 0x28, 0x84, 0x50, 0x94, 0x0f, 0x3e, 0x05, 0x73, 0x94,
+ 0x3c, 0xf1, 0x6d, 0x4a, 0xda, 0xc4, 0xe1, 0x4c, 0x4f, 0xae, 0xa5, 0xd6, 0xf3, 0x9b, 0x1f, 0x18,
+ 0xe1, 0x6d, 0x0c, 0x42, 0x33, 0xbc, 0xe3, 0x86, 0x20, 0x30, 0x43, 0x64, 0xd0, 0xe8, 0x6c, 0x18,
+ 0x31, 0x5f, 0x50, 0xa8, 0xc6, 0xfc, 0xbf, 0xb2, 0x3b, 0x17, 0x21, 0x32, 0x14, 0xb3, 0x24, 0x83,
+ 0xd9, 0xc3, 0x35, 0xd2, 0xfa, 0x8f, 0x04, 0x13, 0xf3, 0x65, 0xda, 0x60, 0x7e, 0x4c, 0x02, 0x7d,
+ 0xcf, 0xb5, 0x70, 0x6b, 0xdf, 0xaf, 0x7d, 0x45, 0x2c, 0x5e, 0xb5, 0x2c, 0xc2, 0x18, 0x22, 0x1d,
+ 0x9b, 0x9c, 0xc0, 0x2f, 0x41, 0x56, 0x18, 0xa9, 0x63, 0x8e, 0x65, 0x28, 0xf9, 0xcd, 0xf7, 0x27,
+ 0x73, 0xe9, 0x13, 0xa9, 0xeb, 0x01, 0xe1, 0xd8, 0x84, 0xca, 0x09, 0x10, 0xd2, 0xd0, 0x40, 0x2b,
+ 0x3c, 0x04, 0x69, 0xe6, 0x11, 0x4b, 0x4f, 0x4a, 0xed, 0xb7, 0x8c, 0x31, 0xbd, 0x64, 0x0c, 0xf1,
+ 0x70, 0xdf, 0x23, 0x96, 0x39, 0xa7, 0x2c, 0xa4, 0xc5, 0x09, 0x49, 0x7d, 0xf0, 0x0b, 0x30, 0xc3,
+ 0x38, 0xe6, 0x3e, 0xd3, 0x53, 0x52, 0xf3, 0x9d, 0xa9, 0x35, 0x4b, 0x69, 0xf3, 0x7f, 0x4a, 0xf7,
+ 0x4c, 0x70, 0x46, 0x4a, 0x6b, 0xf9, 0x33, 0xb0, 0xf4, 0xd0, 0x75, 0x10, 0x61, 0xae, 0x4f, 0x2d,
+ 0x12, 0x29, 0x80, 0x35, 0x90, 0xf6, 0x30, 0x6f, 0xaa, 0x9b, 0x1f, 0xb8, 0xf6, 0x08, 0xf3, 0x26,
+ 0x92, 0x88, 0xe0, 0xe8, 0x10, 0x5a, 0x93, 0x21, 0x47, 0x38, 0x0e, 0x09, 0xad, 0x21, 0x89, 0x94,
+ 0x9f, 0x80, 0xf9, 0x88, 0x72, 0xe4, 0xb7, 0x64, 0xaf, 0x09, 0x28, 0xd6, 0x6b, 0x42, 0x82, 0xa1,
+ 0x80, 0x0e, 0xef, 0x81, 0x79, 0x27, 0x94, 0x39, 0x40, 0x7b, 0x41, 0x11, 0xe5, 0xcc, 0xc5, 0x5e,
+ 0xb7, 0x14, 0x55, 0x27, 0x20, 0x74, 0x91, 0xb7, 0xfc, 0x3c, 0x0d, 0xe0, 0x90, 0x68, 0x2a, 0x20,
+ 0xe7, 0xe0, 0x36, 0x61, 0x1e, 0xb6, 0x88, 0x0a, 0xe9, 0x8a, 0x72, 0x38, 0xf7, 0xb0, 0x0f, 0xa0,
+ 0x90, 0xe7, 0xd5, 0xc1, 0xc1, 0xb7, 0x41, 0xa6, 0x41, 0x5d, 0xdf, 0x93, 0x17, 0x93, 0x33, 0x0b,
+ 0x8a, 0x25, 0xf3, 0xb1, 0x20, 0xa2, 0x00, 0x83, 0xd7, 0xc1, 0x6c, 0x87, 0x50, 0x66, 0xbb, 0x8e,
+ 0x9e, 0x96, 0x6c, 0xf3, 0x8a, 0x6d, 0xf6, 0x30, 0x20, 0xa3, 0x3e, 0x0e, 0x6f, 0x82, 0x2c, 0x55,
+ 0x8e, 0xeb, 0x19, 0xc9, 0xbb, 0xa0, 0x78, 0xb3, 0x83, 0x0c, 0x0e, 0x38, 0x44, 0x7f, 0x32, 0xbf,
+ 0x36, 0x10, 0x98, 0x89, 0xf7, 0xe7, 0x7e, 0x08, 0xa1, 0x28, 0x9f, 0x08, 0x4b, 0xc4, 0xa8, 0xcf,
+ 0xc6, 0xc3, 0x12, 0x29, 0x40, 0x12, 0x81, 0x6d, 0x50, 0x38, 0x8a, 0x0e, 0x15, 0x3d, 0x3b, 0x41,
+ 0x45, 0x8f, 0x18, 0x89, 0xe6, 0x95, 0x5e, 0xb7, 0x54, 0x88, 0xcf, 0xa8, 0xb8, 0x76, 0x61, 0xae,
+ 0x15, 0x6d, 0x7b, 0x3d, 0x37, 0x81, 0xb9, 0x11, 0x43, 0x2b, 0x30, 0x17, 0x9f, 0x22, 0x71, 0xed,
+ 0xe5, 0x9f, 0x35, 0x30, 0x37, 0x5d, 0x3d, 0xde, 0x00, 0x39, 0xec, 0xd9, 0xf2, 0x52, 0xfb, 0x95,
+ 0x58, 0x10, 0x55, 0x53, 0x7d, 0xb4, 0x1b, 0x10, 0x51, 0x88, 0x0b, 0xe6, 0x7e, 0xaa, 0x45, 0xc3,
+ 0x0e, 0x98, 0xfb, 0x26, 0x19, 0x0a, 0x71, 0xb8, 0x05, 0x0a, 0xfd, 0x83, 0x2c, 0x41, 0x3d, 0x2d,
+ 0x05, 0x64, 0x10, 0x28, 0x0a, 0xa0, 0x38, 0x5f, 0xf9, 0xa7, 0x24, 0x58, 0xde, 0x27, 0xad, 0xa3,
+ 0xd7, 0x33, 0xe9, 0x1e, 0xc7, 0x26, 0xdd, 0xf6, 0xf8, 0x79, 0x34, 0xdc, 0xcb, 0xd7, 0x36, 0xed,
+ 0x9e, 0x27, 0xc1, 0xea, 0x18, 0x9f, 0xe0, 0x09, 0x80, 0xf4, 0xd2, 0xf0, 0x50, 0x79, 0xac, 0x8c,
+ 0xf5, 0xe5, 0xf2, 0xcc, 0x31, 0xaf, 0xf6, 0xba, 0xa5, 0x21, 0xb3, 0x08, 0x0d, 0x31, 0x01, 0xbf,
+ 0xd1, 0xc0, 0x92, 0x33, 0x6c, 0x0e, 0xab, 0x34, 0x6f, 0x8e, 0x35, 0x3e, 0x74, 0x82, 0x9b, 0xd7,
+ 0x7a, 0xdd, 0xd2, 0xf0, 0xe1, 0x8e, 0x86, 0xdb, 0x12, 0xdf, 0xd0, 0xab, 0x91, 0xf4, 0x88, 0x06,
+ 0xf9, 0xf7, 0xea, 0xea, 0xd3, 0x58, 0x5d, 0x6d, 0x4d, 0x5a, 0x57, 0x11, 0x27, 0x47, 0x96, 0xd5,
+ 0xe7, 0x17, 0xca, 0xea, 0xf6, 0x24, 0x65, 0x15, 0x55, 0x3c, 0xbe, 0xaa, 0x1e, 0x80, 0x95, 0xd1,
+ 0x0e, 0x4d, 0xfd, 0xe9, 0x29, 0xff, 0x90, 0x04, 0x8b, 0x6f, 0x96, 0x98, 0x69, 0xda, 0xfa, 0x97,
+ 0x34, 0x58, 0x7e, 0xd3, 0xd2, 0xa3, 0xd6, 0x38, 0x9f, 0x11, 0xaa, 0x96, 0x94, 0xc1, 0xe5, 0x1c,
+ 0x30, 0x42, 0x91, 0x44, 0x60, 0x19, 0xcc, 0x34, 0x82, 0xaf, 0x5b, 0xf0, 0xfd, 0x01, 0x22, 0xc1,
+ 0xea, 0xd3, 0xa6, 0x10, 0x58, 0x07, 0x19, 0x22, 0xde, 0x4b, 0x7a, 0x46, 0xee, 0xf3, 0x1f, 0xfe,
+ 0x93, 0xca, 0x30, 0xe4, 0x8b, 0x6b, 0xc7, 0xe1, 0xf4, 0x34, 0x5c, 0x96, 0x24, 0x0d, 0x05, 0xca,
+ 0xe1, 0x5b, 0x20, 0xe5, 0xdb, 0x75, 0xb5, 0xcb, 0xe4, 0x15, 0x4b, 0xea, 0x60, 0xf7, 0x3e, 0x12,
+ 0xf4, 0x15, 0xac, 0x1e, 0x6d, 0x52, 0x05, 0x5c, 0x00, 0xa9, 0x63, 0x72, 0x1a, 0x34, 0x14, 0x12,
+ 0x3f, 0xe1, 0x3d, 0x90, 0xe9, 0x88, 0xf7, 0x9c, 0xca, 0xef, 0xbb, 0x63, 0x9d, 0x0c, 0x9f, 0x7f,
+ 0x28, 0x90, 0xba, 0x9b, 0xdc, 0xd6, 0xca, 0xbf, 0x69, 0xe0, 0xda, 0xc8, 0xf2, 0x13, 0xcb, 0x1c,
+ 0x6e, 0xb5, 0xdc, 0x13, 0x52, 0x97, 0x66, 0xb3, 0xe1, 0x32, 0x57, 0x0d, 0xc8, 0xa8, 0x8f, 0xc3,
+ 0x77, 0xc0, 0x4c, 0x9d, 0x38, 0x36, 0xa9, 0xcb, 0xb5, 0x2f, 0x1b, 0x56, 0xee, 0x7d, 0x49, 0x45,
+ 0x0a, 0x15, 0x7c, 0x94, 0x60, 0xe6, 0x3a, 0x6a, 0xd1, 0x1c, 0xf0, 0x21, 0x49, 0x45, 0x0a, 0x85,
+ 0x55, 0x30, 0x4f, 0x84, 0x9b, 0xd2, 0xff, 0x1d, 0x4a, 0xdd, 0xfe, 0x8d, 0x2e, 0x2b, 0x81, 0xf9,
+ 0x9d, 0x38, 0x8c, 0x2e, 0xf2, 0x97, 0xff, 0x4a, 0x02, 0x7d, 0xd4, 0x68, 0x83, 0x47, 0xe1, 0x2e,
+ 0x22, 0x41, 0xb9, 0x0e, 0xe5, 0x37, 0xaf, 0x4f, 0xd4, 0x20, 0x42, 0xc2, 0x5c, 0x52, 0x8e, 0x14,
+ 0xa2, 0xd4, 0xc8, 0xea, 0x22, 0x8f, 0x90, 0x82, 0x05, 0x27, 0xfe, 0x22, 0xe8, 0xbf, 0x11, 0x6f,
+ 0x4e, 0xda, 0x0e, 0xd2, 0x9a, 0xae, 0xac, 0x2d, 0x5c, 0x00, 0x18, 0xba, 0xa4, 0x1f, 0x6e, 0x02,
+ 0x60, 0x3b, 0x96, 0xdb, 0xf6, 0x5a, 0x84, 0x13, 0x99, 0xb6, 0x6c, 0x38, 0x07, 0x77, 0x07, 0x08,
+ 0x8a, 0x70, 0x0d, 0xcb, 0x77, 0x7a, 0xba, 0x7c, 0x9b, 0xd5, 0xb3, 0xf3, 0x62, 0xe2, 0xc5, 0x79,
+ 0x31, 0xf1, 0xf2, 0xbc, 0x98, 0x78, 0xd6, 0x2b, 0x6a, 0x67, 0xbd, 0xa2, 0xf6, 0xa2, 0x57, 0xd4,
+ 0x5e, 0xf6, 0x8a, 0xda, 0x1f, 0xbd, 0xa2, 0xf6, 0xed, 0x9f, 0xc5, 0xc4, 0xe3, 0xd5, 0x31, 0xff,
+ 0xd0, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x8c, 0x77, 0x0f, 0xbf, 0x11, 0x00, 0x00,
}
func (m ExtraValue) Marshal() (dAtA []byte, err error) {
@@ -565,6 +631,90 @@ func (m ExtraValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *FieldSelectorAttributes) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *FieldSelectorAttributes) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *FieldSelectorAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Requirements) > 0 {
+ for iNdEx := len(m.Requirements) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Requirements[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ i -= len(m.RawSelector)
+ copy(dAtA[i:], m.RawSelector)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.RawSelector)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *LabelSelectorAttributes) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *LabelSelectorAttributes) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *LabelSelectorAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Requirements) > 0 {
+ for iNdEx := len(m.Requirements) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Requirements[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ i -= len(m.RawSelector)
+ copy(dAtA[i:], m.RawSelector)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.RawSelector)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *LocalSubjectAccessReview) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -712,6 +862,30 @@ func (m *ResourceAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.LabelSelector != nil {
+ {
+ size, err := m.LabelSelector.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x4a
+ }
+ if m.FieldSelector != nil {
+ {
+ size, err := m.FieldSelector.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x42
+ }
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
@@ -1277,6 +1451,40 @@ func (m ExtraValue) Size() (n int) {
return n
}
+func (m *FieldSelectorAttributes) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.RawSelector)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Requirements) > 0 {
+ for _, e := range m.Requirements {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *LabelSelectorAttributes) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.RawSelector)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Requirements) > 0 {
+ for _, e := range m.Requirements {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
func (m *LocalSubjectAccessReview) Size() (n int) {
if m == nil {
return 0
@@ -1346,6 +1554,14 @@ func (m *ResourceAttributes) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = len(m.Name)
n += 1 + l + sovGenerated(uint64(l))
+ if m.FieldSelector != nil {
+ l = m.FieldSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.LabelSelector != nil {
+ l = m.LabelSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1536,6 +1752,38 @@ func sovGenerated(x uint64) (n int) {
func sozGenerated(x uint64) (n int) {
return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
+func (this *FieldSelectorAttributes) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForRequirements := "[]FieldSelectorRequirement{"
+ for _, f := range this.Requirements {
+ repeatedStringForRequirements += fmt.Sprintf("%v", f) + ","
+ }
+ repeatedStringForRequirements += "}"
+ s := strings.Join([]string{`&FieldSelectorAttributes{`,
+ `RawSelector:` + fmt.Sprintf("%v", this.RawSelector) + `,`,
+ `Requirements:` + repeatedStringForRequirements + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *LabelSelectorAttributes) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForRequirements := "[]LabelSelectorRequirement{"
+ for _, f := range this.Requirements {
+ repeatedStringForRequirements += fmt.Sprintf("%v", f) + ","
+ }
+ repeatedStringForRequirements += "}"
+ s := strings.Join([]string{`&LabelSelectorAttributes{`,
+ `RawSelector:` + fmt.Sprintf("%v", this.RawSelector) + `,`,
+ `Requirements:` + repeatedStringForRequirements + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *LocalSubjectAccessReview) String() string {
if this == nil {
return "nil"
@@ -1582,6 +1830,8 @@ func (this *ResourceAttributes) String() string {
`Resource:` + fmt.Sprintf("%v", this.Resource) + `,`,
`Subresource:` + fmt.Sprintf("%v", this.Subresource) + `,`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `FieldSelector:` + strings.Replace(this.FieldSelector.String(), "FieldSelectorAttributes", "FieldSelectorAttributes", 1) + `,`,
+ `LabelSelector:` + strings.Replace(this.LabelSelector.String(), "LabelSelectorAttributes", "LabelSelectorAttributes", 1) + `,`,
`}`,
}, "")
return s
@@ -1807,6 +2057,238 @@ func (m *ExtraValue) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *FieldSelectorAttributes) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: FieldSelectorAttributes: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: FieldSelectorAttributes: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field RawSelector", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.RawSelector = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Requirements", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Requirements = append(m.Requirements, v1.FieldSelectorRequirement{})
+ if err := m.Requirements[len(m.Requirements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *LabelSelectorAttributes) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: LabelSelectorAttributes: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: LabelSelectorAttributes: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field RawSelector", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.RawSelector = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Requirements", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Requirements = append(m.Requirements, v1.LabelSelectorRequirement{})
+ if err := m.Requirements[len(m.Requirements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *LocalSubjectAccessReview) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2437,6 +2919,78 @@ func (m *ResourceAttributes) Unmarshal(dAtA []byte) error {
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
+ case 8:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field FieldSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.FieldSelector == nil {
+ m.FieldSelector = &FieldSelectorAttributes{}
+ }
+ if err := m.FieldSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 9:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.LabelSelector == nil {
+ m.LabelSelector = &LabelSelectorAttributes{}
+ }
+ if err := m.LabelSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
diff --git a/vendor/k8s.io/api/authorization/v1/generated.proto b/vendor/k8s.io/api/authorization/v1/generated.proto
index 83283d0bdbe..37b05b8552f 100644
--- a/vendor/k8s.io/api/authorization/v1/generated.proto
+++ b/vendor/k8s.io/api/authorization/v1/generated.proto
@@ -37,6 +37,60 @@ message ExtraValue {
repeated string items = 1;
}
+// FieldSelectorAttributes indicates a field limited access.
+// Webhook authors are encouraged to
+// * ensure rawSelector and requirements are not both set
+// * consider the requirements field if set
+// * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details.
+// For the *SubjectAccessReview endpoints of the kube-apiserver:
+// * If rawSelector is empty and requirements are empty, the request is not limited.
+// * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds.
+// * If rawSelector is empty and requirements are present, the requirements should be honored
+// * If rawSelector is present and requirements are present, the request is invalid.
+message FieldSelectorAttributes {
+ // rawSelector is the serialization of a field selector that would be included in a query parameter.
+ // Webhook implementations are encouraged to ignore rawSelector.
+ // The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
+ // +optional
+ optional string rawSelector = 1;
+
+ // requirements is the parsed interpretation of a field selector.
+ // All requirements must be met for a resource instance to match the selector.
+ // Webhook implementations should handle requirements, but how to handle them is up to the webhook.
+ // Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements
+ // are not understood.
+ // +optional
+ // +listType=atomic
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.FieldSelectorRequirement requirements = 2;
+}
+
+// LabelSelectorAttributes indicates a label limited access.
+// Webhook authors are encouraged to
+// * ensure rawSelector and requirements are not both set
+// * consider the requirements field if set
+// * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details.
+// For the *SubjectAccessReview endpoints of the kube-apiserver:
+// * If rawSelector is empty and requirements are empty, the request is not limited.
+// * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds.
+// * If rawSelector is empty and requirements are present, the requirements should be honored
+// * If rawSelector is present and requirements are present, the request is invalid.
+message LabelSelectorAttributes {
+ // rawSelector is the serialization of a field selector that would be included in a query parameter.
+ // Webhook implementations are encouraged to ignore rawSelector.
+ // The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
+ // +optional
+ optional string rawSelector = 1;
+
+ // requirements is the parsed interpretation of a label selector.
+ // All requirements must be met for a resource instance to match the selector.
+ // Webhook implementations should handle requirements, but how to handle them is up to the webhook.
+ // Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements
+ // are not understood.
+ // +optional
+ // +listType=atomic
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement requirements = 2;
+}
+
// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.
// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
// checking.
@@ -44,7 +98,7 @@ message LocalSubjectAccessReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace
// you made the request against. If empty, it is defaulted.
@@ -111,6 +165,20 @@ message ResourceAttributes {
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
// +optional
optional string name = 7;
+
+ // fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.
+ //
+ // This field is alpha-level. To use this field, you must enable the
+ // `AuthorizeWithSelectors` feature gate (disabled by default).
+ // +optional
+ optional FieldSelectorAttributes fieldSelector = 8;
+
+ // labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.
+ //
+ // This field is alpha-level. To use this field, you must enable the
+ // `AuthorizeWithSelectors` feature gate (disabled by default).
+ // +optional
+ optional LabelSelectorAttributes labelSelector = 9;
}
// ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant,
@@ -145,7 +213,7 @@ message SelfSubjectAccessReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated. user and groups must be empty
optional SelfSubjectAccessReviewSpec spec = 2;
@@ -177,7 +245,7 @@ message SelfSubjectRulesReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated.
optional SelfSubjectRulesReviewSpec spec = 2;
@@ -198,7 +266,7 @@ message SubjectAccessReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional SubjectAccessReviewSpec spec = 2;
diff --git a/vendor/k8s.io/api/authorization/v1/types.go b/vendor/k8s.io/api/authorization/v1/types.go
index 3b42956f899..36f5fa41078 100644
--- a/vendor/k8s.io/api/authorization/v1/types.go
+++ b/vendor/k8s.io/api/authorization/v1/types.go
@@ -26,6 +26,7 @@ import (
// +genclient:nonNamespaced
// +genclient:onlyVerbs=create
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.6
// SubjectAccessReview checks whether or not a user or group can perform an action.
type SubjectAccessReview struct {
@@ -47,6 +48,7 @@ type SubjectAccessReview struct {
// +genclient:nonNamespaced
// +genclient:onlyVerbs=create
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a
// spec.namespace means "in all namespaces". Self is a special case, because users should always be able
@@ -69,6 +71,7 @@ type SelfSubjectAccessReview struct {
// +genclient
// +genclient:onlyVerbs=create
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.
// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
@@ -115,6 +118,72 @@ type ResourceAttributes struct {
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,7,opt,name=name"`
+ // fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.
+ //
+ // This field is alpha-level. To use this field, you must enable the
+ // `AuthorizeWithSelectors` feature gate (disabled by default).
+ // +optional
+ FieldSelector *FieldSelectorAttributes `json:"fieldSelector,omitempty" protobuf:"bytes,8,opt,name=fieldSelector"`
+ // labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.
+ //
+ // This field is alpha-level. To use this field, you must enable the
+ // `AuthorizeWithSelectors` feature gate (disabled by default).
+ // +optional
+ LabelSelector *LabelSelectorAttributes `json:"labelSelector,omitempty" protobuf:"bytes,9,opt,name=labelSelector"`
+}
+
+// LabelSelectorAttributes indicates a label limited access.
+// Webhook authors are encouraged to
+// * ensure rawSelector and requirements are not both set
+// * consider the requirements field if set
+// * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details.
+// For the *SubjectAccessReview endpoints of the kube-apiserver:
+// * If rawSelector is empty and requirements are empty, the request is not limited.
+// * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds.
+// * If rawSelector is empty and requirements are present, the requirements should be honored
+// * If rawSelector is present and requirements are present, the request is invalid.
+type LabelSelectorAttributes struct {
+ // rawSelector is the serialization of a field selector that would be included in a query parameter.
+ // Webhook implementations are encouraged to ignore rawSelector.
+ // The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
+ // +optional
+ RawSelector string `json:"rawSelector,omitempty" protobuf:"bytes,1,opt,name=rawSelector"`
+
+ // requirements is the parsed interpretation of a label selector.
+ // All requirements must be met for a resource instance to match the selector.
+ // Webhook implementations should handle requirements, but how to handle them is up to the webhook.
+ // Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements
+ // are not understood.
+ // +optional
+ // +listType=atomic
+ Requirements []metav1.LabelSelectorRequirement `json:"requirements,omitempty" protobuf:"bytes,2,rep,name=requirements"`
+}
+
+// FieldSelectorAttributes indicates a field limited access.
+// Webhook authors are encouraged to
+// * ensure rawSelector and requirements are not both set
+// * consider the requirements field if set
+// * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details.
+// For the *SubjectAccessReview endpoints of the kube-apiserver:
+// * If rawSelector is empty and requirements are empty, the request is not limited.
+// * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds.
+// * If rawSelector is empty and requirements are present, the requirements should be honored
+// * If rawSelector is present and requirements are present, the request is invalid.
+type FieldSelectorAttributes struct {
+ // rawSelector is the serialization of a field selector that would be included in a query parameter.
+ // Webhook implementations are encouraged to ignore rawSelector.
+ // The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
+ // +optional
+ RawSelector string `json:"rawSelector,omitempty" protobuf:"bytes,1,opt,name=rawSelector"`
+
+ // requirements is the parsed interpretation of a field selector.
+ // All requirements must be met for a resource instance to match the selector.
+ // Webhook implementations should handle requirements, but how to handle them is up to the webhook.
+ // Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements
+ // are not understood.
+ // +optional
+ // +listType=atomic
+ Requirements []metav1.FieldSelectorRequirement `json:"requirements,omitempty" protobuf:"bytes,2,rep,name=requirements"`
}
// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
@@ -198,6 +267,7 @@ type SubjectAccessReviewStatus struct {
// +genclient:nonNamespaced
// +genclient:onlyVerbs=create
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace.
// The returned list of actions may be incomplete depending on the server's authorization mode,
diff --git a/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go
index 93229485cc0..dc6b8a89ecd 100644
--- a/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go
@@ -27,6 +27,26 @@ package v1
// Those methods can be generated by using hack/update-codegen.sh
// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
+var map_FieldSelectorAttributes = map[string]string{
+ "": "FieldSelectorAttributes indicates a field limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.",
+ "rawSelector": "rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.",
+ "requirements": "requirements is the parsed interpretation of a field selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.",
+}
+
+func (FieldSelectorAttributes) SwaggerDoc() map[string]string {
+ return map_FieldSelectorAttributes
+}
+
+var map_LabelSelectorAttributes = map[string]string{
+ "": "LabelSelectorAttributes indicates a label limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.",
+ "rawSelector": "rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.",
+ "requirements": "requirements is the parsed interpretation of a label selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.",
+}
+
+func (LabelSelectorAttributes) SwaggerDoc() map[string]string {
+ return map_LabelSelectorAttributes
+}
+
var map_LocalSubjectAccessReview = map[string]string{
"": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.",
"metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
@@ -59,14 +79,16 @@ func (NonResourceRule) SwaggerDoc() map[string]string {
}
var map_ResourceAttributes = map[string]string{
- "": "ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface",
- "namespace": "Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces \"\" (empty) is defaulted for LocalSubjectAccessReviews \"\" (empty) is empty for cluster-scoped resources \"\" (empty) means \"all\" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview",
- "verb": "Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. \"*\" means all.",
- "group": "Group is the API Group of the Resource. \"*\" means all.",
- "version": "Version is the API Version of the Resource. \"*\" means all.",
- "resource": "Resource is one of the existing resource types. \"*\" means all.",
- "subresource": "Subresource is one of the existing resource types. \"\" means none.",
- "name": "Name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all.",
+ "": "ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface",
+ "namespace": "Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces \"\" (empty) is defaulted for LocalSubjectAccessReviews \"\" (empty) is empty for cluster-scoped resources \"\" (empty) means \"all\" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview",
+ "verb": "Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. \"*\" means all.",
+ "group": "Group is the API Group of the Resource. \"*\" means all.",
+ "version": "Version is the API Version of the Resource. \"*\" means all.",
+ "resource": "Resource is one of the existing resource types. \"*\" means all.",
+ "subresource": "Subresource is one of the existing resource types. \"\" means none.",
+ "name": "Name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all.",
+ "fieldSelector": "fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.\n\nThis field is alpha-level. To use this field, you must enable the `AuthorizeWithSelectors` feature gate (disabled by default).",
+ "labelSelector": "labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.\n\nThis field is alpha-level. To use this field, you must enable the `AuthorizeWithSelectors` feature gate (disabled by default).",
}
func (ResourceAttributes) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go
index f1d49eb386e..7f040f5c563 100644
--- a/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go
@@ -22,6 +22,7 @@ limitations under the License.
package v1
import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -45,6 +46,52 @@ func (in ExtraValue) DeepCopy() ExtraValue {
return *out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *FieldSelectorAttributes) DeepCopyInto(out *FieldSelectorAttributes) {
+ *out = *in
+ if in.Requirements != nil {
+ in, out := &in.Requirements, &out.Requirements
+ *out = make([]metav1.FieldSelectorRequirement, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FieldSelectorAttributes.
+func (in *FieldSelectorAttributes) DeepCopy() *FieldSelectorAttributes {
+ if in == nil {
+ return nil
+ }
+ out := new(FieldSelectorAttributes)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LabelSelectorAttributes) DeepCopyInto(out *LabelSelectorAttributes) {
+ *out = *in
+ if in.Requirements != nil {
+ in, out := &in.Requirements, &out.Requirements
+ *out = make([]metav1.LabelSelectorRequirement, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelSelectorAttributes.
+func (in *LabelSelectorAttributes) DeepCopy() *LabelSelectorAttributes {
+ if in == nil {
+ return nil
+ }
+ out := new(LabelSelectorAttributes)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LocalSubjectAccessReview) DeepCopyInto(out *LocalSubjectAccessReview) {
*out = *in
@@ -118,6 +165,16 @@ func (in *NonResourceRule) DeepCopy() *NonResourceRule {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceAttributes) DeepCopyInto(out *ResourceAttributes) {
*out = *in
+ if in.FieldSelector != nil {
+ in, out := &in.FieldSelector, &out.FieldSelector
+ *out = new(FieldSelectorAttributes)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.LabelSelector != nil {
+ in, out := &in.LabelSelector, &out.LabelSelector
+ *out = new(LabelSelectorAttributes)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -201,7 +258,7 @@ func (in *SelfSubjectAccessReviewSpec) DeepCopyInto(out *SelfSubjectAccessReview
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
@@ -299,7 +356,7 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) {
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
diff --git a/vendor/k8s.io/api/authorization/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/authorization/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..b0c0475b487
--- /dev/null
+++ b/vendor/k8s.io/api/authorization/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,46 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *LocalSubjectAccessReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *SelfSubjectAccessReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *SelfSubjectRulesReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *SubjectAccessReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 6
+}
diff --git a/vendor/k8s.io/api/authorization/v1beta1/generated.pb.go b/vendor/k8s.io/api/authorization/v1beta1/generated.pb.go
index 28642ba6380..5007d1b4963 100644
--- a/vendor/k8s.io/api/authorization/v1beta1/generated.pb.go
+++ b/vendor/k8s.io/api/authorization/v1beta1/generated.pb.go
@@ -26,6 +26,7 @@ import (
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
+ v11 "k8s.io/api/authorization/v1"
math "math"
math_bits "math/bits"
@@ -459,78 +460,82 @@ func init() {
}
var fileDescriptor_8eab727787743457 = []byte{
- // 1130 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0x1b, 0xc5,
- 0x17, 0xf7, 0xfa, 0x47, 0x62, 0x3f, 0x37, 0xdf, 0xa4, 0x13, 0xa5, 0xd9, 0xe6, 0x2b, 0x6c, 0xcb,
- 0x48, 0x28, 0x88, 0xb2, 0xdb, 0x44, 0x85, 0x94, 0x40, 0x0f, 0xb1, 0x12, 0x50, 0xa4, 0xb6, 0x54,
- 0x13, 0x25, 0x07, 0x2a, 0x01, 0xe3, 0xf5, 0xc4, 0x5e, 0x62, 0xef, 0x2e, 0x3b, 0xb3, 0x0e, 0x41,
- 0x1c, 0x7a, 0xe4, 0xc8, 0x91, 0x23, 0x27, 0xfe, 0x07, 0x2e, 0x48, 0x70, 0xca, 0xb1, 0xc7, 0x20,
- 0x21, 0x8b, 0x2c, 0x7f, 0x04, 0x57, 0x34, 0xb3, 0x63, 0xef, 0x3a, 0xd9, 0xc4, 0x49, 0x0e, 0xf4,
- 0xd2, 0x9b, 0xe7, 0x7d, 0x3e, 0xef, 0xcd, 0x7b, 0x6f, 0xde, 0x7b, 0xfb, 0x0c, 0xf7, 0x0f, 0x1e,
- 0x32, 0xc3, 0x76, 0x4d, 0xe2, 0xd9, 0x26, 0x09, 0x78, 0xc7, 0xf5, 0xed, 0x6f, 0x09, 0xb7, 0x5d,
- 0xc7, 0xec, 0xaf, 0x34, 0x29, 0x27, 0x2b, 0x66, 0x9b, 0x3a, 0xd4, 0x27, 0x9c, 0xb6, 0x0c, 0xcf,
- 0x77, 0xb9, 0x8b, 0x6a, 0x91, 0x86, 0x41, 0x3c, 0xdb, 0x18, 0xd3, 0x30, 0x94, 0xc6, 0xd2, 0xbb,
- 0x6d, 0x9b, 0x77, 0x82, 0xa6, 0x61, 0xb9, 0x3d, 0xb3, 0xed, 0xb6, 0x5d, 0x53, 0x2a, 0x36, 0x83,
- 0x7d, 0x79, 0x92, 0x07, 0xf9, 0x2b, 0x32, 0xb8, 0xf4, 0x20, 0x76, 0xa1, 0x47, 0xac, 0x8e, 0xed,
- 0x50, 0xff, 0xc8, 0xf4, 0x0e, 0xda, 0x42, 0xc0, 0xcc, 0x1e, 0xe5, 0xc4, 0xec, 0x9f, 0x73, 0x63,
- 0xc9, 0xbc, 0x48, 0xcb, 0x0f, 0x1c, 0x6e, 0xf7, 0xe8, 0x39, 0x85, 0xf7, 0x27, 0x29, 0x30, 0xab,
- 0x43, 0x7b, 0xe4, 0xac, 0x5e, 0x7d, 0x0d, 0x60, 0xeb, 0x1b, 0xee, 0x93, 0x3d, 0xd2, 0x0d, 0x28,
- 0xaa, 0x42, 0xc1, 0xe6, 0xb4, 0xc7, 0x74, 0xad, 0x96, 0x5b, 0x2e, 0x35, 0x4a, 0xe1, 0xa0, 0x5a,
- 0xd8, 0x16, 0x02, 0x1c, 0xc9, 0xd7, 0x8b, 0x3f, 0xfe, 0x54, 0xcd, 0xbc, 0xf8, 0xb3, 0x96, 0xa9,
- 0xff, 0x9a, 0x05, 0xfd, 0xb1, 0x6b, 0x91, 0xee, 0x4e, 0xd0, 0xfc, 0x8a, 0x5a, 0x7c, 0xc3, 0xb2,
- 0x28, 0x63, 0x98, 0xf6, 0x6d, 0x7a, 0x88, 0xbe, 0x84, 0xa2, 0x88, 0xac, 0x45, 0x38, 0xd1, 0xb5,
- 0x9a, 0xb6, 0x5c, 0x5e, 0xbd, 0x6f, 0xc4, 0x89, 0x1d, 0x39, 0x68, 0x78, 0x07, 0x6d, 0x21, 0x60,
- 0x86, 0x60, 0x1b, 0xfd, 0x15, 0xe3, 0x53, 0x69, 0xeb, 0x09, 0xe5, 0xa4, 0x81, 0x8e, 0x07, 0xd5,
- 0x4c, 0x38, 0xa8, 0x42, 0x2c, 0xc3, 0x23, 0xab, 0xe8, 0x39, 0xe4, 0x99, 0x47, 0x2d, 0x3d, 0x2b,
- 0xad, 0x7f, 0x60, 0x4c, 0x7a, 0x36, 0x23, 0xc5, 0xcd, 0x1d, 0x8f, 0x5a, 0x8d, 0x5b, 0xea, 0x9a,
- 0xbc, 0x38, 0x61, 0x69, 0x14, 0x59, 0x30, 0xc5, 0x38, 0xe1, 0x01, 0xd3, 0x73, 0xd2, 0xfc, 0x87,
- 0x37, 0x33, 0x2f, 0x4d, 0x34, 0xfe, 0xa7, 0x2e, 0x98, 0x8a, 0xce, 0x58, 0x99, 0xae, 0x3f, 0x87,
- 0x85, 0xa7, 0xae, 0x83, 0x29, 0x73, 0x03, 0xdf, 0xa2, 0x1b, 0x9c, 0xfb, 0x76, 0x33, 0xe0, 0x94,
- 0xa1, 0x1a, 0xe4, 0x3d, 0xc2, 0x3b, 0x32, 0x71, 0xa5, 0xd8, 0xbf, 0x67, 0x84, 0x77, 0xb0, 0x44,
- 0x04, 0xa3, 0x4f, 0xfd, 0xa6, 0x0c, 0x3e, 0xc1, 0xd8, 0xa3, 0x7e, 0x13, 0x4b, 0xa4, 0xfe, 0x35,
- 0xcc, 0x26, 0x8c, 0xe3, 0xa0, 0x2b, 0xdf, 0x56, 0x40, 0x63, 0x6f, 0x2b, 0x34, 0x18, 0x8e, 0xe4,
- 0xe8, 0x11, 0xcc, 0x3a, 0xb1, 0xce, 0x2e, 0x7e, 0xcc, 0xf4, 0xac, 0xa4, 0xce, 0x87, 0x83, 0x6a,
- 0xd2, 0x9c, 0x80, 0xf0, 0x59, 0xae, 0x28, 0x08, 0x94, 0x12, 0x8d, 0x09, 0x25, 0x87, 0xf4, 0x28,
- 0xf3, 0x88, 0x45, 0x55, 0x48, 0xb7, 0x95, 0xc3, 0xa5, 0xa7, 0x43, 0x00, 0xc7, 0x9c, 0xc9, 0xc1,
- 0xa1, 0x37, 0xa1, 0xd0, 0xf6, 0xdd, 0xc0, 0x93, 0xaf, 0x53, 0x6a, 0xcc, 0x28, 0x4a, 0xe1, 0x13,
- 0x21, 0xc4, 0x11, 0x86, 0xde, 0x86, 0xe9, 0x3e, 0xf5, 0x99, 0xed, 0x3a, 0x7a, 0x5e, 0xd2, 0x66,
- 0x15, 0x6d, 0x7a, 0x2f, 0x12, 0xe3, 0x21, 0x8e, 0xee, 0x41, 0xd1, 0x57, 0x8e, 0xeb, 0x05, 0xc9,
- 0x9d, 0x53, 0xdc, 0xe2, 0x28, 0x83, 0x23, 0x06, 0x7a, 0x0f, 0xca, 0x2c, 0x68, 0x8e, 0x14, 0xa6,
- 0xa4, 0xc2, 0xbc, 0x52, 0x28, 0xef, 0xc4, 0x10, 0x4e, 0xf2, 0x44, 0x58, 0x22, 0x46, 0x7d, 0x7a,
- 0x3c, 0x2c, 0x91, 0x02, 0x2c, 0x91, 0xfa, 0xef, 0x1a, 0xdc, 0xba, 0xde, 0x8b, 0xbd, 0x03, 0x25,
- 0xe2, 0xd9, 0x32, 0xec, 0xe1, 0x5b, 0xcd, 0x88, 0xbc, 0x6e, 0x3c, 0xdb, 0x8e, 0x84, 0x38, 0xc6,
- 0x05, 0x79, 0xe8, 0x8c, 0xa8, 0xeb, 0x11, 0x79, 0x78, 0x25, 0xc3, 0x31, 0x8e, 0xd6, 0x60, 0x66,
- 0x78, 0x90, 0x8f, 0xa4, 0xe7, 0xa5, 0xc2, 0xed, 0x70, 0x50, 0x9d, 0xc1, 0x49, 0x00, 0x8f, 0xf3,
- 0xea, 0xbf, 0x65, 0x61, 0x71, 0x87, 0x76, 0xf7, 0x5f, 0xcd, 0x54, 0xf8, 0x62, 0x6c, 0x2a, 0x3c,
- 0xba, 0x42, 0xdb, 0xa6, 0xbb, 0xfa, 0x6a, 0x27, 0xc3, 0xcf, 0x59, 0xf8, 0xff, 0x25, 0x8e, 0xa1,
- 0xef, 0x00, 0xf9, 0xe7, 0x1a, 0x4d, 0x65, 0xf4, 0xc1, 0x64, 0x87, 0xce, 0x37, 0x69, 0xe3, 0x4e,
- 0x38, 0xa8, 0xa6, 0x34, 0x2f, 0x4e, 0xb9, 0x07, 0x7d, 0xaf, 0xc1, 0x82, 0x93, 0x36, 0xb8, 0x54,
- 0xd6, 0xd7, 0x26, 0x7b, 0x90, 0x3a, 0xf7, 0x1a, 0x77, 0xc3, 0x41, 0x35, 0x7d, 0x24, 0xe2, 0xf4,
- 0x0b, 0xc5, 0xc8, 0xb9, 0x93, 0x48, 0x94, 0x68, 0x9a, 0xff, 0xae, 0xd6, 0x3e, 0x1f, 0xab, 0xb5,
- 0x8f, 0xae, 0x55, 0x6b, 0x09, 0x4f, 0x2f, 0x2c, 0xb5, 0xe6, 0x99, 0x52, 0x5b, 0xbf, 0x72, 0xa9,
- 0x25, 0xad, 0x5f, 0x5e, 0x69, 0x4f, 0x60, 0xe9, 0x62, 0xaf, 0xae, 0x3d, 0xba, 0xeb, 0xbf, 0x64,
- 0x61, 0xfe, 0xf5, 0x3a, 0x70, 0xb3, 0xa6, 0x3f, 0xc9, 0xc3, 0xe2, 0xeb, 0x86, 0xbf, 0xbc, 0xe1,
- 0xc5, 0x47, 0x34, 0x60, 0xd4, 0x57, 0x1f, 0xfe, 0xd1, 0x5b, 0xed, 0x32, 0xea, 0x63, 0x89, 0xa0,
- 0xda, 0x70, 0x37, 0x88, 0x3e, 0x58, 0x20, 0x32, 0xad, 0xbe, 0x85, 0x6a, 0x31, 0xb0, 0xa1, 0x40,
- 0xc5, 0xc6, 0xab, 0x17, 0x6a, 0xb9, 0xe5, 0xf2, 0xea, 0xe6, 0x8d, 0x6b, 0xc5, 0x90, 0x8b, 0xf3,
- 0x96, 0xc3, 0xfd, 0xa3, 0x78, 0x07, 0x91, 0x32, 0x1c, 0xdd, 0x80, 0xde, 0x80, 0x5c, 0x60, 0xb7,
- 0xd4, 0x8a, 0x50, 0x56, 0x94, 0xdc, 0xee, 0xf6, 0x26, 0x16, 0xf2, 0xa5, 0x7d, 0xb5, 0x7b, 0x4b,
- 0x13, 0x68, 0x0e, 0x72, 0x07, 0xf4, 0x28, 0xea, 0x33, 0x2c, 0x7e, 0xa2, 0x06, 0x14, 0xfa, 0x62,
- 0x2d, 0x57, 0x79, 0xbe, 0x37, 0xd9, 0xd3, 0x78, 0x95, 0xc7, 0x91, 0xea, 0x7a, 0xf6, 0xa1, 0x56,
- 0xff, 0x43, 0x83, 0xbb, 0x17, 0x16, 0xa4, 0x58, 0x94, 0x48, 0xb7, 0xeb, 0x1e, 0xd2, 0x96, 0xbc,
- 0xbb, 0x18, 0x2f, 0x4a, 0x1b, 0x91, 0x18, 0x0f, 0x71, 0xf4, 0x16, 0x4c, 0xb5, 0xa8, 0x63, 0xd3,
- 0x96, 0x5c, 0xa9, 0x8a, 0x71, 0x2d, 0x6f, 0x4a, 0x29, 0x56, 0xa8, 0xe0, 0xf9, 0x94, 0x30, 0xd7,
- 0x51, 0x4b, 0xdc, 0x88, 0x87, 0xa5, 0x14, 0x2b, 0x14, 0x6d, 0xc0, 0x2c, 0x15, 0x6e, 0xca, 0x20,
- 0xb6, 0x7c, 0xdf, 0x1d, 0xbe, 0xec, 0xa2, 0x52, 0x98, 0xdd, 0x1a, 0x87, 0xf1, 0x59, 0x7e, 0xfd,
- 0x9f, 0x2c, 0xe8, 0x17, 0x8d, 0x3d, 0x74, 0x10, 0x6f, 0x31, 0x12, 0x94, 0x8b, 0x54, 0x79, 0xd5,
- 0xb8, 0x7a, 0xcb, 0x08, 0xb5, 0xc6, 0x82, 0xf2, 0x66, 0x26, 0x29, 0x4d, 0x6c, 0x3e, 0xf2, 0x88,
- 0x0e, 0x61, 0xce, 0x19, 0x5f, 0xb9, 0xa3, 0x9d, 0xac, 0xbc, 0xba, 0x72, 0xad, 0x06, 0x91, 0x57,
- 0xea, 0xea, 0xca, 0xb9, 0x33, 0x00, 0xc3, 0xe7, 0x2e, 0x41, 0xab, 0x00, 0xb6, 0x63, 0xb9, 0x3d,
- 0xaf, 0x4b, 0x39, 0x95, 0x09, 0x2c, 0xc6, 0xd3, 0x72, 0x7b, 0x84, 0xe0, 0x04, 0x2b, 0x2d, 0xf3,
- 0xf9, 0xeb, 0x65, 0xbe, 0xf1, 0xf1, 0xf1, 0x69, 0x25, 0xf3, 0xf2, 0xb4, 0x92, 0x39, 0x39, 0xad,
- 0x64, 0x5e, 0x84, 0x15, 0xed, 0x38, 0xac, 0x68, 0x2f, 0xc3, 0x8a, 0x76, 0x12, 0x56, 0xb4, 0xbf,
- 0xc2, 0x8a, 0xf6, 0xc3, 0xdf, 0x95, 0xcc, 0x67, 0xb5, 0x49, 0xff, 0xc0, 0xff, 0x0d, 0x00, 0x00,
- 0xff, 0xff, 0xcd, 0x08, 0x09, 0x84, 0xa4, 0x0f, 0x00, 0x00,
+ // 1192 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4f, 0x6f, 0xe3, 0x44,
+ 0x14, 0x8f, 0xf3, 0xa7, 0x4d, 0x26, 0x1b, 0xda, 0x9d, 0xaa, 0x5b, 0x6f, 0x11, 0x49, 0x14, 0x24,
+ 0x54, 0xb4, 0x8b, 0xb3, 0xad, 0x0a, 0x5d, 0x0a, 0x7b, 0xa8, 0xd5, 0x2e, 0xaa, 0xd4, 0x5d, 0x56,
+ 0x53, 0xb5, 0x07, 0x56, 0x02, 0x26, 0xce, 0x34, 0x31, 0x75, 0x6c, 0xe3, 0x19, 0xa7, 0x14, 0x71,
+ 0xd8, 0x23, 0x47, 0x8e, 0x1c, 0x38, 0x70, 0xe2, 0x3b, 0x70, 0x41, 0x82, 0x53, 0x8f, 0x7b, 0x2c,
+ 0x12, 0x8a, 0xa8, 0xf9, 0x10, 0x5c, 0xd1, 0x8c, 0x27, 0xb1, 0x9d, 0xba, 0x4d, 0xdb, 0x03, 0x7b,
+ 0xd9, 0x5b, 0xe6, 0xfd, 0x7e, 0xef, 0xcf, 0xbc, 0x79, 0xf3, 0xfc, 0x26, 0xe0, 0xc1, 0xe1, 0x43,
+ 0xaa, 0x99, 0x4e, 0x13, 0xbb, 0x66, 0x13, 0xfb, 0xac, 0xeb, 0x78, 0xe6, 0xb7, 0x98, 0x99, 0x8e,
+ 0xdd, 0xec, 0x2f, 0xb7, 0x08, 0xc3, 0xcb, 0xcd, 0x0e, 0xb1, 0x89, 0x87, 0x19, 0x69, 0x6b, 0xae,
+ 0xe7, 0x30, 0x07, 0xd6, 0x43, 0x0d, 0x0d, 0xbb, 0xa6, 0x96, 0xd0, 0xd0, 0xa4, 0xc6, 0xe2, 0x7b,
+ 0x1d, 0x93, 0x75, 0xfd, 0x96, 0x66, 0x38, 0xbd, 0x66, 0xc7, 0xe9, 0x38, 0x4d, 0xa1, 0xd8, 0xf2,
+ 0x0f, 0xc4, 0x4a, 0x2c, 0xc4, 0xaf, 0xd0, 0xe0, 0xe2, 0xbd, 0x4b, 0x42, 0x18, 0xf7, 0xbe, 0xb8,
+ 0x1a, 0x91, 0x7b, 0xd8, 0xe8, 0x9a, 0x36, 0xf1, 0x8e, 0x9b, 0xee, 0x61, 0x87, 0x0b, 0x68, 0xb3,
+ 0x47, 0x18, 0x4e, 0xd3, 0x6a, 0x5e, 0xa4, 0xe5, 0xf9, 0x36, 0x33, 0x7b, 0xe4, 0x9c, 0xc2, 0x07,
+ 0x93, 0x14, 0xa8, 0xd1, 0x25, 0x3d, 0x3c, 0xae, 0xd7, 0x58, 0x03, 0x60, 0xeb, 0x1b, 0xe6, 0xe1,
+ 0x7d, 0x6c, 0xf9, 0x04, 0xd6, 0x40, 0xc1, 0x64, 0xa4, 0x47, 0x55, 0xa5, 0x9e, 0x5b, 0x2a, 0xe9,
+ 0xa5, 0x60, 0x50, 0x2b, 0x6c, 0x73, 0x01, 0x0a, 0xe5, 0xeb, 0xc5, 0x1f, 0x7f, 0xae, 0x65, 0x5e,
+ 0xfc, 0x55, 0xcf, 0x34, 0x7e, 0xcb, 0x02, 0x75, 0xc7, 0x31, 0xb0, 0xb5, 0xeb, 0xb7, 0xbe, 0x22,
+ 0x06, 0xdb, 0x30, 0x0c, 0x42, 0x29, 0x22, 0x7d, 0x93, 0x1c, 0xc1, 0x2f, 0x41, 0x91, 0xef, 0xac,
+ 0x8d, 0x19, 0x56, 0x95, 0xba, 0xb2, 0x54, 0x5e, 0x79, 0xa0, 0x45, 0xa7, 0x30, 0x0a, 0x50, 0x73,
+ 0x0f, 0x3b, 0x5c, 0x40, 0x35, 0xce, 0xd6, 0xfa, 0xcb, 0xda, 0xa7, 0xc2, 0xd6, 0x13, 0xc2, 0xb0,
+ 0x0e, 0x4f, 0x06, 0xb5, 0x4c, 0x30, 0xa8, 0x81, 0x48, 0x86, 0x46, 0x56, 0xe1, 0x73, 0x90, 0xa7,
+ 0x2e, 0x31, 0xd4, 0xac, 0xb0, 0xfe, 0xa1, 0x36, 0xe9, 0x8c, 0xb5, 0x94, 0x30, 0x77, 0x5d, 0x62,
+ 0xe8, 0xb7, 0xa4, 0x9b, 0x3c, 0x5f, 0x21, 0x61, 0x14, 0x1a, 0x60, 0x8a, 0x32, 0xcc, 0x7c, 0xaa,
+ 0xe6, 0x84, 0xf9, 0x8f, 0x6e, 0x66, 0x5e, 0x98, 0xd0, 0xdf, 0x90, 0x0e, 0xa6, 0xc2, 0x35, 0x92,
+ 0xa6, 0x1b, 0xcf, 0xc1, 0xfc, 0x53, 0xc7, 0x46, 0x84, 0x3a, 0xbe, 0x67, 0x90, 0x0d, 0xc6, 0x3c,
+ 0xb3, 0xe5, 0x33, 0x42, 0x61, 0x1d, 0xe4, 0x5d, 0xcc, 0xba, 0x22, 0x71, 0xa5, 0x28, 0xbe, 0x67,
+ 0x98, 0x75, 0x91, 0x40, 0x38, 0xa3, 0x4f, 0xbc, 0x96, 0xd8, 0x7c, 0x8c, 0xb1, 0x4f, 0xbc, 0x16,
+ 0x12, 0x48, 0xe3, 0x6b, 0x30, 0x13, 0x33, 0x8e, 0x7c, 0x4b, 0x9c, 0x2d, 0x87, 0x12, 0x67, 0xcb,
+ 0x35, 0x28, 0x0a, 0xe5, 0xf0, 0x11, 0x98, 0xb1, 0x23, 0x9d, 0x3d, 0xb4, 0x43, 0xd5, 0xac, 0xa0,
+ 0xce, 0x05, 0x83, 0x5a, 0xdc, 0x1c, 0x87, 0xd0, 0x38, 0xb7, 0xf1, 0x53, 0x1e, 0xc0, 0x94, 0xdd,
+ 0x34, 0x41, 0xc9, 0xc6, 0x3d, 0x42, 0x5d, 0x6c, 0x10, 0xb9, 0xa5, 0xdb, 0x32, 0xe0, 0xd2, 0xd3,
+ 0x21, 0x80, 0x22, 0xce, 0xe4, 0xcd, 0xc1, 0xb7, 0x41, 0xa1, 0xe3, 0x39, 0xbe, 0x2b, 0x4e, 0xa7,
+ 0xa4, 0x57, 0x24, 0xa5, 0xf0, 0x09, 0x17, 0xa2, 0x10, 0x83, 0xef, 0x82, 0xe9, 0x3e, 0xf1, 0xa8,
+ 0xe9, 0xd8, 0x6a, 0x5e, 0xd0, 0x66, 0x24, 0x6d, 0x7a, 0x3f, 0x14, 0xa3, 0x21, 0x0e, 0xef, 0x83,
+ 0xa2, 0x27, 0x03, 0x57, 0x0b, 0x82, 0x3b, 0x2b, 0xb9, 0xc5, 0x51, 0x06, 0x47, 0x0c, 0xf8, 0x3e,
+ 0x28, 0x53, 0xbf, 0x35, 0x52, 0x98, 0x12, 0x0a, 0x73, 0x52, 0xa1, 0xbc, 0x1b, 0x41, 0x28, 0xce,
+ 0xe3, 0xdb, 0xe2, 0x7b, 0x54, 0xa7, 0x93, 0xdb, 0xe2, 0x29, 0x40, 0x02, 0x81, 0x3d, 0x50, 0x39,
+ 0x30, 0x89, 0xd5, 0xde, 0x25, 0x16, 0x31, 0x98, 0xe3, 0xa9, 0x45, 0x51, 0x7c, 0xab, 0x97, 0x15,
+ 0x9f, 0xf6, 0x38, 0xae, 0x11, 0xa5, 0x5d, 0xbf, 0x1d, 0x0c, 0x6a, 0x95, 0x04, 0x88, 0x92, 0xd6,
+ 0xb9, 0x3b, 0x0b, 0xb7, 0x88, 0x35, 0x72, 0x57, 0xba, 0x82, 0xbb, 0x9d, 0xb8, 0xc6, 0xb8, 0xbb,
+ 0x04, 0x88, 0x92, 0xd6, 0x1b, 0x7f, 0x28, 0xe0, 0xd6, 0xf5, 0xea, 0xf1, 0x1e, 0x28, 0x61, 0xd7,
+ 0x14, 0x87, 0x3a, 0xac, 0xc4, 0x0a, 0xaf, 0x9a, 0x8d, 0x67, 0xdb, 0xa1, 0x10, 0x45, 0x38, 0x27,
+ 0x0f, 0x53, 0xcd, 0x6f, 0xed, 0x88, 0x3c, 0x74, 0x49, 0x51, 0x84, 0xc3, 0x35, 0x50, 0x19, 0x2e,
+ 0x44, 0x09, 0xaa, 0x79, 0xa1, 0x20, 0x36, 0x81, 0xe2, 0x00, 0x4a, 0xf2, 0x1a, 0xbf, 0x67, 0xc1,
+ 0xc2, 0x2e, 0xb1, 0x0e, 0x5e, 0x4d, 0xcf, 0xfb, 0x22, 0xd1, 0xf3, 0x1e, 0x5d, 0xa1, 0x29, 0xa5,
+ 0x87, 0xfa, 0x6a, 0xfb, 0xde, 0x2f, 0x59, 0xf0, 0xe6, 0x25, 0x81, 0xc1, 0xef, 0x00, 0xf4, 0xce,
+ 0xb5, 0x11, 0x99, 0xd1, 0xd5, 0xc9, 0x01, 0x9d, 0x6f, 0x41, 0xfa, 0x9d, 0x60, 0x50, 0x4b, 0x69,
+ 0x4d, 0x28, 0xc5, 0x0f, 0xfc, 0x5e, 0x01, 0xf3, 0x76, 0x5a, 0x5b, 0x96, 0x59, 0x5f, 0x9b, 0x1c,
+ 0x41, 0x6a, 0x57, 0xd7, 0xef, 0x06, 0x83, 0x5a, 0x7a, 0xc3, 0x47, 0xe9, 0x0e, 0xf9, 0x17, 0xf6,
+ 0x4e, 0x2c, 0x51, 0xfc, 0xd2, 0xfc, 0x7f, 0xb5, 0xf6, 0x79, 0xa2, 0xd6, 0x3e, 0xbe, 0x56, 0xad,
+ 0xc5, 0x22, 0xbd, 0xb0, 0xd4, 0x5a, 0x63, 0xa5, 0xb6, 0x7e, 0xe5, 0x52, 0x8b, 0x5b, 0xbf, 0xbc,
+ 0xd2, 0x9e, 0x80, 0xc5, 0x8b, 0xa3, 0xba, 0xf6, 0x87, 0xa9, 0xf1, 0x6b, 0x16, 0xcc, 0xbd, 0x1e,
+ 0x76, 0x6e, 0x76, 0xe9, 0x4f, 0xf3, 0x60, 0xe1, 0xf5, 0x85, 0xbf, 0xfc, 0xc2, 0xf3, 0x11, 0xc1,
+ 0xa7, 0xc4, 0x93, 0x63, 0xcd, 0xe8, 0xac, 0xf6, 0x28, 0xf1, 0x90, 0x40, 0x60, 0x7d, 0x38, 0xf9,
+ 0x84, 0x1f, 0x2c, 0xc0, 0x33, 0x2d, 0xbf, 0x85, 0x72, 0xec, 0x31, 0x41, 0x81, 0xf0, 0x79, 0x5e,
+ 0x2d, 0xd4, 0x73, 0x4b, 0xe5, 0x95, 0xcd, 0x1b, 0xd7, 0x8a, 0x26, 0x9e, 0x05, 0x5b, 0x36, 0xf3,
+ 0x8e, 0xa3, 0x09, 0x4b, 0xc8, 0x50, 0xe8, 0x01, 0xbe, 0x05, 0x72, 0xbe, 0xd9, 0x96, 0x03, 0x50,
+ 0x59, 0x52, 0x72, 0x7b, 0xdb, 0x9b, 0x88, 0xcb, 0x17, 0x0f, 0xe4, 0xcb, 0x42, 0x98, 0x80, 0xb3,
+ 0x20, 0x77, 0x48, 0x8e, 0xc3, 0x7b, 0x86, 0xf8, 0x4f, 0xa8, 0x83, 0x42, 0x9f, 0x3f, 0x3a, 0x64,
+ 0x9e, 0xef, 0x4f, 0x8e, 0x34, 0x7a, 0xa8, 0xa0, 0x50, 0x75, 0x3d, 0xfb, 0x50, 0x69, 0xfc, 0xa9,
+ 0x80, 0xbb, 0x17, 0x16, 0x24, 0x1f, 0x03, 0xb1, 0x65, 0x39, 0x47, 0xa4, 0x2d, 0x7c, 0x17, 0xa3,
+ 0x31, 0x70, 0x23, 0x14, 0xa3, 0x21, 0x0e, 0xdf, 0x01, 0x53, 0x6d, 0x62, 0x9b, 0xa4, 0x2d, 0x06,
+ 0xc6, 0x62, 0x54, 0xcb, 0x9b, 0x42, 0x8a, 0x24, 0xca, 0x79, 0x1e, 0xc1, 0xd4, 0xb1, 0xe5, 0x88,
+ 0x3a, 0xe2, 0x21, 0x21, 0x45, 0x12, 0x85, 0x1b, 0x60, 0x86, 0xf0, 0x30, 0xc5, 0x26, 0xb6, 0x3c,
+ 0xcf, 0x19, 0x9e, 0xec, 0x82, 0x54, 0x98, 0xd9, 0x4a, 0xc2, 0x68, 0x9c, 0xdf, 0xf8, 0x37, 0x0b,
+ 0xd4, 0x8b, 0xda, 0x1e, 0x3c, 0x8c, 0xa6, 0x18, 0x01, 0x8a, 0x41, 0xaa, 0xbc, 0xa2, 0x5d, 0xfd,
+ 0xca, 0x70, 0x35, 0x7d, 0x5e, 0x46, 0x53, 0x89, 0x4b, 0x63, 0x93, 0x8f, 0x58, 0xc2, 0x23, 0x30,
+ 0x6b, 0x27, 0x1f, 0x14, 0xe1, 0x4c, 0x56, 0x5e, 0x59, 0xbe, 0xd6, 0x05, 0x11, 0x2e, 0x55, 0xe9,
+ 0x72, 0x76, 0x0c, 0xa0, 0xe8, 0x9c, 0x13, 0xb8, 0x02, 0x80, 0x69, 0x1b, 0x4e, 0xcf, 0xb5, 0x08,
+ 0x23, 0x22, 0x81, 0xc5, 0xa8, 0x5b, 0x6e, 0x8f, 0x10, 0x14, 0x63, 0xa5, 0x65, 0x3e, 0x7f, 0xbd,
+ 0xcc, 0xeb, 0x8f, 0x4f, 0xce, 0xaa, 0x99, 0x97, 0x67, 0xd5, 0xcc, 0xe9, 0x59, 0x35, 0xf3, 0x22,
+ 0xa8, 0x2a, 0x27, 0x41, 0x55, 0x79, 0x19, 0x54, 0x95, 0xd3, 0xa0, 0xaa, 0xfc, 0x1d, 0x54, 0x95,
+ 0x1f, 0xfe, 0xa9, 0x66, 0x3e, 0xab, 0x4f, 0xfa, 0x33, 0xe2, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0x46, 0xf7, 0xe0, 0x3d, 0xaf, 0x10, 0x00, 0x00,
}
func (m ExtraValue) Marshal() (dAtA []byte, err error) {
@@ -712,6 +717,30 @@ func (m *ResourceAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.LabelSelector != nil {
+ {
+ size, err := m.LabelSelector.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x4a
+ }
+ if m.FieldSelector != nil {
+ {
+ size, err := m.FieldSelector.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x42
+ }
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
@@ -1346,6 +1375,14 @@ func (m *ResourceAttributes) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = len(m.Name)
n += 1 + l + sovGenerated(uint64(l))
+ if m.FieldSelector != nil {
+ l = m.FieldSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.LabelSelector != nil {
+ l = m.LabelSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -1582,6 +1619,8 @@ func (this *ResourceAttributes) String() string {
`Resource:` + fmt.Sprintf("%v", this.Resource) + `,`,
`Subresource:` + fmt.Sprintf("%v", this.Subresource) + `,`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `FieldSelector:` + strings.Replace(fmt.Sprintf("%v", this.FieldSelector), "FieldSelectorAttributes", "v11.FieldSelectorAttributes", 1) + `,`,
+ `LabelSelector:` + strings.Replace(fmt.Sprintf("%v", this.LabelSelector), "LabelSelectorAttributes", "v11.LabelSelectorAttributes", 1) + `,`,
`}`,
}, "")
return s
@@ -2437,6 +2476,78 @@ func (m *ResourceAttributes) Unmarshal(dAtA []byte) error {
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
+ case 8:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field FieldSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.FieldSelector == nil {
+ m.FieldSelector = &v11.FieldSelectorAttributes{}
+ }
+ if err := m.FieldSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 9:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.LabelSelector == nil {
+ m.LabelSelector = &v11.LabelSelectorAttributes{}
+ }
+ if err := m.LabelSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
diff --git a/vendor/k8s.io/api/authorization/v1beta1/generated.proto b/vendor/k8s.io/api/authorization/v1beta1/generated.proto
index 43bea7aa12d..8738768b890 100644
--- a/vendor/k8s.io/api/authorization/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/authorization/v1beta1/generated.proto
@@ -21,6 +21,7 @@ syntax = "proto2";
package k8s.io.api.authorization.v1beta1;
+import "k8s.io/api/authorization/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
@@ -44,7 +45,7 @@ message LocalSubjectAccessReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace
// you made the request against. If empty, it is defaulted.
@@ -111,6 +112,14 @@ message ResourceAttributes {
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
// +optional
optional string name = 7;
+
+ // fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.
+ // +optional
+ optional .k8s.io.api.authorization.v1.FieldSelectorAttributes fieldSelector = 8;
+
+ // labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.
+ // +optional
+ optional .k8s.io.api.authorization.v1.LabelSelectorAttributes labelSelector = 9;
}
// ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant,
@@ -145,7 +154,7 @@ message SelfSubjectAccessReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated. user and groups must be empty
optional SelfSubjectAccessReviewSpec spec = 2;
@@ -177,7 +186,7 @@ message SelfSubjectRulesReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated.
optional SelfSubjectRulesReviewSpec spec = 2;
@@ -198,7 +207,7 @@ message SubjectAccessReview {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional SubjectAccessReviewSpec spec = 2;
diff --git a/vendor/k8s.io/api/authorization/v1beta1/types.go b/vendor/k8s.io/api/authorization/v1beta1/types.go
index ef3a501b058..8b8e5a98678 100644
--- a/vendor/k8s.io/api/authorization/v1beta1/types.go
+++ b/vendor/k8s.io/api/authorization/v1beta1/types.go
@@ -19,6 +19,7 @@ package v1beta1
import (
"fmt"
+ authorizationv1 "k8s.io/api/authorization/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -124,6 +125,12 @@ type ResourceAttributes struct {
// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,7,opt,name=name"`
+ // fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.
+ // +optional
+ FieldSelector *authorizationv1.FieldSelectorAttributes `json:"fieldSelector,omitempty" protobuf:"bytes,8,opt,name=fieldSelector"`
+ // labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.
+ // +optional
+ LabelSelector *authorizationv1.LabelSelectorAttributes `json:"labelSelector,omitempty" protobuf:"bytes,9,opt,name=labelSelector"`
}
// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
diff --git a/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go
index e0846be7a4d..bb1352a2d9d 100644
--- a/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go
@@ -59,14 +59,16 @@ func (NonResourceRule) SwaggerDoc() map[string]string {
}
var map_ResourceAttributes = map[string]string{
- "": "ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface",
- "namespace": "Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces \"\" (empty) is defaulted for LocalSubjectAccessReviews \"\" (empty) is empty for cluster-scoped resources \"\" (empty) means \"all\" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview",
- "verb": "Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. \"*\" means all.",
- "group": "Group is the API Group of the Resource. \"*\" means all.",
- "version": "Version is the API Version of the Resource. \"*\" means all.",
- "resource": "Resource is one of the existing resource types. \"*\" means all.",
- "subresource": "Subresource is one of the existing resource types. \"\" means none.",
- "name": "Name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all.",
+ "": "ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface",
+ "namespace": "Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces \"\" (empty) is defaulted for LocalSubjectAccessReviews \"\" (empty) is empty for cluster-scoped resources \"\" (empty) means \"all\" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview",
+ "verb": "Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. \"*\" means all.",
+ "group": "Group is the API Group of the Resource. \"*\" means all.",
+ "version": "Version is the API Version of the Resource. \"*\" means all.",
+ "resource": "Resource is one of the existing resource types. \"*\" means all.",
+ "subresource": "Subresource is one of the existing resource types. \"\" means none.",
+ "name": "Name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all.",
+ "fieldSelector": "fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.",
+ "labelSelector": "labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.",
}
func (ResourceAttributes) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go
index 13f09cf2d27..d76993dba4d 100644
--- a/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go
@@ -22,6 +22,7 @@ limitations under the License.
package v1beta1
import (
+ v1 "k8s.io/api/authorization/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -118,6 +119,16 @@ func (in *NonResourceRule) DeepCopy() *NonResourceRule {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceAttributes) DeepCopyInto(out *ResourceAttributes) {
*out = *in
+ if in.FieldSelector != nil {
+ in, out := &in.FieldSelector, &out.FieldSelector
+ *out = new(v1.FieldSelectorAttributes)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.LabelSelector != nil {
+ in, out := &in.LabelSelector, &out.LabelSelector
+ *out = new(v1.LabelSelectorAttributes)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -201,7 +212,7 @@ func (in *SelfSubjectAccessReviewSpec) DeepCopyInto(out *SelfSubjectAccessReview
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
@@ -299,7 +310,7 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) {
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
diff --git a/vendor/k8s.io/api/autoscaling/v1/doc.go b/vendor/k8s.io/api/autoscaling/v1/doc.go
index 8c9c09b5cb4..d64c9cbc1a4 100644
--- a/vendor/k8s.io/api/autoscaling/v1/doc.go
+++ b/vendor/k8s.io/api/autoscaling/v1/doc.go
@@ -17,5 +17,6 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
package v1 // import "k8s.io/api/autoscaling/v1"
diff --git a/vendor/k8s.io/api/autoscaling/v1/generated.proto b/vendor/k8s.io/api/autoscaling/v1/generated.proto
index 1dbafd1a531..0a961312f41 100644
--- a/vendor/k8s.io/api/autoscaling/v1/generated.proto
+++ b/vendor/k8s.io/api/autoscaling/v1/generated.proto
@@ -51,7 +51,7 @@ message ContainerResourceMetricSource {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
// container is the name of the container in the pods of the scaling target.
optional string container = 5;
@@ -78,7 +78,7 @@ message ContainerResourceMetricStatus {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// It will always be set, regardless of the corresponding metric specification.
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
// container is the name of the container in the pods of the scaling taget
optional string container = 4;
@@ -108,17 +108,17 @@ message ExternalMetricSource {
// metricSelector is used to identify a specific time series
// within a given metric.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
// targetValue is the target value of the metric (as a quantity).
// Mutually exclusive with TargetAverageValue.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
// targetAverageValue is the target per-pod value of global metric (as a quantity).
// Mutually exclusive with TargetValue.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
}
// ExternalMetricStatus indicates the current value of a global metric
@@ -131,21 +131,21 @@ message ExternalMetricStatus {
// metricSelector is used to identify a specific time series
// within a given metric.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
// currentValue is the current value of the metric (as a quantity)
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
// currentAverageValue is the current value of metric averaged over autoscaled pods.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
}
// configuration of a horizontal pod autoscaler.
message HorizontalPodAutoscaler {
// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
// +optional
@@ -168,7 +168,7 @@ message HorizontalPodAutoscalerCondition {
// lastTransitionTime is the last time the condition transitioned from
// one status to another
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// reason is the reason for the condition's last transition.
// +optional
@@ -184,7 +184,7 @@ message HorizontalPodAutoscalerCondition {
message HorizontalPodAutoscalerList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of horizontal pod autoscaler objects.
repeated HorizontalPodAutoscaler items = 2;
@@ -222,7 +222,7 @@ message HorizontalPodAutoscalerStatus {
// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
// currentReplicas is the current number of replicas of pods managed by this autoscaler.
optional int32 currentReplicas = 3;
@@ -336,18 +336,18 @@ message ObjectMetricSource {
optional string metricName = 2;
// targetValue is the target value of the metric (as a quantity).
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric.
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
// averageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// ObjectMetricStatus indicates the current value of a metric describing a
@@ -360,18 +360,18 @@ message ObjectMetricStatus {
optional string metricName = 2;
// currentValue is the current value of the metric (as a quantity).
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
// When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
// averageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// PodsMetricSource indicates how to scale on a metric describing each pod in
@@ -384,13 +384,13 @@ message PodsMetricSource {
// targetAverageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// PodsMetricStatus indicates the current value of a metric describing each pod in
@@ -401,13 +401,13 @@ message PodsMetricStatus {
// currentAverageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
// When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// ResourceMetricSource indicates how to scale on a resource metric known to
@@ -431,7 +431,7 @@ message ResourceMetricSource {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
}
// ResourceMetricStatus indicates the current value of a resource metric known to
@@ -455,14 +455,14 @@ message ResourceMetricStatus {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// It will always be set, regardless of the corresponding metric specification.
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
}
// Scale represents a scaling request for a resource.
message Scale {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
// +optional
diff --git a/vendor/k8s.io/api/autoscaling/v1/types.go b/vendor/k8s.io/api/autoscaling/v1/types.go
index 45082901764..b31425b3b74 100644
--- a/vendor/k8s.io/api/autoscaling/v1/types.go
+++ b/vendor/k8s.io/api/autoscaling/v1/types.go
@@ -83,6 +83,7 @@ type HorizontalPodAutoscalerStatus struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// configuration of a horizontal pod autoscaler.
type HorizontalPodAutoscaler struct {
@@ -101,6 +102,7 @@ type HorizontalPodAutoscaler struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// list of horizontal pod autoscaler objects.
type HorizontalPodAutoscalerList struct {
@@ -114,6 +116,7 @@ type HorizontalPodAutoscalerList struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// Scale represents a scaling request for a resource.
type Scale struct {
diff --git a/vendor/k8s.io/api/autoscaling/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/autoscaling/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..36d86a5ec31
--- /dev/null
+++ b/vendor/k8s.io/api/autoscaling/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,40 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *HorizontalPodAutoscaler) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *HorizontalPodAutoscalerList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Scale) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
diff --git a/vendor/k8s.io/api/autoscaling/v2/doc.go b/vendor/k8s.io/api/autoscaling/v2/doc.go
index f96a059b6c7..aafa2d4de2c 100644
--- a/vendor/k8s.io/api/autoscaling/v2/doc.go
+++ b/vendor/k8s.io/api/autoscaling/v2/doc.go
@@ -17,5 +17,6 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
package v2 // import "k8s.io/api/autoscaling/v2"
diff --git a/vendor/k8s.io/api/autoscaling/v2/generated.proto b/vendor/k8s.io/api/autoscaling/v2/generated.proto
index a9e36975fca..8f2ee58031e 100644
--- a/vendor/k8s.io/api/autoscaling/v2/generated.proto
+++ b/vendor/k8s.io/api/autoscaling/v2/generated.proto
@@ -147,7 +147,7 @@ message HorizontalPodAutoscaler {
// metadata is the standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the specification for the behaviour of the autoscaler.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
@@ -190,7 +190,7 @@ message HorizontalPodAutoscalerCondition {
// lastTransitionTime is the last time the condition transitioned from
// one status to another
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// reason is the reason for the condition's last transition.
// +optional
@@ -206,7 +206,7 @@ message HorizontalPodAutoscalerCondition {
message HorizontalPodAutoscalerList {
// metadata is the standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of horizontal pod autoscaler objects.
repeated HorizontalPodAutoscaler items = 2;
@@ -258,7 +258,7 @@ message HorizontalPodAutoscalerStatus {
// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
// used by the autoscaler to control how often the number of pods is changed.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
// currentReplicas is current number of replicas of pods managed by this autoscaler,
// as last seen by the autoscaler.
@@ -293,7 +293,7 @@ message MetricIdentifier {
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
}
// MetricSpec specifies how to scale based on a single metric
@@ -393,12 +393,12 @@ message MetricTarget {
// value is the target value of the metric (as a quantity).
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 2;
// averageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3;
// averageUtilization is the target value of the average of the
// resource metric across all relevant pods, represented as a percentage of
@@ -412,12 +412,12 @@ message MetricTarget {
message MetricValueStatus {
// value is the current value of the metric (as a quantity).
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
// averageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2;
// currentAverageUtilization is the current value of the average of the
// resource metric across all relevant pods, represented as a percentage of
diff --git a/vendor/k8s.io/api/autoscaling/v2/types.go b/vendor/k8s.io/api/autoscaling/v2/types.go
index c12a83df1bf..69a7b27012c 100644
--- a/vendor/k8s.io/api/autoscaling/v2/types.go
+++ b/vendor/k8s.io/api/autoscaling/v2/types.go
@@ -26,6 +26,7 @@ import (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.23
// HorizontalPodAutoscaler is the configuration for a horizontal pod
// autoscaler, which automatically manages the replica count of any resource
@@ -573,6 +574,7 @@ type MetricValueStatus struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.23
// HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
type HorizontalPodAutoscalerList struct {
diff --git a/vendor/k8s.io/api/autoscaling/v2/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/autoscaling/v2/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..99ae7486512
--- /dev/null
+++ b/vendor/k8s.io/api/autoscaling/v2/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v2
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *HorizontalPodAutoscaler) APILifecycleIntroduced() (major, minor int) {
+ return 1, 23
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *HorizontalPodAutoscalerList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 23
+}
diff --git a/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto b/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto
index e2119d5550d..232a5981584 100644
--- a/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto
+++ b/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto
@@ -51,7 +51,7 @@ message ContainerResourceMetricSource {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
// container is the name of the container in the pods of the scaling target
optional string container = 4;
@@ -78,7 +78,7 @@ message ContainerResourceMetricStatus {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// It will always be set, regardless of the corresponding metric specification.
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
// container is the name of the container in the pods of the scaling target
optional string container = 4;
@@ -108,17 +108,17 @@ message ExternalMetricSource {
// metricSelector is used to identify a specific time series
// within a given metric.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
// targetValue is the target value of the metric (as a quantity).
// Mutually exclusive with TargetAverageValue.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
// targetAverageValue is the target per-pod value of global metric (as a quantity).
// Mutually exclusive with TargetValue.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
}
// ExternalMetricStatus indicates the current value of a global metric
@@ -131,14 +131,14 @@ message ExternalMetricStatus {
// metricSelector is used to identify a specific time series
// within a given metric.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
// currentValue is the current value of the metric (as a quantity)
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
// currentAverageValue is the current value of metric averaged over autoscaled pods.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
}
// HorizontalPodAutoscaler is the configuration for a horizontal pod
@@ -148,7 +148,7 @@ message HorizontalPodAutoscaler {
// metadata is the standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the specification for the behaviour of the autoscaler.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
@@ -172,7 +172,7 @@ message HorizontalPodAutoscalerCondition {
// lastTransitionTime is the last time the condition transitioned from
// one status to another
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// reason is the reason for the condition's last transition.
// +optional
@@ -188,7 +188,7 @@ message HorizontalPodAutoscalerCondition {
message HorizontalPodAutoscalerList {
// metadata is the standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of horizontal pod autoscaler objects.
repeated HorizontalPodAutoscaler items = 2;
@@ -233,7 +233,7 @@ message HorizontalPodAutoscalerStatus {
// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
// used by the autoscaler to control how often the number of pods is changed.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
// currentReplicas is current number of replicas of pods managed by this autoscaler,
// as last seen by the autoscaler.
@@ -355,18 +355,18 @@ message ObjectMetricSource {
optional string metricName = 2;
// targetValue is the target value of the metric (as a quantity).
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
// averageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// ObjectMetricStatus indicates the current value of a metric describing a
@@ -379,18 +379,18 @@ message ObjectMetricStatus {
optional string metricName = 2;
// currentValue is the current value of the metric (as a quantity).
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
// When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
// averageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
}
// PodsMetricSource indicates how to scale on a metric describing each pod in
@@ -403,13 +403,13 @@ message PodsMetricSource {
// targetAverageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// PodsMetricStatus indicates the current value of a metric describing each pod in
@@ -420,13 +420,13 @@ message PodsMetricStatus {
// currentAverageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
// selector is the string-encoded form of a standard kubernetes label selector for the given metric
// When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
}
// ResourceMetricSource indicates how to scale on a resource metric known to
@@ -450,7 +450,7 @@ message ResourceMetricSource {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
}
// ResourceMetricStatus indicates the current value of a resource metric known to
@@ -474,6 +474,6 @@ message ResourceMetricStatus {
// resource metric across all relevant pods, as a raw value (instead of as
// a percentage of the request), similar to the "pods" metric source type.
// It will always be set, regardless of the corresponding metric specification.
- optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
}
diff --git a/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto b/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto
index 41f7a16ea12..c88fc1fe268 100644
--- a/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto
+++ b/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto
@@ -147,7 +147,7 @@ message HorizontalPodAutoscaler {
// metadata is the standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the specification for the behaviour of the autoscaler.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
@@ -190,7 +190,7 @@ message HorizontalPodAutoscalerCondition {
// lastTransitionTime is the last time the condition transitioned from
// one status to another
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// reason is the reason for the condition's last transition.
// +optional
@@ -206,7 +206,7 @@ message HorizontalPodAutoscalerCondition {
message HorizontalPodAutoscalerList {
// metadata is the standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of horizontal pod autoscaler objects.
repeated HorizontalPodAutoscaler items = 2;
@@ -258,7 +258,7 @@ message HorizontalPodAutoscalerStatus {
// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
// used by the autoscaler to control how often the number of pods is changed.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
// currentReplicas is current number of replicas of pods managed by this autoscaler,
// as last seen by the autoscaler.
@@ -289,7 +289,7 @@ message MetricIdentifier {
// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
// When unset, just the metricName will be used to gather metrics.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
}
// MetricSpec specifies how to scale based on a single metric
@@ -389,12 +389,12 @@ message MetricTarget {
// value is the target value of the metric (as a quantity).
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 2;
// averageValue is the target value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3;
// averageUtilization is the target value of the average of the
// resource metric across all relevant pods, represented as a percentage of
@@ -408,12 +408,12 @@ message MetricTarget {
message MetricValueStatus {
// value is the current value of the metric (as a quantity).
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
// averageValue is the current value of the average of the
// metric across all relevant pods (as a quantity)
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2;
// averageUtilization is the current value of the average of the
// resource metric across all relevant pods, represented as a percentage of
diff --git a/vendor/k8s.io/api/batch/v1/doc.go b/vendor/k8s.io/api/batch/v1/doc.go
index c4a8db6e78e..cb5cbb6002e 100644
--- a/vendor/k8s.io/api/batch/v1/doc.go
+++ b/vendor/k8s.io/api/batch/v1/doc.go
@@ -17,5 +17,5 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
-
+// +k8s:prerelease-lifecycle-gen=true
package v1 // import "k8s.io/api/batch/v1"
diff --git a/vendor/k8s.io/api/batch/v1/generated.proto b/vendor/k8s.io/api/batch/v1/generated.proto
index 833b118d00e..f5a9385f5e0 100644
--- a/vendor/k8s.io/api/batch/v1/generated.proto
+++ b/vendor/k8s.io/api/batch/v1/generated.proto
@@ -34,7 +34,7 @@ message CronJob {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of a cron job, including the schedule.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -52,7 +52,7 @@ message CronJobList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CronJobs.
repeated CronJob items = 2;
@@ -113,15 +113,15 @@ message CronJobStatus {
// A list of pointers to currently running jobs.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.ObjectReference active = 1;
+ repeated .k8s.io.api.core.v1.ObjectReference active = 1;
// Information when was the last time the job was successfully scheduled.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4;
// Information when was the last time the job successfully completed.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulTime = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulTime = 5;
}
// Job represents the configuration of a single job.
@@ -129,7 +129,7 @@ message Job {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of a job.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -152,11 +152,11 @@ message JobCondition {
// Last time the condition was checked.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
// Last time the condition transit from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
// +optional
@@ -172,7 +172,7 @@ message JobList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of Jobs.
repeated Job items = 2;
@@ -213,8 +213,6 @@ message JobSpec {
// checked against the backoffLimit. This field cannot be used in combination
// with restartPolicy=OnFailure.
//
- // This field is beta-level. It can be used when the `JobPodFailurePolicy`
- // feature gate is enabled (enabled by default).
// +optional
optional PodFailurePolicy podFailurePolicy = 11;
@@ -224,8 +222,8 @@ message JobSpec {
// When the field is specified, it must be immutable and works only for the Indexed Jobs.
// Once the Job meets the SuccessPolicy, the lingering pods are terminated.
//
- // This field is alpha-level. To use this field, you must enable the
- // `JobSuccessPolicy` feature gate (disabled by default).
+ // This field is beta-level. To use this field, you must enable the
+ // `JobSuccessPolicy` feature gate (enabled by default).
// +optional
optional SuccessPolicy successPolicy = 16;
@@ -262,7 +260,7 @@ message JobSpec {
// Normally, the system sets this field for you.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
// manualSelector controls generation of pod labels and pod selectors.
// Leave `manualSelector` unset unless you are certain what you are doing.
@@ -280,7 +278,7 @@ message JobSpec {
// Describes the pod that will be created when executing a job.
// The only allowed template.spec.restartPolicy values are "Never" or "OnFailure".
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
- optional k8s.io.api.core.v1.PodTemplateSpec template = 6;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 6;
// ttlSecondsAfterFinished limits the lifetime of a Job that has finished
// execution (either Complete or Failed). If this field is set,
@@ -349,7 +347,8 @@ message JobSpec {
// The value must be a valid domain-prefixed path (e.g. acme.io/foo) -
// all characters before the first "/" must be a valid subdomain as defined
// by RFC 1123. All characters trailing the first "/" must be valid HTTP Path
- // characters as defined by RFC 3986. The value cannot exceed 64 characters.
+ // characters as defined by RFC 3986. The value cannot exceed 63 characters.
+ // This field is immutable.
//
// This field is alpha-level. The job controller accepts setting the field
// when the feature gate JobManagedBy is enabled (disabled by default).
@@ -387,7 +386,7 @@ message JobStatus {
// The field cannot be modified while the job is unsuspended or finished.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 2;
// Represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
@@ -396,7 +395,7 @@ message JobStatus {
// The value cannot be updated or removed. The value indicates the same or
// later point in time as the startTime field.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time completionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time completionTime = 3;
// The number of pending and running pods which are not terminating (without
// a deletionTimestamp).
@@ -466,8 +465,8 @@ message JobStatus {
// +optional
optional UncountedTerminatedPods uncountedTerminatedPods = 8;
- // The number of pods which have a Ready condition.
- // +optional
+ // The number of active pods which have a Ready condition and are not
+ // terminating (without a deletionTimestamp).
optional int32 ready = 9;
}
@@ -476,7 +475,7 @@ message JobTemplateSpec {
// Standard object's metadata of the jobs created from this template.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the job.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
diff --git a/vendor/k8s.io/api/batch/v1/types.go b/vendor/k8s.io/api/batch/v1/types.go
index adaefbab5a8..b42ec231e45 100644
--- a/vendor/k8s.io/api/batch/v1/types.go
+++ b/vendor/k8s.io/api/batch/v1/types.go
@@ -64,6 +64,7 @@ const (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// Job represents the configuration of a single job.
type Job struct {
@@ -85,6 +86,7 @@ type Job struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// JobList is a collection of jobs.
type JobList struct {
@@ -336,8 +338,6 @@ type JobSpec struct {
// checked against the backoffLimit. This field cannot be used in combination
// with restartPolicy=OnFailure.
//
- // This field is beta-level. It can be used when the `JobPodFailurePolicy`
- // feature gate is enabled (enabled by default).
// +optional
PodFailurePolicy *PodFailurePolicy `json:"podFailurePolicy,omitempty" protobuf:"bytes,11,opt,name=podFailurePolicy"`
@@ -347,8 +347,8 @@ type JobSpec struct {
// When the field is specified, it must be immutable and works only for the Indexed Jobs.
// Once the Job meets the SuccessPolicy, the lingering pods are terminated.
//
- // This field is alpha-level. To use this field, you must enable the
- // `JobSuccessPolicy` feature gate (disabled by default).
+ // This field is beta-level. To use this field, you must enable the
+ // `JobSuccessPolicy` feature gate (enabled by default).
// +optional
SuccessPolicy *SuccessPolicy `json:"successPolicy,omitempty" protobuf:"bytes,16,opt,name=successPolicy"`
@@ -477,7 +477,8 @@ type JobSpec struct {
// The value must be a valid domain-prefixed path (e.g. acme.io/foo) -
// all characters before the first "/" must be a valid subdomain as defined
// by RFC 1123. All characters trailing the first "/" must be valid HTTP Path
- // characters as defined by RFC 3986. The value cannot exceed 64 characters.
+ // characters as defined by RFC 3986. The value cannot exceed 63 characters.
+ // This field is immutable.
//
// This field is alpha-level. The job controller accepts setting the field
// when the feature gate JobManagedBy is enabled (disabled by default).
@@ -594,8 +595,8 @@ type JobStatus struct {
// +optional
UncountedTerminatedPods *UncountedTerminatedPods `json:"uncountedTerminatedPods,omitempty" protobuf:"bytes,8,opt,name=uncountedTerminatedPods"`
- // The number of pods which have a Ready condition.
- // +optional
+ // The number of active pods which have a Ready condition and are not
+ // terminating (without a deletionTimestamp).
Ready *int32 `json:"ready,omitempty" protobuf:"varint,9,opt,name=ready"`
}
@@ -633,7 +634,6 @@ const (
// JobReasonPodFailurePolicy reason indicates a job failure condition is added due to
// a failed pod matching a pod failure policy rule
// https://kep.k8s.io/3329
- // This is currently a beta field.
JobReasonPodFailurePolicy string = "PodFailurePolicy"
// JobReasonBackOffLimitExceeded reason indicates that pods within a job have failed a number of
// times higher than backOffLimit times.
@@ -649,8 +649,13 @@ const (
// JobReasonSuccessPolicy reason indicates a SuccessCriteriaMet condition is added due to
// a Job met successPolicy.
// https://kep.k8s.io/3998
- // This is currently an alpha field.
+ // This is currently a beta field.
JobReasonSuccessPolicy string = "SuccessPolicy"
+ // JobReasonCompletionsReached reason indicates a SuccessCriteriaMet condition is added due to
+ // a number of succeeded Job pods met completions.
+ // - https://kep.k8s.io/3998
+ // This is currently a beta field.
+ JobReasonCompletionsReached string = "CompletionsReached"
)
// JobCondition describes current state of a job.
@@ -688,6 +693,7 @@ type JobTemplateSpec struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.21
// CronJob represents the configuration of a single cron job.
type CronJob struct {
@@ -709,6 +715,7 @@ type CronJob struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.21
// CronJobList is a collection of cron jobs.
type CronJobList struct {
diff --git a/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go
index 84073b8d86c..d504887884a 100644
--- a/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go
@@ -115,8 +115,8 @@ var map_JobSpec = map[string]string{
"parallelism": "Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/",
"completions": "Specifies the desired number of successfully finished pods the job should be run with. Setting to null means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/",
"activeDeadlineSeconds": "Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.",
- "podFailurePolicy": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.\n\nThis field is beta-level. It can be used when the `JobPodFailurePolicy` feature gate is enabled (enabled by default).",
- "successPolicy": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is alpha-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (disabled by default).",
+ "podFailurePolicy": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.",
+ "successPolicy": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is beta-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (enabled by default).",
"backoffLimit": "Specifies the number of retries before marking this job failed. Defaults to 6",
"backoffLimitPerIndex": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).",
"maxFailedIndexes": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).",
@@ -127,7 +127,7 @@ var map_JobSpec = map[string]string{
"completionMode": "completionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nMore completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, which is possible during upgrades due to version skew, the controller skips updates for the Job.",
"suspend": "suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.",
"podReplacementPolicy": "podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods\n when they are terminating (has a metadata.deletionTimestamp) or failed.\n- Failed means to wait until a previously created Pod is fully terminated (has phase\n Failed or Succeeded) before creating a replacement Pod.\n\nWhen using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle. This is on by default.",
- "managedBy": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 64 characters.\n\nThis field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default).",
+ "managedBy": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.\n\nThis field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default).",
}
func (JobSpec) SwaggerDoc() map[string]string {
@@ -146,7 +146,7 @@ var map_JobStatus = map[string]string{
"completedIndexes": "completedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".",
"failedIndexes": "FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes.\n\nThis field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).",
"uncountedTerminatedPods": "uncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status:\n\n1. Add the pod UID to the arrays in this field. 2. Remove the pod finalizer. 3. Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nOld jobs might not be tracked using this field, in which case the field remains null. The structure is empty for finished jobs.",
- "ready": "The number of pods which have a Ready condition.",
+ "ready": "The number of active pods which have a Ready condition and are not terminating (without a deletionTimestamp).",
}
func (JobStatus) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/batch/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/batch/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..b76cb09249a
--- /dev/null
+++ b/vendor/k8s.io/api/batch/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,46 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CronJob) APILifecycleIntroduced() (major, minor int) {
+ return 1, 21
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CronJobList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 21
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Job) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *JobList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
diff --git a/vendor/k8s.io/api/batch/v1beta1/generated.proto b/vendor/k8s.io/api/batch/v1beta1/generated.proto
index ac774f19ade..6dd322128dc 100644
--- a/vendor/k8s.io/api/batch/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/batch/v1beta1/generated.proto
@@ -35,7 +35,7 @@ message CronJob {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of a cron job, including the schedule.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -53,7 +53,7 @@ message CronJobList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CronJobs.
repeated CronJob items = 2;
@@ -116,15 +116,15 @@ message CronJobStatus {
// A list of pointers to currently running jobs.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.ObjectReference active = 1;
+ repeated .k8s.io.api.core.v1.ObjectReference active = 1;
// Information when was the last time the job was successfully scheduled.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4;
// Information when was the last time the job successfully completed.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulTime = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulTime = 5;
}
// JobTemplateSpec describes the data a Job should have when created from a template
@@ -132,11 +132,11 @@ message JobTemplateSpec {
// Standard object's metadata of the jobs created from this template.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the job.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +optional
- optional k8s.io.api.batch.v1.JobSpec spec = 2;
+ optional .k8s.io.api.batch.v1.JobSpec spec = 2;
}
diff --git a/vendor/k8s.io/api/certificates/v1/doc.go b/vendor/k8s.io/api/certificates/v1/doc.go
index fe3ea3af87f..78434478e84 100644
--- a/vendor/k8s.io/api/certificates/v1/doc.go
+++ b/vendor/k8s.io/api/certificates/v1/doc.go
@@ -17,7 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
-
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=certificates.k8s.io
package v1 // import "k8s.io/api/certificates/v1"
diff --git a/vendor/k8s.io/api/certificates/v1/generated.proto b/vendor/k8s.io/api/certificates/v1/generated.proto
index 968cc2564c1..dac7c7f5f22 100644
--- a/vendor/k8s.io/api/certificates/v1/generated.proto
+++ b/vendor/k8s.io/api/certificates/v1/generated.proto
@@ -41,7 +41,7 @@ option go_package = "k8s.io/api/certificates/v1";
// or to obtain certificates from custom non-Kubernetes signers.
message CertificateSigningRequest {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec contains the certificate request, and is immutable after creation.
// Only the request, signerName, expirationSeconds, and usages fields can be set on creation.
@@ -87,19 +87,19 @@ message CertificateSigningRequestCondition {
// lastUpdateTime is the time of the last update to this condition
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4;
// lastTransitionTime is the time the condition last transitioned from one status to another.
// If unset, when a new condition type is added or an existing condition's status is changed,
// the server defaults this to the current time.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 5;
}
// CertificateSigningRequestList is a collection of CertificateSigningRequest objects
message CertificateSigningRequestList {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a collection of CertificateSigningRequest objects
repeated CertificateSigningRequest items = 2;
diff --git a/vendor/k8s.io/api/certificates/v1/types.go b/vendor/k8s.io/api/certificates/v1/types.go
index 92b2018e761..ba8009840d8 100644
--- a/vendor/k8s.io/api/certificates/v1/types.go
+++ b/vendor/k8s.io/api/certificates/v1/types.go
@@ -27,6 +27,7 @@ import (
// +genclient:nonNamespaced
// +genclient:method=UpdateApproval,verb=update,subresource=approval,input=k8s.io/api/certificates/v1.CertificateSigningRequest,result=k8s.io/api/certificates/v1.CertificateSigningRequest
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// CertificateSigningRequest objects provide a mechanism to obtain x509 certificates
// by submitting a certificate signing request, and having it asynchronously approved and issued.
@@ -262,6 +263,7 @@ type CertificateSigningRequestCondition struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// CertificateSigningRequestList is a collection of CertificateSigningRequest objects
type CertificateSigningRequestList struct {
diff --git a/vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..3a2b2740305
--- /dev/null
+++ b/vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CertificateSigningRequest) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CertificateSigningRequestList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
diff --git a/vendor/k8s.io/api/certificates/v1alpha1/generated.proto b/vendor/k8s.io/api/certificates/v1alpha1/generated.proto
index b0ebc4bd458..7155f778cff 100644
--- a/vendor/k8s.io/api/certificates/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/certificates/v1alpha1/generated.proto
@@ -46,7 +46,7 @@ option go_package = "k8s.io/api/certificates/v1alpha1";
message ClusterTrustBundle {
// metadata contains the object metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec contains the signer (if any) and trust anchors.
optional ClusterTrustBundleSpec spec = 2;
@@ -57,7 +57,7 @@ message ClusterTrustBundleList {
// metadata contains the list metadata.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a collection of ClusterTrustBundle objects
repeated ClusterTrustBundle items = 2;
diff --git a/vendor/k8s.io/api/certificates/v1beta1/generated.proto b/vendor/k8s.io/api/certificates/v1beta1/generated.proto
index f70f01ef7ab..f3ec4c06e4c 100644
--- a/vendor/k8s.io/api/certificates/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/certificates/v1beta1/generated.proto
@@ -32,7 +32,7 @@ option go_package = "k8s.io/api/certificates/v1beta1";
// Describes a certificate signing request
message CertificateSigningRequest {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec contains the certificate request, and is immutable after creation.
// Only the request, signerName, expirationSeconds, and usages fields can be set on creation.
@@ -65,18 +65,18 @@ message CertificateSigningRequestCondition {
// timestamp for the last update to this condition
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4;
// lastTransitionTime is the time the condition last transitioned from one status to another.
// If unset, when a new condition type is added or an existing condition's status is changed,
// the server defaults this to the current time.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 5;
}
message CertificateSigningRequestList {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated CertificateSigningRequest items = 2;
}
diff --git a/vendor/k8s.io/api/coordination/v1/doc.go b/vendor/k8s.io/api/coordination/v1/doc.go
index fc2f4f2c6e1..9b2fbbda3ad 100644
--- a/vendor/k8s.io/api/coordination/v1/doc.go
+++ b/vendor/k8s.io/api/coordination/v1/doc.go
@@ -17,6 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=coordination.k8s.io
diff --git a/vendor/k8s.io/api/coordination/v1/generated.pb.go b/vendor/k8s.io/api/coordination/v1/generated.pb.go
index 8b7ab98caaa..cf6702aef37 100644
--- a/vendor/k8s.io/api/coordination/v1/generated.pb.go
+++ b/vendor/k8s.io/api/coordination/v1/generated.pb.go
@@ -139,40 +139,44 @@ func init() {
}
var fileDescriptor_239d5a4df3139dce = []byte{
- // 524 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x6f, 0xd3, 0x30,
- 0x18, 0xc6, 0x9b, 0xb5, 0x95, 0x56, 0x97, 0x8d, 0x2a, 0xea, 0x21, 0xea, 0x21, 0x19, 0x95, 0x90,
- 0x26, 0x24, 0x1c, 0x3a, 0x21, 0x84, 0x38, 0x8d, 0x08, 0x01, 0x93, 0x3a, 0x21, 0x65, 0x3b, 0xa1,
- 0x1d, 0x70, 0x93, 0x97, 0xd4, 0x74, 0x89, 0x83, 0xed, 0x16, 0xed, 0xc6, 0x47, 0xe0, 0xca, 0xc7,
- 0x80, 0x4f, 0xd1, 0xe3, 0x8e, 0x3b, 0x45, 0xd4, 0x7c, 0x11, 0x64, 0xb7, 0x5b, 0x4b, 0xff, 0x68,
- 0xd3, 0x6e, 0xf1, 0xeb, 0xe7, 0xf9, 0xbd, 0x8f, 0x9f, 0x43, 0xd0, 0x93, 0xc1, 0x4b, 0x81, 0x29,
- 0xf3, 0x49, 0x4e, 0xfd, 0x88, 0x31, 0x1e, 0xd3, 0x8c, 0x48, 0xca, 0x32, 0x7f, 0xd4, 0xf1, 0x13,
- 0xc8, 0x80, 0x13, 0x09, 0x31, 0xce, 0x39, 0x93, 0xcc, 0x6e, 0x4d, 0xb5, 0x98, 0xe4, 0x14, 0x2f,
- 0x6a, 0xf1, 0xa8, 0xd3, 0x7a, 0x9a, 0x50, 0xd9, 0x1f, 0xf6, 0x70, 0xc4, 0x52, 0x3f, 0x61, 0x09,
- 0xf3, 0x8d, 0xa5, 0x37, 0xfc, 0x6c, 0x4e, 0xe6, 0x60, 0xbe, 0xa6, 0xa8, 0xd6, 0xf3, 0xf9, 0xda,
- 0x94, 0x44, 0x7d, 0x9a, 0x01, 0xbf, 0xf0, 0xf3, 0x41, 0xa2, 0x07, 0xc2, 0x4f, 0x41, 0x92, 0x35,
- 0x01, 0x5a, 0xfe, 0x26, 0x17, 0x1f, 0x66, 0x92, 0xa6, 0xb0, 0x62, 0x78, 0x71, 0x9b, 0x41, 0x44,
- 0x7d, 0x48, 0xc9, 0xb2, 0xaf, 0xfd, 0xdb, 0x42, 0xd5, 0x2e, 0x10, 0x01, 0xf6, 0x27, 0xb4, 0xad,
- 0xd3, 0xc4, 0x44, 0x12, 0xc7, 0xda, 0xb3, 0xf6, 0xeb, 0x07, 0xcf, 0xf0, 0xbc, 0x86, 0x1b, 0x28,
- 0xce, 0x07, 0x89, 0x1e, 0x08, 0xac, 0xd5, 0x78, 0xd4, 0xc1, 0x1f, 0x7a, 0x5f, 0x20, 0x92, 0xc7,
- 0x20, 0x49, 0x60, 0x8f, 0x0b, 0xaf, 0xa4, 0x0a, 0x0f, 0xcd, 0x67, 0xe1, 0x0d, 0xd5, 0x7e, 0x87,
- 0x2a, 0x22, 0x87, 0xc8, 0xd9, 0x32, 0xf4, 0xc7, 0x78, 0x73, 0xc9, 0xd8, 0x44, 0x3a, 0xc9, 0x21,
- 0x0a, 0x1e, 0xcc, 0x90, 0x15, 0x7d, 0x0a, 0x0d, 0xa0, 0xfd, 0xcb, 0x42, 0x35, 0xa3, 0xe8, 0x52,
- 0x21, 0xed, 0xb3, 0x95, 0xe0, 0xf8, 0x6e, 0xc1, 0xb5, 0xdb, 0xc4, 0x6e, 0xcc, 0x76, 0x6c, 0x5f,
- 0x4f, 0x16, 0x42, 0xbf, 0x45, 0x55, 0x2a, 0x21, 0x15, 0xce, 0xd6, 0x5e, 0x79, 0xbf, 0x7e, 0xf0,
- 0xe8, 0xd6, 0xd4, 0xc1, 0xce, 0x8c, 0x56, 0x3d, 0xd2, 0xbe, 0x70, 0x6a, 0x6f, 0xff, 0x2c, 0xcf,
- 0x32, 0xeb, 0x77, 0xd8, 0xaf, 0xd0, 0x6e, 0x9f, 0x9d, 0xc7, 0xc0, 0x8f, 0x62, 0xc8, 0x24, 0x95,
- 0x17, 0x26, 0x79, 0x2d, 0xb0, 0x55, 0xe1, 0xed, 0xbe, 0xff, 0xef, 0x26, 0x5c, 0x52, 0xda, 0x5d,
- 0xd4, 0x3c, 0xd7, 0xa0, 0x37, 0x43, 0x6e, 0x36, 0x9f, 0x40, 0xc4, 0xb2, 0x58, 0x98, 0x5a, 0xab,
- 0x81, 0xa3, 0x0a, 0xaf, 0xd9, 0x5d, 0x73, 0x1f, 0xae, 0x75, 0xd9, 0x3d, 0x54, 0x27, 0xd1, 0xd7,
- 0x21, 0xe5, 0x70, 0x4a, 0x53, 0x70, 0xca, 0xa6, 0x40, 0xff, 0x6e, 0x05, 0x1e, 0xd3, 0x88, 0x33,
- 0x6d, 0x0b, 0x1e, 0xaa, 0xc2, 0xab, 0xbf, 0x9e, 0x73, 0xc2, 0x45, 0xa8, 0x7d, 0x86, 0x6a, 0x1c,
- 0x32, 0xf8, 0x66, 0x36, 0x54, 0xee, 0xb7, 0x61, 0x47, 0x15, 0x5e, 0x2d, 0xbc, 0xa6, 0x84, 0x73,
- 0xa0, 0x7d, 0x88, 0x1a, 0xe6, 0x65, 0xa7, 0x9c, 0x64, 0x82, 0xea, 0xb7, 0x09, 0xa7, 0x6a, 0xba,
- 0x68, 0xaa, 0xc2, 0x6b, 0x74, 0x97, 0xee, 0xc2, 0x15, 0x75, 0x70, 0x38, 0x9e, 0xb8, 0xa5, 0xcb,
- 0x89, 0x5b, 0xba, 0x9a, 0xb8, 0xa5, 0xef, 0xca, 0xb5, 0xc6, 0xca, 0xb5, 0x2e, 0x95, 0x6b, 0x5d,
- 0x29, 0xd7, 0xfa, 0xa3, 0x5c, 0xeb, 0xc7, 0x5f, 0xb7, 0xf4, 0xb1, 0xb5, 0xf9, 0x07, 0xf2, 0x2f,
- 0x00, 0x00, 0xff, 0xff, 0xb0, 0xb0, 0x3a, 0x46, 0x5d, 0x04, 0x00, 0x00,
+ // 588 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdf, 0x4e, 0xd4, 0x40,
+ 0x14, 0xc6, 0xb7, 0xb0, 0xab, 0xec, 0xac, 0xfc, 0xc9, 0xc8, 0x45, 0xb3, 0x17, 0x2d, 0x92, 0x98,
+ 0x10, 0x13, 0xa7, 0x42, 0x8c, 0x31, 0x26, 0x26, 0x58, 0x89, 0x4a, 0xb2, 0x44, 0x53, 0xb8, 0x32,
+ 0x5c, 0x38, 0xdb, 0x1e, 0xba, 0x23, 0xb4, 0x53, 0x67, 0x66, 0x31, 0xdc, 0xf9, 0x08, 0x3e, 0x81,
+ 0xef, 0xa0, 0x4f, 0xc1, 0x25, 0x97, 0x5c, 0x35, 0x32, 0xbe, 0x85, 0x57, 0x66, 0x66, 0x0b, 0x0b,
+ 0xcb, 0x6e, 0x20, 0xde, 0x75, 0xce, 0x39, 0xdf, 0xef, 0x7c, 0x73, 0x4e, 0x5b, 0xf4, 0x68, 0xff,
+ 0xb9, 0x24, 0x8c, 0x07, 0xb4, 0x60, 0x41, 0xcc, 0xb9, 0x48, 0x58, 0x4e, 0x15, 0xe3, 0x79, 0x70,
+ 0xb8, 0x1a, 0xa4, 0x90, 0x83, 0xa0, 0x0a, 0x12, 0x52, 0x08, 0xae, 0x38, 0x6e, 0x0f, 0x6a, 0x09,
+ 0x2d, 0x18, 0xb9, 0x5c, 0x4b, 0x0e, 0x57, 0xdb, 0x8f, 0x53, 0xa6, 0x7a, 0xfd, 0x2e, 0x89, 0x79,
+ 0x16, 0xa4, 0x3c, 0xe5, 0x81, 0x95, 0x74, 0xfb, 0x7b, 0xf6, 0x64, 0x0f, 0xf6, 0x69, 0x80, 0x6a,
+ 0x3f, 0x1d, 0xb6, 0xcd, 0x68, 0xdc, 0x63, 0x39, 0x88, 0xa3, 0xa0, 0xd8, 0x4f, 0x4d, 0x40, 0x06,
+ 0x19, 0x28, 0x3a, 0xc6, 0x40, 0x3b, 0x98, 0xa4, 0x12, 0xfd, 0x5c, 0xb1, 0x0c, 0xae, 0x09, 0x9e,
+ 0xdd, 0x24, 0x90, 0x71, 0x0f, 0x32, 0x3a, 0xaa, 0x5b, 0xfe, 0xe5, 0xa0, 0x46, 0x07, 0xa8, 0x04,
+ 0xfc, 0x09, 0xcd, 0x18, 0x37, 0x09, 0x55, 0xd4, 0x75, 0x96, 0x9c, 0x95, 0xd6, 0xda, 0x13, 0x32,
+ 0x1c, 0xc3, 0x05, 0x94, 0x14, 0xfb, 0xa9, 0x09, 0x48, 0x62, 0xaa, 0xc9, 0xe1, 0x2a, 0x79, 0xdf,
+ 0xfd, 0x0c, 0xb1, 0xda, 0x02, 0x45, 0x43, 0x7c, 0x5c, 0xfa, 0x35, 0x5d, 0xfa, 0x68, 0x18, 0x8b,
+ 0x2e, 0xa8, 0xf8, 0x2d, 0xaa, 0xcb, 0x02, 0x62, 0x77, 0xca, 0xd2, 0x1f, 0x92, 0xc9, 0x43, 0x26,
+ 0xd6, 0xd2, 0x76, 0x01, 0x71, 0x78, 0xaf, 0x42, 0xd6, 0xcd, 0x29, 0xb2, 0x80, 0xe5, 0x9f, 0x0e,
+ 0x6a, 0xda, 0x8a, 0x0e, 0x93, 0x0a, 0xef, 0x5e, 0x33, 0x4e, 0x6e, 0x67, 0xdc, 0xa8, 0xad, 0xed,
+ 0x85, 0xaa, 0xc7, 0xcc, 0x79, 0xe4, 0x92, 0xe9, 0x37, 0xa8, 0xc1, 0x14, 0x64, 0xd2, 0x9d, 0x5a,
+ 0x9a, 0x5e, 0x69, 0xad, 0x3d, 0xb8, 0xd1, 0x75, 0x38, 0x5b, 0xd1, 0x1a, 0x9b, 0x46, 0x17, 0x0d,
+ 0xe4, 0xcb, 0x3f, 0xea, 0x95, 0x67, 0x73, 0x0f, 0xfc, 0x02, 0xcd, 0xf5, 0xf8, 0x41, 0x02, 0x62,
+ 0x33, 0x81, 0x5c, 0x31, 0x75, 0x64, 0x9d, 0x37, 0x43, 0xac, 0x4b, 0x7f, 0xee, 0xdd, 0x95, 0x4c,
+ 0x34, 0x52, 0x89, 0x3b, 0x68, 0xf1, 0xc0, 0x80, 0x36, 0xfa, 0xc2, 0x76, 0xde, 0x86, 0x98, 0xe7,
+ 0x89, 0xb4, 0x63, 0x6d, 0x84, 0xae, 0x2e, 0xfd, 0xc5, 0xce, 0x98, 0x7c, 0x34, 0x56, 0x85, 0xbb,
+ 0xa8, 0x45, 0xe3, 0x2f, 0x7d, 0x26, 0x60, 0x87, 0x65, 0xe0, 0x4e, 0xdb, 0x01, 0x06, 0xb7, 0x1b,
+ 0xe0, 0x16, 0x8b, 0x05, 0x37, 0xb2, 0x70, 0x5e, 0x97, 0x7e, 0xeb, 0xd5, 0x90, 0x13, 0x5d, 0x86,
+ 0xe2, 0x5d, 0xd4, 0x14, 0x90, 0xc3, 0x57, 0xdb, 0xa1, 0xfe, 0x7f, 0x1d, 0x66, 0x75, 0xe9, 0x37,
+ 0xa3, 0x73, 0x4a, 0x34, 0x04, 0xe2, 0x75, 0xb4, 0x60, 0x6f, 0xb6, 0x23, 0x68, 0x2e, 0x99, 0xb9,
+ 0x9b, 0x74, 0x1b, 0x76, 0x16, 0x8b, 0xba, 0xf4, 0x17, 0x3a, 0x23, 0xb9, 0xe8, 0x5a, 0x35, 0xde,
+ 0x40, 0x33, 0x52, 0x99, 0xaf, 0x22, 0x3d, 0x72, 0xef, 0xd8, 0x3d, 0xac, 0x98, 0xb7, 0x61, 0xbb,
+ 0x8a, 0xfd, 0x2d, 0x7d, 0xf7, 0xf5, 0xf9, 0xaa, 0x21, 0x19, 0x6c, 0xb1, 0xca, 0x45, 0x17, 0x4a,
+ 0xfc, 0x12, 0xcd, 0x17, 0x02, 0xf6, 0x40, 0x08, 0x48, 0x06, 0x2b, 0x74, 0xef, 0x5a, 0xd8, 0x7d,
+ 0x5d, 0xfa, 0xf3, 0x1f, 0xae, 0xa6, 0xa2, 0xd1, 0xda, 0x70, 0xfd, 0xf8, 0xcc, 0xab, 0x9d, 0x9c,
+ 0x79, 0xb5, 0xd3, 0x33, 0xaf, 0xf6, 0x4d, 0x7b, 0xce, 0xb1, 0xf6, 0x9c, 0x13, 0xed, 0x39, 0xa7,
+ 0xda, 0x73, 0x7e, 0x6b, 0xcf, 0xf9, 0xfe, 0xc7, 0xab, 0x7d, 0x6c, 0x4f, 0xfe, 0x8b, 0xfd, 0x0b,
+ 0x00, 0x00, 0xff, 0xff, 0xf8, 0xf4, 0xd4, 0x78, 0xe2, 0x04, 0x00, 0x00,
}
func (m *Lease) Marshal() (dAtA []byte, err error) {
@@ -285,6 +289,20 @@ func (m *LeaseSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.PreferredHolder != nil {
+ i -= len(*m.PreferredHolder)
+ copy(dAtA[i:], *m.PreferredHolder)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreferredHolder)))
+ i--
+ dAtA[i] = 0x3a
+ }
+ if m.Strategy != nil {
+ i -= len(*m.Strategy)
+ copy(dAtA[i:], *m.Strategy)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Strategy)))
+ i--
+ dAtA[i] = 0x32
+ }
if m.LeaseTransitions != nil {
i = encodeVarintGenerated(dAtA, i, uint64(*m.LeaseTransitions))
i--
@@ -394,6 +412,14 @@ func (m *LeaseSpec) Size() (n int) {
if m.LeaseTransitions != nil {
n += 1 + sovGenerated(uint64(*m.LeaseTransitions))
}
+ if m.Strategy != nil {
+ l = len(*m.Strategy)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.PreferredHolder != nil {
+ l = len(*m.PreferredHolder)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -440,6 +466,8 @@ func (this *LeaseSpec) String() string {
`AcquireTime:` + strings.Replace(fmt.Sprintf("%v", this.AcquireTime), "MicroTime", "v1.MicroTime", 1) + `,`,
`RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`,
`LeaseTransitions:` + valueToStringGenerated(this.LeaseTransitions) + `,`,
+ `Strategy:` + valueToStringGenerated(this.Strategy) + `,`,
+ `PreferredHolder:` + valueToStringGenerated(this.PreferredHolder) + `,`,
`}`,
}, "")
return s
@@ -859,6 +887,72 @@ func (m *LeaseSpec) Unmarshal(dAtA []byte) error {
}
}
m.LeaseTransitions = &v
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Strategy", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := CoordinatedLeaseStrategy(dAtA[iNdEx:postIndex])
+ m.Strategy = &s
+ iNdEx = postIndex
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PreferredHolder", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := string(dAtA[iNdEx:postIndex])
+ m.PreferredHolder = &s
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
diff --git a/vendor/k8s.io/api/coordination/v1/generated.proto b/vendor/k8s.io/api/coordination/v1/generated.proto
index 36fce60f2de..4d4f7e08f45 100644
--- a/vendor/k8s.io/api/coordination/v1/generated.proto
+++ b/vendor/k8s.io/api/coordination/v1/generated.proto
@@ -32,7 +32,7 @@ option go_package = "k8s.io/api/coordination/v1";
message Lease {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec contains the specification of the Lease.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -45,7 +45,7 @@ message LeaseList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated Lease items = 2;
@@ -54,27 +54,43 @@ message LeaseList {
// LeaseSpec is a specification of a Lease.
message LeaseSpec {
// holderIdentity contains the identity of the holder of a current lease.
+ // If Coordinated Leader Election is used, the holder identity must be
+ // equal to the elected LeaseCandidate.metadata.name field.
// +optional
optional string holderIdentity = 1;
// leaseDurationSeconds is a duration that candidates for a lease need
- // to wait to force acquire it. This is measure against time of last
+ // to wait to force acquire it. This is measured against the time of last
// observed renewTime.
// +optional
optional int32 leaseDurationSeconds = 2;
// acquireTime is a time when the current lease was acquired.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3;
// renewTime is a time when the current holder of a lease has last
// updated the lease.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4;
// leaseTransitions is the number of transitions of a lease between
// holders.
// +optional
optional int32 leaseTransitions = 5;
+
+ // Strategy indicates the strategy for picking the leader for coordinated leader election.
+ // If the field is not specified, there is no active coordination for this lease.
+ // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ optional string strategy = 6;
+
+ // PreferredHolder signals to a lease holder that the lease has a
+ // more optimal holder and should be given up.
+ // This field can only be set if Strategy is also set.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ optional string preferredHolder = 7;
}
diff --git a/vendor/k8s.io/api/coordination/v1/types.go b/vendor/k8s.io/api/coordination/v1/types.go
index b0e1d068296..5307cea88fa 100644
--- a/vendor/k8s.io/api/coordination/v1/types.go
+++ b/vendor/k8s.io/api/coordination/v1/types.go
@@ -20,8 +20,21 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
+type CoordinatedLeaseStrategy string
+
+// CoordinatedLeaseStrategy defines the strategy for picking the leader for coordinated leader election.
+const (
+ // OldestEmulationVersion picks the oldest LeaseCandidate, where "oldest" is defined as follows
+ // 1) Select the candidate(s) with the lowest emulation version
+ // 2) If multiple candidates have the same emulation version, select the candidate(s) with the lowest binary version. (Note that binary version must be greater or equal to emulation version)
+ // 3) If multiple candidates have the same binary version, select the candidate with the oldest creationTimestamp.
+ // If a candidate does not specify the emulationVersion and binaryVersion fields, it will not be considered a candidate for the lease.
+ OldestEmulationVersion CoordinatedLeaseStrategy = "OldestEmulationVersion"
+)
+
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.14
// Lease defines a lease concept.
type Lease struct {
@@ -39,10 +52,12 @@ type Lease struct {
// LeaseSpec is a specification of a Lease.
type LeaseSpec struct {
// holderIdentity contains the identity of the holder of a current lease.
+ // If Coordinated Leader Election is used, the holder identity must be
+ // equal to the elected LeaseCandidate.metadata.name field.
// +optional
HolderIdentity *string `json:"holderIdentity,omitempty" protobuf:"bytes,1,opt,name=holderIdentity"`
// leaseDurationSeconds is a duration that candidates for a lease need
- // to wait to force acquire it. This is measure against time of last
+ // to wait to force acquire it. This is measured against the time of last
// observed renewTime.
// +optional
LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty" protobuf:"varint,2,opt,name=leaseDurationSeconds"`
@@ -57,9 +72,22 @@ type LeaseSpec struct {
// holders.
// +optional
LeaseTransitions *int32 `json:"leaseTransitions,omitempty" protobuf:"varint,5,opt,name=leaseTransitions"`
+ // Strategy indicates the strategy for picking the leader for coordinated leader election.
+ // If the field is not specified, there is no active coordination for this lease.
+ // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ Strategy *CoordinatedLeaseStrategy `json:"strategy,omitempty" protobuf:"bytes,6,opt,name=strategy"`
+ // PreferredHolder signals to a lease holder that the lease has a
+ // more optimal holder and should be given up.
+ // This field can only be set if Strategy is also set.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ PreferredHolder *string `json:"preferredHolder,omitempty" protobuf:"bytes,7,opt,name=preferredHolder"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// LeaseList is a list of Lease objects.
type LeaseList struct {
diff --git a/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go
index f3720eca027..6c1a7ea8b90 100644
--- a/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go
@@ -49,11 +49,13 @@ func (LeaseList) SwaggerDoc() map[string]string {
var map_LeaseSpec = map[string]string{
"": "LeaseSpec is a specification of a Lease.",
- "holderIdentity": "holderIdentity contains the identity of the holder of a current lease.",
- "leaseDurationSeconds": "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed renewTime.",
+ "holderIdentity": "holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.",
+ "leaseDurationSeconds": "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime.",
"acquireTime": "acquireTime is a time when the current lease was acquired.",
"renewTime": "renewTime is a time when the current holder of a lease has last updated the lease.",
"leaseTransitions": "leaseTransitions is the number of transitions of a lease between holders.",
+ "strategy": "Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.",
+ "preferredHolder": "PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.",
}
func (LeaseSpec) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/coordination/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/coordination/v1/zz_generated.deepcopy.go
index 99f6b0be7ac..4d549cc99fc 100644
--- a/vendor/k8s.io/api/coordination/v1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/coordination/v1/zz_generated.deepcopy.go
@@ -111,6 +111,16 @@ func (in *LeaseSpec) DeepCopyInto(out *LeaseSpec) {
*out = new(int32)
**out = **in
}
+ if in.Strategy != nil {
+ in, out := &in.Strategy, &out.Strategy
+ *out = new(CoordinatedLeaseStrategy)
+ **out = **in
+ }
+ if in.PreferredHolder != nil {
+ in, out := &in.PreferredHolder, &out.PreferredHolder
+ *out = new(string)
+ **out = **in
+ }
return
}
diff --git a/vendor/k8s.io/api/coordination/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/coordination/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..a22632cba96
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Lease) APILifecycleIntroduced() (major, minor int) {
+ return 1, 14
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *LeaseList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
diff --git a/vendor/k8s.io/api/coordination/v1alpha1/doc.go b/vendor/k8s.io/api/coordination/v1alpha1/doc.go
new file mode 100644
index 00000000000..33a0b0ea97f
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1alpha1/doc.go
@@ -0,0 +1,24 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +k8s:deepcopy-gen=package
+// +k8s:protobuf-gen=package
+// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
+
+// +groupName=coordination.k8s.io
+
+package v1alpha1 // import "k8s.io/api/coordination/v1alpha1"
diff --git a/vendor/k8s.io/api/coordination/v1alpha1/generated.pb.go b/vendor/k8s.io/api/coordination/v1alpha1/generated.pb.go
new file mode 100644
index 00000000000..9e072e62d01
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1alpha1/generated.pb.go
@@ -0,0 +1,1036 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: k8s.io/api/coordination/v1alpha1/generated.proto
+
+package v1alpha1
+
+import (
+ fmt "fmt"
+
+ io "io"
+
+ proto "github.com/gogo/protobuf/proto"
+
+ k8s_io_api_coordination_v1 "k8s.io/api/coordination/v1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ math "math"
+ math_bits "math/bits"
+ reflect "reflect"
+ strings "strings"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+func (m *LeaseCandidate) Reset() { *m = LeaseCandidate{} }
+func (*LeaseCandidate) ProtoMessage() {}
+func (*LeaseCandidate) Descriptor() ([]byte, []int) {
+ return fileDescriptor_cb9e87df9da593c2, []int{0}
+}
+func (m *LeaseCandidate) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *LeaseCandidate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *LeaseCandidate) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LeaseCandidate.Merge(m, src)
+}
+func (m *LeaseCandidate) XXX_Size() int {
+ return m.Size()
+}
+func (m *LeaseCandidate) XXX_DiscardUnknown() {
+ xxx_messageInfo_LeaseCandidate.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LeaseCandidate proto.InternalMessageInfo
+
+func (m *LeaseCandidateList) Reset() { *m = LeaseCandidateList{} }
+func (*LeaseCandidateList) ProtoMessage() {}
+func (*LeaseCandidateList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_cb9e87df9da593c2, []int{1}
+}
+func (m *LeaseCandidateList) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *LeaseCandidateList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *LeaseCandidateList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LeaseCandidateList.Merge(m, src)
+}
+func (m *LeaseCandidateList) XXX_Size() int {
+ return m.Size()
+}
+func (m *LeaseCandidateList) XXX_DiscardUnknown() {
+ xxx_messageInfo_LeaseCandidateList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LeaseCandidateList proto.InternalMessageInfo
+
+func (m *LeaseCandidateSpec) Reset() { *m = LeaseCandidateSpec{} }
+func (*LeaseCandidateSpec) ProtoMessage() {}
+func (*LeaseCandidateSpec) Descriptor() ([]byte, []int) {
+ return fileDescriptor_cb9e87df9da593c2, []int{2}
+}
+func (m *LeaseCandidateSpec) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *LeaseCandidateSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *LeaseCandidateSpec) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LeaseCandidateSpec.Merge(m, src)
+}
+func (m *LeaseCandidateSpec) XXX_Size() int {
+ return m.Size()
+}
+func (m *LeaseCandidateSpec) XXX_DiscardUnknown() {
+ xxx_messageInfo_LeaseCandidateSpec.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LeaseCandidateSpec proto.InternalMessageInfo
+
+func init() {
+ proto.RegisterType((*LeaseCandidate)(nil), "k8s.io.api.coordination.v1alpha1.LeaseCandidate")
+ proto.RegisterType((*LeaseCandidateList)(nil), "k8s.io.api.coordination.v1alpha1.LeaseCandidateList")
+ proto.RegisterType((*LeaseCandidateSpec)(nil), "k8s.io.api.coordination.v1alpha1.LeaseCandidateSpec")
+}
+
+func init() {
+ proto.RegisterFile("k8s.io/api/coordination/v1alpha1/generated.proto", fileDescriptor_cb9e87df9da593c2)
+}
+
+var fileDescriptor_cb9e87df9da593c2 = []byte{
+ // 570 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcb, 0x6e, 0xd3, 0x4c,
+ 0x14, 0xc7, 0xe3, 0x36, 0xf9, 0x94, 0xcc, 0xd7, 0xa0, 0x30, 0x15, 0x92, 0x95, 0x85, 0x13, 0x65,
+ 0x55, 0x21, 0x31, 0x6e, 0xa0, 0x42, 0x48, 0xec, 0x5c, 0x40, 0x42, 0x4a, 0x4b, 0xe5, 0x42, 0x25,
+ 0x50, 0x17, 0x4c, 0xec, 0x53, 0x67, 0x48, 0x7c, 0xd1, 0x78, 0x52, 0x94, 0x5d, 0x17, 0x3c, 0x00,
+ 0x8f, 0x15, 0x58, 0x75, 0xd9, 0x55, 0x44, 0xcc, 0x5b, 0xb0, 0x42, 0x33, 0xb1, 0x73, 0x6d, 0x94,
+ 0x88, 0x5d, 0xce, 0xe5, 0xf7, 0x3f, 0xe7, 0x7f, 0xac, 0x0c, 0x3a, 0xec, 0xbe, 0x88, 0x09, 0x0b,
+ 0x4d, 0x1a, 0x31, 0xd3, 0x09, 0x43, 0xee, 0xb2, 0x80, 0x0a, 0x16, 0x06, 0xe6, 0x75, 0x93, 0xf6,
+ 0xa2, 0x0e, 0x6d, 0x9a, 0x1e, 0x04, 0xc0, 0xa9, 0x00, 0x97, 0x44, 0x3c, 0x14, 0x21, 0xae, 0x4f,
+ 0x08, 0x42, 0x23, 0x46, 0xe6, 0x09, 0x92, 0x11, 0xd5, 0x27, 0x1e, 0x13, 0x9d, 0x7e, 0x9b, 0x38,
+ 0xa1, 0x6f, 0x7a, 0xa1, 0x17, 0x9a, 0x0a, 0x6c, 0xf7, 0xaf, 0x54, 0xa4, 0x02, 0xf5, 0x6b, 0x22,
+ 0x58, 0x7d, 0xbc, 0x7e, 0x85, 0xe5, 0xe1, 0xd5, 0xa3, 0x59, 0xaf, 0x4f, 0x9d, 0x0e, 0x0b, 0x80,
+ 0x0f, 0xcc, 0xa8, 0xeb, 0xc9, 0x44, 0x6c, 0xfa, 0x20, 0xe8, 0x7d, 0x94, 0xb9, 0x8e, 0xe2, 0xfd,
+ 0x40, 0x30, 0x1f, 0x56, 0x80, 0xe7, 0x9b, 0x80, 0xd8, 0xe9, 0x80, 0x4f, 0x97, 0xb9, 0xc6, 0x4f,
+ 0x0d, 0x3d, 0x68, 0x01, 0x8d, 0xe1, 0x98, 0x06, 0x2e, 0x73, 0xa9, 0x00, 0xfc, 0x19, 0x15, 0xe5,
+ 0x5a, 0x2e, 0x15, 0x54, 0xd7, 0xea, 0xda, 0xc1, 0xff, 0x4f, 0x0f, 0xc9, 0xec, 0x82, 0x53, 0x75,
+ 0x12, 0x75, 0x3d, 0x99, 0x88, 0x89, 0xec, 0x26, 0xd7, 0x4d, 0xf2, 0xae, 0xfd, 0x05, 0x1c, 0x71,
+ 0x02, 0x82, 0x5a, 0x78, 0x38, 0xaa, 0xe5, 0x92, 0x51, 0x0d, 0xcd, 0x72, 0xf6, 0x54, 0x15, 0x5f,
+ 0xa0, 0x7c, 0x1c, 0x81, 0xa3, 0xef, 0x28, 0xf5, 0x23, 0xb2, 0xe9, 0xfb, 0x90, 0xc5, 0x0d, 0xcf,
+ 0x23, 0x70, 0xac, 0xbd, 0x74, 0x42, 0x5e, 0x46, 0xb6, 0xd2, 0x6b, 0xfc, 0xd0, 0x10, 0x5e, 0x6c,
+ 0x6d, 0xb1, 0x58, 0xe0, 0xcb, 0x15, 0x43, 0x64, 0x3b, 0x43, 0x92, 0x56, 0x76, 0x2a, 0xe9, 0xb0,
+ 0x62, 0x96, 0x99, 0x33, 0xf3, 0x01, 0x15, 0x98, 0x00, 0x3f, 0xd6, 0x77, 0xea, 0xbb, 0x4b, 0xb7,
+ 0xda, 0xca, 0x8d, 0x55, 0x4e, 0xc5, 0x0b, 0x6f, 0xa5, 0x8c, 0x3d, 0x51, 0x6b, 0x7c, 0xcb, 0x2f,
+ 0x7b, 0x91, 0x46, 0xb1, 0x89, 0x4a, 0x3d, 0x99, 0x3d, 0xa5, 0x3e, 0x28, 0x33, 0x25, 0xeb, 0x61,
+ 0xca, 0x97, 0x5a, 0x59, 0xc1, 0x9e, 0xf5, 0xe0, 0x8f, 0xa8, 0x18, 0xb1, 0xc0, 0x7b, 0xcf, 0x7c,
+ 0x48, 0xef, 0x6d, 0x6e, 0x67, 0xfe, 0x84, 0x39, 0x3c, 0x94, 0x98, 0xb5, 0x27, 0x9d, 0x9f, 0xa5,
+ 0x22, 0xf6, 0x54, 0x0e, 0x5f, 0xa2, 0x12, 0x87, 0x00, 0xbe, 0x2a, 0xed, 0xdd, 0x7f, 0xd3, 0x2e,
+ 0xcb, 0xc5, 0xed, 0x4c, 0xc5, 0x9e, 0x09, 0xe2, 0x97, 0xa8, 0xdc, 0x66, 0x01, 0xe5, 0x83, 0x0b,
+ 0xe0, 0x31, 0x0b, 0x03, 0x3d, 0xaf, 0xdc, 0x3e, 0x4a, 0xdd, 0x96, 0xad, 0xf9, 0xa2, 0xbd, 0xd8,
+ 0x8b, 0x5f, 0xa1, 0x0a, 0xf8, 0xfd, 0x9e, 0x3a, 0x7c, 0xc6, 0x17, 0x14, 0xaf, 0xa7, 0x7c, 0xe5,
+ 0xf5, 0x52, 0xdd, 0x5e, 0x21, 0xf0, 0x8d, 0x86, 0xf6, 0x23, 0x0e, 0x57, 0xc0, 0x39, 0xb8, 0xe7,
+ 0x42, 0xfe, 0x6f, 0x3c, 0x06, 0xb1, 0xfe, 0x5f, 0x7d, 0xf7, 0xa0, 0x64, 0x9d, 0x26, 0xa3, 0xda,
+ 0xfe, 0xd9, 0x6a, 0xf9, 0xcf, 0xa8, 0xf6, 0x6c, 0xfd, 0x03, 0x41, 0x8e, 0xb3, 0x18, 0x5c, 0xf5,
+ 0xc1, 0x52, 0x70, 0x60, 0xdf, 0x37, 0xca, 0x7a, 0x33, 0x1c, 0x1b, 0xb9, 0xdb, 0xb1, 0x91, 0xbb,
+ 0x1b, 0x1b, 0xb9, 0x9b, 0xc4, 0xd0, 0x86, 0x89, 0xa1, 0xdd, 0x26, 0x86, 0x76, 0x97, 0x18, 0xda,
+ 0xaf, 0xc4, 0xd0, 0xbe, 0xff, 0x36, 0x72, 0x9f, 0xea, 0x9b, 0xde, 0xc4, 0xbf, 0x01, 0x00, 0x00,
+ 0xff, 0xff, 0x05, 0x28, 0x49, 0xd9, 0x36, 0x05, 0x00, 0x00,
+}
+
+func (m *LeaseCandidate) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *LeaseCandidate) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *LeaseCandidate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ {
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *LeaseCandidateList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *LeaseCandidateList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *LeaseCandidateList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Items) > 0 {
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *LeaseCandidateSpec) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *LeaseCandidateSpec) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *LeaseCandidateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.PreferredStrategies) > 0 {
+ for iNdEx := len(m.PreferredStrategies) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.PreferredStrategies[iNdEx])
+ copy(dAtA[i:], m.PreferredStrategies[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.PreferredStrategies[iNdEx])))
+ i--
+ dAtA[i] = 0x32
+ }
+ }
+ i -= len(m.EmulationVersion)
+ copy(dAtA[i:], m.EmulationVersion)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.EmulationVersion)))
+ i--
+ dAtA[i] = 0x2a
+ i -= len(m.BinaryVersion)
+ copy(dAtA[i:], m.BinaryVersion)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.BinaryVersion)))
+ i--
+ dAtA[i] = 0x22
+ if m.RenewTime != nil {
+ {
+ size, err := m.RenewTime.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
+ }
+ if m.PingTime != nil {
+ {
+ size, err := m.PingTime.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ i -= len(m.LeaseName)
+ copy(dAtA[i:], m.LeaseName)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.LeaseName)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ offset -= sovGenerated(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *LeaseCandidate) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *LeaseCandidateList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *LeaseCandidateSpec) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.LeaseName)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.PingTime != nil {
+ l = m.PingTime.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.RenewTime != nil {
+ l = m.RenewTime.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ l = len(m.BinaryVersion)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.EmulationVersion)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.PreferredStrategies) > 0 {
+ for _, s := range m.PreferredStrategies {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func sovGenerated(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozGenerated(x uint64) (n int) {
+ return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (this *LeaseCandidate) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&LeaseCandidate{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "LeaseCandidateSpec", "LeaseCandidateSpec", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *LeaseCandidateList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForItems := "[]LeaseCandidate{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "LeaseCandidate", "LeaseCandidate", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&LeaseCandidateList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *LeaseCandidateSpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&LeaseCandidateSpec{`,
+ `LeaseName:` + fmt.Sprintf("%v", this.LeaseName) + `,`,
+ `PingTime:` + strings.Replace(fmt.Sprintf("%v", this.PingTime), "MicroTime", "v1.MicroTime", 1) + `,`,
+ `RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`,
+ `BinaryVersion:` + fmt.Sprintf("%v", this.BinaryVersion) + `,`,
+ `EmulationVersion:` + fmt.Sprintf("%v", this.EmulationVersion) + `,`,
+ `PreferredStrategies:` + fmt.Sprintf("%v", this.PreferredStrategies) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
+}
+func (m *LeaseCandidate) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: LeaseCandidate: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: LeaseCandidate: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *LeaseCandidateList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: LeaseCandidateList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: LeaseCandidateList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, LeaseCandidate{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *LeaseCandidateSpec) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: LeaseCandidateSpec: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: LeaseCandidateSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field LeaseName", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.LeaseName = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PingTime", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.PingTime == nil {
+ m.PingTime = &v1.MicroTime{}
+ }
+ if err := m.PingTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field RenewTime", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.RenewTime == nil {
+ m.RenewTime = &v1.MicroTime{}
+ }
+ if err := m.RenewTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field BinaryVersion", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.BinaryVersion = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field EmulationVersion", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.EmulationVersion = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PreferredStrategies", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.PreferredStrategies = append(m.PreferredStrategies, k8s_io_api_coordination_v1.CoordinatedLeaseStrategy(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipGenerated(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ depth := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ case 1:
+ iNdEx += 8
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if length < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ iNdEx += length
+ case 3:
+ depth++
+ case 4:
+ if depth == 0 {
+ return 0, ErrUnexpectedEndOfGroupGenerated
+ }
+ depth--
+ case 5:
+ iNdEx += 4
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ if depth == 0 {
+ return iNdEx, nil
+ }
+ }
+ return 0, io.ErrUnexpectedEOF
+}
+
+var (
+ ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
+ ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
+)
diff --git a/vendor/k8s.io/api/coordination/v1alpha1/generated.proto b/vendor/k8s.io/api/coordination/v1alpha1/generated.proto
new file mode 100644
index 00000000000..57895ad569d
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1alpha1/generated.proto
@@ -0,0 +1,105 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+// This file was autogenerated by go-to-protobuf. Do not edit it manually!
+
+syntax = "proto2";
+
+package k8s.io.api.coordination.v1alpha1;
+
+import "k8s.io/api/coordination/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
+
+// Package-wide variables from generator "generated".
+option go_package = "k8s.io/api/coordination/v1alpha1";
+
+// LeaseCandidate defines a candidate for a Lease object.
+// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.
+message LeaseCandidate {
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // spec contains the specification of the Lease.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ optional LeaseCandidateSpec spec = 2;
+}
+
+// LeaseCandidateList is a list of Lease objects.
+message LeaseCandidateList {
+ // Standard list metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // items is a list of schema objects.
+ repeated LeaseCandidate items = 2;
+}
+
+// LeaseCandidateSpec is a specification of a Lease.
+message LeaseCandidateSpec {
+ // LeaseName is the name of the lease for which this candidate is contending.
+ // This field is immutable.
+ // +required
+ optional string leaseName = 1;
+
+ // PingTime is the last time that the server has requested the LeaseCandidate
+ // to renew. It is only done during leader election to check if any
+ // LeaseCandidates have become ineligible. When PingTime is updated, the
+ // LeaseCandidate will respond by updating RenewTime.
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime pingTime = 2;
+
+ // RenewTime is the time that the LeaseCandidate was last updated.
+ // Any time a Lease needs to do leader election, the PingTime field
+ // is updated to signal to the LeaseCandidate that they should update
+ // the RenewTime.
+ // Old LeaseCandidate objects are also garbage collected if it has been hours
+ // since the last renew. The PingTime field is updated regularly to prevent
+ // garbage collection for still active LeaseCandidates.
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 3;
+
+ // BinaryVersion is the binary version. It must be in a semver format without leading `v`.
+ // This field is required when strategy is "OldestEmulationVersion"
+ // +optional
+ optional string binaryVersion = 4;
+
+ // EmulationVersion is the emulation version. It must be in a semver format without leading `v`.
+ // EmulationVersion must be less than or equal to BinaryVersion.
+ // This field is required when strategy is "OldestEmulationVersion"
+ // +optional
+ optional string emulationVersion = 5;
+
+ // PreferredStrategies indicates the list of strategies for picking the leader for coordinated leader election.
+ // The list is ordered, and the first strategy supersedes all other strategies. The list is used by coordinated
+ // leader election to make a decision about the final election strategy. This follows as
+ // - If all clients have strategy X as the first element in this list, strategy X will be used.
+ // - If a candidate has strategy [X] and another candidate has strategy [Y, X], Y supersedes X and strategy Y
+ // will be used.
+ // - If a candidate has strategy [X, Y] and another candidate has strategy [Y, X], this is a user error and leader
+ // election will not operate the Lease until resolved.
+ // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
+ // +featureGate=CoordinatedLeaderElection
+ // +listType=atomic
+ // +required
+ repeated string preferredStrategies = 6;
+}
+
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/v1/register.go b/vendor/k8s.io/api/coordination/v1alpha1/register.go
similarity index 51%
rename from vendor/k8s.io/apiserver/pkg/apis/config/v1/register.go
rename to vendor/k8s.io/api/coordination/v1alpha1/register.go
index 32b5634c44e..6e57905a190 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/config/v1/register.go
+++ b/vendor/k8s.io/api/coordination/v1alpha1/register.go
@@ -14,40 +14,40 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package v1alpha1
import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
-// GroupName is the group name use in this package.
-const GroupName = "apiserver.config.k8s.io"
+// GroupName is the group name use in this package
+const GroupName = "coordination.k8s.io"
-// SchemeGroupVersion is group version used to register these objects.
-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
var (
- // SchemeBuilder points to a list of functions added to Scheme.
- SchemeBuilder runtime.SchemeBuilder
+ // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
+ // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
localSchemeBuilder = &SchemeBuilder
- // AddToScheme adds this group to a scheme.
- AddToScheme = localSchemeBuilder.AddToScheme
+ AddToScheme = localSchemeBuilder.AddToScheme
)
-func init() {
- // We only register manually written functions here. The registration of the
- // generated functions takes place in the generated files. The separation
- // makes the code compile even when the generated files are missing.
- localSchemeBuilder.Register(addKnownTypes)
- localSchemeBuilder.Register(addDefaultingFuncs)
-}
-
+// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
- &EncryptionConfiguration{},
+ &LeaseCandidate{},
+ &LeaseCandidateList{},
)
- // also register into the v1 group as EncryptionConfig (due to a docs bug)
- scheme.AddKnownTypeWithName(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "EncryptionConfig"}, &EncryptionConfiguration{})
+
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
diff --git a/vendor/k8s.io/api/coordination/v1alpha1/types.go b/vendor/k8s.io/api/coordination/v1alpha1/types.go
new file mode 100644
index 00000000000..14066600cf5
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1alpha1/types.go
@@ -0,0 +1,100 @@
+/*
+Copyright 2018 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+ v1 "k8s.io/api/coordination/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// LeaseCandidate defines a candidate for a Lease object.
+// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.
+type LeaseCandidate struct {
+ metav1.TypeMeta `json:",inline"`
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // spec contains the specification of the Lease.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ Spec LeaseCandidateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
+}
+
+// LeaseCandidateSpec is a specification of a Lease.
+type LeaseCandidateSpec struct {
+ // LeaseName is the name of the lease for which this candidate is contending.
+ // This field is immutable.
+ // +required
+ LeaseName string `json:"leaseName" protobuf:"bytes,1,name=leaseName"`
+ // PingTime is the last time that the server has requested the LeaseCandidate
+ // to renew. It is only done during leader election to check if any
+ // LeaseCandidates have become ineligible. When PingTime is updated, the
+ // LeaseCandidate will respond by updating RenewTime.
+ // +optional
+ PingTime *metav1.MicroTime `json:"pingTime,omitempty" protobuf:"bytes,2,opt,name=pingTime"`
+ // RenewTime is the time that the LeaseCandidate was last updated.
+ // Any time a Lease needs to do leader election, the PingTime field
+ // is updated to signal to the LeaseCandidate that they should update
+ // the RenewTime.
+ // Old LeaseCandidate objects are also garbage collected if it has been hours
+ // since the last renew. The PingTime field is updated regularly to prevent
+ // garbage collection for still active LeaseCandidates.
+ // +optional
+ RenewTime *metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,3,opt,name=renewTime"`
+ // BinaryVersion is the binary version. It must be in a semver format without leading `v`.
+ // This field is required when strategy is "OldestEmulationVersion"
+ // +optional
+ BinaryVersion string `json:"binaryVersion,omitempty" protobuf:"bytes,4,opt,name=binaryVersion"`
+ // EmulationVersion is the emulation version. It must be in a semver format without leading `v`.
+ // EmulationVersion must be less than or equal to BinaryVersion.
+ // This field is required when strategy is "OldestEmulationVersion"
+ // +optional
+ EmulationVersion string `json:"emulationVersion,omitempty" protobuf:"bytes,5,opt,name=emulationVersion"`
+ // PreferredStrategies indicates the list of strategies for picking the leader for coordinated leader election.
+ // The list is ordered, and the first strategy supersedes all other strategies. The list is used by coordinated
+ // leader election to make a decision about the final election strategy. This follows as
+ // - If all clients have strategy X as the first element in this list, strategy X will be used.
+ // - If a candidate has strategy [X] and another candidate has strategy [Y, X], Y supersedes X and strategy Y
+ // will be used.
+ // - If a candidate has strategy [X, Y] and another candidate has strategy [Y, X], this is a user error and leader
+ // election will not operate the Lease until resolved.
+ // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
+ // +featureGate=CoordinatedLeaderElection
+ // +listType=atomic
+ // +required
+ PreferredStrategies []v1.CoordinatedLeaseStrategy `json:"preferredStrategies,omitempty" protobuf:"bytes,6,opt,name=preferredStrategies"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// LeaseCandidateList is a list of Lease objects.
+type LeaseCandidateList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // items is a list of schema objects.
+ Items []LeaseCandidate `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
diff --git a/vendor/k8s.io/api/coordination/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/coordination/v1alpha1/types_swagger_doc_generated.go
new file mode 100644
index 00000000000..0e52809c8ca
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1alpha1/types_swagger_doc_generated.go
@@ -0,0 +1,64 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+// This file contains a collection of methods that can be used from go-restful to
+// generate Swagger API documentation for its models. Please read this PR for more
+// information on the implementation: https://github.com/emicklei/go-restful/pull/215
+//
+// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
+// they are on one line! For multiple line or blocks that you want to ignore use ---.
+// Any context after a --- is ignored.
+//
+// Those methods can be generated by using hack/update-codegen.sh
+
+// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
+var map_LeaseCandidate = map[string]string{
+ "": "LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.",
+ "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "spec": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
+}
+
+func (LeaseCandidate) SwaggerDoc() map[string]string {
+ return map_LeaseCandidate
+}
+
+var map_LeaseCandidateList = map[string]string{
+ "": "LeaseCandidateList is a list of Lease objects.",
+ "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "items": "items is a list of schema objects.",
+}
+
+func (LeaseCandidateList) SwaggerDoc() map[string]string {
+ return map_LeaseCandidateList
+}
+
+var map_LeaseCandidateSpec = map[string]string{
+ "": "LeaseCandidateSpec is a specification of a Lease.",
+ "leaseName": "LeaseName is the name of the lease for which this candidate is contending. This field is immutable.",
+ "pingTime": "PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.",
+ "renewTime": "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.",
+ "binaryVersion": "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is \"OldestEmulationVersion\"",
+ "emulationVersion": "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"",
+ "preferredStrategies": "PreferredStrategies indicates the list of strategies for picking the leader for coordinated leader election. The list is ordered, and the first strategy supersedes all other strategies. The list is used by coordinated leader election to make a decision about the final election strategy. This follows as - If all clients have strategy X as the first element in this list, strategy X will be used. - If a candidate has strategy [X] and another candidate has strategy [Y, X], Y supersedes X and strategy Y\n will be used.\n- If a candidate has strategy [X, Y] and another candidate has strategy [Y, X], this is a user error and leader\n election will not operate the Lease until resolved.\n(Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.",
+}
+
+func (LeaseCandidateSpec) SwaggerDoc() map[string]string {
+ return map_LeaseCandidateSpec
+}
+
+// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/vendor/k8s.io/api/coordination/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/coordination/v1alpha1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..9cf15d21dce
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1alpha1/zz_generated.deepcopy.go
@@ -0,0 +1,116 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ v1 "k8s.io/api/coordination/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeaseCandidate) DeepCopyInto(out *LeaseCandidate) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseCandidate.
+func (in *LeaseCandidate) DeepCopy() *LeaseCandidate {
+ if in == nil {
+ return nil
+ }
+ out := new(LeaseCandidate)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LeaseCandidate) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeaseCandidateList) DeepCopyInto(out *LeaseCandidateList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]LeaseCandidate, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseCandidateList.
+func (in *LeaseCandidateList) DeepCopy() *LeaseCandidateList {
+ if in == nil {
+ return nil
+ }
+ out := new(LeaseCandidateList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LeaseCandidateList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeaseCandidateSpec) DeepCopyInto(out *LeaseCandidateSpec) {
+ *out = *in
+ if in.PingTime != nil {
+ in, out := &in.PingTime, &out.PingTime
+ *out = (*in).DeepCopy()
+ }
+ if in.RenewTime != nil {
+ in, out := &in.RenewTime, &out.RenewTime
+ *out = (*in).DeepCopy()
+ }
+ if in.PreferredStrategies != nil {
+ in, out := &in.PreferredStrategies, &out.PreferredStrategies
+ *out = make([]v1.CoordinatedLeaseStrategy, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseCandidateSpec.
+func (in *LeaseCandidateSpec) DeepCopy() *LeaseCandidateSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(LeaseCandidateSpec)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/vendor/k8s.io/api/coordination/v1alpha1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/coordination/v1alpha1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..f42bef65c9d
--- /dev/null
+++ b/vendor/k8s.io/api/coordination/v1alpha1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,58 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1alpha1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *LeaseCandidate) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *LeaseCandidate) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *LeaseCandidate) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *LeaseCandidateList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *LeaseCandidateList) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *LeaseCandidateList) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
diff --git a/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go b/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go
index 655de565901..bea9b8146ad 100644
--- a/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go
+++ b/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go
@@ -25,6 +25,8 @@ import (
io "io"
proto "github.com/gogo/protobuf/proto"
+
+ k8s_io_api_coordination_v1 "k8s.io/api/coordination/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
math "math"
@@ -139,40 +141,45 @@ func init() {
}
var fileDescriptor_8d4e223b8bb23da3 = []byte{
- // 527 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x41, 0x6f, 0xd3, 0x30,
- 0x14, 0xc7, 0x9b, 0xb5, 0x95, 0x56, 0x97, 0x8d, 0x2a, 0xea, 0x21, 0xea, 0x21, 0x99, 0x7a, 0x40,
- 0x13, 0x12, 0x36, 0x9d, 0x10, 0x42, 0x9c, 0x20, 0x02, 0x89, 0x89, 0x4c, 0x48, 0xd9, 0x4e, 0x68,
- 0x07, 0xdc, 0xe4, 0x91, 0x9a, 0x2e, 0x71, 0x88, 0xdd, 0xa2, 0xdd, 0xf8, 0x08, 0x5c, 0xf9, 0x22,
- 0xf0, 0x15, 0x7a, 0xdc, 0x71, 0xa7, 0x88, 0x9a, 0x2f, 0x82, 0xec, 0x76, 0x6b, 0x69, 0x87, 0x5a,
- 0x71, 0x8b, 0x9f, 0xdf, 0xef, 0xf7, 0xfe, 0x7e, 0x87, 0x20, 0x32, 0x7c, 0x26, 0x30, 0xe3, 0x84,
- 0xe6, 0x8c, 0x44, 0x9c, 0x17, 0x31, 0xcb, 0xa8, 0x64, 0x3c, 0x23, 0xe3, 0x5e, 0x1f, 0x24, 0xed,
- 0x91, 0x04, 0x32, 0x28, 0xa8, 0x84, 0x18, 0xe7, 0x05, 0x97, 0xdc, 0xf6, 0x66, 0x00, 0xa6, 0x39,
- 0xc3, 0xcb, 0x00, 0x9e, 0x03, 0x9d, 0x47, 0x09, 0x93, 0x83, 0x51, 0x1f, 0x47, 0x3c, 0x25, 0x09,
- 0x4f, 0x38, 0x31, 0x5c, 0x7f, 0xf4, 0xd1, 0x9c, 0xcc, 0xc1, 0x7c, 0xcd, 0x7c, 0x9d, 0x27, 0x8b,
- 0x00, 0x29, 0x8d, 0x06, 0x2c, 0x83, 0xe2, 0x92, 0xe4, 0xc3, 0x44, 0x17, 0x04, 0x49, 0x41, 0x52,
- 0x32, 0x5e, 0x4b, 0xd1, 0x21, 0xff, 0xa2, 0x8a, 0x51, 0x26, 0x59, 0x0a, 0x6b, 0xc0, 0xd3, 0x4d,
- 0x80, 0x88, 0x06, 0x90, 0xd2, 0x55, 0xae, 0xfb, 0xd3, 0x42, 0xf5, 0x00, 0xa8, 0x00, 0xfb, 0x03,
- 0xda, 0xd5, 0x69, 0x62, 0x2a, 0xa9, 0x63, 0x1d, 0x58, 0x87, 0xcd, 0xa3, 0xc7, 0x78, 0xb1, 0x8b,
- 0x5b, 0x29, 0xce, 0x87, 0x89, 0x2e, 0x08, 0xac, 0xbb, 0xf1, 0xb8, 0x87, 0xdf, 0xf5, 0x3f, 0x41,
- 0x24, 0x4f, 0x40, 0x52, 0xdf, 0x9e, 0x94, 0x5e, 0x45, 0x95, 0x1e, 0x5a, 0xd4, 0xc2, 0x5b, 0xab,
- 0x1d, 0xa0, 0x9a, 0xc8, 0x21, 0x72, 0x76, 0x8c, 0xfd, 0x21, 0xde, 0xb0, 0x69, 0x6c, 0x72, 0x9d,
- 0xe6, 0x10, 0xf9, 0xf7, 0xe6, 0xde, 0x9a, 0x3e, 0x85, 0xc6, 0xd2, 0xfd, 0x61, 0xa1, 0x86, 0xe9,
- 0x08, 0x98, 0x90, 0xf6, 0xf9, 0x5a, 0x7a, 0xbc, 0x5d, 0x7a, 0x4d, 0x9b, 0xec, 0xad, 0xf9, 0x8c,
- 0xdd, 0x9b, 0xca, 0x52, 0xf2, 0xb7, 0xa8, 0xce, 0x24, 0xa4, 0xc2, 0xd9, 0x39, 0xa8, 0x1e, 0x36,
- 0x8f, 0x1e, 0x6c, 0x17, 0xdd, 0xdf, 0x9b, 0x2b, 0xeb, 0xc7, 0x1a, 0x0e, 0x67, 0x8e, 0xee, 0xf7,
- 0xea, 0x3c, 0xb8, 0x7e, 0x8c, 0xfd, 0x1c, 0xed, 0x0f, 0xf8, 0x45, 0x0c, 0xc5, 0x71, 0x0c, 0x99,
- 0x64, 0xf2, 0xd2, 0xc4, 0x6f, 0xf8, 0xb6, 0x2a, 0xbd, 0xfd, 0x37, 0x7f, 0xdd, 0x84, 0x2b, 0x9d,
- 0x76, 0x80, 0xda, 0x17, 0x5a, 0xf4, 0x6a, 0x54, 0x98, 0xf1, 0xa7, 0x10, 0xf1, 0x2c, 0x16, 0x66,
- 0xc1, 0x75, 0xdf, 0x51, 0xa5, 0xd7, 0x0e, 0xee, 0xb8, 0x0f, 0xef, 0xa4, 0xec, 0x3e, 0x6a, 0xd2,
- 0xe8, 0xf3, 0x88, 0x15, 0x70, 0xc6, 0x52, 0x70, 0xaa, 0x66, 0x8b, 0x64, 0xbb, 0x2d, 0x9e, 0xb0,
- 0xa8, 0xe0, 0x1a, 0xf3, 0xef, 0xab, 0xd2, 0x6b, 0xbe, 0x5c, 0x78, 0xc2, 0x65, 0xa9, 0x7d, 0x8e,
- 0x1a, 0x05, 0x64, 0xf0, 0xc5, 0x4c, 0xa8, 0xfd, 0xdf, 0x84, 0x3d, 0x55, 0x7a, 0x8d, 0xf0, 0xc6,
- 0x12, 0x2e, 0x84, 0xf6, 0x0b, 0xd4, 0x32, 0x2f, 0x3b, 0x2b, 0x68, 0x26, 0x98, 0x7e, 0x9b, 0x70,
- 0xea, 0x66, 0x17, 0x6d, 0x55, 0x7a, 0xad, 0x60, 0xe5, 0x2e, 0x5c, 0xeb, 0xf6, 0x5f, 0x4f, 0xa6,
- 0x6e, 0xe5, 0x6a, 0xea, 0x56, 0xae, 0xa7, 0x6e, 0xe5, 0xab, 0x72, 0xad, 0x89, 0x72, 0xad, 0x2b,
- 0xe5, 0x5a, 0xd7, 0xca, 0xb5, 0x7e, 0x29, 0xd7, 0xfa, 0xf6, 0xdb, 0xad, 0xbc, 0xf7, 0x36, 0xfc,
- 0x54, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x81, 0x42, 0xfe, 0x76, 0x04, 0x00, 0x00,
+ // 600 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdf, 0x4e, 0xd4, 0x4e,
+ 0x14, 0xc7, 0xb7, 0xb0, 0xfb, 0xfb, 0xb1, 0xb3, 0xf2, 0x27, 0x23, 0x17, 0x0d, 0x17, 0x2d, 0xe1,
+ 0xc2, 0x10, 0x12, 0xa7, 0x82, 0xc6, 0x18, 0x13, 0x13, 0x2d, 0x9a, 0x48, 0x2c, 0xd1, 0x14, 0xae,
+ 0x0c, 0x89, 0xce, 0xb6, 0x87, 0xee, 0x08, 0xed, 0xd4, 0x99, 0x59, 0x0c, 0x77, 0x3e, 0x82, 0x4f,
+ 0xa3, 0xf1, 0x0d, 0xb8, 0xe4, 0x92, 0xab, 0x46, 0xc6, 0xb7, 0xf0, 0xca, 0xcc, 0x6c, 0x61, 0x61,
+ 0x81, 0xb0, 0xf1, 0x6e, 0xe7, 0x9c, 0xf3, 0xfd, 0x9c, 0xef, 0x9c, 0xb3, 0x53, 0x14, 0xec, 0x3d,
+ 0x91, 0x84, 0xf1, 0x80, 0x96, 0x2c, 0x48, 0x38, 0x17, 0x29, 0x2b, 0xa8, 0x62, 0xbc, 0x08, 0x0e,
+ 0x56, 0xbb, 0xa0, 0xe8, 0x6a, 0x90, 0x41, 0x01, 0x82, 0x2a, 0x48, 0x49, 0x29, 0xb8, 0xe2, 0xd8,
+ 0x1f, 0x08, 0x08, 0x2d, 0x19, 0xb9, 0x28, 0x20, 0xb5, 0x60, 0xe1, 0x7e, 0xc6, 0x54, 0xaf, 0xdf,
+ 0x25, 0x09, 0xcf, 0x83, 0x8c, 0x67, 0x3c, 0xb0, 0xba, 0x6e, 0x7f, 0xd7, 0x9e, 0xec, 0xc1, 0xfe,
+ 0x1a, 0xf0, 0x16, 0x56, 0x6e, 0x36, 0x30, 0xda, 0x7b, 0xe1, 0xd1, 0xb0, 0x36, 0xa7, 0x49, 0x8f,
+ 0x15, 0x20, 0x0e, 0x83, 0x72, 0x2f, 0x33, 0x01, 0x19, 0xe4, 0xa0, 0xe8, 0x75, 0xaa, 0xe0, 0x26,
+ 0x95, 0xe8, 0x17, 0x8a, 0xe5, 0x70, 0x45, 0xf0, 0xf8, 0x36, 0x81, 0x4c, 0x7a, 0x90, 0xd3, 0x51,
+ 0xdd, 0xd2, 0x0f, 0x07, 0xb5, 0x22, 0xa0, 0x12, 0xf0, 0x47, 0x34, 0x65, 0xdc, 0xa4, 0x54, 0x51,
+ 0xd7, 0x59, 0x74, 0x96, 0x3b, 0x6b, 0x0f, 0xc8, 0x70, 0x6e, 0xe7, 0x50, 0x52, 0xee, 0x65, 0x26,
+ 0x20, 0x89, 0xa9, 0x26, 0x07, 0xab, 0xe4, 0x6d, 0xf7, 0x13, 0x24, 0x6a, 0x13, 0x14, 0x0d, 0xf1,
+ 0x51, 0xe5, 0x37, 0x74, 0xe5, 0xa3, 0x61, 0x2c, 0x3e, 0xa7, 0xe2, 0x08, 0x35, 0x65, 0x09, 0x89,
+ 0x3b, 0x61, 0xe9, 0x2b, 0xe4, 0x96, 0xad, 0x10, 0xeb, 0x6b, 0xab, 0x84, 0x24, 0xbc, 0x53, 0x73,
+ 0x9b, 0xe6, 0x14, 0x5b, 0xca, 0xd2, 0x77, 0x07, 0xb5, 0x6d, 0x45, 0xc4, 0xa4, 0xc2, 0x3b, 0x57,
+ 0xdc, 0x93, 0xf1, 0xdc, 0x1b, 0xb5, 0xf5, 0x3e, 0x57, 0xf7, 0x98, 0x3a, 0x8b, 0x5c, 0x70, 0xfe,
+ 0x06, 0xb5, 0x98, 0x82, 0x5c, 0xba, 0x13, 0x8b, 0x93, 0xcb, 0x9d, 0xb5, 0x7b, 0xe3, 0x59, 0x0f,
+ 0xa7, 0x6b, 0x64, 0x6b, 0xc3, 0x88, 0xe3, 0x01, 0x63, 0xe9, 0x67, 0xb3, 0x36, 0x6e, 0x2e, 0x83,
+ 0x9f, 0xa2, 0x99, 0x1e, 0xdf, 0x4f, 0x41, 0x6c, 0xa4, 0x50, 0x28, 0xa6, 0x0e, 0xad, 0xfd, 0x76,
+ 0x88, 0x75, 0xe5, 0xcf, 0xbc, 0xbe, 0x94, 0x89, 0x47, 0x2a, 0x71, 0x84, 0xe6, 0xf7, 0x0d, 0xe8,
+ 0x65, 0x5f, 0xd8, 0xf6, 0x5b, 0x90, 0xf0, 0x22, 0x95, 0x76, 0xc0, 0xad, 0xd0, 0xd5, 0x95, 0x3f,
+ 0x1f, 0x5d, 0x93, 0x8f, 0xaf, 0x55, 0xe1, 0x2e, 0xea, 0xd0, 0xe4, 0x73, 0x9f, 0x09, 0xd8, 0x66,
+ 0x39, 0xb8, 0x93, 0x76, 0x8a, 0xc1, 0x78, 0x53, 0xdc, 0x64, 0x89, 0xe0, 0x46, 0x16, 0xce, 0xea,
+ 0xca, 0xef, 0xbc, 0x18, 0x72, 0xe2, 0x8b, 0x50, 0xbc, 0x83, 0xda, 0x02, 0x0a, 0xf8, 0x62, 0x3b,
+ 0x34, 0xff, 0xad, 0xc3, 0xb4, 0xae, 0xfc, 0x76, 0x7c, 0x46, 0x89, 0x87, 0x40, 0xfc, 0x1c, 0xcd,
+ 0xd9, 0x9b, 0x6d, 0x0b, 0x5a, 0x48, 0x66, 0xee, 0x26, 0xdd, 0x96, 0x9d, 0xc5, 0xbc, 0xae, 0xfc,
+ 0xb9, 0x68, 0x24, 0x17, 0x5f, 0xa9, 0xc6, 0x1f, 0xd0, 0x94, 0x54, 0xe6, 0x7d, 0x64, 0x87, 0xee,
+ 0x7f, 0x76, 0x0f, 0xeb, 0xe6, 0x2f, 0xb1, 0x55, 0xc7, 0xfe, 0x54, 0xfe, 0xc3, 0x9b, 0xdf, 0x3e,
+ 0x59, 0x3f, 0x3b, 0x43, 0x3a, 0x58, 0x70, 0x2d, 0x8b, 0xcf, 0xa1, 0xf8, 0x19, 0x9a, 0x2d, 0x05,
+ 0xec, 0x82, 0x10, 0x90, 0x0e, 0xb6, 0xeb, 0xfe, 0x6f, 0xfb, 0xdc, 0xd5, 0x95, 0x3f, 0xfb, 0xee,
+ 0x72, 0x2a, 0x1e, 0xad, 0x0d, 0x5f, 0x1d, 0x9d, 0x7a, 0x8d, 0xe3, 0x53, 0xaf, 0x71, 0x72, 0xea,
+ 0x35, 0xbe, 0x6a, 0xcf, 0x39, 0xd2, 0x9e, 0x73, 0xac, 0x3d, 0xe7, 0x44, 0x7b, 0xce, 0x2f, 0xed,
+ 0x39, 0xdf, 0x7e, 0x7b, 0x8d, 0xf7, 0xfe, 0x2d, 0x1f, 0xc8, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff,
+ 0x57, 0x93, 0xf3, 0xef, 0x42, 0x05, 0x00, 0x00,
}
func (m *Lease) Marshal() (dAtA []byte, err error) {
@@ -285,6 +292,20 @@ func (m *LeaseSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.PreferredHolder != nil {
+ i -= len(*m.PreferredHolder)
+ copy(dAtA[i:], *m.PreferredHolder)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreferredHolder)))
+ i--
+ dAtA[i] = 0x3a
+ }
+ if m.Strategy != nil {
+ i -= len(*m.Strategy)
+ copy(dAtA[i:], *m.Strategy)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Strategy)))
+ i--
+ dAtA[i] = 0x32
+ }
if m.LeaseTransitions != nil {
i = encodeVarintGenerated(dAtA, i, uint64(*m.LeaseTransitions))
i--
@@ -394,6 +415,14 @@ func (m *LeaseSpec) Size() (n int) {
if m.LeaseTransitions != nil {
n += 1 + sovGenerated(uint64(*m.LeaseTransitions))
}
+ if m.Strategy != nil {
+ l = len(*m.Strategy)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.PreferredHolder != nil {
+ l = len(*m.PreferredHolder)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -440,6 +469,8 @@ func (this *LeaseSpec) String() string {
`AcquireTime:` + strings.Replace(fmt.Sprintf("%v", this.AcquireTime), "MicroTime", "v1.MicroTime", 1) + `,`,
`RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`,
`LeaseTransitions:` + valueToStringGenerated(this.LeaseTransitions) + `,`,
+ `Strategy:` + valueToStringGenerated(this.Strategy) + `,`,
+ `PreferredHolder:` + valueToStringGenerated(this.PreferredHolder) + `,`,
`}`,
}, "")
return s
@@ -859,6 +890,72 @@ func (m *LeaseSpec) Unmarshal(dAtA []byte) error {
}
}
m.LeaseTransitions = &v
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Strategy", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := k8s_io_api_coordination_v1.CoordinatedLeaseStrategy(dAtA[iNdEx:postIndex])
+ m.Strategy = &s
+ iNdEx = postIndex
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PreferredHolder", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := string(dAtA[iNdEx:postIndex])
+ m.PreferredHolder = &s
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
diff --git a/vendor/k8s.io/api/coordination/v1beta1/generated.proto b/vendor/k8s.io/api/coordination/v1beta1/generated.proto
index 92c8918b801..088811a74b3 100644
--- a/vendor/k8s.io/api/coordination/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/coordination/v1beta1/generated.proto
@@ -21,6 +21,7 @@ syntax = "proto2";
package k8s.io.api.coordination.v1beta1;
+import "k8s.io/api/coordination/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
@@ -32,7 +33,7 @@ option go_package = "k8s.io/api/coordination/v1beta1";
message Lease {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec contains the specification of the Lease.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -45,7 +46,7 @@ message LeaseList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated Lease items = 2;
@@ -54,6 +55,8 @@ message LeaseList {
// LeaseSpec is a specification of a Lease.
message LeaseSpec {
// holderIdentity contains the identity of the holder of a current lease.
+ // If Coordinated Leader Election is used, the holder identity must be
+ // equal to the elected LeaseCandidate.metadata.name field.
// +optional
optional string holderIdentity = 1;
@@ -65,16 +68,28 @@ message LeaseSpec {
// acquireTime is a time when the current lease was acquired.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3;
// renewTime is a time when the current holder of a lease has last
// updated the lease.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4;
// leaseTransitions is the number of transitions of a lease between
// holders.
// +optional
optional int32 leaseTransitions = 5;
+
+ // Strategy indicates the strategy for picking the leader for coordinated leader election
+ // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ optional string strategy = 6;
+
+ // PreferredHolder signals to a lease holder that the lease has a
+ // more optimal holder and should be given up.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ optional string preferredHolder = 7;
}
diff --git a/vendor/k8s.io/api/coordination/v1beta1/types.go b/vendor/k8s.io/api/coordination/v1beta1/types.go
index 3a3d5f32e21..d63fc30a9e7 100644
--- a/vendor/k8s.io/api/coordination/v1beta1/types.go
+++ b/vendor/k8s.io/api/coordination/v1beta1/types.go
@@ -17,6 +17,7 @@ limitations under the License.
package v1beta1
import (
+ v1 "k8s.io/api/coordination/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -42,6 +43,8 @@ type Lease struct {
// LeaseSpec is a specification of a Lease.
type LeaseSpec struct {
// holderIdentity contains the identity of the holder of a current lease.
+ // If Coordinated Leader Election is used, the holder identity must be
+ // equal to the elected LeaseCandidate.metadata.name field.
// +optional
HolderIdentity *string `json:"holderIdentity,omitempty" protobuf:"bytes,1,opt,name=holderIdentity"`
// leaseDurationSeconds is a duration that candidates for a lease need
@@ -60,6 +63,16 @@ type LeaseSpec struct {
// holders.
// +optional
LeaseTransitions *int32 `json:"leaseTransitions,omitempty" protobuf:"varint,5,opt,name=leaseTransitions"`
+ // Strategy indicates the strategy for picking the leader for coordinated leader election
+ // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ Strategy *v1.CoordinatedLeaseStrategy `json:"strategy,omitempty" protobuf:"bytes,6,opt,name=strategy"`
+ // PreferredHolder signals to a lease holder that the lease has a
+ // more optimal holder and should be given up.
+ // +featureGate=CoordinatedLeaderElection
+ // +optional
+ PreferredHolder *string `json:"preferredHolder,omitempty" protobuf:"bytes,7,opt,name=preferredHolder"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go
index 78ca4e393fc..50fe8ea1896 100644
--- a/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go
@@ -49,11 +49,13 @@ func (LeaseList) SwaggerDoc() map[string]string {
var map_LeaseSpec = map[string]string{
"": "LeaseSpec is a specification of a Lease.",
- "holderIdentity": "holderIdentity contains the identity of the holder of a current lease.",
+ "holderIdentity": "holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.",
"leaseDurationSeconds": "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed renewTime.",
"acquireTime": "acquireTime is a time when the current lease was acquired.",
"renewTime": "renewTime is a time when the current holder of a lease has last updated the lease.",
"leaseTransitions": "leaseTransitions is the number of transitions of a lease between holders.",
+ "strategy": "Strategy indicates the strategy for picking the leader for coordinated leader election (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.",
+ "preferredHolder": "PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up.",
}
func (LeaseSpec) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go
index 3adfd872038..dcef1e346ad 100644
--- a/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go
@@ -22,6 +22,7 @@ limitations under the License.
package v1beta1
import (
+ v1 "k8s.io/api/coordination/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -111,6 +112,16 @@ func (in *LeaseSpec) DeepCopyInto(out *LeaseSpec) {
*out = new(int32)
**out = **in
}
+ if in.Strategy != nil {
+ in, out := &in.Strategy, &out.Strategy
+ *out = new(v1.CoordinatedLeaseStrategy)
+ **out = **in
+ }
+ if in.PreferredHolder != nil {
+ in, out := &in.PreferredHolder, &out.PreferredHolder
+ *out = new(string)
+ **out = **in
+ }
return
}
diff --git a/vendor/k8s.io/api/core/v1/doc.go b/vendor/k8s.io/api/core/v1/doc.go
index 1bdf0b25b1b..bc0041b331a 100644
--- a/vendor/k8s.io/api/core/v1/doc.go
+++ b/vendor/k8s.io/api/core/v1/doc.go
@@ -17,6 +17,8 @@ limitations under the License.
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
+// +k8s:prerelease-lifecycle-gen=true
+// +groupName=
// Package v1 is the v1 version of the core API.
package v1 // import "k8s.io/api/core/v1"
diff --git a/vendor/k8s.io/api/core/v1/generated.pb.go b/vendor/k8s.io/api/core/v1/generated.pb.go
index d52d8da1896..5654ee48291 100644
--- a/vendor/k8s.io/api/core/v1/generated.pb.go
+++ b/vendor/k8s.io/api/core/v1/generated.pb.go
@@ -497,38 +497,10 @@ func (m *CinderVolumeSource) XXX_DiscardUnknown() {
var xxx_messageInfo_CinderVolumeSource proto.InternalMessageInfo
-func (m *ClaimSource) Reset() { *m = ClaimSource{} }
-func (*ClaimSource) ProtoMessage() {}
-func (*ClaimSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{16}
-}
-func (m *ClaimSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ClaimSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ClaimSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClaimSource.Merge(m, src)
-}
-func (m *ClaimSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ClaimSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ClaimSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ClaimSource proto.InternalMessageInfo
-
func (m *ClientIPConfig) Reset() { *m = ClientIPConfig{} }
func (*ClientIPConfig) ProtoMessage() {}
func (*ClientIPConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{17}
+ return fileDescriptor_6c07b07c062484ab, []int{16}
}
func (m *ClientIPConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -556,7 +528,7 @@ var xxx_messageInfo_ClientIPConfig proto.InternalMessageInfo
func (m *ClusterTrustBundleProjection) Reset() { *m = ClusterTrustBundleProjection{} }
func (*ClusterTrustBundleProjection) ProtoMessage() {}
func (*ClusterTrustBundleProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{18}
+ return fileDescriptor_6c07b07c062484ab, []int{17}
}
func (m *ClusterTrustBundleProjection) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -584,7 +556,7 @@ var xxx_messageInfo_ClusterTrustBundleProjection proto.InternalMessageInfo
func (m *ComponentCondition) Reset() { *m = ComponentCondition{} }
func (*ComponentCondition) ProtoMessage() {}
func (*ComponentCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{19}
+ return fileDescriptor_6c07b07c062484ab, []int{18}
}
func (m *ComponentCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -612,7 +584,7 @@ var xxx_messageInfo_ComponentCondition proto.InternalMessageInfo
func (m *ComponentStatus) Reset() { *m = ComponentStatus{} }
func (*ComponentStatus) ProtoMessage() {}
func (*ComponentStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{20}
+ return fileDescriptor_6c07b07c062484ab, []int{19}
}
func (m *ComponentStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -640,7 +612,7 @@ var xxx_messageInfo_ComponentStatus proto.InternalMessageInfo
func (m *ComponentStatusList) Reset() { *m = ComponentStatusList{} }
func (*ComponentStatusList) ProtoMessage() {}
func (*ComponentStatusList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{21}
+ return fileDescriptor_6c07b07c062484ab, []int{20}
}
func (m *ComponentStatusList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -668,7 +640,7 @@ var xxx_messageInfo_ComponentStatusList proto.InternalMessageInfo
func (m *ConfigMap) Reset() { *m = ConfigMap{} }
func (*ConfigMap) ProtoMessage() {}
func (*ConfigMap) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{22}
+ return fileDescriptor_6c07b07c062484ab, []int{21}
}
func (m *ConfigMap) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -696,7 +668,7 @@ var xxx_messageInfo_ConfigMap proto.InternalMessageInfo
func (m *ConfigMapEnvSource) Reset() { *m = ConfigMapEnvSource{} }
func (*ConfigMapEnvSource) ProtoMessage() {}
func (*ConfigMapEnvSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{23}
+ return fileDescriptor_6c07b07c062484ab, []int{22}
}
func (m *ConfigMapEnvSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -724,7 +696,7 @@ var xxx_messageInfo_ConfigMapEnvSource proto.InternalMessageInfo
func (m *ConfigMapKeySelector) Reset() { *m = ConfigMapKeySelector{} }
func (*ConfigMapKeySelector) ProtoMessage() {}
func (*ConfigMapKeySelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{24}
+ return fileDescriptor_6c07b07c062484ab, []int{23}
}
func (m *ConfigMapKeySelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -752,7 +724,7 @@ var xxx_messageInfo_ConfigMapKeySelector proto.InternalMessageInfo
func (m *ConfigMapList) Reset() { *m = ConfigMapList{} }
func (*ConfigMapList) ProtoMessage() {}
func (*ConfigMapList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{25}
+ return fileDescriptor_6c07b07c062484ab, []int{24}
}
func (m *ConfigMapList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -780,7 +752,7 @@ var xxx_messageInfo_ConfigMapList proto.InternalMessageInfo
func (m *ConfigMapNodeConfigSource) Reset() { *m = ConfigMapNodeConfigSource{} }
func (*ConfigMapNodeConfigSource) ProtoMessage() {}
func (*ConfigMapNodeConfigSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{26}
+ return fileDescriptor_6c07b07c062484ab, []int{25}
}
func (m *ConfigMapNodeConfigSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -808,7 +780,7 @@ var xxx_messageInfo_ConfigMapNodeConfigSource proto.InternalMessageInfo
func (m *ConfigMapProjection) Reset() { *m = ConfigMapProjection{} }
func (*ConfigMapProjection) ProtoMessage() {}
func (*ConfigMapProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{27}
+ return fileDescriptor_6c07b07c062484ab, []int{26}
}
func (m *ConfigMapProjection) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -836,7 +808,7 @@ var xxx_messageInfo_ConfigMapProjection proto.InternalMessageInfo
func (m *ConfigMapVolumeSource) Reset() { *m = ConfigMapVolumeSource{} }
func (*ConfigMapVolumeSource) ProtoMessage() {}
func (*ConfigMapVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{28}
+ return fileDescriptor_6c07b07c062484ab, []int{27}
}
func (m *ConfigMapVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -864,7 +836,7 @@ var xxx_messageInfo_ConfigMapVolumeSource proto.InternalMessageInfo
func (m *Container) Reset() { *m = Container{} }
func (*Container) ProtoMessage() {}
func (*Container) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{29}
+ return fileDescriptor_6c07b07c062484ab, []int{28}
}
func (m *Container) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -892,7 +864,7 @@ var xxx_messageInfo_Container proto.InternalMessageInfo
func (m *ContainerImage) Reset() { *m = ContainerImage{} }
func (*ContainerImage) ProtoMessage() {}
func (*ContainerImage) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{30}
+ return fileDescriptor_6c07b07c062484ab, []int{29}
}
func (m *ContainerImage) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -920,7 +892,7 @@ var xxx_messageInfo_ContainerImage proto.InternalMessageInfo
func (m *ContainerPort) Reset() { *m = ContainerPort{} }
func (*ContainerPort) ProtoMessage() {}
func (*ContainerPort) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{31}
+ return fileDescriptor_6c07b07c062484ab, []int{30}
}
func (m *ContainerPort) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -948,7 +920,7 @@ var xxx_messageInfo_ContainerPort proto.InternalMessageInfo
func (m *ContainerResizePolicy) Reset() { *m = ContainerResizePolicy{} }
func (*ContainerResizePolicy) ProtoMessage() {}
func (*ContainerResizePolicy) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{32}
+ return fileDescriptor_6c07b07c062484ab, []int{31}
}
func (m *ContainerResizePolicy) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -976,7 +948,7 @@ var xxx_messageInfo_ContainerResizePolicy proto.InternalMessageInfo
func (m *ContainerState) Reset() { *m = ContainerState{} }
func (*ContainerState) ProtoMessage() {}
func (*ContainerState) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{33}
+ return fileDescriptor_6c07b07c062484ab, []int{32}
}
func (m *ContainerState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1004,7 +976,7 @@ var xxx_messageInfo_ContainerState proto.InternalMessageInfo
func (m *ContainerStateRunning) Reset() { *m = ContainerStateRunning{} }
func (*ContainerStateRunning) ProtoMessage() {}
func (*ContainerStateRunning) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{34}
+ return fileDescriptor_6c07b07c062484ab, []int{33}
}
func (m *ContainerStateRunning) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1032,7 +1004,7 @@ var xxx_messageInfo_ContainerStateRunning proto.InternalMessageInfo
func (m *ContainerStateTerminated) Reset() { *m = ContainerStateTerminated{} }
func (*ContainerStateTerminated) ProtoMessage() {}
func (*ContainerStateTerminated) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{35}
+ return fileDescriptor_6c07b07c062484ab, []int{34}
}
func (m *ContainerStateTerminated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1060,7 +1032,7 @@ var xxx_messageInfo_ContainerStateTerminated proto.InternalMessageInfo
func (m *ContainerStateWaiting) Reset() { *m = ContainerStateWaiting{} }
func (*ContainerStateWaiting) ProtoMessage() {}
func (*ContainerStateWaiting) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{36}
+ return fileDescriptor_6c07b07c062484ab, []int{35}
}
func (m *ContainerStateWaiting) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1088,7 +1060,7 @@ var xxx_messageInfo_ContainerStateWaiting proto.InternalMessageInfo
func (m *ContainerStatus) Reset() { *m = ContainerStatus{} }
func (*ContainerStatus) ProtoMessage() {}
func (*ContainerStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{37}
+ return fileDescriptor_6c07b07c062484ab, []int{36}
}
func (m *ContainerStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1113,6 +1085,34 @@ func (m *ContainerStatus) XXX_DiscardUnknown() {
var xxx_messageInfo_ContainerStatus proto.InternalMessageInfo
+func (m *ContainerUser) Reset() { *m = ContainerUser{} }
+func (*ContainerUser) ProtoMessage() {}
+func (*ContainerUser) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6c07b07c062484ab, []int{37}
+}
+func (m *ContainerUser) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ContainerUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ContainerUser) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ContainerUser.Merge(m, src)
+}
+func (m *ContainerUser) XXX_Size() int {
+ return m.Size()
+}
+func (m *ContainerUser) XXX_DiscardUnknown() {
+ xxx_messageInfo_ContainerUser.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ContainerUser proto.InternalMessageInfo
+
func (m *DaemonEndpoint) Reset() { *m = DaemonEndpoint{} }
func (*DaemonEndpoint) ProtoMessage() {}
func (*DaemonEndpoint) Descriptor() ([]byte, []int) {
@@ -2149,10 +2149,38 @@ func (m *ISCSIVolumeSource) XXX_DiscardUnknown() {
var xxx_messageInfo_ISCSIVolumeSource proto.InternalMessageInfo
+func (m *ImageVolumeSource) Reset() { *m = ImageVolumeSource{} }
+func (*ImageVolumeSource) ProtoMessage() {}
+func (*ImageVolumeSource) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6c07b07c062484ab, []int{75}
+}
+func (m *ImageVolumeSource) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ImageVolumeSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ImageVolumeSource) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ImageVolumeSource.Merge(m, src)
+}
+func (m *ImageVolumeSource) XXX_Size() int {
+ return m.Size()
+}
+func (m *ImageVolumeSource) XXX_DiscardUnknown() {
+ xxx_messageInfo_ImageVolumeSource.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ImageVolumeSource proto.InternalMessageInfo
+
func (m *KeyToPath) Reset() { *m = KeyToPath{} }
func (*KeyToPath) ProtoMessage() {}
func (*KeyToPath) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{75}
+ return fileDescriptor_6c07b07c062484ab, []int{76}
}
func (m *KeyToPath) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2180,7 +2208,7 @@ var xxx_messageInfo_KeyToPath proto.InternalMessageInfo
func (m *Lifecycle) Reset() { *m = Lifecycle{} }
func (*Lifecycle) ProtoMessage() {}
func (*Lifecycle) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{76}
+ return fileDescriptor_6c07b07c062484ab, []int{77}
}
func (m *Lifecycle) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2208,7 +2236,7 @@ var xxx_messageInfo_Lifecycle proto.InternalMessageInfo
func (m *LifecycleHandler) Reset() { *m = LifecycleHandler{} }
func (*LifecycleHandler) ProtoMessage() {}
func (*LifecycleHandler) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{77}
+ return fileDescriptor_6c07b07c062484ab, []int{78}
}
func (m *LifecycleHandler) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2236,7 +2264,7 @@ var xxx_messageInfo_LifecycleHandler proto.InternalMessageInfo
func (m *LimitRange) Reset() { *m = LimitRange{} }
func (*LimitRange) ProtoMessage() {}
func (*LimitRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{78}
+ return fileDescriptor_6c07b07c062484ab, []int{79}
}
func (m *LimitRange) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2264,7 +2292,7 @@ var xxx_messageInfo_LimitRange proto.InternalMessageInfo
func (m *LimitRangeItem) Reset() { *m = LimitRangeItem{} }
func (*LimitRangeItem) ProtoMessage() {}
func (*LimitRangeItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{79}
+ return fileDescriptor_6c07b07c062484ab, []int{80}
}
func (m *LimitRangeItem) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2292,7 +2320,7 @@ var xxx_messageInfo_LimitRangeItem proto.InternalMessageInfo
func (m *LimitRangeList) Reset() { *m = LimitRangeList{} }
func (*LimitRangeList) ProtoMessage() {}
func (*LimitRangeList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{80}
+ return fileDescriptor_6c07b07c062484ab, []int{81}
}
func (m *LimitRangeList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2320,7 +2348,7 @@ var xxx_messageInfo_LimitRangeList proto.InternalMessageInfo
func (m *LimitRangeSpec) Reset() { *m = LimitRangeSpec{} }
func (*LimitRangeSpec) ProtoMessage() {}
func (*LimitRangeSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{81}
+ return fileDescriptor_6c07b07c062484ab, []int{82}
}
func (m *LimitRangeSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2345,10 +2373,38 @@ func (m *LimitRangeSpec) XXX_DiscardUnknown() {
var xxx_messageInfo_LimitRangeSpec proto.InternalMessageInfo
+func (m *LinuxContainerUser) Reset() { *m = LinuxContainerUser{} }
+func (*LinuxContainerUser) ProtoMessage() {}
+func (*LinuxContainerUser) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6c07b07c062484ab, []int{83}
+}
+func (m *LinuxContainerUser) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *LinuxContainerUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *LinuxContainerUser) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LinuxContainerUser.Merge(m, src)
+}
+func (m *LinuxContainerUser) XXX_Size() int {
+ return m.Size()
+}
+func (m *LinuxContainerUser) XXX_DiscardUnknown() {
+ xxx_messageInfo_LinuxContainerUser.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LinuxContainerUser proto.InternalMessageInfo
+
func (m *List) Reset() { *m = List{} }
func (*List) ProtoMessage() {}
func (*List) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{82}
+ return fileDescriptor_6c07b07c062484ab, []int{84}
}
func (m *List) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2376,7 +2432,7 @@ var xxx_messageInfo_List proto.InternalMessageInfo
func (m *LoadBalancerIngress) Reset() { *m = LoadBalancerIngress{} }
func (*LoadBalancerIngress) ProtoMessage() {}
func (*LoadBalancerIngress) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{83}
+ return fileDescriptor_6c07b07c062484ab, []int{85}
}
func (m *LoadBalancerIngress) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2404,7 +2460,7 @@ var xxx_messageInfo_LoadBalancerIngress proto.InternalMessageInfo
func (m *LoadBalancerStatus) Reset() { *m = LoadBalancerStatus{} }
func (*LoadBalancerStatus) ProtoMessage() {}
func (*LoadBalancerStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{84}
+ return fileDescriptor_6c07b07c062484ab, []int{86}
}
func (m *LoadBalancerStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2432,7 +2488,7 @@ var xxx_messageInfo_LoadBalancerStatus proto.InternalMessageInfo
func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} }
func (*LocalObjectReference) ProtoMessage() {}
func (*LocalObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{85}
+ return fileDescriptor_6c07b07c062484ab, []int{87}
}
func (m *LocalObjectReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2460,7 +2516,7 @@ var xxx_messageInfo_LocalObjectReference proto.InternalMessageInfo
func (m *LocalVolumeSource) Reset() { *m = LocalVolumeSource{} }
func (*LocalVolumeSource) ProtoMessage() {}
func (*LocalVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{86}
+ return fileDescriptor_6c07b07c062484ab, []int{88}
}
func (m *LocalVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2488,7 +2544,7 @@ var xxx_messageInfo_LocalVolumeSource proto.InternalMessageInfo
func (m *ModifyVolumeStatus) Reset() { *m = ModifyVolumeStatus{} }
func (*ModifyVolumeStatus) ProtoMessage() {}
func (*ModifyVolumeStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{87}
+ return fileDescriptor_6c07b07c062484ab, []int{89}
}
func (m *ModifyVolumeStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2516,7 +2572,7 @@ var xxx_messageInfo_ModifyVolumeStatus proto.InternalMessageInfo
func (m *NFSVolumeSource) Reset() { *m = NFSVolumeSource{} }
func (*NFSVolumeSource) ProtoMessage() {}
func (*NFSVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{88}
+ return fileDescriptor_6c07b07c062484ab, []int{90}
}
func (m *NFSVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2544,7 +2600,7 @@ var xxx_messageInfo_NFSVolumeSource proto.InternalMessageInfo
func (m *Namespace) Reset() { *m = Namespace{} }
func (*Namespace) ProtoMessage() {}
func (*Namespace) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{89}
+ return fileDescriptor_6c07b07c062484ab, []int{91}
}
func (m *Namespace) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2572,7 +2628,7 @@ var xxx_messageInfo_Namespace proto.InternalMessageInfo
func (m *NamespaceCondition) Reset() { *m = NamespaceCondition{} }
func (*NamespaceCondition) ProtoMessage() {}
func (*NamespaceCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{90}
+ return fileDescriptor_6c07b07c062484ab, []int{92}
}
func (m *NamespaceCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2600,7 +2656,7 @@ var xxx_messageInfo_NamespaceCondition proto.InternalMessageInfo
func (m *NamespaceList) Reset() { *m = NamespaceList{} }
func (*NamespaceList) ProtoMessage() {}
func (*NamespaceList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{91}
+ return fileDescriptor_6c07b07c062484ab, []int{93}
}
func (m *NamespaceList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2628,7 +2684,7 @@ var xxx_messageInfo_NamespaceList proto.InternalMessageInfo
func (m *NamespaceSpec) Reset() { *m = NamespaceSpec{} }
func (*NamespaceSpec) ProtoMessage() {}
func (*NamespaceSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{92}
+ return fileDescriptor_6c07b07c062484ab, []int{94}
}
func (m *NamespaceSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2656,7 +2712,7 @@ var xxx_messageInfo_NamespaceSpec proto.InternalMessageInfo
func (m *NamespaceStatus) Reset() { *m = NamespaceStatus{} }
func (*NamespaceStatus) ProtoMessage() {}
func (*NamespaceStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{93}
+ return fileDescriptor_6c07b07c062484ab, []int{95}
}
func (m *NamespaceStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2684,7 +2740,7 @@ var xxx_messageInfo_NamespaceStatus proto.InternalMessageInfo
func (m *Node) Reset() { *m = Node{} }
func (*Node) ProtoMessage() {}
func (*Node) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{94}
+ return fileDescriptor_6c07b07c062484ab, []int{96}
}
func (m *Node) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2712,7 +2768,7 @@ var xxx_messageInfo_Node proto.InternalMessageInfo
func (m *NodeAddress) Reset() { *m = NodeAddress{} }
func (*NodeAddress) ProtoMessage() {}
func (*NodeAddress) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{95}
+ return fileDescriptor_6c07b07c062484ab, []int{97}
}
func (m *NodeAddress) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2740,7 +2796,7 @@ var xxx_messageInfo_NodeAddress proto.InternalMessageInfo
func (m *NodeAffinity) Reset() { *m = NodeAffinity{} }
func (*NodeAffinity) ProtoMessage() {}
func (*NodeAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{96}
+ return fileDescriptor_6c07b07c062484ab, []int{98}
}
func (m *NodeAffinity) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2768,7 +2824,7 @@ var xxx_messageInfo_NodeAffinity proto.InternalMessageInfo
func (m *NodeCondition) Reset() { *m = NodeCondition{} }
func (*NodeCondition) ProtoMessage() {}
func (*NodeCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{97}
+ return fileDescriptor_6c07b07c062484ab, []int{99}
}
func (m *NodeCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2796,7 +2852,7 @@ var xxx_messageInfo_NodeCondition proto.InternalMessageInfo
func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} }
func (*NodeConfigSource) ProtoMessage() {}
func (*NodeConfigSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{98}
+ return fileDescriptor_6c07b07c062484ab, []int{100}
}
func (m *NodeConfigSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2824,7 +2880,7 @@ var xxx_messageInfo_NodeConfigSource proto.InternalMessageInfo
func (m *NodeConfigStatus) Reset() { *m = NodeConfigStatus{} }
func (*NodeConfigStatus) ProtoMessage() {}
func (*NodeConfigStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{99}
+ return fileDescriptor_6c07b07c062484ab, []int{101}
}
func (m *NodeConfigStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2852,7 +2908,7 @@ var xxx_messageInfo_NodeConfigStatus proto.InternalMessageInfo
func (m *NodeDaemonEndpoints) Reset() { *m = NodeDaemonEndpoints{} }
func (*NodeDaemonEndpoints) ProtoMessage() {}
func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{100}
+ return fileDescriptor_6c07b07c062484ab, []int{102}
}
func (m *NodeDaemonEndpoints) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2877,10 +2933,38 @@ func (m *NodeDaemonEndpoints) XXX_DiscardUnknown() {
var xxx_messageInfo_NodeDaemonEndpoints proto.InternalMessageInfo
+func (m *NodeFeatures) Reset() { *m = NodeFeatures{} }
+func (*NodeFeatures) ProtoMessage() {}
+func (*NodeFeatures) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6c07b07c062484ab, []int{103}
+}
+func (m *NodeFeatures) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *NodeFeatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *NodeFeatures) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_NodeFeatures.Merge(m, src)
+}
+func (m *NodeFeatures) XXX_Size() int {
+ return m.Size()
+}
+func (m *NodeFeatures) XXX_DiscardUnknown() {
+ xxx_messageInfo_NodeFeatures.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_NodeFeatures proto.InternalMessageInfo
+
func (m *NodeList) Reset() { *m = NodeList{} }
func (*NodeList) ProtoMessage() {}
func (*NodeList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{101}
+ return fileDescriptor_6c07b07c062484ab, []int{104}
}
func (m *NodeList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2908,7 +2992,7 @@ var xxx_messageInfo_NodeList proto.InternalMessageInfo
func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} }
func (*NodeProxyOptions) ProtoMessage() {}
func (*NodeProxyOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{102}
+ return fileDescriptor_6c07b07c062484ab, []int{105}
}
func (m *NodeProxyOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2936,7 +3020,7 @@ var xxx_messageInfo_NodeProxyOptions proto.InternalMessageInfo
func (m *NodeRuntimeHandler) Reset() { *m = NodeRuntimeHandler{} }
func (*NodeRuntimeHandler) ProtoMessage() {}
func (*NodeRuntimeHandler) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{103}
+ return fileDescriptor_6c07b07c062484ab, []int{106}
}
func (m *NodeRuntimeHandler) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2964,7 +3048,7 @@ var xxx_messageInfo_NodeRuntimeHandler proto.InternalMessageInfo
func (m *NodeRuntimeHandlerFeatures) Reset() { *m = NodeRuntimeHandlerFeatures{} }
func (*NodeRuntimeHandlerFeatures) ProtoMessage() {}
func (*NodeRuntimeHandlerFeatures) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{104}
+ return fileDescriptor_6c07b07c062484ab, []int{107}
}
func (m *NodeRuntimeHandlerFeatures) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -2992,7 +3076,7 @@ var xxx_messageInfo_NodeRuntimeHandlerFeatures proto.InternalMessageInfo
func (m *NodeSelector) Reset() { *m = NodeSelector{} }
func (*NodeSelector) ProtoMessage() {}
func (*NodeSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{105}
+ return fileDescriptor_6c07b07c062484ab, []int{108}
}
func (m *NodeSelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3020,7 +3104,7 @@ var xxx_messageInfo_NodeSelector proto.InternalMessageInfo
func (m *NodeSelectorRequirement) Reset() { *m = NodeSelectorRequirement{} }
func (*NodeSelectorRequirement) ProtoMessage() {}
func (*NodeSelectorRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{106}
+ return fileDescriptor_6c07b07c062484ab, []int{109}
}
func (m *NodeSelectorRequirement) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3048,7 +3132,7 @@ var xxx_messageInfo_NodeSelectorRequirement proto.InternalMessageInfo
func (m *NodeSelectorTerm) Reset() { *m = NodeSelectorTerm{} }
func (*NodeSelectorTerm) ProtoMessage() {}
func (*NodeSelectorTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{107}
+ return fileDescriptor_6c07b07c062484ab, []int{110}
}
func (m *NodeSelectorTerm) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3076,7 +3160,7 @@ var xxx_messageInfo_NodeSelectorTerm proto.InternalMessageInfo
func (m *NodeSpec) Reset() { *m = NodeSpec{} }
func (*NodeSpec) ProtoMessage() {}
func (*NodeSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{108}
+ return fileDescriptor_6c07b07c062484ab, []int{111}
}
func (m *NodeSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3104,7 +3188,7 @@ var xxx_messageInfo_NodeSpec proto.InternalMessageInfo
func (m *NodeStatus) Reset() { *m = NodeStatus{} }
func (*NodeStatus) ProtoMessage() {}
func (*NodeStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{109}
+ return fileDescriptor_6c07b07c062484ab, []int{112}
}
func (m *NodeStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3132,7 +3216,7 @@ var xxx_messageInfo_NodeStatus proto.InternalMessageInfo
func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} }
func (*NodeSystemInfo) ProtoMessage() {}
func (*NodeSystemInfo) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{110}
+ return fileDescriptor_6c07b07c062484ab, []int{113}
}
func (m *NodeSystemInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3160,7 +3244,7 @@ var xxx_messageInfo_NodeSystemInfo proto.InternalMessageInfo
func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} }
func (*ObjectFieldSelector) ProtoMessage() {}
func (*ObjectFieldSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{111}
+ return fileDescriptor_6c07b07c062484ab, []int{114}
}
func (m *ObjectFieldSelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3188,7 +3272,7 @@ var xxx_messageInfo_ObjectFieldSelector proto.InternalMessageInfo
func (m *ObjectReference) Reset() { *m = ObjectReference{} }
func (*ObjectReference) ProtoMessage() {}
func (*ObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{112}
+ return fileDescriptor_6c07b07c062484ab, []int{115}
}
func (m *ObjectReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3216,7 +3300,7 @@ var xxx_messageInfo_ObjectReference proto.InternalMessageInfo
func (m *PersistentVolume) Reset() { *m = PersistentVolume{} }
func (*PersistentVolume) ProtoMessage() {}
func (*PersistentVolume) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{113}
+ return fileDescriptor_6c07b07c062484ab, []int{116}
}
func (m *PersistentVolume) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3244,7 +3328,7 @@ var xxx_messageInfo_PersistentVolume proto.InternalMessageInfo
func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} }
func (*PersistentVolumeClaim) ProtoMessage() {}
func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{114}
+ return fileDescriptor_6c07b07c062484ab, []int{117}
}
func (m *PersistentVolumeClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3272,7 +3356,7 @@ var xxx_messageInfo_PersistentVolumeClaim proto.InternalMessageInfo
func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} }
func (*PersistentVolumeClaimCondition) ProtoMessage() {}
func (*PersistentVolumeClaimCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{115}
+ return fileDescriptor_6c07b07c062484ab, []int{118}
}
func (m *PersistentVolumeClaimCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3300,7 +3384,7 @@ var xxx_messageInfo_PersistentVolumeClaimCondition proto.InternalMessageInfo
func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} }
func (*PersistentVolumeClaimList) ProtoMessage() {}
func (*PersistentVolumeClaimList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{116}
+ return fileDescriptor_6c07b07c062484ab, []int{119}
}
func (m *PersistentVolumeClaimList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3328,7 +3412,7 @@ var xxx_messageInfo_PersistentVolumeClaimList proto.InternalMessageInfo
func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} }
func (*PersistentVolumeClaimSpec) ProtoMessage() {}
func (*PersistentVolumeClaimSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{117}
+ return fileDescriptor_6c07b07c062484ab, []int{120}
}
func (m *PersistentVolumeClaimSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3356,7 +3440,7 @@ var xxx_messageInfo_PersistentVolumeClaimSpec proto.InternalMessageInfo
func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} }
func (*PersistentVolumeClaimStatus) ProtoMessage() {}
func (*PersistentVolumeClaimStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{118}
+ return fileDescriptor_6c07b07c062484ab, []int{121}
}
func (m *PersistentVolumeClaimStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3384,7 +3468,7 @@ var xxx_messageInfo_PersistentVolumeClaimStatus proto.InternalMessageInfo
func (m *PersistentVolumeClaimTemplate) Reset() { *m = PersistentVolumeClaimTemplate{} }
func (*PersistentVolumeClaimTemplate) ProtoMessage() {}
func (*PersistentVolumeClaimTemplate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{119}
+ return fileDescriptor_6c07b07c062484ab, []int{122}
}
func (m *PersistentVolumeClaimTemplate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3412,7 +3496,7 @@ var xxx_messageInfo_PersistentVolumeClaimTemplate proto.InternalMessageInfo
func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} }
func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {}
func (*PersistentVolumeClaimVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{120}
+ return fileDescriptor_6c07b07c062484ab, []int{123}
}
func (m *PersistentVolumeClaimVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3440,7 +3524,7 @@ var xxx_messageInfo_PersistentVolumeClaimVolumeSource proto.InternalMessageInfo
func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} }
func (*PersistentVolumeList) ProtoMessage() {}
func (*PersistentVolumeList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{121}
+ return fileDescriptor_6c07b07c062484ab, []int{124}
}
func (m *PersistentVolumeList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3468,7 +3552,7 @@ var xxx_messageInfo_PersistentVolumeList proto.InternalMessageInfo
func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} }
func (*PersistentVolumeSource) ProtoMessage() {}
func (*PersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{122}
+ return fileDescriptor_6c07b07c062484ab, []int{125}
}
func (m *PersistentVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3496,7 +3580,7 @@ var xxx_messageInfo_PersistentVolumeSource proto.InternalMessageInfo
func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} }
func (*PersistentVolumeSpec) ProtoMessage() {}
func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{123}
+ return fileDescriptor_6c07b07c062484ab, []int{126}
}
func (m *PersistentVolumeSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3524,7 +3608,7 @@ var xxx_messageInfo_PersistentVolumeSpec proto.InternalMessageInfo
func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} }
func (*PersistentVolumeStatus) ProtoMessage() {}
func (*PersistentVolumeStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{124}
+ return fileDescriptor_6c07b07c062484ab, []int{127}
}
func (m *PersistentVolumeStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3552,7 +3636,7 @@ var xxx_messageInfo_PersistentVolumeStatus proto.InternalMessageInfo
func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} }
func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {}
func (*PhotonPersistentDiskVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{125}
+ return fileDescriptor_6c07b07c062484ab, []int{128}
}
func (m *PhotonPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3580,7 +3664,7 @@ var xxx_messageInfo_PhotonPersistentDiskVolumeSource proto.InternalMessageInfo
func (m *Pod) Reset() { *m = Pod{} }
func (*Pod) ProtoMessage() {}
func (*Pod) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{126}
+ return fileDescriptor_6c07b07c062484ab, []int{129}
}
func (m *Pod) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3608,7 +3692,7 @@ var xxx_messageInfo_Pod proto.InternalMessageInfo
func (m *PodAffinity) Reset() { *m = PodAffinity{} }
func (*PodAffinity) ProtoMessage() {}
func (*PodAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{127}
+ return fileDescriptor_6c07b07c062484ab, []int{130}
}
func (m *PodAffinity) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3636,7 +3720,7 @@ var xxx_messageInfo_PodAffinity proto.InternalMessageInfo
func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} }
func (*PodAffinityTerm) ProtoMessage() {}
func (*PodAffinityTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{128}
+ return fileDescriptor_6c07b07c062484ab, []int{131}
}
func (m *PodAffinityTerm) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3664,7 +3748,7 @@ var xxx_messageInfo_PodAffinityTerm proto.InternalMessageInfo
func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} }
func (*PodAntiAffinity) ProtoMessage() {}
func (*PodAntiAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{129}
+ return fileDescriptor_6c07b07c062484ab, []int{132}
}
func (m *PodAntiAffinity) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3692,7 +3776,7 @@ var xxx_messageInfo_PodAntiAffinity proto.InternalMessageInfo
func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} }
func (*PodAttachOptions) ProtoMessage() {}
func (*PodAttachOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{130}
+ return fileDescriptor_6c07b07c062484ab, []int{133}
}
func (m *PodAttachOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3720,7 +3804,7 @@ var xxx_messageInfo_PodAttachOptions proto.InternalMessageInfo
func (m *PodCondition) Reset() { *m = PodCondition{} }
func (*PodCondition) ProtoMessage() {}
func (*PodCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{131}
+ return fileDescriptor_6c07b07c062484ab, []int{134}
}
func (m *PodCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3748,7 +3832,7 @@ var xxx_messageInfo_PodCondition proto.InternalMessageInfo
func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} }
func (*PodDNSConfig) ProtoMessage() {}
func (*PodDNSConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{132}
+ return fileDescriptor_6c07b07c062484ab, []int{135}
}
func (m *PodDNSConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3776,7 +3860,7 @@ var xxx_messageInfo_PodDNSConfig proto.InternalMessageInfo
func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} }
func (*PodDNSConfigOption) ProtoMessage() {}
func (*PodDNSConfigOption) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{133}
+ return fileDescriptor_6c07b07c062484ab, []int{136}
}
func (m *PodDNSConfigOption) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3804,7 +3888,7 @@ var xxx_messageInfo_PodDNSConfigOption proto.InternalMessageInfo
func (m *PodExecOptions) Reset() { *m = PodExecOptions{} }
func (*PodExecOptions) ProtoMessage() {}
func (*PodExecOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{134}
+ return fileDescriptor_6c07b07c062484ab, []int{137}
}
func (m *PodExecOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3832,7 +3916,7 @@ var xxx_messageInfo_PodExecOptions proto.InternalMessageInfo
func (m *PodIP) Reset() { *m = PodIP{} }
func (*PodIP) ProtoMessage() {}
func (*PodIP) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{135}
+ return fileDescriptor_6c07b07c062484ab, []int{138}
}
func (m *PodIP) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3860,7 +3944,7 @@ var xxx_messageInfo_PodIP proto.InternalMessageInfo
func (m *PodList) Reset() { *m = PodList{} }
func (*PodList) ProtoMessage() {}
func (*PodList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{136}
+ return fileDescriptor_6c07b07c062484ab, []int{139}
}
func (m *PodList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3888,7 +3972,7 @@ var xxx_messageInfo_PodList proto.InternalMessageInfo
func (m *PodLogOptions) Reset() { *m = PodLogOptions{} }
func (*PodLogOptions) ProtoMessage() {}
func (*PodLogOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{137}
+ return fileDescriptor_6c07b07c062484ab, []int{140}
}
func (m *PodLogOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3916,7 +4000,7 @@ var xxx_messageInfo_PodLogOptions proto.InternalMessageInfo
func (m *PodOS) Reset() { *m = PodOS{} }
func (*PodOS) ProtoMessage() {}
func (*PodOS) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{138}
+ return fileDescriptor_6c07b07c062484ab, []int{141}
}
func (m *PodOS) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3944,7 +4028,7 @@ var xxx_messageInfo_PodOS proto.InternalMessageInfo
func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} }
func (*PodPortForwardOptions) ProtoMessage() {}
func (*PodPortForwardOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{139}
+ return fileDescriptor_6c07b07c062484ab, []int{142}
}
func (m *PodPortForwardOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -3972,7 +4056,7 @@ var xxx_messageInfo_PodPortForwardOptions proto.InternalMessageInfo
func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} }
func (*PodProxyOptions) ProtoMessage() {}
func (*PodProxyOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{140}
+ return fileDescriptor_6c07b07c062484ab, []int{143}
}
func (m *PodProxyOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4000,7 +4084,7 @@ var xxx_messageInfo_PodProxyOptions proto.InternalMessageInfo
func (m *PodReadinessGate) Reset() { *m = PodReadinessGate{} }
func (*PodReadinessGate) ProtoMessage() {}
func (*PodReadinessGate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{141}
+ return fileDescriptor_6c07b07c062484ab, []int{144}
}
func (m *PodReadinessGate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4028,7 +4112,7 @@ var xxx_messageInfo_PodReadinessGate proto.InternalMessageInfo
func (m *PodResourceClaim) Reset() { *m = PodResourceClaim{} }
func (*PodResourceClaim) ProtoMessage() {}
func (*PodResourceClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{142}
+ return fileDescriptor_6c07b07c062484ab, []int{145}
}
func (m *PodResourceClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4056,7 +4140,7 @@ var xxx_messageInfo_PodResourceClaim proto.InternalMessageInfo
func (m *PodResourceClaimStatus) Reset() { *m = PodResourceClaimStatus{} }
func (*PodResourceClaimStatus) ProtoMessage() {}
func (*PodResourceClaimStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{143}
+ return fileDescriptor_6c07b07c062484ab, []int{146}
}
func (m *PodResourceClaimStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4084,7 +4168,7 @@ var xxx_messageInfo_PodResourceClaimStatus proto.InternalMessageInfo
func (m *PodSchedulingGate) Reset() { *m = PodSchedulingGate{} }
func (*PodSchedulingGate) ProtoMessage() {}
func (*PodSchedulingGate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{144}
+ return fileDescriptor_6c07b07c062484ab, []int{147}
}
func (m *PodSchedulingGate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4112,7 +4196,7 @@ var xxx_messageInfo_PodSchedulingGate proto.InternalMessageInfo
func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} }
func (*PodSecurityContext) ProtoMessage() {}
func (*PodSecurityContext) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{145}
+ return fileDescriptor_6c07b07c062484ab, []int{148}
}
func (m *PodSecurityContext) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4140,7 +4224,7 @@ var xxx_messageInfo_PodSecurityContext proto.InternalMessageInfo
func (m *PodSignature) Reset() { *m = PodSignature{} }
func (*PodSignature) ProtoMessage() {}
func (*PodSignature) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{146}
+ return fileDescriptor_6c07b07c062484ab, []int{149}
}
func (m *PodSignature) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4168,7 +4252,7 @@ var xxx_messageInfo_PodSignature proto.InternalMessageInfo
func (m *PodSpec) Reset() { *m = PodSpec{} }
func (*PodSpec) ProtoMessage() {}
func (*PodSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{147}
+ return fileDescriptor_6c07b07c062484ab, []int{150}
}
func (m *PodSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4196,7 +4280,7 @@ var xxx_messageInfo_PodSpec proto.InternalMessageInfo
func (m *PodStatus) Reset() { *m = PodStatus{} }
func (*PodStatus) ProtoMessage() {}
func (*PodStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{148}
+ return fileDescriptor_6c07b07c062484ab, []int{151}
}
func (m *PodStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4224,7 +4308,7 @@ var xxx_messageInfo_PodStatus proto.InternalMessageInfo
func (m *PodStatusResult) Reset() { *m = PodStatusResult{} }
func (*PodStatusResult) ProtoMessage() {}
func (*PodStatusResult) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{149}
+ return fileDescriptor_6c07b07c062484ab, []int{152}
}
func (m *PodStatusResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4252,7 +4336,7 @@ var xxx_messageInfo_PodStatusResult proto.InternalMessageInfo
func (m *PodTemplate) Reset() { *m = PodTemplate{} }
func (*PodTemplate) ProtoMessage() {}
func (*PodTemplate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{150}
+ return fileDescriptor_6c07b07c062484ab, []int{153}
}
func (m *PodTemplate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4280,7 +4364,7 @@ var xxx_messageInfo_PodTemplate proto.InternalMessageInfo
func (m *PodTemplateList) Reset() { *m = PodTemplateList{} }
func (*PodTemplateList) ProtoMessage() {}
func (*PodTemplateList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{151}
+ return fileDescriptor_6c07b07c062484ab, []int{154}
}
func (m *PodTemplateList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4308,7 +4392,7 @@ var xxx_messageInfo_PodTemplateList proto.InternalMessageInfo
func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} }
func (*PodTemplateSpec) ProtoMessage() {}
func (*PodTemplateSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{152}
+ return fileDescriptor_6c07b07c062484ab, []int{155}
}
func (m *PodTemplateSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4336,7 +4420,7 @@ var xxx_messageInfo_PodTemplateSpec proto.InternalMessageInfo
func (m *PortStatus) Reset() { *m = PortStatus{} }
func (*PortStatus) ProtoMessage() {}
func (*PortStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{153}
+ return fileDescriptor_6c07b07c062484ab, []int{156}
}
func (m *PortStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4364,7 +4448,7 @@ var xxx_messageInfo_PortStatus proto.InternalMessageInfo
func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} }
func (*PortworxVolumeSource) ProtoMessage() {}
func (*PortworxVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{154}
+ return fileDescriptor_6c07b07c062484ab, []int{157}
}
func (m *PortworxVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4392,7 +4476,7 @@ var xxx_messageInfo_PortworxVolumeSource proto.InternalMessageInfo
func (m *Preconditions) Reset() { *m = Preconditions{} }
func (*Preconditions) ProtoMessage() {}
func (*Preconditions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{155}
+ return fileDescriptor_6c07b07c062484ab, []int{158}
}
func (m *Preconditions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4420,7 +4504,7 @@ var xxx_messageInfo_Preconditions proto.InternalMessageInfo
func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} }
func (*PreferAvoidPodsEntry) ProtoMessage() {}
func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{156}
+ return fileDescriptor_6c07b07c062484ab, []int{159}
}
func (m *PreferAvoidPodsEntry) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4448,7 +4532,7 @@ var xxx_messageInfo_PreferAvoidPodsEntry proto.InternalMessageInfo
func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} }
func (*PreferredSchedulingTerm) ProtoMessage() {}
func (*PreferredSchedulingTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{157}
+ return fileDescriptor_6c07b07c062484ab, []int{160}
}
func (m *PreferredSchedulingTerm) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4476,7 +4560,7 @@ var xxx_messageInfo_PreferredSchedulingTerm proto.InternalMessageInfo
func (m *Probe) Reset() { *m = Probe{} }
func (*Probe) ProtoMessage() {}
func (*Probe) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{158}
+ return fileDescriptor_6c07b07c062484ab, []int{161}
}
func (m *Probe) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4504,7 +4588,7 @@ var xxx_messageInfo_Probe proto.InternalMessageInfo
func (m *ProbeHandler) Reset() { *m = ProbeHandler{} }
func (*ProbeHandler) ProtoMessage() {}
func (*ProbeHandler) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{159}
+ return fileDescriptor_6c07b07c062484ab, []int{162}
}
func (m *ProbeHandler) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4532,7 +4616,7 @@ var xxx_messageInfo_ProbeHandler proto.InternalMessageInfo
func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} }
func (*ProjectedVolumeSource) ProtoMessage() {}
func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{160}
+ return fileDescriptor_6c07b07c062484ab, []int{163}
}
func (m *ProjectedVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4560,7 +4644,7 @@ var xxx_messageInfo_ProjectedVolumeSource proto.InternalMessageInfo
func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} }
func (*QuobyteVolumeSource) ProtoMessage() {}
func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{161}
+ return fileDescriptor_6c07b07c062484ab, []int{164}
}
func (m *QuobyteVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4588,7 +4672,7 @@ var xxx_messageInfo_QuobyteVolumeSource proto.InternalMessageInfo
func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} }
func (*RBDPersistentVolumeSource) ProtoMessage() {}
func (*RBDPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{162}
+ return fileDescriptor_6c07b07c062484ab, []int{165}
}
func (m *RBDPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4616,7 +4700,7 @@ var xxx_messageInfo_RBDPersistentVolumeSource proto.InternalMessageInfo
func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} }
func (*RBDVolumeSource) ProtoMessage() {}
func (*RBDVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{163}
+ return fileDescriptor_6c07b07c062484ab, []int{166}
}
func (m *RBDVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4644,7 +4728,7 @@ var xxx_messageInfo_RBDVolumeSource proto.InternalMessageInfo
func (m *RangeAllocation) Reset() { *m = RangeAllocation{} }
func (*RangeAllocation) ProtoMessage() {}
func (*RangeAllocation) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{164}
+ return fileDescriptor_6c07b07c062484ab, []int{167}
}
func (m *RangeAllocation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4672,7 +4756,7 @@ var xxx_messageInfo_RangeAllocation proto.InternalMessageInfo
func (m *ReplicationController) Reset() { *m = ReplicationController{} }
func (*ReplicationController) ProtoMessage() {}
func (*ReplicationController) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{165}
+ return fileDescriptor_6c07b07c062484ab, []int{168}
}
func (m *ReplicationController) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4700,7 +4784,7 @@ var xxx_messageInfo_ReplicationController proto.InternalMessageInfo
func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} }
func (*ReplicationControllerCondition) ProtoMessage() {}
func (*ReplicationControllerCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{166}
+ return fileDescriptor_6c07b07c062484ab, []int{169}
}
func (m *ReplicationControllerCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4728,7 +4812,7 @@ var xxx_messageInfo_ReplicationControllerCondition proto.InternalMessageInfo
func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} }
func (*ReplicationControllerList) ProtoMessage() {}
func (*ReplicationControllerList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{167}
+ return fileDescriptor_6c07b07c062484ab, []int{170}
}
func (m *ReplicationControllerList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4756,7 +4840,7 @@ var xxx_messageInfo_ReplicationControllerList proto.InternalMessageInfo
func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} }
func (*ReplicationControllerSpec) ProtoMessage() {}
func (*ReplicationControllerSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{168}
+ return fileDescriptor_6c07b07c062484ab, []int{171}
}
func (m *ReplicationControllerSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4784,7 +4868,7 @@ var xxx_messageInfo_ReplicationControllerSpec proto.InternalMessageInfo
func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} }
func (*ReplicationControllerStatus) ProtoMessage() {}
func (*ReplicationControllerStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{169}
+ return fileDescriptor_6c07b07c062484ab, []int{172}
}
func (m *ReplicationControllerStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4812,7 +4896,7 @@ var xxx_messageInfo_ReplicationControllerStatus proto.InternalMessageInfo
func (m *ResourceClaim) Reset() { *m = ResourceClaim{} }
func (*ResourceClaim) ProtoMessage() {}
func (*ResourceClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{170}
+ return fileDescriptor_6c07b07c062484ab, []int{173}
}
func (m *ResourceClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4840,7 +4924,7 @@ var xxx_messageInfo_ResourceClaim proto.InternalMessageInfo
func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} }
func (*ResourceFieldSelector) ProtoMessage() {}
func (*ResourceFieldSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{171}
+ return fileDescriptor_6c07b07c062484ab, []int{174}
}
func (m *ResourceFieldSelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4865,10 +4949,38 @@ func (m *ResourceFieldSelector) XXX_DiscardUnknown() {
var xxx_messageInfo_ResourceFieldSelector proto.InternalMessageInfo
+func (m *ResourceHealth) Reset() { *m = ResourceHealth{} }
+func (*ResourceHealth) ProtoMessage() {}
+func (*ResourceHealth) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6c07b07c062484ab, []int{175}
+}
+func (m *ResourceHealth) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ResourceHealth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ResourceHealth) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ResourceHealth.Merge(m, src)
+}
+func (m *ResourceHealth) XXX_Size() int {
+ return m.Size()
+}
+func (m *ResourceHealth) XXX_DiscardUnknown() {
+ xxx_messageInfo_ResourceHealth.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ResourceHealth proto.InternalMessageInfo
+
func (m *ResourceQuota) Reset() { *m = ResourceQuota{} }
func (*ResourceQuota) ProtoMessage() {}
func (*ResourceQuota) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{172}
+ return fileDescriptor_6c07b07c062484ab, []int{176}
}
func (m *ResourceQuota) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4896,7 +5008,7 @@ var xxx_messageInfo_ResourceQuota proto.InternalMessageInfo
func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} }
func (*ResourceQuotaList) ProtoMessage() {}
func (*ResourceQuotaList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{173}
+ return fileDescriptor_6c07b07c062484ab, []int{177}
}
func (m *ResourceQuotaList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4924,7 +5036,7 @@ var xxx_messageInfo_ResourceQuotaList proto.InternalMessageInfo
func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} }
func (*ResourceQuotaSpec) ProtoMessage() {}
func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{174}
+ return fileDescriptor_6c07b07c062484ab, []int{178}
}
func (m *ResourceQuotaSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4952,7 +5064,7 @@ var xxx_messageInfo_ResourceQuotaSpec proto.InternalMessageInfo
func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} }
func (*ResourceQuotaStatus) ProtoMessage() {}
func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{175}
+ return fileDescriptor_6c07b07c062484ab, []int{179}
}
func (m *ResourceQuotaStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -4980,7 +5092,7 @@ var xxx_messageInfo_ResourceQuotaStatus proto.InternalMessageInfo
func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} }
func (*ResourceRequirements) ProtoMessage() {}
func (*ResourceRequirements) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{176}
+ return fileDescriptor_6c07b07c062484ab, []int{180}
}
func (m *ResourceRequirements) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5005,10 +5117,38 @@ func (m *ResourceRequirements) XXX_DiscardUnknown() {
var xxx_messageInfo_ResourceRequirements proto.InternalMessageInfo
+func (m *ResourceStatus) Reset() { *m = ResourceStatus{} }
+func (*ResourceStatus) ProtoMessage() {}
+func (*ResourceStatus) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6c07b07c062484ab, []int{181}
+}
+func (m *ResourceStatus) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ResourceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ResourceStatus) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ResourceStatus.Merge(m, src)
+}
+func (m *ResourceStatus) XXX_Size() int {
+ return m.Size()
+}
+func (m *ResourceStatus) XXX_DiscardUnknown() {
+ xxx_messageInfo_ResourceStatus.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ResourceStatus proto.InternalMessageInfo
+
func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} }
func (*SELinuxOptions) ProtoMessage() {}
func (*SELinuxOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{177}
+ return fileDescriptor_6c07b07c062484ab, []int{182}
}
func (m *SELinuxOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5036,7 +5176,7 @@ var xxx_messageInfo_SELinuxOptions proto.InternalMessageInfo
func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} }
func (*ScaleIOPersistentVolumeSource) ProtoMessage() {}
func (*ScaleIOPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{178}
+ return fileDescriptor_6c07b07c062484ab, []int{183}
}
func (m *ScaleIOPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5064,7 +5204,7 @@ var xxx_messageInfo_ScaleIOPersistentVolumeSource proto.InternalMessageInfo
func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} }
func (*ScaleIOVolumeSource) ProtoMessage() {}
func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{179}
+ return fileDescriptor_6c07b07c062484ab, []int{184}
}
func (m *ScaleIOVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5092,7 +5232,7 @@ var xxx_messageInfo_ScaleIOVolumeSource proto.InternalMessageInfo
func (m *ScopeSelector) Reset() { *m = ScopeSelector{} }
func (*ScopeSelector) ProtoMessage() {}
func (*ScopeSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{180}
+ return fileDescriptor_6c07b07c062484ab, []int{185}
}
func (m *ScopeSelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5120,7 +5260,7 @@ var xxx_messageInfo_ScopeSelector proto.InternalMessageInfo
func (m *ScopedResourceSelectorRequirement) Reset() { *m = ScopedResourceSelectorRequirement{} }
func (*ScopedResourceSelectorRequirement) ProtoMessage() {}
func (*ScopedResourceSelectorRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{181}
+ return fileDescriptor_6c07b07c062484ab, []int{186}
}
func (m *ScopedResourceSelectorRequirement) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5148,7 +5288,7 @@ var xxx_messageInfo_ScopedResourceSelectorRequirement proto.InternalMessageInfo
func (m *SeccompProfile) Reset() { *m = SeccompProfile{} }
func (*SeccompProfile) ProtoMessage() {}
func (*SeccompProfile) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{182}
+ return fileDescriptor_6c07b07c062484ab, []int{187}
}
func (m *SeccompProfile) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5176,7 +5316,7 @@ var xxx_messageInfo_SeccompProfile proto.InternalMessageInfo
func (m *Secret) Reset() { *m = Secret{} }
func (*Secret) ProtoMessage() {}
func (*Secret) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{183}
+ return fileDescriptor_6c07b07c062484ab, []int{188}
}
func (m *Secret) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5204,7 +5344,7 @@ var xxx_messageInfo_Secret proto.InternalMessageInfo
func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} }
func (*SecretEnvSource) ProtoMessage() {}
func (*SecretEnvSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{184}
+ return fileDescriptor_6c07b07c062484ab, []int{189}
}
func (m *SecretEnvSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5232,7 +5372,7 @@ var xxx_messageInfo_SecretEnvSource proto.InternalMessageInfo
func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} }
func (*SecretKeySelector) ProtoMessage() {}
func (*SecretKeySelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{185}
+ return fileDescriptor_6c07b07c062484ab, []int{190}
}
func (m *SecretKeySelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5260,7 +5400,7 @@ var xxx_messageInfo_SecretKeySelector proto.InternalMessageInfo
func (m *SecretList) Reset() { *m = SecretList{} }
func (*SecretList) ProtoMessage() {}
func (*SecretList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{186}
+ return fileDescriptor_6c07b07c062484ab, []int{191}
}
func (m *SecretList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5288,7 +5428,7 @@ var xxx_messageInfo_SecretList proto.InternalMessageInfo
func (m *SecretProjection) Reset() { *m = SecretProjection{} }
func (*SecretProjection) ProtoMessage() {}
func (*SecretProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{187}
+ return fileDescriptor_6c07b07c062484ab, []int{192}
}
func (m *SecretProjection) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5316,7 +5456,7 @@ var xxx_messageInfo_SecretProjection proto.InternalMessageInfo
func (m *SecretReference) Reset() { *m = SecretReference{} }
func (*SecretReference) ProtoMessage() {}
func (*SecretReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{188}
+ return fileDescriptor_6c07b07c062484ab, []int{193}
}
func (m *SecretReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5344,7 +5484,7 @@ var xxx_messageInfo_SecretReference proto.InternalMessageInfo
func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} }
func (*SecretVolumeSource) ProtoMessage() {}
func (*SecretVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{189}
+ return fileDescriptor_6c07b07c062484ab, []int{194}
}
func (m *SecretVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5372,7 +5512,7 @@ var xxx_messageInfo_SecretVolumeSource proto.InternalMessageInfo
func (m *SecurityContext) Reset() { *m = SecurityContext{} }
func (*SecurityContext) ProtoMessage() {}
func (*SecurityContext) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{190}
+ return fileDescriptor_6c07b07c062484ab, []int{195}
}
func (m *SecurityContext) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5400,7 +5540,7 @@ var xxx_messageInfo_SecurityContext proto.InternalMessageInfo
func (m *SerializedReference) Reset() { *m = SerializedReference{} }
func (*SerializedReference) ProtoMessage() {}
func (*SerializedReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{191}
+ return fileDescriptor_6c07b07c062484ab, []int{196}
}
func (m *SerializedReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5428,7 +5568,7 @@ var xxx_messageInfo_SerializedReference proto.InternalMessageInfo
func (m *Service) Reset() { *m = Service{} }
func (*Service) ProtoMessage() {}
func (*Service) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{192}
+ return fileDescriptor_6c07b07c062484ab, []int{197}
}
func (m *Service) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5456,7 +5596,7 @@ var xxx_messageInfo_Service proto.InternalMessageInfo
func (m *ServiceAccount) Reset() { *m = ServiceAccount{} }
func (*ServiceAccount) ProtoMessage() {}
func (*ServiceAccount) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{193}
+ return fileDescriptor_6c07b07c062484ab, []int{198}
}
func (m *ServiceAccount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5484,7 +5624,7 @@ var xxx_messageInfo_ServiceAccount proto.InternalMessageInfo
func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} }
func (*ServiceAccountList) ProtoMessage() {}
func (*ServiceAccountList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{194}
+ return fileDescriptor_6c07b07c062484ab, []int{199}
}
func (m *ServiceAccountList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5512,7 +5652,7 @@ var xxx_messageInfo_ServiceAccountList proto.InternalMessageInfo
func (m *ServiceAccountTokenProjection) Reset() { *m = ServiceAccountTokenProjection{} }
func (*ServiceAccountTokenProjection) ProtoMessage() {}
func (*ServiceAccountTokenProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{195}
+ return fileDescriptor_6c07b07c062484ab, []int{200}
}
func (m *ServiceAccountTokenProjection) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5540,7 +5680,7 @@ var xxx_messageInfo_ServiceAccountTokenProjection proto.InternalMessageInfo
func (m *ServiceList) Reset() { *m = ServiceList{} }
func (*ServiceList) ProtoMessage() {}
func (*ServiceList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{196}
+ return fileDescriptor_6c07b07c062484ab, []int{201}
}
func (m *ServiceList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5568,7 +5708,7 @@ var xxx_messageInfo_ServiceList proto.InternalMessageInfo
func (m *ServicePort) Reset() { *m = ServicePort{} }
func (*ServicePort) ProtoMessage() {}
func (*ServicePort) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{197}
+ return fileDescriptor_6c07b07c062484ab, []int{202}
}
func (m *ServicePort) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5596,7 +5736,7 @@ var xxx_messageInfo_ServicePort proto.InternalMessageInfo
func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} }
func (*ServiceProxyOptions) ProtoMessage() {}
func (*ServiceProxyOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{198}
+ return fileDescriptor_6c07b07c062484ab, []int{203}
}
func (m *ServiceProxyOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5624,7 +5764,7 @@ var xxx_messageInfo_ServiceProxyOptions proto.InternalMessageInfo
func (m *ServiceSpec) Reset() { *m = ServiceSpec{} }
func (*ServiceSpec) ProtoMessage() {}
func (*ServiceSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{199}
+ return fileDescriptor_6c07b07c062484ab, []int{204}
}
func (m *ServiceSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5652,7 +5792,7 @@ var xxx_messageInfo_ServiceSpec proto.InternalMessageInfo
func (m *ServiceStatus) Reset() { *m = ServiceStatus{} }
func (*ServiceStatus) ProtoMessage() {}
func (*ServiceStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{200}
+ return fileDescriptor_6c07b07c062484ab, []int{205}
}
func (m *ServiceStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5680,7 +5820,7 @@ var xxx_messageInfo_ServiceStatus proto.InternalMessageInfo
func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} }
func (*SessionAffinityConfig) ProtoMessage() {}
func (*SessionAffinityConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{201}
+ return fileDescriptor_6c07b07c062484ab, []int{206}
}
func (m *SessionAffinityConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5708,7 +5848,7 @@ var xxx_messageInfo_SessionAffinityConfig proto.InternalMessageInfo
func (m *SleepAction) Reset() { *m = SleepAction{} }
func (*SleepAction) ProtoMessage() {}
func (*SleepAction) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{202}
+ return fileDescriptor_6c07b07c062484ab, []int{207}
}
func (m *SleepAction) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5736,7 +5876,7 @@ var xxx_messageInfo_SleepAction proto.InternalMessageInfo
func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} }
func (*StorageOSPersistentVolumeSource) ProtoMessage() {}
func (*StorageOSPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{203}
+ return fileDescriptor_6c07b07c062484ab, []int{208}
}
func (m *StorageOSPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5764,7 +5904,7 @@ var xxx_messageInfo_StorageOSPersistentVolumeSource proto.InternalMessageInfo
func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} }
func (*StorageOSVolumeSource) ProtoMessage() {}
func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{204}
+ return fileDescriptor_6c07b07c062484ab, []int{209}
}
func (m *StorageOSVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5792,7 +5932,7 @@ var xxx_messageInfo_StorageOSVolumeSource proto.InternalMessageInfo
func (m *Sysctl) Reset() { *m = Sysctl{} }
func (*Sysctl) ProtoMessage() {}
func (*Sysctl) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{205}
+ return fileDescriptor_6c07b07c062484ab, []int{210}
}
func (m *Sysctl) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5820,7 +5960,7 @@ var xxx_messageInfo_Sysctl proto.InternalMessageInfo
func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} }
func (*TCPSocketAction) ProtoMessage() {}
func (*TCPSocketAction) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{206}
+ return fileDescriptor_6c07b07c062484ab, []int{211}
}
func (m *TCPSocketAction) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5848,7 +5988,7 @@ var xxx_messageInfo_TCPSocketAction proto.InternalMessageInfo
func (m *Taint) Reset() { *m = Taint{} }
func (*Taint) ProtoMessage() {}
func (*Taint) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{207}
+ return fileDescriptor_6c07b07c062484ab, []int{212}
}
func (m *Taint) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5876,7 +6016,7 @@ var xxx_messageInfo_Taint proto.InternalMessageInfo
func (m *Toleration) Reset() { *m = Toleration{} }
func (*Toleration) ProtoMessage() {}
func (*Toleration) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{208}
+ return fileDescriptor_6c07b07c062484ab, []int{213}
}
func (m *Toleration) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5904,7 +6044,7 @@ var xxx_messageInfo_Toleration proto.InternalMessageInfo
func (m *TopologySelectorLabelRequirement) Reset() { *m = TopologySelectorLabelRequirement{} }
func (*TopologySelectorLabelRequirement) ProtoMessage() {}
func (*TopologySelectorLabelRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{209}
+ return fileDescriptor_6c07b07c062484ab, []int{214}
}
func (m *TopologySelectorLabelRequirement) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5932,7 +6072,7 @@ var xxx_messageInfo_TopologySelectorLabelRequirement proto.InternalMessageInfo
func (m *TopologySelectorTerm) Reset() { *m = TopologySelectorTerm{} }
func (*TopologySelectorTerm) ProtoMessage() {}
func (*TopologySelectorTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{210}
+ return fileDescriptor_6c07b07c062484ab, []int{215}
}
func (m *TopologySelectorTerm) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5960,7 +6100,7 @@ var xxx_messageInfo_TopologySelectorTerm proto.InternalMessageInfo
func (m *TopologySpreadConstraint) Reset() { *m = TopologySpreadConstraint{} }
func (*TopologySpreadConstraint) ProtoMessage() {}
func (*TopologySpreadConstraint) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{211}
+ return fileDescriptor_6c07b07c062484ab, []int{216}
}
func (m *TopologySpreadConstraint) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -5988,7 +6128,7 @@ var xxx_messageInfo_TopologySpreadConstraint proto.InternalMessageInfo
func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} }
func (*TypedLocalObjectReference) ProtoMessage() {}
func (*TypedLocalObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{212}
+ return fileDescriptor_6c07b07c062484ab, []int{217}
}
func (m *TypedLocalObjectReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6016,7 +6156,7 @@ var xxx_messageInfo_TypedLocalObjectReference proto.InternalMessageInfo
func (m *TypedObjectReference) Reset() { *m = TypedObjectReference{} }
func (*TypedObjectReference) ProtoMessage() {}
func (*TypedObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{213}
+ return fileDescriptor_6c07b07c062484ab, []int{218}
}
func (m *TypedObjectReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6044,7 +6184,7 @@ var xxx_messageInfo_TypedObjectReference proto.InternalMessageInfo
func (m *Volume) Reset() { *m = Volume{} }
func (*Volume) ProtoMessage() {}
func (*Volume) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{214}
+ return fileDescriptor_6c07b07c062484ab, []int{219}
}
func (m *Volume) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6072,7 +6212,7 @@ var xxx_messageInfo_Volume proto.InternalMessageInfo
func (m *VolumeDevice) Reset() { *m = VolumeDevice{} }
func (*VolumeDevice) ProtoMessage() {}
func (*VolumeDevice) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{215}
+ return fileDescriptor_6c07b07c062484ab, []int{220}
}
func (m *VolumeDevice) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6100,7 +6240,7 @@ var xxx_messageInfo_VolumeDevice proto.InternalMessageInfo
func (m *VolumeMount) Reset() { *m = VolumeMount{} }
func (*VolumeMount) ProtoMessage() {}
func (*VolumeMount) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{216}
+ return fileDescriptor_6c07b07c062484ab, []int{221}
}
func (m *VolumeMount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6128,7 +6268,7 @@ var xxx_messageInfo_VolumeMount proto.InternalMessageInfo
func (m *VolumeMountStatus) Reset() { *m = VolumeMountStatus{} }
func (*VolumeMountStatus) ProtoMessage() {}
func (*VolumeMountStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{217}
+ return fileDescriptor_6c07b07c062484ab, []int{222}
}
func (m *VolumeMountStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6156,7 +6296,7 @@ var xxx_messageInfo_VolumeMountStatus proto.InternalMessageInfo
func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} }
func (*VolumeNodeAffinity) ProtoMessage() {}
func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{218}
+ return fileDescriptor_6c07b07c062484ab, []int{223}
}
func (m *VolumeNodeAffinity) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6184,7 +6324,7 @@ var xxx_messageInfo_VolumeNodeAffinity proto.InternalMessageInfo
func (m *VolumeProjection) Reset() { *m = VolumeProjection{} }
func (*VolumeProjection) ProtoMessage() {}
func (*VolumeProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{219}
+ return fileDescriptor_6c07b07c062484ab, []int{224}
}
func (m *VolumeProjection) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6212,7 +6352,7 @@ var xxx_messageInfo_VolumeProjection proto.InternalMessageInfo
func (m *VolumeResourceRequirements) Reset() { *m = VolumeResourceRequirements{} }
func (*VolumeResourceRequirements) ProtoMessage() {}
func (*VolumeResourceRequirements) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{220}
+ return fileDescriptor_6c07b07c062484ab, []int{225}
}
func (m *VolumeResourceRequirements) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6240,7 +6380,7 @@ var xxx_messageInfo_VolumeResourceRequirements proto.InternalMessageInfo
func (m *VolumeSource) Reset() { *m = VolumeSource{} }
func (*VolumeSource) ProtoMessage() {}
func (*VolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{221}
+ return fileDescriptor_6c07b07c062484ab, []int{226}
}
func (m *VolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6268,7 +6408,7 @@ var xxx_messageInfo_VolumeSource proto.InternalMessageInfo
func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} }
func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {}
func (*VsphereVirtualDiskVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{222}
+ return fileDescriptor_6c07b07c062484ab, []int{227}
}
func (m *VsphereVirtualDiskVolumeSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6296,7 +6436,7 @@ var xxx_messageInfo_VsphereVirtualDiskVolumeSource proto.InternalMessageInfo
func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} }
func (*WeightedPodAffinityTerm) ProtoMessage() {}
func (*WeightedPodAffinityTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{223}
+ return fileDescriptor_6c07b07c062484ab, []int{228}
}
func (m *WeightedPodAffinityTerm) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6324,7 +6464,7 @@ var xxx_messageInfo_WeightedPodAffinityTerm proto.InternalMessageInfo
func (m *WindowsSecurityContextOptions) Reset() { *m = WindowsSecurityContextOptions{} }
func (*WindowsSecurityContextOptions) ProtoMessage() {}
func (*WindowsSecurityContextOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{224}
+ return fileDescriptor_6c07b07c062484ab, []int{229}
}
func (m *WindowsSecurityContextOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -6368,7 +6508,6 @@ func init() {
proto.RegisterType((*CephFSVolumeSource)(nil), "k8s.io.api.core.v1.CephFSVolumeSource")
proto.RegisterType((*CinderPersistentVolumeSource)(nil), "k8s.io.api.core.v1.CinderPersistentVolumeSource")
proto.RegisterType((*CinderVolumeSource)(nil), "k8s.io.api.core.v1.CinderVolumeSource")
- proto.RegisterType((*ClaimSource)(nil), "k8s.io.api.core.v1.ClaimSource")
proto.RegisterType((*ClientIPConfig)(nil), "k8s.io.api.core.v1.ClientIPConfig")
proto.RegisterType((*ClusterTrustBundleProjection)(nil), "k8s.io.api.core.v1.ClusterTrustBundleProjection")
proto.RegisterType((*ComponentCondition)(nil), "k8s.io.api.core.v1.ComponentCondition")
@@ -6393,6 +6532,7 @@ func init() {
proto.RegisterType((*ContainerStateWaiting)(nil), "k8s.io.api.core.v1.ContainerStateWaiting")
proto.RegisterType((*ContainerStatus)(nil), "k8s.io.api.core.v1.ContainerStatus")
proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.ContainerStatus.AllocatedResourcesEntry")
+ proto.RegisterType((*ContainerUser)(nil), "k8s.io.api.core.v1.ContainerUser")
proto.RegisterType((*DaemonEndpoint)(nil), "k8s.io.api.core.v1.DaemonEndpoint")
proto.RegisterType((*DownwardAPIProjection)(nil), "k8s.io.api.core.v1.DownwardAPIProjection")
proto.RegisterType((*DownwardAPIVolumeFile)(nil), "k8s.io.api.core.v1.DownwardAPIVolumeFile")
@@ -6432,6 +6572,7 @@ func init() {
proto.RegisterType((*HostPathVolumeSource)(nil), "k8s.io.api.core.v1.HostPathVolumeSource")
proto.RegisterType((*ISCSIPersistentVolumeSource)(nil), "k8s.io.api.core.v1.ISCSIPersistentVolumeSource")
proto.RegisterType((*ISCSIVolumeSource)(nil), "k8s.io.api.core.v1.ISCSIVolumeSource")
+ proto.RegisterType((*ImageVolumeSource)(nil), "k8s.io.api.core.v1.ImageVolumeSource")
proto.RegisterType((*KeyToPath)(nil), "k8s.io.api.core.v1.KeyToPath")
proto.RegisterType((*Lifecycle)(nil), "k8s.io.api.core.v1.Lifecycle")
proto.RegisterType((*LifecycleHandler)(nil), "k8s.io.api.core.v1.LifecycleHandler")
@@ -6444,6 +6585,7 @@ func init() {
proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.LimitRangeItem.MinEntry")
proto.RegisterType((*LimitRangeList)(nil), "k8s.io.api.core.v1.LimitRangeList")
proto.RegisterType((*LimitRangeSpec)(nil), "k8s.io.api.core.v1.LimitRangeSpec")
+ proto.RegisterType((*LinuxContainerUser)(nil), "k8s.io.api.core.v1.LinuxContainerUser")
proto.RegisterType((*List)(nil), "k8s.io.api.core.v1.List")
proto.RegisterType((*LoadBalancerIngress)(nil), "k8s.io.api.core.v1.LoadBalancerIngress")
proto.RegisterType((*LoadBalancerStatus)(nil), "k8s.io.api.core.v1.LoadBalancerStatus")
@@ -6463,6 +6605,7 @@ func init() {
proto.RegisterType((*NodeConfigSource)(nil), "k8s.io.api.core.v1.NodeConfigSource")
proto.RegisterType((*NodeConfigStatus)(nil), "k8s.io.api.core.v1.NodeConfigStatus")
proto.RegisterType((*NodeDaemonEndpoints)(nil), "k8s.io.api.core.v1.NodeDaemonEndpoints")
+ proto.RegisterType((*NodeFeatures)(nil), "k8s.io.api.core.v1.NodeFeatures")
proto.RegisterType((*NodeList)(nil), "k8s.io.api.core.v1.NodeList")
proto.RegisterType((*NodeProxyOptions)(nil), "k8s.io.api.core.v1.NodeProxyOptions")
proto.RegisterType((*NodeRuntimeHandler)(nil), "k8s.io.api.core.v1.NodeRuntimeHandler")
@@ -6543,6 +6686,7 @@ func init() {
proto.RegisterType((*ReplicationControllerStatus)(nil), "k8s.io.api.core.v1.ReplicationControllerStatus")
proto.RegisterType((*ResourceClaim)(nil), "k8s.io.api.core.v1.ResourceClaim")
proto.RegisterType((*ResourceFieldSelector)(nil), "k8s.io.api.core.v1.ResourceFieldSelector")
+ proto.RegisterType((*ResourceHealth)(nil), "k8s.io.api.core.v1.ResourceHealth")
proto.RegisterType((*ResourceQuota)(nil), "k8s.io.api.core.v1.ResourceQuota")
proto.RegisterType((*ResourceQuotaList)(nil), "k8s.io.api.core.v1.ResourceQuotaList")
proto.RegisterType((*ResourceQuotaSpec)(nil), "k8s.io.api.core.v1.ResourceQuotaSpec")
@@ -6553,6 +6697,7 @@ func init() {
proto.RegisterType((*ResourceRequirements)(nil), "k8s.io.api.core.v1.ResourceRequirements")
proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.ResourceRequirements.LimitsEntry")
proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.ResourceRequirements.RequestsEntry")
+ proto.RegisterType((*ResourceStatus)(nil), "k8s.io.api.core.v1.ResourceStatus")
proto.RegisterType((*SELinuxOptions)(nil), "k8s.io.api.core.v1.SELinuxOptions")
proto.RegisterType((*ScaleIOPersistentVolumeSource)(nil), "k8s.io.api.core.v1.ScaleIOPersistentVolumeSource")
proto.RegisterType((*ScaleIOVolumeSource)(nil), "k8s.io.api.core.v1.ScaleIOVolumeSource")
@@ -6613,989 +6758,1011 @@ func init() {
}
var fileDescriptor_6c07b07c062484ab = []byte{
- // 15708 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x59, 0x8c, 0x1c, 0xd9,
- 0x75, 0x20, 0xaa, 0xc8, 0xac, 0xf5, 0xd4, 0x7e, 0x8b, 0x64, 0x17, 0xab, 0x49, 0x26, 0x3b, 0xba,
- 0x9b, 0xcd, 0xde, 0x8a, 0x62, 0x2f, 0xea, 0x56, 0x77, 0xab, 0xad, 0x5a, 0xc9, 0x6c, 0x56, 0x15,
- 0xb3, 0x6f, 0x16, 0x49, 0xa9, 0xd5, 0x92, 0x15, 0xcc, 0xbc, 0x55, 0x15, 0xaa, 0xcc, 0x88, 0xec,
- 0x88, 0xc8, 0x22, 0x8b, 0x4f, 0x86, 0x6d, 0xf9, 0x59, 0xb6, 0x64, 0x3f, 0x40, 0x78, 0xf0, 0x5b,
- 0x20, 0x1b, 0xc6, 0x83, 0x9f, 0x9f, 0x97, 0xa7, 0x67, 0xbf, 0xd1, 0xc8, 0xe3, 0x4d, 0xde, 0xc6,
- 0x33, 0x03, 0xd8, 0x83, 0x81, 0xc7, 0x63, 0xc0, 0x96, 0x31, 0xc6, 0x94, 0x47, 0xf4, 0x00, 0x86,
- 0x3f, 0xc6, 0x36, 0x3c, 0xf3, 0x31, 0x53, 0xf0, 0x8c, 0x07, 0x77, 0x8d, 0x7b, 0x63, 0xc9, 0xcc,
- 0x62, 0x93, 0xa5, 0x96, 0xd0, 0x7f, 0x99, 0xe7, 0x9c, 0x7b, 0xee, 0x8d, 0xbb, 0x9e, 0x7b, 0xce,
- 0xb9, 0xe7, 0x80, 0xbd, 0xf3, 0x72, 0x38, 0xe7, 0xfa, 0x17, 0x9c, 0x96, 0x7b, 0xa1, 0xe6, 0x07,
- 0xe4, 0xc2, 0xee, 0xc5, 0x0b, 0x5b, 0xc4, 0x23, 0x81, 0x13, 0x91, 0xfa, 0x5c, 0x2b, 0xf0, 0x23,
- 0x1f, 0x21, 0x4e, 0x33, 0xe7, 0xb4, 0xdc, 0x39, 0x4a, 0x33, 0xb7, 0x7b, 0x71, 0xf6, 0xd9, 0x2d,
- 0x37, 0xda, 0x6e, 0xdf, 0x9c, 0xab, 0xf9, 0xcd, 0x0b, 0x5b, 0xfe, 0x96, 0x7f, 0x81, 0x91, 0xde,
- 0x6c, 0x6f, 0xb2, 0x7f, 0xec, 0x0f, 0xfb, 0xc5, 0x59, 0xcc, 0xbe, 0x10, 0x57, 0xd3, 0x74, 0x6a,
- 0xdb, 0xae, 0x47, 0x82, 0xbd, 0x0b, 0xad, 0x9d, 0x2d, 0x56, 0x6f, 0x40, 0x42, 0xbf, 0x1d, 0xd4,
- 0x48, 0xb2, 0xe2, 0x8e, 0xa5, 0xc2, 0x0b, 0x4d, 0x12, 0x39, 0x19, 0xcd, 0x9d, 0xbd, 0x90, 0x57,
- 0x2a, 0x68, 0x7b, 0x91, 0xdb, 0x4c, 0x57, 0xf3, 0xa1, 0x6e, 0x05, 0xc2, 0xda, 0x36, 0x69, 0x3a,
- 0xa9, 0x72, 0xcf, 0xe7, 0x95, 0x6b, 0x47, 0x6e, 0xe3, 0x82, 0xeb, 0x45, 0x61, 0x14, 0x24, 0x0b,
- 0xd9, 0xdf, 0xb0, 0xe0, 0xec, 0xfc, 0x8d, 0xea, 0x72, 0xc3, 0x09, 0x23, 0xb7, 0xb6, 0xd0, 0xf0,
- 0x6b, 0x3b, 0xd5, 0xc8, 0x0f, 0xc8, 0x75, 0xbf, 0xd1, 0x6e, 0x92, 0x2a, 0xeb, 0x08, 0xf4, 0x0c,
- 0x0c, 0xed, 0xb2, 0xff, 0xe5, 0xa5, 0x19, 0xeb, 0xac, 0x75, 0x7e, 0x78, 0x61, 0xf2, 0xf7, 0xf6,
- 0x4b, 0x1f, 0xb8, 0xbb, 0x5f, 0x1a, 0xba, 0x2e, 0xe0, 0x58, 0x51, 0xa0, 0x73, 0x30, 0xb0, 0x19,
- 0x6e, 0xec, 0xb5, 0xc8, 0x4c, 0x81, 0xd1, 0x8e, 0x0b, 0xda, 0x81, 0x95, 0x2a, 0x85, 0x62, 0x81,
- 0x45, 0x17, 0x60, 0xb8, 0xe5, 0x04, 0x91, 0x1b, 0xb9, 0xbe, 0x37, 0x53, 0x3c, 0x6b, 0x9d, 0xef,
- 0x5f, 0x98, 0x12, 0xa4, 0xc3, 0x15, 0x89, 0xc0, 0x31, 0x0d, 0x6d, 0x46, 0x40, 0x9c, 0xfa, 0x55,
- 0xaf, 0xb1, 0x37, 0xd3, 0x77, 0xd6, 0x3a, 0x3f, 0x14, 0x37, 0x03, 0x0b, 0x38, 0x56, 0x14, 0xf6,
- 0x97, 0x0b, 0x30, 0x34, 0xbf, 0xb9, 0xe9, 0x7a, 0x6e, 0xb4, 0x87, 0xae, 0xc3, 0xa8, 0xe7, 0xd7,
- 0x89, 0xfc, 0xcf, 0xbe, 0x62, 0xe4, 0xb9, 0xb3, 0x73, 0xe9, 0xa9, 0x34, 0xb7, 0xae, 0xd1, 0x2d,
- 0x4c, 0xde, 0xdd, 0x2f, 0x8d, 0xea, 0x10, 0x6c, 0xf0, 0x41, 0x18, 0x46, 0x5a, 0x7e, 0x5d, 0xb1,
- 0x2d, 0x30, 0xb6, 0xa5, 0x2c, 0xb6, 0x95, 0x98, 0x6c, 0x61, 0xe2, 0xee, 0x7e, 0x69, 0x44, 0x03,
- 0x60, 0x9d, 0x09, 0xba, 0x09, 0x13, 0xf4, 0xaf, 0x17, 0xb9, 0x8a, 0x6f, 0x91, 0xf1, 0x7d, 0x34,
- 0x8f, 0xaf, 0x46, 0xba, 0x30, 0x7d, 0x77, 0xbf, 0x34, 0x91, 0x00, 0xe2, 0x24, 0x43, 0xfb, 0x47,
- 0x2d, 0x98, 0x98, 0x6f, 0xb5, 0xe6, 0x83, 0xa6, 0x1f, 0x54, 0x02, 0x7f, 0xd3, 0x6d, 0x10, 0xf4,
- 0x12, 0xf4, 0x45, 0x74, 0xd4, 0xf8, 0x08, 0x3f, 0x2a, 0xba, 0xb6, 0x8f, 0x8e, 0xd5, 0xc1, 0x7e,
- 0x69, 0x3a, 0x41, 0xce, 0x86, 0x92, 0x15, 0x40, 0x1f, 0x85, 0xc9, 0x86, 0x5f, 0x73, 0x1a, 0xdb,
- 0x7e, 0x18, 0x09, 0xac, 0x18, 0xfa, 0x63, 0x77, 0xf7, 0x4b, 0x93, 0xab, 0x09, 0x1c, 0x4e, 0x51,
- 0xdb, 0x77, 0x60, 0x7c, 0x3e, 0x8a, 0x9c, 0xda, 0x36, 0xa9, 0xf3, 0x09, 0x85, 0x5e, 0x80, 0x3e,
- 0xcf, 0x69, 0xca, 0xc6, 0x9c, 0x95, 0x8d, 0x59, 0x77, 0x9a, 0xb4, 0x31, 0x93, 0xd7, 0x3c, 0xf7,
- 0x9d, 0xb6, 0x98, 0xa4, 0x14, 0x86, 0x19, 0x35, 0x7a, 0x0e, 0xa0, 0x4e, 0x76, 0xdd, 0x1a, 0xa9,
- 0x38, 0xd1, 0xb6, 0x68, 0x03, 0x12, 0x65, 0x61, 0x49, 0x61, 0xb0, 0x46, 0x65, 0xdf, 0x86, 0xe1,
- 0xf9, 0x5d, 0xdf, 0xad, 0x57, 0xfc, 0x7a, 0x88, 0x76, 0x60, 0xa2, 0x15, 0x90, 0x4d, 0x12, 0x28,
- 0xd0, 0x8c, 0x75, 0xb6, 0x78, 0x7e, 0xe4, 0xb9, 0xf3, 0x99, 0x7d, 0x6f, 0x92, 0x2e, 0x7b, 0x51,
- 0xb0, 0xb7, 0xf0, 0x90, 0xa8, 0x6f, 0x22, 0x81, 0xc5, 0x49, 0xce, 0xf6, 0x3f, 0x2f, 0xc0, 0xf1,
- 0xf9, 0x3b, 0xed, 0x80, 0x2c, 0xb9, 0xe1, 0x4e, 0x72, 0xc1, 0xd5, 0xdd, 0x70, 0x67, 0x3d, 0xee,
- 0x01, 0x35, 0xd3, 0x97, 0x04, 0x1c, 0x2b, 0x0a, 0xf4, 0x2c, 0x0c, 0xd2, 0xdf, 0xd7, 0x70, 0x59,
- 0x7c, 0xf2, 0xb4, 0x20, 0x1e, 0x59, 0x72, 0x22, 0x67, 0x89, 0xa3, 0xb0, 0xa4, 0x41, 0x6b, 0x30,
- 0x52, 0x63, 0xfb, 0xc3, 0xd6, 0x9a, 0x5f, 0x27, 0x6c, 0x6e, 0x0d, 0x2f, 0x3c, 0x4d, 0xc9, 0x17,
- 0x63, 0xf0, 0xc1, 0x7e, 0x69, 0x86, 0xb7, 0x4d, 0xb0, 0xd0, 0x70, 0x58, 0x2f, 0x8f, 0x6c, 0xb5,
- 0xdc, 0xfb, 0x18, 0x27, 0xc8, 0x58, 0xea, 0xe7, 0xb5, 0x95, 0xdb, 0xcf, 0x56, 0xee, 0x68, 0xf6,
- 0xaa, 0x45, 0x17, 0xa1, 0x6f, 0xc7, 0xf5, 0xea, 0x33, 0x03, 0x8c, 0xd7, 0x69, 0x3a, 0xe6, 0x57,
- 0x5c, 0xaf, 0x7e, 0xb0, 0x5f, 0x9a, 0x32, 0x9a, 0x43, 0x81, 0x98, 0x91, 0xda, 0xff, 0xc9, 0x82,
- 0x12, 0xc3, 0xad, 0xb8, 0x0d, 0x52, 0x21, 0x41, 0xe8, 0x86, 0x11, 0xf1, 0x22, 0xa3, 0x43, 0x9f,
- 0x03, 0x08, 0x49, 0x2d, 0x20, 0x91, 0xd6, 0xa5, 0x6a, 0x62, 0x54, 0x15, 0x06, 0x6b, 0x54, 0x74,
- 0x7f, 0x0a, 0xb7, 0x9d, 0x80, 0xcd, 0x2f, 0xd1, 0xb1, 0x6a, 0x7f, 0xaa, 0x4a, 0x04, 0x8e, 0x69,
- 0x8c, 0xfd, 0xa9, 0xd8, 0x6d, 0x7f, 0x42, 0x1f, 0x81, 0x89, 0xb8, 0xb2, 0xb0, 0xe5, 0xd4, 0x64,
- 0x07, 0xb2, 0x15, 0x5c, 0x35, 0x51, 0x38, 0x49, 0x6b, 0xff, 0xbf, 0x96, 0x98, 0x3c, 0xf4, 0xab,
- 0xdf, 0xe3, 0xdf, 0x6a, 0xff, 0xaa, 0x05, 0x83, 0x0b, 0xae, 0x57, 0x77, 0xbd, 0x2d, 0xf4, 0x69,
- 0x18, 0xa2, 0x47, 0x65, 0xdd, 0x89, 0x1c, 0xb1, 0x0d, 0x7f, 0x50, 0x5b, 0x5b, 0xea, 0xe4, 0x9a,
- 0x6b, 0xed, 0x6c, 0x51, 0x40, 0x38, 0x47, 0xa9, 0xe9, 0x6a, 0xbb, 0x7a, 0xf3, 0x33, 0xa4, 0x16,
- 0xad, 0x91, 0xc8, 0x89, 0x3f, 0x27, 0x86, 0x61, 0xc5, 0x15, 0x5d, 0x81, 0x81, 0xc8, 0x09, 0xb6,
- 0x48, 0x24, 0xf6, 0xe3, 0xcc, 0x7d, 0x93, 0x97, 0xc4, 0x74, 0x45, 0x12, 0xaf, 0x46, 0xe2, 0x53,
- 0x6a, 0x83, 0x15, 0xc5, 0x82, 0x85, 0xfd, 0xdf, 0x06, 0xe1, 0xe4, 0x62, 0xb5, 0x9c, 0x33, 0xaf,
- 0xce, 0xc1, 0x40, 0x3d, 0x70, 0x77, 0x49, 0x20, 0xfa, 0x59, 0x71, 0x59, 0x62, 0x50, 0x2c, 0xb0,
- 0xe8, 0x65, 0x18, 0xe5, 0xe7, 0xe3, 0x65, 0xc7, 0xab, 0xc7, 0xdb, 0xa3, 0xa0, 0x1e, 0xbd, 0xae,
- 0xe1, 0xb0, 0x41, 0x79, 0xc8, 0x49, 0x75, 0x2e, 0xb1, 0x18, 0xf3, 0xce, 0xde, 0x2f, 0x58, 0x30,
- 0xc9, 0xab, 0x99, 0x8f, 0xa2, 0xc0, 0xbd, 0xd9, 0x8e, 0x48, 0x38, 0xd3, 0xcf, 0x76, 0xba, 0xc5,
- 0xac, 0xde, 0xca, 0xed, 0x81, 0xb9, 0xeb, 0x09, 0x2e, 0x7c, 0x13, 0x9c, 0x11, 0xf5, 0x4e, 0x26,
- 0xd1, 0x38, 0x55, 0x2d, 0xfa, 0x01, 0x0b, 0x66, 0x6b, 0xbe, 0x17, 0x05, 0x7e, 0xa3, 0x41, 0x82,
- 0x4a, 0xfb, 0x66, 0xc3, 0x0d, 0xb7, 0xf9, 0x3c, 0xc5, 0x64, 0x93, 0xed, 0x04, 0x39, 0x63, 0xa8,
- 0x88, 0xc4, 0x18, 0x9e, 0xb9, 0xbb, 0x5f, 0x9a, 0x5d, 0xcc, 0x65, 0x85, 0x3b, 0x54, 0x83, 0x76,
- 0x00, 0xd1, 0x93, 0xbd, 0x1a, 0x39, 0x5b, 0x24, 0xae, 0x7c, 0xb0, 0xf7, 0xca, 0x4f, 0xdc, 0xdd,
- 0x2f, 0xa1, 0xf5, 0x14, 0x0b, 0x9c, 0xc1, 0x16, 0xbd, 0x03, 0xc7, 0x28, 0x34, 0xf5, 0xad, 0x43,
- 0xbd, 0x57, 0x37, 0x73, 0x77, 0xbf, 0x74, 0x6c, 0x3d, 0x83, 0x09, 0xce, 0x64, 0x8d, 0xbe, 0xcf,
- 0x82, 0x93, 0xf1, 0xe7, 0x2f, 0xdf, 0x6e, 0x39, 0x5e, 0x3d, 0xae, 0x78, 0xb8, 0xf7, 0x8a, 0xe9,
- 0x9e, 0x7c, 0x72, 0x31, 0x8f, 0x13, 0xce, 0xaf, 0x04, 0x79, 0x30, 0x4d, 0x9b, 0x96, 0xac, 0x1b,
- 0x7a, 0xaf, 0xfb, 0xa1, 0xbb, 0xfb, 0xa5, 0xe9, 0xf5, 0x34, 0x0f, 0x9c, 0xc5, 0x78, 0x76, 0x11,
- 0x8e, 0x67, 0xce, 0x4e, 0x34, 0x09, 0xc5, 0x1d, 0xc2, 0x85, 0xc0, 0x61, 0x4c, 0x7f, 0xa2, 0x63,
- 0xd0, 0xbf, 0xeb, 0x34, 0xda, 0x62, 0x61, 0x62, 0xfe, 0xe7, 0x95, 0xc2, 0xcb, 0x96, 0xfd, 0x2f,
- 0x8a, 0x30, 0xb1, 0x58, 0x2d, 0xdf, 0xd3, 0xaa, 0xd7, 0x8f, 0xbd, 0x42, 0xc7, 0x63, 0x2f, 0x3e,
- 0x44, 0x8b, 0xb9, 0x87, 0xe8, 0xf7, 0x66, 0x2c, 0xd9, 0x3e, 0xb6, 0x64, 0x3f, 0x9c, 0xb3, 0x64,
- 0xef, 0xf3, 0x42, 0xdd, 0xcd, 0x99, 0xb5, 0xfd, 0x6c, 0x00, 0x33, 0x25, 0x24, 0x26, 0xfb, 0x25,
- 0xb7, 0xda, 0x43, 0x4e, 0xdd, 0xfb, 0x33, 0x8e, 0x35, 0x18, 0x5d, 0x74, 0x5a, 0xce, 0x4d, 0xb7,
- 0xe1, 0x46, 0x2e, 0x09, 0xd1, 0x13, 0x50, 0x74, 0xea, 0x75, 0x26, 0xdd, 0x0d, 0x2f, 0x1c, 0xbf,
- 0xbb, 0x5f, 0x2a, 0xce, 0xd7, 0xa9, 0x98, 0x01, 0x8a, 0x6a, 0x0f, 0x53, 0x0a, 0xf4, 0x14, 0xf4,
- 0xd5, 0x03, 0xbf, 0x35, 0x53, 0x60, 0x94, 0x74, 0x95, 0xf7, 0x2d, 0x05, 0x7e, 0x2b, 0x41, 0xca,
- 0x68, 0xec, 0xdf, 0x29, 0xc0, 0xa9, 0x45, 0xd2, 0xda, 0x5e, 0xa9, 0xe6, 0x9c, 0x17, 0xe7, 0x61,
- 0xa8, 0xe9, 0x7b, 0x6e, 0xe4, 0x07, 0xa1, 0xa8, 0x9a, 0xcd, 0x88, 0x35, 0x01, 0xc3, 0x0a, 0x8b,
- 0xce, 0x42, 0x5f, 0x2b, 0x16, 0x62, 0x47, 0xa5, 0x00, 0xcc, 0xc4, 0x57, 0x86, 0xa1, 0x14, 0xed,
- 0x90, 0x04, 0x62, 0xc6, 0x28, 0x8a, 0x6b, 0x21, 0x09, 0x30, 0xc3, 0xc4, 0x92, 0x00, 0x95, 0x11,
- 0xc4, 0x89, 0x90, 0x90, 0x04, 0x28, 0x06, 0x6b, 0x54, 0xa8, 0x02, 0xc3, 0x61, 0x62, 0x64, 0x7b,
- 0x5a, 0x9a, 0x63, 0x4c, 0x54, 0x50, 0x23, 0x19, 0x33, 0x31, 0x4e, 0xb0, 0x81, 0xae, 0xa2, 0xc2,
- 0xd7, 0x0b, 0x80, 0x78, 0x17, 0x7e, 0x9b, 0x75, 0xdc, 0xb5, 0x74, 0xc7, 0xf5, 0xbe, 0x24, 0xee,
- 0x57, 0xef, 0xfd, 0x67, 0x0b, 0x4e, 0x2d, 0xba, 0x5e, 0x9d, 0x04, 0x39, 0x13, 0xf0, 0xc1, 0x5c,
- 0xe5, 0x0f, 0x27, 0xa4, 0x18, 0x53, 0xac, 0xef, 0x3e, 0x4c, 0x31, 0xfb, 0x6f, 0x2c, 0x40, 0xfc,
- 0xb3, 0xdf, 0x73, 0x1f, 0x7b, 0x2d, 0xfd, 0xb1, 0xf7, 0x61, 0x5a, 0xd8, 0xff, 0xbf, 0x05, 0x23,
- 0x8b, 0x0d, 0xc7, 0x6d, 0x8a, 0x4f, 0x5d, 0x84, 0x29, 0xa9, 0xb7, 0x62, 0x60, 0x4d, 0xf6, 0xa7,
- 0x9b, 0xdb, 0x14, 0x4e, 0x22, 0x71, 0x9a, 0x1e, 0x7d, 0x02, 0x4e, 0x1a, 0xc0, 0x0d, 0xd2, 0x6c,
- 0x35, 0x9c, 0x48, 0xbf, 0x15, 0xb0, 0xd3, 0x1f, 0xe7, 0x11, 0xe1, 0xfc, 0xf2, 0xf6, 0x2a, 0x8c,
- 0x2f, 0x36, 0x5c, 0xe2, 0x45, 0xe5, 0xca, 0xa2, 0xef, 0x6d, 0xba, 0x5b, 0xe8, 0x15, 0x18, 0x8f,
- 0xdc, 0x26, 0xf1, 0xdb, 0x51, 0x95, 0xd4, 0x7c, 0x8f, 0xdd, 0xb5, 0xad, 0xf3, 0xfd, 0x0b, 0xe8,
- 0xee, 0x7e, 0x69, 0x7c, 0xc3, 0xc0, 0xe0, 0x04, 0xa5, 0xfd, 0x33, 0x74, 0xa7, 0x6d, 0xb4, 0xc3,
- 0x88, 0x04, 0x1b, 0x41, 0x3b, 0x8c, 0x16, 0xda, 0x54, 0x5a, 0xae, 0x04, 0x3e, 0xed, 0x40, 0xd7,
- 0xf7, 0xd0, 0x29, 0x43, 0x81, 0x30, 0x24, 0x95, 0x07, 0x42, 0x51, 0x30, 0x07, 0x10, 0xba, 0x5b,
- 0x1e, 0x09, 0xb4, 0x4f, 0x1b, 0x67, 0x8b, 0x5b, 0x41, 0xb1, 0x46, 0x81, 0x1a, 0x30, 0xd6, 0x70,
- 0x6e, 0x92, 0x46, 0x95, 0x34, 0x48, 0x2d, 0xf2, 0x03, 0xa1, 0x91, 0x79, 0xbe, 0xb7, 0x9b, 0xcb,
- 0xaa, 0x5e, 0x74, 0x61, 0xea, 0xee, 0x7e, 0x69, 0xcc, 0x00, 0x61, 0x93, 0x39, 0xdd, 0xec, 0xfc,
- 0x16, 0xfd, 0x0a, 0xa7, 0xa1, 0x5f, 0x97, 0xaf, 0x0a, 0x18, 0x56, 0x58, 0xb5, 0xd9, 0xf5, 0xe5,
- 0x6d, 0x76, 0xf6, 0x9f, 0xd1, 0xa5, 0xe1, 0x37, 0x5b, 0xbe, 0x47, 0xbc, 0x68, 0xd1, 0xf7, 0xea,
- 0x5c, 0x97, 0xf6, 0x8a, 0xa1, 0xec, 0x39, 0x97, 0x50, 0xf6, 0x9c, 0x48, 0x97, 0xd0, 0xf4, 0x3d,
- 0x1f, 0x86, 0x81, 0x30, 0x72, 0xa2, 0x76, 0x28, 0x3a, 0xee, 0x11, 0xb9, 0x50, 0xaa, 0x0c, 0x7a,
- 0xb0, 0x5f, 0x9a, 0x50, 0xc5, 0x38, 0x08, 0x8b, 0x02, 0xe8, 0x49, 0x18, 0x6c, 0x92, 0x30, 0x74,
- 0xb6, 0xa4, 0xa0, 0x33, 0x21, 0xca, 0x0e, 0xae, 0x71, 0x30, 0x96, 0x78, 0xf4, 0x28, 0xf4, 0x93,
- 0x20, 0xf0, 0x03, 0xf1, 0x6d, 0x63, 0x82, 0xb0, 0x7f, 0x99, 0x02, 0x31, 0xc7, 0xd9, 0xff, 0xda,
- 0x82, 0x09, 0xd5, 0x56, 0x5e, 0xd7, 0x11, 0x5c, 0x30, 0xdf, 0x02, 0xa8, 0xc9, 0x0f, 0x0c, 0x99,
- 0x60, 0x30, 0xf2, 0xdc, 0xb9, 0x4c, 0x19, 0x2c, 0xd5, 0x8d, 0x31, 0x67, 0x05, 0x0a, 0xb1, 0xc6,
- 0xcd, 0xfe, 0x4d, 0x0b, 0xa6, 0x13, 0x5f, 0xb4, 0xea, 0x86, 0x11, 0x7a, 0x3b, 0xf5, 0x55, 0x73,
- 0x3d, 0x4e, 0x3e, 0x37, 0xe4, 0xdf, 0xa4, 0x76, 0x29, 0x09, 0xd1, 0xbe, 0xe8, 0x32, 0xf4, 0xbb,
- 0x11, 0x69, 0xca, 0x8f, 0x79, 0xb4, 0xe3, 0xc7, 0xf0, 0x56, 0xc5, 0x23, 0x52, 0xa6, 0x25, 0x31,
- 0x67, 0x60, 0xff, 0x4e, 0x11, 0x86, 0xf9, 0xfa, 0x5e, 0x73, 0x5a, 0x47, 0x30, 0x16, 0x4f, 0xc3,
- 0xb0, 0xdb, 0x6c, 0xb6, 0x23, 0xe7, 0xa6, 0x38, 0xa9, 0x87, 0xf8, 0xae, 0x59, 0x96, 0x40, 0x1c,
- 0xe3, 0x51, 0x19, 0xfa, 0x58, 0x53, 0xf8, 0x57, 0x3e, 0x91, 0xfd, 0x95, 0xa2, 0xed, 0x73, 0x4b,
- 0x4e, 0xe4, 0x70, 0x21, 0x59, 0xad, 0x2b, 0x0a, 0xc2, 0x8c, 0x05, 0x72, 0x00, 0x6e, 0xba, 0x9e,
- 0x13, 0xec, 0x51, 0xd8, 0x4c, 0x91, 0x31, 0x7c, 0xb6, 0x33, 0xc3, 0x05, 0x45, 0xcf, 0xd9, 0xaa,
- 0x0f, 0x8b, 0x11, 0x58, 0x63, 0x3a, 0xfb, 0x12, 0x0c, 0x2b, 0xe2, 0xc3, 0xc8, 0xba, 0xb3, 0x1f,
- 0x81, 0x89, 0x44, 0x5d, 0xdd, 0x8a, 0x8f, 0xea, 0xa2, 0xf2, 0xaf, 0xb3, 0x2d, 0x43, 0xb4, 0x7a,
- 0xd9, 0xdb, 0x15, 0x47, 0xcc, 0x1d, 0x38, 0xd6, 0xc8, 0x38, 0xa4, 0xc4, 0xb8, 0xf6, 0x7e, 0xa8,
- 0x9d, 0x12, 0x9f, 0x7d, 0x2c, 0x0b, 0x8b, 0x33, 0xeb, 0x30, 0x76, 0xc4, 0x42, 0xa7, 0x1d, 0x91,
- 0xee, 0x77, 0xc7, 0x54, 0xe3, 0xaf, 0x90, 0x3d, 0xb5, 0xa9, 0x7e, 0x2b, 0x9b, 0x7f, 0x9a, 0xf7,
- 0x3e, 0xdf, 0x2e, 0x47, 0x04, 0x83, 0xe2, 0x15, 0xb2, 0xc7, 0x87, 0x42, 0xff, 0xba, 0x62, 0xc7,
- 0xaf, 0xfb, 0xaa, 0x05, 0x63, 0xea, 0xeb, 0x8e, 0x60, 0x5f, 0x58, 0x30, 0xf7, 0x85, 0xd3, 0x1d,
- 0x27, 0x78, 0xce, 0x8e, 0xf0, 0xf5, 0x02, 0x9c, 0x54, 0x34, 0xf4, 0xda, 0xc7, 0xff, 0x88, 0x59,
- 0x75, 0x01, 0x86, 0x3d, 0xa5, 0x00, 0xb5, 0x4c, 0xcd, 0x63, 0xac, 0xfe, 0x8c, 0x69, 0xe8, 0x91,
- 0xe7, 0xc5, 0x87, 0xf6, 0xa8, 0x6e, 0x19, 0x10, 0x87, 0xfb, 0x02, 0x14, 0xdb, 0x6e, 0x5d, 0x1c,
- 0x30, 0x1f, 0x94, 0xbd, 0x7d, 0xad, 0xbc, 0x74, 0xb0, 0x5f, 0x7a, 0x24, 0xcf, 0x48, 0x46, 0x4f,
- 0xb6, 0x70, 0xee, 0x5a, 0x79, 0x09, 0xd3, 0xc2, 0x68, 0x1e, 0x26, 0xa4, 0x28, 0x73, 0x9d, 0x4a,
- 0xd2, 0xbe, 0x27, 0xce, 0x21, 0xa5, 0xde, 0xc7, 0x26, 0x1a, 0x27, 0xe9, 0xd1, 0x12, 0x4c, 0xee,
- 0xb4, 0x6f, 0x92, 0x06, 0x89, 0xf8, 0x07, 0x5f, 0x21, 0x5c, 0xf9, 0x3d, 0x1c, 0x5f, 0xba, 0xaf,
- 0x24, 0xf0, 0x38, 0x55, 0xc2, 0xfe, 0x07, 0x76, 0x1e, 0x88, 0xde, 0xd3, 0xe4, 0x9b, 0x6f, 0xe5,
- 0x74, 0xee, 0x65, 0x56, 0x5c, 0x21, 0x7b, 0x1b, 0x3e, 0x95, 0x43, 0xb2, 0x67, 0x85, 0x31, 0xe7,
- 0xfb, 0x3a, 0xce, 0xf9, 0x5f, 0x2a, 0xc0, 0x71, 0xd5, 0x03, 0x86, 0x7c, 0xff, 0xed, 0xde, 0x07,
- 0x17, 0x61, 0xa4, 0x4e, 0x36, 0x9d, 0x76, 0x23, 0x52, 0x96, 0x98, 0x7e, 0x6e, 0x1c, 0x5c, 0x8a,
- 0xc1, 0x58, 0xa7, 0x39, 0x44, 0xb7, 0xfd, 0xc2, 0x18, 0x3b, 0x88, 0x23, 0x87, 0xce, 0x71, 0xb5,
- 0x6a, 0xac, 0xdc, 0x55, 0xf3, 0x28, 0xf4, 0xbb, 0x4d, 0x2a, 0x98, 0x15, 0x4c, 0x79, 0xab, 0x4c,
- 0x81, 0x98, 0xe3, 0xd0, 0xe3, 0x30, 0x58, 0xf3, 0x9b, 0x4d, 0xc7, 0xab, 0xb3, 0x23, 0x6f, 0x78,
- 0x61, 0x84, 0xca, 0x6e, 0x8b, 0x1c, 0x84, 0x25, 0x8e, 0x0a, 0xdf, 0x4e, 0xb0, 0xc5, 0xd5, 0x53,
- 0x42, 0xf8, 0x9e, 0x0f, 0xb6, 0x42, 0xcc, 0xa0, 0xf4, 0x76, 0x7d, 0xcb, 0x0f, 0x76, 0x5c, 0x6f,
- 0x6b, 0xc9, 0x0d, 0xc4, 0x92, 0x50, 0x67, 0xe1, 0x0d, 0x85, 0xc1, 0x1a, 0x15, 0x5a, 0x81, 0xfe,
- 0x96, 0x1f, 0x44, 0xe1, 0xcc, 0x00, 0xeb, 0xee, 0x47, 0x72, 0x36, 0x22, 0xfe, 0xb5, 0x15, 0x3f,
- 0x88, 0xe2, 0x0f, 0xa0, 0xff, 0x42, 0xcc, 0x8b, 0xa3, 0x55, 0x18, 0x24, 0xde, 0xee, 0x4a, 0xe0,
- 0x37, 0x67, 0xa6, 0xf3, 0x39, 0x2d, 0x73, 0x12, 0x3e, 0xcd, 0x62, 0x19, 0x55, 0x80, 0xb1, 0x64,
- 0x81, 0x3e, 0x0c, 0x45, 0xe2, 0xed, 0xce, 0x0c, 0x32, 0x4e, 0xb3, 0x39, 0x9c, 0xae, 0x3b, 0x41,
- 0xbc, 0xe7, 0x2f, 0x7b, 0xbb, 0x98, 0x96, 0x41, 0x1f, 0x87, 0x61, 0xb9, 0x61, 0x84, 0x42, 0xef,
- 0x9b, 0x39, 0x61, 0xe5, 0x36, 0x83, 0xc9, 0x3b, 0x6d, 0x37, 0x20, 0x4d, 0xe2, 0x45, 0x61, 0xbc,
- 0x43, 0x4a, 0x6c, 0x88, 0x63, 0x6e, 0xa8, 0x06, 0xa3, 0x01, 0x09, 0xdd, 0x3b, 0xa4, 0xe2, 0x37,
- 0xdc, 0xda, 0xde, 0xcc, 0x43, 0xac, 0x79, 0x4f, 0x76, 0xec, 0x32, 0xac, 0x15, 0x88, 0xed, 0x12,
- 0x3a, 0x14, 0x1b, 0x4c, 0xd1, 0x9b, 0x30, 0x16, 0x90, 0x30, 0x72, 0x82, 0x48, 0xd4, 0x32, 0xa3,
- 0xec, 0x88, 0x63, 0x58, 0x47, 0xf0, 0xeb, 0x44, 0x5c, 0x4d, 0x8c, 0xc1, 0x26, 0x07, 0xf4, 0x71,
- 0x69, 0x24, 0x59, 0xf3, 0xdb, 0x5e, 0x14, 0xce, 0x0c, 0xb3, 0x76, 0x67, 0x5a, 0xd3, 0xaf, 0xc7,
- 0x74, 0x49, 0x2b, 0x0a, 0x2f, 0x8c, 0x0d, 0x56, 0xe8, 0x93, 0x30, 0xc6, 0xff, 0x73, 0x23, 0x70,
- 0x38, 0x73, 0x9c, 0xf1, 0x3e, 0x9b, 0xcf, 0x9b, 0x13, 0x2e, 0x1c, 0x17, 0xcc, 0xc7, 0x74, 0x68,
- 0x88, 0x4d, 0x6e, 0x08, 0xc3, 0x58, 0xc3, 0xdd, 0x25, 0x1e, 0x09, 0xc3, 0x4a, 0xe0, 0xdf, 0x24,
- 0x42, 0xa7, 0x7d, 0x32, 0xdb, 0x68, 0xec, 0xdf, 0x24, 0xe2, 0x12, 0xa8, 0x97, 0xc1, 0x26, 0x0b,
- 0x74, 0x0d, 0xc6, 0x03, 0xe2, 0xd4, 0xdd, 0x98, 0xe9, 0x48, 0x37, 0xa6, 0xec, 0xe2, 0x8c, 0x8d,
- 0x42, 0x38, 0xc1, 0x04, 0x5d, 0x85, 0x51, 0xd6, 0xe7, 0xed, 0x16, 0x67, 0x7a, 0xa2, 0x1b, 0x53,
- 0xe6, 0x02, 0x51, 0xd5, 0x8a, 0x60, 0x83, 0x01, 0x7a, 0x03, 0x86, 0x1b, 0xee, 0x26, 0xa9, 0xed,
- 0xd5, 0x1a, 0x64, 0x66, 0x94, 0x71, 0xcb, 0xdc, 0x0c, 0x57, 0x25, 0x11, 0x97, 0xcf, 0xd5, 0x5f,
- 0x1c, 0x17, 0x47, 0xd7, 0xe1, 0x44, 0x44, 0x82, 0xa6, 0xeb, 0x39, 0x74, 0x13, 0x13, 0x57, 0x42,
- 0x66, 0xcb, 0x1f, 0x63, 0xb3, 0xeb, 0x8c, 0x18, 0x8d, 0x13, 0x1b, 0x99, 0x54, 0x38, 0xa7, 0x34,
- 0xba, 0x0d, 0x33, 0x19, 0x18, 0x3e, 0x6f, 0x8f, 0x31, 0xce, 0xaf, 0x09, 0xce, 0x33, 0x1b, 0x39,
- 0x74, 0x07, 0x1d, 0x70, 0x38, 0x97, 0x3b, 0xba, 0x0a, 0x13, 0x6c, 0xe7, 0xac, 0xb4, 0x1b, 0x0d,
- 0x51, 0xe1, 0x38, 0xab, 0xf0, 0x71, 0x29, 0x47, 0x94, 0x4d, 0xf4, 0xc1, 0x7e, 0x09, 0xe2, 0x7f,
- 0x38, 0x59, 0x1a, 0xdd, 0x64, 0x66, 0xe3, 0x76, 0xe0, 0x46, 0x7b, 0x74, 0x55, 0x91, 0xdb, 0xd1,
- 0xcc, 0x44, 0x47, 0x15, 0x9a, 0x4e, 0xaa, 0x6c, 0xcb, 0x3a, 0x10, 0x27, 0x19, 0xd2, 0xa3, 0x20,
- 0x8c, 0xea, 0xae, 0x37, 0x33, 0xc9, 0xef, 0x53, 0x72, 0x27, 0xad, 0x52, 0x20, 0xe6, 0x38, 0x66,
- 0x32, 0xa6, 0x3f, 0xae, 0xd2, 0x13, 0x77, 0x8a, 0x11, 0xc6, 0x26, 0x63, 0x89, 0xc0, 0x31, 0x0d,
- 0x15, 0x82, 0xa3, 0x68, 0x6f, 0x06, 0x31, 0x52, 0xb5, 0x21, 0x6e, 0x6c, 0x7c, 0x1c, 0x53, 0xb8,
- 0x7d, 0x13, 0xc6, 0xd5, 0x36, 0xc1, 0xfa, 0x04, 0x95, 0xa0, 0x9f, 0x89, 0x7d, 0x42, 0xe1, 0x3b,
- 0x4c, 0x9b, 0xc0, 0x44, 0x42, 0xcc, 0xe1, 0xac, 0x09, 0xee, 0x1d, 0xb2, 0xb0, 0x17, 0x11, 0xae,
- 0x8b, 0x28, 0x6a, 0x4d, 0x90, 0x08, 0x1c, 0xd3, 0xd8, 0xff, 0x9d, 0x8b, 0xcf, 0xf1, 0x29, 0xd1,
- 0xc3, 0xb9, 0xf8, 0x0c, 0x0c, 0x31, 0x57, 0x15, 0x3f, 0xe0, 0xf6, 0xe4, 0xfe, 0x58, 0x60, 0xbe,
- 0x2c, 0xe0, 0x58, 0x51, 0xa0, 0x57, 0x61, 0xac, 0xa6, 0x57, 0x20, 0x0e, 0x75, 0xb5, 0x8d, 0x18,
- 0xb5, 0x63, 0x93, 0x16, 0xbd, 0x0c, 0x43, 0xcc, 0x2b, 0xab, 0xe6, 0x37, 0x84, 0xb4, 0x29, 0x25,
- 0x93, 0xa1, 0x8a, 0x80, 0x1f, 0x68, 0xbf, 0xb1, 0xa2, 0x46, 0xe7, 0x60, 0x80, 0x36, 0xa1, 0x5c,
- 0x11, 0xc7, 0xa9, 0xd2, 0x5d, 0x5e, 0x66, 0x50, 0x2c, 0xb0, 0xf6, 0x6f, 0x5a, 0x4c, 0x96, 0x4a,
- 0xef, 0xf9, 0xe8, 0x32, 0x3b, 0x34, 0xd8, 0x09, 0xa2, 0xe9, 0x0e, 0x1f, 0xd3, 0x4e, 0x02, 0x85,
- 0x3b, 0x48, 0xfc, 0xc7, 0x46, 0x49, 0xf4, 0x56, 0xf2, 0x64, 0xe0, 0x02, 0xc5, 0x0b, 0xb2, 0x0b,
- 0x92, 0xa7, 0xc3, 0xc3, 0xf1, 0x11, 0x47, 0xdb, 0xd3, 0xe9, 0x88, 0xb0, 0xff, 0xd7, 0x82, 0x36,
- 0x4b, 0xaa, 0x91, 0x13, 0x11, 0x54, 0x81, 0xc1, 0x5b, 0x8e, 0x1b, 0xb9, 0xde, 0x96, 0x90, 0xfb,
- 0x3a, 0x1f, 0x74, 0xac, 0xd0, 0x0d, 0x5e, 0x80, 0x4b, 0x2f, 0xe2, 0x0f, 0x96, 0x6c, 0x28, 0xc7,
- 0xa0, 0xed, 0x79, 0x94, 0x63, 0xa1, 0x57, 0x8e, 0x98, 0x17, 0xe0, 0x1c, 0xc5, 0x1f, 0x2c, 0xd9,
- 0xa0, 0xb7, 0x01, 0xe4, 0x0e, 0x41, 0xea, 0x42, 0x77, 0xf8, 0x4c, 0x77, 0xa6, 0x1b, 0xaa, 0x0c,
- 0x57, 0x4e, 0xc6, 0xff, 0xb1, 0xc6, 0xcf, 0x8e, 0xb4, 0x31, 0xd5, 0x1b, 0x83, 0x3e, 0x41, 0x97,
- 0xa8, 0x13, 0x44, 0xa4, 0x3e, 0x1f, 0x89, 0xce, 0x79, 0xaa, 0xb7, 0xcb, 0xe1, 0x86, 0xdb, 0x24,
- 0xfa, 0x72, 0x16, 0x4c, 0x70, 0xcc, 0xcf, 0xfe, 0x95, 0x22, 0xcc, 0xe4, 0x35, 0x97, 0x2e, 0x1a,
- 0x72, 0xdb, 0x8d, 0x16, 0xa9, 0x58, 0x6b, 0x99, 0x8b, 0x66, 0x59, 0xc0, 0xb1, 0xa2, 0xa0, 0xb3,
- 0x37, 0x74, 0xb7, 0xe4, 0xdd, 0xbe, 0x3f, 0x9e, 0xbd, 0x55, 0x06, 0xc5, 0x02, 0x4b, 0xe9, 0x02,
- 0xe2, 0x84, 0xc2, 0x5d, 0x50, 0x9b, 0xe5, 0x98, 0x41, 0xb1, 0xc0, 0xea, 0x5a, 0xc6, 0xbe, 0x2e,
- 0x5a, 0x46, 0xa3, 0x8b, 0xfa, 0xef, 0x6f, 0x17, 0xa1, 0x4f, 0x01, 0x6c, 0xba, 0x9e, 0x1b, 0x6e,
- 0x33, 0xee, 0x03, 0x87, 0xe6, 0xae, 0x84, 0xe2, 0x15, 0xc5, 0x05, 0x6b, 0x1c, 0xd1, 0x8b, 0x30,
- 0xa2, 0x36, 0x90, 0xf2, 0x12, 0x73, 0x56, 0xd0, 0x9c, 0xbf, 0xe2, 0xdd, 0x74, 0x09, 0xeb, 0x74,
- 0xf6, 0x67, 0x92, 0xf3, 0x45, 0xac, 0x00, 0xad, 0x7f, 0xad, 0x5e, 0xfb, 0xb7, 0xd0, 0xb9, 0x7f,
- 0xed, 0xdf, 0x1d, 0x84, 0x09, 0xa3, 0xb2, 0x76, 0xd8, 0xc3, 0x9e, 0x7b, 0x89, 0x1e, 0x40, 0x4e,
- 0x44, 0xc4, 0xfa, 0xb3, 0xbb, 0x2f, 0x15, 0xfd, 0x90, 0xa2, 0x2b, 0x80, 0x97, 0x47, 0x9f, 0x82,
- 0xe1, 0x86, 0x13, 0x32, 0x8d, 0x25, 0x11, 0xeb, 0xae, 0x17, 0x66, 0xf1, 0x85, 0xd0, 0x09, 0x23,
- 0xed, 0xd4, 0xe7, 0xbc, 0x63, 0x96, 0xf4, 0xa4, 0xa4, 0xf2, 0x95, 0xf4, 0x47, 0x55, 0x8d, 0xa0,
- 0x42, 0xd8, 0x1e, 0xe6, 0x38, 0xf4, 0x32, 0xdb, 0x5a, 0xe9, 0xac, 0x58, 0xa4, 0xd2, 0x28, 0x9b,
- 0x66, 0xfd, 0x86, 0x90, 0xad, 0x70, 0xd8, 0xa0, 0x8c, 0xef, 0x64, 0x03, 0x1d, 0xee, 0x64, 0x4f,
- 0xc2, 0x20, 0xfb, 0xa1, 0x66, 0x80, 0x1a, 0x8d, 0x32, 0x07, 0x63, 0x89, 0x4f, 0x4e, 0x98, 0xa1,
- 0xde, 0x26, 0x0c, 0xbd, 0xf5, 0x89, 0x49, 0xcd, 0x1c, 0x45, 0x86, 0xf8, 0x2e, 0x27, 0xa6, 0x3c,
- 0x96, 0x38, 0xf4, 0xb3, 0x16, 0x20, 0xa7, 0x41, 0x6f, 0xcb, 0x14, 0xac, 0x2e, 0x37, 0xc0, 0x44,
- 0xed, 0x57, 0xbb, 0x76, 0x7b, 0x3b, 0x9c, 0x9b, 0x4f, 0x95, 0xe6, 0x9a, 0xd2, 0x57, 0x44, 0x13,
- 0x51, 0x9a, 0x40, 0x3f, 0x8c, 0x56, 0xdd, 0x30, 0xfa, 0xdc, 0x9f, 0x27, 0x0e, 0xa7, 0x8c, 0x26,
- 0xa1, 0x6b, 0xfa, 0xe5, 0x6b, 0xe4, 0x90, 0x97, 0xaf, 0xb1, 0xdc, 0x8b, 0xd7, 0x77, 0x27, 0x2e,
- 0x30, 0xa3, 0xec, 0xcb, 0x1f, 0xef, 0x72, 0x81, 0x11, 0xea, 0xf4, 0x1e, 0xae, 0x31, 0xb3, 0x6d,
- 0x78, 0x28, 0xa7, 0x8b, 0x32, 0x14, 0xbc, 0x4b, 0xba, 0x82, 0xb7, 0x8b, 0x5a, 0x70, 0x4e, 0x7e,
- 0xc4, 0xdc, 0x9b, 0x6d, 0xc7, 0x8b, 0xdc, 0x68, 0x4f, 0x57, 0x08, 0x3f, 0x05, 0xe3, 0x4b, 0x0e,
- 0x69, 0xfa, 0xde, 0xb2, 0x57, 0x6f, 0xf9, 0xae, 0x17, 0xa1, 0x19, 0xe8, 0x63, 0xd2, 0x0d, 0xdf,
- 0xdb, 0xfb, 0x68, 0xd3, 0x31, 0x83, 0xd8, 0x5b, 0x70, 0x7c, 0xc9, 0xbf, 0xe5, 0xdd, 0x72, 0x82,
- 0xfa, 0x7c, 0xa5, 0xac, 0x29, 0xac, 0xd6, 0xa5, 0xc2, 0xc4, 0xca, 0xbf, 0x8e, 0x6a, 0x25, 0x79,
- 0x2f, 0xac, 0xb8, 0x0d, 0x92, 0xa3, 0x56, 0xfc, 0x3f, 0x0a, 0x46, 0x4d, 0x31, 0xbd, 0x32, 0x8a,
- 0x59, 0xb9, 0x1e, 0x00, 0x6f, 0xc2, 0xd0, 0xa6, 0x4b, 0x1a, 0x75, 0x4c, 0x36, 0x45, 0xef, 0x3c,
- 0x91, 0xef, 0x23, 0xb8, 0x42, 0x29, 0x95, 0xf5, 0x8e, 0xa9, 0x5b, 0x56, 0x44, 0x61, 0xac, 0xd8,
- 0xa0, 0x1d, 0x98, 0x94, 0x7d, 0x28, 0xb1, 0x62, 0xc3, 0x79, 0xb2, 0xd3, 0xcc, 0x32, 0x99, 0x33,
- 0x7f, 0x69, 0x9c, 0x60, 0x83, 0x53, 0x8c, 0xd1, 0x29, 0xe8, 0x6b, 0xd2, 0xa3, 0xb5, 0x8f, 0x75,
- 0x3f, 0xd3, 0xaf, 0x30, 0x55, 0x11, 0x83, 0xda, 0x3f, 0x61, 0xc1, 0x43, 0xa9, 0x9e, 0x11, 0x2a,
- 0xb3, 0xfb, 0x3c, 0x0a, 0x49, 0x15, 0x56, 0xa1, 0xbb, 0x0a, 0xcb, 0xfe, 0xff, 0x2c, 0x38, 0xb6,
- 0xdc, 0x6c, 0x45, 0x7b, 0x4b, 0xae, 0x69, 0xae, 0x7f, 0x09, 0x06, 0x9a, 0xa4, 0xee, 0xb6, 0x9b,
- 0x62, 0xe4, 0x4a, 0xf2, 0xf8, 0x59, 0x63, 0xd0, 0x83, 0xfd, 0xd2, 0x58, 0x35, 0xf2, 0x03, 0x67,
- 0x8b, 0x70, 0x00, 0x16, 0xe4, 0xec, 0x10, 0x77, 0xef, 0x90, 0x55, 0xb7, 0xe9, 0x46, 0xf7, 0x36,
- 0xdb, 0x85, 0xa5, 0x5d, 0x32, 0xc1, 0x31, 0x3f, 0xfb, 0x1b, 0x16, 0x4c, 0xc8, 0x79, 0x3f, 0x5f,
- 0xaf, 0x07, 0x24, 0x0c, 0xd1, 0x2c, 0x14, 0xdc, 0x96, 0x68, 0x25, 0x88, 0x56, 0x16, 0xca, 0x15,
- 0x5c, 0x70, 0x5b, 0xf2, 0xbe, 0xc0, 0x4e, 0xb8, 0xa2, 0xe9, 0x74, 0x70, 0x59, 0xc0, 0xb1, 0xa2,
- 0x40, 0xe7, 0x61, 0xc8, 0xf3, 0xeb, 0x5c, 0xe4, 0x16, 0x46, 0x5c, 0x4a, 0xb9, 0x2e, 0x60, 0x58,
- 0x61, 0x51, 0x05, 0x86, 0xb9, 0x4b, 0x6a, 0x3c, 0x69, 0x7b, 0x72, 0x6c, 0x65, 0x5f, 0xb6, 0x21,
- 0x4b, 0xe2, 0x98, 0x89, 0xfd, 0xdb, 0x16, 0x8c, 0xca, 0x2f, 0xeb, 0xf1, 0x32, 0x44, 0x97, 0x56,
- 0x7c, 0x11, 0x8a, 0x97, 0x16, 0xbd, 0xcc, 0x30, 0x8c, 0x71, 0x87, 0x29, 0x1e, 0xea, 0x0e, 0x73,
- 0x11, 0x46, 0x9c, 0x56, 0xab, 0x62, 0x5e, 0x80, 0xd8, 0x54, 0x9a, 0x8f, 0xc1, 0x58, 0xa7, 0xb1,
- 0x7f, 0xbc, 0x00, 0xe3, 0xf2, 0x0b, 0xaa, 0xed, 0x9b, 0x21, 0x89, 0xd0, 0x06, 0x0c, 0x3b, 0x7c,
- 0x94, 0x88, 0x9c, 0xe4, 0x8f, 0x66, 0x2b, 0xe6, 0x8c, 0x21, 0x8d, 0x25, 0xb9, 0x79, 0x59, 0x1a,
- 0xc7, 0x8c, 0x50, 0x03, 0xa6, 0x3c, 0x3f, 0x62, 0xa7, 0xba, 0xc2, 0x77, 0xb2, 0x95, 0x26, 0xb9,
- 0x9f, 0x14, 0xdc, 0xa7, 0xd6, 0x93, 0x5c, 0x70, 0x9a, 0x31, 0x5a, 0x96, 0xca, 0xce, 0x62, 0xbe,
- 0x96, 0x4a, 0x1f, 0xb8, 0x6c, 0x5d, 0xa7, 0xfd, 0x1b, 0x16, 0x0c, 0x4b, 0xb2, 0xa3, 0x30, 0x8b,
- 0xaf, 0xc1, 0x60, 0xc8, 0x06, 0x41, 0x76, 0x8d, 0xdd, 0xa9, 0xe1, 0x7c, 0xbc, 0x62, 0x61, 0x85,
- 0xff, 0x0f, 0xb1, 0xe4, 0xc1, 0x6c, 0x5d, 0xaa, 0xf9, 0xef, 0x11, 0x5b, 0x97, 0x6a, 0x4f, 0xce,
- 0xa1, 0xf4, 0x97, 0xac, 0xcd, 0x9a, 0xf2, 0x98, 0xca, 0xd4, 0xad, 0x80, 0x6c, 0xba, 0xb7, 0x93,
- 0x32, 0x75, 0x85, 0x41, 0xb1, 0xc0, 0xa2, 0xb7, 0x61, 0xb4, 0x26, 0x8d, 0x1c, 0xf1, 0x0a, 0x3f,
- 0xd7, 0xd1, 0xe0, 0xa6, 0x6c, 0xb3, 0x5c, 0x49, 0xb7, 0xa8, 0x95, 0xc7, 0x06, 0x37, 0xd3, 0xe5,
- 0xaa, 0xd8, 0xcd, 0xe5, 0x2a, 0xe6, 0x9b, 0xef, 0x80, 0xf4, 0x93, 0x16, 0x0c, 0x70, 0xe5, 0x76,
- 0x6f, 0xb6, 0x05, 0xcd, 0x54, 0x1d, 0xf7, 0xdd, 0x75, 0x0a, 0x14, 0x92, 0x06, 0x5a, 0x83, 0x61,
- 0xf6, 0x83, 0x29, 0xe7, 0x8b, 0xf9, 0x0f, 0xb4, 0x78, 0xad, 0x7a, 0x03, 0xaf, 0xcb, 0x62, 0x38,
- 0xe6, 0x60, 0xff, 0x58, 0x91, 0xee, 0x6e, 0x31, 0xa9, 0x71, 0xe8, 0x5b, 0x0f, 0xee, 0xd0, 0x2f,
- 0x3c, 0xa8, 0x43, 0x7f, 0x0b, 0x26, 0x6a, 0x9a, 0x61, 0x3b, 0x1e, 0xc9, 0xf3, 0x1d, 0x27, 0x89,
- 0x66, 0x03, 0xe7, 0xea, 0xbf, 0x45, 0x93, 0x09, 0x4e, 0x72, 0x45, 0x9f, 0x80, 0x51, 0x3e, 0xce,
- 0xa2, 0x16, 0xee, 0xb5, 0xf6, 0x78, 0xfe, 0x7c, 0xd1, 0xab, 0xe0, 0xea, 0x62, 0xad, 0x38, 0x36,
- 0x98, 0xd9, 0x7f, 0x6b, 0x01, 0x5a, 0x6e, 0x6d, 0x93, 0x26, 0x09, 0x9c, 0x46, 0x6c, 0x9f, 0xfa,
- 0xa2, 0x05, 0x33, 0x24, 0x05, 0x5e, 0xf4, 0x9b, 0x4d, 0x71, 0x1b, 0xcd, 0x51, 0x98, 0x2c, 0xe7,
- 0x94, 0x51, 0x4f, 0xc6, 0x66, 0xf2, 0x28, 0x70, 0x6e, 0x7d, 0x68, 0x0d, 0xa6, 0xf9, 0x29, 0xa9,
- 0x10, 0x9a, 0x9b, 0xd8, 0xc3, 0x82, 0xf1, 0xf4, 0x46, 0x9a, 0x04, 0x67, 0x95, 0xb3, 0x7f, 0x63,
- 0x0c, 0x72, 0x5b, 0xf1, 0xbe, 0x61, 0xee, 0x7d, 0xc3, 0xdc, 0xfb, 0x86, 0xb9, 0xf7, 0x0d, 0x73,
- 0xef, 0x1b, 0xe6, 0xde, 0x37, 0xcc, 0xbd, 0x47, 0x0d, 0x73, 0xff, 0x9b, 0x05, 0xc7, 0xd5, 0xf1,
- 0x65, 0x5c, 0xd8, 0x3f, 0x0b, 0xd3, 0x7c, 0xb9, 0x19, 0xde, 0xde, 0xe2, 0xb8, 0xbe, 0x98, 0x39,
- 0x73, 0x13, 0xaf, 0x12, 0x8c, 0x82, 0xfc, 0x79, 0x57, 0x06, 0x02, 0x67, 0x55, 0x63, 0xff, 0xca,
- 0x10, 0xf4, 0x2f, 0xef, 0x12, 0x2f, 0x3a, 0x82, 0xab, 0x4d, 0x0d, 0xc6, 0x5d, 0x6f, 0xd7, 0x6f,
- 0xec, 0x92, 0x3a, 0xc7, 0x1f, 0xe6, 0x06, 0x7e, 0x42, 0xb0, 0x1e, 0x2f, 0x1b, 0x2c, 0x70, 0x82,
- 0xe5, 0x83, 0x30, 0x6f, 0x5c, 0x82, 0x01, 0x7e, 0xf8, 0x08, 0xdb, 0x46, 0xe6, 0x9e, 0xcd, 0x3a,
- 0x51, 0x1c, 0xa9, 0xb1, 0xe9, 0x85, 0x1f, 0x6e, 0xa2, 0x38, 0xfa, 0x0c, 0x8c, 0x6f, 0xba, 0x41,
- 0x18, 0x6d, 0xb8, 0x4d, 0x7a, 0x34, 0x34, 0x5b, 0xf7, 0x60, 0xce, 0x50, 0xfd, 0xb0, 0x62, 0x70,
- 0xc2, 0x09, 0xce, 0x68, 0x0b, 0xc6, 0x1a, 0x8e, 0x5e, 0xd5, 0xe0, 0xa1, 0xab, 0x52, 0xa7, 0xc3,
- 0xaa, 0xce, 0x08, 0x9b, 0x7c, 0xe9, 0x72, 0xaa, 0x31, 0x8d, 0xfc, 0x10, 0x53, 0x67, 0xa8, 0xe5,
- 0xc4, 0x55, 0xf1, 0x1c, 0x47, 0x05, 0x34, 0xe6, 0x29, 0x3f, 0x6c, 0x0a, 0x68, 0x9a, 0x3f, 0xfc,
- 0xa7, 0x61, 0x98, 0xd0, 0x2e, 0xa4, 0x8c, 0xc5, 0x01, 0x73, 0xa1, 0xb7, 0xb6, 0xae, 0xb9, 0xb5,
- 0xc0, 0x37, 0x0d, 0x49, 0xcb, 0x92, 0x13, 0x8e, 0x99, 0xa2, 0x45, 0x18, 0x08, 0x49, 0xe0, 0x2a,
- 0x65, 0x75, 0x87, 0x61, 0x64, 0x64, 0xfc, 0xfd, 0x20, 0xff, 0x8d, 0x45, 0x51, 0x3a, 0xbd, 0x1c,
- 0xa6, 0x8a, 0x65, 0x87, 0x81, 0x36, 0xbd, 0xe6, 0x19, 0x14, 0x0b, 0x2c, 0x7a, 0x03, 0x06, 0x03,
- 0xd2, 0x60, 0x96, 0xca, 0xb1, 0xde, 0x27, 0x39, 0x37, 0x7c, 0xf2, 0x72, 0x58, 0x32, 0x40, 0x57,
- 0x00, 0x05, 0x84, 0x0a, 0x78, 0xae, 0xb7, 0xa5, 0xfc, 0xc7, 0xc5, 0x46, 0xab, 0x04, 0x69, 0x1c,
- 0x53, 0xc8, 0xa7, 0xa3, 0x38, 0xa3, 0x18, 0xba, 0x04, 0x53, 0x0a, 0x5a, 0xf6, 0xc2, 0xc8, 0xa1,
- 0x1b, 0xdc, 0x04, 0xe3, 0xa5, 0xf4, 0x2b, 0x38, 0x49, 0x80, 0xd3, 0x65, 0xec, 0x9f, 0xb7, 0x80,
- 0xf7, 0xf3, 0x11, 0x68, 0x15, 0x5e, 0x37, 0xb5, 0x0a, 0x27, 0x73, 0x47, 0x2e, 0x47, 0xa3, 0xf0,
- 0xf3, 0x16, 0x8c, 0x68, 0x23, 0x1b, 0xcf, 0x59, 0xab, 0xc3, 0x9c, 0x6d, 0xc3, 0x24, 0x9d, 0xe9,
- 0x57, 0x6f, 0x86, 0x24, 0xd8, 0x25, 0x75, 0x36, 0x31, 0x0b, 0xf7, 0x36, 0x31, 0x95, 0xaf, 0xea,
- 0x6a, 0x82, 0x21, 0x4e, 0x55, 0x61, 0x7f, 0x5a, 0x36, 0x55, 0xb9, 0xf6, 0xd6, 0xd4, 0x98, 0x27,
- 0x5c, 0x7b, 0xd5, 0xa8, 0xe2, 0x98, 0x86, 0x2e, 0xb5, 0x6d, 0x3f, 0x8c, 0x92, 0xae, 0xbd, 0x97,
- 0xfd, 0x30, 0xc2, 0x0c, 0x63, 0x3f, 0x0f, 0xb0, 0x7c, 0x9b, 0xd4, 0xf8, 0x8c, 0xd5, 0x2f, 0x3d,
- 0x56, 0xfe, 0xa5, 0xc7, 0xfe, 0x23, 0x0b, 0xc6, 0x57, 0x16, 0x8d, 0x93, 0x6b, 0x0e, 0x80, 0xdf,
- 0xd4, 0x6e, 0xdc, 0x58, 0x97, 0xfe, 0x25, 0xdc, 0xc4, 0xae, 0xa0, 0x58, 0xa3, 0x40, 0x27, 0xa1,
- 0xd8, 0x68, 0x7b, 0x42, 0xed, 0x39, 0x48, 0x8f, 0xc7, 0xd5, 0xb6, 0x87, 0x29, 0x4c, 0x7b, 0x36,
- 0x56, 0xec, 0xf9, 0xd9, 0x58, 0xd7, 0xe8, 0x35, 0xa8, 0x04, 0xfd, 0xb7, 0x6e, 0xb9, 0x75, 0xfe,
- 0x28, 0x5f, 0xf8, 0xbe, 0xdc, 0xb8, 0x51, 0x5e, 0x0a, 0x31, 0x87, 0xdb, 0x5f, 0x2a, 0xc2, 0xec,
- 0x4a, 0x83, 0xdc, 0x7e, 0x97, 0x81, 0x09, 0x7a, 0x7d, 0xf4, 0x76, 0x38, 0x05, 0xd2, 0x61, 0x1f,
- 0x36, 0x76, 0xef, 0x8f, 0x4d, 0x18, 0xe4, 0x9e, 0xad, 0x32, 0x4c, 0x41, 0xa6, 0x3d, 0x31, 0xbf,
- 0x43, 0xe6, 0xb8, 0x87, 0xac, 0xb0, 0x27, 0xaa, 0x03, 0x53, 0x40, 0xb1, 0x64, 0x3e, 0xfb, 0x0a,
- 0x8c, 0xea, 0x94, 0x87, 0x7a, 0x62, 0xfc, 0xfd, 0x45, 0x98, 0xa4, 0x2d, 0x78, 0xa0, 0x03, 0x71,
- 0x2d, 0x3d, 0x10, 0xf7, 0xfb, 0x99, 0x69, 0xf7, 0xd1, 0x78, 0x3b, 0x39, 0x1a, 0x17, 0xf3, 0x46,
- 0xe3, 0xa8, 0xc7, 0xe0, 0x07, 0x2c, 0x98, 0x5e, 0x69, 0xf8, 0xb5, 0x9d, 0xc4, 0x53, 0xd0, 0x17,
- 0x61, 0x84, 0x6e, 0xc7, 0xa1, 0x11, 0x15, 0xc5, 0x88, 0x93, 0x23, 0x50, 0x58, 0xa7, 0xd3, 0x8a,
- 0x5d, 0xbb, 0x56, 0x5e, 0xca, 0x0a, 0xaf, 0x23, 0x50, 0x58, 0xa7, 0xb3, 0xff, 0xc0, 0x82, 0xd3,
- 0x97, 0x16, 0x97, 0xe3, 0xa9, 0x98, 0x8a, 0xf0, 0x73, 0x0e, 0x06, 0x5a, 0x75, 0xad, 0x29, 0xb1,
- 0x5a, 0x78, 0x89, 0xb5, 0x42, 0x60, 0xdf, 0x2b, 0xc1, 0xb4, 0xae, 0x01, 0x5c, 0xc2, 0x95, 0x45,
- 0xb1, 0xef, 0x4a, 0x2b, 0x90, 0x95, 0x6b, 0x05, 0x7a, 0x1c, 0x06, 0xe9, 0xb9, 0xe0, 0xd6, 0x64,
- 0xbb, 0xb9, 0xc7, 0x00, 0x07, 0x61, 0x89, 0xb3, 0x7f, 0xce, 0x82, 0xe9, 0x4b, 0x6e, 0x44, 0x0f,
- 0xed, 0x64, 0x08, 0x1b, 0x7a, 0x6a, 0x87, 0x6e, 0xe4, 0x07, 0x7b, 0xc9, 0x10, 0x36, 0x58, 0x61,
- 0xb0, 0x46, 0xc5, 0x3f, 0x68, 0xd7, 0x65, 0x4f, 0x35, 0x0a, 0xa6, 0xdd, 0x0d, 0x0b, 0x38, 0x56,
- 0x14, 0xb4, 0xbf, 0xea, 0x6e, 0xc0, 0x54, 0x96, 0x7b, 0x62, 0xe3, 0x56, 0xfd, 0xb5, 0x24, 0x11,
- 0x38, 0xa6, 0xb1, 0xff, 0xda, 0x82, 0xd2, 0x25, 0xfe, 0xe0, 0x74, 0x33, 0xcc, 0xd9, 0x74, 0x9f,
- 0x87, 0x61, 0x22, 0x0d, 0x04, 0xf2, 0xf1, 0xad, 0x14, 0x44, 0x95, 0xe5, 0x80, 0x47, 0xd2, 0x51,
- 0x74, 0x3d, 0xbc, 0x57, 0x3f, 0xdc, 0x83, 0xe3, 0x15, 0x40, 0x44, 0xaf, 0x4b, 0x0f, 0x2d, 0xc4,
- 0x62, 0x94, 0x2c, 0xa7, 0xb0, 0x38, 0xa3, 0x84, 0xfd, 0x13, 0x16, 0x1c, 0x57, 0x1f, 0xfc, 0x9e,
- 0xfb, 0x4c, 0xfb, 0x6b, 0x05, 0x18, 0xbb, 0xbc, 0xb1, 0x51, 0xb9, 0x44, 0x22, 0x6d, 0x56, 0x76,
- 0x36, 0xfb, 0x63, 0xcd, 0x7a, 0xd9, 0xe9, 0x8e, 0xd8, 0x8e, 0xdc, 0xc6, 0x1c, 0x0f, 0x98, 0x37,
- 0x57, 0xf6, 0xa2, 0xab, 0x41, 0x35, 0x0a, 0x5c, 0x6f, 0x2b, 0x73, 0xa6, 0x4b, 0x99, 0xa5, 0x98,
- 0x27, 0xb3, 0xa0, 0xe7, 0x61, 0x80, 0x45, 0xec, 0x93, 0x83, 0xf0, 0xb0, 0xba, 0x62, 0x31, 0xe8,
- 0xc1, 0x7e, 0x69, 0xf8, 0x1a, 0x2e, 0xf3, 0x3f, 0x58, 0x90, 0xa2, 0x6b, 0x30, 0xb2, 0x1d, 0x45,
- 0xad, 0xcb, 0xc4, 0xa9, 0x93, 0x40, 0xee, 0xb2, 0x67, 0xb2, 0x76, 0x59, 0xda, 0x09, 0x9c, 0x2c,
- 0xde, 0x98, 0x62, 0x58, 0x88, 0x75, 0x3e, 0x76, 0x15, 0x20, 0xc6, 0xdd, 0x27, 0xc3, 0x8d, 0xbd,
- 0x01, 0xc3, 0xf4, 0x73, 0xe7, 0x1b, 0xae, 0xd3, 0xd9, 0x34, 0xfe, 0x34, 0x0c, 0x4b, 0xc3, 0x77,
- 0x28, 0xe2, 0x69, 0xb0, 0x13, 0x49, 0xda, 0xc5, 0x43, 0x1c, 0xe3, 0xed, 0xc7, 0x40, 0x38, 0xaf,
- 0x76, 0x62, 0x69, 0x6f, 0xc2, 0x31, 0xe6, 0x85, 0xeb, 0x44, 0xdb, 0xc6, 0x1c, 0xed, 0x3e, 0x19,
- 0x9e, 0x11, 0xf7, 0x3a, 0xfe, 0x65, 0x33, 0xda, 0xeb, 0xe7, 0x51, 0xc9, 0x31, 0xbe, 0xe3, 0xd9,
- 0x7f, 0xd5, 0x07, 0x0f, 0x97, 0xab, 0xf9, 0x81, 0xa0, 0x5e, 0x86, 0x51, 0x2e, 0x2e, 0xd2, 0xa9,
- 0xe1, 0x34, 0x44, 0xbd, 0x4a, 0x03, 0xba, 0xa1, 0xe1, 0xb0, 0x41, 0x89, 0x4e, 0x43, 0xd1, 0x7d,
- 0xc7, 0x4b, 0xbe, 0x0d, 0x2c, 0xbf, 0xb9, 0x8e, 0x29, 0x9c, 0xa2, 0xa9, 0xe4, 0xc9, 0xb7, 0x74,
- 0x85, 0x56, 0xd2, 0xe7, 0xeb, 0x30, 0xee, 0x86, 0xb5, 0xd0, 0x2d, 0x7b, 0x74, 0x9d, 0x6a, 0x2b,
- 0x5d, 0xe9, 0x1c, 0x68, 0xa3, 0x15, 0x16, 0x27, 0xa8, 0xb5, 0xf3, 0xa5, 0xbf, 0x67, 0xe9, 0xb5,
- 0x6b, 0x18, 0x0a, 0xba, 0xfd, 0xb7, 0xd8, 0xd7, 0x85, 0x4c, 0x05, 0x2f, 0xb6, 0x7f, 0xfe, 0xc1,
- 0x21, 0x96, 0x38, 0x7a, 0xa1, 0xab, 0x6d, 0x3b, 0xad, 0xf9, 0x76, 0xb4, 0xbd, 0xe4, 0x86, 0x35,
- 0x7f, 0x97, 0x04, 0x7b, 0xec, 0x2e, 0x3e, 0x14, 0x5f, 0xe8, 0x14, 0x62, 0xf1, 0xf2, 0x7c, 0x85,
- 0x52, 0xe2, 0x74, 0x19, 0x34, 0x0f, 0x13, 0x12, 0x58, 0x25, 0x21, 0x3b, 0x02, 0x46, 0x18, 0x1b,
- 0xf5, 0x5a, 0x4f, 0x80, 0x15, 0x93, 0x24, 0xbd, 0x29, 0xe0, 0xc2, 0xfd, 0x10, 0x70, 0x5f, 0x82,
- 0x31, 0xd7, 0x73, 0x23, 0xd7, 0x89, 0x7c, 0x6e, 0x3f, 0xe2, 0xd7, 0x6e, 0xa6, 0x60, 0x2e, 0xeb,
- 0x08, 0x6c, 0xd2, 0xd9, 0xff, 0xa1, 0x0f, 0xa6, 0xd8, 0xb0, 0xbd, 0x3f, 0xc3, 0xbe, 0x93, 0x66,
- 0xd8, 0xb5, 0xf4, 0x0c, 0xbb, 0x1f, 0x92, 0xfb, 0x3d, 0x4f, 0xb3, 0xcf, 0xc0, 0xb0, 0x7a, 0xa0,
- 0x28, 0x5f, 0x28, 0x5b, 0x39, 0x2f, 0x94, 0xbb, 0x9f, 0xde, 0xd2, 0x25, 0xad, 0x98, 0xe9, 0x92,
- 0xf6, 0x15, 0x0b, 0x62, 0xc3, 0x02, 0x7a, 0x13, 0x86, 0x5b, 0x3e, 0x73, 0xa1, 0x0d, 0xa4, 0x5f,
- 0xfa, 0x63, 0x1d, 0x2d, 0x13, 0x3c, 0x16, 0x5e, 0xc0, 0x7b, 0xa1, 0x22, 0x8b, 0xe2, 0x98, 0x0b,
- 0xba, 0x02, 0x83, 0xad, 0x80, 0x54, 0x23, 0x16, 0xa8, 0xa9, 0x77, 0x86, 0x7c, 0xd6, 0xf0, 0x82,
- 0x58, 0x72, 0xb0, 0x7f, 0xb1, 0x00, 0x93, 0x49, 0x52, 0xf4, 0x1a, 0xf4, 0x91, 0xdb, 0xa4, 0x26,
- 0xda, 0x9b, 0x79, 0x14, 0xc7, 0xaa, 0x09, 0xde, 0x01, 0xf4, 0x3f, 0x66, 0xa5, 0xd0, 0x65, 0x18,
- 0xa4, 0xe7, 0xf0, 0x25, 0x15, 0x94, 0xf0, 0x91, 0xbc, 0xb3, 0x5c, 0x09, 0x34, 0xbc, 0x71, 0x02,
- 0x84, 0x65, 0x71, 0xe6, 0x07, 0x56, 0x6b, 0x55, 0xe9, 0x15, 0x27, 0xea, 0x74, 0x13, 0xdf, 0x58,
- 0xac, 0x70, 0x22, 0xc1, 0x8d, 0xfb, 0x81, 0x49, 0x20, 0x8e, 0x99, 0xa0, 0x8f, 0x42, 0x7f, 0xd8,
- 0x20, 0xa4, 0x25, 0x0c, 0xfd, 0x99, 0xca, 0xc5, 0x2a, 0x25, 0x10, 0x9c, 0x98, 0x32, 0x82, 0x01,
- 0x30, 0x2f, 0x68, 0xff, 0x92, 0x05, 0xc0, 0x1d, 0xe7, 0x1c, 0x6f, 0x8b, 0x1c, 0x81, 0x3e, 0x7e,
- 0x09, 0xfa, 0xc2, 0x16, 0xa9, 0x75, 0xf2, 0x0f, 0x8f, 0xdb, 0x53, 0x6d, 0x91, 0x5a, 0x3c, 0x67,
- 0xe9, 0x3f, 0xcc, 0x4a, 0xdb, 0x3f, 0x08, 0x30, 0x1e, 0x93, 0x95, 0x23, 0xd2, 0x44, 0xcf, 0x1a,
- 0x71, 0x51, 0x4e, 0x26, 0xe2, 0xa2, 0x0c, 0x33, 0x6a, 0x4d, 0xf5, 0xfb, 0x19, 0x28, 0x36, 0x9d,
- 0xdb, 0x42, 0xb7, 0xf7, 0x74, 0xe7, 0x66, 0x50, 0xfe, 0x73, 0x6b, 0xce, 0x6d, 0x7e, 0xfd, 0x7d,
- 0x5a, 0xae, 0xb1, 0x35, 0xe7, 0x76, 0x57, 0x1f, 0x66, 0x5a, 0x09, 0xab, 0xcb, 0xf5, 0x84, 0x4f,
- 0x58, 0x4f, 0x75, 0xb9, 0x5e, 0xb2, 0x2e, 0xd7, 0xeb, 0xa1, 0x2e, 0xd7, 0x43, 0x77, 0x60, 0x50,
- 0xb8, 0x6c, 0x8a, 0x10, 0x73, 0x17, 0x7a, 0xa8, 0x4f, 0x78, 0x7c, 0xf2, 0x3a, 0x2f, 0xc8, 0xeb,
- 0xbd, 0x80, 0x76, 0xad, 0x57, 0x56, 0x88, 0xfe, 0x77, 0x0b, 0xc6, 0xc5, 0x6f, 0x4c, 0xde, 0x69,
- 0x93, 0x30, 0x12, 0xe2, 0xef, 0x87, 0x7a, 0x6f, 0x83, 0x28, 0xc8, 0x9b, 0xf2, 0x21, 0x79, 0x52,
- 0x99, 0xc8, 0xae, 0x2d, 0x4a, 0xb4, 0x02, 0xfd, 0xa2, 0x05, 0xc7, 0x9a, 0xce, 0x6d, 0x5e, 0x23,
- 0x87, 0x61, 0x27, 0x72, 0x7d, 0xe1, 0xfa, 0xf0, 0x5a, 0x6f, 0xc3, 0x9f, 0x2a, 0xce, 0x1b, 0x29,
- 0xed, 0x9c, 0xc7, 0xb2, 0x48, 0xba, 0x36, 0x35, 0xb3, 0x5d, 0xb3, 0x9b, 0x30, 0x24, 0xe7, 0xdb,
- 0x83, 0xf4, 0x0f, 0x67, 0xf5, 0x88, 0xb9, 0xf6, 0x40, 0xeb, 0xf9, 0x0c, 0x8c, 0xea, 0x73, 0xec,
- 0x81, 0xd6, 0xf5, 0x0e, 0x4c, 0x67, 0xcc, 0xa5, 0x07, 0x5a, 0xe5, 0x2d, 0x38, 0x99, 0x3b, 0x3f,
- 0x1e, 0xa8, 0x7f, 0xff, 0xd7, 0x2c, 0x7d, 0x1f, 0x3c, 0x02, 0xa3, 0xc8, 0xa2, 0x69, 0x14, 0x39,
- 0xd3, 0x79, 0xe5, 0xe4, 0x58, 0x46, 0xde, 0xd6, 0x1b, 0x4d, 0x77, 0x75, 0xf4, 0x06, 0x0c, 0x34,
- 0x28, 0x44, 0x3a, 0xfe, 0xda, 0xdd, 0x57, 0x64, 0x2c, 0x8e, 0x32, 0x78, 0x88, 0x05, 0x07, 0xfb,
- 0x57, 0x2d, 0xe8, 0x3b, 0x82, 0x9e, 0xc0, 0x66, 0x4f, 0x3c, 0x9b, 0xcb, 0x5a, 0x04, 0xff, 0x9f,
- 0xc3, 0xce, 0xad, 0xe5, 0xdb, 0x11, 0xf1, 0x42, 0x76, 0xa6, 0x67, 0x76, 0xcc, 0xbe, 0x05, 0xd3,
- 0xab, 0xbe, 0x53, 0x5f, 0x70, 0x1a, 0x8e, 0x57, 0x23, 0x41, 0xd9, 0xdb, 0x3a, 0x94, 0xd7, 0x7a,
- 0xa1, 0xab, 0xd7, 0xfa, 0xcb, 0x30, 0xe0, 0xb6, 0xb4, 0xe8, 0xe1, 0x67, 0x69, 0x07, 0x96, 0x2b,
- 0x22, 0x70, 0x38, 0x32, 0x2a, 0x67, 0x50, 0x2c, 0xe8, 0xe9, 0xc8, 0x73, 0x77, 0xb1, 0xbe, 0xfc,
- 0x91, 0xa7, 0x52, 0x7c, 0x32, 0xc6, 0x94, 0xe1, 0xd8, 0xbc, 0x0d, 0x46, 0x15, 0xe2, 0x59, 0x19,
- 0x86, 0x41, 0x97, 0x7f, 0xa9, 0x18, 0xfe, 0x27, 0xb2, 0xa5, 0xeb, 0x54, 0xc7, 0x68, 0x0f, 0xa6,
- 0x38, 0x00, 0x4b, 0x46, 0xf6, 0xcb, 0x90, 0x19, 0x13, 0xa4, 0xbb, 0xe6, 0xc4, 0xfe, 0x38, 0x4c,
- 0xb1, 0x92, 0x87, 0xd4, 0x4a, 0xd8, 0x09, 0x7d, 0x6f, 0x46, 0x20, 0x58, 0xfb, 0xdf, 0x5a, 0x80,
- 0xd6, 0xfc, 0xba, 0xbb, 0xb9, 0x27, 0x98, 0xf3, 0xef, 0x7f, 0x07, 0x4a, 0xfc, 0xda, 0x97, 0x0c,
- 0x96, 0xba, 0xd8, 0x70, 0xc2, 0x50, 0xd3, 0x35, 0x3f, 0x21, 0xea, 0x2d, 0x6d, 0x74, 0x26, 0xc7,
- 0xdd, 0xf8, 0xa1, 0x37, 0x13, 0x91, 0xe0, 0x3e, 0x9c, 0x8a, 0x04, 0xf7, 0x44, 0xa6, 0xc7, 0x47,
- 0xba, 0xf5, 0x32, 0x42, 0x9c, 0xfd, 0x05, 0x0b, 0x26, 0xd6, 0x13, 0xc1, 0x3f, 0xcf, 0x31, 0xf3,
- 0x77, 0x86, 0x0d, 0xa5, 0xca, 0xa0, 0x58, 0x60, 0xef, 0xbb, 0x8e, 0xf1, 0x1f, 0x2c, 0x88, 0x63,
- 0x10, 0x1d, 0x81, 0x54, 0xbb, 0x68, 0x48, 0xb5, 0x99, 0x37, 0x04, 0xd5, 0x9c, 0x3c, 0xa1, 0x16,
- 0x5d, 0x51, 0x63, 0xd2, 0xe1, 0x72, 0x10, 0xb3, 0xe1, 0xeb, 0x6c, 0xdc, 0x1c, 0x38, 0x35, 0x1a,
- 0x7f, 0x52, 0x00, 0xa4, 0x68, 0x7b, 0x8e, 0x1e, 0x98, 0x2e, 0x71, 0x7f, 0xa2, 0x07, 0xee, 0x02,
- 0x62, 0x0e, 0x1c, 0x81, 0xe3, 0x85, 0x9c, 0xad, 0x2b, 0xb4, 0xaa, 0x87, 0xf3, 0x0e, 0x99, 0x95,
- 0xcf, 0x09, 0x57, 0x53, 0xdc, 0x70, 0x46, 0x0d, 0x9a, 0x63, 0x4e, 0x7f, 0xaf, 0x8e, 0x39, 0x03,
- 0x5d, 0xde, 0xc5, 0x7e, 0xd5, 0x82, 0x31, 0xd5, 0x4d, 0xef, 0x91, 0xc7, 0x0d, 0xaa, 0x3d, 0x39,
- 0xe7, 0x4a, 0x45, 0x6b, 0x32, 0x3b, 0x6f, 0xbf, 0x8b, 0xbd, 0x6f, 0x76, 0x1a, 0xee, 0x1d, 0xa2,
- 0xc2, 0xf2, 0x96, 0xc4, 0x7b, 0x65, 0x01, 0x3d, 0xd8, 0x2f, 0x8d, 0xa9, 0x7f, 0x3c, 0xac, 0x66,
- 0x5c, 0xc4, 0xfe, 0x69, 0xba, 0xd8, 0xcd, 0xa9, 0x88, 0x5e, 0x84, 0xfe, 0xd6, 0xb6, 0x13, 0x92,
- 0xc4, 0x23, 0xb0, 0xfe, 0x0a, 0x05, 0x1e, 0xec, 0x97, 0xc6, 0x55, 0x01, 0x06, 0xc1, 0x9c, 0xba,
- 0xf7, 0x98, 0x8c, 0xe9, 0xc9, 0xd9, 0x35, 0x26, 0xe3, 0xdf, 0x5a, 0xd0, 0xb7, 0x4e, 0x4f, 0xaf,
- 0x07, 0xbf, 0x05, 0xbc, 0x6e, 0x6c, 0x01, 0xa7, 0xf2, 0x12, 0xd4, 0xe4, 0xae, 0xfe, 0x95, 0xc4,
- 0xea, 0x3f, 0x93, 0xcb, 0xa1, 0xf3, 0xc2, 0x6f, 0xc2, 0x08, 0x4b, 0x7b, 0x23, 0x1e, 0xbc, 0x3d,
- 0x6f, 0x2c, 0xf8, 0x52, 0x62, 0xc1, 0x4f, 0x68, 0xa4, 0xda, 0x4a, 0x7f, 0x12, 0x06, 0xc5, 0x0b,
- 0xaa, 0xe4, 0x33, 0x71, 0x41, 0x8b, 0x25, 0xde, 0xfe, 0xc9, 0x22, 0x18, 0x69, 0x76, 0xd0, 0x6f,
- 0x58, 0x30, 0x17, 0x70, 0xcf, 0xea, 0xfa, 0x52, 0x3b, 0x70, 0xbd, 0xad, 0x6a, 0x6d, 0x9b, 0xd4,
- 0xdb, 0x0d, 0xd7, 0xdb, 0x2a, 0x6f, 0x79, 0xbe, 0x02, 0x2f, 0xdf, 0x26, 0xb5, 0x36, 0xb3, 0x7a,
- 0x76, 0xc9, 0xe9, 0xa3, 0x5e, 0x28, 0x3c, 0x77, 0x77, 0xbf, 0x34, 0x87, 0x0f, 0xc5, 0x1b, 0x1f,
- 0xb2, 0x2d, 0xe8, 0x0f, 0x2c, 0xb8, 0xc0, 0xd3, 0xbd, 0xf4, 0xde, 0xfe, 0x0e, 0x4a, 0x84, 0x8a,
- 0x64, 0x15, 0x33, 0xd9, 0x20, 0x41, 0x73, 0xe1, 0x25, 0xd1, 0xa1, 0x17, 0x2a, 0x87, 0xab, 0x0b,
- 0x1f, 0xb6, 0x71, 0xf6, 0x3f, 0x2d, 0xc2, 0x98, 0x88, 0xdd, 0x27, 0xce, 0x80, 0x17, 0x8d, 0x29,
- 0xf1, 0x48, 0x62, 0x4a, 0x4c, 0x19, 0xc4, 0xf7, 0x67, 0xfb, 0x0f, 0x61, 0x8a, 0x6e, 0xce, 0x97,
- 0x89, 0x13, 0x44, 0x37, 0x89, 0xc3, 0xfd, 0xed, 0x8a, 0x87, 0xde, 0xfd, 0x95, 0xe2, 0x77, 0x35,
- 0xc9, 0x0c, 0xa7, 0xf9, 0x7f, 0x27, 0x9d, 0x39, 0x1e, 0x4c, 0xa6, 0xc2, 0x2f, 0xbe, 0x05, 0xc3,
- 0xea, 0xf9, 0x8f, 0xd8, 0x74, 0x3a, 0x47, 0x31, 0x4d, 0x72, 0xe0, 0x7a, 0xc5, 0xf8, 0xe9, 0x59,
- 0xcc, 0xce, 0xfe, 0x47, 0x05, 0xa3, 0x42, 0x3e, 0x88, 0xeb, 0x30, 0xe4, 0x84, 0x2c, 0xb2, 0x72,
- 0xbd, 0x93, 0xea, 0x37, 0x55, 0x0d, 0x7b, 0x82, 0x35, 0x2f, 0x4a, 0x62, 0xc5, 0x03, 0x5d, 0xe6,
- 0x5e, 0x8d, 0xbb, 0xa4, 0x93, 0xde, 0x37, 0xc5, 0x0d, 0xa4, 0xdf, 0xe3, 0x2e, 0xc1, 0xa2, 0x3c,
- 0xfa, 0x24, 0x77, 0x3b, 0xbd, 0xe2, 0xf9, 0xb7, 0xbc, 0x4b, 0xbe, 0x2f, 0xe3, 0xb4, 0xf4, 0xc6,
- 0x70, 0x4a, 0x3a, 0x9b, 0xaa, 0xe2, 0xd8, 0xe4, 0xd6, 0x5b, 0x3c, 0xe3, 0xcf, 0x02, 0x4b, 0x6f,
- 0x61, 0xbe, 0xb6, 0x0f, 0x11, 0x81, 0x09, 0x11, 0x18, 0x52, 0xc2, 0x44, 0xdf, 0x65, 0xde, 0x70,
- 0xcd, 0xd2, 0xb1, 0x85, 0xe2, 0x8a, 0xc9, 0x02, 0x27, 0x79, 0xda, 0x3f, 0x6b, 0x01, 0x7b, 0x79,
- 0x7c, 0x04, 0xf2, 0xc8, 0x47, 0x4c, 0x79, 0x64, 0x26, 0xaf, 0x93, 0x73, 0x44, 0x91, 0x17, 0xf8,
- 0xcc, 0xaa, 0x04, 0xfe, 0xed, 0x3d, 0xe1, 0x2b, 0xd4, 0xfd, 0x72, 0x65, 0x7f, 0xc9, 0x02, 0x96,
- 0xa1, 0x05, 0xf3, 0xbb, 0xb4, 0xd4, 0xec, 0x77, 0x37, 0x83, 0x7f, 0x0c, 0x86, 0x36, 0x89, 0x13,
- 0xb5, 0x03, 0x11, 0x67, 0xca, 0xec, 0x0b, 0xa3, 0xc1, 0x26, 0xef, 0x15, 0x51, 0x4a, 0xbc, 0x20,
- 0x14, 0xff, 0xb0, 0xe2, 0x66, 0x87, 0x30, 0x9b, 0x5f, 0x0a, 0x5d, 0x83, 0x87, 0x02, 0x52, 0x6b,
- 0x07, 0x21, 0x9d, 0xa7, 0xe2, 0x56, 0x22, 0xde, 0xe0, 0x58, 0xec, 0xf6, 0xf2, 0xf0, 0xdd, 0xfd,
- 0xd2, 0x43, 0x38, 0x9b, 0x04, 0xe7, 0x95, 0xb5, 0xbf, 0x87, 0x1f, 0xb6, 0x2a, 0x34, 0x6e, 0x13,
- 0xa6, 0x3c, 0xed, 0x3f, 0x3d, 0x5a, 0xe4, 0x1d, 0xfa, 0xb1, 0x6e, 0xc7, 0x29, 0x3b, 0x87, 0xb4,
- 0xe7, 0xcd, 0x09, 0x36, 0x38, 0xcd, 0xd9, 0xfe, 0x29, 0x0b, 0x1e, 0xd2, 0x09, 0xb5, 0x17, 0x54,
- 0xdd, 0xec, 0x50, 0x4b, 0x30, 0xe4, 0xb7, 0x48, 0xe0, 0x44, 0x7e, 0x20, 0xce, 0x8f, 0xf3, 0x72,
- 0x92, 0x5d, 0x15, 0xf0, 0x03, 0x91, 0x5c, 0x44, 0x72, 0x97, 0x70, 0xac, 0x4a, 0xd2, 0x4b, 0x36,
- 0x53, 0x7e, 0x85, 0xe2, 0xad, 0x1c, 0xdb, 0x0d, 0x98, 0x4b, 0x43, 0x88, 0x05, 0xc6, 0xfe, 0x2b,
- 0x8b, 0x4f, 0x31, 0xbd, 0xe9, 0xe8, 0x1d, 0x98, 0x6c, 0x3a, 0x51, 0x6d, 0x7b, 0xf9, 0x76, 0x2b,
- 0xe0, 0x56, 0x3d, 0xd9, 0x4f, 0x4f, 0x77, 0xeb, 0x27, 0xed, 0x23, 0x63, 0x9f, 0xda, 0xb5, 0x04,
- 0x33, 0x9c, 0x62, 0x8f, 0x6e, 0xc2, 0x08, 0x83, 0xb1, 0x67, 0xa0, 0x61, 0x27, 0x21, 0x21, 0xaf,
- 0x36, 0xe5, 0x15, 0xb2, 0x16, 0xf3, 0xc1, 0x3a, 0x53, 0xfb, 0x2b, 0x45, 0xbe, 0xee, 0x99, 0x50,
- 0xff, 0x24, 0x0c, 0xb6, 0xfc, 0xfa, 0x62, 0x79, 0x09, 0x8b, 0x51, 0x50, 0x07, 0x4a, 0x85, 0x83,
- 0xb1, 0xc4, 0xa3, 0xf3, 0x30, 0x24, 0x7e, 0x4a, 0x2b, 0x2c, 0x9b, 0xe6, 0x82, 0x2e, 0xc4, 0x0a,
- 0x8b, 0x9e, 0x03, 0x68, 0x05, 0xfe, 0xae, 0x5b, 0x67, 0x71, 0x67, 0x8a, 0xa6, 0x43, 0x57, 0x45,
- 0x61, 0xb0, 0x46, 0x85, 0x5e, 0x85, 0xb1, 0xb6, 0x17, 0x72, 0xc1, 0x44, 0x8b, 0xee, 0xad, 0x5c,
- 0x8d, 0xae, 0xe9, 0x48, 0x6c, 0xd2, 0xa2, 0x79, 0x18, 0x88, 0x1c, 0xe6, 0xa0, 0xd4, 0x9f, 0xef,
- 0x77, 0xbd, 0x41, 0x29, 0xf4, 0xcc, 0x5f, 0xb4, 0x00, 0x16, 0x05, 0xd1, 0x5b, 0xf2, 0x45, 0x36,
- 0xdf, 0xe2, 0xc5, 0x83, 0x87, 0xde, 0x8e, 0x03, 0xed, 0x3d, 0xb6, 0x78, 0x48, 0x61, 0xf0, 0x42,
- 0xaf, 0x00, 0x90, 0xdb, 0x11, 0x09, 0x3c, 0xa7, 0xa1, 0xdc, 0x0a, 0x95, 0x84, 0xb0, 0xe4, 0xaf,
- 0xfb, 0xd1, 0xb5, 0x90, 0x2c, 0x2b, 0x0a, 0xac, 0x51, 0xdb, 0xbf, 0x06, 0x00, 0xb1, 0x04, 0x8f,
- 0xee, 0xc0, 0x50, 0xcd, 0x69, 0x39, 0x35, 0x9e, 0xd6, 0xb2, 0x98, 0xf7, 0x50, 0x36, 0x2e, 0x31,
- 0xb7, 0x28, 0xc8, 0xb9, 0xe1, 0x41, 0x06, 0x48, 0x1e, 0x92, 0xe0, 0xae, 0xc6, 0x06, 0x55, 0x1f,
- 0xfa, 0xbc, 0x05, 0x23, 0x22, 0xbc, 0x0e, 0x1b, 0xa1, 0x42, 0xbe, 0xad, 0x48, 0xab, 0x7f, 0x3e,
- 0x2e, 0xc1, 0x9b, 0xf0, 0xbc, 0x9c, 0xa1, 0x1a, 0xa6, 0x6b, 0x2b, 0xf4, 0x8a, 0xd1, 0x07, 0xe5,
- 0xa5, 0xb1, 0x68, 0x74, 0xa5, 0xba, 0x34, 0x0e, 0xb3, 0xd3, 0x42, 0xbf, 0x2f, 0x5e, 0x33, 0xee,
- 0x8b, 0x7d, 0xf9, 0x4f, 0x4e, 0x0d, 0x41, 0xb6, 0xdb, 0x55, 0x11, 0x55, 0xf4, 0xf0, 0x13, 0xfd,
- 0xf9, 0xef, 0x24, 0xb5, 0x1b, 0x53, 0x97, 0xd0, 0x13, 0x9f, 0x81, 0x89, 0xba, 0x29, 0x0e, 0x88,
- 0x99, 0xf8, 0x44, 0x1e, 0xdf, 0x84, 0xf4, 0x10, 0x0b, 0x00, 0x09, 0x04, 0x4e, 0x32, 0x46, 0x15,
- 0x1e, 0x8d, 0xa4, 0xec, 0x6d, 0xfa, 0xe2, 0xd1, 0x8d, 0x9d, 0x3b, 0x96, 0x7b, 0x61, 0x44, 0x9a,
- 0x94, 0x32, 0x3e, 0xe7, 0xd7, 0x45, 0x59, 0xac, 0xb8, 0xa0, 0x37, 0x60, 0x80, 0x3d, 0x94, 0x0b,
- 0x67, 0x86, 0xf2, 0x55, 0xf2, 0x66, 0xdc, 0xc7, 0x78, 0x41, 0xb2, 0xbf, 0x21, 0x16, 0x1c, 0xd0,
- 0x65, 0xf9, 0x0c, 0x35, 0x2c, 0x7b, 0xd7, 0x42, 0xc2, 0x9e, 0xa1, 0x0e, 0x2f, 0x3c, 0x16, 0xbf,
- 0x30, 0xe5, 0xf0, 0xcc, 0xfc, 0xa0, 0x46, 0x49, 0x2a, 0x4f, 0x89, 0xff, 0x32, 0xed, 0xa8, 0x88,
- 0x52, 0x95, 0xd9, 0x3c, 0x33, 0x35, 0x69, 0xdc, 0x9d, 0xd7, 0x4d, 0x16, 0x38, 0xc9, 0x93, 0xca,
- 0xa6, 0x7c, 0xd5, 0x8b, 0x67, 0x3b, 0xdd, 0xf6, 0x0e, 0x7e, 0x25, 0x67, 0xa7, 0x11, 0x87, 0x60,
- 0x51, 0x1e, 0xb9, 0x30, 0x11, 0x18, 0x22, 0x82, 0x0c, 0x2e, 0x75, 0xae, 0x37, 0x39, 0x44, 0x0b,
- 0x5b, 0x6e, 0xb2, 0xc1, 0x49, 0xbe, 0xb3, 0x3b, 0x30, 0x66, 0x6c, 0x10, 0x0f, 0xd4, 0xe4, 0xe5,
- 0xc1, 0x64, 0x72, 0x37, 0x78, 0xa0, 0x96, 0xae, 0xbf, 0xe8, 0x83, 0x71, 0x73, 0xf6, 0xa2, 0x0b,
- 0x30, 0x2c, 0x98, 0xa8, 0x2c, 0x41, 0x6a, 0x41, 0xae, 0x49, 0x04, 0x8e, 0x69, 0x58, 0x72, 0x28,
- 0x56, 0x5c, 0x73, 0x09, 0x8f, 0x93, 0x43, 0x29, 0x0c, 0xd6, 0xa8, 0xe8, 0x6d, 0xee, 0xa6, 0xef,
- 0x47, 0xea, 0xec, 0x53, 0x53, 0x7c, 0x81, 0x41, 0xb1, 0xc0, 0xd2, 0x33, 0x6f, 0x87, 0x04, 0x1e,
- 0x69, 0x98, 0x41, 0xe7, 0xd5, 0x99, 0x77, 0x45, 0x47, 0x62, 0x93, 0x96, 0x9e, 0xdc, 0x7e, 0xc8,
- 0xd6, 0x8c, 0xb8, 0x33, 0xc6, 0x2e, 0xf6, 0x55, 0x1e, 0x2c, 0x40, 0xe2, 0xd1, 0xc7, 0xe1, 0x21,
- 0x15, 0xe0, 0x4d, 0xcc, 0x08, 0x59, 0xe3, 0x80, 0xa1, 0xe2, 0x79, 0x68, 0x31, 0x9b, 0x0c, 0xe7,
- 0x95, 0x47, 0xaf, 0xc3, 0xb8, 0xb8, 0x57, 0x48, 0x8e, 0x83, 0xa6, 0xbf, 0xd8, 0x15, 0x03, 0x8b,
- 0x13, 0xd4, 0x32, 0x6c, 0x3e, 0x13, 0xed, 0x25, 0x87, 0xa1, 0x74, 0xd8, 0x7c, 0x1d, 0x8f, 0x53,
- 0x25, 0xd0, 0x3c, 0x4c, 0x70, 0x71, 0xcf, 0xf5, 0xb6, 0xf8, 0x98, 0x88, 0x07, 0x7c, 0x6a, 0x21,
- 0x5c, 0x35, 0xd1, 0x38, 0x49, 0x8f, 0x5e, 0x86, 0x51, 0x27, 0xa8, 0x6d, 0xbb, 0x11, 0xa9, 0x51,
- 0x69, 0x9c, 0xb9, 0x6c, 0x69, 0x0e, 0x77, 0xf3, 0x1a, 0x0e, 0x1b, 0x94, 0xf6, 0x1d, 0x98, 0xce,
- 0x88, 0x22, 0x42, 0x27, 0x8e, 0xd3, 0x72, 0xe5, 0x37, 0x25, 0xbc, 0xda, 0xe7, 0x2b, 0x65, 0xf9,
- 0x35, 0x1a, 0x15, 0x9d, 0x9d, 0x2c, 0xda, 0x88, 0x96, 0xd0, 0x58, 0xcd, 0xce, 0x15, 0x89, 0xc0,
- 0x31, 0x8d, 0xfd, 0x77, 0x05, 0x98, 0xc8, 0xb0, 0x56, 0xb1, 0xa4, 0xba, 0x89, 0x0b, 0x4e, 0x9c,
- 0x43, 0xd7, 0xcc, 0xc2, 0x50, 0x38, 0x44, 0x16, 0x86, 0x62, 0xb7, 0x2c, 0x0c, 0x7d, 0xef, 0x26,
- 0x0b, 0x83, 0xd9, 0x63, 0xfd, 0x3d, 0xf5, 0x58, 0x46, 0xe6, 0x86, 0x81, 0x43, 0x66, 0x6e, 0x30,
- 0x3a, 0x7d, 0xb0, 0x87, 0x4e, 0xff, 0xb1, 0x02, 0x4c, 0x26, 0x0d, 0x5d, 0x47, 0xa0, 0x2c, 0x7e,
- 0xc3, 0x50, 0x16, 0x9f, 0xef, 0xe5, 0xc1, 0x75, 0xae, 0xe2, 0x18, 0x27, 0x14, 0xc7, 0x4f, 0xf5,
- 0xc4, 0xad, 0xb3, 0x12, 0xf9, 0xff, 0x2e, 0xc0, 0xf1, 0x4c, 0xfb, 0xdf, 0x11, 0xf4, 0xcd, 0x55,
- 0xa3, 0x6f, 0x9e, 0xed, 0xf9, 0x31, 0x7a, 0x6e, 0x07, 0xdd, 0x48, 0x74, 0xd0, 0x85, 0xde, 0x59,
- 0x76, 0xee, 0xa5, 0x6f, 0x14, 0xe1, 0x4c, 0x66, 0xb9, 0x58, 0xd7, 0xba, 0x62, 0xe8, 0x5a, 0x9f,
- 0x4b, 0xe8, 0x5a, 0xed, 0xce, 0xa5, 0xef, 0x8f, 0xf2, 0x55, 0x3c, 0xca, 0x66, 0xa1, 0x25, 0xee,
- 0x51, 0xf1, 0x6a, 0x3c, 0xca, 0x56, 0x8c, 0xb0, 0xc9, 0xf7, 0x3b, 0x49, 0xe1, 0xfa, 0xfb, 0x16,
- 0x9c, 0xcc, 0x1c, 0x9b, 0x23, 0x50, 0xb0, 0xad, 0x9b, 0x0a, 0xb6, 0x27, 0x7b, 0x9e, 0xad, 0x39,
- 0x1a, 0xb7, 0x2f, 0x0c, 0xe4, 0x7c, 0x0b, 0x53, 0x1a, 0x5c, 0x85, 0x11, 0xa7, 0x56, 0x23, 0x61,
- 0xb8, 0xe6, 0xd7, 0x55, 0xc0, 0xf6, 0x67, 0xd9, 0x95, 0x2e, 0x06, 0x1f, 0xec, 0x97, 0x66, 0x93,
- 0x2c, 0x62, 0x34, 0xd6, 0x39, 0xa0, 0x4f, 0xc2, 0x50, 0x28, 0x73, 0xed, 0xf5, 0xdd, 0x7b, 0xae,
- 0x3d, 0xa6, 0x8f, 0x50, 0x4a, 0x11, 0xc5, 0x12, 0x7d, 0xb7, 0x1e, 0xe4, 0xa7, 0x83, 0x46, 0x8f,
- 0x37, 0xf2, 0x1e, 0x42, 0xfd, 0x3c, 0x07, 0xb0, 0xab, 0x6e, 0x1f, 0x49, 0x85, 0x87, 0x76, 0x2f,
- 0xd1, 0xa8, 0xd0, 0x47, 0x61, 0x32, 0xe4, 0xf1, 0x2d, 0x63, 0x8f, 0x0d, 0x3e, 0x17, 0x59, 0x88,
- 0xb0, 0x6a, 0x02, 0x87, 0x53, 0xd4, 0x68, 0x45, 0xd6, 0xca, 0x7c, 0x73, 0xf8, 0xf4, 0x3c, 0x17,
- 0xd7, 0x28, 0xfc, 0x73, 0x8e, 0x25, 0x07, 0x81, 0x75, 0xbf, 0x56, 0x12, 0x7d, 0x12, 0x80, 0x4e,
- 0x22, 0xa1, 0xf8, 0x18, 0xcc, 0xdf, 0x42, 0xe9, 0xde, 0x52, 0xcf, 0x74, 0x58, 0x67, 0xaf, 0xa9,
- 0x97, 0x14, 0x13, 0xac, 0x31, 0x44, 0x0e, 0x8c, 0xc5, 0xff, 0xe2, 0xbc, 0xd7, 0xe7, 0x73, 0x6b,
- 0x48, 0x32, 0x67, 0xda, 0xf6, 0x25, 0x9d, 0x05, 0x36, 0x39, 0xa2, 0x4f, 0xc0, 0xc9, 0xdd, 0x5c,
- 0x37, 0x98, 0xe1, 0x38, 0x95, 0x65, 0xbe, 0xf3, 0x4b, 0x7e, 0x79, 0xfb, 0x5f, 0x02, 0x3c, 0xdc,
- 0x61, 0xa7, 0x47, 0xf3, 0xa6, 0x09, 0xfb, 0xe9, 0xa4, 0x36, 0x62, 0x36, 0xb3, 0xb0, 0xa1, 0x9e,
- 0x48, 0x2c, 0xa8, 0xc2, 0xbb, 0x5e, 0x50, 0x3f, 0x62, 0x69, 0x7a, 0x22, 0xee, 0x43, 0xfc, 0x91,
- 0x43, 0x9e, 0x60, 0xf7, 0x51, 0x71, 0xb4, 0x99, 0xa1, 0x7d, 0x79, 0xae, 0xe7, 0xe6, 0xf4, 0xae,
- 0x8e, 0xf9, 0x5a, 0x76, 0x48, 0x6a, 0xae, 0x98, 0xb9, 0x74, 0xd8, 0xef, 0x3f, 0xaa, 0xf0, 0xd4,
- 0x7f, 0x62, 0xc1, 0xc9, 0x14, 0x98, 0xb7, 0x81, 0x84, 0x22, 0xa8, 0xd9, 0xfa, 0xbb, 0x6e, 0xbc,
- 0x64, 0xc8, 0xbf, 0xe1, 0xb2, 0xf8, 0x86, 0x93, 0xb9, 0x74, 0xc9, 0xa6, 0x7f, 0xf1, 0xcf, 0x4b,
- 0xd3, 0xac, 0x02, 0x93, 0x10, 0xe7, 0x37, 0x1d, 0xb5, 0xe0, 0x6c, 0xad, 0x1d, 0x04, 0xf1, 0x64,
- 0xcd, 0x58, 0x9c, 0xfc, 0xae, 0xf7, 0xd8, 0xdd, 0xfd, 0xd2, 0xd9, 0xc5, 0x2e, 0xb4, 0xb8, 0x2b,
- 0x37, 0xe4, 0x01, 0x6a, 0xa6, 0x9c, 0xcd, 0x44, 0xba, 0xfb, 0x4c, 0xdd, 0x49, 0xda, 0x35, 0x8d,
- 0xbf, 0x9a, 0xcd, 0x70, 0x59, 0xcb, 0xe0, 0x7c, 0xb4, 0xda, 0x93, 0x6f, 0x4d, 0x38, 0xf0, 0xd9,
- 0x55, 0x38, 0xd3, 0x79, 0x32, 0x1d, 0xea, 0xc5, 0xfe, 0x1f, 0x59, 0x70, 0xba, 0x63, 0x58, 0xa8,
- 0x6f, 0xc3, 0xcb, 0x82, 0xfd, 0x39, 0x0b, 0x1e, 0xc9, 0x2c, 0x61, 0xf8, 0x35, 0x5e, 0x80, 0xe1,
- 0x5a, 0x22, 0x59, 0x73, 0x1c, 0x20, 0x45, 0x25, 0x6a, 0x8e, 0x69, 0x0c, 0xf7, 0xc5, 0x42, 0x57,
- 0xf7, 0xc5, 0xdf, 0xb6, 0x20, 0x75, 0xd4, 0x1f, 0x81, 0xe4, 0x59, 0x36, 0x25, 0xcf, 0xc7, 0x7a,
- 0xe9, 0xcd, 0x1c, 0xa1, 0xf3, 0x6f, 0x26, 0xe0, 0x44, 0xce, 0x83, 0xdb, 0x5d, 0x98, 0xda, 0xaa,
- 0x11, 0x33, 0xc2, 0x42, 0xa7, 0xc8, 0x63, 0x1d, 0xc3, 0x31, 0xf0, 0x1c, 0xd9, 0x29, 0x12, 0x9c,
- 0xae, 0x02, 0x7d, 0xce, 0x82, 0x63, 0xce, 0xad, 0x70, 0x99, 0xde, 0x20, 0xdc, 0xda, 0x42, 0xc3,
- 0xaf, 0xed, 0x50, 0xc1, 0x4c, 0x2e, 0xab, 0x17, 0x32, 0x15, 0xc8, 0x37, 0xaa, 0x29, 0x7a, 0xa3,
- 0xfa, 0x99, 0xbb, 0xfb, 0xa5, 0x63, 0x59, 0x54, 0x38, 0xb3, 0x2e, 0x84, 0x45, 0x4e, 0x22, 0x27,
- 0xda, 0xee, 0x14, 0x03, 0x24, 0xeb, 0x65, 0x34, 0x17, 0x89, 0x25, 0x06, 0x2b, 0x3e, 0xe8, 0xd3,
- 0x30, 0xbc, 0x25, 0x9f, 0xfb, 0x67, 0x88, 0xdc, 0x71, 0x47, 0x76, 0x0e, 0x82, 0xc0, 0xfd, 0x41,
- 0x14, 0x11, 0x8e, 0x99, 0xa2, 0xd7, 0xa1, 0xe8, 0x6d, 0x86, 0x22, 0x12, 0x59, 0xb6, 0x5b, 0xaa,
- 0xe9, 0xf8, 0xcb, 0x23, 0xed, 0xac, 0xaf, 0x54, 0x31, 0x2d, 0x88, 0x2e, 0x43, 0x31, 0xb8, 0x59,
- 0x17, 0xd6, 0x8f, 0xcc, 0x45, 0x8a, 0x17, 0x96, 0x72, 0x5a, 0xc5, 0x38, 0xe1, 0x85, 0x25, 0x4c,
- 0x59, 0xa0, 0x0a, 0xf4, 0xb3, 0x57, 0xaa, 0x42, 0xb4, 0xcd, 0xbc, 0xca, 0x77, 0x78, 0xed, 0xcd,
- 0x5f, 0xc0, 0x31, 0x02, 0xcc, 0x19, 0xa1, 0x0d, 0x18, 0xa8, 0xb1, 0x04, 0xf4, 0x42, 0x96, 0xfd,
- 0x60, 0xa6, 0x9d, 0xa3, 0x43, 0x66, 0x7e, 0xa1, 0xf6, 0x67, 0x14, 0x58, 0xf0, 0x62, 0x5c, 0x49,
- 0x6b, 0x7b, 0x53, 0x9e, 0x58, 0xd9, 0x5c, 0x49, 0x6b, 0x7b, 0xa5, 0xda, 0x91, 0x2b, 0xa3, 0xc0,
- 0x82, 0x17, 0x7a, 0x05, 0x0a, 0x9b, 0x35, 0xf1, 0x02, 0x35, 0xd3, 0xe0, 0x61, 0x06, 0x4b, 0x5a,
- 0x18, 0xb8, 0xbb, 0x5f, 0x2a, 0xac, 0x2c, 0xe2, 0xc2, 0x66, 0x0d, 0xad, 0xc3, 0xe0, 0x26, 0x0f,
- 0xaf, 0x22, 0x6c, 0x1a, 0x4f, 0x64, 0x47, 0x7e, 0x49, 0x45, 0x60, 0xe1, 0xaf, 0x19, 0x05, 0x02,
- 0x4b, 0x26, 0x2c, 0x45, 0x8e, 0x0a, 0x13, 0x23, 0xa2, 0x54, 0xce, 0x1d, 0x2e, 0xb4, 0x0f, 0xbf,
- 0x6a, 0xc4, 0xc1, 0x66, 0xb0, 0xc6, 0x91, 0xce, 0x6a, 0xe7, 0x4e, 0x3b, 0x60, 0x29, 0x0c, 0x44,
- 0x38, 0xb3, 0xcc, 0x59, 0x3d, 0x2f, 0x89, 0x3a, 0xcd, 0x6a, 0x45, 0x84, 0x63, 0xa6, 0x68, 0x07,
- 0xc6, 0x76, 0xc3, 0xd6, 0x36, 0x91, 0x4b, 0x9a, 0x45, 0x37, 0xcb, 0x91, 0x66, 0xaf, 0x0b, 0x42,
- 0x37, 0x88, 0xda, 0x4e, 0x23, 0xb5, 0x0b, 0xb1, 0x6b, 0xcd, 0x75, 0x9d, 0x19, 0x36, 0x79, 0xd3,
- 0xee, 0x7f, 0xa7, 0xed, 0xdf, 0xdc, 0x8b, 0x88, 0x08, 0x2e, 0x99, 0xd9, 0xfd, 0x6f, 0x72, 0x92,
- 0x74, 0xf7, 0x0b, 0x04, 0x96, 0x4c, 0xd0, 0x75, 0xd1, 0x3d, 0x6c, 0xf7, 0x9c, 0xcc, 0x8f, 0x5c,
- 0x3d, 0x2f, 0x89, 0x72, 0x3a, 0x85, 0xed, 0x96, 0x31, 0x2b, 0xb6, 0x4b, 0xb6, 0xb6, 0xfd, 0xc8,
- 0xf7, 0x12, 0x3b, 0xf4, 0x54, 0xfe, 0x2e, 0x59, 0xc9, 0xa0, 0x4f, 0xef, 0x92, 0x59, 0x54, 0x38,
- 0xb3, 0x2e, 0x54, 0x87, 0xf1, 0x96, 0x1f, 0x44, 0xb7, 0xfc, 0x40, 0xce, 0x2f, 0xd4, 0x41, 0x51,
- 0x6a, 0x50, 0x8a, 0x1a, 0x59, 0xdc, 0x56, 0x13, 0x83, 0x13, 0x3c, 0xd1, 0xc7, 0x60, 0x30, 0xac,
- 0x39, 0x0d, 0x52, 0xbe, 0x3a, 0x33, 0x9d, 0x7f, 0xfc, 0x54, 0x39, 0x49, 0xce, 0xec, 0xe2, 0xd1,
- 0x71, 0x38, 0x09, 0x96, 0xec, 0xd0, 0x0a, 0xf4, 0xb3, 0xd4, 0xb3, 0x2c, 0x12, 0x6a, 0x4e, 0x00,
- 0xee, 0xd4, 0x1b, 0x13, 0xbe, 0x37, 0x31, 0x30, 0xe6, 0xc5, 0xe9, 0x1a, 0x10, 0x9a, 0x02, 0x3f,
- 0x9c, 0x39, 0x9e, 0xbf, 0x06, 0x84, 0x82, 0xe1, 0x6a, 0xb5, 0xd3, 0x1a, 0x50, 0x44, 0x38, 0x66,
- 0x4a, 0x77, 0x66, 0xba, 0x9b, 0x9e, 0xe8, 0xe0, 0x3f, 0x98, 0xbb, 0x97, 0xb2, 0x9d, 0x99, 0xee,
- 0xa4, 0x94, 0x85, 0xfd, 0x9b, 0x43, 0x69, 0x99, 0x85, 0x69, 0x98, 0xfe, 0x67, 0x2b, 0xe5, 0xe7,
- 0xf0, 0xa1, 0x5e, 0x15, 0xde, 0xf7, 0xf1, 0xe2, 0xfa, 0x39, 0x0b, 0x4e, 0xb4, 0x32, 0x3f, 0x44,
- 0x08, 0x00, 0xbd, 0xe9, 0xcd, 0xf9, 0xa7, 0xab, 0xa8, 0xb9, 0xd9, 0x78, 0x9c, 0x53, 0x53, 0x52,
- 0x39, 0x50, 0x7c, 0xd7, 0xca, 0x81, 0x35, 0x18, 0xaa, 0xf1, 0x9b, 0x9c, 0x8c, 0xf6, 0xde, 0x53,
- 0xcc, 0x47, 0x26, 0x4a, 0x88, 0x2b, 0xe0, 0x26, 0x56, 0x2c, 0xd0, 0x8f, 0x5a, 0x70, 0x3a, 0xd9,
- 0x74, 0x4c, 0x18, 0x5a, 0x84, 0xda, 0xe5, 0x6a, 0xad, 0x15, 0xf1, 0xfd, 0x29, 0xf9, 0xdf, 0x20,
- 0x3e, 0xe8, 0x46, 0x80, 0x3b, 0x57, 0x86, 0x96, 0x32, 0xf4, 0x6a, 0x03, 0xa6, 0x45, 0xb1, 0x07,
- 0xdd, 0xda, 0x0b, 0x30, 0xda, 0xf4, 0xdb, 0x5e, 0x24, 0xdc, 0x0d, 0x85, 0xc3, 0x13, 0x73, 0xf4,
- 0x59, 0xd3, 0xe0, 0xd8, 0xa0, 0x4a, 0x68, 0xe4, 0x86, 0xee, 0x59, 0x23, 0xf7, 0x36, 0x8c, 0x7a,
- 0x9a, 0x7f, 0x7c, 0xa7, 0x1b, 0xac, 0xd0, 0x2e, 0x6a, 0xd4, 0xbc, 0x95, 0x3a, 0x04, 0x1b, 0xdc,
- 0x3a, 0x6b, 0xcb, 0xe0, 0xdd, 0x69, 0xcb, 0x8e, 0xf4, 0x4a, 0x6c, 0xff, 0x42, 0x21, 0xe3, 0xc6,
- 0xc0, 0xb5, 0x72, 0xaf, 0x99, 0x5a, 0xb9, 0x73, 0x49, 0xad, 0x5c, 0xca, 0x54, 0x65, 0x28, 0xe4,
- 0x7a, 0xcf, 0x79, 0xd7, 0x73, 0x1c, 0xdf, 0xef, 0xb7, 0xe0, 0x21, 0x66, 0xfb, 0xa0, 0x15, 0xbc,
- 0x6b, 0x7b, 0x07, 0x73, 0x05, 0x5d, 0xcd, 0x66, 0x87, 0xf3, 0xea, 0xb1, 0x1b, 0x70, 0xb6, 0xdb,
- 0xb9, 0xcb, 0x1c, 0x6b, 0xeb, 0xca, 0x39, 0x22, 0x76, 0xac, 0xad, 0x97, 0x97, 0x30, 0xc3, 0xf4,
- 0x1a, 0xa5, 0xce, 0xfe, 0x8f, 0x16, 0x14, 0x2b, 0x7e, 0xfd, 0x08, 0x6e, 0xf4, 0x1f, 0x31, 0x6e,
- 0xf4, 0x0f, 0x67, 0x9f, 0xf8, 0xf5, 0x5c, 0x63, 0xdf, 0x72, 0xc2, 0xd8, 0x77, 0x3a, 0x8f, 0x41,
- 0x67, 0xd3, 0xde, 0x4f, 0x17, 0x61, 0xa4, 0xe2, 0xd7, 0xd5, 0x3a, 0xfb, 0x67, 0xf7, 0xf2, 0xaa,
- 0x25, 0x37, 0xc9, 0x90, 0xc6, 0x99, 0x79, 0xe1, 0xca, 0x38, 0x07, 0xdf, 0x66, 0x8f, 0x5b, 0x6e,
- 0x10, 0x77, 0x6b, 0x3b, 0x22, 0xf5, 0xe4, 0xe7, 0x1c, 0xdd, 0xe3, 0x96, 0x6f, 0x16, 0x61, 0x22,
- 0x51, 0x3b, 0x6a, 0xc0, 0x58, 0x43, 0x37, 0x25, 0x89, 0x79, 0x7a, 0x4f, 0x56, 0x28, 0xf1, 0x38,
- 0x40, 0x03, 0x61, 0x93, 0x39, 0x9a, 0x03, 0x50, 0xbe, 0x15, 0x52, 0xdb, 0xcf, 0xae, 0x35, 0xca,
- 0xf9, 0x22, 0xc4, 0x1a, 0x05, 0x7a, 0x11, 0x46, 0x22, 0xbf, 0xe5, 0x37, 0xfc, 0xad, 0xbd, 0x2b,
- 0x44, 0x06, 0x30, 0x54, 0x8e, 0xbe, 0x1b, 0x31, 0x0a, 0xeb, 0x74, 0xe8, 0x36, 0x4c, 0x29, 0x26,
- 0xd5, 0xfb, 0x60, 0x5e, 0x63, 0x6a, 0x93, 0xf5, 0x24, 0x47, 0x9c, 0xae, 0x04, 0xbd, 0x02, 0xe3,
- 0xcc, 0xe3, 0x98, 0x95, 0xbf, 0x42, 0xf6, 0x64, 0x60, 0x5b, 0x26, 0x61, 0xaf, 0x19, 0x18, 0x9c,
- 0xa0, 0x44, 0x8b, 0x30, 0xd5, 0x74, 0xc3, 0x44, 0xf1, 0x01, 0x56, 0x9c, 0x35, 0x60, 0x2d, 0x89,
- 0xc4, 0x69, 0x7a, 0xfb, 0xe7, 0xc4, 0x18, 0x7b, 0x91, 0xfb, 0xfe, 0x72, 0x7c, 0x6f, 0x2f, 0xc7,
- 0x6f, 0x58, 0x30, 0x49, 0x6b, 0x67, 0x6e, 0x94, 0x52, 0x90, 0x52, 0xa9, 0x0f, 0xac, 0x0e, 0xa9,
- 0x0f, 0xce, 0xd1, 0x6d, 0xbb, 0xee, 0xb7, 0x23, 0xa1, 0x1d, 0xd5, 0xf6, 0x65, 0x0a, 0xc5, 0x02,
- 0x2b, 0xe8, 0x48, 0x10, 0x88, 0x47, 0xe0, 0x3a, 0x1d, 0x09, 0x02, 0x2c, 0xb0, 0x32, 0x33, 0x42,
- 0x5f, 0x76, 0x66, 0x04, 0x1e, 0xe0, 0x5a, 0x78, 0xc1, 0x09, 0x91, 0x56, 0x0b, 0x70, 0x2d, 0xdd,
- 0xe3, 0x62, 0x1a, 0xfb, 0x6b, 0x45, 0x18, 0xad, 0xf8, 0xf5, 0xd8, 0xb1, 0xe3, 0x05, 0xc3, 0xb1,
- 0xe3, 0x6c, 0xc2, 0xb1, 0x63, 0x52, 0xa7, 0x7d, 0xdf, 0x8d, 0xe3, 0x5b, 0xe5, 0xc6, 0xf1, 0x5b,
- 0x16, 0x1b, 0xb5, 0xa5, 0xf5, 0x2a, 0xf7, 0xca, 0x45, 0x17, 0x61, 0x84, 0xed, 0x70, 0x2c, 0xea,
- 0x80, 0xf4, 0x76, 0x60, 0x99, 0x0a, 0xd7, 0x63, 0x30, 0xd6, 0x69, 0xd0, 0x79, 0x18, 0x0a, 0x89,
- 0x13, 0xd4, 0xb6, 0xd5, 0xf6, 0x2e, 0x5c, 0x13, 0x38, 0x0c, 0x2b, 0x2c, 0x7a, 0x33, 0x8e, 0xad,
- 0x5c, 0xcc, 0x77, 0xf1, 0xd5, 0xdb, 0xc3, 0x97, 0x48, 0x7e, 0x40, 0x65, 0xfb, 0x06, 0xa0, 0x34,
- 0x7d, 0x0f, 0xcf, 0x9e, 0x4a, 0x66, 0xf4, 0xcf, 0xe1, 0x54, 0xe4, 0xcf, 0xbf, 0xb7, 0x60, 0xbc,
- 0xe2, 0xd7, 0xe9, 0xd2, 0xfd, 0x4e, 0x5a, 0xa7, 0x7a, 0x60, 0xf9, 0x81, 0x0e, 0x81, 0xe5, 0x1f,
- 0x85, 0xfe, 0x8a, 0x5f, 0xef, 0x12, 0xa1, 0xf4, 0xff, 0xb1, 0x60, 0xb0, 0xe2, 0xd7, 0x8f, 0xc0,
- 0xf0, 0xf2, 0x9a, 0x69, 0x78, 0x79, 0x28, 0x67, 0xde, 0xe4, 0xd8, 0x5a, 0xfe, 0xaf, 0x3e, 0x18,
- 0xa3, 0xed, 0xf4, 0xb7, 0xe4, 0x50, 0x1a, 0xdd, 0x66, 0xf5, 0xd0, 0x6d, 0xf4, 0x1a, 0xe0, 0x37,
- 0x1a, 0xfe, 0xad, 0xe4, 0xb0, 0xae, 0x30, 0x28, 0x16, 0x58, 0xf4, 0x0c, 0x0c, 0xb5, 0x02, 0xb2,
- 0xeb, 0xfa, 0x42, 0xbe, 0xd6, 0xcc, 0x58, 0x15, 0x01, 0xc7, 0x8a, 0x82, 0x5e, 0xbc, 0x43, 0xd7,
- 0xa3, 0xb2, 0x44, 0xcd, 0xf7, 0xea, 0xdc, 0x36, 0x51, 0x14, 0xd9, 0x8f, 0x34, 0x38, 0x36, 0xa8,
- 0xd0, 0x0d, 0x18, 0x66, 0xff, 0xd9, 0xb6, 0x73, 0xf8, 0xc4, 0xee, 0x22, 0x1f, 0xac, 0x60, 0x80,
- 0x63, 0x5e, 0xe8, 0x39, 0x80, 0x48, 0x66, 0x10, 0x09, 0x45, 0xa4, 0x4a, 0x75, 0x17, 0x51, 0xb9,
- 0x45, 0x42, 0xac, 0x51, 0xa1, 0xa7, 0x61, 0x38, 0x72, 0xdc, 0xc6, 0xaa, 0xeb, 0x31, 0xfb, 0x3d,
- 0x6d, 0xbf, 0x48, 0xcb, 0x2a, 0x80, 0x38, 0xc6, 0x53, 0x59, 0x90, 0xc5, 0x20, 0x5a, 0xd8, 0x8b,
- 0x44, 0x06, 0xb2, 0x22, 0x97, 0x05, 0x57, 0x15, 0x14, 0x6b, 0x14, 0x68, 0x1b, 0x4e, 0xb9, 0x1e,
- 0xcb, 0x14, 0x44, 0xaa, 0x3b, 0x6e, 0x6b, 0x63, 0xb5, 0x7a, 0x9d, 0x04, 0xee, 0xe6, 0xde, 0x82,
- 0x53, 0xdb, 0x21, 0x9e, 0x4c, 0xd9, 0xfd, 0x98, 0x68, 0xe2, 0xa9, 0x72, 0x07, 0x5a, 0xdc, 0x91,
- 0x93, 0xfd, 0x3c, 0x9b, 0xef, 0x57, 0xab, 0xe8, 0x29, 0x63, 0xeb, 0x38, 0xa1, 0x6f, 0x1d, 0x07,
- 0xfb, 0xa5, 0x81, 0xab, 0x55, 0x2d, 0x10, 0xce, 0xcb, 0x70, 0xbc, 0xe2, 0xd7, 0x2b, 0x7e, 0x10,
- 0xad, 0xf8, 0xc1, 0x2d, 0x27, 0xa8, 0xcb, 0xe9, 0x55, 0x92, 0xa1, 0x80, 0xe8, 0xfe, 0xd9, 0xcf,
- 0x77, 0x17, 0x23, 0xcc, 0xcf, 0xf3, 0x4c, 0x62, 0x3b, 0xe4, 0x1b, 0xcf, 0x1a, 0x93, 0x1d, 0x54,
- 0xae, 0xad, 0x4b, 0x4e, 0x44, 0xd0, 0x55, 0x18, 0xab, 0xe9, 0xc7, 0xa8, 0x28, 0xfe, 0xa4, 0x3c,
- 0xc8, 0x8c, 0x33, 0x36, 0xf3, 0xdc, 0x35, 0xcb, 0xdb, 0xdf, 0x23, 0x2a, 0xe1, 0x8a, 0x08, 0xee,
- 0xd2, 0xda, 0x4b, 0x56, 0x7b, 0x99, 0x8c, 0xa7, 0x90, 0x1f, 0x68, 0x91, 0xdb, 0x95, 0x3b, 0x26,
- 0xe3, 0xb1, 0xbf, 0x17, 0x4e, 0x24, 0xab, 0xef, 0x39, 0xb5, 0xfe, 0x22, 0x4c, 0x05, 0x7a, 0x41,
- 0x2d, 0xb3, 0xe1, 0x71, 0x9e, 0x40, 0x25, 0x81, 0xc4, 0x69, 0x7a, 0xfb, 0x45, 0x98, 0xa2, 0x97,
- 0x5f, 0x25, 0xc8, 0xb1, 0x5e, 0xee, 0x1e, 0x13, 0xe9, 0x8f, 0x07, 0xd8, 0x41, 0x94, 0x48, 0x73,
- 0x85, 0x3e, 0x05, 0xe3, 0x21, 0x59, 0x75, 0xbd, 0xf6, 0x6d, 0xa9, 0x5b, 0xeb, 0xf0, 0xb8, 0xb9,
- 0xba, 0xac, 0x53, 0xf2, 0xfb, 0x83, 0x09, 0xc3, 0x09, 0x6e, 0xa8, 0x09, 0xe3, 0xb7, 0x5c, 0xaf,
- 0xee, 0xdf, 0x0a, 0x25, 0xff, 0xa1, 0x7c, 0x45, 0xfd, 0x0d, 0x4e, 0x99, 0x68, 0xa3, 0x51, 0xdd,
- 0x0d, 0x83, 0x19, 0x4e, 0x30, 0xa7, 0x8b, 0x3d, 0x68, 0x7b, 0xf3, 0xe1, 0xb5, 0x90, 0xf0, 0x47,
- 0xaa, 0x62, 0xb1, 0x63, 0x09, 0xc4, 0x31, 0x9e, 0x2e, 0x76, 0xf6, 0xe7, 0x52, 0xe0, 0xb7, 0x79,
- 0x4e, 0x25, 0xb1, 0xd8, 0xb1, 0x82, 0x62, 0x8d, 0x82, 0x6e, 0x86, 0xec, 0xdf, 0xba, 0xef, 0x61,
- 0xdf, 0x8f, 0xe4, 0xf6, 0xc9, 0x72, 0x02, 0x6a, 0x70, 0x6c, 0x50, 0xa1, 0x15, 0x40, 0x61, 0xbb,
- 0xd5, 0x6a, 0x30, 0xd7, 0x45, 0xa7, 0xc1, 0x58, 0x71, 0xb7, 0xab, 0x22, 0xf7, 0x6e, 0xa9, 0xa6,
- 0xb0, 0x38, 0xa3, 0x04, 0x3d, 0x17, 0x37, 0x45, 0x53, 0xfb, 0x59, 0x53, 0xb9, 0x51, 0xaf, 0xca,
- 0xdb, 0x29, 0x71, 0x68, 0x19, 0x06, 0xc3, 0xbd, 0xb0, 0x16, 0x35, 0xc2, 0x4e, 0x19, 0x18, 0xab,
- 0x8c, 0x44, 0x4b, 0x00, 0xcc, 0x8b, 0x60, 0x59, 0x16, 0xd5, 0x60, 0x5a, 0x70, 0x5c, 0xdc, 0x76,
- 0x3c, 0x95, 0x17, 0x8e, 0x7b, 0xef, 0x5d, 0xbc, 0xbb, 0x5f, 0x9a, 0x16, 0x35, 0xeb, 0xe8, 0x83,
- 0xfd, 0x12, 0x5d, 0x1c, 0x19, 0x18, 0x9c, 0xc5, 0x8d, 0x4f, 0xbe, 0x5a, 0xcd, 0x6f, 0xb6, 0x2a,
- 0x81, 0xbf, 0xe9, 0x36, 0x48, 0x27, 0xc3, 0x68, 0xd5, 0xa0, 0x14, 0x93, 0xcf, 0x80, 0xe1, 0x04,
- 0x37, 0x74, 0x13, 0x26, 0x9c, 0x56, 0x6b, 0x3e, 0x68, 0xfa, 0x81, 0xac, 0x60, 0x24, 0x5f, 0xc3,
- 0x3e, 0x6f, 0x92, 0xf2, 0xb4, 0x70, 0x09, 0x20, 0x4e, 0x32, 0xb4, 0xbf, 0x87, 0xc9, 0xa7, 0x55,
- 0x77, 0xcb, 0x63, 0xef, 0xc6, 0x51, 0x13, 0xc6, 0x5a, 0x6c, 0x07, 0x13, 0xd9, 0x94, 0xc4, 0x7a,
- 0x7a, 0xa1, 0x47, 0x1d, 0xdb, 0x2d, 0x96, 0x0f, 0xd2, 0xf0, 0xb5, 0xac, 0xe8, 0xec, 0xb0, 0xc9,
- 0xdd, 0xfe, 0x57, 0x27, 0x99, 0x84, 0x53, 0xe5, 0x8a, 0xb3, 0x41, 0xf1, 0x0a, 0x4e, 0x5c, 0x95,
- 0x67, 0xf3, 0x55, 0xd4, 0xf1, 0xd0, 0x8b, 0x97, 0x74, 0x58, 0x96, 0x45, 0x9f, 0x84, 0x71, 0x7a,
- 0xf3, 0x54, 0x52, 0x46, 0x38, 0x73, 0x2c, 0x3f, 0x6e, 0x91, 0xa2, 0xd2, 0x33, 0xad, 0xe9, 0x85,
- 0x71, 0x82, 0x19, 0x7a, 0x93, 0xb9, 0x1f, 0x4a, 0xd6, 0x85, 0x5e, 0x58, 0xeb, 0x9e, 0x86, 0x92,
- 0xad, 0xc6, 0x04, 0xb5, 0x61, 0x3a, 0x9d, 0x4f, 0x36, 0x9c, 0xb1, 0xf3, 0x45, 0xf8, 0x74, 0x4a,
- 0xd8, 0x38, 0x25, 0x56, 0x1a, 0x17, 0xe2, 0x2c, 0xfe, 0x68, 0x35, 0x99, 0xed, 0xb3, 0x68, 0x28,
- 0xb7, 0x53, 0x19, 0x3f, 0xc7, 0x3a, 0x26, 0xfa, 0xdc, 0x82, 0xd3, 0x5a, 0xc2, 0xc4, 0x4b, 0x81,
- 0xc3, 0xdc, 0x5f, 0x5c, 0xb6, 0x65, 0x6b, 0xb2, 0xd7, 0x23, 0x77, 0xf7, 0x4b, 0xa7, 0x37, 0x3a,
- 0x11, 0xe2, 0xce, 0x7c, 0xd0, 0x55, 0x38, 0xce, 0xa3, 0x6e, 0x2c, 0x11, 0xa7, 0xde, 0x70, 0x3d,
- 0x25, 0xdc, 0xf1, 0x6d, 0xe5, 0xe4, 0xdd, 0xfd, 0xd2, 0xf1, 0xf9, 0x2c, 0x02, 0x9c, 0x5d, 0x0e,
- 0xbd, 0x06, 0xc3, 0x75, 0x2f, 0x14, 0x7d, 0x30, 0x60, 0xe4, 0xa4, 0x1c, 0x5e, 0x5a, 0xaf, 0xaa,
- 0xef, 0x8f, 0xff, 0xe0, 0xb8, 0x00, 0xda, 0xe2, 0xd6, 0x15, 0xa5, 0x12, 0x1b, 0x4c, 0x05, 0x63,
- 0x4c, 0x6a, 0x8d, 0x8d, 0xd7, 0xf6, 0xdc, 0xac, 0xa8, 0x5e, 0x86, 0x19, 0x0f, 0xf1, 0x0d, 0xc6,
- 0xe8, 0x0d, 0x40, 0x22, 0xf7, 0xc9, 0x7c, 0x8d, 0xa5, 0xea, 0xd2, 0x5c, 0x1e, 0xd5, 0x4d, 0xb7,
- 0x9a, 0xa2, 0xc0, 0x19, 0xa5, 0xd0, 0x65, 0xba, 0x73, 0xe9, 0x50, 0xb1, 0x33, 0xaa, 0xcc, 0xc7,
- 0x4b, 0xa4, 0x15, 0x10, 0xe6, 0xa5, 0x67, 0x72, 0xc4, 0x89, 0x72, 0xa8, 0x0e, 0xa7, 0x9c, 0x76,
- 0xe4, 0x33, 0xc3, 0x95, 0x49, 0xba, 0xe1, 0xef, 0x10, 0x8f, 0xd9, 0x8c, 0x87, 0x58, 0x90, 0xc7,
- 0x53, 0xf3, 0x1d, 0xe8, 0x70, 0x47, 0x2e, 0x54, 0xea, 0xa7, 0x7d, 0xa1, 0xd9, 0x94, 0x8c, 0x87,
- 0xc3, 0xdc, 0xd0, 0x2a, 0x29, 0xd0, 0x8b, 0x30, 0xb2, 0xed, 0x87, 0xd1, 0x3a, 0x89, 0x6e, 0xf9,
- 0xc1, 0x8e, 0x08, 0xb6, 0x1e, 0x27, 0xb8, 0x88, 0x51, 0x58, 0xa7, 0xa3, 0xd7, 0x7a, 0xe6, 0xd1,
- 0x54, 0x5e, 0x62, 0xce, 0x24, 0x43, 0xf1, 0x1e, 0x73, 0x99, 0x83, 0xb1, 0xc4, 0x4b, 0xd2, 0x72,
- 0x65, 0x91, 0x39, 0x86, 0x24, 0x48, 0xcb, 0x95, 0x45, 0x2c, 0xf1, 0x74, 0xba, 0x86, 0xdb, 0x4e,
- 0x40, 0x2a, 0x81, 0x5f, 0x23, 0xa1, 0x96, 0x56, 0xe5, 0x61, 0x1e, 0x4a, 0x9e, 0x4e, 0xd7, 0x6a,
- 0x16, 0x01, 0xce, 0x2e, 0x87, 0x48, 0x3a, 0x59, 0xe8, 0x78, 0xbe, 0x45, 0x2f, 0x2d, 0x33, 0xf5,
- 0x98, 0x2f, 0xd4, 0x83, 0x49, 0x95, 0xa6, 0x94, 0x07, 0x8f, 0x0f, 0x67, 0x26, 0xd8, 0xdc, 0xee,
- 0x3d, 0xf2, 0xbc, 0xb2, 0x91, 0x96, 0x13, 0x9c, 0x70, 0x8a, 0xb7, 0x11, 0x45, 0x74, 0xb2, 0x6b,
- 0x14, 0xd1, 0x0b, 0x30, 0x1c, 0xb6, 0x6f, 0xd6, 0xfd, 0xa6, 0xe3, 0x7a, 0xcc, 0x31, 0x44, 0xbb,
- 0x5f, 0x56, 0x25, 0x02, 0xc7, 0x34, 0x68, 0x05, 0x86, 0x1c, 0x69, 0x00, 0x45, 0xf9, 0x01, 0xd2,
- 0x94, 0xd9, 0x93, 0xc7, 0x0c, 0x92, 0x26, 0x4f, 0x55, 0x16, 0xbd, 0x0a, 0x63, 0x22, 0x56, 0x84,
- 0xc8, 0xec, 0x3d, 0x6d, 0xbe, 0xb2, 0xad, 0xea, 0x48, 0x6c, 0xd2, 0xa2, 0x6b, 0x30, 0x12, 0xf9,
- 0x0d, 0xf6, 0x54, 0x94, 0x8a, 0x92, 0x27, 0xf2, 0xe3, 0x98, 0x6e, 0x28, 0x32, 0x5d, 0x35, 0xaf,
- 0x8a, 0x62, 0x9d, 0x0f, 0xda, 0xe0, 0xf3, 0x9d, 0x25, 0x51, 0x21, 0xa1, 0x48, 0x0d, 0x7d, 0x3a,
- 0xcf, 0xab, 0x8f, 0x91, 0x99, 0xcb, 0x41, 0x94, 0xc4, 0x3a, 0x1b, 0x74, 0x09, 0xa6, 0x5a, 0x81,
- 0xeb, 0xb3, 0x39, 0xa1, 0x0c, 0xba, 0x33, 0x66, 0xca, 0xc4, 0x4a, 0x92, 0x00, 0xa7, 0xcb, 0xb0,
- 0x50, 0x1f, 0x02, 0x38, 0x73, 0x92, 0xa7, 0x7d, 0xe2, 0xd7, 0x75, 0x0e, 0xc3, 0x0a, 0x8b, 0xd6,
- 0xd8, 0x4e, 0xcc, 0x35, 0x4d, 0x33, 0xb3, 0xf9, 0x31, 0xd9, 0x74, 0x8d, 0x14, 0x17, 0x90, 0xd5,
- 0x5f, 0x1c, 0x73, 0x40, 0x75, 0x2d, 0xdb, 0x32, 0xbd, 0x66, 0x84, 0x33, 0xa7, 0x3a, 0xb8, 0x95,
- 0x26, 0x6e, 0x7e, 0xb1, 0x40, 0x60, 0x80, 0x43, 0x9c, 0xe0, 0x89, 0x3e, 0x0a, 0x93, 0xe2, 0x1d,
- 0x7c, 0xdc, 0x4d, 0xa7, 0xe3, 0xa7, 0x37, 0x38, 0x81, 0xc3, 0x29, 0x6a, 0x9e, 0x76, 0xc9, 0xb9,
- 0xd9, 0x20, 0x62, 0xeb, 0x5b, 0x75, 0xbd, 0x9d, 0x70, 0xe6, 0x0c, 0xdb, 0x1f, 0x44, 0xda, 0xa5,
- 0x24, 0x16, 0x67, 0x94, 0x40, 0x1b, 0x30, 0xd9, 0x0a, 0x08, 0x69, 0xb2, 0xcb, 0x84, 0x38, 0xcf,
- 0x4a, 0x3c, 0xd2, 0x0d, 0x6d, 0x49, 0x25, 0x81, 0x3b, 0xc8, 0x80, 0xe1, 0x14, 0x07, 0x74, 0x0b,
- 0x86, 0xfc, 0x5d, 0x12, 0x6c, 0x13, 0xa7, 0x3e, 0x73, 0xb6, 0xc3, 0x83, 0x30, 0x71, 0xb8, 0x5d,
- 0x15, 0xb4, 0x09, 0x7f, 0x19, 0x09, 0xee, 0xee, 0x2f, 0x23, 0x2b, 0x43, 0xff, 0x8b, 0x05, 0x27,
- 0xa5, 0x05, 0xaa, 0xda, 0xa2, 0xbd, 0xbe, 0xe8, 0x7b, 0x61, 0x14, 0xf0, 0xd8, 0x2c, 0x8f, 0xe4,
- 0xc7, 0x2b, 0xd9, 0xc8, 0x29, 0xa4, 0x94, 0xdd, 0x27, 0xf3, 0x28, 0x42, 0x9c, 0x5f, 0x23, 0xbd,
- 0xfe, 0x86, 0x24, 0x92, 0x9b, 0xd1, 0x7c, 0xb8, 0xf2, 0xe6, 0xd2, 0xfa, 0xcc, 0xa3, 0x3c, 0xb0,
- 0x0c, 0x5d, 0x0c, 0xd5, 0x24, 0x12, 0xa7, 0xe9, 0xd1, 0x45, 0x28, 0xf8, 0xe1, 0xcc, 0x63, 0x1d,
- 0x12, 0x74, 0xfb, 0xf5, 0xab, 0x55, 0xee, 0x37, 0x79, 0xb5, 0x8a, 0x0b, 0x7e, 0x28, 0x53, 0x1f,
- 0xd1, 0x3b, 0x5f, 0x38, 0xf3, 0x38, 0x57, 0x8d, 0xca, 0xd4, 0x47, 0x0c, 0x88, 0x63, 0x3c, 0xda,
- 0x86, 0x89, 0xd0, 0xb8, 0x5b, 0x87, 0x33, 0xe7, 0x58, 0x4f, 0x3d, 0x9e, 0x37, 0x68, 0x06, 0xb5,
- 0x96, 0x93, 0xc4, 0xe4, 0x82, 0x93, 0x6c, 0xf9, 0xea, 0xd2, 0x6e, 0xf7, 0xe1, 0xcc, 0x13, 0x5d,
- 0x56, 0x97, 0x46, 0xac, 0xaf, 0x2e, 0x9d, 0x07, 0x4e, 0xf0, 0x9c, 0xfd, 0x2e, 0x98, 0x4a, 0x89,
- 0x4b, 0x87, 0x79, 0x23, 0x30, 0xbb, 0x03, 0x63, 0xc6, 0x94, 0x7c, 0xa0, 0x2e, 0x24, 0xbf, 0x3f,
- 0x0c, 0xc3, 0xca, 0xb4, 0x8f, 0x2e, 0x98, 0x5e, 0x23, 0x27, 0x93, 0x5e, 0x23, 0x43, 0x15, 0xbf,
- 0x6e, 0x38, 0x8a, 0x6c, 0x64, 0x04, 0x22, 0xcd, 0xdb, 0x00, 0x7b, 0x7f, 0xc8, 0xa4, 0x99, 0x2b,
- 0x8a, 0x3d, 0xbb, 0x9f, 0xf4, 0x75, 0xb4, 0x80, 0x5c, 0x82, 0x29, 0xcf, 0x67, 0x32, 0x3a, 0xa9,
- 0x4b, 0x01, 0x8c, 0xc9, 0x59, 0xc3, 0x7a, 0x3c, 0xaf, 0x04, 0x01, 0x4e, 0x97, 0xa1, 0x15, 0x72,
- 0x41, 0x29, 0x69, 0x72, 0xe1, 0x72, 0x14, 0x16, 0x58, 0x7a, 0x37, 0xe4, 0xbf, 0xc2, 0x99, 0xc9,
- 0xfc, 0xbb, 0x21, 0x2f, 0x94, 0x14, 0xc6, 0x42, 0x29, 0x8c, 0x31, 0x0b, 0x43, 0xcb, 0xaf, 0x97,
- 0x2b, 0x42, 0xcc, 0xd7, 0x42, 0x84, 0xd7, 0xcb, 0x15, 0xcc, 0x71, 0x68, 0x1e, 0x06, 0xd8, 0x0f,
- 0x19, 0x27, 0x25, 0x6f, 0x99, 0x96, 0x2b, 0x5a, 0xea, 0x45, 0x56, 0x00, 0x8b, 0x82, 0x4c, 0x83,
- 0x4c, 0xef, 0x46, 0x4c, 0x83, 0x3c, 0x78, 0x8f, 0x1a, 0x64, 0xc9, 0x00, 0xc7, 0xbc, 0xd0, 0x6d,
- 0x38, 0x6e, 0xdc, 0x47, 0xd5, 0xcb, 0x2e, 0xc8, 0x37, 0x2e, 0x27, 0x88, 0x17, 0x4e, 0x8b, 0x46,
- 0x1f, 0x2f, 0x67, 0x71, 0xc2, 0xd9, 0x15, 0xa0, 0x06, 0x4c, 0xd5, 0x52, 0xb5, 0x0e, 0xf5, 0x5e,
- 0xab, 0x9a, 0x17, 0xe9, 0x1a, 0xd3, 0x8c, 0xd1, 0xab, 0x30, 0xf4, 0x8e, 0xcf, 0x1d, 0xc1, 0xc4,
- 0xd5, 0x44, 0x46, 0x15, 0x19, 0x7a, 0xf3, 0x6a, 0x95, 0xc1, 0x0f, 0xf6, 0x4b, 0x23, 0x15, 0xbf,
- 0x2e, 0xff, 0x62, 0x55, 0x00, 0xfd, 0x90, 0x05, 0xb3, 0xe9, 0x0b, 0xaf, 0x6a, 0xf4, 0x58, 0xef,
- 0x8d, 0xb6, 0x45, 0xa5, 0xb3, 0xcb, 0xb9, 0xec, 0x70, 0x87, 0xaa, 0xd0, 0x87, 0xe9, 0x7a, 0x0a,
- 0xdd, 0x3b, 0x44, 0xe4, 0xad, 0x7e, 0x24, 0x5e, 0x4f, 0x14, 0x7a, 0xb0, 0x5f, 0x9a, 0xe0, 0x3b,
- 0xa3, 0x7b, 0x47, 0x05, 0x33, 0xe7, 0x05, 0xd0, 0xf7, 0xc2, 0xf1, 0x20, 0xad, 0xa5, 0x25, 0x52,
- 0x08, 0x7f, 0xaa, 0x97, 0x5d, 0x36, 0x39, 0xe0, 0x38, 0x8b, 0x21, 0xce, 0xae, 0xc7, 0xfe, 0x75,
- 0x8b, 0xe9, 0xd0, 0x45, 0xb3, 0x48, 0xd8, 0x6e, 0x1c, 0x45, 0xb6, 0xfc, 0x65, 0xc3, 0x3e, 0x7d,
- 0xcf, 0xde, 0x53, 0xbf, 0x6b, 0x31, 0xef, 0xa9, 0x23, 0x7c, 0x07, 0xf6, 0x26, 0x0c, 0x45, 0xa2,
- 0xb6, 0x4e, 0x09, 0xfe, 0xb5, 0x46, 0x31, 0x0f, 0x32, 0x75, 0xc9, 0x91, 0x50, 0xac, 0xd8, 0xd8,
- 0xff, 0x84, 0x8f, 0x80, 0xc4, 0x1c, 0x81, 0x19, 0x70, 0xc9, 0x34, 0x03, 0x96, 0xba, 0x7c, 0x41,
- 0x8e, 0x39, 0xf0, 0x1f, 0x9b, 0xed, 0x66, 0xca, 0xbd, 0xf7, 0xba, 0xdb, 0x9e, 0xfd, 0x05, 0x0b,
- 0x20, 0xce, 0x1e, 0xd1, 0x43, 0x9e, 0xda, 0x97, 0xe9, 0xb5, 0xc6, 0x8f, 0xfc, 0x9a, 0xdf, 0x10,
- 0x46, 0x90, 0x53, 0xb1, 0x25, 0x92, 0xc3, 0x0f, 0xb4, 0xdf, 0x58, 0x51, 0xa3, 0x92, 0x0c, 0xe7,
- 0x5a, 0x8c, 0x6d, 0xe3, 0x46, 0x28, 0xd7, 0x2f, 0x5b, 0x70, 0x2c, 0xeb, 0x51, 0x01, 0xbd, 0x24,
- 0x73, 0x35, 0xa7, 0x72, 0xa9, 0x54, 0xa3, 0x79, 0x5d, 0xc0, 0xb1, 0xa2, 0xe8, 0x39, 0x01, 0xf0,
- 0xe1, 0x32, 0x1b, 0x5c, 0x85, 0xb1, 0x4a, 0x40, 0x34, 0xf9, 0xe2, 0x75, 0x1e, 0xad, 0x87, 0xb7,
- 0xe7, 0x99, 0x43, 0x47, 0xea, 0xb1, 0xbf, 0x52, 0x80, 0x63, 0xdc, 0x31, 0x68, 0x7e, 0xd7, 0x77,
- 0xeb, 0x15, 0xbf, 0x2e, 0x9e, 0x82, 0xbe, 0x05, 0xa3, 0x2d, 0x4d, 0x37, 0xdd, 0x29, 0x4a, 0xb7,
- 0xae, 0xc3, 0x8e, 0xb5, 0x69, 0x3a, 0x14, 0x1b, 0xbc, 0x50, 0x1d, 0x46, 0xc9, 0xae, 0x5b, 0x53,
- 0xde, 0x25, 0x85, 0x43, 0x1f, 0xd2, 0xaa, 0x96, 0x65, 0x8d, 0x0f, 0x36, 0xb8, 0xf6, 0xec, 0xce,
- 0xab, 0x89, 0x68, 0x7d, 0x5d, 0x3c, 0x4a, 0x7e, 0xdc, 0x82, 0x87, 0x72, 0x62, 0x7a, 0xd3, 0xea,
- 0x6e, 0x31, 0x17, 0x2c, 0x31, 0x6d, 0x55, 0x75, 0xdc, 0x31, 0x0b, 0x0b, 0x2c, 0xfa, 0x18, 0x00,
- 0x77, 0xac, 0x22, 0x5e, 0xad, 0x6b, 0xf0, 0x63, 0x23, 0x5a, 0xab, 0x16, 0x78, 0x53, 0x96, 0xc7,
- 0x1a, 0x2f, 0xfb, 0xcb, 0x7d, 0xd0, 0xcf, 0x1c, 0x79, 0x50, 0x05, 0x06, 0xb7, 0x79, 0x5c, 0xb8,
- 0x8e, 0xe3, 0x46, 0x69, 0x65, 0xa0, 0xb9, 0x78, 0xdc, 0x34, 0x28, 0x96, 0x6c, 0xd0, 0x1a, 0x4c,
- 0xf3, 0x2c, 0x84, 0x8d, 0x25, 0xd2, 0x70, 0xf6, 0xa4, 0xda, 0x97, 0x27, 0xd6, 0x57, 0xea, 0xef,
- 0x72, 0x9a, 0x04, 0x67, 0x95, 0x43, 0xaf, 0xc3, 0x38, 0xbd, 0x86, 0xfb, 0xed, 0x48, 0x72, 0xe2,
- 0xf9, 0x07, 0xd5, 0xcd, 0x64, 0xc3, 0xc0, 0xe2, 0x04, 0x35, 0x7a, 0x15, 0xc6, 0x5a, 0x29, 0x05,
- 0x77, 0x7f, 0xac, 0x09, 0x32, 0x95, 0xda, 0x26, 0x2d, 0x7b, 0x57, 0xd0, 0x66, 0xaf, 0x28, 0x36,
- 0xb6, 0x03, 0x12, 0x6e, 0xfb, 0x8d, 0x3a, 0x93, 0x80, 0xfb, 0xb5, 0x77, 0x05, 0x09, 0x3c, 0x4e,
- 0x95, 0xa0, 0x5c, 0x36, 0x1d, 0xb7, 0xd1, 0x0e, 0x48, 0xcc, 0x65, 0xc0, 0xe4, 0xb2, 0x92, 0xc0,
- 0xe3, 0x54, 0x89, 0xee, 0x9a, 0xfb, 0xc1, 0xfb, 0xa3, 0xb9, 0xb7, 0x7f, 0xa6, 0x00, 0xc6, 0xd0,
- 0x7e, 0x07, 0xe7, 0x45, 0x7c, 0x0d, 0xfa, 0xb6, 0x82, 0x56, 0x4d, 0x38, 0xad, 0x65, 0x7e, 0x59,
- 0x9c, 0x14, 0x9d, 0x7f, 0x19, 0xfd, 0x8f, 0x59, 0x29, 0xba, 0xc6, 0x8f, 0x57, 0x02, 0x9f, 0x1e,
- 0x72, 0x32, 0x74, 0xa4, 0x7a, 0xbe, 0x33, 0x28, 0x03, 0x51, 0x74, 0x08, 0xb2, 0x2c, 0xde, 0x20,
- 0x70, 0x0e, 0x86, 0x7f, 0x57, 0x55, 0x84, 0x9b, 0x91, 0x5c, 0xd0, 0x45, 0x18, 0x11, 0xa9, 0xea,
- 0xd8, 0x2b, 0x13, 0xbe, 0x98, 0x98, 0x3f, 0xda, 0x52, 0x0c, 0xc6, 0x3a, 0x8d, 0xfd, 0xc3, 0x05,
- 0x98, 0xce, 0x78, 0x26, 0xc8, 0x8f, 0x91, 0x2d, 0x37, 0x8c, 0x54, 0xde, 0x75, 0xed, 0x18, 0xe1,
- 0x70, 0xac, 0x28, 0xe8, 0x5e, 0xc5, 0x0f, 0xaa, 0xe4, 0xe1, 0x24, 0x9e, 0xe1, 0x08, 0xec, 0x21,
- 0x33, 0x98, 0x9f, 0x85, 0xbe, 0x76, 0x48, 0x64, 0xa0, 0x74, 0x75, 0x6c, 0x33, 0xd3, 0x39, 0xc3,
- 0xd0, 0x2b, 0xe0, 0x96, 0xb2, 0x42, 0x6b, 0x57, 0x40, 0x6e, 0x87, 0xe6, 0x38, 0xda, 0xb8, 0x88,
- 0x78, 0x8e, 0x17, 0x89, 0x8b, 0x62, 0x1c, 0xe7, 0x97, 0x41, 0xb1, 0xc0, 0xda, 0x5f, 0x2a, 0xc2,
- 0xc9, 0xdc, 0x87, 0xc3, 0xb4, 0xe9, 0x4d, 0xdf, 0x73, 0x23, 0x5f, 0x39, 0xfa, 0xf1, 0xd8, 0xbe,
- 0xa4, 0xb5, 0xbd, 0x26, 0xe0, 0x58, 0x51, 0xa0, 0x73, 0xd0, 0xcf, 0x94, 0xe2, 0xa9, 0x0c, 0xf4,
- 0x0b, 0x4b, 0x3c, 0x02, 0x23, 0x47, 0x6b, 0xa7, 0x7a, 0xb1, 0xe3, 0xa9, 0xfe, 0x28, 0x95, 0x60,
- 0xfc, 0x46, 0xf2, 0x40, 0xa1, 0xcd, 0xf5, 0xfd, 0x06, 0x66, 0x48, 0xf4, 0xb8, 0xe8, 0xaf, 0x84,
- 0x67, 0x1b, 0x76, 0xea, 0x7e, 0xa8, 0x75, 0xda, 0x93, 0x30, 0xb8, 0x43, 0xf6, 0x02, 0xd7, 0xdb,
- 0x4a, 0x7a, 0x3c, 0x5e, 0xe1, 0x60, 0x2c, 0xf1, 0x66, 0x32, 0xe4, 0xc1, 0xfb, 0x91, 0x0c, 0x59,
- 0x9f, 0x01, 0x43, 0x5d, 0xc5, 0x93, 0x1f, 0x29, 0xc2, 0x04, 0x5e, 0x58, 0x7a, 0x7f, 0x20, 0xae,
- 0xa5, 0x07, 0xe2, 0x7e, 0xe4, 0x0c, 0x3e, 0xdc, 0x68, 0xfc, 0xb2, 0x05, 0x13, 0x2c, 0x61, 0x9e,
- 0x88, 0xfa, 0xe1, 0xfa, 0xde, 0x11, 0x5c, 0x05, 0x1e, 0x85, 0xfe, 0x80, 0x56, 0x9a, 0x4c, 0x3d,
- 0xcf, 0x5a, 0x82, 0x39, 0x0e, 0x9d, 0x82, 0x3e, 0xd6, 0x04, 0x3a, 0x78, 0xa3, 0x7c, 0x0b, 0x5e,
- 0x72, 0x22, 0x07, 0x33, 0x28, 0x8b, 0x3f, 0x88, 0x49, 0xab, 0xe1, 0xf2, 0x46, 0xc7, 0x2e, 0x0b,
- 0xef, 0x8d, 0x90, 0x22, 0x99, 0x4d, 0x7b, 0x77, 0xf1, 0x07, 0xb3, 0x59, 0x76, 0xbe, 0x66, 0xff,
- 0x75, 0x01, 0xce, 0x64, 0x96, 0xeb, 0x39, 0xfe, 0x60, 0xe7, 0xd2, 0x0f, 0x32, 0xf7, 0x57, 0xf1,
- 0x08, 0xfd, 0xc9, 0xfb, 0x7a, 0x95, 0xfe, 0xfb, 0x7b, 0x08, 0x0b, 0x98, 0xd9, 0x65, 0xef, 0x91,
- 0xb0, 0x80, 0x99, 0x6d, 0xcb, 0x51, 0x13, 0xfc, 0x43, 0x21, 0xe7, 0x5b, 0x98, 0xc2, 0xe0, 0x3c,
- 0xdd, 0x67, 0x18, 0x32, 0x94, 0x97, 0x70, 0xbe, 0xc7, 0x70, 0x18, 0x56, 0x58, 0x34, 0x0f, 0x13,
- 0x4d, 0xd7, 0xa3, 0x9b, 0xcf, 0x9e, 0x29, 0x8a, 0x2b, 0x5b, 0xc6, 0x9a, 0x89, 0xc6, 0x49, 0x7a,
- 0xe4, 0x6a, 0x21, 0x03, 0xf9, 0xd7, 0xbd, 0x7a, 0xa8, 0x55, 0x37, 0x67, 0xba, 0x73, 0xa8, 0x5e,
- 0xcc, 0x08, 0x1f, 0xb8, 0xa6, 0xe9, 0x89, 0x8a, 0xbd, 0xeb, 0x89, 0x46, 0xb3, 0x75, 0x44, 0xb3,
- 0xaf, 0xc2, 0xd8, 0x3d, 0xdb, 0x46, 0xec, 0x6f, 0x14, 0xe1, 0xe1, 0x0e, 0xcb, 0x9e, 0xef, 0xf5,
- 0xc6, 0x18, 0x68, 0x7b, 0x7d, 0x6a, 0x1c, 0x2a, 0x70, 0x6c, 0xb3, 0xdd, 0x68, 0xec, 0xb1, 0x87,
- 0x53, 0xa4, 0x2e, 0x29, 0x84, 0x4c, 0x29, 0x95, 0x23, 0xc7, 0x56, 0x32, 0x68, 0x70, 0x66, 0x49,
- 0x7a, 0xc5, 0xa2, 0x27, 0xc9, 0x9e, 0x62, 0x95, 0xb8, 0x62, 0x61, 0x1d, 0x89, 0x4d, 0x5a, 0x74,
- 0x09, 0xa6, 0x9c, 0x5d, 0xc7, 0xe5, 0x29, 0x1e, 0x24, 0x03, 0x7e, 0xc7, 0x52, 0xba, 0xe8, 0xf9,
- 0x24, 0x01, 0x4e, 0x97, 0x41, 0x6f, 0x00, 0xf2, 0x6f, 0xb2, 0xc7, 0x18, 0xf5, 0x4b, 0xc4, 0x13,
- 0x56, 0x77, 0x36, 0x76, 0xc5, 0x78, 0x4b, 0xb8, 0x9a, 0xa2, 0xc0, 0x19, 0xa5, 0x12, 0xc1, 0xeb,
- 0x06, 0xf2, 0x83, 0xd7, 0x75, 0xde, 0x17, 0xbb, 0xa6, 0x9d, 0xbb, 0x08, 0x63, 0x87, 0x74, 0x31,
- 0xb6, 0xff, 0x9d, 0x05, 0x4a, 0x41, 0x6c, 0x06, 0x9f, 0x7e, 0x95, 0xf9, 0x40, 0x73, 0xd5, 0xb6,
- 0x16, 0x6f, 0xea, 0xb8, 0xe6, 0x03, 0x1d, 0x23, 0xb1, 0x49, 0xcb, 0xe7, 0x90, 0xe6, 0xbb, 0x6c,
- 0xdc, 0x0a, 0x44, 0x6c, 0x4c, 0x45, 0x81, 0x3e, 0x0e, 0x83, 0x75, 0x77, 0xd7, 0x0d, 0x85, 0x72,
- 0xec, 0xd0, 0xc6, 0xb8, 0x78, 0xeb, 0x5c, 0xe2, 0x6c, 0xb0, 0xe4, 0x67, 0xff, 0x48, 0x21, 0xee,
- 0x93, 0x37, 0xdb, 0x7e, 0xe4, 0x1c, 0xc1, 0x49, 0x7e, 0xc9, 0x38, 0xc9, 0x1f, 0xcf, 0x1e, 0x68,
- 0xad, 0x49, 0xb9, 0x27, 0xf8, 0xd5, 0xc4, 0x09, 0xfe, 0x44, 0x77, 0x56, 0x9d, 0x4f, 0xee, 0x5f,
- 0xb3, 0x60, 0xca, 0xa0, 0x3f, 0x82, 0x03, 0x64, 0xc5, 0x3c, 0x40, 0x1e, 0xe9, 0xfa, 0x0d, 0x39,
- 0x07, 0xc7, 0x0f, 0x16, 0x13, 0x6d, 0x67, 0x07, 0xc6, 0x3b, 0xd0, 0xb7, 0xed, 0x04, 0x75, 0x71,
- 0x2f, 0xbe, 0xd0, 0x53, 0x5f, 0xcf, 0x5d, 0x76, 0x02, 0xe1, 0xa9, 0xf0, 0x8c, 0xec, 0x75, 0x0a,
- 0xea, 0xea, 0xa5, 0xc0, 0xaa, 0x42, 0x2f, 0xc3, 0x40, 0x58, 0xf3, 0x5b, 0xea, 0x5d, 0x16, 0xcb,
- 0x65, 0x5c, 0x65, 0x90, 0x83, 0xfd, 0x12, 0x32, 0xab, 0xa3, 0x60, 0x2c, 0xe8, 0xd1, 0x5b, 0x30,
- 0xc6, 0x7e, 0x29, 0xb7, 0xc1, 0x62, 0xbe, 0x06, 0xa3, 0xaa, 0x13, 0x72, 0x9f, 0x5a, 0x03, 0x84,
- 0x4d, 0x56, 0xb3, 0x5b, 0x30, 0xac, 0x3e, 0xeb, 0x81, 0x5a, 0xbb, 0xff, 0x4d, 0x11, 0xa6, 0x33,
- 0xe6, 0x1c, 0x0a, 0x8d, 0x91, 0xb8, 0xd8, 0xe3, 0x54, 0x7d, 0x97, 0x63, 0x11, 0xb2, 0x0b, 0x54,
- 0x5d, 0xcc, 0xad, 0x9e, 0x2b, 0xbd, 0x16, 0x92, 0x64, 0xa5, 0x14, 0xd4, 0xbd, 0x52, 0x5a, 0xd9,
- 0x91, 0x75, 0x35, 0xad, 0x48, 0xb5, 0xf4, 0x81, 0x8e, 0xe9, 0x6f, 0xf5, 0xc1, 0xb1, 0xac, 0x98,
- 0xc5, 0xe8, 0xb3, 0x89, 0x04, 0xe9, 0x2f, 0x74, 0xea, 0x61, 0xbd, 0x24, 0xcf, 0x9a, 0x2e, 0x42,
- 0x85, 0xce, 0x99, 0x29, 0xd3, 0xbb, 0x76, 0xb3, 0xa8, 0x93, 0x85, 0xf0, 0x09, 0x78, 0x62, 0x7b,
- 0xb9, 0x7d, 0x7c, 0xa8, 0xe7, 0x06, 0x88, 0x8c, 0xf8, 0x61, 0xc2, 0x25, 0x49, 0x82, 0xbb, 0xbb,
- 0x24, 0xc9, 0x9a, 0x51, 0x19, 0x06, 0x6a, 0xdc, 0xd7, 0xa5, 0xd8, 0x7d, 0x0b, 0xe3, 0x8e, 0x2e,
- 0x6a, 0x03, 0x16, 0x0e, 0x2e, 0x82, 0xc1, 0xac, 0x0b, 0x23, 0x5a, 0xc7, 0x3c, 0xd0, 0xc9, 0xb3,
- 0x43, 0x0f, 0x3e, 0xad, 0x0b, 0x1e, 0xe8, 0x04, 0xfa, 0x71, 0x0b, 0x12, 0x8f, 0x6a, 0x94, 0x52,
- 0xce, 0xca, 0x55, 0xca, 0x9d, 0x85, 0xbe, 0xc0, 0x6f, 0x90, 0x64, 0xf6, 0x6d, 0xec, 0x37, 0x08,
- 0x66, 0x18, 0x4a, 0x11, 0xc5, 0xaa, 0x96, 0x51, 0xfd, 0x1a, 0x29, 0x2e, 0x88, 0x8f, 0x42, 0x7f,
- 0x83, 0xec, 0x92, 0x46, 0x32, 0x49, 0xe2, 0x2a, 0x05, 0x62, 0x8e, 0xb3, 0x7f, 0xb9, 0x0f, 0x4e,
- 0x77, 0x8c, 0xa7, 0x45, 0x2f, 0x63, 0x5b, 0x4e, 0x44, 0x6e, 0x39, 0x7b, 0xc9, 0x1c, 0x66, 0x97,
- 0x38, 0x18, 0x4b, 0x3c, 0x7b, 0x62, 0xca, 0xf3, 0x83, 0x24, 0x54, 0x98, 0x22, 0x2d, 0x88, 0xc0,
- 0x9a, 0x2a, 0xb1, 0xe2, 0xfd, 0x50, 0x89, 0x3d, 0x07, 0x10, 0x86, 0x0d, 0xee, 0x16, 0x58, 0x17,
- 0x6f, 0x57, 0xe3, 0x3c, 0x32, 0xd5, 0x55, 0x81, 0xc1, 0x1a, 0x15, 0x5a, 0x82, 0xc9, 0x56, 0xe0,
- 0x47, 0x5c, 0x23, 0xbc, 0xc4, 0x3d, 0x67, 0xfb, 0xcd, 0x50, 0x46, 0x95, 0x04, 0x1e, 0xa7, 0x4a,
- 0xa0, 0x17, 0x61, 0x44, 0x84, 0x37, 0xaa, 0xf8, 0x7e, 0x43, 0x28, 0xa1, 0x94, 0x33, 0x69, 0x35,
- 0x46, 0x61, 0x9d, 0x4e, 0x2b, 0xc6, 0xd4, 0xcc, 0x83, 0x99, 0xc5, 0xb8, 0xaa, 0x59, 0xa3, 0x4b,
- 0x84, 0x42, 0x1f, 0xea, 0x29, 0x14, 0x7a, 0xac, 0x96, 0x1b, 0xee, 0xd9, 0xea, 0x09, 0x5d, 0x15,
- 0x59, 0x5f, 0xed, 0x83, 0x69, 0x31, 0x71, 0x1e, 0xf4, 0x74, 0xb9, 0x96, 0x9e, 0x2e, 0xf7, 0x43,
- 0x71, 0xf7, 0xfe, 0x9c, 0x39, 0xea, 0x39, 0xf3, 0xa3, 0x16, 0x98, 0x92, 0x1a, 0xfa, 0x9f, 0x72,
- 0x93, 0x40, 0xbe, 0x98, 0x2b, 0xf9, 0xc5, 0x71, 0x92, 0xdf, 0x5d, 0x3a, 0x48, 0xfb, 0x8f, 0x2d,
- 0x78, 0xa4, 0x2b, 0x47, 0xb4, 0x0c, 0xc3, 0x4c, 0x9c, 0xd4, 0x2e, 0x7a, 0x4f, 0x28, 0xcf, 0x7a,
- 0x89, 0xc8, 0x91, 0x6e, 0xe3, 0x92, 0x68, 0x39, 0x95, 0x6d, 0xf3, 0xc9, 0x8c, 0x6c, 0x9b, 0xc7,
- 0x8d, 0xee, 0xb9, 0xc7, 0x74, 0x9b, 0x5f, 0xa4, 0x27, 0x8e, 0xf9, 0x72, 0xee, 0x43, 0x86, 0xd2,
- 0xd1, 0x4e, 0x28, 0x1d, 0x91, 0x49, 0xad, 0x9d, 0x21, 0x1f, 0x85, 0x49, 0x16, 0xf7, 0x90, 0xbd,
- 0xf3, 0x10, 0x4f, 0xee, 0x0a, 0xb1, 0x2f, 0xf7, 0x6a, 0x02, 0x87, 0x53, 0xd4, 0xf6, 0x5f, 0x16,
- 0x61, 0x80, 0x2f, 0xbf, 0x23, 0xb8, 0x5e, 0x3e, 0x0d, 0xc3, 0x6e, 0xb3, 0xd9, 0xe6, 0x09, 0x14,
- 0xfb, 0x63, 0xcf, 0xe0, 0xb2, 0x04, 0xe2, 0x18, 0x8f, 0x56, 0x84, 0xbe, 0xbb, 0x43, 0x68, 0x65,
- 0xde, 0xf0, 0xb9, 0x25, 0x27, 0x72, 0xb8, 0xac, 0xa4, 0xce, 0xd9, 0x58, 0x33, 0x8e, 0x3e, 0x05,
- 0x10, 0x46, 0x81, 0xeb, 0x6d, 0x51, 0x98, 0x88, 0xbf, 0xff, 0x54, 0x07, 0x6e, 0x55, 0x45, 0xcc,
- 0x79, 0xc6, 0x7b, 0x8e, 0x42, 0x60, 0x8d, 0x23, 0x9a, 0x33, 0x4e, 0xfa, 0xd9, 0xc4, 0xd8, 0x01,
- 0xe7, 0x1a, 0x8f, 0xd9, 0xec, 0x4b, 0x30, 0xac, 0x98, 0x77, 0xd3, 0x7e, 0x8d, 0xea, 0x62, 0xd1,
- 0x47, 0x60, 0x22, 0xd1, 0xb6, 0x43, 0x29, 0xcf, 0x7e, 0xc5, 0x82, 0x09, 0xde, 0x98, 0x65, 0x6f,
- 0x57, 0x9c, 0x06, 0x77, 0xe0, 0x58, 0x23, 0x63, 0x57, 0x16, 0xc3, 0xdf, 0xfb, 0x2e, 0xae, 0x94,
- 0x65, 0x59, 0x58, 0x9c, 0x59, 0x07, 0x3a, 0x4f, 0x57, 0x1c, 0xdd, 0x75, 0x9d, 0x86, 0x88, 0xa1,
- 0x30, 0xca, 0x57, 0x1b, 0x87, 0x61, 0x85, 0xb5, 0xff, 0xd4, 0x82, 0x29, 0xde, 0xf2, 0x2b, 0x64,
- 0x4f, 0xed, 0x4d, 0xdf, 0xca, 0xb6, 0x8b, 0xd4, 0xbd, 0x85, 0x9c, 0xd4, 0xbd, 0xfa, 0xa7, 0x15,
- 0x3b, 0x7e, 0xda, 0x57, 0x2c, 0x10, 0x33, 0xe4, 0x08, 0xf4, 0x19, 0xdf, 0x65, 0xea, 0x33, 0x66,
- 0xf3, 0x17, 0x41, 0x8e, 0x22, 0xe3, 0xef, 0x2d, 0x98, 0xe4, 0x04, 0xb1, 0xad, 0xfe, 0x5b, 0x3a,
- 0x0e, 0x0b, 0xe6, 0x17, 0x65, 0x3a, 0x5f, 0x5e, 0x21, 0x7b, 0x1b, 0x7e, 0xc5, 0x89, 0xb6, 0xb3,
- 0x3f, 0xca, 0x18, 0xac, 0xbe, 0x8e, 0x83, 0x55, 0x97, 0x0b, 0xc8, 0x48, 0x37, 0xd7, 0x25, 0x08,
- 0xc1, 0x61, 0xd3, 0xcd, 0xd9, 0x7f, 0x65, 0x01, 0xe2, 0xd5, 0x18, 0x82, 0x1b, 0x15, 0x87, 0x18,
- 0x54, 0x3b, 0xe8, 0xe2, 0xad, 0x49, 0x61, 0xb0, 0x46, 0x75, 0x5f, 0xba, 0x27, 0xe1, 0x70, 0x51,
- 0xec, 0xee, 0x70, 0x71, 0x88, 0x1e, 0xfd, 0xca, 0x20, 0x24, 0x5f, 0xf6, 0xa1, 0xeb, 0x30, 0x5a,
- 0x73, 0x5a, 0xce, 0x4d, 0xb7, 0xe1, 0x46, 0x2e, 0x09, 0x3b, 0x79, 0x63, 0x2d, 0x6a, 0x74, 0xc2,
- 0x44, 0xae, 0x41, 0xb0, 0xc1, 0x07, 0xcd, 0x01, 0xb4, 0x02, 0x77, 0xd7, 0x6d, 0x90, 0x2d, 0xa6,
- 0x76, 0x61, 0x51, 0x5b, 0xb8, 0x6b, 0x98, 0x84, 0x62, 0x8d, 0x22, 0x23, 0x54, 0x43, 0xf1, 0x01,
- 0x87, 0x6a, 0x80, 0x23, 0x0b, 0xd5, 0xd0, 0x77, 0xa8, 0x50, 0x0d, 0x43, 0x87, 0x0e, 0xd5, 0xd0,
- 0xdf, 0x53, 0xa8, 0x06, 0x0c, 0x27, 0xa4, 0xec, 0x49, 0xff, 0xaf, 0xb8, 0x0d, 0x22, 0x2e, 0x1c,
- 0x3c, 0xd4, 0xcc, 0xec, 0xdd, 0xfd, 0xd2, 0x09, 0x9c, 0x49, 0x81, 0x73, 0x4a, 0xa2, 0x8f, 0xc1,
- 0x8c, 0xd3, 0x68, 0xf8, 0xb7, 0xd4, 0xa0, 0x2e, 0x87, 0x35, 0xa7, 0xc1, 0x4d, 0x20, 0x83, 0x8c,
- 0xeb, 0xa9, 0xbb, 0xfb, 0xa5, 0x99, 0xf9, 0x1c, 0x1a, 0x9c, 0x5b, 0x1a, 0xbd, 0x06, 0xc3, 0xad,
- 0xc0, 0xaf, 0xad, 0x69, 0xcf, 0x8f, 0xcf, 0xd0, 0x0e, 0xac, 0x48, 0xe0, 0xc1, 0x7e, 0x69, 0x4c,
- 0xfd, 0x61, 0x07, 0x7e, 0x5c, 0x20, 0x23, 0xf6, 0xc2, 0xc8, 0x83, 0x8e, 0xbd, 0x30, 0x7a, 0xbf,
- 0x63, 0x2f, 0xec, 0xc0, 0x74, 0x95, 0x04, 0xae, 0xd3, 0x70, 0xef, 0x50, 0x99, 0x5c, 0xee, 0x81,
- 0x1b, 0x30, 0x1c, 0x24, 0x76, 0xfd, 0x9e, 0x42, 0x2a, 0x6b, 0x59, 0xc5, 0xe4, 0x2e, 0x1f, 0x33,
- 0xb2, 0xff, 0xab, 0x05, 0x83, 0xe2, 0xb5, 0xe0, 0x11, 0x48, 0xa6, 0xf3, 0x86, 0xe1, 0xa3, 0x94,
- 0x3d, 0x28, 0xac, 0x31, 0xb9, 0x26, 0x8f, 0x72, 0xc2, 0xe4, 0xf1, 0x48, 0x27, 0x26, 0x9d, 0x8d,
- 0x1d, 0xff, 0x67, 0x91, 0xde, 0x10, 0x8c, 0x77, 0xeb, 0x0f, 0xbe, 0x0b, 0xd6, 0x61, 0x30, 0x14,
- 0xef, 0xa6, 0x0b, 0xf9, 0x2f, 0x4e, 0x92, 0x83, 0x18, 0x7b, 0xea, 0x89, 0x97, 0xd2, 0x92, 0x49,
- 0xe6, 0x83, 0xec, 0xe2, 0x03, 0x7c, 0x90, 0xdd, 0xed, 0x65, 0x7f, 0xdf, 0xfd, 0x78, 0xd9, 0x6f,
- 0x7f, 0x9d, 0x9d, 0xce, 0x3a, 0xfc, 0x08, 0x04, 0xb7, 0x4b, 0xe6, 0x39, 0x6e, 0x77, 0x98, 0x59,
- 0xa2, 0x51, 0x39, 0x02, 0xdc, 0x2f, 0x59, 0x70, 0x3a, 0xe3, 0xab, 0x34, 0x69, 0xee, 0x19, 0x18,
- 0x72, 0xda, 0x75, 0x57, 0xad, 0x65, 0xcd, 0xfc, 0x39, 0x2f, 0xe0, 0x58, 0x51, 0xa0, 0x45, 0x98,
- 0x22, 0xb7, 0x5b, 0x2e, 0x37, 0x16, 0xeb, 0x0e, 0xce, 0x45, 0xfe, 0xc4, 0x74, 0x39, 0x89, 0xc4,
- 0x69, 0x7a, 0x15, 0xe8, 0xaa, 0x98, 0x1b, 0xe8, 0xea, 0x17, 0x2c, 0x18, 0x51, 0x2f, 0x87, 0x1f,
- 0x78, 0x6f, 0x7f, 0xd4, 0xec, 0xed, 0x87, 0x3b, 0xf4, 0x76, 0x4e, 0x37, 0xff, 0x51, 0x41, 0xb5,
- 0xb7, 0xe2, 0x07, 0x51, 0x0f, 0x52, 0xe2, 0xbd, 0x3f, 0xce, 0xb8, 0x08, 0x23, 0x4e, 0xab, 0x25,
- 0x11, 0xd2, 0xcb, 0x8e, 0x05, 0xc8, 0x8f, 0xc1, 0x58, 0xa7, 0x51, 0x6f, 0x45, 0x8a, 0xb9, 0x6f,
- 0x45, 0xea, 0x00, 0x91, 0x13, 0x6c, 0x91, 0x88, 0xc2, 0x84, 0x53, 0x70, 0xfe, 0x7e, 0xd3, 0x8e,
- 0xdc, 0xc6, 0x9c, 0xeb, 0x45, 0x61, 0x14, 0xcc, 0x95, 0xbd, 0xe8, 0x6a, 0xc0, 0xaf, 0xa9, 0x5a,
- 0xa8, 0x38, 0xc5, 0x0b, 0x6b, 0x7c, 0x65, 0x94, 0x0c, 0x56, 0x47, 0xbf, 0xe9, 0xae, 0xb1, 0x2e,
- 0xe0, 0x58, 0x51, 0xd8, 0x2f, 0xb1, 0xd3, 0x87, 0xf5, 0xe9, 0xe1, 0xc2, 0xa4, 0xfd, 0xf5, 0xa8,
- 0x1a, 0x0d, 0x66, 0x78, 0x5d, 0xd2, 0x83, 0xb1, 0x75, 0xde, 0xec, 0x69, 0xc5, 0xfa, 0xab, 0xcb,
- 0x38, 0x62, 0x1b, 0xfa, 0x44, 0xca, 0x05, 0xe7, 0xd9, 0x2e, 0xa7, 0xc6, 0x21, 0x9c, 0x6e, 0x58,
- 0xb6, 0x2c, 0x96, 0x4b, 0xa8, 0x5c, 0x11, 0xeb, 0x42, 0xcb, 0x96, 0x25, 0x10, 0x38, 0xa6, 0xa1,
- 0x02, 0x9b, 0xfa, 0x13, 0xce, 0xa0, 0x38, 0xa8, 0xb2, 0xa2, 0x0e, 0xb1, 0x46, 0x81, 0x2e, 0x08,
- 0xa5, 0x05, 0xb7, 0x3d, 0x3c, 0x9c, 0x50, 0x5a, 0xc8, 0xee, 0xd2, 0x34, 0x4d, 0x17, 0x61, 0x84,
- 0xdc, 0x8e, 0x48, 0xe0, 0x39, 0x0d, 0x5a, 0x43, 0x7f, 0x1c, 0x07, 0x74, 0x39, 0x06, 0x63, 0x9d,
- 0x06, 0x6d, 0xc0, 0x44, 0xc8, 0x75, 0x79, 0x2a, 0x94, 0x3f, 0xd7, 0x89, 0x3e, 0xa5, 0xde, 0x6c,
- 0x9b, 0xe8, 0x03, 0x06, 0xe2, 0xbb, 0x93, 0x8c, 0x64, 0x91, 0x64, 0x81, 0x5e, 0x87, 0xf1, 0x86,
- 0xef, 0xd4, 0x17, 0x9c, 0x86, 0xe3, 0xd5, 0x58, 0xff, 0x0c, 0x99, 0x39, 0xd7, 0x57, 0x0d, 0x2c,
- 0x4e, 0x50, 0x53, 0x01, 0x51, 0x87, 0x88, 0x70, 0x73, 0x8e, 0xb7, 0x45, 0xc2, 0x99, 0x61, 0xf6,
- 0x55, 0x4c, 0x40, 0x5c, 0xcd, 0xa1, 0xc1, 0xb9, 0xa5, 0xd1, 0xcb, 0x30, 0x2a, 0x3f, 0x5f, 0x0b,
- 0xfc, 0x12, 0x3f, 0xbb, 0xd1, 0x70, 0xd8, 0xa0, 0x44, 0x21, 0x1c, 0x97, 0xff, 0x37, 0x02, 0x67,
- 0x73, 0xd3, 0xad, 0x89, 0x68, 0x08, 0xfc, 0x89, 0xf2, 0x47, 0xe4, 0x7b, 0xc8, 0xe5, 0x2c, 0xa2,
- 0x83, 0xfd, 0xd2, 0x29, 0xd1, 0x6b, 0x99, 0x78, 0x9c, 0xcd, 0x1b, 0xad, 0xc1, 0xf4, 0x36, 0x71,
- 0x1a, 0xd1, 0xf6, 0xe2, 0x36, 0xa9, 0xed, 0xc8, 0x05, 0xc7, 0xa4, 0x46, 0xed, 0x79, 0xca, 0xe5,
- 0x34, 0x09, 0xce, 0x2a, 0x87, 0xde, 0x86, 0x99, 0x56, 0xfb, 0x66, 0xc3, 0x0d, 0xb7, 0xd7, 0xfd,
- 0x88, 0x39, 0x3a, 0xcd, 0xd7, 0xeb, 0x01, 0x09, 0xf9, 0x0b, 0x56, 0x76, 0xf4, 0xca, 0x60, 0x3d,
- 0x95, 0x1c, 0x3a, 0x9c, 0xcb, 0x01, 0xdd, 0x81, 0xe3, 0x89, 0x89, 0x20, 0xa2, 0x6e, 0x8c, 0xe7,
- 0x27, 0xf2, 0xa9, 0x66, 0x15, 0x10, 0x01, 0x6c, 0xb2, 0x50, 0x38, 0xbb, 0x0a, 0xf4, 0x0a, 0x80,
- 0xdb, 0x5a, 0x71, 0x9a, 0x6e, 0x83, 0x5e, 0x47, 0xa7, 0xd9, 0x1c, 0xa1, 0x57, 0x13, 0x28, 0x57,
- 0x24, 0x94, 0xee, 0xcd, 0xe2, 0xdf, 0x1e, 0xd6, 0xa8, 0xd1, 0x2a, 0x8c, 0x8b, 0x7f, 0x7b, 0x62,
- 0x48, 0xa7, 0x54, 0xce, 0xc7, 0x71, 0x59, 0x42, 0x8d, 0x63, 0x02, 0x82, 0x13, 0x65, 0xd1, 0x16,
- 0x9c, 0x96, 0x09, 0x27, 0xf5, 0xf9, 0x29, 0xc7, 0x20, 0x64, 0xd9, 0x73, 0x86, 0xf8, 0xcb, 0x97,
- 0xf9, 0x4e, 0x84, 0xb8, 0x33, 0x1f, 0x7a, 0xae, 0xeb, 0xd3, 0x9c, 0xbf, 0x6b, 0x3e, 0x1e, 0x47,
- 0x4e, 0x5c, 0x4d, 0x22, 0x71, 0x9a, 0x1e, 0xf9, 0x70, 0xdc, 0xf5, 0xb2, 0x66, 0xf5, 0x09, 0xc6,
- 0xe8, 0xc3, 0xfc, 0x49, 0x77, 0xe7, 0x19, 0x9d, 0x89, 0xc7, 0xd9, 0x7c, 0x51, 0x19, 0xa6, 0x23,
- 0x0e, 0x58, 0x72, 0x43, 0x9e, 0x9c, 0x83, 0x5e, 0xfb, 0x1e, 0xe2, 0x29, 0xf1, 0xe9, 0x6c, 0xde,
- 0x48, 0xa3, 0x71, 0x56, 0x99, 0x77, 0xe7, 0xa6, 0xf8, 0x27, 0x16, 0x2d, 0xad, 0x09, 0xfa, 0xe8,
- 0xd3, 0x30, 0xaa, 0xf7, 0x8f, 0x10, 0x5a, 0xce, 0x65, 0xcb, 0xc1, 0xda, 0xf6, 0xc2, 0xaf, 0x09,
- 0x6a, 0x0b, 0xd1, 0x71, 0xd8, 0xe0, 0x88, 0x6a, 0x19, 0xa1, 0x18, 0x2e, 0xf4, 0x26, 0x14, 0xf5,
- 0xee, 0xa5, 0x47, 0x20, 0x7b, 0xe5, 0xa0, 0x55, 0x18, 0xaa, 0x35, 0x5c, 0xe2, 0x45, 0xe5, 0x4a,
- 0xa7, 0x80, 0x96, 0x8b, 0x82, 0x46, 0x2c, 0x45, 0x91, 0x53, 0x87, 0xc3, 0xb0, 0xe2, 0x60, 0xbf,
- 0x0c, 0x23, 0xd5, 0x06, 0x21, 0x2d, 0xfe, 0xda, 0x08, 0x3d, 0xc9, 0x2e, 0x26, 0x4c, 0xb4, 0xb4,
- 0x98, 0x68, 0xa9, 0xdf, 0x39, 0x98, 0x50, 0x29, 0xf1, 0xf6, 0xef, 0x14, 0xa0, 0xd4, 0x25, 0xb5,
- 0x53, 0xc2, 0xde, 0x66, 0xf5, 0x64, 0x6f, 0x9b, 0x87, 0x89, 0xf8, 0x9f, 0xae, 0xca, 0x53, 0x2e,
- 0xbb, 0xd7, 0x4d, 0x34, 0x4e, 0xd2, 0xf7, 0xfc, 0xfa, 0x42, 0x37, 0xd9, 0xf5, 0x75, 0x7d, 0x3f,
- 0x64, 0x98, 0xea, 0xfb, 0x7b, 0xbf, 0x7b, 0xe7, 0x9a, 0x5d, 0xed, 0xaf, 0x17, 0xe0, 0xb8, 0xea,
- 0xc2, 0xef, 0xdc, 0x8e, 0xbb, 0x96, 0xee, 0xb8, 0xfb, 0x60, 0xb4, 0xb6, 0xaf, 0xc2, 0x00, 0x8f,
- 0xed, 0xd9, 0x83, 0xcc, 0xff, 0xa8, 0x19, 0x72, 0x5c, 0x89, 0x99, 0x46, 0xd8, 0xf1, 0x1f, 0xb2,
- 0x60, 0x22, 0xf1, 0x8c, 0x0f, 0x61, 0xed, 0xad, 0xf7, 0xbd, 0xc8, 0xe5, 0x59, 0x12, 0xff, 0x59,
- 0xe8, 0xdb, 0xf6, 0xc3, 0x28, 0xe9, 0xd1, 0x72, 0xd9, 0x0f, 0x23, 0xcc, 0x30, 0xf6, 0x9f, 0x59,
- 0xd0, 0xbf, 0xe1, 0xb8, 0x5e, 0x24, 0xad, 0x1f, 0x56, 0x8e, 0xf5, 0xa3, 0x97, 0xef, 0x42, 0x2f,
- 0xc2, 0x00, 0xd9, 0xdc, 0x24, 0xb5, 0x48, 0x8c, 0xaa, 0x8c, 0xf9, 0x30, 0xb0, 0xcc, 0xa0, 0x54,
- 0x08, 0x65, 0x95, 0xf1, 0xbf, 0x58, 0x10, 0xa3, 0x1b, 0x30, 0x1c, 0xb9, 0x4d, 0x32, 0x5f, 0xaf,
- 0x0b, 0x9f, 0x80, 0x7b, 0x08, 0x54, 0xb2, 0x21, 0x19, 0xe0, 0x98, 0x97, 0xfd, 0xa5, 0x02, 0x40,
- 0x1c, 0xb0, 0xac, 0xdb, 0x27, 0x2e, 0xa4, 0xac, 0xc5, 0xe7, 0x32, 0xac, 0xc5, 0x28, 0x66, 0x98,
- 0x61, 0x2a, 0x56, 0xdd, 0x54, 0xec, 0xa9, 0x9b, 0xfa, 0x0e, 0xd3, 0x4d, 0x8b, 0x30, 0x15, 0x07,
- 0x5c, 0x33, 0xe3, 0x4d, 0xb2, 0xf3, 0x7b, 0x23, 0x89, 0xc4, 0x69, 0x7a, 0x9b, 0xc0, 0x59, 0x15,
- 0x77, 0x4a, 0x9c, 0x85, 0xcc, 0xe1, 0x5d, 0xb7, 0xbe, 0x77, 0xe9, 0xa7, 0xd8, 0x1c, 0x5e, 0xc8,
- 0x35, 0x87, 0xff, 0x94, 0x05, 0xc7, 0x92, 0xf5, 0xb0, 0xd7, 0xe1, 0x5f, 0xb0, 0xe0, 0x78, 0x9c,
- 0xd9, 0x24, 0xed, 0x82, 0xf0, 0x42, 0xc7, 0x58, 0x5a, 0x39, 0x2d, 0x8e, 0x83, 0x8b, 0xac, 0x65,
- 0xb1, 0xc6, 0xd9, 0x35, 0xda, 0xff, 0xa5, 0x0f, 0x66, 0xf2, 0x82, 0x70, 0xb1, 0xf7, 0x30, 0xce,
- 0xed, 0xea, 0x0e, 0xb9, 0x25, 0x5e, 0x1d, 0xc4, 0xef, 0x61, 0x38, 0x18, 0x4b, 0x7c, 0x32, 0x99,
- 0x4d, 0xa1, 0xc7, 0x64, 0x36, 0xdb, 0x30, 0x75, 0x6b, 0x9b, 0x78, 0xd7, 0xbc, 0xd0, 0x89, 0xdc,
- 0x70, 0xd3, 0x65, 0x06, 0x74, 0x3e, 0x6f, 0x64, 0x42, 0xf6, 0xa9, 0x1b, 0x49, 0x82, 0x83, 0xfd,
- 0xd2, 0x69, 0x03, 0x10, 0x37, 0x99, 0x6f, 0x24, 0x38, 0xcd, 0x34, 0x9d, 0x0b, 0xa8, 0xef, 0x01,
- 0xe7, 0x02, 0x6a, 0xba, 0xc2, 0xed, 0x46, 0x3e, 0x76, 0x60, 0xd7, 0xd6, 0x35, 0x05, 0xc5, 0x1a,
- 0x05, 0xfa, 0x24, 0x20, 0x3d, 0x99, 0x9b, 0x11, 0x03, 0xf5, 0xd9, 0xbb, 0xfb, 0x25, 0xb4, 0x9e,
- 0xc2, 0x1e, 0xec, 0x97, 0xa6, 0x29, 0xb4, 0xec, 0xd1, 0xeb, 0x6f, 0x1c, 0x38, 0x2e, 0x83, 0x11,
- 0xba, 0x01, 0x93, 0x14, 0xca, 0x56, 0x94, 0x0c, 0xb0, 0xca, 0xaf, 0xac, 0x4f, 0xdf, 0xdd, 0x2f,
- 0x4d, 0xae, 0x27, 0x70, 0x79, 0xac, 0x53, 0x4c, 0x32, 0x52, 0x02, 0x0d, 0xf5, 0x9a, 0x12, 0xc8,
- 0xfe, 0x82, 0x05, 0x27, 0xe9, 0x01, 0x57, 0x5f, 0xcd, 0xb1, 0xa2, 0x3b, 0x2d, 0x97, 0xdb, 0x69,
- 0xc4, 0x51, 0xc3, 0x74, 0x75, 0x95, 0x32, 0xb7, 0xd2, 0x28, 0x2c, 0xdd, 0xe1, 0x77, 0x5c, 0xaf,
- 0x9e, 0xdc, 0xe1, 0xaf, 0xb8, 0x5e, 0x1d, 0x33, 0x8c, 0x3a, 0xb2, 0x8a, 0xb9, 0x6f, 0x2e, 0xbe,
- 0x4a, 0xd7, 0x2a, 0x6d, 0xcb, 0xb7, 0xb4, 0x19, 0xe8, 0x69, 0xdd, 0xa6, 0x2a, 0xdc, 0x27, 0x73,
- 0xed, 0xa9, 0x9f, 0xb7, 0x40, 0xbc, 0xd1, 0xee, 0xe1, 0x4c, 0x7e, 0x0b, 0x46, 0x77, 0xd3, 0x89,
- 0x2e, 0xcf, 0xe6, 0x3f, 0x5a, 0x17, 0xe1, 0xeb, 0x95, 0x88, 0x6e, 0x24, 0xb5, 0x34, 0x78, 0xd9,
- 0x75, 0x10, 0xd8, 0x25, 0xc2, 0xac, 0x1a, 0xdd, 0x5b, 0xf3, 0x1c, 0x40, 0x9d, 0xd1, 0xb2, 0xec,
- 0xd7, 0x05, 0x53, 0xe2, 0x5a, 0x52, 0x18, 0xac, 0x51, 0xd9, 0x3f, 0x57, 0x84, 0x11, 0x99, 0x58,
- 0xb1, 0xed, 0xf5, 0xa2, 0x7b, 0x3c, 0x54, 0xa6, 0x75, 0xf4, 0x36, 0x4c, 0x05, 0xa4, 0xd6, 0x0e,
- 0x42, 0x77, 0x97, 0x48, 0xb4, 0x58, 0x24, 0x73, 0x3c, 0xa8, 0x7e, 0x02, 0x79, 0xc0, 0x02, 0x39,
- 0x25, 0x80, 0xcc, 0x68, 0x9c, 0x66, 0x84, 0x2e, 0xc0, 0x30, 0x53, 0xbd, 0x57, 0x62, 0x85, 0xb0,
- 0x52, 0x7c, 0xad, 0x49, 0x04, 0x8e, 0x69, 0xd8, 0xe5, 0xa0, 0x7d, 0x93, 0x91, 0x27, 0xde, 0x2b,
- 0x57, 0x39, 0x18, 0x4b, 0x3c, 0xfa, 0x18, 0x4c, 0xf2, 0x72, 0x81, 0xdf, 0x72, 0xb6, 0xb8, 0x49,
- 0xb0, 0x5f, 0x05, 0x81, 0x99, 0x5c, 0x4b, 0xe0, 0x0e, 0xf6, 0x4b, 0xc7, 0x92, 0x30, 0xd6, 0xec,
- 0x14, 0x17, 0xe6, 0xf9, 0xc7, 0x2b, 0xa1, 0x67, 0x46, 0xca, 0x61, 0x30, 0x46, 0x61, 0x9d, 0xce,
- 0xfe, 0x3b, 0x0b, 0xa6, 0xb4, 0xa1, 0xea, 0x39, 0xaf, 0x81, 0xd1, 0x49, 0x85, 0x1e, 0x3a, 0xe9,
- 0x70, 0x31, 0x09, 0x32, 0x47, 0xb8, 0xef, 0x3e, 0x8d, 0xb0, 0xfd, 0x69, 0x40, 0xe9, 0xac, 0x9d,
- 0xe8, 0x0d, 0xee, 0x2e, 0xef, 0x06, 0xa4, 0xde, 0xc9, 0xe0, 0xaf, 0xc7, 0x77, 0x91, 0xef, 0x2b,
- 0x79, 0x29, 0xac, 0xca, 0xdb, 0x3f, 0xdc, 0x07, 0x93, 0xc9, 0x88, 0x12, 0xe8, 0x32, 0x0c, 0x70,
- 0x29, 0x5d, 0xb0, 0xef, 0xe0, 0x4f, 0xa6, 0xc5, 0xa1, 0x60, 0xf2, 0x8a, 0x10, 0xf4, 0x45, 0x79,
- 0xf4, 0x36, 0x8c, 0xd4, 0xfd, 0x5b, 0xde, 0x2d, 0x27, 0xa8, 0xcf, 0x57, 0xca, 0x62, 0x87, 0xc8,
- 0x54, 0x40, 0x2d, 0xc5, 0x64, 0x7a, 0x6c, 0x0b, 0xe6, 0x3b, 0x11, 0xa3, 0xb0, 0xce, 0x0e, 0x6d,
- 0xb0, 0x44, 0x34, 0x9b, 0xee, 0xd6, 0x9a, 0xd3, 0xea, 0xf4, 0x76, 0x6a, 0x51, 0x12, 0x69, 0x9c,
- 0xc7, 0x44, 0xb6, 0x1a, 0x8e, 0xc0, 0x31, 0x23, 0xf4, 0x59, 0x98, 0x0e, 0x73, 0x4c, 0x62, 0x79,
- 0x49, 0x9c, 0x3b, 0x59, 0x89, 0xb8, 0x32, 0x25, 0xcb, 0x78, 0x96, 0x55, 0x0d, 0xba, 0x0d, 0x48,
- 0xa8, 0x9e, 0x37, 0x82, 0x76, 0x18, 0x2d, 0xb4, 0xbd, 0x7a, 0x43, 0x26, 0xaa, 0xc9, 0x4e, 0xf3,
- 0x9e, 0xa2, 0xd6, 0xea, 0x66, 0x11, 0x66, 0xd3, 0x14, 0x38, 0xa3, 0x0e, 0xfb, 0xf3, 0x7d, 0x30,
- 0x2b, 0xd3, 0xe4, 0x66, 0xbc, 0x11, 0xf9, 0x9c, 0x95, 0x78, 0x24, 0xf2, 0x4a, 0xfe, 0x46, 0xff,
- 0xc0, 0x9e, 0x8a, 0x7c, 0x31, 0xfd, 0x54, 0xe4, 0xb5, 0x43, 0x36, 0xe3, 0xbe, 0x3d, 0x18, 0xf9,
- 0x8e, 0x7d, 0xe5, 0xf1, 0xe5, 0x63, 0x60, 0x1c, 0xcd, 0x08, 0xf3, 0xf0, 0xdd, 0x15, 0x69, 0x3a,
- 0xca, 0xb9, 0xfe, 0x5f, 0x16, 0x34, 0xc6, 0x61, 0x3f, 0x2a, 0x83, 0x7c, 0xb3, 0x7d, 0x56, 0xf1,
- 0xa1, 0x3c, 0x49, 0xb3, 0x15, 0xed, 0x2d, 0xb9, 0x81, 0x68, 0x71, 0x26, 0xcf, 0x65, 0x41, 0x93,
- 0xe6, 0x29, 0x31, 0x58, 0xf1, 0x41, 0xbb, 0x30, 0xb5, 0x55, 0x23, 0x89, 0xcc, 0xf2, 0xc5, 0xfc,
- 0x75, 0x7b, 0x69, 0x71, 0xb9, 0x43, 0x5a, 0x79, 0x76, 0xf9, 0x4b, 0x91, 0xe0, 0x74, 0x15, 0x2c,
- 0xab, 0xbd, 0x73, 0x2b, 0x5c, 0x6e, 0x38, 0x61, 0xe4, 0xd6, 0x16, 0x1a, 0x7e, 0x6d, 0xa7, 0x1a,
- 0xf9, 0x81, 0x4c, 0x6b, 0x97, 0x79, 0xf7, 0x9a, 0xbf, 0x51, 0x4d, 0xd1, 0xa7, 0xb3, 0xda, 0x67,
- 0x51, 0xe1, 0xcc, 0xba, 0xd0, 0x3a, 0x0c, 0x6e, 0xb9, 0x11, 0x26, 0x2d, 0x5f, 0xec, 0x16, 0x99,
- 0x5b, 0xe1, 0x25, 0x4e, 0x92, 0xce, 0x32, 0x2f, 0x10, 0x58, 0x32, 0x41, 0x6f, 0xa8, 0x43, 0x60,
- 0x20, 0x5f, 0x01, 0x9b, 0xf6, 0xbd, 0xcb, 0x3c, 0x06, 0x5e, 0x87, 0xa2, 0xb7, 0x19, 0x76, 0x8a,
- 0x18, 0xb3, 0xbe, 0x52, 0x4d, 0x67, 0x7f, 0x5f, 0x5f, 0xa9, 0x62, 0x5a, 0x90, 0x3d, 0x2e, 0x0d,
- 0x6b, 0xa1, 0x2b, 0x12, 0xf4, 0x64, 0xbe, 0xb5, 0x2d, 0x57, 0x17, 0xab, 0xe5, 0x74, 0xc6, 0x7b,
- 0x06, 0xc6, 0xbc, 0x38, 0xba, 0x0e, 0xc3, 0x5b, 0x7c, 0xe3, 0xdb, 0x0c, 0x45, 0xaa, 0xec, 0xcc,
- 0xc3, 0xe8, 0x92, 0x24, 0x4a, 0xe7, 0xb9, 0x57, 0x28, 0x1c, 0xb3, 0x42, 0x9f, 0xb7, 0xe0, 0x78,
- 0x32, 0xd7, 0x38, 0x7b, 0x12, 0x26, 0xdc, 0xd4, 0x5e, 0xec, 0x25, 0xf9, 0x3b, 0x2b, 0x60, 0x54,
- 0xc8, 0xcc, 0x2f, 0x99, 0x64, 0x38, 0xbb, 0x3a, 0xda, 0xd1, 0xc1, 0xcd, 0x7a, 0xa7, 0x4c, 0x32,
- 0x89, 0xf0, 0x39, 0xbc, 0xa3, 0xf1, 0xc2, 0x12, 0xa6, 0x05, 0xd1, 0x06, 0xc0, 0x66, 0x83, 0x88,
- 0xb8, 0x84, 0xc2, 0x29, 0x2a, 0xf3, 0xf4, 0x5f, 0x51, 0x54, 0x32, 0x27, 0x15, 0x15, 0xb3, 0x63,
- 0x28, 0xd6, 0xf8, 0xd0, 0xa9, 0x54, 0x73, 0xbd, 0x3a, 0x09, 0x98, 0x71, 0x2b, 0x67, 0x2a, 0x2d,
- 0x32, 0x8a, 0xf4, 0x54, 0xe2, 0x70, 0x2c, 0x38, 0x30, 0x5e, 0xa4, 0xb5, 0xbd, 0x19, 0x76, 0x4a,
- 0x8c, 0xb0, 0x48, 0x5a, 0xdb, 0x89, 0x09, 0xc5, 0x79, 0x31, 0x38, 0x16, 0x1c, 0xe8, 0x92, 0xd9,
- 0xa4, 0x0b, 0x88, 0x04, 0x33, 0x13, 0xf9, 0x4b, 0x66, 0x85, 0x93, 0xa4, 0x97, 0x8c, 0x40, 0x60,
- 0xc9, 0x04, 0x7d, 0xca, 0x94, 0x76, 0x26, 0x19, 0xcf, 0xa7, 0xbb, 0x48, 0x3b, 0x06, 0xdf, 0xce,
- 0xf2, 0xce, 0x2b, 0x50, 0xd8, 0xac, 0x31, 0xa3, 0x58, 0x8e, 0xcd, 0x60, 0x65, 0xd1, 0xe0, 0xc6,
- 0x02, 0x8d, 0xaf, 0x2c, 0xe2, 0xc2, 0x66, 0x8d, 0x4e, 0x7d, 0xe7, 0x4e, 0x3b, 0x20, 0x2b, 0x6e,
- 0x83, 0x88, 0x24, 0x09, 0x99, 0x53, 0x7f, 0x5e, 0x12, 0xa5, 0xa7, 0xbe, 0x42, 0xe1, 0x98, 0x15,
- 0xe5, 0x1b, 0xcb, 0x60, 0xd3, 0xf9, 0x7c, 0x95, 0xa8, 0x95, 0xe6, 0x9b, 0x29, 0x85, 0xed, 0xc0,
- 0xd8, 0x6e, 0xd8, 0xda, 0x26, 0x72, 0x57, 0x64, 0xe6, 0xba, 0x9c, 0x78, 0x0a, 0xd7, 0x05, 0xa1,
- 0x1b, 0x44, 0x6d, 0xa7, 0x91, 0xda, 0xc8, 0x99, 0x6a, 0xe5, 0xba, 0xce, 0x0c, 0x9b, 0xbc, 0xe9,
- 0x44, 0x78, 0x87, 0x07, 0x3d, 0x63, 0x86, 0xbb, 0x9c, 0x89, 0x90, 0x11, 0x17, 0x8d, 0x4f, 0x04,
- 0x81, 0xc0, 0x92, 0x89, 0xea, 0x6c, 0x76, 0x00, 0x9d, 0xe8, 0xd2, 0xd9, 0xa9, 0xf6, 0xc6, 0x9d,
- 0xcd, 0x0e, 0x9c, 0x98, 0x15, 0x3b, 0x68, 0x5a, 0x19, 0x69, 0xd9, 0x99, 0xd9, 0x2e, 0xe7, 0xa0,
- 0xe9, 0x96, 0xc6, 0x9d, 0x1f, 0x34, 0x59, 0x54, 0x38, 0xb3, 0x2e, 0xfa, 0x71, 0x2d, 0x19, 0xbf,
- 0x4e, 0x24, 0x72, 0x78, 0x32, 0x27, 0xfc, 0x63, 0x3a, 0xc8, 0x1d, 0xff, 0x38, 0x85, 0xc2, 0x31,
- 0x2b, 0x54, 0x87, 0xf1, 0x96, 0x11, 0x17, 0x95, 0x25, 0xa4, 0xc8, 0x91, 0x0b, 0xb2, 0x22, 0xa8,
- 0x72, 0x0d, 0x91, 0x89, 0xc1, 0x09, 0x9e, 0xcc, 0x73, 0x8f, 0x3f, 0xf5, 0x63, 0xf9, 0x2a, 0x72,
- 0x86, 0x3a, 0xe3, 0x35, 0x20, 0x1f, 0x6a, 0x81, 0xc0, 0x92, 0x09, 0xed, 0x0d, 0xf1, 0x40, 0xcd,
- 0x0f, 0x59, 0xda, 0x97, 0x3c, 0x03, 0x7b, 0x96, 0x99, 0x48, 0x06, 0x03, 0x17, 0x28, 0x1c, 0xb3,
- 0xa2, 0x3b, 0x39, 0x3d, 0xf0, 0x4e, 0xe5, 0xef, 0xe4, 0xc9, 0xe3, 0x8e, 0xed, 0xe4, 0xf4, 0xb0,
- 0x2b, 0x8a, 0xa3, 0x4e, 0xc5, 0xae, 0x66, 0x29, 0x2b, 0x72, 0xda, 0xa5, 0x82, 0x5f, 0xa7, 0xdb,
- 0xa5, 0x50, 0x38, 0x66, 0x65, 0xff, 0x70, 0x01, 0xce, 0x74, 0x5e, 0x6f, 0xb1, 0xed, 0xab, 0x12,
- 0xfb, 0x1a, 0x25, 0x6c, 0x5f, 0x5c, 0x13, 0x13, 0x53, 0xf5, 0x1c, 0xce, 0xf6, 0x12, 0x4c, 0xa9,
- 0x67, 0x84, 0x0d, 0xb7, 0xb6, 0xb7, 0x1e, 0x2b, 0xbf, 0x54, 0xe0, 0x97, 0x6a, 0x92, 0x00, 0xa7,
- 0xcb, 0xa0, 0x79, 0x98, 0x30, 0x80, 0xe5, 0x25, 0x71, 0x6d, 0x8f, 0x93, 0x24, 0x98, 0x68, 0x9c,
- 0xa4, 0xb7, 0x7f, 0xde, 0x82, 0x87, 0x72, 0xb2, 0x62, 0xf7, 0x1c, 0xad, 0x75, 0x13, 0x26, 0x5a,
- 0x66, 0xd1, 0x2e, 0x01, 0xa6, 0x8d, 0xdc, 0xdb, 0xaa, 0xad, 0x09, 0x04, 0x4e, 0x32, 0xb5, 0x7f,
- 0xb6, 0x00, 0xa7, 0x3b, 0xfa, 0xc5, 0x23, 0x0c, 0x27, 0xb6, 0x9a, 0xa1, 0xb3, 0x18, 0x90, 0x3a,
- 0xf1, 0x22, 0xd7, 0x69, 0x54, 0x5b, 0xa4, 0xa6, 0x59, 0x2f, 0x99, 0x83, 0xf9, 0xa5, 0xb5, 0xea,
- 0x7c, 0x9a, 0x02, 0xe7, 0x94, 0x44, 0x2b, 0x80, 0xd2, 0x18, 0x31, 0xc2, 0xec, 0x6a, 0x9a, 0xe6,
- 0x87, 0x33, 0x4a, 0xa0, 0x97, 0x60, 0x4c, 0xf9, 0xdb, 0x6b, 0x23, 0xce, 0x36, 0x76, 0xac, 0x23,
- 0xb0, 0x49, 0x87, 0x2e, 0xf2, 0xec, 0x39, 0x22, 0xcf, 0x92, 0x30, 0x75, 0x4e, 0xc8, 0xd4, 0x38,
- 0x02, 0x8c, 0x75, 0x9a, 0x85, 0x97, 0x7f, 0xef, 0x9b, 0x67, 0x3e, 0xf0, 0x87, 0xdf, 0x3c, 0xf3,
- 0x81, 0x3f, 0xfd, 0xe6, 0x99, 0x0f, 0x7c, 0xdf, 0xdd, 0x33, 0xd6, 0xef, 0xdd, 0x3d, 0x63, 0xfd,
- 0xe1, 0xdd, 0x33, 0xd6, 0x9f, 0xde, 0x3d, 0x63, 0xfd, 0xfb, 0xbb, 0x67, 0xac, 0x2f, 0xfd, 0xc5,
- 0x99, 0x0f, 0xbc, 0x85, 0xe2, 0xf8, 0xc7, 0x17, 0xe8, 0xe8, 0x5c, 0xd8, 0xbd, 0xf8, 0x3f, 0x02,
- 0x00, 0x00, 0xff, 0xff, 0xfd, 0xca, 0x84, 0xba, 0xa5, 0x1e, 0x01, 0x00,
+ // 16056 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x79, 0x90, 0x1c, 0xd7,
+ 0x79, 0x18, 0xae, 0x9e, 0xd9, 0xf3, 0xdb, 0xfb, 0x2d, 0x8e, 0xc5, 0x12, 0xc0, 0x80, 0x4d, 0x12,
+ 0x04, 0xaf, 0x85, 0xc0, 0x43, 0x84, 0x48, 0x8a, 0xe6, 0x9e, 0xc0, 0x12, 0xd8, 0xc5, 0xf0, 0xcd,
+ 0x02, 0x90, 0x28, 0x4a, 0x56, 0x63, 0xe6, 0xed, 0x6e, 0x6b, 0x67, 0xba, 0x87, 0xdd, 0x3d, 0x0b,
+ 0x2c, 0x7e, 0x72, 0xd9, 0x96, 0x7f, 0x96, 0x2d, 0xd9, 0xa9, 0x52, 0xb9, 0x9c, 0x38, 0x25, 0xbb,
+ 0x5c, 0x29, 0xc7, 0xf1, 0x11, 0xc5, 0x4e, 0x14, 0x39, 0xb6, 0x63, 0xf9, 0xca, 0x55, 0x65, 0x27,
+ 0x29, 0xc7, 0x71, 0x55, 0x24, 0x57, 0x5c, 0x59, 0x47, 0xeb, 0x54, 0xb9, 0xfc, 0x47, 0x6c, 0x97,
+ 0x93, 0x3f, 0x92, 0x2d, 0x27, 0x4e, 0xbd, 0xb3, 0xdf, 0xeb, 0x63, 0x66, 0x16, 0x04, 0x56, 0x14,
+ 0x8b, 0xff, 0xcd, 0xbc, 0xef, 0x7b, 0xdf, 0x7b, 0xfd, 0xce, 0xef, 0x7d, 0x27, 0xd8, 0x5b, 0x17,
+ 0xc3, 0x19, 0xd7, 0x3f, 0xef, 0x34, 0xdd, 0xf3, 0x55, 0x3f, 0x20, 0xe7, 0xb7, 0x2f, 0x9c, 0xdf,
+ 0x20, 0x1e, 0x09, 0x9c, 0x88, 0xd4, 0x66, 0x9a, 0x81, 0x1f, 0xf9, 0x08, 0x71, 0x9c, 0x19, 0xa7,
+ 0xe9, 0xce, 0x50, 0x9c, 0x99, 0xed, 0x0b, 0xd3, 0xcf, 0x6c, 0xb8, 0xd1, 0x66, 0xeb, 0xd6, 0x4c,
+ 0xd5, 0x6f, 0x9c, 0xdf, 0xf0, 0x37, 0xfc, 0xf3, 0x0c, 0xf5, 0x56, 0x6b, 0x9d, 0xfd, 0x63, 0x7f,
+ 0xd8, 0x2f, 0x4e, 0x62, 0xfa, 0xf9, 0xb8, 0x99, 0x86, 0x53, 0xdd, 0x74, 0x3d, 0x12, 0xec, 0x9c,
+ 0x6f, 0x6e, 0x6d, 0xb0, 0x76, 0x03, 0x12, 0xfa, 0xad, 0xa0, 0x4a, 0x92, 0x0d, 0xb7, 0xad, 0x15,
+ 0x9e, 0x6f, 0x90, 0xc8, 0xc9, 0xe8, 0xee, 0xf4, 0xf9, 0xbc, 0x5a, 0x41, 0xcb, 0x8b, 0xdc, 0x46,
+ 0xba, 0x99, 0x0f, 0x75, 0xaa, 0x10, 0x56, 0x37, 0x49, 0xc3, 0x49, 0xd5, 0x7b, 0x2e, 0xaf, 0x5e,
+ 0x2b, 0x72, 0xeb, 0xe7, 0x5d, 0x2f, 0x0a, 0xa3, 0x20, 0x59, 0xc9, 0xfe, 0x86, 0x05, 0x67, 0x66,
+ 0x6f, 0x56, 0x16, 0xeb, 0x4e, 0x18, 0xb9, 0xd5, 0xb9, 0xba, 0x5f, 0xdd, 0xaa, 0x44, 0x7e, 0x40,
+ 0x6e, 0xf8, 0xf5, 0x56, 0x83, 0x54, 0xd8, 0x40, 0xa0, 0xa7, 0x61, 0x60, 0x9b, 0xfd, 0x5f, 0x5e,
+ 0x98, 0xb2, 0xce, 0x58, 0xe7, 0x06, 0xe7, 0xc6, 0x7f, 0x67, 0xb7, 0xf4, 0x81, 0xbd, 0xdd, 0xd2,
+ 0xc0, 0x0d, 0x51, 0x8e, 0x15, 0x06, 0x3a, 0x0b, 0x7d, 0xeb, 0xe1, 0xda, 0x4e, 0x93, 0x4c, 0x15,
+ 0x18, 0xee, 0xa8, 0xc0, 0xed, 0x5b, 0xaa, 0xd0, 0x52, 0x2c, 0xa0, 0xe8, 0x3c, 0x0c, 0x36, 0x9d,
+ 0x20, 0x72, 0x23, 0xd7, 0xf7, 0xa6, 0x8a, 0x67, 0xac, 0x73, 0xbd, 0x73, 0x13, 0x02, 0x75, 0xb0,
+ 0x2c, 0x01, 0x38, 0xc6, 0xa1, 0xdd, 0x08, 0x88, 0x53, 0xbb, 0xe6, 0xd5, 0x77, 0xa6, 0x7a, 0xce,
+ 0x58, 0xe7, 0x06, 0xe2, 0x6e, 0x60, 0x51, 0x8e, 0x15, 0x86, 0xfd, 0xa5, 0x02, 0x0c, 0xcc, 0xae,
+ 0xaf, 0xbb, 0x9e, 0x1b, 0xed, 0xa0, 0x1b, 0x30, 0xec, 0xf9, 0x35, 0x22, 0xff, 0xb3, 0xaf, 0x18,
+ 0x7a, 0xf6, 0xcc, 0x4c, 0x7a, 0x29, 0xcd, 0xac, 0x6a, 0x78, 0x73, 0xe3, 0x7b, 0xbb, 0xa5, 0x61,
+ 0xbd, 0x04, 0x1b, 0x74, 0x10, 0x86, 0xa1, 0xa6, 0x5f, 0x53, 0x64, 0x0b, 0x8c, 0x6c, 0x29, 0x8b,
+ 0x6c, 0x39, 0x46, 0x9b, 0x1b, 0xdb, 0xdb, 0x2d, 0x0d, 0x69, 0x05, 0x58, 0x27, 0x82, 0x6e, 0xc1,
+ 0x18, 0xfd, 0xeb, 0x45, 0xae, 0xa2, 0x5b, 0x64, 0x74, 0x1f, 0xc9, 0xa3, 0xab, 0xa1, 0xce, 0x4d,
+ 0xee, 0xed, 0x96, 0xc6, 0x12, 0x85, 0x38, 0x49, 0xd0, 0xfe, 0x61, 0x0b, 0xc6, 0x66, 0x9b, 0xcd,
+ 0xd9, 0xa0, 0xe1, 0x07, 0xe5, 0xc0, 0x5f, 0x77, 0xeb, 0x04, 0xbd, 0x08, 0x3d, 0x11, 0x9d, 0x35,
+ 0x3e, 0xc3, 0x8f, 0x88, 0xa1, 0xed, 0xa1, 0x73, 0xb5, 0xbf, 0x5b, 0x9a, 0x4c, 0xa0, 0xb3, 0xa9,
+ 0x64, 0x15, 0xd0, 0x6b, 0x30, 0x5e, 0xf7, 0xab, 0x4e, 0x7d, 0xd3, 0x0f, 0x23, 0x01, 0x15, 0x53,
+ 0x7f, 0x64, 0x6f, 0xb7, 0x34, 0x7e, 0x35, 0x01, 0xc3, 0x29, 0x6c, 0xfb, 0x2e, 0x8c, 0xce, 0x46,
+ 0x91, 0x53, 0xdd, 0x24, 0x35, 0xbe, 0xa0, 0xd0, 0xf3, 0xd0, 0xe3, 0x39, 0x0d, 0xd9, 0x99, 0x33,
+ 0xb2, 0x33, 0xab, 0x4e, 0x83, 0x76, 0x66, 0xfc, 0xba, 0xe7, 0xbe, 0xdd, 0x12, 0x8b, 0x94, 0x96,
+ 0x61, 0x86, 0x8d, 0x9e, 0x05, 0xa8, 0x91, 0x6d, 0xb7, 0x4a, 0xca, 0x4e, 0xb4, 0x29, 0xfa, 0x80,
+ 0x44, 0x5d, 0x58, 0x50, 0x10, 0xac, 0x61, 0xd9, 0x77, 0x60, 0x70, 0x76, 0xdb, 0x77, 0x6b, 0x65,
+ 0xbf, 0x16, 0xa2, 0x2d, 0x18, 0x6b, 0x06, 0x64, 0x9d, 0x04, 0xaa, 0x68, 0xca, 0x3a, 0x53, 0x3c,
+ 0x37, 0xf4, 0xec, 0xb9, 0xcc, 0xb1, 0x37, 0x51, 0x17, 0xbd, 0x28, 0xd8, 0x99, 0x3b, 0x2e, 0xda,
+ 0x1b, 0x4b, 0x40, 0x71, 0x92, 0xb2, 0xfd, 0xaf, 0x0b, 0x70, 0x74, 0xf6, 0x6e, 0x2b, 0x20, 0x0b,
+ 0x6e, 0xb8, 0x95, 0xdc, 0x70, 0x35, 0x37, 0xdc, 0x5a, 0x8d, 0x47, 0x40, 0xad, 0xf4, 0x05, 0x51,
+ 0x8e, 0x15, 0x06, 0x7a, 0x06, 0xfa, 0xe9, 0xef, 0xeb, 0x78, 0x59, 0x7c, 0xf2, 0xa4, 0x40, 0x1e,
+ 0x5a, 0x70, 0x22, 0x67, 0x81, 0x83, 0xb0, 0xc4, 0x41, 0x2b, 0x30, 0x54, 0x65, 0xe7, 0xc3, 0xc6,
+ 0x8a, 0x5f, 0x23, 0x6c, 0x6d, 0x0d, 0xce, 0x3d, 0x45, 0xd1, 0xe7, 0xe3, 0xe2, 0xfd, 0xdd, 0xd2,
+ 0x14, 0xef, 0x9b, 0x20, 0xa1, 0xc1, 0xb0, 0x5e, 0x1f, 0xd9, 0x6a, 0xbb, 0xf7, 0x30, 0x4a, 0x90,
+ 0xb1, 0xd5, 0xcf, 0x69, 0x3b, 0xb7, 0x97, 0xed, 0xdc, 0xe1, 0xec, 0x5d, 0x8b, 0x2e, 0x40, 0xcf,
+ 0x96, 0xeb, 0xd5, 0xa6, 0xfa, 0x18, 0xad, 0x53, 0x74, 0xce, 0xaf, 0xb8, 0x5e, 0x6d, 0x7f, 0xb7,
+ 0x34, 0x61, 0x74, 0x87, 0x16, 0x62, 0x86, 0x6a, 0xff, 0x0f, 0x0b, 0x4a, 0x0c, 0xb6, 0xe4, 0xd6,
+ 0x49, 0x99, 0x04, 0xa1, 0x1b, 0x46, 0xc4, 0x8b, 0x8c, 0x01, 0x7d, 0x16, 0x20, 0x24, 0xd5, 0x80,
+ 0x44, 0xda, 0x90, 0xaa, 0x85, 0x51, 0x51, 0x10, 0xac, 0x61, 0xd1, 0xf3, 0x29, 0xdc, 0x74, 0x02,
+ 0xb6, 0xbe, 0xc4, 0xc0, 0xaa, 0xf3, 0xa9, 0x22, 0x01, 0x38, 0xc6, 0x31, 0xce, 0xa7, 0x62, 0xa7,
+ 0xf3, 0x09, 0x7d, 0x04, 0xc6, 0xe2, 0xc6, 0xc2, 0xa6, 0x53, 0x95, 0x03, 0xc8, 0x76, 0x70, 0xc5,
+ 0x04, 0xe1, 0x24, 0xae, 0xfd, 0x0f, 0x2d, 0xb1, 0x78, 0xe8, 0x57, 0xbf, 0xcb, 0xbf, 0xd5, 0xfe,
+ 0x55, 0x0b, 0xfa, 0xe7, 0x5c, 0xaf, 0xe6, 0x7a, 0x1b, 0xe8, 0x53, 0x30, 0x40, 0xaf, 0xca, 0x9a,
+ 0x13, 0x39, 0xe2, 0x18, 0xfe, 0xa0, 0xb6, 0xb7, 0xd4, 0xcd, 0x35, 0xd3, 0xdc, 0xda, 0xa0, 0x05,
+ 0xe1, 0x0c, 0xc5, 0xa6, 0xbb, 0xed, 0xda, 0xad, 0x4f, 0x93, 0x6a, 0xb4, 0x42, 0x22, 0x27, 0xfe,
+ 0x9c, 0xb8, 0x0c, 0x2b, 0xaa, 0xe8, 0x0a, 0xf4, 0x45, 0x4e, 0xb0, 0x41, 0x22, 0x71, 0x1e, 0x67,
+ 0x9e, 0x9b, 0xbc, 0x26, 0xa6, 0x3b, 0x92, 0x78, 0x55, 0x12, 0xdf, 0x52, 0x6b, 0xac, 0x2a, 0x16,
+ 0x24, 0xec, 0xff, 0xd3, 0x0f, 0x27, 0xe6, 0x2b, 0xcb, 0x39, 0xeb, 0xea, 0x2c, 0xf4, 0xd5, 0x02,
+ 0x77, 0x9b, 0x04, 0x62, 0x9c, 0x15, 0x95, 0x05, 0x56, 0x8a, 0x05, 0x14, 0x5d, 0x84, 0x61, 0x7e,
+ 0x3f, 0x5e, 0x76, 0xbc, 0x5a, 0x7c, 0x3c, 0x0a, 0xec, 0xe1, 0x1b, 0x1a, 0x0c, 0x1b, 0x98, 0x07,
+ 0x5c, 0x54, 0x67, 0x13, 0x9b, 0x31, 0xef, 0xee, 0xfd, 0xbc, 0x05, 0xe3, 0xbc, 0x99, 0xd9, 0x28,
+ 0x0a, 0xdc, 0x5b, 0xad, 0x88, 0x84, 0x53, 0xbd, 0xec, 0xa4, 0x9b, 0xcf, 0x1a, 0xad, 0xdc, 0x11,
+ 0x98, 0xb9, 0x91, 0xa0, 0xc2, 0x0f, 0xc1, 0x29, 0xd1, 0xee, 0x78, 0x12, 0x8c, 0x53, 0xcd, 0xa2,
+ 0xef, 0xb3, 0x60, 0xba, 0xea, 0x7b, 0x51, 0xe0, 0xd7, 0xeb, 0x24, 0x28, 0xb7, 0x6e, 0xd5, 0xdd,
+ 0x70, 0x93, 0xaf, 0x53, 0x4c, 0xd6, 0xd9, 0x49, 0x90, 0x33, 0x87, 0x0a, 0x49, 0xcc, 0xe1, 0xe9,
+ 0xbd, 0xdd, 0xd2, 0xf4, 0x7c, 0x2e, 0x29, 0xdc, 0xa6, 0x19, 0xb4, 0x05, 0x88, 0xde, 0xec, 0x95,
+ 0xc8, 0xd9, 0x20, 0x71, 0xe3, 0xfd, 0xdd, 0x37, 0x7e, 0x6c, 0x6f, 0xb7, 0x84, 0x56, 0x53, 0x24,
+ 0x70, 0x06, 0x59, 0xf4, 0x36, 0x1c, 0xa1, 0xa5, 0xa9, 0x6f, 0x1d, 0xe8, 0xbe, 0xb9, 0xa9, 0xbd,
+ 0xdd, 0xd2, 0x91, 0xd5, 0x0c, 0x22, 0x38, 0x93, 0x34, 0xfa, 0x1e, 0x0b, 0x4e, 0xc4, 0x9f, 0xbf,
+ 0x78, 0xa7, 0xe9, 0x78, 0xb5, 0xb8, 0xe1, 0xc1, 0xee, 0x1b, 0xa6, 0x67, 0xf2, 0x89, 0xf9, 0x3c,
+ 0x4a, 0x38, 0xbf, 0x11, 0xe4, 0xc1, 0x24, 0xed, 0x5a, 0xb2, 0x6d, 0xe8, 0xbe, 0xed, 0xe3, 0x7b,
+ 0xbb, 0xa5, 0xc9, 0xd5, 0x34, 0x0d, 0x9c, 0x45, 0x78, 0x7a, 0x1e, 0x8e, 0x66, 0xae, 0x4e, 0x34,
+ 0x0e, 0xc5, 0x2d, 0xc2, 0x99, 0xc0, 0x41, 0x4c, 0x7f, 0xa2, 0x23, 0xd0, 0xbb, 0xed, 0xd4, 0x5b,
+ 0x62, 0x63, 0x62, 0xfe, 0xe7, 0xa5, 0xc2, 0x45, 0xcb, 0xfe, 0x37, 0x45, 0x18, 0x9b, 0xaf, 0x2c,
+ 0xdf, 0xd3, 0xae, 0xd7, 0xaf, 0xbd, 0x42, 0xdb, 0x6b, 0x2f, 0xbe, 0x44, 0x8b, 0xb9, 0x97, 0xe8,
+ 0x77, 0x67, 0x6c, 0xd9, 0x1e, 0xb6, 0x65, 0x3f, 0x9c, 0xb3, 0x65, 0xef, 0xf3, 0x46, 0xdd, 0xce,
+ 0x59, 0xb5, 0xbd, 0x6c, 0x02, 0x33, 0x39, 0x24, 0xc6, 0xfb, 0x25, 0x8f, 0xda, 0x03, 0x2e, 0xdd,
+ 0xfb, 0x33, 0x8f, 0x55, 0x18, 0x9e, 0x77, 0x9a, 0xce, 0x2d, 0xb7, 0xee, 0x46, 0x2e, 0x09, 0xd1,
+ 0xe3, 0x50, 0x74, 0x6a, 0x35, 0xc6, 0xdd, 0x0d, 0xce, 0x1d, 0xdd, 0xdb, 0x2d, 0x15, 0x67, 0x6b,
+ 0x94, 0xcd, 0x00, 0x85, 0xb5, 0x83, 0x29, 0x06, 0x7a, 0x12, 0x7a, 0x6a, 0x81, 0xdf, 0x9c, 0x2a,
+ 0x30, 0x4c, 0xba, 0xcb, 0x7b, 0x16, 0x02, 0xbf, 0x99, 0x40, 0x65, 0x38, 0xf6, 0x6f, 0x17, 0xe0,
+ 0xe4, 0x3c, 0x69, 0x6e, 0x2e, 0x55, 0x72, 0xee, 0x8b, 0x73, 0x30, 0xd0, 0xf0, 0x3d, 0x37, 0xf2,
+ 0x83, 0x50, 0x34, 0xcd, 0x56, 0xc4, 0x8a, 0x28, 0xc3, 0x0a, 0x8a, 0xce, 0x40, 0x4f, 0x33, 0x66,
+ 0x62, 0x87, 0x25, 0x03, 0xcc, 0xd8, 0x57, 0x06, 0xa1, 0x18, 0xad, 0x90, 0x04, 0x62, 0xc5, 0x28,
+ 0x8c, 0xeb, 0x21, 0x09, 0x30, 0x83, 0xc4, 0x9c, 0x00, 0xe5, 0x11, 0xc4, 0x8d, 0x90, 0xe0, 0x04,
+ 0x28, 0x04, 0x6b, 0x58, 0xa8, 0x0c, 0x83, 0x61, 0x62, 0x66, 0xbb, 0xda, 0x9a, 0x23, 0x8c, 0x55,
+ 0x50, 0x33, 0x19, 0x13, 0x31, 0x6e, 0xb0, 0xbe, 0x8e, 0xac, 0xc2, 0xd7, 0x0a, 0x80, 0xf8, 0x10,
+ 0x7e, 0x9b, 0x0d, 0xdc, 0xf5, 0xf4, 0xc0, 0x75, 0xbf, 0x25, 0xee, 0xd7, 0xe8, 0xfd, 0x4f, 0x0b,
+ 0x4e, 0xce, 0xbb, 0x5e, 0x8d, 0x04, 0x39, 0x0b, 0xf0, 0xc1, 0x3c, 0xe5, 0x0f, 0xc6, 0xa4, 0x18,
+ 0x4b, 0xac, 0xe7, 0x3e, 0x2c, 0x31, 0xfb, 0x2f, 0x2c, 0x40, 0xfc, 0xb3, 0xdf, 0x75, 0x1f, 0x7b,
+ 0x3d, 0xfd, 0xb1, 0xf7, 0x61, 0x59, 0xd8, 0x57, 0x61, 0x74, 0xbe, 0xee, 0x12, 0x2f, 0x5a, 0x2e,
+ 0xcf, 0xfb, 0xde, 0xba, 0xbb, 0x81, 0x5e, 0x82, 0xd1, 0xc8, 0x6d, 0x10, 0xbf, 0x15, 0x55, 0x48,
+ 0xd5, 0xf7, 0xd8, 0xcb, 0xd5, 0x3a, 0xd7, 0x3b, 0x87, 0xf6, 0x76, 0x4b, 0xa3, 0x6b, 0x06, 0x04,
+ 0x27, 0x30, 0xed, 0x9f, 0xa1, 0xe7, 0x56, 0xbd, 0x15, 0x46, 0x24, 0x58, 0x0b, 0x5a, 0x61, 0x34,
+ 0xd7, 0xa2, 0xbc, 0x67, 0x39, 0xf0, 0x69, 0x77, 0x5c, 0xdf, 0x43, 0x27, 0x8d, 0xe7, 0xf8, 0x80,
+ 0x7c, 0x8a, 0x8b, 0x67, 0xf7, 0x0c, 0x40, 0xe8, 0x6e, 0x78, 0x24, 0xd0, 0x9e, 0x0f, 0xa3, 0x6c,
+ 0xab, 0xa8, 0x52, 0xac, 0x61, 0xa0, 0x3a, 0x8c, 0xd4, 0x9d, 0x5b, 0xa4, 0x5e, 0x21, 0x75, 0x52,
+ 0x8d, 0xfc, 0x40, 0xc8, 0x37, 0x9e, 0xeb, 0xee, 0x1d, 0x70, 0x55, 0xaf, 0x3a, 0x37, 0xb1, 0xb7,
+ 0x5b, 0x1a, 0x31, 0x8a, 0xb0, 0x49, 0x9c, 0x1e, 0x1d, 0x7e, 0x93, 0x7e, 0x85, 0x53, 0xd7, 0x1f,
+ 0x9f, 0xd7, 0x44, 0x19, 0x56, 0x50, 0x75, 0x74, 0xf4, 0xe4, 0x1d, 0x1d, 0xf6, 0x1f, 0xd1, 0x85,
+ 0xe6, 0x37, 0x9a, 0xbe, 0x47, 0xbc, 0x68, 0xde, 0xf7, 0x6a, 0x5c, 0x32, 0xf5, 0x92, 0x21, 0x3a,
+ 0x39, 0x9b, 0x10, 0x9d, 0x1c, 0x4b, 0xd7, 0xd0, 0xa4, 0x27, 0x1f, 0x86, 0xbe, 0x30, 0x72, 0xa2,
+ 0x56, 0x28, 0x06, 0xee, 0x61, 0xb9, 0xec, 0x2a, 0xac, 0x74, 0x7f, 0xb7, 0x34, 0xa6, 0xaa, 0xf1,
+ 0x22, 0x2c, 0x2a, 0xa0, 0x27, 0xa0, 0xbf, 0x41, 0xc2, 0xd0, 0xd9, 0x90, 0x6c, 0xc3, 0x98, 0xa8,
+ 0xdb, 0xbf, 0xc2, 0x8b, 0xb1, 0x84, 0xa3, 0x47, 0xa0, 0x97, 0x04, 0x81, 0x1f, 0x88, 0x6f, 0x1b,
+ 0x11, 0x88, 0xbd, 0x8b, 0xb4, 0x10, 0x73, 0x98, 0xfd, 0x1f, 0x2c, 0x18, 0x53, 0x7d, 0xe5, 0x6d,
+ 0x1d, 0xc2, 0x73, 0xed, 0x4d, 0x80, 0xaa, 0xfc, 0xc0, 0x90, 0x5d, 0xb3, 0x43, 0xcf, 0x9e, 0xcd,
+ 0xe4, 0x68, 0x52, 0xc3, 0x18, 0x53, 0x56, 0x45, 0x21, 0xd6, 0xa8, 0xd9, 0xbf, 0x61, 0xc1, 0x64,
+ 0xe2, 0x8b, 0xae, 0xba, 0x61, 0x84, 0xde, 0x4a, 0x7d, 0xd5, 0x4c, 0x97, 0x8b, 0xcf, 0x0d, 0xf9,
+ 0x37, 0xa9, 0x3d, 0x2f, 0x4b, 0xb4, 0x2f, 0xba, 0x0c, 0xbd, 0x6e, 0x44, 0x1a, 0xf2, 0x63, 0x1e,
+ 0x69, 0xfb, 0x31, 0xbc, 0x57, 0xf1, 0x8c, 0x2c, 0xd3, 0x9a, 0x98, 0x13, 0xb0, 0x7f, 0xbb, 0x08,
+ 0x83, 0x7c, 0x7f, 0xaf, 0x38, 0xcd, 0x43, 0x98, 0x8b, 0xa7, 0x60, 0xd0, 0x6d, 0x34, 0x5a, 0x91,
+ 0x73, 0x4b, 0xdc, 0x7b, 0x03, 0xfc, 0x0c, 0x5a, 0x96, 0x85, 0x38, 0x86, 0xa3, 0x65, 0xe8, 0x61,
+ 0x5d, 0xe1, 0x5f, 0xf9, 0x78, 0xf6, 0x57, 0x8a, 0xbe, 0xcf, 0x2c, 0x38, 0x91, 0xc3, 0x59, 0x4e,
+ 0xb5, 0xaf, 0x68, 0x11, 0x66, 0x24, 0x90, 0x03, 0x70, 0xcb, 0xf5, 0x9c, 0x60, 0x87, 0x96, 0x4d,
+ 0x15, 0x19, 0xc1, 0x67, 0xda, 0x13, 0x9c, 0x53, 0xf8, 0x9c, 0xac, 0xfa, 0xb0, 0x18, 0x80, 0x35,
+ 0xa2, 0xd3, 0x2f, 0xc2, 0xa0, 0x42, 0x3e, 0x08, 0xe7, 0x38, 0xfd, 0x11, 0x18, 0x4b, 0xb4, 0xd5,
+ 0xa9, 0xfa, 0xb0, 0xce, 0x78, 0xfe, 0x1a, 0x3b, 0x32, 0x44, 0xaf, 0x17, 0xbd, 0x6d, 0x71, 0x37,
+ 0xdd, 0x85, 0x23, 0xf5, 0x8c, 0x23, 0x5f, 0xcc, 0x6b, 0xf7, 0x57, 0xc4, 0x49, 0xf1, 0xd9, 0x47,
+ 0xb2, 0xa0, 0x38, 0xb3, 0x0d, 0xe3, 0x44, 0x2c, 0xb4, 0x3b, 0x11, 0xe9, 0x79, 0x77, 0x44, 0x75,
+ 0xfe, 0x0a, 0xd9, 0x51, 0x87, 0xea, 0xb7, 0xb2, 0xfb, 0xa7, 0xf8, 0xe8, 0xf3, 0xe3, 0x72, 0x48,
+ 0x10, 0x28, 0x5e, 0x21, 0x3b, 0x7c, 0x2a, 0xf4, 0xaf, 0x2b, 0xb6, 0xfd, 0xba, 0xaf, 0x58, 0x30,
+ 0xa2, 0xbe, 0xee, 0x10, 0xce, 0x85, 0x39, 0xf3, 0x5c, 0x38, 0xd5, 0x76, 0x81, 0xe7, 0x9c, 0x08,
+ 0x5f, 0x2b, 0xc0, 0x09, 0x85, 0x43, 0x1f, 0x51, 0xfc, 0x8f, 0x58, 0x55, 0xe7, 0x61, 0xd0, 0x53,
+ 0xe2, 0x44, 0xcb, 0x94, 0xe3, 0xc5, 0xc2, 0xc4, 0x18, 0x87, 0x5e, 0x79, 0x5e, 0x7c, 0x69, 0x0f,
+ 0xeb, 0x72, 0x76, 0x71, 0xb9, 0xcf, 0x41, 0xb1, 0xe5, 0xd6, 0xc4, 0x05, 0xf3, 0x41, 0x39, 0xda,
+ 0xd7, 0x97, 0x17, 0xf6, 0x77, 0x4b, 0x0f, 0xe7, 0xa9, 0x9c, 0xe8, 0xcd, 0x16, 0xce, 0x5c, 0x5f,
+ 0x5e, 0xc0, 0xb4, 0x32, 0x9a, 0x85, 0x31, 0xa9, 0x55, 0xbb, 0x41, 0xf9, 0x52, 0xdf, 0x13, 0xf7,
+ 0x90, 0x12, 0x96, 0x63, 0x13, 0x8c, 0x93, 0xf8, 0x68, 0x01, 0xc6, 0xb7, 0x5a, 0xb7, 0x48, 0x9d,
+ 0x44, 0xfc, 0x83, 0xaf, 0x10, 0x2e, 0x4a, 0x1e, 0x8c, 0x9f, 0xb0, 0x57, 0x12, 0x70, 0x9c, 0xaa,
+ 0x61, 0xff, 0x0d, 0xbb, 0x0f, 0xc4, 0xe8, 0x69, 0xfc, 0xcd, 0xb7, 0x72, 0x39, 0x77, 0xb3, 0x2a,
+ 0xae, 0x90, 0x9d, 0x35, 0x9f, 0xf2, 0x21, 0xd9, 0xab, 0xc2, 0x58, 0xf3, 0x3d, 0x6d, 0xd7, 0xfc,
+ 0x2f, 0x15, 0xe0, 0xa8, 0x1a, 0x01, 0x83, 0x5b, 0xfe, 0x76, 0x1f, 0x83, 0x0b, 0x30, 0x54, 0x23,
+ 0xeb, 0x4e, 0xab, 0x1e, 0x29, 0xbd, 0x46, 0x2f, 0x57, 0xb5, 0x2d, 0xc4, 0xc5, 0x58, 0xc7, 0x39,
+ 0xc0, 0xb0, 0xfd, 0xc2, 0x08, 0xbb, 0x88, 0x23, 0x87, 0xae, 0x71, 0xb5, 0x6b, 0xac, 0xdc, 0x5d,
+ 0xf3, 0x08, 0xf4, 0xba, 0x0d, 0xca, 0x98, 0x15, 0x4c, 0x7e, 0x6b, 0x99, 0x16, 0x62, 0x0e, 0x43,
+ 0x8f, 0x41, 0x7f, 0xd5, 0x6f, 0x34, 0x1c, 0xaf, 0xc6, 0xae, 0xbc, 0xc1, 0xb9, 0x21, 0xca, 0xbb,
+ 0xcd, 0xf3, 0x22, 0x2c, 0x61, 0x94, 0xf9, 0x76, 0x82, 0x0d, 0x2e, 0xec, 0x11, 0xcc, 0xf7, 0x6c,
+ 0xb0, 0x11, 0x62, 0x56, 0x4a, 0xdf, 0xaa, 0xb7, 0xfd, 0x60, 0xcb, 0xf5, 0x36, 0x16, 0xdc, 0x40,
+ 0x6c, 0x09, 0x75, 0x17, 0xde, 0x54, 0x10, 0xac, 0x61, 0xa1, 0x25, 0xe8, 0x6d, 0xfa, 0x41, 0x14,
+ 0x4e, 0xf5, 0xb1, 0xe1, 0x7e, 0x38, 0xe7, 0x20, 0xe2, 0x5f, 0x5b, 0xf6, 0x83, 0x28, 0xfe, 0x00,
+ 0xfa, 0x2f, 0xc4, 0xbc, 0x3a, 0xba, 0x0a, 0xfd, 0xc4, 0xdb, 0x5e, 0x0a, 0xfc, 0xc6, 0xd4, 0x64,
+ 0x3e, 0xa5, 0x45, 0x8e, 0xc2, 0x97, 0x59, 0xcc, 0xa3, 0x8a, 0x62, 0x2c, 0x49, 0xa0, 0x0f, 0x43,
+ 0x91, 0x78, 0xdb, 0x53, 0xfd, 0x8c, 0xd2, 0x74, 0x0e, 0xa5, 0x1b, 0x4e, 0x10, 0x9f, 0xf9, 0x8b,
+ 0xde, 0x36, 0xa6, 0x75, 0xd0, 0xc7, 0x60, 0x50, 0x1e, 0x18, 0xa1, 0x90, 0xa2, 0x66, 0x2e, 0x58,
+ 0x79, 0xcc, 0x60, 0xf2, 0x76, 0xcb, 0x0d, 0x48, 0x83, 0x78, 0x51, 0x18, 0x9f, 0x90, 0x12, 0x1a,
+ 0xe2, 0x98, 0x1a, 0xaa, 0xc2, 0x70, 0x40, 0x42, 0xf7, 0x2e, 0x29, 0xfb, 0x75, 0xb7, 0xba, 0x33,
+ 0x75, 0x9c, 0x75, 0xef, 0x89, 0xb6, 0x43, 0x86, 0xb5, 0x0a, 0xb1, 0x94, 0x5f, 0x2f, 0xc5, 0x06,
+ 0x51, 0xf4, 0x06, 0x8c, 0x04, 0x24, 0x8c, 0x9c, 0x20, 0x12, 0xad, 0x4c, 0x29, 0xad, 0xdc, 0x08,
+ 0xd6, 0x01, 0xfc, 0x39, 0x11, 0x37, 0x13, 0x43, 0xb0, 0x49, 0x01, 0x7d, 0x4c, 0xaa, 0x1c, 0x56,
+ 0xfc, 0x96, 0x17, 0x85, 0x53, 0x83, 0xac, 0xdf, 0x99, 0xba, 0xe9, 0x1b, 0x31, 0x5e, 0x52, 0x27,
+ 0xc1, 0x2b, 0x63, 0x83, 0x14, 0xfa, 0x04, 0x8c, 0xf0, 0xff, 0x5c, 0xa5, 0x1a, 0x4e, 0x1d, 0x65,
+ 0xb4, 0xcf, 0xe4, 0xd3, 0xe6, 0x88, 0x73, 0x47, 0x05, 0xf1, 0x11, 0xbd, 0x34, 0xc4, 0x26, 0x35,
+ 0x84, 0x61, 0xa4, 0xee, 0x6e, 0x13, 0x8f, 0x84, 0x61, 0x39, 0xf0, 0x6f, 0x11, 0x21, 0x21, 0x3e,
+ 0x91, 0xad, 0x82, 0xf5, 0x6f, 0x11, 0xf1, 0x08, 0xd4, 0xeb, 0x60, 0x93, 0x04, 0xba, 0x0e, 0xa3,
+ 0xf4, 0x49, 0xee, 0xc6, 0x44, 0x87, 0x3a, 0x11, 0x65, 0x0f, 0x67, 0x6c, 0x54, 0xc2, 0x09, 0x22,
+ 0xe8, 0x1a, 0x0c, 0xb3, 0x31, 0x6f, 0x35, 0x39, 0xd1, 0x63, 0x9d, 0x88, 0x32, 0x83, 0x82, 0x8a,
+ 0x56, 0x05, 0x1b, 0x04, 0xd0, 0xeb, 0x30, 0x58, 0x77, 0xd7, 0x49, 0x75, 0xa7, 0x5a, 0x27, 0x53,
+ 0xc3, 0x8c, 0x5a, 0xe6, 0x61, 0x78, 0x55, 0x22, 0x71, 0xfe, 0x5c, 0xfd, 0xc5, 0x71, 0x75, 0x74,
+ 0x03, 0x8e, 0x45, 0x24, 0x68, 0xb8, 0x9e, 0x43, 0x0f, 0x31, 0xf1, 0x24, 0x64, 0x9a, 0xf1, 0x11,
+ 0xb6, 0xba, 0x4e, 0x8b, 0xd9, 0x38, 0xb6, 0x96, 0x89, 0x85, 0x73, 0x6a, 0xa3, 0x3b, 0x30, 0x95,
+ 0x01, 0xe1, 0xeb, 0xf6, 0x08, 0xa3, 0xfc, 0x8a, 0xa0, 0x3c, 0xb5, 0x96, 0x83, 0xb7, 0xdf, 0x06,
+ 0x86, 0x73, 0xa9, 0xa3, 0x6b, 0x30, 0xc6, 0x4e, 0xce, 0x72, 0xab, 0x5e, 0x17, 0x0d, 0x8e, 0xb2,
+ 0x06, 0x1f, 0x93, 0x7c, 0xc4, 0xb2, 0x09, 0xde, 0xdf, 0x2d, 0x41, 0xfc, 0x0f, 0x27, 0x6b, 0xa3,
+ 0x5b, 0x4c, 0x09, 0xdb, 0x0a, 0xdc, 0x68, 0x87, 0xee, 0x2a, 0x72, 0x27, 0x9a, 0x1a, 0x6b, 0x2b,
+ 0x90, 0xd2, 0x51, 0x95, 0xa6, 0x56, 0x2f, 0xc4, 0x49, 0x82, 0xf4, 0x2a, 0x08, 0xa3, 0x9a, 0xeb,
+ 0x4d, 0x8d, 0xf3, 0xf7, 0x94, 0x3c, 0x49, 0x2b, 0xb4, 0x10, 0x73, 0x18, 0x53, 0xc0, 0xd2, 0x1f,
+ 0xd7, 0xe8, 0x8d, 0x3b, 0xc1, 0x10, 0x63, 0x05, 0xac, 0x04, 0xe0, 0x18, 0x87, 0x32, 0xc1, 0x51,
+ 0xb4, 0x33, 0x85, 0x18, 0xaa, 0x3a, 0x10, 0xd7, 0xd6, 0x3e, 0x86, 0x69, 0xb9, 0x7d, 0x0b, 0x46,
+ 0xd5, 0x31, 0xc1, 0xc6, 0x04, 0x95, 0xa0, 0x97, 0xb1, 0x7d, 0x42, 0x7c, 0x3a, 0x48, 0xbb, 0xc0,
+ 0x58, 0x42, 0xcc, 0xcb, 0x59, 0x17, 0xdc, 0xbb, 0x64, 0x6e, 0x27, 0x22, 0x5c, 0x16, 0x51, 0xd4,
+ 0xba, 0x20, 0x01, 0x38, 0xc6, 0xb1, 0xff, 0x2f, 0x67, 0x9f, 0xe3, 0x5b, 0xa2, 0x8b, 0x7b, 0xf1,
+ 0x69, 0x18, 0x60, 0x86, 0x1f, 0x7e, 0xc0, 0xb5, 0xb3, 0xbd, 0x31, 0xc3, 0x7c, 0x59, 0x94, 0x63,
+ 0x85, 0x81, 0x5e, 0x86, 0x91, 0xaa, 0xde, 0x80, 0xb8, 0xd4, 0xd5, 0x31, 0x62, 0xb4, 0x8e, 0x4d,
+ 0x5c, 0x74, 0x11, 0x06, 0x98, 0x8d, 0x53, 0xd5, 0xaf, 0x0b, 0x6e, 0x53, 0x72, 0x26, 0x03, 0x65,
+ 0x51, 0xbe, 0xaf, 0xfd, 0xc6, 0x0a, 0x1b, 0x9d, 0x85, 0x3e, 0xda, 0x85, 0xe5, 0xb2, 0xb8, 0x4e,
+ 0x95, 0x24, 0xf0, 0x32, 0x2b, 0xc5, 0x02, 0x6a, 0xff, 0x86, 0xc5, 0x78, 0xa9, 0xf4, 0x99, 0x8f,
+ 0x2e, 0xb3, 0x4b, 0x83, 0xdd, 0x20, 0x9a, 0x16, 0xfe, 0x51, 0xed, 0x26, 0x50, 0xb0, 0xfd, 0xc4,
+ 0x7f, 0x6c, 0xd4, 0x44, 0x6f, 0x26, 0x6f, 0x06, 0xce, 0x50, 0x3c, 0x2f, 0x87, 0x20, 0x79, 0x3b,
+ 0x3c, 0x14, 0x5f, 0x71, 0xb4, 0x3f, 0xed, 0xae, 0x08, 0xfb, 0x47, 0x0a, 0xda, 0x2a, 0xa9, 0x44,
+ 0x4e, 0x44, 0x50, 0x19, 0xfa, 0x6f, 0x3b, 0x6e, 0xe4, 0x7a, 0x1b, 0x82, 0xef, 0x6b, 0x7f, 0xd1,
+ 0xb1, 0x4a, 0x37, 0x79, 0x05, 0xce, 0xbd, 0x88, 0x3f, 0x58, 0x92, 0xa1, 0x14, 0x83, 0x96, 0xe7,
+ 0x51, 0x8a, 0x85, 0x6e, 0x29, 0x62, 0x5e, 0x81, 0x53, 0x14, 0x7f, 0xb0, 0x24, 0x83, 0xde, 0x02,
+ 0x90, 0x27, 0x04, 0xa9, 0x09, 0xd9, 0xe1, 0xd3, 0x9d, 0x89, 0xae, 0xa9, 0x3a, 0x5c, 0x38, 0x19,
+ 0xff, 0xc7, 0x1a, 0x3d, 0x3b, 0xd2, 0xe6, 0x54, 0xef, 0x0c, 0xfa, 0x38, 0xdd, 0xa2, 0x4e, 0x10,
+ 0x91, 0xda, 0x6c, 0x24, 0x06, 0xe7, 0xc9, 0xee, 0x1e, 0x87, 0x6b, 0x6e, 0x83, 0xe8, 0xdb, 0x59,
+ 0x10, 0xc1, 0x31, 0x3d, 0xfb, 0x57, 0x8a, 0x30, 0x95, 0xd7, 0x5d, 0xba, 0x69, 0xc8, 0x1d, 0x37,
+ 0x9a, 0xa7, 0x6c, 0xad, 0x65, 0x6e, 0x9a, 0x45, 0x51, 0x8e, 0x15, 0x06, 0x5d, 0xbd, 0xa1, 0xbb,
+ 0x21, 0xdf, 0xf6, 0xbd, 0xf1, 0xea, 0xad, 0xb0, 0x52, 0x2c, 0xa0, 0x14, 0x2f, 0x20, 0x4e, 0x28,
+ 0x8c, 0xef, 0xb4, 0x55, 0x8e, 0x59, 0x29, 0x16, 0x50, 0x5d, 0xca, 0xd8, 0xd3, 0x41, 0xca, 0x68,
+ 0x0c, 0x51, 0xef, 0xfd, 0x1d, 0x22, 0xf4, 0x49, 0x80, 0x75, 0xd7, 0x73, 0xc3, 0x4d, 0x46, 0xbd,
+ 0xef, 0xc0, 0xd4, 0x15, 0x53, 0xbc, 0xa4, 0xa8, 0x60, 0x8d, 0x22, 0x7a, 0x01, 0x86, 0xd4, 0x01,
+ 0xb2, 0xbc, 0xc0, 0x54, 0xff, 0x9a, 0x29, 0x55, 0x7c, 0x9a, 0x2e, 0x60, 0x1d, 0xcf, 0xfe, 0x74,
+ 0x72, 0xbd, 0x88, 0x1d, 0xa0, 0x8d, 0xaf, 0xd5, 0xed, 0xf8, 0x16, 0xda, 0x8f, 0xaf, 0xfd, 0x63,
+ 0x83, 0x30, 0x66, 0x34, 0xd6, 0x0a, 0xbb, 0x38, 0x73, 0x2f, 0xd1, 0x0b, 0xc8, 0x89, 0x88, 0xd8,
+ 0x7f, 0x76, 0xe7, 0xad, 0xa2, 0x5f, 0x52, 0x74, 0x07, 0xf0, 0xfa, 0xe8, 0x93, 0x30, 0x58, 0x77,
+ 0x42, 0x26, 0xb1, 0x24, 0x62, 0xdf, 0x75, 0x43, 0x2c, 0x7e, 0x10, 0x3a, 0x61, 0xa4, 0xdd, 0xfa,
+ 0x9c, 0x76, 0x4c, 0x92, 0xde, 0x94, 0x94, 0xbf, 0x92, 0xd6, 0x9d, 0xaa, 0x13, 0x94, 0x09, 0xdb,
+ 0xc1, 0x1c, 0x86, 0x2e, 0xb2, 0xa3, 0x95, 0xae, 0x8a, 0x79, 0xca, 0x8d, 0xb2, 0x65, 0xd6, 0x6b,
+ 0x30, 0xd9, 0x0a, 0x86, 0x0d, 0xcc, 0xf8, 0x4d, 0xd6, 0xd7, 0xe6, 0x4d, 0xf6, 0x04, 0xf4, 0xb3,
+ 0x1f, 0x6a, 0x05, 0xa8, 0xd9, 0x58, 0xe6, 0xc5, 0x58, 0xc2, 0x93, 0x0b, 0x66, 0xa0, 0xbb, 0x05,
+ 0x43, 0x5f, 0x7d, 0x62, 0x51, 0x33, 0xb3, 0x8b, 0x01, 0x7e, 0xca, 0x89, 0x25, 0x8f, 0x25, 0x0c,
+ 0xfd, 0xac, 0x05, 0xc8, 0xa9, 0xd3, 0xd7, 0x32, 0x2d, 0x56, 0x8f, 0x1b, 0x60, 0xac, 0xf6, 0xcb,
+ 0x1d, 0x87, 0xbd, 0x15, 0xce, 0xcc, 0xa6, 0x6a, 0x73, 0x49, 0xe9, 0x4b, 0xa2, 0x8b, 0x28, 0x8d,
+ 0xa0, 0x5f, 0x46, 0x57, 0xdd, 0x30, 0xfa, 0xec, 0x1f, 0x27, 0x2e, 0xa7, 0x8c, 0x2e, 0xa1, 0xeb,
+ 0xfa, 0xe3, 0x6b, 0xe8, 0x80, 0x8f, 0xaf, 0x91, 0xdc, 0x87, 0xd7, 0x77, 0x26, 0x1e, 0x30, 0xc3,
+ 0xec, 0xcb, 0x1f, 0xeb, 0xf0, 0x80, 0x11, 0xe2, 0xf4, 0x6e, 0x9e, 0x31, 0x65, 0xa1, 0x07, 0x1e,
+ 0x61, 0x5d, 0x6e, 0xff, 0x08, 0xbe, 0x1e, 0x92, 0x60, 0xee, 0x84, 0x54, 0x13, 0xef, 0xeb, 0xbc,
+ 0x87, 0xa6, 0x37, 0xfe, 0x1e, 0x0b, 0xa6, 0xd2, 0x03, 0xc4, 0xbb, 0x34, 0x35, 0xca, 0xfa, 0x6f,
+ 0xb7, 0x1b, 0x19, 0xd1, 0x79, 0x69, 0xee, 0x3a, 0x35, 0x9b, 0x43, 0x0b, 0xe7, 0xb6, 0x32, 0xdd,
+ 0x82, 0xe3, 0x39, 0xf3, 0x9e, 0x21, 0xb5, 0x5e, 0xd0, 0xa5, 0xd6, 0x1d, 0x64, 0x9d, 0x33, 0x72,
+ 0x66, 0x66, 0xde, 0x68, 0x39, 0x5e, 0xe4, 0x46, 0x3b, 0xba, 0x94, 0xdb, 0x03, 0x73, 0x40, 0xd0,
+ 0x27, 0xa0, 0xb7, 0xee, 0x7a, 0xad, 0x3b, 0xe2, 0xa6, 0x3c, 0x9b, 0xfd, 0x88, 0xf1, 0x5a, 0x77,
+ 0xcc, 0x21, 0x2e, 0xd1, 0x0d, 0xc9, 0xca, 0xf7, 0x77, 0x4b, 0x28, 0x8d, 0x80, 0x39, 0x55, 0xfb,
+ 0x49, 0x18, 0x5d, 0x70, 0x48, 0xc3, 0xf7, 0x16, 0xbd, 0x5a, 0xd3, 0x77, 0xbd, 0x08, 0x4d, 0x41,
+ 0x0f, 0x63, 0x11, 0xf9, 0x05, 0xd9, 0x43, 0x87, 0x10, 0xb3, 0x12, 0x7b, 0x03, 0x8e, 0x2e, 0xf8,
+ 0xb7, 0xbd, 0xdb, 0x4e, 0x50, 0x9b, 0x2d, 0x2f, 0x6b, 0x52, 0xbf, 0x55, 0x29, 0x75, 0xb2, 0xf2,
+ 0xdf, 0xf4, 0x5a, 0x4d, 0xbe, 0x94, 0x96, 0xdc, 0x3a, 0xc9, 0x91, 0xcd, 0xfe, 0x58, 0xc1, 0x68,
+ 0x29, 0xc6, 0x57, 0x9a, 0x45, 0x2b, 0xd7, 0x28, 0xe1, 0x0d, 0x18, 0x58, 0x77, 0x49, 0xbd, 0x86,
+ 0xc9, 0xba, 0x98, 0x8d, 0xc7, 0xf3, 0xcd, 0x16, 0x97, 0x28, 0xa6, 0x52, 0x81, 0x32, 0x99, 0xd5,
+ 0x92, 0xa8, 0x8c, 0x15, 0x19, 0xb4, 0x05, 0xe3, 0x72, 0xce, 0x24, 0x54, 0x9c, 0xda, 0x4f, 0xb4,
+ 0x5b, 0x84, 0x26, 0x71, 0x66, 0xc2, 0x8d, 0x13, 0x64, 0x70, 0x8a, 0x30, 0x3a, 0x09, 0x3d, 0x0d,
+ 0xca, 0x9f, 0xf4, 0xb0, 0xe1, 0x67, 0x42, 0x2a, 0x26, 0x6f, 0x63, 0xa5, 0xf6, 0x4f, 0x58, 0x70,
+ 0x3c, 0x35, 0x32, 0x42, 0xee, 0x78, 0x9f, 0x67, 0x21, 0x29, 0x07, 0x2c, 0x74, 0x96, 0x03, 0xda,
+ 0xff, 0xc8, 0x82, 0x23, 0x8b, 0x8d, 0x66, 0xb4, 0xb3, 0xe0, 0x9a, 0x16, 0x04, 0x2f, 0x42, 0x5f,
+ 0x83, 0xd4, 0xdc, 0x56, 0x43, 0xcc, 0x5c, 0x49, 0xde, 0xe1, 0x2b, 0xac, 0x94, 0x9e, 0x03, 0x95,
+ 0xc8, 0x0f, 0x9c, 0x0d, 0xc2, 0x0b, 0xb0, 0x40, 0x67, 0x9c, 0x90, 0x7b, 0x97, 0x5c, 0x75, 0x1b,
+ 0x6e, 0x74, 0x6f, 0xbb, 0x4b, 0x28, 0xff, 0x25, 0x11, 0x1c, 0xd3, 0xb3, 0xbf, 0x61, 0xc1, 0x98,
+ 0x5c, 0xf7, 0xb3, 0xb5, 0x5a, 0x40, 0xc2, 0x10, 0x4d, 0x43, 0xc1, 0x6d, 0x8a, 0x5e, 0x82, 0xe8,
+ 0x65, 0x61, 0xb9, 0x8c, 0x0b, 0x6e, 0x53, 0x3e, 0xba, 0x18, 0x9b, 0x50, 0x34, 0xed, 0x20, 0x2e,
+ 0x8b, 0x72, 0xac, 0x30, 0xd0, 0x39, 0x18, 0xf0, 0xfc, 0x1a, 0x7f, 0xb7, 0x08, 0x4d, 0x38, 0xc5,
+ 0x5c, 0x15, 0x65, 0x58, 0x41, 0x51, 0x19, 0x06, 0xb9, 0x95, 0x6c, 0xbc, 0x68, 0xbb, 0xb2, 0xb5,
+ 0x65, 0x5f, 0xb6, 0x26, 0x6b, 0xe2, 0x98, 0x88, 0xfd, 0x5b, 0x16, 0x0c, 0xcb, 0x2f, 0xeb, 0xf2,
+ 0x45, 0x49, 0xb7, 0x56, 0xfc, 0x9a, 0x8c, 0xb7, 0x16, 0x7d, 0x11, 0x32, 0x88, 0xf1, 0x10, 0x2c,
+ 0x1e, 0xe8, 0x21, 0x78, 0x01, 0x86, 0x9c, 0x66, 0xb3, 0x6c, 0xbe, 0x22, 0xd9, 0x52, 0x9a, 0x8d,
+ 0x8b, 0xb1, 0x8e, 0x63, 0xff, 0x78, 0x01, 0x46, 0xe5, 0x17, 0x54, 0x5a, 0xb7, 0x42, 0x12, 0xa1,
+ 0x35, 0x18, 0x74, 0xf8, 0x2c, 0x11, 0xb9, 0xc8, 0x1f, 0xc9, 0x96, 0x6e, 0x1a, 0x53, 0x1a, 0xb3,
+ 0xc3, 0xb3, 0xb2, 0x36, 0x8e, 0x09, 0xa1, 0x3a, 0x4c, 0x78, 0x7e, 0xc4, 0x58, 0x23, 0x05, 0x6f,
+ 0xa7, 0x70, 0x4e, 0x52, 0x3f, 0x21, 0xa8, 0x4f, 0xac, 0x26, 0xa9, 0xe0, 0x34, 0x61, 0xb4, 0x28,
+ 0x25, 0xc6, 0xc5, 0x7c, 0x51, 0x9f, 0x3e, 0x71, 0xd9, 0x02, 0x63, 0xfb, 0xd7, 0x2d, 0x18, 0x94,
+ 0x68, 0x87, 0x61, 0x5b, 0xb0, 0x02, 0xfd, 0x21, 0x9b, 0x04, 0x39, 0x34, 0x76, 0xbb, 0x8e, 0xf3,
+ 0xf9, 0x8a, 0x39, 0x3e, 0xfe, 0x3f, 0xc4, 0x92, 0x06, 0x53, 0x18, 0xaa, 0xee, 0xbf, 0x4b, 0x14,
+ 0x86, 0xaa, 0x3f, 0x39, 0x97, 0xd2, 0x9f, 0xb2, 0x3e, 0x6b, 0x12, 0x78, 0xfa, 0x30, 0x69, 0x06,
+ 0x64, 0xdd, 0xbd, 0x93, 0x7c, 0x98, 0x94, 0x59, 0x29, 0x16, 0x50, 0xf4, 0x16, 0x0c, 0x57, 0xa5,
+ 0xa6, 0x28, 0xde, 0xe1, 0x67, 0xdb, 0x6a, 0x2d, 0x95, 0x82, 0x9b, 0x4b, 0x3a, 0xe7, 0xb5, 0xfa,
+ 0xd8, 0xa0, 0x66, 0x5a, 0x81, 0x15, 0x3b, 0x59, 0x81, 0xc5, 0x74, 0xf3, 0x6d, 0xa2, 0x7e, 0xd2,
+ 0x82, 0x3e, 0xae, 0x21, 0xe8, 0x4e, 0x41, 0xa3, 0xe9, 0xfb, 0xe3, 0xb1, 0xbb, 0x41, 0x0b, 0x05,
+ 0x67, 0x83, 0x56, 0x60, 0x90, 0xfd, 0x60, 0x1a, 0x8e, 0x62, 0xbe, 0xcf, 0x18, 0x6f, 0x55, 0xef,
+ 0xe0, 0x0d, 0x59, 0x0d, 0xc7, 0x14, 0xec, 0x1f, 0x2d, 0xd2, 0xd3, 0x2d, 0x46, 0x35, 0x2e, 0x7d,
+ 0xeb, 0xc1, 0x5d, 0xfa, 0x85, 0x07, 0x75, 0xe9, 0x6f, 0xc0, 0x58, 0x55, 0xb3, 0x0e, 0x88, 0x67,
+ 0xf2, 0x5c, 0xdb, 0x45, 0xa2, 0x19, 0x12, 0x70, 0x19, 0xea, 0xbc, 0x49, 0x04, 0x27, 0xa9, 0xa2,
+ 0x8f, 0xc3, 0x30, 0x9f, 0x67, 0xd1, 0x0a, 0x37, 0xa4, 0x7b, 0x2c, 0x7f, 0xbd, 0xe8, 0x4d, 0x70,
+ 0x99, 0xbb, 0x56, 0x1d, 0x1b, 0xc4, 0xec, 0xbf, 0xb4, 0x00, 0x2d, 0x36, 0x37, 0x49, 0x83, 0x04,
+ 0x4e, 0x3d, 0x56, 0xf2, 0x7d, 0xc1, 0x82, 0x29, 0x92, 0x2a, 0x9e, 0xf7, 0x1b, 0x0d, 0xf1, 0xa4,
+ 0xcf, 0x91, 0x3a, 0x2d, 0xe6, 0xd4, 0x89, 0xd9, 0xfa, 0x3c, 0x0c, 0x9c, 0xdb, 0x1e, 0x5a, 0x81,
+ 0x49, 0x7e, 0x4b, 0x2a, 0x80, 0x66, 0x6b, 0xf7, 0x90, 0x20, 0x3c, 0xb9, 0x96, 0x46, 0xc1, 0x59,
+ 0xf5, 0xec, 0x5f, 0x1f, 0x81, 0xdc, 0x5e, 0xbc, 0xaf, 0xdd, 0x7c, 0x5f, 0xbb, 0xf9, 0xbe, 0x76,
+ 0xf3, 0x7d, 0xed, 0xe6, 0xfb, 0xda, 0xcd, 0xf7, 0xb5, 0x9b, 0xef, 0x52, 0xed, 0xe6, 0xdf, 0xb6,
+ 0xe0, 0xa8, 0xba, 0xbe, 0x8c, 0x07, 0xfb, 0x67, 0x60, 0x92, 0x6f, 0xb7, 0xf9, 0xba, 0xe3, 0x36,
+ 0xd6, 0x48, 0xa3, 0x59, 0x77, 0x22, 0x69, 0xc3, 0x74, 0x21, 0x73, 0xe5, 0x26, 0x1c, 0x25, 0x8c,
+ 0x8a, 0xdc, 0xe3, 0x2c, 0x03, 0x80, 0xb3, 0x9a, 0xb1, 0x7f, 0x65, 0x00, 0x7a, 0x17, 0xb7, 0x89,
+ 0x17, 0x1d, 0xc2, 0xd3, 0xa6, 0x0a, 0xa3, 0xae, 0xb7, 0xed, 0xd7, 0xb7, 0x49, 0x8d, 0xc3, 0x0f,
+ 0xf2, 0x02, 0x3f, 0x26, 0x48, 0x8f, 0x2e, 0x1b, 0x24, 0x70, 0x82, 0xe4, 0x83, 0xd0, 0x11, 0x5d,
+ 0x82, 0x3e, 0x7e, 0xf9, 0x08, 0x05, 0x51, 0xe6, 0x99, 0xcd, 0x06, 0x51, 0x5c, 0xa9, 0xb1, 0xfe,
+ 0x8a, 0x5f, 0x6e, 0xa2, 0x3a, 0xfa, 0x34, 0x8c, 0xae, 0xbb, 0x41, 0x18, 0xad, 0xb9, 0x0d, 0x7a,
+ 0x35, 0x34, 0x9a, 0xf7, 0xa0, 0x13, 0x52, 0xe3, 0xb0, 0x64, 0x50, 0xc2, 0x09, 0xca, 0x68, 0x03,
+ 0x46, 0xea, 0x8e, 0xde, 0x54, 0xff, 0x81, 0x9b, 0x52, 0xb7, 0xc3, 0x55, 0x9d, 0x10, 0x36, 0xe9,
+ 0xd2, 0xed, 0x54, 0x65, 0x6a, 0x8d, 0x01, 0x26, 0xce, 0x50, 0xdb, 0x89, 0xeb, 0x33, 0x38, 0x8c,
+ 0x32, 0x68, 0xcc, 0xdd, 0x60, 0xd0, 0x64, 0xd0, 0x34, 0xa7, 0x82, 0x4f, 0xc1, 0x20, 0xa1, 0x43,
+ 0x48, 0x09, 0x8b, 0x0b, 0xe6, 0x7c, 0x77, 0x7d, 0x5d, 0x71, 0xab, 0x81, 0x6f, 0x6a, 0xe3, 0x16,
+ 0x25, 0x25, 0x1c, 0x13, 0x45, 0xf3, 0xd0, 0x17, 0x92, 0xc0, 0x55, 0x12, 0xff, 0x36, 0xd3, 0xc8,
+ 0xd0, 0xb8, 0x4b, 0x23, 0xff, 0x8d, 0x45, 0x55, 0xba, 0xbc, 0x1c, 0x26, 0x8a, 0x65, 0x97, 0x81,
+ 0xb6, 0xbc, 0x66, 0x59, 0x29, 0x16, 0x50, 0xf4, 0x3a, 0xf4, 0x07, 0xa4, 0xce, 0xd4, 0xbd, 0x23,
+ 0xdd, 0x2f, 0x72, 0xae, 0x3d, 0xe6, 0xf5, 0xb0, 0x24, 0x80, 0xae, 0x00, 0x0a, 0x08, 0x65, 0xf0,
+ 0x5c, 0x6f, 0x43, 0x19, 0xe1, 0x8b, 0x83, 0x56, 0x31, 0xd2, 0x38, 0xc6, 0x90, 0xde, 0xac, 0x38,
+ 0xa3, 0x1a, 0xba, 0x04, 0x13, 0xaa, 0x74, 0xd9, 0x0b, 0x23, 0x87, 0x1e, 0x70, 0x63, 0x8c, 0x96,
+ 0x92, 0xaf, 0xe0, 0x24, 0x02, 0x4e, 0xd7, 0xb1, 0x7f, 0xde, 0x02, 0x3e, 0xce, 0x87, 0x20, 0x55,
+ 0x78, 0xd5, 0x94, 0x2a, 0x9c, 0xc8, 0x9d, 0xb9, 0x1c, 0x89, 0xc2, 0xcf, 0x5b, 0x30, 0xa4, 0xcd,
+ 0x6c, 0xbc, 0x66, 0xad, 0x36, 0x6b, 0xb6, 0x05, 0xe3, 0x74, 0xa5, 0x5f, 0xbb, 0x15, 0x92, 0x60,
+ 0x9b, 0xd4, 0xd8, 0xc2, 0x2c, 0xdc, 0xdb, 0xc2, 0x54, 0x06, 0xbf, 0x57, 0x13, 0x04, 0x71, 0xaa,
+ 0x09, 0xfb, 0x53, 0xb2, 0xab, 0xca, 0x3e, 0xba, 0xaa, 0xe6, 0x3c, 0x61, 0x1f, 0xad, 0x66, 0x15,
+ 0xc7, 0x38, 0x74, 0xab, 0x6d, 0xfa, 0x61, 0x94, 0xb4, 0x8f, 0xbe, 0xec, 0x87, 0x11, 0x66, 0x10,
+ 0xfb, 0x39, 0x80, 0xc5, 0x3b, 0xa4, 0xca, 0x57, 0xac, 0xfe, 0xe8, 0xb1, 0xf2, 0x1f, 0x3d, 0xf6,
+ 0x1f, 0x58, 0x30, 0xba, 0x34, 0x6f, 0xdc, 0x5c, 0x33, 0x00, 0xfc, 0xa5, 0x76, 0xf3, 0xe6, 0xaa,
+ 0x34, 0xd2, 0xe1, 0x76, 0x0a, 0xaa, 0x14, 0x6b, 0x18, 0xe8, 0x04, 0x14, 0xeb, 0x2d, 0x4f, 0x88,
+ 0x3d, 0xfb, 0xe9, 0xf5, 0x78, 0xb5, 0xe5, 0x61, 0x5a, 0xa6, 0x79, 0xb2, 0x15, 0xbb, 0xf6, 0x64,
+ 0xeb, 0x18, 0x50, 0x07, 0x95, 0xa0, 0xf7, 0xf6, 0x6d, 0xb7, 0xc6, 0xe3, 0x04, 0x08, 0x03, 0xa2,
+ 0x9b, 0x37, 0x97, 0x17, 0x42, 0xcc, 0xcb, 0xed, 0x2f, 0x16, 0x61, 0x7a, 0xa9, 0x4e, 0xee, 0xbc,
+ 0xc3, 0x58, 0x09, 0xdd, 0xfa, 0xe1, 0x1d, 0x4c, 0x80, 0x74, 0x50, 0x5f, 0xcb, 0xce, 0xe3, 0xb1,
+ 0x0e, 0xfd, 0xdc, 0x3c, 0x58, 0x46, 0x4e, 0xc8, 0x54, 0xca, 0xe6, 0x0f, 0xc8, 0x0c, 0x37, 0x33,
+ 0x16, 0x4a, 0x59, 0x75, 0x61, 0x8a, 0x52, 0x2c, 0x89, 0x4f, 0xbf, 0x04, 0xc3, 0x3a, 0xe6, 0x81,
+ 0xbc, 0x9e, 0xbf, 0xb7, 0x08, 0xe3, 0xb4, 0x07, 0x0f, 0x74, 0x22, 0xae, 0xa7, 0x27, 0xe2, 0x7e,
+ 0x7b, 0xbe, 0x76, 0x9e, 0x8d, 0xb7, 0x92, 0xb3, 0x71, 0x21, 0x6f, 0x36, 0x0e, 0x7b, 0x0e, 0xbe,
+ 0xcf, 0x82, 0xc9, 0xa5, 0xba, 0x5f, 0xdd, 0x4a, 0x78, 0xa7, 0xbe, 0x00, 0x43, 0xf4, 0x38, 0x0e,
+ 0x8d, 0x40, 0x2d, 0x46, 0xe8, 0x1e, 0x01, 0xc2, 0x3a, 0x9e, 0x56, 0xed, 0xfa, 0xf5, 0xe5, 0x85,
+ 0xac, 0x88, 0x3f, 0x02, 0x84, 0x75, 0x3c, 0xfb, 0xf7, 0x2c, 0x38, 0x75, 0x69, 0x7e, 0x31, 0x5e,
+ 0x8a, 0xa9, 0xa0, 0x43, 0x67, 0xa1, 0xaf, 0x59, 0xd3, 0xba, 0x12, 0x8b, 0x85, 0x17, 0x58, 0x2f,
+ 0x04, 0xf4, 0xdd, 0x12, 0xdf, 0xeb, 0x3a, 0xc0, 0x25, 0x5c, 0x9e, 0x17, 0xe7, 0xae, 0xd4, 0x02,
+ 0x59, 0xb9, 0x5a, 0xa0, 0xc7, 0xa0, 0x9f, 0xde, 0x0b, 0x6e, 0x55, 0xf6, 0x9b, 0x9b, 0x5d, 0xf0,
+ 0x22, 0x2c, 0x61, 0xf6, 0xcf, 0x59, 0x30, 0x79, 0xc9, 0x8d, 0xe8, 0xa5, 0x9d, 0x8c, 0xaa, 0x43,
+ 0x6f, 0xed, 0xd0, 0x8d, 0xfc, 0x60, 0x27, 0x19, 0x55, 0x07, 0x2b, 0x08, 0xd6, 0xb0, 0xf8, 0x07,
+ 0x6d, 0xbb, 0xcc, 0xdf, 0xa5, 0x60, 0xea, 0xdd, 0xb0, 0x28, 0xc7, 0x0a, 0x83, 0x8e, 0x57, 0xcd,
+ 0x0d, 0x98, 0xc8, 0x72, 0x47, 0x1c, 0xdc, 0x6a, 0xbc, 0x16, 0x24, 0x00, 0xc7, 0x38, 0xf6, 0x9f,
+ 0x5b, 0x50, 0xba, 0xc4, 0xbd, 0x76, 0xd7, 0xc3, 0x9c, 0x43, 0xf7, 0x39, 0x18, 0x24, 0x52, 0x41,
+ 0x20, 0x7a, 0xad, 0x18, 0x51, 0xa5, 0x39, 0xe0, 0xc1, 0x7d, 0x14, 0x5e, 0x17, 0x2e, 0xf4, 0x07,
+ 0xf3, 0x81, 0x5e, 0x02, 0x44, 0xf4, 0xb6, 0xf4, 0x68, 0x47, 0x2c, 0x6c, 0xca, 0x62, 0x0a, 0x8a,
+ 0x33, 0x6a, 0xd8, 0x3f, 0x61, 0xc1, 0x51, 0xf5, 0xc1, 0xef, 0xba, 0xcf, 0xb4, 0xbf, 0x5a, 0x80,
+ 0x91, 0xcb, 0x6b, 0x6b, 0xe5, 0x4b, 0x24, 0xd2, 0x56, 0x65, 0x7b, 0xb5, 0x3f, 0xd6, 0xb4, 0x97,
+ 0xed, 0xde, 0x88, 0xad, 0xc8, 0xad, 0xcf, 0xf0, 0x18, 0x7e, 0x33, 0xcb, 0x5e, 0x74, 0x2d, 0xa8,
+ 0x44, 0x81, 0xeb, 0x6d, 0x64, 0xae, 0x74, 0xc9, 0xb3, 0x14, 0xf3, 0x78, 0x16, 0xf4, 0x1c, 0xf4,
+ 0xb1, 0x20, 0x82, 0x72, 0x12, 0x1e, 0x52, 0x4f, 0x2c, 0x56, 0xba, 0xbf, 0x5b, 0x1a, 0xbc, 0x8e,
+ 0x97, 0xf9, 0x1f, 0x2c, 0x50, 0xd1, 0x75, 0x18, 0xda, 0x8c, 0xa2, 0xe6, 0x65, 0xe2, 0xd4, 0x48,
+ 0x20, 0x4f, 0xd9, 0xd3, 0x59, 0xa7, 0x2c, 0x1d, 0x04, 0x8e, 0x16, 0x1f, 0x4c, 0x71, 0x59, 0x88,
+ 0x75, 0x3a, 0x76, 0x05, 0x20, 0x86, 0xdd, 0x27, 0xc5, 0x8d, 0xbd, 0x06, 0x83, 0xf4, 0x73, 0x67,
+ 0xeb, 0xae, 0xd3, 0x5e, 0x35, 0xfe, 0x14, 0x0c, 0x4a, 0xc5, 0x77, 0x28, 0x42, 0x7c, 0xb0, 0x1b,
+ 0x49, 0xea, 0xc5, 0x43, 0x1c, 0xc3, 0xed, 0x47, 0x41, 0x58, 0x00, 0xb7, 0x23, 0x69, 0xaf, 0xc3,
+ 0x11, 0x66, 0xca, 0xec, 0x44, 0x9b, 0xc6, 0x1a, 0xed, 0xbc, 0x18, 0x9e, 0x16, 0xef, 0x3a, 0xfe,
+ 0x65, 0x53, 0x9a, 0x0b, 0xf9, 0xb0, 0xa4, 0x18, 0xbf, 0xf1, 0xec, 0x3f, 0xeb, 0x81, 0x87, 0x96,
+ 0x2b, 0xf9, 0xb1, 0xa9, 0x2e, 0xc2, 0x30, 0x67, 0x17, 0xe9, 0xd2, 0x70, 0xea, 0xa2, 0x5d, 0x25,
+ 0x01, 0x5d, 0xd3, 0x60, 0xd8, 0xc0, 0x44, 0xa7, 0xa0, 0xe8, 0xbe, 0xed, 0x25, 0x1d, 0x2c, 0x97,
+ 0xdf, 0x58, 0xc5, 0xb4, 0x9c, 0x82, 0x29, 0xe7, 0xc9, 0x8f, 0x74, 0x05, 0x56, 0xdc, 0xe7, 0xab,
+ 0x30, 0xea, 0x86, 0xd5, 0xd0, 0x5d, 0xf6, 0xe8, 0x3e, 0xd5, 0x76, 0xba, 0x92, 0x39, 0xd0, 0x4e,
+ 0x2b, 0x28, 0x4e, 0x60, 0x6b, 0xf7, 0x4b, 0x6f, 0xd7, 0xdc, 0x6b, 0xc7, 0xc8, 0x18, 0xf4, 0xf8,
+ 0x6f, 0xb2, 0xaf, 0x0b, 0x99, 0x08, 0x5e, 0x1c, 0xff, 0xfc, 0x83, 0x43, 0x2c, 0x61, 0xf4, 0x41,
+ 0x57, 0xdd, 0x74, 0x9a, 0xb3, 0xad, 0x68, 0x73, 0xc1, 0x0d, 0xab, 0xfe, 0x36, 0x09, 0x76, 0xd8,
+ 0x5b, 0x7c, 0x20, 0x7e, 0xd0, 0x29, 0xc0, 0xfc, 0xe5, 0xd9, 0x32, 0xc5, 0xc4, 0xe9, 0x3a, 0x68,
+ 0x16, 0xc6, 0x64, 0x61, 0x85, 0x84, 0xec, 0x0a, 0x18, 0x62, 0x64, 0x94, 0xcb, 0xa3, 0x28, 0x56,
+ 0x44, 0x92, 0xf8, 0x26, 0x83, 0x0b, 0xf7, 0x83, 0xc1, 0x7d, 0x11, 0x46, 0x5c, 0xcf, 0x8d, 0x5c,
+ 0x27, 0xf2, 0xb9, 0xfe, 0x88, 0x3f, 0xbb, 0x99, 0x80, 0x79, 0x59, 0x07, 0x60, 0x13, 0xcf, 0xfe,
+ 0x6f, 0x3d, 0x30, 0xc1, 0xa6, 0xed, 0xfd, 0x15, 0xf6, 0x5e, 0x5a, 0x61, 0xd7, 0xd3, 0x2b, 0xec,
+ 0x7e, 0x70, 0xee, 0xf7, 0xbc, 0xcc, 0x3e, 0x67, 0xc1, 0x04, 0x93, 0x71, 0x1b, 0xcb, 0xec, 0x3c,
+ 0x0c, 0x06, 0x86, 0x37, 0xea, 0xa0, 0xae, 0xd4, 0x92, 0x8e, 0xa5, 0x31, 0x0e, 0x7a, 0x0d, 0xa0,
+ 0x19, 0xcb, 0xd0, 0x0b, 0x46, 0x08, 0x51, 0xc8, 0x15, 0x9f, 0x6b, 0x75, 0xec, 0x4f, 0xc3, 0xa0,
+ 0x72, 0x37, 0x95, 0xfe, 0xe6, 0x56, 0x8e, 0xbf, 0x79, 0x67, 0x36, 0x42, 0xda, 0xc6, 0x15, 0x33,
+ 0x6d, 0xe3, 0xbe, 0x6c, 0x41, 0xac, 0xe1, 0x40, 0x6f, 0xc0, 0x60, 0xd3, 0x67, 0x06, 0xd1, 0x81,
+ 0xf4, 0x32, 0x78, 0xb4, 0xad, 0x8a, 0x84, 0xc7, 0x09, 0x0c, 0xf8, 0x74, 0x94, 0x65, 0x55, 0x1c,
+ 0x53, 0x41, 0x57, 0xa0, 0xbf, 0x19, 0x90, 0x4a, 0xc4, 0x82, 0x58, 0x75, 0x4f, 0x90, 0x2f, 0x5f,
+ 0x5e, 0x11, 0x4b, 0x0a, 0xf6, 0x2f, 0x16, 0x60, 0x3c, 0x89, 0x8a, 0x5e, 0x81, 0x1e, 0x72, 0x87,
+ 0x54, 0x45, 0x7f, 0x33, 0x79, 0x82, 0x58, 0x46, 0xc2, 0x07, 0x80, 0xfe, 0xc7, 0xac, 0x16, 0xba,
+ 0x0c, 0xfd, 0x94, 0x21, 0xb8, 0xa4, 0x02, 0x36, 0x3e, 0x9c, 0xc7, 0x54, 0x28, 0xce, 0x8a, 0x77,
+ 0x4e, 0x14, 0x61, 0x59, 0x9d, 0x19, 0xa4, 0x55, 0x9b, 0x15, 0xfa, 0xd6, 0x8a, 0xda, 0x89, 0x04,
+ 0xd6, 0xe6, 0xcb, 0x1c, 0x49, 0x50, 0xe3, 0x06, 0x69, 0xb2, 0x10, 0xc7, 0x44, 0xd0, 0x6b, 0xd0,
+ 0x1b, 0xd6, 0x09, 0x69, 0x0a, 0x8b, 0x83, 0x4c, 0x29, 0x67, 0x85, 0x22, 0x08, 0x4a, 0x4c, 0x2a,
+ 0xc2, 0x0a, 0x30, 0xaf, 0x68, 0xff, 0x92, 0x05, 0xc0, 0x2d, 0xf8, 0x1c, 0x6f, 0x83, 0x1c, 0x82,
+ 0x62, 0x60, 0x01, 0x7a, 0xc2, 0x26, 0xa9, 0xb6, 0xb3, 0xf6, 0x8f, 0xfb, 0x53, 0x69, 0x92, 0x6a,
+ 0xbc, 0x66, 0xe9, 0x3f, 0xcc, 0x6a, 0xdb, 0xdf, 0x0f, 0x30, 0x1a, 0xa3, 0x2d, 0x47, 0xa4, 0x81,
+ 0x9e, 0x31, 0xa2, 0xdc, 0x9c, 0x48, 0x44, 0xb9, 0x19, 0x64, 0xd8, 0x9a, 0x0c, 0xfa, 0xd3, 0x50,
+ 0x6c, 0x38, 0x77, 0x84, 0x90, 0xf1, 0xa9, 0xf6, 0xdd, 0xa0, 0xf4, 0x67, 0x56, 0x9c, 0x3b, 0xfc,
+ 0x1d, 0xfe, 0x94, 0xdc, 0x63, 0x2b, 0xce, 0x9d, 0x8e, 0x16, 0xe9, 0xb4, 0x11, 0xd6, 0x96, 0xeb,
+ 0x09, 0xe3, 0xb4, 0xae, 0xda, 0x72, 0xbd, 0x64, 0x5b, 0xae, 0xd7, 0x45, 0x5b, 0xae, 0x87, 0xee,
+ 0x42, 0xbf, 0xb0, 0x1d, 0x15, 0xe1, 0xf7, 0xce, 0x77, 0xd1, 0x9e, 0x30, 0x3d, 0xe5, 0x6d, 0x9e,
+ 0x97, 0x72, 0x06, 0x51, 0xda, 0xb1, 0x5d, 0xd9, 0x20, 0xfa, 0x3b, 0x16, 0x8c, 0x8a, 0xdf, 0x98,
+ 0xbc, 0xdd, 0x22, 0x61, 0x24, 0xf8, 0xf0, 0x0f, 0x75, 0xdf, 0x07, 0x51, 0x91, 0x77, 0xe5, 0x43,
+ 0xf2, 0xca, 0x34, 0x81, 0x1d, 0x7b, 0x94, 0xe8, 0x05, 0xfa, 0x45, 0x0b, 0x8e, 0x34, 0x9c, 0x3b,
+ 0xbc, 0x45, 0x5e, 0x86, 0x9d, 0xc8, 0xf5, 0x85, 0x0d, 0xc6, 0x2b, 0xdd, 0x4d, 0x7f, 0xaa, 0x3a,
+ 0xef, 0xa4, 0x54, 0xb8, 0x1e, 0xc9, 0x42, 0xe9, 0xd8, 0xd5, 0xcc, 0x7e, 0x4d, 0xaf, 0xc3, 0x80,
+ 0x5c, 0x6f, 0x0f, 0xd2, 0x30, 0x9e, 0xb5, 0x23, 0xd6, 0xda, 0x03, 0x6d, 0xe7, 0xd3, 0x30, 0xac,
+ 0xaf, 0xb1, 0x07, 0xda, 0xd6, 0xdb, 0x30, 0x99, 0xb1, 0x96, 0x1e, 0x68, 0x93, 0xb7, 0xe1, 0x44,
+ 0xee, 0xfa, 0x78, 0xa0, 0x8e, 0x0d, 0x5f, 0xb5, 0xf4, 0x73, 0xf0, 0x10, 0xb4, 0x33, 0xf3, 0xa6,
+ 0x76, 0xe6, 0x74, 0xfb, 0x9d, 0x93, 0xa3, 0xa2, 0x79, 0x4b, 0xef, 0x34, 0x3d, 0xd5, 0xd1, 0xeb,
+ 0xd0, 0x57, 0xa7, 0x25, 0xd2, 0x02, 0xd9, 0xee, 0xbc, 0x23, 0x63, 0xbe, 0x98, 0x95, 0x87, 0x58,
+ 0x50, 0xb0, 0xbf, 0x64, 0x41, 0x86, 0x6b, 0x06, 0xe5, 0x93, 0x5a, 0x6e, 0x8d, 0x0d, 0x49, 0x31,
+ 0xe6, 0x93, 0x54, 0x10, 0x98, 0x53, 0x50, 0xdc, 0x70, 0x6b, 0xc2, 0xb3, 0x58, 0x81, 0x2f, 0x51,
+ 0xf0, 0x86, 0x5b, 0x43, 0x4b, 0x80, 0xc2, 0x56, 0xb3, 0x59, 0x67, 0x66, 0x4b, 0x4e, 0xfd, 0x52,
+ 0xe0, 0xb7, 0x9a, 0xdc, 0xdc, 0xb8, 0xc8, 0x85, 0x44, 0x95, 0x14, 0x14, 0x67, 0xd4, 0xb0, 0x7f,
+ 0xd5, 0x82, 0x9e, 0x43, 0x98, 0x26, 0x6c, 0x4e, 0xd3, 0x33, 0xb9, 0xa4, 0x45, 0xd6, 0x86, 0x19,
+ 0xec, 0xdc, 0x5e, 0xbc, 0x13, 0x11, 0x2f, 0x64, 0x0c, 0x47, 0xe6, 0xac, 0xed, 0x5a, 0x30, 0x79,
+ 0xd5, 0x77, 0x6a, 0x73, 0x4e, 0xdd, 0xf1, 0xaa, 0x24, 0x58, 0xf6, 0x36, 0x0e, 0x64, 0xdb, 0x5f,
+ 0xe8, 0x68, 0xdb, 0x7f, 0x11, 0xfa, 0xdc, 0xa6, 0x16, 0xf6, 0xfd, 0x0c, 0x9d, 0xdd, 0xe5, 0xb2,
+ 0x88, 0xf8, 0x8e, 0x8c, 0xc6, 0x59, 0x29, 0x16, 0xf8, 0x74, 0x59, 0x72, 0xa3, 0xba, 0x9e, 0xfc,
+ 0x65, 0x49, 0xdf, 0x3a, 0xc9, 0x70, 0x66, 0x86, 0xf9, 0xf7, 0x26, 0x18, 0x4d, 0x08, 0x0f, 0x46,
+ 0x0c, 0xfd, 0x2e, 0xff, 0x52, 0xb1, 0x36, 0x1f, 0xcf, 0x7e, 0x83, 0xa4, 0x06, 0x46, 0xf3, 0xcd,
+ 0xe3, 0x05, 0x58, 0x12, 0xb2, 0x2f, 0x42, 0x66, 0xf8, 0x99, 0xce, 0xf2, 0x25, 0xfb, 0x63, 0x30,
+ 0xc1, 0x6a, 0x1e, 0x50, 0x76, 0x63, 0x27, 0xa4, 0xe2, 0x19, 0x11, 0x7c, 0xed, 0xff, 0x6c, 0x01,
+ 0x5a, 0xf1, 0x6b, 0xee, 0xfa, 0x8e, 0x20, 0xce, 0xbf, 0xff, 0x6d, 0x28, 0xf1, 0xc7, 0x71, 0x32,
+ 0xca, 0xed, 0x7c, 0xdd, 0x09, 0x43, 0x4d, 0x22, 0xff, 0xb8, 0x68, 0xb7, 0xb4, 0xd6, 0x1e, 0x1d,
+ 0x77, 0xa2, 0x87, 0xde, 0x48, 0x04, 0x1d, 0xfc, 0x70, 0x2a, 0xe8, 0xe0, 0xe3, 0x99, 0x76, 0x31,
+ 0xe9, 0xde, 0xcb, 0x60, 0x84, 0xf6, 0xe7, 0x2d, 0x18, 0x5b, 0x4d, 0x44, 0x6d, 0x3d, 0xcb, 0x8c,
+ 0x04, 0x32, 0x34, 0x4d, 0x15, 0x56, 0x8a, 0x05, 0xf4, 0xbe, 0x4b, 0x62, 0xff, 0xc6, 0x82, 0x38,
+ 0xdc, 0xd5, 0x21, 0xb0, 0xdc, 0xf3, 0x06, 0xcb, 0x9d, 0xf9, 0x7c, 0x51, 0xdd, 0xc9, 0xe3, 0xb8,
+ 0xd1, 0x15, 0x35, 0x27, 0x6d, 0x5e, 0x2e, 0x31, 0x19, 0xbe, 0xcf, 0x46, 0xcd, 0x89, 0x53, 0xb3,
+ 0xf1, 0xf5, 0x02, 0x20, 0x85, 0xdb, 0x75, 0xa0, 0xca, 0x74, 0x8d, 0xfb, 0x13, 0xa8, 0x72, 0x1b,
+ 0x10, 0x33, 0x73, 0x09, 0x1c, 0x2f, 0xe4, 0x64, 0x5d, 0x21, 0x7b, 0x3e, 0x98, 0x0d, 0xcd, 0xb4,
+ 0xf4, 0x5c, 0xbd, 0x9a, 0xa2, 0x86, 0x33, 0x5a, 0xd0, 0xcc, 0x97, 0x7a, 0xbb, 0x35, 0x5f, 0xea,
+ 0xeb, 0xe0, 0x82, 0xfd, 0x15, 0x0b, 0x46, 0xd4, 0x30, 0xbd, 0x4b, 0x5c, 0x40, 0x54, 0x7f, 0x72,
+ 0xee, 0x95, 0xb2, 0xd6, 0x65, 0xc6, 0x0c, 0x7c, 0x07, 0x73, 0xa5, 0x77, 0xea, 0xee, 0x5d, 0xa2,
+ 0xe2, 0x29, 0x97, 0x84, 0x6b, 0xbc, 0x28, 0xdd, 0xdf, 0x2d, 0x8d, 0xa8, 0x7f, 0x3c, 0x82, 0x6b,
+ 0x5c, 0xc5, 0xfe, 0x69, 0xba, 0xd9, 0xcd, 0xa5, 0x88, 0x5e, 0x80, 0xde, 0xe6, 0xa6, 0x13, 0x92,
+ 0x84, 0xab, 0x5c, 0x6f, 0x99, 0x16, 0xee, 0xef, 0x96, 0x46, 0x55, 0x05, 0x56, 0x82, 0x39, 0x76,
+ 0xf7, 0xe1, 0x3f, 0xd3, 0x8b, 0xb3, 0x63, 0xf8, 0xcf, 0xbf, 0xb4, 0xa0, 0x67, 0x95, 0xde, 0x5e,
+ 0x0f, 0xfe, 0x08, 0x78, 0xd5, 0x38, 0x02, 0x4e, 0xe6, 0x65, 0x16, 0xca, 0xdd, 0xfd, 0x4b, 0x89,
+ 0xdd, 0x7f, 0x3a, 0x97, 0x42, 0xfb, 0x8d, 0xdf, 0x80, 0x21, 0x96, 0xaf, 0x48, 0xb8, 0x05, 0x3e,
+ 0x67, 0x6c, 0xf8, 0x52, 0x62, 0xc3, 0x8f, 0x69, 0xa8, 0xda, 0x4e, 0x7f, 0x02, 0xfa, 0x85, 0x9f,
+ 0x59, 0x32, 0x22, 0x81, 0xc0, 0xc5, 0x12, 0x6e, 0xff, 0x64, 0x11, 0x8c, 0xfc, 0x48, 0xe8, 0xd7,
+ 0x2d, 0x98, 0x09, 0xb8, 0xfd, 0x79, 0x6d, 0xa1, 0x15, 0xb8, 0xde, 0x46, 0xa5, 0xba, 0x49, 0x6a,
+ 0xad, 0xba, 0xeb, 0x6d, 0x2c, 0x6f, 0x78, 0xbe, 0x2a, 0x5e, 0xbc, 0x43, 0xaa, 0x2d, 0xa6, 0x1b,
+ 0xee, 0x90, 0x8c, 0x49, 0xf9, 0x71, 0x3c, 0xbb, 0xb7, 0x5b, 0x9a, 0xc1, 0x07, 0xa2, 0x8d, 0x0f,
+ 0xd8, 0x17, 0xf4, 0x7b, 0x16, 0x9c, 0xe7, 0x79, 0x7a, 0xba, 0xef, 0x7f, 0x1b, 0x09, 0x47, 0x59,
+ 0x92, 0x8a, 0x89, 0xac, 0x91, 0xa0, 0x31, 0xf7, 0xa2, 0x18, 0xd0, 0xf3, 0xe5, 0x83, 0xb5, 0x85,
+ 0x0f, 0xda, 0x39, 0xfb, 0x5f, 0x14, 0x61, 0x44, 0x84, 0x89, 0x14, 0x77, 0xc0, 0x0b, 0xc6, 0x92,
+ 0x78, 0x38, 0xb1, 0x24, 0x26, 0x0c, 0xe4, 0xfb, 0x73, 0xfc, 0x87, 0x30, 0x41, 0x0f, 0xe7, 0xcb,
+ 0xc4, 0x09, 0xa2, 0x5b, 0xc4, 0xe1, 0x56, 0x89, 0xc5, 0x03, 0x9f, 0xfe, 0x4a, 0x3c, 0x7e, 0x35,
+ 0x49, 0x0c, 0xa7, 0xe9, 0xbf, 0x97, 0xee, 0x1c, 0x0f, 0xc6, 0x53, 0x91, 0x3e, 0xdf, 0x84, 0x41,
+ 0xe5, 0x24, 0x25, 0x0e, 0x9d, 0xf6, 0x01, 0x73, 0x93, 0x14, 0xb8, 0xd0, 0x33, 0x76, 0xd0, 0x8b,
+ 0xc9, 0xd9, 0xff, 0xa4, 0x60, 0x34, 0xc8, 0x27, 0x71, 0x15, 0x06, 0x9c, 0x90, 0x05, 0xf1, 0xae,
+ 0xb5, 0x93, 0x4b, 0xa7, 0x9a, 0x61, 0x8e, 0x6a, 0xb3, 0xa2, 0x26, 0x56, 0x34, 0xd0, 0x65, 0x6e,
+ 0xfb, 0xb9, 0x4d, 0xda, 0x09, 0xa5, 0x53, 0xd4, 0x40, 0x5a, 0x87, 0x6e, 0x13, 0x2c, 0xea, 0xa3,
+ 0x4f, 0x70, 0xe3, 0xdc, 0x2b, 0x9e, 0x7f, 0xdb, 0xbb, 0xe4, 0xfb, 0x32, 0x24, 0x50, 0x77, 0x04,
+ 0x27, 0xa4, 0x49, 0xae, 0xaa, 0x8e, 0x4d, 0x6a, 0xdd, 0x85, 0xce, 0xfe, 0x0c, 0xb0, 0xbc, 0x24,
+ 0x66, 0x4c, 0x82, 0x10, 0x11, 0x18, 0x13, 0x31, 0x48, 0x65, 0x99, 0x18, 0xbb, 0xcc, 0xe7, 0xb7,
+ 0x59, 0x3b, 0xd6, 0xe3, 0x5c, 0x31, 0x49, 0xe0, 0x24, 0x4d, 0x7b, 0x93, 0x1f, 0xc2, 0x4b, 0xc4,
+ 0x89, 0x5a, 0x01, 0x09, 0xd1, 0x47, 0x61, 0x2a, 0xfd, 0x32, 0x16, 0xea, 0x10, 0x8b, 0x71, 0xcf,
+ 0x27, 0xf7, 0x76, 0x4b, 0x53, 0x95, 0x1c, 0x1c, 0x9c, 0x5b, 0xdb, 0xfe, 0x59, 0x0b, 0x98, 0x27,
+ 0xf8, 0x21, 0x70, 0x3e, 0x1f, 0x31, 0x39, 0x9f, 0xa9, 0xbc, 0xe9, 0xcc, 0x61, 0x7a, 0x9e, 0xe7,
+ 0x6b, 0xb8, 0x1c, 0xf8, 0x77, 0x76, 0x84, 0xed, 0x56, 0xe7, 0x67, 0x9c, 0xfd, 0x45, 0x0b, 0x58,
+ 0x12, 0x1f, 0xcc, 0x5f, 0xed, 0x52, 0xc1, 0xd1, 0xd9, 0x2c, 0xe1, 0xa3, 0x30, 0xb0, 0x2e, 0x86,
+ 0x3f, 0x43, 0xe8, 0x64, 0x74, 0xd8, 0xa4, 0x2d, 0x27, 0x4d, 0x78, 0x74, 0x8a, 0x7f, 0x58, 0x51,
+ 0xb3, 0xff, 0xb1, 0x05, 0xd3, 0xf9, 0xd5, 0xd0, 0x75, 0x38, 0x1e, 0x90, 0x6a, 0x2b, 0x08, 0xe9,
+ 0x96, 0x10, 0x0f, 0x20, 0xe1, 0x14, 0xc5, 0xa7, 0xfa, 0xa1, 0xbd, 0xdd, 0xd2, 0x71, 0x9c, 0x8d,
+ 0x82, 0xf3, 0xea, 0xa2, 0x97, 0x60, 0xb4, 0x15, 0x72, 0xce, 0x8f, 0x31, 0x5d, 0xa1, 0x88, 0x14,
+ 0xcd, 0xfc, 0x86, 0xae, 0x1b, 0x10, 0x9c, 0xc0, 0xb4, 0xbf, 0x8b, 0x2f, 0x47, 0x15, 0x2c, 0xba,
+ 0x01, 0x13, 0x9e, 0xf6, 0x9f, 0xde, 0x80, 0xf2, 0xa9, 0xff, 0x68, 0xa7, 0x5b, 0x9f, 0x5d, 0x97,
+ 0x9a, 0xaf, 0x7a, 0x82, 0x0c, 0x4e, 0x53, 0xb6, 0x7f, 0xca, 0x82, 0xe3, 0x3a, 0xa2, 0xe6, 0x0e,
+ 0xd7, 0x49, 0x97, 0xb7, 0x00, 0x03, 0x7e, 0x93, 0x04, 0x4e, 0xe4, 0x07, 0xe2, 0x9a, 0x3b, 0x27,
+ 0x57, 0xe8, 0x35, 0x51, 0xbe, 0x2f, 0x92, 0xd7, 0x48, 0xea, 0xb2, 0x1c, 0xab, 0x9a, 0xc8, 0x86,
+ 0x3e, 0x26, 0x40, 0x0c, 0x85, 0xe3, 0x23, 0x3b, 0xb4, 0x98, 0x7d, 0x4a, 0x88, 0x05, 0xc4, 0xfe,
+ 0x33, 0x8b, 0xaf, 0x4f, 0xbd, 0xeb, 0xe8, 0x6d, 0x18, 0x6f, 0x38, 0x51, 0x75, 0x73, 0xf1, 0x4e,
+ 0x33, 0xe0, 0x2a, 0x5a, 0x39, 0x4e, 0x4f, 0x75, 0x1a, 0x27, 0xed, 0x23, 0x63, 0x03, 0xe9, 0x95,
+ 0x04, 0x31, 0x9c, 0x22, 0x8f, 0x6e, 0xc1, 0x10, 0x2b, 0x63, 0x3e, 0xbd, 0x61, 0x3b, 0x5e, 0x26,
+ 0xaf, 0x35, 0x65, 0xe2, 0xb3, 0x12, 0xd3, 0xc1, 0x3a, 0x51, 0xfb, 0xcb, 0x45, 0x7e, 0x68, 0xb0,
+ 0xb7, 0xc7, 0x13, 0xd0, 0xdf, 0xf4, 0x6b, 0xf3, 0xcb, 0x0b, 0x58, 0xcc, 0x82, 0xba, 0xf7, 0xca,
+ 0xbc, 0x18, 0x4b, 0x38, 0x3a, 0x07, 0x03, 0xe2, 0xa7, 0x54, 0xa9, 0xb3, 0x3d, 0x22, 0xf0, 0x42,
+ 0xac, 0xa0, 0xe8, 0x59, 0x80, 0x66, 0xe0, 0x6f, 0xbb, 0x35, 0x16, 0x89, 0xa9, 0x68, 0x5a, 0xe7,
+ 0x95, 0x15, 0x04, 0x6b, 0x58, 0xe8, 0x65, 0x18, 0x69, 0x79, 0x21, 0xe7, 0x9f, 0xb4, 0x78, 0xf7,
+ 0xca, 0x6e, 0xec, 0xba, 0x0e, 0xc4, 0x26, 0x2e, 0x9a, 0x85, 0xbe, 0xc8, 0x61, 0xd6, 0x66, 0xbd,
+ 0xf9, 0x46, 0xf4, 0x6b, 0x14, 0x43, 0xcf, 0x2c, 0x47, 0x2b, 0x60, 0x51, 0x11, 0xbd, 0x29, 0xdd,
+ 0xeb, 0xf9, 0x4d, 0x24, 0xbc, 0x57, 0xba, 0xbb, 0xb5, 0x34, 0xe7, 0x7a, 0xe1, 0x15, 0x63, 0xd0,
+ 0x42, 0x2f, 0x01, 0x90, 0x3b, 0x11, 0x09, 0x3c, 0xa7, 0xae, 0x6c, 0x44, 0x15, 0x23, 0xb3, 0xe0,
+ 0xaf, 0xfa, 0xd1, 0xf5, 0x90, 0x2c, 0x2a, 0x0c, 0xac, 0x61, 0xdb, 0xdf, 0x3f, 0x04, 0x10, 0x3f,
+ 0x34, 0xd0, 0x5d, 0x18, 0xa8, 0x3a, 0x4d, 0xa7, 0xca, 0xd3, 0xa6, 0x16, 0xf3, 0xbc, 0x9e, 0xe3,
+ 0x1a, 0x33, 0xf3, 0x02, 0x9d, 0x2b, 0x6f, 0x64, 0xc8, 0xf0, 0x01, 0x59, 0xdc, 0x51, 0x61, 0xa3,
+ 0xda, 0x43, 0x9f, 0xb3, 0x60, 0x48, 0x44, 0x3a, 0x62, 0x33, 0x54, 0xc8, 0xd7, 0xb7, 0x69, 0xed,
+ 0xcf, 0xc6, 0x35, 0x78, 0x17, 0x9e, 0x93, 0x2b, 0x54, 0x83, 0x74, 0xec, 0x85, 0xde, 0x30, 0xfa,
+ 0xa0, 0x7c, 0xdb, 0x16, 0x8d, 0xa1, 0x54, 0x6f, 0xdb, 0x41, 0x76, 0xd5, 0xe8, 0xcf, 0xda, 0xeb,
+ 0xc6, 0xb3, 0xb6, 0x27, 0xdf, 0x7f, 0xd8, 0xe0, 0xb7, 0x3b, 0xbd, 0x68, 0x51, 0x59, 0x8f, 0x25,
+ 0xd2, 0x9b, 0xef, 0xf4, 0xaa, 0x3d, 0xec, 0x3a, 0xc4, 0x11, 0xf9, 0x34, 0x8c, 0xd5, 0x4c, 0xae,
+ 0x45, 0xac, 0xc4, 0xc7, 0xf3, 0xe8, 0x26, 0x98, 0x9c, 0x98, 0x4f, 0x49, 0x00, 0x70, 0x92, 0x30,
+ 0x2a, 0xf3, 0xd0, 0x32, 0xcb, 0xde, 0xba, 0x2f, 0x3c, 0xa8, 0xec, 0xdc, 0xb9, 0xdc, 0x09, 0x23,
+ 0xd2, 0xa0, 0x98, 0x31, 0x93, 0xb0, 0x2a, 0xea, 0x62, 0x45, 0x05, 0xbd, 0x0e, 0x7d, 0xcc, 0xeb,
+ 0x31, 0x9c, 0x1a, 0xc8, 0x57, 0x6b, 0x98, 0x91, 0x50, 0xe3, 0x0d, 0xc9, 0xfe, 0x86, 0x58, 0x50,
+ 0x40, 0x97, 0xa5, 0x4f, 0x71, 0xb8, 0xec, 0x5d, 0x0f, 0x09, 0xf3, 0x29, 0x1e, 0x9c, 0x7b, 0x34,
+ 0x76, 0x17, 0xe6, 0xe5, 0x99, 0xf9, 0x67, 0x8d, 0x9a, 0x94, 0xed, 0x13, 0xff, 0x65, 0x5a, 0x5b,
+ 0x11, 0xb7, 0x2d, 0xb3, 0x7b, 0x66, 0xea, 0xdb, 0x78, 0x38, 0x6f, 0x98, 0x24, 0x70, 0x92, 0x26,
+ 0x65, 0xa1, 0xf9, 0xae, 0x17, 0x3e, 0x58, 0x9d, 0xce, 0x0e, 0x2e, 0x39, 0x60, 0xb7, 0x11, 0x2f,
+ 0xc1, 0xa2, 0x3e, 0x72, 0x61, 0x2c, 0x30, 0xd8, 0x0b, 0x19, 0x6e, 0xed, 0x6c, 0x77, 0x4c, 0x8c,
+ 0x16, 0xc8, 0xdf, 0x24, 0x83, 0x93, 0x74, 0xd1, 0xeb, 0x1a, 0xa3, 0x34, 0xd2, 0xfe, 0xe5, 0xdf,
+ 0x89, 0x35, 0x9a, 0xde, 0x82, 0x11, 0xe3, 0xb0, 0x79, 0xa0, 0x2a, 0x48, 0x0f, 0xc6, 0x93, 0x27,
+ 0xcb, 0x03, 0xd5, 0x3c, 0xfe, 0x49, 0x0f, 0x8c, 0x9a, 0x3b, 0x01, 0x9d, 0x87, 0x41, 0x41, 0x44,
+ 0x65, 0xb4, 0x52, 0x9b, 0x7b, 0x45, 0x02, 0x70, 0x8c, 0xc3, 0x12, 0x99, 0xb1, 0xea, 0x9a, 0xaf,
+ 0x40, 0x9c, 0xc8, 0x4c, 0x41, 0xb0, 0x86, 0x45, 0x1f, 0xb0, 0xb7, 0x7c, 0x3f, 0x52, 0xf7, 0xa8,
+ 0xda, 0x2e, 0x73, 0xac, 0x14, 0x0b, 0x28, 0xbd, 0x3f, 0xb7, 0x48, 0xe0, 0x91, 0xba, 0x99, 0xd2,
+ 0x41, 0xdd, 0x9f, 0x57, 0x74, 0x20, 0x36, 0x71, 0x29, 0x17, 0xe0, 0x87, 0x6c, 0xff, 0x89, 0x67,
+ 0x72, 0xec, 0x7b, 0x51, 0xe1, 0x51, 0x24, 0x24, 0x1c, 0x7d, 0x0c, 0x8e, 0xab, 0xf0, 0x89, 0x62,
+ 0x75, 0xc9, 0x16, 0xfb, 0x0c, 0xa9, 0xd6, 0xf1, 0xf9, 0x6c, 0x34, 0x9c, 0x57, 0x1f, 0xbd, 0x0a,
+ 0xa3, 0xe2, 0x29, 0x25, 0x29, 0xf6, 0x9b, 0x86, 0x84, 0x57, 0x0c, 0x28, 0x4e, 0x60, 0xcb, 0xa4,
+ 0x14, 0xec, 0x8d, 0x21, 0x29, 0x0c, 0xa4, 0x93, 0x52, 0xe8, 0x70, 0x9c, 0xaa, 0x81, 0x66, 0x61,
+ 0x8c, 0xb3, 0x8e, 0xae, 0xb7, 0xc1, 0xe7, 0x44, 0x78, 0x76, 0xaa, 0x4d, 0x75, 0xcd, 0x04, 0xe3,
+ 0x24, 0x3e, 0xba, 0x08, 0xc3, 0x4e, 0x50, 0xdd, 0x74, 0x23, 0x52, 0xa5, 0x3b, 0x83, 0xd9, 0xf2,
+ 0x69, 0x96, 0x98, 0xb3, 0x1a, 0x0c, 0x1b, 0x98, 0xf6, 0x5d, 0x98, 0xcc, 0x08, 0x2f, 0x43, 0x17,
+ 0x8e, 0xd3, 0x74, 0xe5, 0x37, 0x25, 0xdc, 0x1d, 0x66, 0xcb, 0xcb, 0xf2, 0x6b, 0x34, 0x2c, 0xba,
+ 0x3a, 0x59, 0x18, 0x1a, 0x2d, 0xf9, 0xb6, 0x5a, 0x9d, 0x4b, 0x12, 0x80, 0x63, 0x1c, 0xfb, 0xaf,
+ 0x0a, 0x30, 0x96, 0xa1, 0xa0, 0x63, 0x09, 0xa0, 0x13, 0x2f, 0xad, 0x38, 0xdf, 0xb3, 0x99, 0xe3,
+ 0xa4, 0x70, 0x80, 0x1c, 0x27, 0xc5, 0x4e, 0x39, 0x4e, 0x7a, 0xde, 0x49, 0x8e, 0x13, 0x73, 0xc4,
+ 0x7a, 0xbb, 0x1a, 0xb1, 0x8c, 0xbc, 0x28, 0x7d, 0x07, 0xcc, 0x8b, 0x62, 0x0c, 0x7a, 0x7f, 0x17,
+ 0x83, 0xfe, 0xa3, 0x05, 0x18, 0x4f, 0xea, 0xf6, 0x0e, 0x41, 0x3e, 0xfe, 0xba, 0x21, 0x1f, 0x3f,
+ 0xd7, 0x8d, 0x27, 0x7e, 0xae, 0xac, 0x1c, 0x27, 0x64, 0xe5, 0x4f, 0x76, 0x45, 0xad, 0xbd, 0xdc,
+ 0xfc, 0xef, 0x17, 0xe0, 0x68, 0xa6, 0xca, 0xf3, 0x10, 0xc6, 0xe6, 0x9a, 0x31, 0x36, 0xcf, 0x74,
+ 0x1d, 0xa5, 0x20, 0x77, 0x80, 0x6e, 0x26, 0x06, 0xe8, 0x7c, 0xf7, 0x24, 0xdb, 0x8f, 0xd2, 0x37,
+ 0x8a, 0x70, 0x3a, 0xb3, 0x5e, 0x2c, 0x5e, 0x5e, 0x32, 0xc4, 0xcb, 0xcf, 0x26, 0xc4, 0xcb, 0x76,
+ 0xfb, 0xda, 0xf7, 0x47, 0xde, 0x2c, 0xbc, 0xf5, 0x59, 0xcc, 0x91, 0x7b, 0x94, 0x35, 0x1b, 0xde,
+ 0xfa, 0x8a, 0x10, 0x36, 0xe9, 0xbe, 0x97, 0x64, 0xcc, 0xbf, 0x6b, 0xc1, 0x89, 0xcc, 0xb9, 0x39,
+ 0x04, 0x49, 0xdf, 0xaa, 0x29, 0xe9, 0x7b, 0xa2, 0xeb, 0xd5, 0x9a, 0x23, 0xfa, 0xfb, 0x7c, 0x5f,
+ 0xce, 0xb7, 0x30, 0x01, 0xc4, 0x35, 0x18, 0x72, 0xaa, 0x55, 0x12, 0x86, 0x2b, 0x7e, 0x4d, 0xa5,
+ 0x43, 0x78, 0x86, 0x3d, 0x0f, 0xe3, 0xe2, 0xfd, 0xdd, 0xd2, 0x74, 0x92, 0x44, 0x0c, 0xc6, 0x3a,
+ 0x05, 0xf4, 0x09, 0x18, 0x08, 0x65, 0x26, 0xcb, 0x9e, 0x7b, 0xcf, 0x64, 0xc9, 0x98, 0x5c, 0x25,
+ 0x60, 0x51, 0x24, 0xd1, 0x77, 0xea, 0xd1, 0x9f, 0xda, 0x88, 0x16, 0x79, 0x27, 0xef, 0x21, 0x06,
+ 0xd4, 0xb3, 0x00, 0xdb, 0xea, 0x25, 0x93, 0x14, 0x9e, 0x68, 0x6f, 0x1c, 0x0d, 0x0b, 0xbd, 0x06,
+ 0xe3, 0x21, 0x0f, 0x7c, 0x1a, 0x1b, 0xa9, 0xf0, 0xb5, 0xc8, 0x62, 0xc7, 0x55, 0x12, 0x30, 0x9c,
+ 0xc2, 0x46, 0x4b, 0xb2, 0x55, 0x66, 0x8e, 0xc4, 0x97, 0xe7, 0xd9, 0xb8, 0x45, 0x61, 0x92, 0x74,
+ 0x24, 0x39, 0x09, 0x6c, 0xf8, 0xb5, 0x9a, 0xe8, 0x13, 0x00, 0x74, 0x11, 0x09, 0x21, 0x4a, 0x7f,
+ 0xfe, 0x11, 0x4a, 0xcf, 0x96, 0x5a, 0xa6, 0x27, 0x03, 0x73, 0xb3, 0x5f, 0x50, 0x44, 0xb0, 0x46,
+ 0x10, 0x39, 0x30, 0x12, 0xff, 0x8b, 0x73, 0xb4, 0x9f, 0xcb, 0x6d, 0x21, 0x49, 0x9c, 0x29, 0x18,
+ 0x16, 0x74, 0x12, 0xd8, 0xa4, 0x88, 0x3e, 0x0e, 0x27, 0xb6, 0x73, 0x2d, 0x7f, 0x38, 0x27, 0xc8,
+ 0x92, 0xae, 0xe7, 0xdb, 0xfb, 0xe4, 0xd7, 0xb7, 0xff, 0x2d, 0xc0, 0x43, 0x6d, 0x4e, 0x7a, 0x34,
+ 0x6b, 0x6a, 0xed, 0x9f, 0x4a, 0x4a, 0x36, 0xa6, 0x33, 0x2b, 0x1b, 0xa2, 0x8e, 0xc4, 0x86, 0x2a,
+ 0xbc, 0xe3, 0x0d, 0xf5, 0x43, 0x96, 0x26, 0x73, 0xe2, 0x36, 0xdd, 0x1f, 0x39, 0xe0, 0x0d, 0x76,
+ 0x1f, 0x85, 0x50, 0xeb, 0x19, 0x92, 0x9c, 0x67, 0xbb, 0xee, 0x4e, 0xf7, 0xa2, 0x9d, 0xaf, 0x66,
+ 0x07, 0x7c, 0xe7, 0x42, 0x9e, 0x4b, 0x07, 0xfd, 0xfe, 0xc3, 0x0a, 0xfe, 0xfe, 0x75, 0x0b, 0x4e,
+ 0xa4, 0x8a, 0x79, 0x1f, 0x48, 0x28, 0xa2, 0xdd, 0xad, 0xbe, 0xe3, 0xce, 0x4b, 0x82, 0xfc, 0x1b,
+ 0x2e, 0x8b, 0x6f, 0x38, 0x91, 0x8b, 0x97, 0xec, 0xfa, 0x17, 0xfe, 0xb8, 0x34, 0xc9, 0x1a, 0x30,
+ 0x11, 0x71, 0x7e, 0xd7, 0x51, 0x13, 0xce, 0x54, 0x5b, 0x41, 0x10, 0x2f, 0xd6, 0x8c, 0xcd, 0xc9,
+ 0xdf, 0x7a, 0x8f, 0xee, 0xed, 0x96, 0xce, 0xcc, 0x77, 0xc0, 0xc5, 0x1d, 0xa9, 0x21, 0x0f, 0x50,
+ 0x23, 0x65, 0x5f, 0xc7, 0x0e, 0x80, 0x1c, 0x39, 0x4c, 0xda, 0x1a, 0x8f, 0x5b, 0xca, 0x66, 0x58,
+ 0xe9, 0x65, 0x50, 0x3e, 0x5c, 0xe9, 0xc9, 0xb7, 0x26, 0x2e, 0xfd, 0xf4, 0x55, 0x38, 0xdd, 0x7e,
+ 0x31, 0x1d, 0x28, 0x94, 0xc3, 0x1f, 0x58, 0x70, 0xaa, 0x6d, 0xbc, 0xb0, 0x6f, 0xc3, 0xc7, 0x82,
+ 0xfd, 0x59, 0x0b, 0x1e, 0xce, 0xac, 0x91, 0x74, 0xc2, 0xab, 0xd2, 0x42, 0xcd, 0x1c, 0x35, 0x8e,
+ 0x9c, 0x23, 0x01, 0x38, 0xc6, 0x31, 0x2c, 0x36, 0x0b, 0x1d, 0x2d, 0x36, 0x7f, 0xcb, 0x82, 0xd4,
+ 0x55, 0x7f, 0x08, 0x9c, 0xe7, 0xb2, 0xc9, 0x79, 0x3e, 0xda, 0xcd, 0x68, 0xe6, 0x30, 0x9d, 0x7f,
+ 0x31, 0x06, 0xc7, 0x72, 0x3c, 0xb1, 0xb7, 0x61, 0x62, 0xa3, 0x4a, 0xcc, 0xd0, 0x1b, 0xed, 0x42,
+ 0xd2, 0xb5, 0x8d, 0xd3, 0x31, 0x77, 0x74, 0x6f, 0xb7, 0x34, 0x91, 0x42, 0xc1, 0xe9, 0x26, 0xd0,
+ 0x67, 0x2d, 0x38, 0xe2, 0xdc, 0x0e, 0x17, 0xe9, 0x0b, 0xc2, 0xad, 0xce, 0xd5, 0xfd, 0xea, 0x16,
+ 0x65, 0xcc, 0xe4, 0xb6, 0x7a, 0x3e, 0x53, 0x18, 0x7d, 0xb3, 0x92, 0xc2, 0x37, 0x9a, 0x9f, 0xda,
+ 0xdb, 0x2d, 0x1d, 0xc9, 0xc2, 0xc2, 0x99, 0x6d, 0x21, 0x2c, 0x32, 0x7e, 0x39, 0xd1, 0x66, 0xbb,
+ 0xe0, 0x30, 0x59, 0x2e, 0xf3, 0x9c, 0x25, 0x96, 0x10, 0xac, 0xe8, 0xa0, 0x4f, 0xc1, 0xe0, 0x86,
+ 0x8c, 0x03, 0x91, 0xc1, 0x72, 0xc7, 0x03, 0xd9, 0x3e, 0x3a, 0x06, 0x37, 0x81, 0x51, 0x48, 0x38,
+ 0x26, 0x8a, 0x5e, 0x85, 0xa2, 0xb7, 0x1e, 0x8a, 0x10, 0x75, 0xd9, 0x96, 0xb8, 0xa6, 0xad, 0x33,
+ 0x0f, 0xc1, 0xb4, 0xba, 0x54, 0xc1, 0xb4, 0x22, 0xba, 0x0c, 0xc5, 0xe0, 0x56, 0x4d, 0x68, 0x52,
+ 0x32, 0x37, 0x29, 0x9e, 0x5b, 0xc8, 0xe9, 0x15, 0xa3, 0x84, 0xe7, 0x16, 0x30, 0x25, 0x81, 0xca,
+ 0xd0, 0xcb, 0xdc, 0x97, 0x05, 0x6b, 0x9b, 0xf9, 0x94, 0x6f, 0x13, 0x06, 0x80, 0x7b, 0x24, 0x32,
+ 0x04, 0xcc, 0x09, 0xa1, 0x35, 0xe8, 0xab, 0xba, 0x5e, 0x8d, 0x04, 0x82, 0x97, 0xfd, 0x60, 0xa6,
+ 0xce, 0x84, 0x61, 0xe4, 0xd0, 0xe4, 0x2a, 0x04, 0x86, 0x81, 0x05, 0x2d, 0x46, 0x95, 0x34, 0x37,
+ 0xd7, 0xe5, 0x8d, 0x95, 0x4d, 0x95, 0x34, 0x37, 0x97, 0x2a, 0x6d, 0xa9, 0x32, 0x0c, 0x2c, 0x68,
+ 0xa1, 0x97, 0xa0, 0xb0, 0x5e, 0x15, 0xae, 0xc9, 0x99, 0xca, 0x13, 0x33, 0x8a, 0xd6, 0x5c, 0xdf,
+ 0xde, 0x6e, 0xa9, 0xb0, 0x34, 0x8f, 0x0b, 0xeb, 0x55, 0xb4, 0x0a, 0xfd, 0xeb, 0x3c, 0xee, 0x8e,
+ 0xd0, 0x8f, 0x3c, 0x9e, 0x1d, 0x12, 0x28, 0x15, 0x9a, 0x87, 0x7b, 0x97, 0x0a, 0x00, 0x96, 0x44,
+ 0x58, 0x02, 0x2a, 0x15, 0x3f, 0x48, 0x84, 0x2f, 0x9d, 0x39, 0x58, 0xcc, 0x27, 0xfe, 0xd4, 0x88,
+ 0xa3, 0x10, 0x61, 0x8d, 0x22, 0x5d, 0xd5, 0xce, 0xdd, 0x56, 0xc0, 0x72, 0x5b, 0x08, 0xd5, 0x48,
+ 0xe6, 0xaa, 0x9e, 0x95, 0x48, 0xed, 0x56, 0xb5, 0x42, 0xc2, 0x31, 0x51, 0xb4, 0x05, 0x23, 0xdb,
+ 0x61, 0x73, 0x93, 0xc8, 0x2d, 0xcd, 0xc2, 0xde, 0xe5, 0x70, 0xb3, 0x37, 0x04, 0xa2, 0x1b, 0x44,
+ 0x2d, 0xa7, 0x9e, 0x3a, 0x85, 0xd8, 0xb3, 0xe6, 0x86, 0x4e, 0x0c, 0x9b, 0xb4, 0xe9, 0xf0, 0xbf,
+ 0xdd, 0xf2, 0x6f, 0xed, 0x44, 0x44, 0x44, 0x1d, 0xcd, 0x1c, 0xfe, 0x37, 0x38, 0x4a, 0x7a, 0xf8,
+ 0x05, 0x00, 0x4b, 0x22, 0xe8, 0x86, 0x18, 0x1e, 0x76, 0x7a, 0x8e, 0xe7, 0x87, 0x34, 0x9f, 0x95,
+ 0x48, 0x39, 0x83, 0xc2, 0x4e, 0xcb, 0x98, 0x14, 0x3b, 0x25, 0x9b, 0x9b, 0x7e, 0xe4, 0x7b, 0x89,
+ 0x13, 0x7a, 0x22, 0xff, 0x94, 0x2c, 0x67, 0xe0, 0xa7, 0x4f, 0xc9, 0x2c, 0x2c, 0x9c, 0xd9, 0x16,
+ 0xaa, 0xc1, 0x68, 0xd3, 0x0f, 0xa2, 0xdb, 0x7e, 0x20, 0xd7, 0x17, 0x6a, 0x23, 0x28, 0x35, 0x30,
+ 0x45, 0x8b, 0xcc, 0x30, 0xc7, 0x84, 0xe0, 0x04, 0x4d, 0xf4, 0x51, 0xe8, 0x0f, 0xab, 0x4e, 0x9d,
+ 0x2c, 0x5f, 0x9b, 0x9a, 0xcc, 0xbf, 0x7e, 0x2a, 0x1c, 0x25, 0x67, 0x75, 0xf1, 0xb0, 0x49, 0x1c,
+ 0x05, 0x4b, 0x72, 0x68, 0x09, 0x7a, 0x59, 0x62, 0x67, 0x16, 0x22, 0x37, 0x27, 0x32, 0x7b, 0xca,
+ 0xad, 0x86, 0x9f, 0x4d, 0xac, 0x18, 0xf3, 0xea, 0x74, 0x0f, 0x08, 0x49, 0x81, 0x1f, 0x4e, 0x1d,
+ 0xcd, 0xdf, 0x03, 0x42, 0xc0, 0x70, 0xad, 0xd2, 0x6e, 0x0f, 0x28, 0x24, 0x1c, 0x13, 0xa5, 0x27,
+ 0x33, 0x3d, 0x4d, 0x8f, 0xb5, 0x31, 0x99, 0xcc, 0x3d, 0x4b, 0xd9, 0xc9, 0x4c, 0x4f, 0x52, 0x4a,
+ 0xc2, 0xfe, 0x8d, 0x81, 0x34, 0xcf, 0xc2, 0x24, 0x4c, 0xff, 0xbf, 0x95, 0xb2, 0x99, 0xf8, 0x50,
+ 0xb7, 0x02, 0xef, 0xfb, 0xf8, 0x70, 0xfd, 0xac, 0x05, 0xc7, 0x9a, 0x99, 0x1f, 0x22, 0x18, 0x80,
+ 0xee, 0xe4, 0xe6, 0xfc, 0xd3, 0x55, 0x38, 0xe5, 0x6c, 0x38, 0xce, 0x69, 0x29, 0x29, 0x1c, 0x28,
+ 0xbe, 0x63, 0xe1, 0xc0, 0x0a, 0x0c, 0x54, 0xf9, 0x4b, 0x4e, 0xa6, 0x01, 0xe8, 0x2a, 0x18, 0x28,
+ 0x63, 0x25, 0xc4, 0x13, 0x70, 0x1d, 0x2b, 0x12, 0xe8, 0x87, 0x2d, 0x38, 0x95, 0xec, 0x3a, 0x26,
+ 0x0c, 0x2c, 0x0c, 0x26, 0xb9, 0x58, 0x6b, 0x49, 0x7c, 0x7f, 0x8a, 0xff, 0x37, 0x90, 0xf7, 0x3b,
+ 0x21, 0xe0, 0xf6, 0x8d, 0xa1, 0x85, 0x0c, 0xb9, 0x5a, 0x9f, 0xa9, 0x51, 0xec, 0x42, 0xb6, 0xf6,
+ 0x3c, 0x0c, 0x37, 0xfc, 0x96, 0x17, 0x09, 0xbb, 0x47, 0x61, 0x3c, 0xc5, 0x8c, 0x86, 0x56, 0xb4,
+ 0x72, 0x6c, 0x60, 0x25, 0x24, 0x72, 0x03, 0xf7, 0x2c, 0x91, 0x7b, 0x0b, 0x86, 0x3d, 0xcd, 0x25,
+ 0xa0, 0xdd, 0x0b, 0x56, 0x48, 0x17, 0x35, 0x6c, 0xde, 0x4b, 0xbd, 0x04, 0x1b, 0xd4, 0xda, 0x4b,
+ 0xcb, 0xe0, 0x9d, 0x49, 0xcb, 0x0e, 0xf5, 0x49, 0x6c, 0xff, 0x42, 0x21, 0xe3, 0xc5, 0xc0, 0xa5,
+ 0x72, 0xaf, 0x98, 0x52, 0xb9, 0xb3, 0x49, 0xa9, 0x5c, 0x4a, 0x55, 0x65, 0x08, 0xe4, 0xba, 0xcf,
+ 0x28, 0xd9, 0x75, 0x80, 0xe7, 0xef, 0xb5, 0xe0, 0x38, 0xd3, 0x7d, 0xd0, 0x06, 0xde, 0xb1, 0xbe,
+ 0x83, 0x99, 0xa4, 0x5e, 0xcd, 0x26, 0x87, 0xf3, 0xda, 0xb1, 0xeb, 0x70, 0xa6, 0xd3, 0xbd, 0xcb,
+ 0x2c, 0x7c, 0x6b, 0xca, 0x38, 0x22, 0xb6, 0xf0, 0xad, 0x2d, 0x2f, 0x60, 0x06, 0xe9, 0x36, 0x7c,
+ 0xa1, 0xfd, 0xdf, 0x2d, 0x28, 0x96, 0xfd, 0xda, 0x21, 0xbc, 0xe8, 0x3f, 0x62, 0xbc, 0xe8, 0x1f,
+ 0xca, 0xbe, 0xf1, 0x6b, 0xb9, 0xca, 0xbe, 0xc5, 0x84, 0xb2, 0xef, 0x54, 0x1e, 0x81, 0xf6, 0xaa,
+ 0xbd, 0x9f, 0x2e, 0xc2, 0x50, 0xd9, 0xaf, 0xa9, 0x7d, 0xf6, 0xaf, 0xee, 0xc5, 0x91, 0x27, 0x37,
+ 0xfb, 0x94, 0x46, 0x99, 0x59, 0xf4, 0xca, 0xb8, 0x13, 0xdf, 0x66, 0xfe, 0x3c, 0x37, 0x89, 0xbb,
+ 0xb1, 0x19, 0x91, 0x5a, 0xf2, 0x73, 0x0e, 0xcf, 0x9f, 0xe7, 0x9b, 0x45, 0x18, 0x4b, 0xb4, 0x8e,
+ 0xea, 0x30, 0x52, 0xd7, 0x55, 0x49, 0x62, 0x9d, 0xde, 0x93, 0x16, 0x4a, 0xf8, 0x43, 0x68, 0x45,
+ 0xd8, 0x24, 0x8e, 0x66, 0x00, 0x3c, 0xdd, 0x2a, 0x5c, 0x05, 0x2a, 0xd6, 0x2c, 0xc2, 0x35, 0x0c,
+ 0xf4, 0x02, 0x0c, 0x45, 0x7e, 0xd3, 0xaf, 0xfb, 0x1b, 0x3b, 0x57, 0x88, 0x8c, 0x6c, 0xa9, 0x8c,
+ 0x86, 0xd7, 0x62, 0x10, 0xd6, 0xf1, 0xd0, 0x1d, 0x98, 0x50, 0x44, 0x2a, 0xf7, 0x41, 0xbd, 0xc6,
+ 0xc4, 0x26, 0xab, 0x49, 0x8a, 0x38, 0xdd, 0x08, 0x7a, 0x09, 0x46, 0x99, 0xf5, 0x32, 0xab, 0x7f,
+ 0x85, 0xec, 0xc8, 0x88, 0xc7, 0x8c, 0xc3, 0x5e, 0x31, 0x20, 0x38, 0x81, 0x89, 0xe6, 0x61, 0xa2,
+ 0xe1, 0x86, 0x89, 0xea, 0x7d, 0xac, 0x3a, 0xeb, 0xc0, 0x4a, 0x12, 0x88, 0xd3, 0xf8, 0xf6, 0xcf,
+ 0x89, 0x39, 0xf6, 0x22, 0xf7, 0xfd, 0xed, 0xf8, 0xee, 0xde, 0x8e, 0xdf, 0xb0, 0x60, 0x9c, 0xb6,
+ 0xce, 0x4c, 0x32, 0x25, 0x23, 0xa5, 0x72, 0x62, 0x58, 0x6d, 0x72, 0x62, 0x9c, 0xa5, 0xc7, 0x76,
+ 0xcd, 0x6f, 0x45, 0x42, 0x3a, 0xaa, 0x9d, 0xcb, 0xb4, 0x14, 0x0b, 0xa8, 0xc0, 0x23, 0x41, 0x20,
+ 0xfc, 0xde, 0x75, 0x3c, 0x12, 0x04, 0x58, 0x40, 0x65, 0xca, 0x8c, 0x9e, 0xec, 0x94, 0x19, 0x3c,
+ 0xf2, 0xb9, 0xb0, 0x82, 0x13, 0x2c, 0xad, 0x16, 0xf9, 0x5c, 0x9a, 0xc7, 0xc5, 0x38, 0xf6, 0x57,
+ 0x8b, 0x30, 0x5c, 0xf6, 0x6b, 0xb1, 0x61, 0xc7, 0xf3, 0x86, 0x61, 0xc7, 0x99, 0x84, 0x61, 0xc7,
+ 0xb8, 0x8e, 0xfb, 0xbe, 0x19, 0xc7, 0xb7, 0xca, 0x8c, 0xe3, 0x37, 0x2d, 0x36, 0x6b, 0x0b, 0xab,
+ 0x15, 0x6e, 0xe1, 0x8b, 0x2e, 0xc0, 0x10, 0x3b, 0xe1, 0x58, 0xa0, 0x05, 0x69, 0xed, 0xc0, 0x52,
+ 0x58, 0xae, 0xc6, 0xc5, 0x58, 0xc7, 0x41, 0xe7, 0x60, 0x20, 0x24, 0x4e, 0x50, 0xdd, 0x54, 0xc7,
+ 0xbb, 0x30, 0x4d, 0xe0, 0x65, 0x58, 0x41, 0xd1, 0x1b, 0x71, 0xd0, 0xed, 0x62, 0xbe, 0xb9, 0xb0,
+ 0xde, 0x1f, 0xbe, 0x45, 0xf2, 0x23, 0x6d, 0xdb, 0x37, 0x01, 0xa5, 0xf1, 0xbb, 0xf0, 0xbf, 0x2a,
+ 0x99, 0x61, 0x61, 0x07, 0x53, 0x21, 0x61, 0xff, 0xda, 0x82, 0xd1, 0xb2, 0x5f, 0xa3, 0x5b, 0xf7,
+ 0xbd, 0xb4, 0x4f, 0xf5, 0x8c, 0x03, 0x7d, 0x6d, 0x32, 0x0e, 0x3c, 0x02, 0xbd, 0x65, 0xbf, 0xd6,
+ 0x21, 0x74, 0xed, 0x3f, 0xb0, 0xa0, 0xbf, 0xec, 0xd7, 0x0e, 0x41, 0xf1, 0xf2, 0x8a, 0xa9, 0x78,
+ 0x39, 0x9e, 0xb3, 0x6e, 0x72, 0x74, 0x2d, 0x7f, 0xaf, 0x07, 0x46, 0x68, 0x3f, 0xfd, 0x0d, 0x39,
+ 0x95, 0xc6, 0xb0, 0x59, 0x5d, 0x0c, 0x1b, 0x7d, 0x06, 0xf8, 0xf5, 0xba, 0x7f, 0x3b, 0x39, 0xad,
+ 0x4b, 0xac, 0x14, 0x0b, 0x28, 0x7a, 0x1a, 0x06, 0x9a, 0x01, 0xd9, 0x76, 0x7d, 0xc1, 0x5f, 0x6b,
+ 0x6a, 0xac, 0xb2, 0x28, 0xc7, 0x0a, 0x83, 0x3e, 0xbc, 0x43, 0xd7, 0xa3, 0xbc, 0x44, 0xd5, 0xf7,
+ 0x6a, 0x5c, 0x37, 0x51, 0x14, 0x69, 0xb1, 0xb4, 0x72, 0x6c, 0x60, 0xa1, 0x9b, 0x30, 0xc8, 0xfe,
+ 0xb3, 0x63, 0xa7, 0xf7, 0xc0, 0xc7, 0x8e, 0x48, 0x14, 0x2c, 0x08, 0xe0, 0x98, 0x16, 0x7a, 0x16,
+ 0x20, 0x92, 0xa9, 0x65, 0x42, 0x11, 0xc2, 0x54, 0xbd, 0x45, 0x54, 0xd2, 0x99, 0x10, 0x6b, 0x58,
+ 0xe8, 0x29, 0x18, 0x8c, 0x1c, 0xb7, 0x7e, 0xd5, 0xf5, 0x98, 0xfe, 0x9e, 0xf6, 0x5f, 0xe4, 0xeb,
+ 0x15, 0x85, 0x38, 0x86, 0x53, 0x5e, 0x90, 0xc5, 0x84, 0x9a, 0xdb, 0x89, 0x44, 0x6a, 0xba, 0x22,
+ 0xe7, 0x05, 0xaf, 0xaa, 0x52, 0xac, 0x61, 0xa0, 0x4d, 0x38, 0xe9, 0x7a, 0x2c, 0x85, 0x14, 0xa9,
+ 0x6c, 0xb9, 0xcd, 0xb5, 0xab, 0x95, 0x1b, 0x24, 0x70, 0xd7, 0x77, 0xe6, 0x9c, 0xea, 0x16, 0xf1,
+ 0x64, 0x42, 0xfc, 0x47, 0x45, 0x17, 0x4f, 0x2e, 0xb7, 0xc1, 0xc5, 0x6d, 0x29, 0xd9, 0xcf, 0xb1,
+ 0xf5, 0x7e, 0xad, 0x82, 0x9e, 0x34, 0x8e, 0x8e, 0x63, 0xfa, 0xd1, 0xb1, 0xbf, 0x5b, 0xea, 0xbb,
+ 0x56, 0xd1, 0x62, 0xff, 0x5c, 0x84, 0xa3, 0x65, 0xbf, 0x56, 0xf6, 0x83, 0x68, 0xc9, 0x0f, 0x6e,
+ 0x3b, 0x41, 0x4d, 0x2e, 0xaf, 0x92, 0x8c, 0x7e, 0x44, 0xcf, 0xcf, 0x5e, 0x7e, 0xba, 0x18, 0x91,
+ 0x8d, 0x9e, 0x63, 0x1c, 0xdb, 0x01, 0x9d, 0x4d, 0xab, 0x8c, 0x77, 0x50, 0x49, 0xd8, 0x2e, 0x39,
+ 0x11, 0x41, 0xd7, 0x60, 0xa4, 0xaa, 0x5f, 0xa3, 0xa2, 0xfa, 0x13, 0xf2, 0x22, 0x33, 0xee, 0xd8,
+ 0xcc, 0x7b, 0xd7, 0xac, 0x6f, 0x7f, 0xdd, 0x12, 0xad, 0x70, 0x49, 0x04, 0xb7, 0x69, 0xed, 0x7c,
+ 0x9e, 0xce, 0xc3, 0x44, 0xa0, 0x57, 0xd1, 0x6c, 0xc3, 0x8e, 0xf2, 0xac, 0x36, 0x09, 0x20, 0x4e,
+ 0xe3, 0xa3, 0x8f, 0xc3, 0x09, 0xa3, 0x50, 0xaa, 0xc9, 0xb5, 0xdc, 0xd2, 0x4c, 0x56, 0x83, 0xf3,
+ 0x90, 0x70, 0x7e, 0x7d, 0xfb, 0xbb, 0xe1, 0x58, 0xf2, 0xbb, 0x84, 0xf4, 0xe4, 0x1e, 0xbf, 0xae,
+ 0x70, 0xb0, 0xaf, 0xb3, 0x5f, 0x80, 0x09, 0xfa, 0xac, 0x56, 0x2c, 0x22, 0x9b, 0xbf, 0xce, 0x01,
+ 0xa6, 0xfe, 0x5d, 0x3f, 0xbb, 0xe2, 0x12, 0x99, 0xd5, 0xd0, 0x27, 0x61, 0x34, 0x24, 0x2c, 0xaa,
+ 0x9a, 0x94, 0xda, 0xb5, 0xf1, 0x14, 0xaf, 0x2c, 0xea, 0x98, 0xfc, 0x65, 0x62, 0x96, 0xe1, 0x04,
+ 0x35, 0xd4, 0x80, 0xd1, 0xdb, 0xae, 0x57, 0xf3, 0x6f, 0x87, 0x92, 0xfe, 0x40, 0xbe, 0x0a, 0xe0,
+ 0x26, 0xc7, 0x4c, 0xf4, 0xd1, 0x68, 0xee, 0xa6, 0x41, 0x0c, 0x27, 0x88, 0xd3, 0x63, 0x24, 0x68,
+ 0x79, 0xb3, 0xe1, 0xf5, 0x90, 0x04, 0x22, 0xe6, 0x1b, 0x3b, 0x46, 0xb0, 0x2c, 0xc4, 0x31, 0x9c,
+ 0x1e, 0x23, 0xec, 0x0f, 0x73, 0x35, 0x67, 0xe7, 0x94, 0x38, 0x46, 0xb0, 0x2a, 0xc5, 0x1a, 0x06,
+ 0x3d, 0x66, 0xd9, 0xbf, 0x55, 0xdf, 0xc3, 0xbe, 0x1f, 0xc9, 0x83, 0x99, 0xa5, 0xa1, 0xd4, 0xca,
+ 0xb1, 0x81, 0x95, 0x13, 0x61, 0xae, 0xe7, 0xa0, 0x11, 0xe6, 0x50, 0xd4, 0xc6, 0xbb, 0x9e, 0x47,
+ 0x3a, 0xbe, 0xd8, 0xce, 0xbb, 0x7e, 0xff, 0x9e, 0x3c, 0xef, 0xe9, 0x3d, 0xbf, 0x2e, 0x06, 0xa8,
+ 0x97, 0x87, 0xd0, 0x63, 0x4a, 0xca, 0x0a, 0x1f, 0x1d, 0x09, 0x43, 0x8b, 0xd0, 0x1f, 0xee, 0x84,
+ 0xd5, 0xa8, 0x1e, 0xb6, 0x4b, 0x35, 0x5a, 0x61, 0x28, 0x5a, 0xa6, 0x6b, 0x5e, 0x05, 0xcb, 0xba,
+ 0xa8, 0x0a, 0x93, 0x82, 0xe2, 0xfc, 0xa6, 0xe3, 0xa9, 0x04, 0x88, 0xdc, 0x1a, 0xf1, 0xc2, 0xde,
+ 0x6e, 0x69, 0x52, 0xb4, 0xac, 0x83, 0xf7, 0x77, 0x4b, 0x74, 0x4b, 0x66, 0x40, 0x70, 0x16, 0x35,
+ 0xbe, 0xe4, 0xab, 0x55, 0xbf, 0xd1, 0x2c, 0x07, 0xfe, 0xba, 0x5b, 0x27, 0xed, 0x14, 0xbd, 0x15,
+ 0x03, 0x53, 0x2c, 0x79, 0xa3, 0x0c, 0x27, 0xa8, 0xa1, 0x5b, 0x30, 0xe6, 0x34, 0x9b, 0xb3, 0x41,
+ 0xc3, 0x0f, 0x64, 0x03, 0x43, 0xf9, 0x1a, 0x83, 0x59, 0x13, 0x95, 0xe7, 0x3f, 0x4c, 0x14, 0xe2,
+ 0x24, 0x41, 0xfb, 0xbb, 0x18, 0xbf, 0x5d, 0x71, 0x37, 0x3c, 0xe6, 0x93, 0x86, 0x1a, 0x30, 0xd2,
+ 0x64, 0x27, 0xb2, 0x48, 0x1b, 0x26, 0x76, 0xf1, 0xf3, 0x5d, 0xca, 0x0c, 0x6f, 0xb3, 0xc4, 0xa7,
+ 0x86, 0xed, 0x68, 0x59, 0x27, 0x87, 0x4d, 0xea, 0xf6, 0xbf, 0x3f, 0xc1, 0x38, 0xb6, 0x0a, 0x17,
+ 0x04, 0xf6, 0x0b, 0x0f, 0x41, 0xf1, 0xf4, 0x9f, 0xce, 0x17, 0xb9, 0xc7, 0x53, 0x2f, 0xbc, 0x0c,
+ 0xb1, 0xac, 0x8b, 0x3e, 0x01, 0xa3, 0xf4, 0x25, 0xad, 0xb8, 0xa6, 0x70, 0xea, 0x48, 0x7e, 0xe8,
+ 0x29, 0x85, 0xa5, 0xa7, 0x14, 0xd4, 0x2b, 0xe3, 0x04, 0x31, 0xf4, 0x06, 0x33, 0xa7, 0x94, 0xa4,
+ 0x0b, 0xdd, 0x90, 0xd6, 0x2d, 0x27, 0x25, 0x59, 0x8d, 0x08, 0x6a, 0xc1, 0x64, 0x3a, 0x71, 0x72,
+ 0x38, 0x65, 0xe7, 0x3f, 0x49, 0xd2, 0xb9, 0x8f, 0xe3, 0xdc, 0x6f, 0x69, 0x58, 0x88, 0xb3, 0xe8,
+ 0xa3, 0xab, 0xc9, 0xb4, 0xb6, 0x45, 0x43, 0x58, 0x9f, 0x4a, 0x6d, 0x3b, 0xd2, 0x36, 0xa3, 0xed,
+ 0x06, 0x9c, 0xd2, 0x32, 0x83, 0x5e, 0x0a, 0x1c, 0x66, 0xce, 0xe3, 0xb2, 0x8b, 0x42, 0xe3, 0x25,
+ 0x1f, 0xde, 0xdb, 0x2d, 0x9d, 0x5a, 0x6b, 0x87, 0x88, 0xdb, 0xd3, 0x41, 0xd7, 0xe0, 0x28, 0x0f,
+ 0x9c, 0xb2, 0x40, 0x9c, 0x5a, 0xdd, 0xf5, 0x14, 0xb3, 0xca, 0x8f, 0x95, 0x13, 0x7b, 0xbb, 0xa5,
+ 0xa3, 0xb3, 0x59, 0x08, 0x38, 0xbb, 0x1e, 0x7a, 0x05, 0x06, 0x6b, 0x9e, 0x3c, 0x00, 0xfb, 0x8c,
+ 0xe4, 0xab, 0x83, 0x0b, 0xab, 0x15, 0xf5, 0xfd, 0xf1, 0x1f, 0x1c, 0x57, 0x40, 0x1b, 0x5c, 0x5b,
+ 0xa4, 0x44, 0x7c, 0xfd, 0xa9, 0x78, 0x9a, 0x49, 0x29, 0xb8, 0x11, 0x89, 0x80, 0xab, 0x49, 0x95,
+ 0xa7, 0x9b, 0x11, 0xa4, 0xc0, 0x20, 0x8c, 0x5e, 0x07, 0x24, 0x92, 0xfc, 0xcc, 0x56, 0x59, 0x4e,
+ 0x3a, 0xcd, 0x84, 0x53, 0xbd, 0xdc, 0x2b, 0x29, 0x0c, 0x9c, 0x51, 0x0b, 0x5d, 0xa6, 0x27, 0x97,
+ 0x5e, 0x2a, 0x4e, 0x46, 0x95, 0xe2, 0x7b, 0x81, 0x34, 0x03, 0xc2, 0xac, 0x0e, 0x4d, 0x8a, 0x38,
+ 0x51, 0x0f, 0xd5, 0xe0, 0xa4, 0xd3, 0x8a, 0x7c, 0xa6, 0x88, 0x33, 0x51, 0xd7, 0xfc, 0x2d, 0xe2,
+ 0x31, 0x1d, 0xf8, 0x00, 0x8b, 0xd3, 0x79, 0x72, 0xb6, 0x0d, 0x1e, 0x6e, 0x4b, 0x85, 0xbe, 0x62,
+ 0xe8, 0x58, 0x68, 0x3a, 0x32, 0xc3, 0xa9, 0x9a, 0x2b, 0x8e, 0x25, 0x06, 0x7a, 0x01, 0x86, 0x36,
+ 0xfd, 0x30, 0x5a, 0x25, 0xd1, 0x6d, 0x3f, 0xd8, 0x12, 0x59, 0x05, 0xe2, 0x4c, 0x2e, 0x31, 0x08,
+ 0xeb, 0x78, 0xe8, 0x09, 0xe8, 0x67, 0x16, 0x5a, 0xcb, 0x0b, 0xec, 0x1a, 0x1c, 0x88, 0xcf, 0x98,
+ 0xcb, 0xbc, 0x18, 0x4b, 0xb8, 0x44, 0x5d, 0x2e, 0xcf, 0x33, 0x43, 0x97, 0x04, 0xea, 0x72, 0x79,
+ 0x1e, 0x4b, 0x38, 0x5d, 0xae, 0xe1, 0xa6, 0x13, 0x90, 0x72, 0xe0, 0x57, 0x49, 0xa8, 0xe5, 0x0f,
+ 0x7a, 0x88, 0xe7, 0x4c, 0xa0, 0xcb, 0xb5, 0x92, 0x85, 0x80, 0xb3, 0xeb, 0x21, 0x92, 0xce, 0x8a,
+ 0x3b, 0x9a, 0xaf, 0xa1, 0x4c, 0x73, 0x6a, 0x5d, 0x26, 0xc6, 0xf5, 0x60, 0x5c, 0xe5, 0xe3, 0xe5,
+ 0x59, 0x12, 0xc2, 0xa9, 0x31, 0xb6, 0xb6, 0xbb, 0x4f, 0xb1, 0xa0, 0x74, 0xbe, 0xcb, 0x09, 0x4a,
+ 0x38, 0x45, 0xdb, 0x08, 0x04, 0x3b, 0xde, 0x31, 0x10, 0xec, 0x79, 0x18, 0x0c, 0x5b, 0xb7, 0x6a,
+ 0x7e, 0xc3, 0x71, 0x3d, 0x66, 0xe8, 0xa2, 0xbd, 0x97, 0x2b, 0x12, 0x80, 0x63, 0x1c, 0xb4, 0x04,
+ 0x03, 0x8e, 0x54, 0xe8, 0xa2, 0xfc, 0x18, 0x77, 0x4a, 0x8d, 0xcb, 0xc3, 0x3e, 0x49, 0x15, 0xae,
+ 0xaa, 0x8b, 0x5e, 0x86, 0x11, 0x11, 0x47, 0x43, 0xa4, 0xb0, 0x9f, 0x34, 0xbd, 0x86, 0x2b, 0x3a,
+ 0x10, 0x9b, 0xb8, 0xe8, 0x3a, 0x0c, 0x45, 0x7e, 0x9d, 0xb9, 0xbe, 0x52, 0x06, 0xf6, 0x58, 0x7e,
+ 0x28, 0xda, 0x35, 0x85, 0xa6, 0xab, 0x1a, 0x54, 0x55, 0xac, 0xd3, 0x41, 0x6b, 0x7c, 0xbd, 0xb3,
+ 0x6c, 0x41, 0x24, 0x14, 0x39, 0xd0, 0x4f, 0xe5, 0x59, 0x29, 0x32, 0x34, 0x73, 0x3b, 0x88, 0x9a,
+ 0x58, 0x27, 0x83, 0x2e, 0xc1, 0x44, 0x33, 0x70, 0x7d, 0xb6, 0x26, 0x94, 0x82, 0x7a, 0xca, 0xcc,
+ 0x0d, 0x5a, 0x4e, 0x22, 0xe0, 0x74, 0x1d, 0x16, 0x06, 0x45, 0x14, 0x4e, 0x9d, 0xe0, 0xf9, 0xcd,
+ 0xb8, 0xf8, 0x81, 0x97, 0x61, 0x05, 0x45, 0x2b, 0xec, 0x24, 0xe6, 0x92, 0xb3, 0xa9, 0xe9, 0x7c,
+ 0xe7, 0x7a, 0x5d, 0xc2, 0xc6, 0xd9, 0x72, 0xf5, 0x17, 0xc7, 0x14, 0x50, 0x4d, 0x4b, 0x2b, 0x4e,
+ 0x1f, 0x37, 0xe1, 0xd4, 0xc9, 0x36, 0x66, 0xb2, 0x89, 0x97, 0x6c, 0xcc, 0x10, 0x18, 0xc5, 0x21,
+ 0x4e, 0xd0, 0x44, 0xaf, 0xc1, 0xb8, 0x88, 0x11, 0x10, 0x0f, 0xd3, 0xa9, 0xd8, 0x95, 0x08, 0x27,
+ 0x60, 0x38, 0x85, 0xcd, 0xf3, 0x8b, 0x39, 0xb7, 0xea, 0x44, 0x1c, 0x7d, 0x57, 0x5d, 0x6f, 0x2b,
+ 0x9c, 0x3a, 0xcd, 0xce, 0x07, 0x91, 0x5f, 0x2c, 0x09, 0xc5, 0x19, 0x35, 0xd0, 0x1a, 0x8c, 0x37,
+ 0x03, 0x42, 0x1a, 0xec, 0x09, 0x23, 0xee, 0xb3, 0x12, 0x8f, 0x02, 0x44, 0x7b, 0x52, 0x4e, 0xc0,
+ 0xf6, 0x33, 0xca, 0x70, 0x8a, 0x02, 0xba, 0x0d, 0x03, 0xfe, 0x36, 0x09, 0x36, 0x89, 0x53, 0x9b,
+ 0x3a, 0xd3, 0xc6, 0xc1, 0x4d, 0x5c, 0x6e, 0xd7, 0x04, 0x6e, 0xc2, 0xfe, 0x47, 0x16, 0x77, 0xb6,
+ 0xff, 0x91, 0x8d, 0xa1, 0xbf, 0x65, 0xc1, 0x09, 0xa9, 0x51, 0xab, 0x34, 0xe9, 0xa8, 0xcf, 0xfb,
+ 0x5e, 0x18, 0x05, 0x3c, 0x6e, 0xcd, 0xc3, 0xf9, 0xb1, 0x5c, 0xd6, 0x72, 0x2a, 0x29, 0xe1, 0xfd,
+ 0x89, 0x3c, 0x8c, 0x10, 0xe7, 0xb7, 0x48, 0x1f, 0xdd, 0x21, 0x89, 0xe4, 0x61, 0x34, 0x1b, 0x2e,
+ 0xbd, 0xb1, 0xb0, 0x3a, 0xf5, 0x08, 0x0f, 0xba, 0x43, 0x37, 0x43, 0x25, 0x09, 0xc4, 0x69, 0x7c,
+ 0x74, 0x01, 0x0a, 0x7e, 0x38, 0xf5, 0x68, 0x9b, 0x4c, 0xf4, 0x7e, 0xed, 0x5a, 0x85, 0xdb, 0x81,
+ 0x5e, 0xab, 0xe0, 0x82, 0x1f, 0xca, 0x1c, 0x5f, 0xf4, 0xa5, 0x19, 0x4e, 0x3d, 0xc6, 0x45, 0xbd,
+ 0x32, 0xc7, 0x17, 0x2b, 0xc4, 0x31, 0x1c, 0x6d, 0xc2, 0x58, 0x68, 0xbc, 0xe8, 0xc3, 0xa9, 0xb3,
+ 0x6c, 0xa4, 0x1e, 0xcb, 0x9b, 0x34, 0x03, 0x5b, 0x4b, 0xbe, 0x63, 0x52, 0xc1, 0x49, 0xb2, 0x7c,
+ 0x77, 0x69, 0x32, 0x85, 0x70, 0xea, 0xf1, 0x0e, 0xbb, 0x4b, 0x43, 0xd6, 0x77, 0x97, 0x4e, 0x03,
+ 0x27, 0x68, 0x4e, 0x7f, 0x07, 0x4c, 0xa4, 0xd8, 0xa5, 0x83, 0xf8, 0x3c, 0x4c, 0x6f, 0xc1, 0x88,
+ 0xb1, 0x24, 0x1f, 0xa8, 0x49, 0xcc, 0xef, 0x0e, 0xc2, 0xa0, 0x32, 0x55, 0x40, 0xe7, 0x4d, 0x2b,
+ 0x98, 0x13, 0x49, 0x2b, 0x98, 0x81, 0xb2, 0x5f, 0x33, 0x0c, 0x5f, 0xd6, 0x32, 0x62, 0xc9, 0xe6,
+ 0x1d, 0x80, 0xdd, 0x3b, 0x66, 0x69, 0xea, 0x97, 0x62, 0xd7, 0xe6, 0x34, 0x3d, 0x6d, 0x35, 0x3a,
+ 0x97, 0x60, 0xc2, 0xf3, 0x19, 0x8f, 0x4e, 0x6a, 0x92, 0x01, 0x63, 0x7c, 0xd6, 0xa0, 0x1e, 0xeb,
+ 0x2c, 0x81, 0x80, 0xd3, 0x75, 0x68, 0x83, 0x9c, 0x51, 0x4a, 0xaa, 0x90, 0x38, 0x1f, 0x85, 0x05,
+ 0x94, 0xbe, 0x0d, 0xf9, 0xaf, 0x70, 0x6a, 0x3c, 0xff, 0x6d, 0xc8, 0x2b, 0x25, 0x99, 0xb1, 0x50,
+ 0x32, 0x63, 0x4c, 0x63, 0xd2, 0xf4, 0x6b, 0xcb, 0x65, 0xc1, 0xe6, 0x6b, 0x51, 0xde, 0x6b, 0xcb,
+ 0x65, 0xcc, 0x61, 0x68, 0x16, 0xfa, 0xd8, 0x0f, 0x19, 0x43, 0x26, 0x6f, 0x9b, 0x2e, 0x97, 0xb5,
+ 0x1c, 0xa3, 0xac, 0x02, 0x16, 0x15, 0x99, 0x44, 0x9c, 0xbe, 0x8d, 0x98, 0x44, 0xbc, 0xff, 0x1e,
+ 0x25, 0xe2, 0x92, 0x00, 0x8e, 0x69, 0xa1, 0x3b, 0x70, 0xd4, 0x78, 0x8f, 0x2a, 0x4f, 0x35, 0xc8,
+ 0x57, 0x96, 0x27, 0x90, 0xe7, 0x4e, 0x89, 0x4e, 0x1f, 0x5d, 0xce, 0xa2, 0x84, 0xb3, 0x1b, 0x40,
+ 0x75, 0x98, 0xa8, 0xa6, 0x5a, 0x1d, 0xe8, 0xbe, 0x55, 0xb5, 0x2e, 0xd2, 0x2d, 0xa6, 0x09, 0xa3,
+ 0x97, 0x61, 0xe0, 0x6d, 0x9f, 0x1b, 0xb6, 0x89, 0xa7, 0x89, 0x8c, 0x92, 0x32, 0xf0, 0xc6, 0xb5,
+ 0x0a, 0x2b, 0xdf, 0xdf, 0x2d, 0x0d, 0x95, 0xfd, 0x9a, 0xfc, 0x8b, 0x55, 0x05, 0xf4, 0x03, 0x16,
+ 0x4c, 0xa7, 0x1f, 0xbc, 0xaa, 0xd3, 0x23, 0xdd, 0x77, 0xda, 0x16, 0x8d, 0x4e, 0x2f, 0xe6, 0x92,
+ 0xc3, 0x6d, 0x9a, 0x42, 0x1f, 0xa6, 0xfb, 0x29, 0x74, 0xef, 0x12, 0x91, 0xa0, 0xfd, 0xe1, 0x78,
+ 0x3f, 0xd1, 0xd2, 0xfd, 0xdd, 0xd2, 0x18, 0x3f, 0x19, 0xdd, 0xbb, 0x2a, 0x1e, 0x3d, 0xaf, 0x80,
+ 0xbe, 0x1b, 0x8e, 0x06, 0x69, 0xd9, 0x30, 0x91, 0x4c, 0xf8, 0x93, 0xdd, 0x9c, 0xb2, 0xc9, 0x09,
+ 0xc7, 0x59, 0x04, 0x71, 0x76, 0x3b, 0xf6, 0xaf, 0x59, 0x4c, 0x27, 0x20, 0xba, 0x45, 0xc2, 0x56,
+ 0x3d, 0x3a, 0x04, 0x63, 0xb2, 0x45, 0x43, 0xdf, 0x7e, 0xcf, 0xd6, 0x60, 0xff, 0xd2, 0x62, 0xd6,
+ 0x60, 0x87, 0xe8, 0xd7, 0xf6, 0x06, 0x0c, 0x44, 0xa2, 0x35, 0xd1, 0xf5, 0x3c, 0xcb, 0x15, 0xd9,
+ 0x29, 0x66, 0x11, 0xa7, 0x1e, 0x39, 0xb2, 0x14, 0x2b, 0x32, 0xf6, 0x3f, 0xe3, 0x33, 0x20, 0x21,
+ 0x87, 0xa0, 0xd6, 0x5c, 0x30, 0xd5, 0x9a, 0xa5, 0x0e, 0x5f, 0x90, 0xa3, 0xde, 0xfc, 0xa7, 0x66,
+ 0xbf, 0x99, 0x70, 0xef, 0xdd, 0x6e, 0x86, 0x68, 0x7f, 0xde, 0x02, 0x88, 0x13, 0x80, 0x74, 0x91,
+ 0x90, 0xf9, 0x22, 0x7d, 0xd6, 0xf8, 0x91, 0x5f, 0xf5, 0xeb, 0x42, 0xf5, 0x72, 0x32, 0xd6, 0xac,
+ 0xf2, 0xf2, 0x7d, 0xed, 0x37, 0x56, 0xd8, 0xa8, 0x24, 0x23, 0xf2, 0x16, 0x63, 0x5d, 0xbf, 0x11,
+ 0x8d, 0xf7, 0x4b, 0x16, 0x1c, 0xc9, 0x72, 0x92, 0xa0, 0x8f, 0x64, 0x2e, 0xe6, 0x54, 0x26, 0xa2,
+ 0x6a, 0x36, 0x6f, 0x88, 0x72, 0xac, 0x30, 0xba, 0xce, 0x74, 0x7d, 0xb0, 0xe4, 0x14, 0xd7, 0x60,
+ 0xa4, 0x1c, 0x10, 0x8d, 0xbf, 0x78, 0x35, 0xce, 0x9b, 0x33, 0x38, 0xf7, 0xf4, 0x81, 0x23, 0x0f,
+ 0xd9, 0x5f, 0x2e, 0xc0, 0x11, 0x6e, 0xe8, 0x34, 0xbb, 0xed, 0xbb, 0xb5, 0xb2, 0x5f, 0x13, 0xae,
+ 0xad, 0x6f, 0xc2, 0x70, 0x53, 0x93, 0x4d, 0xb7, 0x0b, 0xb4, 0xae, 0xcb, 0xb0, 0x63, 0x69, 0x9a,
+ 0x5e, 0x8a, 0x0d, 0x5a, 0xa8, 0x06, 0xc3, 0x64, 0xdb, 0xad, 0x2a, 0x6b, 0x99, 0xc2, 0x81, 0x2f,
+ 0x69, 0xd5, 0xca, 0xa2, 0x46, 0x07, 0x1b, 0x54, 0xbb, 0x36, 0x4f, 0xd6, 0x58, 0xb4, 0x9e, 0x0e,
+ 0x16, 0x32, 0x3f, 0x6e, 0xc1, 0xf1, 0x9c, 0xb0, 0xec, 0xb4, 0xb9, 0xdb, 0xcc, 0xa4, 0x4c, 0x2c,
+ 0x5b, 0xd5, 0x1c, 0x37, 0x34, 0xc3, 0x02, 0x8a, 0x3e, 0x0a, 0xd0, 0x8c, 0x53, 0x52, 0x76, 0x88,
+ 0x5f, 0x6d, 0x44, 0xb2, 0xd5, 0x82, 0x92, 0xaa, 0xcc, 0x95, 0x1a, 0x2d, 0xfb, 0x4b, 0x3d, 0xd0,
+ 0xcb, 0x0c, 0x93, 0x50, 0x19, 0xfa, 0x37, 0x79, 0xcc, 0xbc, 0xb6, 0xf3, 0x46, 0x71, 0x65, 0x10,
+ 0xbe, 0x78, 0xde, 0xb4, 0x52, 0x2c, 0xc9, 0xa0, 0x15, 0x98, 0xe4, 0xe9, 0x36, 0xeb, 0x0b, 0xa4,
+ 0xee, 0xec, 0x48, 0xb1, 0x6f, 0x81, 0x7d, 0xaa, 0x12, 0x7f, 0x2f, 0xa7, 0x51, 0x70, 0x56, 0x3d,
+ 0xf4, 0x2a, 0x8c, 0xd2, 0x67, 0xb8, 0xdf, 0x8a, 0x24, 0x25, 0x9e, 0xdf, 0x52, 0xbd, 0x4c, 0xd6,
+ 0x0c, 0x28, 0x4e, 0x60, 0xa3, 0x97, 0x61, 0xa4, 0x99, 0x12, 0x70, 0xf7, 0xc6, 0x92, 0x20, 0x53,
+ 0xa8, 0x6d, 0xe2, 0x32, 0x3f, 0x89, 0x16, 0xf3, 0x0a, 0x59, 0xdb, 0x0c, 0x48, 0xb8, 0xe9, 0xd7,
+ 0x6b, 0x8c, 0x03, 0xee, 0xd5, 0xfc, 0x24, 0x12, 0x70, 0x9c, 0xaa, 0x41, 0xa9, 0xac, 0x3b, 0x6e,
+ 0xbd, 0x15, 0x90, 0x98, 0x4a, 0x9f, 0x49, 0x65, 0x29, 0x01, 0xc7, 0xa9, 0x1a, 0x9d, 0x25, 0xf7,
+ 0xfd, 0xf7, 0x47, 0x72, 0x6f, 0xff, 0x4c, 0x01, 0x8c, 0xa9, 0x7d, 0x0f, 0xe7, 0xdd, 0x7c, 0x05,
+ 0x7a, 0x36, 0x82, 0x66, 0x55, 0x18, 0xe1, 0x65, 0x7e, 0x59, 0x9c, 0xfd, 0x9f, 0x7f, 0x19, 0xfd,
+ 0x8f, 0x59, 0x2d, 0xba, 0xc7, 0x8f, 0x96, 0x03, 0x9f, 0x5e, 0x72, 0x32, 0xac, 0xa6, 0x72, 0x47,
+ 0xea, 0x97, 0x81, 0x35, 0xda, 0x04, 0xa0, 0x16, 0x3e, 0x15, 0x9c, 0x82, 0x61, 0xaf, 0x56, 0x11,
+ 0xe1, 0x73, 0x24, 0x15, 0x74, 0x01, 0x86, 0x44, 0x2a, 0x44, 0xe6, 0x35, 0xc3, 0x37, 0x13, 0xb3,
+ 0xaf, 0x5b, 0x88, 0x8b, 0xb1, 0x8e, 0x63, 0xff, 0x60, 0x01, 0x26, 0x33, 0xdc, 0x1e, 0xf9, 0x35,
+ 0xb2, 0xe1, 0x86, 0x51, 0xb0, 0x93, 0xbc, 0x9c, 0xb0, 0x28, 0xc7, 0x0a, 0x83, 0x9e, 0x55, 0xfc,
+ 0xa2, 0x4a, 0x5e, 0x4e, 0xc2, 0xad, 0x48, 0x40, 0x0f, 0x98, 0xaa, 0xff, 0x0c, 0xf4, 0xb4, 0x42,
+ 0x22, 0x63, 0xdd, 0xab, 0x6b, 0x9b, 0x29, 0xec, 0x19, 0x84, 0x3e, 0x01, 0x37, 0x94, 0x16, 0x5a,
+ 0x7b, 0x02, 0x72, 0x3d, 0x34, 0x87, 0xd1, 0xce, 0x45, 0xc4, 0x73, 0xbc, 0x48, 0x3c, 0x14, 0xe3,
+ 0x18, 0xc8, 0xac, 0x14, 0x0b, 0xa8, 0xfd, 0xc5, 0x22, 0x9c, 0xc8, 0x75, 0x84, 0xa6, 0x5d, 0x6f,
+ 0xf8, 0x9e, 0x1b, 0xf9, 0xca, 0x70, 0x91, 0xc7, 0x3d, 0x26, 0xcd, 0xcd, 0x15, 0x51, 0x8e, 0x15,
+ 0x06, 0x3a, 0x0b, 0xbd, 0x4c, 0x28, 0x9e, 0x4c, 0x83, 0x86, 0xe7, 0x16, 0x78, 0x44, 0x49, 0x0e,
+ 0xd6, 0x6e, 0xf5, 0x62, 0xdb, 0x5b, 0xfd, 0x11, 0xca, 0xc1, 0xf8, 0xf5, 0xe4, 0x85, 0x42, 0xbb,
+ 0xeb, 0xfb, 0x75, 0xcc, 0x80, 0xe8, 0x31, 0x31, 0x5e, 0x09, 0x4b, 0x3d, 0xec, 0xd4, 0xfc, 0x50,
+ 0x1b, 0xb4, 0x27, 0xa0, 0x7f, 0x8b, 0xec, 0x04, 0xae, 0xb7, 0x91, 0xb4, 0xe0, 0xbc, 0xc2, 0x8b,
+ 0xb1, 0x84, 0x9b, 0x59, 0xbf, 0xfb, 0xef, 0x47, 0xd6, 0x6f, 0x7d, 0x05, 0x0c, 0x74, 0x64, 0x4f,
+ 0x7e, 0xa8, 0x08, 0x63, 0x78, 0x6e, 0xe1, 0xfd, 0x89, 0xb8, 0x9e, 0x9e, 0x88, 0xfb, 0x91, 0x1c,
+ 0xfb, 0x60, 0xb3, 0xf1, 0xcb, 0x16, 0x8c, 0xb1, 0x84, 0x8c, 0x22, 0x8a, 0x89, 0xeb, 0x7b, 0x87,
+ 0xf0, 0x14, 0x78, 0x04, 0x7a, 0x03, 0xda, 0xa8, 0x98, 0x41, 0xb5, 0xc7, 0x59, 0x4f, 0x30, 0x87,
+ 0xa1, 0x93, 0xd0, 0xc3, 0xba, 0x40, 0x27, 0x6f, 0x98, 0x1f, 0xc1, 0x0b, 0x4e, 0xe4, 0x60, 0x56,
+ 0xca, 0xe2, 0x29, 0x62, 0xd2, 0xac, 0xbb, 0xbc, 0xd3, 0xb1, 0xc9, 0xc2, 0xbb, 0x23, 0x44, 0x4a,
+ 0x66, 0xd7, 0xde, 0x59, 0x3c, 0xc5, 0x6c, 0x92, 0xed, 0x9f, 0xd9, 0x7f, 0x5e, 0x80, 0xd3, 0x99,
+ 0xf5, 0xba, 0x8e, 0xa7, 0xd8, 0xbe, 0xf6, 0x83, 0x4c, 0xdf, 0x56, 0x3c, 0x44, 0xfb, 0xf8, 0x9e,
+ 0x6e, 0xb9, 0xff, 0xde, 0x2e, 0xc2, 0x1c, 0x66, 0x0e, 0xd9, 0xbb, 0x24, 0xcc, 0x61, 0x66, 0xdf,
+ 0x72, 0xc4, 0x04, 0x7f, 0x53, 0xc8, 0xf9, 0x16, 0x26, 0x30, 0x38, 0x47, 0xcf, 0x19, 0x06, 0x0c,
+ 0xe5, 0x23, 0x9c, 0x9f, 0x31, 0xbc, 0x0c, 0x2b, 0x28, 0x9a, 0x85, 0xb1, 0x86, 0xeb, 0xd1, 0xc3,
+ 0x67, 0xc7, 0x64, 0xc5, 0x95, 0x2e, 0x63, 0xc5, 0x04, 0xe3, 0x24, 0x3e, 0x72, 0xb5, 0x10, 0x88,
+ 0xfc, 0xeb, 0x5e, 0x3e, 0xd0, 0xae, 0x9b, 0x31, 0xcd, 0x39, 0xd4, 0x28, 0x66, 0x84, 0x43, 0x5c,
+ 0xd1, 0xe4, 0x44, 0xc5, 0xee, 0xe5, 0x44, 0xc3, 0xd9, 0x32, 0xa2, 0xe9, 0x97, 0x61, 0xe4, 0x9e,
+ 0x75, 0x23, 0xf6, 0x37, 0x8a, 0xf0, 0x50, 0x9b, 0x6d, 0xcf, 0xcf, 0x7a, 0x63, 0x0e, 0xb4, 0xb3,
+ 0x3e, 0x35, 0x0f, 0x65, 0x38, 0xb2, 0xde, 0xaa, 0xd7, 0x77, 0x98, 0x23, 0x18, 0xa9, 0x49, 0x0c,
+ 0xc1, 0x53, 0x4a, 0xe1, 0xc8, 0x91, 0xa5, 0x0c, 0x1c, 0x9c, 0x59, 0x93, 0x3e, 0xb1, 0xe8, 0x4d,
+ 0xb2, 0xa3, 0x48, 0x25, 0x9e, 0x58, 0x58, 0x07, 0x62, 0x13, 0x17, 0x5d, 0x82, 0x09, 0x67, 0xdb,
+ 0x71, 0x79, 0xfa, 0x0b, 0x49, 0x80, 0xbf, 0xb1, 0x94, 0x2c, 0x7a, 0x36, 0x89, 0x80, 0xd3, 0x75,
+ 0xd0, 0xeb, 0x80, 0xfc, 0x5b, 0xcc, 0xb9, 0xa4, 0x76, 0x89, 0x78, 0x42, 0xeb, 0xce, 0xe6, 0xae,
+ 0x18, 0x1f, 0x09, 0xd7, 0x52, 0x18, 0x38, 0xa3, 0x56, 0x22, 0x18, 0x5f, 0x5f, 0x7e, 0x30, 0xbe,
+ 0xf6, 0xe7, 0x62, 0xc7, 0xcc, 0x81, 0x6f, 0xc1, 0xc8, 0x41, 0x2d, 0xa6, 0x9f, 0x80, 0xfe, 0x40,
+ 0xe4, 0x64, 0x4f, 0x78, 0x5d, 0xcb, 0x8c, 0xd5, 0x12, 0x6e, 0xff, 0x17, 0x0b, 0x94, 0x2c, 0xd9,
+ 0x8c, 0xbb, 0xfd, 0x32, 0x33, 0xff, 0xe6, 0x52, 0x70, 0x2d, 0xd4, 0xd6, 0x51, 0xcd, 0xfc, 0x3b,
+ 0x06, 0x62, 0x13, 0x97, 0x2f, 0xb7, 0x30, 0x8e, 0xf0, 0x60, 0x3c, 0x20, 0x44, 0x58, 0x50, 0x85,
+ 0x81, 0x3e, 0x06, 0xfd, 0x35, 0x77, 0xdb, 0x0d, 0x85, 0x1c, 0xed, 0xc0, 0x7a, 0xbb, 0xf8, 0xfb,
+ 0x16, 0x38, 0x19, 0x2c, 0xe9, 0xd9, 0x3f, 0x62, 0x81, 0xd2, 0x4b, 0x5e, 0x26, 0x4e, 0x3d, 0xda,
+ 0x44, 0xaf, 0x01, 0x48, 0x0a, 0x4a, 0xf6, 0x26, 0xad, 0xa5, 0x00, 0x2b, 0xc8, 0xbe, 0xf1, 0x0f,
+ 0x6b, 0x75, 0xd0, 0xab, 0xd0, 0xb7, 0xc9, 0x68, 0x89, 0x6f, 0x3b, 0xab, 0x54, 0x5d, 0xac, 0x74,
+ 0x7f, 0xb7, 0x74, 0xc4, 0x6c, 0x53, 0xde, 0x62, 0xbc, 0x96, 0xfd, 0x43, 0x85, 0x78, 0x4e, 0xdf,
+ 0x68, 0xf9, 0x91, 0x73, 0x08, 0x9c, 0xc8, 0x25, 0x83, 0x13, 0x79, 0x2c, 0x7b, 0xa1, 0x6a, 0x5d,
+ 0xca, 0xe5, 0x40, 0xae, 0x25, 0x38, 0x90, 0xc7, 0x3b, 0x93, 0x6a, 0xcf, 0x79, 0xfc, 0x73, 0x0b,
+ 0x26, 0x0c, 0xfc, 0x43, 0xb8, 0x00, 0x97, 0xcc, 0x0b, 0xf0, 0xe1, 0x8e, 0xdf, 0x90, 0x73, 0xf1,
+ 0x7d, 0x7f, 0x31, 0xd1, 0x77, 0x76, 0xe1, 0xbd, 0x0d, 0x3d, 0x9b, 0x4e, 0x50, 0x13, 0xef, 0xfa,
+ 0xf3, 0x5d, 0x8d, 0xf5, 0xcc, 0x65, 0x27, 0x10, 0x96, 0x16, 0x4f, 0xcb, 0x51, 0xa7, 0x45, 0x1d,
+ 0xad, 0x2c, 0x58, 0x53, 0xe8, 0x22, 0xf4, 0x85, 0x55, 0xbf, 0xa9, 0xfc, 0xe4, 0x58, 0x3a, 0xed,
+ 0x0a, 0x2b, 0xd9, 0xdf, 0x2d, 0x21, 0xb3, 0x39, 0x5a, 0x8c, 0x05, 0x3e, 0x7a, 0x13, 0x46, 0xd8,
+ 0x2f, 0x65, 0xf6, 0x58, 0xcc, 0x97, 0xc0, 0x54, 0x74, 0x44, 0x6e, 0x13, 0x6c, 0x14, 0x61, 0x93,
+ 0xd4, 0xf4, 0x06, 0x0c, 0xaa, 0xcf, 0x7a, 0xa0, 0xda, 0xfa, 0xff, 0x58, 0x84, 0xc9, 0x8c, 0x35,
+ 0x87, 0x42, 0x63, 0x26, 0x2e, 0x74, 0xb9, 0x54, 0xdf, 0xe1, 0x5c, 0x84, 0xec, 0x01, 0x58, 0x13,
+ 0x6b, 0xab, 0xeb, 0x46, 0xaf, 0x87, 0x24, 0xd9, 0x28, 0x2d, 0xea, 0xdc, 0x28, 0x6d, 0xec, 0xd0,
+ 0x86, 0x9a, 0x36, 0xa4, 0x7a, 0xfa, 0x40, 0xe7, 0xf4, 0x37, 0x7b, 0xe0, 0x48, 0x56, 0x0c, 0x69,
+ 0xf4, 0x19, 0x10, 0xe9, 0xff, 0xc5, 0xb4, 0x3e, 0xdf, 0x6e, 0x84, 0xf5, 0x9a, 0x33, 0xcc, 0x17,
+ 0x4c, 0x84, 0x6e, 0x9d, 0x91, 0xc7, 0x11, 0x2f, 0xec, 0x38, 0xcc, 0xa2, 0x4d, 0x16, 0x52, 0x49,
+ 0xdc, 0x9e, 0xf2, 0xf8, 0xf8, 0x50, 0xd7, 0x1d, 0x10, 0xf7, 0x6f, 0x98, 0x30, 0xa9, 0x92, 0xc5,
+ 0x9d, 0x4d, 0xaa, 0x64, 0xcb, 0x68, 0x19, 0xfa, 0xaa, 0xdc, 0x56, 0xa7, 0xd8, 0xf9, 0x08, 0xe3,
+ 0x86, 0x3a, 0xea, 0x00, 0x16, 0x06, 0x3a, 0x82, 0xc0, 0xb4, 0x0b, 0x43, 0xda, 0xc0, 0x3c, 0xd0,
+ 0xc5, 0xb3, 0x45, 0x2f, 0x3e, 0x6d, 0x08, 0x1e, 0xe8, 0x02, 0xfa, 0x31, 0xed, 0xee, 0x17, 0xe7,
+ 0xc1, 0x07, 0x0d, 0xde, 0xe9, 0x64, 0xc2, 0x05, 0x2f, 0xb1, 0xaf, 0x18, 0x2f, 0x55, 0x31, 0x63,
+ 0x9e, 0xe7, 0xa6, 0x4e, 0x32, 0x2f, 0xfc, 0xf6, 0x71, 0xce, 0xed, 0x1f, 0xb7, 0x20, 0xe1, 0x24,
+ 0xa5, 0xc4, 0x9d, 0x56, 0xae, 0xb8, 0xf3, 0x0c, 0xf4, 0x04, 0x7e, 0x9d, 0x24, 0x53, 0xd3, 0x63,
+ 0xbf, 0x4e, 0x30, 0x83, 0x50, 0x8c, 0x28, 0x16, 0x62, 0x0d, 0xeb, 0x0f, 0x74, 0xf1, 0xf4, 0x7e,
+ 0x04, 0x7a, 0xeb, 0x64, 0x9b, 0xd4, 0x93, 0x19, 0x44, 0xaf, 0xd2, 0x42, 0xcc, 0x61, 0xf6, 0x2f,
+ 0xf7, 0xc0, 0xa9, 0xb6, 0x91, 0xd7, 0x28, 0x83, 0xb9, 0xe1, 0x44, 0xe4, 0xb6, 0xb3, 0x93, 0xcc,
+ 0x9c, 0x77, 0x89, 0x17, 0x63, 0x09, 0x67, 0xce, 0xc8, 0x3c, 0x93, 0x4c, 0x42, 0x38, 0x2c, 0x12,
+ 0xc8, 0x08, 0xa8, 0x29, 0x6c, 0x2c, 0xde, 0x0f, 0x61, 0xe3, 0xb3, 0x00, 0x61, 0x58, 0xe7, 0x06,
+ 0x97, 0x35, 0xe1, 0xe5, 0x1c, 0x67, 0x1c, 0xaa, 0x5c, 0x15, 0x10, 0xac, 0x61, 0xa1, 0x05, 0x18,
+ 0x6f, 0x06, 0x7e, 0xc4, 0x65, 0xed, 0x0b, 0xdc, 0x26, 0xb9, 0xd7, 0x0c, 0x7a, 0x55, 0x4e, 0xc0,
+ 0x71, 0xaa, 0x06, 0x7a, 0x01, 0x86, 0x44, 0x20, 0xac, 0xb2, 0xef, 0xd7, 0x85, 0x78, 0x4f, 0x99,
+ 0xe9, 0x56, 0x62, 0x10, 0xd6, 0xf1, 0xb4, 0x6a, 0x4c, 0x80, 0xdf, 0x9f, 0x59, 0x8d, 0x0b, 0xf1,
+ 0x35, 0xbc, 0x44, 0xd0, 0xfc, 0x81, 0xae, 0x82, 0xe6, 0xc7, 0x02, 0xcf, 0xc1, 0xae, 0xf5, 0xc9,
+ 0xd0, 0x51, 0x44, 0xf8, 0x95, 0x1e, 0x98, 0x14, 0x0b, 0xe7, 0x41, 0x2f, 0x97, 0xeb, 0xe9, 0xe5,
+ 0x72, 0x3f, 0x44, 0xa2, 0xef, 0xaf, 0x99, 0xc3, 0x5e, 0x33, 0x3f, 0x6c, 0x81, 0xc9, 0x43, 0xa2,
+ 0xff, 0x2f, 0x37, 0xf5, 0xe8, 0x0b, 0xb9, 0x3c, 0x69, 0x1c, 0x51, 0xfb, 0x9d, 0x25, 0x21, 0xb5,
+ 0xff, 0x93, 0x05, 0x0f, 0x77, 0xa4, 0x88, 0x16, 0x61, 0x90, 0x31, 0xba, 0xda, 0xbb, 0xf8, 0x71,
+ 0xe5, 0xb3, 0x20, 0x01, 0x39, 0x7c, 0x77, 0x5c, 0x13, 0x2d, 0xa6, 0x72, 0xbc, 0x3e, 0x91, 0x91,
+ 0xe3, 0xf5, 0xa8, 0x31, 0x3c, 0xf7, 0x98, 0xe4, 0xf5, 0x0b, 0xf4, 0xc6, 0x31, 0x7d, 0x12, 0x3f,
+ 0x64, 0x88, 0x73, 0xed, 0x84, 0x38, 0x17, 0x99, 0xd8, 0xda, 0x1d, 0xf2, 0x1a, 0x8c, 0xb3, 0x08,
+ 0x99, 0xcc, 0x83, 0x46, 0x38, 0x33, 0x16, 0x62, 0x2b, 0xf9, 0xab, 0x09, 0x18, 0x4e, 0x61, 0xdb,
+ 0x7f, 0x5a, 0x84, 0x3e, 0xbe, 0xfd, 0x0e, 0xe1, 0xe1, 0xfb, 0x14, 0x0c, 0xba, 0x8d, 0x46, 0x8b,
+ 0xa7, 0xed, 0xec, 0x8d, 0x6d, 0xae, 0x97, 0x65, 0x21, 0x8e, 0xe1, 0x68, 0x49, 0x68, 0x12, 0xda,
+ 0x04, 0xe1, 0xe6, 0x1d, 0x9f, 0x59, 0x70, 0x22, 0x87, 0x73, 0x71, 0xea, 0x9e, 0x8d, 0x75, 0x0e,
+ 0xe8, 0x93, 0x00, 0x61, 0x14, 0xb8, 0xde, 0x06, 0x2d, 0x13, 0x99, 0x1a, 0x9e, 0x6c, 0x43, 0xad,
+ 0xa2, 0x90, 0x39, 0xcd, 0xf8, 0xcc, 0x51, 0x00, 0xac, 0x51, 0x44, 0x33, 0xc6, 0x4d, 0x3f, 0x9d,
+ 0x98, 0x3b, 0xe0, 0x54, 0xe3, 0x39, 0x9b, 0x7e, 0x11, 0x06, 0x15, 0xf1, 0x4e, 0x72, 0xc5, 0x61,
+ 0x9d, 0x61, 0xfb, 0x08, 0x8c, 0x25, 0xfa, 0x76, 0x20, 0xb1, 0xe4, 0xaf, 0x58, 0x30, 0xc6, 0x3b,
+ 0xb3, 0xe8, 0x6d, 0x8b, 0xdb, 0xe0, 0x2e, 0x1c, 0xa9, 0x67, 0x9c, 0xca, 0x62, 0xfa, 0xbb, 0x3f,
+ 0xc5, 0x95, 0x18, 0x32, 0x0b, 0x8a, 0x33, 0xdb, 0x40, 0xe7, 0xe8, 0x8e, 0xa3, 0xa7, 0xae, 0x53,
+ 0x17, 0xd1, 0x36, 0x86, 0xf9, 0x6e, 0xe3, 0x65, 0x58, 0x41, 0xed, 0x3f, 0xb4, 0x60, 0x82, 0xf7,
+ 0xfc, 0x0a, 0xd9, 0x51, 0x67, 0xd3, 0xb7, 0xb2, 0xef, 0x22, 0x61, 0x74, 0x21, 0x27, 0x61, 0xb4,
+ 0xfe, 0x69, 0xc5, 0xb6, 0x9f, 0xf6, 0x65, 0x0b, 0xc4, 0x0a, 0x39, 0x04, 0x49, 0xcb, 0x77, 0x98,
+ 0x92, 0x96, 0xe9, 0xfc, 0x4d, 0x90, 0x23, 0x62, 0xf9, 0x6b, 0x0b, 0xc6, 0x39, 0x42, 0x6c, 0x05,
+ 0xf1, 0x2d, 0x9d, 0x87, 0x39, 0xf3, 0x8b, 0x32, 0xcd, 0x5a, 0xaf, 0x90, 0x9d, 0x35, 0xbf, 0xec,
+ 0x44, 0x9b, 0xd9, 0x1f, 0x65, 0x4c, 0x56, 0x4f, 0xdb, 0xc9, 0xaa, 0xc9, 0x0d, 0x64, 0x24, 0x26,
+ 0xec, 0x20, 0x00, 0x3e, 0x68, 0x62, 0x42, 0xfb, 0xcf, 0x2c, 0x40, 0xbc, 0x19, 0x83, 0x71, 0xa3,
+ 0xec, 0x10, 0x2b, 0xd5, 0x2e, 0xba, 0xf8, 0x68, 0x52, 0x10, 0xac, 0x61, 0xdd, 0x97, 0xe1, 0x49,
+ 0x98, 0xb2, 0x14, 0x3b, 0x9b, 0xb2, 0x1c, 0x60, 0x44, 0xbf, 0xdc, 0x0f, 0x49, 0x9f, 0x49, 0x74,
+ 0x03, 0x86, 0xab, 0x4e, 0xd3, 0xb9, 0xe5, 0xd6, 0xdd, 0xc8, 0x25, 0x61, 0x3b, 0x3b, 0xb7, 0x79,
+ 0x0d, 0x4f, 0x18, 0x1f, 0x68, 0x25, 0xd8, 0xa0, 0x83, 0x66, 0x00, 0x9a, 0x81, 0xbb, 0xed, 0xd6,
+ 0xc9, 0x06, 0x13, 0x08, 0xb1, 0xf8, 0x3e, 0xdc, 0xe8, 0x4e, 0x96, 0x62, 0x0d, 0x23, 0x23, 0xf4,
+ 0x46, 0xf1, 0x01, 0x87, 0xde, 0x80, 0x43, 0x0b, 0xbd, 0xd1, 0x73, 0xa0, 0xd0, 0x1b, 0x03, 0x07,
+ 0x0e, 0xbd, 0xd1, 0xdb, 0x55, 0xe8, 0x0d, 0x0c, 0xc7, 0x24, 0xef, 0x49, 0xff, 0x2f, 0xb9, 0x75,
+ 0x22, 0x1e, 0x1c, 0x3c, 0x28, 0xd1, 0xf4, 0xde, 0x6e, 0xe9, 0x18, 0xce, 0xc4, 0xc0, 0x39, 0x35,
+ 0xd1, 0x47, 0x61, 0xca, 0xa9, 0xd7, 0xfd, 0xdb, 0x6a, 0x52, 0x17, 0xc3, 0xaa, 0x53, 0xe7, 0xca,
+ 0xa5, 0x7e, 0x46, 0xf5, 0xe4, 0xde, 0x6e, 0x69, 0x6a, 0x36, 0x07, 0x07, 0xe7, 0xd6, 0x46, 0xaf,
+ 0xc0, 0x60, 0x33, 0xf0, 0xab, 0x2b, 0x9a, 0x63, 0xf7, 0x69, 0x3a, 0x80, 0x65, 0x59, 0xb8, 0xbf,
+ 0x5b, 0x1a, 0x51, 0x7f, 0xd8, 0x85, 0x1f, 0x57, 0xc8, 0x88, 0x6a, 0x31, 0xf4, 0xa0, 0xa3, 0x5a,
+ 0x0c, 0xdf, 0xef, 0xa8, 0x16, 0x5b, 0x30, 0x59, 0x21, 0x81, 0xeb, 0xd4, 0xdd, 0xbb, 0x94, 0x27,
+ 0x97, 0x67, 0xe0, 0x1a, 0x0c, 0x06, 0x89, 0x53, 0xbf, 0xab, 0xe0, 0xdb, 0x9a, 0x5c, 0x46, 0x9e,
+ 0xf2, 0x31, 0x21, 0xfb, 0x7f, 0x5b, 0xd0, 0x2f, 0xfc, 0x30, 0x0f, 0x81, 0x33, 0x9d, 0x35, 0x54,
+ 0x32, 0xa5, 0xec, 0x49, 0x61, 0x9d, 0xc9, 0x55, 0xc6, 0x2c, 0x27, 0x94, 0x31, 0x0f, 0xb7, 0x23,
+ 0xd2, 0x5e, 0x0d, 0xf3, 0x77, 0x8b, 0xf4, 0x85, 0x60, 0x44, 0x04, 0x78, 0xf0, 0x43, 0xb0, 0x0a,
+ 0xfd, 0xa1, 0xf0, 0x48, 0x2f, 0xe4, 0xfb, 0xf2, 0x24, 0x27, 0x31, 0xb6, 0x81, 0x14, 0x3e, 0xe8,
+ 0x92, 0x48, 0xa6, 0xab, 0x7b, 0xf1, 0x01, 0xba, 0xba, 0x77, 0x8a, 0x99, 0xd0, 0x73, 0x3f, 0x62,
+ 0x26, 0xd8, 0x5f, 0x63, 0xb7, 0xb3, 0x5e, 0x7e, 0x08, 0x8c, 0xdb, 0x25, 0xf3, 0x1e, 0xb7, 0xdb,
+ 0xac, 0x2c, 0xd1, 0xa9, 0x1c, 0x06, 0xee, 0x97, 0x2c, 0x38, 0x95, 0xf1, 0x55, 0x1a, 0x37, 0xf7,
+ 0x34, 0x0c, 0x38, 0xad, 0x9a, 0xab, 0xf6, 0xb2, 0xa6, 0x2d, 0x9e, 0x15, 0xe5, 0x58, 0x61, 0xa0,
+ 0x79, 0x98, 0x20, 0x77, 0x9a, 0x2e, 0x57, 0xc3, 0xeb, 0xa6, 0xe3, 0x45, 0xee, 0xbc, 0xbb, 0x98,
+ 0x04, 0xe2, 0x34, 0xbe, 0x0a, 0x89, 0x56, 0xcc, 0x0d, 0x89, 0xf6, 0x0b, 0x16, 0x0c, 0x29, 0x9f,
+ 0xec, 0x07, 0x3e, 0xda, 0xaf, 0x99, 0xa3, 0xfd, 0x50, 0x9b, 0xd1, 0xce, 0x19, 0xe6, 0x3f, 0x28,
+ 0xa8, 0xfe, 0x96, 0xfd, 0x20, 0xea, 0x82, 0x4b, 0xbc, 0x77, 0xb7, 0x97, 0x0b, 0x30, 0xe4, 0x34,
+ 0x9b, 0x12, 0x20, 0xed, 0x17, 0x59, 0x2a, 0x85, 0xb8, 0x18, 0xeb, 0x38, 0xca, 0x0b, 0xa7, 0x98,
+ 0xeb, 0x85, 0x53, 0x03, 0x88, 0x9c, 0x60, 0x83, 0x44, 0xb4, 0x4c, 0x98, 0x5b, 0xe7, 0x9f, 0x37,
+ 0xad, 0xc8, 0xad, 0xcf, 0xb8, 0x5e, 0x14, 0x46, 0xc1, 0xcc, 0xb2, 0x17, 0x5d, 0x0b, 0xf8, 0x33,
+ 0x55, 0x0b, 0x2a, 0xa8, 0x68, 0x61, 0x8d, 0xae, 0x8c, 0x3f, 0xc2, 0xda, 0xe8, 0x35, 0x0d, 0x61,
+ 0x56, 0x45, 0x39, 0x56, 0x18, 0xf6, 0x8b, 0xec, 0xf6, 0x61, 0x63, 0x7a, 0xb0, 0x80, 0x7a, 0x7f,
+ 0x3e, 0xac, 0x66, 0x83, 0xa9, 0x84, 0x17, 0xf4, 0xb0, 0x7d, 0xed, 0x0f, 0x7b, 0xda, 0xb0, 0xee,
+ 0xcf, 0x1a, 0xc7, 0xf6, 0x43, 0x1f, 0x4f, 0x19, 0x37, 0x3d, 0xd3, 0xe1, 0xd6, 0x38, 0x80, 0x39,
+ 0x13, 0xcb, 0xab, 0xc6, 0xb2, 0x4e, 0x2d, 0x97, 0xc5, 0xbe, 0xd0, 0xf2, 0xaa, 0x09, 0x00, 0x8e,
+ 0x71, 0x28, 0xc3, 0xa6, 0xfe, 0x84, 0x53, 0x28, 0x0e, 0xbf, 0xad, 0xb0, 0x43, 0xac, 0x61, 0xa0,
+ 0xf3, 0x42, 0x68, 0xc1, 0x75, 0x0f, 0x0f, 0x25, 0x84, 0x16, 0x72, 0xb8, 0x34, 0x49, 0xd3, 0x05,
+ 0x18, 0x22, 0x77, 0x22, 0x12, 0x78, 0x4e, 0x9d, 0xb6, 0xd0, 0x1b, 0x47, 0x8c, 0x5d, 0x8c, 0x8b,
+ 0xb1, 0x8e, 0x83, 0xd6, 0x60, 0x2c, 0xe4, 0xb2, 0x3c, 0x95, 0xf4, 0x81, 0xcb, 0x44, 0x9f, 0x54,
+ 0xde, 0xf0, 0x26, 0x78, 0x9f, 0x15, 0xf1, 0xd3, 0x49, 0xc6, 0x08, 0x49, 0x92, 0x40, 0xaf, 0xc2,
+ 0x68, 0xdd, 0x77, 0x6a, 0x73, 0x4e, 0xdd, 0xf1, 0xaa, 0x6c, 0x7c, 0x06, 0xcc, 0xec, 0xfc, 0x57,
+ 0x0d, 0x28, 0x4e, 0x60, 0x53, 0x06, 0x51, 0x2f, 0x11, 0x89, 0x4a, 0x1c, 0x6f, 0x83, 0x84, 0x53,
+ 0x83, 0xec, 0xab, 0x18, 0x83, 0x78, 0x35, 0x07, 0x07, 0xe7, 0xd6, 0x46, 0x17, 0x61, 0x58, 0x7e,
+ 0xbe, 0x16, 0x52, 0x27, 0x76, 0x68, 0xd2, 0x60, 0xd8, 0xc0, 0x44, 0x21, 0x1c, 0x95, 0xff, 0xd7,
+ 0x02, 0x67, 0x7d, 0xdd, 0xad, 0x8a, 0x38, 0x13, 0xdc, 0xf9, 0xfb, 0x23, 0xd2, 0xd3, 0x74, 0x31,
+ 0x0b, 0x69, 0x7f, 0xb7, 0x74, 0x52, 0x8c, 0x5a, 0x26, 0x1c, 0x67, 0xd3, 0x46, 0x2b, 0x30, 0xc9,
+ 0x6d, 0x60, 0xe6, 0x37, 0x49, 0x75, 0x4b, 0x6e, 0x38, 0xc6, 0x35, 0x6a, 0x8e, 0x3f, 0x97, 0xd3,
+ 0x28, 0x38, 0xab, 0x1e, 0x7a, 0x0b, 0xa6, 0x9a, 0xad, 0x5b, 0x75, 0x37, 0xdc, 0x5c, 0xf5, 0x23,
+ 0x66, 0x42, 0x36, 0x5b, 0xab, 0x05, 0x24, 0xe4, 0xbe, 0xc1, 0xec, 0xea, 0x95, 0x61, 0x90, 0xca,
+ 0x39, 0x78, 0x38, 0x97, 0x02, 0xba, 0x0b, 0x47, 0x13, 0x0b, 0x41, 0xc4, 0x33, 0x19, 0xcd, 0x4f,
+ 0xf9, 0x54, 0xc9, 0xaa, 0x20, 0x42, 0x03, 0x65, 0x81, 0x70, 0x76, 0x13, 0xe8, 0x25, 0x00, 0xb7,
+ 0xb9, 0xe4, 0x34, 0xdc, 0x3a, 0x7d, 0x8e, 0x4e, 0xb2, 0x35, 0x42, 0x9f, 0x26, 0xb0, 0x5c, 0x96,
+ 0xa5, 0xf4, 0x6c, 0x16, 0xff, 0x76, 0xb0, 0x86, 0x8d, 0xae, 0xc2, 0xa8, 0xf8, 0xb7, 0x23, 0xa6,
+ 0x74, 0x42, 0x65, 0x07, 0x1d, 0x95, 0x35, 0xd4, 0x3c, 0x26, 0x4a, 0x70, 0xa2, 0x2e, 0xda, 0x80,
+ 0x53, 0x32, 0x35, 0xa9, 0xbe, 0x3e, 0xe5, 0x1c, 0x84, 0x2c, 0xcf, 0xd2, 0x00, 0xf7, 0x29, 0x9a,
+ 0x6d, 0x87, 0x88, 0xdb, 0xd3, 0xa1, 0xf7, 0xba, 0xbe, 0xcc, 0xb9, 0xc7, 0xf8, 0xd1, 0x38, 0x12,
+ 0xe6, 0xd5, 0x24, 0x10, 0xa7, 0xf1, 0x91, 0x0f, 0x47, 0x5d, 0x2f, 0x6b, 0x55, 0x1f, 0x63, 0x84,
+ 0x3e, 0xcc, 0x9d, 0xe5, 0xdb, 0xaf, 0xe8, 0x4c, 0x38, 0xce, 0xa6, 0x8b, 0x96, 0x61, 0x32, 0xe2,
+ 0x05, 0x0b, 0x6e, 0xc8, 0xd3, 0xb8, 0xd0, 0x67, 0xdf, 0x71, 0xd6, 0xdc, 0x71, 0xba, 0x9a, 0xd7,
+ 0xd2, 0x60, 0x9c, 0x55, 0xe7, 0x9d, 0x19, 0x80, 0x7e, 0xdd, 0xa2, 0xb5, 0x35, 0x46, 0x1f, 0x7d,
+ 0x0a, 0x86, 0xf5, 0xf1, 0x11, 0x4c, 0xcb, 0xd9, 0x6c, 0x3e, 0x58, 0x3b, 0x5e, 0xf8, 0x33, 0x41,
+ 0x1d, 0x21, 0x3a, 0x0c, 0x1b, 0x14, 0x51, 0x35, 0x23, 0xc8, 0xc5, 0xf9, 0xee, 0x98, 0xa2, 0xee,
+ 0xed, 0x1f, 0x09, 0x64, 0xef, 0x1c, 0x74, 0x15, 0x06, 0xaa, 0x75, 0x97, 0x78, 0xd1, 0x72, 0xb9,
+ 0x5d, 0x80, 0xd2, 0x79, 0x81, 0x23, 0xb6, 0xa2, 0xc8, 0xbe, 0xc4, 0xcb, 0xb0, 0xa2, 0x60, 0x5f,
+ 0x84, 0xa1, 0x4a, 0x9d, 0x90, 0x26, 0xf7, 0xe3, 0x42, 0x4f, 0xb0, 0x87, 0x09, 0x63, 0x2d, 0x2d,
+ 0xc6, 0x5a, 0xea, 0x6f, 0x0e, 0xc6, 0x54, 0x4a, 0xb8, 0xfd, 0xdb, 0x05, 0x28, 0x75, 0x48, 0x02,
+ 0x96, 0xd0, 0xb7, 0x59, 0x5d, 0xe9, 0xdb, 0x66, 0x61, 0x2c, 0xfe, 0xa7, 0x8b, 0xf2, 0x94, 0x31,
+ 0xf4, 0x0d, 0x13, 0x8c, 0x93, 0xf8, 0x5d, 0xfb, 0xb5, 0xe8, 0x2a, 0xbb, 0x9e, 0x8e, 0x9e, 0x59,
+ 0x86, 0xaa, 0xbe, 0xb7, 0xfb, 0xb7, 0x77, 0xae, 0xda, 0xd5, 0xfe, 0x5a, 0x01, 0x8e, 0xaa, 0x21,
+ 0x7c, 0xef, 0x0e, 0xdc, 0xf5, 0xf4, 0xc0, 0xdd, 0x07, 0xa5, 0xb5, 0x7d, 0x0d, 0xfa, 0x78, 0xd4,
+ 0xd4, 0x2e, 0x78, 0xfe, 0x47, 0xcc, 0xe0, 0xf4, 0x8a, 0xcd, 0x34, 0x02, 0xd4, 0xff, 0x80, 0x05,
+ 0x63, 0x09, 0x07, 0x49, 0x84, 0x35, 0x2f, 0xfa, 0x7b, 0xe1, 0xcb, 0xb3, 0x38, 0xfe, 0x33, 0xd0,
+ 0xb3, 0xe9, 0x2b, 0x23, 0x65, 0x85, 0x71, 0xd9, 0x0f, 0x23, 0xcc, 0x20, 0xf6, 0x1f, 0x59, 0xd0,
+ 0xbb, 0xe6, 0xb8, 0x5e, 0x24, 0xb5, 0x1f, 0x56, 0x8e, 0xf6, 0xa3, 0x9b, 0xef, 0x42, 0x2f, 0x40,
+ 0x1f, 0x59, 0x5f, 0x27, 0xd5, 0x48, 0xcc, 0xaa, 0x8c, 0xa6, 0xd1, 0xb7, 0xc8, 0x4a, 0x29, 0x13,
+ 0xca, 0x1a, 0xe3, 0x7f, 0xb1, 0x40, 0x46, 0x37, 0x61, 0x30, 0x72, 0x1b, 0x64, 0xb6, 0x56, 0x13,
+ 0x36, 0x01, 0xf7, 0x10, 0x02, 0x66, 0x4d, 0x12, 0xc0, 0x31, 0x2d, 0xfb, 0x8b, 0x05, 0x80, 0x38,
+ 0x14, 0x5c, 0xa7, 0x4f, 0x9c, 0x4b, 0x69, 0x8b, 0xcf, 0x66, 0x68, 0x8b, 0x51, 0x4c, 0x30, 0x43,
+ 0x55, 0xac, 0x86, 0xa9, 0xd8, 0xd5, 0x30, 0xf5, 0x1c, 0x64, 0x98, 0xe6, 0x61, 0x22, 0x0e, 0x65,
+ 0x67, 0x46, 0xf2, 0x64, 0xf7, 0xf7, 0x5a, 0x12, 0x88, 0xd3, 0xf8, 0x36, 0x81, 0x33, 0x2a, 0xa2,
+ 0x97, 0xb8, 0x0b, 0x99, 0x2b, 0x81, 0xae, 0x7d, 0xef, 0x30, 0x4e, 0xb1, 0x3a, 0xbc, 0x90, 0xab,
+ 0x0e, 0xff, 0x29, 0x0b, 0x8e, 0x24, 0xdb, 0x61, 0x7e, 0xf7, 0x9f, 0xb7, 0xe0, 0x68, 0x9c, 0x03,
+ 0x27, 0x6d, 0x82, 0xf0, 0x7c, 0xdb, 0x28, 0x65, 0x39, 0x3d, 0x8e, 0xc3, 0xb6, 0xac, 0x64, 0x91,
+ 0xc6, 0xd9, 0x2d, 0xda, 0xff, 0xab, 0x07, 0xa6, 0xf2, 0xc2, 0x9b, 0x31, 0x4f, 0x23, 0xe7, 0x4e,
+ 0x65, 0x8b, 0xdc, 0x16, 0xfe, 0x1c, 0xb1, 0xa7, 0x11, 0x2f, 0xc6, 0x12, 0x9e, 0x4c, 0x7b, 0x54,
+ 0xe8, 0x32, 0xed, 0xd1, 0x26, 0x4c, 0xdc, 0xde, 0x24, 0xde, 0x75, 0x2f, 0x74, 0x22, 0x37, 0x5c,
+ 0x77, 0x99, 0x02, 0x9d, 0xaf, 0x1b, 0x99, 0xba, 0x7f, 0xe2, 0x66, 0x12, 0x61, 0x7f, 0xb7, 0x74,
+ 0xca, 0x28, 0x88, 0xbb, 0xcc, 0x0f, 0x12, 0x9c, 0x26, 0x9a, 0xce, 0x1a, 0xd5, 0xf3, 0x80, 0xb3,
+ 0x46, 0x35, 0x5c, 0x61, 0x76, 0x23, 0xdd, 0x48, 0xd8, 0xb3, 0x75, 0x45, 0x95, 0x62, 0x0d, 0x03,
+ 0x7d, 0x02, 0x90, 0x9e, 0xf6, 0xcf, 0x88, 0x2e, 0xfb, 0xcc, 0xde, 0x6e, 0x09, 0xad, 0xa6, 0xa0,
+ 0xfb, 0xbb, 0xa5, 0x49, 0x5a, 0xba, 0xec, 0xd1, 0xe7, 0x6f, 0x1c, 0x92, 0x2f, 0x83, 0x10, 0xba,
+ 0x09, 0xe3, 0xb4, 0x94, 0xed, 0x28, 0x19, 0xba, 0x96, 0x3f, 0x59, 0x9f, 0xda, 0xdb, 0x2d, 0x8d,
+ 0xaf, 0x26, 0x60, 0x79, 0xa4, 0x53, 0x44, 0x32, 0x92, 0x47, 0x0d, 0x74, 0x9b, 0x3c, 0xca, 0xfe,
+ 0xbc, 0x05, 0x27, 0xe8, 0x05, 0x57, 0xbb, 0x9a, 0xa3, 0x45, 0x77, 0x9a, 0x2e, 0xd7, 0xd3, 0x88,
+ 0xab, 0x86, 0xc9, 0xea, 0xca, 0xcb, 0x5c, 0x4b, 0xa3, 0xa0, 0xf4, 0x84, 0xdf, 0x72, 0xbd, 0x5a,
+ 0xf2, 0x84, 0xbf, 0xe2, 0x7a, 0x35, 0xcc, 0x20, 0xea, 0xca, 0x2a, 0xe6, 0x46, 0xa9, 0xff, 0x0a,
+ 0xdd, 0xab, 0xb4, 0x2f, 0xdf, 0xd2, 0x6e, 0xa0, 0xa7, 0x74, 0x9d, 0xaa, 0x30, 0x9f, 0xcc, 0xd5,
+ 0xa7, 0x7e, 0xce, 0x02, 0xe1, 0xfd, 0xde, 0xc5, 0x9d, 0xfc, 0x26, 0x0c, 0x6f, 0xa7, 0x53, 0xa2,
+ 0x9e, 0xc9, 0x0f, 0x07, 0x20, 0x12, 0xa1, 0x2a, 0x16, 0xdd, 0x48, 0x7f, 0x6a, 0xd0, 0xb2, 0x6b,
+ 0x20, 0xa0, 0x0b, 0x84, 0x69, 0x35, 0x3a, 0xf7, 0xe6, 0x59, 0x80, 0x1a, 0xc3, 0x65, 0x79, 0xd2,
+ 0x0b, 0x26, 0xc7, 0xb5, 0xa0, 0x20, 0x58, 0xc3, 0xb2, 0x7f, 0xae, 0x08, 0x43, 0x32, 0x05, 0x67,
+ 0xcb, 0xeb, 0x46, 0xf6, 0x78, 0xa0, 0x9c, 0xfc, 0xe8, 0x2d, 0x98, 0x08, 0x48, 0xb5, 0x15, 0x84,
+ 0xee, 0x36, 0x91, 0x60, 0xb1, 0x49, 0x66, 0x78, 0x92, 0x84, 0x04, 0x70, 0x9f, 0x85, 0xc8, 0x4a,
+ 0x14, 0x32, 0xa5, 0x71, 0x9a, 0x10, 0x3a, 0x0f, 0x83, 0x4c, 0xf4, 0x5e, 0x8e, 0x05, 0xc2, 0x4a,
+ 0xf0, 0xb5, 0x22, 0x01, 0x38, 0xc6, 0x61, 0x8f, 0x83, 0xd6, 0x2d, 0x86, 0x9e, 0xf0, 0x04, 0xaf,
+ 0xf0, 0x62, 0x2c, 0xe1, 0xe8, 0xa3, 0x30, 0xce, 0xeb, 0x05, 0x7e, 0xd3, 0xd9, 0xe0, 0x2a, 0xc1,
+ 0x5e, 0x15, 0x5e, 0x67, 0x7c, 0x25, 0x01, 0xdb, 0xdf, 0x2d, 0x1d, 0x49, 0x96, 0xb1, 0x6e, 0xa7,
+ 0xa8, 0x30, 0xcb, 0x3f, 0xde, 0x08, 0xbd, 0x33, 0x52, 0x06, 0x83, 0x31, 0x08, 0xeb, 0x78, 0xf6,
+ 0x5f, 0x59, 0x30, 0xa1, 0x4d, 0x55, 0xd7, 0x79, 0x2a, 0x8c, 0x41, 0x2a, 0x74, 0x31, 0x48, 0x07,
+ 0x8b, 0xf6, 0x90, 0x39, 0xc3, 0x3d, 0xf7, 0x69, 0x86, 0xed, 0x4f, 0x01, 0x4a, 0xe7, 0x77, 0x45,
+ 0xaf, 0x73, 0x43, 0x7e, 0x37, 0x20, 0xb5, 0x76, 0x0a, 0x7f, 0x3d, 0x72, 0x8e, 0xf4, 0x5c, 0xe5,
+ 0xb5, 0xb0, 0xaa, 0x6f, 0xff, 0x60, 0x0f, 0x8c, 0x27, 0x63, 0x75, 0xa0, 0xcb, 0xd0, 0xc7, 0xb9,
+ 0x74, 0x41, 0xbe, 0x8d, 0x3d, 0x99, 0x16, 0xe1, 0x83, 0xf1, 0x2b, 0x82, 0xd1, 0x17, 0xf5, 0xd1,
+ 0x5b, 0x30, 0x54, 0xf3, 0x6f, 0x7b, 0xb7, 0x9d, 0xa0, 0x36, 0x5b, 0x5e, 0x16, 0x27, 0x44, 0xa6,
+ 0x00, 0x6a, 0x21, 0x46, 0xd3, 0xa3, 0x86, 0x30, 0xdb, 0x89, 0x18, 0x84, 0x75, 0x72, 0x68, 0x8d,
+ 0xa5, 0x2c, 0x5a, 0x77, 0x37, 0x56, 0x9c, 0x66, 0x3b, 0xaf, 0xae, 0x79, 0x89, 0xa4, 0x51, 0x1e,
+ 0x11, 0x79, 0x8d, 0x38, 0x00, 0xc7, 0x84, 0xd0, 0x67, 0x60, 0x32, 0xcc, 0x51, 0x89, 0xe5, 0xa5,
+ 0xfb, 0x6e, 0xa7, 0x25, 0xe2, 0xc2, 0x94, 0x2c, 0xe5, 0x59, 0x56, 0x33, 0xe8, 0x0e, 0x20, 0x21,
+ 0x7a, 0x5e, 0x0b, 0x5a, 0x61, 0x34, 0xd7, 0xf2, 0x6a, 0x75, 0x99, 0xd2, 0xe8, 0x83, 0xd9, 0x72,
+ 0x82, 0x24, 0xb6, 0xd6, 0x36, 0x8b, 0xdd, 0x9b, 0xc6, 0xc0, 0x19, 0x6d, 0xd8, 0x9f, 0xeb, 0x81,
+ 0x69, 0x99, 0x50, 0x39, 0xc3, 0x7b, 0xe5, 0xb3, 0x56, 0xc2, 0x7d, 0xe5, 0xa5, 0xfc, 0x83, 0xfe,
+ 0x81, 0x39, 0xb1, 0x7c, 0x21, 0xed, 0xc4, 0xf2, 0xca, 0x01, 0xbb, 0x71, 0xdf, 0x5c, 0x59, 0xde,
+ 0xb3, 0xfe, 0x27, 0x7b, 0x47, 0xc0, 0xb8, 0x9a, 0x11, 0xe6, 0x81, 0xd1, 0xcb, 0x52, 0x75, 0x94,
+ 0xf3, 0xfc, 0xbf, 0x2c, 0x70, 0x8c, 0xcb, 0x7e, 0x58, 0x86, 0x4f, 0x67, 0xe7, 0xac, 0xa2, 0x43,
+ 0x69, 0x92, 0x46, 0x33, 0xda, 0x59, 0x70, 0x03, 0xd1, 0xe3, 0x4c, 0x9a, 0x8b, 0x02, 0x27, 0x4d,
+ 0x53, 0x42, 0xb0, 0xa2, 0x83, 0xb6, 0x61, 0x62, 0x83, 0x45, 0x7c, 0xd2, 0x72, 0x1b, 0x8b, 0x73,
+ 0x21, 0x73, 0xdf, 0x5e, 0x9a, 0x5f, 0xcc, 0x4f, 0x84, 0xcc, 0x1f, 0x7f, 0x29, 0x14, 0x9c, 0x6e,
+ 0x82, 0x6e, 0x8d, 0x23, 0xce, 0xed, 0x70, 0xb1, 0xee, 0x84, 0x91, 0x5b, 0x9d, 0xab, 0xfb, 0xd5,
+ 0xad, 0x4a, 0xe4, 0x07, 0x32, 0x01, 0x62, 0xe6, 0xdb, 0x6b, 0xf6, 0x66, 0x25, 0x85, 0x6f, 0x34,
+ 0x3f, 0xb5, 0xb7, 0x5b, 0x3a, 0x92, 0x85, 0x85, 0x33, 0xdb, 0x42, 0xab, 0xd0, 0xbf, 0xe1, 0x46,
+ 0x98, 0x34, 0x7d, 0x71, 0x5a, 0x64, 0x1e, 0x85, 0x97, 0x38, 0x8a, 0xd1, 0x12, 0x8b, 0x48, 0x25,
+ 0x00, 0x58, 0x12, 0x41, 0xaf, 0xab, 0x4b, 0xa0, 0x2f, 0x5f, 0x00, 0x9b, 0xb6, 0xbd, 0xcb, 0xbc,
+ 0x06, 0x5e, 0x85, 0xa2, 0xb7, 0x1e, 0xb6, 0x8b, 0xc5, 0xb3, 0xba, 0x64, 0xc8, 0xcf, 0xe6, 0xfa,
+ 0xe9, 0xd3, 0x78, 0x75, 0xa9, 0x82, 0x69, 0x45, 0xe6, 0xf6, 0x1a, 0x56, 0x43, 0x57, 0x24, 0x5c,
+ 0xca, 0xf4, 0x02, 0x5e, 0xae, 0xcc, 0x57, 0x96, 0x0d, 0x1a, 0x2c, 0xaa, 0x21, 0x2b, 0xc6, 0xbc,
+ 0x3a, 0xba, 0x01, 0x83, 0x1b, 0xfc, 0xe0, 0x5b, 0x0f, 0x45, 0x52, 0xf5, 0xcc, 0xcb, 0xe8, 0x92,
+ 0x44, 0x32, 0xe8, 0xb1, 0x2b, 0x43, 0x81, 0x70, 0x4c, 0x0a, 0x7d, 0xce, 0x82, 0xa3, 0xc9, 0xac,
+ 0xf4, 0xcc, 0x59, 0x4d, 0x98, 0xa9, 0x65, 0x3a, 0x00, 0x94, 0xb3, 0x2a, 0x18, 0x0d, 0x32, 0xf5,
+ 0x4b, 0x26, 0x1a, 0xce, 0x6e, 0x8e, 0x0e, 0x74, 0x70, 0xab, 0xd6, 0x2e, 0x47, 0x4f, 0x22, 0x30,
+ 0x11, 0x1f, 0x68, 0x3c, 0xb7, 0x80, 0x69, 0x45, 0xb4, 0x06, 0xb0, 0x5e, 0x27, 0x22, 0xe2, 0xa3,
+ 0x30, 0x8a, 0xca, 0xbc, 0xfd, 0x97, 0x14, 0x96, 0xa0, 0xc3, 0x5e, 0xa2, 0x71, 0x29, 0xd6, 0xe8,
+ 0xd0, 0xa5, 0x54, 0x75, 0xbd, 0x1a, 0x09, 0x98, 0x72, 0x2b, 0x67, 0x29, 0xcd, 0x33, 0x8c, 0xf4,
+ 0x52, 0xe2, 0xe5, 0x58, 0x50, 0x60, 0xb4, 0x48, 0x73, 0x73, 0x3d, 0x6c, 0x97, 0x72, 0x62, 0x9e,
+ 0x34, 0x37, 0x13, 0x0b, 0x8a, 0xd3, 0x62, 0xe5, 0x58, 0x50, 0xa0, 0x5b, 0x66, 0x9d, 0x6e, 0x20,
+ 0x12, 0x4c, 0x8d, 0xe5, 0x6f, 0x99, 0x25, 0x8e, 0x92, 0xde, 0x32, 0x02, 0x80, 0x25, 0x11, 0xf4,
+ 0x49, 0x93, 0xdb, 0x19, 0x67, 0x34, 0x9f, 0xea, 0xc0, 0xed, 0x18, 0x74, 0xdb, 0xf3, 0x3b, 0x2f,
+ 0x41, 0x61, 0xbd, 0xca, 0x94, 0x62, 0x39, 0x3a, 0x83, 0xa5, 0x79, 0x83, 0x1a, 0x0b, 0xe1, 0xbe,
+ 0x34, 0x8f, 0x0b, 0xeb, 0x55, 0xba, 0xf4, 0x9d, 0xbb, 0xad, 0x80, 0x2c, 0xb9, 0x75, 0x22, 0xd2,
+ 0x4f, 0x64, 0x2e, 0xfd, 0x59, 0x89, 0x94, 0x5e, 0xfa, 0x0a, 0x84, 0x63, 0x52, 0x94, 0x6e, 0xcc,
+ 0x83, 0x4d, 0xe6, 0xd3, 0x55, 0xac, 0x56, 0x9a, 0x6e, 0x26, 0x17, 0xb6, 0x05, 0x23, 0xdb, 0x61,
+ 0x73, 0x93, 0xc8, 0x53, 0x91, 0xa9, 0xeb, 0x72, 0x22, 0x55, 0xdc, 0x10, 0x88, 0x6e, 0x10, 0xb5,
+ 0x9c, 0x7a, 0xea, 0x20, 0x67, 0xa2, 0x95, 0x1b, 0x3a, 0x31, 0x6c, 0xd2, 0xa6, 0x0b, 0xe1, 0x6d,
+ 0x1e, 0x4e, 0x8e, 0x29, 0xee, 0x72, 0x16, 0x42, 0x46, 0xc4, 0x39, 0xbe, 0x10, 0x04, 0x00, 0x4b,
+ 0x22, 0x6a, 0xb0, 0xd9, 0x05, 0x74, 0xac, 0xc3, 0x60, 0xa7, 0xfa, 0x1b, 0x0f, 0x36, 0xbb, 0x70,
+ 0x62, 0x52, 0xec, 0xa2, 0x69, 0x66, 0x24, 0xf0, 0x67, 0x6a, 0xbb, 0x9c, 0x8b, 0xa6, 0x53, 0xc2,
+ 0x7f, 0x7e, 0xd1, 0x64, 0x61, 0xe1, 0xcc, 0xb6, 0xe8, 0xc7, 0x35, 0x65, 0x64, 0x40, 0x91, 0x22,
+ 0xe3, 0x89, 0x9c, 0xc0, 0x9a, 0xe9, 0xf0, 0x81, 0xfc, 0xe3, 0x14, 0x08, 0xc7, 0xa4, 0x50, 0x0d,
+ 0x46, 0x9b, 0x46, 0xc4, 0x59, 0x96, 0xea, 0x23, 0x87, 0x2f, 0xc8, 0x8a, 0x4d, 0xcb, 0x25, 0x44,
+ 0x26, 0x04, 0x27, 0x68, 0x32, 0xcb, 0x3d, 0xee, 0xea, 0xc7, 0x32, 0x81, 0xe4, 0x4c, 0x75, 0x86,
+ 0x37, 0x20, 0x9f, 0x6a, 0x01, 0xc0, 0x92, 0x08, 0x1d, 0x0d, 0xe1, 0xa0, 0xe6, 0x87, 0x2c, 0xa1,
+ 0x4e, 0x9e, 0x82, 0x3d, 0x4b, 0x4d, 0x24, 0xc3, 0xac, 0x0b, 0x10, 0x8e, 0x49, 0xd1, 0x93, 0x9c,
+ 0x5e, 0x78, 0x27, 0xf3, 0x4f, 0xf2, 0xe4, 0x75, 0xc7, 0x4e, 0x72, 0x7a, 0xd9, 0x15, 0xc5, 0x55,
+ 0xa7, 0xa2, 0x82, 0xb3, 0x64, 0x20, 0x39, 0xfd, 0x52, 0x61, 0xc5, 0xd3, 0xfd, 0x52, 0x20, 0x1c,
+ 0x93, 0x62, 0x57, 0x31, 0x0b, 0x4d, 0x77, 0xba, 0xcd, 0x55, 0x4c, 0x11, 0x32, 0xae, 0x62, 0x2d,
+ 0x74, 0x9d, 0xfd, 0x83, 0x05, 0x38, 0xdd, 0x7e, 0xdf, 0xc6, 0x3a, 0xb4, 0x72, 0x6c, 0xb3, 0x94,
+ 0xd0, 0xa1, 0x71, 0x89, 0x4e, 0x8c, 0xd5, 0x75, 0xc0, 0xe1, 0x4b, 0x30, 0xa1, 0xdc, 0x11, 0xeb,
+ 0x6e, 0x75, 0x47, 0x4b, 0xce, 0xa9, 0x42, 0xf3, 0x54, 0x92, 0x08, 0x38, 0x5d, 0x07, 0xcd, 0xc2,
+ 0x98, 0x51, 0xb8, 0xbc, 0x20, 0x9e, 0xff, 0x71, 0x1a, 0x0b, 0x13, 0x8c, 0x93, 0xf8, 0xf6, 0xcf,
+ 0x5b, 0x70, 0x3c, 0x27, 0x0f, 0x7b, 0xd7, 0xf1, 0x74, 0xd7, 0x61, 0xac, 0x69, 0x56, 0xed, 0x10,
+ 0x02, 0xdc, 0xc8, 0xf6, 0xae, 0xfa, 0x9a, 0x00, 0xe0, 0x24, 0x51, 0xfb, 0x67, 0x0b, 0x70, 0xaa,
+ 0xad, 0x7d, 0x3d, 0xc2, 0x70, 0x6c, 0xa3, 0x11, 0x3a, 0xf3, 0x01, 0xa9, 0x11, 0x2f, 0x72, 0x9d,
+ 0x7a, 0xa5, 0x49, 0xaa, 0x9a, 0x16, 0x94, 0x19, 0xaa, 0x5f, 0x5a, 0xa9, 0xcc, 0xa6, 0x31, 0x70,
+ 0x4e, 0x4d, 0xb4, 0x04, 0x28, 0x0d, 0x11, 0x33, 0xcc, 0x9e, 0xb8, 0x69, 0x7a, 0x38, 0xa3, 0x06,
+ 0x7a, 0x11, 0x46, 0x94, 0xdd, 0xbe, 0x36, 0xe3, 0xec, 0x82, 0xc0, 0x3a, 0x00, 0x9b, 0x78, 0xe8,
+ 0x02, 0xcf, 0x6f, 0x24, 0x32, 0x61, 0x09, 0x95, 0xe9, 0x98, 0x4c, 0x5e, 0x24, 0x8a, 0xb1, 0x8e,
+ 0x33, 0x77, 0xf1, 0x77, 0xbe, 0x79, 0xfa, 0x03, 0xbf, 0xff, 0xcd, 0xd3, 0x1f, 0xf8, 0xc3, 0x6f,
+ 0x9e, 0xfe, 0xc0, 0xf7, 0xec, 0x9d, 0xb6, 0x7e, 0x67, 0xef, 0xb4, 0xf5, 0xfb, 0x7b, 0xa7, 0xad,
+ 0x3f, 0xdc, 0x3b, 0x6d, 0xfd, 0xd7, 0xbd, 0xd3, 0xd6, 0x17, 0xff, 0xe4, 0xf4, 0x07, 0xde, 0x44,
+ 0x71, 0x84, 0xea, 0xf3, 0x74, 0x76, 0xce, 0x6f, 0x5f, 0xf8, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff,
+ 0x67, 0xd5, 0x38, 0x2d, 0xc3, 0x23, 0x01, 0x00,
}
func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) {
@@ -8494,43 +8661,6 @@ func (m *CinderVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func (m *ClaimSource) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *ClaimSource) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ClaimSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.ResourceClaimTemplateName != nil {
- i -= len(*m.ResourceClaimTemplateName)
- copy(dAtA[i:], *m.ResourceClaimTemplateName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimTemplateName)))
- i--
- dAtA[i] = 0x12
- }
- if m.ResourceClaimName != nil {
- i -= len(*m.ResourceClaimName)
- copy(dAtA[i:], *m.ResourceClaimName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
func (m *ClientIPConfig) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -9753,6 +9883,32 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.AllocatedResourcesStatus) > 0 {
+ for iNdEx := len(m.AllocatedResourcesStatus) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.AllocatedResourcesStatus[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x72
+ }
+ }
+ if m.User != nil {
+ {
+ size, err := m.User.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x6a
+ }
if len(m.VolumeMounts) > 0 {
for iNdEx := len(m.VolumeMounts) - 1; iNdEx >= 0; iNdEx-- {
{
@@ -9872,6 +10028,41 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *ContainerUser) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ContainerUser) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ContainerUser) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Linux != nil {
+ {
+ size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
func (m *DaemonEndpoint) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -11972,6 +12163,39 @@ func (m *ISCSIVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *ImageVolumeSource) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ImageVolumeSource) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ImageVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.PullPolicy)
+ copy(dAtA[i:], m.PullPolicy)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.PullPolicy)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.Reference)
+ copy(dAtA[i:], m.Reference)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reference)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *KeyToPath) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -12428,6 +12652,42 @@ func (m *LimitRangeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *LinuxContainerUser) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *LinuxContainerUser) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *LinuxContainerUser) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.SupplementalGroups) > 0 {
+ for iNdEx := len(m.SupplementalGroups) - 1; iNdEx >= 0; iNdEx-- {
+ i = encodeVarintGenerated(dAtA, i, uint64(m.SupplementalGroups[iNdEx]))
+ i--
+ dAtA[i] = 0x18
+ }
+ }
+ i = encodeVarintGenerated(dAtA, i, uint64(m.GID))
+ i--
+ dAtA[i] = 0x10
+ i = encodeVarintGenerated(dAtA, i, uint64(m.UID))
+ i--
+ dAtA[i] = 0x8
+ return len(dAtA) - i, nil
+}
+
func (m *List) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -13260,6 +13520,39 @@ func (m *NodeDaemonEndpoints) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *NodeFeatures) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *NodeFeatures) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *NodeFeatures) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.SupplementalGroupsPolicy != nil {
+ i--
+ if *m.SupplementalGroupsPolicy {
+ dAtA[i] = 1
+ } else {
+ dAtA[i] = 0
+ }
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
func (m *NodeList) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -13395,6 +13688,16 @@ func (m *NodeRuntimeHandlerFeatures) MarshalToSizedBuffer(dAtA []byte) (int, err
_ = i
var l int
_ = l
+ if m.UserNamespaces != nil {
+ i--
+ if *m.UserNamespaces {
+ dAtA[i] = 1
+ } else {
+ dAtA[i] = 0
+ }
+ i--
+ dAtA[i] = 0x10
+ }
if m.RecursiveReadOnlyMounts != nil {
i--
if *m.RecursiveReadOnlyMounts {
@@ -13639,6 +13942,18 @@ func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.Features != nil {
+ {
+ size, err := m.Features.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x6a
+ }
if len(m.RuntimeHandlers) > 0 {
for iNdEx := len(m.RuntimeHandlers) - 1; iNdEx >= 0; iNdEx-- {
{
@@ -15902,16 +16217,20 @@ func (m *PodResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
- {
- size, err := m.Source.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ if m.ResourceClaimTemplateName != nil {
+ i -= len(*m.ResourceClaimTemplateName)
+ copy(dAtA[i:], *m.ResourceClaimTemplateName)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimTemplateName)))
+ i--
+ dAtA[i] = 0x22
+ }
+ if m.ResourceClaimName != nil {
+ i -= len(*m.ResourceClaimName)
+ copy(dAtA[i:], *m.ResourceClaimName)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName)))
+ i--
+ dAtA[i] = 0x1a
}
- i--
- dAtA[i] = 0x12
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
@@ -16003,6 +16322,13 @@ func (m *PodSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.SupplementalGroupsPolicy != nil {
+ i -= len(*m.SupplementalGroupsPolicy)
+ copy(dAtA[i:], *m.SupplementalGroupsPolicy)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.SupplementalGroupsPolicy)))
+ i--
+ dAtA[i] = 0x62
+ }
if m.AppArmorProfile != nil {
{
size, err := m.AppArmorProfile.MarshalToSizedBuffer(dAtA[:i])
@@ -17878,6 +18204,11 @@ func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ i -= len(m.Request)
+ copy(dAtA[i:], m.Request)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Request)))
+ i--
+ dAtA[i] = 0x12
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
@@ -17929,6 +18260,39 @@ func (m *ResourceFieldSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *ResourceHealth) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceHealth) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ResourceHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.Health)
+ copy(dAtA[i:], m.Health)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Health)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.ResourceID)
+ copy(dAtA[i:], m.ResourceID)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceID)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *ResourceQuota) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -18278,6 +18642,48 @@ func (m *ResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *ResourceStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceStatus) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ResourceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Resources) > 0 {
+ for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *SELinuxOptions) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -20738,6 +21144,20 @@ func (m *VolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.Image != nil {
+ {
+ size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1
+ i--
+ dAtA[i] = 0xf2
+ }
if m.Ephemeral != nil {
{
size, err := m.Ephemeral.MarshalToSizedBuffer(dAtA[:i])
@@ -21596,23 +22016,6 @@ func (m *CinderVolumeSource) Size() (n int) {
return n
}
-func (m *ClaimSource) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.ResourceClaimName != nil {
- l = len(*m.ResourceClaimName)
- n += 1 + l + sovGenerated(uint64(l))
- }
- if m.ResourceClaimTemplateName != nil {
- l = len(*m.ResourceClaimTemplateName)
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
func (m *ClientIPConfig) Size() (n int) {
if m == nil {
return 0
@@ -22097,6 +22500,29 @@ func (m *ContainerStatus) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
}
}
+ if m.User != nil {
+ l = m.User.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if len(m.AllocatedResourcesStatus) > 0 {
+ for _, e := range m.AllocatedResourcesStatus {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *ContainerUser) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Linux != nil {
+ l = m.Linux.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -22881,6 +23307,19 @@ func (m *ISCSIVolumeSource) Size() (n int) {
return n
}
+func (m *ImageVolumeSource) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Reference)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.PullPolicy)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
func (m *KeyToPath) Size() (n int) {
if m == nil {
return 0
@@ -23040,6 +23479,22 @@ func (m *LimitRangeSpec) Size() (n int) {
return n
}
+func (m *LinuxContainerUser) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ n += 1 + sovGenerated(uint64(m.UID))
+ n += 1 + sovGenerated(uint64(m.GID))
+ if len(m.SupplementalGroups) > 0 {
+ for _, e := range m.SupplementalGroups {
+ n += 1 + sovGenerated(uint64(e))
+ }
+ }
+ return n
+}
+
func (m *List) Size() (n int) {
if m == nil {
return 0
@@ -23346,6 +23801,18 @@ func (m *NodeDaemonEndpoints) Size() (n int) {
return n
}
+func (m *NodeFeatures) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.SupplementalGroupsPolicy != nil {
+ n += 2
+ }
+ return n
+}
+
func (m *NodeList) Size() (n int) {
if m == nil {
return 0
@@ -23398,6 +23865,9 @@ func (m *NodeRuntimeHandlerFeatures) Size() (n int) {
if m.RecursiveReadOnlyMounts != nil {
n += 2
}
+ if m.UserNamespaces != nil {
+ n += 2
+ }
return n
}
@@ -23558,6 +24028,10 @@ func (m *NodeStatus) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
}
}
+ if m.Features != nil {
+ l = m.Features.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -24321,8 +24795,14 @@ func (m *PodResourceClaim) Size() (n int) {
_ = l
l = len(m.Name)
n += 1 + l + sovGenerated(uint64(l))
- l = m.Source.Size()
- n += 1 + l + sovGenerated(uint64(l))
+ if m.ResourceClaimName != nil {
+ l = len(*m.ResourceClaimName)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.ResourceClaimTemplateName != nil {
+ l = len(*m.ResourceClaimTemplateName)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -24401,6 +24881,10 @@ func (m *PodSecurityContext) Size() (n int) {
l = m.AppArmorProfile.Size()
n += 1 + l + sovGenerated(uint64(l))
}
+ if m.SupplementalGroupsPolicy != nil {
+ l = len(*m.SupplementalGroupsPolicy)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -25040,6 +25524,8 @@ func (m *ResourceClaim) Size() (n int) {
_ = l
l = len(m.Name)
n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Request)
+ n += 1 + l + sovGenerated(uint64(l))
return n
}
@@ -25058,6 +25544,19 @@ func (m *ResourceFieldSelector) Size() (n int) {
return n
}
+func (m *ResourceHealth) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.ResourceID)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Health)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
func (m *ResourceQuota) Size() (n int) {
if m == nil {
return 0
@@ -25178,6 +25677,23 @@ func (m *ResourceRequirements) Size() (n int) {
return n
}
+func (m *ResourceStatus) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Resources) > 0 {
+ for _, e := range m.Resources {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
func (m *SELinuxOptions) Size() (n int) {
if m == nil {
return 0
@@ -26221,6 +26737,10 @@ func (m *VolumeSource) Size() (n int) {
l = m.Ephemeral.Size()
n += 2 + l + sovGenerated(uint64(l))
}
+ if m.Image != nil {
+ l = m.Image.Size()
+ n += 2 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -26516,17 +27036,6 @@ func (this *CinderVolumeSource) String() string {
}, "")
return s
}
-func (this *ClaimSource) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ClaimSource{`,
- `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`,
- `ResourceClaimTemplateName:` + valueToStringGenerated(this.ResourceClaimTemplateName) + `,`,
- `}`,
- }, "")
- return s
-}
func (this *ClientIPConfig) String() string {
if this == nil {
return "nil"
@@ -26874,6 +27383,11 @@ func (this *ContainerStatus) String() string {
repeatedStringForVolumeMounts += strings.Replace(strings.Replace(f.String(), "VolumeMountStatus", "VolumeMountStatus", 1), `&`, ``, 1) + ","
}
repeatedStringForVolumeMounts += "}"
+ repeatedStringForAllocatedResourcesStatus := "[]ResourceStatus{"
+ for _, f := range this.AllocatedResourcesStatus {
+ repeatedStringForAllocatedResourcesStatus += strings.Replace(strings.Replace(f.String(), "ResourceStatus", "ResourceStatus", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForAllocatedResourcesStatus += "}"
keysForAllocatedResources := make([]string, 0, len(this.AllocatedResources))
for k := range this.AllocatedResources {
keysForAllocatedResources = append(keysForAllocatedResources, string(k))
@@ -26897,6 +27411,18 @@ func (this *ContainerStatus) String() string {
`AllocatedResources:` + mapStringForAllocatedResources + `,`,
`Resources:` + strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1) + `,`,
`VolumeMounts:` + repeatedStringForVolumeMounts + `,`,
+ `User:` + strings.Replace(this.User.String(), "ContainerUser", "ContainerUser", 1) + `,`,
+ `AllocatedResourcesStatus:` + repeatedStringForAllocatedResourcesStatus + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ContainerUser) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ContainerUser{`,
+ `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerUser", "LinuxContainerUser", 1) + `,`,
`}`,
}, "")
return s
@@ -27480,6 +28006,17 @@ func (this *ISCSIVolumeSource) String() string {
}, "")
return s
}
+func (this *ImageVolumeSource) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ImageVolumeSource{`,
+ `Reference:` + fmt.Sprintf("%v", this.Reference) + `,`,
+ `PullPolicy:` + fmt.Sprintf("%v", this.PullPolicy) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *KeyToPath) String() string {
if this == nil {
return "nil"
@@ -27623,6 +28160,18 @@ func (this *LimitRangeSpec) String() string {
}, "")
return s
}
+func (this *LinuxContainerUser) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&LinuxContainerUser{`,
+ `UID:` + fmt.Sprintf("%v", this.UID) + `,`,
+ `GID:` + fmt.Sprintf("%v", this.GID) + `,`,
+ `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *List) String() string {
if this == nil {
return "nil"
@@ -27871,6 +28420,16 @@ func (this *NodeDaemonEndpoints) String() string {
}, "")
return s
}
+func (this *NodeFeatures) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&NodeFeatures{`,
+ `SupplementalGroupsPolicy:` + valueToStringGenerated(this.SupplementalGroupsPolicy) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *NodeList) String() string {
if this == nil {
return "nil"
@@ -27914,6 +28473,7 @@ func (this *NodeRuntimeHandlerFeatures) String() string {
}
s := strings.Join([]string{`&NodeRuntimeHandlerFeatures{`,
`RecursiveReadOnlyMounts:` + valueToStringGenerated(this.RecursiveReadOnlyMounts) + `,`,
+ `UserNamespaces:` + valueToStringGenerated(this.UserNamespaces) + `,`,
`}`,
}, "")
return s
@@ -28049,6 +28609,7 @@ func (this *NodeStatus) String() string {
`VolumesAttached:` + repeatedStringForVolumesAttached + `,`,
`Config:` + strings.Replace(this.Config.String(), "NodeConfigStatus", "NodeConfigStatus", 1) + `,`,
`RuntimeHandlers:` + repeatedStringForRuntimeHandlers + `,`,
+ `Features:` + strings.Replace(this.Features.String(), "NodeFeatures", "NodeFeatures", 1) + `,`,
`}`,
}, "")
return s
@@ -28577,7 +29138,8 @@ func (this *PodResourceClaim) String() string {
}
s := strings.Join([]string{`&PodResourceClaim{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Source:` + strings.Replace(strings.Replace(this.Source.String(), "ClaimSource", "ClaimSource", 1), `&`, ``, 1) + `,`,
+ `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`,
+ `ResourceClaimTemplateName:` + valueToStringGenerated(this.ResourceClaimTemplateName) + `,`,
`}`,
}, "")
return s
@@ -28624,6 +29186,7 @@ func (this *PodSecurityContext) String() string {
`FSGroupChangePolicy:` + valueToStringGenerated(this.FSGroupChangePolicy) + `,`,
`SeccompProfile:` + strings.Replace(this.SeccompProfile.String(), "SeccompProfile", "SeccompProfile", 1) + `,`,
`AppArmorProfile:` + strings.Replace(this.AppArmorProfile.String(), "AppArmorProfile", "AppArmorProfile", 1) + `,`,
+ `SupplementalGroupsPolicy:` + valueToStringGenerated(this.SupplementalGroupsPolicy) + `,`,
`}`,
}, "")
return s
@@ -29125,6 +29688,7 @@ func (this *ResourceClaim) String() string {
}
s := strings.Join([]string{`&ResourceClaim{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Request:` + fmt.Sprintf("%v", this.Request) + `,`,
`}`,
}, "")
return s
@@ -29141,6 +29705,17 @@ func (this *ResourceFieldSelector) String() string {
}, "")
return s
}
+func (this *ResourceHealth) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ResourceHealth{`,
+ `ResourceID:` + fmt.Sprintf("%v", this.ResourceID) + `,`,
+ `Health:` + fmt.Sprintf("%v", this.Health) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *ResourceQuota) String() string {
if this == nil {
return "nil"
@@ -29259,6 +29834,22 @@ func (this *ResourceRequirements) String() string {
}, "")
return s
}
+func (this *ResourceStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForResources := "[]ResourceHealth{"
+ for _, f := range this.Resources {
+ repeatedStringForResources += strings.Replace(strings.Replace(f.String(), "ResourceHealth", "ResourceHealth", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForResources += "}"
+ s := strings.Join([]string{`&ResourceStatus{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Resources:` + repeatedStringForResources + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *SELinuxOptions) String() string {
if this == nil {
return "nil"
@@ -29967,6 +30558,7 @@ func (this *VolumeSource) String() string {
`StorageOS:` + strings.Replace(this.StorageOS.String(), "StorageOSVolumeSource", "StorageOSVolumeSource", 1) + `,`,
`CSI:` + strings.Replace(this.CSI.String(), "CSIVolumeSource", "CSIVolumeSource", 1) + `,`,
`Ephemeral:` + strings.Replace(this.Ephemeral.String(), "EphemeralVolumeSource", "EphemeralVolumeSource", 1) + `,`,
+ `Image:` + strings.Replace(this.Image.String(), "ImageVolumeSource", "ImageVolumeSource", 1) + `,`,
`}`,
}, "")
return s
@@ -32985,122 +33577,6 @@ func (m *CinderVolumeSource) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ClaimSource) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: ClaimSource: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ClaimSource: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- s := string(dAtA[iNdEx:postIndex])
- m.ResourceClaimName = &s
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- s := string(dAtA[iNdEx:postIndex])
- m.ResourceClaimTemplateName = &s
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
func (m *ClientIPConfig) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -37312,6 +37788,162 @@ func (m *ContainerStatus) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 13:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field User", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.User == nil {
+ m.User = &ContainerUser{}
+ }
+ if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 14:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AllocatedResourcesStatus", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.AllocatedResourcesStatus = append(m.AllocatedResourcesStatus, ResourceStatus{})
+ if err := m.AllocatedResourcesStatus[len(m.AllocatedResourcesStatus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ContainerUser) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ContainerUser: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ContainerUser: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Linux == nil {
+ m.Linux = &LinuxContainerUser{}
+ }
+ if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -43256,11 +43888,369 @@ func (m *HostPathVolumeSource) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Path = string(dAtA[iNdEx:postIndex])
+ m.Path = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := HostPathType(dAtA[iNdEx:postIndex])
+ m.Type = &s
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ISCSIPersistentVolumeSource) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ISCSIPersistentVolumeSource: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ISCSIPersistentVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field TargetPortal", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.TargetPortal = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field IQN", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.IQN = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Lun", wireType)
+ }
+ m.Lun = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Lun |= int32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ISCSIInterface", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ISCSIInterface = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field FSType", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.FSType = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 6:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.ReadOnly = bool(v != 0)
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Portals", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Portals = append(m.Portals, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
- case 2:
+ case 8:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DiscoveryCHAPAuth", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.DiscoveryCHAPAuth = bool(v != 0)
+ case 10:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field SecretRef", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.SecretRef == nil {
+ m.SecretRef = &SecretReference{}
+ }
+ if err := m.SecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 11:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SessionCHAPAuth", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.SessionCHAPAuth = bool(v != 0)
+ case 12:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field InitiatorName", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -43288,8 +44278,8 @@ func (m *HostPathVolumeSource) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- s := HostPathType(dAtA[iNdEx:postIndex])
- m.Type = &s
+ s := string(dAtA[iNdEx:postIndex])
+ m.InitiatorName = &s
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -43312,7 +44302,7 @@ func (m *HostPathVolumeSource) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ISCSIPersistentVolumeSource) Unmarshal(dAtA []byte) error {
+func (m *ISCSIVolumeSource) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -43335,10 +44325,10 @@ func (m *ISCSIPersistentVolumeSource) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ISCSIPersistentVolumeSource: wiretype end group for non-group")
+ return fmt.Errorf("proto: ISCSIVolumeSource: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ISCSIPersistentVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ISCSIVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@@ -43590,7 +44580,7 @@ func (m *ISCSIPersistentVolumeSource) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.SecretRef == nil {
- m.SecretRef = &SecretReference{}
+ m.SecretRef = &LocalObjectReference{}
}
if err := m.SecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@@ -43670,7 +44660,7 @@ func (m *ISCSIPersistentVolumeSource) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ISCSIVolumeSource) Unmarshal(dAtA []byte) error {
+func (m *ImageVolumeSource) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -43693,182 +44683,15 @@ func (m *ISCSIVolumeSource) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ISCSIVolumeSource: wiretype end group for non-group")
+ return fmt.Errorf("proto: ImageVolumeSource: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ISCSIVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ImageVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field TargetPortal", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.TargetPortal = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IQN", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IQN = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Lun", wireType)
- }
- m.Lun = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Lun |= int32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ISCSIInterface", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ISCSIInterface = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field FSType", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.FSType = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.ReadOnly = bool(v != 0)
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Portals", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Reference", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -43896,87 +44719,11 @@ func (m *ISCSIVolumeSource) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Portals = append(m.Portals, string(dAtA[iNdEx:postIndex]))
+ m.Reference = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 8:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field DiscoveryCHAPAuth", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.DiscoveryCHAPAuth = bool(v != 0)
- case 10:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SecretRef", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.SecretRef == nil {
- m.SecretRef = &LocalObjectReference{}
- }
- if err := m.SecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 11:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SessionCHAPAuth", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.SessionCHAPAuth = bool(v != 0)
- case 12:
+ case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field InitiatorName", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field PullPolicy", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -44004,8 +44751,7 @@ func (m *ISCSIVolumeSource) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- s := string(dAtA[iNdEx:postIndex])
- m.InitiatorName = &s
+ m.PullPolicy = PullPolicy(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -45344,17 +46090,218 @@ func (m *LimitRangeList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: LimitRangeList: wiretype end group for non-group")
+ return fmt.Errorf("proto: LimitRangeList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: LimitRangeList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, LimitRange{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *LimitRangeSpec) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: LimitRangeSpec: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: LimitRangeSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Limits = append(m.Limits, LimitRangeItem{})
+ if err := m.Limits[len(m.Limits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *LinuxContainerUser) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: LinuxContainerUser: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: LimitRangeList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: LinuxContainerUser: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType)
}
- var msglen int
+ m.UID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -45364,30 +46311,16 @@ func (m *LimitRangeList) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ m.UID |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field GID", wireType)
}
- var msglen int
+ m.GID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -45397,110 +46330,87 @@ func (m *LimitRangeList) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ m.GID |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Items = append(m.Items, LimitRange{})
- if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *LimitRangeSpec) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: LimitRangeSpec: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: LimitRangeSpec: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
+ case 3:
+ if wireType == 0 {
+ var v int64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
}
- if iNdEx >= l {
+ m.SupplementalGroups = append(m.SupplementalGroups, v)
+ } else if wireType == 2 {
+ var packedLen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ packedLen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if packedLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + packedLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
return io.ErrUnexpectedEOF
}
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
+ var elementCount int
+ var count int
+ for _, integer := range dAtA[iNdEx:postIndex] {
+ if integer < 128 {
+ count++
+ }
}
+ elementCount = count
+ if elementCount != 0 && len(m.SupplementalGroups) == 0 {
+ m.SupplementalGroups = make([]int64, 0, elementCount)
+ }
+ for iNdEx < postIndex {
+ var v int64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.SupplementalGroups = append(m.SupplementalGroups, v)
+ }
+ } else {
+ return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType)
}
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Limits = append(m.Limits, LimitRangeItem{})
- if err := m.Limits[len(m.Limits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -47950,17 +48860,100 @@ func (m *NodeDaemonEndpoints) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: NodeDaemonEndpoints: wiretype end group for non-group")
+ return fmt.Errorf("proto: NodeDaemonEndpoints: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: NodeDaemonEndpoints: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field KubeletEndpoint", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.KubeletEndpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *NodeFeatures) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: NodeFeatures: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: NodeDaemonEndpoints: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: NodeFeatures: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field KubeletEndpoint", wireType)
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroupsPolicy", wireType)
}
- var msglen int
+ var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -47970,25 +48963,13 @@ func (m *NodeDaemonEndpoints) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.KubeletEndpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
+ b := bool(v != 0)
+ m.SupplementalGroupsPolicy = &b
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -48377,6 +49358,27 @@ func (m *NodeRuntimeHandlerFeatures) Unmarshal(dAtA []byte) error {
}
b := bool(v != 0)
m.RecursiveReadOnlyMounts = &b
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field UserNamespaces", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ b := bool(v != 0)
+ m.UserNamespaces = &b
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -49637,6 +50639,42 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 13:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Features", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Features == nil {
+ m.Features = &NodeFeatures{}
+ }
+ if err := m.Features.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -56370,11 +57408,11 @@ func (m *PodResourceClaim) Unmarshal(dAtA []byte) error {
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 2:
+ case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -56384,24 +57422,57 @@ func (m *PodResourceClaim) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
+ s := string(dAtA[iNdEx:postIndex])
+ m.ResourceClaimName = &s
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType)
}
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := string(dAtA[iNdEx:postIndex])
+ m.ResourceClaimTemplateName = &s
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -57018,6 +58089,39 @@ func (m *PodSecurityContext) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 12:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroupsPolicy", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := SupplementalGroupsPolicy(dAtA[iNdEx:postIndex])
+ m.SupplementalGroupsPolicy = &s
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -62585,7 +63689,121 @@ func (m *ReplicationControllerStatus) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ResourceClaim: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Request = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -62608,15 +63826,15 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaim: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceFieldSelector: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceFieldSelector: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ContainerName", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -62644,7 +63862,72 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Name = string(dAtA[iNdEx:postIndex])
+ m.ContainerName = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Resource = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Divisor", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Divisor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -62667,7 +63950,7 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error {
+func (m *ResourceHealth) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -62690,15 +63973,15 @@ func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceFieldSelector: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceHealth: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceFieldSelector: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceHealth: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerName", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ResourceID", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -62726,11 +64009,11 @@ func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.ContainerName = string(dAtA[iNdEx:postIndex])
+ m.ResourceID = ResourceID(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -62758,40 +64041,7 @@ func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Resource = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Divisor", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Divisor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Health = ResourceHealthStatus(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -63977,6 +65227,122 @@ func (m *ResourceRequirements) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *ResourceStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ResourceStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ResourceStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = ResourceName(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Resources = append(m.Resources, ResourceHealth{})
+ if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *SELinuxOptions) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -73029,6 +74395,42 @@ func (m *VolumeSource) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 30:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Image == nil {
+ m.Image = &ImageVolumeSource{}
+ }
+ if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
diff --git a/vendor/k8s.io/api/core/v1/generated.proto b/vendor/k8s.io/api/core/v1/generated.proto
index f3b47c722d1..68ac80ed0b1 100644
--- a/vendor/k8s.io/api/core/v1/generated.proto
+++ b/vendor/k8s.io/api/core/v1/generated.proto
@@ -126,20 +126,24 @@ message AzureDiskVolumeSource {
// cachingMode is the Host Caching mode: None, Read Only, Read Write.
// +optional
+ // +default=ref(AzureDataDiskCachingReadWrite)
optional string cachingMode = 3;
// fsType is Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// +optional
+ // +default="ext4"
optional string fsType = 4;
// readOnly Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
+ // +default=false
optional bool readOnly = 5;
// kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
+ // +default=ref(AzureSharedBlobDisk)
optional string kind = 6;
}
@@ -182,7 +186,7 @@ message Binding {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The target object that you want to bind to the standard object.
optional ObjectReference target = 2;
@@ -422,30 +426,6 @@ message CinderVolumeSource {
optional LocalObjectReference secretRef = 4;
}
-// ClaimSource describes a reference to a ResourceClaim.
-//
-// Exactly one of these fields should be set. Consumers of this type must
-// treat an empty object as if it has an unknown value.
-message ClaimSource {
- // ResourceClaimName is the name of a ResourceClaim object in the same
- // namespace as this pod.
- optional string resourceClaimName = 1;
-
- // ResourceClaimTemplateName is the name of a ResourceClaimTemplate
- // object in the same namespace as this pod.
- //
- // The template will be used to create a new ResourceClaim, which will
- // be bound to this pod. When this pod is deleted, the ResourceClaim
- // will also be deleted. The pod name and resource name, along with a
- // generated component, will be used to form a unique name for the
- // ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
- //
- // This field is immutable and no changes will be made to the
- // corresponding ResourceClaim by the control plane after creating the
- // ResourceClaim.
- optional string resourceClaimTemplateName = 2;
-}
-
// ClientIPConfig represents the configurations of Client IP based session affinity.
message ClientIPConfig {
// timeoutSeconds specifies the seconds of ClientIP type session sticky time.
@@ -475,7 +455,7 @@ message ClusterTrustBundleProjection {
// interpreted as "match nothing". If set but empty, interpreted as "match
// everything".
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 3;
// If true, don't block pod startup if the referenced ClusterTrustBundle(s)
// aren't available. If using name, then the named ClusterTrustBundle is
@@ -516,7 +496,7 @@ message ComponentStatus {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// List of component conditions observed
// +optional
@@ -533,7 +513,7 @@ message ComponentStatusList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ComponentStatus objects.
repeated ComponentStatus items = 2;
@@ -544,7 +524,7 @@ message ConfigMap {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Immutable, if set to true, ensures that data stored in the ConfigMap cannot
// be updated (only object metadata can be modified).
@@ -604,7 +584,7 @@ message ConfigMapKeySelector {
message ConfigMapList {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of ConfigMaps.
repeated ConfigMap items = 2;
@@ -984,7 +964,7 @@ message ContainerState {
message ContainerStateRunning {
// Time at which the container was last (re-)started
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startedAt = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time startedAt = 1;
}
// ContainerStateTerminated is a terminated state of a container.
@@ -1006,11 +986,11 @@ message ContainerStateTerminated {
// Time at which previous execution of the container started
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startedAt = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time startedAt = 5;
// Time at which the container last terminated
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time finishedAt = 6;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time finishedAt = 6;
// Container's ID in the format '://'
// +optional
@@ -1093,7 +1073,7 @@ message ContainerStatus {
// and after successfully admitting desired pod resize.
// +featureGate=InPlacePodVerticalScaling
// +optional
- map allocatedResources = 10;
+ map allocatedResources = 10;
// Resources represents the compute resource requests and limits that have been successfully
// enacted on the running container after it has been started or has been successfully resized.
@@ -1109,6 +1089,29 @@ message ContainerStatus {
// +listMapKey=mountPath
// +featureGate=RecursiveReadOnlyMounts
repeated VolumeMountStatus volumeMounts = 12;
+
+ // User represents user identity information initially attached to the first process of the container
+ // +featureGate=SupplementalGroupsPolicy
+ // +optional
+ optional ContainerUser user = 13;
+
+ // AllocatedResourcesStatus represents the status of various resources
+ // allocated for this Pod.
+ // +featureGate=ResourceHealthStatus
+ // +optional
+ // +patchMergeKey=name
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=name
+ repeated ResourceStatus allocatedResourcesStatus = 14;
+}
+
+// ContainerUser represents user identity information
+message ContainerUser {
+ // Linux holds user identity information initially attached to the first process of the containers in Linux.
+ // Note that the actual running identity can be changed if the process has enough privilege to do so.
+ // +optional
+ optional LinuxContainerUser linux = 1;
}
// DaemonEndpoint contains information about a single Daemon endpoint.
@@ -1188,7 +1191,7 @@ message EmptyDirVolumeSource {
// The default is nil which means that the limit is undefined.
// More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity sizeLimit = 2;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity sizeLimit = 2;
}
// EndpointAddress is a tuple that describes single IP address.
@@ -1300,7 +1303,7 @@ message Endpoints {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The set of all endpoints is the union of all subsets. Addresses are placed into
// subsets according to the IPs they share. A single address with multiple ports,
@@ -1319,7 +1322,7 @@ message EndpointsList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of endpoints.
repeated Endpoints items = 2;
@@ -1622,7 +1625,7 @@ message EphemeralVolumeSource {
message Event {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The object that this event is about.
optional ObjectReference involvedObject = 2;
@@ -1644,11 +1647,11 @@ message Event {
// The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time firstTimestamp = 6;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time firstTimestamp = 6;
// The time at which the most recent occurrence of this event was recorded.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTimestamp = 7;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTimestamp = 7;
// The number of times this event has occurred.
// +optional
@@ -1660,7 +1663,7 @@ message Event {
// Time when this Event was first observed.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 10;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 10;
// Data about the Event series this event represents or nil if it's a singleton Event.
// +optional
@@ -1688,7 +1691,7 @@ message EventList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of events
repeated Event items = 2;
@@ -1701,7 +1704,7 @@ message EventSeries {
optional int32 count = 1;
// Time of the last occurrence observed
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2;
}
// EventSource contains information for an event.
@@ -1954,7 +1957,7 @@ message HTTPGetAction {
// Name or number of the port to access on the container.
// Number must be in the range 1 to 65535.
// Name must be an IANA_SVC_NAME.
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
// Host name to connect to, defaults to the pod IP. You probably want to set
// "Host" in httpHeaders instead.
@@ -1997,6 +2000,7 @@ message HostAlias {
// HostIP represents a single IP address allocated to the host.
message HostIP {
// IP is the IP address assigned to the host
+ // +required
optional string ip = 1;
}
@@ -2032,6 +2036,7 @@ message ISCSIPersistentVolumeSource {
// iscsiInterface is the interface Name that uses an iSCSI transport.
// Defaults to 'default' (tcp).
// +optional
+ // +default="default"
optional string iscsiInterface = 4;
// fsType is the filesystem type of the volume that you want to mount.
@@ -2089,6 +2094,7 @@ message ISCSIVolumeSource {
// iscsiInterface is the interface Name that uses an iSCSI transport.
// Defaults to 'default' (tcp).
// +optional
+ // +default="default"
optional string iscsiInterface = 4;
// fsType is the filesystem type of the volume that you want to mount.
@@ -2129,6 +2135,26 @@ message ISCSIVolumeSource {
optional string initiatorName = 12;
}
+// ImageVolumeSource represents a image volume resource.
+message ImageVolumeSource {
+ // Required: Image or artifact reference to be used.
+ // Behaves in the same way as pod.spec.containers[*].image.
+ // Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ // More info: https://kubernetes.io/docs/concepts/containers/images
+ // This field is optional to allow higher level config management to default or override
+ // container images in workload controllers like Deployments and StatefulSets.
+ // +optional
+ optional string reference = 1;
+
+ // Policy for pulling OCI objects. Possible values are:
+ // Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ // Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ // IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ // +optional
+ optional string pullPolicy = 2;
+}
+
// Maps a string key to a path within a volume.
message KeyToPath {
// key is the key to project.
@@ -2202,7 +2228,7 @@ message LimitRange {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the limits enforced.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -2217,23 +2243,23 @@ message LimitRangeItem {
// Max usage constraints on this kind by resource name.
// +optional
- map max = 2;
+ map max = 2;
// Min usage constraints on this kind by resource name.
// +optional
- map min = 3;
+ map min = 3;
// Default resource requirement limit value by resource name if resource limit is omitted.
// +optional
- map default = 4;
+ map default = 4;
// DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.
// +optional
- map defaultRequest = 5;
+ map defaultRequest = 5;
// MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.
// +optional
- map maxLimitRequestRatio = 6;
+ map maxLimitRequestRatio = 6;
}
// LimitRangeList is a list of LimitRange items.
@@ -2241,7 +2267,7 @@ message LimitRangeList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of LimitRange objects.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
@@ -2255,15 +2281,29 @@ message LimitRangeSpec {
repeated LimitRangeItem limits = 1;
}
+// LinuxContainerUser represents user identity information in Linux containers
+message LinuxContainerUser {
+ // UID is the primary uid initially attached to the first process in the container
+ optional int64 uid = 1;
+
+ // GID is the primary gid initially attached to the first process in the container
+ optional int64 gid = 2;
+
+ // SupplementalGroups are the supplemental groups initially attached to the first process in the container
+ // +optional
+ // +listType=atomic
+ repeated int64 supplementalGroups = 3;
+}
+
// List holds a list of objects, which may not be known by the server.
message List {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of objects
- repeated k8s.io.apimachinery.pkg.runtime.RawExtension items = 2;
+ repeated .k8s.io.apimachinery.pkg.runtime.RawExtension items = 2;
}
// LoadBalancerIngress represents the status of a load-balancer ingress point:
@@ -2377,7 +2417,7 @@ message Namespace {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of the Namespace.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -2399,7 +2439,7 @@ message NamespaceCondition {
optional string status = 2;
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// +optional
optional string reason = 5;
@@ -2413,7 +2453,7 @@ message NamespaceList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of Namespace objects in the list.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
@@ -2451,7 +2491,7 @@ message Node {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of a node.
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -2509,11 +2549,11 @@ message NodeCondition {
// Last time we got an update on a given condition.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastHeartbeatTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastHeartbeatTime = 3;
// Last time the condition transit from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
// +optional
@@ -2588,12 +2628,21 @@ message NodeDaemonEndpoints {
optional DaemonEndpoint kubeletEndpoint = 1;
}
+// NodeFeatures describes the set of features implemented by the CRI implementation.
+// The features contained in the NodeFeatures should depend only on the cri implementation
+// independent of runtime handlers.
+message NodeFeatures {
+ // SupplementalGroupsPolicy is set to true if the runtime supports SupplementalGroupsPolicy and ContainerUser.
+ // +optional
+ optional bool supplementalGroupsPolicy = 1;
+}
+
// NodeList is the whole list of all Nodes which have been registered with master.
message NodeList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of nodes
repeated Node items = 2;
@@ -2618,12 +2667,17 @@ message NodeRuntimeHandler {
optional NodeRuntimeHandlerFeatures features = 2;
}
-// NodeRuntimeHandlerFeatures is a set of runtime features.
+// NodeRuntimeHandlerFeatures is a set of features implemented by the runtime handler.
message NodeRuntimeHandlerFeatures {
// RecursiveReadOnlyMounts is set to true if the runtime handler supports RecursiveReadOnlyMounts.
// +featureGate=RecursiveReadOnlyMounts
// +optional
optional bool recursiveReadOnlyMounts = 1;
+
+ // UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.
+ // +featureGate=UserNamespacesSupport
+ // +optional
+ optional bool userNamespaces = 2;
}
// A node selector represents the union of the results of one or more label queries
@@ -2713,14 +2767,14 @@ message NodeSpec {
// NodeStatus is information about the current status of a node.
message NodeStatus {
// Capacity represents the total resources of a node.
- // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
+ // More info: https://kubernetes.io/docs/reference/node/node-status/#capacity
// +optional
- map capacity = 1;
+ map capacity = 1;
// Allocatable represents the resources of a node that are available for scheduling.
// Defaults to Capacity.
// +optional
- map allocatable = 2;
+ map allocatable = 2;
// NodePhase is the recently observed lifecycle phase of the node.
// More info: https://kubernetes.io/docs/concepts/nodes/node/#phase
@@ -2784,9 +2838,15 @@ message NodeStatus {
// The available runtime handlers.
// +featureGate=RecursiveReadOnlyMounts
+ // +featureGate=UserNamespacesSupport
// +optional
// +listType=atomic
repeated NodeRuntimeHandler runtimeHandlers = 12;
+
+ // Features describes the set of features implemented by the CRI implementation.
+ // +featureGate=SupplementalGroupsPolicy
+ // +optional
+ optional NodeFeatures features = 13;
}
// NodeSystemInfo is a set of ids/uuids to uniquely identify the node.
@@ -2816,7 +2876,7 @@ message NodeSystemInfo {
// Kubelet Version reported by the node.
optional string kubeletVersion = 7;
- // KubeProxy Version reported by the node.
+ // Deprecated: KubeProxy Version reported by the node.
optional string kubeProxyVersion = 8;
// The Operating System reported by the node
@@ -2904,7 +2964,7 @@ message PersistentVolume {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec defines a specification of a persistent volume owned by the cluster.
// Provisioned by an administrator.
@@ -2925,7 +2985,7 @@ message PersistentVolumeClaim {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec defines the desired characteristics of a volume requested by a pod author.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
@@ -2947,11 +3007,11 @@ message PersistentVolumeClaimCondition {
// lastProbeTime is the time we probed the condition.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
// lastTransitionTime is the time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// reason is a unique, this should be a short, machine understandable string that gives the reason
// for condition's last transition. If it reports "Resizing" that means the underlying
@@ -2969,7 +3029,7 @@ message PersistentVolumeClaimList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of persistent volume claims.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
@@ -2987,7 +3047,7 @@ message PersistentVolumeClaimSpec {
// selector is a label query over volumes to consider for binding.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
// resources represents the minimum resources the volume should have.
// If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
@@ -3059,7 +3119,7 @@ message PersistentVolumeClaimSpec {
// set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
// exists.
// More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- // (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ // (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
// +featureGate=VolumeAttributesClass
// +optional
optional string volumeAttributesClassName = 9;
@@ -3079,7 +3139,7 @@ message PersistentVolumeClaimStatus {
// capacity represents the actual resources of the underlying volume.
// +optional
- map capacity = 3;
+ map capacity = 3;
// conditions is the current Condition of persistent volume claim. If underlying persistent volume is being
// resized then the Condition will be set to 'Resizing'.
@@ -3114,7 +3174,7 @@ message PersistentVolumeClaimStatus {
// This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
// +featureGate=RecoverVolumeExpansionFailure
// +optional
- map allocatedResources = 5;
+ map allocatedResources = 5;
// allocatedResourceStatuses stores status of resource being resized for the given PVC.
// Key names follow standard Kubernetes label syntax. Valid values are either:
@@ -3158,14 +3218,14 @@ message PersistentVolumeClaimStatus {
// currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using.
// When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim
- // This is an alpha field and requires enabling VolumeAttributesClass feature.
+ // This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
// +featureGate=VolumeAttributesClass
// +optional
optional string currentVolumeAttributesClassName = 8;
// ModifyVolumeStatus represents the status object of ControllerModifyVolume operation.
// When this is unset, there is no ModifyVolume operation being attempted.
- // This is an alpha field and requires enabling VolumeAttributesClass feature.
+ // This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
// +featureGate=VolumeAttributesClass
// +optional
optional ModifyVolumeStatus modifyVolumeStatus = 9;
@@ -3179,7 +3239,7 @@ message PersistentVolumeClaimTemplate {
// validation.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The specification for the PersistentVolumeClaim. The entire content is
// copied unchanged into the PVC that gets created from this
@@ -3208,7 +3268,7 @@ message PersistentVolumeList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of persistent volumes.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes
@@ -3327,7 +3387,7 @@ message PersistentVolumeSpec {
// capacity is the description of the persistent volume's resources and capacity.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
// +optional
- map capacity = 1;
+ map capacity = 1;
// persistentVolumeSource is the actual volume backing the persistent volume.
optional PersistentVolumeSource persistentVolumeSource = 2;
@@ -3382,7 +3442,7 @@ message PersistentVolumeSpec {
// after a volume has been updated successfully to a new class.
// For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound
// PersistentVolumeClaims during the binding process.
- // This is an alpha field and requires enabling VolumeAttributesClass feature.
+ // This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
// +featureGate=VolumeAttributesClass
// +optional
optional string volumeAttributesClassName = 10;
@@ -3406,10 +3466,8 @@ message PersistentVolumeStatus {
// lastPhaseTransitionTime is the time the phase transitioned from one to another
// and automatically resets to current time everytime a volume phase transitions.
- // This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).
- // +featureGate=PersistentVolumeLastPhaseTransitionTime
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastPhaseTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastPhaseTransitionTime = 4;
}
// Represents a Photon Controller persistent disk resource.
@@ -3429,7 +3487,7 @@ message Pod {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the pod.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -3482,7 +3540,7 @@ message PodAffinityTerm {
// A label query over a set of resources, in this case pods.
// If it's null, this PodAffinityTerm matches with no Pods.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 1;
// namespaces specifies a static list of namespace names that the term applies to.
// The term is applied to the union of the namespaces listed in this field
@@ -3505,7 +3563,7 @@ message PodAffinityTerm {
// null selector and null or empty namespaces list means "this pod's namespace".
// An empty selector ({}) matches all namespaces.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 4;
// MatchLabelKeys is a set of pod label keys to select which pods will
// be taken into consideration. The keys are used to lookup values from the
@@ -3515,7 +3573,8 @@ message PodAffinityTerm {
// pod labels will be ignored. The default value is empty.
// The same key is forbidden to exist in both matchLabelKeys and labelSelector.
// Also, matchLabelKeys cannot be set when labelSelector isn't set.
- // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
+ //
// +listType=atomic
// +optional
repeated string matchLabelKeys = 5;
@@ -3528,7 +3587,8 @@ message PodAffinityTerm {
// pod labels will be ignored. The default value is empty.
// The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
// Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
+ //
// +listType=atomic
// +optional
repeated string mismatchLabelKeys = 6;
@@ -3607,11 +3667,11 @@ message PodCondition {
// Last time we probed the condition.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
// Last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// Unique, one-word, CamelCase reason for the condition's last transition.
// +optional
@@ -3693,6 +3753,7 @@ message PodExecOptions {
// PodIP represents a single IP address allocated to the pod.
message PodIP {
// IP is the IP address assigned to the pod
+ // +required
optional string ip = 1;
}
@@ -3701,7 +3762,7 @@ message PodList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of pods.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md
@@ -3734,7 +3795,7 @@ message PodLogOptions {
// If this value is in the future, no logs will be returned.
// Only one of sinceSeconds or sinceTime may be specified.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time sinceTime = 5;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time sinceTime = 5;
// If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
// of log output. Defaults to false.
@@ -3798,7 +3859,10 @@ message PodReadinessGate {
optional string conditionType = 1;
}
-// PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+// PodResourceClaim references exactly one ResourceClaim, either directly
+// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+// for the pod.
+//
// It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
// Containers that need access to the ResourceClaim reference it with this name.
message PodResourceClaim {
@@ -3806,8 +3870,29 @@ message PodResourceClaim {
// This must be a DNS_LABEL.
optional string name = 1;
- // Source describes where to find the ResourceClaim.
- optional ClaimSource source = 2;
+ // ResourceClaimName is the name of a ResourceClaim object in the same
+ // namespace as this pod.
+ //
+ // Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ // be set.
+ optional string resourceClaimName = 3;
+
+ // ResourceClaimTemplateName is the name of a ResourceClaimTemplate
+ // object in the same namespace as this pod.
+ //
+ // The template will be used to create a new ResourceClaim, which will
+ // be bound to this pod. When this pod is deleted, the ResourceClaim
+ // will also be deleted. The pod name and resource name, along with a
+ // generated component, will be used to form a unique name for the
+ // ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
+ //
+ // This field is immutable and no changes will be made to the
+ // corresponding ResourceClaim by the control plane after creating the
+ // ResourceClaim.
+ //
+ // Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ // be set.
+ optional string resourceClaimTemplateName = 4;
}
// PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim
@@ -3820,7 +3905,7 @@ message PodResourceClaimStatus {
optional string name = 1;
// ResourceClaimName is the name of the ResourceClaim that was
- // generated for the Pod in the namespace of the Pod. It this is
+ // generated for the Pod in the namespace of the Pod. If this is
// unset, then generating a ResourceClaim was not necessary. The
// pod.spec.resourceClaims entry can be ignored in this case.
//
@@ -3882,17 +3967,29 @@ message PodSecurityContext {
// +optional
optional bool runAsNonRoot = 3;
- // A list of groups applied to the first process run in each container, in addition
- // to the container's primary GID, the fsGroup (if specified), and group memberships
- // defined in the container image for the uid of the container process. If unspecified,
- // no additional groups are added to any container. Note that group memberships
- // defined in the container image for the uid of the container process are still effective,
- // even if they are not included in this list.
+ // A list of groups applied to the first process run in each container, in
+ // addition to the container's primary GID and fsGroup (if specified). If
+ // the SupplementalGroupsPolicy feature is enabled, the
+ // supplementalGroupsPolicy field determines whether these are in addition
+ // to or instead of any group memberships defined in the container image.
+ // If unspecified, no additional groups are added, though group memberships
+ // defined in the container image may still be used, depending on the
+ // supplementalGroupsPolicy field.
// Note that this field cannot be set when spec.os.name is windows.
// +optional
// +listType=atomic
repeated int64 supplementalGroups = 4;
+ // Defines how supplemental groups of the first container processes are calculated.
+ // Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ // (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ // and the container runtime must implement support for this feature.
+ // Note that this field cannot be set when spec.os.name is windows.
+ // TODO: update the default value to "Merge" when spec.os.name is not windows in v1.34
+ // +featureGate=SupplementalGroupsPolicy
+ // +optional
+ optional string supplementalGroupsPolicy = 12;
+
// A special supplemental group that applies to all containers in a pod.
// Some volume types allow the Kubelet to change the ownership of that volume
// to be owned by the pod:
@@ -3939,7 +4036,7 @@ message PodSecurityContext {
message PodSignature {
// Reference to controller whose pods should avoid this node.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.OwnerReference podController = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.OwnerReference podController = 1;
}
// PodSpec is a description of a pod.
@@ -4048,9 +4145,11 @@ message PodSpec {
// +optional
optional bool automountServiceAccountToken = 21;
- // NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- // the scheduler simply schedules this pod onto that node, assuming that it fits resource
- // requirements.
+ // NodeName indicates in which node this pod is scheduled.
+ // If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ // Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ // This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ // https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
// +optional
optional string nodeName = 10;
@@ -4189,7 +4288,7 @@ message PodSpec {
// defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero.
// More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md
// +optional
- map overhead = 32;
+ map overhead = 32;
// TopologySpreadConstraints describes how a group of pods ought to spread across topology
// domains. Scheduler will schedule pods in a way which abides by the constraints.
@@ -4230,6 +4329,7 @@ message PodSpec {
// - spec.securityContext.runAsUser
// - spec.securityContext.runAsGroup
// - spec.securityContext.supplementalGroups
+ // - spec.securityContext.supplementalGroupsPolicy
// - spec.containers[*].securityContext.appArmorProfile
// - spec.containers[*].securityContext.seLinuxOptions
// - spec.containers[*].securityContext.seccompProfile
@@ -4375,7 +4475,7 @@ message PodStatus {
// RFC 3339 date and time at which the object was acknowledged by the Kubelet.
// This is before the Kubelet pulled the container image(s) for the pod.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 7;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 7;
// The list has one entry per init container in the manifest. The most recent successful
// init container will have ready = true, the most recently started container will have
@@ -4423,7 +4523,7 @@ message PodStatusResult {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Most recently observed status of the pod.
// This data may not be up to date.
@@ -4439,7 +4539,7 @@ message PodTemplate {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Template defines the pods that will be created from this pod template.
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -4452,7 +4552,7 @@ message PodTemplateList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of pod templates
repeated PodTemplate items = 2;
@@ -4463,7 +4563,7 @@ message PodTemplateSpec {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the pod.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -4525,7 +4625,7 @@ message PreferAvoidPodsEntry {
// Time at which this entry was added to the list.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time evictionTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time evictionTime = 2;
// (brief) reason why this entry was added to the list.
// +optional
@@ -4614,7 +4714,8 @@ message ProbeHandler {
// Represents a projected volume source
message ProjectedVolumeSource {
- // sources is the list of volume projections
+ // sources is the list of volume projections. Each entry in this list
+ // handles one source.
// +optional
// +listType=atomic
repeated VolumeProjection sources = 1;
@@ -4685,18 +4786,21 @@ message RBDPersistentVolumeSource {
// Default is rbd.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="rbd"
optional string pool = 4;
// user is the rados user name.
// Default is admin.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="admin"
optional string user = 5;
// keyring is the path to key ring for RBDUser.
// Default is /etc/ceph/keyring.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="/etc/ceph/keyring"
optional string keyring = 6;
// secretRef is name of the authentication secret for RBDUser. If provided
@@ -4737,18 +4841,21 @@ message RBDVolumeSource {
// Default is rbd.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="rbd"
optional string pool = 4;
// user is the rados user name.
// Default is admin.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="admin"
optional string user = 5;
// keyring is the path to key ring for RBDUser.
// Default is /etc/ceph/keyring.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="/etc/ceph/keyring"
optional string keyring = 6;
// secretRef is name of the authentication secret for RBDUser. If provided
@@ -4770,7 +4877,7 @@ message RangeAllocation {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Range is string that identifies the range represented by 'data'.
optional string range = 2;
@@ -4785,7 +4892,7 @@ message ReplicationController {
// be the same as the Pod(s) that the replication controller manages.
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the replication controller.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -4811,7 +4918,7 @@ message ReplicationControllerCondition {
// The last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -4827,7 +4934,7 @@ message ReplicationControllerList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of replication controllers.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
@@ -4904,6 +5011,13 @@ message ResourceClaim {
// the Pod where this field is used. It makes that resource available
// inside a container.
optional string name = 1;
+
+ // Request is the name chosen for a request in the referenced claim.
+ // If empty, everything from the claim is made available, otherwise
+ // only the result of this request.
+ //
+ // +optional
+ optional string request = 2;
}
// ResourceFieldSelector represents container resources (cpu, memory) and their output format
@@ -4918,7 +5032,26 @@ message ResourceFieldSelector {
// Specifies the output format of the exposed resources, defaults to "1"
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity divisor = 3;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity divisor = 3;
+}
+
+// ResourceHealth represents the health of a resource. It has the latest device health information.
+// This is a part of KEP https://kep.k8s.io/4680 and historical health changes are planned to be added in future iterations of a KEP.
+message ResourceHealth {
+ // ResourceID is the unique identifier of the resource. See the ResourceID type for more information.
+ optional string resourceID = 1;
+
+ // Health of the resource.
+ // can be one of:
+ // - Healthy: operates as normal
+ // - Unhealthy: reported unhealthy. We consider this a temporary health issue
+ // since we do not have a mechanism today to distinguish
+ // temporary and permanent issues.
+ // - Unknown: The status cannot be determined.
+ // For example, Device Plugin got unregistered and hasn't been re-registered since.
+ //
+ // In future we may want to introduce the PermanentlyUnhealthy Status.
+ optional string health = 2;
}
// ResourceQuota sets aggregate quota restrictions enforced per namespace
@@ -4926,7 +5059,7 @@ message ResourceQuota {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired quota.
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -4944,7 +5077,7 @@ message ResourceQuotaList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of ResourceQuota objects.
// More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/
@@ -4956,7 +5089,7 @@ message ResourceQuotaSpec {
// hard is the set of desired hard limits for each named resource.
// More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/
// +optional
- map hard = 1;
+ map hard = 1;
// A collection of filters that must match each object tracked by a quota.
// If not specified, the quota matches all objects.
@@ -4976,11 +5109,11 @@ message ResourceQuotaStatus {
// Hard is the set of enforced hard limits for each named resource.
// More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/
// +optional
- map hard = 1;
+ map hard = 1;
// Used is the current observed total usage of the resource in the namespace.
// +optional
- map used = 2;
+ map used = 2;
}
// ResourceRequirements describes the compute resource requirements.
@@ -4988,14 +5121,14 @@ message ResourceRequirements {
// Limits describes the maximum amount of compute resources allowed.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
- map limits = 1;
+ map limits = 1;
// Requests describes the minimum amount of compute resources required.
// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
// otherwise to an implementation-defined value. Requests cannot exceed Limits.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
- map requests = 2;
+ map requests = 2;
// Claims lists the names of resources, defined in spec.resourceClaims,
// that are used by this container.
@@ -5012,6 +5145,20 @@ message ResourceRequirements {
repeated ResourceClaim claims = 3;
}
+message ResourceStatus {
+ // Name of the resource. Must be unique within the pod and match one of the resources from the pod spec.
+ // +required
+ optional string name = 1;
+
+ // List of unique Resources health. Each element in the list contains an unique resource ID and resource health.
+ // At a minimum, ResourceID must uniquely identify the Resource
+ // allocated to the Pod on the Node for the lifetime of a Pod.
+ // See ResourceID type for it's definition.
+ // +listType=map
+ // +listMapKey=resourceID
+ repeated ResourceHealth resources = 2;
+}
+
// SELinuxOptions are the labels to be applied to the container
message SELinuxOptions {
// User is a SELinux user label that applies to the container.
@@ -5058,6 +5205,7 @@ message ScaleIOPersistentVolumeSource {
// storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// Default is ThinProvisioned.
// +optional
+ // +default="ThinProvisioned"
optional string storageMode = 7;
// volumeName is the name of a volume already created in the ScaleIO system
@@ -5069,6 +5217,7 @@ message ScaleIOPersistentVolumeSource {
// Ex. "ext4", "xfs", "ntfs".
// Default is "xfs"
// +optional
+ // +default="xfs"
optional string fsType = 9;
// readOnly defaults to false (read/write). ReadOnly here will force
@@ -5104,6 +5253,7 @@ message ScaleIOVolumeSource {
// storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// Default is ThinProvisioned.
// +optional
+ // +default="ThinProvisioned"
optional string storageMode = 7;
// volumeName is the name of a volume already created in the ScaleIO system
@@ -5115,6 +5265,7 @@ message ScaleIOVolumeSource {
// Ex. "ext4", "xfs", "ntfs".
// Default is "xfs".
// +optional
+ // +default="xfs"
optional string fsType = 9;
// readOnly Defaults to false (read/write). ReadOnly here will force
@@ -5179,7 +5330,7 @@ message Secret {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Immutable, if set to true, ensures that data stored in the Secret cannot
// be updated (only object metadata can be modified).
@@ -5242,7 +5393,7 @@ message SecretList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of secret objects.
// More info: https://kubernetes.io/docs/concepts/configuration/secret
@@ -5398,7 +5549,7 @@ message SecurityContext {
optional bool allowPrivilegeEscalation = 7;
// procMount denotes the type of proc mount to use for the containers.
- // The default is DefaultProcMount which uses the container runtime defaults for
+ // The default value is Default which uses the container runtime defaults for
// readonly paths and masked paths.
// This requires the ProcMountType feature flag to be enabled.
// Note that this field cannot be set when spec.os.name is windows.
@@ -5433,7 +5584,7 @@ message Service {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of a service.
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -5456,7 +5607,7 @@ message ServiceAccount {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use.
// Pods are only limited to this list if this service account has a "kubernetes.io/enforce-mountable-secrets" annotation set to "true".
@@ -5489,7 +5640,7 @@ message ServiceAccountList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ServiceAccounts.
// More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
@@ -5527,7 +5678,7 @@ message ServiceList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of services
repeated Service items = 2;
@@ -5579,7 +5730,7 @@ message ServicePort {
// omitted or set equal to the 'port' field.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString targetPort = 4;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString targetPort = 4;
// The port on each node on which this service is exposed when type is
// NodePort or LoadBalancer. Usually assigned by the system. If a value is
@@ -5864,7 +6015,7 @@ message ServiceStatus {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 2;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 2;
}
// SessionAffinityConfig represents the configurations of session affinity.
@@ -5958,7 +6109,7 @@ message TCPSocketAction {
// Number or name of the port to access on the container.
// Number must be in the range 1 to 65535.
// Name must be an IANA_SVC_NAME.
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 1;
// Optional: Host name to connect to, defaults to the pod IP.
// +optional
@@ -5983,7 +6134,7 @@ message Taint {
// TimeAdded represents the time at which the taint was added.
// It is only written for NoExecute taints.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4;
}
// The pod this Toleration is attached to tolerates any taint that matches
@@ -6107,7 +6258,7 @@ message TopologySpreadConstraint {
// Pods that match this label selector are counted to determine the number of pods
// in their corresponding topology domain.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 4;
// MinDomains indicates a minimum number of eligible domains.
// When the number of eligible domains with matching topology keys is less than minDomains,
@@ -6313,7 +6464,8 @@ message VolumeNodeAffinity {
optional NodeSelector required = 1;
}
-// Projection that may be projected along with other supported volume types
+// Projection that may be projected along with other supported volume types.
+// Exactly one of these fields must be set.
message VolumeProjection {
// secret information about the secret data to project
// +optional
@@ -6355,14 +6507,14 @@ message VolumeResourceRequirements {
// Limits describes the maximum amount of compute resources allowed.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
- map limits = 1;
+ map limits = 1;
// Requests describes the minimum amount of compute resources required.
// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
// otherwise to an implementation-defined value. Requests cannot exceed Limits.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
- map requests = 2;
+ map requests = 2;
}
// Represents the source of a volume to mount.
@@ -6530,6 +6682,24 @@ message VolumeSource {
//
// +optional
optional EphemeralVolumeSource ephemeral = 29;
+
+ // image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ // The volume is resolved at pod startup depending on which PullPolicy value is provided:
+ //
+ // - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ // - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ // - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ //
+ // The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ // A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ // The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ // The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ // The volume will be mounted read-only (ro) and non-executable files (noexec).
+ // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ // The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ // +featureGate=ImageVolume
+ // +optional
+ optional ImageVolumeSource image = 30;
}
// Represents a vSphere volume resource.
diff --git a/vendor/k8s.io/api/core/v1/types.go b/vendor/k8s.io/api/core/v1/types.go
index 328df9a7b7d..3a74138baeb 100644
--- a/vendor/k8s.io/api/core/v1/types.go
+++ b/vendor/k8s.io/api/core/v1/types.go
@@ -181,6 +181,23 @@ type VolumeSource struct {
//
// +optional
Ephemeral *EphemeralVolumeSource `json:"ephemeral,omitempty" protobuf:"bytes,29,opt,name=ephemeral"`
+ // image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
+ // The volume is resolved at pod startup depending on which PullPolicy value is provided:
+ //
+ // - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ // - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ // - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ //
+ // The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
+ // A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
+ // The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
+ // The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
+ // The volume will be mounted read-only (ro) and non-executable files (noexec).
+ // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
+ // The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
+ // +featureGate=ImageVolume
+ // +optional
+ Image *ImageVolumeSource `json:"image,omitempty" protobuf:"bytes,30,opt,name=image"`
}
// PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace.
@@ -295,6 +312,7 @@ const (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PersistentVolume (PV) is a storage resource provisioned by an administrator.
// It is analogous to a node.
@@ -371,7 +389,7 @@ type PersistentVolumeSpec struct {
// after a volume has been updated successfully to a new class.
// For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound
// PersistentVolumeClaims during the binding process.
- // This is an alpha field and requires enabling VolumeAttributesClass feature.
+ // This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
// +featureGate=VolumeAttributesClass
// +optional
VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty" protobuf:"bytes,10,opt,name=volumeAttributesClassName"`
@@ -425,13 +443,12 @@ type PersistentVolumeStatus struct {
Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"`
// lastPhaseTransitionTime is the time the phase transitioned from one to another
// and automatically resets to current time everytime a volume phase transitions.
- // This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).
- // +featureGate=PersistentVolumeLastPhaseTransitionTime
// +optional
LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastPhaseTransitionTime"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PersistentVolumeList is a list of PersistentVolume items.
type PersistentVolumeList struct {
@@ -447,6 +464,7 @@ type PersistentVolumeList struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PersistentVolumeClaim is a user's request for and claim to a persistent volume
type PersistentVolumeClaim struct {
@@ -469,6 +487,7 @@ type PersistentVolumeClaim struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PersistentVolumeClaimList is a list of PersistentVolumeClaim items.
type PersistentVolumeClaimList struct {
@@ -557,7 +576,7 @@ type PersistentVolumeClaimSpec struct {
// set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
// exists.
// More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
- // (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
+ // (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
// +featureGate=VolumeAttributesClass
// +optional
VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty" protobuf:"bytes,9,opt,name=volumeAttributesClassName"`
@@ -581,15 +600,29 @@ type TypedObjectReference struct {
Namespace *string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"`
}
-// PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type
+// PersistentVolumeClaimConditionType defines the condition of PV claim.
+// Valid values are:
+// - "Resizing", "FileSystemResizePending"
+//
+// If RecoverVolumeExpansionFailure feature gate is enabled, then following additional values can be expected:
+// - "ControllerResizeError", "NodeResizeError"
+//
+// If VolumeAttributesClass feature gate is enabled, then following additional values can be expected:
+// - "ModifyVolumeError", "ModifyingVolume"
type PersistentVolumeClaimConditionType string
+// These are valid conditions of PVC
const (
// PersistentVolumeClaimResizing - a user trigger resize of pvc has been started
PersistentVolumeClaimResizing PersistentVolumeClaimConditionType = "Resizing"
// PersistentVolumeClaimFileSystemResizePending - controller resize is finished and a file system resize is pending on node
PersistentVolumeClaimFileSystemResizePending PersistentVolumeClaimConditionType = "FileSystemResizePending"
+ // PersistentVolumeClaimControllerResizeError indicates an error while resizing volume for size in the controller
+ PersistentVolumeClaimControllerResizeError PersistentVolumeClaimConditionType = "ControllerResizeError"
+ // PersistentVolumeClaimNodeResizeError indicates an error while resizing volume for size in the node.
+ PersistentVolumeClaimNodeResizeError PersistentVolumeClaimConditionType = "NodeResizeError"
+
// Applying the target VolumeAttributesClass encountered an error
PersistentVolumeClaimVolumeModifyVolumeError PersistentVolumeClaimConditionType = "ModifyVolumeError"
// Volume is being modified
@@ -606,18 +639,19 @@ const (
// State set when resize controller starts resizing the volume in control-plane.
PersistentVolumeClaimControllerResizeInProgress ClaimResourceStatus = "ControllerResizeInProgress"
- // State set when resize has failed in resize controller with a terminal error.
+ // State set when resize has failed in resize controller with a terminal unrecoverable error.
// Transient errors such as timeout should not set this status and should leave allocatedResourceStatus
// unmodified, so as resize controller can resume the volume expansion.
- PersistentVolumeClaimControllerResizeFailed ClaimResourceStatus = "ControllerResizeFailed"
+ PersistentVolumeClaimControllerResizeInfeasible ClaimResourceStatus = "ControllerResizeInfeasible"
// State set when resize controller has finished resizing the volume but further resizing of volume
// is needed on the node.
PersistentVolumeClaimNodeResizePending ClaimResourceStatus = "NodeResizePending"
// State set when kubelet starts resizing the volume.
PersistentVolumeClaimNodeResizeInProgress ClaimResourceStatus = "NodeResizeInProgress"
- // State set when resizing has failed in kubelet with a terminal error. Transient errors don't set NodeResizeFailed
- PersistentVolumeClaimNodeResizeFailed ClaimResourceStatus = "NodeResizeFailed"
+ // State set when resizing has failed in kubelet with a terminal unrecoverable error. Transient errors
+ // shouldn't set this status
+ PersistentVolumeClaimNodeResizeInfeasible ClaimResourceStatus = "NodeResizeInfeasible"
)
// +enum
@@ -763,13 +797,13 @@ type PersistentVolumeClaimStatus struct {
AllocatedResourceStatuses map[ResourceName]ClaimResourceStatus `json:"allocatedResourceStatuses,omitempty" protobuf:"bytes,7,rep,name=allocatedResourceStatuses"`
// currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using.
// When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim
- // This is an alpha field and requires enabling VolumeAttributesClass feature.
+ // This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
// +featureGate=VolumeAttributesClass
// +optional
CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty" protobuf:"bytes,8,opt,name=currentVolumeAttributesClassName"`
// ModifyVolumeStatus represents the status object of ControllerModifyVolume operation.
// When this is unset, there is no ModifyVolume operation being attempted.
- // This is an alpha field and requires enabling VolumeAttributesClass feature.
+ // This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
// +featureGate=VolumeAttributesClass
// +optional
ModifyVolumeStatus *ModifyVolumeStatus `json:"modifyVolumeStatus,omitempty" protobuf:"bytes,9,opt,name=modifyVolumeStatus"`
@@ -943,16 +977,19 @@ type RBDVolumeSource struct {
// Default is rbd.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="rbd"
RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"`
// user is the rados user name.
// Default is admin.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="admin"
RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"`
// keyring is the path to key ring for RBDUser.
// Default is /etc/ceph/keyring.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="/etc/ceph/keyring"
Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"`
// secretRef is name of the authentication secret for RBDUser. If provided
// overrides keyring.
@@ -988,16 +1025,19 @@ type RBDPersistentVolumeSource struct {
// Default is rbd.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="rbd"
RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"`
// user is the rados user name.
// Default is admin.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="admin"
RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"`
// keyring is the path to key ring for RBDUser.
// Default is /etc/ceph/keyring.
// More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
// +optional
+ // +default="/etc/ceph/keyring"
Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"`
// secretRef is name of the authentication secret for RBDUser. If provided
// overrides keyring.
@@ -1426,6 +1466,7 @@ type ISCSIVolumeSource struct {
// iscsiInterface is the interface Name that uses an iSCSI transport.
// Defaults to 'default' (tcp).
// +optional
+ // +default="default"
ISCSIInterface string `json:"iscsiInterface,omitempty" protobuf:"bytes,4,opt,name=iscsiInterface"`
// fsType is the filesystem type of the volume that you want to mount.
// Tip: Ensure that the filesystem type is supported by the host operating system.
@@ -1473,6 +1514,7 @@ type ISCSIPersistentVolumeSource struct {
// iscsiInterface is the interface Name that uses an iSCSI transport.
// Defaults to 'default' (tcp).
// +optional
+ // +default="default"
ISCSIInterface string `json:"iscsiInterface,omitempty" protobuf:"bytes,4,opt,name=iscsiInterface"`
// fsType is the filesystem type of the volume that you want to mount.
// Tip: Ensure that the filesystem type is supported by the host operating system.
@@ -1613,17 +1655,21 @@ type AzureDiskVolumeSource struct {
DataDiskURI string `json:"diskURI" protobuf:"bytes,2,opt,name=diskURI"`
// cachingMode is the Host Caching mode: None, Read Only, Read Write.
// +optional
+ // +default=ref(AzureDataDiskCachingReadWrite)
CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty" protobuf:"bytes,3,opt,name=cachingMode,casttype=AzureDataDiskCachingMode"`
// fsType is Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
// +optional
+ // +default="ext4"
FSType *string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"`
// readOnly Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
// +optional
+ // +default=false
ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"`
// kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
+ // +default=ref(AzureSharedBlobDisk)
Kind *AzureDataDiskKind `json:"kind,omitempty" protobuf:"bytes,6,opt,name=kind,casttype=AzureDataDiskKind"`
}
@@ -1662,6 +1708,7 @@ type ScaleIOVolumeSource struct {
// storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// Default is ThinProvisioned.
// +optional
+ // +default="ThinProvisioned"
StorageMode string `json:"storageMode,omitempty" protobuf:"bytes,7,opt,name=storageMode"`
// volumeName is the name of a volume already created in the ScaleIO system
// that is associated with this volume source.
@@ -1671,6 +1718,7 @@ type ScaleIOVolumeSource struct {
// Ex. "ext4", "xfs", "ntfs".
// Default is "xfs".
// +optional
+ // +default="xfs"
FSType string `json:"fsType,omitempty" protobuf:"bytes,9,opt,name=fsType"`
// readOnly Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
@@ -1699,6 +1747,7 @@ type ScaleIOPersistentVolumeSource struct {
// storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
// Default is ThinProvisioned.
// +optional
+ // +default="ThinProvisioned"
StorageMode string `json:"storageMode,omitempty" protobuf:"bytes,7,opt,name=storageMode"`
// volumeName is the name of a volume already created in the ScaleIO system
// that is associated with this volume source.
@@ -1708,6 +1757,7 @@ type ScaleIOPersistentVolumeSource struct {
// Ex. "ext4", "xfs", "ntfs".
// Default is "xfs"
// +optional
+ // +default="xfs"
FSType string `json:"fsType,omitempty" protobuf:"bytes,9,opt,name=fsType"`
// readOnly defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
@@ -1891,7 +1941,8 @@ type ClusterTrustBundleProjection struct {
// Represents a projected volume source
type ProjectedVolumeSource struct {
- // sources is the list of volume projections
+ // sources is the list of volume projections. Each entry in this list
+ // handles one source.
// +optional
// +listType=atomic
Sources []VolumeProjection `json:"sources" protobuf:"bytes,1,rep,name=sources"`
@@ -1905,10 +1956,9 @@ type ProjectedVolumeSource struct {
DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"`
}
-// Projection that may be projected along with other supported volume types
+// Projection that may be projected along with other supported volume types.
+// Exactly one of these fields must be set.
type VolumeProjection struct {
- // all types below are the supported types for projection into the same volume
-
// secret information about the secret data to project
// +optional
Secret *SecretProjection `json:"secret,omitempty" protobuf:"bytes,1,opt,name=secret"`
@@ -2631,6 +2681,13 @@ type ResourceClaim struct {
// the Pod where this field is used. It makes that resource available
// inside a container.
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
+
+ // Request is the name chosen for a request in the referenced claim.
+ // If empty, everything from the claim is made available, otherwise
+ // only the result of this request.
+ //
+ // +optional
+ Request string `json:"request,omitempty" protobuf:"bytes,2,opt,name=request"`
}
const (
@@ -3030,6 +3087,93 @@ type ContainerStatus struct {
// +listMapKey=mountPath
// +featureGate=RecursiveReadOnlyMounts
VolumeMounts []VolumeMountStatus `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,12,rep,name=volumeMounts"`
+ // User represents user identity information initially attached to the first process of the container
+ // +featureGate=SupplementalGroupsPolicy
+ // +optional
+ User *ContainerUser `json:"user,omitempty" protobuf:"bytes,13,opt,name=user,casttype=ContainerUser"`
+ // AllocatedResourcesStatus represents the status of various resources
+ // allocated for this Pod.
+ // +featureGate=ResourceHealthStatus
+ // +optional
+ // +patchMergeKey=name
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=name
+ AllocatedResourcesStatus []ResourceStatus `json:"allocatedResourcesStatus,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,14,rep,name=allocatedResourcesStatus"`
+}
+
+type ResourceStatus struct {
+ // Name of the resource. Must be unique within the pod and match one of the resources from the pod spec.
+ // +required
+ Name ResourceName `json:"name" protobuf:"bytes,1,opt,name=name"`
+ // List of unique Resources health. Each element in the list contains an unique resource ID and resource health.
+ // At a minimum, ResourceID must uniquely identify the Resource
+ // allocated to the Pod on the Node for the lifetime of a Pod.
+ // See ResourceID type for it's definition.
+ // +listType=map
+ // +listMapKey=resourceID
+ Resources []ResourceHealth `json:"resources,omitempty" protobuf:"bytes,2,rep,name=resources"`
+}
+
+type ResourceHealthStatus string
+
+const (
+ ResourceHealthStatusHealthy ResourceHealthStatus = "Healthy"
+ ResourceHealthStatusUnhealthy ResourceHealthStatus = "Unhealthy"
+ ResourceHealthStatusUnknown ResourceHealthStatus = "Unknown"
+)
+
+// ResourceID is calculated based on the source of this resource health information.
+// For DevicePlugin:
+//
+// deviceplugin:DeviceID, where DeviceID is from the Device structure of DevicePlugin's ListAndWatchResponse type: https://github.com/kubernetes/kubernetes/blob/eda1c780543a27c078450e2f17d674471e00f494/staging/src/k8s.io/kubelet/pkg/apis/deviceplugin/v1alpha/api.proto#L61-L73
+//
+// DevicePlugin ID is usually a constant for the lifetime of a Node and typically can be used to uniquely identify the device on the node.
+// For DRA:
+//
+// dra://: such a device can be looked up in the information published by that DRA driver to learn more about it. It is designed to be globally unique in a cluster.
+type ResourceID string
+
+// ResourceHealth represents the health of a resource. It has the latest device health information.
+// This is a part of KEP https://kep.k8s.io/4680 and historical health changes are planned to be added in future iterations of a KEP.
+type ResourceHealth struct {
+ // ResourceID is the unique identifier of the resource. See the ResourceID type for more information.
+ ResourceID ResourceID `json:"resourceID" protobuf:"bytes,1,opt,name=resourceID"`
+ // Health of the resource.
+ // can be one of:
+ // - Healthy: operates as normal
+ // - Unhealthy: reported unhealthy. We consider this a temporary health issue
+ // since we do not have a mechanism today to distinguish
+ // temporary and permanent issues.
+ // - Unknown: The status cannot be determined.
+ // For example, Device Plugin got unregistered and hasn't been re-registered since.
+ //
+ // In future we may want to introduce the PermanentlyUnhealthy Status.
+ Health ResourceHealthStatus `json:"health,omitempty" protobuf:"bytes,2,name=health"`
+}
+
+// ContainerUser represents user identity information
+type ContainerUser struct {
+ // Linux holds user identity information initially attached to the first process of the containers in Linux.
+ // Note that the actual running identity can be changed if the process has enough privilege to do so.
+ // +optional
+ Linux *LinuxContainerUser `json:"linux,omitempty" protobuf:"bytes,1,opt,name=linux,casttype=LinuxContainerUser"`
+
+ // Windows holds user identity information initially attached to the first process of the containers in Windows
+ // This is just reserved for future use.
+ // Windows *WindowsContainerUser
+}
+
+// LinuxContainerUser represents user identity information in Linux containers
+type LinuxContainerUser struct {
+ // UID is the primary uid initially attached to the first process in the container
+ UID int64 `json:"uid" protobuf:"varint,1,name=uid"`
+ // GID is the primary gid initially attached to the first process in the container
+ GID int64 `json:"gid" protobuf:"varint,2,name=gid"`
+ // SupplementalGroups are the supplemental groups initially attached to the first process in the container
+ // +optional
+ // +listType=atomic
+ SupplementalGroups []int64 `json:"supplementalGroups,omitempty" protobuf:"varint,3,rep,name=supplementalGroups"`
}
// PodPhase is a label for the condition of a pod at the current time.
@@ -3426,7 +3570,8 @@ type PodAffinityTerm struct {
// pod labels will be ignored. The default value is empty.
// The same key is forbidden to exist in both matchLabelKeys and labelSelector.
// Also, matchLabelKeys cannot be set when labelSelector isn't set.
- // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
+ //
// +listType=atomic
// +optional
MatchLabelKeys []string `json:"matchLabelKeys,omitempty" protobuf:"bytes,5,opt,name=matchLabelKeys"`
@@ -3438,7 +3583,8 @@ type PodAffinityTerm struct {
// pod labels will be ignored. The default value is empty.
// The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
// Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- // This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+ // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
+ //
// +listType=atomic
// +optional
MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty" protobuf:"bytes,6,opt,name=mismatchLabelKeys"`
@@ -3667,9 +3813,11 @@ type PodSpec struct {
// +optional
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" protobuf:"varint,21,opt,name=automountServiceAccountToken"`
- // NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
- // the scheduler simply schedules this pod onto that node, assuming that it fits resource
- // requirements.
+ // NodeName indicates in which node this pod is scheduled.
+ // If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
+ // Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
+ // This field should not be used to express a desire for the pod to be scheduled on a specific node.
+ // https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
// +optional
NodeName string `json:"nodeName,omitempty" protobuf:"bytes,10,opt,name=nodeName"`
// Host networking requested for this pod. Use the host's network namespace.
@@ -3826,6 +3974,7 @@ type PodSpec struct {
// - spec.securityContext.runAsUser
// - spec.securityContext.runAsGroup
// - spec.securityContext.supplementalGroups
+ // - spec.securityContext.supplementalGroupsPolicy
// - spec.containers[*].securityContext.appArmorProfile
// - spec.containers[*].securityContext.seLinuxOptions
// - spec.containers[*].securityContext.seccompProfile
@@ -3883,7 +4032,10 @@ type PodSpec struct {
ResourceClaims []PodResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,39,rep,name=resourceClaims"`
}
-// PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
+// PodResourceClaim references exactly one ResourceClaim, either directly
+// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
+// for the pod.
+//
// It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
// Containers that need access to the ResourceClaim reference it with this name.
type PodResourceClaim struct {
@@ -3891,18 +4043,17 @@ type PodResourceClaim struct {
// This must be a DNS_LABEL.
Name string `json:"name" protobuf:"bytes,1,name=name"`
- // Source describes where to find the ResourceClaim.
- Source ClaimSource `json:"source,omitempty" protobuf:"bytes,2,name=source"`
-}
+ // Source is tombstoned since Kubernetes 1.31 where it got replaced with
+ // the inlined fields below.
+ //
+ // Source ClaimSource `json:"source,omitempty" protobuf:"bytes,2,name=source"`
-// ClaimSource describes a reference to a ResourceClaim.
-//
-// Exactly one of these fields should be set. Consumers of this type must
-// treat an empty object as if it has an unknown value.
-type ClaimSource struct {
// ResourceClaimName is the name of a ResourceClaim object in the same
// namespace as this pod.
- ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,1,opt,name=resourceClaimName"`
+ //
+ // Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ // be set.
+ ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,3,opt,name=resourceClaimName"`
// ResourceClaimTemplateName is the name of a ResourceClaimTemplate
// object in the same namespace as this pod.
@@ -3916,7 +4067,10 @@ type ClaimSource struct {
// This field is immutable and no changes will be made to the
// corresponding ResourceClaim by the control plane after creating the
// ResourceClaim.
- ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimTemplateName"`
+ //
+ // Exactly one of ResourceClaimName and ResourceClaimTemplateName must
+ // be set.
+ ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty" protobuf:"bytes,4,opt,name=resourceClaimTemplateName"`
}
// PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim
@@ -3929,7 +4083,7 @@ type PodResourceClaimStatus struct {
Name string `json:"name" protobuf:"bytes,1,name=name"`
// ResourceClaimName is the name of the ResourceClaim that was
- // generated for the Pod in the namespace of the Pod. It this is
+ // generated for the Pod in the namespace of the Pod. If this is
// unset, then generating a ResourceClaim was not necessary. The
// pod.spec.resourceClaims entry can be ignored in this case.
//
@@ -4137,6 +4291,23 @@ const (
FSGroupChangeAlways PodFSGroupChangePolicy = "Always"
)
+// SupplementalGroupsPolicy defines how supplemental groups
+// of the first container processes are calculated.
+// +enum
+type SupplementalGroupsPolicy string
+
+const (
+ // SupplementalGroupsPolicyMerge means that the container's provided
+ // SupplementalGroups and FsGroup (specified in SecurityContext) will be
+ // merged with the primary user's groups as defined in the container image
+ // (in /etc/group).
+ SupplementalGroupsPolicyMerge SupplementalGroupsPolicy = "Merge"
+ // SupplementalGroupsPolicyStrict means that the container's provided
+ // SupplementalGroups and FsGroup (specified in SecurityContext) will be
+ // used instead of any groups defined in the container image.
+ SupplementalGroupsPolicyStrict SupplementalGroupsPolicy = "Strict"
+)
+
// PodSecurityContext holds pod-level security attributes and common container settings.
// Some fields are also present in container.securityContext. Field values of
// container.securityContext take precedence over field values of PodSecurityContext.
@@ -4179,16 +4350,27 @@ type PodSecurityContext struct {
// PodSecurityContext, the value specified in SecurityContext takes precedence.
// +optional
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" protobuf:"varint,3,opt,name=runAsNonRoot"`
- // A list of groups applied to the first process run in each container, in addition
- // to the container's primary GID, the fsGroup (if specified), and group memberships
- // defined in the container image for the uid of the container process. If unspecified,
- // no additional groups are added to any container. Note that group memberships
- // defined in the container image for the uid of the container process are still effective,
- // even if they are not included in this list.
+ // A list of groups applied to the first process run in each container, in
+ // addition to the container's primary GID and fsGroup (if specified). If
+ // the SupplementalGroupsPolicy feature is enabled, the
+ // supplementalGroupsPolicy field determines whether these are in addition
+ // to or instead of any group memberships defined in the container image.
+ // If unspecified, no additional groups are added, though group memberships
+ // defined in the container image may still be used, depending on the
+ // supplementalGroupsPolicy field.
// Note that this field cannot be set when spec.os.name is windows.
// +optional
// +listType=atomic
SupplementalGroups []int64 `json:"supplementalGroups,omitempty" protobuf:"varint,4,rep,name=supplementalGroups"`
+ // Defines how supplemental groups of the first container processes are calculated.
+ // Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
+ // (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
+ // and the container runtime must implement support for this feature.
+ // Note that this field cannot be set when spec.os.name is windows.
+ // TODO: update the default value to "Merge" when spec.os.name is not windows in v1.34
+ // +featureGate=SupplementalGroupsPolicy
+ // +optional
+ SupplementalGroupsPolicy *SupplementalGroupsPolicy `json:"supplementalGroupsPolicy,omitempty" protobuf:"bytes,12,opt,name=supplementalGroupsPolicy"`
// A special supplemental group that applies to all containers in a pod.
// Some volume types allow the Kubelet to change the ownership of that volume
// to be owned by the pod:
@@ -4340,13 +4522,15 @@ type PodDNSConfigOption struct {
// PodIP represents a single IP address allocated to the pod.
type PodIP struct {
// IP is the IP address assigned to the pod
- IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`
+ // +required
+ IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"`
}
// HostIP represents a single IP address allocated to the host.
type HostIP struct {
// IP is the IP address assigned to the host
- IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`
+ // +required
+ IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"`
}
// EphemeralContainerCommon is a copy of all fields in Container to be inlined in
@@ -4663,6 +4847,7 @@ type PodStatus struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
type PodStatusResult struct {
@@ -4683,6 +4868,7 @@ type PodStatusResult struct {
// +genclient
// +genclient:method=UpdateEphemeralContainers,verb=update,subresource=ephemeralcontainers
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Pod is a collection of containers that can run on a host. This resource is created
// by clients and scheduled onto hosts.
@@ -4708,6 +4894,7 @@ type Pod struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PodList is a list of Pods.
type PodList struct {
@@ -4737,6 +4924,7 @@ type PodTemplateSpec struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PodTemplate describes a template for creating copies of a predefined pod.
type PodTemplate struct {
@@ -4753,6 +4941,7 @@ type PodTemplate struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PodTemplateList is a list of PodTemplates.
type PodTemplateList struct {
@@ -4867,6 +5056,7 @@ type ReplicationControllerCondition struct {
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ReplicationController represents the configuration of a replication controller.
type ReplicationController struct {
@@ -4893,6 +5083,7 @@ type ReplicationController struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ReplicationControllerList is a collection of replication controllers.
type ReplicationControllerList struct {
@@ -5437,6 +5628,7 @@ type ServicePort struct {
// +genclient
// +genclient:skipVerbs=deleteCollection
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Service is a named abstraction of software service (for example, mysql) consisting of local port
// (for example 3306) that the proxy listens on, and the selector that determines which pods
@@ -5468,6 +5660,7 @@ const (
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ServiceList holds a list of services.
type ServiceList struct {
@@ -5484,6 +5677,7 @@ type ServiceList struct {
// +genclient
// +genclient:method=CreateToken,verb=create,subresource=token,input=k8s.io/api/authentication/v1.TokenRequest,result=k8s.io/api/authentication/v1.TokenRequest
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ServiceAccount binds together:
// * a name, understood by users, and perhaps by peripheral systems, for an identity
@@ -5523,6 +5717,7 @@ type ServiceAccount struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ServiceAccountList is a list of ServiceAccount objects
type ServiceAccountList struct {
@@ -5539,6 +5734,7 @@ type ServiceAccountList struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Endpoints is a collection of endpoints that implement the actual service. Example:
//
@@ -5660,6 +5856,7 @@ type EndpointPort struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// EndpointsList is a list of endpoints.
type EndpointsList struct {
@@ -5772,13 +5969,16 @@ type NodeDaemonEndpoints struct {
KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty" protobuf:"bytes,1,opt,name=kubeletEndpoint"`
}
-// NodeRuntimeHandlerFeatures is a set of runtime features.
+// NodeRuntimeHandlerFeatures is a set of features implemented by the runtime handler.
type NodeRuntimeHandlerFeatures struct {
// RecursiveReadOnlyMounts is set to true if the runtime handler supports RecursiveReadOnlyMounts.
// +featureGate=RecursiveReadOnlyMounts
// +optional
RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty" protobuf:"varint,1,opt,name=recursiveReadOnlyMounts"`
- // Reserved: UserNamespaces *bool (varint 2, for consistency with CRI API)
+ // UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.
+ // +featureGate=UserNamespacesSupport
+ // +optional
+ UserNamespaces *bool `json:"userNamespaces,omitempty" protobuf:"varint,2,opt,name=userNamespaces"`
}
// NodeRuntimeHandler is a set of runtime handler information.
@@ -5792,6 +5992,15 @@ type NodeRuntimeHandler struct {
Features *NodeRuntimeHandlerFeatures `json:"features,omitempty" protobuf:"bytes,2,opt,name=features"`
}
+// NodeFeatures describes the set of features implemented by the CRI implementation.
+// The features contained in the NodeFeatures should depend only on the cri implementation
+// independent of runtime handlers.
+type NodeFeatures struct {
+ // SupplementalGroupsPolicy is set to true if the runtime supports SupplementalGroupsPolicy and ContainerUser.
+ // +optional
+ SupplementalGroupsPolicy *bool `json:"supplementalGroupsPolicy,omitempty" protobuf:"varint,1,opt,name=supplementalGroupsPolicy"`
+}
+
// NodeSystemInfo is a set of ids/uuids to uniquely identify the node.
type NodeSystemInfo struct {
// MachineID reported by the node. For unique machine identification
@@ -5812,7 +6021,7 @@ type NodeSystemInfo struct {
ContainerRuntimeVersion string `json:"containerRuntimeVersion" protobuf:"bytes,6,opt,name=containerRuntimeVersion"`
// Kubelet Version reported by the node.
KubeletVersion string `json:"kubeletVersion" protobuf:"bytes,7,opt,name=kubeletVersion"`
- // KubeProxy Version reported by the node.
+ // Deprecated: KubeProxy Version reported by the node.
KubeProxyVersion string `json:"kubeProxyVersion" protobuf:"bytes,8,opt,name=kubeProxyVersion"`
// The Operating System reported by the node
OperatingSystem string `json:"operatingSystem" protobuf:"bytes,9,opt,name=operatingSystem"`
@@ -5870,7 +6079,7 @@ type NodeConfigStatus struct {
// NodeStatus is information about the current status of a node.
type NodeStatus struct {
// Capacity represents the total resources of a node.
- // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
+ // More info: https://kubernetes.io/docs/reference/node/node-status/#capacity
// +optional
Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"`
// Allocatable represents the resources of a node that are available for scheduling.
@@ -5930,9 +6139,14 @@ type NodeStatus struct {
Config *NodeConfigStatus `json:"config,omitempty" protobuf:"bytes,11,opt,name=config"`
// The available runtime handlers.
// +featureGate=RecursiveReadOnlyMounts
+ // +featureGate=UserNamespacesSupport
// +optional
// +listType=atomic
RuntimeHandlers []NodeRuntimeHandler `json:"runtimeHandlers,omitempty" protobuf:"bytes,12,rep,name=runtimeHandlers"`
+ // Features describes the set of features implemented by the CRI implementation.
+ // +featureGate=SupplementalGroupsPolicy
+ // +optional
+ Features *NodeFeatures `json:"features,omitempty" protobuf:"bytes,13,rep,name=features"`
}
type UniqueVolumeName string
@@ -6128,6 +6342,7 @@ type ResourceList map[ResourceName]resource.Quantity
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Node is a worker node in Kubernetes.
// Each node will have a unique identifier in the cache (i.e. in etcd).
@@ -6152,6 +6367,7 @@ type Node struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// NodeList is the whole list of all Nodes which have been registered with master.
type NodeList struct {
@@ -6250,6 +6466,7 @@ type NamespaceCondition struct {
// +genclient:nonNamespaced
// +genclient:skipVerbs=deleteCollection
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Namespace provides a scope for Names.
// Use of multiple namespaces is optional.
@@ -6272,6 +6489,7 @@ type Namespace struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// NamespaceList is a list of Namespaces.
type NamespaceList struct {
@@ -6287,6 +6505,7 @@ type NamespaceList struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Binding ties one object to another; for example, a pod is bound to a node by a scheduler.
// Deprecated in 1.7, please use the bindings subresource of pods instead.
@@ -6311,6 +6530,7 @@ type Preconditions struct {
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PodLogOptions is the query options for a Pod's logs REST call.
type PodLogOptions struct {
@@ -6363,6 +6583,7 @@ type PodLogOptions struct {
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.1
// PodAttachOptions is the query options to a Pod's remote attach call.
// ---
@@ -6401,6 +6622,7 @@ type PodAttachOptions struct {
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PodExecOptions is the query options to a Pod's remote exec call.
// ---
@@ -6439,6 +6661,7 @@ type PodExecOptions struct {
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.6
// PodPortForwardOptions is the query options to a Pod's port forward call
// when using WebSockets.
@@ -6458,6 +6681,7 @@ type PodPortForwardOptions struct {
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// PodProxyOptions is the query options to a Pod's proxy call.
type PodProxyOptions struct {
@@ -6470,6 +6694,7 @@ type PodProxyOptions struct {
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// NodeProxyOptions is the query options to a Node's proxy call.
type NodeProxyOptions struct {
@@ -6482,6 +6707,7 @@ type NodeProxyOptions struct {
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// ServiceProxyOptions is the query options to a Service's proxy call.
type ServiceProxyOptions struct {
@@ -6584,6 +6810,7 @@ type TypedLocalObjectReference struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// SerializedReference is a reference to serialized object.
type SerializedReference struct {
@@ -6613,6 +6840,7 @@ const (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Event is a report of an event somewhere in the cluster. Events
// have a limited retention time and triggers and messages may evolve
@@ -6697,6 +6925,7 @@ type EventSeries struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// EventList is a list of events.
type EventList struct {
@@ -6711,6 +6940,7 @@ type EventList struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// List holds a list of objects, which may not be known by the server.
type List metav1.List
@@ -6758,6 +6988,7 @@ type LimitRangeSpec struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// LimitRange sets resource usage limits for each kind of resource in a Namespace.
type LimitRange struct {
@@ -6774,6 +7005,7 @@ type LimitRange struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// LimitRangeList is a list of LimitRange items.
type LimitRangeList struct {
@@ -6822,6 +7054,8 @@ const (
ResourceLimitsMemory ResourceName = "limits.memory"
// Local ephemeral storage limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
ResourceLimitsEphemeralStorage ResourceName = "limits.ephemeral-storage"
+ // resource.k8s.io devices requested with a certain DeviceClass, number
+ ResourceClaimsPerClass string = ".deviceclass.resource.k8s.io/devices"
)
// The following identify resource prefix for Kubernetes object types
@@ -6922,6 +7156,7 @@ type ResourceQuotaStatus struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ResourceQuota sets aggregate quota restrictions enforced per namespace
type ResourceQuota struct {
@@ -6943,6 +7178,7 @@ type ResourceQuota struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ResourceQuotaList is a list of ResourceQuota items.
type ResourceQuotaList struct {
@@ -6959,6 +7195,7 @@ type ResourceQuotaList struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Secret holds secret data of a certain type. The total bytes of the values in
// the Data field must be less than MaxSecretSize bytes.
@@ -7085,6 +7322,7 @@ const (
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// SecretList is a list of Secret.
type SecretList struct {
@@ -7101,6 +7339,7 @@ type SecretList struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// ConfigMap holds configuration data for pods to consume.
type ConfigMap struct {
@@ -7137,6 +7376,7 @@ type ConfigMap struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.2
// ConfigMapList is a resource containing a list of ConfigMap objects.
type ConfigMapList struct {
@@ -7179,6 +7419,7 @@ type ComponentCondition struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
// Deprecated: This API is deprecated in v1.19+
@@ -7199,6 +7440,7 @@ type ComponentStatus struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// Status of all the conditions for the component as a list of ComponentStatus objects.
// Deprecated: This API is deprecated in v1.19+
@@ -7332,7 +7574,7 @@ type SecurityContext struct {
// +optional
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,7,opt,name=allowPrivilegeEscalation"`
// procMount denotes the type of proc mount to use for the containers.
- // The default is DefaultProcMount which uses the container runtime defaults for
+ // The default value is Default which uses the container runtime defaults for
// readonly paths and masked paths.
// This requires the ProcMountType feature flag to be enabled.
// Note that this field cannot be set when spec.os.name is windows.
@@ -7410,6 +7652,7 @@ type WindowsSecurityContextOptions struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.0
// RangeAllocation is not a public type.
type RangeAllocation struct {
@@ -7519,3 +7762,23 @@ const (
// the destination set to the node's IP and port or the pod's IP and port.
LoadBalancerIPModeProxy LoadBalancerIPMode = "Proxy"
)
+
+// ImageVolumeSource represents a image volume resource.
+type ImageVolumeSource struct {
+ // Required: Image or artifact reference to be used.
+ // Behaves in the same way as pod.spec.containers[*].image.
+ // Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
+ // More info: https://kubernetes.io/docs/concepts/containers/images
+ // This field is optional to allow higher level config management to default or override
+ // container images in workload controllers like Deployments and StatefulSets.
+ // +optional
+ Reference string `json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"`
+
+ // Policy for pulling OCI objects. Possible values are:
+ // Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
+ // Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
+ // IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
+ // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
+ // +optional
+ PullPolicy PullPolicy `json:"pullPolicy,omitempty" protobuf:"bytes,2,opt,name=pullPolicy,casttype=PullPolicy"`
+}
diff --git a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
index c54f2a2fe50..950806ef8e7 100644
--- a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
@@ -219,16 +219,6 @@ func (CinderVolumeSource) SwaggerDoc() map[string]string {
return map_CinderVolumeSource
}
-var map_ClaimSource = map[string]string{
- "": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.",
- "resourceClaimName": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
- "resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.",
-}
-
-func (ClaimSource) SwaggerDoc() map[string]string {
- return map_ClaimSource
-}
-
var map_ClientIPConfig = map[string]string{
"": "ClientIPConfig represents the configurations of Client IP based session affinity.",
"timeoutSeconds": "timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours).",
@@ -469,25 +459,36 @@ func (ContainerStateWaiting) SwaggerDoc() map[string]string {
}
var map_ContainerStatus = map[string]string{
- "": "ContainerStatus contains details for the current status of this container.",
- "name": "Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.",
- "state": "State holds details about the container's current condition.",
- "lastState": "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.",
- "ready": "Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field).\n\nThe value is typically used to determine whether a container is ready to accept traffic.",
- "restartCount": "RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.",
- "image": "Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.",
- "imageID": "ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.",
- "containerID": "ContainerID is the ID of the container in the format '://'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").",
- "started": "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.",
- "allocatedResources": "AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize.",
- "resources": "Resources represents the compute resource requests and limits that have been successfully enacted on the running container after it has been started or has been successfully resized.",
- "volumeMounts": "Status of volume mounts.",
+ "": "ContainerStatus contains details for the current status of this container.",
+ "name": "Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.",
+ "state": "State holds details about the container's current condition.",
+ "lastState": "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.",
+ "ready": "Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field).\n\nThe value is typically used to determine whether a container is ready to accept traffic.",
+ "restartCount": "RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.",
+ "image": "Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.",
+ "imageID": "ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.",
+ "containerID": "ContainerID is the ID of the container in the format '://'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").",
+ "started": "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.",
+ "allocatedResources": "AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize.",
+ "resources": "Resources represents the compute resource requests and limits that have been successfully enacted on the running container after it has been started or has been successfully resized.",
+ "volumeMounts": "Status of volume mounts.",
+ "user": "User represents user identity information initially attached to the first process of the container",
+ "allocatedResourcesStatus": "AllocatedResourcesStatus represents the status of various resources allocated for this Pod.",
}
func (ContainerStatus) SwaggerDoc() map[string]string {
return map_ContainerStatus
}
+var map_ContainerUser = map[string]string{
+ "": "ContainerUser represents user identity information",
+ "linux": "Linux holds user identity information initially attached to the first process of the containers in Linux. Note that the actual running identity can be changed if the process has enough privilege to do so.",
+}
+
+func (ContainerUser) SwaggerDoc() map[string]string {
+ return map_ContainerUser
+}
+
var map_DaemonEndpoint = map[string]string{
"": "DaemonEndpoint contains information about a single Daemon endpoint.",
"Port": "Port number of the given endpoint.",
@@ -933,6 +934,16 @@ func (ISCSIVolumeSource) SwaggerDoc() map[string]string {
return map_ISCSIVolumeSource
}
+var map_ImageVolumeSource = map[string]string{
+ "": "ImageVolumeSource represents a image volume resource.",
+ "reference": "Required: Image or artifact reference to be used. Behaves in the same way as pod.spec.containers[*].image. Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.",
+ "pullPolicy": "Policy for pulling OCI objects. Possible values are: Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.",
+}
+
+func (ImageVolumeSource) SwaggerDoc() map[string]string {
+ return map_ImageVolumeSource
+}
+
var map_KeyToPath = map[string]string{
"": "Maps a string key to a path within a volume.",
"key": "key is the key to project.",
@@ -1009,6 +1020,17 @@ func (LimitRangeSpec) SwaggerDoc() map[string]string {
return map_LimitRangeSpec
}
+var map_LinuxContainerUser = map[string]string{
+ "": "LinuxContainerUser represents user identity information in Linux containers",
+ "uid": "UID is the primary uid initially attached to the first process in the container",
+ "gid": "GID is the primary gid initially attached to the first process in the container",
+ "supplementalGroups": "SupplementalGroups are the supplemental groups initially attached to the first process in the container",
+}
+
+func (LinuxContainerUser) SwaggerDoc() map[string]string {
+ return map_LinuxContainerUser
+}
+
var map_LoadBalancerIngress = map[string]string{
"": "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.",
"ip": "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)",
@@ -1195,6 +1217,15 @@ func (NodeDaemonEndpoints) SwaggerDoc() map[string]string {
return map_NodeDaemonEndpoints
}
+var map_NodeFeatures = map[string]string{
+ "": "NodeFeatures describes the set of features implemented by the CRI implementation. The features contained in the NodeFeatures should depend only on the cri implementation independent of runtime handlers.",
+ "supplementalGroupsPolicy": "SupplementalGroupsPolicy is set to true if the runtime supports SupplementalGroupsPolicy and ContainerUser.",
+}
+
+func (NodeFeatures) SwaggerDoc() map[string]string {
+ return map_NodeFeatures
+}
+
var map_NodeList = map[string]string{
"": "NodeList is the whole list of all Nodes which have been registered with master.",
"metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
@@ -1225,8 +1256,9 @@ func (NodeRuntimeHandler) SwaggerDoc() map[string]string {
}
var map_NodeRuntimeHandlerFeatures = map[string]string{
- "": "NodeRuntimeHandlerFeatures is a set of runtime features.",
+ "": "NodeRuntimeHandlerFeatures is a set of features implemented by the runtime handler.",
"recursiveReadOnlyMounts": "RecursiveReadOnlyMounts is set to true if the runtime handler supports RecursiveReadOnlyMounts.",
+ "userNamespaces": "UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.",
}
func (NodeRuntimeHandlerFeatures) SwaggerDoc() map[string]string {
@@ -1280,7 +1312,7 @@ func (NodeSpec) SwaggerDoc() map[string]string {
var map_NodeStatus = map[string]string{
"": "NodeStatus is information about the current status of a node.",
- "capacity": "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity",
+ "capacity": "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/reference/node/node-status/#capacity",
"allocatable": "Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.",
"phase": "NodePhase is the recently observed lifecycle phase of the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#phase The field is never populated, and now is deprecated.",
"conditions": "Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition",
@@ -1292,6 +1324,7 @@ var map_NodeStatus = map[string]string{
"volumesAttached": "List of volumes that are attached to the node.",
"config": "Status of the config assigned to the node via the dynamic Kubelet config feature.",
"runtimeHandlers": "The available runtime handlers.",
+ "features": "Features describes the set of features implemented by the CRI implementation.",
}
func (NodeStatus) SwaggerDoc() map[string]string {
@@ -1307,7 +1340,7 @@ var map_NodeSystemInfo = map[string]string{
"osImage": "OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).",
"containerRuntimeVersion": "ContainerRuntime Version reported by the node through runtime remote API (e.g. containerd://1.4.2).",
"kubeletVersion": "Kubelet Version reported by the node.",
- "kubeProxyVersion": "KubeProxy Version reported by the node.",
+ "kubeProxyVersion": "Deprecated: KubeProxy Version reported by the node.",
"operatingSystem": "The Operating System reported by the node",
"architecture": "The Architecture reported by the node",
}
@@ -1395,7 +1428,7 @@ var map_PersistentVolumeClaimSpec = map[string]string{
"volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.",
"dataSource": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.",
"dataSourceRef": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.",
- "volumeAttributesClassName": "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.",
+ "volumeAttributesClassName": "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).",
}
func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string {
@@ -1410,8 +1443,8 @@ var map_PersistentVolumeClaimStatus = map[string]string{
"conditions": "conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'Resizing'.",
"allocatedResources": "allocatedResources tracks the resources allocated to a PVC including its capacity. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nCapacity reported here may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity.\n\nA controller that receives PVC update with previously unknown resourceName should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.",
"allocatedResourceStatuses": "allocatedResourceStatuses stores status of resource being resized for the given PVC. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nClaimResourceStatus can be in any of following states:\n\t- ControllerResizeInProgress:\n\t\tState set when resize controller starts resizing the volume in control-plane.\n\t- ControllerResizeFailed:\n\t\tState set when resize has failed in resize controller with a terminal error.\n\t- NodeResizePending:\n\t\tState set when resize controller has finished resizing the volume but further resizing of\n\t\tvolume is needed on the node.\n\t- NodeResizeInProgress:\n\t\tState set when kubelet starts resizing the volume.\n\t- NodeResizeFailed:\n\t\tState set when resizing has failed in kubelet with a terminal error. Transient errors don't set\n\t\tNodeResizeFailed.\nFor example: if expanding a PVC for more capacity - this field can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeFailed\"\nWhen this field is not set, it means that no resize operation is in progress for the given PVC.\n\nA controller that receives PVC update with previously unknown resourceName or ClaimResourceStatus should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.",
- "currentVolumeAttributesClassName": "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is an alpha field and requires enabling VolumeAttributesClass feature.",
- "modifyVolumeStatus": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is an alpha field and requires enabling VolumeAttributesClass feature.",
+ "currentVolumeAttributesClassName": "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is a beta field and requires enabling VolumeAttributesClass feature (off by default).",
+ "modifyVolumeStatus": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).",
}
func (PersistentVolumeClaimStatus) SwaggerDoc() map[string]string {
@@ -1488,7 +1521,7 @@ var map_PersistentVolumeSpec = map[string]string{
"mountOptions": "mountOptions is the list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options",
"volumeMode": "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.",
"nodeAffinity": "nodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume.",
- "volumeAttributesClassName": "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is an alpha field and requires enabling VolumeAttributesClass feature.",
+ "volumeAttributesClassName": "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).",
}
func (PersistentVolumeSpec) SwaggerDoc() map[string]string {
@@ -1500,7 +1533,7 @@ var map_PersistentVolumeStatus = map[string]string{
"phase": "phase indicates if a volume is available, bound to a claim, or released by a claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase",
"message": "message is a human-readable message indicating details about why the volume is in this state.",
"reason": "reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.",
- "lastPhaseTransitionTime": "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).",
+ "lastPhaseTransitionTime": "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions.",
}
func (PersistentVolumeStatus) SwaggerDoc() map[string]string {
@@ -1544,8 +1577,8 @@ var map_PodAffinityTerm = map[string]string{
"namespaces": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".",
"topologyKey": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.",
"namespaceSelector": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces.",
- "matchLabelKeys": "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.",
- "mismatchLabelKeys": "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.",
+ "matchLabelKeys": "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).",
+ "mismatchLabelKeys": "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).",
}
func (PodAffinityTerm) SwaggerDoc() map[string]string {
@@ -1696,9 +1729,10 @@ func (PodReadinessGate) SwaggerDoc() map[string]string {
}
var map_PodResourceClaim = map[string]string{
- "": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
- "name": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
- "source": "Source describes where to find the ResourceClaim.",
+ "": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
+ "name": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
+ "resourceClaimName": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
+ "resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
}
func (PodResourceClaim) SwaggerDoc() map[string]string {
@@ -1708,7 +1742,7 @@ func (PodResourceClaim) SwaggerDoc() map[string]string {
var map_PodResourceClaimStatus = map[string]string{
"": "PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.",
"name": "Name uniquely identifies this resource claim inside the pod. This must match the name of an entry in pod.spec.resourceClaims, which implies that the string must be a DNS_LABEL.",
- "resourceClaimName": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. It this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.",
+ "resourceClaimName": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.",
}
func (PodResourceClaimStatus) SwaggerDoc() map[string]string {
@@ -1725,18 +1759,19 @@ func (PodSchedulingGate) SwaggerDoc() map[string]string {
}
var map_PodSecurityContext = map[string]string{
- "": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.",
- "seLinuxOptions": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.",
- "windowsOptions": "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.",
- "runAsUser": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.",
- "runAsGroup": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.",
- "runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
- "supplementalGroups": "A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.",
- "fsGroup": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw ",
- "sysctls": "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.",
- "fsGroupChangePolicy": "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.",
- "seccompProfile": "The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.",
- "appArmorProfile": "appArmorProfile is the AppArmor options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.",
+ "": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.",
+ "seLinuxOptions": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.",
+ "windowsOptions": "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.",
+ "runAsUser": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.",
+ "runAsGroup": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.",
+ "runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
+ "supplementalGroups": "A list of groups applied to the first process run in each container, in addition to the container's primary GID and fsGroup (if specified). If the SupplementalGroupsPolicy feature is enabled, the supplementalGroupsPolicy field determines whether these are in addition to or instead of any group memberships defined in the container image. If unspecified, no additional groups are added, though group memberships defined in the container image may still be used, depending on the supplementalGroupsPolicy field. Note that this field cannot be set when spec.os.name is windows.",
+ "supplementalGroupsPolicy": "Defines how supplemental groups of the first container processes are calculated. Valid values are \"Merge\" and \"Strict\". If not specified, \"Merge\" is used. (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled and the container runtime must implement support for this feature. Note that this field cannot be set when spec.os.name is windows.",
+ "fsGroup": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw ",
+ "sysctls": "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.",
+ "fsGroupChangePolicy": "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.",
+ "seccompProfile": "The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.",
+ "appArmorProfile": "appArmorProfile is the AppArmor options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.",
}
func (PodSecurityContext) SwaggerDoc() map[string]string {
@@ -1766,7 +1801,7 @@ var map_PodSpec = map[string]string{
"serviceAccountName": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/",
"serviceAccount": "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.",
"automountServiceAccountToken": "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.",
- "nodeName": "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.",
+ "nodeName": "NodeName indicates in which node this pod is scheduled. If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. This field should not be used to express a desire for the pod to be scheduled on a specific node. https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename",
"hostNetwork": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.",
"hostPID": "Use the host's pid namespace. Optional: Default to false.",
"hostIPC": "Use the host's ipc namespace. Optional: Default to false.",
@@ -1789,7 +1824,7 @@ var map_PodSpec = map[string]string{
"overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md",
"topologySpreadConstraints": "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.",
"setHostnameAsFQDN": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.",
- "os": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup",
+ "os": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup",
"hostUsers": "Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.",
"schedulingGates": "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod.\n\nSchedulingGates can only be set at pod creation time, and be removed only afterwards.",
"resourceClaims": "ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable.",
@@ -1943,7 +1978,7 @@ func (ProbeHandler) SwaggerDoc() map[string]string {
var map_ProjectedVolumeSource = map[string]string{
"": "Represents a projected volume source",
- "sources": "sources is the list of volume projections",
+ "sources": "sources is the list of volume projections. Each entry in this list handles one source.",
"defaultMode": "defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.",
}
@@ -2069,8 +2104,9 @@ func (ReplicationControllerStatus) SwaggerDoc() map[string]string {
}
var map_ResourceClaim = map[string]string{
- "": "ResourceClaim references one entry in PodSpec.ResourceClaims.",
- "name": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.",
+ "": "ResourceClaim references one entry in PodSpec.ResourceClaims.",
+ "name": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.",
+ "request": "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.",
}
func (ResourceClaim) SwaggerDoc() map[string]string {
@@ -2088,6 +2124,16 @@ func (ResourceFieldSelector) SwaggerDoc() map[string]string {
return map_ResourceFieldSelector
}
+var map_ResourceHealth = map[string]string{
+ "": "ResourceHealth represents the health of a resource. It has the latest device health information. This is a part of KEP https://kep.k8s.io/4680 and historical health changes are planned to be added in future iterations of a KEP.",
+ "resourceID": "ResourceID is the unique identifier of the resource. See the ResourceID type for more information.",
+ "health": "Health of the resource. can be one of:\n - Healthy: operates as normal\n - Unhealthy: reported unhealthy. We consider this a temporary health issue\n since we do not have a mechanism today to distinguish\n temporary and permanent issues.\n - Unknown: The status cannot be determined.\n For example, Device Plugin got unregistered and hasn't been re-registered since.\n\nIn future we may want to introduce the PermanentlyUnhealthy Status.",
+}
+
+func (ResourceHealth) SwaggerDoc() map[string]string {
+ return map_ResourceHealth
+}
+
var map_ResourceQuota = map[string]string{
"": "ResourceQuota sets aggregate quota restrictions enforced per namespace",
"metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
@@ -2141,6 +2187,15 @@ func (ResourceRequirements) SwaggerDoc() map[string]string {
return map_ResourceRequirements
}
+var map_ResourceStatus = map[string]string{
+ "name": "Name of the resource. Must be unique within the pod and match one of the resources from the pod spec.",
+ "resources": "List of unique Resources health. Each element in the list contains an unique resource ID and resource health. At a minimum, ResourceID must uniquely identify the Resource allocated to the Pod on the Node for the lifetime of a Pod. See ResourceID type for it's definition.",
+}
+
+func (ResourceStatus) SwaggerDoc() map[string]string {
+ return map_ResourceStatus
+}
+
var map_SELinuxOptions = map[string]string{
"": "SELinuxOptions are the labels to be applied to the container",
"user": "User is a SELinux user label that applies to the container.",
@@ -2304,7 +2359,7 @@ var map_SecurityContext = map[string]string{
"runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
"readOnlyRootFilesystem": "Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.",
"allowPrivilegeEscalation": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.",
- "procMount": "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.",
+ "procMount": "procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.",
"seccompProfile": "The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.",
"appArmorProfile": "appArmorProfile is the AppArmor options to use by this container. If set, this profile overrides the pod's appArmorProfile. Note that this field cannot be set when spec.os.name is windows.",
}
@@ -2639,7 +2694,7 @@ func (VolumeNodeAffinity) SwaggerDoc() map[string]string {
}
var map_VolumeProjection = map[string]string{
- "": "Projection that may be projected along with other supported volume types",
+ "": "Projection that may be projected along with other supported volume types. Exactly one of these fields must be set.",
"secret": "secret information about the secret data to project",
"downwardAPI": "downwardAPI information about the downwardAPI data to project",
"configMap": "configMap information about the configMap data to project",
@@ -2692,6 +2747,7 @@ var map_VolumeSource = map[string]string{
"storageos": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.",
"csi": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).",
"ephemeral": "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.",
+ "image": "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.",
}
func (VolumeSource) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
index 08e927848ec..3d23f7f620e 100644
--- a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
@@ -440,32 +440,6 @@ func (in *CinderVolumeSource) DeepCopy() *CinderVolumeSource {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ClaimSource) DeepCopyInto(out *ClaimSource) {
- *out = *in
- if in.ResourceClaimName != nil {
- in, out := &in.ResourceClaimName, &out.ResourceClaimName
- *out = new(string)
- **out = **in
- }
- if in.ResourceClaimTemplateName != nil {
- in, out := &in.ResourceClaimTemplateName, &out.ResourceClaimTemplateName
- *out = new(string)
- **out = **in
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClaimSource.
-func (in *ClaimSource) DeepCopy() *ClaimSource {
- if in == nil {
- return nil
- }
- out := new(ClaimSource)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClientIPConfig) DeepCopyInto(out *ClientIPConfig) {
*out = *in
@@ -1069,6 +1043,18 @@ func (in *ContainerStatus) DeepCopyInto(out *ContainerStatus) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.User != nil {
+ in, out := &in.User, &out.User
+ *out = new(ContainerUser)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.AllocatedResourcesStatus != nil {
+ in, out := &in.AllocatedResourcesStatus, &out.AllocatedResourcesStatus
+ *out = make([]ResourceStatus, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
return
}
@@ -1082,6 +1068,27 @@ func (in *ContainerStatus) DeepCopy() *ContainerStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ContainerUser) DeepCopyInto(out *ContainerUser) {
+ *out = *in
+ if in.Linux != nil {
+ in, out := &in.Linux, &out.Linux
+ *out = new(LinuxContainerUser)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerUser.
+func (in *ContainerUser) DeepCopy() *ContainerUser {
+ if in == nil {
+ return nil
+ }
+ out := new(ContainerUser)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DaemonEndpoint) DeepCopyInto(out *DaemonEndpoint) {
*out = *in
@@ -2044,6 +2051,22 @@ func (in *ISCSIVolumeSource) DeepCopy() *ISCSIVolumeSource {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ImageVolumeSource) DeepCopyInto(out *ImageVolumeSource) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageVolumeSource.
+func (in *ImageVolumeSource) DeepCopy() *ImageVolumeSource {
+ if in == nil {
+ return nil
+ }
+ out := new(ImageVolumeSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KeyToPath) DeepCopyInto(out *KeyToPath) {
*out = *in
@@ -2261,6 +2284,27 @@ func (in *LimitRangeSpec) DeepCopy() *LimitRangeSpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LinuxContainerUser) DeepCopyInto(out *LinuxContainerUser) {
+ *out = *in
+ if in.SupplementalGroups != nil {
+ in, out := &in.SupplementalGroups, &out.SupplementalGroups
+ *out = make([]int64, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinuxContainerUser.
+func (in *LinuxContainerUser) DeepCopy() *LinuxContainerUser {
+ if in == nil {
+ return nil
+ }
+ out := new(LinuxContainerUser)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *List) DeepCopyInto(out *List) {
*out = *in
@@ -2695,6 +2739,27 @@ func (in *NodeDaemonEndpoints) DeepCopy() *NodeDaemonEndpoints {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *NodeFeatures) DeepCopyInto(out *NodeFeatures) {
+ *out = *in
+ if in.SupplementalGroupsPolicy != nil {
+ in, out := &in.SupplementalGroupsPolicy, &out.SupplementalGroupsPolicy
+ *out = new(bool)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFeatures.
+func (in *NodeFeatures) DeepCopy() *NodeFeatures {
+ if in == nil {
+ return nil
+ }
+ out := new(NodeFeatures)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeList) DeepCopyInto(out *NodeList) {
*out = *in
@@ -2782,6 +2847,11 @@ func (in *NodeRuntimeHandlerFeatures) DeepCopyInto(out *NodeRuntimeHandlerFeatur
*out = new(bool)
**out = **in
}
+ if in.UserNamespaces != nil {
+ in, out := &in.UserNamespaces, &out.UserNamespaces
+ *out = new(bool)
+ **out = **in
+ }
return
}
@@ -2962,6 +3032,11 @@ func (in *NodeStatus) DeepCopyInto(out *NodeStatus) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.Features != nil {
+ in, out := &in.Features, &out.Features
+ *out = new(NodeFeatures)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -3971,7 +4046,16 @@ func (in *PodReadinessGate) DeepCopy() *PodReadinessGate {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodResourceClaim) DeepCopyInto(out *PodResourceClaim) {
*out = *in
- in.Source.DeepCopyInto(&out.Source)
+ if in.ResourceClaimName != nil {
+ in, out := &in.ResourceClaimName, &out.ResourceClaimName
+ *out = new(string)
+ **out = **in
+ }
+ if in.ResourceClaimTemplateName != nil {
+ in, out := &in.ResourceClaimTemplateName, &out.ResourceClaimTemplateName
+ *out = new(string)
+ **out = **in
+ }
return
}
@@ -4055,6 +4139,11 @@ func (in *PodSecurityContext) DeepCopyInto(out *PodSecurityContext) {
*out = make([]int64, len(*in))
copy(*out, *in)
}
+ if in.SupplementalGroupsPolicy != nil {
+ in, out := &in.SupplementalGroupsPolicy, &out.SupplementalGroupsPolicy
+ *out = new(SupplementalGroupsPolicy)
+ **out = **in
+ }
if in.FSGroup != nil {
in, out := &in.FSGroup, &out.FSGroup
*out = new(int64)
@@ -4900,6 +4989,22 @@ func (in *ResourceFieldSelector) DeepCopy() *ResourceFieldSelector {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResourceHealth) DeepCopyInto(out *ResourceHealth) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceHealth.
+func (in *ResourceHealth) DeepCopy() *ResourceHealth {
+ if in == nil {
+ return nil
+ }
+ out := new(ResourceHealth)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in ResourceList) DeepCopyInto(out *ResourceList) {
{
@@ -5081,6 +5186,27 @@ func (in *ResourceRequirements) DeepCopy() *ResourceRequirements {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus) {
+ *out = *in
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]ResourceHealth, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStatus.
+func (in *ResourceStatus) DeepCopy() *ResourceStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(ResourceStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SELinuxOptions) DeepCopyInto(out *SELinuxOptions) {
*out = *in
@@ -6426,6 +6552,11 @@ func (in *VolumeSource) DeepCopyInto(out *VolumeSource) {
*out = new(EphemeralVolumeSource)
(*in).DeepCopyInto(*out)
}
+ if in.Image != nil {
+ in, out := &in.Image, &out.Image
+ *out = new(ImageVolumeSource)
+ **out = **in
+ }
return
}
diff --git a/vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..6710a96d1c0
--- /dev/null
+++ b/vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,274 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Binding) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ConfigMap) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ConfigMapList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Endpoints) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *EndpointsList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Event) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *EventList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *LimitRange) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *LimitRangeList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *List) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Namespace) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *NamespaceList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Node) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *NodeList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *NodeProxyOptions) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PersistentVolume) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PersistentVolumeClaim) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PersistentVolumeClaimList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PersistentVolumeList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Pod) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodAttachOptions) APILifecycleIntroduced() (major, minor int) {
+ return 1, 1
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodExecOptions) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodLogOptions) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodPortForwardOptions) APILifecycleIntroduced() (major, minor int) {
+ return 1, 6
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodProxyOptions) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodStatusResult) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodTemplate) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodTemplateList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *RangeAllocation) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ReplicationController) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ReplicationControllerList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ResourceQuota) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ResourceQuotaList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Secret) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *SecretList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *SerializedReference) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Service) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ServiceAccount) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ServiceAccountList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ServiceList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 0
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ServiceProxyOptions) APILifecycleIntroduced() (major, minor int) {
+ return 1, 2
+}
diff --git a/vendor/k8s.io/api/discovery/v1/doc.go b/vendor/k8s.io/api/discovery/v1/doc.go
index 96ae531ce71..01913669fff 100644
--- a/vendor/k8s.io/api/discovery/v1/doc.go
+++ b/vendor/k8s.io/api/discovery/v1/doc.go
@@ -17,6 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=discovery.k8s.io
package v1 // import "k8s.io/api/discovery/v1"
diff --git a/vendor/k8s.io/api/discovery/v1/generated.proto b/vendor/k8s.io/api/discovery/v1/generated.proto
index 6d234017b72..8ddf0dc5d3e 100644
--- a/vendor/k8s.io/api/discovery/v1/generated.proto
+++ b/vendor/k8s.io/api/discovery/v1/generated.proto
@@ -54,7 +54,7 @@ message Endpoint {
// targetRef is a reference to a Kubernetes object that represents this
// endpoint.
// +optional
- optional k8s.io.api.core.v1.ObjectReference targetRef = 4;
+ optional .k8s.io.api.core.v1.ObjectReference targetRef = 4;
// deprecatedTopology contains topology information part of the v1beta1
// API. This field is deprecated, and will be removed when the v1beta1
@@ -161,7 +161,7 @@ message EndpointPort {
message EndpointSlice {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// addressType specifies the type of address carried by this EndpointSlice.
// All addresses in this slice must be the same type. This field is
@@ -191,7 +191,7 @@ message EndpointSlice {
message EndpointSliceList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of endpoint slices
repeated EndpointSlice items = 2;
diff --git a/vendor/k8s.io/api/discovery/v1/types.go b/vendor/k8s.io/api/discovery/v1/types.go
index 7ebb07ca359..d6a9d0fcedb 100644
--- a/vendor/k8s.io/api/discovery/v1/types.go
+++ b/vendor/k8s.io/api/discovery/v1/types.go
@@ -23,6 +23,7 @@ import (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.21
// EndpointSlice represents a subset of the endpoints that implement a service.
// For a given service there may be multiple EndpointSlice objects, selected by
@@ -206,6 +207,7 @@ type EndpointPort struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.21
// EndpointSliceList represents a list of endpoint slices
type EndpointSliceList struct {
diff --git a/vendor/k8s.io/api/discovery/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/discovery/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..362867c5b90
--- /dev/null
+++ b/vendor/k8s.io/api/discovery/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *EndpointSlice) APILifecycleIntroduced() (major, minor int) {
+ return 1, 21
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *EndpointSliceList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 21
+}
diff --git a/vendor/k8s.io/api/discovery/v1beta1/generated.proto b/vendor/k8s.io/api/discovery/v1beta1/generated.proto
index ec555a40b3a..55828dd97d2 100644
--- a/vendor/k8s.io/api/discovery/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/discovery/v1beta1/generated.proto
@@ -54,7 +54,7 @@ message Endpoint {
// targetRef is a reference to a Kubernetes object that represents this
// endpoint.
// +optional
- optional k8s.io.api.core.v1.ObjectReference targetRef = 4;
+ optional .k8s.io.api.core.v1.ObjectReference targetRef = 4;
// topology contains arbitrary topology information associated with the
// endpoint. These key/value pairs must conform with the label format.
@@ -153,7 +153,7 @@ message EndpointPort {
message EndpointSlice {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// addressType specifies the type of address carried by this EndpointSlice.
// All addresses in this slice must be the same type. This field is
@@ -183,7 +183,7 @@ message EndpointSlice {
message EndpointSliceList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of endpoint slices
repeated EndpointSlice items = 2;
diff --git a/vendor/k8s.io/api/events/v1/doc.go b/vendor/k8s.io/api/events/v1/doc.go
index 6e320e06340..5fe700ffcf8 100644
--- a/vendor/k8s.io/api/events/v1/doc.go
+++ b/vendor/k8s.io/api/events/v1/doc.go
@@ -17,7 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
-
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=events.k8s.io
package v1 // import "k8s.io/api/events/v1"
diff --git a/vendor/k8s.io/api/events/v1/generated.proto b/vendor/k8s.io/api/events/v1/generated.proto
index cfa16b021b6..6c7e4cca195 100644
--- a/vendor/k8s.io/api/events/v1/generated.proto
+++ b/vendor/k8s.io/api/events/v1/generated.proto
@@ -39,10 +39,10 @@ message Event {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// eventTime is the time when this Event was first observed. It is required.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 2;
// series is data about the Event series this event represents or nil if it's a singleton Event.
// +optional
@@ -68,12 +68,12 @@ message Event {
// implements, e.g. ReplicaSetController implements ReplicaSets and this event is emitted because
// it acts on some changes in a ReplicaSet object.
// +optional
- optional k8s.io.api.core.v1.ObjectReference regarding = 8;
+ optional .k8s.io.api.core.v1.ObjectReference regarding = 8;
// related is the optional secondary object for more complex actions. E.g. when regarding object triggers
// a creation or deletion of related object.
// +optional
- optional k8s.io.api.core.v1.ObjectReference related = 9;
+ optional .k8s.io.api.core.v1.ObjectReference related = 9;
// note is a human-readable description of the status of this operation.
// Maximal length of the note is 1kB, but libraries should be prepared to
@@ -88,15 +88,15 @@ message Event {
// deprecatedSource is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
- optional k8s.io.api.core.v1.EventSource deprecatedSource = 12;
+ optional .k8s.io.api.core.v1.EventSource deprecatedSource = 12;
// deprecatedFirstTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedFirstTimestamp = 13;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedFirstTimestamp = 13;
// deprecatedLastTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedLastTimestamp = 14;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedLastTimestamp = 14;
// deprecatedCount is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
@@ -108,7 +108,7 @@ message EventList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated Event items = 2;
@@ -123,6 +123,6 @@ message EventSeries {
optional int32 count = 1;
// lastObservedTime is the time when last Event from the series was seen before last heartbeat.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2;
}
diff --git a/vendor/k8s.io/api/events/v1/types.go b/vendor/k8s.io/api/events/v1/types.go
index e01a2b21e73..86b12eee15d 100644
--- a/vendor/k8s.io/api/events/v1/types.go
+++ b/vendor/k8s.io/api/events/v1/types.go
@@ -23,6 +23,7 @@ import (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system.
// Events have a limited retention time and triggers and messages may evolve
@@ -109,6 +110,7 @@ type EventSeries struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// EventList is a list of Event objects.
type EventList struct {
diff --git a/vendor/k8s.io/api/events/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/events/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..5217d1ac690
--- /dev/null
+++ b/vendor/k8s.io/api/events/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Event) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *EventList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
diff --git a/vendor/k8s.io/api/events/v1beta1/generated.proto b/vendor/k8s.io/api/events/v1beta1/generated.proto
index de60bdc3e8c..fbdb3097017 100644
--- a/vendor/k8s.io/api/events/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/events/v1beta1/generated.proto
@@ -39,10 +39,10 @@ message Event {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// eventTime is the time when this Event was first observed. It is required.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 2;
// series is data about the Event series this event represents or nil if it's a singleton Event.
// +optional
@@ -72,12 +72,12 @@ message Event {
// implements, e.g. ReplicaSetController implements ReplicaSets and this event is emitted because
// it acts on some changes in a ReplicaSet object.
// +optional
- optional k8s.io.api.core.v1.ObjectReference regarding = 8;
+ optional .k8s.io.api.core.v1.ObjectReference regarding = 8;
// related is the optional secondary object for more complex actions. E.g. when regarding object triggers
// a creation or deletion of related object.
// +optional
- optional k8s.io.api.core.v1.ObjectReference related = 9;
+ optional .k8s.io.api.core.v1.ObjectReference related = 9;
// note is a human-readable description of the status of this operation.
// Maximal length of the note is 1kB, but libraries should be prepared to
@@ -92,15 +92,15 @@ message Event {
// deprecatedSource is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
- optional k8s.io.api.core.v1.EventSource deprecatedSource = 12;
+ optional .k8s.io.api.core.v1.EventSource deprecatedSource = 12;
// deprecatedFirstTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedFirstTimestamp = 13;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedFirstTimestamp = 13;
// deprecatedLastTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedLastTimestamp = 14;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedLastTimestamp = 14;
// deprecatedCount is the deprecated field assuring backward compatibility with core.v1 Event type.
// +optional
@@ -112,7 +112,7 @@ message EventList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated Event items = 2;
@@ -125,6 +125,6 @@ message EventSeries {
optional int32 count = 1;
// lastObservedTime is the time when last Event from the series was seen before last heartbeat.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2;
}
diff --git a/vendor/k8s.io/api/extensions/v1beta1/generated.proto b/vendor/k8s.io/api/extensions/v1beta1/generated.proto
index 60effc8f711..9bbcaa0e261 100644
--- a/vendor/k8s.io/api/extensions/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/extensions/v1beta1/generated.proto
@@ -37,7 +37,7 @@ message DaemonSet {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The desired behavior of this daemon set.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -63,7 +63,7 @@ message DaemonSetCondition {
// Last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -79,7 +79,7 @@ message DaemonSetList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// A list of daemon sets.
repeated DaemonSet items = 2;
@@ -92,14 +92,14 @@ message DaemonSetSpec {
// If empty, defaulted to labels on Pod template.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1;
// An object that describes the pod that will be created.
// The DaemonSet will create exactly one copy of this pod on every node
// that matches the template's node selector (or on every node if no node
// selector is specified).
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
- optional k8s.io.api.core.v1.PodTemplateSpec template = 2;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 2;
// An update strategy to replace existing DaemonSet pods with new pods.
// +optional
@@ -205,7 +205,7 @@ message DaemonSetUpdateStrategy {
message Deployment {
// Standard object metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the Deployment.
// +optional
@@ -225,10 +225,10 @@ message DeploymentCondition {
optional string status = 2;
// The last time this condition was updated.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
// Last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
// The reason for the condition's last transition.
optional string reason = 4;
@@ -241,7 +241,7 @@ message DeploymentCondition {
message DeploymentList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of Deployments.
repeated Deployment items = 2;
@@ -271,10 +271,10 @@ message DeploymentSpec {
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// Template describes the pods that will be created.
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
// The deployment strategy to use to replace existing pods with new ones.
// +optional
@@ -440,7 +440,7 @@ message Ingress {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec is the desired state of the Ingress.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -461,13 +461,13 @@ message IngressBackend {
// Specifies the port of the referenced service.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString servicePort = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString servicePort = 2;
// Resource is an ObjectRef to another Kubernetes resource in the namespace
// of the Ingress object. If resource is specified, serviceName and servicePort
// must not be specified.
// +optional
- optional k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
+ optional .k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
}
// IngressList is a collection of Ingress.
@@ -475,7 +475,7 @@ message IngressList {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of Ingress.
repeated Ingress items = 2;
@@ -651,7 +651,7 @@ message NetworkPolicy {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior for this NetworkPolicy.
// +optional
@@ -710,7 +710,7 @@ message NetworkPolicyList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of schema objects.
repeated NetworkPolicy items = 2;
@@ -725,7 +725,7 @@ message NetworkPolicyPeer {
// the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
// Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
// Selects Namespaces using cluster-scoped labels. This field follows standard label
// selector semantics; if present but empty, it selects all namespaces.
@@ -734,7 +734,7 @@ message NetworkPolicyPeer {
// the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
// Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
// IPBlock defines policy on a particular IPBlock. If this field is set then
// neither of the other fields can be.
@@ -754,7 +754,7 @@ message NetworkPolicyPort {
// numbers.
// If present, only traffic on the specified protocol AND port will be matched.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
// If set, indicates that the range of ports from port to endPort, inclusive,
// should be allowed by the policy. This field cannot be defined if the port field
@@ -771,7 +771,7 @@ message NetworkPolicySpec {
// same set of pods. In this case, the ingress rules for each are combined additively.
// This field is NOT optional and follows standard label selector semantics.
// An empty podSelector matches all pods in this namespace.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
// List of ingress rules to be applied to the selected pods.
// Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
@@ -818,7 +818,7 @@ message ReplicaSet {
// be the same as the Pod(s) that the ReplicaSet manages.
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the ReplicaSet.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -844,7 +844,7 @@ message ReplicaSetCondition {
// The last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// The reason for the condition's last transition.
// +optional
@@ -860,7 +860,7 @@ message ReplicaSetList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of ReplicaSets.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
@@ -887,13 +887,13 @@ message ReplicaSetSpec {
// Label keys and values that must match in order to be controlled by this replica set.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
// +optional
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
}
// ReplicaSetStatus represents the current status of a ReplicaSet.
@@ -951,7 +951,7 @@ message RollingUpdateDaemonSet {
// 70% of original number of DaemonSet pods are available at all times during
// the update.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of nodes with an existing available DaemonSet pod that
// can have an updated DaemonSet pod during during an update.
@@ -973,7 +973,7 @@ message RollingUpdateDaemonSet {
// cause evictions during disruption.
// This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
}
// Spec to control the desired behavior of rolling update.
@@ -989,7 +989,7 @@ message RollingUpdateDeployment {
// that the total number of pods available at all times during the update is at
// least 70% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
// The maximum number of pods that can be scheduled above the desired number of
// pods.
@@ -1003,14 +1003,14 @@ message RollingUpdateDeployment {
// new RC can be scaled up further, ensuring that total number of pods running
// at any time during the update is at most 130% of desired pods.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
}
// represents a scaling request for a resource.
message Scale {
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
// +optional
diff --git a/vendor/k8s.io/api/extensions/v1beta1/types.go b/vendor/k8s.io/api/extensions/v1beta1/types.go
index cc2deadac0a..09f58692f48 100644
--- a/vendor/k8s.io/api/extensions/v1beta1/types.go
+++ b/vendor/k8s.io/api/extensions/v1beta1/types.go
@@ -775,7 +775,7 @@ type IngressRule struct {
// default backend, is left to the controller fulfilling the Ingress. Http is
// currently the only supported IngressRuleValue.
// +optional
- IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
+ IngressRuleValue `json:",inline" protobuf:"bytes,2,opt,name=ingressRuleValue"`
}
// IngressRuleValue represents a rule to apply against incoming requests. If the
diff --git a/vendor/k8s.io/api/flowcontrol/v1/doc.go b/vendor/k8s.io/api/flowcontrol/v1/doc.go
index 1bc51d40665..c9e7db15893 100644
--- a/vendor/k8s.io/api/flowcontrol/v1/doc.go
+++ b/vendor/k8s.io/api/flowcontrol/v1/doc.go
@@ -17,6 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=flowcontrol.apiserver.k8s.io
diff --git a/vendor/k8s.io/api/flowcontrol/v1/generated.proto b/vendor/k8s.io/api/flowcontrol/v1/generated.proto
index a5c6f4fc4f3..33a135889e5 100644
--- a/vendor/k8s.io/api/flowcontrol/v1/generated.proto
+++ b/vendor/k8s.io/api/flowcontrol/v1/generated.proto
@@ -76,7 +76,7 @@ message FlowSchema {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a FlowSchema.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -101,7 +101,7 @@ message FlowSchemaCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -115,7 +115,7 @@ message FlowSchemaList {
// `metadata` is the standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of FlowSchemas.
repeated FlowSchema items = 2;
@@ -302,7 +302,7 @@ message PriorityLevelConfiguration {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a "request-priority".
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -327,7 +327,7 @@ message PriorityLevelConfigurationCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -341,7 +341,7 @@ message PriorityLevelConfigurationList {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of request-priorities.
repeated PriorityLevelConfiguration items = 2;
diff --git a/vendor/k8s.io/api/flowcontrol/v1/types.go b/vendor/k8s.io/api/flowcontrol/v1/types.go
index e62d23280e5..ad72bcee228 100644
--- a/vendor/k8s.io/api/flowcontrol/v1/types.go
+++ b/vendor/k8s.io/api/flowcontrol/v1/types.go
@@ -106,6 +106,7 @@ const (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.29
// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with
// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher".
@@ -126,6 +127,7 @@ type FlowSchema struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.29
// FlowSchemaList is a list of FlowSchema objects.
type FlowSchemaList struct {
@@ -381,6 +383,7 @@ type FlowSchemaConditionType string
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.29
// PriorityLevelConfiguration represents the configuration of a priority level.
type PriorityLevelConfiguration struct {
@@ -400,6 +403,7 @@ type PriorityLevelConfiguration struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.29
// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
type PriorityLevelConfigurationList struct {
diff --git a/vendor/k8s.io/api/flowcontrol/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/flowcontrol/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..fbab9868c70
--- /dev/null
+++ b/vendor/k8s.io/api/flowcontrol/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,46 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *FlowSchema) APILifecycleIntroduced() (major, minor int) {
+ return 1, 29
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *FlowSchemaList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 29
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PriorityLevelConfiguration) APILifecycleIntroduced() (major, minor int) {
+ return 1, 29
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PriorityLevelConfigurationList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 29
+}
diff --git a/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto b/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto
index 04b54820c73..61ed3833aee 100644
--- a/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto
@@ -76,7 +76,7 @@ message FlowSchema {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a FlowSchema.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -101,7 +101,7 @@ message FlowSchemaCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -115,7 +115,7 @@ message FlowSchemaList {
// `metadata` is the standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of FlowSchemas.
repeated FlowSchema items = 2;
@@ -295,7 +295,7 @@ message PriorityLevelConfiguration {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a "request-priority".
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -320,7 +320,7 @@ message PriorityLevelConfigurationCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -334,7 +334,7 @@ message PriorityLevelConfigurationList {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of request-priorities.
repeated PriorityLevelConfiguration items = 2;
diff --git a/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto b/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto
index a832114afea..d6073fc9259 100644
--- a/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto
+++ b/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto
@@ -76,7 +76,7 @@ message FlowSchema {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a FlowSchema.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -101,7 +101,7 @@ message FlowSchemaCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -115,7 +115,7 @@ message FlowSchemaList {
// `metadata` is the standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of FlowSchemas.
repeated FlowSchema items = 2;
@@ -295,7 +295,7 @@ message PriorityLevelConfiguration {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a "request-priority".
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -320,7 +320,7 @@ message PriorityLevelConfigurationCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -334,7 +334,7 @@ message PriorityLevelConfigurationList {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of request-priorities.
repeated PriorityLevelConfiguration items = 2;
diff --git a/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto b/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto
index eda0f7829e7..c6504d4353f 100644
--- a/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto
+++ b/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto
@@ -76,7 +76,7 @@ message FlowSchema {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a FlowSchema.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -101,7 +101,7 @@ message FlowSchemaCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -115,7 +115,7 @@ message FlowSchemaList {
// `metadata` is the standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of FlowSchemas.
repeated FlowSchema items = 2;
@@ -297,7 +297,7 @@ message PriorityLevelConfiguration {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// `spec` is the specification of the desired behavior of a "request-priority".
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -322,7 +322,7 @@ message PriorityLevelConfigurationCondition {
optional string status = 2;
// `lastTransitionTime` is the last time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
optional string reason = 4;
@@ -336,7 +336,7 @@ message PriorityLevelConfigurationList {
// `metadata` is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// `items` is a list of request-priorities.
repeated PriorityLevelConfiguration items = 2;
diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto b/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto
index fd55972f203..5ea5c0ec8e8 100644
--- a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto
@@ -33,7 +33,7 @@ message ImageReview {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the pod being evaluated
optional ImageReviewSpec spec = 2;
diff --git a/vendor/k8s.io/api/networking/v1/doc.go b/vendor/k8s.io/api/networking/v1/doc.go
index d3ffd5ed178..1d13e7bab31 100644
--- a/vendor/k8s.io/api/networking/v1/doc.go
+++ b/vendor/k8s.io/api/networking/v1/doc.go
@@ -17,6 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=networking.k8s.io
package v1 // import "k8s.io/api/networking/v1"
diff --git a/vendor/k8s.io/api/networking/v1/generated.proto b/vendor/k8s.io/api/networking/v1/generated.proto
index 22a9085a54a..c72fdc8f379 100644
--- a/vendor/k8s.io/api/networking/v1/generated.proto
+++ b/vendor/k8s.io/api/networking/v1/generated.proto
@@ -96,7 +96,7 @@ message Ingress {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the desired state of the Ingress.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -121,7 +121,7 @@ message IngressBackend {
// service.Port must not be specified.
// This is a mutually exclusive setting with "Service".
// +optional
- optional k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
+ optional .k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
}
// IngressClass represents the class of the Ingress, referenced by the Ingress
@@ -133,7 +133,7 @@ message IngressClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the desired state of the IngressClass.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -145,7 +145,7 @@ message IngressClass {
message IngressClassList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of IngressClasses.
repeated IngressClass items = 2;
@@ -200,7 +200,7 @@ message IngressList {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of Ingress.
repeated Ingress items = 2;
@@ -381,7 +381,7 @@ message NetworkPolicy {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec represents the specification of the desired behavior for this NetworkPolicy.
// +optional
@@ -438,7 +438,7 @@ message NetworkPolicyList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated NetworkPolicy items = 2;
@@ -454,7 +454,7 @@ message NetworkPolicyPeer {
// the pods matching podSelector in the Namespaces selected by NamespaceSelector.
// Otherwise it selects the pods matching podSelector in the policy's own namespace.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
// namespaceSelector selects namespaces using cluster-scoped labels. This field follows
// standard label selector semantics; if present but empty, it selects all namespaces.
@@ -463,7 +463,7 @@ message NetworkPolicyPeer {
// the pods matching podSelector in the namespaces selected by namespaceSelector.
// Otherwise it selects all pods in the namespaces selected by namespaceSelector.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
// ipBlock defines policy on a particular IPBlock. If this field is set then
// neither of the other fields can be.
@@ -483,7 +483,7 @@ message NetworkPolicyPort {
// numbers.
// If present, only traffic on the specified protocol AND port will be matched.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
// endPort indicates that the range of ports from port to endPort if set, inclusive,
// should be allowed by the policy. This field cannot be defined if the port field
@@ -501,7 +501,7 @@ message NetworkPolicySpec {
// the ingress rules for each are combined additively.
// This field is NOT optional and follows standard label selector semantics.
// An empty podSelector matches all pods in this namespace.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
// ingress is a list of ingress rules to be applied to the selected pods.
// Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
@@ -541,6 +541,7 @@ message NetworkPolicySpec {
}
// ServiceBackendPort is the service port being referenced.
+// +structType=atomic
message ServiceBackendPort {
// name is the name of the port on the Service.
// This is a mutually exclusive setting with "Number".
diff --git a/vendor/k8s.io/api/networking/v1/types.go b/vendor/k8s.io/api/networking/v1/types.go
index 8ee62918b0a..d75e27558da 100644
--- a/vendor/k8s.io/api/networking/v1/types.go
+++ b/vendor/k8s.io/api/networking/v1/types.go
@@ -24,6 +24,7 @@ import (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.7
// NetworkPolicy describes what network traffic is allowed for a set of Pods
type NetworkPolicy struct {
@@ -214,6 +215,7 @@ type NetworkPolicyPeer struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// NetworkPolicyList is a list of NetworkPolicy objects.
type NetworkPolicyList struct {
@@ -230,6 +232,7 @@ type NetworkPolicyList struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// Ingress is a collection of rules that allow inbound connections to reach the
// endpoints defined by a backend. An Ingress can be configured to give services
@@ -255,6 +258,7 @@ type Ingress struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// IngressList is a collection of Ingress.
type IngressList struct {
@@ -415,7 +419,7 @@ type IngressRule struct {
// default backend, is left to the controller fulfilling the Ingress. Http is
// currently the only supported IngressRuleValue.
// +optional
- IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
+ IngressRuleValue `json:",inline" protobuf:"bytes,2,opt,name=ingressRuleValue"`
}
// IngressRuleValue represents a rule to apply against incoming requests. If the
@@ -527,6 +531,7 @@ type IngressServiceBackend struct {
}
// ServiceBackendPort is the service port being referenced.
+// +structType=atomic
type ServiceBackendPort struct {
// name is the name of the port on the Service.
// This is a mutually exclusive setting with "Number".
@@ -542,6 +547,7 @@ type ServiceBackendPort struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// IngressClass represents the class of the Ingress, referenced by the Ingress
// Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be
@@ -616,6 +622,7 @@ type IngressClassParametersReference struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.19
// IngressClassList is a collection of IngressClasses.
type IngressClassList struct {
diff --git a/vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..21e8c671a56
--- /dev/null
+++ b/vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,58 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Ingress) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *IngressClass) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *IngressClassList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *IngressList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *NetworkPolicy) APILifecycleIntroduced() (major, minor int) {
+ return 1, 7
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *NetworkPolicyList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 19
+}
diff --git a/vendor/k8s.io/api/networking/v1alpha1/generated.proto b/vendor/k8s.io/api/networking/v1alpha1/generated.proto
index 8914fffcf87..80ec6af735e 100644
--- a/vendor/k8s.io/api/networking/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/networking/v1alpha1/generated.proto
@@ -39,7 +39,7 @@ message IPAddress {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the desired state of the IPAddress.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -52,7 +52,7 @@ message IPAddressList {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of IPAddresses.
repeated IPAddress items = 2;
@@ -91,7 +91,7 @@ message ServiceCIDR {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the desired state of the ServiceCIDR.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -109,7 +109,7 @@ message ServiceCIDRList {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of ServiceCIDRs.
repeated ServiceCIDR items = 2;
@@ -119,6 +119,9 @@ message ServiceCIDRList {
message ServiceCIDRSpec {
// CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64")
// from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family.
+ // The network address of each CIDR, the address that identifies the subnet of a host, is reserved
+ // and will not be allocated. The broadcast address for IPv4 CIDRs is also reserved and will not be
+ // allocated.
// This field is immutable.
// +optional
// +listType=atomic
@@ -134,6 +137,6 @@ message ServiceCIDRStatus {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1;
}
diff --git a/vendor/k8s.io/api/networking/v1alpha1/types.go b/vendor/k8s.io/api/networking/v1alpha1/types.go
index bcdc33b4599..0e454f02635 100644
--- a/vendor/k8s.io/api/networking/v1alpha1/types.go
+++ b/vendor/k8s.io/api/networking/v1alpha1/types.go
@@ -109,6 +109,9 @@ type ServiceCIDR struct {
type ServiceCIDRSpec struct {
// CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64")
// from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family.
+ // The network address of each CIDR, the address that identifies the subnet of a host, is reserved
+ // and will not be allocated. The broadcast address for IPv4 CIDRs is also reserved and will not be
+ // allocated.
// This field is immutable.
// +optional
// +listType=atomic
diff --git a/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go
index 481ec06030b..4c8eb57a7a5 100644
--- a/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go
@@ -91,7 +91,7 @@ func (ServiceCIDRList) SwaggerDoc() map[string]string {
var map_ServiceCIDRSpec = map[string]string{
"": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.",
- "cidrs": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.",
+ "cidrs": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. The network address of each CIDR, the address that identifies the subnet of a host, is reserved and will not be allocated. The broadcast address for IPv4 CIDRs is also reserved and will not be allocated. This field is immutable.",
}
func (ServiceCIDRSpec) SwaggerDoc() map[string]string {
diff --git a/vendor/k8s.io/api/networking/v1beta1/generated.pb.go b/vendor/k8s.io/api/networking/v1beta1/generated.pb.go
index 13d4f53855c..a924725f284 100644
--- a/vendor/k8s.io/api/networking/v1beta1/generated.pb.go
+++ b/vendor/k8s.io/api/networking/v1beta1/generated.pb.go
@@ -27,6 +27,7 @@ import (
proto "github.com/gogo/protobuf/proto"
k8s_io_api_core_v1 "k8s.io/api/core/v1"
v11 "k8s.io/api/core/v1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
math "math"
math_bits "math/bits"
@@ -101,10 +102,94 @@ func (m *HTTPIngressRuleValue) XXX_DiscardUnknown() {
var xxx_messageInfo_HTTPIngressRuleValue proto.InternalMessageInfo
+func (m *IPAddress) Reset() { *m = IPAddress{} }
+func (*IPAddress) ProtoMessage() {}
+func (*IPAddress) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{2}
+}
+func (m *IPAddress) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *IPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *IPAddress) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_IPAddress.Merge(m, src)
+}
+func (m *IPAddress) XXX_Size() int {
+ return m.Size()
+}
+func (m *IPAddress) XXX_DiscardUnknown() {
+ xxx_messageInfo_IPAddress.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_IPAddress proto.InternalMessageInfo
+
+func (m *IPAddressList) Reset() { *m = IPAddressList{} }
+func (*IPAddressList) ProtoMessage() {}
+func (*IPAddressList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{3}
+}
+func (m *IPAddressList) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *IPAddressList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *IPAddressList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_IPAddressList.Merge(m, src)
+}
+func (m *IPAddressList) XXX_Size() int {
+ return m.Size()
+}
+func (m *IPAddressList) XXX_DiscardUnknown() {
+ xxx_messageInfo_IPAddressList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_IPAddressList proto.InternalMessageInfo
+
+func (m *IPAddressSpec) Reset() { *m = IPAddressSpec{} }
+func (*IPAddressSpec) ProtoMessage() {}
+func (*IPAddressSpec) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{4}
+}
+func (m *IPAddressSpec) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *IPAddressSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *IPAddressSpec) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_IPAddressSpec.Merge(m, src)
+}
+func (m *IPAddressSpec) XXX_Size() int {
+ return m.Size()
+}
+func (m *IPAddressSpec) XXX_DiscardUnknown() {
+ xxx_messageInfo_IPAddressSpec.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_IPAddressSpec proto.InternalMessageInfo
+
func (m *Ingress) Reset() { *m = Ingress{} }
func (*Ingress) ProtoMessage() {}
func (*Ingress) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{2}
+ return fileDescriptor_9497719c79c89d2d, []int{5}
}
func (m *Ingress) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -132,7 +217,7 @@ var xxx_messageInfo_Ingress proto.InternalMessageInfo
func (m *IngressBackend) Reset() { *m = IngressBackend{} }
func (*IngressBackend) ProtoMessage() {}
func (*IngressBackend) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{3}
+ return fileDescriptor_9497719c79c89d2d, []int{6}
}
func (m *IngressBackend) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -160,7 +245,7 @@ var xxx_messageInfo_IngressBackend proto.InternalMessageInfo
func (m *IngressClass) Reset() { *m = IngressClass{} }
func (*IngressClass) ProtoMessage() {}
func (*IngressClass) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{4}
+ return fileDescriptor_9497719c79c89d2d, []int{7}
}
func (m *IngressClass) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -188,7 +273,7 @@ var xxx_messageInfo_IngressClass proto.InternalMessageInfo
func (m *IngressClassList) Reset() { *m = IngressClassList{} }
func (*IngressClassList) ProtoMessage() {}
func (*IngressClassList) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{5}
+ return fileDescriptor_9497719c79c89d2d, []int{8}
}
func (m *IngressClassList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -216,7 +301,7 @@ var xxx_messageInfo_IngressClassList proto.InternalMessageInfo
func (m *IngressClassParametersReference) Reset() { *m = IngressClassParametersReference{} }
func (*IngressClassParametersReference) ProtoMessage() {}
func (*IngressClassParametersReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{6}
+ return fileDescriptor_9497719c79c89d2d, []int{9}
}
func (m *IngressClassParametersReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -244,7 +329,7 @@ var xxx_messageInfo_IngressClassParametersReference proto.InternalMessageInfo
func (m *IngressClassSpec) Reset() { *m = IngressClassSpec{} }
func (*IngressClassSpec) ProtoMessage() {}
func (*IngressClassSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{7}
+ return fileDescriptor_9497719c79c89d2d, []int{10}
}
func (m *IngressClassSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -272,7 +357,7 @@ var xxx_messageInfo_IngressClassSpec proto.InternalMessageInfo
func (m *IngressList) Reset() { *m = IngressList{} }
func (*IngressList) ProtoMessage() {}
func (*IngressList) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{8}
+ return fileDescriptor_9497719c79c89d2d, []int{11}
}
func (m *IngressList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -300,7 +385,7 @@ var xxx_messageInfo_IngressList proto.InternalMessageInfo
func (m *IngressLoadBalancerIngress) Reset() { *m = IngressLoadBalancerIngress{} }
func (*IngressLoadBalancerIngress) ProtoMessage() {}
func (*IngressLoadBalancerIngress) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{9}
+ return fileDescriptor_9497719c79c89d2d, []int{12}
}
func (m *IngressLoadBalancerIngress) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -328,7 +413,7 @@ var xxx_messageInfo_IngressLoadBalancerIngress proto.InternalMessageInfo
func (m *IngressLoadBalancerStatus) Reset() { *m = IngressLoadBalancerStatus{} }
func (*IngressLoadBalancerStatus) ProtoMessage() {}
func (*IngressLoadBalancerStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{10}
+ return fileDescriptor_9497719c79c89d2d, []int{13}
}
func (m *IngressLoadBalancerStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -356,7 +441,7 @@ var xxx_messageInfo_IngressLoadBalancerStatus proto.InternalMessageInfo
func (m *IngressPortStatus) Reset() { *m = IngressPortStatus{} }
func (*IngressPortStatus) ProtoMessage() {}
func (*IngressPortStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{11}
+ return fileDescriptor_9497719c79c89d2d, []int{14}
}
func (m *IngressPortStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -384,7 +469,7 @@ var xxx_messageInfo_IngressPortStatus proto.InternalMessageInfo
func (m *IngressRule) Reset() { *m = IngressRule{} }
func (*IngressRule) ProtoMessage() {}
func (*IngressRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{12}
+ return fileDescriptor_9497719c79c89d2d, []int{15}
}
func (m *IngressRule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -412,7 +497,7 @@ var xxx_messageInfo_IngressRule proto.InternalMessageInfo
func (m *IngressRuleValue) Reset() { *m = IngressRuleValue{} }
func (*IngressRuleValue) ProtoMessage() {}
func (*IngressRuleValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{13}
+ return fileDescriptor_9497719c79c89d2d, []int{16}
}
func (m *IngressRuleValue) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -440,7 +525,7 @@ var xxx_messageInfo_IngressRuleValue proto.InternalMessageInfo
func (m *IngressSpec) Reset() { *m = IngressSpec{} }
func (*IngressSpec) ProtoMessage() {}
func (*IngressSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{14}
+ return fileDescriptor_9497719c79c89d2d, []int{17}
}
func (m *IngressSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -468,7 +553,7 @@ var xxx_messageInfo_IngressSpec proto.InternalMessageInfo
func (m *IngressStatus) Reset() { *m = IngressStatus{} }
func (*IngressStatus) ProtoMessage() {}
func (*IngressStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{15}
+ return fileDescriptor_9497719c79c89d2d, []int{18}
}
func (m *IngressStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -496,7 +581,7 @@ var xxx_messageInfo_IngressStatus proto.InternalMessageInfo
func (m *IngressTLS) Reset() { *m = IngressTLS{} }
func (*IngressTLS) ProtoMessage() {}
func (*IngressTLS) Descriptor() ([]byte, []int) {
- return fileDescriptor_9497719c79c89d2d, []int{16}
+ return fileDescriptor_9497719c79c89d2d, []int{19}
}
func (m *IngressTLS) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -521,9 +606,152 @@ func (m *IngressTLS) XXX_DiscardUnknown() {
var xxx_messageInfo_IngressTLS proto.InternalMessageInfo
+func (m *ParentReference) Reset() { *m = ParentReference{} }
+func (*ParentReference) ProtoMessage() {}
+func (*ParentReference) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{20}
+}
+func (m *ParentReference) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ParentReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ParentReference) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ParentReference.Merge(m, src)
+}
+func (m *ParentReference) XXX_Size() int {
+ return m.Size()
+}
+func (m *ParentReference) XXX_DiscardUnknown() {
+ xxx_messageInfo_ParentReference.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ParentReference proto.InternalMessageInfo
+
+func (m *ServiceCIDR) Reset() { *m = ServiceCIDR{} }
+func (*ServiceCIDR) ProtoMessage() {}
+func (*ServiceCIDR) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{21}
+}
+func (m *ServiceCIDR) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ServiceCIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ServiceCIDR) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ServiceCIDR.Merge(m, src)
+}
+func (m *ServiceCIDR) XXX_Size() int {
+ return m.Size()
+}
+func (m *ServiceCIDR) XXX_DiscardUnknown() {
+ xxx_messageInfo_ServiceCIDR.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ServiceCIDR proto.InternalMessageInfo
+
+func (m *ServiceCIDRList) Reset() { *m = ServiceCIDRList{} }
+func (*ServiceCIDRList) ProtoMessage() {}
+func (*ServiceCIDRList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{22}
+}
+func (m *ServiceCIDRList) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ServiceCIDRList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ServiceCIDRList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ServiceCIDRList.Merge(m, src)
+}
+func (m *ServiceCIDRList) XXX_Size() int {
+ return m.Size()
+}
+func (m *ServiceCIDRList) XXX_DiscardUnknown() {
+ xxx_messageInfo_ServiceCIDRList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ServiceCIDRList proto.InternalMessageInfo
+
+func (m *ServiceCIDRSpec) Reset() { *m = ServiceCIDRSpec{} }
+func (*ServiceCIDRSpec) ProtoMessage() {}
+func (*ServiceCIDRSpec) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{23}
+}
+func (m *ServiceCIDRSpec) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ServiceCIDRSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ServiceCIDRSpec) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ServiceCIDRSpec.Merge(m, src)
+}
+func (m *ServiceCIDRSpec) XXX_Size() int {
+ return m.Size()
+}
+func (m *ServiceCIDRSpec) XXX_DiscardUnknown() {
+ xxx_messageInfo_ServiceCIDRSpec.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ServiceCIDRSpec proto.InternalMessageInfo
+
+func (m *ServiceCIDRStatus) Reset() { *m = ServiceCIDRStatus{} }
+func (*ServiceCIDRStatus) ProtoMessage() {}
+func (*ServiceCIDRStatus) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9497719c79c89d2d, []int{24}
+}
+func (m *ServiceCIDRStatus) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ServiceCIDRStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *ServiceCIDRStatus) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ServiceCIDRStatus.Merge(m, src)
+}
+func (m *ServiceCIDRStatus) XXX_Size() int {
+ return m.Size()
+}
+func (m *ServiceCIDRStatus) XXX_DiscardUnknown() {
+ xxx_messageInfo_ServiceCIDRStatus.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ServiceCIDRStatus proto.InternalMessageInfo
+
func init() {
proto.RegisterType((*HTTPIngressPath)(nil), "k8s.io.api.networking.v1beta1.HTTPIngressPath")
proto.RegisterType((*HTTPIngressRuleValue)(nil), "k8s.io.api.networking.v1beta1.HTTPIngressRuleValue")
+ proto.RegisterType((*IPAddress)(nil), "k8s.io.api.networking.v1beta1.IPAddress")
+ proto.RegisterType((*IPAddressList)(nil), "k8s.io.api.networking.v1beta1.IPAddressList")
+ proto.RegisterType((*IPAddressSpec)(nil), "k8s.io.api.networking.v1beta1.IPAddressSpec")
proto.RegisterType((*Ingress)(nil), "k8s.io.api.networking.v1beta1.Ingress")
proto.RegisterType((*IngressBackend)(nil), "k8s.io.api.networking.v1beta1.IngressBackend")
proto.RegisterType((*IngressClass)(nil), "k8s.io.api.networking.v1beta1.IngressClass")
@@ -539,6 +767,11 @@ func init() {
proto.RegisterType((*IngressSpec)(nil), "k8s.io.api.networking.v1beta1.IngressSpec")
proto.RegisterType((*IngressStatus)(nil), "k8s.io.api.networking.v1beta1.IngressStatus")
proto.RegisterType((*IngressTLS)(nil), "k8s.io.api.networking.v1beta1.IngressTLS")
+ proto.RegisterType((*ParentReference)(nil), "k8s.io.api.networking.v1beta1.ParentReference")
+ proto.RegisterType((*ServiceCIDR)(nil), "k8s.io.api.networking.v1beta1.ServiceCIDR")
+ proto.RegisterType((*ServiceCIDRList)(nil), "k8s.io.api.networking.v1beta1.ServiceCIDRList")
+ proto.RegisterType((*ServiceCIDRSpec)(nil), "k8s.io.api.networking.v1beta1.ServiceCIDRSpec")
+ proto.RegisterType((*ServiceCIDRStatus)(nil), "k8s.io.api.networking.v1beta1.ServiceCIDRStatus")
}
func init() {
@@ -546,85 +779,99 @@ func init() {
}
var fileDescriptor_9497719c79c89d2d = []byte{
- // 1234 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4d, 0x6f, 0x1b, 0xc5,
- 0x1b, 0xcf, 0xda, 0x71, 0xe3, 0x8c, 0xd3, 0x34, 0xff, 0xf9, 0xe7, 0x60, 0x82, 0x6a, 0x47, 0x7b,
- 0x40, 0x81, 0x36, 0xbb, 0x4d, 0x5a, 0x50, 0xb9, 0x20, 0xd8, 0x08, 0x91, 0x28, 0x21, 0x31, 0x63,
- 0xf3, 0x22, 0xc4, 0x81, 0xc9, 0x7a, 0x6a, 0x2f, 0x5e, 0xef, 0xae, 0x66, 0x66, 0x83, 0x7a, 0x03,
- 0x71, 0xe2, 0x04, 0xdf, 0x01, 0x89, 0x8f, 0x80, 0xb8, 0x20, 0x21, 0xb8, 0xe4, 0xd8, 0x63, 0x2f,
- 0x44, 0xc4, 0x7c, 0x8b, 0x9e, 0xd0, 0x33, 0x3b, 0xfb, 0xe2, 0x97, 0xb4, 0x0e, 0x87, 0x9e, 0xe2,
- 0x7d, 0x5e, 0x7e, 0xcf, 0xfb, 0x33, 0x4f, 0xd0, 0xf6, 0xe0, 0xa1, 0xb0, 0xbc, 0xd0, 0xa6, 0x91,
- 0x67, 0x07, 0x4c, 0x7e, 0x1d, 0xf2, 0x81, 0x17, 0xf4, 0xec, 0xb3, 0x9d, 0x53, 0x26, 0xe9, 0x8e,
- 0xdd, 0x63, 0x01, 0xe3, 0x54, 0xb2, 0xae, 0x15, 0xf1, 0x50, 0x86, 0xf8, 0x76, 0x22, 0x6e, 0xd1,
- 0xc8, 0xb3, 0x72, 0x71, 0x4b, 0x8b, 0x6f, 0x6c, 0xf7, 0x3c, 0xd9, 0x8f, 0x4f, 0x2d, 0x37, 0x1c,
- 0xda, 0xbd, 0xb0, 0x17, 0xda, 0x4a, 0xeb, 0x34, 0x7e, 0xa4, 0xbe, 0xd4, 0x87, 0xfa, 0x95, 0xa0,
- 0x6d, 0x98, 0x05, 0xe3, 0x6e, 0xc8, 0x99, 0x7d, 0x36, 0x65, 0x71, 0xe3, 0x41, 0x2e, 0x33, 0xa4,
- 0x6e, 0xdf, 0x0b, 0x18, 0x7f, 0x6c, 0x47, 0x83, 0x1e, 0x10, 0x84, 0x3d, 0x64, 0x92, 0xce, 0xd2,
- 0xb2, 0xaf, 0xd2, 0xe2, 0x71, 0x20, 0xbd, 0x21, 0x9b, 0x52, 0x78, 0xeb, 0x45, 0x0a, 0xc2, 0xed,
- 0xb3, 0x21, 0x9d, 0xd2, 0xbb, 0x7f, 0x95, 0x5e, 0x2c, 0x3d, 0xdf, 0xf6, 0x02, 0x29, 0x24, 0x9f,
- 0x54, 0x32, 0xff, 0x34, 0xd0, 0xad, 0xfd, 0x4e, 0xa7, 0x75, 0x10, 0xf4, 0x38, 0x13, 0xa2, 0x45,
- 0x65, 0x1f, 0x6f, 0xa2, 0xc5, 0x88, 0xca, 0x7e, 0xdd, 0xd8, 0x34, 0xb6, 0x96, 0x9d, 0x95, 0xf3,
- 0x8b, 0xe6, 0xc2, 0xe8, 0xa2, 0xb9, 0x08, 0x3c, 0xa2, 0x38, 0xf8, 0x01, 0xaa, 0xc2, 0xdf, 0xce,
- 0xe3, 0x88, 0xd5, 0xcb, 0x4a, 0xaa, 0x3e, 0xba, 0x68, 0x56, 0x5b, 0x9a, 0xf6, 0xac, 0xf0, 0x9b,
- 0x64, 0x92, 0xf8, 0x33, 0xb4, 0x74, 0x4a, 0xdd, 0x01, 0x0b, 0xba, 0xf5, 0xd2, 0xa6, 0xb1, 0x55,
- 0xdb, 0xdd, 0xb6, 0x9e, 0x5b, 0x43, 0x4b, 0x3b, 0xe5, 0x24, 0x4a, 0xce, 0x2d, 0xed, 0xc9, 0x92,
- 0x26, 0x90, 0x14, 0xce, 0x1c, 0xa0, 0xf5, 0x42, 0x10, 0x24, 0xf6, 0xd9, 0x27, 0xd4, 0x8f, 0x19,
- 0x6e, 0xa3, 0x0a, 0x58, 0x17, 0x75, 0x63, 0xb3, 0xbc, 0x55, 0xdb, 0xb5, 0x5e, 0x60, 0x6f, 0x22,
- 0x11, 0xce, 0x4d, 0x6d, 0xb0, 0x02, 0x5f, 0x82, 0x24, 0x58, 0xe6, 0x0f, 0x25, 0xb4, 0xa4, 0xa5,
- 0xf0, 0x97, 0xa8, 0x0a, 0x75, 0xef, 0x52, 0x49, 0x55, 0xba, 0x6a, 0xbb, 0xf7, 0x0a, 0x36, 0xb2,
- 0x32, 0x58, 0xd1, 0xa0, 0x07, 0x04, 0x61, 0x81, 0xb4, 0x75, 0xb6, 0x63, 0x9d, 0x9c, 0x7e, 0xc5,
- 0x5c, 0xf9, 0x21, 0x93, 0xd4, 0xc1, 0xda, 0x0a, 0xca, 0x69, 0x24, 0x43, 0xc5, 0x47, 0x68, 0x51,
- 0x44, 0xcc, 0xd5, 0x19, 0x7b, 0x63, 0xbe, 0x8c, 0xb5, 0x23, 0xe6, 0xe6, 0x85, 0x83, 0x2f, 0xa2,
- 0x50, 0x70, 0x07, 0xdd, 0x10, 0x92, 0xca, 0x58, 0xa8, 0xb2, 0xd5, 0x76, 0xef, 0xce, 0x89, 0xa7,
- 0x74, 0x9c, 0x55, 0x8d, 0x78, 0x23, 0xf9, 0x26, 0x1a, 0xcb, 0xfc, 0xbe, 0x84, 0x56, 0xc7, 0x6b,
- 0x85, 0xdf, 0x44, 0x35, 0xc1, 0xf8, 0x99, 0xe7, 0xb2, 0x63, 0x3a, 0x64, 0xba, 0x95, 0xfe, 0xaf,
- 0xf5, 0x6b, 0xed, 0x9c, 0x45, 0x8a, 0x72, 0xb8, 0x97, 0xa9, 0xb5, 0x42, 0x2e, 0x75, 0xd0, 0x57,
- 0xa7, 0x14, 0x3a, 0xdb, 0x4a, 0x3a, 0xdb, 0x3a, 0x08, 0xe4, 0x09, 0x6f, 0x4b, 0xee, 0x05, 0xbd,
- 0x29, 0x43, 0x00, 0x46, 0x8a, 0xc8, 0xf8, 0x53, 0x54, 0xe5, 0x4c, 0x84, 0x31, 0x77, 0x99, 0x4e,
- 0xc5, 0x58, 0x33, 0xc2, 0x0a, 0x80, 0x32, 0x41, 0xdf, 0x76, 0x8f, 0x42, 0x97, 0xfa, 0x49, 0x71,
- 0x08, 0x7b, 0xc4, 0x38, 0x0b, 0x5c, 0xe6, 0xac, 0x40, 0xc3, 0x13, 0x0d, 0x41, 0x32, 0x30, 0x18,
- 0xa8, 0x15, 0x9d, 0x8b, 0x3d, 0x9f, 0xbe, 0x94, 0x16, 0xf9, 0x68, 0xac, 0x45, 0xec, 0xf9, 0x4a,
- 0xaa, 0x9c, 0xbb, 0xaa, 0x4f, 0xcc, 0x3f, 0x0c, 0xb4, 0x56, 0x14, 0x3c, 0xf2, 0x84, 0xc4, 0x5f,
- 0x4c, 0x45, 0x62, 0xcd, 0x17, 0x09, 0x68, 0xab, 0x38, 0xd6, 0xb4, 0xa9, 0x6a, 0x4a, 0x29, 0x44,
- 0xd1, 0x42, 0x15, 0x4f, 0xb2, 0xa1, 0xa8, 0x97, 0xd4, 0xac, 0xde, 0xb9, 0x46, 0x18, 0xf9, 0xa0,
- 0x1e, 0x00, 0x02, 0x49, 0x80, 0xcc, 0xbf, 0x0c, 0xd4, 0x2c, 0x8a, 0xb5, 0x28, 0xa7, 0x43, 0x26,
- 0x19, 0x17, 0x59, 0x19, 0xf1, 0x16, 0xaa, 0xd2, 0xd6, 0xc1, 0x07, 0x3c, 0x8c, 0xa3, 0x74, 0xdf,
- 0x81, 0x7f, 0xef, 0x69, 0x1a, 0xc9, 0xb8, 0xb0, 0x15, 0x07, 0x9e, 0x5e, 0x5d, 0x85, 0xad, 0x78,
- 0xe8, 0x05, 0x5d, 0xa2, 0x38, 0x20, 0x11, 0x40, 0xb3, 0x97, 0xc7, 0x25, 0x54, 0x97, 0x2b, 0x0e,
- 0x6e, 0xa2, 0x8a, 0x70, 0xc3, 0x88, 0xd5, 0x17, 0x95, 0xc8, 0x32, 0xb8, 0xdc, 0x06, 0x02, 0x49,
- 0xe8, 0xf8, 0x0e, 0x5a, 0x06, 0x41, 0x11, 0x51, 0x97, 0xd5, 0x2b, 0x4a, 0xe8, 0xe6, 0xe8, 0xa2,
- 0xb9, 0x7c, 0x9c, 0x12, 0x49, 0xce, 0x37, 0x7f, 0x99, 0x28, 0x12, 0xd4, 0x0f, 0xef, 0x22, 0xe4,
- 0x86, 0x81, 0xe4, 0xa1, 0xef, 0x33, 0xae, 0x43, 0xca, 0xda, 0x67, 0x2f, 0xe3, 0x90, 0x82, 0x14,
- 0x0e, 0x10, 0x8a, 0xb2, 0xdc, 0xe8, 0x36, 0x7a, 0xe7, 0x1a, 0xf9, 0x9f, 0x91, 0x58, 0x67, 0x15,
- 0xec, 0x15, 0x18, 0x05, 0x0b, 0xe6, 0xaf, 0x06, 0xaa, 0x69, 0xfd, 0x97, 0xd0, 0x58, 0x87, 0xe3,
- 0x8d, 0xf5, 0xda, 0x9c, 0x8f, 0xce, 0xec, 0x9e, 0xfa, 0xcd, 0x40, 0x1b, 0xa9, 0xeb, 0x21, 0xed,
- 0x3a, 0xd4, 0xa7, 0x81, 0xcb, 0x78, 0xfa, 0x1e, 0x6c, 0xa0, 0x92, 0x97, 0x36, 0x12, 0xd2, 0x00,
- 0xa5, 0x83, 0x16, 0x29, 0x79, 0x11, 0xbe, 0x8b, 0xaa, 0xfd, 0x50, 0x48, 0xd5, 0x22, 0x49, 0x13,
- 0x65, 0x5e, 0xef, 0x6b, 0x3a, 0xc9, 0x24, 0xf0, 0xc7, 0xa8, 0x12, 0x85, 0x5c, 0x8a, 0xfa, 0xa2,
- 0xf2, 0xfa, 0xde, 0x7c, 0x5e, 0xc3, 0x6e, 0xd3, 0xcb, 0x3a, 0x7f, 0xbc, 0x00, 0x86, 0x24, 0x68,
- 0xe6, 0xb7, 0x06, 0x7a, 0x65, 0x86, 0xff, 0x89, 0x0e, 0xee, 0xa2, 0x25, 0x2f, 0x61, 0xea, 0x17,
- 0xf3, 0xed, 0xf9, 0xcc, 0xce, 0x48, 0x45, 0xfe, 0x5a, 0xa7, 0xaf, 0x72, 0x0a, 0x6d, 0xfe, 0x64,
- 0xa0, 0xff, 0x4d, 0xf9, 0xab, 0xae, 0x0e, 0xd8, 0xf9, 0x90, 0xbc, 0x4a, 0xe1, 0xea, 0x80, 0xd5,
- 0xad, 0x38, 0xf8, 0x10, 0x55, 0xd5, 0xd1, 0xe2, 0x86, 0xbe, 0x4e, 0xa0, 0x9d, 0x26, 0xb0, 0xa5,
- 0xe9, 0xcf, 0x2e, 0x9a, 0xaf, 0x4e, 0x5f, 0x72, 0x56, 0xca, 0x26, 0x19, 0x00, 0x8c, 0x22, 0xe3,
- 0x3c, 0xe4, 0x7a, 0x5a, 0xd5, 0x28, 0xbe, 0x0f, 0x04, 0x92, 0xd0, 0xcd, 0x9f, 0xf3, 0x26, 0x85,
- 0x83, 0x02, 0xfc, 0x83, 0xe2, 0x4c, 0x5e, 0x45, 0x50, 0x3a, 0xa2, 0x38, 0x38, 0x46, 0x6b, 0xde,
- 0xc4, 0x05, 0x72, 0xbd, 0x9d, 0x9c, 0xa9, 0x39, 0x75, 0x0d, 0xbf, 0x36, 0xc9, 0x21, 0x53, 0x26,
- 0x4c, 0x86, 0xa6, 0xa4, 0xe0, 0x49, 0xe8, 0x4b, 0x19, 0xe9, 0x69, 0xba, 0x3f, 0xff, 0xdd, 0x93,
- 0xbb, 0x50, 0x55, 0xd1, 0x75, 0x3a, 0x2d, 0xa2, 0xa0, 0xcc, 0xdf, 0x4b, 0x59, 0x3e, 0xd4, 0xa2,
- 0x79, 0x37, 0x8b, 0x56, 0xed, 0x00, 0xf5, 0xcc, 0x27, 0x6b, 0x6d, 0xbd, 0xe0, 0x78, 0xc6, 0x23,
- 0x53, 0xd2, 0xb8, 0x93, 0xdf, 0x83, 0xc6, 0x7f, 0xb9, 0x07, 0x6b, 0xb3, 0x6e, 0x41, 0xbc, 0x8f,
- 0xca, 0xd2, 0x4f, 0x87, 0xfd, 0xf5, 0xf9, 0x10, 0x3b, 0x47, 0x6d, 0xa7, 0xa6, 0x53, 0x5e, 0xee,
- 0x1c, 0xb5, 0x09, 0x40, 0xe0, 0x13, 0x54, 0xe1, 0xb1, 0xcf, 0xe0, 0x56, 0x2a, 0xcf, 0x7f, 0x7b,
- 0x41, 0x06, 0xf3, 0xe1, 0x83, 0x2f, 0x41, 0x12, 0x1c, 0xf3, 0x3b, 0x03, 0xdd, 0x1c, 0xbb, 0xa8,
- 0x30, 0x47, 0x2b, 0x7e, 0x61, 0x76, 0x74, 0x1e, 0x1e, 0x5e, 0x7f, 0xea, 0xf4, 0xd0, 0xaf, 0x6b,
- 0xbb, 0x2b, 0x45, 0x1e, 0x19, 0xb3, 0x61, 0x52, 0x84, 0xf2, 0xb0, 0x61, 0x0e, 0xa0, 0x79, 0x93,
- 0x81, 0xd7, 0x73, 0x00, 0x3d, 0x2d, 0x48, 0x42, 0x87, 0x07, 0x45, 0x30, 0x97, 0x33, 0x79, 0x9c,
- 0x2f, 0xae, 0xec, 0x41, 0x69, 0x67, 0x1c, 0x52, 0x90, 0x72, 0xf6, 0xce, 0x2f, 0x1b, 0x0b, 0x4f,
- 0x2e, 0x1b, 0x0b, 0x4f, 0x2f, 0x1b, 0x0b, 0xdf, 0x8c, 0x1a, 0xc6, 0xf9, 0xa8, 0x61, 0x3c, 0x19,
- 0x35, 0x8c, 0xa7, 0xa3, 0x86, 0xf1, 0xf7, 0xa8, 0x61, 0xfc, 0xf8, 0x4f, 0x63, 0xe1, 0xf3, 0xdb,
- 0xcf, 0xfd, 0x87, 0xef, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, 0xf6, 0xe9, 0x27, 0x10, 0x0e,
- 0x00, 0x00,
+ // 1457 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcb, 0x6f, 0x1b, 0xc5,
+ 0x1f, 0xcf, 0x3a, 0x71, 0xe3, 0x8c, 0xd3, 0x26, 0x9d, 0x5f, 0x0f, 0xfe, 0x05, 0xd5, 0x8e, 0x16,
+ 0x09, 0x85, 0x3e, 0x76, 0xdb, 0xb4, 0xa0, 0x72, 0x41, 0xd4, 0x01, 0x51, 0xab, 0x69, 0xb2, 0x8c,
+ 0x0d, 0x54, 0xc0, 0x81, 0xc9, 0x7a, 0x6a, 0x2f, 0x5e, 0xef, 0xae, 0x66, 0xc7, 0x81, 0xde, 0x40,
+ 0x9c, 0x38, 0xc1, 0x9d, 0x23, 0x12, 0x7f, 0x02, 0x70, 0xa0, 0x52, 0x05, 0x97, 0x1e, 0x7b, 0xec,
+ 0x85, 0x88, 0x9a, 0xff, 0xa2, 0x27, 0xf4, 0x9d, 0x9d, 0x7d, 0xf9, 0xd1, 0x6c, 0x38, 0xe4, 0x54,
+ 0xef, 0xf7, 0x3d, 0xdf, 0xe7, 0xa7, 0x41, 0x57, 0x07, 0xb7, 0x42, 0xc3, 0xf1, 0x4d, 0x1a, 0x38,
+ 0xa6, 0xc7, 0xc4, 0x97, 0x3e, 0x1f, 0x38, 0x5e, 0xcf, 0x3c, 0xbc, 0x7e, 0xc0, 0x04, 0xbd, 0x6e,
+ 0xf6, 0x98, 0xc7, 0x38, 0x15, 0xac, 0x6b, 0x04, 0xdc, 0x17, 0x3e, 0xbe, 0x18, 0x89, 0x1b, 0x34,
+ 0x70, 0x8c, 0x54, 0xdc, 0x50, 0xe2, 0x1b, 0x57, 0x7b, 0x8e, 0xe8, 0x8f, 0x0e, 0x0c, 0xdb, 0x1f,
+ 0x9a, 0x3d, 0xbf, 0xe7, 0x9b, 0x52, 0xeb, 0x60, 0xf4, 0x40, 0x7e, 0xc9, 0x0f, 0xf9, 0x2b, 0xb2,
+ 0xb6, 0xa1, 0x67, 0x9c, 0xdb, 0x3e, 0x67, 0xe6, 0xe1, 0x94, 0xc7, 0x8d, 0x9b, 0xa9, 0xcc, 0x90,
+ 0xda, 0x7d, 0xc7, 0x63, 0xfc, 0xa1, 0x19, 0x0c, 0x7a, 0x40, 0x08, 0xcd, 0x21, 0x13, 0x74, 0x96,
+ 0x96, 0x39, 0x4f, 0x8b, 0x8f, 0x3c, 0xe1, 0x0c, 0xd9, 0x94, 0xc2, 0x9b, 0xc7, 0x29, 0x84, 0x76,
+ 0x9f, 0x0d, 0xe9, 0x94, 0xde, 0x8d, 0x79, 0x7a, 0x23, 0xe1, 0xb8, 0xa6, 0xe3, 0x89, 0x50, 0xf0,
+ 0x49, 0x25, 0xfd, 0x4f, 0x0d, 0xad, 0xdd, 0xe9, 0x74, 0xac, 0x96, 0xd7, 0xe3, 0x2c, 0x0c, 0x2d,
+ 0x2a, 0xfa, 0x78, 0x13, 0x2d, 0x05, 0x54, 0xf4, 0x6b, 0xda, 0xa6, 0xb6, 0xb5, 0xd2, 0x5c, 0x7d,
+ 0x72, 0xd4, 0x58, 0x18, 0x1f, 0x35, 0x96, 0x80, 0x47, 0x24, 0x07, 0xdf, 0x44, 0x15, 0xf8, 0xb7,
+ 0xf3, 0x30, 0x60, 0xb5, 0x45, 0x29, 0x55, 0x1b, 0x1f, 0x35, 0x2a, 0x96, 0xa2, 0xbd, 0xc8, 0xfc,
+ 0x26, 0x89, 0x24, 0xbe, 0x8f, 0x96, 0x0f, 0xa8, 0x3d, 0x60, 0x5e, 0xb7, 0x56, 0xda, 0xd4, 0xb6,
+ 0xaa, 0xdb, 0x57, 0x8d, 0x97, 0xd6, 0xd0, 0x50, 0x41, 0x35, 0x23, 0xa5, 0xe6, 0x9a, 0x8a, 0x64,
+ 0x59, 0x11, 0x48, 0x6c, 0x4e, 0x1f, 0xa0, 0x0b, 0x99, 0x47, 0x90, 0x91, 0xcb, 0x3e, 0xa2, 0xee,
+ 0x88, 0xe1, 0x36, 0x2a, 0x83, 0xf7, 0xb0, 0xa6, 0x6d, 0x2e, 0x6e, 0x55, 0xb7, 0x8d, 0x63, 0xfc,
+ 0x4d, 0x24, 0xa2, 0x79, 0x56, 0x39, 0x2c, 0xc3, 0x57, 0x48, 0x22, 0x5b, 0xfa, 0x23, 0x0d, 0xad,
+ 0xb4, 0xac, 0xdb, 0xdd, 0x2e, 0xc8, 0xe1, 0xcf, 0x51, 0x05, 0x2a, 0xdf, 0xa5, 0x82, 0xca, 0x84,
+ 0x55, 0xb7, 0xaf, 0x65, 0xbc, 0x24, 0x85, 0x30, 0x82, 0x41, 0x0f, 0x08, 0xa1, 0x01, 0xd2, 0xc6,
+ 0xe1, 0x75, 0x63, 0xff, 0xe0, 0x0b, 0x66, 0x8b, 0x7b, 0x4c, 0xd0, 0x26, 0x56, 0x7e, 0x50, 0x4a,
+ 0x23, 0x89, 0x55, 0xbc, 0x87, 0x96, 0xc2, 0x80, 0xd9, 0x2a, 0x67, 0x57, 0x8e, 0xcb, 0x59, 0x1c,
+ 0x59, 0x3b, 0x60, 0x76, 0x5a, 0x3c, 0xf8, 0x22, 0xd2, 0x8e, 0xfe, 0xbb, 0x86, 0xce, 0x26, 0x52,
+ 0xbb, 0x4e, 0x28, 0xf0, 0x67, 0x53, 0x6f, 0x30, 0x8a, 0xbd, 0x01, 0xb4, 0xe5, 0x0b, 0xd6, 0x95,
+ 0x9f, 0x4a, 0x4c, 0xc9, 0xc4, 0x7f, 0x0f, 0x95, 0x1d, 0xc1, 0x86, 0x61, 0xad, 0x24, 0x8b, 0xb0,
+ 0x55, 0xf4, 0x01, 0x69, 0xfa, 0x5b, 0xa0, 0x4e, 0x22, 0x2b, 0xba, 0x9b, 0x89, 0x1e, 0x5e, 0x85,
+ 0x3f, 0x45, 0x2b, 0x01, 0xe5, 0xcc, 0x13, 0x84, 0x3d, 0x98, 0x11, 0xfe, 0x2c, 0x1f, 0x56, 0x2c,
+ 0xcf, 0x38, 0xf3, 0x6c, 0xd6, 0x3c, 0x3b, 0x3e, 0x6a, 0xac, 0x24, 0x44, 0x92, 0xda, 0xd3, 0xbf,
+ 0x2f, 0xa1, 0x65, 0xd5, 0x12, 0xa7, 0x50, 0xea, 0xdd, 0x5c, 0xa9, 0x2f, 0x15, 0x1b, 0x8f, 0x79,
+ 0x85, 0xc6, 0x1d, 0x74, 0x26, 0x14, 0x54, 0x8c, 0x42, 0x39, 0xa3, 0x05, 0x5a, 0x47, 0xd9, 0x93,
+ 0x3a, 0xcd, 0x73, 0xca, 0xe2, 0x99, 0xe8, 0x9b, 0x28, 0x5b, 0xfa, 0x77, 0x25, 0x74, 0x2e, 0x3f,
+ 0x98, 0xf8, 0x0d, 0x54, 0x0d, 0x19, 0x3f, 0x74, 0x6c, 0xb6, 0x47, 0x87, 0x4c, 0xed, 0x8d, 0xff,
+ 0x29, 0xfd, 0x6a, 0x3b, 0x65, 0x91, 0xac, 0x1c, 0xee, 0x25, 0x6a, 0x96, 0xcf, 0x85, 0x7a, 0xf4,
+ 0xfc, 0x94, 0xc2, 0x1a, 0x33, 0xa2, 0x35, 0x66, 0xb4, 0x3c, 0xb1, 0xcf, 0xdb, 0x82, 0x3b, 0x5e,
+ 0x6f, 0xca, 0x11, 0x18, 0x23, 0x59, 0xcb, 0xf8, 0x63, 0x54, 0xe1, 0x2c, 0xf4, 0x47, 0xdc, 0x66,
+ 0x2a, 0x15, 0xb9, 0xcd, 0x03, 0xfb, 0x1e, 0xca, 0x04, 0x4b, 0xaa, 0xbb, 0xeb, 0xdb, 0xd4, 0x8d,
+ 0x8a, 0x93, 0xf6, 0xc7, 0x2a, 0xb4, 0x36, 0x51, 0x26, 0x48, 0x62, 0x0c, 0xb6, 0xe7, 0xaa, 0xca,
+ 0xc5, 0x8e, 0x4b, 0x4f, 0xa5, 0x45, 0x3e, 0xc8, 0xb5, 0x88, 0x59, 0xac, 0xa4, 0x32, 0xb8, 0xb9,
+ 0x0b, 0xe1, 0x0f, 0x0d, 0xad, 0x67, 0x05, 0x4f, 0x61, 0x27, 0x58, 0xf9, 0x9d, 0x70, 0xf9, 0x04,
+ 0xcf, 0x98, 0xb3, 0x16, 0xfe, 0xd2, 0x50, 0x23, 0x2b, 0x66, 0x51, 0x4e, 0x87, 0x4c, 0x30, 0x1e,
+ 0x26, 0x65, 0xc4, 0x5b, 0xa8, 0x42, 0xad, 0xd6, 0xfb, 0xdc, 0x1f, 0x05, 0xf1, 0x71, 0x83, 0xf8,
+ 0x6e, 0x2b, 0x1a, 0x49, 0xb8, 0x70, 0x02, 0x07, 0x8e, 0xba, 0x53, 0x99, 0x13, 0x78, 0xd7, 0xf1,
+ 0xba, 0x44, 0x72, 0x40, 0xc2, 0x83, 0x66, 0x5f, 0xcc, 0x4b, 0xc8, 0x2e, 0x97, 0x1c, 0xdc, 0x40,
+ 0xe5, 0xd0, 0xf6, 0x03, 0x56, 0x5b, 0x92, 0x22, 0x2b, 0x10, 0x72, 0x1b, 0x08, 0x24, 0xa2, 0xe3,
+ 0xcb, 0x68, 0x05, 0x04, 0xc3, 0x80, 0xda, 0xac, 0x56, 0x96, 0x42, 0x72, 0x11, 0xed, 0xc5, 0x44,
+ 0x92, 0xf2, 0xf5, 0x5f, 0x26, 0x8a, 0x24, 0x57, 0xdf, 0x36, 0x42, 0xb6, 0xef, 0x09, 0xee, 0xbb,
+ 0x2e, 0xe3, 0xea, 0x49, 0x49, 0xfb, 0xec, 0x24, 0x1c, 0x92, 0x91, 0xc2, 0x1e, 0x42, 0x41, 0x92,
+ 0x1b, 0xd5, 0x46, 0x6f, 0x9f, 0x20, 0xff, 0x33, 0x12, 0xdb, 0x3c, 0x07, 0xfe, 0x32, 0x8c, 0x8c,
+ 0x07, 0xfd, 0x37, 0x0d, 0x55, 0x95, 0xfe, 0x29, 0x34, 0xd6, 0xdd, 0x7c, 0x63, 0xbd, 0x56, 0x10,
+ 0x61, 0xcc, 0xee, 0xa9, 0x47, 0x1a, 0xda, 0x88, 0x43, 0xf7, 0x69, 0xb7, 0x49, 0x5d, 0xea, 0xd9,
+ 0x8c, 0xc7, 0xf7, 0x60, 0x03, 0x95, 0x9c, 0xb8, 0x91, 0x90, 0x32, 0x50, 0x6a, 0x59, 0xa4, 0xe4,
+ 0x04, 0xf8, 0x0a, 0xaa, 0xf4, 0xfd, 0x50, 0xc8, 0x16, 0x89, 0x9a, 0x28, 0x89, 0xfa, 0x8e, 0xa2,
+ 0x93, 0x44, 0x02, 0x7f, 0x88, 0xca, 0x81, 0xcf, 0x45, 0x58, 0x5b, 0x92, 0x51, 0x5f, 0x2b, 0x16,
+ 0x35, 0xec, 0x36, 0xb5, 0xac, 0x53, 0xa4, 0x02, 0x66, 0x48, 0x64, 0x4d, 0xff, 0x46, 0x43, 0xff,
+ 0x9f, 0x11, 0x7f, 0xa4, 0x83, 0xbb, 0x68, 0xd9, 0x89, 0x98, 0x0a, 0x1e, 0xbd, 0x55, 0xcc, 0xed,
+ 0x8c, 0x54, 0xa4, 0xd0, 0x2c, 0x86, 0x60, 0xb1, 0x69, 0xfd, 0x27, 0x0d, 0x9d, 0x9f, 0x8a, 0x57,
+ 0x42, 0x4c, 0xd8, 0xf9, 0x90, 0xbc, 0x72, 0x06, 0x62, 0xc2, 0xea, 0x96, 0x1c, 0x7c, 0x17, 0x55,
+ 0x24, 0x42, 0xb5, 0x7d, 0x57, 0x25, 0xd0, 0x8c, 0x13, 0x68, 0x29, 0xfa, 0x8b, 0xa3, 0xc6, 0x2b,
+ 0xd3, 0xb0, 0xdd, 0x88, 0xd9, 0x24, 0x31, 0x00, 0xa3, 0xc8, 0x38, 0xf7, 0xb9, 0x9a, 0x56, 0x39,
+ 0x8a, 0xef, 0x01, 0x81, 0x44, 0x74, 0xfd, 0xe7, 0xb4, 0x49, 0x01, 0x3d, 0x42, 0x7c, 0x50, 0x9c,
+ 0x49, 0x08, 0x0c, 0xa5, 0x23, 0x92, 0x83, 0x47, 0x68, 0xdd, 0x99, 0x80, 0x9b, 0x27, 0xdb, 0xc9,
+ 0x89, 0x5a, 0xb3, 0xa6, 0xcc, 0xaf, 0x4f, 0x72, 0xc8, 0x94, 0x0b, 0x9d, 0xa1, 0x29, 0x29, 0x38,
+ 0x09, 0x7d, 0x21, 0x02, 0x35, 0x4d, 0x37, 0x8a, 0x83, 0xdc, 0x34, 0x84, 0x8a, 0x7c, 0x5d, 0xa7,
+ 0x63, 0x11, 0x69, 0x4a, 0x7f, 0x5c, 0x4a, 0xf2, 0x21, 0x17, 0xcd, 0x3b, 0xc9, 0x6b, 0xe5, 0x0e,
+ 0x90, 0x67, 0x3e, 0x5a, 0x6b, 0x17, 0x32, 0x81, 0x27, 0x3c, 0x32, 0x25, 0x8d, 0x3b, 0x29, 0xf8,
+ 0xd7, 0xfe, 0x0b, 0xf8, 0xaf, 0xce, 0x02, 0xfe, 0xf8, 0x0e, 0x5a, 0x14, 0x6e, 0x3c, 0xec, 0xaf,
+ 0x17, 0xb3, 0xd8, 0xd9, 0x6d, 0x37, 0xab, 0x2a, 0xe5, 0x8b, 0x9d, 0xdd, 0x36, 0x01, 0x13, 0x78,
+ 0x1f, 0x95, 0xf9, 0xc8, 0x65, 0x80, 0x95, 0x16, 0x8b, 0x63, 0x2f, 0xc8, 0x60, 0x3a, 0x7c, 0xf0,
+ 0x15, 0x92, 0xc8, 0x8e, 0xfe, 0x2d, 0xc0, 0xec, 0x2c, 0xa2, 0xc2, 0x1c, 0xad, 0xba, 0x99, 0xd9,
+ 0x51, 0x79, 0xb8, 0x75, 0xf2, 0xa9, 0x53, 0x43, 0x7f, 0x41, 0xf9, 0x5d, 0xcd, 0xf2, 0x48, 0xce,
+ 0x87, 0x4e, 0x11, 0x4a, 0x9f, 0x0d, 0x73, 0x00, 0xcd, 0x1b, 0x0d, 0xbc, 0x9a, 0x03, 0xe8, 0xe9,
+ 0x90, 0x44, 0x74, 0x38, 0x28, 0x21, 0xb3, 0x39, 0x13, 0x7b, 0xe9, 0xe2, 0x4a, 0x0e, 0x4a, 0x3b,
+ 0xe1, 0x90, 0x8c, 0x94, 0xfe, 0xab, 0x86, 0xd6, 0x26, 0x00, 0x35, 0x7e, 0x15, 0x95, 0x7b, 0x99,
+ 0x33, 0x9b, 0x64, 0x28, 0xba, 0xb3, 0x11, 0x0f, 0x76, 0x64, 0x02, 0xcb, 0x26, 0x76, 0xe4, 0x34,
+ 0xd6, 0xc2, 0x66, 0xf6, 0x5a, 0x46, 0x73, 0x7c, 0x5e, 0x89, 0xcf, 0xbc, 0x98, 0xc9, 0x85, 0x5e,
+ 0x9a, 0x77, 0xa1, 0xf5, 0x1f, 0x4b, 0x28, 0x06, 0x8d, 0x3b, 0xad, 0x77, 0xc9, 0x29, 0xa0, 0x37,
+ 0x2b, 0x87, 0xde, 0x8e, 0xfb, 0x6f, 0x4a, 0x26, 0xb6, 0xb9, 0x20, 0xff, 0xfe, 0x04, 0xc8, 0xbf,
+ 0x76, 0x02, 0x9b, 0x2f, 0x07, 0xfa, 0x8f, 0x35, 0xb4, 0x96, 0x91, 0x3e, 0x85, 0xe3, 0xbd, 0x9f,
+ 0x3f, 0xde, 0x97, 0x8a, 0x3f, 0x65, 0xce, 0x01, 0xdf, 0xce, 0xbd, 0x40, 0x6e, 0xb2, 0x06, 0x2a,
+ 0xdb, 0x4e, 0x97, 0xe7, 0x46, 0x00, 0x98, 0x21, 0x89, 0xe8, 0xfa, 0x57, 0xe8, 0xfc, 0x54, 0x8e,
+ 0xb0, 0x2d, 0x81, 0x56, 0xd7, 0x11, 0x8e, 0xef, 0xc5, 0xe7, 0xd2, 0x2c, 0xf6, 0xf2, 0x9d, 0x58,
+ 0x2f, 0x87, 0xcc, 0x94, 0x29, 0x92, 0x31, 0xdb, 0xdc, 0x79, 0xf2, 0xbc, 0xbe, 0xf0, 0xf4, 0x79,
+ 0x7d, 0xe1, 0xd9, 0xf3, 0xfa, 0xc2, 0xd7, 0xe3, 0xba, 0xf6, 0x64, 0x5c, 0xd7, 0x9e, 0x8e, 0xeb,
+ 0xda, 0xb3, 0x71, 0x5d, 0xfb, 0x7b, 0x5c, 0xd7, 0x7e, 0xf8, 0xa7, 0xbe, 0xf0, 0xc9, 0xc5, 0x97,
+ 0xfe, 0x99, 0xec, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, 0xc2, 0xa4, 0xff, 0x46, 0x13, 0x00,
+ 0x00,
}
func (m *HTTPIngressPath) Marshal() (dAtA []byte, err error) {
@@ -709,7 +956,7 @@ func (m *HTTPIngressRuleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func (m *Ingress) Marshal() (dAtA []byte, err error) {
+func (m *IPAddress) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -719,18 +966,18 @@ func (m *Ingress) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *Ingress) MarshalTo(dAtA []byte) (int, error) {
+func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *Ingress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *IPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
{
- size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -738,9 +985,9 @@ func (m *Ingress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x1a
+ dAtA[i] = 0x12
{
- size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -748,9 +995,46 @@ func (m *Ingress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x12
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *IPAddressList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *IPAddressList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *IPAddressList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Items) > 0 {
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
{
- size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -762,7 +1046,7 @@ func (m *Ingress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func (m *IngressBackend) Marshal() (dAtA []byte, err error) {
+func (m *IPAddressSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -772,19 +1056,19 @@ func (m *IngressBackend) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *IngressBackend) MarshalTo(dAtA []byte) (int, error) {
+func (m *IPAddressSpec) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *IngressBackend) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *IPAddressSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if m.Resource != nil {
+ if m.ParentRef != nil {
{
- size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.ParentRef.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -792,27 +1076,12 @@ func (m *IngressBackend) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x1a
- }
- {
- size, err := m.ServicePort.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ dAtA[i] = 0xa
}
- i--
- dAtA[i] = 0x12
- i -= len(m.ServiceName)
- copy(dAtA[i:], m.ServiceName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceName)))
- i--
- dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *IngressClass) Marshal() (dAtA []byte, err error) {
+func (m *Ingress) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -822,16 +1091,26 @@ func (m *IngressClass) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *IngressClass) MarshalTo(dAtA []byte) (int, error) {
+func (m *Ingress) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *IngressClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *Ingress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
+ {
+ size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
{
size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@@ -855,7 +1134,7 @@ func (m *IngressClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func (m *IngressClassList) Marshal() (dAtA []byte, err error) {
+func (m *IngressBackend) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -865,23 +1144,116 @@ func (m *IngressClassList) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *IngressClassList) MarshalTo(dAtA []byte) (int, error) {
+func (m *IngressBackend) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *IngressClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *IngressBackend) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Items) > 0 {
- for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
+ if m.Resource != nil {
+ {
+ size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
+ }
+ {
+ size, err := m.ServicePort.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.ServiceName)
+ copy(dAtA[i:], m.ServiceName)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceName)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *IngressClass) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *IngressClass) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *IngressClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ {
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *IngressClassList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *IngressClassList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *IngressClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Items) > 0 {
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
i -= size
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
@@ -1378,108 +1750,363 @@ func (m *IngressTLS) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
- offset -= sovGenerated(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
+func (m *ParentReference) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
}
- dAtA[offset] = uint8(v)
- return base
+ return dAtA[:n], nil
}
-func (m *HTTPIngressPath) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Path)
- n += 1 + l + sovGenerated(uint64(l))
- l = m.Backend.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if m.PathType != nil {
- l = len(*m.PathType)
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
+
+func (m *ParentReference) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *HTTPIngressRuleValue) Size() (n int) {
- if m == nil {
- return 0
- }
+func (m *ParentReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- if len(m.Paths) > 0 {
- for _, e := range m.Paths {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i--
+ dAtA[i] = 0x22
+ i -= len(m.Namespace)
+ copy(dAtA[i:], m.Namespace)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace)))
+ i--
+ dAtA[i] = 0x1a
+ i -= len(m.Resource)
+ copy(dAtA[i:], m.Resource)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.Group)
+ copy(dAtA[i:], m.Group)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
}
-func (m *Ingress) Size() (n int) {
- if m == nil {
- return 0
+func (m *ServiceCIDR) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
}
- var l int
- _ = l
- l = m.ObjectMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = m.Spec.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = m.Status.Size()
- n += 1 + l + sovGenerated(uint64(l))
- return n
+ return dAtA[:n], nil
}
-func (m *IngressBackend) Size() (n int) {
- if m == nil {
- return 0
- }
+func (m *ServiceCIDR) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ServiceCIDR) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- l = len(m.ServiceName)
- n += 1 + l + sovGenerated(uint64(l))
- l = m.ServicePort.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if m.Resource != nil {
- l = m.Resource.Size()
- n += 1 + l + sovGenerated(uint64(l))
+ {
+ size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
}
- return n
+ i--
+ dAtA[i] = 0x1a
+ {
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ {
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
}
-func (m *IngressClass) Size() (n int) {
- if m == nil {
- return 0
+func (m *ServiceCIDRList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
}
- var l int
- _ = l
- l = m.ObjectMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = m.Spec.Size()
- n += 1 + l + sovGenerated(uint64(l))
- return n
+ return dAtA[:n], nil
}
-func (m *IngressClassList) Size() (n int) {
- if m == nil {
- return 0
- }
+func (m *ServiceCIDRList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ServiceCIDRList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- l = m.ListMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
if len(m.Items) > 0 {
- for _, e := range m.Items {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *ServiceCIDRSpec) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ServiceCIDRSpec) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ServiceCIDRSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.CIDRs) > 0 {
+ for iNdEx := len(m.CIDRs) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.CIDRs[iNdEx])
+ copy(dAtA[i:], m.CIDRs[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.CIDRs[iNdEx])))
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *ServiceCIDRStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ServiceCIDRStatus) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ServiceCIDRStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Conditions) > 0 {
+ for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ offset -= sovGenerated(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *HTTPIngressPath) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Path)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Backend.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.PathType != nil {
+ l = len(*m.PathType)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *HTTPIngressRuleValue) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Paths) > 0 {
+ for _, e := range m.Paths {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *IPAddress) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *IPAddressList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *IPAddressSpec) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.ParentRef != nil {
+ l = m.ParentRef.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *Ingress) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Status.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *IngressBackend) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.ServiceName)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.ServicePort.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.Resource != nil {
+ l = m.Resource.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *IngressClass) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *IngressClassList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
return n
}
@@ -1673,31 +2300,110 @@ func (m *IngressTLS) Size() (n int) {
return n
}
-func sovGenerated(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozGenerated(x uint64) (n int) {
- return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *HTTPIngressPath) String() string {
- if this == nil {
- return "nil"
+func (m *ParentReference) Size() (n int) {
+ if m == nil {
+ return 0
}
- s := strings.Join([]string{`&HTTPIngressPath{`,
- `Path:` + fmt.Sprintf("%v", this.Path) + `,`,
- `Backend:` + strings.Replace(strings.Replace(this.Backend.String(), "IngressBackend", "IngressBackend", 1), `&`, ``, 1) + `,`,
- `PathType:` + valueToStringGenerated(this.PathType) + `,`,
- `}`,
- }, "")
- return s
+ var l int
+ _ = l
+ l = len(m.Group)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Resource)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Namespace)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
}
-func (this *HTTPIngressRuleValue) String() string {
- if this == nil {
- return "nil"
+
+func (m *ServiceCIDR) Size() (n int) {
+ if m == nil {
+ return 0
}
- repeatedStringForPaths := "[]HTTPIngressPath{"
- for _, f := range this.Paths {
- repeatedStringForPaths += strings.Replace(strings.Replace(f.String(), "HTTPIngressPath", "HTTPIngressPath", 1), `&`, ``, 1) + ","
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Status.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *ServiceCIDRList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *ServiceCIDRSpec) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.CIDRs) > 0 {
+ for _, s := range m.CIDRs {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *ServiceCIDRStatus) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Conditions) > 0 {
+ for _, e := range m.Conditions {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func sovGenerated(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozGenerated(x uint64) (n int) {
+ return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (this *HTTPIngressPath) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&HTTPIngressPath{`,
+ `Path:` + fmt.Sprintf("%v", this.Path) + `,`,
+ `Backend:` + strings.Replace(strings.Replace(this.Backend.String(), "IngressBackend", "IngressBackend", 1), `&`, ``, 1) + `,`,
+ `PathType:` + valueToStringGenerated(this.PathType) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *HTTPIngressRuleValue) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForPaths := "[]HTTPIngressPath{"
+ for _, f := range this.Paths {
+ repeatedStringForPaths += strings.Replace(strings.Replace(f.String(), "HTTPIngressPath", "HTTPIngressPath", 1), `&`, ``, 1) + ","
}
repeatedStringForPaths += "}"
s := strings.Join([]string{`&HTTPIngressRuleValue{`,
@@ -1706,6 +2412,43 @@ func (this *HTTPIngressRuleValue) String() string {
}, "")
return s
}
+func (this *IPAddress) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&IPAddress{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "IPAddressSpec", "IPAddressSpec", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *IPAddressList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForItems := "[]IPAddress{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "IPAddress", "IPAddress", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&IPAddressList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *IPAddressSpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&IPAddressSpec{`,
+ `ParentRef:` + strings.Replace(this.ParentRef.String(), "ParentReference", "ParentReference", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *Ingress) String() string {
if this == nil {
return "nil"
@@ -1900,22 +2643,1172 @@ func (this *IngressTLS) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&IngressTLS{`,
- `Hosts:` + fmt.Sprintf("%v", this.Hosts) + `,`,
- `SecretName:` + fmt.Sprintf("%v", this.SecretName) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringGenerated(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
+ s := strings.Join([]string{`&IngressTLS{`,
+ `Hosts:` + fmt.Sprintf("%v", this.Hosts) + `,`,
+ `SecretName:` + fmt.Sprintf("%v", this.SecretName) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ParentReference) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ParentReference{`,
+ `Group:` + fmt.Sprintf("%v", this.Group) + `,`,
+ `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`,
+ `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ServiceCIDR) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ServiceCIDR{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ServiceCIDRSpec", "ServiceCIDRSpec", 1), `&`, ``, 1) + `,`,
+ `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ServiceCIDRStatus", "ServiceCIDRStatus", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ServiceCIDRList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForItems := "[]ServiceCIDR{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ServiceCIDR", "ServiceCIDR", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&ServiceCIDRList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ServiceCIDRSpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&ServiceCIDRSpec{`,
+ `CIDRs:` + fmt.Sprintf("%v", this.CIDRs) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ServiceCIDRStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForConditions := "[]Condition{"
+ for _, f := range this.Conditions {
+ repeatedStringForConditions += fmt.Sprintf("%v", f) + ","
+ }
+ repeatedStringForConditions += "}"
+ s := strings.Join([]string{`&ServiceCIDRStatus{`,
+ `Conditions:` + repeatedStringForConditions + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
+}
+func (m *HTTPIngressPath) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: HTTPIngressPath: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: HTTPIngressPath: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Path = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Backend", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Backend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PathType", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := PathType(dAtA[iNdEx:postIndex])
+ m.PathType = &s
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *HTTPIngressRuleValue) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: HTTPIngressRuleValue: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: HTTPIngressRuleValue: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Paths = append(m.Paths, HTTPIngressPath{})
+ if err := m.Paths[len(m.Paths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IPAddress) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IPAddress: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IPAddress: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IPAddressList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IPAddressList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IPAddressList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, IPAddress{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IPAddressSpec) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IPAddressSpec: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IPAddressSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ParentRef", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.ParentRef == nil {
+ m.ParentRef = &ParentReference{}
+ }
+ if err := m.ParentRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *Ingress) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: Ingress: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: Ingress: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IngressBackend) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IngressBackend: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IngressBackend: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ServiceName = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ServicePort", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ServicePort.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Resource == nil {
+ m.Resource = &v11.TypedLocalObjectReference{}
+ }
+ if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IngressClass) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IngressClass: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IngressClass: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IngressClassList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IngressClassList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IngressClassList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, IngressClass{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
}
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
+ return nil
}
-func (m *HTTPIngressPath) Unmarshal(dAtA []byte) error {
+func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1938,15 +3831,15 @@ func (m *HTTPIngressPath) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: HTTPIngressPath: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressClassParametersReference: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: HTTPIngressPath: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressClassParametersReference: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -1974,13 +3867,14 @@ func (m *HTTPIngressPath) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Path = string(dAtA[iNdEx:postIndex])
+ s := string(dAtA[iNdEx:postIndex])
+ m.APIGroup = &s
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Backend", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -1990,28 +3884,27 @@ func (m *HTTPIngressPath) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Backend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Kind = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field PathType", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -2039,64 +3932,46 @@ func (m *HTTPIngressPath) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- s := PathType(dAtA[iNdEx:postIndex])
- m.PathType = &s
+ m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType)
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
}
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
}
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *HTTPIngressRuleValue) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
}
- if iNdEx >= l {
+ if postIndex > l {
return io.ErrUnexpectedEOF
}
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: HTTPIngressRuleValue: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: HTTPIngressRuleValue: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
+ s := string(dAtA[iNdEx:postIndex])
+ m.Scope = &s
+ iNdEx = postIndex
+ case 5:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -2106,25 +3981,24 @@ func (m *HTTPIngressRuleValue) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Paths = append(m.Paths, HTTPIngressPath{})
- if err := m.Paths[len(m.Paths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ s := string(dAtA[iNdEx:postIndex])
+ m.Namespace = &s
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -2147,7 +4021,7 @@ func (m *HTTPIngressRuleValue) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *Ingress) Unmarshal(dAtA []byte) error {
+func (m *IngressClassSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2170,17 +4044,17 @@ func (m *Ingress) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: Ingress: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressClassSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: Ingress: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressClassSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -2190,28 +4064,27 @@ func (m *Ingress) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Controller = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2238,40 +4111,10 @@ func (m *Ingress) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
+ if m.Parameters == nil {
+ m.Parameters = &IngressClassParametersReference{}
}
- if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -2296,7 +4139,7 @@ func (m *Ingress) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressBackend) Unmarshal(dAtA []byte) error {
+func (m *IngressList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2319,47 +4162,15 @@ func (m *IngressBackend) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressBackend: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressList: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressBackend: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ServiceName = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ServicePort", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2386,13 +4197,13 @@ func (m *IngressBackend) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ServicePort.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 3:
+ case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2419,10 +4230,8 @@ func (m *IngressBackend) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.Resource == nil {
- m.Resource = &v11.TypedLocalObjectReference{}
- }
- if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Items = append(m.Items, Ingress{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -2447,7 +4256,7 @@ func (m *IngressBackend) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressClass) Unmarshal(dAtA []byte) error {
+func (m *IngressLoadBalancerIngress) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2470,17 +4279,17 @@ func (m *IngressClass) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressClass: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressLoadBalancerIngress: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressClass: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressLoadBalancerIngress: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field IP", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -2490,28 +4299,59 @@ func (m *IngressClass) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.IP = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Hostname = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2538,7 +4378,8 @@ func (m *IngressClass) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Ports = append(m.Ports, IngressPortStatus{})
+ if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -2563,7 +4404,7 @@ func (m *IngressClass) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressClassList) Unmarshal(dAtA []byte) error {
+func (m *IngressLoadBalancerStatus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2586,48 +4427,15 @@ func (m *IngressClassList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressClassList: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressLoadBalancerStatus: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressClassList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressLoadBalancerStatus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Ingress", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2654,8 +4462,8 @@ func (m *IngressClassList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, IngressClass{})
- if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Ingress = append(m.Ingress, IngressLoadBalancerIngress{})
+ if err := m.Ingress[len(m.Ingress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -2680,7 +4488,7 @@ func (m *IngressClassList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
+func (m *IngressPortStatus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2703,17 +4511,17 @@ func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressClassParametersReference: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressPortStatus: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressClassParametersReference: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressPortStatus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType)
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
}
- var stringLen uint64
+ m.Port = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -2723,28 +4531,14 @@ func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ m.Port |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- s := string(dAtA[iNdEx:postIndex])
- m.APIGroup = &s
- iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -2772,11 +4566,11 @@ func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Kind = string(dAtA[iNdEx:postIndex])
+ m.Protocol = k8s_io_api_core_v1.Protocol(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -2804,11 +4598,62 @@ func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Name = string(dAtA[iNdEx:postIndex])
+ s := string(dAtA[iNdEx:postIndex])
+ m.Error = &s
iNdEx = postIndex
- case 4:
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IngressRule) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IngressRule: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IngressRule: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -2836,14 +4681,13 @@ func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- s := string(dAtA[iNdEx:postIndex])
- m.Scope = &s
+ m.Host = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 5:
+ case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field IngressRuleValue", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -2853,24 +4697,24 @@ func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- s := string(dAtA[iNdEx:postIndex])
- m.Namespace = &s
+ if err := m.IngressRuleValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -2893,7 +4737,7 @@ func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressClassSpec) Unmarshal(dAtA []byte) error {
+func (m *IngressRuleValue) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2912,51 +4756,19 @@ func (m *IngressClassSpec) Unmarshal(dAtA []byte) error {
if b < 0x80 {
break
}
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: IngressClassSpec: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressClassSpec: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Controller = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IngressRuleValue: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IngressRuleValue: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2983,10 +4795,10 @@ func (m *IngressClassSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.Parameters == nil {
- m.Parameters = &IngressClassParametersReference{}
+ if m.HTTP == nil {
+ m.HTTP = &HTTPIngressRuleValue{}
}
- if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.HTTP.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -3011,7 +4823,7 @@ func (m *IngressClassSpec) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressList) Unmarshal(dAtA []byte) error {
+func (m *IngressSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3034,15 +4846,15 @@ func (m *IngressList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressList: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Backend", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -3069,13 +4881,16 @@ func (m *IngressList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if m.Backend == nil {
+ m.Backend = &IngressBackend{}
+ }
+ if err := m.Backend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -3102,66 +4917,16 @@ func (m *IngressList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, Ingress{})
- if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.TLS = append(m.TLS, IngressTLS{})
+ if err := m.TLS[len(m.TLS)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *IngressLoadBalancerIngress) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: IngressLoadBalancerIngress: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressLoadBalancerIngress: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
+ case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IP", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -3171,27 +4936,29 @@ func (m *IngressLoadBalancerIngress) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.IP = string(dAtA[iNdEx:postIndex])
+ m.Rules = append(m.Rules, IngressRule{})
+ if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
- case 2:
+ case 4:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field IngressClassName", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -3219,11 +4986,62 @@ func (m *IngressLoadBalancerIngress) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Hostname = string(dAtA[iNdEx:postIndex])
+ s := string(dAtA[iNdEx:postIndex])
+ m.IngressClassName = &s
iNdEx = postIndex
- case 4:
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *IngressStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: IngressStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: IngressStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field LoadBalancer", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -3250,8 +5068,7 @@ func (m *IngressLoadBalancerIngress) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Ports = append(m.Ports, IngressPortStatus{})
- if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.LoadBalancer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -3276,7 +5093,7 @@ func (m *IngressLoadBalancerIngress) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressLoadBalancerStatus) Unmarshal(dAtA []byte) error {
+func (m *IngressTLS) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3299,17 +5116,17 @@ func (m *IngressLoadBalancerStatus) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressLoadBalancerStatus: wiretype end group for non-group")
+ return fmt.Errorf("proto: IngressTLS: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressLoadBalancerStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: IngressTLS: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ingress", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -3319,25 +5136,55 @@ func (m *IngressLoadBalancerStatus) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Ingress = append(m.Ingress, IngressLoadBalancerIngress{})
- if err := m.Ingress[len(m.Ingress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
+ m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SecretName", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
}
+ m.SecretName = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -3360,7 +5207,7 @@ func (m *IngressLoadBalancerStatus) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressPortStatus) Unmarshal(dAtA []byte) error {
+func (m *ParentReference) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3383,17 +5230,49 @@ func (m *IngressPortStatus) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressPortStatus: wiretype end group for non-group")
+ return fmt.Errorf("proto: ParentReference: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressPortStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ParentReference: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Group = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
}
- m.Port = 0
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -3403,14 +5282,27 @@ func (m *IngressPortStatus) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- m.Port |= int32(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- case 2:
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Resource = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -3438,11 +5330,11 @@ func (m *IngressPortStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Protocol = k8s_io_api_core_v1.Protocol(dAtA[iNdEx:postIndex])
+ m.Namespace = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 3:
+ case 4:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -3470,8 +5362,7 @@ func (m *IngressPortStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- s := string(dAtA[iNdEx:postIndex])
- m.Error = &s
+ m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -3494,7 +5385,7 @@ func (m *IngressPortStatus) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressRule) Unmarshal(dAtA []byte) error {
+func (m *ServiceCIDR) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3517,17 +5408,17 @@ func (m *IngressRule) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressRule: wiretype end group for non-group")
+ return fmt.Errorf("proto: ServiceCIDR: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressRule: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ServiceCIDR: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -3537,27 +5428,28 @@ func (m *IngressRule) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Host = string(dAtA[iNdEx:postIndex])
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IngressRuleValue", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -3584,63 +5476,13 @@ func (m *IngressRule) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.IngressRuleValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *IngressRuleValue) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: IngressRuleValue: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressRuleValue: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
+ case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -3667,10 +5509,7 @@ func (m *IngressRuleValue) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.HTTP == nil {
- m.HTTP = &HTTPIngressRuleValue{}
- }
- if err := m.HTTP.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -3695,7 +5534,7 @@ func (m *IngressRuleValue) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressSpec) Unmarshal(dAtA []byte) error {
+func (m *ServiceCIDRList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3718,15 +5557,15 @@ func (m *IngressSpec) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressSpec: wiretype end group for non-group")
+ return fmt.Errorf("proto: ServiceCIDRList: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ServiceCIDRList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Backend", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -3753,50 +5592,13 @@ func (m *IngressSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.Backend == nil {
- m.Backend = &IngressBackend{}
- }
- if err := m.Backend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.TLS = append(m.TLS, IngressTLS{})
- if err := m.TLS[len(m.TLS)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -3823,44 +5625,11 @@ func (m *IngressSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Rules = append(m.Rules, IngressRule{})
- if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Items = append(m.Items, ServiceCIDR{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IngressClassName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- s := string(dAtA[iNdEx:postIndex])
- m.IngressClassName = &s
- iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -3882,7 +5651,7 @@ func (m *IngressSpec) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressStatus) Unmarshal(dAtA []byte) error {
+func (m *ServiceCIDRSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3905,17 +5674,17 @@ func (m *IngressStatus) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressStatus: wiretype end group for non-group")
+ return fmt.Errorf("proto: ServiceCIDRSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ServiceCIDRSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field LoadBalancer", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field CIDRs", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -3925,24 +5694,23 @@ func (m *IngressStatus) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.LoadBalancer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.CIDRs = append(m.CIDRs, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -3965,7 +5733,7 @@ func (m *IngressStatus) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *IngressTLS) Unmarshal(dAtA []byte) error {
+func (m *ServiceCIDRStatus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3988,17 +5756,17 @@ func (m *IngressTLS) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: IngressTLS: wiretype end group for non-group")
+ return fmt.Errorf("proto: ServiceCIDRStatus: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: IngressTLS: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ServiceCIDRStatus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -4008,55 +5776,25 @@ func (m *IngressTLS) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SecretName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
+ m.Conditions = append(m.Conditions, v1.Condition{})
+ if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
}
- m.SecretName = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
diff --git a/vendor/k8s.io/api/networking/v1beta1/generated.proto b/vendor/k8s.io/api/networking/v1beta1/generated.proto
index f36df9ec194..3368dcaec3f 100644
--- a/vendor/k8s.io/api/networking/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/networking/v1beta1/generated.proto
@@ -73,6 +73,44 @@ message HTTPIngressRuleValue {
repeated HTTPIngressPath paths = 1;
}
+// IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs
+// that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses.
+// An IP address can be represented in different formats, to guarantee the uniqueness of the IP,
+// the name of the object is the IP address in canonical format, four decimal digits separated
+// by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6.
+// Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1
+// Invalid: 10.01.2.3 or 2001:db8:0:0:0::1
+message IPAddress {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // spec is the desired state of the IPAddress.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ optional IPAddressSpec spec = 2;
+}
+
+// IPAddressList contains a list of IPAddress.
+message IPAddressList {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // items is the list of IPAddresses.
+ repeated IPAddress items = 2;
+}
+
+// IPAddressSpec describe the attributes in an IP Address.
+message IPAddressSpec {
+ // ParentRef references the resource that an IPAddress is attached to.
+ // An IPAddress must reference a parent object.
+ // +required
+ optional ParentReference parentRef = 1;
+}
+
// Ingress is a collection of rules that allow inbound connections to reach the
// endpoints defined by a backend. An Ingress can be configured to give services
// externally-reachable urls, load balance traffic, terminate SSL, offer name
@@ -81,7 +119,7 @@ message Ingress {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the desired state of the Ingress.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -102,13 +140,13 @@ message IngressBackend {
// servicePort Specifies the port of the referenced service.
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString servicePort = 2;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString servicePort = 2;
// resource is an ObjectRef to another Kubernetes resource in the namespace
// of the Ingress object. If resource is specified, serviceName and servicePort
// must not be specified.
// +optional
- optional k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
+ optional .k8s.io.api.core.v1.TypedLocalObjectReference resource = 3;
}
// IngressClass represents the class of the Ingress, referenced by the Ingress
@@ -120,7 +158,7 @@ message IngressClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the desired state of the IngressClass.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -132,7 +170,7 @@ message IngressClass {
message IngressClassList {
// Standard list metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of IngressClasses.
repeated IngressClass items = 2;
@@ -186,7 +224,7 @@ message IngressList {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of Ingress.
repeated Ingress items = 2;
@@ -351,3 +389,74 @@ message IngressTLS {
optional string secretName = 2;
}
+// ParentReference describes a reference to a parent object.
+message ParentReference {
+ // Group is the group of the object being referenced.
+ // +optional
+ optional string group = 1;
+
+ // Resource is the resource of the object being referenced.
+ // +required
+ optional string resource = 2;
+
+ // Namespace is the namespace of the object being referenced.
+ // +optional
+ optional string namespace = 3;
+
+ // Name is the name of the object being referenced.
+ // +required
+ optional string name = 4;
+}
+
+// ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64).
+// This range is used to allocate ClusterIPs to Service objects.
+message ServiceCIDR {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // spec is the desired state of the ServiceCIDR.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ optional ServiceCIDRSpec spec = 2;
+
+ // status represents the current state of the ServiceCIDR.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ optional ServiceCIDRStatus status = 3;
+}
+
+// ServiceCIDRList contains a list of ServiceCIDR objects.
+message ServiceCIDRList {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // items is the list of ServiceCIDRs.
+ repeated ServiceCIDR items = 2;
+}
+
+// ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.
+message ServiceCIDRSpec {
+ // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64")
+ // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family.
+ // This field is immutable.
+ // +optional
+ // +listType=atomic
+ repeated string cidrs = 1;
+}
+
+// ServiceCIDRStatus describes the current state of the ServiceCIDR.
+message ServiceCIDRStatus {
+ // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR.
+ // Current service state
+ // +optional
+ // +patchMergeKey=type
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=type
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1;
+}
+
diff --git a/vendor/k8s.io/api/networking/v1beta1/register.go b/vendor/k8s.io/api/networking/v1beta1/register.go
index 04234953e61..9d2a13cc683 100644
--- a/vendor/k8s.io/api/networking/v1beta1/register.go
+++ b/vendor/k8s.io/api/networking/v1beta1/register.go
@@ -51,6 +51,10 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&IngressList{},
&IngressClass{},
&IngressClassList{},
+ &IPAddress{},
+ &IPAddressList{},
+ &ServiceCIDR{},
+ &ServiceCIDRList{},
)
// Add the watch version that applies
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
diff --git a/vendor/k8s.io/api/networking/v1beta1/types.go b/vendor/k8s.io/api/networking/v1beta1/types.go
index 34dfe76aa3e..cd7126a5a8e 100644
--- a/vendor/k8s.io/api/networking/v1beta1/types.go
+++ b/vendor/k8s.io/api/networking/v1beta1/types.go
@@ -218,7 +218,7 @@ type IngressRule struct {
// default backend, is left to the controller fulfilling the Ingress. Http is
// currently the only supported IngressRuleValue.
// +optional
- IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
+ IngressRuleValue `json:",inline" protobuf:"bytes,2,opt,name=ingressRuleValue"`
}
// IngressRuleValue represents a rule to apply against incoming requests. If the
@@ -421,3 +421,133 @@ type IngressClassList struct {
// items is the list of IngressClasses.
Items []IngressClass `json:"items" protobuf:"bytes,2,rep,name=items"`
}
+
+// +genclient
+// +genclient:nonNamespaced
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs
+// that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses.
+// An IP address can be represented in different formats, to guarantee the uniqueness of the IP,
+// the name of the object is the IP address in canonical format, four decimal digits separated
+// by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6.
+// Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1
+// Invalid: 10.01.2.3 or 2001:db8:0:0:0::1
+type IPAddress struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // spec is the desired state of the IPAddress.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ Spec IPAddressSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
+}
+
+// IPAddressSpec describe the attributes in an IP Address.
+type IPAddressSpec struct {
+ // ParentRef references the resource that an IPAddress is attached to.
+ // An IPAddress must reference a parent object.
+ // +required
+ ParentRef *ParentReference `json:"parentRef,omitempty" protobuf:"bytes,1,opt,name=parentRef"`
+}
+
+// ParentReference describes a reference to a parent object.
+type ParentReference struct {
+ // Group is the group of the object being referenced.
+ // +optional
+ Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
+ // Resource is the resource of the object being referenced.
+ // +required
+ Resource string `json:"resource,omitempty" protobuf:"bytes,2,opt,name=resource"`
+ // Namespace is the namespace of the object being referenced.
+ // +optional
+ Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`
+ // Name is the name of the object being referenced.
+ // +required
+ Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// IPAddressList contains a list of IPAddress.
+type IPAddressList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // items is the list of IPAddresses.
+ Items []IPAddress `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
+
+// +genclient
+// +genclient:nonNamespaced
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64).
+// This range is used to allocate ClusterIPs to Service objects.
+type ServiceCIDR struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // spec is the desired state of the ServiceCIDR.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ Spec ServiceCIDRSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
+ // status represents the current state of the ServiceCIDR.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
+ // +optional
+ Status ServiceCIDRStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
+}
+
+// ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.
+type ServiceCIDRSpec struct {
+ // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64")
+ // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family.
+ // This field is immutable.
+ // +optional
+ // +listType=atomic
+ CIDRs []string `json:"cidrs,omitempty" protobuf:"bytes,1,opt,name=cidrs"`
+}
+
+const (
+ // ServiceCIDRConditionReady represents status of a ServiceCIDR that is ready to be used by the
+ // apiserver to allocate ClusterIPs for Services.
+ ServiceCIDRConditionReady = "Ready"
+ // ServiceCIDRReasonTerminating represents a reason where a ServiceCIDR is not ready because it is
+ // being deleted.
+ ServiceCIDRReasonTerminating = "Terminating"
+)
+
+// ServiceCIDRStatus describes the current state of the ServiceCIDR.
+type ServiceCIDRStatus struct {
+ // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR.
+ // Current service state
+ // +optional
+ // +patchMergeKey=type
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=type
+ Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// ServiceCIDRList contains a list of ServiceCIDR objects.
+type ServiceCIDRList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // items is the list of ServiceCIDRs.
+ Items []ServiceCIDR `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
diff --git a/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go
index b2373669fec..9d27517f3b1 100644
--- a/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go
@@ -47,6 +47,35 @@ func (HTTPIngressRuleValue) SwaggerDoc() map[string]string {
return map_HTTPIngressRuleValue
}
+var map_IPAddress = map[string]string{
+ "": "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1",
+ "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "spec": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
+}
+
+func (IPAddress) SwaggerDoc() map[string]string {
+ return map_IPAddress
+}
+
+var map_IPAddressList = map[string]string{
+ "": "IPAddressList contains a list of IPAddress.",
+ "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "items": "items is the list of IPAddresses.",
+}
+
+func (IPAddressList) SwaggerDoc() map[string]string {
+ return map_IPAddressList
+}
+
+var map_IPAddressSpec = map[string]string{
+ "": "IPAddressSpec describe the attributes in an IP Address.",
+ "parentRef": "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.",
+}
+
+func (IPAddressSpec) SwaggerDoc() map[string]string {
+ return map_IPAddressSpec
+}
+
var map_Ingress = map[string]string{
"": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.",
"metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
@@ -201,4 +230,55 @@ func (IngressTLS) SwaggerDoc() map[string]string {
return map_IngressTLS
}
+var map_ParentReference = map[string]string{
+ "": "ParentReference describes a reference to a parent object.",
+ "group": "Group is the group of the object being referenced.",
+ "resource": "Resource is the resource of the object being referenced.",
+ "namespace": "Namespace is the namespace of the object being referenced.",
+ "name": "Name is the name of the object being referenced.",
+}
+
+func (ParentReference) SwaggerDoc() map[string]string {
+ return map_ParentReference
+}
+
+var map_ServiceCIDR = map[string]string{
+ "": "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.",
+ "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "spec": "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
+ "status": "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
+}
+
+func (ServiceCIDR) SwaggerDoc() map[string]string {
+ return map_ServiceCIDR
+}
+
+var map_ServiceCIDRList = map[string]string{
+ "": "ServiceCIDRList contains a list of ServiceCIDR objects.",
+ "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "items": "items is the list of ServiceCIDRs.",
+}
+
+func (ServiceCIDRList) SwaggerDoc() map[string]string {
+ return map_ServiceCIDRList
+}
+
+var map_ServiceCIDRSpec = map[string]string{
+ "": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.",
+ "cidrs": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.",
+}
+
+func (ServiceCIDRSpec) SwaggerDoc() map[string]string {
+ return map_ServiceCIDRSpec
+}
+
+var map_ServiceCIDRStatus = map[string]string{
+ "": "ServiceCIDRStatus describes the current state of the ServiceCIDR.",
+ "conditions": "conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. Current service state",
+}
+
+func (ServiceCIDRStatus) SwaggerDoc() map[string]string {
+ return map_ServiceCIDRStatus
+}
+
// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/vendor/k8s.io/api/networking/v1beta1/well_known_labels.go b/vendor/k8s.io/api/networking/v1beta1/well_known_labels.go
new file mode 100644
index 00000000000..bc2207766fd
--- /dev/null
+++ b/vendor/k8s.io/api/networking/v1beta1/well_known_labels.go
@@ -0,0 +1,33 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+const (
+
+ // TODO: Use IPFamily as field with a field selector,And the value is set based on
+ // the name at create time and immutable.
+ // LabelIPAddressFamily is used to indicate the IP family of a Kubernetes IPAddress.
+ // This label simplify dual-stack client operations allowing to obtain the list of
+ // IP addresses filtered by family.
+ LabelIPAddressFamily = "ipaddress.kubernetes.io/ip-family"
+ // LabelManagedBy is used to indicate the controller or entity that manages
+ // an IPAddress. This label aims to enable different IPAddress
+ // objects to be managed by different controllers or entities within the
+ // same cluster. It is highly recommended to configure this label for all
+ // IPAddress objects.
+ LabelManagedBy = "ipaddress.kubernetes.io/managed-by"
+)
diff --git a/vendor/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go
index 005d64e7fd4..1a6869cd6db 100644
--- a/vendor/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go
@@ -23,6 +23,7 @@ package v1beta1
import (
v1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -71,6 +72,87 @@ func (in *HTTPIngressRuleValue) DeepCopy() *HTTPIngressRuleValue {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IPAddress) DeepCopyInto(out *IPAddress) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddress.
+func (in *IPAddress) DeepCopy() *IPAddress {
+ if in == nil {
+ return nil
+ }
+ out := new(IPAddress)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *IPAddress) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IPAddressList) DeepCopyInto(out *IPAddressList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]IPAddress, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressList.
+func (in *IPAddressList) DeepCopy() *IPAddressList {
+ if in == nil {
+ return nil
+ }
+ out := new(IPAddressList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *IPAddressList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) {
+ *out = *in
+ if in.ParentRef != nil {
+ in, out := &in.ParentRef, &out.ParentRef
+ *out = new(ParentReference)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressSpec.
+func (in *IPAddressSpec) DeepCopy() *IPAddressSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(IPAddressSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Ingress) DeepCopyInto(out *Ingress) {
*out = *in
@@ -448,3 +530,124 @@ func (in *IngressTLS) DeepCopy() *IngressTLS {
in.DeepCopyInto(out)
return out
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ParentReference) DeepCopyInto(out *ParentReference) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentReference.
+func (in *ParentReference) DeepCopy() *ParentReference {
+ if in == nil {
+ return nil
+ }
+ out := new(ParentReference)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceCIDR) DeepCopyInto(out *ServiceCIDR) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ in.Status.DeepCopyInto(&out.Status)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDR.
+func (in *ServiceCIDR) DeepCopy() *ServiceCIDR {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceCIDR)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ServiceCIDR) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceCIDRList) DeepCopyInto(out *ServiceCIDRList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]ServiceCIDR, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRList.
+func (in *ServiceCIDRList) DeepCopy() *ServiceCIDRList {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceCIDRList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ServiceCIDRList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceCIDRSpec) DeepCopyInto(out *ServiceCIDRSpec) {
+ *out = *in
+ if in.CIDRs != nil {
+ in, out := &in.CIDRs, &out.CIDRs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRSpec.
+func (in *ServiceCIDRSpec) DeepCopy() *ServiceCIDRSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceCIDRSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceCIDRStatus) DeepCopyInto(out *ServiceCIDRStatus) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]metav1.Condition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRStatus.
+func (in *ServiceCIDRStatus) DeepCopy() *ServiceCIDRStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceCIDRStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/vendor/k8s.io/api/networking/v1beta1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/networking/v1beta1/zz_generated.prerelease-lifecycle.go
index e8b4c7ec7ff..a876fd5fe08 100644
--- a/vendor/k8s.io/api/networking/v1beta1/zz_generated.prerelease-lifecycle.go
+++ b/vendor/k8s.io/api/networking/v1beta1/zz_generated.prerelease-lifecycle.go
@@ -25,6 +25,42 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
)
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *IPAddress) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *IPAddress) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *IPAddress) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *IPAddressList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *IPAddressList) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *IPAddressList) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
+
// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
func (in *Ingress) APILifecycleIntroduced() (major, minor int) {
@@ -120,3 +156,39 @@ func (in *IngressList) APILifecycleReplacement() schema.GroupVersionKind {
func (in *IngressList) APILifecycleRemoved() (major, minor int) {
return 1, 22
}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ServiceCIDR) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *ServiceCIDR) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *ServiceCIDR) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ServiceCIDRList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *ServiceCIDRList) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *ServiceCIDRList) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
diff --git a/vendor/k8s.io/api/node/v1/doc.go b/vendor/k8s.io/api/node/v1/doc.go
index 12cbcb8a0ef..57ca52445bd 100644
--- a/vendor/k8s.io/api/node/v1/doc.go
+++ b/vendor/k8s.io/api/node/v1/doc.go
@@ -17,7 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
-
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=node.k8s.io
package v1 // import "k8s.io/api/node/v1"
diff --git a/vendor/k8s.io/api/node/v1/generated.proto b/vendor/k8s.io/api/node/v1/generated.proto
index 0152d5e3aba..e6b8852ec10 100644
--- a/vendor/k8s.io/api/node/v1/generated.proto
+++ b/vendor/k8s.io/api/node/v1/generated.proto
@@ -34,7 +34,7 @@ option go_package = "k8s.io/api/node/v1";
message Overhead {
// podFixed represents the fixed resource overhead associated with running a pod.
// +optional
- map podFixed = 1;
+ map podFixed = 1;
}
// RuntimeClass defines a class of container runtime supported in the cluster.
@@ -47,7 +47,7 @@ message Overhead {
message RuntimeClass {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// handler specifies the underlying runtime and configuration that the CRI
// implementation will use to handle pods of this class. The possible values
@@ -80,7 +80,7 @@ message RuntimeClassList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated RuntimeClass items = 2;
@@ -103,6 +103,6 @@ message Scheduling {
// tolerated by the pod and the RuntimeClass.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.Toleration tolerations = 2;
+ repeated .k8s.io.api.core.v1.Toleration tolerations = 2;
}
diff --git a/vendor/k8s.io/api/node/v1/types.go b/vendor/k8s.io/api/node/v1/types.go
index b00f58772cd..169862ea940 100644
--- a/vendor/k8s.io/api/node/v1/types.go
+++ b/vendor/k8s.io/api/node/v1/types.go
@@ -24,6 +24,7 @@ import (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.20
// RuntimeClass defines a class of container runtime supported in the cluster.
// The RuntimeClass is used to determine which container runtime is used to run
@@ -93,6 +94,7 @@ type Scheduling struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.20
// RuntimeClassList is a list of RuntimeClass objects.
type RuntimeClassList struct {
diff --git a/vendor/k8s.io/api/node/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/node/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..74979556880
--- /dev/null
+++ b/vendor/k8s.io/api/node/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *RuntimeClass) APILifecycleIntroduced() (major, minor int) {
+ return 1, 20
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *RuntimeClassList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 20
+}
diff --git a/vendor/k8s.io/api/node/v1alpha1/generated.proto b/vendor/k8s.io/api/node/v1alpha1/generated.proto
index 4673e9261d8..bc68718d90c 100644
--- a/vendor/k8s.io/api/node/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/node/v1alpha1/generated.proto
@@ -34,7 +34,7 @@ option go_package = "k8s.io/api/node/v1alpha1";
message Overhead {
// podFixed represents the fixed resource overhead associated with running a pod.
// +optional
- map podFixed = 1;
+ map podFixed = 1;
}
// RuntimeClass defines a class of container runtime supported in the cluster.
@@ -47,7 +47,7 @@ message Overhead {
message RuntimeClass {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec represents specification of the RuntimeClass
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -59,7 +59,7 @@ message RuntimeClassList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated RuntimeClass items = 2;
@@ -113,6 +113,6 @@ message Scheduling {
// tolerated by the pod and the RuntimeClass.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.Toleration tolerations = 2;
+ repeated .k8s.io.api.core.v1.Toleration tolerations = 2;
}
diff --git a/vendor/k8s.io/api/node/v1beta1/generated.proto b/vendor/k8s.io/api/node/v1beta1/generated.proto
index 54dbc0995ac..497027e033a 100644
--- a/vendor/k8s.io/api/node/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/node/v1beta1/generated.proto
@@ -34,7 +34,7 @@ option go_package = "k8s.io/api/node/v1beta1";
message Overhead {
// podFixed represents the fixed resource overhead associated with running a pod.
// +optional
- map podFixed = 1;
+ map podFixed = 1;
}
// RuntimeClass defines a class of container runtime supported in the cluster.
@@ -47,7 +47,7 @@ message Overhead {
message RuntimeClass {
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// handler specifies the underlying runtime and configuration that the CRI
// implementation will use to handle pods of this class. The possible values
@@ -80,7 +80,7 @@ message RuntimeClassList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated RuntimeClass items = 2;
@@ -103,6 +103,6 @@ message Scheduling {
// tolerated by the pod and the RuntimeClass.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.Toleration tolerations = 2;
+ repeated .k8s.io.api.core.v1.Toleration tolerations = 2;
}
diff --git a/vendor/k8s.io/api/policy/v1/doc.go b/vendor/k8s.io/api/policy/v1/doc.go
index 177cdf52368..c51e02685ab 100644
--- a/vendor/k8s.io/api/policy/v1/doc.go
+++ b/vendor/k8s.io/api/policy/v1/doc.go
@@ -17,6 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
// Package policy is for any kind of policy object. Suitable examples, even if
// they aren't all here, are PodDisruptionBudget,
diff --git a/vendor/k8s.io/api/policy/v1/generated.proto b/vendor/k8s.io/api/policy/v1/generated.proto
index a79e7102841..57128e8112b 100644
--- a/vendor/k8s.io/api/policy/v1/generated.proto
+++ b/vendor/k8s.io/api/policy/v1/generated.proto
@@ -35,11 +35,11 @@ option go_package = "k8s.io/api/policy/v1";
message Eviction {
// ObjectMeta describes the pod that is being evicted.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// DeleteOptions may be provided
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
}
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
@@ -47,7 +47,7 @@ message PodDisruptionBudget {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the PodDisruptionBudget.
// +optional
@@ -63,7 +63,7 @@ message PodDisruptionBudgetList {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of PodDisruptionBudgets
repeated PodDisruptionBudget items = 2;
@@ -76,7 +76,7 @@ message PodDisruptionBudgetSpec {
// absence of the evicted pod. So for example you can prevent all voluntary
// evictions by specifying "100%".
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
// Label query over pods whose evictions are managed by the disruption
// budget.
@@ -84,14 +84,14 @@ message PodDisruptionBudgetSpec {
// all pods within the namespace.
// +patchStrategy=replace
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// An eviction is allowed if at most "maxUnavailable" pods selected by
// "selector" are unavailable after the eviction, i.e. even in absence of
// the evicted pod. For example, one can prevent all voluntary evictions
// by specifying 0. This is a mutually exclusive setting with "minAvailable".
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
// UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods
// should be considered for eviction. Current implementation considers healthy pods,
@@ -142,7 +142,7 @@ message PodDisruptionBudgetStatus {
// If everything goes smooth this map should be empty for the most of the time.
// Large number of entries in the map may indicate problems with pod deletions.
// +optional
- map disruptedPods = 2;
+ map disruptedPods = 2;
// Number of pod disruptions that are currently allowed.
optional int32 disruptionsAllowed = 3;
@@ -174,6 +174,6 @@ message PodDisruptionBudgetStatus {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
}
diff --git a/vendor/k8s.io/api/policy/v1/types.go b/vendor/k8s.io/api/policy/v1/types.go
index 45b9550f4a7..f05367ebe42 100644
--- a/vendor/k8s.io/api/policy/v1/types.go
+++ b/vendor/k8s.io/api/policy/v1/types.go
@@ -170,6 +170,7 @@ const (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.21
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
type PodDisruptionBudget struct {
@@ -188,6 +189,7 @@ type PodDisruptionBudget struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.21
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
type PodDisruptionBudgetList struct {
@@ -203,6 +205,7 @@ type PodDisruptionBudgetList struct {
// +genclient
// +genclient:noVerbs
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.22
// Eviction evicts a pod from its node subject to certain policies and safety constraints.
// This is a subresource of Pod. A request to cause such an eviction is
diff --git a/vendor/k8s.io/api/policy/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/policy/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..d6663b92346
--- /dev/null
+++ b/vendor/k8s.io/api/policy/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,40 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Eviction) APILifecycleIntroduced() (major, minor int) {
+ return 1, 22
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodDisruptionBudget) APILifecycleIntroduced() (major, minor int) {
+ return 1, 21
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PodDisruptionBudgetList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 21
+}
diff --git a/vendor/k8s.io/api/policy/v1beta1/generated.proto b/vendor/k8s.io/api/policy/v1beta1/generated.proto
index d1409913f1e..91e33f2332b 100644
--- a/vendor/k8s.io/api/policy/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/policy/v1beta1/generated.proto
@@ -35,11 +35,11 @@ option go_package = "k8s.io/api/policy/v1beta1";
message Eviction {
// ObjectMeta describes the pod that is being evicted.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// DeleteOptions may be provided
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
}
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
@@ -47,7 +47,7 @@ message PodDisruptionBudget {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the PodDisruptionBudget.
// +optional
@@ -63,7 +63,7 @@ message PodDisruptionBudgetList {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items list individual PodDisruptionBudget objects
repeated PodDisruptionBudget items = 2;
@@ -76,7 +76,7 @@ message PodDisruptionBudgetSpec {
// absence of the evicted pod. So for example you can prevent all voluntary
// evictions by specifying "100%".
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
// Label query over pods whose evictions are managed by the disruption
// budget.
@@ -84,14 +84,14 @@ message PodDisruptionBudgetSpec {
// An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods.
// In policy/v1, an empty selector will select all pods in the namespace.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// An eviction is allowed if at most "maxUnavailable" pods selected by
// "selector" are unavailable after the eviction, i.e. even in absence of
// the evicted pod. For example, one can prevent all voluntary evictions
// by specifying 0. This is a mutually exclusive setting with "minAvailable".
// +optional
- optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
+ optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
// UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods
// should be considered for eviction. Current implementation considers healthy pods,
@@ -142,7 +142,7 @@ message PodDisruptionBudgetStatus {
// If everything goes smooth this map should be empty for the most of the time.
// Large number of entries in the map may indicate problems with pod deletions.
// +optional
- map disruptedPods = 2;
+ map disruptedPods = 2;
// Number of pod disruptions that are currently allowed.
optional int32 disruptionsAllowed = 3;
@@ -174,6 +174,6 @@ message PodDisruptionBudgetStatus {
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
}
diff --git a/vendor/k8s.io/api/rbac/v1/doc.go b/vendor/k8s.io/api/rbac/v1/doc.go
index 80f43ce9224..b0e4e5b5b58 100644
--- a/vendor/k8s.io/api/rbac/v1/doc.go
+++ b/vendor/k8s.io/api/rbac/v1/doc.go
@@ -17,7 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
-
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=rbac.authorization.k8s.io
package v1 // import "k8s.io/api/rbac/v1"
diff --git a/vendor/k8s.io/api/rbac/v1/generated.proto b/vendor/k8s.io/api/rbac/v1/generated.proto
index 62f5e558ba7..87b8f832d33 100644
--- a/vendor/k8s.io/api/rbac/v1/generated.proto
+++ b/vendor/k8s.io/api/rbac/v1/generated.proto
@@ -34,14 +34,14 @@ message AggregationRule {
// If any of the selectors match, then the ClusterRole's permissions will be added
// +optional
// +listType=atomic
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1;
}
// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
message ClusterRole {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this ClusterRole
// +optional
@@ -60,7 +60,7 @@ message ClusterRole {
message ClusterRoleBinding {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
// +optional
@@ -77,7 +77,7 @@ message ClusterRoleBinding {
message ClusterRoleBindingList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of ClusterRoleBindings
repeated ClusterRoleBinding items = 2;
@@ -87,7 +87,7 @@ message ClusterRoleBindingList {
message ClusterRoleList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of ClusterRoles
repeated ClusterRole items = 2;
@@ -128,7 +128,7 @@ message PolicyRule {
message Role {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this Role
// +optional
@@ -142,7 +142,7 @@ message Role {
message RoleBinding {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
// +optional
@@ -159,7 +159,7 @@ message RoleBinding {
message RoleBindingList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of RoleBindings
repeated RoleBinding items = 2;
@@ -169,7 +169,7 @@ message RoleBindingList {
message RoleList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of Roles
repeated Role items = 2;
diff --git a/vendor/k8s.io/api/rbac/v1/types.go b/vendor/k8s.io/api/rbac/v1/types.go
index 8bef1ac462b..f9628b8536a 100644
--- a/vendor/k8s.io/api/rbac/v1/types.go
+++ b/vendor/k8s.io/api/rbac/v1/types.go
@@ -84,7 +84,7 @@ type Subject struct {
// Defaults to "" for ServiceAccount subjects.
// Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
// +optional
- APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt.name=apiGroup"`
+ APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"`
// Name of the object being referenced.
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
@@ -106,6 +106,7 @@ type RoleRef struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
type Role struct {
@@ -122,6 +123,7 @@ type Role struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace.
// It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given
@@ -144,6 +146,7 @@ type RoleBinding struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// RoleBindingList is a collection of RoleBindings
type RoleBindingList struct {
@@ -157,6 +160,7 @@ type RoleBindingList struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// RoleList is a collection of Roles
type RoleList struct {
@@ -172,6 +176,7 @@ type RoleList struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
type ClusterRole struct {
@@ -204,6 +209,7 @@ type AggregationRule struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace,
// and adds who information via Subject.
@@ -225,6 +231,7 @@ type ClusterRoleBinding struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// ClusterRoleBindingList is a collection of ClusterRoleBindings
type ClusterRoleBindingList struct {
@@ -238,6 +245,7 @@ type ClusterRoleBindingList struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.8
// ClusterRoleList is a collection of ClusterRoles
type ClusterRoleList struct {
diff --git a/vendor/k8s.io/api/rbac/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/rbac/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..f6f74413b8c
--- /dev/null
+++ b/vendor/k8s.io/api/rbac/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,70 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ClusterRole) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ClusterRoleBinding) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ClusterRoleBindingList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ClusterRoleList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *Role) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *RoleBinding) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *RoleBindingList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *RoleList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 8
+}
diff --git a/vendor/k8s.io/api/rbac/v1alpha1/generated.proto b/vendor/k8s.io/api/rbac/v1alpha1/generated.proto
index 170e008a568..19d43cdee58 100644
--- a/vendor/k8s.io/api/rbac/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/rbac/v1alpha1/generated.proto
@@ -34,7 +34,7 @@ message AggregationRule {
// If any of the selectors match, then the ClusterRole's permissions will be added
// +optional
// +listType=atomic
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1;
}
// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
@@ -42,7 +42,7 @@ message AggregationRule {
message ClusterRole {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this ClusterRole
// +optional
@@ -62,7 +62,7 @@ message ClusterRole {
message ClusterRoleBinding {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
// +optional
@@ -79,7 +79,7 @@ message ClusterRoleBinding {
message ClusterRoleBindingList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of ClusterRoleBindings
repeated ClusterRoleBinding items = 2;
@@ -90,7 +90,7 @@ message ClusterRoleBindingList {
message ClusterRoleList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of ClusterRoles
repeated ClusterRole items = 2;
@@ -132,7 +132,7 @@ message PolicyRule {
message Role {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this Role
// +optional
@@ -147,7 +147,7 @@ message Role {
message RoleBinding {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
// +optional
@@ -164,7 +164,7 @@ message RoleBinding {
message RoleBindingList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of RoleBindings
repeated RoleBinding items = 2;
@@ -175,7 +175,7 @@ message RoleBindingList {
message RoleList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of Roles
repeated Role items = 2;
diff --git a/vendor/k8s.io/api/rbac/v1alpha1/types.go b/vendor/k8s.io/api/rbac/v1alpha1/types.go
index 9a0a2197749..2146b4ce39f 100644
--- a/vendor/k8s.io/api/rbac/v1alpha1/types.go
+++ b/vendor/k8s.io/api/rbac/v1alpha1/types.go
@@ -84,7 +84,7 @@ type Subject struct {
// Defaults to "rbac.authorization.k8s.io/v1alpha1" for User and Group subjects.
// +k8s:conversion-gen=false
// +optional
- APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt.name=apiVersion"`
+ APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"`
// Name of the object being referenced.
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
diff --git a/vendor/k8s.io/api/rbac/v1beta1/generated.proto b/vendor/k8s.io/api/rbac/v1beta1/generated.proto
index 7dfc50d7eb6..8bfbd0c8ac6 100644
--- a/vendor/k8s.io/api/rbac/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/rbac/v1beta1/generated.proto
@@ -34,7 +34,7 @@ message AggregationRule {
// If any of the selectors match, then the ClusterRole's permissions will be added
// +optional
// +listType=atomic
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1;
}
// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
@@ -42,7 +42,7 @@ message AggregationRule {
message ClusterRole {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this ClusterRole
// +optional
@@ -62,7 +62,7 @@ message ClusterRole {
message ClusterRoleBinding {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
// +optional
@@ -79,7 +79,7 @@ message ClusterRoleBinding {
message ClusterRoleBindingList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of ClusterRoleBindings
repeated ClusterRoleBinding items = 2;
@@ -90,7 +90,7 @@ message ClusterRoleBindingList {
message ClusterRoleList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of ClusterRoles
repeated ClusterRole items = 2;
@@ -133,7 +133,7 @@ message PolicyRule {
message Role {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Rules holds all the PolicyRules for this Role
// +optional
@@ -148,7 +148,7 @@ message Role {
message RoleBinding {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Subjects holds references to the objects the role applies to.
// +optional
@@ -165,7 +165,7 @@ message RoleBinding {
message RoleBindingList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of RoleBindings
repeated RoleBinding items = 2;
@@ -176,7 +176,7 @@ message RoleBindingList {
message RoleList {
// Standard object's metadata.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of Roles
repeated Role items = 2;
diff --git a/vendor/k8s.io/api/rbac/v1beta1/types.go b/vendor/k8s.io/api/rbac/v1beta1/types.go
index f761f81a6f5..9cfaaceb92c 100644
--- a/vendor/k8s.io/api/rbac/v1beta1/types.go
+++ b/vendor/k8s.io/api/rbac/v1beta1/types.go
@@ -84,7 +84,7 @@ type Subject struct {
// Defaults to "" for ServiceAccount subjects.
// Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
// +optional
- APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt.name=apiGroup"`
+ APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"`
// Name of the object being referenced.
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
// Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
diff --git a/vendor/k8s.io/api/resource/v1alpha2/generated.proto b/vendor/k8s.io/api/resource/v1alpha2/generated.proto
deleted file mode 100644
index 4a6a5bab6c5..00000000000
--- a/vendor/k8s.io/api/resource/v1alpha2/generated.proto
+++ /dev/null
@@ -1,749 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-
-// This file was autogenerated by go-to-protobuf. Do not edit it manually!
-
-syntax = "proto2";
-
-package k8s.io.api.resource.v1alpha2;
-
-import "k8s.io/api/core/v1/generated.proto";
-import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
-import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
-import "k8s.io/apimachinery/pkg/runtime/generated.proto";
-import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
-
-// Package-wide variables from generator "generated".
-option go_package = "k8s.io/api/resource/v1alpha2";
-
-// AllocationResult contains attributes of an allocated resource.
-message AllocationResult {
- // ResourceHandles contain the state associated with an allocation that
- // should be maintained throughout the lifetime of a claim. Each
- // ResourceHandle contains data that should be passed to a specific kubelet
- // plugin once it lands on a node. This data is returned by the driver
- // after a successful allocation and is opaque to Kubernetes. Driver
- // documentation may explain to users how to interpret this data if needed.
- //
- // Setting this field is optional. It has a maximum size of 32 entries.
- // If null (or empty), it is assumed this allocation will be processed by a
- // single kubelet plugin with no ResourceHandle data attached. The name of
- // the kubelet plugin invoked will match the DriverName set in the
- // ResourceClaimStatus this AllocationResult is embedded in.
- //
- // +listType=atomic
- // +optional
- repeated ResourceHandle resourceHandles = 1;
-
- // This field will get set by the resource driver after it has allocated
- // the resource to inform the scheduler where it can schedule Pods using
- // the ResourceClaim.
- //
- // Setting this field is optional. If null, the resource is available
- // everywhere.
- // +optional
- optional k8s.io.api.core.v1.NodeSelector availableOnNodes = 2;
-
- // Shareable determines whether the resource supports more
- // than one consumer at a time.
- // +optional
- optional bool shareable = 3;
-}
-
-// AllocationResultModel must have one and only one field set.
-message AllocationResultModel {
- // NamedResources describes the allocation result when using the named resources model.
- //
- // +optional
- optional NamedResourcesAllocationResult namedResources = 1;
-}
-
-// DriverAllocationResult contains vendor parameters and the allocation result for
-// one request.
-message DriverAllocationResult {
- // VendorRequestParameters are the per-request configuration parameters
- // from the time that the claim was allocated.
- //
- // +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension vendorRequestParameters = 1;
-
- optional AllocationResultModel allocationResultModel = 2;
-}
-
-// DriverRequests describes all resources that are needed from one particular driver.
-message DriverRequests {
- // DriverName is the name used by the DRA driver kubelet plugin.
- optional string driverName = 1;
-
- // VendorParameters are arbitrary setup parameters for all requests of the
- // claim. They are ignored while allocating the claim.
- //
- // +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension vendorParameters = 2;
-
- // Requests describes all resources that are needed from the driver.
- // +listType=atomic
- repeated ResourceRequest requests = 3;
-}
-
-// NamedResourcesAllocationResult is used in AllocationResultModel.
-message NamedResourcesAllocationResult {
- // Name is the name of the selected resource instance.
- optional string name = 1;
-}
-
-// NamedResourcesAttribute is a combination of an attribute name and its value.
-message NamedResourcesAttribute {
- // Name is unique identifier among all resource instances managed by
- // the driver on the node. It must be a DNS subdomain.
- optional string name = 1;
-
- optional NamedResourcesAttributeValue attributeValue = 2;
-}
-
-// NamedResourcesAttributeValue must have one and only one field set.
-message NamedResourcesAttributeValue {
- // QuantityValue is a quantity.
- optional k8s.io.apimachinery.pkg.api.resource.Quantity quantity = 6;
-
- // BoolValue is a true/false value.
- optional bool bool = 2;
-
- // IntValue is a 64-bit integer.
- optional int64 int = 7;
-
- // IntSliceValue is an array of 64-bit integers.
- optional NamedResourcesIntSlice intSlice = 8;
-
- // StringValue is a string.
- optional string string = 5;
-
- // StringSliceValue is an array of strings.
- optional NamedResourcesStringSlice stringSlice = 9;
-
- // VersionValue is a semantic version according to semver.org spec 2.0.0.
- optional string version = 10;
-}
-
-// NamedResourcesFilter is used in ResourceFilterModel.
-message NamedResourcesFilter {
- // Selector is a CEL expression which must evaluate to true if a
- // resource instance is suitable. The language is as defined in
- // https://kubernetes.io/docs/reference/using-api/cel/
- //
- // In addition, for each type NamedResourcesin AttributeValue there is a map that
- // resolves to the corresponding value of the instance under evaluation.
- // For example:
- //
- // attributes.quantity["a"].isGreaterThan(quantity("0")) &&
- // attributes.stringslice["b"].isSorted()
- optional string selector = 1;
-}
-
-// NamedResourcesInstance represents one individual hardware instance that can be selected based
-// on its attributes.
-message NamedResourcesInstance {
- // Name is unique identifier among all resource instances managed by
- // the driver on the node. It must be a DNS subdomain.
- optional string name = 1;
-
- // Attributes defines the attributes of this resource instance.
- // The name of each attribute must be unique.
- //
- // +listType=atomic
- // +optional
- repeated NamedResourcesAttribute attributes = 2;
-}
-
-// NamedResourcesIntSlice contains a slice of 64-bit integers.
-message NamedResourcesIntSlice {
- // Ints is the slice of 64-bit integers.
- //
- // +listType=atomic
- repeated int64 ints = 1;
-}
-
-// NamedResourcesRequest is used in ResourceRequestModel.
-message NamedResourcesRequest {
- // Selector is a CEL expression which must evaluate to true if a
- // resource instance is suitable. The language is as defined in
- // https://kubernetes.io/docs/reference/using-api/cel/
- //
- // In addition, for each type NamedResourcesin AttributeValue there is a map that
- // resolves to the corresponding value of the instance under evaluation.
- // For example:
- //
- // attributes.quantity["a"].isGreaterThan(quantity("0")) &&
- // attributes.stringslice["b"].isSorted()
- optional string selector = 1;
-}
-
-// NamedResourcesResources is used in ResourceModel.
-message NamedResourcesResources {
- // The list of all individual resources instances currently available.
- //
- // +listType=atomic
- repeated NamedResourcesInstance instances = 1;
-}
-
-// NamedResourcesStringSlice contains a slice of strings.
-message NamedResourcesStringSlice {
- // Strings is the slice of strings.
- //
- // +listType=atomic
- repeated string strings = 1;
-}
-
-// PodSchedulingContext objects hold information that is needed to schedule
-// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation
-// mode.
-//
-// This is an alpha type and requires enabling the DynamicResourceAllocation
-// feature gate.
-message PodSchedulingContext {
- // Standard object metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // Spec describes where resources for the Pod are needed.
- optional PodSchedulingContextSpec spec = 2;
-
- // Status describes where resources for the Pod can be allocated.
- // +optional
- optional PodSchedulingContextStatus status = 3;
-}
-
-// PodSchedulingContextList is a collection of Pod scheduling objects.
-message PodSchedulingContextList {
- // Standard list metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
-
- // Items is the list of PodSchedulingContext objects.
- repeated PodSchedulingContext items = 2;
-}
-
-// PodSchedulingContextSpec describes where resources for the Pod are needed.
-message PodSchedulingContextSpec {
- // SelectedNode is the node for which allocation of ResourceClaims that
- // are referenced by the Pod and that use "WaitForFirstConsumer"
- // allocation is to be attempted.
- // +optional
- optional string selectedNode = 1;
-
- // PotentialNodes lists nodes where the Pod might be able to run.
- //
- // The size of this field is limited to 128. This is large enough for
- // many clusters. Larger clusters may need more attempts to find a node
- // that suits all pending resources. This may get increased in the
- // future, but not reduced.
- //
- // +listType=atomic
- // +optional
- repeated string potentialNodes = 2;
-}
-
-// PodSchedulingContextStatus describes where resources for the Pod can be allocated.
-message PodSchedulingContextStatus {
- // ResourceClaims describes resource availability for each
- // pod.spec.resourceClaim entry where the corresponding ResourceClaim
- // uses "WaitForFirstConsumer" allocation mode.
- //
- // +listType=map
- // +listMapKey=name
- // +optional
- repeated ResourceClaimSchedulingStatus resourceClaims = 1;
-}
-
-// ResourceClaim describes which resources are needed by a resource consumer.
-// Its status tracks whether the resource has been allocated and what the
-// resulting attributes are.
-//
-// This is an alpha type and requires enabling the DynamicResourceAllocation
-// feature gate.
-message ResourceClaim {
- // Standard object metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // Spec describes the desired attributes of a resource that then needs
- // to be allocated. It can only be set once when creating the
- // ResourceClaim.
- optional ResourceClaimSpec spec = 2;
-
- // Status describes whether the resource is available and with which
- // attributes.
- // +optional
- optional ResourceClaimStatus status = 3;
-}
-
-// ResourceClaimConsumerReference contains enough information to let you
-// locate the consumer of a ResourceClaim. The user must be a resource in the same
-// namespace as the ResourceClaim.
-message ResourceClaimConsumerReference {
- // APIGroup is the group for the resource being referenced. It is
- // empty for the core API. This matches the group in the APIVersion
- // that is used when creating the resources.
- // +optional
- optional string apiGroup = 1;
-
- // Resource is the type of resource being referenced, for example "pods".
- optional string resource = 3;
-
- // Name is the name of resource being referenced.
- optional string name = 4;
-
- // UID identifies exactly one incarnation of the resource.
- optional string uid = 5;
-}
-
-// ResourceClaimList is a collection of claims.
-message ResourceClaimList {
- // Standard list metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
-
- // Items is the list of resource claims.
- repeated ResourceClaim items = 2;
-}
-
-// ResourceClaimParameters defines resource requests for a ResourceClaim in an
-// in-tree format understood by Kubernetes.
-message ResourceClaimParameters {
- // Standard object metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // If this object was created from some other resource, then this links
- // back to that resource. This field is used to find the in-tree representation
- // of the claim parameters when the parameter reference of the claim refers
- // to some unknown type.
- // +optional
- optional ResourceClaimParametersReference generatedFrom = 2;
-
- // Shareable indicates whether the allocated claim is meant to be shareable
- // by multiple consumers at the same time.
- // +optional
- optional bool shareable = 3;
-
- // DriverRequests describes all resources that are needed for the
- // allocated claim. A single claim may use resources coming from
- // different drivers. For each driver, this array has at most one
- // entry which then may have one or more per-driver requests.
- //
- // May be empty, in which case the claim can always be allocated.
- //
- // +listType=atomic
- repeated DriverRequests driverRequests = 4;
-}
-
-// ResourceClaimParametersList is a collection of ResourceClaimParameters.
-message ResourceClaimParametersList {
- // Standard list metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
-
- // Items is the list of node resource capacity objects.
- repeated ResourceClaimParameters items = 2;
-}
-
-// ResourceClaimParametersReference contains enough information to let you
-// locate the parameters for a ResourceClaim. The object must be in the same
-// namespace as the ResourceClaim.
-message ResourceClaimParametersReference {
- // APIGroup is the group for the resource being referenced. It is
- // empty for the core API. This matches the group in the APIVersion
- // that is used when creating the resources.
- // +optional
- optional string apiGroup = 1;
-
- // Kind is the type of resource being referenced. This is the same
- // value as in the parameter object's metadata, for example "ConfigMap".
- optional string kind = 2;
-
- // Name is the name of resource being referenced.
- optional string name = 3;
-}
-
-// ResourceClaimSchedulingStatus contains information about one particular
-// ResourceClaim with "WaitForFirstConsumer" allocation mode.
-message ResourceClaimSchedulingStatus {
- // Name matches the pod.spec.resourceClaims[*].Name field.
- // +optional
- optional string name = 1;
-
- // UnsuitableNodes lists nodes that the ResourceClaim cannot be
- // allocated for.
- //
- // The size of this field is limited to 128, the same as for
- // PodSchedulingSpec.PotentialNodes. This may get increased in the
- // future, but not reduced.
- //
- // +listType=atomic
- // +optional
- repeated string unsuitableNodes = 2;
-}
-
-// ResourceClaimSpec defines how a resource is to be allocated.
-message ResourceClaimSpec {
- // ResourceClassName references the driver and additional parameters
- // via the name of a ResourceClass that was created as part of the
- // driver deployment.
- optional string resourceClassName = 1;
-
- // ParametersRef references a separate object with arbitrary parameters
- // that will be used by the driver when allocating a resource for the
- // claim.
- //
- // The object must be in the same namespace as the ResourceClaim.
- // +optional
- optional ResourceClaimParametersReference parametersRef = 2;
-
- // Allocation can start immediately or when a Pod wants to use the
- // resource. "WaitForFirstConsumer" is the default.
- // +optional
- optional string allocationMode = 3;
-}
-
-// ResourceClaimStatus tracks whether the resource has been allocated and what
-// the resulting attributes are.
-message ResourceClaimStatus {
- // DriverName is a copy of the driver name from the ResourceClass at
- // the time when allocation started.
- // +optional
- optional string driverName = 1;
-
- // Allocation is set by the resource driver once a resource or set of
- // resources has been allocated successfully. If this is not specified, the
- // resources have not been allocated yet.
- // +optional
- optional AllocationResult allocation = 2;
-
- // ReservedFor indicates which entities are currently allowed to use
- // the claim. A Pod which references a ResourceClaim which is not
- // reserved for that Pod will not be started.
- //
- // There can be at most 32 such reservations. This may get increased in
- // the future, but not reduced.
- //
- // +listType=map
- // +listMapKey=uid
- // +patchStrategy=merge
- // +patchMergeKey=uid
- // +optional
- repeated ResourceClaimConsumerReference reservedFor = 3;
-
- // DeallocationRequested indicates that a ResourceClaim is to be
- // deallocated.
- //
- // The driver then must deallocate this claim and reset the field
- // together with clearing the Allocation field.
- //
- // While DeallocationRequested is set, no new consumers may be added to
- // ReservedFor.
- // +optional
- optional bool deallocationRequested = 4;
-}
-
-// ResourceClaimTemplate is used to produce ResourceClaim objects.
-message ResourceClaimTemplate {
- // Standard object metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // Describes the ResourceClaim that is to be generated.
- //
- // This field is immutable. A ResourceClaim will get created by the
- // control plane for a Pod when needed and then not get updated
- // anymore.
- optional ResourceClaimTemplateSpec spec = 2;
-}
-
-// ResourceClaimTemplateList is a collection of claim templates.
-message ResourceClaimTemplateList {
- // Standard list metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
-
- // Items is the list of resource claim templates.
- repeated ResourceClaimTemplate items = 2;
-}
-
-// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.
-message ResourceClaimTemplateSpec {
- // ObjectMeta may contain labels and annotations that will be copied into the PVC
- // when creating it. No other fields are allowed and will be rejected during
- // validation.
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // Spec for the ResourceClaim. The entire content is copied unchanged
- // into the ResourceClaim that gets created from this template. The
- // same fields as in a ResourceClaim are also valid here.
- optional ResourceClaimSpec spec = 2;
-}
-
-// ResourceClass is used by administrators to influence how resources
-// are allocated.
-//
-// This is an alpha type and requires enabling the DynamicResourceAllocation
-// feature gate.
-message ResourceClass {
- // Standard object metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // DriverName defines the name of the dynamic resource driver that is
- // used for allocation of a ResourceClaim that uses this class.
- //
- // Resource drivers have a unique name in forward domain order
- // (acme.example.com).
- optional string driverName = 2;
-
- // ParametersRef references an arbitrary separate object that may hold
- // parameters that will be used by the driver when allocating a
- // resource that uses this class. A dynamic resource driver can
- // distinguish between parameters stored here and and those stored in
- // ResourceClaimSpec.
- // +optional
- optional ResourceClassParametersReference parametersRef = 3;
-
- // Only nodes matching the selector will be considered by the scheduler
- // when trying to find a Node that fits a Pod when that Pod uses
- // a ResourceClaim that has not been allocated yet.
- //
- // Setting this field is optional. If null, all nodes are candidates.
- // +optional
- optional k8s.io.api.core.v1.NodeSelector suitableNodes = 4;
-
- // If and only if allocation of claims using this class is handled
- // via structured parameters, then StructuredParameters must be set to true.
- // +optional
- optional bool structuredParameters = 5;
-}
-
-// ResourceClassList is a collection of classes.
-message ResourceClassList {
- // Standard list metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
-
- // Items is the list of resource classes.
- repeated ResourceClass items = 2;
-}
-
-// ResourceClassParameters defines resource requests for a ResourceClass in an
-// in-tree format understood by Kubernetes.
-message ResourceClassParameters {
- // Standard object metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // If this object was created from some other resource, then this links
- // back to that resource. This field is used to find the in-tree representation
- // of the class parameters when the parameter reference of the class refers
- // to some unknown type.
- // +optional
- optional ResourceClassParametersReference generatedFrom = 2;
-
- // VendorParameters are arbitrary setup parameters for all claims using
- // this class. They are ignored while allocating the claim. There must
- // not be more than one entry per driver.
- //
- // +listType=atomic
- // +optional
- repeated VendorParameters vendorParameters = 3;
-
- // Filters describes additional contraints that must be met when using the class.
- //
- // +listType=atomic
- repeated ResourceFilter filters = 4;
-}
-
-// ResourceClassParametersList is a collection of ResourceClassParameters.
-message ResourceClassParametersList {
- // Standard list metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
-
- // Items is the list of node resource capacity objects.
- repeated ResourceClassParameters items = 2;
-}
-
-// ResourceClassParametersReference contains enough information to let you
-// locate the parameters for a ResourceClass.
-message ResourceClassParametersReference {
- // APIGroup is the group for the resource being referenced. It is
- // empty for the core API. This matches the group in the APIVersion
- // that is used when creating the resources.
- // +optional
- optional string apiGroup = 1;
-
- // Kind is the type of resource being referenced. This is the same
- // value as in the parameter object's metadata.
- optional string kind = 2;
-
- // Name is the name of resource being referenced.
- optional string name = 3;
-
- // Namespace that contains the referenced resource. Must be empty
- // for cluster-scoped resources and non-empty for namespaced
- // resources.
- // +optional
- optional string namespace = 4;
-}
-
-// ResourceFilter is a filter for resources from one particular driver.
-message ResourceFilter {
- // DriverName is the name used by the DRA driver kubelet plugin.
- optional string driverName = 1;
-
- optional ResourceFilterModel resourceFilterModel = 2;
-}
-
-// ResourceFilterModel must have one and only one field set.
-message ResourceFilterModel {
- // NamedResources describes a resource filter using the named resources model.
- //
- // +optional
- optional NamedResourcesFilter namedResources = 1;
-}
-
-// ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.
-message ResourceHandle {
- // DriverName specifies the name of the resource driver whose kubelet
- // plugin should be invoked to process this ResourceHandle's data once it
- // lands on a node. This may differ from the DriverName set in
- // ResourceClaimStatus this ResourceHandle is embedded in.
- optional string driverName = 1;
-
- // Data contains the opaque data associated with this ResourceHandle. It is
- // set by the controller component of the resource driver whose name
- // matches the DriverName set in the ResourceClaimStatus this
- // ResourceHandle is embedded in. It is set at allocation time and is
- // intended for processing by the kubelet plugin whose name matches
- // the DriverName set in this ResourceHandle.
- //
- // The maximum size of this field is 16KiB. This may get increased in the
- // future, but not reduced.
- // +optional
- optional string data = 2;
-
- // If StructuredData is set, then it needs to be used instead of Data.
- //
- // +optional
- optional StructuredResourceHandle structuredData = 5;
-}
-
-// ResourceModel must have one and only one field set.
-message ResourceModel {
- // NamedResources describes available resources using the named resources model.
- //
- // +optional
- optional NamedResourcesResources namedResources = 1;
-}
-
-// ResourceRequest is a request for resources from one particular driver.
-message ResourceRequest {
- // VendorParameters are arbitrary setup parameters for the requested
- // resource. They are ignored while allocating a claim.
- //
- // +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension vendorParameters = 1;
-
- optional ResourceRequestModel resourceRequestModel = 2;
-}
-
-// ResourceRequestModel must have one and only one field set.
-message ResourceRequestModel {
- // NamedResources describes a request for resources with the named resources model.
- //
- // +optional
- optional NamedResourcesRequest namedResources = 1;
-}
-
-// ResourceSlice provides information about available
-// resources on individual nodes.
-message ResourceSlice {
- // Standard object metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
-
- // NodeName identifies the node which provides the resources
- // if they are local to a node.
- //
- // A field selector can be used to list only ResourceSlice
- // objects with a certain node name.
- //
- // +optional
- optional string nodeName = 2;
-
- // DriverName identifies the DRA driver providing the capacity information.
- // A field selector can be used to list only ResourceSlice
- // objects with a certain driver name.
- optional string driverName = 3;
-
- optional ResourceModel resourceModel = 4;
-}
-
-// ResourceSliceList is a collection of ResourceSlices.
-message ResourceSliceList {
- // Standard list metadata
- // +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
-
- // Items is the list of node resource capacity objects.
- repeated ResourceSlice items = 2;
-}
-
-// StructuredResourceHandle is the in-tree representation of the allocation result.
-message StructuredResourceHandle {
- // VendorClassParameters are the per-claim configuration parameters
- // from the resource class at the time that the claim was allocated.
- //
- // +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension vendorClassParameters = 1;
-
- // VendorClaimParameters are the per-claim configuration parameters
- // from the resource claim parameters at the time that the claim was
- // allocated.
- //
- // +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension vendorClaimParameters = 2;
-
- // NodeName is the name of the node providing the necessary resources
- // if the resources are local to a node.
- //
- // +optional
- optional string nodeName = 4;
-
- // Results lists all allocated driver resources.
- //
- // +listType=atomic
- repeated DriverAllocationResult results = 5;
-}
-
-// VendorParameters are opaque parameters for one particular driver.
-message VendorParameters {
- // DriverName is the name used by the DRA driver kubelet plugin.
- optional string driverName = 1;
-
- // Parameters can be arbitrary setup parameters. They are ignored while
- // allocating a claim.
- //
- // +optional
- optional k8s.io.apimachinery.pkg.runtime.RawExtension parameters = 2;
-}
-
diff --git a/vendor/k8s.io/api/resource/v1alpha2/namedresources.go b/vendor/k8s.io/api/resource/v1alpha2/namedresources.go
deleted file mode 100644
index b80c5c1432f..00000000000
--- a/vendor/k8s.io/api/resource/v1alpha2/namedresources.go
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-Copyright 2023 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package v1alpha2
-
-import (
- "k8s.io/apimachinery/pkg/api/resource"
-)
-
-// NamedResourcesResources is used in ResourceModel.
-type NamedResourcesResources struct {
- // The list of all individual resources instances currently available.
- //
- // +listType=atomic
- Instances []NamedResourcesInstance `json:"instances" protobuf:"bytes,1,name=instances"`
-}
-
-// NamedResourcesInstance represents one individual hardware instance that can be selected based
-// on its attributes.
-type NamedResourcesInstance struct {
- // Name is unique identifier among all resource instances managed by
- // the driver on the node. It must be a DNS subdomain.
- Name string `json:"name" protobuf:"bytes,1,name=name"`
-
- // Attributes defines the attributes of this resource instance.
- // The name of each attribute must be unique.
- //
- // +listType=atomic
- // +optional
- Attributes []NamedResourcesAttribute `json:"attributes,omitempty" protobuf:"bytes,2,opt,name=attributes"`
-}
-
-// NamedResourcesAttribute is a combination of an attribute name and its value.
-type NamedResourcesAttribute struct {
- // Name is unique identifier among all resource instances managed by
- // the driver on the node. It must be a DNS subdomain.
- Name string `json:"name" protobuf:"bytes,1,name=name"`
-
- NamedResourcesAttributeValue `json:",inline" protobuf:"bytes,2,opt,name=attributeValue"`
-}
-
-// The Go field names below have a Value suffix to avoid a conflict between the
-// field "String" and the corresponding method. That method is required.
-// The Kubernetes API is defined without that suffix to keep it more natural.
-
-// NamedResourcesAttributeValue must have one and only one field set.
-type NamedResourcesAttributeValue struct {
- // QuantityValue is a quantity.
- QuantityValue *resource.Quantity `json:"quantity,omitempty" protobuf:"bytes,6,opt,name=quantity"`
- // BoolValue is a true/false value.
- BoolValue *bool `json:"bool,omitempty" protobuf:"bytes,2,opt,name=bool"`
- // IntValue is a 64-bit integer.
- IntValue *int64 `json:"int,omitempty" protobuf:"varint,7,opt,name=int"`
- // IntSliceValue is an array of 64-bit integers.
- IntSliceValue *NamedResourcesIntSlice `json:"intSlice,omitempty" protobuf:"varint,8,rep,name=intSlice"`
- // StringValue is a string.
- StringValue *string `json:"string,omitempty" protobuf:"bytes,5,opt,name=string"`
- // StringSliceValue is an array of strings.
- StringSliceValue *NamedResourcesStringSlice `json:"stringSlice,omitempty" protobuf:"bytes,9,rep,name=stringSlice"`
- // VersionValue is a semantic version according to semver.org spec 2.0.0.
- VersionValue *string `json:"version,omitempty" protobuf:"bytes,10,opt,name=version"`
-}
-
-// NamedResourcesIntSlice contains a slice of 64-bit integers.
-type NamedResourcesIntSlice struct {
- // Ints is the slice of 64-bit integers.
- //
- // +listType=atomic
- Ints []int64 `json:"ints" protobuf:"bytes,1,opt,name=ints"`
-}
-
-// NamedResourcesStringSlice contains a slice of strings.
-type NamedResourcesStringSlice struct {
- // Strings is the slice of strings.
- //
- // +listType=atomic
- Strings []string `json:"strings" protobuf:"bytes,1,opt,name=strings"`
-}
-
-// NamedResourcesRequest is used in ResourceRequestModel.
-type NamedResourcesRequest struct {
- // Selector is a CEL expression which must evaluate to true if a
- // resource instance is suitable. The language is as defined in
- // https://kubernetes.io/docs/reference/using-api/cel/
- //
- // In addition, for each type NamedResourcesin AttributeValue there is a map that
- // resolves to the corresponding value of the instance under evaluation.
- // For example:
- //
- // attributes.quantity["a"].isGreaterThan(quantity("0")) &&
- // attributes.stringslice["b"].isSorted()
- Selector string `json:"selector" protobuf:"bytes,1,name=selector"`
-}
-
-// NamedResourcesFilter is used in ResourceFilterModel.
-type NamedResourcesFilter struct {
- // Selector is a CEL expression which must evaluate to true if a
- // resource instance is suitable. The language is as defined in
- // https://kubernetes.io/docs/reference/using-api/cel/
- //
- // In addition, for each type NamedResourcesin AttributeValue there is a map that
- // resolves to the corresponding value of the instance under evaluation.
- // For example:
- //
- // attributes.quantity["a"].isGreaterThan(quantity("0")) &&
- // attributes.stringslice["b"].isSorted()
- Selector string `json:"selector" protobuf:"bytes,1,name=selector"`
-}
-
-// NamedResourcesAllocationResult is used in AllocationResultModel.
-type NamedResourcesAllocationResult struct {
- // Name is the name of the selected resource instance.
- Name string `json:"name" protobuf:"bytes,1,name=name"`
-}
diff --git a/vendor/k8s.io/api/resource/v1alpha2/types.go b/vendor/k8s.io/api/resource/v1alpha2/types.go
deleted file mode 100644
index 9005144cf69..00000000000
--- a/vendor/k8s.io/api/resource/v1alpha2/types.go
+++ /dev/null
@@ -1,737 +0,0 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package v1alpha2
-
-import (
- v1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/types"
-)
-
-const (
- // Finalizer is the finalizer that gets set for claims
- // which were allocated through a builtin controller.
- Finalizer = "dra.k8s.io/delete-protection"
-)
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// ResourceClaim describes which resources are needed by a resource consumer.
-// Its status tracks whether the resource has been allocated and what the
-// resulting attributes are.
-//
-// This is an alpha type and requires enabling the DynamicResourceAllocation
-// feature gate.
-type ResourceClaim struct {
- metav1.TypeMeta `json:",inline"`
- // Standard object metadata
- // +optional
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Spec describes the desired attributes of a resource that then needs
- // to be allocated. It can only be set once when creating the
- // ResourceClaim.
- Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
-
- // Status describes whether the resource is available and with which
- // attributes.
- // +optional
- Status ResourceClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
-}
-
-// ResourceClaimSpec defines how a resource is to be allocated.
-type ResourceClaimSpec struct {
- // ResourceClassName references the driver and additional parameters
- // via the name of a ResourceClass that was created as part of the
- // driver deployment.
- ResourceClassName string `json:"resourceClassName" protobuf:"bytes,1,name=resourceClassName"`
-
- // ParametersRef references a separate object with arbitrary parameters
- // that will be used by the driver when allocating a resource for the
- // claim.
- //
- // The object must be in the same namespace as the ResourceClaim.
- // +optional
- ParametersRef *ResourceClaimParametersReference `json:"parametersRef,omitempty" protobuf:"bytes,2,opt,name=parametersRef"`
-
- // Allocation can start immediately or when a Pod wants to use the
- // resource. "WaitForFirstConsumer" is the default.
- // +optional
- AllocationMode AllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,3,opt,name=allocationMode"`
-}
-
-// AllocationMode describes whether a ResourceClaim gets allocated immediately
-// when it gets created (AllocationModeImmediate) or whether allocation is
-// delayed until it is needed for a Pod
-// (AllocationModeWaitForFirstConsumer). Other modes might get added in the
-// future.
-type AllocationMode string
-
-const (
- // When a ResourceClaim has AllocationModeWaitForFirstConsumer, allocation is
- // delayed until a Pod gets scheduled that needs the ResourceClaim. The
- // scheduler will consider all resource requirements of that Pod and
- // trigger allocation for a node that fits the Pod.
- AllocationModeWaitForFirstConsumer AllocationMode = "WaitForFirstConsumer"
-
- // When a ResourceClaim has AllocationModeImmediate, allocation starts
- // as soon as the ResourceClaim gets created. This is done without
- // considering the needs of Pods that will use the ResourceClaim
- // because those Pods are not known yet.
- AllocationModeImmediate AllocationMode = "Immediate"
-)
-
-// ResourceClaimStatus tracks whether the resource has been allocated and what
-// the resulting attributes are.
-type ResourceClaimStatus struct {
- // DriverName is a copy of the driver name from the ResourceClass at
- // the time when allocation started.
- // +optional
- DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"`
-
- // Allocation is set by the resource driver once a resource or set of
- // resources has been allocated successfully. If this is not specified, the
- // resources have not been allocated yet.
- // +optional
- Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,2,opt,name=allocation"`
-
- // ReservedFor indicates which entities are currently allowed to use
- // the claim. A Pod which references a ResourceClaim which is not
- // reserved for that Pod will not be started.
- //
- // There can be at most 32 such reservations. This may get increased in
- // the future, but not reduced.
- //
- // +listType=map
- // +listMapKey=uid
- // +patchStrategy=merge
- // +patchMergeKey=uid
- // +optional
- ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,3,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"`
-
- // DeallocationRequested indicates that a ResourceClaim is to be
- // deallocated.
- //
- // The driver then must deallocate this claim and reset the field
- // together with clearing the Allocation field.
- //
- // While DeallocationRequested is set, no new consumers may be added to
- // ReservedFor.
- // +optional
- DeallocationRequested bool `json:"deallocationRequested,omitempty" protobuf:"varint,4,opt,name=deallocationRequested"`
-}
-
-// ReservedForMaxSize is the maximum number of entries in
-// claim.status.reservedFor.
-const ResourceClaimReservedForMaxSize = 32
-
-// AllocationResult contains attributes of an allocated resource.
-type AllocationResult struct {
- // ResourceHandles contain the state associated with an allocation that
- // should be maintained throughout the lifetime of a claim. Each
- // ResourceHandle contains data that should be passed to a specific kubelet
- // plugin once it lands on a node. This data is returned by the driver
- // after a successful allocation and is opaque to Kubernetes. Driver
- // documentation may explain to users how to interpret this data if needed.
- //
- // Setting this field is optional. It has a maximum size of 32 entries.
- // If null (or empty), it is assumed this allocation will be processed by a
- // single kubelet plugin with no ResourceHandle data attached. The name of
- // the kubelet plugin invoked will match the DriverName set in the
- // ResourceClaimStatus this AllocationResult is embedded in.
- //
- // +listType=atomic
- // +optional
- ResourceHandles []ResourceHandle `json:"resourceHandles,omitempty" protobuf:"bytes,1,opt,name=resourceHandles"`
-
- // This field will get set by the resource driver after it has allocated
- // the resource to inform the scheduler where it can schedule Pods using
- // the ResourceClaim.
- //
- // Setting this field is optional. If null, the resource is available
- // everywhere.
- // +optional
- AvailableOnNodes *v1.NodeSelector `json:"availableOnNodes,omitempty" protobuf:"bytes,2,opt,name=availableOnNodes"`
-
- // Shareable determines whether the resource supports more
- // than one consumer at a time.
- // +optional
- Shareable bool `json:"shareable,omitempty" protobuf:"varint,3,opt,name=shareable"`
-}
-
-// AllocationResultResourceHandlesMaxSize represents the maximum number of
-// entries in allocation.resourceHandles.
-const AllocationResultResourceHandlesMaxSize = 32
-
-// ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.
-type ResourceHandle struct {
- // DriverName specifies the name of the resource driver whose kubelet
- // plugin should be invoked to process this ResourceHandle's data once it
- // lands on a node. This may differ from the DriverName set in
- // ResourceClaimStatus this ResourceHandle is embedded in.
- DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"`
-
- // Data contains the opaque data associated with this ResourceHandle. It is
- // set by the controller component of the resource driver whose name
- // matches the DriverName set in the ResourceClaimStatus this
- // ResourceHandle is embedded in. It is set at allocation time and is
- // intended for processing by the kubelet plugin whose name matches
- // the DriverName set in this ResourceHandle.
- //
- // The maximum size of this field is 16KiB. This may get increased in the
- // future, but not reduced.
- // +optional
- Data string `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"`
-
- // If StructuredData is set, then it needs to be used instead of Data.
- //
- // +optional
- StructuredData *StructuredResourceHandle `json:"structuredData,omitempty" protobuf:"bytes,5,opt,name=structuredData"`
-}
-
-// ResourceHandleDataMaxSize represents the maximum size of resourceHandle.data.
-const ResourceHandleDataMaxSize = 16 * 1024
-
-// StructuredResourceHandle is the in-tree representation of the allocation result.
-type StructuredResourceHandle struct {
- // VendorClassParameters are the per-claim configuration parameters
- // from the resource class at the time that the claim was allocated.
- //
- // +optional
- VendorClassParameters runtime.RawExtension `json:"vendorClassParameters,omitempty" protobuf:"bytes,1,opt,name=vendorClassParameters"`
-
- // VendorClaimParameters are the per-claim configuration parameters
- // from the resource claim parameters at the time that the claim was
- // allocated.
- //
- // +optional
- VendorClaimParameters runtime.RawExtension `json:"vendorClaimParameters,omitempty" protobuf:"bytes,2,opt,name=vendorClaimParameters"`
-
- // NodeName is the name of the node providing the necessary resources
- // if the resources are local to a node.
- //
- // +optional
- NodeName string `json:"nodeName,omitempty" protobuf:"bytes,4,name=nodeName"`
-
- // Results lists all allocated driver resources.
- //
- // +listType=atomic
- Results []DriverAllocationResult `json:"results" protobuf:"bytes,5,name=results"`
-}
-
-// DriverAllocationResult contains vendor parameters and the allocation result for
-// one request.
-type DriverAllocationResult struct {
- // VendorRequestParameters are the per-request configuration parameters
- // from the time that the claim was allocated.
- //
- // +optional
- VendorRequestParameters runtime.RawExtension `json:"vendorRequestParameters,omitempty" protobuf:"bytes,1,opt,name=vendorRequestParameters"`
-
- AllocationResultModel `json:",inline" protobuf:"bytes,2,name=allocationResultModel"`
-}
-
-// AllocationResultModel must have one and only one field set.
-type AllocationResultModel struct {
- // NamedResources describes the allocation result when using the named resources model.
- //
- // +optional
- NamedResources *NamedResourcesAllocationResult `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// ResourceClaimList is a collection of claims.
-type ResourceClaimList struct {
- metav1.TypeMeta `json:",inline"`
- // Standard list metadata
- // +optional
- metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Items is the list of resource claims.
- Items []ResourceClaim `json:"items" protobuf:"bytes,2,rep,name=items"`
-}
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// PodSchedulingContext objects hold information that is needed to schedule
-// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation
-// mode.
-//
-// This is an alpha type and requires enabling the DynamicResourceAllocation
-// feature gate.
-type PodSchedulingContext struct {
- metav1.TypeMeta `json:",inline"`
- // Standard object metadata
- // +optional
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Spec describes where resources for the Pod are needed.
- Spec PodSchedulingContextSpec `json:"spec" protobuf:"bytes,2,name=spec"`
-
- // Status describes where resources for the Pod can be allocated.
- // +optional
- Status PodSchedulingContextStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
-}
-
-// PodSchedulingContextSpec describes where resources for the Pod are needed.
-type PodSchedulingContextSpec struct {
- // SelectedNode is the node for which allocation of ResourceClaims that
- // are referenced by the Pod and that use "WaitForFirstConsumer"
- // allocation is to be attempted.
- // +optional
- SelectedNode string `json:"selectedNode,omitempty" protobuf:"bytes,1,opt,name=selectedNode"`
-
- // PotentialNodes lists nodes where the Pod might be able to run.
- //
- // The size of this field is limited to 128. This is large enough for
- // many clusters. Larger clusters may need more attempts to find a node
- // that suits all pending resources. This may get increased in the
- // future, but not reduced.
- //
- // +listType=atomic
- // +optional
- PotentialNodes []string `json:"potentialNodes,omitempty" protobuf:"bytes,2,opt,name=potentialNodes"`
-}
-
-// PodSchedulingContextStatus describes where resources for the Pod can be allocated.
-type PodSchedulingContextStatus struct {
- // ResourceClaims describes resource availability for each
- // pod.spec.resourceClaim entry where the corresponding ResourceClaim
- // uses "WaitForFirstConsumer" allocation mode.
- //
- // +listType=map
- // +listMapKey=name
- // +optional
- ResourceClaims []ResourceClaimSchedulingStatus `json:"resourceClaims,omitempty" protobuf:"bytes,1,opt,name=resourceClaims"`
-
- // If there ever is a need to support other kinds of resources
- // than ResourceClaim, then new fields could get added here
- // for those other resources.
-}
-
-// ResourceClaimSchedulingStatus contains information about one particular
-// ResourceClaim with "WaitForFirstConsumer" allocation mode.
-type ResourceClaimSchedulingStatus struct {
- // Name matches the pod.spec.resourceClaims[*].Name field.
- // +optional
- Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
-
- // UnsuitableNodes lists nodes that the ResourceClaim cannot be
- // allocated for.
- //
- // The size of this field is limited to 128, the same as for
- // PodSchedulingSpec.PotentialNodes. This may get increased in the
- // future, but not reduced.
- //
- // +listType=atomic
- // +optional
- UnsuitableNodes []string `json:"unsuitableNodes,omitempty" protobuf:"bytes,2,opt,name=unsuitableNodes"`
-}
-
-// PodSchedulingNodeListMaxSize defines the maximum number of entries in the
-// node lists that are stored in PodSchedulingContext objects. This limit is part
-// of the API.
-const PodSchedulingNodeListMaxSize = 128
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// PodSchedulingContextList is a collection of Pod scheduling objects.
-type PodSchedulingContextList struct {
- metav1.TypeMeta `json:",inline"`
- // Standard list metadata
- // +optional
- metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Items is the list of PodSchedulingContext objects.
- Items []PodSchedulingContext `json:"items" protobuf:"bytes,2,rep,name=items"`
-}
-
-// +genclient
-// +genclient:nonNamespaced
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// ResourceClass is used by administrators to influence how resources
-// are allocated.
-//
-// This is an alpha type and requires enabling the DynamicResourceAllocation
-// feature gate.
-type ResourceClass struct {
- metav1.TypeMeta `json:",inline"`
- // Standard object metadata
- // +optional
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // DriverName defines the name of the dynamic resource driver that is
- // used for allocation of a ResourceClaim that uses this class.
- //
- // Resource drivers have a unique name in forward domain order
- // (acme.example.com).
- DriverName string `json:"driverName" protobuf:"bytes,2,name=driverName"`
-
- // ParametersRef references an arbitrary separate object that may hold
- // parameters that will be used by the driver when allocating a
- // resource that uses this class. A dynamic resource driver can
- // distinguish between parameters stored here and and those stored in
- // ResourceClaimSpec.
- // +optional
- ParametersRef *ResourceClassParametersReference `json:"parametersRef,omitempty" protobuf:"bytes,3,opt,name=parametersRef"`
-
- // Only nodes matching the selector will be considered by the scheduler
- // when trying to find a Node that fits a Pod when that Pod uses
- // a ResourceClaim that has not been allocated yet.
- //
- // Setting this field is optional. If null, all nodes are candidates.
- // +optional
- SuitableNodes *v1.NodeSelector `json:"suitableNodes,omitempty" protobuf:"bytes,4,opt,name=suitableNodes"`
-
- // If and only if allocation of claims using this class is handled
- // via structured parameters, then StructuredParameters must be set to true.
- // +optional
- StructuredParameters *bool `json:"structuredParameters,omitempty" protobuf:"bytes,5,opt,name=structuredParameters"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// ResourceClassList is a collection of classes.
-type ResourceClassList struct {
- metav1.TypeMeta `json:",inline"`
- // Standard list metadata
- // +optional
- metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Items is the list of resource classes.
- Items []ResourceClass `json:"items" protobuf:"bytes,2,rep,name=items"`
-}
-
-// ResourceClassParametersReference contains enough information to let you
-// locate the parameters for a ResourceClass.
-type ResourceClassParametersReference struct {
- // APIGroup is the group for the resource being referenced. It is
- // empty for the core API. This matches the group in the APIVersion
- // that is used when creating the resources.
- // +optional
- APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"`
- // Kind is the type of resource being referenced. This is the same
- // value as in the parameter object's metadata.
- Kind string `json:"kind" protobuf:"bytes,2,name=kind"`
- // Name is the name of resource being referenced.
- Name string `json:"name" protobuf:"bytes,3,name=name"`
- // Namespace that contains the referenced resource. Must be empty
- // for cluster-scoped resources and non-empty for namespaced
- // resources.
- // +optional
- Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"`
-}
-
-// ResourceClaimParametersReference contains enough information to let you
-// locate the parameters for a ResourceClaim. The object must be in the same
-// namespace as the ResourceClaim.
-type ResourceClaimParametersReference struct {
- // APIGroup is the group for the resource being referenced. It is
- // empty for the core API. This matches the group in the APIVersion
- // that is used when creating the resources.
- // +optional
- APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"`
- // Kind is the type of resource being referenced. This is the same
- // value as in the parameter object's metadata, for example "ConfigMap".
- Kind string `json:"kind" protobuf:"bytes,2,name=kind"`
- // Name is the name of resource being referenced.
- Name string `json:"name" protobuf:"bytes,3,name=name"`
-}
-
-// ResourceClaimConsumerReference contains enough information to let you
-// locate the consumer of a ResourceClaim. The user must be a resource in the same
-// namespace as the ResourceClaim.
-type ResourceClaimConsumerReference struct {
- // APIGroup is the group for the resource being referenced. It is
- // empty for the core API. This matches the group in the APIVersion
- // that is used when creating the resources.
- // +optional
- APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"`
- // Resource is the type of resource being referenced, for example "pods".
- Resource string `json:"resource" protobuf:"bytes,3,name=resource"`
- // Name is the name of resource being referenced.
- Name string `json:"name" protobuf:"bytes,4,name=name"`
- // UID identifies exactly one incarnation of the resource.
- UID types.UID `json:"uid" protobuf:"bytes,5,name=uid"`
-}
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// ResourceClaimTemplate is used to produce ResourceClaim objects.
-type ResourceClaimTemplate struct {
- metav1.TypeMeta `json:",inline"`
- // Standard object metadata
- // +optional
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Describes the ResourceClaim that is to be generated.
- //
- // This field is immutable. A ResourceClaim will get created by the
- // control plane for a Pod when needed and then not get updated
- // anymore.
- Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"`
-}
-
-// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.
-type ResourceClaimTemplateSpec struct {
- // ObjectMeta may contain labels and annotations that will be copied into the PVC
- // when creating it. No other fields are allowed and will be rejected during
- // validation.
- // +optional
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Spec for the ResourceClaim. The entire content is copied unchanged
- // into the ResourceClaim that gets created from this template. The
- // same fields as in a ResourceClaim are also valid here.
- Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.26
-
-// ResourceClaimTemplateList is a collection of claim templates.
-type ResourceClaimTemplateList struct {
- metav1.TypeMeta `json:",inline"`
- // Standard list metadata
- // +optional
- metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Items is the list of resource claim templates.
- Items []ResourceClaimTemplate `json:"items" protobuf:"bytes,2,rep,name=items"`
-}
-
-// +genclient
-// +genclient:nonNamespaced
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
-
-// ResourceSlice provides information about available
-// resources on individual nodes.
-type ResourceSlice struct {
- metav1.TypeMeta `json:",inline"`
- // Standard object metadata
- // +optional
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // NodeName identifies the node which provides the resources
- // if they are local to a node.
- //
- // A field selector can be used to list only ResourceSlice
- // objects with a certain node name.
- //
- // +optional
- NodeName string `json:"nodeName,omitempty" protobuf:"bytes,2,opt,name=nodeName"`
-
- // DriverName identifies the DRA driver providing the capacity information.
- // A field selector can be used to list only ResourceSlice
- // objects with a certain driver name.
- DriverName string `json:"driverName" protobuf:"bytes,3,name=driverName"`
-
- ResourceModel `json:",inline" protobuf:"bytes,4,name=resourceModel"`
-}
-
-// ResourceModel must have one and only one field set.
-type ResourceModel struct {
- // NamedResources describes available resources using the named resources model.
- //
- // +optional
- NamedResources *NamedResourcesResources `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
-
-// ResourceSliceList is a collection of ResourceSlices.
-type ResourceSliceList struct {
- metav1.TypeMeta `json:",inline"`
- // Standard list metadata
- // +optional
- metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Items is the list of node resource capacity objects.
- Items []ResourceSlice `json:"items" protobuf:"bytes,2,rep,name=items"`
-}
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
-
-// ResourceClaimParameters defines resource requests for a ResourceClaim in an
-// in-tree format understood by Kubernetes.
-type ResourceClaimParameters struct {
- metav1.TypeMeta `json:",inline"`
- // Standard object metadata
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // If this object was created from some other resource, then this links
- // back to that resource. This field is used to find the in-tree representation
- // of the claim parameters when the parameter reference of the claim refers
- // to some unknown type.
- // +optional
- GeneratedFrom *ResourceClaimParametersReference `json:"generatedFrom,omitempty" protobuf:"bytes,2,opt,name=generatedFrom"`
-
- // Shareable indicates whether the allocated claim is meant to be shareable
- // by multiple consumers at the same time.
- // +optional
- Shareable bool `json:"shareable,omitempty" protobuf:"bytes,3,opt,name=shareable"`
-
- // DriverRequests describes all resources that are needed for the
- // allocated claim. A single claim may use resources coming from
- // different drivers. For each driver, this array has at most one
- // entry which then may have one or more per-driver requests.
- //
- // May be empty, in which case the claim can always be allocated.
- //
- // +listType=atomic
- DriverRequests []DriverRequests `json:"driverRequests,omitempty" protobuf:"bytes,4,opt,name=driverRequests"`
-}
-
-// DriverRequests describes all resources that are needed from one particular driver.
-type DriverRequests struct {
- // DriverName is the name used by the DRA driver kubelet plugin.
- DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"`
-
- // VendorParameters are arbitrary setup parameters for all requests of the
- // claim. They are ignored while allocating the claim.
- //
- // +optional
- VendorParameters runtime.RawExtension `json:"vendorParameters,omitempty" protobuf:"bytes,2,opt,name=vendorParameters"`
-
- // Requests describes all resources that are needed from the driver.
- // +listType=atomic
- Requests []ResourceRequest `json:"requests,omitempty" protobuf:"bytes,3,opt,name=requests"`
-}
-
-// ResourceRequest is a request for resources from one particular driver.
-type ResourceRequest struct {
- // VendorParameters are arbitrary setup parameters for the requested
- // resource. They are ignored while allocating a claim.
- //
- // +optional
- VendorParameters runtime.RawExtension `json:"vendorParameters,omitempty" protobuf:"bytes,1,opt,name=vendorParameters"`
-
- ResourceRequestModel `json:",inline" protobuf:"bytes,2,name=resourceRequestModel"`
-}
-
-// ResourceRequestModel must have one and only one field set.
-type ResourceRequestModel struct {
- // NamedResources describes a request for resources with the named resources model.
- //
- // +optional
- NamedResources *NamedResourcesRequest `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
-
-// ResourceClaimParametersList is a collection of ResourceClaimParameters.
-type ResourceClaimParametersList struct {
- metav1.TypeMeta `json:",inline"`
- // Standard list metadata
- // +optional
- metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Items is the list of node resource capacity objects.
- Items []ResourceClaimParameters `json:"items" protobuf:"bytes,2,rep,name=items"`
-}
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
-
-// ResourceClassParameters defines resource requests for a ResourceClass in an
-// in-tree format understood by Kubernetes.
-type ResourceClassParameters struct {
- metav1.TypeMeta `json:",inline"`
- // Standard object metadata
- metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // If this object was created from some other resource, then this links
- // back to that resource. This field is used to find the in-tree representation
- // of the class parameters when the parameter reference of the class refers
- // to some unknown type.
- // +optional
- GeneratedFrom *ResourceClassParametersReference `json:"generatedFrom,omitempty" protobuf:"bytes,2,opt,name=generatedFrom"`
-
- // VendorParameters are arbitrary setup parameters for all claims using
- // this class. They are ignored while allocating the claim. There must
- // not be more than one entry per driver.
- //
- // +listType=atomic
- // +optional
- VendorParameters []VendorParameters `json:"vendorParameters,omitempty" protobuf:"bytes,3,opt,name=vendorParameters"`
-
- // Filters describes additional contraints that must be met when using the class.
- //
- // +listType=atomic
- Filters []ResourceFilter `json:"filters,omitempty" protobuf:"bytes,4,opt,name=filters"`
-}
-
-// ResourceFilter is a filter for resources from one particular driver.
-type ResourceFilter struct {
- // DriverName is the name used by the DRA driver kubelet plugin.
- DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"`
-
- ResourceFilterModel `json:",inline" protobuf:"bytes,2,name=resourceFilterModel"`
-}
-
-// ResourceFilterModel must have one and only one field set.
-type ResourceFilterModel struct {
- // NamedResources describes a resource filter using the named resources model.
- //
- // +optional
- NamedResources *NamedResourcesFilter `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:prerelease-lifecycle-gen:introduced=1.30
-
-// ResourceClassParametersList is a collection of ResourceClassParameters.
-type ResourceClassParametersList struct {
- metav1.TypeMeta `json:",inline"`
- // Standard list metadata
- // +optional
- metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
-
- // Items is the list of node resource capacity objects.
- Items []ResourceClassParameters `json:"items" protobuf:"bytes,2,rep,name=items"`
-}
-
-// VendorParameters are opaque parameters for one particular driver.
-type VendorParameters struct {
- // DriverName is the name used by the DRA driver kubelet plugin.
- DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"`
-
- // Parameters can be arbitrary setup parameters. They are ignored while
- // allocating a claim.
- //
- // +optional
- Parameters runtime.RawExtension `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"`
-}
diff --git a/vendor/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go b/vendor/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go
deleted file mode 100644
index 11f9ffbead2..00000000000
--- a/vendor/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package v1alpha2
-
-// This file contains a collection of methods that can be used from go-restful to
-// generate Swagger API documentation for its models. Please read this PR for more
-// information on the implementation: https://github.com/emicklei/go-restful/pull/215
-//
-// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
-// they are on one line! For multiple line or blocks that you want to ignore use ---.
-// Any context after a --- is ignored.
-//
-// Those methods can be generated by using hack/update-codegen.sh
-
-// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
-var map_AllocationResult = map[string]string{
- "": "AllocationResult contains attributes of an allocated resource.",
- "resourceHandles": "ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nSetting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.",
- "availableOnNodes": "This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere.",
- "shareable": "Shareable determines whether the resource supports more than one consumer at a time.",
-}
-
-func (AllocationResult) SwaggerDoc() map[string]string {
- return map_AllocationResult
-}
-
-var map_AllocationResultModel = map[string]string{
- "": "AllocationResultModel must have one and only one field set.",
- "namedResources": "NamedResources describes the allocation result when using the named resources model.",
-}
-
-func (AllocationResultModel) SwaggerDoc() map[string]string {
- return map_AllocationResultModel
-}
-
-var map_DriverAllocationResult = map[string]string{
- "": "DriverAllocationResult contains vendor parameters and the allocation result for one request.",
- "vendorRequestParameters": "VendorRequestParameters are the per-request configuration parameters from the time that the claim was allocated.",
-}
-
-func (DriverAllocationResult) SwaggerDoc() map[string]string {
- return map_DriverAllocationResult
-}
-
-var map_DriverRequests = map[string]string{
- "": "DriverRequests describes all resources that are needed from one particular driver.",
- "driverName": "DriverName is the name used by the DRA driver kubelet plugin.",
- "vendorParameters": "VendorParameters are arbitrary setup parameters for all requests of the claim. They are ignored while allocating the claim.",
- "requests": "Requests describes all resources that are needed from the driver.",
-}
-
-func (DriverRequests) SwaggerDoc() map[string]string {
- return map_DriverRequests
-}
-
-var map_PodSchedulingContext = map[string]string{
- "": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
- "metadata": "Standard object metadata",
- "spec": "Spec describes where resources for the Pod are needed.",
- "status": "Status describes where resources for the Pod can be allocated.",
-}
-
-func (PodSchedulingContext) SwaggerDoc() map[string]string {
- return map_PodSchedulingContext
-}
-
-var map_PodSchedulingContextList = map[string]string{
- "": "PodSchedulingContextList is a collection of Pod scheduling objects.",
- "metadata": "Standard list metadata",
- "items": "Items is the list of PodSchedulingContext objects.",
-}
-
-func (PodSchedulingContextList) SwaggerDoc() map[string]string {
- return map_PodSchedulingContextList
-}
-
-var map_PodSchedulingContextSpec = map[string]string{
- "": "PodSchedulingContextSpec describes where resources for the Pod are needed.",
- "selectedNode": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.",
- "potentialNodes": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.",
-}
-
-func (PodSchedulingContextSpec) SwaggerDoc() map[string]string {
- return map_PodSchedulingContextSpec
-}
-
-var map_PodSchedulingContextStatus = map[string]string{
- "": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.",
- "resourceClaims": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.",
-}
-
-func (PodSchedulingContextStatus) SwaggerDoc() map[string]string {
- return map_PodSchedulingContextStatus
-}
-
-var map_ResourceClaim = map[string]string{
- "": "ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
- "metadata": "Standard object metadata",
- "spec": "Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim.",
- "status": "Status describes whether the resource is available and with which attributes.",
-}
-
-func (ResourceClaim) SwaggerDoc() map[string]string {
- return map_ResourceClaim
-}
-
-var map_ResourceClaimConsumerReference = map[string]string{
- "": "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.",
- "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.",
- "resource": "Resource is the type of resource being referenced, for example \"pods\".",
- "name": "Name is the name of resource being referenced.",
- "uid": "UID identifies exactly one incarnation of the resource.",
-}
-
-func (ResourceClaimConsumerReference) SwaggerDoc() map[string]string {
- return map_ResourceClaimConsumerReference
-}
-
-var map_ResourceClaimList = map[string]string{
- "": "ResourceClaimList is a collection of claims.",
- "metadata": "Standard list metadata",
- "items": "Items is the list of resource claims.",
-}
-
-func (ResourceClaimList) SwaggerDoc() map[string]string {
- return map_ResourceClaimList
-}
-
-var map_ResourceClaimParameters = map[string]string{
- "": "ResourceClaimParameters defines resource requests for a ResourceClaim in an in-tree format understood by Kubernetes.",
- "metadata": "Standard object metadata",
- "generatedFrom": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the claim parameters when the parameter reference of the claim refers to some unknown type.",
- "shareable": "Shareable indicates whether the allocated claim is meant to be shareable by multiple consumers at the same time.",
- "driverRequests": "DriverRequests describes all resources that are needed for the allocated claim. A single claim may use resources coming from different drivers. For each driver, this array has at most one entry which then may have one or more per-driver requests.\n\nMay be empty, in which case the claim can always be allocated.",
-}
-
-func (ResourceClaimParameters) SwaggerDoc() map[string]string {
- return map_ResourceClaimParameters
-}
-
-var map_ResourceClaimParametersList = map[string]string{
- "": "ResourceClaimParametersList is a collection of ResourceClaimParameters.",
- "metadata": "Standard list metadata",
- "items": "Items is the list of node resource capacity objects.",
-}
-
-func (ResourceClaimParametersList) SwaggerDoc() map[string]string {
- return map_ResourceClaimParametersList
-}
-
-var map_ResourceClaimParametersReference = map[string]string{
- "": "ResourceClaimParametersReference contains enough information to let you locate the parameters for a ResourceClaim. The object must be in the same namespace as the ResourceClaim.",
- "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.",
- "kind": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata, for example \"ConfigMap\".",
- "name": "Name is the name of resource being referenced.",
-}
-
-func (ResourceClaimParametersReference) SwaggerDoc() map[string]string {
- return map_ResourceClaimParametersReference
-}
-
-var map_ResourceClaimSchedulingStatus = map[string]string{
- "": "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.",
- "name": "Name matches the pod.spec.resourceClaims[*].Name field.",
- "unsuitableNodes": "UnsuitableNodes lists nodes that the ResourceClaim cannot be allocated for.\n\nThe size of this field is limited to 128, the same as for PodSchedulingSpec.PotentialNodes. This may get increased in the future, but not reduced.",
-}
-
-func (ResourceClaimSchedulingStatus) SwaggerDoc() map[string]string {
- return map_ResourceClaimSchedulingStatus
-}
-
-var map_ResourceClaimSpec = map[string]string{
- "": "ResourceClaimSpec defines how a resource is to be allocated.",
- "resourceClassName": "ResourceClassName references the driver and additional parameters via the name of a ResourceClass that was created as part of the driver deployment.",
- "parametersRef": "ParametersRef references a separate object with arbitrary parameters that will be used by the driver when allocating a resource for the claim.\n\nThe object must be in the same namespace as the ResourceClaim.",
- "allocationMode": "Allocation can start immediately or when a Pod wants to use the resource. \"WaitForFirstConsumer\" is the default.",
-}
-
-func (ResourceClaimSpec) SwaggerDoc() map[string]string {
- return map_ResourceClaimSpec
-}
-
-var map_ResourceClaimStatus = map[string]string{
- "": "ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are.",
- "driverName": "DriverName is a copy of the driver name from the ResourceClass at the time when allocation started.",
- "allocation": "Allocation is set by the resource driver once a resource or set of resources has been allocated successfully. If this is not specified, the resources have not been allocated yet.",
- "reservedFor": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.",
- "deallocationRequested": "DeallocationRequested indicates that a ResourceClaim is to be deallocated.\n\nThe driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nWhile DeallocationRequested is set, no new consumers may be added to ReservedFor.",
-}
-
-func (ResourceClaimStatus) SwaggerDoc() map[string]string {
- return map_ResourceClaimStatus
-}
-
-var map_ResourceClaimTemplate = map[string]string{
- "": "ResourceClaimTemplate is used to produce ResourceClaim objects.",
- "metadata": "Standard object metadata",
- "spec": "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore.",
-}
-
-func (ResourceClaimTemplate) SwaggerDoc() map[string]string {
- return map_ResourceClaimTemplate
-}
-
-var map_ResourceClaimTemplateList = map[string]string{
- "": "ResourceClaimTemplateList is a collection of claim templates.",
- "metadata": "Standard list metadata",
- "items": "Items is the list of resource claim templates.",
-}
-
-func (ResourceClaimTemplateList) SwaggerDoc() map[string]string {
- return map_ResourceClaimTemplateList
-}
-
-var map_ResourceClaimTemplateSpec = map[string]string{
- "": "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.",
- "metadata": "ObjectMeta may contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.",
- "spec": "Spec for the ResourceClaim. The entire content is copied unchanged into the ResourceClaim that gets created from this template. The same fields as in a ResourceClaim are also valid here.",
-}
-
-func (ResourceClaimTemplateSpec) SwaggerDoc() map[string]string {
- return map_ResourceClaimTemplateSpec
-}
-
-var map_ResourceClass = map[string]string{
- "": "ResourceClass is used by administrators to influence how resources are allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
- "metadata": "Standard object metadata",
- "driverName": "DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.\n\nResource drivers have a unique name in forward domain order (acme.example.com).",
- "parametersRef": "ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec.",
- "suitableNodes": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.\n\nSetting this field is optional. If null, all nodes are candidates.",
- "structuredParameters": "If and only if allocation of claims using this class is handled via structured parameters, then StructuredParameters must be set to true.",
-}
-
-func (ResourceClass) SwaggerDoc() map[string]string {
- return map_ResourceClass
-}
-
-var map_ResourceClassList = map[string]string{
- "": "ResourceClassList is a collection of classes.",
- "metadata": "Standard list metadata",
- "items": "Items is the list of resource classes.",
-}
-
-func (ResourceClassList) SwaggerDoc() map[string]string {
- return map_ResourceClassList
-}
-
-var map_ResourceClassParameters = map[string]string{
- "": "ResourceClassParameters defines resource requests for a ResourceClass in an in-tree format understood by Kubernetes.",
- "metadata": "Standard object metadata",
- "generatedFrom": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the class parameters when the parameter reference of the class refers to some unknown type.",
- "vendorParameters": "VendorParameters are arbitrary setup parameters for all claims using this class. They are ignored while allocating the claim. There must not be more than one entry per driver.",
- "filters": "Filters describes additional contraints that must be met when using the class.",
-}
-
-func (ResourceClassParameters) SwaggerDoc() map[string]string {
- return map_ResourceClassParameters
-}
-
-var map_ResourceClassParametersList = map[string]string{
- "": "ResourceClassParametersList is a collection of ResourceClassParameters.",
- "metadata": "Standard list metadata",
- "items": "Items is the list of node resource capacity objects.",
-}
-
-func (ResourceClassParametersList) SwaggerDoc() map[string]string {
- return map_ResourceClassParametersList
-}
-
-var map_ResourceClassParametersReference = map[string]string{
- "": "ResourceClassParametersReference contains enough information to let you locate the parameters for a ResourceClass.",
- "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.",
- "kind": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata.",
- "name": "Name is the name of resource being referenced.",
- "namespace": "Namespace that contains the referenced resource. Must be empty for cluster-scoped resources and non-empty for namespaced resources.",
-}
-
-func (ResourceClassParametersReference) SwaggerDoc() map[string]string {
- return map_ResourceClassParametersReference
-}
-
-var map_ResourceFilter = map[string]string{
- "": "ResourceFilter is a filter for resources from one particular driver.",
- "driverName": "DriverName is the name used by the DRA driver kubelet plugin.",
-}
-
-func (ResourceFilter) SwaggerDoc() map[string]string {
- return map_ResourceFilter
-}
-
-var map_ResourceFilterModel = map[string]string{
- "": "ResourceFilterModel must have one and only one field set.",
- "namedResources": "NamedResources describes a resource filter using the named resources model.",
-}
-
-func (ResourceFilterModel) SwaggerDoc() map[string]string {
- return map_ResourceFilterModel
-}
-
-var map_ResourceHandle = map[string]string{
- "": "ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.",
- "driverName": "DriverName specifies the name of the resource driver whose kubelet plugin should be invoked to process this ResourceHandle's data once it lands on a node. This may differ from the DriverName set in ResourceClaimStatus this ResourceHandle is embedded in.",
- "data": "Data contains the opaque data associated with this ResourceHandle. It is set by the controller component of the resource driver whose name matches the DriverName set in the ResourceClaimStatus this ResourceHandle is embedded in. It is set at allocation time and is intended for processing by the kubelet plugin whose name matches the DriverName set in this ResourceHandle.\n\nThe maximum size of this field is 16KiB. This may get increased in the future, but not reduced.",
- "structuredData": "If StructuredData is set, then it needs to be used instead of Data.",
-}
-
-func (ResourceHandle) SwaggerDoc() map[string]string {
- return map_ResourceHandle
-}
-
-var map_ResourceModel = map[string]string{
- "": "ResourceModel must have one and only one field set.",
- "namedResources": "NamedResources describes available resources using the named resources model.",
-}
-
-func (ResourceModel) SwaggerDoc() map[string]string {
- return map_ResourceModel
-}
-
-var map_ResourceRequest = map[string]string{
- "": "ResourceRequest is a request for resources from one particular driver.",
- "vendorParameters": "VendorParameters are arbitrary setup parameters for the requested resource. They are ignored while allocating a claim.",
-}
-
-func (ResourceRequest) SwaggerDoc() map[string]string {
- return map_ResourceRequest
-}
-
-var map_ResourceRequestModel = map[string]string{
- "": "ResourceRequestModel must have one and only one field set.",
- "namedResources": "NamedResources describes a request for resources with the named resources model.",
-}
-
-func (ResourceRequestModel) SwaggerDoc() map[string]string {
- return map_ResourceRequestModel
-}
-
-var map_ResourceSlice = map[string]string{
- "": "ResourceSlice provides information about available resources on individual nodes.",
- "metadata": "Standard object metadata",
- "nodeName": "NodeName identifies the node which provides the resources if they are local to a node.\n\nA field selector can be used to list only ResourceSlice objects with a certain node name.",
- "driverName": "DriverName identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.",
-}
-
-func (ResourceSlice) SwaggerDoc() map[string]string {
- return map_ResourceSlice
-}
-
-var map_ResourceSliceList = map[string]string{
- "": "ResourceSliceList is a collection of ResourceSlices.",
- "metadata": "Standard list metadata",
- "items": "Items is the list of node resource capacity objects.",
-}
-
-func (ResourceSliceList) SwaggerDoc() map[string]string {
- return map_ResourceSliceList
-}
-
-var map_StructuredResourceHandle = map[string]string{
- "": "StructuredResourceHandle is the in-tree representation of the allocation result.",
- "vendorClassParameters": "VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated.",
- "vendorClaimParameters": "VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated.",
- "nodeName": "NodeName is the name of the node providing the necessary resources if the resources are local to a node.",
- "results": "Results lists all allocated driver resources.",
-}
-
-func (StructuredResourceHandle) SwaggerDoc() map[string]string {
- return map_StructuredResourceHandle
-}
-
-var map_VendorParameters = map[string]string{
- "": "VendorParameters are opaque parameters for one particular driver.",
- "driverName": "DriverName is the name used by the DRA driver kubelet plugin.",
- "parameters": "Parameters can be arbitrary setup parameters. They are ignored while allocating a claim.",
-}
-
-func (VendorParameters) SwaggerDoc() map[string]string {
- return map_VendorParameters
-}
-
-// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/vendor/k8s.io/api/resource/v1alpha2/doc.go b/vendor/k8s.io/api/resource/v1alpha3/doc.go
similarity index 84%
rename from vendor/k8s.io/api/resource/v1alpha2/doc.go
rename to vendor/k8s.io/api/resource/v1alpha3/doc.go
index d9c20e089d9..aeb66561fb8 100644
--- a/vendor/k8s.io/api/resource/v1alpha2/doc.go
+++ b/vendor/k8s.io/api/resource/v1alpha3/doc.go
@@ -20,5 +20,5 @@ limitations under the License.
// +groupName=resource.k8s.io
-// Package v1alpha2 is the v1alpha2 version of the resource API.
-package v1alpha2 // import "k8s.io/api/resource/v1alpha2"
+// Package v1alpha3 is the v1alpha3 version of the resource API.
+package v1alpha3 // import "k8s.io/api/resource/v1alpha3"
diff --git a/vendor/k8s.io/api/resource/v1alpha2/generated.pb.go b/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go
similarity index 60%
rename from vendor/k8s.io/api/resource/v1alpha2/generated.pb.go
rename to vendor/k8s.io/api/resource/v1alpha3/generated.pb.go
index 6c6ba438e38..4ac01cc6f3b 100644
--- a/vendor/k8s.io/api/resource/v1alpha2/generated.pb.go
+++ b/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go
@@ -15,9 +15,9 @@ limitations under the License.
*/
// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: k8s.io/api/resource/v1alpha2/generated.proto
+// source: k8s.io/api/resource/v1alpha3/generated.proto
-package v1alpha2
+package v1alpha3
import (
fmt "fmt"
@@ -25,6 +25,7 @@ import (
io "io"
proto "github.com/gogo/protobuf/proto"
+ github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
v1 "k8s.io/api/core/v1"
resource "k8s.io/apimachinery/pkg/api/resource"
@@ -50,7 +51,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func (m *AllocationResult) Reset() { *m = AllocationResult{} }
func (*AllocationResult) ProtoMessage() {}
func (*AllocationResult) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{0}
+ return fileDescriptor_66649ee9bbcd89d2, []int{0}
}
func (m *AllocationResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -75,15 +76,15 @@ func (m *AllocationResult) XXX_DiscardUnknown() {
var xxx_messageInfo_AllocationResult proto.InternalMessageInfo
-func (m *AllocationResultModel) Reset() { *m = AllocationResultModel{} }
-func (*AllocationResultModel) ProtoMessage() {}
-func (*AllocationResultModel) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{1}
+func (m *BasicDevice) Reset() { *m = BasicDevice{} }
+func (*BasicDevice) ProtoMessage() {}
+func (*BasicDevice) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{1}
}
-func (m *AllocationResultModel) XXX_Unmarshal(b []byte) error {
+func (m *BasicDevice) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *AllocationResultModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *BasicDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -91,27 +92,27 @@ func (m *AllocationResultModel) XXX_Marshal(b []byte, deterministic bool) ([]byt
}
return b[:n], nil
}
-func (m *AllocationResultModel) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AllocationResultModel.Merge(m, src)
+func (m *BasicDevice) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_BasicDevice.Merge(m, src)
}
-func (m *AllocationResultModel) XXX_Size() int {
+func (m *BasicDevice) XXX_Size() int {
return m.Size()
}
-func (m *AllocationResultModel) XXX_DiscardUnknown() {
- xxx_messageInfo_AllocationResultModel.DiscardUnknown(m)
+func (m *BasicDevice) XXX_DiscardUnknown() {
+ xxx_messageInfo_BasicDevice.DiscardUnknown(m)
}
-var xxx_messageInfo_AllocationResultModel proto.InternalMessageInfo
+var xxx_messageInfo_BasicDevice proto.InternalMessageInfo
-func (m *DriverAllocationResult) Reset() { *m = DriverAllocationResult{} }
-func (*DriverAllocationResult) ProtoMessage() {}
-func (*DriverAllocationResult) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{2}
+func (m *CELDeviceSelector) Reset() { *m = CELDeviceSelector{} }
+func (*CELDeviceSelector) ProtoMessage() {}
+func (*CELDeviceSelector) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{2}
}
-func (m *DriverAllocationResult) XXX_Unmarshal(b []byte) error {
+func (m *CELDeviceSelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *DriverAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *CELDeviceSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -119,27 +120,27 @@ func (m *DriverAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]by
}
return b[:n], nil
}
-func (m *DriverAllocationResult) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DriverAllocationResult.Merge(m, src)
+func (m *CELDeviceSelector) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_CELDeviceSelector.Merge(m, src)
}
-func (m *DriverAllocationResult) XXX_Size() int {
+func (m *CELDeviceSelector) XXX_Size() int {
return m.Size()
}
-func (m *DriverAllocationResult) XXX_DiscardUnknown() {
- xxx_messageInfo_DriverAllocationResult.DiscardUnknown(m)
+func (m *CELDeviceSelector) XXX_DiscardUnknown() {
+ xxx_messageInfo_CELDeviceSelector.DiscardUnknown(m)
}
-var xxx_messageInfo_DriverAllocationResult proto.InternalMessageInfo
+var xxx_messageInfo_CELDeviceSelector proto.InternalMessageInfo
-func (m *DriverRequests) Reset() { *m = DriverRequests{} }
-func (*DriverRequests) ProtoMessage() {}
-func (*DriverRequests) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{3}
+func (m *Device) Reset() { *m = Device{} }
+func (*Device) ProtoMessage() {}
+func (*Device) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{3}
}
-func (m *DriverRequests) XXX_Unmarshal(b []byte) error {
+func (m *Device) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *DriverRequests) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -147,27 +148,27 @@ func (m *DriverRequests) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
}
return b[:n], nil
}
-func (m *DriverRequests) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DriverRequests.Merge(m, src)
+func (m *Device) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Device.Merge(m, src)
}
-func (m *DriverRequests) XXX_Size() int {
+func (m *Device) XXX_Size() int {
return m.Size()
}
-func (m *DriverRequests) XXX_DiscardUnknown() {
- xxx_messageInfo_DriverRequests.DiscardUnknown(m)
+func (m *Device) XXX_DiscardUnknown() {
+ xxx_messageInfo_Device.DiscardUnknown(m)
}
-var xxx_messageInfo_DriverRequests proto.InternalMessageInfo
+var xxx_messageInfo_Device proto.InternalMessageInfo
-func (m *NamedResourcesAllocationResult) Reset() { *m = NamedResourcesAllocationResult{} }
-func (*NamedResourcesAllocationResult) ProtoMessage() {}
-func (*NamedResourcesAllocationResult) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{4}
+func (m *DeviceAllocationConfiguration) Reset() { *m = DeviceAllocationConfiguration{} }
+func (*DeviceAllocationConfiguration) ProtoMessage() {}
+func (*DeviceAllocationConfiguration) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{4}
}
-func (m *NamedResourcesAllocationResult) XXX_Unmarshal(b []byte) error {
+func (m *DeviceAllocationConfiguration) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceAllocationConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -175,27 +176,27 @@ func (m *NamedResourcesAllocationResult) XXX_Marshal(b []byte, deterministic boo
}
return b[:n], nil
}
-func (m *NamedResourcesAllocationResult) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesAllocationResult.Merge(m, src)
+func (m *DeviceAllocationConfiguration) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceAllocationConfiguration.Merge(m, src)
}
-func (m *NamedResourcesAllocationResult) XXX_Size() int {
+func (m *DeviceAllocationConfiguration) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesAllocationResult) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesAllocationResult.DiscardUnknown(m)
+func (m *DeviceAllocationConfiguration) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceAllocationConfiguration.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesAllocationResult proto.InternalMessageInfo
+var xxx_messageInfo_DeviceAllocationConfiguration proto.InternalMessageInfo
-func (m *NamedResourcesAttribute) Reset() { *m = NamedResourcesAttribute{} }
-func (*NamedResourcesAttribute) ProtoMessage() {}
-func (*NamedResourcesAttribute) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{5}
+func (m *DeviceAllocationResult) Reset() { *m = DeviceAllocationResult{} }
+func (*DeviceAllocationResult) ProtoMessage() {}
+func (*DeviceAllocationResult) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{5}
}
-func (m *NamedResourcesAttribute) XXX_Unmarshal(b []byte) error {
+func (m *DeviceAllocationResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesAttribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -203,27 +204,27 @@ func (m *NamedResourcesAttribute) XXX_Marshal(b []byte, deterministic bool) ([]b
}
return b[:n], nil
}
-func (m *NamedResourcesAttribute) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesAttribute.Merge(m, src)
+func (m *DeviceAllocationResult) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceAllocationResult.Merge(m, src)
}
-func (m *NamedResourcesAttribute) XXX_Size() int {
+func (m *DeviceAllocationResult) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesAttribute) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesAttribute.DiscardUnknown(m)
+func (m *DeviceAllocationResult) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceAllocationResult.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesAttribute proto.InternalMessageInfo
+var xxx_messageInfo_DeviceAllocationResult proto.InternalMessageInfo
-func (m *NamedResourcesAttributeValue) Reset() { *m = NamedResourcesAttributeValue{} }
-func (*NamedResourcesAttributeValue) ProtoMessage() {}
-func (*NamedResourcesAttributeValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{6}
+func (m *DeviceAttribute) Reset() { *m = DeviceAttribute{} }
+func (*DeviceAttribute) ProtoMessage() {}
+func (*DeviceAttribute) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{6}
}
-func (m *NamedResourcesAttributeValue) XXX_Unmarshal(b []byte) error {
+func (m *DeviceAttribute) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesAttributeValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceAttribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -231,27 +232,27 @@ func (m *NamedResourcesAttributeValue) XXX_Marshal(b []byte, deterministic bool)
}
return b[:n], nil
}
-func (m *NamedResourcesAttributeValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesAttributeValue.Merge(m, src)
+func (m *DeviceAttribute) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceAttribute.Merge(m, src)
}
-func (m *NamedResourcesAttributeValue) XXX_Size() int {
+func (m *DeviceAttribute) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesAttributeValue) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesAttributeValue.DiscardUnknown(m)
+func (m *DeviceAttribute) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceAttribute.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesAttributeValue proto.InternalMessageInfo
+var xxx_messageInfo_DeviceAttribute proto.InternalMessageInfo
-func (m *NamedResourcesFilter) Reset() { *m = NamedResourcesFilter{} }
-func (*NamedResourcesFilter) ProtoMessage() {}
-func (*NamedResourcesFilter) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{7}
+func (m *DeviceClaim) Reset() { *m = DeviceClaim{} }
+func (*DeviceClaim) ProtoMessage() {}
+func (*DeviceClaim) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{7}
}
-func (m *NamedResourcesFilter) XXX_Unmarshal(b []byte) error {
+func (m *DeviceClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -259,27 +260,27 @@ func (m *NamedResourcesFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte
}
return b[:n], nil
}
-func (m *NamedResourcesFilter) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesFilter.Merge(m, src)
+func (m *DeviceClaim) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceClaim.Merge(m, src)
}
-func (m *NamedResourcesFilter) XXX_Size() int {
+func (m *DeviceClaim) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesFilter) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesFilter.DiscardUnknown(m)
+func (m *DeviceClaim) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceClaim.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesFilter proto.InternalMessageInfo
+var xxx_messageInfo_DeviceClaim proto.InternalMessageInfo
-func (m *NamedResourcesInstance) Reset() { *m = NamedResourcesInstance{} }
-func (*NamedResourcesInstance) ProtoMessage() {}
-func (*NamedResourcesInstance) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{8}
+func (m *DeviceClaimConfiguration) Reset() { *m = DeviceClaimConfiguration{} }
+func (*DeviceClaimConfiguration) ProtoMessage() {}
+func (*DeviceClaimConfiguration) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{8}
}
-func (m *NamedResourcesInstance) XXX_Unmarshal(b []byte) error {
+func (m *DeviceClaimConfiguration) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesInstance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceClaimConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -287,27 +288,27 @@ func (m *NamedResourcesInstance) XXX_Marshal(b []byte, deterministic bool) ([]by
}
return b[:n], nil
}
-func (m *NamedResourcesInstance) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesInstance.Merge(m, src)
+func (m *DeviceClaimConfiguration) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceClaimConfiguration.Merge(m, src)
}
-func (m *NamedResourcesInstance) XXX_Size() int {
+func (m *DeviceClaimConfiguration) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesInstance) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesInstance.DiscardUnknown(m)
+func (m *DeviceClaimConfiguration) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceClaimConfiguration.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesInstance proto.InternalMessageInfo
+var xxx_messageInfo_DeviceClaimConfiguration proto.InternalMessageInfo
-func (m *NamedResourcesIntSlice) Reset() { *m = NamedResourcesIntSlice{} }
-func (*NamedResourcesIntSlice) ProtoMessage() {}
-func (*NamedResourcesIntSlice) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{9}
+func (m *DeviceClass) Reset() { *m = DeviceClass{} }
+func (*DeviceClass) ProtoMessage() {}
+func (*DeviceClass) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{9}
}
-func (m *NamedResourcesIntSlice) XXX_Unmarshal(b []byte) error {
+func (m *DeviceClass) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesIntSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -315,27 +316,27 @@ func (m *NamedResourcesIntSlice) XXX_Marshal(b []byte, deterministic bool) ([]by
}
return b[:n], nil
}
-func (m *NamedResourcesIntSlice) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesIntSlice.Merge(m, src)
+func (m *DeviceClass) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceClass.Merge(m, src)
}
-func (m *NamedResourcesIntSlice) XXX_Size() int {
+func (m *DeviceClass) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesIntSlice) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesIntSlice.DiscardUnknown(m)
+func (m *DeviceClass) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceClass.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesIntSlice proto.InternalMessageInfo
+var xxx_messageInfo_DeviceClass proto.InternalMessageInfo
-func (m *NamedResourcesRequest) Reset() { *m = NamedResourcesRequest{} }
-func (*NamedResourcesRequest) ProtoMessage() {}
-func (*NamedResourcesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{10}
+func (m *DeviceClassConfiguration) Reset() { *m = DeviceClassConfiguration{} }
+func (*DeviceClassConfiguration) ProtoMessage() {}
+func (*DeviceClassConfiguration) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{10}
}
-func (m *NamedResourcesRequest) XXX_Unmarshal(b []byte) error {
+func (m *DeviceClassConfiguration) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceClassConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -343,27 +344,27 @@ func (m *NamedResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt
}
return b[:n], nil
}
-func (m *NamedResourcesRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesRequest.Merge(m, src)
+func (m *DeviceClassConfiguration) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceClassConfiguration.Merge(m, src)
}
-func (m *NamedResourcesRequest) XXX_Size() int {
+func (m *DeviceClassConfiguration) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesRequest.DiscardUnknown(m)
+func (m *DeviceClassConfiguration) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceClassConfiguration.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesRequest proto.InternalMessageInfo
+var xxx_messageInfo_DeviceClassConfiguration proto.InternalMessageInfo
-func (m *NamedResourcesResources) Reset() { *m = NamedResourcesResources{} }
-func (*NamedResourcesResources) ProtoMessage() {}
-func (*NamedResourcesResources) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{11}
+func (m *DeviceClassList) Reset() { *m = DeviceClassList{} }
+func (*DeviceClassList) ProtoMessage() {}
+func (*DeviceClassList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{11}
}
-func (m *NamedResourcesResources) XXX_Unmarshal(b []byte) error {
+func (m *DeviceClassList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -371,27 +372,27 @@ func (m *NamedResourcesResources) XXX_Marshal(b []byte, deterministic bool) ([]b
}
return b[:n], nil
}
-func (m *NamedResourcesResources) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesResources.Merge(m, src)
+func (m *DeviceClassList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceClassList.Merge(m, src)
}
-func (m *NamedResourcesResources) XXX_Size() int {
+func (m *DeviceClassList) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesResources) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesResources.DiscardUnknown(m)
+func (m *DeviceClassList) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceClassList.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesResources proto.InternalMessageInfo
+var xxx_messageInfo_DeviceClassList proto.InternalMessageInfo
-func (m *NamedResourcesStringSlice) Reset() { *m = NamedResourcesStringSlice{} }
-func (*NamedResourcesStringSlice) ProtoMessage() {}
-func (*NamedResourcesStringSlice) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{12}
+func (m *DeviceClassSpec) Reset() { *m = DeviceClassSpec{} }
+func (*DeviceClassSpec) ProtoMessage() {}
+func (*DeviceClassSpec) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{12}
}
-func (m *NamedResourcesStringSlice) XXX_Unmarshal(b []byte) error {
+func (m *DeviceClassSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *NamedResourcesStringSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *DeviceClassSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -399,22 +400,190 @@ func (m *NamedResourcesStringSlice) XXX_Marshal(b []byte, deterministic bool) ([
}
return b[:n], nil
}
-func (m *NamedResourcesStringSlice) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResourcesStringSlice.Merge(m, src)
+func (m *DeviceClassSpec) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceClassSpec.Merge(m, src)
}
-func (m *NamedResourcesStringSlice) XXX_Size() int {
+func (m *DeviceClassSpec) XXX_Size() int {
return m.Size()
}
-func (m *NamedResourcesStringSlice) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResourcesStringSlice.DiscardUnknown(m)
+func (m *DeviceClassSpec) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceClassSpec.DiscardUnknown(m)
}
-var xxx_messageInfo_NamedResourcesStringSlice proto.InternalMessageInfo
+var xxx_messageInfo_DeviceClassSpec proto.InternalMessageInfo
+
+func (m *DeviceConfiguration) Reset() { *m = DeviceConfiguration{} }
+func (*DeviceConfiguration) ProtoMessage() {}
+func (*DeviceConfiguration) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{13}
+}
+func (m *DeviceConfiguration) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *DeviceConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *DeviceConfiguration) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceConfiguration.Merge(m, src)
+}
+func (m *DeviceConfiguration) XXX_Size() int {
+ return m.Size()
+}
+func (m *DeviceConfiguration) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceConfiguration.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DeviceConfiguration proto.InternalMessageInfo
+
+func (m *DeviceConstraint) Reset() { *m = DeviceConstraint{} }
+func (*DeviceConstraint) ProtoMessage() {}
+func (*DeviceConstraint) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{14}
+}
+func (m *DeviceConstraint) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *DeviceConstraint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *DeviceConstraint) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceConstraint.Merge(m, src)
+}
+func (m *DeviceConstraint) XXX_Size() int {
+ return m.Size()
+}
+func (m *DeviceConstraint) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceConstraint.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DeviceConstraint proto.InternalMessageInfo
+
+func (m *DeviceRequest) Reset() { *m = DeviceRequest{} }
+func (*DeviceRequest) ProtoMessage() {}
+func (*DeviceRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{15}
+}
+func (m *DeviceRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *DeviceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *DeviceRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceRequest.Merge(m, src)
+}
+func (m *DeviceRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *DeviceRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DeviceRequest proto.InternalMessageInfo
+
+func (m *DeviceRequestAllocationResult) Reset() { *m = DeviceRequestAllocationResult{} }
+func (*DeviceRequestAllocationResult) ProtoMessage() {}
+func (*DeviceRequestAllocationResult) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{16}
+}
+func (m *DeviceRequestAllocationResult) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *DeviceRequestAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *DeviceRequestAllocationResult) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceRequestAllocationResult.Merge(m, src)
+}
+func (m *DeviceRequestAllocationResult) XXX_Size() int {
+ return m.Size()
+}
+func (m *DeviceRequestAllocationResult) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceRequestAllocationResult.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DeviceRequestAllocationResult proto.InternalMessageInfo
+
+func (m *DeviceSelector) Reset() { *m = DeviceSelector{} }
+func (*DeviceSelector) ProtoMessage() {}
+func (*DeviceSelector) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{17}
+}
+func (m *DeviceSelector) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *DeviceSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *DeviceSelector) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DeviceSelector.Merge(m, src)
+}
+func (m *DeviceSelector) XXX_Size() int {
+ return m.Size()
+}
+func (m *DeviceSelector) XXX_DiscardUnknown() {
+ xxx_messageInfo_DeviceSelector.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DeviceSelector proto.InternalMessageInfo
+
+func (m *OpaqueDeviceConfiguration) Reset() { *m = OpaqueDeviceConfiguration{} }
+func (*OpaqueDeviceConfiguration) ProtoMessage() {}
+func (*OpaqueDeviceConfiguration) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{18}
+}
+func (m *OpaqueDeviceConfiguration) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *OpaqueDeviceConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *OpaqueDeviceConfiguration) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_OpaqueDeviceConfiguration.Merge(m, src)
+}
+func (m *OpaqueDeviceConfiguration) XXX_Size() int {
+ return m.Size()
+}
+func (m *OpaqueDeviceConfiguration) XXX_DiscardUnknown() {
+ xxx_messageInfo_OpaqueDeviceConfiguration.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_OpaqueDeviceConfiguration proto.InternalMessageInfo
func (m *PodSchedulingContext) Reset() { *m = PodSchedulingContext{} }
func (*PodSchedulingContext) ProtoMessage() {}
func (*PodSchedulingContext) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{13}
+ return fileDescriptor_66649ee9bbcd89d2, []int{19}
}
func (m *PodSchedulingContext) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -442,7 +611,7 @@ var xxx_messageInfo_PodSchedulingContext proto.InternalMessageInfo
func (m *PodSchedulingContextList) Reset() { *m = PodSchedulingContextList{} }
func (*PodSchedulingContextList) ProtoMessage() {}
func (*PodSchedulingContextList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{14}
+ return fileDescriptor_66649ee9bbcd89d2, []int{20}
}
func (m *PodSchedulingContextList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -470,7 +639,7 @@ var xxx_messageInfo_PodSchedulingContextList proto.InternalMessageInfo
func (m *PodSchedulingContextSpec) Reset() { *m = PodSchedulingContextSpec{} }
func (*PodSchedulingContextSpec) ProtoMessage() {}
func (*PodSchedulingContextSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{15}
+ return fileDescriptor_66649ee9bbcd89d2, []int{21}
}
func (m *PodSchedulingContextSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -498,7 +667,7 @@ var xxx_messageInfo_PodSchedulingContextSpec proto.InternalMessageInfo
func (m *PodSchedulingContextStatus) Reset() { *m = PodSchedulingContextStatus{} }
func (*PodSchedulingContextStatus) ProtoMessage() {}
func (*PodSchedulingContextStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{16}
+ return fileDescriptor_66649ee9bbcd89d2, []int{22}
}
func (m *PodSchedulingContextStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -526,7 +695,7 @@ var xxx_messageInfo_PodSchedulingContextStatus proto.InternalMessageInfo
func (m *ResourceClaim) Reset() { *m = ResourceClaim{} }
func (*ResourceClaim) ProtoMessage() {}
func (*ResourceClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{17}
+ return fileDescriptor_66649ee9bbcd89d2, []int{23}
}
func (m *ResourceClaim) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -554,7 +723,7 @@ var xxx_messageInfo_ResourceClaim proto.InternalMessageInfo
func (m *ResourceClaimConsumerReference) Reset() { *m = ResourceClaimConsumerReference{} }
func (*ResourceClaimConsumerReference) ProtoMessage() {}
func (*ResourceClaimConsumerReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{18}
+ return fileDescriptor_66649ee9bbcd89d2, []int{24}
}
func (m *ResourceClaimConsumerReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -582,7 +751,7 @@ var xxx_messageInfo_ResourceClaimConsumerReference proto.InternalMessageInfo
func (m *ResourceClaimList) Reset() { *m = ResourceClaimList{} }
func (*ResourceClaimList) ProtoMessage() {}
func (*ResourceClaimList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{19}
+ return fileDescriptor_66649ee9bbcd89d2, []int{25}
}
func (m *ResourceClaimList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -607,94 +776,10 @@ func (m *ResourceClaimList) XXX_DiscardUnknown() {
var xxx_messageInfo_ResourceClaimList proto.InternalMessageInfo
-func (m *ResourceClaimParameters) Reset() { *m = ResourceClaimParameters{} }
-func (*ResourceClaimParameters) ProtoMessage() {}
-func (*ResourceClaimParameters) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{20}
-}
-func (m *ResourceClaimParameters) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceClaimParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceClaimParameters) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClaimParameters.Merge(m, src)
-}
-func (m *ResourceClaimParameters) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceClaimParameters) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClaimParameters.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceClaimParameters proto.InternalMessageInfo
-
-func (m *ResourceClaimParametersList) Reset() { *m = ResourceClaimParametersList{} }
-func (*ResourceClaimParametersList) ProtoMessage() {}
-func (*ResourceClaimParametersList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{21}
-}
-func (m *ResourceClaimParametersList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceClaimParametersList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceClaimParametersList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClaimParametersList.Merge(m, src)
-}
-func (m *ResourceClaimParametersList) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceClaimParametersList) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClaimParametersList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceClaimParametersList proto.InternalMessageInfo
-
-func (m *ResourceClaimParametersReference) Reset() { *m = ResourceClaimParametersReference{} }
-func (*ResourceClaimParametersReference) ProtoMessage() {}
-func (*ResourceClaimParametersReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{22}
-}
-func (m *ResourceClaimParametersReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceClaimParametersReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceClaimParametersReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClaimParametersReference.Merge(m, src)
-}
-func (m *ResourceClaimParametersReference) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceClaimParametersReference) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClaimParametersReference.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceClaimParametersReference proto.InternalMessageInfo
-
func (m *ResourceClaimSchedulingStatus) Reset() { *m = ResourceClaimSchedulingStatus{} }
func (*ResourceClaimSchedulingStatus) ProtoMessage() {}
func (*ResourceClaimSchedulingStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{23}
+ return fileDescriptor_66649ee9bbcd89d2, []int{26}
}
func (m *ResourceClaimSchedulingStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -722,7 +807,7 @@ var xxx_messageInfo_ResourceClaimSchedulingStatus proto.InternalMessageInfo
func (m *ResourceClaimSpec) Reset() { *m = ResourceClaimSpec{} }
func (*ResourceClaimSpec) ProtoMessage() {}
func (*ResourceClaimSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{24}
+ return fileDescriptor_66649ee9bbcd89d2, []int{27}
}
func (m *ResourceClaimSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -750,7 +835,7 @@ var xxx_messageInfo_ResourceClaimSpec proto.InternalMessageInfo
func (m *ResourceClaimStatus) Reset() { *m = ResourceClaimStatus{} }
func (*ResourceClaimStatus) ProtoMessage() {}
func (*ResourceClaimStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{25}
+ return fileDescriptor_66649ee9bbcd89d2, []int{28}
}
func (m *ResourceClaimStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -778,7 +863,7 @@ var xxx_messageInfo_ResourceClaimStatus proto.InternalMessageInfo
func (m *ResourceClaimTemplate) Reset() { *m = ResourceClaimTemplate{} }
func (*ResourceClaimTemplate) ProtoMessage() {}
func (*ResourceClaimTemplate) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{26}
+ return fileDescriptor_66649ee9bbcd89d2, []int{29}
}
func (m *ResourceClaimTemplate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -806,7 +891,7 @@ var xxx_messageInfo_ResourceClaimTemplate proto.InternalMessageInfo
func (m *ResourceClaimTemplateList) Reset() { *m = ResourceClaimTemplateList{} }
func (*ResourceClaimTemplateList) ProtoMessage() {}
func (*ResourceClaimTemplateList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{27}
+ return fileDescriptor_66649ee9bbcd89d2, []int{30}
}
func (m *ResourceClaimTemplateList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -834,7 +919,7 @@ var xxx_messageInfo_ResourceClaimTemplateList proto.InternalMessageInfo
func (m *ResourceClaimTemplateSpec) Reset() { *m = ResourceClaimTemplateSpec{} }
func (*ResourceClaimTemplateSpec) ProtoMessage() {}
func (*ResourceClaimTemplateSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{28}
+ return fileDescriptor_66649ee9bbcd89d2, []int{31}
}
func (m *ResourceClaimTemplateSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -859,15 +944,15 @@ func (m *ResourceClaimTemplateSpec) XXX_DiscardUnknown() {
var xxx_messageInfo_ResourceClaimTemplateSpec proto.InternalMessageInfo
-func (m *ResourceClass) Reset() { *m = ResourceClass{} }
-func (*ResourceClass) ProtoMessage() {}
-func (*ResourceClass) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{29}
+func (m *ResourcePool) Reset() { *m = ResourcePool{} }
+func (*ResourcePool) ProtoMessage() {}
+func (*ResourcePool) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{32}
}
-func (m *ResourceClass) XXX_Unmarshal(b []byte) error {
+func (m *ResourcePool) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *ResourceClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *ResourcePool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -875,27 +960,27 @@ func (m *ResourceClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
}
return b[:n], nil
}
-func (m *ResourceClass) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClass.Merge(m, src)
+func (m *ResourcePool) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ResourcePool.Merge(m, src)
}
-func (m *ResourceClass) XXX_Size() int {
+func (m *ResourcePool) XXX_Size() int {
return m.Size()
}
-func (m *ResourceClass) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClass.DiscardUnknown(m)
+func (m *ResourcePool) XXX_DiscardUnknown() {
+ xxx_messageInfo_ResourcePool.DiscardUnknown(m)
}
-var xxx_messageInfo_ResourceClass proto.InternalMessageInfo
+var xxx_messageInfo_ResourcePool proto.InternalMessageInfo
-func (m *ResourceClassList) Reset() { *m = ResourceClassList{} }
-func (*ResourceClassList) ProtoMessage() {}
-func (*ResourceClassList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{30}
+func (m *ResourceSlice) Reset() { *m = ResourceSlice{} }
+func (*ResourceSlice) ProtoMessage() {}
+func (*ResourceSlice) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{33}
}
-func (m *ResourceClassList) XXX_Unmarshal(b []byte) error {
+func (m *ResourceSlice) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *ResourceClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *ResourceSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -903,27 +988,27 @@ func (m *ResourceClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
}
return b[:n], nil
}
-func (m *ResourceClassList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClassList.Merge(m, src)
+func (m *ResourceSlice) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ResourceSlice.Merge(m, src)
}
-func (m *ResourceClassList) XXX_Size() int {
+func (m *ResourceSlice) XXX_Size() int {
return m.Size()
}
-func (m *ResourceClassList) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClassList.DiscardUnknown(m)
+func (m *ResourceSlice) XXX_DiscardUnknown() {
+ xxx_messageInfo_ResourceSlice.DiscardUnknown(m)
}
-var xxx_messageInfo_ResourceClassList proto.InternalMessageInfo
+var xxx_messageInfo_ResourceSlice proto.InternalMessageInfo
-func (m *ResourceClassParameters) Reset() { *m = ResourceClassParameters{} }
-func (*ResourceClassParameters) ProtoMessage() {}
-func (*ResourceClassParameters) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{31}
+func (m *ResourceSliceList) Reset() { *m = ResourceSliceList{} }
+func (*ResourceSliceList) ProtoMessage() {}
+func (*ResourceSliceList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{34}
}
-func (m *ResourceClassParameters) XXX_Unmarshal(b []byte) error {
+func (m *ResourceSliceList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *ResourceClassParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *ResourceSliceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -931,27 +1016,27 @@ func (m *ResourceClassParameters) XXX_Marshal(b []byte, deterministic bool) ([]b
}
return b[:n], nil
}
-func (m *ResourceClassParameters) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClassParameters.Merge(m, src)
+func (m *ResourceSliceList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ResourceSliceList.Merge(m, src)
}
-func (m *ResourceClassParameters) XXX_Size() int {
+func (m *ResourceSliceList) XXX_Size() int {
return m.Size()
}
-func (m *ResourceClassParameters) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClassParameters.DiscardUnknown(m)
+func (m *ResourceSliceList) XXX_DiscardUnknown() {
+ xxx_messageInfo_ResourceSliceList.DiscardUnknown(m)
}
-var xxx_messageInfo_ResourceClassParameters proto.InternalMessageInfo
+var xxx_messageInfo_ResourceSliceList proto.InternalMessageInfo
-func (m *ResourceClassParametersList) Reset() { *m = ResourceClassParametersList{} }
-func (*ResourceClassParametersList) ProtoMessage() {}
-func (*ResourceClassParametersList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{32}
+func (m *ResourceSliceSpec) Reset() { *m = ResourceSliceSpec{} }
+func (*ResourceSliceSpec) ProtoMessage() {}
+func (*ResourceSliceSpec) Descriptor() ([]byte, []int) {
+ return fileDescriptor_66649ee9bbcd89d2, []int{35}
}
-func (m *ResourceClassParametersList) XXX_Unmarshal(b []byte) error {
+func (m *ResourceSliceSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-func (m *ResourceClassParametersList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+func (m *ResourceSliceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
@@ -959,523 +1044,330 @@ func (m *ResourceClassParametersList) XXX_Marshal(b []byte, deterministic bool)
}
return b[:n], nil
}
-func (m *ResourceClassParametersList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClassParametersList.Merge(m, src)
+func (m *ResourceSliceSpec) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ResourceSliceSpec.Merge(m, src)
}
-func (m *ResourceClassParametersList) XXX_Size() int {
+func (m *ResourceSliceSpec) XXX_Size() int {
return m.Size()
}
-func (m *ResourceClassParametersList) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClassParametersList.DiscardUnknown(m)
+func (m *ResourceSliceSpec) XXX_DiscardUnknown() {
+ xxx_messageInfo_ResourceSliceSpec.DiscardUnknown(m)
}
-var xxx_messageInfo_ResourceClassParametersList proto.InternalMessageInfo
+var xxx_messageInfo_ResourceSliceSpec proto.InternalMessageInfo
-func (m *ResourceClassParametersReference) Reset() { *m = ResourceClassParametersReference{} }
-func (*ResourceClassParametersReference) ProtoMessage() {}
-func (*ResourceClassParametersReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{33}
-}
-func (m *ResourceClassParametersReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceClassParametersReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceClassParametersReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClassParametersReference.Merge(m, src)
-}
-func (m *ResourceClassParametersReference) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceClassParametersReference) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClassParametersReference.DiscardUnknown(m)
+func init() {
+ proto.RegisterType((*AllocationResult)(nil), "k8s.io.api.resource.v1alpha3.AllocationResult")
+ proto.RegisterType((*BasicDevice)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice")
+ proto.RegisterMapType((map[QualifiedName]DeviceAttribute)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice.AttributesEntry")
+ proto.RegisterMapType((map[QualifiedName]resource.Quantity)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice.CapacityEntry")
+ proto.RegisterType((*CELDeviceSelector)(nil), "k8s.io.api.resource.v1alpha3.CELDeviceSelector")
+ proto.RegisterType((*Device)(nil), "k8s.io.api.resource.v1alpha3.Device")
+ proto.RegisterType((*DeviceAllocationConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceAllocationConfiguration")
+ proto.RegisterType((*DeviceAllocationResult)(nil), "k8s.io.api.resource.v1alpha3.DeviceAllocationResult")
+ proto.RegisterType((*DeviceAttribute)(nil), "k8s.io.api.resource.v1alpha3.DeviceAttribute")
+ proto.RegisterType((*DeviceClaim)(nil), "k8s.io.api.resource.v1alpha3.DeviceClaim")
+ proto.RegisterType((*DeviceClaimConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceClaimConfiguration")
+ proto.RegisterType((*DeviceClass)(nil), "k8s.io.api.resource.v1alpha3.DeviceClass")
+ proto.RegisterType((*DeviceClassConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceClassConfiguration")
+ proto.RegisterType((*DeviceClassList)(nil), "k8s.io.api.resource.v1alpha3.DeviceClassList")
+ proto.RegisterType((*DeviceClassSpec)(nil), "k8s.io.api.resource.v1alpha3.DeviceClassSpec")
+ proto.RegisterType((*DeviceConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceConfiguration")
+ proto.RegisterType((*DeviceConstraint)(nil), "k8s.io.api.resource.v1alpha3.DeviceConstraint")
+ proto.RegisterType((*DeviceRequest)(nil), "k8s.io.api.resource.v1alpha3.DeviceRequest")
+ proto.RegisterType((*DeviceRequestAllocationResult)(nil), "k8s.io.api.resource.v1alpha3.DeviceRequestAllocationResult")
+ proto.RegisterType((*DeviceSelector)(nil), "k8s.io.api.resource.v1alpha3.DeviceSelector")
+ proto.RegisterType((*OpaqueDeviceConfiguration)(nil), "k8s.io.api.resource.v1alpha3.OpaqueDeviceConfiguration")
+ proto.RegisterType((*PodSchedulingContext)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContext")
+ proto.RegisterType((*PodSchedulingContextList)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContextList")
+ proto.RegisterType((*PodSchedulingContextSpec)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContextSpec")
+ proto.RegisterType((*PodSchedulingContextStatus)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContextStatus")
+ proto.RegisterType((*ResourceClaim)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaim")
+ proto.RegisterType((*ResourceClaimConsumerReference)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimConsumerReference")
+ proto.RegisterType((*ResourceClaimList)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimList")
+ proto.RegisterType((*ResourceClaimSchedulingStatus)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimSchedulingStatus")
+ proto.RegisterType((*ResourceClaimSpec)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimSpec")
+ proto.RegisterType((*ResourceClaimStatus)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimStatus")
+ proto.RegisterType((*ResourceClaimTemplate)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimTemplate")
+ proto.RegisterType((*ResourceClaimTemplateList)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimTemplateList")
+ proto.RegisterType((*ResourceClaimTemplateSpec)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimTemplateSpec")
+ proto.RegisterType((*ResourcePool)(nil), "k8s.io.api.resource.v1alpha3.ResourcePool")
+ proto.RegisterType((*ResourceSlice)(nil), "k8s.io.api.resource.v1alpha3.ResourceSlice")
+ proto.RegisterType((*ResourceSliceList)(nil), "k8s.io.api.resource.v1alpha3.ResourceSliceList")
+ proto.RegisterType((*ResourceSliceSpec)(nil), "k8s.io.api.resource.v1alpha3.ResourceSliceSpec")
}
-var xxx_messageInfo_ResourceClassParametersReference proto.InternalMessageInfo
-
-func (m *ResourceFilter) Reset() { *m = ResourceFilter{} }
-func (*ResourceFilter) ProtoMessage() {}
-func (*ResourceFilter) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{34}
-}
-func (m *ResourceFilter) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
+func init() {
+ proto.RegisterFile("k8s.io/api/resource/v1alpha3/generated.proto", fileDescriptor_66649ee9bbcd89d2)
+}
+
+var fileDescriptor_66649ee9bbcd89d2 = []byte{
+ // 2085 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x1a, 0xcd, 0x6f, 0x1c, 0x57,
+ 0x3d, 0xb3, 0xeb, 0xcf, 0x9f, 0xbf, 0x9f, 0x93, 0xe0, 0x9a, 0x66, 0x37, 0x99, 0x22, 0x70, 0xda,
+ 0x74, 0xb6, 0x71, 0x4b, 0x1b, 0x5a, 0x90, 0xf0, 0xd8, 0x6e, 0xe4, 0x28, 0x1f, 0xce, 0xdb, 0x26,
+ 0x34, 0x50, 0x4a, 0x9f, 0x67, 0x9f, 0xed, 0xc1, 0xb3, 0x33, 0xd3, 0x99, 0x37, 0x26, 0x16, 0x12,
+ 0x8a, 0xb8, 0x70, 0x8b, 0x7a, 0xe5, 0x80, 0xb8, 0x21, 0x21, 0x0e, 0x70, 0xe0, 0x88, 0x54, 0x24,
+ 0x90, 0xc8, 0x31, 0x08, 0x0e, 0x3d, 0x2d, 0xcd, 0x22, 0xfe, 0x89, 0x5c, 0x40, 0xef, 0xcd, 0x9b,
+ 0x4f, 0xcf, 0x6c, 0x66, 0xa3, 0xca, 0x2a, 0x37, 0xcf, 0xef, 0xfb, 0xfd, 0xbe, 0xdf, 0x5b, 0xc3,
+ 0xa5, 0x83, 0x2b, 0xbe, 0x66, 0x3a, 0x2d, 0xe2, 0x9a, 0x2d, 0x8f, 0xfa, 0x4e, 0xe0, 0x19, 0xb4,
+ 0x75, 0x78, 0x99, 0x58, 0xee, 0x3e, 0x79, 0xbd, 0xb5, 0x47, 0x6d, 0xea, 0x11, 0x46, 0x3b, 0x9a,
+ 0xeb, 0x39, 0xcc, 0x41, 0x2f, 0x86, 0xd4, 0x1a, 0x71, 0x4d, 0x2d, 0xa2, 0xd6, 0x22, 0xea, 0xe5,
+ 0x57, 0xf7, 0x4c, 0xb6, 0x1f, 0xec, 0x68, 0x86, 0xd3, 0x6d, 0xed, 0x39, 0x7b, 0x4e, 0x4b, 0x30,
+ 0xed, 0x04, 0xbb, 0xe2, 0x4b, 0x7c, 0x88, 0xbf, 0x42, 0x61, 0xcb, 0x6a, 0x4a, 0xb5, 0xe1, 0x78,
+ 0x5c, 0x6d, 0x5e, 0xe1, 0xf2, 0x1b, 0x09, 0x4d, 0x97, 0x18, 0xfb, 0xa6, 0x4d, 0xbd, 0xa3, 0x96,
+ 0x7b, 0xb0, 0x97, 0xb5, 0x77, 0x18, 0x2e, 0xbf, 0xd5, 0xa5, 0x8c, 0x14, 0xe9, 0x6a, 0x95, 0x71,
+ 0x79, 0x81, 0xcd, 0xcc, 0xee, 0x71, 0x35, 0x6f, 0x3e, 0x8b, 0xc1, 0x37, 0xf6, 0x69, 0x97, 0xe4,
+ 0xf9, 0xd4, 0xff, 0x2a, 0x30, 0xbf, 0x66, 0x59, 0x8e, 0x41, 0x98, 0xe9, 0xd8, 0x98, 0xfa, 0x81,
+ 0xc5, 0xd0, 0x8f, 0x60, 0xbc, 0x43, 0x0f, 0x4d, 0x83, 0xfa, 0x4b, 0xca, 0x79, 0x65, 0x65, 0x6a,
+ 0xf5, 0x0d, 0x6d, 0x90, 0xb3, 0xb5, 0x0d, 0x41, 0x9c, 0x17, 0xa3, 0xcf, 0x3d, 0xea, 0x35, 0x4f,
+ 0xf5, 0x7b, 0xcd, 0xf1, 0x10, 0xef, 0xe3, 0x48, 0x2a, 0xba, 0x0b, 0xd3, 0xb6, 0xd3, 0xa1, 0x6d,
+ 0x6a, 0x51, 0x83, 0x39, 0xde, 0x52, 0x5d, 0x68, 0x39, 0x9f, 0xd6, 0xc2, 0xa3, 0xa0, 0x1d, 0x5e,
+ 0xd6, 0x6e, 0xa6, 0xe8, 0xf4, 0xf9, 0x7e, 0xaf, 0x39, 0x9d, 0x86, 0xe0, 0x8c, 0x1c, 0xb4, 0x0a,
+ 0x60, 0x38, 0x36, 0xf3, 0x1c, 0xcb, 0xa2, 0xde, 0xd2, 0xc8, 0x79, 0x65, 0x65, 0x52, 0x47, 0xd2,
+ 0x0a, 0x58, 0x8f, 0x31, 0x38, 0x45, 0xa5, 0x7e, 0x5e, 0x87, 0x29, 0x9d, 0xf8, 0xa6, 0x11, 0x5a,
+ 0x89, 0x7e, 0x06, 0x40, 0x18, 0xf3, 0xcc, 0x9d, 0x80, 0x89, 0xf3, 0xd7, 0x57, 0xa6, 0x56, 0xbf,
+ 0x35, 0xf8, 0xfc, 0x29, 0x76, 0x6d, 0x2d, 0xe6, 0xdd, 0xb4, 0x99, 0x77, 0xa4, 0xbf, 0x14, 0xa9,
+ 0x4f, 0x10, 0x3f, 0xff, 0x57, 0x73, 0xe6, 0x76, 0x40, 0x2c, 0x73, 0xd7, 0xa4, 0x9d, 0x9b, 0xa4,
+ 0x4b, 0x71, 0x4a, 0x23, 0x3a, 0x84, 0x09, 0x83, 0xb8, 0xc4, 0x30, 0xd9, 0xd1, 0x52, 0x4d, 0x68,
+ 0x7f, 0xab, 0xba, 0xf6, 0x75, 0xc9, 0x19, 0xea, 0xbe, 0x20, 0x75, 0x4f, 0x44, 0xe0, 0xe3, 0x9a,
+ 0x63, 0x5d, 0xcb, 0x16, 0xcc, 0xe5, 0x6c, 0x47, 0xf3, 0x50, 0x3f, 0xa0, 0x47, 0x22, 0x07, 0x26,
+ 0x31, 0xff, 0x13, 0xad, 0xc3, 0xe8, 0x21, 0xb1, 0x02, 0xba, 0x54, 0x13, 0x11, 0x7b, 0xb5, 0x52,
+ 0x5e, 0x44, 0x52, 0x71, 0xc8, 0xfb, 0x76, 0xed, 0x8a, 0xb2, 0x7c, 0x00, 0x33, 0x19, 0x5b, 0x0b,
+ 0x74, 0x6d, 0x64, 0x75, 0x69, 0x29, 0x5d, 0x71, 0x8a, 0x6b, 0xee, 0xc1, 0x5e, 0x56, 0xf9, 0xed,
+ 0x80, 0xd8, 0xcc, 0x64, 0x47, 0x29, 0x65, 0xea, 0x55, 0x58, 0x58, 0xdf, 0xbc, 0x1e, 0x5a, 0x93,
+ 0xce, 0x15, 0x7a, 0xdf, 0xf5, 0xa8, 0xef, 0x9b, 0x8e, 0x1d, 0xea, 0x4d, 0x72, 0x65, 0x33, 0xc6,
+ 0xe0, 0x14, 0x95, 0x7a, 0x08, 0x63, 0x32, 0x4b, 0xce, 0xc3, 0x88, 0x4d, 0xba, 0x54, 0xf2, 0x4d,
+ 0x4b, 0xbe, 0x11, 0xe1, 0x53, 0x81, 0x41, 0xd7, 0x60, 0x74, 0x87, 0x47, 0x46, 0x9a, 0x7f, 0xb1,
+ 0x72, 0x10, 0xf5, 0xc9, 0x7e, 0xaf, 0x39, 0x2a, 0x00, 0x38, 0x14, 0xa1, 0x3e, 0xac, 0xc1, 0xb9,
+ 0x7c, 0x91, 0xad, 0x3b, 0xf6, 0xae, 0xb9, 0x17, 0x78, 0xe2, 0x03, 0x7d, 0x17, 0xc6, 0x42, 0x91,
+ 0xd2, 0xa2, 0x15, 0x69, 0xd1, 0x58, 0x5b, 0x40, 0x9f, 0xf6, 0x9a, 0x67, 0xf3, 0xac, 0x21, 0x06,
+ 0x4b, 0x3e, 0xb4, 0x02, 0x13, 0x1e, 0xfd, 0x38, 0xa0, 0x3e, 0xf3, 0x45, 0xde, 0x4d, 0xea, 0xd3,
+ 0x3c, 0x75, 0xb0, 0x84, 0xe1, 0x18, 0x8b, 0x1e, 0x28, 0xb0, 0x18, 0x56, 0x72, 0xc6, 0x06, 0x59,
+ 0xc5, 0x97, 0xab, 0xe4, 0x44, 0x86, 0x51, 0xff, 0xaa, 0x34, 0x76, 0xb1, 0x00, 0x89, 0x8b, 0x54,
+ 0xa9, 0xff, 0x51, 0xe0, 0x6c, 0x71, 0xd7, 0x41, 0xbb, 0x30, 0xee, 0x89, 0xbf, 0xa2, 0xe2, 0x7d,
+ 0xa7, 0x8a, 0x41, 0xf2, 0x98, 0xe5, 0x3d, 0x2c, 0xfc, 0xf6, 0x71, 0x24, 0x1c, 0x19, 0x30, 0x66,
+ 0x08, 0x9b, 0x64, 0x95, 0xbe, 0x33, 0x5c, 0x8f, 0xcc, 0x7a, 0x60, 0x36, 0x0a, 0x57, 0x08, 0xc6,
+ 0x52, 0xb4, 0xfa, 0x5b, 0x05, 0xe6, 0x72, 0x55, 0x84, 0x1a, 0x50, 0x37, 0x6d, 0x26, 0xd2, 0xaa,
+ 0x1e, 0xc6, 0x68, 0xcb, 0x66, 0x77, 0x79, 0xb2, 0x63, 0x8e, 0x40, 0x17, 0x60, 0x64, 0xc7, 0x71,
+ 0x2c, 0x11, 0x8e, 0x09, 0x7d, 0xa6, 0xdf, 0x6b, 0x4e, 0xea, 0x8e, 0x63, 0x85, 0x14, 0x02, 0x85,
+ 0xbe, 0x01, 0x63, 0x3e, 0xf3, 0x4c, 0x7b, 0x4f, 0xf6, 0xc8, 0xb9, 0x7e, 0xaf, 0x39, 0xd5, 0x16,
+ 0x90, 0x90, 0x4c, 0xa2, 0xd1, 0xcb, 0x30, 0x7e, 0x48, 0x3d, 0x51, 0x21, 0xa3, 0x82, 0x52, 0x74,
+ 0xe0, 0xbb, 0x21, 0x28, 0x24, 0x8d, 0x08, 0xd4, 0xdf, 0xd7, 0x60, 0x4a, 0x06, 0xd0, 0x22, 0x66,
+ 0x17, 0xdd, 0x4b, 0x25, 0x54, 0x18, 0x89, 0x57, 0x86, 0x88, 0x84, 0x3e, 0x1f, 0x35, 0xaf, 0x82,
+ 0x0c, 0xa4, 0x30, 0x65, 0x38, 0xb6, 0xcf, 0x3c, 0x62, 0xda, 0x32, 0x5d, 0xb3, 0x0d, 0x62, 0x50,
+ 0xe2, 0x49, 0x36, 0x7d, 0x51, 0x2a, 0x98, 0x4a, 0x60, 0x3e, 0x4e, 0xcb, 0x45, 0x1f, 0xc6, 0x21,
+ 0xae, 0x0b, 0x0d, 0x6f, 0x56, 0xd2, 0xc0, 0x0f, 0x5f, 0x2d, 0xba, 0x7f, 0x53, 0x60, 0xa9, 0x8c,
+ 0x29, 0x53, 0x8f, 0xca, 0x73, 0xd5, 0x63, 0xed, 0xe4, 0xea, 0xf1, 0xcf, 0x4a, 0x2a, 0xf6, 0xbe,
+ 0x8f, 0x3e, 0x82, 0x09, 0xbe, 0xda, 0x74, 0x08, 0x23, 0x72, 0x85, 0x78, 0x6d, 0x50, 0xfb, 0xf6,
+ 0x35, 0x4e, 0xcd, 0xc7, 0xfd, 0xad, 0x9d, 0x1f, 0x53, 0x83, 0xdd, 0xa0, 0x8c, 0x24, 0xcd, 0x38,
+ 0x81, 0xe1, 0x58, 0x2a, 0xba, 0x05, 0x23, 0xbe, 0x4b, 0x8d, 0x61, 0x06, 0x91, 0x30, 0xad, 0xed,
+ 0x52, 0x23, 0xe9, 0xd7, 0xfc, 0x0b, 0x0b, 0x41, 0xea, 0xaf, 0xd2, 0xc1, 0xf0, 0xfd, 0x6c, 0x30,
+ 0xca, 0x5c, 0xac, 0x9c, 0x9c, 0x8b, 0x3f, 0x8d, 0x5b, 0x81, 0xb0, 0xef, 0xba, 0xe9, 0x33, 0xf4,
+ 0xc1, 0x31, 0x37, 0x6b, 0xd5, 0xdc, 0xcc, 0xb9, 0x85, 0x93, 0xe3, 0x2a, 0x8b, 0x20, 0x29, 0x17,
+ 0xdf, 0x84, 0x51, 0x93, 0xd1, 0x6e, 0x54, 0x5f, 0x17, 0x2b, 0xfb, 0x58, 0x9f, 0x91, 0x52, 0x47,
+ 0xb7, 0x38, 0x3f, 0x0e, 0xc5, 0xa8, 0xbf, 0xab, 0x65, 0x4e, 0xc0, 0x7d, 0x8f, 0x7e, 0x08, 0x93,
+ 0xbe, 0x9c, 0xc8, 0x51, 0x97, 0xb8, 0x54, 0x45, 0x4f, 0xbc, 0x12, 0x2e, 0x48, 0x55, 0x93, 0x11,
+ 0xc4, 0xc7, 0x89, 0xc4, 0x54, 0x05, 0xd7, 0x86, 0xaa, 0xe0, 0x5c, 0xfc, 0xcb, 0x2a, 0x18, 0xdd,
+ 0x83, 0x19, 0x3f, 0x30, 0x19, 0xd9, 0xb1, 0x28, 0x5f, 0x4b, 0xfd, 0xca, 0x9b, 0xec, 0x42, 0xbf,
+ 0xd7, 0x9c, 0x69, 0xa7, 0x59, 0x71, 0x56, 0x92, 0xea, 0x41, 0x51, 0x6e, 0xa0, 0x1f, 0xc0, 0x98,
+ 0xe3, 0x92, 0x8f, 0x03, 0x2a, 0x03, 0xfe, 0x8c, 0xe5, 0xf0, 0x96, 0xa0, 0x2d, 0xca, 0x40, 0xe0,
+ 0xc7, 0x09, 0xd1, 0x58, 0x8a, 0x54, 0x1f, 0x2a, 0x30, 0x9f, 0xef, 0x93, 0x43, 0x34, 0xa2, 0x6d,
+ 0x98, 0xed, 0x12, 0x66, 0xec, 0xc7, 0xb3, 0x4a, 0x54, 0xe7, 0xa4, 0xbe, 0xd2, 0xef, 0x35, 0x67,
+ 0x6f, 0x64, 0x30, 0x4f, 0x7b, 0x4d, 0xf4, 0x6e, 0x60, 0x59, 0x47, 0xd9, 0x75, 0x34, 0xc7, 0xaf,
+ 0xfe, 0xa2, 0x0e, 0x33, 0x99, 0xb1, 0x50, 0x61, 0xf1, 0x5a, 0x83, 0xb9, 0x4e, 0x12, 0x47, 0x8e,
+ 0x90, 0x66, 0x7c, 0x45, 0x12, 0xa7, 0x93, 0x50, 0xf0, 0xe5, 0xe9, 0xb3, 0x59, 0x59, 0xff, 0xc2,
+ 0xb3, 0xf2, 0x2e, 0xcc, 0x92, 0x78, 0x11, 0xb8, 0xe1, 0x74, 0xa8, 0x1c, 0xc3, 0x9a, 0xe4, 0x9a,
+ 0x5d, 0xcb, 0x60, 0x9f, 0xf6, 0x9a, 0xa7, 0xf3, 0xeb, 0x03, 0x87, 0xe3, 0x9c, 0x14, 0xf4, 0x12,
+ 0x8c, 0x1a, 0x4e, 0x60, 0x33, 0x31, 0xab, 0xeb, 0x49, 0x15, 0xae, 0x73, 0x20, 0x0e, 0x71, 0xe8,
+ 0x9b, 0x30, 0x45, 0x3a, 0x5d, 0xd3, 0x5e, 0x33, 0x0c, 0xea, 0xfb, 0x4b, 0x63, 0x62, 0x4b, 0x88,
+ 0x67, 0xe1, 0x5a, 0x82, 0xc2, 0x69, 0x3a, 0xf5, 0x4f, 0x4a, 0xb4, 0x82, 0x96, 0xac, 0x4a, 0xe8,
+ 0x22, 0x5f, 0xbc, 0x04, 0x4a, 0x06, 0x27, 0xb5, 0x3b, 0x09, 0x30, 0x8e, 0xf0, 0xe8, 0xeb, 0x30,
+ 0xd6, 0xf1, 0xcc, 0x43, 0xea, 0xc9, 0xc8, 0xc4, 0xe5, 0xb5, 0x21, 0xa0, 0x58, 0x62, 0x79, 0xb0,
+ 0xdd, 0x68, 0x95, 0x49, 0x05, 0x7b, 0xdb, 0x71, 0x2c, 0x2c, 0x30, 0x42, 0x92, 0xb0, 0x4a, 0xba,
+ 0x30, 0x91, 0x14, 0xda, 0x2a, 0xb1, 0xea, 0x07, 0x30, 0x9b, 0xdb, 0xff, 0xaf, 0x41, 0xdd, 0xa0,
+ 0x96, 0xac, 0xa2, 0xd6, 0xe0, 0xe8, 0x1e, 0xbb, 0x3d, 0xe8, 0xe3, 0xfd, 0x5e, 0xb3, 0xbe, 0xbe,
+ 0x79, 0x1d, 0x73, 0x21, 0xea, 0x6f, 0x14, 0x78, 0xa1, 0xb4, 0xd2, 0x52, 0xa7, 0x55, 0x06, 0x9e,
+ 0x96, 0x00, 0xb8, 0xc4, 0x23, 0x5d, 0xca, 0xa8, 0xe7, 0x17, 0x0c, 0xb6, 0x6c, 0x3f, 0x97, 0x17,
+ 0x7b, 0x0d, 0x93, 0x9f, 0x6c, 0xde, 0x67, 0xd4, 0xe6, 0x3b, 0x58, 0x32, 0x33, 0xb7, 0x63, 0x41,
+ 0x38, 0x25, 0x54, 0xfd, 0x63, 0x0d, 0x4e, 0x6f, 0x3b, 0x9d, 0xb6, 0xb1, 0x4f, 0x3b, 0x81, 0x65,
+ 0xda, 0x7b, 0xfc, 0x52, 0x4c, 0xef, 0xb3, 0x13, 0x18, 0xd8, 0xef, 0x67, 0x06, 0xf6, 0x33, 0x1a,
+ 0x71, 0x91, 0x8d, 0x65, 0x93, 0x1b, 0x7d, 0xc4, 0xb7, 0x59, 0xc2, 0x82, 0xa8, 0xfb, 0x5e, 0x79,
+ 0x0e, 0xd9, 0x82, 0x3f, 0x89, 0x4c, 0xf8, 0x8d, 0xa5, 0x5c, 0xf5, 0xef, 0x0a, 0x2c, 0x15, 0xb1,
+ 0x9d, 0xc0, 0x10, 0xfe, 0x5e, 0x76, 0x08, 0xaf, 0x0e, 0x7f, 0xb6, 0x92, 0x69, 0xfc, 0x49, 0xc9,
+ 0x99, 0xc4, 0x58, 0xbe, 0x02, 0xd3, 0x61, 0xbb, 0xa2, 0x1d, 0x3e, 0x8d, 0x64, 0xe2, 0x9e, 0x96,
+ 0x82, 0xa6, 0xdb, 0x29, 0x1c, 0xce, 0x50, 0xa2, 0xb7, 0x61, 0xd6, 0x75, 0x18, 0xb5, 0x99, 0x49,
+ 0xac, 0x70, 0x24, 0x86, 0x97, 0x49, 0xc4, 0xfb, 0xda, 0x76, 0x06, 0x83, 0x73, 0x94, 0xea, 0x2f,
+ 0x15, 0x58, 0x2e, 0x8f, 0x0e, 0xfa, 0x29, 0xcc, 0x46, 0x27, 0x16, 0xfb, 0x72, 0xc5, 0x0b, 0x1e,
+ 0x4e, 0xf3, 0x24, 0xb2, 0x65, 0xc8, 0xcf, 0x46, 0x3d, 0x37, 0x43, 0xe6, 0xe3, 0x9c, 0x2a, 0xf5,
+ 0xd7, 0x35, 0x98, 0xc9, 0x90, 0x9c, 0x40, 0xc9, 0xdc, 0xce, 0x94, 0x4c, 0x6b, 0x98, 0x63, 0x96,
+ 0xd5, 0xca, 0xbd, 0x5c, 0xad, 0x5c, 0x1e, 0x46, 0xe8, 0xe0, 0x22, 0xe9, 0x2b, 0xd0, 0xc8, 0xd0,
+ 0xf3, 0x1d, 0x22, 0xe8, 0x52, 0x0f, 0xd3, 0x5d, 0xea, 0x51, 0xdb, 0xa0, 0xe8, 0x12, 0x4c, 0x10,
+ 0xd7, 0xbc, 0xea, 0x39, 0x81, 0x2b, 0x53, 0x2a, 0x4e, 0xfd, 0xb5, 0xed, 0x2d, 0x01, 0xc7, 0x31,
+ 0x05, 0xa7, 0x8e, 0x2c, 0x92, 0x13, 0x20, 0x75, 0x27, 0x0c, 0xe1, 0x38, 0xa6, 0x88, 0x17, 0x83,
+ 0x91, 0xd2, 0xc5, 0x40, 0x87, 0x7a, 0x60, 0x76, 0xe4, 0x45, 0xf6, 0x35, 0x49, 0x50, 0xbf, 0xb3,
+ 0xb5, 0xf1, 0xb4, 0xd7, 0xbc, 0x50, 0xf6, 0x7e, 0xca, 0x8e, 0x5c, 0xea, 0x6b, 0x77, 0xb6, 0x36,
+ 0x30, 0x67, 0x56, 0xff, 0xa2, 0xc0, 0x42, 0xe6, 0x90, 0x27, 0xd0, 0x02, 0xb6, 0xb3, 0x2d, 0xe0,
+ 0x95, 0x21, 0x42, 0x56, 0x52, 0xfb, 0x0f, 0x14, 0x38, 0x37, 0xb0, 0x2c, 0x2a, 0xac, 0x59, 0xdf,
+ 0x81, 0xb9, 0xc0, 0xce, 0x2e, 0xbf, 0x61, 0xa5, 0x2f, 0xf2, 0x15, 0xeb, 0x4e, 0x16, 0x85, 0xf3,
+ 0xb4, 0xfc, 0xba, 0xb5, 0x70, 0x2c, 0x65, 0xd1, 0x7b, 0xf9, 0x97, 0xe7, 0x8b, 0x95, 0xaf, 0xdc,
+ 0x03, 0x9e, 0x9b, 0xb3, 0xcf, 0xc2, 0xb5, 0x4a, 0xcf, 0xc2, 0x9f, 0xd6, 0x60, 0xb1, 0x20, 0xfb,
+ 0xd1, 0x87, 0x00, 0xc9, 0xd6, 0x55, 0x10, 0xec, 0x02, 0x23, 0x8f, 0x3d, 0x2a, 0xcd, 0x8a, 0xf7,
+ 0xe0, 0x04, 0x9a, 0x92, 0x88, 0x7c, 0x98, 0xf2, 0xa8, 0x4f, 0xbd, 0x43, 0xda, 0x79, 0xd7, 0xf1,
+ 0x64, 0xc8, 0xbf, 0x3d, 0x44, 0xc8, 0x8f, 0x55, 0x5d, 0xb2, 0xdc, 0xe1, 0x44, 0x30, 0x4e, 0x6b,
+ 0x41, 0x6d, 0x38, 0xd3, 0xa1, 0x24, 0x65, 0xa6, 0x58, 0xd3, 0x68, 0x47, 0xbe, 0x21, 0x9d, 0x93,
+ 0x02, 0xce, 0x6c, 0x14, 0x11, 0xe1, 0x62, 0x5e, 0xf5, 0x9f, 0x0a, 0x9c, 0xc9, 0x58, 0xf6, 0x1e,
+ 0xed, 0xba, 0x16, 0x61, 0xf4, 0x04, 0x3a, 0xe7, 0xbd, 0x4c, 0xe7, 0x7c, 0x6b, 0x08, 0xf7, 0x45,
+ 0x46, 0x96, 0xbe, 0x13, 0xfc, 0x43, 0x81, 0x17, 0x0a, 0x39, 0x4e, 0xa0, 0x13, 0xbc, 0x9f, 0xed,
+ 0x04, 0xaf, 0x3f, 0xc7, 0xb9, 0x4a, 0x3a, 0xc2, 0xe3, 0xb2, 0x53, 0xb5, 0xc3, 0x0d, 0xeb, 0xff,
+ 0x6f, 0xd4, 0xa9, 0x7f, 0x50, 0x60, 0x3a, 0xa2, 0xe4, 0x37, 0x86, 0x0a, 0x3d, 0x6d, 0x15, 0x40,
+ 0xfe, 0x40, 0x16, 0xbd, 0x9f, 0xd5, 0x13, 0xbb, 0xaf, 0xc6, 0x18, 0x9c, 0xa2, 0x42, 0xd7, 0x00,
+ 0x45, 0x16, 0xb6, 0x2d, 0xb1, 0xfb, 0xf3, 0x1b, 0x58, 0x5d, 0xf0, 0x2e, 0x4b, 0x5e, 0x84, 0x8f,
+ 0x51, 0xe0, 0x02, 0x2e, 0xf5, 0xaf, 0x4a, 0xb2, 0x64, 0x08, 0xf0, 0x97, 0xd5, 0xf3, 0xc2, 0xb8,
+ 0x52, 0xcf, 0xa7, 0x87, 0xa4, 0xa0, 0xfc, 0xd2, 0x0e, 0x49, 0x61, 0x5d, 0x49, 0x49, 0x3c, 0xac,
+ 0xe7, 0x4e, 0x21, 0x4a, 0xa1, 0xea, 0x65, 0xee, 0xba, 0xbc, 0xba, 0x86, 0x6e, 0x7d, 0xb9, 0x9a,
+ 0x39, 0x3c, 0x4d, 0x0b, 0xaf, 0xb9, 0x97, 0x60, 0xc2, 0x76, 0x3a, 0x54, 0x3c, 0x66, 0xe4, 0x56,
+ 0xa1, 0x9b, 0x12, 0x8e, 0x63, 0x8a, 0x63, 0x3f, 0xaf, 0x8e, 0x7c, 0x41, 0x3f, 0xaf, 0xf2, 0xf5,
+ 0xcd, 0x92, 0x5b, 0xfd, 0xa8, 0x98, 0x0c, 0xc9, 0xfa, 0x26, 0xe1, 0x38, 0xa6, 0x40, 0xb7, 0x92,
+ 0x59, 0x3e, 0x26, 0x62, 0xf2, 0xb5, 0x2a, 0xb3, 0xbc, 0x7c, 0x8c, 0xeb, 0xfa, 0xa3, 0x27, 0x8d,
+ 0x53, 0x8f, 0x9f, 0x34, 0x4e, 0x7d, 0xf6, 0xa4, 0x71, 0xea, 0x41, 0xbf, 0xa1, 0x3c, 0xea, 0x37,
+ 0x94, 0xc7, 0xfd, 0x86, 0xf2, 0x59, 0xbf, 0xa1, 0x7c, 0xde, 0x6f, 0x28, 0x9f, 0xfc, 0xbb, 0x71,
+ 0xea, 0xfb, 0x2f, 0x0e, 0xfa, 0x2f, 0x82, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x23, 0x3d, 0xa6,
+ 0x20, 0x64, 0x20, 0x00, 0x00,
}
-func (m *ResourceFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
+
+func (m *AllocationResult) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
- return b[:n], nil
-}
-func (m *ResourceFilter) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceFilter.Merge(m, src)
-}
-func (m *ResourceFilter) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceFilter) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceFilter.DiscardUnknown(m)
+ return dAtA[:n], nil
}
-var xxx_messageInfo_ResourceFilter proto.InternalMessageInfo
-
-func (m *ResourceFilterModel) Reset() { *m = ResourceFilterModel{} }
-func (*ResourceFilterModel) ProtoMessage() {}
-func (*ResourceFilterModel) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{35}
-}
-func (m *ResourceFilterModel) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
+func (m *AllocationResult) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceFilterModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
+
+func (m *AllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.Controller)
+ copy(dAtA[i:], m.Controller)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Controller)))
+ i--
+ dAtA[i] = 0x22
+ if m.NodeSelector != nil {
+ {
+ size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
}
- return b[:n], nil
-}
-func (m *ResourceFilterModel) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceFilterModel.Merge(m, src)
-}
-func (m *ResourceFilterModel) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceFilterModel) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceFilterModel.DiscardUnknown(m)
+ {
+ size, err := m.Devices.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
}
-var xxx_messageInfo_ResourceFilterModel proto.InternalMessageInfo
-
-func (m *ResourceHandle) Reset() { *m = ResourceHandle{} }
-func (*ResourceHandle) ProtoMessage() {}
-func (*ResourceHandle) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{36}
-}
-func (m *ResourceHandle) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceHandle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
+func (m *BasicDevice) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
- return b[:n], nil
-}
-func (m *ResourceHandle) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceHandle.Merge(m, src)
-}
-func (m *ResourceHandle) XXX_Size() int {
- return m.Size()
+ return dAtA[:n], nil
}
-func (m *ResourceHandle) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceHandle.DiscardUnknown(m)
+
+func (m *BasicDevice) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
}
-var xxx_messageInfo_ResourceHandle proto.InternalMessageInfo
-
-func (m *ResourceModel) Reset() { *m = ResourceModel{} }
-func (*ResourceModel) ProtoMessage() {}
-func (*ResourceModel) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{37}
-}
-func (m *ResourceModel) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceModel) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceModel.Merge(m, src)
-}
-func (m *ResourceModel) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceModel) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceModel.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceModel proto.InternalMessageInfo
-
-func (m *ResourceRequest) Reset() { *m = ResourceRequest{} }
-func (*ResourceRequest) ProtoMessage() {}
-func (*ResourceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{38}
-}
-func (m *ResourceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceRequest.Merge(m, src)
-}
-func (m *ResourceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceRequest proto.InternalMessageInfo
-
-func (m *ResourceRequestModel) Reset() { *m = ResourceRequestModel{} }
-func (*ResourceRequestModel) ProtoMessage() {}
-func (*ResourceRequestModel) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{39}
-}
-func (m *ResourceRequestModel) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceRequestModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceRequestModel) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceRequestModel.Merge(m, src)
-}
-func (m *ResourceRequestModel) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceRequestModel) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceRequestModel.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceRequestModel proto.InternalMessageInfo
-
-func (m *ResourceSlice) Reset() { *m = ResourceSlice{} }
-func (*ResourceSlice) ProtoMessage() {}
-func (*ResourceSlice) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{40}
-}
-func (m *ResourceSlice) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceSlice) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceSlice.Merge(m, src)
-}
-func (m *ResourceSlice) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceSlice) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceSlice.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceSlice proto.InternalMessageInfo
-
-func (m *ResourceSliceList) Reset() { *m = ResourceSliceList{} }
-func (*ResourceSliceList) ProtoMessage() {}
-func (*ResourceSliceList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{41}
-}
-func (m *ResourceSliceList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceSliceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
-}
-func (m *ResourceSliceList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceSliceList.Merge(m, src)
-}
-func (m *ResourceSliceList) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceSliceList) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceSliceList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceSliceList proto.InternalMessageInfo
-
-func (m *StructuredResourceHandle) Reset() { *m = StructuredResourceHandle{} }
-func (*StructuredResourceHandle) ProtoMessage() {}
-func (*StructuredResourceHandle) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{42}
-}
-func (m *StructuredResourceHandle) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StructuredResourceHandle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
+func (m *BasicDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Capacity) > 0 {
+ keysForCapacity := make([]string, 0, len(m.Capacity))
+ for k := range m.Capacity {
+ keysForCapacity = append(keysForCapacity, string(k))
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ for iNdEx := len(keysForCapacity) - 1; iNdEx >= 0; iNdEx-- {
+ v := m.Capacity[QualifiedName(keysForCapacity[iNdEx])]
+ baseI := i
+ {
+ size, err := (&v).MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ i -= len(keysForCapacity[iNdEx])
+ copy(dAtA[i:], keysForCapacity[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(keysForCapacity[iNdEx])))
+ i--
+ dAtA[i] = 0xa
+ i = encodeVarintGenerated(dAtA, i, uint64(baseI-i))
+ i--
+ dAtA[i] = 0x12
+ }
}
- return b[:n], nil
-}
-func (m *StructuredResourceHandle) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StructuredResourceHandle.Merge(m, src)
-}
-func (m *StructuredResourceHandle) XXX_Size() int {
- return m.Size()
-}
-func (m *StructuredResourceHandle) XXX_DiscardUnknown() {
- xxx_messageInfo_StructuredResourceHandle.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StructuredResourceHandle proto.InternalMessageInfo
-
-func (m *VendorParameters) Reset() { *m = VendorParameters{} }
-func (*VendorParameters) ProtoMessage() {}
-func (*VendorParameters) Descriptor() ([]byte, []int) {
- return fileDescriptor_4312f5b44a31ec02, []int{43}
-}
-func (m *VendorParameters) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VendorParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
+ if len(m.Attributes) > 0 {
+ keysForAttributes := make([]string, 0, len(m.Attributes))
+ for k := range m.Attributes {
+ keysForAttributes = append(keysForAttributes, string(k))
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForAttributes)
+ for iNdEx := len(keysForAttributes) - 1; iNdEx >= 0; iNdEx-- {
+ v := m.Attributes[QualifiedName(keysForAttributes[iNdEx])]
+ baseI := i
+ {
+ size, err := (&v).MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ i -= len(keysForAttributes[iNdEx])
+ copy(dAtA[i:], keysForAttributes[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAttributes[iNdEx])))
+ i--
+ dAtA[i] = 0xa
+ i = encodeVarintGenerated(dAtA, i, uint64(baseI-i))
+ i--
+ dAtA[i] = 0xa
+ }
}
- return b[:n], nil
-}
-func (m *VendorParameters) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VendorParameters.Merge(m, src)
-}
-func (m *VendorParameters) XXX_Size() int {
- return m.Size()
-}
-func (m *VendorParameters) XXX_DiscardUnknown() {
- xxx_messageInfo_VendorParameters.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_VendorParameters proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*AllocationResult)(nil), "k8s.io.api.resource.v1alpha2.AllocationResult")
- proto.RegisterType((*AllocationResultModel)(nil), "k8s.io.api.resource.v1alpha2.AllocationResultModel")
- proto.RegisterType((*DriverAllocationResult)(nil), "k8s.io.api.resource.v1alpha2.DriverAllocationResult")
- proto.RegisterType((*DriverRequests)(nil), "k8s.io.api.resource.v1alpha2.DriverRequests")
- proto.RegisterType((*NamedResourcesAllocationResult)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesAllocationResult")
- proto.RegisterType((*NamedResourcesAttribute)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesAttribute")
- proto.RegisterType((*NamedResourcesAttributeValue)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesAttributeValue")
- proto.RegisterType((*NamedResourcesFilter)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesFilter")
- proto.RegisterType((*NamedResourcesInstance)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesInstance")
- proto.RegisterType((*NamedResourcesIntSlice)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesIntSlice")
- proto.RegisterType((*NamedResourcesRequest)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesRequest")
- proto.RegisterType((*NamedResourcesResources)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesResources")
- proto.RegisterType((*NamedResourcesStringSlice)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesStringSlice")
- proto.RegisterType((*PodSchedulingContext)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContext")
- proto.RegisterType((*PodSchedulingContextList)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContextList")
- proto.RegisterType((*PodSchedulingContextSpec)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContextSpec")
- proto.RegisterType((*PodSchedulingContextStatus)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContextStatus")
- proto.RegisterType((*ResourceClaim)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaim")
- proto.RegisterType((*ResourceClaimConsumerReference)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimConsumerReference")
- proto.RegisterType((*ResourceClaimList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimList")
- proto.RegisterType((*ResourceClaimParameters)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimParameters")
- proto.RegisterType((*ResourceClaimParametersList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimParametersList")
- proto.RegisterType((*ResourceClaimParametersReference)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimParametersReference")
- proto.RegisterType((*ResourceClaimSchedulingStatus)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimSchedulingStatus")
- proto.RegisterType((*ResourceClaimSpec)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimSpec")
- proto.RegisterType((*ResourceClaimStatus)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimStatus")
- proto.RegisterType((*ResourceClaimTemplate)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimTemplate")
- proto.RegisterType((*ResourceClaimTemplateList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimTemplateList")
- proto.RegisterType((*ResourceClaimTemplateSpec)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimTemplateSpec")
- proto.RegisterType((*ResourceClass)(nil), "k8s.io.api.resource.v1alpha2.ResourceClass")
- proto.RegisterType((*ResourceClassList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassList")
- proto.RegisterType((*ResourceClassParameters)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassParameters")
- proto.RegisterType((*ResourceClassParametersList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassParametersList")
- proto.RegisterType((*ResourceClassParametersReference)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassParametersReference")
- proto.RegisterType((*ResourceFilter)(nil), "k8s.io.api.resource.v1alpha2.ResourceFilter")
- proto.RegisterType((*ResourceFilterModel)(nil), "k8s.io.api.resource.v1alpha2.ResourceFilterModel")
- proto.RegisterType((*ResourceHandle)(nil), "k8s.io.api.resource.v1alpha2.ResourceHandle")
- proto.RegisterType((*ResourceModel)(nil), "k8s.io.api.resource.v1alpha2.ResourceModel")
- proto.RegisterType((*ResourceRequest)(nil), "k8s.io.api.resource.v1alpha2.ResourceRequest")
- proto.RegisterType((*ResourceRequestModel)(nil), "k8s.io.api.resource.v1alpha2.ResourceRequestModel")
- proto.RegisterType((*ResourceSlice)(nil), "k8s.io.api.resource.v1alpha2.ResourceSlice")
- proto.RegisterType((*ResourceSliceList)(nil), "k8s.io.api.resource.v1alpha2.ResourceSliceList")
- proto.RegisterType((*StructuredResourceHandle)(nil), "k8s.io.api.resource.v1alpha2.StructuredResourceHandle")
- proto.RegisterType((*VendorParameters)(nil), "k8s.io.api.resource.v1alpha2.VendorParameters")
-}
-
-func init() {
- proto.RegisterFile("k8s.io/api/resource/v1alpha2/generated.proto", fileDescriptor_4312f5b44a31ec02)
-}
-
-var fileDescriptor_4312f5b44a31ec02 = []byte{
- // 2242 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x1a, 0x4d, 0x6c, 0x1c, 0x57,
- 0xd9, 0xb3, 0xbb, 0x89, 0xd7, 0x9f, 0xed, 0xb5, 0x33, 0xb6, 0xe3, 0x4d, 0xea, 0xee, 0x6e, 0x47,
- 0x20, 0x2c, 0x70, 0x76, 0x1b, 0xa7, 0x4d, 0xa3, 0x52, 0x90, 0x32, 0x71, 0x13, 0x2c, 0x9a, 0xd4,
- 0x7d, 0x4b, 0xdc, 0xa6, 0xfc, 0x75, 0xbc, 0xf3, 0x62, 0x0f, 0xd9, 0x9d, 0xd9, 0xcc, 0x7b, 0xeb,
- 0x26, 0xe2, 0x12, 0x55, 0x20, 0xb8, 0x20, 0x15, 0x81, 0x10, 0x9c, 0x38, 0x21, 0xc4, 0x85, 0x0b,
- 0x5c, 0x39, 0x55, 0xd0, 0x1c, 0x83, 0x40, 0xa2, 0xe2, 0xb0, 0x22, 0xcb, 0x91, 0x23, 0xb7, 0x9e,
- 0xd0, 0xbc, 0xf7, 0xe6, 0xe7, 0xcd, 0xce, 0xac, 0x77, 0x96, 0xc6, 0x4a, 0x4e, 0xde, 0x79, 0xef,
- 0xfb, 0x7b, 0xdf, 0xff, 0x7b, 0x9f, 0x61, 0xe3, 0xce, 0x25, 0x52, 0xb7, 0x9c, 0x86, 0xd1, 0xb5,
- 0x1a, 0x2e, 0x26, 0x4e, 0xcf, 0x6d, 0xe1, 0xc6, 0xe1, 0x79, 0xa3, 0xdd, 0x3d, 0x30, 0x36, 0x1b,
- 0xfb, 0xd8, 0xc6, 0xae, 0x41, 0xb1, 0x59, 0xef, 0xba, 0x0e, 0x75, 0xd4, 0x35, 0x0e, 0x5d, 0x37,
- 0xba, 0x56, 0xdd, 0x87, 0xae, 0xfb, 0xd0, 0x67, 0xcf, 0xed, 0x5b, 0xf4, 0xa0, 0xb7, 0x57, 0x6f,
- 0x39, 0x9d, 0xc6, 0xbe, 0xb3, 0xef, 0x34, 0x18, 0xd2, 0x5e, 0xef, 0x36, 0xfb, 0x62, 0x1f, 0xec,
- 0x17, 0x27, 0x76, 0x56, 0x8b, 0xb0, 0x6e, 0x39, 0xae, 0xc7, 0x36, 0xce, 0xf0, 0xec, 0x4b, 0x21,
- 0x4c, 0xc7, 0x68, 0x1d, 0x58, 0x36, 0x76, 0xef, 0x37, 0xba, 0x77, 0xf6, 0x65, 0x79, 0xb3, 0x60,
- 0x91, 0x46, 0x07, 0x53, 0x23, 0x89, 0x57, 0x23, 0x0d, 0xcb, 0xed, 0xd9, 0xd4, 0xea, 0x0c, 0xb3,
- 0xb9, 0x78, 0x14, 0x02, 0x69, 0x1d, 0xe0, 0x8e, 0x11, 0xc7, 0xd3, 0x7e, 0x99, 0x83, 0xc5, 0xcb,
- 0xed, 0xb6, 0xd3, 0x32, 0xa8, 0xe5, 0xd8, 0x08, 0x93, 0x5e, 0x9b, 0xaa, 0x0e, 0x2c, 0xf8, 0xe7,
- 0xf9, 0x9a, 0x61, 0x9b, 0x6d, 0x4c, 0xca, 0x4a, 0x2d, 0xbf, 0x3e, 0xbb, 0xb9, 0x51, 0x1f, 0xa5,
- 0xf4, 0x3a, 0x92, 0x90, 0xf4, 0xd5, 0x87, 0xfd, 0xea, 0xd4, 0xa0, 0x5f, 0x5d, 0x90, 0xd7, 0x09,
- 0x8a, 0x53, 0x57, 0xf7, 0x60, 0xd1, 0x38, 0x34, 0xac, 0xb6, 0xb1, 0xd7, 0xc6, 0x6f, 0xda, 0x37,
- 0x1c, 0x13, 0x93, 0x72, 0xae, 0xa6, 0xac, 0xcf, 0x6e, 0xd6, 0xa2, 0x1c, 0x3d, 0xcb, 0xd4, 0x0f,
- 0xcf, 0xd7, 0x3d, 0x80, 0x26, 0x6e, 0xe3, 0x16, 0x75, 0x5c, 0x7d, 0x79, 0xd0, 0xaf, 0x2e, 0x5e,
- 0x8e, 0x61, 0xa3, 0x21, 0x7a, 0x6a, 0x03, 0x66, 0xc8, 0x81, 0xe1, 0x62, 0x6f, 0xad, 0x9c, 0xaf,
- 0x29, 0xeb, 0x45, 0xfd, 0x94, 0x10, 0x70, 0xa6, 0xe9, 0x6f, 0xa0, 0x10, 0x46, 0xfb, 0xa9, 0x02,
- 0x2b, 0x71, 0xd5, 0x5c, 0x77, 0x4c, 0xdc, 0x56, 0xef, 0x41, 0xc9, 0x36, 0x3a, 0xd8, 0xf4, 0xcf,
- 0xe5, 0xa9, 0xc7, 0x13, 0xf6, 0xb5, 0xd1, 0xea, 0xb9, 0x21, 0xe1, 0xc4, 0x49, 0xeb, 0xea, 0xa0,
- 0x5f, 0x2d, 0xc9, 0x30, 0x28, 0xc6, 0x47, 0xfb, 0x7d, 0x0e, 0x4e, 0x6f, 0xb9, 0xd6, 0x21, 0x76,
- 0x87, 0x8c, 0xf6, 0x63, 0x05, 0x56, 0x0f, 0xb1, 0x6d, 0x3a, 0x2e, 0xc2, 0x77, 0x7b, 0x98, 0xd0,
- 0x1d, 0xc3, 0x35, 0x3a, 0x98, 0x62, 0xd7, 0x17, 0xef, 0x5c, 0x44, 0xbc, 0xc0, 0x49, 0xea, 0xdd,
- 0x3b, 0xfb, 0x75, 0xe1, 0x24, 0x75, 0x64, 0xbc, 0xff, 0xfa, 0x3d, 0x8a, 0x6d, 0x62, 0x39, 0xb6,
- 0x5e, 0x15, 0xda, 0x59, 0xdd, 0x4d, 0xa6, 0x8a, 0xd2, 0xd8, 0x79, 0xa2, 0xac, 0x18, 0x49, 0x9a,
- 0x13, 0x46, 0xbd, 0x30, 0x5a, 0x4f, 0x89, 0x4a, 0xd7, 0x9f, 0x17, 0xe2, 0x24, 0xdb, 0x04, 0x25,
- 0x33, 0xd4, 0x7e, 0x91, 0x83, 0x12, 0x57, 0x98, 0x10, 0x93, 0xa8, 0x9b, 0x00, 0x26, 0x5b, 0xf1,
- 0x74, 0xcd, 0x54, 0x33, 0xa3, 0xab, 0x82, 0x38, 0x6c, 0x05, 0x3b, 0x28, 0x02, 0xa5, 0x12, 0x58,
- 0xe4, 0x87, 0x8d, 0x28, 0x35, 0x37, 0x89, 0x52, 0xcb, 0x82, 0xd1, 0xe2, 0x6e, 0x8c, 0x1c, 0x1a,
- 0x62, 0xa0, 0x7e, 0x13, 0x8a, 0xae, 0x10, 0xba, 0x9c, 0x67, 0xf1, 0x77, 0x6e, 0xbc, 0xf8, 0x13,
- 0x47, 0xd5, 0x17, 0x05, 0xb3, 0xa2, 0x7f, 0x76, 0x14, 0x10, 0xd4, 0x74, 0xa8, 0x8c, 0xf6, 0x47,
- 0xb5, 0x06, 0x05, 0x3b, 0xd4, 0xd0, 0x9c, 0xa0, 0x55, 0x60, 0xba, 0x61, 0x3b, 0xda, 0x5f, 0x14,
- 0x58, 0x8d, 0x11, 0xa1, 0xd4, 0xb5, 0xf6, 0x7a, 0x14, 0x1f, 0x8d, 0xed, 0x79, 0x49, 0xc9, 0xf0,
- 0xe1, 0x77, 0x8d, 0x76, 0x0f, 0x0b, 0x95, 0xbe, 0x9a, 0x29, 0x8c, 0x24, 0x0a, 0xfa, 0xe7, 0x04,
- 0xa3, 0xb5, 0x51, 0x50, 0x28, 0xc6, 0x57, 0xfb, 0x4f, 0x1e, 0x46, 0x22, 0xa8, 0xdf, 0x86, 0xe2,
- 0xdd, 0x9e, 0x61, 0x53, 0x8b, 0xde, 0x2f, 0x9f, 0x64, 0x42, 0xd6, 0x53, 0xed, 0x2e, 0x49, 0xfd,
- 0x96, 0xc0, 0xd2, 0x4f, 0x0d, 0xfa, 0xd5, 0x79, 0xff, 0x8b, 0x4b, 0x11, 0x90, 0x54, 0x5f, 0x80,
- 0xc2, 0x9e, 0xe3, 0xf0, 0xf0, 0x28, 0xea, 0xf3, 0x5e, 0x4a, 0xd2, 0x1d, 0xa7, 0xcd, 0xc1, 0xd8,
- 0x96, 0x5a, 0x81, 0xbc, 0x65, 0xd3, 0xf2, 0x74, 0x4d, 0x59, 0xcf, 0xeb, 0x73, 0x9e, 0x51, 0xb7,
- 0x6d, 0xca, 0x01, 0xbc, 0x0d, 0xb5, 0x05, 0x45, 0xcb, 0xa6, 0xcd, 0xb6, 0xd5, 0xc2, 0xe5, 0x22,
- 0x93, 0xf0, 0xa5, 0x2c, 0x6a, 0xdc, 0x16, 0xb8, 0x5c, 0x4e, 0xff, 0x4b, 0xc8, 0xe9, 0x13, 0x56,
- 0xbf, 0x00, 0x27, 0x09, 0x75, 0x2d, 0x7b, 0xbf, 0x7c, 0x82, 0x99, 0x75, 0x61, 0xd0, 0xaf, 0xce,
- 0x36, 0xd9, 0x0a, 0x07, 0x15, 0xdb, 0xaa, 0x03, 0xb3, 0xfc, 0x17, 0x17, 0x68, 0x86, 0x09, 0xf4,
- 0x4a, 0x16, 0x81, 0x9a, 0x21, 0x3a, 0x4f, 0xf1, 0x91, 0x05, 0xce, 0x2b, 0xca, 0x41, 0xfd, 0x22,
- 0x4c, 0x1f, 0x62, 0xd7, 0x0b, 0xb1, 0x32, 0x30, 0xd1, 0x16, 0x07, 0xfd, 0xea, 0xdc, 0x2e, 0x5f,
- 0xe2, 0xf0, 0x3e, 0x80, 0xb6, 0x05, 0xcb, 0x32, 0xaf, 0xab, 0x56, 0x9b, 0x62, 0x57, 0xdd, 0x80,
- 0x22, 0x11, 0x55, 0x45, 0xb8, 0x6d, 0x10, 0x40, 0x7e, 0xb5, 0x41, 0x01, 0x84, 0xf6, 0x1b, 0x05,
- 0x4e, 0xc7, 0x75, 0x48, 0xa8, 0x61, 0xb7, 0xc6, 0xf1, 0x7d, 0x0b, 0x20, 0x70, 0x41, 0x2f, 0x93,
- 0x78, 0xc1, 0xfd, 0xf2, 0x44, 0x6e, 0x1f, 0xa6, 0xae, 0x60, 0x89, 0xa0, 0x08, 0x71, 0xed, 0xe2,
- 0xb0, 0x98, 0xc2, 0x9a, 0x6b, 0x50, 0xb0, 0x6c, 0xca, 0x6b, 0x7b, 0x5e, 0x2f, 0x7a, 0x22, 0x6e,
- 0xdb, 0x94, 0x20, 0xb6, 0xaa, 0xbd, 0x0e, 0x2b, 0xb1, 0x62, 0xc4, 0x53, 0x47, 0x46, 0x35, 0x3d,
- 0x18, 0xca, 0x11, 0xc1, 0x0f, 0x15, 0xc3, 0x8c, 0x25, 0x74, 0xe6, 0x77, 0x18, 0x19, 0x9d, 0x96,
- 0x23, 0x87, 0x85, 0xdc, 0x5f, 0x21, 0x28, 0xa4, 0xac, 0xe9, 0x70, 0x26, 0xd5, 0xb7, 0xd4, 0xcf,
- 0xc3, 0x34, 0xf7, 0x23, 0x2e, 0xc1, 0x8c, 0x3e, 0x3b, 0xe8, 0x57, 0xa7, 0x39, 0x04, 0x41, 0xfe,
- 0x9e, 0xf6, 0xc7, 0x1c, 0x2c, 0xef, 0x38, 0x66, 0xb3, 0x75, 0x80, 0xcd, 0x5e, 0xdb, 0xb2, 0xf7,
- 0xaf, 0x38, 0x36, 0xc5, 0xf7, 0xa8, 0xfa, 0x1e, 0x14, 0xbd, 0x26, 0xce, 0x34, 0xa8, 0x21, 0xca,
- 0xec, 0x8b, 0xa3, 0x32, 0x03, 0xa9, 0x7b, 0xd0, 0x5e, 0x13, 0xf3, 0xe6, 0xde, 0xf7, 0x70, 0x8b,
- 0x5e, 0xc7, 0xd4, 0x08, 0x4d, 0x18, 0xae, 0xa1, 0x80, 0xaa, 0xfa, 0x0e, 0x14, 0x48, 0x17, 0xb7,
- 0x44, 0x72, 0xbc, 0x38, 0x5a, 0x41, 0x49, 0x32, 0x36, 0xbb, 0xb8, 0x15, 0x7a, 0xa1, 0xf7, 0x85,
- 0x18, 0x45, 0xf5, 0x3d, 0x2f, 0x9c, 0x0d, 0xda, 0x23, 0xac, 0x1f, 0x9a, 0xdd, 0xbc, 0x34, 0x01,
- 0x6d, 0x86, 0xaf, 0x97, 0x04, 0xf5, 0x93, 0xfc, 0x1b, 0x09, 0xba, 0xda, 0x5f, 0x15, 0x28, 0x27,
- 0xa1, 0xbd, 0x61, 0x11, 0xaa, 0x7e, 0x6b, 0x48, 0x75, 0xf5, 0xf1, 0x54, 0xe7, 0x61, 0x33, 0xc5,
- 0x05, 0x8e, 0xe7, 0xaf, 0x44, 0xd4, 0xf6, 0x36, 0x9c, 0xb0, 0x28, 0xee, 0xf8, 0xd1, 0xb5, 0x99,
- 0xfd, 0x6c, 0xfa, 0xbc, 0x20, 0x7f, 0x62, 0xdb, 0x23, 0x84, 0x38, 0x3d, 0xed, 0xc3, 0x94, 0x33,
- 0x79, 0x8a, 0x55, 0x2f, 0xc1, 0x1c, 0x77, 0x7d, 0x6c, 0x7a, 0x6d, 0xa7, 0x08, 0x90, 0x65, 0x41,
- 0x68, 0xae, 0x19, 0xd9, 0x43, 0x12, 0xa4, 0xfa, 0x2a, 0x94, 0xba, 0x0e, 0xc5, 0x36, 0xb5, 0x8c,
- 0xb6, 0xdf, 0x01, 0x7b, 0xfe, 0xc8, 0xda, 0xc2, 0x1d, 0x69, 0x07, 0xc5, 0x20, 0xb5, 0x5f, 0x29,
- 0x70, 0x36, 0xdd, 0x3a, 0xea, 0xf7, 0xa1, 0xe4, 0x9f, 0xf8, 0x4a, 0xdb, 0xb0, 0x3a, 0x7e, 0xb0,
- 0x7d, 0x79, 0xbc, 0x76, 0x82, 0xe1, 0x84, 0xb4, 0x85, 0xc9, 0x4f, 0x8b, 0x33, 0x95, 0x24, 0x30,
- 0x82, 0x62, 0xac, 0xb4, 0x5f, 0xe7, 0x60, 0x5e, 0x02, 0x39, 0x86, 0x90, 0x79, 0x4b, 0x0a, 0x99,
- 0x46, 0x96, 0x63, 0xa6, 0xc5, 0xca, 0xad, 0x58, 0xac, 0x9c, 0xcf, 0x42, 0x74, 0x74, 0x90, 0x0c,
- 0x14, 0xa8, 0x48, 0xf0, 0x57, 0x1c, 0x9b, 0xf4, 0x3a, 0x5e, 0xcb, 0x7a, 0x1b, 0xbb, 0xd8, 0xab,
- 0x28, 0x1b, 0x50, 0x34, 0xba, 0xd6, 0x35, 0xd7, 0xe9, 0x75, 0xe3, 0x39, 0xf7, 0xf2, 0xce, 0x36,
- 0x5b, 0x47, 0x01, 0x84, 0x07, 0xed, 0x4b, 0xc4, 0xa4, 0x9d, 0x89, 0x76, 0x82, 0xa2, 0x45, 0x0c,
- 0x20, 0x82, 0x6a, 0x55, 0x48, 0xad, 0x56, 0x3a, 0xe4, 0x7b, 0x96, 0x29, 0x6a, 0xfe, 0x8b, 0x02,
- 0x20, 0x7f, 0x73, 0x7b, 0xeb, 0xd3, 0x7e, 0xf5, 0x85, 0xb4, 0x8b, 0x27, 0xbd, 0xdf, 0xc5, 0xa4,
- 0x7e, 0x73, 0x7b, 0x0b, 0x79, 0xc8, 0xda, 0x47, 0x0a, 0x9c, 0x92, 0x0e, 0x79, 0x0c, 0x29, 0x60,
- 0x47, 0x4e, 0x01, 0x5f, 0xca, 0x60, 0xb2, 0x94, 0xd8, 0xff, 0x59, 0x1e, 0x56, 0x25, 0xb8, 0x48,
- 0xbb, 0xfe, 0xe4, 0xdd, 0xfa, 0x7d, 0x98, 0x0f, 0xee, 0xef, 0x57, 0x5d, 0xa7, 0x23, 0xfc, 0xfb,
- 0xab, 0x19, 0xce, 0x15, 0xb9, 0x70, 0xf8, 0xce, 0xc5, 0x5b, 0xbe, 0x6b, 0x51, 0xc2, 0x48, 0xe6,
- 0x93, 0xf9, 0xee, 0xac, 0xb6, 0xa1, 0x64, 0x4a, 0xb7, 0xae, 0x72, 0x61, 0x9c, 0x07, 0x04, 0xf9,
- 0xa6, 0x16, 0xa6, 0x18, 0x79, 0x1d, 0xc5, 0x68, 0x6b, 0xff, 0x50, 0xe0, 0xb9, 0x94, 0x53, 0x1e,
- 0x83, 0x97, 0xbd, 0x2b, 0x7b, 0xd9, 0xcb, 0x13, 0x59, 0x23, 0xc5, 0xdf, 0x7e, 0xae, 0x40, 0xed,
- 0x28, 0xfb, 0x65, 0x4c, 0x0e, 0x35, 0x28, 0xdc, 0xb1, 0x6c, 0x93, 0xf9, 0x4e, 0x24, 0xdc, 0xbf,
- 0x6e, 0xd9, 0x26, 0x62, 0x3b, 0x41, 0x42, 0xc8, 0xa7, 0x5e, 0xfc, 0x1e, 0x28, 0xf0, 0xfc, 0xc8,
- 0xea, 0x30, 0x46, 0x0b, 0xfc, 0x15, 0x58, 0xe8, 0xd9, 0xa4, 0x67, 0x51, 0xcf, 0x61, 0xa2, 0x05,
- 0x6f, 0x69, 0xd0, 0xaf, 0x2e, 0xdc, 0x94, 0xb7, 0x50, 0x1c, 0x56, 0xfb, 0x6d, 0x2e, 0x96, 0x4f,
- 0x58, 0xf9, 0xbd, 0x06, 0xa7, 0x22, 0xe5, 0x87, 0x90, 0xc8, 0x15, 0xff, 0x8c, 0x90, 0x21, 0x8a,
- 0xc5, 0x01, 0xd0, 0x30, 0x8e, 0x17, 0x6a, 0xdd, 0xa8, 0xaa, 0x3f, 0xcb, 0x50, 0x93, 0x36, 0x90,
- 0xcc, 0x47, 0xdd, 0x81, 0x52, 0xf8, 0x92, 0x71, 0xdd, 0x6b, 0x21, 0xb8, 0x19, 0xd6, 0xfd, 0x58,
- 0xb8, 0x2c, 0xed, 0x7e, 0x3a, 0xb4, 0x82, 0x62, 0xf8, 0xda, 0x7f, 0x73, 0xb0, 0x94, 0x50, 0x8e,
- 0x26, 0x7a, 0x07, 0xf9, 0x0e, 0x40, 0x48, 0x5d, 0xe8, 0xa4, 0x9e, 0xed, 0x35, 0x47, 0x2f, 0xb1,
- 0xcb, 0x4a, 0xb8, 0x1a, 0xa1, 0xa8, 0x12, 0x98, 0x75, 0x31, 0xc1, 0xee, 0x21, 0x36, 0xaf, 0x3a,
- 0xae, 0x78, 0xf5, 0x78, 0x2d, 0x83, 0xd2, 0x87, 0x4a, 0xa7, 0xbe, 0x24, 0x8e, 0x34, 0x8b, 0x42,
- 0xc2, 0x28, 0xca, 0x45, 0x6d, 0xc2, 0x8a, 0x89, 0xa3, 0xcf, 0x47, 0x2c, 0xad, 0x60, 0x93, 0x55,
- 0xc4, 0x62, 0xf8, 0xf0, 0xb4, 0x95, 0x04, 0x84, 0x92, 0x71, 0xb5, 0xbf, 0x2b, 0xb0, 0x22, 0x49,
- 0xf6, 0x0d, 0xdc, 0xe9, 0xb6, 0x0d, 0x8a, 0x8f, 0xa1, 0x4e, 0xdc, 0x92, 0xda, 0x9f, 0x57, 0x32,
- 0xa8, 0xcf, 0x17, 0x32, 0xad, 0x0d, 0xd2, 0xfe, 0xa6, 0xc0, 0x99, 0x44, 0x8c, 0x63, 0x48, 0xb4,
- 0xef, 0xc8, 0x89, 0xf6, 0xc2, 0x04, 0xe7, 0x4a, 0x49, 0xb3, 0x8f, 0xd2, 0x4e, 0xd5, 0xe4, 0xd7,
- 0xa4, 0x67, 0xaf, 0x5f, 0xd5, 0x3e, 0xce, 0x4b, 0x6d, 0x37, 0x39, 0x8e, 0xfe, 0x44, 0xce, 0x28,
- 0xb9, 0xb1, 0x32, 0xca, 0x50, 0xa2, 0xcd, 0x67, 0x4c, 0xb4, 0x84, 0x4c, 0x96, 0x68, 0x6f, 0xc1,
- 0xbc, 0x5c, 0x7d, 0x0a, 0x63, 0x0e, 0x1c, 0x18, 0xe9, 0xa6, 0x54, 0x9d, 0x64, 0x4a, 0xea, 0x1b,
- 0xb0, 0x4c, 0xa8, 0xdb, 0x6b, 0xd1, 0x9e, 0x8b, 0xcd, 0xc8, 0x8b, 0xf1, 0x09, 0x96, 0x4f, 0xca,
- 0x83, 0x7e, 0x75, 0xb9, 0x99, 0xb0, 0x8f, 0x12, 0xb1, 0xe2, 0x9d, 0x33, 0x21, 0x4f, 0x73, 0xe7,
- 0x4c, 0xd2, 0x3a, 0x99, 0x8f, 0xe4, 0xce, 0x39, 0x6a, 0xb5, 0x67, 0xa1, 0x73, 0x1e, 0xe1, 0x65,
- 0x23, 0x3b, 0x67, 0x9a, 0x30, 0x38, 0xe0, 0x55, 0xed, 0x88, 0xb2, 0x19, 0x9f, 0x0f, 0x64, 0x9a,
- 0x1c, 0xbc, 0x0d, 0xd3, 0xb7, 0xd9, 0x9b, 0xe6, 0x98, 0x7d, 0xb7, 0x7f, 0x50, 0xfe, 0x10, 0xaa,
- 0x2f, 0x08, 0x56, 0xd3, 0xfc, 0x9b, 0x20, 0x9f, 0x5a, 0xbc, 0xd3, 0x8e, 0x6a, 0xe5, 0x69, 0xee,
- 0xb4, 0xa3, 0x72, 0xa6, 0xf8, 0xe7, 0x9f, 0xe5, 0x4e, 0x3b, 0xd1, 0xde, 0xc7, 0xdf, 0x69, 0x7b,
- 0x37, 0x2f, 0xef, 0x2f, 0xe9, 0x1a, 0x2d, 0xff, 0x86, 0x1e, 0xdc, 0xbc, 0x6e, 0xf8, 0x1b, 0x28,
- 0x84, 0xd1, 0x3e, 0x56, 0xa0, 0x24, 0x9b, 0x73, 0xa2, 0x46, 0xef, 0x81, 0x02, 0x4b, 0xae, 0x44,
- 0x26, 0x3a, 0xc0, 0x3b, 0x9f, 0xc5, 0x9d, 0xf8, 0xf8, 0xee, 0x39, 0xc1, 0x70, 0x29, 0x61, 0x13,
- 0x25, 0xb1, 0xd2, 0x7e, 0xa8, 0x40, 0x12, 0xb0, 0x6a, 0xa7, 0x4c, 0x5f, 0x37, 0xb3, 0x3c, 0x1d,
- 0x0b, 0x4f, 0x1f, 0x67, 0xe6, 0xfa, 0xcf, 0x88, 0x46, 0xf9, 0xc0, 0x7a, 0x22, 0x8d, 0xd6, 0xa0,
- 0xc0, 0xc2, 0x22, 0xe6, 0x0d, 0x5b, 0x06, 0x35, 0x10, 0xdb, 0x51, 0x5d, 0x28, 0x85, 0x05, 0xc0,
- 0x5b, 0x67, 0x05, 0xe3, 0xc8, 0x27, 0xdf, 0xb0, 0x94, 0xc4, 0xe6, 0xef, 0xec, 0x70, 0x4d, 0x89,
- 0x22, 0x8a, 0x71, 0xd0, 0x3e, 0x50, 0xc2, 0x36, 0x81, 0xab, 0xf7, 0x6e, 0x8a, 0x7a, 0x33, 0x8d,
- 0x27, 0x82, 0x1f, 0x63, 0x69, 0xf8, 0x27, 0x39, 0x58, 0x88, 0xcd, 0x2e, 0x13, 0x27, 0xae, 0xca,
- 0x93, 0x9e, 0xb8, 0xfe, 0x40, 0x81, 0x65, 0x57, 0x16, 0x24, 0xea, 0xf6, 0x9b, 0x99, 0xc6, 0xaf,
- 0xdc, 0xef, 0xd7, 0x04, 0xfb, 0xe5, 0xa4, 0x5d, 0x94, 0xc8, 0x4d, 0xfb, 0x91, 0x02, 0x89, 0xe0,
- 0xaa, 0x93, 0x62, 0x9b, 0x0b, 0xd9, 0x6c, 0xc3, 0xa7, 0xc3, 0xe3, 0x58, 0xe6, 0x4f, 0x91, 0xc7,
- 0x5b, 0x3e, 0x2f, 0x79, 0xf2, 0xb5, 0x7a, 0x03, 0x8a, 0xb6, 0x63, 0xe2, 0x48, 0x0f, 0x19, 0x24,
- 0xd9, 0x1b, 0x62, 0x1d, 0x05, 0x10, 0xb1, 0x50, 0xcc, 0x8f, 0x15, 0x8a, 0x07, 0x30, 0xef, 0x46,
- 0x7d, 0x5e, 0xb4, 0x7e, 0x63, 0x76, 0x39, 0xdc, 0xae, 0x2b, 0x82, 0x87, 0x1c, 0x3d, 0x48, 0x26,
- 0x2c, 0xf5, 0x6e, 0x4c, 0x7f, 0x4f, 0x6d, 0xef, 0xc6, 0x27, 0xad, 0xc9, 0xb5, 0xf1, 0x0f, 0x79,
- 0x28, 0xa7, 0x65, 0x19, 0xf5, 0x03, 0x05, 0x56, 0x78, 0x20, 0xc5, 0xca, 0xe6, 0x64, 0xe1, 0x1a,
- 0xdc, 0xb6, 0x77, 0x93, 0x68, 0xa2, 0x64, 0x56, 0xb2, 0x10, 0xd1, 0xa7, 0x97, 0xc9, 0xfe, 0x4b,
- 0x63, 0x58, 0x08, 0xe9, 0x39, 0x27, 0x99, 0x95, 0xe4, 0xb8, 0x85, 0x23, 0x1d, 0xf7, 0xbb, 0x30,
- 0xed, 0xb2, 0x07, 0x11, 0xef, 0x5e, 0x30, 0xc6, 0xe8, 0x33, 0xf9, 0xdf, 0x7e, 0xc2, 0x5e, 0x8d,
- 0x7f, 0x13, 0xe4, 0x53, 0xd5, 0x7e, 0xa7, 0xc0, 0x50, 0xce, 0x9b, 0xa8, 0x72, 0x19, 0x00, 0xdd,
- 0xff, 0x53, 0xa1, 0x01, 0x8b, 0x88, 0x16, 0x23, 0x44, 0x75, 0xfd, 0xe1, 0xe3, 0xca, 0xd4, 0xa3,
- 0xc7, 0x95, 0xa9, 0x4f, 0x1e, 0x57, 0xa6, 0x1e, 0x0c, 0x2a, 0xca, 0xc3, 0x41, 0x45, 0x79, 0x34,
- 0xa8, 0x28, 0x9f, 0x0c, 0x2a, 0xca, 0xbf, 0x06, 0x15, 0xe5, 0xc3, 0x7f, 0x57, 0xa6, 0xde, 0x5d,
- 0x1b, 0xf5, 0x0f, 0x82, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x94, 0xb7, 0xe5, 0x3f, 0x28,
- 0x00, 0x00,
+ return len(dAtA) - i, nil
}
-func (m *AllocationResult) Marshal() (dAtA []byte, err error) {
+func (m *CELDeviceSelector) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -1485,54 +1377,25 @@ func (m *AllocationResult) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *AllocationResult) MarshalTo(dAtA []byte) (int, error) {
+func (m *CELDeviceSelector) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *AllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *CELDeviceSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
+ i -= len(m.Expression)
+ copy(dAtA[i:], m.Expression)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expression)))
i--
- if m.Shareable {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x18
- if m.AvailableOnNodes != nil {
- {
- size, err := m.AvailableOnNodes.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- if len(m.ResourceHandles) > 0 {
- for iNdEx := len(m.ResourceHandles) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.ResourceHandles[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
+ dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *AllocationResultModel) Marshal() (dAtA []byte, err error) {
+func (m *Device) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -1542,19 +1405,19 @@ func (m *AllocationResultModel) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *AllocationResultModel) MarshalTo(dAtA []byte) (int, error) {
+func (m *Device) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *AllocationResultModel) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if m.NamedResources != nil {
+ if m.Basic != nil {
{
- size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -1562,12 +1425,17 @@ func (m *AllocationResultModel) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0xa
+ dAtA[i] = 0x12
}
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i--
+ dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *DriverAllocationResult) Marshal() (dAtA []byte, err error) {
+func (m *DeviceAllocationConfiguration) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -1577,18 +1445,18 @@ func (m *DriverAllocationResult) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *DriverAllocationResult) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceAllocationConfiguration) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *DriverAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceAllocationConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
{
- size, err := m.AllocationResultModel.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.DeviceConfiguration.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -1596,21 +1464,25 @@ func (m *DriverAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error)
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x12
- {
- size, err := m.VendorRequestParameters.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
+ dAtA[i] = 0x1a
+ if len(m.Requests) > 0 {
+ for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Requests[iNdEx])
+ copy(dAtA[i:], m.Requests[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Requests[iNdEx])))
+ i--
+ dAtA[i] = 0x12
}
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
}
+ i -= len(m.Source)
+ copy(dAtA[i:], m.Source)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Source)))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *DriverRequests) Marshal() (dAtA []byte, err error) {
+func (m *DeviceAllocationResult) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -1620,20 +1492,20 @@ func (m *DriverRequests) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *DriverRequests) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceAllocationResult) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *DriverRequests) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Requests) > 0 {
- for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- {
+ if len(m.Config) > 0 {
+ for iNdEx := len(m.Config) - 1; iNdEx >= 0; iNdEx-- {
{
- size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Config[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -1641,28 +1513,27 @@ func (m *DriverRequests) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x1a
+ dAtA[i] = 0x12
}
}
- {
- size, err := m.VendorParameters.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
+ if len(m.Results) > 0 {
+ for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
}
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
}
- i--
- dAtA[i] = 0x12
- i -= len(m.DriverName)
- copy(dAtA[i:], m.DriverName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
- i--
- dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *NamedResourcesAllocationResult) Marshal() (dAtA []byte, err error) {
+func (m *DeviceAttribute) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -1672,78 +1543,12 @@ func (m *NamedResourcesAllocationResult) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *NamedResourcesAllocationResult) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceAttribute) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *NamedResourcesAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *NamedResourcesAttribute) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *NamedResourcesAttribute) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamedResourcesAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- {
- size, err := m.NamedResourcesAttributeValue.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *NamedResourcesAttributeValue) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *NamedResourcesAttributeValue) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamedResourcesAttributeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@@ -1753,55 +1558,14 @@ func (m *NamedResourcesAttributeValue) MarshalToSizedBuffer(dAtA []byte) (int, e
copy(dAtA[i:], *m.VersionValue)
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.VersionValue)))
i--
- dAtA[i] = 0x52
- }
- if m.StringSliceValue != nil {
- {
- size, err := m.StringSliceValue.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x4a
- }
- if m.IntSliceValue != nil {
- {
- size, err := m.IntSliceValue.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x42
- }
- if m.IntValue != nil {
- i = encodeVarintGenerated(dAtA, i, uint64(*m.IntValue))
- i--
- dAtA[i] = 0x38
- }
- if m.QuantityValue != nil {
- {
- size, err := m.QuantityValue.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x32
+ dAtA[i] = 0x2a
}
if m.StringValue != nil {
i -= len(*m.StringValue)
copy(dAtA[i:], *m.StringValue)
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StringValue)))
i--
- dAtA[i] = 0x2a
+ dAtA[i] = 0x22
}
if m.BoolValue != nil {
i--
@@ -1811,40 +1575,17 @@ func (m *NamedResourcesAttributeValue) MarshalToSizedBuffer(dAtA []byte) (int, e
dAtA[i] = 0
}
i--
- dAtA[i] = 0x10
+ dAtA[i] = 0x18
}
- return len(dAtA) - i, nil
-}
-
-func (m *NamedResourcesFilter) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+ if m.IntValue != nil {
+ i = encodeVarintGenerated(dAtA, i, uint64(*m.IntValue))
+ i--
+ dAtA[i] = 0x10
}
- return dAtA[:n], nil
-}
-
-func (m *NamedResourcesFilter) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamedResourcesFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- i -= len(m.Selector)
- copy(dAtA[i:], m.Selector)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Selector)))
- i--
- dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *NamedResourcesInstance) Marshal() (dAtA []byte, err error) {
+func (m *DeviceClaim) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -1854,20 +1595,20 @@ func (m *NamedResourcesInstance) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *NamedResourcesInstance) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceClaim) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *NamedResourcesInstance) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Attributes) > 0 {
- for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- {
+ if len(m.Config) > 0 {
+ for iNdEx := len(m.Config) - 1; iNdEx >= 0; iNdEx-- {
{
- size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Config[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -1875,99 +1616,27 @@ func (m *NamedResourcesInstance) MarshalToSizedBuffer(dAtA []byte) (int, error)
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x12
+ dAtA[i] = 0x1a
}
}
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *NamedResourcesIntSlice) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *NamedResourcesIntSlice) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamedResourcesIntSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if len(m.Ints) > 0 {
- for iNdEx := len(m.Ints) - 1; iNdEx >= 0; iNdEx-- {
- i = encodeVarintGenerated(dAtA, i, uint64(m.Ints[iNdEx]))
+ if len(m.Constraints) > 0 {
+ for iNdEx := len(m.Constraints) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Constraints[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
i--
- dAtA[i] = 0x8
+ dAtA[i] = 0x12
}
}
- return len(dAtA) - i, nil
-}
-
-func (m *NamedResourcesRequest) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *NamedResourcesRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamedResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- i -= len(m.Selector)
- copy(dAtA[i:], m.Selector)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Selector)))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *NamedResourcesResources) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *NamedResourcesResources) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamedResourcesResources) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if len(m.Instances) > 0 {
- for iNdEx := len(m.Instances) - 1; iNdEx >= 0; iNdEx-- {
+ if len(m.Requests) > 0 {
+ for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- {
{
- size, err := m.Instances[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -1981,7 +1650,7 @@ func (m *NamedResourcesResources) MarshalToSizedBuffer(dAtA []byte) (int, error)
return len(dAtA) - i, nil
}
-func (m *NamedResourcesStringSlice) Marshal() (dAtA []byte, err error) {
+func (m *DeviceClaimConfiguration) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -1991,21 +1660,31 @@ func (m *NamedResourcesStringSlice) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *NamedResourcesStringSlice) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceClaimConfiguration) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *NamedResourcesStringSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceClaimConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Strings) > 0 {
- for iNdEx := len(m.Strings) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Strings[iNdEx])
- copy(dAtA[i:], m.Strings[iNdEx])
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Strings[iNdEx])))
+ {
+ size, err := m.DeviceConfiguration.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ if len(m.Requests) > 0 {
+ for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Requests[iNdEx])
+ copy(dAtA[i:], m.Requests[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Requests[iNdEx])))
i--
dAtA[i] = 0xa
}
@@ -2013,7 +1692,7 @@ func (m *NamedResourcesStringSlice) MarshalToSizedBuffer(dAtA []byte) (int, erro
return len(dAtA) - i, nil
}
-func (m *PodSchedulingContext) Marshal() (dAtA []byte, err error) {
+func (m *DeviceClass) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2023,18 +1702,18 @@ func (m *PodSchedulingContext) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *PodSchedulingContext) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceClass) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
{
- size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -2042,9 +1721,9 @@ func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x1a
+ dAtA[i] = 0x12
{
- size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -2052,9 +1731,32 @@ func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x12
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *DeviceClassConfiguration) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *DeviceClassConfiguration) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *DeviceClassConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
{
- size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.DeviceConfiguration.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -2066,7 +1768,7 @@ func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
-func (m *PodSchedulingContextList) Marshal() (dAtA []byte, err error) {
+func (m *DeviceClassList) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2076,12 +1778,12 @@ func (m *PodSchedulingContextList) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *PodSchedulingContextList) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceClassList) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *PodSchedulingContextList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@@ -2113,7 +1815,7 @@ func (m *PodSchedulingContextList) MarshalToSizedBuffer(dAtA []byte) (int, error
return len(dAtA) - i, nil
}
-func (m *PodSchedulingContextSpec) Marshal() (dAtA []byte, err error) {
+func (m *DeviceClassSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2123,34 +1825,60 @@ func (m *PodSchedulingContextSpec) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *PodSchedulingContextSpec) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceClassSpec) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *PodSchedulingContextSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceClassSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.PotentialNodes) > 0 {
- for iNdEx := len(m.PotentialNodes) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.PotentialNodes[iNdEx])
- copy(dAtA[i:], m.PotentialNodes[iNdEx])
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.PotentialNodes[iNdEx])))
- i--
- dAtA[i] = 0x12
+ if m.SuitableNodes != nil {
+ {
+ size, err := m.SuitableNodes.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
+ }
+ if len(m.Config) > 0 {
+ for iNdEx := len(m.Config) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Config[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ if len(m.Selectors) > 0 {
+ for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
}
}
- i -= len(m.SelectedNode)
- copy(dAtA[i:], m.SelectedNode)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.SelectedNode)))
- i--
- dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *PodSchedulingContextStatus) Marshal() (dAtA []byte, err error) {
+func (m *DeviceConfiguration) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2160,26 +1888,63 @@ func (m *PodSchedulingContextStatus) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *PodSchedulingContextStatus) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceConfiguration) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *PodSchedulingContextStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.ResourceClaims) > 0 {
- for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ if m.Opaque != nil {
+ {
+ size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
}
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *DeviceConstraint) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *DeviceConstraint) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *DeviceConstraint) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.MatchAttribute != nil {
+ i -= len(*m.MatchAttribute)
+ copy(dAtA[i:], *m.MatchAttribute)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MatchAttribute)))
+ i--
+ dAtA[i] = 0x12
+ }
+ if len(m.Requests) > 0 {
+ for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Requests[iNdEx])
+ copy(dAtA[i:], m.Requests[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Requests[iNdEx])))
i--
dAtA[i] = 0xa
}
@@ -2187,7 +1952,7 @@ func (m *PodSchedulingContextStatus) MarshalToSizedBuffer(dAtA []byte) (int, err
return len(dAtA) - i, nil
}
-func (m *ResourceClaim) Marshal() (dAtA []byte, err error) {
+func (m *DeviceRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2197,50 +1962,60 @@ func (m *ResourceClaim) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClaim) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- {
- size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ i--
+ if m.AdminAccess {
+ dAtA[i] = 1
+ } else {
+ dAtA[i] = 0
}
i--
- dAtA[i] = 0x1a
- {
- size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
+ dAtA[i] = 0x30
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Count))
+ i--
+ dAtA[i] = 0x28
+ i -= len(m.AllocationMode)
+ copy(dAtA[i:], m.AllocationMode)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllocationMode)))
+ i--
+ dAtA[i] = 0x22
+ if len(m.Selectors) > 0 {
+ for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
}
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
}
+ i -= len(m.DeviceClassName)
+ copy(dAtA[i:], m.DeviceClassName)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeviceClassName)))
i--
dAtA[i] = 0x12
- {
- size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) {
+func (m *DeviceRequestAllocationResult) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2250,40 +2025,40 @@ func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClaimConsumerReference) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceRequestAllocationResult) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClaimConsumerReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceRequestAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- i -= len(m.UID)
- copy(dAtA[i:], m.UID)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID)))
- i--
- dAtA[i] = 0x2a
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i -= len(m.Device)
+ copy(dAtA[i:], m.Device)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Device)))
i--
dAtA[i] = 0x22
- i -= len(m.Resource)
- copy(dAtA[i:], m.Resource)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource)))
+ i -= len(m.Pool)
+ copy(dAtA[i:], m.Pool)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Pool)))
i--
dAtA[i] = 0x1a
- i -= len(m.APIGroup)
- copy(dAtA[i:], m.APIGroup)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup)))
+ i -= len(m.Driver)
+ copy(dAtA[i:], m.Driver)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.Request)
+ copy(dAtA[i:], m.Request)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Request)))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) {
+func (m *DeviceSelector) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2293,32 +2068,53 @@ func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClaimList) MarshalTo(dAtA []byte) (int, error) {
+func (m *DeviceSelector) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *DeviceSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Items) > 0 {
- for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ if m.CEL != nil {
+ {
+ size, err := m.CEL.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
}
- i--
- dAtA[i] = 0x12
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
}
+ i--
+ dAtA[i] = 0xa
}
+ return len(dAtA) - i, nil
+}
+
+func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *OpaqueDeviceConfiguration) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *OpaqueDeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
{
- size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -2326,11 +2122,16 @@ func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
+ dAtA[i] = 0x12
+ i -= len(m.Driver)
+ copy(dAtA[i:], m.Driver)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver)))
+ i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *ResourceClaimParameters) Marshal() (dAtA []byte, err error) {
+func (m *PodSchedulingContext) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2340,50 +2141,36 @@ func (m *ResourceClaimParameters) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClaimParameters) MarshalTo(dAtA []byte) (int, error) {
+func (m *PodSchedulingContext) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClaimParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.DriverRequests) > 0 {
- for iNdEx := len(m.DriverRequests) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.DriverRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
+ {
+ size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
}
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- if m.Shareable {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x18
- if m.GeneratedFrom != nil {
- {
- size, err := m.GeneratedFrom.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ dAtA[i] = 0x1a
+ {
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
}
- i--
- dAtA[i] = 0x12
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
}
+ i--
+ dAtA[i] = 0x12
{
size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@@ -2397,7 +2184,7 @@ func (m *ResourceClaimParameters) MarshalToSizedBuffer(dAtA []byte) (int, error)
return len(dAtA) - i, nil
}
-func (m *ResourceClaimParametersList) Marshal() (dAtA []byte, err error) {
+func (m *PodSchedulingContextList) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2407,12 +2194,12 @@ func (m *ResourceClaimParametersList) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClaimParametersList) MarshalTo(dAtA []byte) (int, error) {
+func (m *PodSchedulingContextList) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClaimParametersList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *PodSchedulingContextList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@@ -2444,7 +2231,7 @@ func (m *ResourceClaimParametersList) MarshalToSizedBuffer(dAtA []byte) (int, er
return len(dAtA) - i, nil
}
-func (m *ResourceClaimParametersReference) Marshal() (dAtA []byte, err error) {
+func (m *PodSchedulingContextSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2454,35 +2241,34 @@ func (m *ResourceClaimParametersReference) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClaimParametersReference) MarshalTo(dAtA []byte) (int, error) {
+func (m *PodSchedulingContextSpec) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClaimParametersReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *PodSchedulingContextSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0x1a
- i -= len(m.Kind)
- copy(dAtA[i:], m.Kind)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind)))
- i--
- dAtA[i] = 0x12
- i -= len(m.APIGroup)
- copy(dAtA[i:], m.APIGroup)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup)))
+ if len(m.PotentialNodes) > 0 {
+ for iNdEx := len(m.PotentialNodes) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.PotentialNodes[iNdEx])
+ copy(dAtA[i:], m.PotentialNodes[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.PotentialNodes[iNdEx])))
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ i -= len(m.SelectedNode)
+ copy(dAtA[i:], m.SelectedNode)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.SelectedNode)))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *ResourceClaimSchedulingStatus) Marshal() (dAtA []byte, err error) {
+func (m *PodSchedulingContextStatus) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2492,7 +2278,187 @@ func (m *ResourceClaimSchedulingStatus) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClaimSchedulingStatus) MarshalTo(dAtA []byte) (int, error) {
+func (m *PodSchedulingContextStatus) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *PodSchedulingContextStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.ResourceClaims) > 0 {
+ for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *ResourceClaim) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceClaim) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
+ {
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ {
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceClaimConsumerReference) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ResourceClaimConsumerReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.UID)
+ copy(dAtA[i:], m.UID)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID)))
+ i--
+ dAtA[i] = 0x2a
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
+ i--
+ dAtA[i] = 0x22
+ i -= len(m.Resource)
+ copy(dAtA[i:], m.Resource)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource)))
+ i--
+ dAtA[i] = 0x1a
+ i -= len(m.APIGroup)
+ copy(dAtA[i:], m.APIGroup)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceClaimList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Items) > 0 {
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *ResourceClaimSchedulingStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ResourceClaimSchedulingStatus) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
@@ -2539,26 +2505,19 @@ func (m *ResourceClaimSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
- i -= len(m.AllocationMode)
- copy(dAtA[i:], m.AllocationMode)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllocationMode)))
+ i -= len(m.Controller)
+ copy(dAtA[i:], m.Controller)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Controller)))
i--
- dAtA[i] = 0x1a
- if m.ParametersRef != nil {
- {
- size, err := m.ParametersRef.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ dAtA[i] = 0x12
+ {
+ size, err := m.Devices.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
}
- i--
- dAtA[i] = 0x12
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
}
- i -= len(m.ResourceClassName)
- copy(dAtA[i:], m.ResourceClassName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceClassName)))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
@@ -2591,7 +2550,7 @@ func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
dAtA[i] = 0
}
i--
- dAtA[i] = 0x20
+ dAtA[i] = 0x18
if len(m.ReservedFor) > 0 {
for iNdEx := len(m.ReservedFor) - 1; iNdEx >= 0; iNdEx-- {
{
@@ -2603,7 +2562,7 @@ func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x1a
+ dAtA[i] = 0x12
}
}
if m.Allocation != nil {
@@ -2616,13 +2575,8 @@ func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0x12
+ dAtA[i] = 0xa
}
- i -= len(m.DriverName)
- copy(dAtA[i:], m.DriverName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
- i--
- dAtA[i] = 0xa
return len(dAtA) - i, nil
}
@@ -2759,7 +2713,7 @@ func (m *ResourceClaimTemplateSpec) MarshalToSizedBuffer(dAtA []byte) (int, erro
return len(dAtA) - i, nil
}
-func (m *ResourceClass) Marshal() (dAtA []byte, err error) {
+func (m *ResourcePool) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2769,69 +2723,31 @@ func (m *ResourceClass) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClass) MarshalTo(dAtA []byte) (int, error) {
+func (m *ResourcePool) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *ResourcePool) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if m.StructuredParameters != nil {
- i--
- if *m.StructuredParameters {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x28
- }
- if m.SuitableNodes != nil {
- {
- size, err := m.SuitableNodes.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- if m.ParametersRef != nil {
- {
- size, err := m.ParametersRef.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- i -= len(m.DriverName)
- copy(dAtA[i:], m.DriverName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
+ i = encodeVarintGenerated(dAtA, i, uint64(m.ResourceSliceCount))
i--
- dAtA[i] = 0x12
- {
- size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
+ dAtA[i] = 0x18
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Generation))
+ i--
+ dAtA[i] = 0x10
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *ResourceClassList) Marshal() (dAtA []byte, err error) {
+func (m *ResourceSlice) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2841,32 +2757,18 @@ func (m *ResourceClassList) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClassList) MarshalTo(dAtA []byte) (int, error) {
+func (m *ResourceSlice) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *ResourceSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- if len(m.Items) > 0 {
- for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- }
{
- size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -2874,70 +2776,7 @@ func (m *ResourceClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ResourceClassParameters) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *ResourceClassParameters) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ResourceClassParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- }
- if len(m.VendorParameters) > 0 {
- for iNdEx := len(m.VendorParameters) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.VendorParameters[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- }
- if m.GeneratedFrom != nil {
- {
- size, err := m.GeneratedFrom.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
+ dAtA[i] = 0x12
{
size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@@ -2951,7 +2790,7 @@ func (m *ResourceClassParameters) MarshalToSizedBuffer(dAtA []byte) (int, error)
return len(dAtA) - i, nil
}
-func (m *ResourceClassParametersList) Marshal() (dAtA []byte, err error) {
+func (m *ResourceSliceList) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -2961,12 +2800,12 @@ func (m *ResourceClassParametersList) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClassParametersList) MarshalTo(dAtA []byte) (int, error) {
+func (m *ResourceSliceList) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClassParametersList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *ResourceSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@@ -2998,7 +2837,7 @@ func (m *ResourceClassParametersList) MarshalToSizedBuffer(dAtA []byte) (int, er
return len(dAtA) - i, nil
}
-func (m *ResourceClassParametersReference) Marshal() (dAtA []byte, err error) {
+func (m *ResourceSliceSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -3008,61 +2847,57 @@ func (m *ResourceClassParametersReference) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
-func (m *ResourceClassParametersReference) MarshalTo(dAtA []byte) (int, error) {
+func (m *ResourceSliceSpec) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *ResourceClassParametersReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
- i -= len(m.Namespace)
- copy(dAtA[i:], m.Namespace)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace)))
- i--
- dAtA[i] = 0x22
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0x1a
- i -= len(m.Kind)
- copy(dAtA[i:], m.Kind)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind)))
+ if len(m.Devices) > 0 {
+ for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x32
+ }
+ }
i--
- dAtA[i] = 0x12
- i -= len(m.APIGroup)
- copy(dAtA[i:], m.APIGroup)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup)))
+ if m.AllNodes {
+ dAtA[i] = 1
+ } else {
+ dAtA[i] = 0
+ }
i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ResourceFilter) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+ dAtA[i] = 0x28
+ if m.NodeSelector != nil {
+ {
+ size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x22
}
- return dAtA[:n], nil
-}
-
-func (m *ResourceFilter) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ResourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
+ i -= len(m.NodeName)
+ copy(dAtA[i:], m.NodeName)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName)))
+ i--
+ dAtA[i] = 0x1a
{
- size, err := m.ResourceFilterModel.MarshalToSizedBuffer(dAtA[:i])
+ size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -3071,625 +2906,366 @@ func (m *ResourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) {
}
i--
dAtA[i] = 0x12
- i -= len(m.DriverName)
- copy(dAtA[i:], m.DriverName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
+ i -= len(m.Driver)
+ copy(dAtA[i:], m.Driver)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver)))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
-func (m *ResourceFilterModel) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ offset -= sovGenerated(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
}
- return dAtA[:n], nil
+ dAtA[offset] = uint8(v)
+ return base
}
-
-func (m *ResourceFilterModel) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
+func (m *AllocationResult) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Devices.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.NodeSelector != nil {
+ l = m.NodeSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ l = len(m.Controller)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
}
-func (m *ResourceFilterModel) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
+func (m *BasicDevice) Size() (n int) {
+ if m == nil {
+ return 0
+ }
var l int
_ = l
- if m.NamedResources != nil {
- {
- size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ if len(m.Attributes) > 0 {
+ for k, v := range m.Attributes {
+ _ = k
+ _ = v
+ l = v.Size()
+ mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l))
+ n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
}
- i--
- dAtA[i] = 0xa
}
- return len(dAtA) - i, nil
+ if len(m.Capacity) > 0 {
+ for k, v := range m.Capacity {
+ _ = k
+ _ = v
+ l = v.Size()
+ mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l))
+ n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
+ }
+ }
+ return n
}
-func (m *ResourceHandle) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+func (m *CELDeviceSelector) Size() (n int) {
+ if m == nil {
+ return 0
}
- return dAtA[:n], nil
+ var l int
+ _ = l
+ l = len(m.Expression)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
}
-func (m *ResourceHandle) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
+func (m *Device) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ if m.Basic != nil {
+ l = m.Basic.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
}
-func (m *ResourceHandle) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
+func (m *DeviceAllocationConfiguration) Size() (n int) {
+ if m == nil {
+ return 0
+ }
var l int
_ = l
- if m.StructuredData != nil {
- {
- size, err := m.StructuredData.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ l = len(m.Source)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Requests) > 0 {
+ for _, s := range m.Requests {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
}
- i--
- dAtA[i] = 0x2a
}
- i -= len(m.Data)
- copy(dAtA[i:], m.Data)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.Data)))
- i--
- dAtA[i] = 0x12
- i -= len(m.DriverName)
- copy(dAtA[i:], m.DriverName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
+ l = m.DeviceConfiguration.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
}
-func (m *ResourceModel) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+func (m *DeviceAllocationResult) Size() (n int) {
+ if m == nil {
+ return 0
}
- return dAtA[:n], nil
-}
-
-func (m *ResourceModel) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ResourceModel) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
var l int
_ = l
- if m.NamedResources != nil {
- {
- size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ if len(m.Results) > 0 {
+ for _, e := range m.Results {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
}
- i--
- dAtA[i] = 0xa
}
- return len(dAtA) - i, nil
+ if len(m.Config) > 0 {
+ for _, e := range m.Config {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
}
-func (m *ResourceRequest) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+func (m *DeviceAttribute) Size() (n int) {
+ if m == nil {
+ return 0
}
- return dAtA[:n], nil
-}
-
-func (m *ResourceRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
+ var l int
+ _ = l
+ if m.IntValue != nil {
+ n += 1 + sovGenerated(uint64(*m.IntValue))
+ }
+ if m.BoolValue != nil {
+ n += 2
+ }
+ if m.StringValue != nil {
+ l = len(*m.StringValue)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.VersionValue != nil {
+ l = len(*m.VersionValue)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
}
-func (m *ResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
+func (m *DeviceClaim) Size() (n int) {
+ if m == nil {
+ return 0
+ }
var l int
_ = l
- {
- size, err := m.ResourceRequestModel.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
+ if len(m.Requests) > 0 {
+ for _, e := range m.Requests {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
}
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
}
- i--
- dAtA[i] = 0x12
- {
- size, err := m.VendorParameters.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
+ if len(m.Constraints) > 0 {
+ for _, e := range m.Constraints {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
}
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
}
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ResourceRequestModel) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+ if len(m.Config) > 0 {
+ for _, e := range m.Config {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
}
- return dAtA[:n], nil
-}
-
-func (m *ResourceRequestModel) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
+ return n
}
-func (m *ResourceRequestModel) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
+func (m *DeviceClaimConfiguration) Size() (n int) {
+ if m == nil {
+ return 0
+ }
var l int
_ = l
- if m.NamedResources != nil {
- {
- size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
+ if len(m.Requests) > 0 {
+ for _, s := range m.Requests {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
}
- i--
- dAtA[i] = 0xa
}
- return len(dAtA) - i, nil
+ l = m.DeviceConfiguration.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
}
-func (m *ResourceSlice) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+func (m *DeviceClass) Size() (n int) {
+ if m == nil {
+ return 0
}
- return dAtA[:n], nil
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
}
-func (m *ResourceSlice) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
+func (m *DeviceClassConfiguration) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.DeviceConfiguration.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
}
-func (m *ResourceSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
+func (m *DeviceClassList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
var l int
_ = l
- {
- size, err := m.ResourceModel.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- i -= len(m.DriverName)
- copy(dAtA[i:], m.DriverName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
- i--
- dAtA[i] = 0x1a
- i -= len(m.NodeName)
- copy(dAtA[i:], m.NodeName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName)))
- i--
- dAtA[i] = 0x12
- {
- size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
}
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
}
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
+ return n
}
-func (m *ResourceSliceList) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+func (m *DeviceClassSpec) Size() (n int) {
+ if m == nil {
+ return 0
}
- return dAtA[:n], nil
-}
-
-func (m *ResourceSliceList) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ResourceSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
var l int
_ = l
- if len(m.Items) > 0 {
- for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
+ if len(m.Selectors) > 0 {
+ for _, e := range m.Selectors {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
}
}
- {
- size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
+ if len(m.Config) > 0 {
+ for _, e := range m.Config {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
}
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
}
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
+ if m.SuitableNodes != nil {
+ l = m.SuitableNodes.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
}
-func (m *StructuredResourceHandle) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
+func (m *DeviceConfiguration) Size() (n int) {
+ if m == nil {
+ return 0
}
- return dAtA[:n], nil
+ var l int
+ _ = l
+ if m.Opaque != nil {
+ l = m.Opaque.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
}
-func (m *StructuredResourceHandle) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
+func (m *DeviceConstraint) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Requests) > 0 {
+ for _, s := range m.Requests {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ if m.MatchAttribute != nil {
+ l = len(*m.MatchAttribute)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
}
-func (m *StructuredResourceHandle) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
+func (m *DeviceRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
var l int
_ = l
- if len(m.Results) > 0 {
- for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x2a
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.DeviceClassName)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Selectors) > 0 {
+ for _, e := range m.Selectors {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
}
}
- i -= len(m.NodeName)
- copy(dAtA[i:], m.NodeName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName)))
- i--
- dAtA[i] = 0x22
- {
- size, err := m.VendorClaimParameters.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- {
- size, err := m.VendorClassParameters.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *VendorParameters) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *VendorParameters) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *VendorParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- {
- size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintGenerated(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- i -= len(m.DriverName)
- copy(dAtA[i:], m.DriverName)
- i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
- offset -= sovGenerated(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *AllocationResult) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.ResourceHandles) > 0 {
- for _, e := range m.ResourceHandles {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- if m.AvailableOnNodes != nil {
- l = m.AvailableOnNodes.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- n += 2
- return n
-}
-
-func (m *AllocationResultModel) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.NamedResources != nil {
- l = m.NamedResources.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
-func (m *DriverAllocationResult) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.VendorRequestParameters.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = m.AllocationResultModel.Size()
+ l = len(m.AllocationMode)
n += 1 + l + sovGenerated(uint64(l))
+ n += 1 + sovGenerated(uint64(m.Count))
+ n += 2
return n
}
-func (m *DriverRequests) Size() (n int) {
+func (m *DeviceRequestAllocationResult) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- l = len(m.DriverName)
+ l = len(m.Request)
n += 1 + l + sovGenerated(uint64(l))
- l = m.VendorParameters.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if len(m.Requests) > 0 {
- for _, e := range m.Requests {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *NamedResourcesAllocationResult) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
+ l = len(m.Driver)
n += 1 + l + sovGenerated(uint64(l))
- return n
-}
-
-func (m *NamedResourcesAttribute) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
+ l = len(m.Pool)
n += 1 + l + sovGenerated(uint64(l))
- l = m.NamedResourcesAttributeValue.Size()
+ l = len(m.Device)
n += 1 + l + sovGenerated(uint64(l))
return n
}
-func (m *NamedResourcesAttributeValue) Size() (n int) {
+func (m *DeviceSelector) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- if m.BoolValue != nil {
- n += 2
- }
- if m.StringValue != nil {
- l = len(*m.StringValue)
+ if m.CEL != nil {
+ l = m.CEL.Size()
n += 1 + l + sovGenerated(uint64(l))
}
- if m.QuantityValue != nil {
- l = m.QuantityValue.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- if m.IntValue != nil {
- n += 1 + sovGenerated(uint64(*m.IntValue))
- }
- if m.IntSliceValue != nil {
- l = m.IntSliceValue.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- if m.StringSliceValue != nil {
- l = m.StringSliceValue.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- if m.VersionValue != nil {
- l = len(*m.VersionValue)
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
-func (m *NamedResourcesFilter) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Selector)
- n += 1 + l + sovGenerated(uint64(l))
return n
}
-func (m *NamedResourcesInstance) Size() (n int) {
+func (m *OpaqueDeviceConfiguration) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- l = len(m.Name)
+ l = len(m.Driver)
n += 1 + l + sovGenerated(uint64(l))
- if len(m.Attributes) > 0 {
- for _, e := range m.Attributes {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *NamedResourcesIntSlice) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Ints) > 0 {
- for _, e := range m.Ints {
- n += 1 + sovGenerated(uint64(e))
- }
- }
- return n
-}
-
-func (m *NamedResourcesRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Selector)
+ l = m.Parameters.Size()
n += 1 + l + sovGenerated(uint64(l))
return n
}
-func (m *NamedResourcesResources) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Instances) > 0 {
- for _, e := range m.Instances {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *NamedResourcesStringSlice) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Strings) > 0 {
- for _, s := range m.Strings {
- l = len(s)
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
func (m *PodSchedulingContext) Size() (n int) {
if m == nil {
return 0
@@ -3803,60 +3379,6 @@ func (m *ResourceClaimList) Size() (n int) {
return n
}
-func (m *ResourceClaimParameters) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.ObjectMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if m.GeneratedFrom != nil {
- l = m.GeneratedFrom.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- n += 2
- if len(m.DriverRequests) > 0 {
- for _, e := range m.DriverRequests {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *ResourceClaimParametersList) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.ListMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if len(m.Items) > 0 {
- for _, e := range m.Items {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *ResourceClaimParametersReference) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.APIGroup)
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.Kind)
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.Name)
- n += 1 + l + sovGenerated(uint64(l))
- return n
-}
-
func (m *ResourceClaimSchedulingStatus) Size() (n int) {
if m == nil {
return 0
@@ -3880,13 +3402,9 @@ func (m *ResourceClaimSpec) Size() (n int) {
}
var l int
_ = l
- l = len(m.ResourceClassName)
+ l = m.Devices.Size()
n += 1 + l + sovGenerated(uint64(l))
- if m.ParametersRef != nil {
- l = m.ParametersRef.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- l = len(m.AllocationMode)
+ l = len(m.Controller)
n += 1 + l + sovGenerated(uint64(l))
return n
}
@@ -3897,8 +3415,6 @@ func (m *ResourceClaimStatus) Size() (n int) {
}
var l int
_ = l
- l = len(m.DriverName)
- n += 1 + l + sovGenerated(uint64(l))
if m.Allocation != nil {
l = m.Allocation.Size()
n += 1 + l + sovGenerated(uint64(l))
@@ -3956,187 +3472,16 @@ func (m *ResourceClaimTemplateSpec) Size() (n int) {
return n
}
-func (m *ResourceClass) Size() (n int) {
+func (m *ResourcePool) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- l = m.ObjectMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.DriverName)
+ l = len(m.Name)
n += 1 + l + sovGenerated(uint64(l))
- if m.ParametersRef != nil {
- l = m.ParametersRef.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- if m.SuitableNodes != nil {
- l = m.SuitableNodes.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- if m.StructuredParameters != nil {
- n += 2
- }
- return n
-}
-
-func (m *ResourceClassList) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.ListMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if len(m.Items) > 0 {
- for _, e := range m.Items {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *ResourceClassParameters) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.ObjectMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if m.GeneratedFrom != nil {
- l = m.GeneratedFrom.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- if len(m.VendorParameters) > 0 {
- for _, e := range m.VendorParameters {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- if len(m.Filters) > 0 {
- for _, e := range m.Filters {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *ResourceClassParametersList) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.ListMeta.Size()
- n += 1 + l + sovGenerated(uint64(l))
- if len(m.Items) > 0 {
- for _, e := range m.Items {
- l = e.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- }
- return n
-}
-
-func (m *ResourceClassParametersReference) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.APIGroup)
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.Kind)
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.Name)
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.Namespace)
- n += 1 + l + sovGenerated(uint64(l))
- return n
-}
-
-func (m *ResourceFilter) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.DriverName)
- n += 1 + l + sovGenerated(uint64(l))
- l = m.ResourceFilterModel.Size()
- n += 1 + l + sovGenerated(uint64(l))
- return n
-}
-
-func (m *ResourceFilterModel) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.NamedResources != nil {
- l = m.NamedResources.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
-func (m *ResourceHandle) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.DriverName)
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.Data)
- n += 1 + l + sovGenerated(uint64(l))
- if m.StructuredData != nil {
- l = m.StructuredData.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
-func (m *ResourceModel) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.NamedResources != nil {
- l = m.NamedResources.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
- return n
-}
-
-func (m *ResourceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.VendorParameters.Size()
- n += 1 + l + sovGenerated(uint64(l))
- l = m.ResourceRequestModel.Size()
- n += 1 + l + sovGenerated(uint64(l))
- return n
-}
-
-func (m *ResourceRequestModel) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.NamedResources != nil {
- l = m.NamedResources.Size()
- n += 1 + l + sovGenerated(uint64(l))
- }
+ n += 1 + sovGenerated(uint64(m.Generation))
+ n += 1 + sovGenerated(uint64(m.ResourceSliceCount))
return n
}
@@ -4148,11 +3493,7 @@ func (m *ResourceSlice) Size() (n int) {
_ = l
l = m.ObjectMeta.Size()
n += 1 + l + sovGenerated(uint64(l))
- l = len(m.NodeName)
- n += 1 + l + sovGenerated(uint64(l))
- l = len(m.DriverName)
- n += 1 + l + sovGenerated(uint64(l))
- l = m.ResourceModel.Size()
+ l = m.Spec.Size()
n += 1 + l + sovGenerated(uint64(l))
return n
}
@@ -4174,20 +3515,25 @@ func (m *ResourceSliceList) Size() (n int) {
return n
}
-func (m *StructuredResourceHandle) Size() (n int) {
+func (m *ResourceSliceSpec) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
- l = m.VendorClassParameters.Size()
+ l = len(m.Driver)
n += 1 + l + sovGenerated(uint64(l))
- l = m.VendorClaimParameters.Size()
+ l = m.Pool.Size()
n += 1 + l + sovGenerated(uint64(l))
l = len(m.NodeName)
n += 1 + l + sovGenerated(uint64(l))
- if len(m.Results) > 0 {
- for _, e := range m.Results {
+ if m.NodeSelector != nil {
+ l = m.NodeSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ n += 2
+ if len(m.Devices) > 0 {
+ for _, e := range m.Devices {
l = e.Size()
n += 1 + l + sovGenerated(uint64(l))
}
@@ -4195,19 +3541,6 @@ func (m *StructuredResourceHandle) Size() (n int) {
return n
}
-func (m *VendorParameters) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.DriverName)
- n += 1 + l + sovGenerated(uint64(l))
- l = m.Parameters.Size()
- n += 1 + l + sovGenerated(uint64(l))
- return n
-}
-
func sovGenerated(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -4218,161 +3551,280 @@ func (this *AllocationResult) String() string {
if this == nil {
return "nil"
}
- repeatedStringForResourceHandles := "[]ResourceHandle{"
- for _, f := range this.ResourceHandles {
- repeatedStringForResourceHandles += strings.Replace(strings.Replace(f.String(), "ResourceHandle", "ResourceHandle", 1), `&`, ``, 1) + ","
- }
- repeatedStringForResourceHandles += "}"
s := strings.Join([]string{`&AllocationResult{`,
- `ResourceHandles:` + repeatedStringForResourceHandles + `,`,
- `AvailableOnNodes:` + strings.Replace(fmt.Sprintf("%v", this.AvailableOnNodes), "NodeSelector", "v1.NodeSelector", 1) + `,`,
- `Shareable:` + fmt.Sprintf("%v", this.Shareable) + `,`,
+ `Devices:` + strings.Replace(strings.Replace(this.Devices.String(), "DeviceAllocationResult", "DeviceAllocationResult", 1), `&`, ``, 1) + `,`,
+ `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v1.NodeSelector", 1) + `,`,
+ `Controller:` + fmt.Sprintf("%v", this.Controller) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *BasicDevice) String() string {
+ if this == nil {
+ return "nil"
+ }
+ keysForAttributes := make([]string, 0, len(this.Attributes))
+ for k := range this.Attributes {
+ keysForAttributes = append(keysForAttributes, string(k))
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForAttributes)
+ mapStringForAttributes := "map[QualifiedName]DeviceAttribute{"
+ for _, k := range keysForAttributes {
+ mapStringForAttributes += fmt.Sprintf("%v: %v,", k, this.Attributes[QualifiedName(k)])
+ }
+ mapStringForAttributes += "}"
+ keysForCapacity := make([]string, 0, len(this.Capacity))
+ for k := range this.Capacity {
+ keysForCapacity = append(keysForCapacity, string(k))
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ mapStringForCapacity := "map[QualifiedName]resource.Quantity{"
+ for _, k := range keysForCapacity {
+ mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[QualifiedName(k)])
+ }
+ mapStringForCapacity += "}"
+ s := strings.Join([]string{`&BasicDevice{`,
+ `Attributes:` + mapStringForAttributes + `,`,
+ `Capacity:` + mapStringForCapacity + `,`,
`}`,
}, "")
return s
}
-func (this *AllocationResultModel) String() string {
+func (this *CELDeviceSelector) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&AllocationResultModel{`,
- `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesAllocationResult", "NamedResourcesAllocationResult", 1) + `,`,
+ s := strings.Join([]string{`&CELDeviceSelector{`,
+ `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`,
`}`,
}, "")
return s
}
-func (this *DriverAllocationResult) String() string {
+func (this *Device) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&DriverAllocationResult{`,
- `VendorRequestParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorRequestParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`,
- `AllocationResultModel:` + strings.Replace(strings.Replace(this.AllocationResultModel.String(), "AllocationResultModel", "AllocationResultModel", 1), `&`, ``, 1) + `,`,
+ s := strings.Join([]string{`&Device{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Basic:` + strings.Replace(this.Basic.String(), "BasicDevice", "BasicDevice", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *DeviceAllocationConfiguration) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&DeviceAllocationConfiguration{`,
+ `Source:` + fmt.Sprintf("%v", this.Source) + `,`,
+ `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`,
+ `DeviceConfiguration:` + strings.Replace(strings.Replace(this.DeviceConfiguration.String(), "DeviceConfiguration", "DeviceConfiguration", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *DeviceAllocationResult) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForResults := "[]DeviceRequestAllocationResult{"
+ for _, f := range this.Results {
+ repeatedStringForResults += strings.Replace(strings.Replace(f.String(), "DeviceRequestAllocationResult", "DeviceRequestAllocationResult", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForResults += "}"
+ repeatedStringForConfig := "[]DeviceAllocationConfiguration{"
+ for _, f := range this.Config {
+ repeatedStringForConfig += strings.Replace(strings.Replace(f.String(), "DeviceAllocationConfiguration", "DeviceAllocationConfiguration", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForConfig += "}"
+ s := strings.Join([]string{`&DeviceAllocationResult{`,
+ `Results:` + repeatedStringForResults + `,`,
+ `Config:` + repeatedStringForConfig + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *DeviceAttribute) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&DeviceAttribute{`,
+ `IntValue:` + valueToStringGenerated(this.IntValue) + `,`,
+ `BoolValue:` + valueToStringGenerated(this.BoolValue) + `,`,
+ `StringValue:` + valueToStringGenerated(this.StringValue) + `,`,
+ `VersionValue:` + valueToStringGenerated(this.VersionValue) + `,`,
`}`,
}, "")
return s
}
-func (this *DriverRequests) String() string {
+func (this *DeviceClaim) String() string {
if this == nil {
return "nil"
}
- repeatedStringForRequests := "[]ResourceRequest{"
+ repeatedStringForRequests := "[]DeviceRequest{"
for _, f := range this.Requests {
- repeatedStringForRequests += strings.Replace(strings.Replace(f.String(), "ResourceRequest", "ResourceRequest", 1), `&`, ``, 1) + ","
+ repeatedStringForRequests += strings.Replace(strings.Replace(f.String(), "DeviceRequest", "DeviceRequest", 1), `&`, ``, 1) + ","
}
repeatedStringForRequests += "}"
- s := strings.Join([]string{`&DriverRequests{`,
- `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
- `VendorParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`,
+ repeatedStringForConstraints := "[]DeviceConstraint{"
+ for _, f := range this.Constraints {
+ repeatedStringForConstraints += strings.Replace(strings.Replace(f.String(), "DeviceConstraint", "DeviceConstraint", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForConstraints += "}"
+ repeatedStringForConfig := "[]DeviceClaimConfiguration{"
+ for _, f := range this.Config {
+ repeatedStringForConfig += strings.Replace(strings.Replace(f.String(), "DeviceClaimConfiguration", "DeviceClaimConfiguration", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForConfig += "}"
+ s := strings.Join([]string{`&DeviceClaim{`,
`Requests:` + repeatedStringForRequests + `,`,
+ `Constraints:` + repeatedStringForConstraints + `,`,
+ `Config:` + repeatedStringForConfig + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesAllocationResult) String() string {
+func (this *DeviceClaimConfiguration) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&NamedResourcesAllocationResult{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ s := strings.Join([]string{`&DeviceClaimConfiguration{`,
+ `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`,
+ `DeviceConfiguration:` + strings.Replace(strings.Replace(this.DeviceConfiguration.String(), "DeviceConfiguration", "DeviceConfiguration", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesAttribute) String() string {
+func (this *DeviceClass) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&NamedResourcesAttribute{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `NamedResourcesAttributeValue:` + strings.Replace(strings.Replace(this.NamedResourcesAttributeValue.String(), "NamedResourcesAttributeValue", "NamedResourcesAttributeValue", 1), `&`, ``, 1) + `,`,
+ s := strings.Join([]string{`&DeviceClass{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "DeviceClassSpec", "DeviceClassSpec", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesAttributeValue) String() string {
+func (this *DeviceClassConfiguration) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&NamedResourcesAttributeValue{`,
- `BoolValue:` + valueToStringGenerated(this.BoolValue) + `,`,
- `StringValue:` + valueToStringGenerated(this.StringValue) + `,`,
- `QuantityValue:` + strings.Replace(fmt.Sprintf("%v", this.QuantityValue), "Quantity", "resource.Quantity", 1) + `,`,
- `IntValue:` + valueToStringGenerated(this.IntValue) + `,`,
- `IntSliceValue:` + strings.Replace(this.IntSliceValue.String(), "NamedResourcesIntSlice", "NamedResourcesIntSlice", 1) + `,`,
- `StringSliceValue:` + strings.Replace(this.StringSliceValue.String(), "NamedResourcesStringSlice", "NamedResourcesStringSlice", 1) + `,`,
- `VersionValue:` + valueToStringGenerated(this.VersionValue) + `,`,
+ s := strings.Join([]string{`&DeviceClassConfiguration{`,
+ `DeviceConfiguration:` + strings.Replace(strings.Replace(this.DeviceConfiguration.String(), "DeviceConfiguration", "DeviceConfiguration", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesFilter) String() string {
+func (this *DeviceClassList) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&NamedResourcesFilter{`,
- `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`,
+ repeatedStringForItems := "[]DeviceClass{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "DeviceClass", "DeviceClass", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&DeviceClassList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesInstance) String() string {
+func (this *DeviceClassSpec) String() string {
if this == nil {
return "nil"
}
- repeatedStringForAttributes := "[]NamedResourcesAttribute{"
- for _, f := range this.Attributes {
- repeatedStringForAttributes += strings.Replace(strings.Replace(f.String(), "NamedResourcesAttribute", "NamedResourcesAttribute", 1), `&`, ``, 1) + ","
+ repeatedStringForSelectors := "[]DeviceSelector{"
+ for _, f := range this.Selectors {
+ repeatedStringForSelectors += strings.Replace(strings.Replace(f.String(), "DeviceSelector", "DeviceSelector", 1), `&`, ``, 1) + ","
}
- repeatedStringForAttributes += "}"
- s := strings.Join([]string{`&NamedResourcesInstance{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Attributes:` + repeatedStringForAttributes + `,`,
+ repeatedStringForSelectors += "}"
+ repeatedStringForConfig := "[]DeviceClassConfiguration{"
+ for _, f := range this.Config {
+ repeatedStringForConfig += strings.Replace(strings.Replace(f.String(), "DeviceClassConfiguration", "DeviceClassConfiguration", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForConfig += "}"
+ s := strings.Join([]string{`&DeviceClassSpec{`,
+ `Selectors:` + repeatedStringForSelectors + `,`,
+ `Config:` + repeatedStringForConfig + `,`,
+ `SuitableNodes:` + strings.Replace(fmt.Sprintf("%v", this.SuitableNodes), "NodeSelector", "v1.NodeSelector", 1) + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesIntSlice) String() string {
+func (this *DeviceConfiguration) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&NamedResourcesIntSlice{`,
- `Ints:` + fmt.Sprintf("%v", this.Ints) + `,`,
+ s := strings.Join([]string{`&DeviceConfiguration{`,
+ `Opaque:` + strings.Replace(this.Opaque.String(), "OpaqueDeviceConfiguration", "OpaqueDeviceConfiguration", 1) + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesRequest) String() string {
+func (this *DeviceConstraint) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&NamedResourcesRequest{`,
- `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`,
+ s := strings.Join([]string{`&DeviceConstraint{`,
+ `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`,
+ `MatchAttribute:` + valueToStringGenerated(this.MatchAttribute) + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesResources) String() string {
+func (this *DeviceRequest) String() string {
if this == nil {
return "nil"
}
- repeatedStringForInstances := "[]NamedResourcesInstance{"
- for _, f := range this.Instances {
- repeatedStringForInstances += strings.Replace(strings.Replace(f.String(), "NamedResourcesInstance", "NamedResourcesInstance", 1), `&`, ``, 1) + ","
+ repeatedStringForSelectors := "[]DeviceSelector{"
+ for _, f := range this.Selectors {
+ repeatedStringForSelectors += strings.Replace(strings.Replace(f.String(), "DeviceSelector", "DeviceSelector", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForSelectors += "}"
+ s := strings.Join([]string{`&DeviceRequest{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`,
+ `Selectors:` + repeatedStringForSelectors + `,`,
+ `AllocationMode:` + fmt.Sprintf("%v", this.AllocationMode) + `,`,
+ `Count:` + fmt.Sprintf("%v", this.Count) + `,`,
+ `AdminAccess:` + fmt.Sprintf("%v", this.AdminAccess) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *DeviceRequestAllocationResult) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&DeviceRequestAllocationResult{`,
+ `Request:` + fmt.Sprintf("%v", this.Request) + `,`,
+ `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`,
+ `Pool:` + fmt.Sprintf("%v", this.Pool) + `,`,
+ `Device:` + fmt.Sprintf("%v", this.Device) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *DeviceSelector) String() string {
+ if this == nil {
+ return "nil"
}
- repeatedStringForInstances += "}"
- s := strings.Join([]string{`&NamedResourcesResources{`,
- `Instances:` + repeatedStringForInstances + `,`,
+ s := strings.Join([]string{`&DeviceSelector{`,
+ `CEL:` + strings.Replace(this.CEL.String(), "CELDeviceSelector", "CELDeviceSelector", 1) + `,`,
`}`,
}, "")
return s
}
-func (this *NamedResourcesStringSlice) String() string {
+func (this *OpaqueDeviceConfiguration) String() string {
if this == nil {
return "nil"
}
- s := strings.Join([]string{`&NamedResourcesStringSlice{`,
- `Strings:` + fmt.Sprintf("%v", this.Strings) + `,`,
+ s := strings.Join([]string{`&OpaqueDeviceConfiguration{`,
+ `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`,
+ `Parameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Parameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
@@ -4472,52 +3924,6 @@ func (this *ResourceClaimList) String() string {
}, "")
return s
}
-func (this *ResourceClaimParameters) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForDriverRequests := "[]DriverRequests{"
- for _, f := range this.DriverRequests {
- repeatedStringForDriverRequests += strings.Replace(strings.Replace(f.String(), "DriverRequests", "DriverRequests", 1), `&`, ``, 1) + ","
- }
- repeatedStringForDriverRequests += "}"
- s := strings.Join([]string{`&ResourceClaimParameters{`,
- `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`,
- `GeneratedFrom:` + strings.Replace(this.GeneratedFrom.String(), "ResourceClaimParametersReference", "ResourceClaimParametersReference", 1) + `,`,
- `Shareable:` + fmt.Sprintf("%v", this.Shareable) + `,`,
- `DriverRequests:` + repeatedStringForDriverRequests + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceClaimParametersList) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForItems := "[]ResourceClaimParameters{"
- for _, f := range this.Items {
- repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceClaimParameters", "ResourceClaimParameters", 1), `&`, ``, 1) + ","
- }
- repeatedStringForItems += "}"
- s := strings.Join([]string{`&ResourceClaimParametersList{`,
- `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`,
- `Items:` + repeatedStringForItems + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceClaimParametersReference) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceClaimParametersReference{`,
- `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`,
- `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `}`,
- }, "")
- return s
-}
func (this *ResourceClaimSchedulingStatus) String() string {
if this == nil {
return "nil"
@@ -4534,9 +3940,8 @@ func (this *ResourceClaimSpec) String() string {
return "nil"
}
s := strings.Join([]string{`&ResourceClaimSpec{`,
- `ResourceClassName:` + fmt.Sprintf("%v", this.ResourceClassName) + `,`,
- `ParametersRef:` + strings.Replace(this.ParametersRef.String(), "ResourceClaimParametersReference", "ResourceClaimParametersReference", 1) + `,`,
- `AllocationMode:` + fmt.Sprintf("%v", this.AllocationMode) + `,`,
+ `Devices:` + strings.Replace(strings.Replace(this.Devices.String(), "DeviceClaim", "DeviceClaim", 1), `&`, ``, 1) + `,`,
+ `Controller:` + fmt.Sprintf("%v", this.Controller) + `,`,
`}`,
}, "")
return s
@@ -4551,7 +3956,6 @@ func (this *ResourceClaimStatus) String() string {
}
repeatedStringForReservedFor += "}"
s := strings.Join([]string{`&ResourceClaimStatus{`,
- `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
`Allocation:` + strings.Replace(this.Allocation.String(), "AllocationResult", "AllocationResult", 1) + `,`,
`ReservedFor:` + repeatedStringForReservedFor + `,`,
`DeallocationRequested:` + fmt.Sprintf("%v", this.DeallocationRequested) + `,`,
@@ -4597,1496 +4001,74 @@ func (this *ResourceClaimTemplateSpec) String() string {
}, "")
return s
}
-func (this *ResourceClass) String() string {
+func (this *ResourcePool) String() string {
if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceClass{`,
- `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`,
- `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
- `ParametersRef:` + strings.Replace(this.ParametersRef.String(), "ResourceClassParametersReference", "ResourceClassParametersReference", 1) + `,`,
- `SuitableNodes:` + strings.Replace(fmt.Sprintf("%v", this.SuitableNodes), "NodeSelector", "v1.NodeSelector", 1) + `,`,
- `StructuredParameters:` + valueToStringGenerated(this.StructuredParameters) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceClassList) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForItems := "[]ResourceClass{"
- for _, f := range this.Items {
- repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceClass", "ResourceClass", 1), `&`, ``, 1) + ","
- }
- repeatedStringForItems += "}"
- s := strings.Join([]string{`&ResourceClassList{`,
- `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`,
- `Items:` + repeatedStringForItems + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceClassParameters) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForVendorParameters := "[]VendorParameters{"
- for _, f := range this.VendorParameters {
- repeatedStringForVendorParameters += strings.Replace(strings.Replace(f.String(), "VendorParameters", "VendorParameters", 1), `&`, ``, 1) + ","
- }
- repeatedStringForVendorParameters += "}"
- repeatedStringForFilters := "[]ResourceFilter{"
- for _, f := range this.Filters {
- repeatedStringForFilters += strings.Replace(strings.Replace(f.String(), "ResourceFilter", "ResourceFilter", 1), `&`, ``, 1) + ","
- }
- repeatedStringForFilters += "}"
- s := strings.Join([]string{`&ResourceClassParameters{`,
- `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`,
- `GeneratedFrom:` + strings.Replace(this.GeneratedFrom.String(), "ResourceClassParametersReference", "ResourceClassParametersReference", 1) + `,`,
- `VendorParameters:` + repeatedStringForVendorParameters + `,`,
- `Filters:` + repeatedStringForFilters + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceClassParametersList) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForItems := "[]ResourceClassParameters{"
- for _, f := range this.Items {
- repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceClassParameters", "ResourceClassParameters", 1), `&`, ``, 1) + ","
- }
- repeatedStringForItems += "}"
- s := strings.Join([]string{`&ResourceClassParametersList{`,
- `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`,
- `Items:` + repeatedStringForItems + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceClassParametersReference) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceClassParametersReference{`,
- `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`,
- `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceFilter) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceFilter{`,
- `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
- `ResourceFilterModel:` + strings.Replace(strings.Replace(this.ResourceFilterModel.String(), "ResourceFilterModel", "ResourceFilterModel", 1), `&`, ``, 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceFilterModel) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceFilterModel{`,
- `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesFilter", "NamedResourcesFilter", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceHandle) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceHandle{`,
- `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
- `Data:` + fmt.Sprintf("%v", this.Data) + `,`,
- `StructuredData:` + strings.Replace(this.StructuredData.String(), "StructuredResourceHandle", "StructuredResourceHandle", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceModel) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceModel{`,
- `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesResources", "NamedResourcesResources", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceRequest{`,
- `VendorParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`,
- `ResourceRequestModel:` + strings.Replace(strings.Replace(this.ResourceRequestModel.String(), "ResourceRequestModel", "ResourceRequestModel", 1), `&`, ``, 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceRequestModel) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceRequestModel{`,
- `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesRequest", "NamedResourcesRequest", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceSlice) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResourceSlice{`,
- `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`,
- `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`,
- `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
- `ResourceModel:` + strings.Replace(strings.Replace(this.ResourceModel.String(), "ResourceModel", "ResourceModel", 1), `&`, ``, 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResourceSliceList) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForItems := "[]ResourceSlice{"
- for _, f := range this.Items {
- repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceSlice", "ResourceSlice", 1), `&`, ``, 1) + ","
- }
- repeatedStringForItems += "}"
- s := strings.Join([]string{`&ResourceSliceList{`,
- `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`,
- `Items:` + repeatedStringForItems + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *StructuredResourceHandle) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForResults := "[]DriverAllocationResult{"
- for _, f := range this.Results {
- repeatedStringForResults += strings.Replace(strings.Replace(f.String(), "DriverAllocationResult", "DriverAllocationResult", 1), `&`, ``, 1) + ","
- }
- repeatedStringForResults += "}"
- s := strings.Join([]string{`&StructuredResourceHandle{`,
- `VendorClassParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorClassParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`,
- `VendorClaimParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorClaimParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`,
- `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`,
- `Results:` + repeatedStringForResults + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *VendorParameters) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&VendorParameters{`,
- `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
- `Parameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Parameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringGenerated(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *AllocationResult) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: AllocationResult: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: AllocationResult: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceHandles", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ResourceHandles = append(m.ResourceHandles, ResourceHandle{})
- if err := m.ResourceHandles[len(m.ResourceHandles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field AvailableOnNodes", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.AvailableOnNodes == nil {
- m.AvailableOnNodes = &v1.NodeSelector{}
- }
- if err := m.AvailableOnNodes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Shareable", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Shareable = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *AllocationResultModel) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: AllocationResultModel: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: AllocationResultModel: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.NamedResources == nil {
- m.NamedResources = &NamedResourcesAllocationResult{}
- }
- if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DriverAllocationResult) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: DriverAllocationResult: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DriverAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VendorRequestParameters", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.VendorRequestParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field AllocationResultModel", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.AllocationResultModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DriverRequests) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: DriverRequests: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DriverRequests: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.DriverName = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VendorParameters", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.VendorParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Requests = append(m.Requests, ResourceRequest{})
- if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamedResourcesAllocationResult) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesAllocationResult: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamedResourcesAttribute) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesAttribute: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesAttribute: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NamedResourcesAttributeValue", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.NamedResourcesAttributeValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamedResourcesAttributeValue) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesAttributeValue: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesAttributeValue: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- b := bool(v != 0)
- m.BoolValue = &b
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- s := string(dAtA[iNdEx:postIndex])
- m.StringValue = &s
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field QuantityValue", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.QuantityValue == nil {
- m.QuantityValue = &resource.Quantity{}
- }
- if err := m.QuantityValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field IntValue", wireType)
- }
- var v int64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.IntValue = &v
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IntSliceValue", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.IntSliceValue == nil {
- m.IntSliceValue = &NamedResourcesIntSlice{}
- }
- if err := m.IntSliceValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 9:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field StringSliceValue", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.StringSliceValue == nil {
- m.StringSliceValue = &NamedResourcesStringSlice{}
- }
- if err := m.StringSliceValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 10:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VersionValue", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- s := string(dAtA[iNdEx:postIndex])
- m.VersionValue = &s
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamedResourcesFilter) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesFilter: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesFilter: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Selector = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamedResourcesInstance) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesInstance: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesInstance: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Attributes = append(m.Attributes, NamedResourcesAttribute{})
- if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamedResourcesIntSlice) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesIntSlice: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesIntSlice: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType == 0 {
- var v int64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Ints = append(m.Ints, v)
- } else if wireType == 2 {
- var packedLen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- packedLen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if packedLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + packedLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- var elementCount int
- var count int
- for _, integer := range dAtA[iNdEx:postIndex] {
- if integer < 128 {
- count++
- }
- }
- elementCount = count
- if elementCount != 0 && len(m.Ints) == 0 {
- m.Ints = make([]int64, 0, elementCount)
- }
- for iNdEx < postIndex {
- var v int64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Ints = append(m.Ints, v)
- }
- } else {
- return fmt.Errorf("proto: wrong wireType = %d for field Ints", wireType)
- }
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
+ return "nil"
}
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
+ s := strings.Join([]string{`&ResourcePool{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `Generation:` + fmt.Sprintf("%v", this.Generation) + `,`,
+ `ResourceSliceCount:` + fmt.Sprintf("%v", this.ResourceSliceCount) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ResourceSlice) String() string {
+ if this == nil {
+ return "nil"
}
- return nil
+ s := strings.Join([]string{`&ResourceSlice{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ResourceSliceSpec", "ResourceSliceSpec", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ResourceSliceList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForItems := "[]ResourceSlice{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceSlice", "ResourceSlice", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&ResourceSliceList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *ResourceSliceSpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForDevices := "[]Device{"
+ for _, f := range this.Devices {
+ repeatedStringForDevices += strings.Replace(strings.Replace(f.String(), "Device", "Device", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForDevices += "}"
+ s := strings.Join([]string{`&ResourceSliceSpec{`,
+ `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`,
+ `Pool:` + strings.Replace(strings.Replace(this.Pool.String(), "ResourcePool", "ResourcePool", 1), `&`, ``, 1) + `,`,
+ `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`,
+ `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v1.NodeSelector", 1) + `,`,
+ `AllNodes:` + fmt.Sprintf("%v", this.AllNodes) + `,`,
+ `Devices:` + repeatedStringForDevices + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
}
-func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error {
+func (m *AllocationResult) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6109,15 +4091,84 @@ func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: AllocationResult: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: AllocationResult: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Devices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.NodeSelector == nil {
+ m.NodeSelector = &v1.NodeSelector{}
+ }
+ if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -6145,7 +4196,7 @@ func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Selector = string(dAtA[iNdEx:postIndex])
+ m.Controller = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -6168,7 +4219,7 @@ func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error {
+func (m *BasicDevice) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6191,15 +4242,15 @@ func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesResources: wiretype end group for non-group")
+ return fmt.Errorf("proto: BasicDevice: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesResources: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: BasicDevice: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -6226,10 +4277,234 @@ func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Instances = append(m.Instances, NamedResourcesInstance{})
- if err := m.Instances[len(m.Instances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
+ if m.Attributes == nil {
+ m.Attributes = make(map[QualifiedName]DeviceAttribute)
+ }
+ var mapkey QualifiedName
+ mapvalue := &DeviceAttribute{}
+ for iNdEx < postIndex {
+ entryPreIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ if fieldNum == 1 {
+ var stringLenmapkey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLenmapkey |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapkey := int(stringLenmapkey)
+ if intStringLenmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapkey := iNdEx + intStringLenmapkey
+ if postStringIndexmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postStringIndexmapkey > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey])
+ iNdEx = postStringIndexmapkey
+ } else if fieldNum == 2 {
+ var mapmsglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ mapmsglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if mapmsglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postmsgIndex := iNdEx + mapmsglen
+ if postmsgIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postmsgIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapvalue = &DeviceAttribute{}
+ if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
+ return err
+ }
+ iNdEx = postmsgIndex
+ } else {
+ iNdEx = entryPreIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > postIndex {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+ m.Attributes[QualifiedName(mapkey)] = *mapvalue
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Capacity == nil {
+ m.Capacity = make(map[QualifiedName]resource.Quantity)
+ }
+ var mapkey QualifiedName
+ mapvalue := &resource.Quantity{}
+ for iNdEx < postIndex {
+ entryPreIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ if fieldNum == 1 {
+ var stringLenmapkey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLenmapkey |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapkey := int(stringLenmapkey)
+ if intStringLenmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapkey := iNdEx + intStringLenmapkey
+ if postStringIndexmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postStringIndexmapkey > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey])
+ iNdEx = postStringIndexmapkey
+ } else if fieldNum == 2 {
+ var mapmsglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ mapmsglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if mapmsglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postmsgIndex := iNdEx + mapmsglen
+ if postmsgIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postmsgIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapvalue = &resource.Quantity{}
+ if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
+ return err
+ }
+ iNdEx = postmsgIndex
+ } else {
+ iNdEx = entryPreIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > postIndex {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
}
+ m.Capacity[QualifiedName(mapkey)] = *mapvalue
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -6252,7 +4527,7 @@ func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error {
+func (m *CELDeviceSelector) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6275,15 +4550,15 @@ func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: NamedResourcesStringSlice: wiretype end group for non-group")
+ return fmt.Errorf("proto: CELDeviceSelector: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: NamedResourcesStringSlice: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: CELDeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Strings", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -6311,7 +4586,7 @@ func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Strings = append(m.Strings, string(dAtA[iNdEx:postIndex]))
+ m.Expression = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -6334,7 +4609,7 @@ func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error {
+func (m *Device) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6357,17 +4632,17 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: PodSchedulingContext: wiretype end group for non-group")
+ return fmt.Errorf("proto: Device: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: PodSchedulingContext: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6377,28 +4652,27 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -6425,40 +4699,10 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
+ if m.Basic == nil {
+ m.Basic = &BasicDevice{}
}
- if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -6483,7 +4727,7 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error {
+func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6506,17 +4750,17 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: PodSchedulingContextList: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceAllocationConfiguration: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: PodSchedulingContextList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceAllocationConfiguration: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6526,28 +4770,59 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Source = AllocationConfigSource(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -6574,8 +4849,7 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, PodSchedulingContext{})
- if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -6600,7 +4874,7 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error {
+func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6623,17 +4897,17 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: PodSchedulingContextSpec: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceAllocationResult: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: PodSchedulingContextSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SelectedNode", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6643,29 +4917,31 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.SelectedNode = string(dAtA[iNdEx:postIndex])
+ m.Results = append(m.Results, DeviceRequestAllocationResult{})
+ if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field PotentialNodes", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6675,23 +4951,25 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.PotentialNodes = append(m.PotentialNodes, string(dAtA[iNdEx:postIndex]))
+ m.Config = append(m.Config, DeviceAllocationConfiguration{})
+ if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -6714,7 +4992,7 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error {
+func (m *DeviceAttribute) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6737,17 +5015,17 @@ func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: PodSchedulingContextStatus: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceAttribute: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: PodSchedulingContextStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceAttribute: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType)
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field IntValue", wireType)
}
- var msglen int
+ var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6757,81 +5035,17 @@ func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ResourceClaims = append(m.ResourceClaims, ResourceClaimSchedulingStatus{})
- if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaim: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ m.IntValue = &v
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType)
}
- var msglen int
+ var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6841,30 +5055,18 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
+ b := bool(v != 0)
+ m.BoolValue = &b
+ case 4:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6874,30 +5076,30 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ s := string(dAtA[iNdEx:postIndex])
+ m.StringValue = &s
iNdEx = postIndex
- case 3:
+ case 5:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field VersionValue", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6907,24 +5109,24 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ s := string(dAtA[iNdEx:postIndex])
+ m.VersionValue = &s
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -6947,7 +5149,7 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error {
+func (m *DeviceClaim) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -6970,17 +5172,17 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimConsumerReference: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceClaim: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimConsumerReference: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceClaim: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -6990,61 +5192,31 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.APIGroup = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
+ m.Requests = append(m.Requests, DeviceRequest{})
+ if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
}
- m.Resource = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 4:
+ case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Constraints", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -7054,29 +5226,31 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Name = string(dAtA[iNdEx:postIndex])
+ m.Constraints = append(m.Constraints, DeviceConstraint{})
+ if err := m.Constraints[len(m.Constraints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
- case 5:
+ case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -7086,23 +5260,25 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex])
+ m.Config = append(m.Config, DeviceClaimConfiguration{})
+ if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -7125,7 +5301,7 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimList) Unmarshal(dAtA []byte) error {
+func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -7148,17 +5324,17 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimList: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceClaimConfiguration: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceClaimConfiguration: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -7168,28 +5344,27 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -7216,8 +5391,7 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, ResourceClaim{})
- if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -7242,7 +5416,7 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error {
+func (m *DeviceClass) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -7265,10 +5439,10 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimParameters: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceClass: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimParameters: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceClass: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@@ -7306,7 +5480,7 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field GeneratedFrom", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -7333,36 +5507,63 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.GeneratedFrom == nil {
- m.GeneratedFrom = &ResourceClaimParametersReference{}
- }
- if err := m.GeneratedFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Shareable", wireType)
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
}
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
}
- m.Shareable = bool(v != 0)
- case 4:
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *DeviceClassConfiguration) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: DeviceClassConfiguration: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: DeviceClassConfiguration: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverRequests", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -7389,8 +5590,7 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.DriverRequests = append(m.DriverRequests, DriverRequests{})
- if err := m.DriverRequests[len(m.DriverRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -7415,7 +5615,7 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error {
+func (m *DeviceClassList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -7438,10 +5638,10 @@ func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimParametersList: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceClassList: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimParametersList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceClassList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@@ -7506,7 +5706,7 @@ func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, ResourceClaimParameters{})
+ m.Items = append(m.Items, DeviceClass{})
if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@@ -7532,7 +5732,7 @@ func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error {
+func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -7555,17 +5755,17 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimParametersReference: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceClassSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimParametersReference: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceClassSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -7575,29 +5775,31 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.APIGroup = string(dAtA[iNdEx:postIndex])
+ m.Selectors = append(m.Selectors, DeviceSelector{})
+ if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -7607,29 +5809,117 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Config = append(m.Config, DeviceClassConfiguration{})
+ if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SuitableNodes", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
- if postIndex > l {
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.SuitableNodes == nil {
+ m.SuitableNodes = &v1.NodeSelector{}
+ }
+ if err := m.SuitableNodes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
- m.Kind = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *DeviceConfiguration) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: DeviceConfiguration: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: DeviceConfiguration: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -7639,23 +5929,27 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Name = string(dAtA[iNdEx:postIndex])
+ if m.Opaque == nil {
+ m.Opaque = &OpaqueDeviceConfiguration{}
+ }
+ if err := m.Opaque.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -7678,7 +5972,7 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error {
+func (m *DeviceConstraint) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -7701,15 +5995,15 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimSchedulingStatus: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceConstraint: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimSchedulingStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceConstraint: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -7737,11 +6031,11 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Name = string(dAtA[iNdEx:postIndex])
+ m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UnsuitableNodes", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field MatchAttribute", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -7769,7 +6063,8 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.UnsuitableNodes = append(m.UnsuitableNodes, string(dAtA[iNdEx:postIndex]))
+ s := FullyQualifiedName(dAtA[iNdEx:postIndex])
+ m.MatchAttribute = &s
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -7792,7 +6087,7 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error {
+func (m *DeviceRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -7815,15 +6110,15 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimSpec: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceClassName", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -7851,11 +6146,43 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.ResourceClassName = string(dAtA[iNdEx:postIndex])
+ m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ParametersRef", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.DeviceClassName = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -7882,14 +6209,12 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.ParametersRef == nil {
- m.ParametersRef = &ResourceClaimParametersReference{}
- }
- if err := m.ParametersRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Selectors = append(m.Selectors, DeviceSelector{})
+ if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 3:
+ case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AllocationMode", wireType)
}
@@ -7919,8 +6244,47 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.AllocationMode = AllocationMode(dAtA[iNdEx:postIndex])
+ m.AllocationMode = DeviceAllocationMode(dAtA[iNdEx:postIndex])
iNdEx = postIndex
+ case 5:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType)
+ }
+ m.Count = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Count |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 6:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AdminAccess", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.AdminAccess = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -7942,7 +6306,7 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
+func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -7965,15 +6329,15 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimStatus: wiretype end group for non-group")
+ return fmt.Errorf("proto: DeviceRequestAllocationResult: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: DeviceRequestAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -8001,13 +6365,13 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.DriverName = string(dAtA[iNdEx:postIndex])
+ m.Request = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Allocation", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8017,33 +6381,61 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.Allocation == nil {
- m.Allocation = &AllocationResult{}
+ m.Driver = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType)
}
- if err := m.Allocation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
}
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Pool = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 3:
+ case 4:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReservedFor", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8053,31 +6445,79 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.ReservedFor = append(m.ReservedFor, ResourceClaimConsumerReference{})
- if err := m.ReservedFor[len(m.ReservedFor)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Device = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
return err
}
- iNdEx = postIndex
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field DeallocationRequested", wireType)
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
}
- var v int
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *DeviceSelector) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: DeviceSelector: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: DeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field CEL", wireType)
+ }
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8087,12 +6527,28 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- v |= int(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- m.DeallocationRequested = bool(v != 0)
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.CEL == nil {
+ m.CEL = &CELDeviceSelector{}
+ }
+ if err := m.CEL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -8114,7 +6570,7 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error {
+func (m *OpaqueDeviceConfiguration) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -8137,17 +6593,17 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimTemplate: wiretype end group for non-group")
+ return fmt.Errorf("proto: OpaqueDeviceConfiguration: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimTemplate: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: OpaqueDeviceConfiguration: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8157,28 +6613,27 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Driver = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8205,7 +6660,7 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -8230,7 +6685,7 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error {
+func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -8253,15 +6708,15 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimTemplateList: wiretype end group for non-group")
+ return fmt.Errorf("proto: PodSchedulingContext: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimTemplateList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: PodSchedulingContext: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8288,13 +6743,13 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8321,8 +6776,40 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, ResourceClaimTemplate{})
- if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -8347,7 +6834,7 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error {
+func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -8370,15 +6857,15 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClaimTemplateSpec: wiretype end group for non-group")
+ return fmt.Errorf("proto: PodSchedulingContextList: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClaimTemplateSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: PodSchedulingContextList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8405,13 +6892,13 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8438,7 +6925,8 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Items = append(m.Items, PodSchedulingContext{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -8463,7 +6951,7 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClass) Unmarshal(dAtA []byte) error {
+func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -8486,17 +6974,17 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClass: wiretype end group for non-group")
+ return fmt.Errorf("proto: PodSchedulingContextSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClass: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: PodSchedulingContextSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field SelectedNode", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8506,28 +6994,27 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.SelectedNode = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field PotentialNodes", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -8555,47 +7042,61 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.DriverName = string(dAtA[iNdEx:postIndex])
+ m.PotentialNodes = append(m.PotentialNodes, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ParametersRef", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthGenerated
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
}
- postIndex := iNdEx + msglen
- if postIndex < 0 {
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenerated
}
- if postIndex > l {
+ if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
- if m.ParametersRef == nil {
- m.ParametersRef = &ResourceClassParametersReference{}
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
}
- if err := m.ParametersRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
}
- iNdEx = postIndex
- case 4:
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: PodSchedulingContextStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: PodSchedulingContextStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SuitableNodes", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8622,34 +7123,11 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.SuitableNodes == nil {
- m.SuitableNodes = &v1.NodeSelector{}
- }
- if err := m.SuitableNodes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.ResourceClaims = append(m.ResourceClaims, ResourceClaimSchedulingStatus{})
+ if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field StructuredParameters", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- b := bool(v != 0)
- m.StructuredParameters = &b
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -8671,7 +7149,7 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClassList) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaim) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -8694,15 +7172,15 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClassList: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaim: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClassList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8729,13 +7207,13 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -8762,8 +7240,40 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, ResourceClass{})
- if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -8788,7 +7298,7 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -8811,17 +7321,17 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClassParameters: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimConsumerReference: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClassParameters: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimConsumerReference: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8831,30 +7341,29 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.APIGroup = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 2:
+ case 3:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field GeneratedFrom", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8864,33 +7373,29 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.GeneratedFrom == nil {
- m.GeneratedFrom = &ResourceClassParametersReference{}
- }
- if err := m.GeneratedFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Resource = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 3:
+ case 4:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VendorParameters", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8900,31 +7405,29 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.VendorParameters = append(m.VendorParameters, VendorParameters{})
- if err := m.VendorParameters[len(m.VendorParameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 4:
+ case 5:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -8934,25 +7437,23 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Filters = append(m.Filters, ResourceFilter{})
- if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -8975,7 +7476,7 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -8998,10 +7499,10 @@ func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClassParametersList: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimList: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClassParametersList: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@@ -9066,7 +7567,7 @@ func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Items = append(m.Items, ResourceClassParameters{})
+ m.Items = append(m.Items, ResourceClaim{})
if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@@ -9092,7 +7593,7 @@ func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -9115,77 +7616,13 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceClassParametersReference: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimSchedulingStatus: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceClassParametersReference: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimSchedulingStatus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.APIGroup = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Kind = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
@@ -9217,9 +7654,9 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error {
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 4:
+ case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field UnsuitableNodes", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -9247,7 +7684,7 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Namespace = string(dAtA[iNdEx:postIndex])
+ m.UnsuitableNodes = append(m.UnsuitableNodes, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -9270,7 +7707,7 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceFilter) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -9293,17 +7730,17 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceFilter: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceFilter: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -9313,29 +7750,30 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.DriverName = string(dAtA[iNdEx:postIndex])
+ if err := m.Devices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceFilterModel", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -9345,24 +7783,23 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ResourceFilterModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Controller = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -9385,7 +7822,7 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -9408,15 +7845,15 @@ func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceFilterModel: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimStatus: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceFilterModel: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Allocation", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -9443,13 +7880,67 @@ func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.NamedResources == nil {
- m.NamedResources = &NamedResourcesFilter{}
+ if m.Allocation == nil {
+ m.Allocation = &AllocationResult{}
+ }
+ if err := m.Allocation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ReservedFor", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
}
- if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.ReservedFor = append(m.ReservedFor, ResourceClaimConsumerReference{})
+ if err := m.ReservedFor[len(m.ReservedFor)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DeallocationRequested", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.DeallocationRequested = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -9471,7 +7962,7 @@ func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceHandle) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -9494,49 +7985,17 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceHandle: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimTemplate: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceHandle: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimTemplate: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.DriverName = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -9546,27 +8005,28 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Data = string(dAtA[iNdEx:postIndex])
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
- case 5:
+ case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field StructuredData", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -9593,10 +8053,7 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.StructuredData == nil {
- m.StructuredData = &StructuredResourceHandle{}
- }
- if err := m.StructuredData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -9621,7 +8078,7 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceModel) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -9644,15 +8101,15 @@ func (m *ResourceModel) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceModel: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimTemplateList: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceModel: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimTemplateList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -9679,10 +8136,41 @@ func (m *ResourceModel) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.NamedResources == nil {
- m.NamedResources = &NamedResourcesResources{}
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
}
- if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Items = append(m.Items, ResourceClaimTemplate{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -9707,7 +8195,7 @@ func (m *ResourceModel) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceRequest) Unmarshal(dAtA []byte) error {
+func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -9730,15 +8218,15 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceClaimTemplateSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceClaimTemplateSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VendorParameters", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -9765,13 +8253,13 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.VendorParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceRequestModel", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -9798,7 +8286,7 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ResourceRequestModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -9823,7 +8311,7 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *ResourceRequestModel) Unmarshal(dAtA []byte) error {
+func (m *ResourcePool) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -9846,17 +8334,17 @@ func (m *ResourceRequestModel) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: ResourceRequestModel: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourcePool: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: ResourceRequestModel: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourcePool: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -9866,28 +8354,62 @@ func (m *ResourceRequestModel) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.NamedResources == nil {
- m.NamedResources = &NamedResourcesRequest{}
+ m.Name = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Generation", wireType)
}
- if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
+ m.Generation = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Generation |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ResourceSliceCount", wireType)
+ }
+ m.ResourceSliceCount = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.ResourceSliceCount |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
}
- iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -9973,71 +8495,7 @@ func (m *ResourceSlice) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.NodeName = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- stringLen |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.DriverName = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResourceModel", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -10064,7 +8522,7 @@ func (m *ResourceSlice) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.ResourceModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -10206,7 +8664,7 @@ func (m *ResourceSliceList) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error {
+func (m *ResourceSliceSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -10229,17 +8687,17 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: StructuredResourceHandle: wiretype end group for non-group")
+ return fmt.Errorf("proto: ResourceSliceSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: StructuredResourceHandle: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: ResourceSliceSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VendorClassParameters", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType)
}
- var msglen int
+ var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -10249,28 +8707,27 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- msglen |= int(b&0x7F) << shift
+ stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
- if msglen < 0 {
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
- postIndex := iNdEx + msglen
+ postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.VendorClassParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Driver = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VendorClaimParameters", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -10297,11 +8754,11 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.VendorClaimParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 4:
+ case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
}
@@ -10333,9 +8790,9 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error {
}
m.NodeName = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 5:
+ case 4:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -10362,66 +8819,18 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Results = append(m.Results, DriverAllocationResult{})
- if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
+ if m.NodeSelector == nil {
+ m.NodeSelector = &v1.NodeSelector{}
}
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipGenerated(dAtA[iNdEx:])
- if err != nil {
+ if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthGenerated
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *VendorParameters) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: VendorParameters: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: VendorParameters: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
+ iNdEx = postIndex
+ case 5:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AllNodes", wireType)
}
- var stringLen uint64
+ var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -10431,27 +8840,15 @@ func (m *VendorParameters) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
- return ErrInvalidLengthGenerated
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthGenerated
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.DriverName = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
+ m.AllNodes = bool(v != 0)
+ case 6:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -10478,7 +8875,8 @@ func (m *VendorParameters) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Devices = append(m.Devices, Device{})
+ if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
diff --git a/vendor/k8s.io/api/resource/v1alpha3/generated.proto b/vendor/k8s.io/api/resource/v1alpha3/generated.proto
new file mode 100644
index 00000000000..b4428ad4529
--- /dev/null
+++ b/vendor/k8s.io/api/resource/v1alpha3/generated.proto
@@ -0,0 +1,912 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+// This file was autogenerated by go-to-protobuf. Do not edit it manually!
+
+syntax = "proto2";
+
+package k8s.io.api.resource.v1alpha3;
+
+import "k8s.io/api/core/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
+import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
+
+// Package-wide variables from generator "generated".
+option go_package = "k8s.io/api/resource/v1alpha3";
+
+// AllocationResult contains attributes of an allocated resource.
+message AllocationResult {
+ // Devices is the result of allocating devices.
+ //
+ // +optional
+ optional DeviceAllocationResult devices = 1;
+
+ // NodeSelector defines where the allocated resources are available. If
+ // unset, they are available everywhere.
+ //
+ // +optional
+ optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 3;
+
+ // Controller is the name of the DRA driver which handled the
+ // allocation. That driver is also responsible for deallocating the
+ // claim. It is empty when the claim can be deallocated without
+ // involving a driver.
+ //
+ // A driver may allocate devices provided by other drivers, so this
+ // driver name here can be different from the driver names listed for
+ // the results.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ optional string controller = 4;
+}
+
+// BasicDevice defines one device instance.
+message BasicDevice {
+ // Attributes defines the set of attributes for this device.
+ // The name of each attribute must be unique in that set.
+ //
+ // The maximum number of attributes and capacities combined is 32.
+ //
+ // +optional
+ map attributes = 1;
+
+ // Capacity defines the set of capacities for this device.
+ // The name of each capacity must be unique in that set.
+ //
+ // The maximum number of attributes and capacities combined is 32.
+ //
+ // +optional
+ map capacity = 2;
+}
+
+// CELDeviceSelector contains a CEL expression for selecting a device.
+message CELDeviceSelector {
+ // Expression is a CEL expression which evaluates a single device. It
+ // must evaluate to true when the device under consideration satisfies
+ // the desired criteria, and false when it does not. Any other result
+ // is an error and causes allocation of devices to abort.
+ //
+ // The expression's input is an object named "device", which carries
+ // the following properties:
+ // - driver (string): the name of the driver which defines this device.
+ // - attributes (map[string]object): the device's attributes, grouped by prefix
+ // (e.g. device.attributes["dra.example.com"] evaluates to an object with all
+ // of the attributes which were prefixed by "dra.example.com".
+ // - capacity (map[string]object): the device's capacities, grouped by prefix.
+ //
+ // Example: Consider a device with driver="dra.example.com", which exposes
+ // two attributes named "model" and "ext.example.com/family" and which
+ // exposes one capacity named "modules". This input to this expression
+ // would have the following fields:
+ //
+ // device.driver
+ // device.attributes["dra.example.com"].model
+ // device.attributes["ext.example.com"].family
+ // device.capacity["dra.example.com"].modules
+ //
+ // The device.driver field can be used to check for a specific driver,
+ // either as a high-level precondition (i.e. you only want to consider
+ // devices from this driver) or as part of a multi-clause expression
+ // that is meant to consider devices from different drivers.
+ //
+ // The value type of each attribute is defined by the device
+ // definition, and users who write these expressions must consult the
+ // documentation for their specific drivers. The value type of each
+ // capacity is Quantity.
+ //
+ // If an unknown prefix is used as a lookup in either device.attributes
+ // or device.capacity, an empty map will be returned. Any reference to
+ // an unknown field will cause an evaluation error and allocation to
+ // abort.
+ //
+ // A robust expression should check for the existence of attributes
+ // before referencing them.
+ //
+ // For ease of use, the cel.bind() function is enabled, and can be used
+ // to simplify expressions that access multiple attributes with the
+ // same domain. For example:
+ //
+ // cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
+ //
+ // +required
+ optional string expression = 1;
+}
+
+// Device represents one individual hardware instance that can be selected based
+// on its attributes. Besides the name, exactly one field must be set.
+message Device {
+ // Name is unique identifier among all devices managed by
+ // the driver in the pool. It must be a DNS label.
+ //
+ // +required
+ optional string name = 1;
+
+ // Basic defines one device instance.
+ //
+ // +optional
+ // +oneOf=deviceType
+ optional BasicDevice basic = 2;
+}
+
+// DeviceAllocationConfiguration gets embedded in an AllocationResult.
+message DeviceAllocationConfiguration {
+ // Source records whether the configuration comes from a class and thus
+ // is not something that a normal user would have been able to set
+ // or from a claim.
+ //
+ // +required
+ optional string source = 1;
+
+ // Requests lists the names of requests where the configuration applies.
+ // If empty, its applies to all requests.
+ //
+ // +optional
+ // +listType=atomic
+ repeated string requests = 2;
+
+ optional DeviceConfiguration deviceConfiguration = 3;
+}
+
+// DeviceAllocationResult is the result of allocating devices.
+message DeviceAllocationResult {
+ // Results lists all allocated devices.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceRequestAllocationResult results = 1;
+
+ // This field is a combination of all the claim and class configuration parameters.
+ // Drivers can distinguish between those based on a flag.
+ //
+ // This includes configuration parameters for drivers which have no allocated
+ // devices in the result because it is up to the drivers which configuration
+ // parameters they support. They can silently ignore unknown configuration
+ // parameters.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceAllocationConfiguration config = 2;
+}
+
+// DeviceAttribute must have exactly one field set.
+message DeviceAttribute {
+ // IntValue is a number.
+ //
+ // +optional
+ // +oneOf=ValueType
+ optional int64 int = 2;
+
+ // BoolValue is a true/false value.
+ //
+ // +optional
+ // +oneOf=ValueType
+ optional bool bool = 3;
+
+ // StringValue is a string. Must not be longer than 64 characters.
+ //
+ // +optional
+ // +oneOf=ValueType
+ optional string string = 4;
+
+ // VersionValue is a semantic version according to semver.org spec 2.0.0.
+ // Must not be longer than 64 characters.
+ //
+ // +optional
+ // +oneOf=ValueType
+ optional string version = 5;
+}
+
+// DeviceClaim defines how to request devices with a ResourceClaim.
+message DeviceClaim {
+ // Requests represent individual requests for distinct devices which
+ // must all be satisfied. If empty, nothing needs to be allocated.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceRequest requests = 1;
+
+ // These constraints must be satisfied by the set of devices that get
+ // allocated for the claim.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceConstraint constraints = 2;
+
+ // This field holds configuration for multiple potential drivers which
+ // could satisfy requests in this claim. It is ignored while allocating
+ // the claim.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceClaimConfiguration config = 3;
+}
+
+// DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.
+message DeviceClaimConfiguration {
+ // Requests lists the names of requests where the configuration applies.
+ // If empty, it applies to all requests.
+ //
+ // +optional
+ // +listType=atomic
+ repeated string requests = 1;
+
+ optional DeviceConfiguration deviceConfiguration = 2;
+}
+
+// DeviceClass is a vendor- or admin-provided resource that contains
+// device configuration and selectors. It can be referenced in
+// the device requests of a claim to apply these presets.
+// Cluster scoped.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+message DeviceClass {
+ // Standard object metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Spec defines what can be allocated and how to configure it.
+ //
+ // This is mutable. Consumers have to be prepared for classes changing
+ // at any time, either because they get updated or replaced. Claim
+ // allocations are done once based on whatever was set in classes at
+ // the time of allocation.
+ //
+ // Changing the spec automatically increments the metadata.generation number.
+ optional DeviceClassSpec spec = 2;
+}
+
+// DeviceClassConfiguration is used in DeviceClass.
+message DeviceClassConfiguration {
+ optional DeviceConfiguration deviceConfiguration = 1;
+}
+
+// DeviceClassList is a collection of classes.
+message DeviceClassList {
+ // Standard list metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of resource classes.
+ repeated DeviceClass items = 2;
+}
+
+// DeviceClassSpec is used in a [DeviceClass] to define what can be allocated
+// and how to configure it.
+message DeviceClassSpec {
+ // Each selector must be satisfied by a device which is claimed via this class.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceSelector selectors = 1;
+
+ // Config defines configuration parameters that apply to each device that is claimed via this class.
+ // Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor
+ // configuration applies to exactly one driver.
+ //
+ // They are passed to the driver, but are not considered while allocating the claim.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceClassConfiguration config = 2;
+
+ // Only nodes matching the selector will be considered by the scheduler
+ // when trying to find a Node that fits a Pod when that Pod uses
+ // a claim that has not been allocated yet *and* that claim
+ // gets allocated through a control plane controller. It is ignored
+ // when the claim does not use a control plane controller
+ // for allocation.
+ //
+ // Setting this field is optional. If unset, all Nodes are candidates.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ optional .k8s.io.api.core.v1.NodeSelector suitableNodes = 3;
+}
+
+// DeviceConfiguration must have exactly one field set. It gets embedded
+// inline in some other structs which have other fields, so field names must
+// not conflict with those.
+message DeviceConfiguration {
+ // Opaque provides driver-specific configuration parameters.
+ //
+ // +optional
+ // +oneOf=ConfigurationType
+ optional OpaqueDeviceConfiguration opaque = 1;
+}
+
+// DeviceConstraint must have exactly one field set besides Requests.
+message DeviceConstraint {
+ // Requests is a list of the one or more requests in this claim which
+ // must co-satisfy this constraint. If a request is fulfilled by
+ // multiple devices, then all of the devices must satisfy the
+ // constraint. If this is not specified, this constraint applies to all
+ // requests in this claim.
+ //
+ // +optional
+ // +listType=atomic
+ repeated string requests = 1;
+
+ // MatchAttribute requires that all devices in question have this
+ // attribute and that its type and value are the same across those
+ // devices.
+ //
+ // For example, if you specified "dra.example.com/numa" (a hypothetical example!),
+ // then only devices in the same NUMA node will be chosen. A device which
+ // does not have that attribute will not be chosen. All devices should
+ // use a value of the same type for this attribute because that is part of
+ // its specification, but if one device doesn't, then it also will not be
+ // chosen.
+ //
+ // Must include the domain qualifier.
+ //
+ // +optional
+ // +oneOf=ConstraintType
+ optional string matchAttribute = 2;
+}
+
+// DeviceRequest is a request for devices required for a claim.
+// This is typically a request for a single resource like a device, but can
+// also ask for several identical devices.
+//
+// A DeviceClassName is currently required. Clients must check that it is
+// indeed set. It's absence indicates that something changed in a way that
+// is not supported by the client yet, in which case it must refuse to
+// handle the request.
+message DeviceRequest {
+ // Name can be used to reference this request in a pod.spec.containers[].resources.claims
+ // entry and in a constraint of the claim.
+ //
+ // Must be a DNS label.
+ //
+ // +required
+ optional string name = 1;
+
+ // DeviceClassName references a specific DeviceClass, which can define
+ // additional configuration and selectors to be inherited by this
+ // request.
+ //
+ // A class is required. Which classes are available depends on the cluster.
+ //
+ // Administrators may use this to restrict which devices may get
+ // requested by only installing classes with selectors for permitted
+ // devices. If users are free to request anything without restrictions,
+ // then administrators can create an empty DeviceClass for users
+ // to reference.
+ //
+ // +required
+ optional string deviceClassName = 2;
+
+ // Selectors define criteria which must be satisfied by a specific
+ // device in order for that device to be considered for this
+ // request. All selectors must be satisfied for a device to be
+ // considered.
+ //
+ // +optional
+ // +listType=atomic
+ repeated DeviceSelector selectors = 3;
+
+ // AllocationMode and its related fields define how devices are allocated
+ // to satisfy this request. Supported values are:
+ //
+ // - ExactCount: This request is for a specific number of devices.
+ // This is the default. The exact number is provided in the
+ // count field.
+ //
+ // - All: This request is for all of the matching devices in a pool.
+ // Allocation will fail if some devices are already allocated,
+ // unless adminAccess is requested.
+ //
+ // If AlloctionMode is not specified, the default mode is ExactCount. If
+ // the mode is ExactCount and count is not specified, the default count is
+ // one. Any other requests must specify this field.
+ //
+ // More modes may get added in the future. Clients must refuse to handle
+ // requests with unknown modes.
+ //
+ // +optional
+ optional string allocationMode = 4;
+
+ // Count is used only when the count mode is "ExactCount". Must be greater than zero.
+ // If AllocationMode is ExactCount and this field is not specified, the default is one.
+ //
+ // +optional
+ // +oneOf=AllocationMode
+ optional int64 count = 5;
+
+ // AdminAccess indicates that this is a claim for administrative access
+ // to the device(s). Claims with AdminAccess are expected to be used for
+ // monitoring or other management services for a device. They ignore
+ // all ordinary claims to the device with respect to access modes and
+ // any resource allocations.
+ //
+ // +optional
+ // +default=false
+ optional bool adminAccess = 6;
+}
+
+// DeviceRequestAllocationResult contains the allocation result for one request.
+message DeviceRequestAllocationResult {
+ // Request is the name of the request in the claim which caused this
+ // device to be allocated. Multiple devices may have been allocated
+ // per request.
+ //
+ // +required
+ optional string request = 1;
+
+ // Driver specifies the name of the DRA driver whose kubelet
+ // plugin should be invoked to process the allocation once the claim is
+ // needed on a node.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver.
+ //
+ // +required
+ optional string driver = 2;
+
+ // This name together with the driver name and the device name field
+ // identify which device was allocated (`//`).
+ //
+ // Must not be longer than 253 characters and may contain one or more
+ // DNS sub-domains separated by slashes.
+ //
+ // +required
+ optional string pool = 3;
+
+ // Device references one device instance via its name in the driver's
+ // resource pool. It must be a DNS label.
+ //
+ // +required
+ optional string device = 4;
+}
+
+// DeviceSelector must have exactly one field set.
+message DeviceSelector {
+ // CEL contains a CEL expression for selecting a device.
+ //
+ // +optional
+ // +oneOf=SelectorType
+ optional CELDeviceSelector cel = 1;
+}
+
+// OpaqueDeviceConfiguration contains configuration parameters for a driver
+// in a format defined by the driver vendor.
+message OpaqueDeviceConfiguration {
+ // Driver is used to determine which kubelet plugin needs
+ // to be passed these configuration parameters.
+ //
+ // An admission policy provided by the driver developer could use this
+ // to decide whether it needs to validate them.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver.
+ //
+ // +required
+ optional string driver = 1;
+
+ // Parameters can contain arbitrary data. It is the responsibility of
+ // the driver developer to handle validation and versioning. Typically this
+ // includes self-identification and a version ("kind" + "apiVersion" for
+ // Kubernetes types), with conversion between different versions.
+ //
+ // +required
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension parameters = 2;
+}
+
+// PodSchedulingContext objects hold information that is needed to schedule
+// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation
+// mode.
+//
+// This is an alpha type and requires enabling the DRAControlPlaneController
+// feature gate.
+message PodSchedulingContext {
+ // Standard object metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Spec describes where resources for the Pod are needed.
+ optional PodSchedulingContextSpec spec = 2;
+
+ // Status describes where resources for the Pod can be allocated.
+ //
+ // +optional
+ optional PodSchedulingContextStatus status = 3;
+}
+
+// PodSchedulingContextList is a collection of Pod scheduling objects.
+message PodSchedulingContextList {
+ // Standard list metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of PodSchedulingContext objects.
+ repeated PodSchedulingContext items = 2;
+}
+
+// PodSchedulingContextSpec describes where resources for the Pod are needed.
+message PodSchedulingContextSpec {
+ // SelectedNode is the node for which allocation of ResourceClaims that
+ // are referenced by the Pod and that use "WaitForFirstConsumer"
+ // allocation is to be attempted.
+ //
+ // +optional
+ optional string selectedNode = 1;
+
+ // PotentialNodes lists nodes where the Pod might be able to run.
+ //
+ // The size of this field is limited to 128. This is large enough for
+ // many clusters. Larger clusters may need more attempts to find a node
+ // that suits all pending resources. This may get increased in the
+ // future, but not reduced.
+ //
+ // +optional
+ // +listType=atomic
+ repeated string potentialNodes = 2;
+}
+
+// PodSchedulingContextStatus describes where resources for the Pod can be allocated.
+message PodSchedulingContextStatus {
+ // ResourceClaims describes resource availability for each
+ // pod.spec.resourceClaim entry where the corresponding ResourceClaim
+ // uses "WaitForFirstConsumer" allocation mode.
+ //
+ // +listType=map
+ // +listMapKey=name
+ // +optional
+ repeated ResourceClaimSchedulingStatus resourceClaims = 1;
+}
+
+// ResourceClaim describes a request for access to resources in the cluster,
+// for use by workloads. For example, if a workload needs an accelerator device
+// with specific properties, this is how that request is expressed. The status
+// stanza tracks whether this claim has been satisfied and what specific
+// resources have been allocated.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+message ResourceClaim {
+ // Standard object metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Spec describes what is being requested and how to configure it.
+ // The spec is immutable.
+ optional ResourceClaimSpec spec = 2;
+
+ // Status describes whether the claim is ready to use and what has been allocated.
+ // +optional
+ optional ResourceClaimStatus status = 3;
+}
+
+// ResourceClaimConsumerReference contains enough information to let you
+// locate the consumer of a ResourceClaim. The user must be a resource in the same
+// namespace as the ResourceClaim.
+message ResourceClaimConsumerReference {
+ // APIGroup is the group for the resource being referenced. It is
+ // empty for the core API. This matches the group in the APIVersion
+ // that is used when creating the resources.
+ // +optional
+ optional string apiGroup = 1;
+
+ // Resource is the type of resource being referenced, for example "pods".
+ // +required
+ optional string resource = 3;
+
+ // Name is the name of resource being referenced.
+ // +required
+ optional string name = 4;
+
+ // UID identifies exactly one incarnation of the resource.
+ // +required
+ optional string uid = 5;
+}
+
+// ResourceClaimList is a collection of claims.
+message ResourceClaimList {
+ // Standard list metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of resource claims.
+ repeated ResourceClaim items = 2;
+}
+
+// ResourceClaimSchedulingStatus contains information about one particular
+// ResourceClaim with "WaitForFirstConsumer" allocation mode.
+message ResourceClaimSchedulingStatus {
+ // Name matches the pod.spec.resourceClaims[*].Name field.
+ //
+ // +required
+ optional string name = 1;
+
+ // UnsuitableNodes lists nodes that the ResourceClaim cannot be
+ // allocated for.
+ //
+ // The size of this field is limited to 128, the same as for
+ // PodSchedulingSpec.PotentialNodes. This may get increased in the
+ // future, but not reduced.
+ //
+ // +optional
+ // +listType=atomic
+ repeated string unsuitableNodes = 2;
+}
+
+// ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.
+message ResourceClaimSpec {
+ // Devices defines how to request devices.
+ //
+ // +optional
+ optional DeviceClaim devices = 1;
+
+ // Controller is the name of the DRA driver that is meant
+ // to handle allocation of this claim. If empty, allocation is handled
+ // by the scheduler while scheduling a pod.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ optional string controller = 2;
+}
+
+// ResourceClaimStatus tracks whether the resource has been allocated and what
+// the result of that was.
+message ResourceClaimStatus {
+ // Allocation is set once the claim has been allocated successfully.
+ //
+ // +optional
+ optional AllocationResult allocation = 1;
+
+ // ReservedFor indicates which entities are currently allowed to use
+ // the claim. A Pod which references a ResourceClaim which is not
+ // reserved for that Pod will not be started. A claim that is in
+ // use or might be in use because it has been reserved must not get
+ // deallocated.
+ //
+ // In a cluster with multiple scheduler instances, two pods might get
+ // scheduled concurrently by different schedulers. When they reference
+ // the same ResourceClaim which already has reached its maximum number
+ // of consumers, only one pod can be scheduled.
+ //
+ // Both schedulers try to add their pod to the claim.status.reservedFor
+ // field, but only the update that reaches the API server first gets
+ // stored. The other one fails with an error and the scheduler
+ // which issued it knows that it must put the pod back into the queue,
+ // waiting for the ResourceClaim to become usable again.
+ //
+ // There can be at most 32 such reservations. This may get increased in
+ // the future, but not reduced.
+ //
+ // +optional
+ // +listType=map
+ // +listMapKey=uid
+ // +patchStrategy=merge
+ // +patchMergeKey=uid
+ repeated ResourceClaimConsumerReference reservedFor = 2;
+
+ // Indicates that a claim is to be deallocated. While this is set,
+ // no new consumers may be added to ReservedFor.
+ //
+ // This is only used if the claim needs to be deallocated by a DRA driver.
+ // That driver then must deallocate this claim and reset the field
+ // together with clearing the Allocation field.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ optional bool deallocationRequested = 3;
+}
+
+// ResourceClaimTemplate is used to produce ResourceClaim objects.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+message ResourceClaimTemplate {
+ // Standard object metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Describes the ResourceClaim that is to be generated.
+ //
+ // This field is immutable. A ResourceClaim will get created by the
+ // control plane for a Pod when needed and then not get updated
+ // anymore.
+ optional ResourceClaimTemplateSpec spec = 2;
+}
+
+// ResourceClaimTemplateList is a collection of claim templates.
+message ResourceClaimTemplateList {
+ // Standard list metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of resource claim templates.
+ repeated ResourceClaimTemplate items = 2;
+}
+
+// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.
+message ResourceClaimTemplateSpec {
+ // ObjectMeta may contain labels and annotations that will be copied into the PVC
+ // when creating it. No other fields are allowed and will be rejected during
+ // validation.
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Spec for the ResourceClaim. The entire content is copied unchanged
+ // into the ResourceClaim that gets created from this template. The
+ // same fields as in a ResourceClaim are also valid here.
+ optional ResourceClaimSpec spec = 2;
+}
+
+// ResourcePool describes the pool that ResourceSlices belong to.
+message ResourcePool {
+ // Name is used to identify the pool. For node-local devices, this
+ // is often the node name, but this is not required.
+ //
+ // It must not be longer than 253 characters and must consist of one or more DNS sub-domains
+ // separated by slashes. This field is immutable.
+ //
+ // +required
+ optional string name = 1;
+
+ // Generation tracks the change in a pool over time. Whenever a driver
+ // changes something about one or more of the resources in a pool, it
+ // must change the generation in all ResourceSlices which are part of
+ // that pool. Consumers of ResourceSlices should only consider
+ // resources from the pool with the highest generation number. The
+ // generation may be reset by drivers, which should be fine for
+ // consumers, assuming that all ResourceSlices in a pool are updated to
+ // match or deleted.
+ //
+ // Combined with ResourceSliceCount, this mechanism enables consumers to
+ // detect pools which are comprised of multiple ResourceSlices and are
+ // in an incomplete state.
+ //
+ // +required
+ optional int64 generation = 2;
+
+ // ResourceSliceCount is the total number of ResourceSlices in the pool at this
+ // generation number. Must be greater than zero.
+ //
+ // Consumers can use this to check whether they have seen all ResourceSlices
+ // belonging to the same pool.
+ //
+ // +required
+ optional int64 resourceSliceCount = 3;
+}
+
+// ResourceSlice represents one or more resources in a pool of similar resources,
+// managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many
+// ResourceSlices comprise a pool is determined by the driver.
+//
+// At the moment, the only supported resources are devices with attributes and capacities.
+// Each device in a given pool, regardless of how many ResourceSlices, must have a unique name.
+// The ResourceSlice in which a device gets published may change over time. The unique identifier
+// for a device is the tuple , , .
+//
+// Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number
+// and updates all ResourceSlices with that new number and new resource definitions. A consumer
+// must only use ResourceSlices with the highest generation number and ignore all others.
+//
+// When allocating all resources in a pool matching certain criteria or when
+// looking for the best solution among several different alternatives, a
+// consumer should check the number of ResourceSlices in a pool (included in
+// each ResourceSlice) to determine whether its view of a pool is complete and
+// if not, should wait until the driver has completed updating the pool.
+//
+// For resources that are not local to a node, the node name is not set. Instead,
+// the driver may use a node selector to specify where the devices are available.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+message ResourceSlice {
+ // Standard object metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Contains the information published by the driver.
+ //
+ // Changing the spec automatically increments the metadata.generation number.
+ optional ResourceSliceSpec spec = 2;
+}
+
+// ResourceSliceList is a collection of ResourceSlices.
+message ResourceSliceList {
+ // Standard list metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of resource ResourceSlices.
+ repeated ResourceSlice items = 2;
+}
+
+// ResourceSliceSpec contains the information published by the driver in one ResourceSlice.
+message ResourceSliceSpec {
+ // Driver identifies the DRA driver providing the capacity information.
+ // A field selector can be used to list only ResourceSlice
+ // objects with a certain driver name.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver. This field is immutable.
+ //
+ // +required
+ optional string driver = 1;
+
+ // Pool describes the pool that this ResourceSlice belongs to.
+ //
+ // +required
+ optional ResourcePool pool = 2;
+
+ // NodeName identifies the node which provides the resources in this pool.
+ // A field selector can be used to list only ResourceSlice
+ // objects belonging to a certain node.
+ //
+ // This field can be used to limit access from nodes to ResourceSlices with
+ // the same node name. It also indicates to autoscalers that adding
+ // new nodes of the same type as some old node might also make new
+ // resources available.
+ //
+ // Exactly one of NodeName, NodeSelector and AllNodes must be set.
+ // This field is immutable.
+ //
+ // +optional
+ // +oneOf=NodeSelection
+ optional string nodeName = 3;
+
+ // NodeSelector defines which nodes have access to the resources in the pool,
+ // when that pool is not limited to a single node.
+ //
+ // Must use exactly one term.
+ //
+ // Exactly one of NodeName, NodeSelector and AllNodes must be set.
+ //
+ // +optional
+ // +oneOf=NodeSelection
+ optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 4;
+
+ // AllNodes indicates that all nodes have access to the resources in the pool.
+ //
+ // Exactly one of NodeName, NodeSelector and AllNodes must be set.
+ //
+ // +optional
+ // +oneOf=NodeSelection
+ optional bool allNodes = 5;
+
+ // Devices lists some or all of the devices in this pool.
+ //
+ // Must not have more than 128 entries.
+ //
+ // +optional
+ // +listType=atomic
+ repeated Device devices = 6;
+}
+
diff --git a/vendor/k8s.io/api/resource/v1alpha2/register.go b/vendor/k8s.io/api/resource/v1alpha3/register.go
similarity index 86%
rename from vendor/k8s.io/api/resource/v1alpha2/register.go
rename to vendor/k8s.io/api/resource/v1alpha3/register.go
index 893fb4c1e52..74044e8cf0e 100644
--- a/vendor/k8s.io/api/resource/v1alpha2/register.go
+++ b/vendor/k8s.io/api/resource/v1alpha3/register.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha2
+package v1alpha3
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -26,7 +26,7 @@ import (
const GroupName = "resource.k8s.io"
// SchemeGroupVersion is group version used to register these objects
-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"}
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
@@ -44,8 +44,8 @@ var (
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
- &ResourceClass{},
- &ResourceClassList{},
+ &DeviceClass{},
+ &DeviceClassList{},
&ResourceClaim{},
&ResourceClaimList{},
&ResourceClaimTemplate{},
@@ -54,15 +54,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&PodSchedulingContextList{},
&ResourceSlice{},
&ResourceSliceList{},
- &ResourceClaimParameters{},
- &ResourceClaimParametersList{},
- &ResourceClassParameters{},
- &ResourceClassParametersList{},
)
- // Add common types
- scheme.AddKnownTypes(SchemeGroupVersion, &metav1.Status{})
-
// Add the watch version that applies
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
diff --git a/vendor/k8s.io/api/resource/v1alpha3/types.go b/vendor/k8s.io/api/resource/v1alpha3/types.go
new file mode 100644
index 00000000000..4efd2491de5
--- /dev/null
+++ b/vendor/k8s.io/api/resource/v1alpha3/types.go
@@ -0,0 +1,1048 @@
+/*
+Copyright 2022 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha3
+
+import (
+ v1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/resource"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/apimachinery/pkg/util/validation"
+)
+
+const (
+ // Finalizer is the finalizer that gets set for claims
+ // which were allocated through a builtin controller.
+ // Reserved for use by Kubernetes, DRA driver controllers must
+ // use their own finalizer.
+ Finalizer = "resource.kubernetes.io/delete-protection"
+)
+
+// +genclient
+// +genclient:nonNamespaced
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// ResourceSlice represents one or more resources in a pool of similar resources,
+// managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many
+// ResourceSlices comprise a pool is determined by the driver.
+//
+// At the moment, the only supported resources are devices with attributes and capacities.
+// Each device in a given pool, regardless of how many ResourceSlices, must have a unique name.
+// The ResourceSlice in which a device gets published may change over time. The unique identifier
+// for a device is the tuple , , .
+//
+// Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number
+// and updates all ResourceSlices with that new number and new resource definitions. A consumer
+// must only use ResourceSlices with the highest generation number and ignore all others.
+//
+// When allocating all resources in a pool matching certain criteria or when
+// looking for the best solution among several different alternatives, a
+// consumer should check the number of ResourceSlices in a pool (included in
+// each ResourceSlice) to determine whether its view of a pool is complete and
+// if not, should wait until the driver has completed updating the pool.
+//
+// For resources that are not local to a node, the node name is not set. Instead,
+// the driver may use a node selector to specify where the devices are available.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+type ResourceSlice struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Contains the information published by the driver.
+ //
+ // Changing the spec automatically increments the metadata.generation number.
+ Spec ResourceSliceSpec `json:"spec" protobuf:"bytes,2,name=spec"`
+}
+
+const (
+ // ResourceSliceSelectorNodeName can be used in a [metav1.ListOptions]
+ // field selector to filter based on [ResourceSliceSpec.NodeName].
+ ResourceSliceSelectorNodeName = "spec.nodeName"
+ // ResourceSliceSelectorDriver can be used in a [metav1.ListOptions]
+ // field selector to filter based on [ResourceSliceSpec.Driver].
+ ResourceSliceSelectorDriver = "spec.driver"
+)
+
+// ResourceSliceSpec contains the information published by the driver in one ResourceSlice.
+type ResourceSliceSpec struct {
+ // Driver identifies the DRA driver providing the capacity information.
+ // A field selector can be used to list only ResourceSlice
+ // objects with a certain driver name.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver. This field is immutable.
+ //
+ // +required
+ Driver string `json:"driver" protobuf:"bytes,1,name=driver"`
+
+ // Pool describes the pool that this ResourceSlice belongs to.
+ //
+ // +required
+ Pool ResourcePool `json:"pool" protobuf:"bytes,2,name=pool"`
+
+ // NodeName identifies the node which provides the resources in this pool.
+ // A field selector can be used to list only ResourceSlice
+ // objects belonging to a certain node.
+ //
+ // This field can be used to limit access from nodes to ResourceSlices with
+ // the same node name. It also indicates to autoscalers that adding
+ // new nodes of the same type as some old node might also make new
+ // resources available.
+ //
+ // Exactly one of NodeName, NodeSelector and AllNodes must be set.
+ // This field is immutable.
+ //
+ // +optional
+ // +oneOf=NodeSelection
+ NodeName string `json:"nodeName,omitempty" protobuf:"bytes,3,opt,name=nodeName"`
+
+ // NodeSelector defines which nodes have access to the resources in the pool,
+ // when that pool is not limited to a single node.
+ //
+ // Must use exactly one term.
+ //
+ // Exactly one of NodeName, NodeSelector and AllNodes must be set.
+ //
+ // +optional
+ // +oneOf=NodeSelection
+ NodeSelector *v1.NodeSelector `json:"nodeSelector,omitempty" protobuf:"bytes,4,opt,name=nodeSelector"`
+
+ // AllNodes indicates that all nodes have access to the resources in the pool.
+ //
+ // Exactly one of NodeName, NodeSelector and AllNodes must be set.
+ //
+ // +optional
+ // +oneOf=NodeSelection
+ AllNodes bool `json:"allNodes,omitempty" protobuf:"bytes,5,opt,name=allNodes"`
+
+ // Devices lists some or all of the devices in this pool.
+ //
+ // Must not have more than 128 entries.
+ //
+ // +optional
+ // +listType=atomic
+ Devices []Device `json:"devices" protobuf:"bytes,6,name=devices"`
+}
+
+// ResourcePool describes the pool that ResourceSlices belong to.
+type ResourcePool struct {
+ // Name is used to identify the pool. For node-local devices, this
+ // is often the node name, but this is not required.
+ //
+ // It must not be longer than 253 characters and must consist of one or more DNS sub-domains
+ // separated by slashes. This field is immutable.
+ //
+ // +required
+ Name string `json:"name" protobuf:"bytes,1,name=name"`
+
+ // Generation tracks the change in a pool over time. Whenever a driver
+ // changes something about one or more of the resources in a pool, it
+ // must change the generation in all ResourceSlices which are part of
+ // that pool. Consumers of ResourceSlices should only consider
+ // resources from the pool with the highest generation number. The
+ // generation may be reset by drivers, which should be fine for
+ // consumers, assuming that all ResourceSlices in a pool are updated to
+ // match or deleted.
+ //
+ // Combined with ResourceSliceCount, this mechanism enables consumers to
+ // detect pools which are comprised of multiple ResourceSlices and are
+ // in an incomplete state.
+ //
+ // +required
+ Generation int64 `json:"generation" protobuf:"bytes,2,name=generation"`
+
+ // ResourceSliceCount is the total number of ResourceSlices in the pool at this
+ // generation number. Must be greater than zero.
+ //
+ // Consumers can use this to check whether they have seen all ResourceSlices
+ // belonging to the same pool.
+ //
+ // +required
+ ResourceSliceCount int64 `json:"resourceSliceCount" protobuf:"bytes,3,name=resourceSliceCount"`
+}
+
+const ResourceSliceMaxSharedCapacity = 128
+const ResourceSliceMaxDevices = 128
+const PoolNameMaxLength = validation.DNS1123SubdomainMaxLength // Same as for a single node name.
+
+// Device represents one individual hardware instance that can be selected based
+// on its attributes. Besides the name, exactly one field must be set.
+type Device struct {
+ // Name is unique identifier among all devices managed by
+ // the driver in the pool. It must be a DNS label.
+ //
+ // +required
+ Name string `json:"name" protobuf:"bytes,1,name=name"`
+
+ // Basic defines one device instance.
+ //
+ // +optional
+ // +oneOf=deviceType
+ Basic *BasicDevice `json:"basic,omitempty" protobuf:"bytes,2,opt,name=basic"`
+}
+
+// BasicDevice defines one device instance.
+type BasicDevice struct {
+ // Attributes defines the set of attributes for this device.
+ // The name of each attribute must be unique in that set.
+ //
+ // The maximum number of attributes and capacities combined is 32.
+ //
+ // +optional
+ Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,1,rep,name=attributes"`
+
+ // Capacity defines the set of capacities for this device.
+ // The name of each capacity must be unique in that set.
+ //
+ // The maximum number of attributes and capacities combined is 32.
+ //
+ // +optional
+ Capacity map[QualifiedName]resource.Quantity `json:"capacity,omitempty" protobuf:"bytes,2,rep,name=capacity"`
+}
+
+// Limit for the sum of the number of entries in both ResourceSlices.
+const ResourceSliceMaxAttributesAndCapacitiesPerDevice = 32
+
+// QualifiedName is the name of a device attribute or capacity.
+//
+// Attributes and capacities are defined either by the owner of the specific
+// driver (usually the vendor) or by some 3rd party (e.g. the Kubernetes
+// project). Because they are sometimes compared across devices, a given name
+// is expected to mean the same thing and have the same type on all devices.
+//
+// Names must be either a C identifier (e.g. "theName") or a DNS subdomain
+// followed by a slash ("/") followed by a C identifier
+// (e.g. "dra.example.com/theName"). Names which do not include the
+// domain prefix are assumed to be part of the driver's domain. Attributes
+// or capacities defined by 3rd parties must include the domain prefix.
+//
+// The maximum length for the DNS subdomain is 63 characters (same as
+// for driver names) and the maximum length of the C identifier
+// is 32.
+type QualifiedName string
+
+// FullyQualifiedName is a QualifiedName where the domain is set.
+type FullyQualifiedName string
+
+// DeviceMaxIDLength is the maximum length of the identifier in a device attribute or capacity name (`/`).
+const DeviceMaxIDLength = 32
+
+// DeviceAttribute must have exactly one field set.
+type DeviceAttribute struct {
+ // The Go field names below have a Value suffix to avoid a conflict between the
+ // field "String" and the corresponding method. That method is required.
+ // The Kubernetes API is defined without that suffix to keep it more natural.
+
+ // IntValue is a number.
+ //
+ // +optional
+ // +oneOf=ValueType
+ IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"`
+
+ // BoolValue is a true/false value.
+ //
+ // +optional
+ // +oneOf=ValueType
+ BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"`
+
+ // StringValue is a string. Must not be longer than 64 characters.
+ //
+ // +optional
+ // +oneOf=ValueType
+ StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"`
+
+ // VersionValue is a semantic version according to semver.org spec 2.0.0.
+ // Must not be longer than 64 characters.
+ //
+ // +optional
+ // +oneOf=ValueType
+ VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"`
+}
+
+// DeviceAttributeMaxValueLength is the maximum length of a string or version attribute value.
+const DeviceAttributeMaxValueLength = 64
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// ResourceSliceList is a collection of ResourceSlices.
+type ResourceSliceList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Items is the list of resource ResourceSlices.
+ Items []ResourceSlice `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.26
+
+// ResourceClaim describes a request for access to resources in the cluster,
+// for use by workloads. For example, if a workload needs an accelerator device
+// with specific properties, this is how that request is expressed. The status
+// stanza tracks whether this claim has been satisfied and what specific
+// resources have been allocated.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+type ResourceClaim struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Spec describes what is being requested and how to configure it.
+ // The spec is immutable.
+ Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
+
+ // Status describes whether the claim is ready to use and what has been allocated.
+ // +optional
+ Status ResourceClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
+}
+
+// ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.
+type ResourceClaimSpec struct {
+ // Devices defines how to request devices.
+ //
+ // +optional
+ Devices DeviceClaim `json:"devices" protobuf:"bytes,1,name=devices"`
+
+ // Controller is the name of the DRA driver that is meant
+ // to handle allocation of this claim. If empty, allocation is handled
+ // by the scheduler while scheduling a pod.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ Controller string `json:"controller,omitempty" protobuf:"bytes,2,opt,name=controller"`
+}
+
+// DeviceClaim defines how to request devices with a ResourceClaim.
+type DeviceClaim struct {
+ // Requests represent individual requests for distinct devices which
+ // must all be satisfied. If empty, nothing needs to be allocated.
+ //
+ // +optional
+ // +listType=atomic
+ Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"`
+
+ // These constraints must be satisfied by the set of devices that get
+ // allocated for the claim.
+ //
+ // +optional
+ // +listType=atomic
+ Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"`
+
+ // This field holds configuration for multiple potential drivers which
+ // could satisfy requests in this claim. It is ignored while allocating
+ // the claim.
+ //
+ // +optional
+ // +listType=atomic
+ Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"`
+}
+
+const (
+ DeviceRequestsMaxSize = AllocationResultsMaxSize
+ DeviceConstraintsMaxSize = 32
+ DeviceConfigMaxSize = 32
+)
+
+// DeviceRequest is a request for devices required for a claim.
+// This is typically a request for a single resource like a device, but can
+// also ask for several identical devices.
+//
+// A DeviceClassName is currently required. Clients must check that it is
+// indeed set. It's absence indicates that something changed in a way that
+// is not supported by the client yet, in which case it must refuse to
+// handle the request.
+type DeviceRequest struct {
+ // Name can be used to reference this request in a pod.spec.containers[].resources.claims
+ // entry and in a constraint of the claim.
+ //
+ // Must be a DNS label.
+ //
+ // +required
+ Name string `json:"name" protobuf:"bytes,1,name=name"`
+
+ // DeviceClassName references a specific DeviceClass, which can define
+ // additional configuration and selectors to be inherited by this
+ // request.
+ //
+ // A class is required. Which classes are available depends on the cluster.
+ //
+ // Administrators may use this to restrict which devices may get
+ // requested by only installing classes with selectors for permitted
+ // devices. If users are free to request anything without restrictions,
+ // then administrators can create an empty DeviceClass for users
+ // to reference.
+ //
+ // +required
+ DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"`
+
+ // Selectors define criteria which must be satisfied by a specific
+ // device in order for that device to be considered for this
+ // request. All selectors must be satisfied for a device to be
+ // considered.
+ //
+ // +optional
+ // +listType=atomic
+ Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"`
+
+ // AllocationMode and its related fields define how devices are allocated
+ // to satisfy this request. Supported values are:
+ //
+ // - ExactCount: This request is for a specific number of devices.
+ // This is the default. The exact number is provided in the
+ // count field.
+ //
+ // - All: This request is for all of the matching devices in a pool.
+ // Allocation will fail if some devices are already allocated,
+ // unless adminAccess is requested.
+ //
+ // If AlloctionMode is not specified, the default mode is ExactCount. If
+ // the mode is ExactCount and count is not specified, the default count is
+ // one. Any other requests must specify this field.
+ //
+ // More modes may get added in the future. Clients must refuse to handle
+ // requests with unknown modes.
+ //
+ // +optional
+ AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"`
+
+ // Count is used only when the count mode is "ExactCount". Must be greater than zero.
+ // If AllocationMode is ExactCount and this field is not specified, the default is one.
+ //
+ // +optional
+ // +oneOf=AllocationMode
+ Count int64 `json:"count,omitempty" protobuf:"bytes,5,opt,name=count"`
+
+ // AdminAccess indicates that this is a claim for administrative access
+ // to the device(s). Claims with AdminAccess are expected to be used for
+ // monitoring or other management services for a device. They ignore
+ // all ordinary claims to the device with respect to access modes and
+ // any resource allocations.
+ //
+ // +optional
+ // +default=false
+ AdminAccess bool `json:"adminAccess,omitempty" protobuf:"bytes,6,opt,name=adminAccess"`
+}
+
+const (
+ DeviceSelectorsMaxSize = 32
+)
+
+type DeviceAllocationMode string
+
+// Valid [DeviceRequest.CountMode] values.
+const (
+ DeviceAllocationModeExactCount = DeviceAllocationMode("ExactCount")
+ DeviceAllocationModeAll = DeviceAllocationMode("All")
+)
+
+// DeviceSelector must have exactly one field set.
+type DeviceSelector struct {
+ // CEL contains a CEL expression for selecting a device.
+ //
+ // +optional
+ // +oneOf=SelectorType
+ CEL *CELDeviceSelector `json:"cel,omitempty" protobuf:"bytes,1,opt,name=cel"`
+}
+
+// CELDeviceSelector contains a CEL expression for selecting a device.
+type CELDeviceSelector struct {
+ // Expression is a CEL expression which evaluates a single device. It
+ // must evaluate to true when the device under consideration satisfies
+ // the desired criteria, and false when it does not. Any other result
+ // is an error and causes allocation of devices to abort.
+ //
+ // The expression's input is an object named "device", which carries
+ // the following properties:
+ // - driver (string): the name of the driver which defines this device.
+ // - attributes (map[string]object): the device's attributes, grouped by prefix
+ // (e.g. device.attributes["dra.example.com"] evaluates to an object with all
+ // of the attributes which were prefixed by "dra.example.com".
+ // - capacity (map[string]object): the device's capacities, grouped by prefix.
+ //
+ // Example: Consider a device with driver="dra.example.com", which exposes
+ // two attributes named "model" and "ext.example.com/family" and which
+ // exposes one capacity named "modules". This input to this expression
+ // would have the following fields:
+ //
+ // device.driver
+ // device.attributes["dra.example.com"].model
+ // device.attributes["ext.example.com"].family
+ // device.capacity["dra.example.com"].modules
+ //
+ // The device.driver field can be used to check for a specific driver,
+ // either as a high-level precondition (i.e. you only want to consider
+ // devices from this driver) or as part of a multi-clause expression
+ // that is meant to consider devices from different drivers.
+ //
+ // The value type of each attribute is defined by the device
+ // definition, and users who write these expressions must consult the
+ // documentation for their specific drivers. The value type of each
+ // capacity is Quantity.
+ //
+ // If an unknown prefix is used as a lookup in either device.attributes
+ // or device.capacity, an empty map will be returned. Any reference to
+ // an unknown field will cause an evaluation error and allocation to
+ // abort.
+ //
+ // A robust expression should check for the existence of attributes
+ // before referencing them.
+ //
+ // For ease of use, the cel.bind() function is enabled, and can be used
+ // to simplify expressions that access multiple attributes with the
+ // same domain. For example:
+ //
+ // cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
+ //
+ // +required
+ Expression string `json:"expression" protobuf:"bytes,1,name=expression"`
+}
+
+// DeviceConstraint must have exactly one field set besides Requests.
+type DeviceConstraint struct {
+ // Requests is a list of the one or more requests in this claim which
+ // must co-satisfy this constraint. If a request is fulfilled by
+ // multiple devices, then all of the devices must satisfy the
+ // constraint. If this is not specified, this constraint applies to all
+ // requests in this claim.
+ //
+ // +optional
+ // +listType=atomic
+ Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
+
+ // MatchAttribute requires that all devices in question have this
+ // attribute and that its type and value are the same across those
+ // devices.
+ //
+ // For example, if you specified "dra.example.com/numa" (a hypothetical example!),
+ // then only devices in the same NUMA node will be chosen. A device which
+ // does not have that attribute will not be chosen. All devices should
+ // use a value of the same type for this attribute because that is part of
+ // its specification, but if one device doesn't, then it also will not be
+ // chosen.
+ //
+ // Must include the domain qualifier.
+ //
+ // +optional
+ // +oneOf=ConstraintType
+ MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"`
+}
+
+// DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.
+type DeviceClaimConfiguration struct {
+ // Requests lists the names of requests where the configuration applies.
+ // If empty, it applies to all requests.
+ //
+ // +optional
+ // +listType=atomic
+ Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
+
+ DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"`
+}
+
+// DeviceConfiguration must have exactly one field set. It gets embedded
+// inline in some other structs which have other fields, so field names must
+// not conflict with those.
+type DeviceConfiguration struct {
+ // Opaque provides driver-specific configuration parameters.
+ //
+ // +optional
+ // +oneOf=ConfigurationType
+ Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"`
+}
+
+// OpaqueDeviceConfiguration contains configuration parameters for a driver
+// in a format defined by the driver vendor.
+type OpaqueDeviceConfiguration struct {
+ // Driver is used to determine which kubelet plugin needs
+ // to be passed these configuration parameters.
+ //
+ // An admission policy provided by the driver developer could use this
+ // to decide whether it needs to validate them.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver.
+ //
+ // +required
+ Driver string `json:"driver" protobuf:"bytes,1,name=driver"`
+
+ // Parameters can contain arbitrary data. It is the responsibility of
+ // the driver developer to handle validation and versioning. Typically this
+ // includes self-identification and a version ("kind" + "apiVersion" for
+ // Kubernetes types), with conversion between different versions.
+ //
+ // +required
+ Parameters runtime.RawExtension `json:"parameters" protobuf:"bytes,2,name=parameters"`
+}
+
+// ResourceClaimStatus tracks whether the resource has been allocated and what
+// the result of that was.
+type ResourceClaimStatus struct {
+ // Allocation is set once the claim has been allocated successfully.
+ //
+ // +optional
+ Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"`
+
+ // ReservedFor indicates which entities are currently allowed to use
+ // the claim. A Pod which references a ResourceClaim which is not
+ // reserved for that Pod will not be started. A claim that is in
+ // use or might be in use because it has been reserved must not get
+ // deallocated.
+ //
+ // In a cluster with multiple scheduler instances, two pods might get
+ // scheduled concurrently by different schedulers. When they reference
+ // the same ResourceClaim which already has reached its maximum number
+ // of consumers, only one pod can be scheduled.
+ //
+ // Both schedulers try to add their pod to the claim.status.reservedFor
+ // field, but only the update that reaches the API server first gets
+ // stored. The other one fails with an error and the scheduler
+ // which issued it knows that it must put the pod back into the queue,
+ // waiting for the ResourceClaim to become usable again.
+ //
+ // There can be at most 32 such reservations. This may get increased in
+ // the future, but not reduced.
+ //
+ // +optional
+ // +listType=map
+ // +listMapKey=uid
+ // +patchStrategy=merge
+ // +patchMergeKey=uid
+ ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"`
+
+ // Indicates that a claim is to be deallocated. While this is set,
+ // no new consumers may be added to ReservedFor.
+ //
+ // This is only used if the claim needs to be deallocated by a DRA driver.
+ // That driver then must deallocate this claim and reset the field
+ // together with clearing the Allocation field.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ DeallocationRequested bool `json:"deallocationRequested,omitempty" protobuf:"bytes,3,opt,name=deallocationRequested"`
+}
+
+// ReservedForMaxSize is the maximum number of entries in
+// claim.status.reservedFor.
+const ResourceClaimReservedForMaxSize = 32
+
+// ResourceClaimConsumerReference contains enough information to let you
+// locate the consumer of a ResourceClaim. The user must be a resource in the same
+// namespace as the ResourceClaim.
+type ResourceClaimConsumerReference struct {
+ // APIGroup is the group for the resource being referenced. It is
+ // empty for the core API. This matches the group in the APIVersion
+ // that is used when creating the resources.
+ // +optional
+ APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"`
+ // Resource is the type of resource being referenced, for example "pods".
+ // +required
+ Resource string `json:"resource" protobuf:"bytes,3,name=resource"`
+ // Name is the name of resource being referenced.
+ // +required
+ Name string `json:"name" protobuf:"bytes,4,name=name"`
+ // UID identifies exactly one incarnation of the resource.
+ // +required
+ UID types.UID `json:"uid" protobuf:"bytes,5,name=uid"`
+}
+
+// AllocationResult contains attributes of an allocated resource.
+type AllocationResult struct {
+ // Devices is the result of allocating devices.
+ //
+ // +optional
+ Devices DeviceAllocationResult `json:"devices,omitempty" protobuf:"bytes,1,opt,name=devices"`
+
+ // NodeSelector defines where the allocated resources are available. If
+ // unset, they are available everywhere.
+ //
+ // +optional
+ NodeSelector *v1.NodeSelector `json:"nodeSelector,omitempty" protobuf:"bytes,3,opt,name=nodeSelector"`
+
+ // Controller is the name of the DRA driver which handled the
+ // allocation. That driver is also responsible for deallocating the
+ // claim. It is empty when the claim can be deallocated without
+ // involving a driver.
+ //
+ // A driver may allocate devices provided by other drivers, so this
+ // driver name here can be different from the driver names listed for
+ // the results.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ Controller string `json:"controller,omitempty" protobuf:"bytes,4,opt,name=controller"`
+}
+
+// DeviceAllocationResult is the result of allocating devices.
+type DeviceAllocationResult struct {
+ // Results lists all allocated devices.
+ //
+ // +optional
+ // +listType=atomic
+ Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"`
+
+ // This field is a combination of all the claim and class configuration parameters.
+ // Drivers can distinguish between those based on a flag.
+ //
+ // This includes configuration parameters for drivers which have no allocated
+ // devices in the result because it is up to the drivers which configuration
+ // parameters they support. They can silently ignore unknown configuration
+ // parameters.
+ //
+ // +optional
+ // +listType=atomic
+ Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
+}
+
+// AllocationResultsMaxSize represents the maximum number of
+// entries in allocation.devices.results.
+const AllocationResultsMaxSize = 32
+
+// DeviceRequestAllocationResult contains the allocation result for one request.
+type DeviceRequestAllocationResult struct {
+ // Request is the name of the request in the claim which caused this
+ // device to be allocated. Multiple devices may have been allocated
+ // per request.
+ //
+ // +required
+ Request string `json:"request" protobuf:"bytes,1,name=request"`
+
+ // Driver specifies the name of the DRA driver whose kubelet
+ // plugin should be invoked to process the allocation once the claim is
+ // needed on a node.
+ //
+ // Must be a DNS subdomain and should end with a DNS domain owned by the
+ // vendor of the driver.
+ //
+ // +required
+ Driver string `json:"driver" protobuf:"bytes,2,name=driver"`
+
+ // This name together with the driver name and the device name field
+ // identify which device was allocated (`//`).
+ //
+ // Must not be longer than 253 characters and may contain one or more
+ // DNS sub-domains separated by slashes.
+ //
+ // +required
+ Pool string `json:"pool" protobuf:"bytes,3,name=pool"`
+
+ // Device references one device instance via its name in the driver's
+ // resource pool. It must be a DNS label.
+ //
+ // +required
+ Device string `json:"device" protobuf:"bytes,4,name=device"`
+}
+
+// DeviceAllocationConfiguration gets embedded in an AllocationResult.
+type DeviceAllocationConfiguration struct {
+ // Source records whether the configuration comes from a class and thus
+ // is not something that a normal user would have been able to set
+ // or from a claim.
+ //
+ // +required
+ Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"`
+
+ // Requests lists the names of requests where the configuration applies.
+ // If empty, its applies to all requests.
+ //
+ // +optional
+ // +listType=atomic
+ Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"`
+
+ DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"`
+}
+
+type AllocationConfigSource string
+
+// Valid [DeviceAllocationConfiguration.Source] values.
+const (
+ AllocationConfigSourceClass = "FromClass"
+ AllocationConfigSourceClaim = "FromClaim"
+)
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.26
+
+// ResourceClaimList is a collection of claims.
+type ResourceClaimList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Items is the list of resource claims.
+ Items []ResourceClaim `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.26
+
+// PodSchedulingContext objects hold information that is needed to schedule
+// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation
+// mode.
+//
+// This is an alpha type and requires enabling the DRAControlPlaneController
+// feature gate.
+type PodSchedulingContext struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Spec describes where resources for the Pod are needed.
+ Spec PodSchedulingContextSpec `json:"spec" protobuf:"bytes,2,name=spec"`
+
+ // Status describes where resources for the Pod can be allocated.
+ //
+ // +optional
+ Status PodSchedulingContextStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
+}
+
+// PodSchedulingContextSpec describes where resources for the Pod are needed.
+type PodSchedulingContextSpec struct {
+ // SelectedNode is the node for which allocation of ResourceClaims that
+ // are referenced by the Pod and that use "WaitForFirstConsumer"
+ // allocation is to be attempted.
+ //
+ // +optional
+ SelectedNode string `json:"selectedNode,omitempty" protobuf:"bytes,1,opt,name=selectedNode"`
+
+ // PotentialNodes lists nodes where the Pod might be able to run.
+ //
+ // The size of this field is limited to 128. This is large enough for
+ // many clusters. Larger clusters may need more attempts to find a node
+ // that suits all pending resources. This may get increased in the
+ // future, but not reduced.
+ //
+ // +optional
+ // +listType=atomic
+ PotentialNodes []string `json:"potentialNodes,omitempty" protobuf:"bytes,2,opt,name=potentialNodes"`
+}
+
+// PodSchedulingContextStatus describes where resources for the Pod can be allocated.
+type PodSchedulingContextStatus struct {
+ // ResourceClaims describes resource availability for each
+ // pod.spec.resourceClaim entry where the corresponding ResourceClaim
+ // uses "WaitForFirstConsumer" allocation mode.
+ //
+ // +listType=map
+ // +listMapKey=name
+ // +optional
+ ResourceClaims []ResourceClaimSchedulingStatus `json:"resourceClaims,omitempty" protobuf:"bytes,1,opt,name=resourceClaims"`
+
+ // If there ever is a need to support other kinds of resources
+ // than ResourceClaim, then new fields could get added here
+ // for those other resources.
+}
+
+// ResourceClaimSchedulingStatus contains information about one particular
+// ResourceClaim with "WaitForFirstConsumer" allocation mode.
+type ResourceClaimSchedulingStatus struct {
+ // Name matches the pod.spec.resourceClaims[*].Name field.
+ //
+ // +required
+ Name string `json:"name" protobuf:"bytes,1,name=name"`
+
+ // UnsuitableNodes lists nodes that the ResourceClaim cannot be
+ // allocated for.
+ //
+ // The size of this field is limited to 128, the same as for
+ // PodSchedulingSpec.PotentialNodes. This may get increased in the
+ // future, but not reduced.
+ //
+ // +optional
+ // +listType=atomic
+ UnsuitableNodes []string `json:"unsuitableNodes,omitempty" protobuf:"bytes,2,opt,name=unsuitableNodes"`
+}
+
+// PodSchedulingNodeListMaxSize defines the maximum number of entries in the
+// node lists that are stored in PodSchedulingContext objects. This limit is part
+// of the API.
+const PodSchedulingNodeListMaxSize = 128
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.26
+
+// PodSchedulingContextList is a collection of Pod scheduling objects.
+type PodSchedulingContextList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Items is the list of PodSchedulingContext objects.
+ Items []PodSchedulingContext `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
+
+// +genclient
+// +genclient:nonNamespaced
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+
+// DeviceClass is a vendor- or admin-provided resource that contains
+// device configuration and selectors. It can be referenced in
+// the device requests of a claim to apply these presets.
+// Cluster scoped.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+type DeviceClass struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Spec defines what can be allocated and how to configure it.
+ //
+ // This is mutable. Consumers have to be prepared for classes changing
+ // at any time, either because they get updated or replaced. Claim
+ // allocations are done once based on whatever was set in classes at
+ // the time of allocation.
+ //
+ // Changing the spec automatically increments the metadata.generation number.
+ Spec DeviceClassSpec `json:"spec" protobuf:"bytes,2,name=spec"`
+}
+
+// DeviceClassSpec is used in a [DeviceClass] to define what can be allocated
+// and how to configure it.
+type DeviceClassSpec struct {
+ // Each selector must be satisfied by a device which is claimed via this class.
+ //
+ // +optional
+ // +listType=atomic
+ Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"`
+
+ // Config defines configuration parameters that apply to each device that is claimed via this class.
+ // Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor
+ // configuration applies to exactly one driver.
+ //
+ // They are passed to the driver, but are not considered while allocating the claim.
+ //
+ // +optional
+ // +listType=atomic
+ Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
+
+ // Only nodes matching the selector will be considered by the scheduler
+ // when trying to find a Node that fits a Pod when that Pod uses
+ // a claim that has not been allocated yet *and* that claim
+ // gets allocated through a control plane controller. It is ignored
+ // when the claim does not use a control plane controller
+ // for allocation.
+ //
+ // Setting this field is optional. If unset, all Nodes are candidates.
+ //
+ // This is an alpha field and requires enabling the DRAControlPlaneController
+ // feature gate.
+ //
+ // +optional
+ // +featureGate=DRAControlPlaneController
+ SuitableNodes *v1.NodeSelector `json:"suitableNodes,omitempty" protobuf:"bytes,3,opt,name=suitableNodes"`
+}
+
+// DeviceClassConfiguration is used in DeviceClass.
+type DeviceClassConfiguration struct {
+ DeviceConfiguration `json:",inline" protobuf:"bytes,1,opt,name=deviceConfiguration"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.26
+
+// DeviceClassList is a collection of classes.
+type DeviceClassList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Items is the list of resource classes.
+ Items []DeviceClass `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.26
+
+// ResourceClaimTemplate is used to produce ResourceClaim objects.
+//
+// This is an alpha type and requires enabling the DynamicResourceAllocation
+// feature gate.
+type ResourceClaimTemplate struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Describes the ResourceClaim that is to be generated.
+ //
+ // This field is immutable. A ResourceClaim will get created by the
+ // control plane for a Pod when needed and then not get updated
+ // anymore.
+ Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"`
+}
+
+// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.
+type ResourceClaimTemplateSpec struct {
+ // ObjectMeta may contain labels and annotations that will be copied into the PVC
+ // when creating it. No other fields are allowed and will be rejected during
+ // validation.
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Spec for the ResourceClaim. The entire content is copied unchanged
+ // into the ResourceClaim that gets created from this template. The
+ // same fields as in a ResourceClaim are also valid here.
+ Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.26
+
+// ResourceClaimTemplateList is a collection of claim templates.
+type ResourceClaimTemplateList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Items is the list of resource claim templates.
+ Items []ResourceClaimTemplate `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
diff --git a/vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go b/vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go
new file mode 100644
index 00000000000..1a44a971db8
--- /dev/null
+++ b/vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go
@@ -0,0 +1,404 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha3
+
+// This file contains a collection of methods that can be used from go-restful to
+// generate Swagger API documentation for its models. Please read this PR for more
+// information on the implementation: https://github.com/emicklei/go-restful/pull/215
+//
+// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
+// they are on one line! For multiple line or blocks that you want to ignore use ---.
+// Any context after a --- is ignored.
+//
+// Those methods can be generated by using hack/update-codegen.sh
+
+// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
+var map_AllocationResult = map[string]string{
+ "": "AllocationResult contains attributes of an allocated resource.",
+ "devices": "Devices is the result of allocating devices.",
+ "nodeSelector": "NodeSelector defines where the allocated resources are available. If unset, they are available everywhere.",
+ "controller": "Controller is the name of the DRA driver which handled the allocation. That driver is also responsible for deallocating the claim. It is empty when the claim can be deallocated without involving a driver.\n\nA driver may allocate devices provided by other drivers, so this driver name here can be different from the driver names listed for the results.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.",
+}
+
+func (AllocationResult) SwaggerDoc() map[string]string {
+ return map_AllocationResult
+}
+
+var map_BasicDevice = map[string]string{
+ "": "BasicDevice defines one device instance.",
+ "attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
+ "capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
+}
+
+func (BasicDevice) SwaggerDoc() map[string]string {
+ return map_BasicDevice
+}
+
+var map_CELDeviceSelector = map[string]string{
+ "": "CELDeviceSelector contains a CEL expression for selecting a device.",
+ "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)",
+}
+
+func (CELDeviceSelector) SwaggerDoc() map[string]string {
+ return map_CELDeviceSelector
+}
+
+var map_Device = map[string]string{
+ "": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
+ "name": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.",
+ "basic": "Basic defines one device instance.",
+}
+
+func (Device) SwaggerDoc() map[string]string {
+ return map_Device
+}
+
+var map_DeviceAllocationConfiguration = map[string]string{
+ "": "DeviceAllocationConfiguration gets embedded in an AllocationResult.",
+ "source": "Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim.",
+ "requests": "Requests lists the names of requests where the configuration applies. If empty, its applies to all requests.",
+}
+
+func (DeviceAllocationConfiguration) SwaggerDoc() map[string]string {
+ return map_DeviceAllocationConfiguration
+}
+
+var map_DeviceAllocationResult = map[string]string{
+ "": "DeviceAllocationResult is the result of allocating devices.",
+ "results": "Results lists all allocated devices.",
+ "config": "This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag.\n\nThis includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters.",
+}
+
+func (DeviceAllocationResult) SwaggerDoc() map[string]string {
+ return map_DeviceAllocationResult
+}
+
+var map_DeviceAttribute = map[string]string{
+ "": "DeviceAttribute must have exactly one field set.",
+ "int": "IntValue is a number.",
+ "bool": "BoolValue is a true/false value.",
+ "string": "StringValue is a string. Must not be longer than 64 characters.",
+ "version": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.",
+}
+
+func (DeviceAttribute) SwaggerDoc() map[string]string {
+ return map_DeviceAttribute
+}
+
+var map_DeviceClaim = map[string]string{
+ "": "DeviceClaim defines how to request devices with a ResourceClaim.",
+ "requests": "Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated.",
+ "constraints": "These constraints must be satisfied by the set of devices that get allocated for the claim.",
+ "config": "This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim.",
+}
+
+func (DeviceClaim) SwaggerDoc() map[string]string {
+ return map_DeviceClaim
+}
+
+var map_DeviceClaimConfiguration = map[string]string{
+ "": "DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.",
+ "requests": "Requests lists the names of requests where the configuration applies. If empty, it applies to all requests.",
+}
+
+func (DeviceClaimConfiguration) SwaggerDoc() map[string]string {
+ return map_DeviceClaimConfiguration
+}
+
+var map_DeviceClass = map[string]string{
+ "": "DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
+ "metadata": "Standard object metadata",
+ "spec": "Spec defines what can be allocated and how to configure it.\n\nThis is mutable. Consumers have to be prepared for classes changing at any time, either because they get updated or replaced. Claim allocations are done once based on whatever was set in classes at the time of allocation.\n\nChanging the spec automatically increments the metadata.generation number.",
+}
+
+func (DeviceClass) SwaggerDoc() map[string]string {
+ return map_DeviceClass
+}
+
+var map_DeviceClassConfiguration = map[string]string{
+ "": "DeviceClassConfiguration is used in DeviceClass.",
+}
+
+func (DeviceClassConfiguration) SwaggerDoc() map[string]string {
+ return map_DeviceClassConfiguration
+}
+
+var map_DeviceClassList = map[string]string{
+ "": "DeviceClassList is a collection of classes.",
+ "metadata": "Standard list metadata",
+ "items": "Items is the list of resource classes.",
+}
+
+func (DeviceClassList) SwaggerDoc() map[string]string {
+ return map_DeviceClassList
+}
+
+var map_DeviceClassSpec = map[string]string{
+ "": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.",
+ "selectors": "Each selector must be satisfied by a device which is claimed via this class.",
+ "config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.",
+ "suitableNodes": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a claim that has not been allocated yet *and* that claim gets allocated through a control plane controller. It is ignored when the claim does not use a control plane controller for allocation.\n\nSetting this field is optional. If unset, all Nodes are candidates.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.",
+}
+
+func (DeviceClassSpec) SwaggerDoc() map[string]string {
+ return map_DeviceClassSpec
+}
+
+var map_DeviceConfiguration = map[string]string{
+ "": "DeviceConfiguration must have exactly one field set. It gets embedded inline in some other structs which have other fields, so field names must not conflict with those.",
+ "opaque": "Opaque provides driver-specific configuration parameters.",
+}
+
+func (DeviceConfiguration) SwaggerDoc() map[string]string {
+ return map_DeviceConfiguration
+}
+
+var map_DeviceConstraint = map[string]string{
+ "": "DeviceConstraint must have exactly one field set besides Requests.",
+ "requests": "Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim.",
+ "matchAttribute": "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nMust include the domain qualifier.",
+}
+
+func (DeviceConstraint) SwaggerDoc() map[string]string {
+ return map_DeviceConstraint
+}
+
+var map_DeviceRequest = map[string]string{
+ "": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nA DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request.",
+ "name": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nMust be a DNS label.",
+ "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.",
+ "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.",
+ "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AlloctionMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.",
+ "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.",
+ "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.",
+}
+
+func (DeviceRequest) SwaggerDoc() map[string]string {
+ return map_DeviceRequest
+}
+
+var map_DeviceRequestAllocationResult = map[string]string{
+ "": "DeviceRequestAllocationResult contains the allocation result for one request.",
+ "request": "Request is the name of the request in the claim which caused this device to be allocated. Multiple devices may have been allocated per request.",
+ "driver": "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.",
+ "pool": "This name together with the driver name and the device name field identify which device was allocated (`//`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.",
+ "device": "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.",
+}
+
+func (DeviceRequestAllocationResult) SwaggerDoc() map[string]string {
+ return map_DeviceRequestAllocationResult
+}
+
+var map_DeviceSelector = map[string]string{
+ "": "DeviceSelector must have exactly one field set.",
+ "cel": "CEL contains a CEL expression for selecting a device.",
+}
+
+func (DeviceSelector) SwaggerDoc() map[string]string {
+ return map_DeviceSelector
+}
+
+var map_OpaqueDeviceConfiguration = map[string]string{
+ "": "OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor.",
+ "driver": "Driver is used to determine which kubelet plugin needs to be passed these configuration parameters.\n\nAn admission policy provided by the driver developer could use this to decide whether it needs to validate them.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.",
+ "parameters": "Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions.",
+}
+
+func (OpaqueDeviceConfiguration) SwaggerDoc() map[string]string {
+ return map_OpaqueDeviceConfiguration
+}
+
+var map_PodSchedulingContext = map[string]string{
+ "": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DRAControlPlaneController feature gate.",
+ "metadata": "Standard object metadata",
+ "spec": "Spec describes where resources for the Pod are needed.",
+ "status": "Status describes where resources for the Pod can be allocated.",
+}
+
+func (PodSchedulingContext) SwaggerDoc() map[string]string {
+ return map_PodSchedulingContext
+}
+
+var map_PodSchedulingContextList = map[string]string{
+ "": "PodSchedulingContextList is a collection of Pod scheduling objects.",
+ "metadata": "Standard list metadata",
+ "items": "Items is the list of PodSchedulingContext objects.",
+}
+
+func (PodSchedulingContextList) SwaggerDoc() map[string]string {
+ return map_PodSchedulingContextList
+}
+
+var map_PodSchedulingContextSpec = map[string]string{
+ "": "PodSchedulingContextSpec describes where resources for the Pod are needed.",
+ "selectedNode": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.",
+ "potentialNodes": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.",
+}
+
+func (PodSchedulingContextSpec) SwaggerDoc() map[string]string {
+ return map_PodSchedulingContextSpec
+}
+
+var map_PodSchedulingContextStatus = map[string]string{
+ "": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.",
+ "resourceClaims": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.",
+}
+
+func (PodSchedulingContextStatus) SwaggerDoc() map[string]string {
+ return map_PodSchedulingContextStatus
+}
+
+var map_ResourceClaim = map[string]string{
+ "": "ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
+ "metadata": "Standard object metadata",
+ "spec": "Spec describes what is being requested and how to configure it. The spec is immutable.",
+ "status": "Status describes whether the claim is ready to use and what has been allocated.",
+}
+
+func (ResourceClaim) SwaggerDoc() map[string]string {
+ return map_ResourceClaim
+}
+
+var map_ResourceClaimConsumerReference = map[string]string{
+ "": "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.",
+ "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.",
+ "resource": "Resource is the type of resource being referenced, for example \"pods\".",
+ "name": "Name is the name of resource being referenced.",
+ "uid": "UID identifies exactly one incarnation of the resource.",
+}
+
+func (ResourceClaimConsumerReference) SwaggerDoc() map[string]string {
+ return map_ResourceClaimConsumerReference
+}
+
+var map_ResourceClaimList = map[string]string{
+ "": "ResourceClaimList is a collection of claims.",
+ "metadata": "Standard list metadata",
+ "items": "Items is the list of resource claims.",
+}
+
+func (ResourceClaimList) SwaggerDoc() map[string]string {
+ return map_ResourceClaimList
+}
+
+var map_ResourceClaimSchedulingStatus = map[string]string{
+ "": "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.",
+ "name": "Name matches the pod.spec.resourceClaims[*].Name field.",
+ "unsuitableNodes": "UnsuitableNodes lists nodes that the ResourceClaim cannot be allocated for.\n\nThe size of this field is limited to 128, the same as for PodSchedulingSpec.PotentialNodes. This may get increased in the future, but not reduced.",
+}
+
+func (ResourceClaimSchedulingStatus) SwaggerDoc() map[string]string {
+ return map_ResourceClaimSchedulingStatus
+}
+
+var map_ResourceClaimSpec = map[string]string{
+ "": "ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.",
+ "devices": "Devices defines how to request devices.",
+ "controller": "Controller is the name of the DRA driver that is meant to handle allocation of this claim. If empty, allocation is handled by the scheduler while scheduling a pod.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.",
+}
+
+func (ResourceClaimSpec) SwaggerDoc() map[string]string {
+ return map_ResourceClaimSpec
+}
+
+var map_ResourceClaimStatus = map[string]string{
+ "": "ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.",
+ "allocation": "Allocation is set once the claim has been allocated successfully.",
+ "reservedFor": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.\n\nIn a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.\n\nBoth schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.",
+ "deallocationRequested": "Indicates that a claim is to be deallocated. While this is set, no new consumers may be added to ReservedFor.\n\nThis is only used if the claim needs to be deallocated by a DRA driver. That driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.",
+}
+
+func (ResourceClaimStatus) SwaggerDoc() map[string]string {
+ return map_ResourceClaimStatus
+}
+
+var map_ResourceClaimTemplate = map[string]string{
+ "": "ResourceClaimTemplate is used to produce ResourceClaim objects.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
+ "metadata": "Standard object metadata",
+ "spec": "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore.",
+}
+
+func (ResourceClaimTemplate) SwaggerDoc() map[string]string {
+ return map_ResourceClaimTemplate
+}
+
+var map_ResourceClaimTemplateList = map[string]string{
+ "": "ResourceClaimTemplateList is a collection of claim templates.",
+ "metadata": "Standard list metadata",
+ "items": "Items is the list of resource claim templates.",
+}
+
+func (ResourceClaimTemplateList) SwaggerDoc() map[string]string {
+ return map_ResourceClaimTemplateList
+}
+
+var map_ResourceClaimTemplateSpec = map[string]string{
+ "": "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.",
+ "metadata": "ObjectMeta may contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.",
+ "spec": "Spec for the ResourceClaim. The entire content is copied unchanged into the ResourceClaim that gets created from this template. The same fields as in a ResourceClaim are also valid here.",
+}
+
+func (ResourceClaimTemplateSpec) SwaggerDoc() map[string]string {
+ return map_ResourceClaimTemplateSpec
+}
+
+var map_ResourcePool = map[string]string{
+ "": "ResourcePool describes the pool that ResourceSlices belong to.",
+ "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.",
+ "generation": "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.",
+ "resourceSliceCount": "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.",
+}
+
+func (ResourcePool) SwaggerDoc() map[string]string {
+ return map_ResourcePool
+}
+
+var map_ResourceSlice = map[string]string{
+ "": "ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.\n\nAt the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple , , .\n\nWhenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.\n\nWhen allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.\n\nFor resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
+ "metadata": "Standard object metadata",
+ "spec": "Contains the information published by the driver.\n\nChanging the spec automatically increments the metadata.generation number.",
+}
+
+func (ResourceSlice) SwaggerDoc() map[string]string {
+ return map_ResourceSlice
+}
+
+var map_ResourceSliceList = map[string]string{
+ "": "ResourceSliceList is a collection of ResourceSlices.",
+ "metadata": "Standard list metadata",
+ "items": "Items is the list of resource ResourceSlices.",
+}
+
+func (ResourceSliceList) SwaggerDoc() map[string]string {
+ return map_ResourceSliceList
+}
+
+var map_ResourceSliceSpec = map[string]string{
+ "": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
+ "driver": "Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable.",
+ "pool": "Pool describes the pool that this ResourceSlice belongs to.",
+ "nodeName": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
+ "nodeSelector": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
+ "allNodes": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
+ "devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.",
+}
+
+func (ResourceSliceSpec) SwaggerDoc() map[string]string {
+ return map_ResourceSliceSpec
+}
+
+// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/vendor/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go b/vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go
similarity index 60%
rename from vendor/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go
rename to vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go
index 52de8e1ad53..58171df1f2d 100644
--- a/vendor/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go
@@ -19,25 +19,20 @@ limitations under the License.
// Code generated by deepcopy-gen. DO NOT EDIT.
-package v1alpha2
+package v1alpha3
import (
v1 "k8s.io/api/core/v1"
+ resource "k8s.io/apimachinery/pkg/api/resource"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AllocationResult) DeepCopyInto(out *AllocationResult) {
*out = *in
- if in.ResourceHandles != nil {
- in, out := &in.ResourceHandles, &out.ResourceHandles
- *out = make([]ResourceHandle, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- if in.AvailableOnNodes != nil {
- in, out := &in.AvailableOnNodes, &out.AvailableOnNodes
+ in.Devices.DeepCopyInto(&out.Devices)
+ if in.NodeSelector != nil {
+ in, out := &in.NodeSelector, &out.NodeSelector
*out = new(v1.NodeSelector)
(*in).DeepCopyInto(*out)
}
@@ -55,134 +50,140 @@ func (in *AllocationResult) DeepCopy() *AllocationResult {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *AllocationResultModel) DeepCopyInto(out *AllocationResultModel) {
+func (in *BasicDevice) DeepCopyInto(out *BasicDevice) {
*out = *in
- if in.NamedResources != nil {
- in, out := &in.NamedResources, &out.NamedResources
- *out = new(NamedResourcesAllocationResult)
- **out = **in
+ if in.Attributes != nil {
+ in, out := &in.Attributes, &out.Attributes
+ *out = make(map[QualifiedName]DeviceAttribute, len(*in))
+ for key, val := range *in {
+ (*out)[key] = *val.DeepCopy()
+ }
+ }
+ if in.Capacity != nil {
+ in, out := &in.Capacity, &out.Capacity
+ *out = make(map[QualifiedName]resource.Quantity, len(*in))
+ for key, val := range *in {
+ (*out)[key] = val.DeepCopy()
+ }
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllocationResultModel.
-func (in *AllocationResultModel) DeepCopy() *AllocationResultModel {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicDevice.
+func (in *BasicDevice) DeepCopy() *BasicDevice {
if in == nil {
return nil
}
- out := new(AllocationResultModel)
+ out := new(BasicDevice)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *DriverAllocationResult) DeepCopyInto(out *DriverAllocationResult) {
+func (in *CELDeviceSelector) DeepCopyInto(out *CELDeviceSelector) {
*out = *in
- in.VendorRequestParameters.DeepCopyInto(&out.VendorRequestParameters)
- in.AllocationResultModel.DeepCopyInto(&out.AllocationResultModel)
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverAllocationResult.
-func (in *DriverAllocationResult) DeepCopy() *DriverAllocationResult {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CELDeviceSelector.
+func (in *CELDeviceSelector) DeepCopy() *CELDeviceSelector {
if in == nil {
return nil
}
- out := new(DriverAllocationResult)
+ out := new(CELDeviceSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *DriverRequests) DeepCopyInto(out *DriverRequests) {
+func (in *Device) DeepCopyInto(out *Device) {
*out = *in
- in.VendorParameters.DeepCopyInto(&out.VendorParameters)
- if in.Requests != nil {
- in, out := &in.Requests, &out.Requests
- *out = make([]ResourceRequest, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
+ if in.Basic != nil {
+ in, out := &in.Basic, &out.Basic
+ *out = new(BasicDevice)
+ (*in).DeepCopyInto(*out)
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverRequests.
-func (in *DriverRequests) DeepCopy() *DriverRequests {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.
+func (in *Device) DeepCopy() *Device {
if in == nil {
return nil
}
- out := new(DriverRequests)
+ out := new(Device)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesAllocationResult) DeepCopyInto(out *NamedResourcesAllocationResult) {
+func (in *DeviceAllocationConfiguration) DeepCopyInto(out *DeviceAllocationConfiguration) {
*out = *in
+ if in.Requests != nil {
+ in, out := &in.Requests, &out.Requests
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration)
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAllocationResult.
-func (in *NamedResourcesAllocationResult) DeepCopy() *NamedResourcesAllocationResult {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAllocationConfiguration.
+func (in *DeviceAllocationConfiguration) DeepCopy() *DeviceAllocationConfiguration {
if in == nil {
return nil
}
- out := new(NamedResourcesAllocationResult)
+ out := new(DeviceAllocationConfiguration)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesAttribute) DeepCopyInto(out *NamedResourcesAttribute) {
+func (in *DeviceAllocationResult) DeepCopyInto(out *DeviceAllocationResult) {
*out = *in
- in.NamedResourcesAttributeValue.DeepCopyInto(&out.NamedResourcesAttributeValue)
+ if in.Results != nil {
+ in, out := &in.Results, &out.Results
+ *out = make([]DeviceRequestAllocationResult, len(*in))
+ copy(*out, *in)
+ }
+ if in.Config != nil {
+ in, out := &in.Config, &out.Config
+ *out = make([]DeviceAllocationConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAttribute.
-func (in *NamedResourcesAttribute) DeepCopy() *NamedResourcesAttribute {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAllocationResult.
+func (in *DeviceAllocationResult) DeepCopy() *DeviceAllocationResult {
if in == nil {
return nil
}
- out := new(NamedResourcesAttribute)
+ out := new(DeviceAllocationResult)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesAttributeValue) DeepCopyInto(out *NamedResourcesAttributeValue) {
+func (in *DeviceAttribute) DeepCopyInto(out *DeviceAttribute) {
*out = *in
- if in.QuantityValue != nil {
- in, out := &in.QuantityValue, &out.QuantityValue
- x := (*in).DeepCopy()
- *out = &x
- }
- if in.BoolValue != nil {
- in, out := &in.BoolValue, &out.BoolValue
- *out = new(bool)
- **out = **in
- }
if in.IntValue != nil {
in, out := &in.IntValue, &out.IntValue
*out = new(int64)
**out = **in
}
- if in.IntSliceValue != nil {
- in, out := &in.IntSliceValue, &out.IntSliceValue
- *out = new(NamedResourcesIntSlice)
- (*in).DeepCopyInto(*out)
+ if in.BoolValue != nil {
+ in, out := &in.BoolValue, &out.BoolValue
+ *out = new(bool)
+ **out = **in
}
if in.StringValue != nil {
in, out := &in.StringValue, &out.StringValue
*out = new(string)
**out = **in
}
- if in.StringSliceValue != nil {
- in, out := &in.StringSliceValue, &out.StringSliceValue
- *out = new(NamedResourcesStringSlice)
- (*in).DeepCopyInto(*out)
- }
if in.VersionValue != nil {
in, out := &in.VersionValue, &out.VersionValue
*out = new(string)
@@ -191,38 +192,127 @@ func (in *NamedResourcesAttributeValue) DeepCopyInto(out *NamedResourcesAttribut
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAttributeValue.
-func (in *NamedResourcesAttributeValue) DeepCopy() *NamedResourcesAttributeValue {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAttribute.
+func (in *DeviceAttribute) DeepCopy() *DeviceAttribute {
if in == nil {
return nil
}
- out := new(NamedResourcesAttributeValue)
+ out := new(DeviceAttribute)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesFilter) DeepCopyInto(out *NamedResourcesFilter) {
+func (in *DeviceClaim) DeepCopyInto(out *DeviceClaim) {
*out = *in
+ if in.Requests != nil {
+ in, out := &in.Requests, &out.Requests
+ *out = make([]DeviceRequest, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.Constraints != nil {
+ in, out := &in.Constraints, &out.Constraints
+ *out = make([]DeviceConstraint, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.Config != nil {
+ in, out := &in.Config, &out.Config
+ *out = make([]DeviceClaimConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesFilter.
-func (in *NamedResourcesFilter) DeepCopy() *NamedResourcesFilter {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaim.
+func (in *DeviceClaim) DeepCopy() *DeviceClaim {
if in == nil {
return nil
}
- out := new(NamedResourcesFilter)
+ out := new(DeviceClaim)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesInstance) DeepCopyInto(out *NamedResourcesInstance) {
+func (in *DeviceClaimConfiguration) DeepCopyInto(out *DeviceClaimConfiguration) {
*out = *in
- if in.Attributes != nil {
- in, out := &in.Attributes, &out.Attributes
- *out = make([]NamedResourcesAttribute, len(*in))
+ if in.Requests != nil {
+ in, out := &in.Requests, &out.Requests
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaimConfiguration.
+func (in *DeviceClaimConfiguration) DeepCopy() *DeviceClaimConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(DeviceClaimConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeviceClass) DeepCopyInto(out *DeviceClass) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClass.
+func (in *DeviceClass) DeepCopy() *DeviceClass {
+ if in == nil {
+ return nil
+ }
+ out := new(DeviceClass)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *DeviceClass) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeviceClassConfiguration) DeepCopyInto(out *DeviceClassConfiguration) {
+ *out = *in
+ in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassConfiguration.
+func (in *DeviceClassConfiguration) DeepCopy() *DeviceClassConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(DeviceClassConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeviceClassList) DeepCopyInto(out *DeviceClassList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]DeviceClass, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -230,59 +320,112 @@ func (in *NamedResourcesInstance) DeepCopyInto(out *NamedResourcesInstance) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesInstance.
-func (in *NamedResourcesInstance) DeepCopy() *NamedResourcesInstance {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassList.
+func (in *DeviceClassList) DeepCopy() *DeviceClassList {
if in == nil {
return nil
}
- out := new(NamedResourcesInstance)
+ out := new(DeviceClassList)
in.DeepCopyInto(out)
return out
}
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *DeviceClassList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesIntSlice) DeepCopyInto(out *NamedResourcesIntSlice) {
+func (in *DeviceClassSpec) DeepCopyInto(out *DeviceClassSpec) {
*out = *in
- if in.Ints != nil {
- in, out := &in.Ints, &out.Ints
- *out = make([]int64, len(*in))
- copy(*out, *in)
+ if in.Selectors != nil {
+ in, out := &in.Selectors, &out.Selectors
+ *out = make([]DeviceSelector, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.Config != nil {
+ in, out := &in.Config, &out.Config
+ *out = make([]DeviceClassConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.SuitableNodes != nil {
+ in, out := &in.SuitableNodes, &out.SuitableNodes
+ *out = new(v1.NodeSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassSpec.
+func (in *DeviceClassSpec) DeepCopy() *DeviceClassSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(DeviceClassSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeviceConfiguration) DeepCopyInto(out *DeviceConfiguration) {
+ *out = *in
+ if in.Opaque != nil {
+ in, out := &in.Opaque, &out.Opaque
+ *out = new(OpaqueDeviceConfiguration)
+ (*in).DeepCopyInto(*out)
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesIntSlice.
-func (in *NamedResourcesIntSlice) DeepCopy() *NamedResourcesIntSlice {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceConfiguration.
+func (in *DeviceConfiguration) DeepCopy() *DeviceConfiguration {
if in == nil {
return nil
}
- out := new(NamedResourcesIntSlice)
+ out := new(DeviceConfiguration)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesRequest) DeepCopyInto(out *NamedResourcesRequest) {
+func (in *DeviceConstraint) DeepCopyInto(out *DeviceConstraint) {
*out = *in
+ if in.Requests != nil {
+ in, out := &in.Requests, &out.Requests
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.MatchAttribute != nil {
+ in, out := &in.MatchAttribute, &out.MatchAttribute
+ *out = new(FullyQualifiedName)
+ **out = **in
+ }
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesRequest.
-func (in *NamedResourcesRequest) DeepCopy() *NamedResourcesRequest {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceConstraint.
+func (in *DeviceConstraint) DeepCopy() *DeviceConstraint {
if in == nil {
return nil
}
- out := new(NamedResourcesRequest)
+ out := new(DeviceConstraint)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesResources) DeepCopyInto(out *NamedResourcesResources) {
+func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) {
*out = *in
- if in.Instances != nil {
- in, out := &in.Instances, &out.Instances
- *out = make([]NamedResourcesInstance, len(*in))
+ if in.Selectors != nil {
+ in, out := &in.Selectors, &out.Selectors
+ *out = make([]DeviceSelector, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -290,33 +433,66 @@ func (in *NamedResourcesResources) DeepCopyInto(out *NamedResourcesResources) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesResources.
-func (in *NamedResourcesResources) DeepCopy() *NamedResourcesResources {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceRequest.
+func (in *DeviceRequest) DeepCopy() *DeviceRequest {
if in == nil {
return nil
}
- out := new(NamedResourcesResources)
+ out := new(DeviceRequest)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *NamedResourcesStringSlice) DeepCopyInto(out *NamedResourcesStringSlice) {
+func (in *DeviceRequestAllocationResult) DeepCopyInto(out *DeviceRequestAllocationResult) {
*out = *in
- if in.Strings != nil {
- in, out := &in.Strings, &out.Strings
- *out = make([]string, len(*in))
- copy(*out, *in)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceRequestAllocationResult.
+func (in *DeviceRequestAllocationResult) DeepCopy() *DeviceRequestAllocationResult {
+ if in == nil {
+ return nil
+ }
+ out := new(DeviceRequestAllocationResult)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeviceSelector) DeepCopyInto(out *DeviceSelector) {
+ *out = *in
+ if in.CEL != nil {
+ in, out := &in.CEL, &out.CEL
+ *out = new(CELDeviceSelector)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceSelector.
+func (in *DeviceSelector) DeepCopy() *DeviceSelector {
+ if in == nil {
+ return nil
}
+ out := new(DeviceSelector)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OpaqueDeviceConfiguration) DeepCopyInto(out *OpaqueDeviceConfiguration) {
+ *out = *in
+ in.Parameters.DeepCopyInto(&out.Parameters)
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesStringSlice.
-func (in *NamedResourcesStringSlice) DeepCopy() *NamedResourcesStringSlice {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpaqueDeviceConfiguration.
+func (in *OpaqueDeviceConfiguration) DeepCopy() *OpaqueDeviceConfiguration {
if in == nil {
return nil
}
- out := new(NamedResourcesStringSlice)
+ out := new(OpaqueDeviceConfiguration)
in.DeepCopyInto(out)
return out
}
@@ -503,93 +679,6 @@ func (in *ResourceClaimList) DeepCopyObject() runtime.Object {
return nil
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClaimParameters) DeepCopyInto(out *ResourceClaimParameters) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- if in.GeneratedFrom != nil {
- in, out := &in.GeneratedFrom, &out.GeneratedFrom
- *out = new(ResourceClaimParametersReference)
- **out = **in
- }
- if in.DriverRequests != nil {
- in, out := &in.DriverRequests, &out.DriverRequests
- *out = make([]DriverRequests, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParameters.
-func (in *ResourceClaimParameters) DeepCopy() *ResourceClaimParameters {
- if in == nil {
- return nil
- }
- out := new(ResourceClaimParameters)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ResourceClaimParameters) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClaimParametersList) DeepCopyInto(out *ResourceClaimParametersList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]ResourceClaimParameters, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParametersList.
-func (in *ResourceClaimParametersList) DeepCopy() *ResourceClaimParametersList {
- if in == nil {
- return nil
- }
- out := new(ResourceClaimParametersList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ResourceClaimParametersList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClaimParametersReference) DeepCopyInto(out *ResourceClaimParametersReference) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParametersReference.
-func (in *ResourceClaimParametersReference) DeepCopy() *ResourceClaimParametersReference {
- if in == nil {
- return nil
- }
- out := new(ResourceClaimParametersReference)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceClaimSchedulingStatus) DeepCopyInto(out *ResourceClaimSchedulingStatus) {
*out = *in
@@ -614,11 +703,7 @@ func (in *ResourceClaimSchedulingStatus) DeepCopy() *ResourceClaimSchedulingStat
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceClaimSpec) DeepCopyInto(out *ResourceClaimSpec) {
*out = *in
- if in.ParametersRef != nil {
- in, out := &in.ParametersRef, &out.ParametersRef
- *out = new(ResourceClaimParametersReference)
- **out = **in
- }
+ in.Devices.DeepCopyInto(&out.Devices)
return
}
@@ -737,288 +822,17 @@ func (in *ResourceClaimTemplateSpec) DeepCopy() *ResourceClaimTemplateSpec {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClass) DeepCopyInto(out *ResourceClass) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- if in.ParametersRef != nil {
- in, out := &in.ParametersRef, &out.ParametersRef
- *out = new(ResourceClassParametersReference)
- **out = **in
- }
- if in.SuitableNodes != nil {
- in, out := &in.SuitableNodes, &out.SuitableNodes
- *out = new(v1.NodeSelector)
- (*in).DeepCopyInto(*out)
- }
- if in.StructuredParameters != nil {
- in, out := &in.StructuredParameters, &out.StructuredParameters
- *out = new(bool)
- **out = **in
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClass.
-func (in *ResourceClass) DeepCopy() *ResourceClass {
- if in == nil {
- return nil
- }
- out := new(ResourceClass)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ResourceClass) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClassList) DeepCopyInto(out *ResourceClassList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]ResourceClass, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassList.
-func (in *ResourceClassList) DeepCopy() *ResourceClassList {
- if in == nil {
- return nil
- }
- out := new(ResourceClassList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ResourceClassList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClassParameters) DeepCopyInto(out *ResourceClassParameters) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- if in.GeneratedFrom != nil {
- in, out := &in.GeneratedFrom, &out.GeneratedFrom
- *out = new(ResourceClassParametersReference)
- **out = **in
- }
- if in.VendorParameters != nil {
- in, out := &in.VendorParameters, &out.VendorParameters
- *out = make([]VendorParameters, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- if in.Filters != nil {
- in, out := &in.Filters, &out.Filters
- *out = make([]ResourceFilter, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParameters.
-func (in *ResourceClassParameters) DeepCopy() *ResourceClassParameters {
- if in == nil {
- return nil
- }
- out := new(ResourceClassParameters)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ResourceClassParameters) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClassParametersList) DeepCopyInto(out *ResourceClassParametersList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]ResourceClassParameters, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParametersList.
-func (in *ResourceClassParametersList) DeepCopy() *ResourceClassParametersList {
- if in == nil {
- return nil
- }
- out := new(ResourceClassParametersList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ResourceClassParametersList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceClassParametersReference) DeepCopyInto(out *ResourceClassParametersReference) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParametersReference.
-func (in *ResourceClassParametersReference) DeepCopy() *ResourceClassParametersReference {
- if in == nil {
- return nil
- }
- out := new(ResourceClassParametersReference)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceFilter) DeepCopyInto(out *ResourceFilter) {
- *out = *in
- in.ResourceFilterModel.DeepCopyInto(&out.ResourceFilterModel)
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilter.
-func (in *ResourceFilter) DeepCopy() *ResourceFilter {
- if in == nil {
- return nil
- }
- out := new(ResourceFilter)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceFilterModel) DeepCopyInto(out *ResourceFilterModel) {
- *out = *in
- if in.NamedResources != nil {
- in, out := &in.NamedResources, &out.NamedResources
- *out = new(NamedResourcesFilter)
- **out = **in
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilterModel.
-func (in *ResourceFilterModel) DeepCopy() *ResourceFilterModel {
- if in == nil {
- return nil
- }
- out := new(ResourceFilterModel)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceHandle) DeepCopyInto(out *ResourceHandle) {
- *out = *in
- if in.StructuredData != nil {
- in, out := &in.StructuredData, &out.StructuredData
- *out = new(StructuredResourceHandle)
- (*in).DeepCopyInto(*out)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceHandle.
-func (in *ResourceHandle) DeepCopy() *ResourceHandle {
- if in == nil {
- return nil
- }
- out := new(ResourceHandle)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceModel) DeepCopyInto(out *ResourceModel) {
- *out = *in
- if in.NamedResources != nil {
- in, out := &in.NamedResources, &out.NamedResources
- *out = new(NamedResourcesResources)
- (*in).DeepCopyInto(*out)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceModel.
-func (in *ResourceModel) DeepCopy() *ResourceModel {
- if in == nil {
- return nil
- }
- out := new(ResourceModel)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceRequest) DeepCopyInto(out *ResourceRequest) {
- *out = *in
- in.VendorParameters.DeepCopyInto(&out.VendorParameters)
- in.ResourceRequestModel.DeepCopyInto(&out.ResourceRequestModel)
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequest.
-func (in *ResourceRequest) DeepCopy() *ResourceRequest {
- if in == nil {
- return nil
- }
- out := new(ResourceRequest)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceRequestModel) DeepCopyInto(out *ResourceRequestModel) {
+func (in *ResourcePool) DeepCopyInto(out *ResourcePool) {
*out = *in
- if in.NamedResources != nil {
- in, out := &in.NamedResources, &out.NamedResources
- *out = new(NamedResourcesRequest)
- **out = **in
- }
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequestModel.
-func (in *ResourceRequestModel) DeepCopy() *ResourceRequestModel {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePool.
+func (in *ResourcePool) DeepCopy() *ResourcePool {
if in == nil {
return nil
}
- out := new(ResourceRequestModel)
+ out := new(ResourcePool)
in.DeepCopyInto(out)
return out
}
@@ -1028,7 +842,7 @@ func (in *ResourceSlice) DeepCopyInto(out *ResourceSlice) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- in.ResourceModel.DeepCopyInto(&out.ResourceModel)
+ in.Spec.DeepCopyInto(&out.Spec)
return
}
@@ -1084,13 +898,17 @@ func (in *ResourceSliceList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *StructuredResourceHandle) DeepCopyInto(out *StructuredResourceHandle) {
+func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) {
*out = *in
- in.VendorClassParameters.DeepCopyInto(&out.VendorClassParameters)
- in.VendorClaimParameters.DeepCopyInto(&out.VendorClaimParameters)
- if in.Results != nil {
- in, out := &in.Results, &out.Results
- *out = make([]DriverAllocationResult, len(*in))
+ out.Pool = in.Pool
+ if in.NodeSelector != nil {
+ in, out := &in.NodeSelector, &out.NodeSelector
+ *out = new(v1.NodeSelector)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Devices != nil {
+ in, out := &in.Devices, &out.Devices
+ *out = make([]Device, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -1098,29 +916,12 @@ func (in *StructuredResourceHandle) DeepCopyInto(out *StructuredResourceHandle)
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StructuredResourceHandle.
-func (in *StructuredResourceHandle) DeepCopy() *StructuredResourceHandle {
- if in == nil {
- return nil
- }
- out := new(StructuredResourceHandle)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *VendorParameters) DeepCopyInto(out *VendorParameters) {
- *out = *in
- in.Parameters.DeepCopyInto(&out.Parameters)
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VendorParameters.
-func (in *VendorParameters) DeepCopy() *VendorParameters {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSliceSpec.
+func (in *ResourceSliceSpec) DeepCopy() *ResourceSliceSpec {
if in == nil {
return nil
}
- out := new(VendorParameters)
+ out := new(ResourceSliceSpec)
in.DeepCopyInto(out)
return out
}
diff --git a/vendor/k8s.io/api/scheduling/v1/doc.go b/vendor/k8s.io/api/scheduling/v1/doc.go
index 76c4da002ef..ee3c6684718 100644
--- a/vendor/k8s.io/api/scheduling/v1/doc.go
+++ b/vendor/k8s.io/api/scheduling/v1/doc.go
@@ -17,7 +17,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
-
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=scheduling.k8s.io
package v1 // import "k8s.io/api/scheduling/v1"
diff --git a/vendor/k8s.io/api/scheduling/v1/generated.proto b/vendor/k8s.io/api/scheduling/v1/generated.proto
index c1a27e8baa8..374e68238b5 100644
--- a/vendor/k8s.io/api/scheduling/v1/generated.proto
+++ b/vendor/k8s.io/api/scheduling/v1/generated.proto
@@ -35,7 +35,7 @@ message PriorityClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// value represents the integer value of this priority class. This is the actual priority that pods
// receive when they have the name of this class in their pod spec.
@@ -66,7 +66,7 @@ message PriorityClassList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of PriorityClasses
repeated PriorityClass items = 2;
diff --git a/vendor/k8s.io/api/scheduling/v1/types.go b/vendor/k8s.io/api/scheduling/v1/types.go
index 146bae40d3b..019dbcd00e1 100644
--- a/vendor/k8s.io/api/scheduling/v1/types.go
+++ b/vendor/k8s.io/api/scheduling/v1/types.go
@@ -24,6 +24,7 @@ import (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.14
// PriorityClass defines mapping from a priority class name to the priority
// integer value. The value can be any valid integer.
@@ -59,6 +60,7 @@ type PriorityClass struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.14
// PriorityClassList is a collection of priority classes.
type PriorityClassList struct {
diff --git a/vendor/k8s.io/api/scheduling/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/scheduling/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..a4a432a64f3
--- /dev/null
+++ b/vendor/k8s.io/api/scheduling/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,34 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PriorityClass) APILifecycleIntroduced() (major, minor int) {
+ return 1, 14
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *PriorityClassList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 14
+}
diff --git a/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto b/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto
index f0878fb16e0..e42dccc688b 100644
--- a/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto
@@ -36,7 +36,7 @@ message PriorityClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// value represents the integer value of this priority class. This is the actual priority that pods
// receive when they have the name of this class in their pod spec.
@@ -67,7 +67,7 @@ message PriorityClassList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of PriorityClasses
repeated PriorityClass items = 2;
diff --git a/vendor/k8s.io/api/scheduling/v1beta1/generated.proto b/vendor/k8s.io/api/scheduling/v1beta1/generated.proto
index 43878184d6e..7f77b01753f 100644
--- a/vendor/k8s.io/api/scheduling/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/scheduling/v1beta1/generated.proto
@@ -36,7 +36,7 @@ message PriorityClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// value represents the integer value of this priority class. This is the actual priority that pods
// receive when they have the name of this class in their pod spec.
@@ -67,7 +67,7 @@ message PriorityClassList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of PriorityClasses
repeated PriorityClass items = 2;
diff --git a/vendor/k8s.io/api/storage/v1/doc.go b/vendor/k8s.io/api/storage/v1/doc.go
index 75a6489da2c..e2310dac23a 100644
--- a/vendor/k8s.io/api/storage/v1/doc.go
+++ b/vendor/k8s.io/api/storage/v1/doc.go
@@ -18,5 +18,6 @@ limitations under the License.
// +k8s:protobuf-gen=package
// +groupName=storage.k8s.io
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
package v1 // import "k8s.io/api/storage/v1"
diff --git a/vendor/k8s.io/api/storage/v1/generated.proto b/vendor/k8s.io/api/storage/v1/generated.proto
index 06bbe3d5cff..ec2beac4686 100644
--- a/vendor/k8s.io/api/storage/v1/generated.proto
+++ b/vendor/k8s.io/api/storage/v1/generated.proto
@@ -44,7 +44,7 @@ message CSIDriver {
// an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and
// alphanumerics between.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec represents the specification of the CSI Driver.
optional CSIDriverSpec spec = 2;
@@ -55,7 +55,7 @@ message CSIDriverList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CSIDriver
repeated CSIDriver items = 2;
@@ -226,7 +226,7 @@ message CSIDriverSpec {
message CSINode {
// Standard object's metadata.
// metadata.name must be the Kubernetes node name.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the specification of CSINode
optional CSINodeSpec spec = 2;
@@ -275,7 +275,7 @@ message CSINodeList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CSINode
repeated CSINode items = 2;
@@ -327,7 +327,7 @@ message CSIStorageCapacity {
//
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// nodeTopology defines which nodes have access to the storage
// for which capacity was reported. If not set, the storage is
@@ -336,7 +336,7 @@ message CSIStorageCapacity {
// immutable.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
// storageClassName represents the name of the StorageClass that the reported capacity applies to.
// It must meet the same requirements as the name of a StorageClass
@@ -356,7 +356,7 @@ message CSIStorageCapacity {
// unavailable.
//
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
// maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse
// for a GetCapacityRequest with topology and parameters that match the
@@ -370,7 +370,7 @@ message CSIStorageCapacity {
// API is ResourceRequirements.Requests in a volume claim.
//
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
}
// CSIStorageCapacityList is a collection of CSIStorageCapacity objects.
@@ -378,7 +378,7 @@ message CSIStorageCapacityList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CSIStorageCapacity objects.
repeated CSIStorageCapacity items = 2;
@@ -393,7 +393,7 @@ message StorageClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// provisioner indicates the type of the provisioner.
optional string provisioner = 2;
@@ -431,7 +431,7 @@ message StorageClass {
// This field is only honored by servers that enable the VolumeScheduling feature.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
+ repeated .k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
}
// StorageClassList is a collection of storage classes.
@@ -439,7 +439,7 @@ message StorageClassList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of StorageClasses
repeated StorageClass items = 2;
@@ -466,7 +466,7 @@ message VolumeAttachment {
// Standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec represents specification of the desired attach/detach volume behavior.
// Populated by the Kubernetes system.
@@ -484,7 +484,7 @@ message VolumeAttachmentList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of VolumeAttachments
repeated VolumeAttachment items = 2;
@@ -506,7 +506,7 @@ message VolumeAttachmentSource {
// PersistentVolumeSpec. This field is beta-level and is only
// honored by servers that enabled the CSIMigration feature.
// +optional
- optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
+ optional .k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
}
// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
@@ -554,7 +554,7 @@ message VolumeAttachmentStatus {
message VolumeError {
// time represents the time the error was encountered.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
// message represents the error encountered during Attach or Detach operation.
// This string may be logged, so it should not contain sensitive
diff --git a/vendor/k8s.io/api/storage/v1/types.go b/vendor/k8s.io/api/storage/v1/types.go
index a94c7f44c53..de2bbc2e06c 100644
--- a/vendor/k8s.io/api/storage/v1/types.go
+++ b/vendor/k8s.io/api/storage/v1/types.go
@@ -25,6 +25,7 @@ import (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.6
// StorageClass describes the parameters for a class of storage for
// which PersistentVolumes can be dynamically provisioned.
@@ -79,6 +80,7 @@ type StorageClass struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.6
// StorageClassList is a collection of storage classes.
type StorageClassList struct {
@@ -112,6 +114,7 @@ const (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.13
// VolumeAttachment captures the intent to attach or detach the specified volume
// to/from the specified node.
@@ -137,6 +140,7 @@ type VolumeAttachment struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.13
// VolumeAttachmentList is a collection of VolumeAttachment objects.
type VolumeAttachmentList struct {
@@ -227,6 +231,7 @@ type VolumeError struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.18
// CSIDriver captures information about a Container Storage Interface (CSI)
// volume driver deployed on the cluster.
@@ -251,6 +256,7 @@ type CSIDriver struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.18
// CSIDriverList is a collection of CSIDriver objects.
type CSIDriverList struct {
@@ -491,6 +497,7 @@ const (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.17
// CSINode holds information about all CSI drivers installed on a node.
// CSI drivers do not need to create the CSINode object directly. As long as
@@ -572,6 +579,7 @@ type VolumeNodeResources struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.17
// CSINodeList is a collection of CSINode objects.
type CSINodeList struct {
@@ -588,6 +596,7 @@ type CSINodeList struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.24
// CSIStorageCapacity stores the result of one CSI GetCapacity call.
// For a given StorageClass, this describes the available capacity in a
@@ -673,6 +682,7 @@ type CSIStorageCapacity struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.24
// CSIStorageCapacityList is a collection of CSIStorageCapacity objects.
type CSIStorageCapacityList struct {
diff --git a/vendor/k8s.io/api/storage/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/storage/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..a44c1181ad1
--- /dev/null
+++ b/vendor/k8s.io/api/storage/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,82 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CSIDriver) APILifecycleIntroduced() (major, minor int) {
+ return 1, 18
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CSIDriverList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 18
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CSINode) APILifecycleIntroduced() (major, minor int) {
+ return 1, 17
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CSINodeList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 17
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CSIStorageCapacity) APILifecycleIntroduced() (major, minor int) {
+ return 1, 24
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CSIStorageCapacityList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 24
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *StorageClass) APILifecycleIntroduced() (major, minor int) {
+ return 1, 6
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *StorageClassList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 6
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *VolumeAttachment) APILifecycleIntroduced() (major, minor int) {
+ return 1, 13
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *VolumeAttachmentList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 13
+}
diff --git a/vendor/k8s.io/api/storage/v1alpha1/generated.proto b/vendor/k8s.io/api/storage/v1alpha1/generated.proto
index 93aefd933a1..380adbf66e3 100644
--- a/vendor/k8s.io/api/storage/v1alpha1/generated.proto
+++ b/vendor/k8s.io/api/storage/v1alpha1/generated.proto
@@ -65,7 +65,7 @@ message CSIStorageCapacity {
//
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// nodeTopology defines which nodes have access to the storage
// for which capacity was reported. If not set, the storage is
@@ -74,7 +74,7 @@ message CSIStorageCapacity {
// immutable.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
// storageClassName represents the name of the StorageClass that the reported capacity applies to.
// It must meet the same requirements as the name of a StorageClass
@@ -94,7 +94,7 @@ message CSIStorageCapacity {
// unavailable.
//
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
// maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse
// for a GetCapacityRequest with topology and parameters that match the
@@ -108,7 +108,7 @@ message CSIStorageCapacity {
// API is ResourceRequirements.Requests in a volume claim.
//
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
}
// CSIStorageCapacityList is a collection of CSIStorageCapacity objects.
@@ -116,7 +116,7 @@ message CSIStorageCapacityList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CSIStorageCapacity objects.
repeated CSIStorageCapacity items = 2;
@@ -130,7 +130,7 @@ message VolumeAttachment {
// Standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec represents specification of the desired attach/detach volume behavior.
// Populated by the Kubernetes system.
@@ -148,7 +148,7 @@ message VolumeAttachmentList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of VolumeAttachments
repeated VolumeAttachment items = 2;
@@ -170,7 +170,7 @@ message VolumeAttachmentSource {
// PersistentVolumeSpec. This field is alpha-level and is only
// honored by servers that enabled the CSIMigration feature.
// +optional
- optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
+ optional .k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
}
// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
@@ -221,7 +221,7 @@ message VolumeAttributesClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Name of the CSI driver
// This field is immutable.
@@ -248,7 +248,7 @@ message VolumeAttributesClassList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of VolumeAttributesClass objects.
repeated VolumeAttributesClass items = 2;
@@ -258,7 +258,7 @@ message VolumeAttributesClassList {
message VolumeError {
// time represents the time the error was encountered.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
// message represents the error encountered during Attach or Detach operation.
// This string maybe logged, so it should not contain sensitive
diff --git a/vendor/k8s.io/api/storage/v1beta1/generated.pb.go b/vendor/k8s.io/api/storage/v1beta1/generated.pb.go
index c503ec6511c..446a40c483d 100644
--- a/vendor/k8s.io/api/storage/v1beta1/generated.pb.go
+++ b/vendor/k8s.io/api/storage/v1beta1/generated.pb.go
@@ -524,10 +524,66 @@ func (m *VolumeAttachmentStatus) XXX_DiscardUnknown() {
var xxx_messageInfo_VolumeAttachmentStatus proto.InternalMessageInfo
+func (m *VolumeAttributesClass) Reset() { *m = VolumeAttributesClass{} }
+func (*VolumeAttributesClass) ProtoMessage() {}
+func (*VolumeAttributesClass) Descriptor() ([]byte, []int) {
+ return fileDescriptor_73e4f72503e71065, []int{17}
+}
+func (m *VolumeAttributesClass) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *VolumeAttributesClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *VolumeAttributesClass) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_VolumeAttributesClass.Merge(m, src)
+}
+func (m *VolumeAttributesClass) XXX_Size() int {
+ return m.Size()
+}
+func (m *VolumeAttributesClass) XXX_DiscardUnknown() {
+ xxx_messageInfo_VolumeAttributesClass.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_VolumeAttributesClass proto.InternalMessageInfo
+
+func (m *VolumeAttributesClassList) Reset() { *m = VolumeAttributesClassList{} }
+func (*VolumeAttributesClassList) ProtoMessage() {}
+func (*VolumeAttributesClassList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_73e4f72503e71065, []int{18}
+}
+func (m *VolumeAttributesClassList) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *VolumeAttributesClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *VolumeAttributesClassList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_VolumeAttributesClassList.Merge(m, src)
+}
+func (m *VolumeAttributesClassList) XXX_Size() int {
+ return m.Size()
+}
+func (m *VolumeAttributesClassList) XXX_DiscardUnknown() {
+ xxx_messageInfo_VolumeAttributesClassList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_VolumeAttributesClassList proto.InternalMessageInfo
+
func (m *VolumeError) Reset() { *m = VolumeError{} }
func (*VolumeError) ProtoMessage() {}
func (*VolumeError) Descriptor() ([]byte, []int) {
- return fileDescriptor_73e4f72503e71065, []int{17}
+ return fileDescriptor_73e4f72503e71065, []int{19}
}
func (m *VolumeError) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -555,7 +611,7 @@ var xxx_messageInfo_VolumeError proto.InternalMessageInfo
func (m *VolumeNodeResources) Reset() { *m = VolumeNodeResources{} }
func (*VolumeNodeResources) ProtoMessage() {}
func (*VolumeNodeResources) Descriptor() ([]byte, []int) {
- return fileDescriptor_73e4f72503e71065, []int{18}
+ return fileDescriptor_73e4f72503e71065, []int{20}
}
func (m *VolumeNodeResources) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -600,6 +656,9 @@ func init() {
proto.RegisterType((*VolumeAttachmentSpec)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachmentSpec")
proto.RegisterType((*VolumeAttachmentStatus)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachmentStatus")
proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachmentStatus.AttachmentMetadataEntry")
+ proto.RegisterType((*VolumeAttributesClass)(nil), "k8s.io.api.storage.v1beta1.VolumeAttributesClass")
+ proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.storage.v1beta1.VolumeAttributesClass.ParametersEntry")
+ proto.RegisterType((*VolumeAttributesClassList)(nil), "k8s.io.api.storage.v1beta1.VolumeAttributesClassList")
proto.RegisterType((*VolumeError)(nil), "k8s.io.api.storage.v1beta1.VolumeError")
proto.RegisterType((*VolumeNodeResources)(nil), "k8s.io.api.storage.v1beta1.VolumeNodeResources")
}
@@ -609,111 +668,115 @@ func init() {
}
var fileDescriptor_73e4f72503e71065 = []byte{
- // 1655 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x6f, 0x1b, 0xc5,
- 0x1b, 0xcf, 0xc6, 0xce, 0xdb, 0x38, 0x69, 0x92, 0x49, 0xda, 0xbf, 0xff, 0x3e, 0xd8, 0x91, 0x11,
- 0x34, 0xad, 0xca, 0xba, 0x0d, 0xa5, 0xaa, 0x2a, 0x55, 0x22, 0x9b, 0x04, 0xea, 0x36, 0x4e, 0xd3,
- 0x71, 0x54, 0x55, 0x15, 0x07, 0xc6, 0xeb, 0x89, 0x33, 0x8d, 0xf7, 0xa5, 0x3b, 0xe3, 0x10, 0x73,
- 0x82, 0x0b, 0x67, 0xc4, 0x81, 0x4f, 0xc0, 0x57, 0x00, 0x09, 0x2e, 0x1c, 0xa9, 0x84, 0x84, 0x2a,
- 0x2e, 0xf4, 0x64, 0x51, 0xf3, 0x11, 0x90, 0x38, 0x44, 0x1c, 0xd0, 0xcc, 0x8e, 0xbd, 0x6f, 0x76,
- 0x93, 0x70, 0xf0, 0xcd, 0xf3, 0xbc, 0xfc, 0x9e, 0x67, 0xe6, 0x79, 0x5d, 0x83, 0xab, 0x87, 0xb7,
- 0x99, 0x4e, 0x9d, 0x12, 0x76, 0x69, 0x89, 0x71, 0xc7, 0xc3, 0x0d, 0x52, 0x3a, 0xba, 0x51, 0x23,
- 0x1c, 0xdf, 0x28, 0x35, 0x88, 0x4d, 0x3c, 0xcc, 0x49, 0x5d, 0x77, 0x3d, 0x87, 0x3b, 0x30, 0xe7,
- 0xcb, 0xea, 0xd8, 0xa5, 0xba, 0x92, 0xd5, 0x95, 0x6c, 0xee, 0xdd, 0x06, 0xe5, 0x07, 0xad, 0x9a,
- 0x6e, 0x3a, 0x56, 0xa9, 0xe1, 0x34, 0x9c, 0x92, 0x54, 0xa9, 0xb5, 0xf6, 0xe5, 0x49, 0x1e, 0xe4,
- 0x2f, 0x1f, 0x2a, 0x57, 0x0c, 0x99, 0x35, 0x1d, 0x4f, 0xd8, 0x8c, 0x9b, 0xcb, 0xdd, 0x0c, 0x64,
- 0x2c, 0x6c, 0x1e, 0x50, 0x9b, 0x78, 0xed, 0x92, 0x7b, 0xd8, 0x90, 0x4a, 0x1e, 0x61, 0x4e, 0xcb,
- 0x33, 0xc9, 0xb9, 0xb4, 0x58, 0xc9, 0x22, 0x1c, 0x0f, 0xb2, 0x55, 0x1a, 0xa6, 0xe5, 0xb5, 0x6c,
- 0x4e, 0xad, 0xa4, 0x99, 0x5b, 0xa7, 0x29, 0x30, 0xf3, 0x80, 0x58, 0x38, 0xae, 0x57, 0xfc, 0x51,
- 0x03, 0x33, 0x1b, 0xd5, 0xf2, 0xa6, 0x47, 0x8f, 0x88, 0x07, 0x3f, 0x01, 0xd3, 0xc2, 0xa3, 0x3a,
- 0xe6, 0x38, 0xab, 0xad, 0x68, 0xab, 0x99, 0xb5, 0xeb, 0x7a, 0xf0, 0xc8, 0x7d, 0x60, 0xdd, 0x3d,
- 0x6c, 0x08, 0x02, 0xd3, 0x85, 0xb4, 0x7e, 0x74, 0x43, 0x7f, 0x58, 0x7b, 0x46, 0x4c, 0x5e, 0x21,
- 0x1c, 0x1b, 0xf0, 0x45, 0xa7, 0x30, 0xd6, 0xed, 0x14, 0x40, 0x40, 0x43, 0x7d, 0x54, 0xf8, 0x00,
- 0xa4, 0x99, 0x4b, 0xcc, 0xec, 0xb8, 0x44, 0xbf, 0xa2, 0x0f, 0x0f, 0xa1, 0xde, 0x77, 0xab, 0xea,
- 0x12, 0xd3, 0x98, 0x55, 0xb0, 0x69, 0x71, 0x42, 0x12, 0xa4, 0xf8, 0x83, 0x06, 0xe6, 0xfa, 0x52,
- 0xdb, 0x94, 0x71, 0xf8, 0x71, 0xe2, 0x02, 0xfa, 0xd9, 0x2e, 0x20, 0xb4, 0xa5, 0xfb, 0x0b, 0xca,
- 0xce, 0x74, 0x8f, 0x12, 0x72, 0xfe, 0x3e, 0x98, 0xa0, 0x9c, 0x58, 0x2c, 0x3b, 0xbe, 0x92, 0x5a,
- 0xcd, 0xac, 0xbd, 0x7d, 0x26, 0xef, 0x8d, 0x39, 0x85, 0x38, 0x51, 0x16, 0xba, 0xc8, 0x87, 0x28,
- 0xfe, 0x9e, 0x0e, 0xf9, 0x2e, 0xee, 0x04, 0xef, 0x80, 0x0b, 0x98, 0x73, 0x6c, 0x1e, 0x20, 0xf2,
- 0xbc, 0x45, 0x3d, 0x52, 0x97, 0x37, 0x98, 0x36, 0x60, 0xb7, 0x53, 0xb8, 0xb0, 0x1e, 0xe1, 0xa0,
- 0x98, 0xa4, 0xd0, 0x75, 0x9d, 0x7a, 0xd9, 0xde, 0x77, 0x1e, 0xda, 0x15, 0xa7, 0x65, 0x73, 0xf9,
- 0xc0, 0x4a, 0x77, 0x37, 0xc2, 0x41, 0x31, 0x49, 0x68, 0x82, 0xe5, 0x23, 0xa7, 0xd9, 0xb2, 0xc8,
- 0x36, 0xdd, 0x27, 0x66, 0xdb, 0x6c, 0x92, 0x8a, 0x53, 0x27, 0x2c, 0x9b, 0x5a, 0x49, 0xad, 0xce,
- 0x18, 0xa5, 0x6e, 0xa7, 0xb0, 0xfc, 0x78, 0x00, 0xff, 0xa4, 0x53, 0x58, 0x1a, 0x40, 0x47, 0x03,
- 0xc1, 0xe0, 0x5d, 0x30, 0xaf, 0x5e, 0x68, 0x03, 0xbb, 0xd8, 0xa4, 0xbc, 0x9d, 0x4d, 0x4b, 0x0f,
- 0x97, 0xba, 0x9d, 0xc2, 0x7c, 0x35, 0xca, 0x42, 0x71, 0x59, 0x78, 0x0f, 0xcc, 0xed, 0xb3, 0x8f,
- 0x3c, 0xa7, 0xe5, 0xee, 0x3a, 0x4d, 0x6a, 0xb6, 0xb3, 0x13, 0x2b, 0xda, 0xea, 0x8c, 0x51, 0xec,
- 0x76, 0x0a, 0x73, 0x1f, 0x56, 0x43, 0x8c, 0x93, 0x38, 0x01, 0x45, 0x15, 0x21, 0x01, 0x73, 0xdc,
- 0x39, 0x24, 0xb6, 0x78, 0x3a, 0xc2, 0x38, 0xcb, 0x4e, 0xca, 0x58, 0xae, 0xbe, 0x29, 0x96, 0x7b,
- 0x21, 0x05, 0xe3, 0xa2, 0x0a, 0xe7, 0x5c, 0x98, 0xca, 0x50, 0x14, 0x15, 0x6e, 0x80, 0x45, 0xcf,
- 0x0f, 0x0e, 0x43, 0xc4, 0x6d, 0xd5, 0x9a, 0x94, 0x1d, 0x64, 0xa7, 0xe4, 0x8d, 0x2f, 0x76, 0x3b,
- 0x85, 0x45, 0x14, 0x67, 0xa2, 0xa4, 0x3c, 0xbc, 0x09, 0x66, 0x19, 0xd9, 0xa6, 0x76, 0xeb, 0xd8,
- 0x8f, 0xe9, 0xb4, 0xd4, 0x5f, 0xe8, 0x76, 0x0a, 0xb3, 0xd5, 0xad, 0x80, 0x8e, 0x22, 0x52, 0xc5,
- 0xef, 0x35, 0x30, 0xb5, 0x51, 0x2d, 0xef, 0x38, 0x75, 0x32, 0x82, 0x82, 0x2e, 0x47, 0x0a, 0xfa,
- 0xf2, 0x29, 0x25, 0x21, 0x9c, 0x1a, 0x5a, 0xce, 0x7f, 0xf9, 0xe5, 0x2c, 0x64, 0x54, 0x3f, 0x5a,
- 0x01, 0x69, 0x1b, 0x5b, 0x44, 0xba, 0x3e, 0x13, 0xe8, 0xec, 0x60, 0x8b, 0x20, 0xc9, 0x81, 0xef,
- 0x80, 0x49, 0xdb, 0xa9, 0x93, 0xf2, 0xa6, 0x74, 0x60, 0xc6, 0xb8, 0xa0, 0x64, 0x26, 0x77, 0x24,
- 0x15, 0x29, 0xae, 0x78, 0x4a, 0xee, 0xb8, 0x4e, 0xd3, 0x69, 0xb4, 0x1f, 0x90, 0x76, 0x2f, 0xb9,
- 0xe5, 0x53, 0xee, 0x85, 0xe8, 0x28, 0x22, 0x05, 0x6b, 0x20, 0x83, 0x9b, 0x4d, 0xc7, 0xc4, 0x1c,
- 0xd7, 0x9a, 0x44, 0x66, 0x6c, 0x66, 0xad, 0xf4, 0xa6, 0x3b, 0xfa, 0x15, 0x21, 0x8c, 0x23, 0x35,
- 0x11, 0x98, 0x31, 0xdf, 0xed, 0x14, 0x32, 0xeb, 0x01, 0x0e, 0x0a, 0x83, 0x16, 0xbf, 0xd3, 0x40,
- 0x46, 0xdd, 0x7a, 0x04, 0x2d, 0xec, 0x5e, 0xb4, 0x85, 0xbd, 0x75, 0x86, 0x78, 0x0d, 0x69, 0x60,
- 0x66, 0xdf, 0x6d, 0xd9, 0xbd, 0xf6, 0xc0, 0x54, 0x5d, 0x06, 0x8d, 0x65, 0x35, 0x09, 0x7d, 0xe5,
- 0x0c, 0xd0, 0xaa, 0x43, 0xce, 0x2b, 0x03, 0x53, 0xfe, 0x99, 0xa1, 0x1e, 0x54, 0xf1, 0xef, 0x14,
- 0x80, 0x1b, 0xd5, 0x72, 0xac, 0x3f, 0x8c, 0x20, 0xad, 0x29, 0x98, 0x15, 0x99, 0xd3, 0xcb, 0x0d,
- 0x95, 0xde, 0xef, 0x9d, 0x31, 0x12, 0xb8, 0x46, 0x9a, 0x55, 0xd2, 0x24, 0x26, 0x77, 0x3c, 0x3f,
- 0xc9, 0x76, 0x42, 0x60, 0x28, 0x02, 0x0d, 0x37, 0xc1, 0x42, 0xaf, 0xdd, 0x35, 0x31, 0x63, 0x22,
- 0xb9, 0xb3, 0x29, 0x99, 0xcc, 0x59, 0xe5, 0xe2, 0x42, 0x35, 0xc6, 0x47, 0x09, 0x0d, 0xf8, 0x04,
- 0x4c, 0x9b, 0xe1, 0xce, 0x7a, 0x4a, 0xda, 0xe8, 0xbd, 0x85, 0x45, 0x7f, 0xd4, 0xc2, 0x36, 0xa7,
- 0xbc, 0x6d, 0xcc, 0x8a, 0x94, 0xe9, 0xb7, 0xe0, 0x3e, 0x1a, 0x64, 0x60, 0xd1, 0xc2, 0xc7, 0xd4,
- 0x6a, 0x59, 0x7e, 0x72, 0x57, 0xe9, 0x67, 0x44, 0xf6, 0xdf, 0xf3, 0x9b, 0x90, 0xad, 0xaf, 0x12,
- 0x07, 0x43, 0x49, 0xfc, 0xe2, 0x2f, 0x1a, 0xb8, 0x94, 0x0c, 0xfc, 0x08, 0x0a, 0xa4, 0x1a, 0x2d,
- 0x10, 0xfd, 0x94, 0x2c, 0x8e, 0x39, 0x38, 0xa4, 0x56, 0xbe, 0x9e, 0x04, 0xb3, 0xe1, 0x18, 0x8e,
- 0x20, 0x81, 0xdf, 0x07, 0x19, 0xd7, 0x73, 0x8e, 0x28, 0xa3, 0x8e, 0x4d, 0x3c, 0xd5, 0x1d, 0x97,
- 0x94, 0x4a, 0x66, 0x37, 0x60, 0xa1, 0xb0, 0x1c, 0x6c, 0x02, 0xe0, 0x62, 0x0f, 0x5b, 0x84, 0x8b,
- 0x4a, 0x4e, 0xc9, 0x37, 0xb8, 0xfd, 0xa6, 0x37, 0x08, 0x5f, 0x4b, 0xdf, 0xed, 0xab, 0x6e, 0xd9,
- 0xdc, 0x6b, 0x07, 0x2e, 0x06, 0x0c, 0x14, 0xc2, 0x87, 0x87, 0x60, 0xce, 0x23, 0x66, 0x13, 0x53,
- 0x4b, 0x8d, 0xf5, 0xb4, 0x74, 0x73, 0x4b, 0x8c, 0x57, 0x14, 0x66, 0x9c, 0x74, 0x0a, 0xd7, 0x93,
- 0x2b, 0xba, 0xbe, 0x4b, 0x3c, 0x46, 0x19, 0x27, 0x36, 0xf7, 0x53, 0x27, 0xa2, 0x83, 0xa2, 0xd8,
- 0x62, 0x04, 0x58, 0x62, 0x40, 0x3e, 0x74, 0x39, 0x75, 0x6c, 0x96, 0x9d, 0x08, 0x46, 0x40, 0x25,
- 0x44, 0x47, 0x11, 0x29, 0xb8, 0x0d, 0x96, 0x45, 0xb7, 0xfe, 0xd4, 0x37, 0xb0, 0x75, 0xec, 0x62,
- 0x5b, 0x3c, 0x55, 0x76, 0x52, 0xce, 0xe2, 0xac, 0xd8, 0x8e, 0xd6, 0x07, 0xf0, 0xd1, 0x40, 0x2d,
- 0xf8, 0x04, 0x2c, 0xfa, 0xeb, 0x91, 0x41, 0xed, 0x3a, 0xb5, 0x1b, 0x62, 0x39, 0x92, 0x6b, 0xc1,
- 0x8c, 0x71, 0x55, 0xd4, 0xc6, 0xe3, 0x38, 0xf3, 0x64, 0x10, 0x11, 0x25, 0x41, 0xe0, 0x73, 0xb0,
- 0x28, 0x2d, 0x92, 0xba, 0x6a, 0x2c, 0x94, 0xb0, 0xec, 0x74, 0x72, 0xb7, 0x11, 0x4f, 0x27, 0x12,
- 0xa9, 0xd7, 0x7e, 0x7a, 0x6d, 0x6a, 0x8f, 0x78, 0x96, 0xf1, 0x7f, 0x15, 0xaf, 0xc5, 0xf5, 0x38,
- 0x14, 0x4a, 0xa2, 0xe7, 0xee, 0x82, 0xf9, 0x58, 0xc0, 0xe1, 0x02, 0x48, 0x1d, 0x92, 0xb6, 0x3f,
- 0xaf, 0x91, 0xf8, 0x09, 0x97, 0xc1, 0xc4, 0x11, 0x6e, 0xb6, 0x88, 0x9f, 0x81, 0xc8, 0x3f, 0xdc,
- 0x19, 0xbf, 0xad, 0x15, 0x7f, 0xd2, 0x40, 0xa4, 0xb1, 0x8d, 0xa0, 0xb8, 0x2b, 0xd1, 0xe2, 0x5e,
- 0x3d, 0x6b, 0x62, 0x0f, 0x29, 0xeb, 0x2f, 0x34, 0x30, 0x1b, 0xde, 0x02, 0xe1, 0x35, 0x30, 0x8d,
- 0x5b, 0x75, 0x4a, 0x6c, 0xb3, 0xb7, 0xb3, 0xf4, 0xbd, 0x59, 0x57, 0x74, 0xd4, 0x97, 0x10, 0x3b,
- 0x22, 0x39, 0x76, 0xa9, 0x87, 0x45, 0xa6, 0x55, 0x89, 0xe9, 0xd8, 0x75, 0x26, 0x9f, 0x29, 0xe5,
- 0x37, 0xca, 0xad, 0x38, 0x13, 0x25, 0xe5, 0x8b, 0xdf, 0x8e, 0x83, 0x05, 0x3f, 0x41, 0xfc, 0x4f,
- 0x04, 0x8b, 0xd8, 0x7c, 0x04, 0xed, 0x05, 0x45, 0xd6, 0xbe, 0xeb, 0xa7, 0xaf, 0x44, 0x81, 0x77,
- 0xc3, 0xf6, 0x3f, 0xf8, 0x14, 0x4c, 0x32, 0x8e, 0x79, 0x8b, 0xc9, 0xf1, 0x97, 0x59, 0x5b, 0x3b,
- 0x17, 0xaa, 0xd4, 0x0c, 0xf6, 0x3f, 0xff, 0x8c, 0x14, 0x62, 0xf1, 0x67, 0x0d, 0x2c, 0xc7, 0x55,
- 0x46, 0x90, 0x70, 0x8f, 0xa2, 0x09, 0x77, 0xed, 0x3c, 0x37, 0x1a, 0x92, 0x74, 0xbf, 0x69, 0xe0,
- 0x52, 0xe2, 0xf2, 0x72, 0xce, 0x8a, 0x5e, 0xe5, 0xc6, 0x3a, 0xe2, 0x4e, 0xb0, 0x3e, 0xcb, 0x5e,
- 0xb5, 0x3b, 0x80, 0x8f, 0x06, 0x6a, 0xc1, 0x67, 0x60, 0x81, 0xda, 0x4d, 0x6a, 0x13, 0x35, 0x96,
- 0x83, 0x70, 0x0f, 0x6c, 0x28, 0x71, 0x64, 0x19, 0xe6, 0x65, 0xb1, 0xbd, 0x94, 0x63, 0x28, 0x28,
- 0x81, 0x5b, 0xfc, 0x75, 0x40, 0x78, 0xe4, 0x5a, 0x29, 0x2a, 0x4a, 0x52, 0x88, 0x97, 0xa8, 0x28,
- 0x45, 0x47, 0x7d, 0x09, 0x99, 0x41, 0xf2, 0x29, 0x94, 0xa3, 0xe7, 0xcb, 0x20, 0xa9, 0x19, 0xca,
- 0x20, 0x79, 0x46, 0x0a, 0x51, 0x78, 0x22, 0xd6, 0xb6, 0xd0, 0x7a, 0xd6, 0xf7, 0x64, 0x47, 0xd1,
- 0x51, 0x5f, 0xa2, 0xf8, 0x4f, 0x6a, 0x40, 0x94, 0x64, 0x2a, 0x86, 0xae, 0xd4, 0xfb, 0xc2, 0x8f,
- 0x5f, 0xa9, 0xde, 0xbf, 0x52, 0x1d, 0x7e, 0xa3, 0x01, 0x88, 0xfb, 0x10, 0x95, 0x5e, 0xaa, 0xfa,
- 0xf9, 0x74, 0xff, 0xfc, 0x15, 0xa2, 0xaf, 0x27, 0xc0, 0xfc, 0x59, 0x9d, 0x53, 0x4e, 0xc0, 0xa4,
- 0x00, 0x1a, 0xe0, 0x01, 0xa4, 0x20, 0xe3, 0x53, 0xb7, 0x3c, 0xcf, 0xf1, 0x54, 0xc9, 0x5e, 0x3e,
- 0xdd, 0x21, 0x29, 0x6e, 0xe4, 0xe5, 0x37, 0x51, 0xa0, 0x7f, 0xd2, 0x29, 0x64, 0x42, 0x7c, 0x14,
- 0xc6, 0x16, 0xa6, 0xea, 0x24, 0x30, 0x95, 0xfe, 0x0f, 0xa6, 0x36, 0xc9, 0x70, 0x53, 0x21, 0xec,
- 0xdc, 0x16, 0xf8, 0xdf, 0x90, 0x07, 0x3a, 0xd7, 0x6c, 0xfb, 0x52, 0x03, 0x61, 0x1b, 0x70, 0x1b,
- 0xa4, 0x39, 0x55, 0x95, 0x98, 0x59, 0xbb, 0x7a, 0xb6, 0x0e, 0xb3, 0x47, 0x2d, 0x12, 0x34, 0x4a,
- 0x71, 0x42, 0x12, 0x05, 0x5e, 0x01, 0x53, 0x16, 0x61, 0x0c, 0x37, 0x94, 0xe5, 0xe0, 0x03, 0xaa,
- 0xe2, 0x93, 0x51, 0x8f, 0x5f, 0xbc, 0x05, 0x96, 0x06, 0x7c, 0x92, 0xc2, 0x02, 0x98, 0x30, 0xe5,
- 0x5f, 0x0a, 0xc2, 0xa1, 0x09, 0x63, 0x46, 0x74, 0x99, 0x0d, 0xf9, 0x5f, 0x82, 0x4f, 0x37, 0x3e,
- 0x78, 0xf1, 0x3a, 0x3f, 0xf6, 0xf2, 0x75, 0x7e, 0xec, 0xd5, 0xeb, 0xfc, 0xd8, 0xe7, 0xdd, 0xbc,
- 0xf6, 0xa2, 0x9b, 0xd7, 0x5e, 0x76, 0xf3, 0xda, 0xab, 0x6e, 0x5e, 0xfb, 0xa3, 0x9b, 0xd7, 0xbe,
- 0xfa, 0x33, 0x3f, 0xf6, 0x34, 0x37, 0xfc, 0xdf, 0xda, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x12,
- 0x41, 0x18, 0xc9, 0xca, 0x15, 0x00, 0x00,
+ // 1728 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x23, 0x49,
+ 0x15, 0x4f, 0xc7, 0xce, 0x57, 0x39, 0x99, 0x24, 0x35, 0x99, 0xc5, 0xeb, 0x83, 0x1d, 0x19, 0xc1,
+ 0x66, 0x46, 0x4b, 0x7b, 0x12, 0x96, 0xd5, 0x68, 0xa5, 0x95, 0x48, 0x27, 0x81, 0xf5, 0x6e, 0x9c,
+ 0xc9, 0x96, 0xa3, 0xd1, 0x6a, 0xc5, 0x81, 0x72, 0xbb, 0xe2, 0xd4, 0xc6, 0xfd, 0xb1, 0x5d, 0xd5,
+ 0x21, 0xe6, 0x04, 0x17, 0xce, 0x88, 0x03, 0x7f, 0x01, 0xff, 0x02, 0x48, 0x70, 0xe1, 0xc8, 0x48,
+ 0x48, 0x68, 0xe1, 0xc2, 0x9e, 0x2c, 0xc6, 0xf3, 0x27, 0x20, 0x71, 0x88, 0x38, 0xa0, 0xaa, 0x2e,
+ 0xf7, 0xb7, 0x27, 0x36, 0x2b, 0xf9, 0xe6, 0x7a, 0x1f, 0xbf, 0x7a, 0x55, 0xef, 0xf7, 0x5e, 0xbd,
+ 0x36, 0x78, 0x72, 0xfd, 0x8c, 0xe9, 0xd4, 0x69, 0x60, 0x97, 0x36, 0x18, 0x77, 0x3c, 0xdc, 0x23,
+ 0x8d, 0x9b, 0xfd, 0x0e, 0xe1, 0x78, 0xbf, 0xd1, 0x23, 0x36, 0xf1, 0x30, 0x27, 0x5d, 0xdd, 0xf5,
+ 0x1c, 0xee, 0xc0, 0x4a, 0x60, 0xab, 0x63, 0x97, 0xea, 0xca, 0x56, 0x57, 0xb6, 0x95, 0xef, 0xf5,
+ 0x28, 0xbf, 0xf2, 0x3b, 0xba, 0xe9, 0x58, 0x8d, 0x9e, 0xd3, 0x73, 0x1a, 0xd2, 0xa5, 0xe3, 0x5f,
+ 0xca, 0x95, 0x5c, 0xc8, 0x5f, 0x01, 0x54, 0xa5, 0x1e, 0xdb, 0xd6, 0x74, 0x3c, 0xb1, 0x67, 0x7a,
+ 0xbb, 0xca, 0x7b, 0x91, 0x8d, 0x85, 0xcd, 0x2b, 0x6a, 0x13, 0x6f, 0xd0, 0x70, 0xaf, 0x7b, 0xd2,
+ 0xc9, 0x23, 0xcc, 0xf1, 0x3d, 0x93, 0xcc, 0xe4, 0xc5, 0x1a, 0x16, 0xe1, 0x38, 0x6f, 0xaf, 0xc6,
+ 0x24, 0x2f, 0xcf, 0xb7, 0x39, 0xb5, 0xb2, 0xdb, 0xbc, 0x7f, 0x9f, 0x03, 0x33, 0xaf, 0x88, 0x85,
+ 0xd3, 0x7e, 0xf5, 0x3f, 0x69, 0x60, 0xed, 0xa8, 0xdd, 0x3c, 0xf6, 0xe8, 0x0d, 0xf1, 0xe0, 0x4f,
+ 0xc1, 0xaa, 0x88, 0xa8, 0x8b, 0x39, 0x2e, 0x6b, 0xbb, 0xda, 0x5e, 0xe9, 0xe0, 0xa9, 0x1e, 0x5d,
+ 0x72, 0x08, 0xac, 0xbb, 0xd7, 0x3d, 0x21, 0x60, 0xba, 0xb0, 0xd6, 0x6f, 0xf6, 0xf5, 0xe7, 0x9d,
+ 0x2f, 0x88, 0xc9, 0x5b, 0x84, 0x63, 0x03, 0xbe, 0x1c, 0xd6, 0x16, 0x46, 0xc3, 0x1a, 0x88, 0x64,
+ 0x28, 0x44, 0x85, 0x9f, 0x80, 0x22, 0x73, 0x89, 0x59, 0x5e, 0x94, 0xe8, 0x8f, 0xf5, 0xc9, 0x29,
+ 0xd4, 0xc3, 0xb0, 0xda, 0x2e, 0x31, 0x8d, 0x75, 0x05, 0x5b, 0x14, 0x2b, 0x24, 0x41, 0xea, 0x7f,
+ 0xd4, 0xc0, 0x46, 0x68, 0x75, 0x4a, 0x19, 0x87, 0x3f, 0xc9, 0x1c, 0x40, 0x9f, 0xee, 0x00, 0xc2,
+ 0x5b, 0x86, 0xbf, 0xa5, 0xf6, 0x59, 0x1d, 0x4b, 0x62, 0xc1, 0x7f, 0x0c, 0x96, 0x28, 0x27, 0x16,
+ 0x2b, 0x2f, 0xee, 0x16, 0xf6, 0x4a, 0x07, 0xdf, 0x99, 0x2a, 0x7a, 0x63, 0x43, 0x21, 0x2e, 0x35,
+ 0x85, 0x2f, 0x0a, 0x20, 0xea, 0xff, 0x2c, 0xc6, 0x62, 0x17, 0x67, 0x82, 0x1f, 0x80, 0x07, 0x98,
+ 0x73, 0x6c, 0x5e, 0x21, 0xf2, 0xa5, 0x4f, 0x3d, 0xd2, 0x95, 0x27, 0x58, 0x35, 0xe0, 0x68, 0x58,
+ 0x7b, 0x70, 0x98, 0xd0, 0xa0, 0x94, 0xa5, 0xf0, 0x75, 0x9d, 0x6e, 0xd3, 0xbe, 0x74, 0x9e, 0xdb,
+ 0x2d, 0xc7, 0xb7, 0xb9, 0xbc, 0x60, 0xe5, 0x7b, 0x9e, 0xd0, 0xa0, 0x94, 0x25, 0x34, 0xc1, 0xce,
+ 0x8d, 0xd3, 0xf7, 0x2d, 0x72, 0x4a, 0x2f, 0x89, 0x39, 0x30, 0xfb, 0xa4, 0xe5, 0x74, 0x09, 0x2b,
+ 0x17, 0x76, 0x0b, 0x7b, 0x6b, 0x46, 0x63, 0x34, 0xac, 0xed, 0xbc, 0xc8, 0xd1, 0xdf, 0x0d, 0x6b,
+ 0x0f, 0x73, 0xe4, 0x28, 0x17, 0x0c, 0x7e, 0x08, 0x36, 0xd5, 0x0d, 0x1d, 0x61, 0x17, 0x9b, 0x94,
+ 0x0f, 0xca, 0x45, 0x19, 0xe1, 0xc3, 0xd1, 0xb0, 0xb6, 0xd9, 0x4e, 0xaa, 0x50, 0xda, 0x16, 0x7e,
+ 0x04, 0x36, 0x2e, 0xd9, 0x8f, 0x3d, 0xc7, 0x77, 0xcf, 0x9d, 0x3e, 0x35, 0x07, 0xe5, 0xa5, 0x5d,
+ 0x6d, 0x6f, 0xcd, 0xa8, 0x8f, 0x86, 0xb5, 0x8d, 0x1f, 0xb5, 0x63, 0x8a, 0xbb, 0xb4, 0x00, 0x25,
+ 0x1d, 0x21, 0x01, 0x1b, 0xdc, 0xb9, 0x26, 0xb6, 0xb8, 0x3a, 0xc2, 0x38, 0x2b, 0x2f, 0xcb, 0x5c,
+ 0xee, 0xbd, 0x29, 0x97, 0x17, 0x31, 0x07, 0xe3, 0x91, 0x4a, 0xe7, 0x46, 0x5c, 0xca, 0x50, 0x12,
+ 0x15, 0x1e, 0x81, 0x6d, 0x2f, 0x48, 0x0e, 0x43, 0xc4, 0xf5, 0x3b, 0x7d, 0xca, 0xae, 0xca, 0x2b,
+ 0xf2, 0xc4, 0x8f, 0x46, 0xc3, 0xda, 0x36, 0x4a, 0x2b, 0x51, 0xd6, 0x1e, 0xbe, 0x07, 0xd6, 0x19,
+ 0x39, 0xa5, 0xb6, 0x7f, 0x1b, 0xe4, 0x74, 0x55, 0xfa, 0x6f, 0x8d, 0x86, 0xb5, 0xf5, 0xf6, 0x49,
+ 0x24, 0x47, 0x09, 0xab, 0xfa, 0x1f, 0x34, 0xb0, 0x72, 0xd4, 0x6e, 0x9e, 0x39, 0x5d, 0x32, 0x87,
+ 0x82, 0x6e, 0x26, 0x0a, 0xfa, 0x9d, 0x7b, 0x4a, 0x42, 0x04, 0x35, 0xb1, 0x9c, 0xff, 0x1d, 0x94,
+ 0xb3, 0xb0, 0x51, 0xfd, 0x68, 0x17, 0x14, 0x6d, 0x6c, 0x11, 0x19, 0xfa, 0x5a, 0xe4, 0x73, 0x86,
+ 0x2d, 0x82, 0xa4, 0x06, 0x7e, 0x17, 0x2c, 0xdb, 0x4e, 0x97, 0x34, 0x8f, 0x65, 0x00, 0x6b, 0xc6,
+ 0x03, 0x65, 0xb3, 0x7c, 0x26, 0xa5, 0x48, 0x69, 0xc5, 0x55, 0x72, 0xc7, 0x75, 0xfa, 0x4e, 0x6f,
+ 0xf0, 0x09, 0x19, 0x8c, 0xc9, 0x2d, 0xaf, 0xf2, 0x22, 0x26, 0x47, 0x09, 0x2b, 0xd8, 0x01, 0x25,
+ 0xdc, 0xef, 0x3b, 0x26, 0xe6, 0xb8, 0xd3, 0x27, 0x92, 0xb1, 0xa5, 0x83, 0xc6, 0x9b, 0xce, 0x18,
+ 0x54, 0x84, 0xd8, 0x1c, 0xa9, 0x17, 0x81, 0x19, 0x9b, 0xa3, 0x61, 0xad, 0x74, 0x18, 0xe1, 0xa0,
+ 0x38, 0x68, 0xfd, 0xf7, 0x1a, 0x28, 0xa9, 0x53, 0xcf, 0xa1, 0x85, 0x7d, 0x94, 0x6c, 0x61, 0xdf,
+ 0x9e, 0x22, 0x5f, 0x13, 0x1a, 0x98, 0x19, 0x86, 0x2d, 0xbb, 0xd7, 0x05, 0x58, 0xe9, 0xca, 0xa4,
+ 0xb1, 0xb2, 0x26, 0xa1, 0x1f, 0x4f, 0x01, 0xad, 0x3a, 0xe4, 0xa6, 0xda, 0x60, 0x25, 0x58, 0x33,
+ 0x34, 0x86, 0xaa, 0xff, 0xa7, 0x00, 0xe0, 0x51, 0xbb, 0x99, 0xea, 0x0f, 0x73, 0xa0, 0x35, 0x05,
+ 0xeb, 0x82, 0x39, 0x63, 0x6e, 0x28, 0x7a, 0x7f, 0x7f, 0xca, 0x4c, 0xe0, 0x0e, 0xe9, 0xb7, 0x49,
+ 0x9f, 0x98, 0xdc, 0xf1, 0x02, 0x92, 0x9d, 0xc5, 0xc0, 0x50, 0x02, 0x1a, 0x1e, 0x83, 0xad, 0x71,
+ 0xbb, 0xeb, 0x63, 0xc6, 0x04, 0xb9, 0xcb, 0x05, 0x49, 0xe6, 0xb2, 0x0a, 0x71, 0xab, 0x9d, 0xd2,
+ 0xa3, 0x8c, 0x07, 0xfc, 0x0c, 0xac, 0x9a, 0xf1, 0xce, 0x7a, 0x0f, 0x6d, 0xf4, 0xf1, 0xc0, 0xa2,
+ 0x7f, 0xea, 0x63, 0x9b, 0x53, 0x3e, 0x30, 0xd6, 0x05, 0x65, 0xc2, 0x16, 0x1c, 0xa2, 0x41, 0x06,
+ 0xb6, 0x2d, 0x7c, 0x4b, 0x2d, 0xdf, 0x0a, 0xc8, 0xdd, 0xa6, 0x3f, 0x27, 0xb2, 0xff, 0xce, 0xbe,
+ 0x85, 0x6c, 0x7d, 0xad, 0x34, 0x18, 0xca, 0xe2, 0xd7, 0xff, 0xaa, 0x81, 0xb7, 0xb2, 0x89, 0x9f,
+ 0x43, 0x81, 0xb4, 0x93, 0x05, 0xa2, 0xdf, 0xc3, 0xe2, 0x54, 0x80, 0x13, 0x6a, 0xe5, 0x37, 0xcb,
+ 0x60, 0x3d, 0x9e, 0xc3, 0x39, 0x10, 0xf8, 0x07, 0xa0, 0xe4, 0x7a, 0xce, 0x0d, 0x65, 0xd4, 0xb1,
+ 0x89, 0xa7, 0xba, 0xe3, 0x43, 0xe5, 0x52, 0x3a, 0x8f, 0x54, 0x28, 0x6e, 0x07, 0xfb, 0x00, 0xb8,
+ 0xd8, 0xc3, 0x16, 0xe1, 0xa2, 0x92, 0x0b, 0xf2, 0x0e, 0x9e, 0xbd, 0xe9, 0x0e, 0xe2, 0xc7, 0xd2,
+ 0xcf, 0x43, 0xd7, 0x13, 0x9b, 0x7b, 0x83, 0x28, 0xc4, 0x48, 0x81, 0x62, 0xf8, 0xf0, 0x1a, 0x6c,
+ 0x78, 0xc4, 0xec, 0x63, 0x6a, 0xa9, 0x67, 0xbd, 0x28, 0xc3, 0x3c, 0x11, 0xcf, 0x2b, 0x8a, 0x2b,
+ 0xee, 0x86, 0xb5, 0xa7, 0xd9, 0x11, 0x5d, 0x3f, 0x27, 0x1e, 0xa3, 0x8c, 0x13, 0x9b, 0x07, 0xd4,
+ 0x49, 0xf8, 0xa0, 0x24, 0xb6, 0x78, 0x02, 0x2c, 0xf1, 0x40, 0x3e, 0x77, 0x39, 0x75, 0x6c, 0x56,
+ 0x5e, 0x8a, 0x9e, 0x80, 0x56, 0x4c, 0x8e, 0x12, 0x56, 0xf0, 0x14, 0xec, 0x88, 0x6e, 0xfd, 0xb3,
+ 0x60, 0x83, 0x93, 0x5b, 0x17, 0xdb, 0xe2, 0xaa, 0xca, 0xcb, 0xf2, 0x2d, 0x2e, 0x8b, 0xe9, 0xe8,
+ 0x30, 0x47, 0x8f, 0x72, 0xbd, 0xe0, 0x67, 0x60, 0x3b, 0x18, 0x8f, 0x0c, 0x6a, 0x77, 0xa9, 0xdd,
+ 0x13, 0xc3, 0x91, 0x1c, 0x0b, 0xd6, 0x8c, 0x27, 0xa2, 0x36, 0x5e, 0xa4, 0x95, 0x77, 0x79, 0x42,
+ 0x94, 0x05, 0x81, 0x5f, 0x82, 0x6d, 0xb9, 0x23, 0xe9, 0xaa, 0xc6, 0x42, 0x09, 0x2b, 0xaf, 0x66,
+ 0x67, 0x1b, 0x71, 0x75, 0x82, 0x48, 0xe3, 0xf6, 0x33, 0x6e, 0x53, 0x17, 0xc4, 0xb3, 0x8c, 0xb7,
+ 0x55, 0xbe, 0xb6, 0x0f, 0xd3, 0x50, 0x28, 0x8b, 0x5e, 0xf9, 0x10, 0x6c, 0xa6, 0x12, 0x0e, 0xb7,
+ 0x40, 0xe1, 0x9a, 0x0c, 0x82, 0xf7, 0x1a, 0x89, 0x9f, 0x70, 0x07, 0x2c, 0xdd, 0xe0, 0xbe, 0x4f,
+ 0x02, 0x06, 0xa2, 0x60, 0xf1, 0xc1, 0xe2, 0x33, 0xad, 0xfe, 0x67, 0x0d, 0x24, 0x1a, 0xdb, 0x1c,
+ 0x8a, 0xbb, 0x95, 0x2c, 0xee, 0xbd, 0x69, 0x89, 0x3d, 0xa1, 0xac, 0x7f, 0xa9, 0x81, 0xf5, 0xf8,
+ 0x14, 0x08, 0xdf, 0x05, 0xab, 0xd8, 0xef, 0x52, 0x62, 0x9b, 0xe3, 0x99, 0x25, 0x8c, 0xe6, 0x50,
+ 0xc9, 0x51, 0x68, 0x21, 0x66, 0x44, 0x72, 0xeb, 0x52, 0x0f, 0x0b, 0xa6, 0xb5, 0x89, 0xe9, 0xd8,
+ 0x5d, 0x26, 0xaf, 0xa9, 0x10, 0x34, 0xca, 0x93, 0xb4, 0x12, 0x65, 0xed, 0xeb, 0xbf, 0x5b, 0x04,
+ 0x5b, 0x01, 0x41, 0x82, 0x4f, 0x04, 0x8b, 0xd8, 0x7c, 0x0e, 0xed, 0x05, 0x25, 0xc6, 0xbe, 0xa7,
+ 0xf7, 0x8f, 0x44, 0x51, 0x74, 0x93, 0xe6, 0x3f, 0xf8, 0x39, 0x58, 0x66, 0x1c, 0x73, 0x9f, 0xc9,
+ 0xe7, 0xaf, 0x74, 0x70, 0x30, 0x13, 0xaa, 0xf4, 0x8c, 0xe6, 0xbf, 0x60, 0x8d, 0x14, 0x62, 0xfd,
+ 0x2f, 0x1a, 0xd8, 0x49, 0xbb, 0xcc, 0x81, 0x70, 0x9f, 0x26, 0x09, 0xf7, 0xee, 0x2c, 0x27, 0x9a,
+ 0x40, 0xba, 0x7f, 0x68, 0xe0, 0xad, 0xcc, 0xe1, 0xe5, 0x3b, 0x2b, 0x7a, 0x95, 0x9b, 0xea, 0x88,
+ 0x67, 0xd1, 0xf8, 0x2c, 0x7b, 0xd5, 0x79, 0x8e, 0x1e, 0xe5, 0x7a, 0xc1, 0x2f, 0xc0, 0x16, 0xb5,
+ 0xfb, 0xd4, 0x26, 0xea, 0x59, 0x8e, 0xd2, 0x9d, 0xdb, 0x50, 0xd2, 0xc8, 0x32, 0xcd, 0x3b, 0x62,
+ 0x7a, 0x69, 0xa6, 0x50, 0x50, 0x06, 0xb7, 0xfe, 0xb7, 0x9c, 0xf4, 0xc8, 0xb1, 0x52, 0x54, 0x94,
+ 0x94, 0x10, 0x2f, 0x53, 0x51, 0x4a, 0x8e, 0x42, 0x0b, 0xc9, 0x20, 0x79, 0x15, 0x2a, 0xd0, 0xd9,
+ 0x18, 0x24, 0x3d, 0x63, 0x0c, 0x92, 0x6b, 0xa4, 0x10, 0x45, 0x24, 0x62, 0x6c, 0x8b, 0x8d, 0x67,
+ 0x61, 0x24, 0x67, 0x4a, 0x8e, 0x42, 0x8b, 0xfa, 0x7f, 0x0b, 0x39, 0x59, 0x92, 0x54, 0x8c, 0x1d,
+ 0x69, 0xfc, 0x85, 0x9f, 0x3e, 0x52, 0x37, 0x3c, 0x52, 0x17, 0xfe, 0x56, 0x03, 0x10, 0x87, 0x10,
+ 0xad, 0x31, 0x55, 0x03, 0x3e, 0x7d, 0x3c, 0x7b, 0x85, 0xe8, 0x87, 0x19, 0xb0, 0xe0, 0xad, 0xae,
+ 0xa8, 0x20, 0x60, 0xd6, 0x00, 0xe5, 0x44, 0x00, 0x29, 0x28, 0x05, 0xd2, 0x13, 0xcf, 0x73, 0x3c,
+ 0x55, 0xb2, 0xef, 0xdc, 0x1f, 0x90, 0x34, 0x37, 0xaa, 0xf2, 0x9b, 0x28, 0xf2, 0xbf, 0x1b, 0xd6,
+ 0x4a, 0x31, 0x3d, 0x8a, 0x63, 0x8b, 0xad, 0xba, 0x24, 0xda, 0xaa, 0xf8, 0x7f, 0x6c, 0x75, 0x4c,
+ 0x26, 0x6f, 0x15, 0xc3, 0xae, 0x9c, 0x80, 0x6f, 0x4d, 0xb8, 0xa0, 0x99, 0xde, 0xb6, 0xd7, 0x8b,
+ 0xe0, 0x51, 0x78, 0xff, 0x1e, 0xed, 0xf8, 0x9c, 0xb0, 0x79, 0x4d, 0x7e, 0x07, 0x00, 0x04, 0x9f,
+ 0x4f, 0x92, 0xaa, 0xc1, 0xe0, 0x17, 0x7a, 0x1c, 0x87, 0x1a, 0x14, 0xb3, 0x82, 0x7e, 0xce, 0xd8,
+ 0x77, 0x38, 0x15, 0xb9, 0xe2, 0x87, 0x9b, 0x75, 0xfe, 0xfb, 0xa6, 0x13, 0xc4, 0xdf, 0x35, 0xf0,
+ 0x76, 0x6e, 0x20, 0x73, 0xe8, 0xec, 0x2f, 0x92, 0x9d, 0x7d, 0x7f, 0xe6, 0xcb, 0x9a, 0xd0, 0xde,
+ 0x7f, 0xa5, 0x81, 0x38, 0x3b, 0xe1, 0x29, 0x28, 0x72, 0xaa, 0x7a, 0x78, 0xe9, 0xe0, 0xc9, 0x74,
+ 0x27, 0xb8, 0xa0, 0x16, 0x89, 0x9e, 0x58, 0xb1, 0x42, 0x12, 0x05, 0x3e, 0x06, 0x2b, 0x16, 0x61,
+ 0x0c, 0xf7, 0xc6, 0xc4, 0x08, 0x3f, 0xbd, 0x5b, 0x81, 0x18, 0x8d, 0xf5, 0xf5, 0xf7, 0xc1, 0xc3,
+ 0x9c, 0x3f, 0x33, 0x60, 0x0d, 0x2c, 0x99, 0xf2, 0xcf, 0x28, 0x11, 0xd0, 0x92, 0xb1, 0x26, 0x0e,
+ 0x70, 0x24, 0xff, 0x85, 0x0a, 0xe4, 0xc6, 0x0f, 0x5f, 0xbe, 0xaa, 0x2e, 0x7c, 0xf5, 0xaa, 0xba,
+ 0xf0, 0xf5, 0xab, 0xea, 0xc2, 0x2f, 0x46, 0x55, 0xed, 0xe5, 0xa8, 0xaa, 0x7d, 0x35, 0xaa, 0x6a,
+ 0x5f, 0x8f, 0xaa, 0xda, 0xbf, 0x46, 0x55, 0xed, 0xd7, 0xaf, 0xab, 0x0b, 0x9f, 0x57, 0x26, 0xff,
+ 0xcf, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x30, 0xdb, 0x24, 0x04, 0x18, 0x00, 0x00,
}
func (m *CSIDriver) Marshal() (dAtA []byte, err error) {
@@ -1664,6 +1727,115 @@ func (m *VolumeAttachmentStatus) MarshalToSizedBuffer(dAtA []byte) (int, error)
return len(dAtA) - i, nil
}
+func (m *VolumeAttributesClass) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *VolumeAttributesClass) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *VolumeAttributesClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Parameters) > 0 {
+ keysForParameters := make([]string, 0, len(m.Parameters))
+ for k := range m.Parameters {
+ keysForParameters = append(keysForParameters, string(k))
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForParameters)
+ for iNdEx := len(keysForParameters) - 1; iNdEx >= 0; iNdEx-- {
+ v := m.Parameters[string(keysForParameters[iNdEx])]
+ baseI := i
+ i -= len(v)
+ copy(dAtA[i:], v)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(v)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(keysForParameters[iNdEx])
+ copy(dAtA[i:], keysForParameters[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(keysForParameters[iNdEx])))
+ i--
+ dAtA[i] = 0xa
+ i = encodeVarintGenerated(dAtA, i, uint64(baseI-i))
+ i--
+ dAtA[i] = 0x1a
+ }
+ }
+ i -= len(m.DriverName)
+ copy(dAtA[i:], m.DriverName)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName)))
+ i--
+ dAtA[i] = 0x12
+ {
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *VolumeAttributesClassList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *VolumeAttributesClassList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *VolumeAttributesClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Items) > 0 {
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *VolumeError) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -2086,6 +2258,44 @@ func (m *VolumeAttachmentStatus) Size() (n int) {
return n
}
+func (m *VolumeAttributesClass) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.DriverName)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Parameters) > 0 {
+ for k, v := range m.Parameters {
+ _ = k
+ _ = v
+ mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v)))
+ n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
+ }
+ }
+ return n
+}
+
+func (m *VolumeAttributesClassList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
func (m *VolumeError) Size() (n int) {
if m == nil {
return 0
@@ -2384,6 +2594,44 @@ func (this *VolumeAttachmentStatus) String() string {
}, "")
return s
}
+func (this *VolumeAttributesClass) String() string {
+ if this == nil {
+ return "nil"
+ }
+ keysForParameters := make([]string, 0, len(this.Parameters))
+ for k := range this.Parameters {
+ keysForParameters = append(keysForParameters, k)
+ }
+ github_com_gogo_protobuf_sortkeys.Strings(keysForParameters)
+ mapStringForParameters := "map[string]string{"
+ for _, k := range keysForParameters {
+ mapStringForParameters += fmt.Sprintf("%v: %v,", k, this.Parameters[k])
+ }
+ mapStringForParameters += "}"
+ s := strings.Join([]string{`&VolumeAttributesClass{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`,
+ `Parameters:` + mapStringForParameters + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *VolumeAttributesClassList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForItems := "[]VolumeAttributesClass{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "VolumeAttributesClass", "VolumeAttributesClass", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&VolumeAttributesClassList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *VolumeError) String() string {
if this == nil {
return "nil"
@@ -5154,6 +5402,365 @@ func (m *VolumeAttachmentStatus) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *VolumeAttributesClass) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: VolumeAttributesClass: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: VolumeAttributesClass: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.DriverName = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Parameters == nil {
+ m.Parameters = make(map[string]string)
+ }
+ var mapkey string
+ var mapvalue string
+ for iNdEx < postIndex {
+ entryPreIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ if fieldNum == 1 {
+ var stringLenmapkey uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLenmapkey |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapkey := int(stringLenmapkey)
+ if intStringLenmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapkey := iNdEx + intStringLenmapkey
+ if postStringIndexmapkey < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postStringIndexmapkey > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
+ iNdEx = postStringIndexmapkey
+ } else if fieldNum == 2 {
+ var stringLenmapvalue uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLenmapvalue |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLenmapvalue := int(stringLenmapvalue)
+ if intStringLenmapvalue < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postStringIndexmapvalue := iNdEx + intStringLenmapvalue
+ if postStringIndexmapvalue < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postStringIndexmapvalue > l {
+ return io.ErrUnexpectedEOF
+ }
+ mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
+ iNdEx = postStringIndexmapvalue
+ } else {
+ iNdEx = entryPreIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > postIndex {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+ m.Parameters[mapkey] = mapvalue
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *VolumeAttributesClassList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: VolumeAttributesClassList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: VolumeAttributesClassList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, VolumeAttributesClass{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *VolumeError) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
diff --git a/vendor/k8s.io/api/storage/v1beta1/generated.proto b/vendor/k8s.io/api/storage/v1beta1/generated.proto
index f6e619d05da..dfef3f6cc5f 100644
--- a/vendor/k8s.io/api/storage/v1beta1/generated.proto
+++ b/vendor/k8s.io/api/storage/v1beta1/generated.proto
@@ -47,7 +47,7 @@ message CSIDriver {
// an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and
// alphanumerics between.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec represents the specification of the CSI Driver.
optional CSIDriverSpec spec = 2;
@@ -58,7 +58,7 @@ message CSIDriverList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CSIDriver
repeated CSIDriver items = 2;
@@ -229,7 +229,7 @@ message CSIDriverSpec {
// CSINode has an OwnerReference that points to the corresponding node object.
message CSINode {
// metadata.name must be the Kubernetes node name.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the specification of CSINode
optional CSINodeSpec spec = 2;
@@ -277,7 +277,7 @@ message CSINodeList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CSINode
repeated CSINode items = 2;
@@ -329,7 +329,7 @@ message CSIStorageCapacity {
//
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// nodeTopology defines which nodes have access to the storage
// for which capacity was reported. If not set, the storage is
@@ -338,7 +338,7 @@ message CSIStorageCapacity {
// immutable.
//
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
// storageClassName represents the name of the StorageClass that the reported capacity applies to.
// It must meet the same requirements as the name of a StorageClass
@@ -358,7 +358,7 @@ message CSIStorageCapacity {
// unavailable.
//
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
// maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse
// for a GetCapacityRequest with topology and parameters that match the
@@ -372,7 +372,7 @@ message CSIStorageCapacity {
// API is ResourceRequirements.Requests in a volume claim.
//
// +optional
- optional k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
+ optional .k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
}
// CSIStorageCapacityList is a collection of CSIStorageCapacity objects.
@@ -380,7 +380,7 @@ message CSIStorageCapacityList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of CSIStorageCapacity objects.
repeated CSIStorageCapacity items = 2;
@@ -395,7 +395,7 @@ message StorageClass {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// provisioner indicates the type of the provisioner.
optional string provisioner = 2;
@@ -433,7 +433,7 @@ message StorageClass {
// This field is only honored by servers that enable the VolumeScheduling feature.
// +optional
// +listType=atomic
- repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
+ repeated .k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
}
// StorageClassList is a collection of storage classes.
@@ -441,7 +441,7 @@ message StorageClassList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of StorageClasses
repeated StorageClass items = 2;
@@ -468,7 +468,7 @@ message VolumeAttachment {
// Standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec represents specification of the desired attach/detach volume behavior.
// Populated by the Kubernetes system.
@@ -486,7 +486,7 @@ message VolumeAttachmentList {
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is the list of VolumeAttachments
repeated VolumeAttachment items = 2;
@@ -508,7 +508,7 @@ message VolumeAttachmentSource {
// PersistentVolumeSpec. This field is beta-level and is only
// honored by servers that enabled the CSIMigration feature.
// +optional
- optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
+ optional .k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
}
// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
@@ -552,11 +552,51 @@ message VolumeAttachmentStatus {
optional VolumeError detachError = 4;
}
+// VolumeAttributesClass represents a specification of mutable volume attributes
+// defined by the CSI driver. The class can be specified during dynamic provisioning
+// of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.
+message VolumeAttributesClass {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Name of the CSI driver
+ // This field is immutable.
+ optional string driverName = 2;
+
+ // parameters hold volume attributes defined by the CSI driver. These values
+ // are opaque to the Kubernetes and are passed directly to the CSI driver.
+ // The underlying storage provider supports changing these attributes on an
+ // existing volume, however the parameters field itself is immutable. To
+ // invoke a volume update, a new VolumeAttributesClass should be created with
+ // new parameters, and the PersistentVolumeClaim should be updated to reference
+ // the new VolumeAttributesClass.
+ //
+ // This field is required and must contain at least one key/value pair.
+ // The keys cannot be empty, and the maximum number of parameters is 512, with
+ // a cumulative max size of 256K. If the CSI driver rejects invalid parameters,
+ // the target PersistentVolumeClaim will be set to an "Infeasible" state in the
+ // modifyVolumeStatus field.
+ map parameters = 3;
+}
+
+// VolumeAttributesClassList is a collection of VolumeAttributesClass objects.
+message VolumeAttributesClassList {
+ // Standard list metadata
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // items is the list of VolumeAttributesClass objects.
+ repeated VolumeAttributesClass items = 2;
+}
+
// VolumeError captures an error encountered during a volume operation.
message VolumeError {
// time represents the time the error was encountered.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
// message represents the error encountered during Attach or Detach operation.
// This string may be logged, so it should not contain sensitive
diff --git a/vendor/k8s.io/api/storage/v1beta1/register.go b/vendor/k8s.io/api/storage/v1beta1/register.go
index a281d0f26ec..e2214ef2f54 100644
--- a/vendor/k8s.io/api/storage/v1beta1/register.go
+++ b/vendor/k8s.io/api/storage/v1beta1/register.go
@@ -58,6 +58,9 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&CSIStorageCapacity{},
&CSIStorageCapacityList{},
+
+ &VolumeAttributesClass{},
+ &VolumeAttributesClassList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
diff --git a/vendor/k8s.io/api/storage/v1beta1/types.go b/vendor/k8s.io/api/storage/v1beta1/types.go
index 9333a28b8d0..ce294e3dbab 100644
--- a/vendor/k8s.io/api/storage/v1beta1/types.go
+++ b/vendor/k8s.io/api/storage/v1beta1/types.go
@@ -714,3 +714,55 @@ type CSIStorageCapacityList struct {
// items is the list of CSIStorageCapacity objects.
Items []CSIStorageCapacity `json:"items" protobuf:"bytes,2,rep,name=items"`
}
+
+// +genclient
+// +genclient:nonNamespaced
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// VolumeAttributesClass represents a specification of mutable volume attributes
+// defined by the CSI driver. The class can be specified during dynamic provisioning
+// of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.
+type VolumeAttributesClass struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Name of the CSI driver
+ // This field is immutable.
+ DriverName string `json:"driverName" protobuf:"bytes,2,opt,name=driverName"`
+
+ // parameters hold volume attributes defined by the CSI driver. These values
+ // are opaque to the Kubernetes and are passed directly to the CSI driver.
+ // The underlying storage provider supports changing these attributes on an
+ // existing volume, however the parameters field itself is immutable. To
+ // invoke a volume update, a new VolumeAttributesClass should be created with
+ // new parameters, and the PersistentVolumeClaim should be updated to reference
+ // the new VolumeAttributesClass.
+ //
+ // This field is required and must contain at least one key/value pair.
+ // The keys cannot be empty, and the maximum number of parameters is 512, with
+ // a cumulative max size of 256K. If the CSI driver rejects invalid parameters,
+ // the target PersistentVolumeClaim will be set to an "Infeasible" state in the
+ // modifyVolumeStatus field.
+ Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"`
+}
+
+// +k8s:prerelease-lifecycle-gen:introduced=1.31
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// VolumeAttributesClassList is a collection of VolumeAttributesClass objects.
+type VolumeAttributesClassList struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // Standard list metadata
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // items is the list of VolumeAttributesClass objects.
+ Items []VolumeAttributesClass `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
diff --git a/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go
index 6d9d233066a..8c1a663507e 100644
--- a/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go
@@ -216,6 +216,27 @@ func (VolumeAttachmentStatus) SwaggerDoc() map[string]string {
return map_VolumeAttachmentStatus
}
+var map_VolumeAttributesClass = map[string]string{
+ "": "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.",
+ "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "driverName": "Name of the CSI driver This field is immutable.",
+ "parameters": "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass.\n\nThis field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.",
+}
+
+func (VolumeAttributesClass) SwaggerDoc() map[string]string {
+ return map_VolumeAttributesClass
+}
+
+var map_VolumeAttributesClassList = map[string]string{
+ "": "VolumeAttributesClassList is a collection of VolumeAttributesClass objects.",
+ "metadata": "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "items": "items is the list of VolumeAttributesClass objects.",
+}
+
+func (VolumeAttributesClassList) SwaggerDoc() map[string]string {
+ return map_VolumeAttributesClassList
+}
+
var map_VolumeError = map[string]string{
"": "VolumeError captures an error encountered during a volume operation.",
"time": "time represents the time the error was encountered.",
diff --git a/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go
index f0450182b27..d87aa6b90be 100644
--- a/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go
@@ -579,6 +579,72 @@ func (in *VolumeAttachmentStatus) DeepCopy() *VolumeAttachmentStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *VolumeAttributesClass) DeepCopyInto(out *VolumeAttributesClass) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Parameters != nil {
+ in, out := &in.Parameters, &out.Parameters
+ *out = make(map[string]string, len(*in))
+ for key, val := range *in {
+ (*out)[key] = val
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttributesClass.
+func (in *VolumeAttributesClass) DeepCopy() *VolumeAttributesClass {
+ if in == nil {
+ return nil
+ }
+ out := new(VolumeAttributesClass)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *VolumeAttributesClass) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *VolumeAttributesClassList) DeepCopyInto(out *VolumeAttributesClassList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]VolumeAttributesClass, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttributesClassList.
+func (in *VolumeAttributesClassList) DeepCopy() *VolumeAttributesClassList {
+ if in == nil {
+ return nil
+ }
+ out := new(VolumeAttributesClassList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *VolumeAttributesClassList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeError) DeepCopyInto(out *VolumeError) {
*out = *in
diff --git a/vendor/k8s.io/api/storage/v1beta1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/storage/v1beta1/zz_generated.prerelease-lifecycle.go
index c5d23e7d45e..4be57dc0d46 100644
--- a/vendor/k8s.io/api/storage/v1beta1/zz_generated.prerelease-lifecycle.go
+++ b/vendor/k8s.io/api/storage/v1beta1/zz_generated.prerelease-lifecycle.go
@@ -264,3 +264,39 @@ func (in *VolumeAttachmentList) APILifecycleReplacement() schema.GroupVersionKin
func (in *VolumeAttachmentList) APILifecycleRemoved() (major, minor int) {
return 1, 22
}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *VolumeAttributesClass) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *VolumeAttributesClass) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *VolumeAttributesClass) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *VolumeAttributesClassList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 31
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *VolumeAttributesClassList) APILifecycleDeprecated() (major, minor int) {
+ return 1, 34
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *VolumeAttributesClassList) APILifecycleRemoved() (major, minor int) {
+ return 1, 37
+}
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/doc.go b/vendor/k8s.io/api/storagemigration/v1alpha1/doc.go
new file mode 100644
index 00000000000..192f9ff3c3c
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/doc.go
@@ -0,0 +1,23 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +k8s:deepcopy-gen=package
+// +k8s:protobuf-gen=package
+// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
+// +groupName=storagemigration.k8s.io
+
+package v1alpha1 // import "k8s.io/api/storagemigration/v1alpha1"
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/generated.pb.go b/vendor/k8s.io/api/storagemigration/v1alpha1/generated.pb.go
new file mode 100644
index 00000000000..ed57f34b59e
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/generated.pb.go
@@ -0,0 +1,1688 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: k8s.io/api/storagemigration/v1alpha1/generated.proto
+
+package v1alpha1
+
+import (
+ fmt "fmt"
+
+ io "io"
+
+ proto "github.com/gogo/protobuf/proto"
+
+ k8s_io_api_core_v1 "k8s.io/api/core/v1"
+
+ math "math"
+ math_bits "math/bits"
+ reflect "reflect"
+ strings "strings"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
+func (*GroupVersionResource) ProtoMessage() {}
+func (*GroupVersionResource) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0117377a57b172b9, []int{0}
+}
+func (m *GroupVersionResource) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *GroupVersionResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *GroupVersionResource) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GroupVersionResource.Merge(m, src)
+}
+func (m *GroupVersionResource) XXX_Size() int {
+ return m.Size()
+}
+func (m *GroupVersionResource) XXX_DiscardUnknown() {
+ xxx_messageInfo_GroupVersionResource.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GroupVersionResource proto.InternalMessageInfo
+
+func (m *MigrationCondition) Reset() { *m = MigrationCondition{} }
+func (*MigrationCondition) ProtoMessage() {}
+func (*MigrationCondition) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0117377a57b172b9, []int{1}
+}
+func (m *MigrationCondition) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MigrationCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *MigrationCondition) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MigrationCondition.Merge(m, src)
+}
+func (m *MigrationCondition) XXX_Size() int {
+ return m.Size()
+}
+func (m *MigrationCondition) XXX_DiscardUnknown() {
+ xxx_messageInfo_MigrationCondition.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MigrationCondition proto.InternalMessageInfo
+
+func (m *StorageVersionMigration) Reset() { *m = StorageVersionMigration{} }
+func (*StorageVersionMigration) ProtoMessage() {}
+func (*StorageVersionMigration) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0117377a57b172b9, []int{2}
+}
+func (m *StorageVersionMigration) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *StorageVersionMigration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *StorageVersionMigration) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StorageVersionMigration.Merge(m, src)
+}
+func (m *StorageVersionMigration) XXX_Size() int {
+ return m.Size()
+}
+func (m *StorageVersionMigration) XXX_DiscardUnknown() {
+ xxx_messageInfo_StorageVersionMigration.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StorageVersionMigration proto.InternalMessageInfo
+
+func (m *StorageVersionMigrationList) Reset() { *m = StorageVersionMigrationList{} }
+func (*StorageVersionMigrationList) ProtoMessage() {}
+func (*StorageVersionMigrationList) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0117377a57b172b9, []int{3}
+}
+func (m *StorageVersionMigrationList) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *StorageVersionMigrationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *StorageVersionMigrationList) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StorageVersionMigrationList.Merge(m, src)
+}
+func (m *StorageVersionMigrationList) XXX_Size() int {
+ return m.Size()
+}
+func (m *StorageVersionMigrationList) XXX_DiscardUnknown() {
+ xxx_messageInfo_StorageVersionMigrationList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StorageVersionMigrationList proto.InternalMessageInfo
+
+func (m *StorageVersionMigrationSpec) Reset() { *m = StorageVersionMigrationSpec{} }
+func (*StorageVersionMigrationSpec) ProtoMessage() {}
+func (*StorageVersionMigrationSpec) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0117377a57b172b9, []int{4}
+}
+func (m *StorageVersionMigrationSpec) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *StorageVersionMigrationSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *StorageVersionMigrationSpec) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StorageVersionMigrationSpec.Merge(m, src)
+}
+func (m *StorageVersionMigrationSpec) XXX_Size() int {
+ return m.Size()
+}
+func (m *StorageVersionMigrationSpec) XXX_DiscardUnknown() {
+ xxx_messageInfo_StorageVersionMigrationSpec.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StorageVersionMigrationSpec proto.InternalMessageInfo
+
+func (m *StorageVersionMigrationStatus) Reset() { *m = StorageVersionMigrationStatus{} }
+func (*StorageVersionMigrationStatus) ProtoMessage() {}
+func (*StorageVersionMigrationStatus) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0117377a57b172b9, []int{5}
+}
+func (m *StorageVersionMigrationStatus) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *StorageVersionMigrationStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *StorageVersionMigrationStatus) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StorageVersionMigrationStatus.Merge(m, src)
+}
+func (m *StorageVersionMigrationStatus) XXX_Size() int {
+ return m.Size()
+}
+func (m *StorageVersionMigrationStatus) XXX_DiscardUnknown() {
+ xxx_messageInfo_StorageVersionMigrationStatus.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StorageVersionMigrationStatus proto.InternalMessageInfo
+
+func init() {
+ proto.RegisterType((*GroupVersionResource)(nil), "k8s.io.api.storagemigration.v1alpha1.GroupVersionResource")
+ proto.RegisterType((*MigrationCondition)(nil), "k8s.io.api.storagemigration.v1alpha1.MigrationCondition")
+ proto.RegisterType((*StorageVersionMigration)(nil), "k8s.io.api.storagemigration.v1alpha1.StorageVersionMigration")
+ proto.RegisterType((*StorageVersionMigrationList)(nil), "k8s.io.api.storagemigration.v1alpha1.StorageVersionMigrationList")
+ proto.RegisterType((*StorageVersionMigrationSpec)(nil), "k8s.io.api.storagemigration.v1alpha1.StorageVersionMigrationSpec")
+ proto.RegisterType((*StorageVersionMigrationStatus)(nil), "k8s.io.api.storagemigration.v1alpha1.StorageVersionMigrationStatus")
+}
+
+func init() {
+ proto.RegisterFile("k8s.io/api/storagemigration/v1alpha1/generated.proto", fileDescriptor_0117377a57b172b9)
+}
+
+var fileDescriptor_0117377a57b172b9 = []byte{
+ // 719 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x4f, 0x13, 0x4f,
+ 0x14, 0xef, 0x42, 0x0b, 0x7c, 0xa7, 0x5f, 0xc0, 0x4c, 0x14, 0x1a, 0x8c, 0x5b, 0x53, 0x09, 0x41,
+ 0xa3, 0xb3, 0xd2, 0x10, 0x43, 0x30, 0x1e, 0x28, 0x07, 0xa3, 0x81, 0x98, 0x0c, 0xc8, 0xc1, 0x78,
+ 0x70, 0xba, 0x1d, 0xb7, 0x43, 0xd9, 0x9d, 0xcd, 0xce, 0x6c, 0x13, 0x6e, 0xfe, 0x09, 0x1e, 0xfc,
+ 0x93, 0x3c, 0x70, 0x31, 0xe1, 0xc8, 0xc5, 0x2a, 0xf5, 0xbf, 0xe0, 0x64, 0x66, 0x76, 0x76, 0xfb,
+ 0x8b, 0x62, 0x13, 0x6e, 0x3b, 0xef, 0xbd, 0xcf, 0x67, 0xde, 0x7b, 0x9f, 0x79, 0x6f, 0xc1, 0x66,
+ 0x6b, 0x4b, 0x20, 0xc6, 0x1d, 0x12, 0x32, 0x47, 0x48, 0x1e, 0x11, 0x8f, 0xfa, 0xcc, 0x8b, 0x88,
+ 0x64, 0x3c, 0x70, 0xda, 0x1b, 0xe4, 0x24, 0x6c, 0x92, 0x0d, 0xc7, 0xa3, 0x01, 0x8d, 0x88, 0xa4,
+ 0x0d, 0x14, 0x46, 0x5c, 0x72, 0xb8, 0x9a, 0xa0, 0x10, 0x09, 0x19, 0x1a, 0x46, 0xa1, 0x14, 0xb5,
+ 0xf2, 0xcc, 0x63, 0xb2, 0x19, 0xd7, 0x91, 0xcb, 0x7d, 0xc7, 0xe3, 0x1e, 0x77, 0x34, 0xb8, 0x1e,
+ 0x7f, 0xd6, 0x27, 0x7d, 0xd0, 0x5f, 0x09, 0xe9, 0x4a, 0xa5, 0x2f, 0x15, 0x97, 0x47, 0xd4, 0x69,
+ 0x8f, 0x5c, 0xbc, 0xd2, 0x97, 0xae, 0x4f, 0xdc, 0x26, 0x0b, 0x68, 0x74, 0xea, 0x84, 0x2d, 0x4f,
+ 0x19, 0x84, 0xe3, 0x53, 0x49, 0xae, 0x43, 0x39, 0xe3, 0x50, 0x51, 0x1c, 0x48, 0xe6, 0xd3, 0x11,
+ 0xc0, 0x8b, 0x7f, 0x01, 0x84, 0xdb, 0xa4, 0x3e, 0x19, 0xc6, 0x55, 0xbe, 0x59, 0xe0, 0xee, 0xeb,
+ 0x88, 0xc7, 0xe1, 0x11, 0x8d, 0x04, 0xe3, 0x01, 0xa6, 0x82, 0xc7, 0x91, 0x4b, 0xe1, 0x23, 0x50,
+ 0xf0, 0x94, 0xbd, 0x64, 0x3d, 0xb4, 0xd6, 0xff, 0xab, 0xcd, 0x9f, 0x75, 0xca, 0xb9, 0x6e, 0xa7,
+ 0x5c, 0xd0, 0xc1, 0x38, 0xf1, 0xc1, 0xc7, 0x60, 0xb6, 0x9d, 0xe0, 0x4a, 0x53, 0x3a, 0x6c, 0xd1,
+ 0x84, 0xcd, 0xa6, 0x74, 0xa9, 0x1f, 0x3e, 0x05, 0x73, 0x91, 0xe1, 0x2e, 0x4d, 0xeb, 0xd8, 0x3b,
+ 0x26, 0x76, 0x2e, 0xbd, 0x13, 0x67, 0x11, 0x95, 0x9f, 0x53, 0x00, 0xee, 0xa7, 0xfa, 0xec, 0xf2,
+ 0xa0, 0xc1, 0xd4, 0x07, 0xdc, 0x06, 0x79, 0x79, 0x1a, 0x52, 0x93, 0xd3, 0x9a, 0x21, 0xc8, 0x1f,
+ 0x9e, 0x86, 0xf4, 0xaa, 0x53, 0x5e, 0x1a, 0x45, 0x28, 0x0f, 0xd6, 0x18, 0xb8, 0x07, 0x66, 0x84,
+ 0x24, 0x32, 0x16, 0x26, 0xd5, 0x4d, 0x83, 0x9e, 0x39, 0xd0, 0xd6, 0xab, 0x4e, 0xf9, 0x1a, 0x39,
+ 0x51, 0xc6, 0x94, 0x44, 0x61, 0xc3, 0x01, 0x8f, 0xc1, 0xc2, 0x09, 0x11, 0xf2, 0x7d, 0xd8, 0x20,
+ 0x92, 0x1e, 0x32, 0x3f, 0x29, 0xaa, 0x58, 0x7d, 0x82, 0x7a, 0x0f, 0x2d, 0x13, 0x02, 0x85, 0x2d,
+ 0x4f, 0x19, 0x04, 0x52, 0x7a, 0xa3, 0xf6, 0x06, 0x52, 0x88, 0xda, 0x92, 0xc9, 0x60, 0x61, 0x6f,
+ 0x80, 0x09, 0x0f, 0x31, 0xc3, 0x35, 0x30, 0x13, 0x51, 0x22, 0x78, 0x50, 0xca, 0xeb, 0xcc, 0x17,
+ 0xd2, 0xcc, 0xb1, 0xb6, 0x62, 0xe3, 0x55, 0x6a, 0xf8, 0x54, 0x08, 0xe2, 0xd1, 0x52, 0x61, 0x50,
+ 0x8d, 0xfd, 0xc4, 0x8c, 0x53, 0x7f, 0xe5, 0xc7, 0x14, 0x58, 0x3e, 0x48, 0xc6, 0xc0, 0x28, 0x95,
+ 0xf5, 0x0e, 0x7e, 0x02, 0x73, 0x2a, 0xcd, 0x06, 0x91, 0x44, 0x37, 0xba, 0x58, 0x7d, 0x3e, 0x59,
+ 0x51, 0xef, 0xea, 0xc7, 0xd4, 0x95, 0xfb, 0x54, 0x92, 0x1a, 0x34, 0x37, 0x83, 0x9e, 0x0d, 0x67,
+ 0xac, 0xd0, 0x05, 0x79, 0x11, 0x52, 0x57, 0x0b, 0x51, 0xac, 0xee, 0xa0, 0x49, 0x66, 0x13, 0x8d,
+ 0x49, 0xf7, 0x20, 0xa4, 0x6e, 0xed, 0xff, 0xf4, 0x25, 0xa8, 0x13, 0xd6, 0xe4, 0xb0, 0x95, 0xe9,
+ 0x9d, 0x28, 0xb3, 0x7b, 0xbb, 0x6b, 0x34, 0x55, 0xaf, 0xf5, 0x83, 0xcf, 0xa1, 0xf2, 0xcb, 0x02,
+ 0xf7, 0xc7, 0x20, 0xf7, 0x98, 0x90, 0xf0, 0xe3, 0x48, 0x4f, 0xd1, 0x64, 0x3d, 0x55, 0x68, 0xdd,
+ 0xd1, 0x6c, 0x5a, 0x52, 0x4b, 0x5f, 0x3f, 0xeb, 0xa0, 0xc0, 0x24, 0xf5, 0xd5, 0xcb, 0x9e, 0x5e,
+ 0x2f, 0x56, 0x5f, 0xdd, 0xaa, 0xd2, 0xde, 0xa8, 0xbf, 0x51, 0x9c, 0x38, 0xa1, 0xae, 0x7c, 0x1f,
+ 0x5f, 0xa1, 0x6a, 0x3a, 0x6c, 0xf6, 0xcd, 0x77, 0x52, 0xe1, 0xf6, 0x64, 0x69, 0x5c, 0xb7, 0x7d,
+ 0x6e, 0xda, 0x0d, 0xf0, 0x25, 0x98, 0x77, 0x79, 0x20, 0x59, 0x10, 0xd3, 0x43, 0xde, 0xa2, 0xe9,
+ 0xea, 0xb9, 0x67, 0x20, 0xf3, 0xbb, 0xfd, 0x4e, 0x3c, 0x18, 0x5b, 0x39, 0xb7, 0xc0, 0x83, 0x1b,
+ 0x25, 0x86, 0x27, 0x00, 0xb8, 0xe9, 0xd0, 0x8b, 0x92, 0xa5, 0x3b, 0xba, 0x35, 0x59, 0x29, 0xa3,
+ 0xfb, 0xa7, 0x37, 0x08, 0x99, 0x49, 0xe0, 0x3e, 0x7e, 0xb8, 0x03, 0x16, 0xd3, 0xc2, 0x8e, 0x06,
+ 0x36, 0xe9, 0xb2, 0x01, 0x2e, 0xe2, 0x41, 0x37, 0x1e, 0x8e, 0xaf, 0xbd, 0x3d, 0xbb, 0xb4, 0x73,
+ 0xe7, 0x97, 0x76, 0xee, 0xe2, 0xd2, 0xce, 0x7d, 0xe9, 0xda, 0xd6, 0x59, 0xd7, 0xb6, 0xce, 0xbb,
+ 0xb6, 0x75, 0xd1, 0xb5, 0xad, 0xdf, 0x5d, 0xdb, 0xfa, 0xfa, 0xc7, 0xce, 0x7d, 0x58, 0x9d, 0xe4,
+ 0xb7, 0xf9, 0x37, 0x00, 0x00, 0xff, 0xff, 0x01, 0xc1, 0xb1, 0xd8, 0x5d, 0x07, 0x00, 0x00,
+}
+
+func (m *GroupVersionResource) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *GroupVersionResource) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *GroupVersionResource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.Resource)
+ copy(dAtA[i:], m.Resource)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource)))
+ i--
+ dAtA[i] = 0x1a
+ i -= len(m.Version)
+ copy(dAtA[i:], m.Version)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.Group)
+ copy(dAtA[i:], m.Group)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *MigrationCondition) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MigrationCondition) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MigrationCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.Message)
+ copy(dAtA[i:], m.Message)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message)))
+ i--
+ dAtA[i] = 0x2a
+ i -= len(m.Reason)
+ copy(dAtA[i:], m.Reason)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason)))
+ i--
+ dAtA[i] = 0x22
+ {
+ size, err := m.LastUpdateTime.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
+ i -= len(m.Status)
+ copy(dAtA[i:], m.Status)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.Type)
+ copy(dAtA[i:], m.Type)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *StorageVersionMigration) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *StorageVersionMigration) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *StorageVersionMigration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1a
+ {
+ size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ {
+ size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *StorageVersionMigrationList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *StorageVersionMigrationList) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *StorageVersionMigrationList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Items) > 0 {
+ for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *StorageVersionMigrationSpec) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *StorageVersionMigrationSpec) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *StorageVersionMigrationSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.ContinueToken)
+ copy(dAtA[i:], m.ContinueToken)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContinueToken)))
+ i--
+ dAtA[i] = 0x12
+ {
+ size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
+func (m *StorageVersionMigrationStatus) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *StorageVersionMigrationStatus) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *StorageVersionMigrationStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.ResourceVersion)
+ copy(dAtA[i:], m.ResourceVersion)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceVersion)))
+ i--
+ dAtA[i] = 0x12
+ if len(m.Conditions) > 0 {
+ for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ offset -= sovGenerated(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *GroupVersionResource) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Group)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Version)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Resource)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *MigrationCondition) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Type)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Status)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.LastUpdateTime.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Reason)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Message)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *StorageVersionMigration) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Status.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *StorageVersionMigrationList) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *StorageVersionMigrationSpec) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Resource.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.ContinueToken)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *StorageVersionMigrationStatus) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Conditions) > 0 {
+ for _, e := range m.Conditions {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ l = len(m.ResourceVersion)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func sovGenerated(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozGenerated(x uint64) (n int) {
+ return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (this *GroupVersionResource) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&GroupVersionResource{`,
+ `Group:` + fmt.Sprintf("%v", this.Group) + `,`,
+ `Version:` + fmt.Sprintf("%v", this.Version) + `,`,
+ `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *MigrationCondition) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&MigrationCondition{`,
+ `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
+ `Status:` + fmt.Sprintf("%v", this.Status) + `,`,
+ `LastUpdateTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastUpdateTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`,
+ `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`,
+ `Message:` + fmt.Sprintf("%v", this.Message) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *StorageVersionMigration) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&StorageVersionMigration{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "StorageVersionMigrationSpec", "StorageVersionMigrationSpec", 1), `&`, ``, 1) + `,`,
+ `Status:` + strings.Replace(strings.Replace(this.Status.String(), "StorageVersionMigrationStatus", "StorageVersionMigrationStatus", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *StorageVersionMigrationList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForItems := "[]StorageVersionMigration{"
+ for _, f := range this.Items {
+ repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "StorageVersionMigration", "StorageVersionMigration", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForItems += "}"
+ s := strings.Join([]string{`&StorageVersionMigrationList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + repeatedStringForItems + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *StorageVersionMigrationSpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&StorageVersionMigrationSpec{`,
+ `Resource:` + strings.Replace(strings.Replace(this.Resource.String(), "GroupVersionResource", "GroupVersionResource", 1), `&`, ``, 1) + `,`,
+ `ContinueToken:` + fmt.Sprintf("%v", this.ContinueToken) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *StorageVersionMigrationStatus) String() string {
+ if this == nil {
+ return "nil"
+ }
+ repeatedStringForConditions := "[]MigrationCondition{"
+ for _, f := range this.Conditions {
+ repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "MigrationCondition", "MigrationCondition", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForConditions += "}"
+ s := strings.Join([]string{`&StorageVersionMigrationStatus{`,
+ `Conditions:` + repeatedStringForConditions + `,`,
+ `ResourceVersion:` + fmt.Sprintf("%v", this.ResourceVersion) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
+}
+func (m *GroupVersionResource) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: GroupVersionResource: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: GroupVersionResource: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Group = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Version = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Resource = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MigrationCondition) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MigrationCondition: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MigrationCondition: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Type = MigrationConditionType(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field LastUpdateTime", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.LastUpdateTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Reason = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Message = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *StorageVersionMigration) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: StorageVersionMigration: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageVersionMigration: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *StorageVersionMigrationList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: StorageVersionMigrationList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageVersionMigrationList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, StorageVersionMigration{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *StorageVersionMigrationSpec) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: StorageVersionMigrationSpec: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageVersionMigrationSpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ContinueToken", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ContinueToken = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *StorageVersionMigrationStatus) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: StorageVersionMigrationStatus: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: StorageVersionMigrationStatus: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Conditions = append(m.Conditions, MigrationCondition{})
+ if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ResourceVersion", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ResourceVersion = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipGenerated(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ depth := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ case 1:
+ iNdEx += 8
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if length < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ iNdEx += length
+ case 3:
+ depth++
+ case 4:
+ if depth == 0 {
+ return 0, ErrUnexpectedEndOfGroupGenerated
+ }
+ depth--
+ case 5:
+ iNdEx += 4
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ if depth == 0 {
+ return iNdEx, nil
+ }
+ }
+ return 0, io.ErrUnexpectedEOF
+}
+
+var (
+ ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
+ ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
+)
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/generated.proto b/vendor/k8s.io/api/storagemigration/v1alpha1/generated.proto
new file mode 100644
index 00000000000..341e0bc5cfa
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/generated.proto
@@ -0,0 +1,127 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+// This file was autogenerated by go-to-protobuf. Do not edit it manually!
+
+syntax = "proto2";
+
+package k8s.io.api.storagemigration.v1alpha1;
+
+import "k8s.io/api/core/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
+
+// Package-wide variables from generator "generated".
+option go_package = "k8s.io/api/storagemigration/v1alpha1";
+
+// The names of the group, the version, and the resource.
+message GroupVersionResource {
+ // The name of the group.
+ optional string group = 1;
+
+ // The name of the version.
+ optional string version = 2;
+
+ // The name of the resource.
+ optional string resource = 3;
+}
+
+// Describes the state of a migration at a certain point.
+message MigrationCondition {
+ // Type of the condition.
+ optional string type = 1;
+
+ // Status of the condition, one of True, False, Unknown.
+ optional string status = 2;
+
+ // The last time this condition was updated.
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 3;
+
+ // The reason for the condition's last transition.
+ // +optional
+ optional string reason = 4;
+
+ // A human readable message indicating details about the transition.
+ // +optional
+ optional string message = 5;
+}
+
+// StorageVersionMigration represents a migration of stored data to the latest
+// storage version.
+message StorageVersionMigration {
+ // Standard object metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Specification of the migration.
+ // +optional
+ optional StorageVersionMigrationSpec spec = 2;
+
+ // Status of the migration.
+ // +optional
+ optional StorageVersionMigrationStatus status = 3;
+}
+
+// StorageVersionMigrationList is a collection of storage version migrations.
+message StorageVersionMigrationList {
+ // Standard list metadata
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is the list of StorageVersionMigration
+ // +patchMergeKey=type
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=type
+ repeated StorageVersionMigration items = 2;
+}
+
+// Spec of the storage version migration.
+message StorageVersionMigrationSpec {
+ // The resource that is being migrated. The migrator sends requests to
+ // the endpoint serving the resource.
+ // Immutable.
+ optional GroupVersionResource resource = 1;
+
+ // The token used in the list options to get the next chunk of objects
+ // to migrate. When the .status.conditions indicates the migration is
+ // "Running", users can use this token to check the progress of the
+ // migration.
+ // +optional
+ optional string continueToken = 2;
+}
+
+// Status of the storage version migration.
+message StorageVersionMigrationStatus {
+ // The latest available observations of the migration's current state.
+ // +patchMergeKey=type
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=type
+ // +optional
+ repeated MigrationCondition conditions = 1;
+
+ // ResourceVersion to compare with the GC cache for performing the migration.
+ // This is the current resource version of given group, version and resource when
+ // kube-controller-manager first observes this StorageVersionMigration resource.
+ optional string resourceVersion = 2;
+}
+
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/register.go b/vendor/k8s.io/api/storagemigration/v1alpha1/register.go
new file mode 100644
index 00000000000..c9706050f12
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/register.go
@@ -0,0 +1,58 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "storagemigration.k8s.io"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
+
+// Kind takes an unqualified kind and returns a Group qualified GroupKind
+func Kind(kind string) schema.GroupKind {
+ return SchemeGroupVersion.WithKind(kind).GroupKind()
+}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ localSchemeBuilder = &SchemeBuilder
+ AddToScheme = localSchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to the given scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &StorageVersionMigration{},
+ &StorageVersionMigrationList{},
+ )
+
+ // Add the watch version that applies
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/types.go b/vendor/k8s.io/api/storagemigration/v1alpha1/types.go
new file mode 100644
index 00000000000..0f343d1e956
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/types.go
@@ -0,0 +1,131 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+ corev1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +genclient
+// +genclient:nonNamespaced
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.30
+
+// StorageVersionMigration represents a migration of stored data to the latest
+// storage version.
+type StorageVersionMigration struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // Specification of the migration.
+ // +optional
+ Spec StorageVersionMigrationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
+ // Status of the migration.
+ // +optional
+ Status StorageVersionMigrationStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
+}
+
+// Spec of the storage version migration.
+type StorageVersionMigrationSpec struct {
+ // The resource that is being migrated. The migrator sends requests to
+ // the endpoint serving the resource.
+ // Immutable.
+ Resource GroupVersionResource `json:"resource" protobuf:"bytes,1,opt,name=resource"`
+ // The token used in the list options to get the next chunk of objects
+ // to migrate. When the .status.conditions indicates the migration is
+ // "Running", users can use this token to check the progress of the
+ // migration.
+ // +optional
+ ContinueToken string `json:"continueToken,omitempty" protobuf:"bytes,2,opt,name=continueToken"`
+ // TODO: consider recording the storage version hash when the migration
+ // is created. It can avoid races.
+}
+
+// The names of the group, the version, and the resource.
+type GroupVersionResource struct {
+ // The name of the group.
+ Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
+ // The name of the version.
+ Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"`
+ // The name of the resource.
+ Resource string `json:"resource,omitempty" protobuf:"bytes,3,opt,name=resource"`
+}
+
+type MigrationConditionType string
+
+const (
+ // Indicates that the migration is running.
+ MigrationRunning MigrationConditionType = "Running"
+ // Indicates that the migration has completed successfully.
+ MigrationSucceeded MigrationConditionType = "Succeeded"
+ // Indicates that the migration has failed.
+ MigrationFailed MigrationConditionType = "Failed"
+)
+
+// Describes the state of a migration at a certain point.
+type MigrationCondition struct {
+ // Type of the condition.
+ Type MigrationConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=MigrationConditionType"`
+ // Status of the condition, one of True, False, Unknown.
+ Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
+ // The last time this condition was updated.
+ // +optional
+ LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,3,opt,name=lastUpdateTime"`
+ // The reason for the condition's last transition.
+ // +optional
+ Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
+ // A human readable message indicating details about the transition.
+ // +optional
+ Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
+}
+
+// Status of the storage version migration.
+type StorageVersionMigrationStatus struct {
+ // The latest available observations of the migration's current state.
+ // +patchMergeKey=type
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=type
+ // +optional
+ Conditions []MigrationCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
+ // ResourceVersion to compare with the GC cache for performing the migration.
+ // This is the current resource version of given group, version and resource when
+ // kube-controller-manager first observes this StorageVersionMigration resource.
+ ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.30
+
+// StorageVersionMigrationList is a collection of storage version migrations.
+type StorageVersionMigrationList struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // Standard list metadata
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+ // Items is the list of StorageVersionMigration
+ // +patchMergeKey=type
+ // +patchStrategy=merge
+ // +listType=map
+ // +listMapKey=type
+ Items []StorageVersionMigration `json:"items" listType:"map" listMapKey:"type" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=items"`
+}
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storagemigration/v1alpha1/types_swagger_doc_generated.go
new file mode 100644
index 00000000000..257d72a2363
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/types_swagger_doc_generated.go
@@ -0,0 +1,95 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+// This file contains a collection of methods that can be used from go-restful to
+// generate Swagger API documentation for its models. Please read this PR for more
+// information on the implementation: https://github.com/emicklei/go-restful/pull/215
+//
+// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
+// they are on one line! For multiple line or blocks that you want to ignore use ---.
+// Any context after a --- is ignored.
+//
+// Those methods can be generated by using hack/update-codegen.sh
+
+// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
+var map_GroupVersionResource = map[string]string{
+ "": "The names of the group, the version, and the resource.",
+ "group": "The name of the group.",
+ "version": "The name of the version.",
+ "resource": "The name of the resource.",
+}
+
+func (GroupVersionResource) SwaggerDoc() map[string]string {
+ return map_GroupVersionResource
+}
+
+var map_MigrationCondition = map[string]string{
+ "": "Describes the state of a migration at a certain point.",
+ "type": "Type of the condition.",
+ "status": "Status of the condition, one of True, False, Unknown.",
+ "lastUpdateTime": "The last time this condition was updated.",
+ "reason": "The reason for the condition's last transition.",
+ "message": "A human readable message indicating details about the transition.",
+}
+
+func (MigrationCondition) SwaggerDoc() map[string]string {
+ return map_MigrationCondition
+}
+
+var map_StorageVersionMigration = map[string]string{
+ "": "StorageVersionMigration represents a migration of stored data to the latest storage version.",
+ "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "spec": "Specification of the migration.",
+ "status": "Status of the migration.",
+}
+
+func (StorageVersionMigration) SwaggerDoc() map[string]string {
+ return map_StorageVersionMigration
+}
+
+var map_StorageVersionMigrationList = map[string]string{
+ "": "StorageVersionMigrationList is a collection of storage version migrations.",
+ "metadata": "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
+ "items": "Items is the list of StorageVersionMigration",
+}
+
+func (StorageVersionMigrationList) SwaggerDoc() map[string]string {
+ return map_StorageVersionMigrationList
+}
+
+var map_StorageVersionMigrationSpec = map[string]string{
+ "": "Spec of the storage version migration.",
+ "resource": "The resource that is being migrated. The migrator sends requests to the endpoint serving the resource. Immutable.",
+ "continueToken": "The token used in the list options to get the next chunk of objects to migrate. When the .status.conditions indicates the migration is \"Running\", users can use this token to check the progress of the migration.",
+}
+
+func (StorageVersionMigrationSpec) SwaggerDoc() map[string]string {
+ return map_StorageVersionMigrationSpec
+}
+
+var map_StorageVersionMigrationStatus = map[string]string{
+ "": "Status of the storage version migration.",
+ "conditions": "The latest available observations of the migration's current state.",
+ "resourceVersion": "ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource.",
+}
+
+func (StorageVersionMigrationStatus) SwaggerDoc() map[string]string {
+ return map_StorageVersionMigrationStatus
+}
+
+// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..9d35011d59c
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.deepcopy.go
@@ -0,0 +1,160 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *GroupVersionResource) DeepCopyInto(out *GroupVersionResource) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupVersionResource.
+func (in *GroupVersionResource) DeepCopy() *GroupVersionResource {
+ if in == nil {
+ return nil
+ }
+ out := new(GroupVersionResource)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MigrationCondition) DeepCopyInto(out *MigrationCondition) {
+ *out = *in
+ in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MigrationCondition.
+func (in *MigrationCondition) DeepCopy() *MigrationCondition {
+ if in == nil {
+ return nil
+ }
+ out := new(MigrationCondition)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *StorageVersionMigration) DeepCopyInto(out *StorageVersionMigration) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ in.Status.DeepCopyInto(&out.Status)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigration.
+func (in *StorageVersionMigration) DeepCopy() *StorageVersionMigration {
+ if in == nil {
+ return nil
+ }
+ out := new(StorageVersionMigration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *StorageVersionMigration) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *StorageVersionMigrationList) DeepCopyInto(out *StorageVersionMigrationList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]StorageVersionMigration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigrationList.
+func (in *StorageVersionMigrationList) DeepCopy() *StorageVersionMigrationList {
+ if in == nil {
+ return nil
+ }
+ out := new(StorageVersionMigrationList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *StorageVersionMigrationList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *StorageVersionMigrationSpec) DeepCopyInto(out *StorageVersionMigrationSpec) {
+ *out = *in
+ out.Resource = in.Resource
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigrationSpec.
+func (in *StorageVersionMigrationSpec) DeepCopy() *StorageVersionMigrationSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(StorageVersionMigrationSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *StorageVersionMigrationStatus) DeepCopyInto(out *StorageVersionMigrationStatus) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]MigrationCondition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigrationStatus.
+func (in *StorageVersionMigrationStatus) DeepCopy() *StorageVersionMigrationStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(StorageVersionMigrationStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..acdb5743512
--- /dev/null
+++ b/vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,58 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1alpha1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *StorageVersionMigration) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *StorageVersionMigration) APILifecycleDeprecated() (major, minor int) {
+ return 1, 33
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *StorageVersionMigration) APILifecycleRemoved() (major, minor int) {
+ return 1, 36
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *StorageVersionMigrationList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 30
+}
+
+// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.
+func (in *StorageVersionMigrationList) APILifecycleDeprecated() (major, minor int) {
+ return 1, 33
+}
+
+// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
+func (in *StorageVersionMigrationList) APILifecycleRemoved() (major, minor int) {
+ return 1, 36
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go
index b1c5f6f4c09..6556eda65d5 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go
@@ -70,6 +70,12 @@ type CustomResourceDefinitionSpec struct {
// Top-level and per-version columns are mutually exclusive.
// +optional
AdditionalPrinterColumns []CustomResourceColumnDefinition
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // A maximum of 8 selectable fields are allowed.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ // Top-level and per-version columns are mutually exclusive.
+ // +optional
+ SelectableFields []SelectableField
// `conversion` defines conversion settings for the CRD.
Conversion *CustomResourceConversion
@@ -207,6 +213,25 @@ type CustomResourceDefinitionVersion struct {
// be explicitly set to null
// +optional
AdditionalPrinterColumns []CustomResourceColumnDefinition
+
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // A maximum of 8 selectable fields are allowed.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ // +optional
+ SelectableFields []SelectableField
+}
+
+// SelectableField specifies the JSON path of a field that may be used with field selectors.
+type SelectableField struct {
+ // jsonPath is a simple JSON path which is evaluated against each custom resource to produce a
+ // field selector value.
+ // Only JSON paths without the array notation are allowed.
+ // Must point to a field of type string, boolean or integer. Types with enum values
+ // and strings with formats are allowed.
+ // If jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string.
+ // Must not point to metdata fields.
+ // Required.
+ JSONPath string
}
// CustomResourceColumnDefinition specifies a column for server side printing.
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go
index 8c4e147f0b9..61efeae69ca 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go
@@ -144,7 +144,6 @@ type JSONSchemaProps struct {
XMapType *string
// x-kubernetes-validations -kubernetes-validations describes a list of validation rules written in the CEL expression language.
- // This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled.
// +patchMergeKey=rule
// +patchStrategy=merge
// +listType=map
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go
index 4d29ff8235d..2ca72bb16b3 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion.go
@@ -80,7 +80,7 @@ func Convert_apiextensions_CustomResourceDefinitionSpec_To_v1_CustomResourceDefi
out.Versions = []CustomResourceDefinitionVersion{{Name: in.Version, Served: true, Storage: true}}
}
- // If spec.{subresources,validation,additionalPrinterColumns} exists, move to versions
+ // If spec.{subresources,validation,additionalPrinterColumns,selectableFields} exists, move to versions
if in.Subresources != nil {
subresources := &CustomResourceSubresources{}
if err := Convert_apiextensions_CustomResourceSubresources_To_v1_CustomResourceSubresources(in.Subresources, subresources, s); err != nil {
@@ -110,6 +110,17 @@ func Convert_apiextensions_CustomResourceDefinitionSpec_To_v1_CustomResourceDefi
out.Versions[i].AdditionalPrinterColumns = additionalPrinterColumns
}
}
+ if in.SelectableFields != nil {
+ selectableFields := make([]SelectableField, len(in.SelectableFields))
+ for i := range in.SelectableFields {
+ if err := Convert_apiextensions_SelectableField_To_v1_SelectableField(&in.SelectableFields[i], &selectableFields[i], s); err != nil {
+ return err
+ }
+ }
+ for i := range out.Versions {
+ out.Versions[i].SelectableFields = selectableFields
+ }
+ }
return nil
}
@@ -125,13 +136,15 @@ func Convert_v1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefi
// Copy versions[0] to version
out.Version = out.Versions[0].Name
- // If versions[*].{subresources,schema,additionalPrinterColumns} are identical, move to spec
+ // If versions[*].{subresources,schema,additionalPrinterColumns,selectableFields} are identical, move to spec
subresources := out.Versions[0].Subresources
subresourcesIdentical := true
validation := out.Versions[0].Schema
validationIdentical := true
additionalPrinterColumns := out.Versions[0].AdditionalPrinterColumns
additionalPrinterColumnsIdentical := true
+ selectableFields := out.Versions[0].SelectableFields
+ selectableFieldsIdentical := true
// Detect if per-version fields are identical
for _, v := range out.Versions {
@@ -144,6 +157,9 @@ func Convert_v1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefi
if additionalPrinterColumnsIdentical && !apiequality.Semantic.DeepEqual(v.AdditionalPrinterColumns, additionalPrinterColumns) {
additionalPrinterColumnsIdentical = false
}
+ if selectableFieldsIdentical && !apiequality.Semantic.DeepEqual(v.SelectableFields, selectableFields) {
+ selectableFieldsIdentical = false
+ }
}
// If they are, set the top-level fields and clear the per-version fields
@@ -156,6 +172,9 @@ func Convert_v1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefi
if additionalPrinterColumnsIdentical {
out.AdditionalPrinterColumns = additionalPrinterColumns
}
+ if selectableFieldsIdentical {
+ out.SelectableFields = selectableFields
+ }
for i := range out.Versions {
if subresourcesIdentical {
out.Versions[i].Subresources = nil
@@ -166,6 +185,9 @@ func Convert_v1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefi
if additionalPrinterColumnsIdentical {
out.Versions[i].AdditionalPrinterColumns = nil
}
+ if selectableFieldsIdentical {
+ out.Versions[i].SelectableFields = nil
+ }
}
return nil
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/doc.go
index 09d4872f8a4..c7be07a1431 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/doc.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/doc.go
@@ -19,6 +19,7 @@ limitations under the License.
// +k8s:conversion-gen=k8s.io/apiextensions-apiserver/pkg/apis/apiextensions
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-gen=true
+// +k8s:prerelease-lifecycle-gen=true
// +groupName=apiextensions.k8s.io
// Package v1 is the v1 version of the API.
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go
index 6c22a516985..8e081e4b1c5 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto
+// source: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto
package v1
@@ -51,7 +51,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func (m *ConversionRequest) Reset() { *m = ConversionRequest{} }
func (*ConversionRequest) ProtoMessage() {}
func (*ConversionRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{0}
+ return fileDescriptor_c5e101a0235c8c62, []int{0}
}
func (m *ConversionRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -79,7 +79,7 @@ var xxx_messageInfo_ConversionRequest proto.InternalMessageInfo
func (m *ConversionResponse) Reset() { *m = ConversionResponse{} }
func (*ConversionResponse) ProtoMessage() {}
func (*ConversionResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{1}
+ return fileDescriptor_c5e101a0235c8c62, []int{1}
}
func (m *ConversionResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -107,7 +107,7 @@ var xxx_messageInfo_ConversionResponse proto.InternalMessageInfo
func (m *ConversionReview) Reset() { *m = ConversionReview{} }
func (*ConversionReview) ProtoMessage() {}
func (*ConversionReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{2}
+ return fileDescriptor_c5e101a0235c8c62, []int{2}
}
func (m *ConversionReview) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -135,7 +135,7 @@ var xxx_messageInfo_ConversionReview proto.InternalMessageInfo
func (m *CustomResourceColumnDefinition) Reset() { *m = CustomResourceColumnDefinition{} }
func (*CustomResourceColumnDefinition) ProtoMessage() {}
func (*CustomResourceColumnDefinition) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{3}
+ return fileDescriptor_c5e101a0235c8c62, []int{3}
}
func (m *CustomResourceColumnDefinition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -163,7 +163,7 @@ var xxx_messageInfo_CustomResourceColumnDefinition proto.InternalMessageInfo
func (m *CustomResourceConversion) Reset() { *m = CustomResourceConversion{} }
func (*CustomResourceConversion) ProtoMessage() {}
func (*CustomResourceConversion) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{4}
+ return fileDescriptor_c5e101a0235c8c62, []int{4}
}
func (m *CustomResourceConversion) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -191,7 +191,7 @@ var xxx_messageInfo_CustomResourceConversion proto.InternalMessageInfo
func (m *CustomResourceDefinition) Reset() { *m = CustomResourceDefinition{} }
func (*CustomResourceDefinition) ProtoMessage() {}
func (*CustomResourceDefinition) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{5}
+ return fileDescriptor_c5e101a0235c8c62, []int{5}
}
func (m *CustomResourceDefinition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -219,7 +219,7 @@ var xxx_messageInfo_CustomResourceDefinition proto.InternalMessageInfo
func (m *CustomResourceDefinitionCondition) Reset() { *m = CustomResourceDefinitionCondition{} }
func (*CustomResourceDefinitionCondition) ProtoMessage() {}
func (*CustomResourceDefinitionCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{6}
+ return fileDescriptor_c5e101a0235c8c62, []int{6}
}
func (m *CustomResourceDefinitionCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -247,7 +247,7 @@ var xxx_messageInfo_CustomResourceDefinitionCondition proto.InternalMessageInfo
func (m *CustomResourceDefinitionList) Reset() { *m = CustomResourceDefinitionList{} }
func (*CustomResourceDefinitionList) ProtoMessage() {}
func (*CustomResourceDefinitionList) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{7}
+ return fileDescriptor_c5e101a0235c8c62, []int{7}
}
func (m *CustomResourceDefinitionList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -275,7 +275,7 @@ var xxx_messageInfo_CustomResourceDefinitionList proto.InternalMessageInfo
func (m *CustomResourceDefinitionNames) Reset() { *m = CustomResourceDefinitionNames{} }
func (*CustomResourceDefinitionNames) ProtoMessage() {}
func (*CustomResourceDefinitionNames) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{8}
+ return fileDescriptor_c5e101a0235c8c62, []int{8}
}
func (m *CustomResourceDefinitionNames) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -303,7 +303,7 @@ var xxx_messageInfo_CustomResourceDefinitionNames proto.InternalMessageInfo
func (m *CustomResourceDefinitionSpec) Reset() { *m = CustomResourceDefinitionSpec{} }
func (*CustomResourceDefinitionSpec) ProtoMessage() {}
func (*CustomResourceDefinitionSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{9}
+ return fileDescriptor_c5e101a0235c8c62, []int{9}
}
func (m *CustomResourceDefinitionSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -331,7 +331,7 @@ var xxx_messageInfo_CustomResourceDefinitionSpec proto.InternalMessageInfo
func (m *CustomResourceDefinitionStatus) Reset() { *m = CustomResourceDefinitionStatus{} }
func (*CustomResourceDefinitionStatus) ProtoMessage() {}
func (*CustomResourceDefinitionStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{10}
+ return fileDescriptor_c5e101a0235c8c62, []int{10}
}
func (m *CustomResourceDefinitionStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -359,7 +359,7 @@ var xxx_messageInfo_CustomResourceDefinitionStatus proto.InternalMessageInfo
func (m *CustomResourceDefinitionVersion) Reset() { *m = CustomResourceDefinitionVersion{} }
func (*CustomResourceDefinitionVersion) ProtoMessage() {}
func (*CustomResourceDefinitionVersion) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{11}
+ return fileDescriptor_c5e101a0235c8c62, []int{11}
}
func (m *CustomResourceDefinitionVersion) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -387,7 +387,7 @@ var xxx_messageInfo_CustomResourceDefinitionVersion proto.InternalMessageInfo
func (m *CustomResourceSubresourceScale) Reset() { *m = CustomResourceSubresourceScale{} }
func (*CustomResourceSubresourceScale) ProtoMessage() {}
func (*CustomResourceSubresourceScale) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{12}
+ return fileDescriptor_c5e101a0235c8c62, []int{12}
}
func (m *CustomResourceSubresourceScale) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -415,7 +415,7 @@ var xxx_messageInfo_CustomResourceSubresourceScale proto.InternalMessageInfo
func (m *CustomResourceSubresourceStatus) Reset() { *m = CustomResourceSubresourceStatus{} }
func (*CustomResourceSubresourceStatus) ProtoMessage() {}
func (*CustomResourceSubresourceStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{13}
+ return fileDescriptor_c5e101a0235c8c62, []int{13}
}
func (m *CustomResourceSubresourceStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -443,7 +443,7 @@ var xxx_messageInfo_CustomResourceSubresourceStatus proto.InternalMessageInfo
func (m *CustomResourceSubresources) Reset() { *m = CustomResourceSubresources{} }
func (*CustomResourceSubresources) ProtoMessage() {}
func (*CustomResourceSubresources) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{14}
+ return fileDescriptor_c5e101a0235c8c62, []int{14}
}
func (m *CustomResourceSubresources) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -471,7 +471,7 @@ var xxx_messageInfo_CustomResourceSubresources proto.InternalMessageInfo
func (m *CustomResourceValidation) Reset() { *m = CustomResourceValidation{} }
func (*CustomResourceValidation) ProtoMessage() {}
func (*CustomResourceValidation) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{15}
+ return fileDescriptor_c5e101a0235c8c62, []int{15}
}
func (m *CustomResourceValidation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -499,7 +499,7 @@ var xxx_messageInfo_CustomResourceValidation proto.InternalMessageInfo
func (m *ExternalDocumentation) Reset() { *m = ExternalDocumentation{} }
func (*ExternalDocumentation) ProtoMessage() {}
func (*ExternalDocumentation) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{16}
+ return fileDescriptor_c5e101a0235c8c62, []int{16}
}
func (m *ExternalDocumentation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -527,7 +527,7 @@ var xxx_messageInfo_ExternalDocumentation proto.InternalMessageInfo
func (m *JSON) Reset() { *m = JSON{} }
func (*JSON) ProtoMessage() {}
func (*JSON) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{17}
+ return fileDescriptor_c5e101a0235c8c62, []int{17}
}
func (m *JSON) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -555,7 +555,7 @@ var xxx_messageInfo_JSON proto.InternalMessageInfo
func (m *JSONSchemaProps) Reset() { *m = JSONSchemaProps{} }
func (*JSONSchemaProps) ProtoMessage() {}
func (*JSONSchemaProps) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{18}
+ return fileDescriptor_c5e101a0235c8c62, []int{18}
}
func (m *JSONSchemaProps) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -583,7 +583,7 @@ var xxx_messageInfo_JSONSchemaProps proto.InternalMessageInfo
func (m *JSONSchemaPropsOrArray) Reset() { *m = JSONSchemaPropsOrArray{} }
func (*JSONSchemaPropsOrArray) ProtoMessage() {}
func (*JSONSchemaPropsOrArray) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{19}
+ return fileDescriptor_c5e101a0235c8c62, []int{19}
}
func (m *JSONSchemaPropsOrArray) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -611,7 +611,7 @@ var xxx_messageInfo_JSONSchemaPropsOrArray proto.InternalMessageInfo
func (m *JSONSchemaPropsOrBool) Reset() { *m = JSONSchemaPropsOrBool{} }
func (*JSONSchemaPropsOrBool) ProtoMessage() {}
func (*JSONSchemaPropsOrBool) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{20}
+ return fileDescriptor_c5e101a0235c8c62, []int{20}
}
func (m *JSONSchemaPropsOrBool) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -639,7 +639,7 @@ var xxx_messageInfo_JSONSchemaPropsOrBool proto.InternalMessageInfo
func (m *JSONSchemaPropsOrStringArray) Reset() { *m = JSONSchemaPropsOrStringArray{} }
func (*JSONSchemaPropsOrStringArray) ProtoMessage() {}
func (*JSONSchemaPropsOrStringArray) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{21}
+ return fileDescriptor_c5e101a0235c8c62, []int{21}
}
func (m *JSONSchemaPropsOrStringArray) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -664,10 +664,38 @@ func (m *JSONSchemaPropsOrStringArray) XXX_DiscardUnknown() {
var xxx_messageInfo_JSONSchemaPropsOrStringArray proto.InternalMessageInfo
+func (m *SelectableField) Reset() { *m = SelectableField{} }
+func (*SelectableField) ProtoMessage() {}
+func (*SelectableField) Descriptor() ([]byte, []int) {
+ return fileDescriptor_c5e101a0235c8c62, []int{22}
+}
+func (m *SelectableField) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *SelectableField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *SelectableField) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SelectableField.Merge(m, src)
+}
+func (m *SelectableField) XXX_Size() int {
+ return m.Size()
+}
+func (m *SelectableField) XXX_DiscardUnknown() {
+ xxx_messageInfo_SelectableField.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SelectableField proto.InternalMessageInfo
+
func (m *ServiceReference) Reset() { *m = ServiceReference{} }
func (*ServiceReference) ProtoMessage() {}
func (*ServiceReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{22}
+ return fileDescriptor_c5e101a0235c8c62, []int{23}
}
func (m *ServiceReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -695,7 +723,7 @@ var xxx_messageInfo_ServiceReference proto.InternalMessageInfo
func (m *ValidationRule) Reset() { *m = ValidationRule{} }
func (*ValidationRule) ProtoMessage() {}
func (*ValidationRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{23}
+ return fileDescriptor_c5e101a0235c8c62, []int{24}
}
func (m *ValidationRule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -723,7 +751,7 @@ var xxx_messageInfo_ValidationRule proto.InternalMessageInfo
func (m *WebhookClientConfig) Reset() { *m = WebhookClientConfig{} }
func (*WebhookClientConfig) ProtoMessage() {}
func (*WebhookClientConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{24}
+ return fileDescriptor_c5e101a0235c8c62, []int{25}
}
func (m *WebhookClientConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -751,7 +779,7 @@ var xxx_messageInfo_WebhookClientConfig proto.InternalMessageInfo
func (m *WebhookConversion) Reset() { *m = WebhookConversion{} }
func (*WebhookConversion) ProtoMessage() {}
func (*WebhookConversion) Descriptor() ([]byte, []int) {
- return fileDescriptor_f5a35c9667703937, []int{25}
+ return fileDescriptor_c5e101a0235c8c62, []int{26}
}
func (m *WebhookConversion) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -803,6 +831,7 @@ func init() {
proto.RegisterType((*JSONSchemaPropsOrArray)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrArray")
proto.RegisterType((*JSONSchemaPropsOrBool)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool")
proto.RegisterType((*JSONSchemaPropsOrStringArray)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray")
+ proto.RegisterType((*SelectableField)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1.SelectableField")
proto.RegisterType((*ServiceReference)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1.ServiceReference")
proto.RegisterType((*ValidationRule)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1.ValidationRule")
proto.RegisterType((*WebhookClientConfig)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig")
@@ -810,208 +839,209 @@ func init() {
}
func init() {
- proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto", fileDescriptor_f5a35c9667703937)
-}
-
-var fileDescriptor_f5a35c9667703937 = []byte{
- // 3137 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xdf, 0x6f, 0x5c, 0x47,
- 0xf5, 0xcf, 0x5d, 0x7b, 0xed, 0xf5, 0xd8, 0x89, 0xed, 0x49, 0xec, 0xef, 0x8d, 0x9b, 0x78, 0x9d,
- 0xcd, 0xb7, 0xc1, 0x6d, 0xd3, 0x75, 0x1b, 0x5a, 0x1a, 0xca, 0x2f, 0x79, 0x6d, 0xa7, 0x75, 0x13,
- 0xc7, 0xd6, 0x6c, 0x92, 0xba, 0x2d, 0xa2, 0xbd, 0xde, 0x3b, 0xbb, 0xbe, 0xf5, 0xfd, 0x95, 0x99,
- 0x7b, 0xfd, 0x43, 0x02, 0xa9, 0x02, 0x55, 0x40, 0x25, 0x28, 0x0f, 0xa8, 0x3c, 0x21, 0x84, 0x50,
- 0x1f, 0xe0, 0x01, 0xde, 0xe0, 0x5f, 0xe8, 0x0b, 0x52, 0x25, 0x24, 0x54, 0x09, 0x69, 0x45, 0x97,
- 0x7f, 0x00, 0x09, 0x10, 0xc2, 0x0f, 0x08, 0xcd, 0x8f, 0x3b, 0x77, 0xf6, 0xee, 0x6e, 0x12, 0xd9,
- 0xeb, 0xf6, 0x6d, 0xf7, 0x9c, 0x33, 0xe7, 0x73, 0xe6, 0xcc, 0x99, 0x33, 0x67, 0xce, 0x1d, 0x60,
- 0xed, 0x5c, 0xa7, 0x65, 0x27, 0x58, 0xd8, 0x89, 0xb7, 0x30, 0xf1, 0x71, 0x84, 0xe9, 0xc2, 0x2e,
- 0xf6, 0xed, 0x80, 0x2c, 0x48, 0x86, 0x15, 0x3a, 0x78, 0x3f, 0xc2, 0x3e, 0x75, 0x02, 0x9f, 0x3e,
- 0x6d, 0x85, 0x0e, 0xc5, 0x64, 0x17, 0x93, 0x85, 0x70, 0xa7, 0xc1, 0x78, 0xb4, 0x5d, 0x60, 0x61,
- 0xf7, 0xd9, 0x85, 0x06, 0xf6, 0x31, 0xb1, 0x22, 0x6c, 0x97, 0x43, 0x12, 0x44, 0x01, 0xbc, 0x2e,
- 0x34, 0x95, 0xdb, 0x04, 0xdf, 0x54, 0x9a, 0xca, 0xe1, 0x4e, 0x83, 0xf1, 0x68, 0xbb, 0x40, 0x79,
- 0xf7, 0xd9, 0x99, 0xa7, 0x1b, 0x4e, 0xb4, 0x1d, 0x6f, 0x95, 0x6b, 0x81, 0xb7, 0xd0, 0x08, 0x1a,
- 0xc1, 0x02, 0x57, 0xb8, 0x15, 0xd7, 0xf9, 0x3f, 0xfe, 0x87, 0xff, 0x12, 0x40, 0x33, 0xcf, 0xa5,
- 0x26, 0x7b, 0x56, 0x6d, 0xdb, 0xf1, 0x31, 0x39, 0x48, 0xed, 0xf4, 0x70, 0x64, 0x75, 0x31, 0x6f,
- 0x66, 0xa1, 0xd7, 0x28, 0x12, 0xfb, 0x91, 0xe3, 0xe1, 0x8e, 0x01, 0x5f, 0x7a, 0xd8, 0x00, 0x5a,
- 0xdb, 0xc6, 0x9e, 0x95, 0x1d, 0x57, 0x3a, 0x34, 0xc0, 0xe4, 0x52, 0xe0, 0xef, 0x62, 0xc2, 0x26,
- 0x88, 0xf0, 0xfd, 0x18, 0xd3, 0x08, 0x56, 0xc0, 0x40, 0xec, 0xd8, 0xa6, 0x31, 0x67, 0xcc, 0x8f,
- 0x54, 0x9e, 0xf9, 0xa8, 0x59, 0x3c, 0xd5, 0x6a, 0x16, 0x07, 0xee, 0xae, 0x2e, 0x1f, 0x36, 0x8b,
- 0x97, 0x7a, 0x21, 0x45, 0x07, 0x21, 0xa6, 0xe5, 0xbb, 0xab, 0xcb, 0x88, 0x0d, 0x86, 0x2f, 0x81,
- 0x49, 0x1b, 0x53, 0x87, 0x60, 0x7b, 0x71, 0x63, 0xf5, 0x9e, 0xd0, 0x6f, 0xe6, 0xb8, 0xc6, 0xf3,
- 0x52, 0xe3, 0xe4, 0x72, 0x56, 0x00, 0x75, 0x8e, 0x81, 0x9b, 0x60, 0x38, 0xd8, 0x7a, 0x1b, 0xd7,
- 0x22, 0x6a, 0x0e, 0xcc, 0x0d, 0xcc, 0x8f, 0x5e, 0x7b, 0xba, 0x9c, 0x2e, 0x9e, 0x32, 0x81, 0xaf,
- 0x98, 0x9c, 0x6c, 0x19, 0x59, 0x7b, 0x2b, 0xc9, 0xa2, 0x55, 0xc6, 0x25, 0xda, 0xf0, 0xba, 0xd0,
- 0x82, 0x12, 0x75, 0xa5, 0x5f, 0xe5, 0x00, 0xd4, 0x27, 0x4f, 0xc3, 0xc0, 0xa7, 0xb8, 0x2f, 0xb3,
- 0xa7, 0x60, 0xa2, 0xc6, 0x35, 0x47, 0xd8, 0x96, 0xb8, 0x66, 0xee, 0x28, 0xd6, 0x9b, 0x12, 0x7f,
- 0x62, 0x29, 0xa3, 0x0e, 0x75, 0x00, 0xc0, 0x3b, 0x60, 0x88, 0x60, 0x1a, 0xbb, 0x91, 0x39, 0x30,
- 0x67, 0xcc, 0x8f, 0x5e, 0xbb, 0xda, 0x13, 0x8a, 0x87, 0x36, 0x0b, 0xbe, 0xf2, 0xee, 0xb3, 0xe5,
- 0x6a, 0x64, 0x45, 0x31, 0xad, 0x9c, 0x91, 0x48, 0x43, 0x88, 0xeb, 0x40, 0x52, 0x57, 0xe9, 0xbf,
- 0x06, 0x98, 0xd0, 0xbd, 0xb4, 0xeb, 0xe0, 0x3d, 0x48, 0xc0, 0x30, 0x11, 0xc1, 0xc2, 0xfd, 0x34,
- 0x7a, 0xed, 0x66, 0xf9, 0xa8, 0x3b, 0xaa, 0xdc, 0x11, 0x7f, 0x95, 0x51, 0xb6, 0x5c, 0xf2, 0x0f,
- 0x4a, 0x80, 0xe0, 0x2e, 0x28, 0x10, 0xb9, 0x46, 0x3c, 0x90, 0x46, 0xaf, 0xdd, 0xea, 0x0f, 0xa8,
- 0xd0, 0x59, 0x19, 0x6b, 0x35, 0x8b, 0x85, 0xe4, 0x1f, 0x52, 0x58, 0xa5, 0x5f, 0xe4, 0xc0, 0xec,
- 0x52, 0x4c, 0xa3, 0xc0, 0x43, 0x98, 0x06, 0x31, 0xa9, 0xe1, 0xa5, 0xc0, 0x8d, 0x3d, 0x7f, 0x19,
- 0xd7, 0x1d, 0xdf, 0x89, 0x58, 0x8c, 0xce, 0x81, 0x41, 0xdf, 0xf2, 0xb0, 0x8c, 0x99, 0x31, 0xe9,
- 0xc9, 0xc1, 0xdb, 0x96, 0x87, 0x11, 0xe7, 0x30, 0x09, 0x16, 0x22, 0x72, 0x07, 0x28, 0x89, 0x3b,
- 0x07, 0x21, 0x46, 0x9c, 0x03, 0xaf, 0x80, 0xa1, 0x7a, 0x40, 0x3c, 0x4b, 0xac, 0xde, 0x48, 0xba,
- 0x1e, 0x37, 0x38, 0x15, 0x49, 0x2e, 0x7c, 0x1e, 0x8c, 0xda, 0x98, 0xd6, 0x88, 0x13, 0x32, 0x68,
- 0x73, 0x90, 0x0b, 0x9f, 0x95, 0xc2, 0xa3, 0xcb, 0x29, 0x0b, 0xe9, 0x72, 0xf0, 0x2a, 0x28, 0x84,
- 0xc4, 0x09, 0x88, 0x13, 0x1d, 0x98, 0xf9, 0x39, 0x63, 0x3e, 0x5f, 0x99, 0x90, 0x63, 0x0a, 0x1b,
- 0x92, 0x8e, 0x94, 0x04, 0x93, 0x7e, 0x9b, 0x06, 0xfe, 0x86, 0x15, 0x6d, 0x9b, 0x43, 0x1c, 0x41,
- 0x49, 0xbf, 0x52, 0x5d, 0xbf, 0xcd, 0xe8, 0x48, 0x49, 0x94, 0xfe, 0x6c, 0x00, 0x33, 0xeb, 0xa1,
- 0xc4, 0xbd, 0xf0, 0x06, 0x28, 0xd0, 0x88, 0xe5, 0x9c, 0xc6, 0x81, 0xf4, 0xcf, 0x93, 0x89, 0xaa,
- 0xaa, 0xa4, 0x1f, 0x36, 0x8b, 0xd3, 0xe9, 0x88, 0x84, 0xca, 0x7d, 0xa3, 0xc6, 0xb2, 0x90, 0xdb,
- 0xc3, 0x5b, 0xdb, 0x41, 0xb0, 0x23, 0x57, 0xff, 0x18, 0x21, 0xf7, 0xaa, 0x50, 0x94, 0x62, 0x8a,
- 0x90, 0x93, 0x64, 0x94, 0x00, 0x95, 0xfe, 0x93, 0xcb, 0x4e, 0x4c, 0x5b, 0xf4, 0xb7, 0x40, 0x81,
- 0x6d, 0x21, 0xdb, 0x8a, 0x2c, 0xb9, 0x09, 0x9e, 0x79, 0xb4, 0x0d, 0x27, 0xf6, 0xeb, 0x1a, 0x8e,
- 0xac, 0x0a, 0x94, 0xae, 0x00, 0x29, 0x0d, 0x29, 0xad, 0x70, 0x1f, 0x0c, 0xd2, 0x10, 0xd7, 0xe4,
- 0x7c, 0xef, 0x1d, 0x23, 0xda, 0x7b, 0xcc, 0xa1, 0x1a, 0xe2, 0x5a, 0x1a, 0x8c, 0xec, 0x1f, 0xe2,
- 0x88, 0xf0, 0x1d, 0x03, 0x0c, 0x51, 0x9e, 0x17, 0x64, 0x2e, 0xd9, 0x3c, 0x01, 0xf0, 0x4c, 0xde,
- 0x11, 0xff, 0x91, 0xc4, 0x2d, 0xfd, 0x33, 0x07, 0x2e, 0xf5, 0x1a, 0xba, 0x14, 0xf8, 0xb6, 0x58,
- 0x84, 0x55, 0xb9, 0xaf, 0x44, 0x64, 0x3d, 0xaf, 0xef, 0xab, 0xc3, 0x66, 0xf1, 0xf1, 0x87, 0x2a,
- 0xd0, 0x36, 0xe0, 0x97, 0xd5, 0x94, 0xc5, 0x26, 0xbd, 0xd4, 0x6e, 0xd8, 0x61, 0xb3, 0x38, 0xae,
- 0x86, 0xb5, 0xdb, 0x0a, 0x77, 0x01, 0x74, 0x2d, 0x1a, 0xdd, 0x21, 0x96, 0x4f, 0x85, 0x5a, 0xc7,
- 0xc3, 0xd2, 0x73, 0x4f, 0x3e, 0x5a, 0x50, 0xb0, 0x11, 0x95, 0x19, 0x09, 0x09, 0x6f, 0x75, 0x68,
- 0x43, 0x5d, 0x10, 0x58, 0xce, 0x20, 0xd8, 0xa2, 0x2a, 0x0d, 0x68, 0x39, 0x9c, 0x51, 0x91, 0xe4,
- 0xc2, 0x27, 0xc0, 0xb0, 0x87, 0x29, 0xb5, 0x1a, 0x98, 0xef, 0xfd, 0x91, 0xf4, 0x50, 0x5c, 0x13,
- 0x64, 0x94, 0xf0, 0x4b, 0xff, 0x32, 0xc0, 0x85, 0x5e, 0x5e, 0xbb, 0xe5, 0xd0, 0x08, 0x7e, 0xb3,
- 0x23, 0xec, 0xcb, 0x8f, 0x36, 0x43, 0x36, 0x9a, 0x07, 0xbd, 0x4a, 0x25, 0x09, 0x45, 0x0b, 0xf9,
- 0x3d, 0x90, 0x77, 0x22, 0xec, 0x25, 0xa7, 0x25, 0xea, 0x7f, 0xd8, 0x55, 0x4e, 0x4b, 0xf8, 0xfc,
- 0x2a, 0x03, 0x42, 0x02, 0xaf, 0xf4, 0x61, 0x0e, 0x5c, 0xec, 0x35, 0x84, 0xe5, 0x71, 0xca, 0x9c,
- 0x1d, 0xba, 0x31, 0xb1, 0x5c, 0x19, 0x6c, 0xca, 0xd9, 0x1b, 0x9c, 0x8a, 0x24, 0x97, 0xe5, 0x4e,
- 0xea, 0xf8, 0x8d, 0xd8, 0xb5, 0x88, 0x8c, 0x24, 0x35, 0xe1, 0xaa, 0xa4, 0x23, 0x25, 0x01, 0xcb,
- 0x00, 0xd0, 0xed, 0x80, 0x44, 0x1c, 0x83, 0x57, 0x38, 0x23, 0x95, 0x33, 0x2c, 0x23, 0x54, 0x15,
- 0x15, 0x69, 0x12, 0xec, 0x20, 0xd9, 0x71, 0x7c, 0x5b, 0x2e, 0xb8, 0xda, 0xbb, 0x37, 0x1d, 0xdf,
- 0x46, 0x9c, 0xc3, 0xf0, 0x5d, 0x87, 0x46, 0x8c, 0x22, 0x57, 0xbb, 0xcd, 0xe1, 0x5c, 0x52, 0x49,
- 0x30, 0xfc, 0x1a, 0x4b, 0xb0, 0x01, 0x71, 0x30, 0x35, 0x87, 0x52, 0xfc, 0x25, 0x45, 0x45, 0x9a,
- 0x44, 0xe9, 0x2f, 0x83, 0xbd, 0xe3, 0x83, 0x25, 0x10, 0x78, 0x19, 0xe4, 0x1b, 0x24, 0x88, 0x43,
- 0xe9, 0x25, 0xe5, 0xed, 0x97, 0x18, 0x11, 0x09, 0x1e, 0xfc, 0x36, 0xc8, 0xfb, 0x72, 0xc2, 0x2c,
- 0x82, 0x5e, 0xed, 0xff, 0x32, 0x73, 0x6f, 0xa5, 0xe8, 0xc2, 0x91, 0x02, 0x14, 0x3e, 0x07, 0xf2,
- 0xb4, 0x16, 0x84, 0x58, 0x3a, 0x71, 0x36, 0x11, 0xaa, 0x32, 0xe2, 0x61, 0xb3, 0x78, 0x3a, 0x51,
- 0xc7, 0x09, 0x48, 0x08, 0xc3, 0xef, 0x1b, 0xa0, 0x20, 0x8f, 0x0b, 0x6a, 0x0e, 0xf3, 0xf0, 0x7c,
- 0xad, 0xff, 0x76, 0xcb, 0xb2, 0x37, 0x5d, 0x33, 0x49, 0xa0, 0x48, 0x81, 0xc3, 0xef, 0x1a, 0x00,
- 0xd4, 0xd4, 0xd9, 0x65, 0x8e, 0x70, 0x1f, 0xf6, 0x6d, 0xab, 0x68, 0xa7, 0xa2, 0x08, 0x84, 0xb4,
- 0x54, 0xd2, 0x50, 0x61, 0x15, 0x4c, 0x85, 0x04, 0x73, 0xdd, 0x77, 0xfd, 0x1d, 0x3f, 0xd8, 0xf3,
- 0x6f, 0x38, 0xd8, 0xb5, 0xa9, 0x09, 0xe6, 0x8c, 0xf9, 0x42, 0xe5, 0xa2, 0xb4, 0x7f, 0x6a, 0xa3,
- 0x9b, 0x10, 0xea, 0x3e, 0xb6, 0xf4, 0xee, 0x40, 0xb6, 0xd6, 0xca, 0x9e, 0x17, 0xf0, 0x7d, 0x31,
- 0x79, 0x91, 0x87, 0xa9, 0x69, 0xf0, 0x85, 0x78, 0xa3, 0xff, 0x0b, 0xa1, 0x72, 0x7d, 0x7a, 0x48,
- 0x2b, 0x12, 0x45, 0x9a, 0x09, 0xf0, 0xa7, 0x06, 0x38, 0x6d, 0xd5, 0x6a, 0x38, 0x8c, 0xb0, 0x2d,
- 0xb6, 0x71, 0xee, 0x64, 0xa3, 0x7a, 0x4a, 0x1a, 0x74, 0x7a, 0x51, 0x47, 0x45, 0xed, 0x46, 0xc0,
- 0x17, 0xc1, 0x19, 0x1a, 0x05, 0x04, 0xdb, 0x49, 0x04, 0xc9, 0xec, 0x02, 0x5b, 0xcd, 0xe2, 0x99,
- 0x6a, 0x1b, 0x07, 0x65, 0x24, 0x4b, 0x1f, 0xe7, 0x41, 0xf1, 0x21, 0x11, 0xfa, 0x08, 0x45, 0xef,
- 0x15, 0x30, 0xc4, 0x67, 0x6a, 0x73, 0x87, 0x14, 0xb4, 0xa3, 0x9e, 0x53, 0x91, 0xe4, 0xb2, 0xe3,
- 0x89, 0xe1, 0xb3, 0xe3, 0x69, 0x80, 0x0b, 0xaa, 0xe3, 0xa9, 0x2a, 0xc8, 0x28, 0xe1, 0xc3, 0x6b,
- 0x00, 0xd8, 0x38, 0x24, 0x98, 0x65, 0x24, 0xdb, 0x1c, 0xe6, 0xd2, 0x6a, 0x7d, 0x96, 0x15, 0x07,
- 0x69, 0x52, 0xf0, 0x06, 0x80, 0xc9, 0x3f, 0x27, 0xf0, 0x5f, 0xb5, 0x88, 0xef, 0xf8, 0x0d, 0xb3,
- 0xc0, 0xcd, 0x9e, 0x66, 0xa7, 0xed, 0x72, 0x07, 0x17, 0x75, 0x19, 0x01, 0x77, 0xc1, 0x90, 0xb8,
- 0x46, 0xf3, 0xbc, 0xd1, 0xc7, 0x1d, 0x77, 0xcf, 0x72, 0x1d, 0x9b, 0x43, 0x55, 0x00, 0x77, 0x0f,
- 0x47, 0x41, 0x12, 0x0d, 0xbe, 0x67, 0x80, 0x31, 0x1a, 0x6f, 0x11, 0x29, 0x4d, 0x79, 0x56, 0x1f,
- 0xbd, 0x76, 0xa7, 0x5f, 0xf0, 0x55, 0x4d, 0x77, 0x65, 0xa2, 0xd5, 0x2c, 0x8e, 0xe9, 0x14, 0xd4,
- 0x86, 0x0d, 0x7f, 0x6f, 0x00, 0xd3, 0xb2, 0x45, 0xe8, 0x5b, 0xee, 0x06, 0x71, 0xfc, 0x08, 0x13,
- 0x71, 0x21, 0x12, 0xc7, 0x47, 0x1f, 0x6b, 0xc5, 0xec, 0x3d, 0xab, 0x32, 0x27, 0x57, 0xda, 0x5c,
- 0xec, 0x61, 0x01, 0xea, 0x69, 0x5b, 0xe9, 0xdf, 0x46, 0x36, 0xb5, 0x68, 0xb3, 0xac, 0xd6, 0x2c,
- 0x17, 0xc3, 0x65, 0x30, 0xc1, 0xaa, 0x5f, 0x84, 0x43, 0xd7, 0xa9, 0x59, 0x94, 0xdf, 0x7e, 0x44,
- 0x74, 0xab, 0x6b, 0x78, 0x35, 0xc3, 0x47, 0x1d, 0x23, 0xe0, 0x2b, 0x00, 0x8a, 0xb2, 0xb0, 0x4d,
- 0x8f, 0xa8, 0x04, 0x54, 0x81, 0x57, 0xed, 0x90, 0x40, 0x5d, 0x46, 0xc1, 0x25, 0x30, 0xe9, 0x5a,
- 0x5b, 0xd8, 0xad, 0x62, 0x17, 0xd7, 0xa2, 0x80, 0x70, 0x55, 0xe2, 0x7e, 0x38, 0xd5, 0x6a, 0x16,
- 0x27, 0x6f, 0x65, 0x99, 0xa8, 0x53, 0xbe, 0x74, 0x29, 0xbb, 0x97, 0xf5, 0x89, 0x8b, 0x62, 0xfb,
- 0x83, 0x1c, 0x98, 0xe9, 0x1d, 0x14, 0xf0, 0x3b, 0xaa, 0x34, 0x16, 0x15, 0xdf, 0x6b, 0x27, 0x10,
- 0x7a, 0xf2, 0x3a, 0x00, 0x3a, 0xaf, 0x02, 0xf0, 0x80, 0x9d, 0xd7, 0x96, 0x9b, 0x5c, 0xfb, 0x37,
- 0x4f, 0x02, 0x9d, 0xe9, 0xaf, 0x8c, 0x88, 0x2a, 0xc0, 0x72, 0xf9, 0xa1, 0x6f, 0xb9, 0xb8, 0xf4,
- 0x61, 0xc7, 0xd5, 0x36, 0xdd, 0xac, 0xf0, 0x07, 0x06, 0x18, 0x0f, 0x42, 0xec, 0x2f, 0x6e, 0xac,
- 0xde, 0xfb, 0xa2, 0xd8, 0xb4, 0xd2, 0x41, 0xab, 0x47, 0x37, 0x91, 0xdd, 0xaf, 0x85, 0xae, 0x0d,
- 0x12, 0x84, 0xb4, 0x72, 0xb6, 0xd5, 0x2c, 0x8e, 0xaf, 0xb7, 0xa3, 0xa0, 0x2c, 0x6c, 0xc9, 0x03,
- 0x53, 0x2b, 0xfb, 0x11, 0x26, 0xbe, 0xe5, 0x2e, 0x07, 0xb5, 0xd8, 0xc3, 0x7e, 0x24, 0x6c, 0xcc,
- 0xb4, 0x0b, 0x8c, 0x47, 0x6c, 0x17, 0x5c, 0x04, 0x03, 0x31, 0x71, 0x65, 0xd4, 0x8e, 0xaa, 0x26,
- 0x18, 0xba, 0x85, 0x18, 0xbd, 0x74, 0x09, 0x0c, 0x32, 0x3b, 0xe1, 0x79, 0x30, 0x40, 0xac, 0x3d,
- 0xae, 0x75, 0xac, 0x32, 0xcc, 0x44, 0x90, 0xb5, 0x87, 0x18, 0xad, 0xf4, 0xf7, 0x39, 0x30, 0x9e,
- 0x99, 0x0b, 0x9c, 0x01, 0x39, 0xd5, 0x59, 0x03, 0x52, 0x69, 0x6e, 0x75, 0x19, 0xe5, 0x1c, 0x1b,
- 0xbe, 0xa0, 0xb2, 0xab, 0x00, 0x2d, 0xaa, 0xc3, 0x82, 0x53, 0x59, 0x59, 0x96, 0xaa, 0x63, 0x86,
- 0x24, 0xe9, 0x91, 0xd9, 0x80, 0xeb, 0x72, 0x57, 0x08, 0x1b, 0x70, 0x1d, 0x31, 0xda, 0x51, 0x7b,
- 0x25, 0x49, 0xb3, 0x26, 0xff, 0x08, 0xcd, 0x9a, 0xa1, 0x07, 0x36, 0x6b, 0x2e, 0x83, 0x7c, 0xe4,
- 0x44, 0x2e, 0xe6, 0x27, 0x95, 0x56, 0x0c, 0xdf, 0x61, 0x44, 0x24, 0x78, 0x10, 0x83, 0x61, 0x1b,
- 0xd7, 0xad, 0xd8, 0x8d, 0xf8, 0xa1, 0x34, 0x7a, 0xed, 0xeb, 0xc7, 0x8b, 0x1e, 0xd1, 0xcc, 0x58,
- 0x16, 0x2a, 0x51, 0xa2, 0x1b, 0x3e, 0x0e, 0x86, 0x3d, 0x6b, 0xdf, 0xf1, 0x62, 0x8f, 0x57, 0x8c,
- 0x86, 0x10, 0x5b, 0x13, 0x24, 0x94, 0xf0, 0x58, 0x12, 0xc4, 0xfb, 0x35, 0x37, 0xa6, 0xce, 0x2e,
- 0x96, 0x4c, 0x59, 0xd2, 0xa9, 0x24, 0xb8, 0x92, 0xe1, 0xa3, 0x8e, 0x11, 0x1c, 0xcc, 0xf1, 0xf9,
- 0xe0, 0x51, 0x0d, 0x4c, 0x90, 0x50, 0xc2, 0x6b, 0x07, 0x93, 0xf2, 0x63, 0xbd, 0xc0, 0xe4, 0xe0,
- 0x8e, 0x11, 0xf0, 0x29, 0x30, 0xe2, 0x59, 0xfb, 0xb7, 0xb0, 0xdf, 0x88, 0xb6, 0xcd, 0xd3, 0x73,
- 0xc6, 0xfc, 0x40, 0xe5, 0x74, 0xab, 0x59, 0x1c, 0x59, 0x4b, 0x88, 0x28, 0xe5, 0x73, 0x61, 0xc7,
- 0x97, 0xc2, 0x67, 0x34, 0xe1, 0x84, 0x88, 0x52, 0x3e, 0xab, 0x4c, 0x42, 0x2b, 0x62, 0xfb, 0xca,
- 0x1c, 0x6f, 0xbf, 0x38, 0x6f, 0x08, 0x32, 0x4a, 0xf8, 0x70, 0x1e, 0x14, 0x3c, 0x6b, 0x9f, 0xdf,
- 0x29, 0xcd, 0x09, 0xae, 0x96, 0x37, 0x14, 0xd7, 0x24, 0x0d, 0x29, 0x2e, 0x97, 0x74, 0x7c, 0x21,
- 0x39, 0xa9, 0x49, 0x4a, 0x1a, 0x52, 0x5c, 0x16, 0xbf, 0xb1, 0xef, 0xdc, 0x8f, 0xb1, 0x10, 0x86,
- 0xdc, 0x33, 0x2a, 0x7e, 0xef, 0xa6, 0x2c, 0xa4, 0xcb, 0xb1, 0x3b, 0x9d, 0x17, 0xbb, 0x91, 0x13,
- 0xba, 0x78, 0xbd, 0x6e, 0x9e, 0xe5, 0xfe, 0xe7, 0xa5, 0xfc, 0x9a, 0xa2, 0x22, 0x4d, 0x02, 0xbe,
- 0x05, 0x06, 0xb1, 0x1f, 0x7b, 0xe6, 0x39, 0x7e, 0x7c, 0x1f, 0x37, 0xfa, 0xd4, 0x7e, 0x59, 0xf1,
- 0x63, 0x0f, 0x71, 0xcd, 0xf0, 0x05, 0x70, 0xda, 0xb3, 0xf6, 0x59, 0x12, 0xc0, 0x24, 0x62, 0x17,
- 0xcd, 0x29, 0x3e, 0xef, 0x49, 0x56, 0xc4, 0xae, 0xe9, 0x0c, 0xd4, 0x2e, 0xc7, 0x07, 0x3a, 0xbe,
- 0x36, 0x70, 0x5a, 0x1b, 0xa8, 0x33, 0x50, 0xbb, 0x1c, 0x73, 0x32, 0xc1, 0xf7, 0x63, 0x87, 0x60,
- 0xdb, 0xfc, 0x3f, 0x5e, 0xf7, 0xca, 0xfe, 0xae, 0xa0, 0x21, 0xc5, 0x85, 0xf7, 0x93, 0x96, 0x83,
- 0xc9, 0x37, 0xdf, 0x46, 0xdf, 0x52, 0xf7, 0x3a, 0x59, 0x24, 0xc4, 0x3a, 0x10, 0xa7, 0x8a, 0xde,
- 0x6c, 0x80, 0x3e, 0xc8, 0x5b, 0xae, 0xbb, 0x5e, 0x37, 0xcf, 0x73, 0x8f, 0xf7, 0xf1, 0xb4, 0x50,
- 0x19, 0x66, 0x91, 0xe9, 0x47, 0x02, 0x86, 0xe1, 0x05, 0x3e, 0x8b, 0x85, 0x99, 0x13, 0xc3, 0x5b,
- 0x67, 0xfa, 0x91, 0x80, 0xe1, 0xf3, 0xf3, 0x0f, 0xd6, 0xeb, 0xe6, 0x63, 0x27, 0x37, 0x3f, 0xa6,
- 0x1f, 0x09, 0x18, 0x68, 0x83, 0x01, 0x3f, 0x88, 0xcc, 0x0b, 0xfd, 0x3e, 0x7b, 0xf9, 0x69, 0x72,
- 0x3b, 0x88, 0x10, 0x53, 0x0f, 0x7f, 0x64, 0x00, 0x10, 0xa6, 0x91, 0x78, 0xf1, 0xb8, 0x2d, 0x80,
- 0x0c, 0x5a, 0x39, 0x8d, 0xde, 0x15, 0x3f, 0x22, 0x07, 0xe9, 0xbd, 0x46, 0x8b, 0x72, 0xcd, 0x00,
- 0xf8, 0x73, 0x03, 0x9c, 0xd3, 0xcb, 0x5d, 0x65, 0xd9, 0x2c, 0xf7, 0xc3, 0x7a, 0x1f, 0x03, 0xb9,
- 0x12, 0x04, 0x6e, 0xc5, 0x6c, 0x35, 0x8b, 0xe7, 0x16, 0xbb, 0x00, 0xa2, 0xae, 0x66, 0xc0, 0x5f,
- 0x1b, 0x60, 0x52, 0x66, 0x47, 0xcd, 0xb8, 0x22, 0x77, 0xdb, 0x5b, 0x7d, 0x74, 0x5b, 0x16, 0x42,
- 0x78, 0x4f, 0x7d, 0x65, 0xec, 0xe0, 0xa3, 0x4e, 0xab, 0xe0, 0xef, 0x0c, 0x30, 0x66, 0xe3, 0x10,
- 0xfb, 0x36, 0xf6, 0x6b, 0xcc, 0xcc, 0xb9, 0xe3, 0xf6, 0x15, 0xb2, 0x66, 0x2e, 0x6b, 0xda, 0x85,
- 0x85, 0x65, 0x69, 0xe1, 0x98, 0xce, 0x3a, 0x6c, 0x16, 0xa7, 0xd3, 0xa1, 0x3a, 0x07, 0xb5, 0x19,
- 0x08, 0x7f, 0x6c, 0x80, 0xf1, 0xd4, 0xed, 0xe2, 0x80, 0xb8, 0x74, 0x32, 0x0b, 0xcf, 0x4b, 0xd0,
- 0xc5, 0x76, 0x2c, 0x94, 0x05, 0x87, 0xbf, 0x31, 0x58, 0xb5, 0x95, 0xdc, 0xd5, 0xa8, 0x59, 0xe2,
- 0x1e, 0x7c, 0xbd, 0x9f, 0x1e, 0x54, 0xca, 0x85, 0x03, 0xaf, 0xa6, 0x95, 0x9c, 0xe2, 0x1c, 0x36,
- 0x8b, 0x53, 0xba, 0xff, 0x14, 0x03, 0xe9, 0xc6, 0xc1, 0x77, 0x0d, 0x30, 0x86, 0xd3, 0x82, 0x99,
- 0x9a, 0x97, 0x8f, 0xeb, 0xba, 0xae, 0xe5, 0xb7, 0xb8, 0x4e, 0x6b, 0x2c, 0x8a, 0xda, 0x60, 0x59,
- 0xed, 0x87, 0xf7, 0x2d, 0x2f, 0x74, 0xb1, 0xf9, 0xff, 0xfd, 0xab, 0xfd, 0x56, 0x84, 0x4a, 0x94,
- 0xe8, 0x86, 0x57, 0x41, 0xc1, 0x8f, 0x5d, 0xd7, 0xda, 0x72, 0xb1, 0xf9, 0x38, 0xaf, 0x22, 0x54,
- 0x7f, 0xf1, 0xb6, 0xa4, 0x23, 0x25, 0x01, 0xeb, 0x60, 0x6e, 0xff, 0xa6, 0x7a, 0x7c, 0xd1, 0xb5,
- 0x81, 0x67, 0x5e, 0xe1, 0x5a, 0x66, 0x5a, 0xcd, 0xe2, 0xf4, 0x66, 0xf7, 0x16, 0xdf, 0x43, 0x75,
- 0xc0, 0x37, 0xc0, 0x63, 0x9a, 0xcc, 0x8a, 0xb7, 0x85, 0x6d, 0x1b, 0xdb, 0xc9, 0x45, 0xcb, 0xfc,
- 0x02, 0x87, 0x50, 0xfb, 0x78, 0x33, 0x2b, 0x80, 0x1e, 0x34, 0x1a, 0xde, 0x02, 0xd3, 0x1a, 0x7b,
- 0xd5, 0x8f, 0xd6, 0x49, 0x35, 0x22, 0x8e, 0xdf, 0x30, 0xe7, 0xb9, 0xde, 0x73, 0xc9, 0xee, 0xdb,
- 0xd4, 0x78, 0xa8, 0xc7, 0x18, 0xf8, 0x72, 0x9b, 0x36, 0xfe, 0xe1, 0xc2, 0x0a, 0x6f, 0xe2, 0x03,
- 0x6a, 0x3e, 0xc1, 0x8b, 0x0b, 0xbe, 0xce, 0x9b, 0x1a, 0x1d, 0xf5, 0x90, 0x87, 0xdf, 0x00, 0x67,
- 0x33, 0x1c, 0x76, 0xaf, 0x30, 0x9f, 0x14, 0x17, 0x04, 0x56, 0x89, 0x6e, 0x26, 0x44, 0xd4, 0x4d,
- 0x12, 0x7e, 0x15, 0x40, 0x8d, 0xbc, 0x66, 0x85, 0x7c, 0xfc, 0x53, 0xe2, 0xae, 0xc2, 0x56, 0x74,
- 0x53, 0xd2, 0x50, 0x17, 0x39, 0xf8, 0x81, 0xd1, 0x36, 0x93, 0xf4, 0x36, 0x4b, 0xcd, 0xab, 0x7c,
- 0xc3, 0xbe, 0x7c, 0xf4, 0x00, 0x4c, 0x95, 0xa1, 0xd8, 0xc5, 0x9a, 0x87, 0x35, 0x14, 0xd4, 0x03,
- 0x7d, 0x86, 0x5d, 0xa6, 0x33, 0x39, 0x1c, 0x4e, 0x80, 0x81, 0x1d, 0x2c, 0x3f, 0x1b, 0x23, 0xf6,
- 0x13, 0xbe, 0x09, 0xf2, 0xbb, 0x96, 0x1b, 0x27, 0xad, 0x80, 0xfe, 0x9d, 0xf5, 0x48, 0xe8, 0x7d,
- 0x31, 0x77, 0xdd, 0x98, 0x79, 0xdf, 0x00, 0xd3, 0xdd, 0x4f, 0x95, 0xcf, 0xcb, 0xa2, 0x9f, 0x19,
- 0x60, 0xb2, 0xe3, 0x00, 0xe9, 0x62, 0x8c, 0xdb, 0x6e, 0xcc, 0xbd, 0x3e, 0x9e, 0x04, 0x62, 0x23,
- 0xf0, 0x8a, 0x56, 0xb7, 0xec, 0x87, 0x06, 0x98, 0xc8, 0x26, 0xe6, 0xcf, 0xc9, 0x4b, 0xa5, 0xf7,
- 0x72, 0x60, 0xba, 0x7b, 0x0d, 0x0e, 0x3d, 0xd5, 0x5d, 0xe8, 0x7b, 0x83, 0xa6, 0x5b, 0xcb, 0xf6,
- 0x1d, 0x03, 0x8c, 0xbe, 0xad, 0xe4, 0x92, 0xaf, 0x99, 0xfd, 0xec, 0x0a, 0x25, 0x47, 0x5f, 0xca,
- 0xa0, 0x48, 0x87, 0x2c, 0xfd, 0xd6, 0x00, 0x53, 0x5d, 0x8f, 0x73, 0x78, 0x05, 0x0c, 0x59, 0xae,
- 0x1b, 0xec, 0x89, 0x6e, 0x9e, 0xd6, 0x96, 0x5f, 0xe4, 0x54, 0x24, 0xb9, 0x9a, 0xcf, 0x72, 0x9f,
- 0x81, 0xcf, 0x4a, 0x7f, 0x30, 0xc0, 0x85, 0x07, 0x45, 0xdd, 0x67, 0xbd, 0x86, 0xf3, 0xa0, 0x20,
- 0x8b, 0xed, 0x03, 0xbe, 0x7e, 0x32, 0xbb, 0xca, 0x8c, 0xc0, 0x5f, 0xcb, 0x88, 0x5f, 0xa5, 0x5f,
- 0x1a, 0x60, 0xa2, 0x8a, 0xc9, 0xae, 0x53, 0xc3, 0x08, 0xd7, 0x31, 0xc1, 0x7e, 0x0d, 0xc3, 0x05,
- 0x30, 0xc2, 0xbf, 0x36, 0x86, 0x56, 0x2d, 0xf9, 0x46, 0x32, 0x29, 0x1d, 0x3d, 0x72, 0x3b, 0x61,
- 0xa0, 0x54, 0x46, 0x7d, 0x4f, 0xc9, 0xf5, 0xfc, 0x9e, 0x72, 0x01, 0x0c, 0x86, 0x69, 0x03, 0xb8,
- 0xc0, 0xb8, 0xbc, 0xe7, 0xcb, 0xa9, 0x9c, 0x1b, 0x90, 0x88, 0x77, 0xb9, 0xf2, 0x92, 0x1b, 0x90,
- 0x08, 0x71, 0x6a, 0xe9, 0x4f, 0x39, 0x70, 0xa6, 0x3d, 0x3f, 0x33, 0x40, 0x12, 0xbb, 0x1d, 0x1f,
- 0x70, 0x18, 0x0f, 0x71, 0x8e, 0xfe, 0x6e, 0x20, 0xf7, 0xe0, 0x77, 0x03, 0xf0, 0x25, 0x30, 0x29,
- 0x7f, 0xae, 0xec, 0x87, 0x04, 0x53, 0xfe, 0x65, 0x72, 0xa0, 0xfd, 0xbd, 0xdf, 0x5a, 0x56, 0x00,
- 0x75, 0x8e, 0x81, 0x5f, 0xc9, 0xbc, 0x69, 0xb8, 0x9c, 0xbe, 0x67, 0x60, 0xb5, 0x1d, 0x2f, 0x1d,
- 0xee, 0xb1, 0x2d, 0xbf, 0x42, 0x48, 0x40, 0x32, 0x0f, 0x1d, 0x16, 0xc0, 0x48, 0x9d, 0x09, 0xf0,
- 0x3e, 0x79, 0xbe, 0xdd, 0xe9, 0x37, 0x12, 0x06, 0x4a, 0x65, 0xe0, 0xd7, 0xc0, 0x78, 0x10, 0x8a,
- 0x2a, 0x76, 0xdd, 0xb5, 0xab, 0xd8, 0xad, 0xf3, 0x8e, 0x5e, 0x21, 0x69, 0xbb, 0xb6, 0xb1, 0x50,
- 0x56, 0xb6, 0xf4, 0x47, 0x03, 0x9c, 0x4d, 0x1e, 0x13, 0xb9, 0x0e, 0xf6, 0xa3, 0xa5, 0xc0, 0xaf,
- 0x3b, 0x0d, 0x78, 0x5e, 0xb4, 0x4f, 0xb5, 0x9e, 0x64, 0xd2, 0x3a, 0x85, 0xf7, 0xc1, 0x30, 0x15,
- 0xb1, 0x22, 0xc3, 0xf8, 0x95, 0xa3, 0x87, 0x71, 0x36, 0xe8, 0x44, 0xf5, 0x97, 0x50, 0x13, 0x1c,
- 0x16, 0xc9, 0x35, 0xab, 0x12, 0xfb, 0xb6, 0x6c, 0xa1, 0x8f, 0x89, 0x48, 0x5e, 0x5a, 0x14, 0x34,
- 0xa4, 0xb8, 0xa5, 0x7f, 0x18, 0x60, 0xb2, 0xe3, 0x71, 0x14, 0xfc, 0x9e, 0x01, 0xc6, 0x6a, 0xda,
- 0xf4, 0x64, 0x3e, 0x58, 0x3b, 0xfe, 0x03, 0x2c, 0x4d, 0xa9, 0x28, 0xa1, 0x74, 0x0a, 0x6a, 0x03,
- 0x85, 0x9b, 0xc0, 0xac, 0x65, 0xde, 0x21, 0x66, 0xbe, 0x6c, 0x5e, 0x68, 0x35, 0x8b, 0xe6, 0x52,
- 0x0f, 0x19, 0xd4, 0x73, 0x74, 0xe5, 0x5b, 0x1f, 0x7d, 0x3a, 0x7b, 0xea, 0xe3, 0x4f, 0x67, 0x4f,
- 0x7d, 0xf2, 0xe9, 0xec, 0xa9, 0x77, 0x5a, 0xb3, 0xc6, 0x47, 0xad, 0x59, 0xe3, 0xe3, 0xd6, 0xac,
- 0xf1, 0x49, 0x6b, 0xd6, 0xf8, 0x6b, 0x6b, 0xd6, 0xf8, 0xc9, 0xdf, 0x66, 0x4f, 0xbd, 0x7e, 0xfd,
- 0xa8, 0xaf, 0x8f, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x28, 0x77, 0xf5, 0x22, 0xd1, 0x2c, 0x00,
- 0x00,
+ proto.RegisterFile("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto", fileDescriptor_c5e101a0235c8c62)
+}
+
+var fileDescriptor_c5e101a0235c8c62 = []byte{
+ // 3166 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xdb, 0x6f, 0x1b, 0xc7,
+ 0xd5, 0xf7, 0x52, 0x37, 0x6a, 0x24, 0x59, 0xd2, 0xd8, 0xd2, 0xb7, 0x56, 0x6c, 0x51, 0xa6, 0xbf,
+ 0xf8, 0x53, 0x12, 0x87, 0x4a, 0xf4, 0x25, 0x8d, 0x9b, 0x5e, 0x02, 0x51, 0x92, 0x13, 0xc5, 0x92,
+ 0x25, 0x0c, 0x6d, 0x47, 0x49, 0x8a, 0x26, 0x2b, 0xee, 0x90, 0xda, 0x68, 0xb9, 0xbb, 0x9e, 0xd9,
+ 0xd5, 0x05, 0x68, 0x81, 0xa0, 0x45, 0xd0, 0x36, 0x40, 0x9b, 0x3e, 0x14, 0xe9, 0x53, 0x51, 0x14,
+ 0x45, 0x1e, 0xda, 0x87, 0xf6, 0xad, 0xfd, 0x17, 0xf2, 0x52, 0x20, 0x40, 0x81, 0x22, 0x40, 0x01,
+ 0xa2, 0x61, 0xff, 0x81, 0x02, 0x6d, 0x51, 0x54, 0x0f, 0x45, 0x31, 0x97, 0x9d, 0x9d, 0x5d, 0x92,
+ 0xb6, 0x61, 0x51, 0xc9, 0x1b, 0x79, 0xce, 0x99, 0xf3, 0x3b, 0x73, 0xe6, 0xcc, 0x99, 0x33, 0x67,
+ 0x07, 0xbc, 0xb2, 0x77, 0x9d, 0x96, 0x1c, 0x7f, 0xc1, 0x0a, 0x1c, 0x7c, 0x18, 0x62, 0x8f, 0x3a,
+ 0xbe, 0x47, 0x9f, 0xb6, 0x02, 0x87, 0x62, 0xb2, 0x8f, 0xc9, 0x42, 0xb0, 0x57, 0x67, 0x3c, 0x9a,
+ 0x16, 0x58, 0xd8, 0x7f, 0x76, 0xa1, 0x8e, 0x3d, 0x4c, 0xac, 0x10, 0xdb, 0xa5, 0x80, 0xf8, 0xa1,
+ 0x0f, 0xaf, 0x0b, 0x4d, 0xa5, 0x94, 0xe0, 0x5b, 0x4a, 0x53, 0x29, 0xd8, 0xab, 0x33, 0x1e, 0x4d,
+ 0x0b, 0x94, 0xf6, 0x9f, 0x9d, 0x79, 0xba, 0xee, 0x84, 0xbb, 0xd1, 0x4e, 0xa9, 0xea, 0x37, 0x16,
+ 0xea, 0x7e, 0xdd, 0x5f, 0xe0, 0x0a, 0x77, 0xa2, 0x1a, 0xff, 0xc7, 0xff, 0xf0, 0x5f, 0x02, 0x68,
+ 0xe6, 0xb9, 0xc4, 0xe4, 0x86, 0x55, 0xdd, 0x75, 0x3c, 0x4c, 0x8e, 0x12, 0x3b, 0x1b, 0x38, 0xb4,
+ 0x3a, 0x98, 0x37, 0xb3, 0xd0, 0x6d, 0x14, 0x89, 0xbc, 0xd0, 0x69, 0xe0, 0xb6, 0x01, 0x5f, 0x7a,
+ 0xd0, 0x00, 0x5a, 0xdd, 0xc5, 0x0d, 0x2b, 0x3b, 0xae, 0x78, 0x6c, 0x80, 0xc9, 0x65, 0xdf, 0xdb,
+ 0xc7, 0x84, 0x4d, 0x10, 0xe1, 0x7b, 0x11, 0xa6, 0x21, 0x2c, 0x83, 0xbe, 0xc8, 0xb1, 0x4d, 0x63,
+ 0xce, 0x98, 0x1f, 0x2e, 0x3f, 0xf3, 0x71, 0xb3, 0x70, 0xa6, 0xd5, 0x2c, 0xf4, 0xdd, 0x59, 0x5b,
+ 0x39, 0x6e, 0x16, 0x2e, 0x77, 0x43, 0x0a, 0x8f, 0x02, 0x4c, 0x4b, 0x77, 0xd6, 0x56, 0x10, 0x1b,
+ 0x0c, 0x5f, 0x06, 0x93, 0x36, 0xa6, 0x0e, 0xc1, 0xf6, 0xd2, 0xd6, 0xda, 0x5d, 0xa1, 0xdf, 0xcc,
+ 0x71, 0x8d, 0x17, 0xa4, 0xc6, 0xc9, 0x95, 0xac, 0x00, 0x6a, 0x1f, 0x03, 0xb7, 0xc1, 0x90, 0xbf,
+ 0xf3, 0x0e, 0xae, 0x86, 0xd4, 0xec, 0x9b, 0xeb, 0x9b, 0x1f, 0x59, 0x7c, 0xba, 0x94, 0x2c, 0x9e,
+ 0x32, 0x81, 0xaf, 0x98, 0x9c, 0x6c, 0x09, 0x59, 0x07, 0xab, 0xf1, 0xa2, 0x95, 0xc7, 0x25, 0xda,
+ 0xd0, 0xa6, 0xd0, 0x82, 0x62, 0x75, 0xc5, 0x5f, 0xe6, 0x00, 0xd4, 0x27, 0x4f, 0x03, 0xdf, 0xa3,
+ 0xb8, 0x27, 0xb3, 0xa7, 0x60, 0xa2, 0xca, 0x35, 0x87, 0xd8, 0x96, 0xb8, 0x66, 0xee, 0x51, 0xac,
+ 0x37, 0x25, 0xfe, 0xc4, 0x72, 0x46, 0x1d, 0x6a, 0x03, 0x80, 0xb7, 0xc1, 0x20, 0xc1, 0x34, 0x72,
+ 0x43, 0xb3, 0x6f, 0xce, 0x98, 0x1f, 0x59, 0xbc, 0xd6, 0x15, 0x8a, 0x87, 0x36, 0x0b, 0xbe, 0xd2,
+ 0xfe, 0xb3, 0xa5, 0x4a, 0x68, 0x85, 0x11, 0x2d, 0x9f, 0x95, 0x48, 0x83, 0x88, 0xeb, 0x40, 0x52,
+ 0x57, 0xf1, 0x3f, 0x06, 0x98, 0xd0, 0xbd, 0xb4, 0xef, 0xe0, 0x03, 0x48, 0xc0, 0x10, 0x11, 0xc1,
+ 0xc2, 0xfd, 0x34, 0xb2, 0x78, 0xb3, 0xf4, 0xa8, 0x3b, 0xaa, 0xd4, 0x16, 0x7f, 0xe5, 0x11, 0xb6,
+ 0x5c, 0xf2, 0x0f, 0x8a, 0x81, 0xe0, 0x3e, 0xc8, 0x13, 0xb9, 0x46, 0x3c, 0x90, 0x46, 0x16, 0xd7,
+ 0x7b, 0x03, 0x2a, 0x74, 0x96, 0x47, 0x5b, 0xcd, 0x42, 0x3e, 0xfe, 0x87, 0x14, 0x56, 0xf1, 0xe7,
+ 0x39, 0x30, 0xbb, 0x1c, 0xd1, 0xd0, 0x6f, 0x20, 0x4c, 0xfd, 0x88, 0x54, 0xf1, 0xb2, 0xef, 0x46,
+ 0x0d, 0x6f, 0x05, 0xd7, 0x1c, 0xcf, 0x09, 0x59, 0x8c, 0xce, 0x81, 0x7e, 0xcf, 0x6a, 0x60, 0x19,
+ 0x33, 0xa3, 0xd2, 0x93, 0xfd, 0xb7, 0xac, 0x06, 0x46, 0x9c, 0xc3, 0x24, 0x58, 0x88, 0xc8, 0x1d,
+ 0xa0, 0x24, 0x6e, 0x1f, 0x05, 0x18, 0x71, 0x0e, 0xbc, 0x0a, 0x06, 0x6b, 0x3e, 0x69, 0x58, 0x62,
+ 0xf5, 0x86, 0x93, 0xf5, 0xb8, 0xc1, 0xa9, 0x48, 0x72, 0xe1, 0xf3, 0x60, 0xc4, 0xc6, 0xb4, 0x4a,
+ 0x9c, 0x80, 0x41, 0x9b, 0xfd, 0x5c, 0xf8, 0x9c, 0x14, 0x1e, 0x59, 0x49, 0x58, 0x48, 0x97, 0x83,
+ 0xd7, 0x40, 0x3e, 0x20, 0x8e, 0x4f, 0x9c, 0xf0, 0xc8, 0x1c, 0x98, 0x33, 0xe6, 0x07, 0xca, 0x13,
+ 0x72, 0x4c, 0x7e, 0x4b, 0xd2, 0x91, 0x92, 0x60, 0xd2, 0xef, 0x50, 0xdf, 0xdb, 0xb2, 0xc2, 0x5d,
+ 0x73, 0x90, 0x23, 0x28, 0xe9, 0x57, 0x2b, 0x9b, 0xb7, 0x18, 0x1d, 0x29, 0x89, 0xe2, 0x9f, 0x0c,
+ 0x60, 0x66, 0x3d, 0x14, 0xbb, 0x17, 0xde, 0x00, 0x79, 0x1a, 0xb2, 0x9c, 0x53, 0x3f, 0x92, 0xfe,
+ 0x79, 0x32, 0x56, 0x55, 0x91, 0xf4, 0xe3, 0x66, 0x61, 0x3a, 0x19, 0x11, 0x53, 0xb9, 0x6f, 0xd4,
+ 0x58, 0x16, 0x72, 0x07, 0x78, 0x67, 0xd7, 0xf7, 0xf7, 0xe4, 0xea, 0x9f, 0x20, 0xe4, 0x5e, 0x13,
+ 0x8a, 0x12, 0x4c, 0x11, 0x72, 0x92, 0x8c, 0x62, 0xa0, 0xe2, 0xbf, 0x73, 0xd9, 0x89, 0x69, 0x8b,
+ 0xfe, 0x36, 0xc8, 0xb3, 0x2d, 0x64, 0x5b, 0xa1, 0x25, 0x37, 0xc1, 0x33, 0x0f, 0xb7, 0xe1, 0xc4,
+ 0x7e, 0xdd, 0xc0, 0xa1, 0x55, 0x86, 0xd2, 0x15, 0x20, 0xa1, 0x21, 0xa5, 0x15, 0x1e, 0x82, 0x7e,
+ 0x1a, 0xe0, 0xaa, 0x9c, 0xef, 0xdd, 0x13, 0x44, 0x7b, 0x97, 0x39, 0x54, 0x02, 0x5c, 0x4d, 0x82,
+ 0x91, 0xfd, 0x43, 0x1c, 0x11, 0xbe, 0x6b, 0x80, 0x41, 0xca, 0xf3, 0x82, 0xcc, 0x25, 0xdb, 0xa7,
+ 0x00, 0x9e, 0xc9, 0x3b, 0xe2, 0x3f, 0x92, 0xb8, 0xc5, 0x7f, 0xe4, 0xc0, 0xe5, 0x6e, 0x43, 0x97,
+ 0x7d, 0xcf, 0x16, 0x8b, 0xb0, 0x26, 0xf7, 0x95, 0x88, 0xac, 0xe7, 0xf5, 0x7d, 0x75, 0xdc, 0x2c,
+ 0x3c, 0xfe, 0x40, 0x05, 0xda, 0x06, 0xfc, 0xb2, 0x9a, 0xb2, 0xd8, 0xa4, 0x97, 0xd3, 0x86, 0x1d,
+ 0x37, 0x0b, 0xe3, 0x6a, 0x58, 0xda, 0x56, 0xb8, 0x0f, 0xa0, 0x6b, 0xd1, 0xf0, 0x36, 0xb1, 0x3c,
+ 0x2a, 0xd4, 0x3a, 0x0d, 0x2c, 0x3d, 0xf7, 0xe4, 0xc3, 0x05, 0x05, 0x1b, 0x51, 0x9e, 0x91, 0x90,
+ 0x70, 0xbd, 0x4d, 0x1b, 0xea, 0x80, 0xc0, 0x72, 0x06, 0xc1, 0x16, 0x55, 0x69, 0x40, 0xcb, 0xe1,
+ 0x8c, 0x8a, 0x24, 0x17, 0x3e, 0x01, 0x86, 0x1a, 0x98, 0x52, 0xab, 0x8e, 0xf9, 0xde, 0x1f, 0x4e,
+ 0x0e, 0xc5, 0x0d, 0x41, 0x46, 0x31, 0xbf, 0xf8, 0x4f, 0x03, 0x5c, 0xec, 0xe6, 0xb5, 0x75, 0x87,
+ 0x86, 0xf0, 0x1b, 0x6d, 0x61, 0x5f, 0x7a, 0xb8, 0x19, 0xb2, 0xd1, 0x3c, 0xe8, 0x55, 0x2a, 0x89,
+ 0x29, 0x5a, 0xc8, 0x1f, 0x80, 0x01, 0x27, 0xc4, 0x8d, 0xf8, 0xb4, 0x44, 0xbd, 0x0f, 0xbb, 0xf2,
+ 0x98, 0x84, 0x1f, 0x58, 0x63, 0x40, 0x48, 0xe0, 0x15, 0x3f, 0xca, 0x81, 0x4b, 0xdd, 0x86, 0xb0,
+ 0x3c, 0x4e, 0x99, 0xb3, 0x03, 0x37, 0x22, 0x96, 0x2b, 0x83, 0x4d, 0x39, 0x7b, 0x8b, 0x53, 0x91,
+ 0xe4, 0xb2, 0xdc, 0x49, 0x1d, 0xaf, 0x1e, 0xb9, 0x16, 0x91, 0x91, 0xa4, 0x26, 0x5c, 0x91, 0x74,
+ 0xa4, 0x24, 0x60, 0x09, 0x00, 0xba, 0xeb, 0x93, 0x90, 0x63, 0xf0, 0x0a, 0x67, 0xb8, 0x7c, 0x96,
+ 0x65, 0x84, 0x8a, 0xa2, 0x22, 0x4d, 0x82, 0x1d, 0x24, 0x7b, 0x8e, 0x67, 0xcb, 0x05, 0x57, 0x7b,
+ 0xf7, 0xa6, 0xe3, 0xd9, 0x88, 0x73, 0x18, 0xbe, 0xeb, 0xd0, 0x90, 0x51, 0xe4, 0x6a, 0xa7, 0x1c,
+ 0xce, 0x25, 0x95, 0x04, 0xc3, 0xaf, 0xb2, 0x04, 0xeb, 0x13, 0x07, 0x53, 0x73, 0x30, 0xc1, 0x5f,
+ 0x56, 0x54, 0xa4, 0x49, 0x14, 0xff, 0xdc, 0xdf, 0x3d, 0x3e, 0x58, 0x02, 0x81, 0x57, 0xc0, 0x40,
+ 0x9d, 0xf8, 0x51, 0x20, 0xbd, 0xa4, 0xbc, 0xfd, 0x32, 0x23, 0x22, 0xc1, 0x83, 0xdf, 0x02, 0x03,
+ 0x9e, 0x9c, 0x30, 0x8b, 0xa0, 0xd7, 0x7a, 0xbf, 0xcc, 0xdc, 0x5b, 0x09, 0xba, 0x70, 0xa4, 0x00,
+ 0x85, 0xcf, 0x81, 0x01, 0x5a, 0xf5, 0x03, 0x2c, 0x9d, 0x38, 0x1b, 0x0b, 0x55, 0x18, 0xf1, 0xb8,
+ 0x59, 0x18, 0x8b, 0xd5, 0x71, 0x02, 0x12, 0xc2, 0xf0, 0x7b, 0x06, 0xc8, 0xcb, 0xe3, 0x82, 0x9a,
+ 0x43, 0x3c, 0x3c, 0x5f, 0xef, 0xbd, 0xdd, 0xb2, 0xec, 0x4d, 0xd6, 0x4c, 0x12, 0x28, 0x52, 0xe0,
+ 0xf0, 0x3b, 0x06, 0x00, 0x55, 0x75, 0x76, 0x99, 0xc3, 0xdc, 0x87, 0x3d, 0xdb, 0x2a, 0xda, 0xa9,
+ 0x28, 0x02, 0x21, 0x29, 0x95, 0x34, 0x54, 0x58, 0x01, 0x53, 0x01, 0xc1, 0x5c, 0xf7, 0x1d, 0x6f,
+ 0xcf, 0xf3, 0x0f, 0xbc, 0x1b, 0x0e, 0x76, 0x6d, 0x6a, 0x82, 0x39, 0x63, 0x3e, 0x5f, 0xbe, 0x24,
+ 0xed, 0x9f, 0xda, 0xea, 0x24, 0x84, 0x3a, 0x8f, 0x2d, 0xbe, 0xd7, 0x97, 0xad, 0xb5, 0xb2, 0xe7,
+ 0x05, 0xfc, 0x40, 0x4c, 0x5e, 0xe4, 0x61, 0x6a, 0x1a, 0x7c, 0x21, 0xde, 0xec, 0xfd, 0x42, 0xa8,
+ 0x5c, 0x9f, 0x1c, 0xd2, 0x8a, 0x44, 0x91, 0x66, 0x02, 0xfc, 0x89, 0x01, 0xc6, 0xac, 0x6a, 0x15,
+ 0x07, 0x21, 0xb6, 0xc5, 0x36, 0xce, 0x9d, 0x6e, 0x54, 0x4f, 0x49, 0x83, 0xc6, 0x96, 0x74, 0x54,
+ 0x94, 0x36, 0x02, 0xbe, 0x08, 0xce, 0xd2, 0xd0, 0x27, 0xd8, 0x8e, 0x23, 0x48, 0x66, 0x17, 0xd8,
+ 0x6a, 0x16, 0xce, 0x56, 0x52, 0x1c, 0x94, 0x91, 0x2c, 0xb6, 0x06, 0x41, 0xe1, 0x01, 0x11, 0xfa,
+ 0x10, 0x45, 0xef, 0x55, 0x30, 0xc8, 0x67, 0x6a, 0x73, 0x87, 0xe4, 0xb5, 0xa3, 0x9e, 0x53, 0x91,
+ 0xe4, 0xb2, 0xe3, 0x89, 0xe1, 0xb3, 0xe3, 0xa9, 0x8f, 0x0b, 0xaa, 0xe3, 0xa9, 0x22, 0xc8, 0x28,
+ 0xe6, 0xc3, 0x45, 0x00, 0x6c, 0x1c, 0x10, 0xcc, 0x32, 0x92, 0x6d, 0x0e, 0x71, 0x69, 0xb5, 0x3e,
+ 0x2b, 0x8a, 0x83, 0x34, 0x29, 0x78, 0x03, 0xc0, 0xf8, 0x9f, 0xe3, 0x7b, 0xaf, 0x59, 0xc4, 0x73,
+ 0xbc, 0xba, 0x99, 0xe7, 0x66, 0x4f, 0xb3, 0xd3, 0x76, 0xa5, 0x8d, 0x8b, 0x3a, 0x8c, 0x80, 0xfb,
+ 0x60, 0x50, 0x5c, 0xa3, 0x79, 0xde, 0xe8, 0xe1, 0x8e, 0xbb, 0x6b, 0xb9, 0x8e, 0xcd, 0xa1, 0xca,
+ 0x80, 0xbb, 0x87, 0xa3, 0x20, 0x89, 0x06, 0xdf, 0x37, 0xc0, 0x28, 0x8d, 0x76, 0x88, 0x94, 0xa6,
+ 0x3c, 0xab, 0x8f, 0x2c, 0xde, 0xee, 0x15, 0x7c, 0x45, 0xd3, 0x5d, 0x9e, 0x68, 0x35, 0x0b, 0xa3,
+ 0x3a, 0x05, 0xa5, 0xb0, 0xe1, 0xef, 0x0c, 0x60, 0x5a, 0xb6, 0x08, 0x7d, 0xcb, 0xdd, 0x22, 0x8e,
+ 0x17, 0x62, 0x22, 0x2e, 0x44, 0xe2, 0xf8, 0xe8, 0x61, 0xad, 0x98, 0xbd, 0x67, 0x95, 0xe7, 0xe4,
+ 0x4a, 0x9b, 0x4b, 0x5d, 0x2c, 0x40, 0x5d, 0x6d, 0x63, 0x79, 0x63, 0x82, 0x62, 0x17, 0x57, 0x43,
+ 0x6b, 0xc7, 0xc5, 0x32, 0x57, 0x0d, 0x73, 0x83, 0xd7, 0x1e, 0xdd, 0xe0, 0x4a, 0x5a, 0x63, 0x72,
+ 0x5f, 0xcf, 0x30, 0x28, 0x6a, 0x03, 0x2f, 0xfe, 0xcb, 0xc8, 0x26, 0x3b, 0xcd, 0xef, 0x95, 0xaa,
+ 0xe5, 0x62, 0xb8, 0x02, 0x26, 0x58, 0x3d, 0x8e, 0x70, 0xe0, 0x3a, 0x55, 0x8b, 0xf2, 0xfb, 0x98,
+ 0xd8, 0x6f, 0x09, 0x50, 0x86, 0x8f, 0xda, 0x46, 0xc0, 0x57, 0x01, 0x14, 0x85, 0x6a, 0x4a, 0x8f,
+ 0xa8, 0x4d, 0x54, 0xc9, 0x59, 0x69, 0x93, 0x40, 0x1d, 0x46, 0xc1, 0x65, 0x30, 0xe9, 0x5a, 0x3b,
+ 0xd8, 0x15, 0xf3, 0xf3, 0x09, 0x57, 0x25, 0x6e, 0xac, 0x53, 0xad, 0x66, 0x61, 0x72, 0x3d, 0xcb,
+ 0x44, 0xed, 0xf2, 0xc5, 0xcb, 0xd9, 0xec, 0xa2, 0x4f, 0x5c, 0x94, 0xff, 0x1f, 0xe6, 0xc0, 0x4c,
+ 0xf7, 0x30, 0x85, 0xdf, 0x56, 0xc5, 0xba, 0xa8, 0x41, 0x5f, 0x3f, 0x85, 0xcd, 0x20, 0x2f, 0x28,
+ 0xa0, 0xfd, 0x72, 0x02, 0x8f, 0x58, 0x05, 0x61, 0xb9, 0x71, 0x23, 0x62, 0xfb, 0x34, 0xd0, 0x99,
+ 0xfe, 0xf2, 0xb0, 0xa8, 0x4b, 0x2c, 0x97, 0x97, 0x21, 0x96, 0x8b, 0x8b, 0x1f, 0xb5, 0x5d, 0xb6,
+ 0x93, 0xf4, 0x01, 0xbf, 0x6f, 0x80, 0x71, 0x3f, 0xc0, 0xde, 0xd2, 0xd6, 0xda, 0xdd, 0xff, 0x17,
+ 0x69, 0x44, 0x3a, 0xe8, 0x04, 0x31, 0xce, 0x6e, 0xfc, 0x42, 0xd7, 0x16, 0xf1, 0x03, 0x5a, 0x3e,
+ 0xd7, 0x6a, 0x16, 0xc6, 0x37, 0xd3, 0x28, 0x28, 0x0b, 0x5b, 0x6c, 0x80, 0xa9, 0xd5, 0xc3, 0x10,
+ 0x13, 0xcf, 0x72, 0x57, 0xfc, 0x6a, 0xd4, 0xc0, 0x5e, 0x28, 0x6c, 0xcc, 0x34, 0x30, 0x8c, 0x87,
+ 0x6c, 0x60, 0x5c, 0x02, 0x7d, 0x11, 0x71, 0x65, 0xd4, 0x8e, 0xa8, 0xb6, 0x1c, 0x5a, 0x47, 0x8c,
+ 0x5e, 0xbc, 0x0c, 0xfa, 0x99, 0x9d, 0xf0, 0x02, 0xe8, 0x23, 0xd6, 0x01, 0xd7, 0x3a, 0x5a, 0x1e,
+ 0x62, 0x22, 0xc8, 0x3a, 0x40, 0x8c, 0x56, 0xfc, 0xdb, 0x1c, 0x18, 0xcf, 0xcc, 0x05, 0xce, 0x80,
+ 0x9c, 0xea, 0xf5, 0x01, 0xa9, 0x34, 0xb7, 0xb6, 0x82, 0x72, 0x8e, 0x0d, 0x5f, 0x50, 0xf9, 0x5e,
+ 0x80, 0x16, 0xd4, 0xf1, 0xc5, 0xa9, 0xac, 0x50, 0x4c, 0xd4, 0x31, 0x43, 0xe2, 0x84, 0xcd, 0x6c,
+ 0xc0, 0x35, 0xb9, 0x2b, 0x84, 0x0d, 0xb8, 0x86, 0x18, 0xed, 0x51, 0xbb, 0x37, 0x71, 0xfb, 0x68,
+ 0xe0, 0x21, 0xda, 0x47, 0x83, 0xf7, 0x6d, 0x1f, 0x5d, 0x01, 0x03, 0xa1, 0x13, 0xba, 0x98, 0x9f,
+ 0x9d, 0x5a, 0x79, 0x7e, 0x9b, 0x11, 0x91, 0xe0, 0x41, 0x0c, 0x86, 0x6c, 0x5c, 0xb3, 0x22, 0x37,
+ 0xe4, 0xc7, 0xe4, 0xc8, 0xe2, 0xd7, 0x4f, 0x16, 0x3d, 0xa2, 0xbd, 0xb2, 0x22, 0x54, 0xa2, 0x58,
+ 0x37, 0x7c, 0x1c, 0x0c, 0x35, 0xac, 0x43, 0xa7, 0x11, 0x35, 0x78, 0x0d, 0x6b, 0x08, 0xb1, 0x0d,
+ 0x41, 0x42, 0x31, 0x8f, 0x25, 0x41, 0x7c, 0x58, 0x75, 0x23, 0xea, 0xec, 0x63, 0xc9, 0x94, 0x45,
+ 0xa6, 0x4a, 0x82, 0xab, 0x19, 0x3e, 0x6a, 0x1b, 0xc1, 0xc1, 0x1c, 0x8f, 0x0f, 0x1e, 0xd1, 0xc0,
+ 0x04, 0x09, 0xc5, 0xbc, 0x34, 0x98, 0x94, 0x1f, 0xed, 0x06, 0x26, 0x07, 0xb7, 0x8d, 0x80, 0x4f,
+ 0x81, 0xe1, 0x86, 0x75, 0xb8, 0x8e, 0xbd, 0x7a, 0xb8, 0x6b, 0x8e, 0xcd, 0x19, 0xf3, 0x7d, 0xe5,
+ 0xb1, 0x56, 0xb3, 0x30, 0xbc, 0x11, 0x13, 0x51, 0xc2, 0xe7, 0xc2, 0x8e, 0x27, 0x85, 0xcf, 0x6a,
+ 0xc2, 0x31, 0x11, 0x25, 0x7c, 0x56, 0x2b, 0x05, 0x56, 0xc8, 0xf6, 0x95, 0x39, 0x9e, 0xbe, 0xca,
+ 0x6f, 0x09, 0x32, 0x8a, 0xf9, 0x70, 0x1e, 0xe4, 0x1b, 0xd6, 0x21, 0xbf, 0xe5, 0x9a, 0x13, 0x5c,
+ 0x2d, 0x6f, 0x71, 0x6e, 0x48, 0x1a, 0x52, 0x5c, 0x2e, 0xe9, 0x78, 0x42, 0x72, 0x52, 0x93, 0x94,
+ 0x34, 0xa4, 0xb8, 0x2c, 0x7e, 0x23, 0xcf, 0xb9, 0x17, 0x61, 0x21, 0x0c, 0xb9, 0x67, 0x54, 0xfc,
+ 0xde, 0x49, 0x58, 0x48, 0x97, 0x63, 0xb7, 0xcc, 0x46, 0xe4, 0x86, 0x4e, 0xe0, 0xe2, 0xcd, 0x9a,
+ 0x79, 0x8e, 0xfb, 0x9f, 0x5f, 0x2e, 0x36, 0x14, 0x15, 0x69, 0x12, 0xf0, 0x6d, 0xd0, 0x8f, 0xbd,
+ 0xa8, 0x61, 0x9e, 0xe7, 0xe7, 0xf3, 0x49, 0xa3, 0x4f, 0xed, 0x97, 0x55, 0x2f, 0x6a, 0x20, 0xae,
+ 0x19, 0xbe, 0x00, 0xc6, 0x1a, 0xd6, 0x21, 0x4b, 0x02, 0x98, 0x84, 0xec, 0xea, 0x3b, 0xc5, 0xe7,
+ 0x3d, 0xc9, 0xca, 0xea, 0x0d, 0x9d, 0x81, 0xd2, 0x72, 0x7c, 0xa0, 0xe3, 0x69, 0x03, 0xa7, 0xb5,
+ 0x81, 0x3a, 0x03, 0xa5, 0xe5, 0x98, 0x93, 0x09, 0xbe, 0x17, 0x39, 0x04, 0xdb, 0xe6, 0xff, 0xf0,
+ 0x4a, 0x5c, 0x76, 0x9c, 0x05, 0x0d, 0x29, 0x2e, 0xbc, 0x17, 0x37, 0x41, 0x4c, 0xbe, 0xf9, 0xb6,
+ 0x7a, 0x96, 0xba, 0x37, 0xc9, 0x12, 0x21, 0xd6, 0x91, 0x38, 0x55, 0xf4, 0xf6, 0x07, 0xf4, 0xc0,
+ 0x80, 0xe5, 0xba, 0x9b, 0x35, 0xf3, 0xc2, 0x49, 0x2b, 0xa2, 0xec, 0x69, 0xa1, 0x32, 0xcc, 0x12,
+ 0xd3, 0x8f, 0x04, 0x0c, 0xc3, 0xf3, 0x3d, 0x16, 0x0b, 0x33, 0xa7, 0x86, 0xb7, 0xc9, 0xf4, 0x23,
+ 0x01, 0xc3, 0xe7, 0xe7, 0x1d, 0x6d, 0xd6, 0xcc, 0xc7, 0x4e, 0x6f, 0x7e, 0x4c, 0x3f, 0x12, 0x30,
+ 0xd0, 0x06, 0x7d, 0x9e, 0x1f, 0x9a, 0x17, 0x7b, 0x7d, 0xf6, 0xf2, 0xd3, 0xe4, 0x96, 0x1f, 0x22,
+ 0xa6, 0x1e, 0xfe, 0xd0, 0x00, 0x20, 0x48, 0x22, 0xf1, 0xd2, 0x49, 0x9b, 0x12, 0x19, 0xb4, 0x52,
+ 0x12, 0xbd, 0xab, 0x5e, 0x48, 0x8e, 0x92, 0x9b, 0x96, 0x16, 0xe5, 0x9a, 0x01, 0xf0, 0x67, 0x06,
+ 0x38, 0xaf, 0x17, 0xe0, 0xca, 0xb2, 0x59, 0xee, 0x87, 0xcd, 0x1e, 0x06, 0x72, 0xd9, 0xf7, 0xdd,
+ 0xb2, 0xd9, 0x6a, 0x16, 0xce, 0x2f, 0x75, 0x00, 0x44, 0x1d, 0xcd, 0x80, 0xbf, 0x32, 0xc0, 0xa4,
+ 0xcc, 0x8e, 0x9a, 0x71, 0x05, 0xee, 0xb6, 0xb7, 0x7b, 0xe8, 0xb6, 0x2c, 0x84, 0xf0, 0x9e, 0xfa,
+ 0xee, 0xd9, 0xc6, 0x47, 0xed, 0x56, 0xc1, 0xdf, 0x1a, 0x60, 0xd4, 0xc6, 0x01, 0xf6, 0x6c, 0xec,
+ 0x55, 0x99, 0x99, 0x73, 0x27, 0xed, 0x74, 0x64, 0xcd, 0x5c, 0xd1, 0xb4, 0x0b, 0x0b, 0x4b, 0xd2,
+ 0xc2, 0x51, 0x9d, 0x75, 0xdc, 0x2c, 0x4c, 0x27, 0x43, 0x75, 0x0e, 0x4a, 0x19, 0x08, 0x7f, 0x64,
+ 0x80, 0xf1, 0xc4, 0xed, 0xe2, 0x80, 0xb8, 0x7c, 0x3a, 0x0b, 0xcf, 0x4b, 0xd0, 0xa5, 0x34, 0x16,
+ 0xca, 0x82, 0xc3, 0x5f, 0x1b, 0xac, 0xda, 0x8a, 0x6f, 0x8f, 0xd4, 0x2c, 0x72, 0x0f, 0xbe, 0xd1,
+ 0x4b, 0x0f, 0x2a, 0xe5, 0xc2, 0x81, 0xd7, 0x92, 0x4a, 0x4e, 0x71, 0x8e, 0x9b, 0x85, 0x29, 0xdd,
+ 0x7f, 0x8a, 0x81, 0x74, 0xe3, 0xe0, 0x7b, 0x06, 0x18, 0xc5, 0x49, 0xc1, 0x4c, 0xcd, 0x2b, 0x27,
+ 0x75, 0x5d, 0xc7, 0xf2, 0x5b, 0x5c, 0xf0, 0x35, 0x16, 0x45, 0x29, 0x58, 0x56, 0xfb, 0xe1, 0x43,
+ 0xab, 0x11, 0xb8, 0xd8, 0xfc, 0xdf, 0xde, 0xd5, 0x7e, 0xab, 0x42, 0x25, 0x8a, 0x75, 0xc3, 0x6b,
+ 0x20, 0xef, 0x45, 0xae, 0xcb, 0xae, 0xc3, 0xe6, 0xe3, 0xbc, 0x8a, 0x50, 0x1d, 0xcf, 0x5b, 0x92,
+ 0x8e, 0x94, 0x04, 0xac, 0x81, 0xb9, 0xc3, 0x9b, 0xd1, 0x0e, 0x26, 0x1e, 0x0e, 0x31, 0xed, 0xd8,
+ 0x52, 0x34, 0xaf, 0x72, 0x2d, 0x33, 0xad, 0x66, 0x61, 0x7a, 0xbb, 0x73, 0xd3, 0xf1, 0x81, 0x3a,
+ 0xe0, 0x9b, 0xe0, 0x31, 0x4d, 0x66, 0xb5, 0xb1, 0x83, 0x6d, 0x1b, 0xdb, 0xf1, 0x45, 0xcb, 0xfc,
+ 0x3f, 0x0e, 0xa1, 0xf6, 0xf1, 0x76, 0x56, 0x00, 0xdd, 0x6f, 0x34, 0x5c, 0x07, 0xd3, 0x1a, 0x7b,
+ 0xcd, 0x0b, 0x37, 0x49, 0x25, 0x24, 0x8e, 0x57, 0x37, 0xe7, 0xb9, 0xde, 0xf3, 0xf1, 0xee, 0xdb,
+ 0xd6, 0x78, 0xa8, 0xcb, 0x18, 0xf8, 0x4a, 0x4a, 0x1b, 0xff, 0x94, 0x62, 0x05, 0x37, 0xf1, 0x11,
+ 0x35, 0x9f, 0xe0, 0xc5, 0x05, 0x5f, 0xe7, 0x6d, 0x8d, 0x8e, 0xba, 0xc8, 0xc3, 0x97, 0xc0, 0xb9,
+ 0x0c, 0x87, 0xdd, 0x2b, 0xcc, 0x27, 0xc5, 0x05, 0x81, 0x55, 0xa2, 0xdb, 0x31, 0x11, 0x75, 0x92,
+ 0x84, 0x5f, 0x05, 0x50, 0x23, 0x6f, 0x58, 0x01, 0x1f, 0xff, 0x94, 0xb8, 0xab, 0xb0, 0x15, 0xdd,
+ 0x96, 0x34, 0xd4, 0x41, 0x0e, 0x7e, 0x68, 0xa4, 0x66, 0x92, 0xdc, 0x66, 0xa9, 0x79, 0x8d, 0x6f,
+ 0xd8, 0x57, 0x1e, 0x3d, 0x00, 0x13, 0x65, 0x28, 0x72, 0xb1, 0xe6, 0x61, 0x0d, 0x05, 0x75, 0x41,
+ 0x9f, 0x61, 0x97, 0xe9, 0x4c, 0x0e, 0x87, 0x13, 0xa0, 0x6f, 0x0f, 0xcb, 0x0f, 0xd9, 0x88, 0xfd,
+ 0x84, 0x6f, 0x81, 0x81, 0x7d, 0xcb, 0x8d, 0xe2, 0x56, 0x40, 0xef, 0xce, 0x7a, 0x24, 0xf4, 0xbe,
+ 0x98, 0xbb, 0x6e, 0xcc, 0x7c, 0x60, 0x80, 0xe9, 0xce, 0xa7, 0xca, 0x17, 0x65, 0xd1, 0x4f, 0x0d,
+ 0x30, 0xd9, 0x76, 0x80, 0x74, 0x30, 0xc6, 0x4d, 0x1b, 0x73, 0xb7, 0x87, 0x27, 0x81, 0xd8, 0x08,
+ 0xbc, 0xa2, 0xd5, 0x2d, 0xfb, 0x81, 0x01, 0x26, 0xb2, 0x89, 0xf9, 0x0b, 0xf2, 0x52, 0xf1, 0xfd,
+ 0x1c, 0x98, 0xee, 0x5c, 0x83, 0xc3, 0x86, 0xea, 0x2e, 0xf4, 0xbc, 0x41, 0xd3, 0xa9, 0x89, 0xfc,
+ 0xae, 0x01, 0x46, 0xde, 0x51, 0x72, 0xf1, 0xf7, 0xd5, 0x5e, 0x76, 0x85, 0xe2, 0xa3, 0x2f, 0x61,
+ 0x50, 0xa4, 0x43, 0x16, 0x7f, 0x63, 0x80, 0xa9, 0x8e, 0xc7, 0x39, 0xbc, 0x0a, 0x06, 0x2d, 0xd7,
+ 0xf5, 0x0f, 0x44, 0x37, 0x4f, 0xfb, 0x50, 0xb0, 0xc4, 0xa9, 0x48, 0x72, 0x35, 0x9f, 0xe5, 0x3e,
+ 0x07, 0x9f, 0x15, 0x7f, 0x6f, 0x80, 0x8b, 0xf7, 0x8b, 0xba, 0xcf, 0x7b, 0x0d, 0xe7, 0x41, 0x5e,
+ 0x16, 0xdb, 0x47, 0x7c, 0xfd, 0x64, 0x76, 0x95, 0x19, 0x81, 0xbf, 0xdf, 0x11, 0xbf, 0x8a, 0x2f,
+ 0x81, 0xf1, 0x4c, 0x03, 0x3a, 0xf5, 0xa4, 0xc7, 0x78, 0xe0, 0x93, 0x9e, 0x5f, 0x18, 0x60, 0xa2,
+ 0x82, 0xc9, 0xbe, 0x53, 0xc5, 0x08, 0xd7, 0x30, 0xc1, 0x5e, 0x15, 0xc3, 0x05, 0x30, 0xcc, 0x3f,
+ 0xa0, 0x06, 0x56, 0x35, 0xfe, 0xec, 0x33, 0x29, 0x75, 0x0c, 0xdf, 0x8a, 0x19, 0x28, 0x91, 0x51,
+ 0x9f, 0x88, 0x72, 0x5d, 0x3f, 0x11, 0x5d, 0x04, 0xfd, 0x41, 0xd2, 0x41, 0xce, 0x33, 0x2e, 0xb7,
+ 0x84, 0x53, 0x39, 0xd7, 0x27, 0x21, 0x6f, 0x93, 0x0d, 0x48, 0xae, 0x4f, 0x42, 0xc4, 0xa9, 0xc5,
+ 0x3f, 0xe6, 0xc0, 0xd9, 0x74, 0x82, 0x67, 0x80, 0x24, 0x72, 0xdb, 0xbe, 0x49, 0x31, 0x1e, 0xe2,
+ 0x1c, 0xfd, 0x29, 0x44, 0xee, 0xfe, 0x4f, 0x21, 0xe0, 0xcb, 0x60, 0x52, 0xfe, 0x5c, 0x3d, 0x0c,
+ 0x08, 0xa6, 0xfc, 0x63, 0x6b, 0x5f, 0xfa, 0x09, 0xe3, 0x46, 0x56, 0x00, 0xb5, 0x8f, 0x81, 0x5f,
+ 0xc9, 0x3c, 0xd3, 0xb8, 0x92, 0x3c, 0xd1, 0x60, 0xc5, 0x21, 0x5f, 0x9f, 0xbb, 0x2c, 0x67, 0xac,
+ 0x12, 0xe2, 0x93, 0xcc, 0xdb, 0x8d, 0x05, 0x30, 0x5c, 0x63, 0x02, 0x7c, 0xe1, 0x06, 0xd2, 0x4e,
+ 0xbf, 0x11, 0x33, 0x50, 0x22, 0x03, 0xbf, 0x06, 0xc6, 0xfd, 0x40, 0x94, 0xc1, 0x9b, 0xae, 0x5d,
+ 0xc1, 0x6e, 0x8d, 0xb7, 0x04, 0xf3, 0x71, 0xdf, 0x36, 0xc5, 0x42, 0x59, 0xd9, 0xe2, 0x1f, 0x0c,
+ 0x70, 0x2e, 0x7e, 0x1f, 0xe5, 0x3a, 0xd8, 0x0b, 0x97, 0x7d, 0xaf, 0xe6, 0xd4, 0xe1, 0x05, 0xd1,
+ 0x7f, 0xd5, 0x9a, 0x9a, 0x71, 0xef, 0x15, 0xde, 0x03, 0x43, 0x54, 0xc4, 0x8a, 0xdc, 0x07, 0xaf,
+ 0x9e, 0xe4, 0x83, 0x4a, 0x3a, 0xe8, 0x44, 0xf9, 0x18, 0x53, 0x63, 0x1c, 0xb6, 0x15, 0xaa, 0x56,
+ 0x39, 0xf2, 0x6c, 0xd9, 0x83, 0x1f, 0x15, 0x5b, 0x61, 0x79, 0x49, 0xd0, 0x90, 0xe2, 0x16, 0xff,
+ 0x6e, 0x80, 0xc9, 0xb6, 0xf7, 0x5e, 0xf0, 0xbb, 0x06, 0x18, 0xad, 0x6a, 0xd3, 0x93, 0x09, 0x65,
+ 0xe3, 0xe4, 0x6f, 0xca, 0x34, 0xa5, 0xa2, 0x06, 0xd3, 0x29, 0x28, 0x05, 0x0a, 0xb7, 0x81, 0x59,
+ 0xcd, 0x3c, 0xad, 0xcc, 0x7c, 0xac, 0xbd, 0xd8, 0x6a, 0x16, 0xcc, 0xe5, 0x2e, 0x32, 0xa8, 0xeb,
+ 0xe8, 0xf2, 0x37, 0x3f, 0xfe, 0x6c, 0xf6, 0xcc, 0x27, 0x9f, 0xcd, 0x9e, 0xf9, 0xf4, 0xb3, 0xd9,
+ 0x33, 0xef, 0xb6, 0x66, 0x8d, 0x8f, 0x5b, 0xb3, 0xc6, 0x27, 0xad, 0x59, 0xe3, 0xd3, 0xd6, 0xac,
+ 0xf1, 0x97, 0xd6, 0xac, 0xf1, 0xe3, 0xbf, 0xce, 0x9e, 0x79, 0xe3, 0xfa, 0xa3, 0x3e, 0xa8, 0xfe,
+ 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x1c, 0x7a, 0x10, 0x8b, 0x2d, 0x00, 0x00,
}
func (m *ConversionRequest) Marshal() (dAtA []byte, err error) {
@@ -1618,6 +1648,20 @@ func (m *CustomResourceDefinitionVersion) MarshalToSizedBuffer(dAtA []byte) (int
_ = i
var l int
_ = l
+ if len(m.SelectableFields) > 0 {
+ for iNdEx := len(m.SelectableFields) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.SelectableFields[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x4a
+ }
+ }
if m.DeprecationWarning != nil {
i -= len(*m.DeprecationWarning)
copy(dAtA[i:], *m.DeprecationWarning)
@@ -2570,6 +2614,34 @@ func (m *JSONSchemaPropsOrStringArray) MarshalToSizedBuffer(dAtA []byte) (int, e
return len(dAtA) - i, nil
}
+func (m *SelectableField) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *SelectableField) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *SelectableField) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.JSONPath)
+ copy(dAtA[i:], m.JSONPath)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.JSONPath)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *ServiceReference) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -3027,6 +3099,12 @@ func (m *CustomResourceDefinitionVersion) Size() (n int) {
l = len(*m.DeprecationWarning)
n += 1 + l + sovGenerated(uint64(l))
}
+ if len(m.SelectableFields) > 0 {
+ for _, e := range m.SelectableFields {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
return n
}
@@ -3341,6 +3419,17 @@ func (m *JSONSchemaPropsOrStringArray) Size() (n int) {
return n
}
+func (m *SelectableField) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.JSONPath)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
func (m *ServiceReference) Size() (n int) {
if m == nil {
return 0
@@ -3605,6 +3694,11 @@ func (this *CustomResourceDefinitionVersion) String() string {
repeatedStringForAdditionalPrinterColumns += strings.Replace(strings.Replace(f.String(), "CustomResourceColumnDefinition", "CustomResourceColumnDefinition", 1), `&`, ``, 1) + ","
}
repeatedStringForAdditionalPrinterColumns += "}"
+ repeatedStringForSelectableFields := "[]SelectableField{"
+ for _, f := range this.SelectableFields {
+ repeatedStringForSelectableFields += strings.Replace(strings.Replace(f.String(), "SelectableField", "SelectableField", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForSelectableFields += "}"
s := strings.Join([]string{`&CustomResourceDefinitionVersion{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Served:` + fmt.Sprintf("%v", this.Served) + `,`,
@@ -3614,6 +3708,7 @@ func (this *CustomResourceDefinitionVersion) String() string {
`AdditionalPrinterColumns:` + repeatedStringForAdditionalPrinterColumns + `,`,
`Deprecated:` + fmt.Sprintf("%v", this.Deprecated) + `,`,
`DeprecationWarning:` + valueToStringGenerated(this.DeprecationWarning) + `,`,
+ `SelectableFields:` + repeatedStringForSelectableFields + `,`,
`}`,
}, "")
return s
@@ -3837,6 +3932,16 @@ func (this *JSONSchemaPropsOrStringArray) String() string {
}, "")
return s
}
+func (this *SelectableField) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&SelectableField{`,
+ `JSONPath:` + fmt.Sprintf("%v", this.JSONPath) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *ServiceReference) String() string {
if this == nil {
return "nil"
@@ -6027,6 +6132,40 @@ func (m *CustomResourceDefinitionVersion) Unmarshal(dAtA []byte) error {
s := string(dAtA[iNdEx:postIndex])
m.DeprecationWarning = &s
iNdEx = postIndex
+ case 9:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SelectableFields", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.SelectableFields = append(m.SelectableFields, SelectableField{})
+ if err := m.SelectableFields[len(m.SelectableFields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -8667,6 +8806,88 @@ func (m *JSONSchemaPropsOrStringArray) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *SelectableField) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: SelectableField: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: SelectableField: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field JSONPath", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.JSONPath = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *ServiceReference) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto
index 3c39d63a5f2..1bbd0ce13e1 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto
@@ -40,7 +40,8 @@ message ConversionRequest {
optional string desiredAPIVersion = 2;
// objects is the list of custom resource objects to be converted.
- repeated k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3;
+ // +listType=atomic
+ repeated .k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3;
}
// ConversionResponse describes a conversion response.
@@ -53,14 +54,15 @@ message ConversionResponse {
// The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list
// must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace).
// The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored.
- repeated k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2;
+ // +listType=atomic
+ repeated .k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2;
// result contains the result of conversion with extra details if the conversion failed. `result.status` determines if
// the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the
// conversion. A successful conversion must set `result.status` to `Success`. A failed conversion must set
// `result.status` to `Failure` and provide more details in `result.message` and return http status 200. The `result.message`
// will be used to construct an error message for the end user.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3;
}
// ConversionReview describes a conversion request/response.
@@ -123,7 +125,7 @@ message CustomResourceDefinition {
// Standard object's metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec describes how the user wants the resources to appear
optional CustomResourceDefinitionSpec spec = 2;
@@ -144,7 +146,7 @@ message CustomResourceDefinitionCondition {
// lastTransitionTime last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// reason is a unique, one-word, CamelCase reason for the condition's last transition.
// +optional
@@ -160,7 +162,7 @@ message CustomResourceDefinitionList {
// Standard object's metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items list individual CustomResourceDefinition objects
repeated CustomResourceDefinition items = 2;
@@ -182,6 +184,7 @@ message CustomResourceDefinitionNames {
// and used by clients to support invocations like `kubectl get `.
// It must be all lowercase.
// +optional
+ // +listType=atomic
repeated string shortNames = 3;
// kind is the serialized kind of the resource. It is normally CamelCase and singular.
@@ -196,6 +199,7 @@ message CustomResourceDefinitionNames {
// This is published in API discovery documents, and used by clients to support invocations like
// `kubectl get all`.
// +optional
+ // +listType=atomic
repeated string categories = 6;
}
@@ -221,6 +225,7 @@ message CustomResourceDefinitionSpec {
// by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing
// major version, then minor version. An example sorted list of versions:
// v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
+ // +listType=atomic
repeated CustomResourceDefinitionVersion versions = 7;
// conversion defines conversion settings for the CRD.
@@ -256,6 +261,7 @@ message CustomResourceDefinitionStatus {
// versions from this list.
// Versions may not be removed from `spec.versions` while they exist in this list.
// +optional
+ // +listType=atomic
repeated string storedVersions = 3;
}
@@ -297,7 +303,17 @@ message CustomResourceDefinitionVersion {
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.
// If no columns are specified, a single column displaying the age of the custom resource is used.
// +optional
+ // +listType=atomic
repeated CustomResourceColumnDefinition additionalPrinterColumns = 6;
+
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // A maximum of 8 selectable fields are allowed.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ //
+ // +featureGate=CustomResourceFieldSelectors
+ // +optional
+ // +listType=atomic
+ repeated SelectableField selectableFields = 9;
}
// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.
@@ -439,20 +455,25 @@ message JSONSchemaProps {
optional double multipleOf = 19;
+ // +listType=atomic
repeated JSON enum = 20;
optional int64 maxProperties = 21;
optional int64 minProperties = 22;
+ // +listType=atomic
repeated string required = 23;
optional JSONSchemaPropsOrArray items = 24;
+ // +listType=atomic
repeated JSONSchemaProps allOf = 25;
+ // +listType=atomic
repeated JSONSchemaProps oneOf = 26;
+ // +listType=atomic
repeated JSONSchemaProps anyOf = 27;
optional JSONSchemaProps not = 28;
@@ -518,6 +539,7 @@ message JSONSchemaProps {
// to ensure those properties are present for all list items.
//
// +optional
+ // +listType=atomic
repeated string xKubernetesListMapKeys = 41;
// x-kubernetes-list-type annotates an array to further describe its topology.
@@ -551,7 +573,6 @@ message JSONSchemaProps {
optional string xKubernetesMapType = 43;
// x-kubernetes-validations describes a list of validation rules written in the CEL expression language.
- // This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled.
// +patchMergeKey=rule
// +patchStrategy=merge
// +listType=map
@@ -564,6 +585,7 @@ message JSONSchemaProps {
message JSONSchemaPropsOrArray {
optional JSONSchemaProps schema = 1;
+ // +listType=atomic
repeated JSONSchemaProps jSONSchemas = 2;
}
@@ -579,9 +601,23 @@ message JSONSchemaPropsOrBool {
message JSONSchemaPropsOrStringArray {
optional JSONSchemaProps schema = 1;
+ // +listType=atomic
repeated string property = 2;
}
+// SelectableField specifies the JSON path of a field that may be used with field selectors.
+message SelectableField {
+ // jsonPath is a simple JSON path which is evaluated against each custom resource to produce a
+ // field selector value.
+ // Only JSON paths without the array notation are allowed.
+ // Must point to a field of type string, boolean or integer. Types with enum values
+ // and strings with formats are allowed.
+ // If jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string.
+ // Must not point to metdata fields.
+ // Required.
+ optional string jsonPath = 1;
+}
+
// ServiceReference holds a reference to Service.legacy.k8s.io
message ServiceReference {
// namespace is the namespace of the service.
@@ -787,6 +823,7 @@ message WebhookConversion {
// are supported by API server, conversion will fail for the custom resource.
// If a persisted Webhook configuration specifies allowed versions and does not
// include any versions known to the API Server, calls to the webhook will fail.
+ // +listType=atomic
repeated string conversionReviewVersions = 3;
}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/marshal.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/marshal.go
index 12cc2f6f2c9..321bec385c5 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/marshal.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/marshal.go
@@ -130,7 +130,7 @@ func (s JSON) MarshalJSON() ([]byte, error) {
func (s *JSON) UnmarshalJSON(data []byte) error {
if len(data) > 0 && !bytes.Equal(data, nullLiteral) {
- s.Raw = data
+ s.Raw = append(s.Raw[0:0], data...)
}
return nil
}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go
index 59ec0e372b8..212cea6f696 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go
@@ -56,6 +56,7 @@ type CustomResourceDefinitionSpec struct {
// by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing
// major version, then minor version. An example sorted list of versions:
// v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
+ // +listType=atomic
Versions []CustomResourceDefinitionVersion `json:"versions" protobuf:"bytes,7,rep,name=versions"`
// conversion defines conversion settings for the CRD.
@@ -96,6 +97,7 @@ type WebhookConversion struct {
// are supported by API server, conversion will fail for the custom resource.
// If a persisted Webhook configuration specifies allowed versions and does not
// include any versions known to the API Server, calls to the webhook will fail.
+ // +listType=atomic
ConversionReviewVersions []string `json:"conversionReviewVersions" protobuf:"bytes,3,rep,name=conversionReviewVersions"`
}
@@ -195,7 +197,30 @@ type CustomResourceDefinitionVersion struct {
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.
// If no columns are specified, a single column displaying the age of the custom resource is used.
// +optional
+ // +listType=atomic
AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,6,rep,name=additionalPrinterColumns"`
+
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // A maximum of 8 selectable fields are allowed.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ //
+ // +featureGate=CustomResourceFieldSelectors
+ // +optional
+ // +listType=atomic
+ SelectableFields []SelectableField `json:"selectableFields,omitempty" protobuf:"bytes,9,rep,name=selectableFields"`
+}
+
+// SelectableField specifies the JSON path of a field that may be used with field selectors.
+type SelectableField struct {
+ // jsonPath is a simple JSON path which is evaluated against each custom resource to produce a
+ // field selector value.
+ // Only JSON paths without the array notation are allowed.
+ // Must point to a field of type string, boolean or integer. Types with enum values
+ // and strings with formats are allowed.
+ // If jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string.
+ // Must not point to metdata fields.
+ // Required.
+ JSONPath string `json:"jsonPath" protobuf:"bytes,1,opt,name=jsonPath"`
}
// CustomResourceColumnDefinition specifies a column for server side printing.
@@ -237,6 +262,7 @@ type CustomResourceDefinitionNames struct {
// and used by clients to support invocations like `kubectl get `.
// It must be all lowercase.
// +optional
+ // +listType=atomic
ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,3,opt,name=shortNames"`
// kind is the serialized kind of the resource. It is normally CamelCase and singular.
// Custom resource instances will use this value as the `kind` attribute in API calls.
@@ -248,6 +274,7 @@ type CustomResourceDefinitionNames struct {
// This is published in API discovery documents, and used by clients to support invocations like
// `kubectl get all`.
// +optional
+ // +listType=atomic
Categories []string `json:"categories,omitempty" protobuf:"bytes,6,rep,name=categories"`
}
@@ -345,6 +372,7 @@ type CustomResourceDefinitionStatus struct {
// versions from this list.
// Versions may not be removed from `spec.versions` while they exist in this list.
// +optional
+ // +listType=atomic
StoredVersions []string `json:"storedVersions" protobuf:"bytes,3,rep,name=storedVersions"`
}
@@ -355,6 +383,7 @@ const CustomResourceCleanupFinalizer = "customresourcecleanup.apiextensions.k8s.
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.16
// CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format
// <.spec.name>.<.spec.group>.
@@ -373,6 +402,7 @@ type CustomResourceDefinition struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.16
// CustomResourceDefinitionList is a list of CustomResourceDefinition objects.
type CustomResourceDefinitionList struct {
@@ -441,6 +471,7 @@ type CustomResourceSubresourceScale struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:prerelease-lifecycle-gen:introduced=1.16
// ConversionReview describes a conversion request/response.
type ConversionReview struct {
@@ -463,6 +494,7 @@ type ConversionRequest struct {
// desiredAPIVersion is the version to convert given objects to. e.g. "myapi.example.com/v1"
DesiredAPIVersion string `json:"desiredAPIVersion" protobuf:"bytes,2,name=desiredAPIVersion"`
// objects is the list of custom resource objects to be converted.
+ // +listType=atomic
Objects []runtime.RawExtension `json:"objects" protobuf:"bytes,3,rep,name=objects"`
}
@@ -475,6 +507,7 @@ type ConversionResponse struct {
// The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list
// must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace).
// The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored.
+ // +listType=atomic
ConvertedObjects []runtime.RawExtension `json:"convertedObjects" protobuf:"bytes,2,rep,name=convertedObjects"`
// result contains the result of conversion with extra details if the conversion failed. `result.status` determines if
// the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go
index a81451ad6ef..197bd1b7a88 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types_jsonschema.go
@@ -76,25 +76,30 @@ type JSONSchemaProps struct {
// default is a default value for undefined object fields.
// Defaulting is a beta feature under the CustomResourceDefaulting feature gate.
// Defaulting requires spec.preserveUnknownFields to be false.
- Default *JSON `json:"default,omitempty" protobuf:"bytes,8,opt,name=default"`
- Maximum *float64 `json:"maximum,omitempty" protobuf:"bytes,9,opt,name=maximum"`
- ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty" protobuf:"bytes,10,opt,name=exclusiveMaximum"`
- Minimum *float64 `json:"minimum,omitempty" protobuf:"bytes,11,opt,name=minimum"`
- ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty" protobuf:"bytes,12,opt,name=exclusiveMinimum"`
- MaxLength *int64 `json:"maxLength,omitempty" protobuf:"bytes,13,opt,name=maxLength"`
- MinLength *int64 `json:"minLength,omitempty" protobuf:"bytes,14,opt,name=minLength"`
- Pattern string `json:"pattern,omitempty" protobuf:"bytes,15,opt,name=pattern"`
- MaxItems *int64 `json:"maxItems,omitempty" protobuf:"bytes,16,opt,name=maxItems"`
- MinItems *int64 `json:"minItems,omitempty" protobuf:"bytes,17,opt,name=minItems"`
- UniqueItems bool `json:"uniqueItems,omitempty" protobuf:"bytes,18,opt,name=uniqueItems"`
- MultipleOf *float64 `json:"multipleOf,omitempty" protobuf:"bytes,19,opt,name=multipleOf"`
- Enum []JSON `json:"enum,omitempty" protobuf:"bytes,20,rep,name=enum"`
- MaxProperties *int64 `json:"maxProperties,omitempty" protobuf:"bytes,21,opt,name=maxProperties"`
- MinProperties *int64 `json:"minProperties,omitempty" protobuf:"bytes,22,opt,name=minProperties"`
- Required []string `json:"required,omitempty" protobuf:"bytes,23,rep,name=required"`
- Items *JSONSchemaPropsOrArray `json:"items,omitempty" protobuf:"bytes,24,opt,name=items"`
- AllOf []JSONSchemaProps `json:"allOf,omitempty" protobuf:"bytes,25,rep,name=allOf"`
- OneOf []JSONSchemaProps `json:"oneOf,omitempty" protobuf:"bytes,26,rep,name=oneOf"`
+ Default *JSON `json:"default,omitempty" protobuf:"bytes,8,opt,name=default"`
+ Maximum *float64 `json:"maximum,omitempty" protobuf:"bytes,9,opt,name=maximum"`
+ ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty" protobuf:"bytes,10,opt,name=exclusiveMaximum"`
+ Minimum *float64 `json:"minimum,omitempty" protobuf:"bytes,11,opt,name=minimum"`
+ ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty" protobuf:"bytes,12,opt,name=exclusiveMinimum"`
+ MaxLength *int64 `json:"maxLength,omitempty" protobuf:"bytes,13,opt,name=maxLength"`
+ MinLength *int64 `json:"minLength,omitempty" protobuf:"bytes,14,opt,name=minLength"`
+ Pattern string `json:"pattern,omitempty" protobuf:"bytes,15,opt,name=pattern"`
+ MaxItems *int64 `json:"maxItems,omitempty" protobuf:"bytes,16,opt,name=maxItems"`
+ MinItems *int64 `json:"minItems,omitempty" protobuf:"bytes,17,opt,name=minItems"`
+ UniqueItems bool `json:"uniqueItems,omitempty" protobuf:"bytes,18,opt,name=uniqueItems"`
+ MultipleOf *float64 `json:"multipleOf,omitempty" protobuf:"bytes,19,opt,name=multipleOf"`
+ // +listType=atomic
+ Enum []JSON `json:"enum,omitempty" protobuf:"bytes,20,rep,name=enum"`
+ MaxProperties *int64 `json:"maxProperties,omitempty" protobuf:"bytes,21,opt,name=maxProperties"`
+ MinProperties *int64 `json:"minProperties,omitempty" protobuf:"bytes,22,opt,name=minProperties"`
+ // +listType=atomic
+ Required []string `json:"required,omitempty" protobuf:"bytes,23,rep,name=required"`
+ Items *JSONSchemaPropsOrArray `json:"items,omitempty" protobuf:"bytes,24,opt,name=items"`
+ // +listType=atomic
+ AllOf []JSONSchemaProps `json:"allOf,omitempty" protobuf:"bytes,25,rep,name=allOf"`
+ // +listType=atomic
+ OneOf []JSONSchemaProps `json:"oneOf,omitempty" protobuf:"bytes,26,rep,name=oneOf"`
+ // +listType=atomic
AnyOf []JSONSchemaProps `json:"anyOf,omitempty" protobuf:"bytes,27,rep,name=anyOf"`
Not *JSONSchemaProps `json:"not,omitempty" protobuf:"bytes,28,opt,name=not"`
Properties map[string]JSONSchemaProps `json:"properties,omitempty" protobuf:"bytes,29,rep,name=properties"`
@@ -150,6 +155,7 @@ type JSONSchemaProps struct {
// to ensure those properties are present for all list items.
//
// +optional
+ // +listType=atomic
XListMapKeys []string `json:"x-kubernetes-list-map-keys,omitempty" protobuf:"bytes,41,rep,name=xKubernetesListMapKeys"`
// x-kubernetes-list-type annotates an array to further describe its topology.
@@ -183,7 +189,6 @@ type JSONSchemaProps struct {
XMapType *string `json:"x-kubernetes-map-type,omitempty" protobuf:"bytes,43,opt,name=xKubernetesMapType"`
// x-kubernetes-validations describes a list of validation rules written in the CEL expression language.
- // This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled.
// +patchMergeKey=rule
// +patchStrategy=merge
// +listType=map
@@ -343,7 +348,8 @@ type JSONSchemaURL string
// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps
// or an array of JSONSchemaProps. Mainly here for serialization purposes.
type JSONSchemaPropsOrArray struct {
- Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
+ Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
+ // +listType=atomic
JSONSchemas []JSONSchemaProps `protobuf:"bytes,2,rep,name=jSONSchemas"`
}
@@ -385,8 +391,9 @@ type JSONSchemaDependencies map[string]JSONSchemaPropsOrStringArray
// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array.
type JSONSchemaPropsOrStringArray struct {
- Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
- Property []string `protobuf:"bytes,2,rep,name=property"`
+ Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
+ // +listType=atomic
+ Property []string `protobuf:"bytes,2,rep,name=property"`
}
// OpenAPISchemaType is used by the kube-openapi generator when constructing
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go
index 405021bf389..bb1d7e01429 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go
@@ -192,6 +192,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddGeneratedConversionFunc((*SelectableField)(nil), (*apiextensions.SelectableField)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_SelectableField_To_apiextensions_SelectableField(a.(*SelectableField), b.(*apiextensions.SelectableField), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiextensions.SelectableField)(nil), (*SelectableField)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiextensions_SelectableField_To_v1_SelectableField(a.(*apiextensions.SelectableField), b.(*SelectableField), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddGeneratedConversionFunc((*ServiceReference)(nil), (*apiextensions.ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ServiceReference_To_apiextensions_ServiceReference(a.(*ServiceReference), b.(*apiextensions.ServiceReference), scope)
}); err != nil {
@@ -493,6 +503,7 @@ func autoConvert_apiextensions_CustomResourceDefinitionSpec_To_v1_CustomResource
out.Versions = nil
}
// WARNING: in.AdditionalPrinterColumns requires manual conversion: does not exist in peer-type
+ // WARNING: in.SelectableFields requires manual conversion: does not exist in peer-type
if in.Conversion != nil {
in, out := &in.Conversion, &out.Conversion
*out = new(CustomResourceConversion)
@@ -553,6 +564,7 @@ func autoConvert_v1_CustomResourceDefinitionVersion_To_apiextensions_CustomResou
}
out.Subresources = (*apiextensions.CustomResourceSubresources)(unsafe.Pointer(in.Subresources))
out.AdditionalPrinterColumns = *(*[]apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns))
+ out.SelectableFields = *(*[]apiextensions.SelectableField)(unsafe.Pointer(&in.SelectableFields))
return nil
}
@@ -578,6 +590,7 @@ func autoConvert_apiextensions_CustomResourceDefinitionVersion_To_v1_CustomResou
}
out.Subresources = (*CustomResourceSubresources)(unsafe.Pointer(in.Subresources))
out.AdditionalPrinterColumns = *(*[]CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns))
+ out.SelectableFields = *(*[]SelectableField)(unsafe.Pointer(&in.SelectableFields))
return nil
}
@@ -1225,6 +1238,26 @@ func Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1_JSONSchemaPropsOrS
return autoConvert_apiextensions_JSONSchemaPropsOrStringArray_To_v1_JSONSchemaPropsOrStringArray(in, out, s)
}
+func autoConvert_v1_SelectableField_To_apiextensions_SelectableField(in *SelectableField, out *apiextensions.SelectableField, s conversion.Scope) error {
+ out.JSONPath = in.JSONPath
+ return nil
+}
+
+// Convert_v1_SelectableField_To_apiextensions_SelectableField is an autogenerated conversion function.
+func Convert_v1_SelectableField_To_apiextensions_SelectableField(in *SelectableField, out *apiextensions.SelectableField, s conversion.Scope) error {
+ return autoConvert_v1_SelectableField_To_apiextensions_SelectableField(in, out, s)
+}
+
+func autoConvert_apiextensions_SelectableField_To_v1_SelectableField(in *apiextensions.SelectableField, out *SelectableField, s conversion.Scope) error {
+ out.JSONPath = in.JSONPath
+ return nil
+}
+
+// Convert_apiextensions_SelectableField_To_v1_SelectableField is an autogenerated conversion function.
+func Convert_apiextensions_SelectableField_To_v1_SelectableField(in *apiextensions.SelectableField, out *SelectableField, s conversion.Scope) error {
+ return autoConvert_apiextensions_SelectableField_To_v1_SelectableField(in, out, s)
+}
+
func autoConvert_v1_ServiceReference_To_apiextensions_ServiceReference(in *ServiceReference, out *apiextensions.ServiceReference, s conversion.Scope) error {
out.Namespace = in.Namespace
out.Name = in.Name
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go
index bc23fcd86ff..f85a0b0677d 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go
@@ -329,6 +329,11 @@ func (in *CustomResourceDefinitionVersion) DeepCopyInto(out *CustomResourceDefin
*out = make([]CustomResourceColumnDefinition, len(*in))
copy(*out, *in)
}
+ if in.SelectableFields != nil {
+ in, out := &in.SelectableFields, &out.SelectableFields
+ *out = make([]SelectableField, len(*in))
+ copy(*out, *in)
+ }
return
}
@@ -585,6 +590,22 @@ func (in *JSONSchemaPropsOrStringArray) DeepCopy() *JSONSchemaPropsOrStringArray
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SelectableField) DeepCopyInto(out *SelectableField) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectableField.
+func (in *SelectableField) DeepCopy() *SelectableField {
+ if in == nil {
+ return nil
+ }
+ out := new(SelectableField)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceReference) DeepCopyInto(out *ServiceReference) {
*out = *in
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.prerelease-lifecycle.go
new file mode 100644
index 00000000000..e3acc247c65
--- /dev/null
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.prerelease-lifecycle.go
@@ -0,0 +1,40 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by prerelease-lifecycle-gen. DO NOT EDIT.
+
+package v1
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *ConversionReview) APILifecycleIntroduced() (major, minor int) {
+ return 1, 16
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CustomResourceDefinition) APILifecycleIntroduced() (major, minor int) {
+ return 1, 16
+}
+
+// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
+// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+func (in *CustomResourceDefinitionList) APILifecycleIntroduced() (major, minor int) {
+ return 1, 16
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go
index c81fa6bc31b..32e58324071 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto
+// source: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto
package v1beta1
@@ -51,7 +51,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func (m *ConversionRequest) Reset() { *m = ConversionRequest{} }
func (*ConversionRequest) ProtoMessage() {}
func (*ConversionRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{0}
+ return fileDescriptor_3623d6c0bd238430, []int{0}
}
func (m *ConversionRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -79,7 +79,7 @@ var xxx_messageInfo_ConversionRequest proto.InternalMessageInfo
func (m *ConversionResponse) Reset() { *m = ConversionResponse{} }
func (*ConversionResponse) ProtoMessage() {}
func (*ConversionResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{1}
+ return fileDescriptor_3623d6c0bd238430, []int{1}
}
func (m *ConversionResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -107,7 +107,7 @@ var xxx_messageInfo_ConversionResponse proto.InternalMessageInfo
func (m *ConversionReview) Reset() { *m = ConversionReview{} }
func (*ConversionReview) ProtoMessage() {}
func (*ConversionReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{2}
+ return fileDescriptor_3623d6c0bd238430, []int{2}
}
func (m *ConversionReview) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -135,7 +135,7 @@ var xxx_messageInfo_ConversionReview proto.InternalMessageInfo
func (m *CustomResourceColumnDefinition) Reset() { *m = CustomResourceColumnDefinition{} }
func (*CustomResourceColumnDefinition) ProtoMessage() {}
func (*CustomResourceColumnDefinition) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{3}
+ return fileDescriptor_3623d6c0bd238430, []int{3}
}
func (m *CustomResourceColumnDefinition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -163,7 +163,7 @@ var xxx_messageInfo_CustomResourceColumnDefinition proto.InternalMessageInfo
func (m *CustomResourceConversion) Reset() { *m = CustomResourceConversion{} }
func (*CustomResourceConversion) ProtoMessage() {}
func (*CustomResourceConversion) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{4}
+ return fileDescriptor_3623d6c0bd238430, []int{4}
}
func (m *CustomResourceConversion) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -191,7 +191,7 @@ var xxx_messageInfo_CustomResourceConversion proto.InternalMessageInfo
func (m *CustomResourceDefinition) Reset() { *m = CustomResourceDefinition{} }
func (*CustomResourceDefinition) ProtoMessage() {}
func (*CustomResourceDefinition) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{5}
+ return fileDescriptor_3623d6c0bd238430, []int{5}
}
func (m *CustomResourceDefinition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -219,7 +219,7 @@ var xxx_messageInfo_CustomResourceDefinition proto.InternalMessageInfo
func (m *CustomResourceDefinitionCondition) Reset() { *m = CustomResourceDefinitionCondition{} }
func (*CustomResourceDefinitionCondition) ProtoMessage() {}
func (*CustomResourceDefinitionCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{6}
+ return fileDescriptor_3623d6c0bd238430, []int{6}
}
func (m *CustomResourceDefinitionCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -247,7 +247,7 @@ var xxx_messageInfo_CustomResourceDefinitionCondition proto.InternalMessageInfo
func (m *CustomResourceDefinitionList) Reset() { *m = CustomResourceDefinitionList{} }
func (*CustomResourceDefinitionList) ProtoMessage() {}
func (*CustomResourceDefinitionList) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{7}
+ return fileDescriptor_3623d6c0bd238430, []int{7}
}
func (m *CustomResourceDefinitionList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -275,7 +275,7 @@ var xxx_messageInfo_CustomResourceDefinitionList proto.InternalMessageInfo
func (m *CustomResourceDefinitionNames) Reset() { *m = CustomResourceDefinitionNames{} }
func (*CustomResourceDefinitionNames) ProtoMessage() {}
func (*CustomResourceDefinitionNames) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{8}
+ return fileDescriptor_3623d6c0bd238430, []int{8}
}
func (m *CustomResourceDefinitionNames) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -303,7 +303,7 @@ var xxx_messageInfo_CustomResourceDefinitionNames proto.InternalMessageInfo
func (m *CustomResourceDefinitionSpec) Reset() { *m = CustomResourceDefinitionSpec{} }
func (*CustomResourceDefinitionSpec) ProtoMessage() {}
func (*CustomResourceDefinitionSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{9}
+ return fileDescriptor_3623d6c0bd238430, []int{9}
}
func (m *CustomResourceDefinitionSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -331,7 +331,7 @@ var xxx_messageInfo_CustomResourceDefinitionSpec proto.InternalMessageInfo
func (m *CustomResourceDefinitionStatus) Reset() { *m = CustomResourceDefinitionStatus{} }
func (*CustomResourceDefinitionStatus) ProtoMessage() {}
func (*CustomResourceDefinitionStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{10}
+ return fileDescriptor_3623d6c0bd238430, []int{10}
}
func (m *CustomResourceDefinitionStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -359,7 +359,7 @@ var xxx_messageInfo_CustomResourceDefinitionStatus proto.InternalMessageInfo
func (m *CustomResourceDefinitionVersion) Reset() { *m = CustomResourceDefinitionVersion{} }
func (*CustomResourceDefinitionVersion) ProtoMessage() {}
func (*CustomResourceDefinitionVersion) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{11}
+ return fileDescriptor_3623d6c0bd238430, []int{11}
}
func (m *CustomResourceDefinitionVersion) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -387,7 +387,7 @@ var xxx_messageInfo_CustomResourceDefinitionVersion proto.InternalMessageInfo
func (m *CustomResourceSubresourceScale) Reset() { *m = CustomResourceSubresourceScale{} }
func (*CustomResourceSubresourceScale) ProtoMessage() {}
func (*CustomResourceSubresourceScale) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{12}
+ return fileDescriptor_3623d6c0bd238430, []int{12}
}
func (m *CustomResourceSubresourceScale) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -415,7 +415,7 @@ var xxx_messageInfo_CustomResourceSubresourceScale proto.InternalMessageInfo
func (m *CustomResourceSubresourceStatus) Reset() { *m = CustomResourceSubresourceStatus{} }
func (*CustomResourceSubresourceStatus) ProtoMessage() {}
func (*CustomResourceSubresourceStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{13}
+ return fileDescriptor_3623d6c0bd238430, []int{13}
}
func (m *CustomResourceSubresourceStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -443,7 +443,7 @@ var xxx_messageInfo_CustomResourceSubresourceStatus proto.InternalMessageInfo
func (m *CustomResourceSubresources) Reset() { *m = CustomResourceSubresources{} }
func (*CustomResourceSubresources) ProtoMessage() {}
func (*CustomResourceSubresources) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{14}
+ return fileDescriptor_3623d6c0bd238430, []int{14}
}
func (m *CustomResourceSubresources) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -471,7 +471,7 @@ var xxx_messageInfo_CustomResourceSubresources proto.InternalMessageInfo
func (m *CustomResourceValidation) Reset() { *m = CustomResourceValidation{} }
func (*CustomResourceValidation) ProtoMessage() {}
func (*CustomResourceValidation) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{15}
+ return fileDescriptor_3623d6c0bd238430, []int{15}
}
func (m *CustomResourceValidation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -499,7 +499,7 @@ var xxx_messageInfo_CustomResourceValidation proto.InternalMessageInfo
func (m *ExternalDocumentation) Reset() { *m = ExternalDocumentation{} }
func (*ExternalDocumentation) ProtoMessage() {}
func (*ExternalDocumentation) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{16}
+ return fileDescriptor_3623d6c0bd238430, []int{16}
}
func (m *ExternalDocumentation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -527,7 +527,7 @@ var xxx_messageInfo_ExternalDocumentation proto.InternalMessageInfo
func (m *JSON) Reset() { *m = JSON{} }
func (*JSON) ProtoMessage() {}
func (*JSON) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{17}
+ return fileDescriptor_3623d6c0bd238430, []int{17}
}
func (m *JSON) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -555,7 +555,7 @@ var xxx_messageInfo_JSON proto.InternalMessageInfo
func (m *JSONSchemaProps) Reset() { *m = JSONSchemaProps{} }
func (*JSONSchemaProps) ProtoMessage() {}
func (*JSONSchemaProps) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{18}
+ return fileDescriptor_3623d6c0bd238430, []int{18}
}
func (m *JSONSchemaProps) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -583,7 +583,7 @@ var xxx_messageInfo_JSONSchemaProps proto.InternalMessageInfo
func (m *JSONSchemaPropsOrArray) Reset() { *m = JSONSchemaPropsOrArray{} }
func (*JSONSchemaPropsOrArray) ProtoMessage() {}
func (*JSONSchemaPropsOrArray) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{19}
+ return fileDescriptor_3623d6c0bd238430, []int{19}
}
func (m *JSONSchemaPropsOrArray) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -611,7 +611,7 @@ var xxx_messageInfo_JSONSchemaPropsOrArray proto.InternalMessageInfo
func (m *JSONSchemaPropsOrBool) Reset() { *m = JSONSchemaPropsOrBool{} }
func (*JSONSchemaPropsOrBool) ProtoMessage() {}
func (*JSONSchemaPropsOrBool) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{20}
+ return fileDescriptor_3623d6c0bd238430, []int{20}
}
func (m *JSONSchemaPropsOrBool) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -639,7 +639,7 @@ var xxx_messageInfo_JSONSchemaPropsOrBool proto.InternalMessageInfo
func (m *JSONSchemaPropsOrStringArray) Reset() { *m = JSONSchemaPropsOrStringArray{} }
func (*JSONSchemaPropsOrStringArray) ProtoMessage() {}
func (*JSONSchemaPropsOrStringArray) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{21}
+ return fileDescriptor_3623d6c0bd238430, []int{21}
}
func (m *JSONSchemaPropsOrStringArray) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -664,10 +664,38 @@ func (m *JSONSchemaPropsOrStringArray) XXX_DiscardUnknown() {
var xxx_messageInfo_JSONSchemaPropsOrStringArray proto.InternalMessageInfo
+func (m *SelectableField) Reset() { *m = SelectableField{} }
+func (*SelectableField) ProtoMessage() {}
+func (*SelectableField) Descriptor() ([]byte, []int) {
+ return fileDescriptor_3623d6c0bd238430, []int{22}
+}
+func (m *SelectableField) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *SelectableField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *SelectableField) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SelectableField.Merge(m, src)
+}
+func (m *SelectableField) XXX_Size() int {
+ return m.Size()
+}
+func (m *SelectableField) XXX_DiscardUnknown() {
+ xxx_messageInfo_SelectableField.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SelectableField proto.InternalMessageInfo
+
func (m *ServiceReference) Reset() { *m = ServiceReference{} }
func (*ServiceReference) ProtoMessage() {}
func (*ServiceReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{22}
+ return fileDescriptor_3623d6c0bd238430, []int{23}
}
func (m *ServiceReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -695,7 +723,7 @@ var xxx_messageInfo_ServiceReference proto.InternalMessageInfo
func (m *ValidationRule) Reset() { *m = ValidationRule{} }
func (*ValidationRule) ProtoMessage() {}
func (*ValidationRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{23}
+ return fileDescriptor_3623d6c0bd238430, []int{24}
}
func (m *ValidationRule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -723,7 +751,7 @@ var xxx_messageInfo_ValidationRule proto.InternalMessageInfo
func (m *WebhookClientConfig) Reset() { *m = WebhookClientConfig{} }
func (*WebhookClientConfig) ProtoMessage() {}
func (*WebhookClientConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_98a4cc6918394e53, []int{24}
+ return fileDescriptor_3623d6c0bd238430, []int{25}
}
func (m *WebhookClientConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -775,216 +803,219 @@ func init() {
proto.RegisterType((*JSONSchemaPropsOrArray)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray")
proto.RegisterType((*JSONSchemaPropsOrBool)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrBool")
proto.RegisterType((*JSONSchemaPropsOrStringArray)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrStringArray")
+ proto.RegisterType((*SelectableField)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.SelectableField")
proto.RegisterType((*ServiceReference)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.ServiceReference")
proto.RegisterType((*ValidationRule)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.ValidationRule")
proto.RegisterType((*WebhookClientConfig)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.WebhookClientConfig")
}
func init() {
- proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto", fileDescriptor_98a4cc6918394e53)
-}
-
-var fileDescriptor_98a4cc6918394e53 = []byte{
- // 3170 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcd, 0x73, 0x1c, 0x47,
- 0xd9, 0xf7, 0xec, 0x6a, 0xa5, 0x55, 0x4b, 0xb6, 0xa4, 0xb6, 0xa5, 0x8c, 0x15, 0x47, 0x2b, 0xaf,
- 0xdf, 0xf8, 0x55, 0x12, 0x67, 0x95, 0xf8, 0x4d, 0xde, 0xe4, 0xcd, 0x4b, 0x8a, 0xd2, 0x4a, 0x72,
- 0x50, 0x62, 0x59, 0xa2, 0xd7, 0x76, 0x04, 0xf9, 0x1c, 0xed, 0xf4, 0xae, 0x27, 0x9a, 0x9d, 0x19,
- 0x77, 0xcf, 0xac, 0xa4, 0x0a, 0x50, 0x7c, 0x54, 0x0a, 0x8a, 0x02, 0x42, 0x91, 0x5c, 0x28, 0xe0,
- 0x10, 0x28, 0x2e, 0x1c, 0xe0, 0x00, 0x37, 0xf8, 0x03, 0x72, 0x4c, 0x01, 0x87, 0x1c, 0xa8, 0x85,
- 0x2c, 0x57, 0x8e, 0x54, 0x51, 0xa5, 0x13, 0xd5, 0x1f, 0xd3, 0xd3, 0x3b, 0xbb, 0x6b, 0xbb, 0xa2,
- 0xdd, 0x98, 0xdb, 0xee, 0xf3, 0xf5, 0x7b, 0xe6, 0xe9, 0xa7, 0x9f, 0x7e, 0xfa, 0x99, 0x01, 0xb5,
- 0xbd, 0x67, 0x69, 0xc9, 0xf1, 0x97, 0xf7, 0xa2, 0x5d, 0x4c, 0x3c, 0x1c, 0x62, 0xba, 0xdc, 0xc4,
- 0x9e, 0xed, 0x93, 0x65, 0xc9, 0xb0, 0x02, 0x07, 0x1f, 0x84, 0xd8, 0xa3, 0x8e, 0xef, 0xd1, 0xc7,
- 0xad, 0xc0, 0xa1, 0x98, 0x34, 0x31, 0x59, 0x0e, 0xf6, 0xea, 0x8c, 0x47, 0x3b, 0x05, 0x96, 0x9b,
- 0x4f, 0xee, 0xe2, 0xd0, 0x7a, 0x72, 0xb9, 0x8e, 0x3d, 0x4c, 0xac, 0x10, 0xdb, 0xa5, 0x80, 0xf8,
- 0xa1, 0x0f, 0x9f, 0x17, 0xe6, 0x4a, 0x1d, 0xd2, 0x6f, 0x28, 0x73, 0xa5, 0x60, 0xaf, 0xce, 0x78,
- 0xb4, 0x53, 0xa0, 0x24, 0xcd, 0xcd, 0x3f, 0x5e, 0x77, 0xc2, 0x5b, 0xd1, 0x6e, 0xa9, 0xea, 0x37,
- 0x96, 0xeb, 0x7e, 0xdd, 0x5f, 0xe6, 0x56, 0x77, 0xa3, 0x1a, 0xff, 0xc7, 0xff, 0xf0, 0x5f, 0x02,
- 0x6d, 0xfe, 0xa9, 0xc4, 0xf9, 0x86, 0x55, 0xbd, 0xe5, 0x78, 0x98, 0x1c, 0x26, 0x1e, 0x37, 0x70,
- 0x68, 0x2d, 0x37, 0xbb, 0x7c, 0x9c, 0x5f, 0xee, 0xa7, 0x45, 0x22, 0x2f, 0x74, 0x1a, 0xb8, 0x4b,
- 0xe1, 0x7f, 0xef, 0xa6, 0x40, 0xab, 0xb7, 0x70, 0xc3, 0x4a, 0xeb, 0x15, 0x8f, 0x0c, 0x30, 0xb3,
- 0xea, 0x7b, 0x4d, 0x4c, 0xd8, 0x53, 0x22, 0x7c, 0x3b, 0xc2, 0x34, 0x84, 0x65, 0x90, 0x8d, 0x1c,
- 0xdb, 0x34, 0x16, 0x8d, 0xa5, 0xf1, 0xf2, 0x13, 0x1f, 0xb6, 0x0a, 0x27, 0xda, 0xad, 0x42, 0xf6,
- 0xc6, 0xc6, 0xda, 0x51, 0xab, 0x70, 0xbe, 0x1f, 0x52, 0x78, 0x18, 0x60, 0x5a, 0xba, 0xb1, 0xb1,
- 0x86, 0x98, 0x32, 0x7c, 0x01, 0xcc, 0xd8, 0x98, 0x3a, 0x04, 0xdb, 0x2b, 0xdb, 0x1b, 0x37, 0x85,
- 0x7d, 0x33, 0xc3, 0x2d, 0x9e, 0x95, 0x16, 0x67, 0xd6, 0xd2, 0x02, 0xa8, 0x5b, 0x07, 0xee, 0x80,
- 0x31, 0x7f, 0xf7, 0x2d, 0x5c, 0x0d, 0xa9, 0x99, 0x5d, 0xcc, 0x2e, 0x4d, 0x5c, 0x7e, 0xbc, 0x94,
- 0xac, 0xa0, 0x72, 0x81, 0x2f, 0x9b, 0x7c, 0xd8, 0x12, 0xb2, 0xf6, 0xd7, 0xe3, 0x95, 0x2b, 0x4f,
- 0x49, 0xb4, 0xb1, 0x2d, 0x61, 0x05, 0xc5, 0xe6, 0x8a, 0xbf, 0xc8, 0x00, 0xa8, 0x3f, 0x3c, 0x0d,
- 0x7c, 0x8f, 0xe2, 0x81, 0x3c, 0x3d, 0x05, 0xd3, 0x55, 0x6e, 0x39, 0xc4, 0xb6, 0xc4, 0x35, 0x33,
- 0x9f, 0xc6, 0x7b, 0x53, 0xe2, 0x4f, 0xaf, 0xa6, 0xcc, 0xa1, 0x2e, 0x00, 0x78, 0x1d, 0x8c, 0x12,
- 0x4c, 0x23, 0x37, 0x34, 0xb3, 0x8b, 0xc6, 0xd2, 0xc4, 0xe5, 0x4b, 0x7d, 0xa1, 0x78, 0x7e, 0xb3,
- 0xe4, 0x2b, 0x35, 0x9f, 0x2c, 0x55, 0x42, 0x2b, 0x8c, 0x68, 0xf9, 0x94, 0x44, 0x1a, 0x45, 0xdc,
- 0x06, 0x92, 0xb6, 0x8a, 0xdf, 0xc9, 0x80, 0x69, 0x3d, 0x4a, 0x4d, 0x07, 0xef, 0xc3, 0x7d, 0x30,
- 0x46, 0x44, 0xb2, 0xf0, 0x38, 0x4d, 0x5c, 0xde, 0x2e, 0x1d, 0x6b, 0x5b, 0x95, 0xba, 0x92, 0xb0,
- 0x3c, 0xc1, 0xd6, 0x4c, 0xfe, 0x41, 0x31, 0x1a, 0x7c, 0x1b, 0xe4, 0x89, 0x5c, 0x28, 0x9e, 0x4d,
- 0x13, 0x97, 0xbf, 0x38, 0x40, 0x64, 0x61, 0xb8, 0x3c, 0xd9, 0x6e, 0x15, 0xf2, 0xf1, 0x3f, 0xa4,
- 0x00, 0x8b, 0xef, 0x65, 0xc0, 0xc2, 0x6a, 0x44, 0x43, 0xbf, 0x81, 0x30, 0xf5, 0x23, 0x52, 0xc5,
- 0xab, 0xbe, 0x1b, 0x35, 0xbc, 0x35, 0x5c, 0x73, 0x3c, 0x27, 0x64, 0xd9, 0xba, 0x08, 0x46, 0x3c,
- 0xab, 0x81, 0x65, 0xf6, 0x4c, 0xca, 0x98, 0x8e, 0x5c, 0xb3, 0x1a, 0x18, 0x71, 0x0e, 0x93, 0x60,
- 0xc9, 0x22, 0xf7, 0x82, 0x92, 0xb8, 0x7e, 0x18, 0x60, 0xc4, 0x39, 0xf0, 0x22, 0x18, 0xad, 0xf9,
- 0xa4, 0x61, 0x89, 0x75, 0x1c, 0x4f, 0x56, 0xe6, 0x0a, 0xa7, 0x22, 0xc9, 0x85, 0x4f, 0x83, 0x09,
- 0x1b, 0xd3, 0x2a, 0x71, 0x02, 0x06, 0x6d, 0x8e, 0x70, 0xe1, 0xd3, 0x52, 0x78, 0x62, 0x2d, 0x61,
- 0x21, 0x5d, 0x0e, 0x5e, 0x02, 0xf9, 0x80, 0x38, 0x3e, 0x71, 0xc2, 0x43, 0x33, 0xb7, 0x68, 0x2c,
- 0xe5, 0xca, 0xd3, 0x52, 0x27, 0xbf, 0x2d, 0xe9, 0x48, 0x49, 0xc0, 0x45, 0x90, 0x7f, 0xb1, 0xb2,
- 0x75, 0x6d, 0xdb, 0x0a, 0x6f, 0x99, 0xa3, 0x1c, 0x61, 0x84, 0x49, 0x23, 0x45, 0x2d, 0xfe, 0x25,
- 0x03, 0xcc, 0x74, 0x54, 0xe2, 0x90, 0xc2, 0x2b, 0x20, 0x4f, 0x43, 0x56, 0x71, 0xea, 0x87, 0x32,
- 0x26, 0x8f, 0xc6, 0x60, 0x15, 0x49, 0x3f, 0x6a, 0x15, 0xe6, 0x12, 0x8d, 0x98, 0xca, 0xe3, 0xa1,
- 0x74, 0xe1, 0xcf, 0x0c, 0x70, 0x7a, 0x1f, 0xef, 0xde, 0xf2, 0xfd, 0xbd, 0x55, 0xd7, 0xc1, 0x5e,
- 0xb8, 0xea, 0x7b, 0x35, 0xa7, 0x2e, 0x73, 0x00, 0x1d, 0x33, 0x07, 0x5e, 0xee, 0xb6, 0x5c, 0x7e,
- 0xa0, 0xdd, 0x2a, 0x9c, 0xee, 0xc1, 0x40, 0xbd, 0xfc, 0x80, 0x3b, 0xc0, 0xac, 0xa6, 0x36, 0x89,
- 0x2c, 0x60, 0xa2, 0x6c, 0x8d, 0x97, 0xcf, 0xb5, 0x5b, 0x05, 0x73, 0xb5, 0x8f, 0x0c, 0xea, 0xab,
- 0x5d, 0xfc, 0x56, 0x36, 0x1d, 0x5e, 0x2d, 0xdd, 0xde, 0x04, 0x79, 0xb6, 0x8d, 0x6d, 0x2b, 0xb4,
- 0xe4, 0x46, 0x7c, 0xe2, 0xde, 0x36, 0xbd, 0xa8, 0x19, 0x9b, 0x38, 0xb4, 0xca, 0x50, 0x2e, 0x08,
- 0x48, 0x68, 0x48, 0x59, 0x85, 0x5f, 0x05, 0x23, 0x34, 0xc0, 0x55, 0x19, 0xe8, 0x57, 0x8e, 0xbb,
- 0xd9, 0xfa, 0x3c, 0x48, 0x25, 0xc0, 0xd5, 0x64, 0x2f, 0xb0, 0x7f, 0x88, 0xc3, 0xc2, 0x77, 0x0c,
- 0x30, 0x4a, 0x79, 0x81, 0x92, 0x45, 0xed, 0xb5, 0x61, 0x79, 0x90, 0xaa, 0x82, 0xe2, 0x3f, 0x92,
- 0xe0, 0xc5, 0x7f, 0x66, 0xc0, 0xf9, 0x7e, 0xaa, 0xab, 0xbe, 0x67, 0x8b, 0xe5, 0xd8, 0x90, 0x7b,
- 0x5b, 0x64, 0xfa, 0xd3, 0xfa, 0xde, 0x3e, 0x6a, 0x15, 0x1e, 0xbe, 0xab, 0x01, 0xad, 0x08, 0xfc,
- 0x9f, 0x7a, 0x6e, 0x51, 0x28, 0xce, 0x77, 0x3a, 0x76, 0xd4, 0x2a, 0x4c, 0x29, 0xb5, 0x4e, 0x5f,
- 0x61, 0x13, 0x40, 0xd7, 0xa2, 0xe1, 0x75, 0x62, 0x79, 0x54, 0x98, 0x75, 0x1a, 0x58, 0x86, 0xef,
- 0xd1, 0x7b, 0x4b, 0x0f, 0xa6, 0x51, 0x9e, 0x97, 0x90, 0xf0, 0x6a, 0x97, 0x35, 0xd4, 0x03, 0x81,
- 0xd5, 0x2d, 0x82, 0x2d, 0xaa, 0x4a, 0x91, 0x76, 0xa2, 0x30, 0x2a, 0x92, 0x5c, 0xf8, 0x08, 0x18,
- 0x6b, 0x60, 0x4a, 0xad, 0x3a, 0xe6, 0xf5, 0x67, 0x3c, 0x39, 0xa2, 0x37, 0x05, 0x19, 0xc5, 0x7c,
- 0xd6, 0x9f, 0x9c, 0xeb, 0x17, 0xb5, 0xab, 0x0e, 0x0d, 0xe1, 0xab, 0x5d, 0x1b, 0xa0, 0x74, 0x6f,
- 0x4f, 0xc8, 0xb4, 0x79, 0xfa, 0xab, 0xe2, 0x17, 0x53, 0xb4, 0xe4, 0xff, 0x0a, 0xc8, 0x39, 0x21,
- 0x6e, 0xc4, 0x67, 0xf7, 0xcb, 0x43, 0xca, 0xbd, 0xf2, 0x49, 0xe9, 0x43, 0x6e, 0x83, 0xa1, 0x21,
- 0x01, 0x5a, 0xfc, 0x65, 0x06, 0x3c, 0xd4, 0x4f, 0x85, 0x1d, 0x28, 0x94, 0x45, 0x3c, 0x70, 0x23,
- 0x62, 0xb9, 0x32, 0xe3, 0x54, 0xc4, 0xb7, 0x39, 0x15, 0x49, 0x2e, 0x2b, 0xf9, 0xd4, 0xf1, 0xea,
- 0x91, 0x6b, 0x11, 0x99, 0x4e, 0xea, 0xa9, 0x2b, 0x92, 0x8e, 0x94, 0x04, 0x2c, 0x01, 0x40, 0x6f,
- 0xf9, 0x24, 0xe4, 0x18, 0xb2, 0x7a, 0x9d, 0x62, 0x05, 0xa2, 0xa2, 0xa8, 0x48, 0x93, 0x60, 0x27,
- 0xda, 0x9e, 0xe3, 0xd9, 0x72, 0xd5, 0xd5, 0x2e, 0x7e, 0xc9, 0xf1, 0x6c, 0xc4, 0x39, 0x0c, 0xdf,
- 0x75, 0x68, 0xc8, 0x28, 0x72, 0xc9, 0x3b, 0xa2, 0xce, 0x25, 0x95, 0x04, 0xc3, 0xaf, 0xb2, 0xaa,
- 0xef, 0x13, 0x07, 0x53, 0x73, 0x34, 0xc1, 0x5f, 0x55, 0x54, 0xa4, 0x49, 0x14, 0xff, 0x91, 0xef,
- 0x9f, 0x24, 0xac, 0x94, 0xc0, 0x0b, 0x20, 0x57, 0x27, 0x7e, 0x14, 0xc8, 0x28, 0xa9, 0x68, 0xbf,
- 0xc0, 0x88, 0x48, 0xf0, 0x58, 0x56, 0x36, 0x3b, 0xda, 0x54, 0x95, 0x95, 0x71, 0x73, 0x1a, 0xf3,
- 0xe1, 0x37, 0x0c, 0x90, 0xf3, 0x64, 0x70, 0x58, 0xca, 0xbd, 0x3a, 0xa4, 0xbc, 0xe0, 0xe1, 0x4d,
- 0xdc, 0x15, 0x91, 0x17, 0xc8, 0xf0, 0x29, 0x90, 0xa3, 0x55, 0x3f, 0xc0, 0x32, 0xea, 0x0b, 0xb1,
- 0x50, 0x85, 0x11, 0x8f, 0x5a, 0x85, 0x93, 0xb1, 0x39, 0x4e, 0x40, 0x42, 0x18, 0x7e, 0xdb, 0x00,
- 0xa0, 0x69, 0xb9, 0x8e, 0x6d, 0xf1, 0x96, 0x21, 0xc7, 0xdd, 0x1f, 0x6c, 0x5a, 0xdf, 0x54, 0xe6,
- 0xc5, 0xa2, 0x25, 0xff, 0x91, 0x06, 0x0d, 0xdf, 0x35, 0xc0, 0x24, 0x8d, 0x76, 0x89, 0xd4, 0xa2,
- 0xbc, 0xb9, 0x98, 0xb8, 0xfc, 0xa5, 0x81, 0xfa, 0x52, 0xd1, 0x00, 0xca, 0xd3, 0xed, 0x56, 0x61,
- 0x52, 0xa7, 0xa0, 0x0e, 0x07, 0xe0, 0xf7, 0x0c, 0x90, 0x6f, 0xc6, 0x67, 0xf6, 0x18, 0xdf, 0xf0,
- 0xaf, 0x0f, 0x69, 0x61, 0x65, 0x46, 0x25, 0xbb, 0x40, 0xf5, 0x01, 0xca, 0x03, 0xf8, 0x7b, 0x03,
- 0x98, 0x96, 0x2d, 0x0a, 0xbc, 0xe5, 0x6e, 0x13, 0xc7, 0x0b, 0x31, 0x11, 0xfd, 0x26, 0x35, 0xf3,
- 0xdc, 0xbd, 0xc1, 0x9e, 0x85, 0xe9, 0x5e, 0xb6, 0xbc, 0x28, 0xbd, 0x33, 0x57, 0xfa, 0xb8, 0x81,
- 0xfa, 0x3a, 0xc8, 0x13, 0x2d, 0x69, 0x69, 0xcc, 0xf1, 0x21, 0x24, 0x5a, 0xd2, 0x4b, 0xc9, 0xea,
- 0x90, 0x74, 0x50, 0x1a, 0x34, 0xdc, 0x02, 0xb3, 0x01, 0xc1, 0x1c, 0xe0, 0x86, 0xb7, 0xe7, 0xf9,
- 0xfb, 0xde, 0x15, 0x07, 0xbb, 0x36, 0x35, 0xc1, 0xa2, 0xb1, 0x94, 0x2f, 0x9f, 0x6d, 0xb7, 0x0a,
- 0xb3, 0xdb, 0xbd, 0x04, 0x50, 0x6f, 0xbd, 0xe2, 0xbb, 0xd9, 0xf4, 0x2d, 0x20, 0xdd, 0x45, 0xc0,
- 0xf7, 0xc5, 0xd3, 0x8b, 0xd8, 0x50, 0xd3, 0xe0, 0xab, 0xf5, 0xe6, 0x90, 0x92, 0x49, 0xb5, 0x01,
- 0x49, 0x27, 0xa7, 0x48, 0x14, 0x69, 0x7e, 0xc0, 0x1f, 0x1b, 0xe0, 0xa4, 0x55, 0xad, 0xe2, 0x20,
- 0xc4, 0xb6, 0x28, 0xee, 0x99, 0xcf, 0xa0, 0x7e, 0xcd, 0x4a, 0xaf, 0x4e, 0xae, 0xe8, 0xd0, 0xa8,
- 0xd3, 0x13, 0xf8, 0x1c, 0x38, 0x45, 0x43, 0x9f, 0x60, 0x3b, 0xd5, 0x36, 0xc3, 0x76, 0xab, 0x70,
- 0xaa, 0xd2, 0xc1, 0x41, 0x29, 0xc9, 0xe2, 0x5f, 0x73, 0xa0, 0x70, 0x97, 0xad, 0x76, 0x0f, 0x17,
- 0xb3, 0x8b, 0x60, 0x94, 0x3f, 0xae, 0xcd, 0xa3, 0x92, 0xd7, 0x5a, 0x41, 0x4e, 0x45, 0x92, 0xcb,
- 0x0e, 0x0a, 0x86, 0xcf, 0xda, 0x97, 0x2c, 0x17, 0x54, 0x07, 0x45, 0x45, 0x90, 0x51, 0xcc, 0x87,
- 0x97, 0x01, 0xb0, 0x71, 0x40, 0x30, 0x3b, 0xac, 0x6c, 0x73, 0x8c, 0x4b, 0xab, 0x45, 0x5a, 0x53,
- 0x1c, 0xa4, 0x49, 0xc1, 0x2b, 0x00, 0xc6, 0xff, 0x1c, 0xdf, 0x7b, 0xd9, 0x22, 0x9e, 0xe3, 0xd5,
- 0xcd, 0x3c, 0x77, 0x7b, 0x8e, 0x75, 0x63, 0x6b, 0x5d, 0x5c, 0xd4, 0x43, 0x03, 0xbe, 0x0d, 0x46,
- 0xc5, 0xd0, 0x87, 0x9f, 0x10, 0x43, 0xac, 0xf2, 0x80, 0xc7, 0x88, 0x43, 0x21, 0x09, 0xd9, 0x5d,
- 0xdd, 0x73, 0xf7, 0xbb, 0xba, 0xdf, 0xb1, 0x9c, 0x8e, 0xfe, 0x87, 0x97, 0xd3, 0xe2, 0xbf, 0x8c,
- 0x74, 0xcd, 0xd1, 0x1e, 0xb5, 0x52, 0xb5, 0x5c, 0x0c, 0xd7, 0xc0, 0x34, 0xbb, 0x31, 0x21, 0x1c,
- 0xb8, 0x4e, 0xd5, 0xa2, 0xfc, 0xc2, 0x2e, 0x92, 0x5d, 0xcd, 0x90, 0x2a, 0x29, 0x3e, 0xea, 0xd2,
- 0x80, 0x2f, 0x02, 0x28, 0x6e, 0x11, 0x1d, 0x76, 0x44, 0x43, 0xa4, 0xee, 0x03, 0x95, 0x2e, 0x09,
- 0xd4, 0x43, 0x0b, 0xae, 0x82, 0x19, 0xd7, 0xda, 0xc5, 0x6e, 0x05, 0xbb, 0xb8, 0x1a, 0xfa, 0x84,
- 0x9b, 0x12, 0x23, 0x8d, 0xd9, 0x76, 0xab, 0x30, 0x73, 0x35, 0xcd, 0x44, 0xdd, 0xf2, 0xc5, 0xf3,
- 0xe9, 0xad, 0xad, 0x3f, 0xb8, 0xb8, 0x9b, 0x7d, 0x90, 0x01, 0xf3, 0xfd, 0x33, 0x03, 0x7e, 0x33,
- 0xb9, 0x42, 0x8a, 0x1b, 0xc2, 0xeb, 0xc3, 0xca, 0x42, 0x79, 0x87, 0x04, 0xdd, 0xf7, 0x47, 0xf8,
- 0x35, 0xd6, 0xae, 0x59, 0x6e, 0x3c, 0xb4, 0x7a, 0x6d, 0x68, 0x2e, 0x30, 0x90, 0xf2, 0xb8, 0xe8,
- 0x04, 0x2d, 0x97, 0x37, 0x7e, 0x96, 0x8b, 0x8b, 0xbf, 0x32, 0xd2, 0x53, 0x84, 0x64, 0x07, 0xc3,
- 0xef, 0x1b, 0x60, 0xca, 0x0f, 0xb0, 0xb7, 0xb2, 0xbd, 0x71, 0xf3, 0x7f, 0xc4, 0x4e, 0x96, 0xa1,
- 0xba, 0x76, 0x4c, 0x3f, 0x5f, 0xac, 0x6c, 0x5d, 0x13, 0x06, 0xb7, 0x89, 0x1f, 0xd0, 0xf2, 0xe9,
- 0x76, 0xab, 0x30, 0xb5, 0xd5, 0x09, 0x85, 0xd2, 0xd8, 0xc5, 0x06, 0x98, 0x5d, 0x3f, 0x08, 0x31,
- 0xf1, 0x2c, 0x77, 0xcd, 0xaf, 0x46, 0x0d, 0xec, 0x85, 0xc2, 0xd1, 0xd4, 0xc4, 0xcb, 0xb8, 0xc7,
- 0x89, 0xd7, 0x43, 0x20, 0x1b, 0x11, 0x57, 0x66, 0xf1, 0x84, 0x9a, 0xe8, 0xa2, 0xab, 0x88, 0xd1,
- 0x8b, 0xe7, 0xc1, 0x08, 0xf3, 0x13, 0x9e, 0x05, 0x59, 0x62, 0xed, 0x73, 0xab, 0x93, 0xe5, 0x31,
- 0x26, 0x82, 0xac, 0x7d, 0xc4, 0x68, 0xc5, 0x3f, 0x9f, 0x07, 0x53, 0xa9, 0x67, 0x81, 0xf3, 0x20,
- 0xa3, 0xc6, 0xc4, 0x40, 0x1a, 0xcd, 0x6c, 0xac, 0xa1, 0x8c, 0x63, 0xc3, 0x67, 0x54, 0xf1, 0x15,
- 0xa0, 0x05, 0x75, 0x96, 0x70, 0x2a, 0xeb, 0xcf, 0x13, 0x73, 0xcc, 0x91, 0xb8, 0x70, 0x32, 0x1f,
- 0x70, 0x4d, 0xee, 0x12, 0xe1, 0x03, 0xae, 0x21, 0x46, 0xfb, 0xb4, 0xe3, 0xbe, 0x78, 0xde, 0x98,
- 0xbb, 0x87, 0x79, 0xe3, 0xe8, 0x1d, 0xe7, 0x8d, 0x17, 0x40, 0x2e, 0x74, 0x42, 0x17, 0xf3, 0x83,
- 0x4c, 0xbb, 0x46, 0x5d, 0x67, 0x44, 0x24, 0x78, 0xf0, 0x2d, 0x30, 0x66, 0xe3, 0x9a, 0x15, 0xb9,
- 0x21, 0x3f, 0xb3, 0x26, 0x2e, 0xaf, 0x0e, 0x20, 0x85, 0xc4, 0x30, 0x78, 0x4d, 0xd8, 0x45, 0x31,
- 0x00, 0x7c, 0x18, 0x8c, 0x35, 0xac, 0x03, 0xa7, 0x11, 0x35, 0x78, 0x83, 0x69, 0x08, 0xb1, 0x4d,
- 0x41, 0x42, 0x31, 0x8f, 0x55, 0x46, 0x7c, 0x50, 0x75, 0x23, 0xea, 0x34, 0xb1, 0x64, 0xca, 0xe6,
- 0x4f, 0x55, 0xc6, 0xf5, 0x14, 0x1f, 0x75, 0x69, 0x70, 0x30, 0xc7, 0xe3, 0xca, 0x13, 0x1a, 0x98,
- 0x20, 0xa1, 0x98, 0xd7, 0x09, 0x26, 0xe5, 0x27, 0xfb, 0x81, 0x49, 0xe5, 0x2e, 0x0d, 0xf8, 0x18,
- 0x18, 0x6f, 0x58, 0x07, 0x57, 0xb1, 0x57, 0x0f, 0x6f, 0x99, 0x27, 0x17, 0x8d, 0xa5, 0x6c, 0xf9,
- 0x64, 0xbb, 0x55, 0x18, 0xdf, 0x8c, 0x89, 0x28, 0xe1, 0x73, 0x61, 0xc7, 0x93, 0xc2, 0xa7, 0x34,
- 0xe1, 0x98, 0x88, 0x12, 0x3e, 0xeb, 0x5e, 0x02, 0x2b, 0x64, 0x9b, 0xcb, 0x9c, 0xea, 0xbc, 0xe6,
- 0x6e, 0x0b, 0x32, 0x8a, 0xf9, 0x70, 0x09, 0xe4, 0x1b, 0xd6, 0x01, 0x1f, 0x49, 0x98, 0xd3, 0xdc,
- 0x2c, 0x1f, 0x8c, 0x6f, 0x4a, 0x1a, 0x52, 0x5c, 0x2e, 0xe9, 0x78, 0x42, 0x72, 0x46, 0x93, 0x94,
- 0x34, 0xa4, 0xb8, 0x2c, 0x89, 0x23, 0xcf, 0xb9, 0x1d, 0x61, 0x21, 0x0c, 0x79, 0x64, 0x54, 0x12,
- 0xdf, 0x48, 0x58, 0x48, 0x97, 0x83, 0x25, 0x00, 0x1a, 0x91, 0x1b, 0x3a, 0x81, 0x8b, 0xb7, 0x6a,
- 0xe6, 0x69, 0x1e, 0x7f, 0xde, 0xf4, 0x6f, 0x2a, 0x2a, 0xd2, 0x24, 0x20, 0x06, 0x23, 0xd8, 0x8b,
- 0x1a, 0xe6, 0x19, 0x7e, 0xb0, 0x0f, 0x24, 0x05, 0xd5, 0xce, 0x59, 0xf7, 0xa2, 0x06, 0xe2, 0xe6,
- 0xe1, 0x33, 0xe0, 0x64, 0xc3, 0x3a, 0x60, 0xe5, 0x00, 0x93, 0xd0, 0xc1, 0xd4, 0x9c, 0xe5, 0x0f,
- 0x3f, 0xc3, 0xba, 0xdd, 0x4d, 0x9d, 0x81, 0x3a, 0xe5, 0xb8, 0xa2, 0xe3, 0x69, 0x8a, 0x73, 0x9a,
- 0xa2, 0xce, 0x40, 0x9d, 0x72, 0x2c, 0xd2, 0x04, 0xdf, 0x8e, 0x1c, 0x82, 0x6d, 0xf3, 0x01, 0xde,
- 0x20, 0xcb, 0x97, 0x15, 0x82, 0x86, 0x14, 0x17, 0x36, 0xe3, 0xd9, 0x95, 0xc9, 0xb7, 0xe1, 0x8d,
- 0xc1, 0x56, 0xf2, 0x2d, 0xb2, 0x42, 0x88, 0x75, 0x28, 0x4e, 0x1a, 0x7d, 0x6a, 0x05, 0x29, 0xc8,
- 0x59, 0xae, 0xbb, 0x55, 0x33, 0xcf, 0xf2, 0xd8, 0x0f, 0xfa, 0x04, 0x51, 0x55, 0x67, 0x85, 0x81,
- 0x20, 0x81, 0xc5, 0x40, 0x7d, 0x8f, 0xa5, 0xc6, 0xfc, 0x70, 0x41, 0xb7, 0x18, 0x08, 0x12, 0x58,
- 0xfc, 0x49, 0xbd, 0xc3, 0xad, 0x9a, 0xf9, 0xe0, 0x90, 0x9f, 0x94, 0x81, 0x20, 0x81, 0x05, 0x1d,
- 0x90, 0xf5, 0xfc, 0xd0, 0x3c, 0x37, 0x94, 0xe3, 0x99, 0x1f, 0x38, 0xd7, 0xfc, 0x10, 0x31, 0x0c,
- 0xf8, 0x23, 0x03, 0x80, 0x20, 0x49, 0xd1, 0x87, 0x06, 0x32, 0x12, 0x49, 0x41, 0x96, 0x92, 0xdc,
- 0x5e, 0xf7, 0x42, 0x72, 0x98, 0x5c, 0x8f, 0xb4, 0x3d, 0xa0, 0x79, 0x01, 0x7f, 0x6e, 0x80, 0x33,
- 0x7a, 0x9b, 0xac, 0xdc, 0x5b, 0xe0, 0x11, 0xb9, 0x3e, 0xe8, 0x34, 0x2f, 0xfb, 0xbe, 0x5b, 0x36,
- 0xdb, 0xad, 0xc2, 0x99, 0x95, 0x1e, 0xa8, 0xa8, 0xa7, 0x2f, 0xf0, 0xd7, 0x06, 0x98, 0x91, 0x55,
- 0x54, 0xf3, 0xb0, 0xc0, 0x03, 0x88, 0x07, 0x1d, 0xc0, 0x34, 0x8e, 0x88, 0xa3, 0x7a, 0xc9, 0xde,
- 0xc5, 0x47, 0xdd, 0xae, 0xc1, 0xdf, 0x19, 0x60, 0xd2, 0xc6, 0x01, 0xf6, 0x6c, 0xec, 0x55, 0x99,
- 0xaf, 0x8b, 0x03, 0x19, 0x59, 0xa4, 0x7d, 0x5d, 0xd3, 0x20, 0x84, 0x9b, 0x25, 0xe9, 0xe6, 0xa4,
- 0xce, 0x3a, 0x6a, 0x15, 0xe6, 0x12, 0x55, 0x9d, 0x83, 0x3a, 0xbc, 0x84, 0xef, 0x19, 0x60, 0x2a,
- 0x59, 0x00, 0x71, 0xa4, 0x9c, 0x1f, 0x62, 0x1e, 0xf0, 0xf6, 0x75, 0xa5, 0x13, 0x10, 0xa5, 0x3d,
- 0x80, 0xbf, 0x31, 0x58, 0xa7, 0x16, 0xdf, 0xfb, 0xa8, 0x59, 0xe4, 0xb1, 0x7c, 0x63, 0xe0, 0xb1,
- 0x54, 0x08, 0x22, 0x94, 0x97, 0x92, 0x56, 0x50, 0x71, 0x8e, 0x5a, 0x85, 0x59, 0x3d, 0x92, 0x8a,
- 0x81, 0x74, 0x0f, 0xe1, 0x77, 0x0d, 0x30, 0x89, 0x93, 0x8e, 0x9b, 0x9a, 0x17, 0x06, 0x12, 0xc4,
- 0x9e, 0x4d, 0xbc, 0xb8, 0xa9, 0x6b, 0x2c, 0x8a, 0x3a, 0xb0, 0x59, 0x07, 0x89, 0x0f, 0xac, 0x46,
- 0xe0, 0x62, 0xf3, 0xbf, 0x06, 0xdc, 0x41, 0xae, 0x0b, 0xbb, 0x28, 0x06, 0x80, 0x97, 0x40, 0xde,
- 0x8b, 0x5c, 0xd7, 0xda, 0x75, 0xb1, 0xf9, 0x30, 0xef, 0x45, 0xd4, 0x48, 0xf6, 0x9a, 0xa4, 0x23,
- 0x25, 0x01, 0x6b, 0x60, 0xf1, 0xe0, 0x25, 0xf5, 0x79, 0x52, 0xcf, 0xa1, 0xa1, 0x79, 0x91, 0x5b,
- 0x99, 0x6f, 0xb7, 0x0a, 0x73, 0x3b, 0xbd, 0xc7, 0x8a, 0x77, 0xb5, 0x01, 0x5f, 0x01, 0x0f, 0x6a,
- 0x32, 0xeb, 0x8d, 0x5d, 0x6c, 0xdb, 0xd8, 0x8e, 0x2f, 0x6e, 0xe6, 0x7f, 0x8b, 0xc1, 0x65, 0xbc,
- 0xc1, 0x77, 0xd2, 0x02, 0xe8, 0x4e, 0xda, 0xf0, 0x2a, 0x98, 0xd3, 0xd8, 0x1b, 0x5e, 0xb8, 0x45,
- 0x2a, 0x21, 0x71, 0xbc, 0xba, 0xb9, 0xc4, 0xed, 0x9e, 0x89, 0x77, 0xe4, 0x8e, 0xc6, 0x43, 0x7d,
- 0x74, 0xe0, 0x17, 0x3a, 0xac, 0xf1, 0x57, 0x68, 0x56, 0xf0, 0x12, 0x3e, 0xa4, 0xe6, 0x23, 0xbc,
- 0x3b, 0xe1, 0x8b, 0xbd, 0xa3, 0xd1, 0x51, 0x1f, 0x79, 0xf8, 0x79, 0x70, 0x3a, 0xc5, 0x61, 0x57,
- 0x14, 0xf3, 0x51, 0x71, 0xd7, 0x60, 0xfd, 0xec, 0x4e, 0x4c, 0x44, 0xbd, 0x24, 0xe1, 0xe7, 0x00,
- 0xd4, 0xc8, 0x9b, 0x56, 0xc0, 0xf5, 0x1f, 0x13, 0xd7, 0x1e, 0xb6, 0xa2, 0x3b, 0x92, 0x86, 0x7a,
- 0xc8, 0xc1, 0x9f, 0x18, 0x1d, 0x4f, 0x92, 0xdc, 0x8e, 0xa9, 0x79, 0x89, 0xef, 0xdf, 0xcd, 0x63,
- 0x66, 0xa1, 0xf6, 0x1e, 0x24, 0x72, 0xb1, 0x16, 0x66, 0x0d, 0x0a, 0xf5, 0x71, 0x61, 0x9e, 0xdd,
- 0xd0, 0x53, 0x15, 0x1e, 0x4e, 0x83, 0xec, 0x1e, 0x96, 0x5f, 0x55, 0x20, 0xf6, 0x13, 0xda, 0x20,
- 0xd7, 0xb4, 0xdc, 0x28, 0x1e, 0x32, 0x0c, 0xb8, 0x3b, 0x40, 0xc2, 0xf8, 0x73, 0x99, 0x67, 0x8d,
- 0xf9, 0xf7, 0x0d, 0x30, 0xd7, 0xfb, 0xe0, 0xb9, 0xaf, 0x6e, 0xfd, 0xd4, 0x00, 0x33, 0x5d, 0x67,
- 0x4c, 0x0f, 0x8f, 0x6e, 0x77, 0x7a, 0xf4, 0xca, 0xa0, 0x0f, 0x0b, 0xb1, 0x39, 0x78, 0x87, 0xac,
- 0xbb, 0xf7, 0x03, 0x03, 0x4c, 0xa7, 0xcb, 0xf6, 0xfd, 0x8c, 0x57, 0xf1, 0xfd, 0x0c, 0x98, 0xeb,
- 0xdd, 0xd8, 0x43, 0xa2, 0x26, 0x18, 0xc3, 0x99, 0x04, 0xf5, 0x9a, 0x1a, 0xbf, 0x63, 0x80, 0x89,
- 0xb7, 0x94, 0x5c, 0xfc, 0xd6, 0x7d, 0xe0, 0x33, 0xa8, 0xf8, 0x9c, 0x4c, 0x18, 0x14, 0xe9, 0xb8,
- 0xc5, 0xdf, 0x1a, 0x60, 0xb6, 0x67, 0x03, 0x00, 0x2f, 0x82, 0x51, 0xcb, 0x75, 0xfd, 0x7d, 0x31,
- 0x4a, 0xd4, 0xde, 0x11, 0xac, 0x70, 0x2a, 0x92, 0x5c, 0x2d, 0x7a, 0x99, 0xcf, 0x2a, 0x7a, 0xc5,
- 0x3f, 0x18, 0xe0, 0xdc, 0x9d, 0x32, 0xf1, 0xbe, 0x2c, 0xe9, 0x12, 0xc8, 0xcb, 0xe6, 0xfd, 0x90,
- 0x2f, 0xa7, 0x2c, 0xc5, 0xb2, 0x68, 0xf0, 0x0f, 0xcd, 0xc4, 0xaf, 0xe2, 0x07, 0x06, 0x98, 0xae,
- 0x60, 0xd2, 0x74, 0xaa, 0x18, 0xe1, 0x1a, 0x26, 0xd8, 0xab, 0x62, 0xb8, 0x0c, 0xc6, 0xf9, 0xeb,
- 0xee, 0xc0, 0xaa, 0xc6, 0xaf, 0x6e, 0x66, 0x64, 0xc8, 0xc7, 0xaf, 0xc5, 0x0c, 0x94, 0xc8, 0xa8,
- 0xd7, 0x3c, 0x99, 0xbe, 0xaf, 0x79, 0xce, 0x81, 0x91, 0x20, 0x19, 0x44, 0xe7, 0x19, 0x97, 0xcf,
- 0x9e, 0x39, 0x95, 0x73, 0x7d, 0x12, 0xf2, 0xe9, 0x5a, 0x4e, 0x72, 0x7d, 0x12, 0x22, 0x4e, 0x2d,
- 0xfe, 0x29, 0x03, 0x4e, 0x75, 0xd6, 0x71, 0x06, 0x48, 0x22, 0xb7, 0xeb, 0xbd, 0x12, 0xe3, 0x21,
- 0xce, 0xd1, 0x3f, 0x77, 0xc9, 0xdc, 0xf9, 0x73, 0x17, 0xf8, 0x02, 0x98, 0x91, 0x3f, 0xd7, 0x0f,
- 0x02, 0x82, 0x29, 0x7f, 0x77, 0x9a, 0xed, 0xfc, 0x68, 0x76, 0x33, 0x2d, 0x80, 0xba, 0x75, 0xe0,
- 0xff, 0xa7, 0x3e, 0xc5, 0xb9, 0x90, 0x7c, 0x86, 0xc3, 0x5a, 0x42, 0xde, 0x67, 0xdc, 0x64, 0x65,
- 0x60, 0x9d, 0x10, 0x9f, 0xa4, 0xbe, 0xcf, 0x59, 0x06, 0xe3, 0x35, 0x26, 0xc0, 0xe7, 0xf5, 0xb9,
- 0xce, 0xa0, 0x5f, 0x89, 0x19, 0x28, 0x91, 0x81, 0xcf, 0x83, 0x29, 0x3f, 0x10, 0x1d, 0xf0, 0x96,
- 0x6b, 0x57, 0xb0, 0x5b, 0xe3, 0x93, 0xc4, 0x7c, 0x3c, 0xee, 0xed, 0x60, 0xa1, 0xb4, 0x6c, 0xf1,
- 0x8f, 0x06, 0xe8, 0xf5, 0xa1, 0x1d, 0x3c, 0x2b, 0xc6, 0xb6, 0xda, 0x2c, 0x34, 0x1e, 0xd9, 0xc2,
- 0x26, 0x18, 0xa3, 0x22, 0x57, 0x64, 0x2e, 0x6f, 0x1d, 0x33, 0x97, 0xd3, 0x99, 0x27, 0xfa, 0xc5,
- 0x98, 0x1a, 0x83, 0xb1, 0x74, 0xae, 0x5a, 0xe5, 0xc8, 0xb3, 0xe5, 0x24, 0x7f, 0x52, 0xa4, 0xf3,
- 0xea, 0x8a, 0xa0, 0x21, 0xc5, 0x2d, 0x57, 0x3f, 0xfc, 0x64, 0xe1, 0xc4, 0x47, 0x9f, 0x2c, 0x9c,
- 0xf8, 0xf8, 0x93, 0x85, 0x13, 0x5f, 0x6f, 0x2f, 0x18, 0x1f, 0xb6, 0x17, 0x8c, 0x8f, 0xda, 0x0b,
- 0xc6, 0xc7, 0xed, 0x05, 0xe3, 0x6f, 0xed, 0x05, 0xe3, 0x87, 0x7f, 0x5f, 0x38, 0xf1, 0xe5, 0xe7,
- 0x8f, 0xf5, 0x6d, 0xfb, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x16, 0x56, 0x59, 0x35, 0x34, 0x2f,
- 0x00, 0x00,
+ proto.RegisterFile("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto", fileDescriptor_3623d6c0bd238430)
+}
+
+var fileDescriptor_3623d6c0bd238430 = []byte{
+ // 3214 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0xcf, 0x73, 0x1c, 0x57,
+ 0xf1, 0xf7, 0xac, 0xb4, 0xd2, 0xaa, 0x25, 0x5b, 0xd2, 0xb3, 0xa5, 0x8c, 0x15, 0x47, 0x2b, 0xaf,
+ 0xbf, 0xf1, 0x57, 0x49, 0x9c, 0x55, 0xe2, 0x6f, 0xf2, 0x4d, 0x08, 0xa4, 0x52, 0x5a, 0x49, 0x0e,
+ 0x4a, 0x2c, 0x4b, 0xbc, 0xb5, 0x1d, 0x41, 0x7e, 0x8e, 0x76, 0x9e, 0xd6, 0x63, 0xcf, 0xce, 0x8c,
+ 0xe7, 0xcd, 0xac, 0xa4, 0x0a, 0x50, 0x40, 0x2a, 0x05, 0x45, 0x01, 0xa1, 0x48, 0x2e, 0x14, 0x70,
+ 0x08, 0x14, 0x17, 0x0e, 0x70, 0x80, 0x1b, 0xfc, 0x01, 0x39, 0xa6, 0x80, 0x43, 0x0e, 0xd4, 0x16,
+ 0x59, 0xfe, 0x05, 0x0a, 0xaa, 0x74, 0xa2, 0xde, 0x8f, 0x99, 0x79, 0x33, 0xbb, 0x6b, 0xbb, 0xa2,
+ 0xdd, 0xb8, 0xb8, 0x69, 0xbb, 0xfb, 0xf5, 0xa7, 0xa7, 0x5f, 0xbf, 0xee, 0x7e, 0x3d, 0x23, 0xd8,
+ 0xb8, 0xf5, 0x2c, 0x2d, 0x5b, 0xee, 0x92, 0xe1, 0x59, 0x64, 0x3f, 0x20, 0x0e, 0xb5, 0x5c, 0x87,
+ 0x3e, 0x6e, 0x78, 0x16, 0x25, 0x7e, 0x93, 0xf8, 0x4b, 0xde, 0xad, 0x3a, 0xe3, 0xd1, 0xb4, 0xc0,
+ 0x52, 0xf3, 0xc9, 0x1d, 0x12, 0x18, 0x4f, 0x2e, 0xd5, 0x89, 0x43, 0x7c, 0x23, 0x20, 0x66, 0xd9,
+ 0xf3, 0xdd, 0xc0, 0x45, 0xcf, 0x0b, 0x75, 0xe5, 0x94, 0xf4, 0x9b, 0xb1, 0xba, 0xb2, 0x77, 0xab,
+ 0xce, 0x78, 0x34, 0x2d, 0x50, 0x96, 0xea, 0xe6, 0x1e, 0xaf, 0x5b, 0xc1, 0x8d, 0x70, 0xa7, 0x5c,
+ 0x73, 0x1b, 0x4b, 0x75, 0xb7, 0xee, 0x2e, 0x71, 0xad, 0x3b, 0xe1, 0x2e, 0xff, 0xc5, 0x7f, 0xf0,
+ 0xbf, 0x04, 0xda, 0xdc, 0x53, 0x89, 0xf1, 0x0d, 0xa3, 0x76, 0xc3, 0x72, 0x88, 0x7f, 0x90, 0x58,
+ 0xdc, 0x20, 0x81, 0xb1, 0xd4, 0xec, 0xb0, 0x71, 0x6e, 0xa9, 0xd7, 0x2a, 0x3f, 0x74, 0x02, 0xab,
+ 0x41, 0x3a, 0x16, 0xfc, 0xff, 0xdd, 0x16, 0xd0, 0xda, 0x0d, 0xd2, 0x30, 0xb2, 0xeb, 0x4a, 0x87,
+ 0x1a, 0x4c, 0xaf, 0xb8, 0x4e, 0x93, 0xf8, 0xec, 0x29, 0x31, 0xb9, 0x1d, 0x12, 0x1a, 0xa0, 0x0a,
+ 0x0c, 0x85, 0x96, 0xa9, 0x6b, 0x0b, 0xda, 0xe2, 0x58, 0xe5, 0x89, 0x8f, 0x5a, 0xc5, 0x63, 0xed,
+ 0x56, 0x71, 0xe8, 0xda, 0xfa, 0xea, 0x61, 0xab, 0x78, 0xb6, 0x17, 0x52, 0x70, 0xe0, 0x11, 0x5a,
+ 0xbe, 0xb6, 0xbe, 0x8a, 0xd9, 0x62, 0xf4, 0x22, 0x4c, 0x9b, 0x84, 0x5a, 0x3e, 0x31, 0x97, 0xb7,
+ 0xd6, 0xaf, 0x0b, 0xfd, 0x7a, 0x8e, 0x6b, 0x3c, 0x2d, 0x35, 0x4e, 0xaf, 0x66, 0x05, 0x70, 0xe7,
+ 0x1a, 0xb4, 0x0d, 0xa3, 0xee, 0xce, 0x4d, 0x52, 0x0b, 0xa8, 0x3e, 0xb4, 0x30, 0xb4, 0x38, 0x7e,
+ 0xf1, 0xf1, 0x72, 0xb2, 0x83, 0xb1, 0x09, 0x7c, 0xdb, 0xe4, 0xc3, 0x96, 0xb1, 0xb1, 0xb7, 0x16,
+ 0xed, 0x5c, 0x65, 0x52, 0xa2, 0x8d, 0x6e, 0x0a, 0x2d, 0x38, 0x52, 0x57, 0xfa, 0x55, 0x0e, 0x90,
+ 0xfa, 0xf0, 0xd4, 0x73, 0x1d, 0x4a, 0xfa, 0xf2, 0xf4, 0x14, 0xa6, 0x6a, 0x5c, 0x73, 0x40, 0x4c,
+ 0x89, 0xab, 0xe7, 0x3e, 0x8b, 0xf5, 0xba, 0xc4, 0x9f, 0x5a, 0xc9, 0xa8, 0xc3, 0x1d, 0x00, 0xe8,
+ 0x2a, 0x8c, 0xf8, 0x84, 0x86, 0x76, 0xa0, 0x0f, 0x2d, 0x68, 0x8b, 0xe3, 0x17, 0x2f, 0xf4, 0x84,
+ 0xe2, 0xf1, 0xcd, 0x82, 0xaf, 0xdc, 0x7c, 0xb2, 0x5c, 0x0d, 0x8c, 0x20, 0xa4, 0x95, 0x13, 0x12,
+ 0x69, 0x04, 0x73, 0x1d, 0x58, 0xea, 0x2a, 0x7d, 0x2f, 0x07, 0x53, 0xaa, 0x97, 0x9a, 0x16, 0xd9,
+ 0x43, 0x7b, 0x30, 0xea, 0x8b, 0x60, 0xe1, 0x7e, 0x1a, 0xbf, 0xb8, 0x55, 0x3e, 0xd2, 0xb1, 0x2a,
+ 0x77, 0x04, 0x61, 0x65, 0x9c, 0xed, 0x99, 0xfc, 0x81, 0x23, 0x34, 0xf4, 0x36, 0x14, 0x7c, 0xb9,
+ 0x51, 0x3c, 0x9a, 0xc6, 0x2f, 0x7e, 0xa5, 0x8f, 0xc8, 0x42, 0x71, 0x65, 0xa2, 0xdd, 0x2a, 0x16,
+ 0xa2, 0x5f, 0x38, 0x06, 0x2c, 0xbd, 0x9f, 0x83, 0xf9, 0x95, 0x90, 0x06, 0x6e, 0x03, 0x13, 0xea,
+ 0x86, 0x7e, 0x8d, 0xac, 0xb8, 0x76, 0xd8, 0x70, 0x56, 0xc9, 0xae, 0xe5, 0x58, 0x01, 0x8b, 0xd6,
+ 0x05, 0x18, 0x76, 0x8c, 0x06, 0x91, 0xd1, 0x33, 0x21, 0x7d, 0x3a, 0x7c, 0xc5, 0x68, 0x10, 0xcc,
+ 0x39, 0x4c, 0x82, 0x05, 0x8b, 0x3c, 0x0b, 0xb1, 0xc4, 0xd5, 0x03, 0x8f, 0x60, 0xce, 0x41, 0xe7,
+ 0x61, 0x64, 0xd7, 0xf5, 0x1b, 0x86, 0xd8, 0xc7, 0xb1, 0x64, 0x67, 0x2e, 0x71, 0x2a, 0x96, 0x5c,
+ 0xf4, 0x34, 0x8c, 0x9b, 0x84, 0xd6, 0x7c, 0xcb, 0x63, 0xd0, 0xfa, 0x30, 0x17, 0x3e, 0x29, 0x85,
+ 0xc7, 0x57, 0x13, 0x16, 0x56, 0xe5, 0xd0, 0x05, 0x28, 0x78, 0xbe, 0xe5, 0xfa, 0x56, 0x70, 0xa0,
+ 0xe7, 0x17, 0xb4, 0xc5, 0x7c, 0x65, 0x4a, 0xae, 0x29, 0x6c, 0x49, 0x3a, 0x8e, 0x25, 0xd0, 0x02,
+ 0x14, 0x5e, 0xaa, 0x6e, 0x5e, 0xd9, 0x32, 0x82, 0x1b, 0xfa, 0x08, 0x47, 0x18, 0x66, 0xd2, 0x38,
+ 0xa6, 0x96, 0xfe, 0x96, 0x03, 0x3d, 0xeb, 0x95, 0xc8, 0xa5, 0xe8, 0x12, 0x14, 0x68, 0xc0, 0x32,
+ 0x4e, 0xfd, 0x40, 0xfa, 0xe4, 0xd1, 0x08, 0xac, 0x2a, 0xe9, 0x87, 0xad, 0xe2, 0x6c, 0xb2, 0x22,
+ 0xa2, 0x72, 0x7f, 0xc4, 0x6b, 0xd1, 0x2f, 0x34, 0x38, 0xb9, 0x47, 0x76, 0x6e, 0xb8, 0xee, 0xad,
+ 0x15, 0xdb, 0x22, 0x4e, 0xb0, 0xe2, 0x3a, 0xbb, 0x56, 0x5d, 0xc6, 0x00, 0x3e, 0x62, 0x0c, 0xbc,
+ 0xd2, 0xa9, 0xb9, 0xf2, 0x40, 0xbb, 0x55, 0x3c, 0xd9, 0x85, 0x81, 0xbb, 0xd9, 0x81, 0xb6, 0x41,
+ 0xaf, 0x65, 0x0e, 0x89, 0x4c, 0x60, 0x22, 0x6d, 0x8d, 0x55, 0xce, 0xb4, 0x5b, 0x45, 0x7d, 0xa5,
+ 0x87, 0x0c, 0xee, 0xb9, 0xba, 0xf4, 0xce, 0x50, 0xd6, 0xbd, 0x4a, 0xb8, 0xbd, 0x05, 0x05, 0x76,
+ 0x8c, 0x4d, 0x23, 0x30, 0xe4, 0x41, 0x7c, 0xe2, 0xde, 0x0e, 0xbd, 0xc8, 0x19, 0x1b, 0x24, 0x30,
+ 0x2a, 0x48, 0x6e, 0x08, 0x24, 0x34, 0x1c, 0x6b, 0x45, 0xdf, 0x80, 0x61, 0xea, 0x91, 0x9a, 0x74,
+ 0xf4, 0xab, 0x47, 0x3d, 0x6c, 0x3d, 0x1e, 0xa4, 0xea, 0x91, 0x5a, 0x72, 0x16, 0xd8, 0x2f, 0xcc,
+ 0x61, 0xd1, 0xbb, 0x1a, 0x8c, 0x50, 0x9e, 0xa0, 0x64, 0x52, 0x7b, 0x7d, 0x50, 0x16, 0x64, 0xb2,
+ 0xa0, 0xf8, 0x8d, 0x25, 0x78, 0xe9, 0x9f, 0x39, 0x38, 0xdb, 0x6b, 0xe9, 0x8a, 0xeb, 0x98, 0x62,
+ 0x3b, 0xd6, 0xe5, 0xd9, 0x16, 0x91, 0xfe, 0xb4, 0x7a, 0xb6, 0x0f, 0x5b, 0xc5, 0x87, 0xef, 0xaa,
+ 0x40, 0x49, 0x02, 0x5f, 0x88, 0x9f, 0x5b, 0x24, 0x8a, 0xb3, 0x69, 0xc3, 0x0e, 0x5b, 0xc5, 0xc9,
+ 0x78, 0x59, 0xda, 0x56, 0xd4, 0x04, 0x64, 0x1b, 0x34, 0xb8, 0xea, 0x1b, 0x0e, 0x15, 0x6a, 0xad,
+ 0x06, 0x91, 0xee, 0x7b, 0xf4, 0xde, 0xc2, 0x83, 0xad, 0xa8, 0xcc, 0x49, 0x48, 0x74, 0xb9, 0x43,
+ 0x1b, 0xee, 0x82, 0xc0, 0xf2, 0x96, 0x4f, 0x0c, 0x1a, 0xa7, 0x22, 0xa5, 0xa2, 0x30, 0x2a, 0x96,
+ 0x5c, 0xf4, 0x08, 0x8c, 0x36, 0x08, 0xa5, 0x46, 0x9d, 0xf0, 0xfc, 0x33, 0x96, 0x94, 0xe8, 0x0d,
+ 0x41, 0xc6, 0x11, 0x9f, 0xf5, 0x27, 0x67, 0x7a, 0x79, 0xed, 0xb2, 0x45, 0x03, 0xf4, 0x5a, 0xc7,
+ 0x01, 0x28, 0xdf, 0xdb, 0x13, 0xb2, 0xd5, 0x3c, 0xfc, 0xe3, 0xe4, 0x17, 0x51, 0x94, 0xe0, 0xff,
+ 0x3a, 0xe4, 0xad, 0x80, 0x34, 0xa2, 0xda, 0xfd, 0xca, 0x80, 0x62, 0xaf, 0x72, 0x5c, 0xda, 0x90,
+ 0x5f, 0x67, 0x68, 0x58, 0x80, 0x96, 0x7e, 0x9d, 0x83, 0x87, 0x7a, 0x2d, 0x61, 0x05, 0x85, 0x32,
+ 0x8f, 0x7b, 0x76, 0xe8, 0x1b, 0xb6, 0x8c, 0xb8, 0xd8, 0xe3, 0x5b, 0x9c, 0x8a, 0x25, 0x97, 0xa5,
+ 0x7c, 0x6a, 0x39, 0xf5, 0xd0, 0x36, 0x7c, 0x19, 0x4e, 0xf1, 0x53, 0x57, 0x25, 0x1d, 0xc7, 0x12,
+ 0xa8, 0x0c, 0x40, 0x6f, 0xb8, 0x7e, 0xc0, 0x31, 0x64, 0xf6, 0x3a, 0xc1, 0x12, 0x44, 0x35, 0xa6,
+ 0x62, 0x45, 0x82, 0x55, 0xb4, 0x5b, 0x96, 0x63, 0xca, 0x5d, 0x8f, 0x4f, 0xf1, 0xcb, 0x96, 0x63,
+ 0x62, 0xce, 0x61, 0xf8, 0xb6, 0x45, 0x03, 0x46, 0x91, 0x5b, 0x9e, 0xf2, 0x3a, 0x97, 0x8c, 0x25,
+ 0x18, 0x7e, 0x8d, 0x65, 0x7d, 0xd7, 0xb7, 0x08, 0xd5, 0x47, 0x12, 0xfc, 0x95, 0x98, 0x8a, 0x15,
+ 0x89, 0xd2, 0x3b, 0xd0, 0x3b, 0x48, 0x58, 0x2a, 0x41, 0xe7, 0x20, 0x5f, 0xf7, 0xdd, 0xd0, 0x93,
+ 0x5e, 0x8a, 0xbd, 0xfd, 0x22, 0x23, 0x62, 0xc1, 0x63, 0x51, 0xd9, 0x4c, 0xb5, 0xa9, 0x71, 0x54,
+ 0x46, 0xcd, 0x69, 0xc4, 0x47, 0xdf, 0xd6, 0x20, 0xef, 0x48, 0xe7, 0xb0, 0x90, 0x7b, 0x6d, 0x40,
+ 0x71, 0xc1, 0xdd, 0x9b, 0x98, 0x2b, 0x3c, 0x2f, 0x90, 0xd1, 0x53, 0x90, 0xa7, 0x35, 0xd7, 0x23,
+ 0xd2, 0xeb, 0xf3, 0x91, 0x50, 0x95, 0x11, 0x0f, 0x5b, 0xc5, 0xe3, 0x91, 0x3a, 0x4e, 0xc0, 0x42,
+ 0x18, 0x7d, 0x57, 0x03, 0x68, 0x1a, 0xb6, 0x65, 0x1a, 0xbc, 0x65, 0xc8, 0x73, 0xf3, 0xfb, 0x1b,
+ 0xd6, 0xd7, 0x63, 0xf5, 0x62, 0xd3, 0x92, 0xdf, 0x58, 0x81, 0x46, 0xef, 0x69, 0x30, 0x41, 0xc3,
+ 0x1d, 0x5f, 0xae, 0xa2, 0xbc, 0xb9, 0x18, 0xbf, 0xf8, 0xd5, 0xbe, 0xda, 0x52, 0x55, 0x00, 0x2a,
+ 0x53, 0xed, 0x56, 0x71, 0x42, 0xa5, 0xe0, 0x94, 0x01, 0xe8, 0x07, 0x1a, 0x14, 0x9a, 0x51, 0xcd,
+ 0x1e, 0xe5, 0x07, 0xfe, 0x8d, 0x01, 0x6d, 0xac, 0x8c, 0xa8, 0xe4, 0x14, 0xc4, 0x7d, 0x40, 0x6c,
+ 0x01, 0xfa, 0xa3, 0x06, 0xba, 0x61, 0x8a, 0x04, 0x6f, 0xd8, 0x5b, 0xbe, 0xe5, 0x04, 0xc4, 0x17,
+ 0xfd, 0x26, 0xd5, 0x0b, 0xdc, 0xbc, 0xfe, 0xd6, 0xc2, 0x6c, 0x2f, 0x5b, 0x59, 0x90, 0xd6, 0xe9,
+ 0xcb, 0x3d, 0xcc, 0xc0, 0x3d, 0x0d, 0x44, 0x1f, 0x68, 0x30, 0x45, 0x89, 0x4d, 0x6a, 0x81, 0xb1,
+ 0x63, 0x93, 0x4b, 0x16, 0xb1, 0x4d, 0xaa, 0x8f, 0x73, 0xab, 0xaf, 0x1c, 0xd1, 0xea, 0x6a, 0x5a,
+ 0x6d, 0x72, 0x45, 0xca, 0x30, 0x28, 0xee, 0xb0, 0x80, 0xc7, 0x7f, 0xd2, 0x69, 0xe9, 0x63, 0x03,
+ 0x88, 0xff, 0xa4, 0xc5, 0x93, 0x49, 0x2b, 0x69, 0xec, 0x14, 0x68, 0xb4, 0x09, 0x33, 0x9e, 0x4f,
+ 0x38, 0xc0, 0x35, 0xe7, 0x96, 0xe3, 0xee, 0x39, 0xd2, 0x49, 0xb0, 0xa0, 0x2d, 0x16, 0x2a, 0xa7,
+ 0xdb, 0xad, 0xe2, 0xcc, 0x56, 0x37, 0x01, 0xdc, 0x7d, 0x5d, 0xe9, 0xbd, 0xa1, 0xec, 0xe5, 0x24,
+ 0xdb, 0xdc, 0xb0, 0x4d, 0x61, 0x26, 0x88, 0x2d, 0xa3, 0xba, 0xc6, 0xb7, 0xe3, 0xad, 0x01, 0xc5,
+ 0x78, 0xdc, 0x9d, 0x24, 0x0d, 0x66, 0x4c, 0xa2, 0x58, 0xb1, 0x03, 0xfd, 0x54, 0x83, 0xe3, 0x46,
+ 0xad, 0x46, 0xbc, 0x80, 0x98, 0xa2, 0xe6, 0xe4, 0x3e, 0x87, 0xb4, 0x3a, 0x23, 0xad, 0x3a, 0xbe,
+ 0xac, 0x42, 0xe3, 0xb4, 0x25, 0xe8, 0x39, 0x38, 0x41, 0x03, 0xd7, 0x27, 0x66, 0xa6, 0x9b, 0x47,
+ 0xed, 0x56, 0xf1, 0x44, 0x35, 0xc5, 0xc1, 0x19, 0xc9, 0xd2, 0xbf, 0x46, 0xa0, 0x78, 0x97, 0x0c,
+ 0x70, 0x0f, 0xf7, 0xc5, 0xf3, 0x30, 0xc2, 0x1f, 0xd7, 0xe4, 0x5e, 0x29, 0x28, 0x1d, 0x2a, 0xa7,
+ 0x62, 0xc9, 0x65, 0xf5, 0x8b, 0xe1, 0xb3, 0xae, 0x6a, 0x88, 0x0b, 0xc6, 0xf5, 0xab, 0x2a, 0xc8,
+ 0x38, 0xe2, 0xa3, 0x8b, 0x00, 0x26, 0xf1, 0x7c, 0xc2, 0x6a, 0xa8, 0xa9, 0x8f, 0x72, 0xe9, 0x78,
+ 0x93, 0x56, 0x63, 0x0e, 0x56, 0xa4, 0xd0, 0x25, 0x40, 0xd1, 0x2f, 0xcb, 0x75, 0x5e, 0x31, 0x7c,
+ 0xc7, 0x72, 0xea, 0x7a, 0x81, 0x9b, 0x3d, 0xcb, 0x9a, 0xc4, 0xd5, 0x0e, 0x2e, 0xee, 0xb2, 0x02,
+ 0xbd, 0x0d, 0x23, 0x62, 0x16, 0xc5, 0x0b, 0xd7, 0x00, 0x8b, 0x0f, 0x70, 0x1f, 0x71, 0x28, 0x2c,
+ 0x21, 0x3b, 0x8b, 0x4e, 0xfe, 0x7e, 0x17, 0x9d, 0x3b, 0x66, 0xf9, 0x91, 0xff, 0xca, 0x2c, 0x3f,
+ 0x76, 0xbf, 0xb3, 0x7c, 0xe9, 0xdf, 0x5a, 0x36, 0x15, 0x2a, 0x3b, 0x50, 0xad, 0x19, 0x36, 0x41,
+ 0xab, 0x30, 0xc5, 0xee, 0x97, 0x98, 0x78, 0xb6, 0x55, 0x33, 0x28, 0x1f, 0x6f, 0x88, 0x33, 0x98,
+ 0x00, 0x65, 0xf8, 0xb8, 0x63, 0x05, 0x7a, 0x09, 0x90, 0xb8, 0x73, 0xa5, 0xf4, 0x88, 0xf6, 0x31,
+ 0xbe, 0x3d, 0x55, 0x3b, 0x24, 0x70, 0x97, 0x55, 0x68, 0x05, 0xa6, 0x6d, 0x63, 0x87, 0xd8, 0xe2,
+ 0xf9, 0x5c, 0x9f, 0xab, 0x12, 0x03, 0xa0, 0x99, 0x76, 0xab, 0x38, 0x7d, 0x39, 0xcb, 0xc4, 0x9d,
+ 0xf2, 0xa5, 0xb3, 0xd9, 0x8c, 0xa3, 0x3e, 0xb8, 0xb8, 0xc9, 0x7e, 0x98, 0x83, 0xb9, 0xde, 0x01,
+ 0x8b, 0xbe, 0x93, 0x5c, 0xb8, 0xc5, 0x7d, 0xea, 0x8d, 0x41, 0x1d, 0x0e, 0x79, 0xe3, 0x86, 0xce,
+ 0xdb, 0x36, 0xfa, 0x26, 0x6b, 0x6e, 0x0d, 0x3b, 0x1a, 0xf1, 0xbd, 0x3e, 0x30, 0x13, 0x18, 0x48,
+ 0x65, 0x4c, 0xf4, 0xcd, 0x86, 0xcd, 0xdb, 0x64, 0xc3, 0x26, 0xa5, 0xdf, 0x68, 0xd9, 0x99, 0x4b,
+ 0x92, 0x58, 0xd0, 0x0f, 0x35, 0x98, 0x74, 0x3d, 0xe2, 0x2c, 0x6f, 0xad, 0x5f, 0xff, 0x3f, 0x91,
+ 0x60, 0xa4, 0xab, 0x8e, 0x1a, 0xf3, 0x2f, 0x55, 0x37, 0xaf, 0x08, 0x85, 0x5b, 0xbe, 0xeb, 0xd1,
+ 0xca, 0xc9, 0x76, 0xab, 0x38, 0xb9, 0x99, 0x86, 0xc2, 0x59, 0xec, 0x52, 0x03, 0x66, 0xd6, 0xf6,
+ 0x03, 0xe2, 0x3b, 0x86, 0xbd, 0xea, 0xd6, 0xc2, 0x06, 0x71, 0x02, 0x61, 0x68, 0x66, 0x3e, 0xa8,
+ 0xdd, 0xe3, 0x7c, 0xf0, 0x21, 0x18, 0x0a, 0x7d, 0x5b, 0x46, 0xf1, 0x78, 0x3c, 0xff, 0xc6, 0x97,
+ 0x31, 0xa3, 0x97, 0xce, 0xc2, 0x30, 0xb3, 0x13, 0x9d, 0x86, 0x21, 0xdf, 0xd8, 0xe3, 0x5a, 0x27,
+ 0x2a, 0xa3, 0x4c, 0x04, 0x1b, 0x7b, 0x98, 0xd1, 0x4a, 0x7f, 0x3d, 0x0b, 0x93, 0x99, 0x67, 0x41,
+ 0x73, 0x90, 0x8b, 0x87, 0xea, 0x20, 0x95, 0xe6, 0xd6, 0x57, 0x71, 0xce, 0x32, 0xd1, 0x33, 0x71,
+ 0x4d, 0x10, 0xa0, 0xc5, 0xb8, 0xc4, 0x71, 0x2a, 0xbb, 0xcd, 0x24, 0xea, 0x98, 0x21, 0x51, 0x3e,
+ 0x67, 0x36, 0x90, 0x5d, 0x79, 0x4a, 0x84, 0x0d, 0x64, 0x17, 0x33, 0xda, 0x67, 0x1d, 0x8e, 0x46,
+ 0xd3, 0xd9, 0xfc, 0x3d, 0x4c, 0x67, 0x47, 0xee, 0x38, 0x9d, 0x3d, 0x07, 0xf9, 0xc0, 0x0a, 0x6c,
+ 0xc2, 0xeb, 0xab, 0x72, 0xe9, 0xbc, 0xca, 0x88, 0x58, 0xf0, 0xd0, 0x4d, 0x18, 0x35, 0xc9, 0xae,
+ 0x11, 0xda, 0x01, 0x2f, 0xa5, 0xe3, 0x17, 0x57, 0xfa, 0x10, 0x42, 0x62, 0x74, 0xbe, 0x2a, 0xf4,
+ 0xe2, 0x08, 0x00, 0x3d, 0x0c, 0xa3, 0x0d, 0x63, 0xdf, 0x6a, 0x84, 0x0d, 0xde, 0xf7, 0x6a, 0x42,
+ 0x6c, 0x43, 0x90, 0x70, 0xc4, 0x63, 0x99, 0x91, 0xec, 0xd7, 0xec, 0x90, 0x5a, 0x4d, 0x22, 0x99,
+ 0xb2, 0x27, 0x8d, 0x33, 0xe3, 0x5a, 0x86, 0x8f, 0x3b, 0x56, 0x70, 0x30, 0xcb, 0xe1, 0x8b, 0xc7,
+ 0x15, 0x30, 0x41, 0xc2, 0x11, 0x2f, 0x0d, 0x26, 0xe5, 0x27, 0x7a, 0x81, 0xc9, 0xc5, 0x1d, 0x2b,
+ 0xd0, 0x63, 0x30, 0xd6, 0x30, 0xf6, 0x2f, 0x13, 0xa7, 0x1e, 0xdc, 0xd0, 0x8f, 0x2f, 0x68, 0x8b,
+ 0x43, 0x95, 0xe3, 0xed, 0x56, 0x71, 0x6c, 0x23, 0x22, 0xe2, 0x84, 0xcf, 0x85, 0x2d, 0x47, 0x0a,
+ 0x9f, 0x50, 0x84, 0x23, 0x22, 0x4e, 0xf8, 0xac, 0xa9, 0xf2, 0x8c, 0x80, 0x1d, 0x2e, 0x7d, 0x32,
+ 0x3d, 0x14, 0xd8, 0x12, 0x64, 0x1c, 0xf1, 0xd1, 0x22, 0x14, 0x1a, 0xc6, 0x3e, 0x1f, 0xe0, 0xe8,
+ 0x53, 0x5c, 0x2d, 0x7f, 0x8d, 0xb0, 0x21, 0x69, 0x38, 0xe6, 0x72, 0x49, 0xcb, 0x11, 0x92, 0xd3,
+ 0x8a, 0xa4, 0xa4, 0xe1, 0x98, 0xcb, 0x82, 0x38, 0x74, 0xac, 0xdb, 0x21, 0x11, 0xc2, 0x88, 0x7b,
+ 0x26, 0x0e, 0xe2, 0x6b, 0x09, 0x0b, 0xab, 0x72, 0xa8, 0x0c, 0xd0, 0x08, 0xed, 0xc0, 0xf2, 0x6c,
+ 0xb2, 0xb9, 0xab, 0x9f, 0xe4, 0xfe, 0xe7, 0x77, 0x91, 0x8d, 0x98, 0x8a, 0x15, 0x09, 0x44, 0x60,
+ 0x98, 0x38, 0x61, 0x43, 0x3f, 0xc5, 0x2b, 0x77, 0x5f, 0x42, 0x30, 0x3e, 0x39, 0x6b, 0x4e, 0xd8,
+ 0xc0, 0x5c, 0x3d, 0x7a, 0x06, 0x8e, 0x37, 0x8c, 0x7d, 0x96, 0x0e, 0x88, 0x1f, 0x58, 0x84, 0xea,
+ 0x33, 0xfc, 0xe1, 0xa7, 0x59, 0x13, 0xbe, 0xa1, 0x32, 0x70, 0x5a, 0x8e, 0x2f, 0xb4, 0x1c, 0x65,
+ 0xe1, 0xac, 0xb2, 0x50, 0x65, 0xe0, 0xb4, 0x1c, 0xf3, 0xb4, 0x4f, 0x6e, 0x87, 0x96, 0x4f, 0x4c,
+ 0xfd, 0x01, 0xde, 0xb7, 0xcb, 0x57, 0x3b, 0x82, 0x86, 0x63, 0x2e, 0x6a, 0x46, 0x93, 0x3e, 0x9d,
+ 0x1f, 0xc3, 0x6b, 0xfd, 0xcd, 0xe4, 0x9b, 0xfe, 0xb2, 0xef, 0x1b, 0x07, 0xa2, 0xd2, 0xa8, 0x33,
+ 0x3e, 0x44, 0x21, 0x6f, 0xd8, 0xf6, 0xe6, 0xae, 0x7e, 0xba, 0x2f, 0x5d, 0x53, 0xb6, 0x82, 0xc4,
+ 0x59, 0x67, 0x99, 0x81, 0x60, 0x81, 0xc5, 0x40, 0x5d, 0x87, 0x85, 0xc6, 0xdc, 0x60, 0x41, 0x37,
+ 0x19, 0x08, 0x16, 0x58, 0xfc, 0x49, 0x9d, 0x83, 0xcd, 0x5d, 0xfd, 0xc1, 0x01, 0x3f, 0x29, 0x03,
+ 0xc1, 0x02, 0x0b, 0x59, 0x30, 0xe4, 0xb8, 0x81, 0x7e, 0x66, 0x20, 0xe5, 0x99, 0x17, 0x9c, 0x2b,
+ 0x6e, 0x80, 0x19, 0x06, 0xfa, 0x89, 0x06, 0xe0, 0x25, 0x21, 0xfa, 0x50, 0x5f, 0x06, 0x48, 0x19,
+ 0xc8, 0x72, 0x12, 0xdb, 0x6b, 0x4e, 0xe0, 0x1f, 0x24, 0xb7, 0x36, 0xe5, 0x0c, 0x28, 0x56, 0xa0,
+ 0x5f, 0x6a, 0x70, 0x4a, 0xed, 0xde, 0x63, 0xf3, 0xe6, 0xb9, 0x47, 0xae, 0xf6, 0x3b, 0xcc, 0x2b,
+ 0xae, 0x6b, 0x57, 0xf4, 0x76, 0xab, 0x78, 0x6a, 0xb9, 0x0b, 0x2a, 0xee, 0x6a, 0x0b, 0xfa, 0xad,
+ 0x06, 0xd3, 0x32, 0x8b, 0x2a, 0x16, 0x16, 0xb9, 0x03, 0x49, 0xbf, 0x1d, 0x98, 0xc5, 0x11, 0x7e,
+ 0x8c, 0x3f, 0x49, 0xe8, 0xe0, 0xe3, 0x4e, 0xd3, 0xd0, 0x1f, 0x34, 0x98, 0x30, 0x89, 0x47, 0x1c,
+ 0x93, 0x38, 0x35, 0x66, 0xeb, 0x42, 0x5f, 0x26, 0x29, 0x59, 0x5b, 0x57, 0x15, 0x08, 0x61, 0x66,
+ 0x59, 0x9a, 0x39, 0xa1, 0xb2, 0x0e, 0x5b, 0xc5, 0xd9, 0x64, 0xa9, 0xca, 0xc1, 0x29, 0x2b, 0xd1,
+ 0xfb, 0x1a, 0x4c, 0x26, 0x1b, 0x20, 0x4a, 0xca, 0xd9, 0x01, 0xc6, 0x01, 0x6f, 0x5f, 0x97, 0xd3,
+ 0x80, 0x38, 0x6b, 0x01, 0xfa, 0x9d, 0xc6, 0x3a, 0xb5, 0xe8, 0x3a, 0x4a, 0xf5, 0x12, 0xf7, 0xe5,
+ 0x9b, 0x7d, 0xf7, 0x65, 0x8c, 0x20, 0x5c, 0x79, 0x21, 0x69, 0x05, 0x63, 0xce, 0x61, 0xab, 0x38,
+ 0xa3, 0x7a, 0x32, 0x66, 0x60, 0xd5, 0x42, 0xf4, 0x7d, 0x0d, 0x26, 0x48, 0xd2, 0x71, 0x53, 0xfd,
+ 0x5c, 0x5f, 0x9c, 0xd8, 0xb5, 0x89, 0x17, 0x03, 0x04, 0x85, 0x45, 0x71, 0x0a, 0x9b, 0x75, 0x90,
+ 0x64, 0xdf, 0x68, 0x78, 0x36, 0xd1, 0xff, 0xa7, 0xcf, 0x1d, 0xe4, 0x9a, 0xd0, 0x8b, 0x23, 0x00,
+ 0x74, 0x01, 0x0a, 0x4e, 0x68, 0xdb, 0xec, 0xa6, 0xad, 0x3f, 0xcc, 0x7b, 0x91, 0x78, 0x80, 0x7d,
+ 0x45, 0xd2, 0x71, 0x2c, 0x81, 0x76, 0x61, 0x61, 0xff, 0xe5, 0x70, 0x87, 0xf8, 0x0e, 0x09, 0x08,
+ 0xed, 0x3a, 0xcb, 0xd4, 0xcf, 0x73, 0x2d, 0x73, 0xed, 0x56, 0x71, 0x76, 0xbb, 0xfb, 0xb4, 0xf3,
+ 0xae, 0x3a, 0xd0, 0xab, 0xf0, 0xa0, 0x22, 0xb3, 0xd6, 0xd8, 0x21, 0xa6, 0x49, 0xcc, 0xe8, 0xe2,
+ 0xa6, 0xff, 0xaf, 0x98, 0xa7, 0x46, 0x07, 0x7c, 0x3b, 0x2b, 0x80, 0xef, 0xb4, 0x1a, 0x5d, 0x86,
+ 0x59, 0x85, 0xbd, 0xee, 0x04, 0x9b, 0x7e, 0x35, 0xf0, 0x2d, 0xa7, 0xae, 0x2f, 0x72, 0xbd, 0xa7,
+ 0xa2, 0x13, 0xb9, 0xad, 0xf0, 0x70, 0x8f, 0x35, 0xe8, 0xcb, 0x29, 0x6d, 0xfc, 0x85, 0xa3, 0xe1,
+ 0xbd, 0x4c, 0x0e, 0xa8, 0xfe, 0x08, 0xef, 0x4e, 0xf8, 0x66, 0x6f, 0x2b, 0x74, 0xdc, 0x43, 0x1e,
+ 0xbd, 0x00, 0x27, 0x33, 0x1c, 0x76, 0x45, 0xd1, 0x1f, 0x15, 0x77, 0x0d, 0xd6, 0xcf, 0x6e, 0x47,
+ 0x44, 0xdc, 0x4d, 0x12, 0x7d, 0x09, 0x90, 0x42, 0xde, 0x30, 0x3c, 0xbe, 0xfe, 0x31, 0x71, 0xed,
+ 0x61, 0x3b, 0xba, 0x2d, 0x69, 0xb8, 0x8b, 0x1c, 0xfa, 0x99, 0x96, 0x7a, 0x92, 0xe4, 0x76, 0x4c,
+ 0xf5, 0x0b, 0xfc, 0xfc, 0x6e, 0x1c, 0x31, 0x0a, 0x95, 0xb7, 0x46, 0xa1, 0x4d, 0x14, 0x37, 0x2b,
+ 0x50, 0xb8, 0x87, 0x09, 0x73, 0xec, 0x86, 0x9e, 0xc9, 0xf0, 0x68, 0x0a, 0x86, 0x6e, 0x11, 0xf9,
+ 0x0d, 0x0a, 0x66, 0x7f, 0x22, 0x13, 0xf2, 0x4d, 0xc3, 0x0e, 0xa3, 0x21, 0x43, 0x9f, 0xbb, 0x03,
+ 0x2c, 0x94, 0x3f, 0x97, 0x7b, 0x56, 0x9b, 0xfb, 0x40, 0x83, 0xd9, 0xee, 0x85, 0xe7, 0xbe, 0x9a,
+ 0xf5, 0x73, 0x0d, 0xa6, 0x3b, 0x6a, 0x4c, 0x17, 0x8b, 0x6e, 0xa7, 0x2d, 0x7a, 0xb5, 0xdf, 0xc5,
+ 0x42, 0x1c, 0x0e, 0xde, 0x21, 0xab, 0xe6, 0xfd, 0x48, 0x83, 0xa9, 0x6c, 0xda, 0xbe, 0x9f, 0xfe,
+ 0x2a, 0x7d, 0x90, 0x83, 0xd9, 0xee, 0x8d, 0x3d, 0xf2, 0xe3, 0x09, 0xc6, 0x60, 0x26, 0x41, 0xdd,
+ 0x86, 0xd9, 0xef, 0x6a, 0x30, 0x7e, 0x33, 0x96, 0x8b, 0xbe, 0x51, 0xe8, 0xfb, 0x0c, 0x2a, 0xaa,
+ 0x93, 0x09, 0x83, 0x62, 0x15, 0xb7, 0xf4, 0x7b, 0x0d, 0x66, 0xba, 0x36, 0x00, 0xe8, 0x3c, 0x8c,
+ 0x18, 0xb6, 0xed, 0xee, 0x89, 0x51, 0xa2, 0xf2, 0xea, 0x62, 0x99, 0x53, 0xb1, 0xe4, 0x2a, 0xde,
+ 0xcb, 0x7d, 0x5e, 0xde, 0x2b, 0xfd, 0x49, 0x83, 0x33, 0x77, 0x8a, 0xc4, 0xfb, 0xb2, 0xa5, 0x8b,
+ 0x50, 0x90, 0xcd, 0xfb, 0x01, 0xdf, 0x4e, 0x99, 0x8a, 0x65, 0xd2, 0xe0, 0x9f, 0xe5, 0x89, 0xbf,
+ 0x4a, 0x2f, 0xc0, 0x64, 0x66, 0x10, 0xce, 0xaa, 0xf3, 0x4d, 0xea, 0x3a, 0xca, 0x28, 0x3b, 0xae,
+ 0xce, 0xd1, 0xb7, 0x7a, 0x38, 0x96, 0x28, 0x7d, 0xa8, 0xc1, 0x54, 0x95, 0xf8, 0x4d, 0xab, 0x46,
+ 0x30, 0xd9, 0x25, 0x3e, 0x71, 0x6a, 0x04, 0x2d, 0xc1, 0x18, 0xff, 0xba, 0xc0, 0x33, 0x6a, 0xd1,
+ 0x2b, 0xa9, 0x69, 0xa9, 0x63, 0xec, 0x4a, 0xc4, 0xc0, 0x89, 0x4c, 0xfc, 0xfa, 0x2a, 0xd7, 0xf3,
+ 0xf5, 0xd5, 0x19, 0x18, 0xf6, 0x92, 0x49, 0x76, 0x81, 0x71, 0xb9, 0x25, 0x9c, 0xca, 0xb9, 0xae,
+ 0x1f, 0xf0, 0xf1, 0x5c, 0x5e, 0x72, 0x5d, 0x3f, 0xc0, 0x9c, 0x5a, 0xfa, 0x4b, 0x0e, 0x4e, 0xa4,
+ 0x0b, 0x01, 0x03, 0xf4, 0x43, 0xbb, 0xe3, 0x7d, 0x19, 0xe3, 0x61, 0xce, 0x51, 0xbf, 0x2e, 0xca,
+ 0xdd, 0xf9, 0xeb, 0x22, 0xf4, 0x22, 0x4c, 0xcb, 0x3f, 0xd7, 0xf6, 0x3d, 0x9f, 0x50, 0xfe, 0x4e,
+ 0x78, 0x28, 0xfd, 0x8d, 0xf2, 0x46, 0x56, 0x00, 0x77, 0xae, 0x41, 0x5f, 0xcc, 0x7c, 0xf9, 0x74,
+ 0x2e, 0xf9, 0xea, 0x89, 0xf5, 0x94, 0x7c, 0x7f, 0xae, 0xb3, 0x3c, 0xb2, 0xe6, 0xfb, 0xae, 0x9f,
+ 0xf9, 0x1c, 0x6a, 0x09, 0xc6, 0x76, 0x99, 0x00, 0xdf, 0xb8, 0x7c, 0xda, 0xe9, 0x97, 0x22, 0x06,
+ 0x4e, 0x64, 0xd0, 0xf3, 0x30, 0xe9, 0x7a, 0xa2, 0x85, 0xde, 0xb4, 0xcd, 0x2a, 0xb1, 0x77, 0xf9,
+ 0x28, 0xb2, 0x10, 0xcd, 0x8b, 0x53, 0x2c, 0x9c, 0x95, 0x2d, 0xfd, 0x59, 0x83, 0x6e, 0xdf, 0x35,
+ 0xa2, 0xd3, 0x62, 0xee, 0xab, 0x0c, 0x53, 0xa3, 0x99, 0x2f, 0x6a, 0xc2, 0x28, 0x15, 0xb1, 0x22,
+ 0x0f, 0xc3, 0xe6, 0x91, 0xdf, 0xee, 0xa4, 0x23, 0x4f, 0x34, 0x9c, 0x11, 0x35, 0x02, 0x63, 0xe7,
+ 0xa1, 0x66, 0x54, 0x42, 0xc7, 0x94, 0xaf, 0x02, 0x26, 0xc4, 0x79, 0x58, 0x59, 0x16, 0x34, 0x1c,
+ 0x73, 0x2b, 0xb5, 0x8f, 0x3e, 0x9d, 0x3f, 0xf6, 0xf1, 0xa7, 0xf3, 0xc7, 0x3e, 0xf9, 0x74, 0xfe,
+ 0xd8, 0xb7, 0xda, 0xf3, 0xda, 0x47, 0xed, 0x79, 0xed, 0xe3, 0xf6, 0xbc, 0xf6, 0x49, 0x7b, 0x5e,
+ 0xfb, 0x7b, 0x7b, 0x5e, 0xfb, 0xf1, 0x3f, 0xe6, 0x8f, 0x7d, 0xed, 0xf9, 0x23, 0xfd, 0x2b, 0xc1,
+ 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xe3, 0x03, 0xa1, 0x8a, 0x30, 0x00, 0x00,
}
func (m *ConversionRequest) Marshal() (dAtA []byte, err error) {
@@ -1467,6 +1498,20 @@ func (m *CustomResourceDefinitionSpec) MarshalToSizedBuffer(dAtA []byte) (int, e
_ = i
var l int
_ = l
+ if len(m.SelectableFields) > 0 {
+ for iNdEx := len(m.SelectableFields) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.SelectableFields[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x5a
+ }
+ }
if m.PreserveUnknownFields != nil {
i--
if *m.PreserveUnknownFields {
@@ -1645,6 +1690,20 @@ func (m *CustomResourceDefinitionVersion) MarshalToSizedBuffer(dAtA []byte) (int
_ = i
var l int
_ = l
+ if len(m.SelectableFields) > 0 {
+ for iNdEx := len(m.SelectableFields) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.SelectableFields[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x4a
+ }
+ }
if m.DeprecationWarning != nil {
i -= len(*m.DeprecationWarning)
copy(dAtA[i:], *m.DeprecationWarning)
@@ -2597,6 +2656,34 @@ func (m *JSONSchemaPropsOrStringArray) MarshalToSizedBuffer(dAtA []byte) (int, e
return len(dAtA) - i, nil
}
+func (m *SelectableField) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *SelectableField) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *SelectableField) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.JSONPath)
+ copy(dAtA[i:], m.JSONPath)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.JSONPath)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *ServiceReference) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -2979,6 +3066,12 @@ func (m *CustomResourceDefinitionSpec) Size() (n int) {
if m.PreserveUnknownFields != nil {
n += 2
}
+ if len(m.SelectableFields) > 0 {
+ for _, e := range m.SelectableFields {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
return n
}
@@ -3034,6 +3127,12 @@ func (m *CustomResourceDefinitionVersion) Size() (n int) {
l = len(*m.DeprecationWarning)
n += 1 + l + sovGenerated(uint64(l))
}
+ if len(m.SelectableFields) > 0 {
+ for _, e := range m.SelectableFields {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
return n
}
@@ -3348,6 +3447,17 @@ func (m *JSONSchemaPropsOrStringArray) Size() (n int) {
return n
}
+func (m *SelectableField) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.JSONPath)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
func (m *ServiceReference) Size() (n int) {
if m == nil {
return 0
@@ -3562,6 +3672,11 @@ func (this *CustomResourceDefinitionSpec) String() string {
repeatedStringForAdditionalPrinterColumns += strings.Replace(strings.Replace(f.String(), "CustomResourceColumnDefinition", "CustomResourceColumnDefinition", 1), `&`, ``, 1) + ","
}
repeatedStringForAdditionalPrinterColumns += "}"
+ repeatedStringForSelectableFields := "[]SelectableField{"
+ for _, f := range this.SelectableFields {
+ repeatedStringForSelectableFields += strings.Replace(strings.Replace(f.String(), "SelectableField", "SelectableField", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForSelectableFields += "}"
s := strings.Join([]string{`&CustomResourceDefinitionSpec{`,
`Group:` + fmt.Sprintf("%v", this.Group) + `,`,
`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
@@ -3573,6 +3688,7 @@ func (this *CustomResourceDefinitionSpec) String() string {
`AdditionalPrinterColumns:` + repeatedStringForAdditionalPrinterColumns + `,`,
`Conversion:` + strings.Replace(this.Conversion.String(), "CustomResourceConversion", "CustomResourceConversion", 1) + `,`,
`PreserveUnknownFields:` + valueToStringGenerated(this.PreserveUnknownFields) + `,`,
+ `SelectableFields:` + repeatedStringForSelectableFields + `,`,
`}`,
}, "")
return s
@@ -3603,6 +3719,11 @@ func (this *CustomResourceDefinitionVersion) String() string {
repeatedStringForAdditionalPrinterColumns += strings.Replace(strings.Replace(f.String(), "CustomResourceColumnDefinition", "CustomResourceColumnDefinition", 1), `&`, ``, 1) + ","
}
repeatedStringForAdditionalPrinterColumns += "}"
+ repeatedStringForSelectableFields := "[]SelectableField{"
+ for _, f := range this.SelectableFields {
+ repeatedStringForSelectableFields += strings.Replace(strings.Replace(f.String(), "SelectableField", "SelectableField", 1), `&`, ``, 1) + ","
+ }
+ repeatedStringForSelectableFields += "}"
s := strings.Join([]string{`&CustomResourceDefinitionVersion{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Served:` + fmt.Sprintf("%v", this.Served) + `,`,
@@ -3612,6 +3733,7 @@ func (this *CustomResourceDefinitionVersion) String() string {
`AdditionalPrinterColumns:` + repeatedStringForAdditionalPrinterColumns + `,`,
`Deprecated:` + fmt.Sprintf("%v", this.Deprecated) + `,`,
`DeprecationWarning:` + valueToStringGenerated(this.DeprecationWarning) + `,`,
+ `SelectableFields:` + repeatedStringForSelectableFields + `,`,
`}`,
}, "")
return s
@@ -3835,6 +3957,16 @@ func (this *JSONSchemaPropsOrStringArray) String() string {
}, "")
return s
}
+func (this *SelectableField) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&SelectableField{`,
+ `JSONPath:` + fmt.Sprintf("%v", this.JSONPath) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *ServiceReference) String() string {
if this == nil {
return "nil"
@@ -5755,6 +5887,40 @@ func (m *CustomResourceDefinitionSpec) Unmarshal(dAtA []byte) error {
}
b := bool(v != 0)
m.PreserveUnknownFields = &b
+ case 11:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SelectableFields", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.SelectableFields = append(m.SelectableFields, SelectableField{})
+ if err := m.SelectableFields[len(m.SelectableFields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -6185,6 +6351,40 @@ func (m *CustomResourceDefinitionVersion) Unmarshal(dAtA []byte) error {
s := string(dAtA[iNdEx:postIndex])
m.DeprecationWarning = &s
iNdEx = postIndex
+ case 9:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field SelectableFields", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.SelectableFields = append(m.SelectableFields, SelectableField{})
+ if err := m.SelectableFields[len(m.SelectableFields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -8825,6 +9025,88 @@ func (m *JSONSchemaPropsOrStringArray) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *SelectableField) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: SelectableField: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: SelectableField: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field JSONPath", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.JSONPath = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *ServiceReference) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto
index b8477322b70..f9e5600345a 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto
@@ -40,7 +40,8 @@ message ConversionRequest {
optional string desiredAPIVersion = 2;
// objects is the list of custom resource objects to be converted.
- repeated k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3;
+ // +listType=atomic
+ repeated .k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3;
}
// ConversionResponse describes a conversion response.
@@ -53,14 +54,15 @@ message ConversionResponse {
// The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list
// must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace).
// The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored.
- repeated k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2;
+ // +listType=atomic
+ repeated .k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2;
// result contains the result of conversion with extra details if the conversion failed. `result.status` determines if
// the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the
// conversion. A successful conversion must set `result.status` to `Success`. A failed conversion must set
// `result.status` to `Failure` and provide more details in `result.message` and return http status 200. The `result.message`
// will be used to construct an error message for the end user.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3;
}
// ConversionReview describes a conversion request/response.
@@ -125,6 +127,7 @@ message CustomResourceConversion {
// include any versions known to the API Server, calls to the webhook will fail.
// Defaults to `["v1beta1"]`.
// +optional
+ // +listType=atomic
repeated string conversionReviewVersions = 3;
}
@@ -135,7 +138,7 @@ message CustomResourceDefinition {
// Standard object's metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec describes how the user wants the resources to appear
optional CustomResourceDefinitionSpec spec = 2;
@@ -156,7 +159,7 @@ message CustomResourceDefinitionCondition {
// lastTransitionTime last time the condition transitioned from one status to another.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// reason is a unique, one-word, CamelCase reason for the condition's last transition.
// +optional
@@ -172,7 +175,7 @@ message CustomResourceDefinitionList {
// Standard object's metadata
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items list individual CustomResourceDefinition objects
repeated CustomResourceDefinition items = 2;
@@ -194,6 +197,7 @@ message CustomResourceDefinitionNames {
// and used by clients to support invocations like `kubectl get `.
// It must be all lowercase.
// +optional
+ // +listType=atomic
repeated string shortNames = 3;
// kind is the serialized kind of the resource. It is normally CamelCase and singular.
@@ -208,6 +212,7 @@ message CustomResourceDefinitionNames {
// This is published in API discovery documents, and used by clients to support invocations like
// `kubectl get all`.
// +optional
+ // +listType=atomic
repeated string categories = 6;
}
@@ -256,6 +261,7 @@ message CustomResourceDefinitionSpec {
// major version, then minor version. An example sorted list of versions:
// v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
// +optional
+ // +listType=atomic
repeated CustomResourceDefinitionVersion versions = 7;
// additionalPrinterColumns specifies additional columns returned in Table output.
@@ -264,8 +270,17 @@ message CustomResourceDefinitionSpec {
// Top-level and per-version columns are mutually exclusive.
// If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
// +optional
+ // +listType=atomic
repeated CustomResourceColumnDefinition additionalPrinterColumns = 8;
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ //
+ // +featureGate=CustomResourceFieldSelectors
+ // +optional
+ // +listType=atomic
+ repeated SelectableField selectableFields = 11;
+
// conversion defines conversion settings for the CRD.
// +optional
optional CustomResourceConversion conversion = 9;
@@ -302,6 +317,7 @@ message CustomResourceDefinitionStatus {
// versions from this list.
// Versions may not be removed from `spec.versions` while they exist in this list.
// +optional
+ // +listType=atomic
repeated string storedVersions = 3;
}
@@ -349,7 +365,16 @@ message CustomResourceDefinitionVersion {
// Per-version columns must not all be set to identical values (top-level columns should be used instead).
// If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
// +optional
+ // +listType=atomic
repeated CustomResourceColumnDefinition additionalPrinterColumns = 6;
+
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ //
+ // +featureGate=CustomResourceFieldSelectors
+ // +optional
+ // +listType=atomic
+ repeated SelectableField selectableFields = 9;
}
// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.
@@ -491,20 +516,25 @@ message JSONSchemaProps {
optional double multipleOf = 19;
+ // +listType=atomic
repeated JSON enum = 20;
optional int64 maxProperties = 21;
optional int64 minProperties = 22;
+ // +listType=atomic
repeated string required = 23;
optional JSONSchemaPropsOrArray items = 24;
+ // +listType=atomic
repeated JSONSchemaProps allOf = 25;
+ // +listType=atomic
repeated JSONSchemaProps oneOf = 26;
+ // +listType=atomic
repeated JSONSchemaProps anyOf = 27;
optional JSONSchemaProps not = 28;
@@ -570,6 +600,7 @@ message JSONSchemaProps {
// to ensure those properties are present for all list items.
//
// +optional
+ // +listType=atomic
repeated string xKubernetesListMapKeys = 41;
// x-kubernetes-list-type annotates an array to further describe its topology.
@@ -603,7 +634,6 @@ message JSONSchemaProps {
optional string xKubernetesMapType = 43;
// x-kubernetes-validations describes a list of validation rules written in the CEL expression language.
- // This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled.
// +patchMergeKey=rule
// +patchStrategy=merge
// +listType=map
@@ -616,6 +646,7 @@ message JSONSchemaProps {
message JSONSchemaPropsOrArray {
optional JSONSchemaProps schema = 1;
+ // +listType=atomic
repeated JSONSchemaProps jSONSchemas = 2;
}
@@ -631,9 +662,23 @@ message JSONSchemaPropsOrBool {
message JSONSchemaPropsOrStringArray {
optional JSONSchemaProps schema = 1;
+ // +listType=atomic
repeated string property = 2;
}
+// SelectableField specifies the JSON path of a field that may be used with field selectors.
+message SelectableField {
+ // jsonPath is a simple JSON path which is evaluated against each custom resource to produce a
+ // field selector value.
+ // Only JSON paths without the array notation are allowed.
+ // Must point to a field of type string, boolean or integer. Types with enum values
+ // and strings with formats are allowed.
+ // If jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string.
+ // Must not point to metdata fields.
+ // Required.
+ optional string jsonPath = 1;
+}
+
// ServiceReference holds a reference to Service.legacy.k8s.io
message ServiceReference {
// namespace is the namespace of the service.
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal.go
index 44941d82eff..43b90387872 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal.go
@@ -130,7 +130,7 @@ func (s JSON) MarshalJSON() ([]byte, error) {
func (s *JSON) UnmarshalJSON(data []byte) error {
if len(data) > 0 && !bytes.Equal(data, nullLiteral) {
- s.Raw = data
+ s.Raw = append(s.Raw[0:0], data...)
}
return nil
}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go
index db445b10d2b..153f7233775 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go
@@ -76,6 +76,7 @@ type CustomResourceDefinitionSpec struct {
// major version, then minor version. An example sorted list of versions:
// v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
// +optional
+ // +listType=atomic
Versions []CustomResourceDefinitionVersion `json:"versions,omitempty" protobuf:"bytes,7,rep,name=versions"`
// additionalPrinterColumns specifies additional columns returned in Table output.
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.
@@ -83,8 +84,17 @@ type CustomResourceDefinitionSpec struct {
// Top-level and per-version columns are mutually exclusive.
// If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
// +optional
+ // +listType=atomic
AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,8,rep,name=additionalPrinterColumns"`
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ //
+ // +featureGate=CustomResourceFieldSelectors
+ // +optional
+ // +listType=atomic
+ SelectableFields []SelectableField `json:"selectableFields,omitempty" protobuf:"bytes,11,rep,name=selectableFields"`
+
// conversion defines conversion settings for the CRD.
// +optional
Conversion *CustomResourceConversion `json:"conversion,omitempty" protobuf:"bytes,9,opt,name=conversion"`
@@ -122,6 +132,7 @@ type CustomResourceConversion struct {
// include any versions known to the API Server, calls to the webhook will fail.
// Defaults to `["v1beta1"]`.
// +optional
+ // +listType=atomic
ConversionReviewVersions []string `json:"conversionReviewVersions,omitempty" protobuf:"bytes,3,rep,name=conversionReviewVersions"`
}
@@ -227,7 +238,29 @@ type CustomResourceDefinitionVersion struct {
// Per-version columns must not all be set to identical values (top-level columns should be used instead).
// If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
// +optional
+ // +listType=atomic
AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,6,rep,name=additionalPrinterColumns"`
+
+ // selectableFields specifies paths to fields that may be used as field selectors.
+ // See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors
+ //
+ // +featureGate=CustomResourceFieldSelectors
+ // +optional
+ // +listType=atomic
+ SelectableFields []SelectableField `json:"selectableFields,omitempty" protobuf:"bytes,9,rep,name=selectableFields"`
+}
+
+// SelectableField specifies the JSON path of a field that may be used with field selectors.
+type SelectableField struct {
+ // jsonPath is a simple JSON path which is evaluated against each custom resource to produce a
+ // field selector value.
+ // Only JSON paths without the array notation are allowed.
+ // Must point to a field of type string, boolean or integer. Types with enum values
+ // and strings with formats are allowed.
+ // If jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string.
+ // Must not point to metdata fields.
+ // Required.
+ JSONPath string `json:"jsonPath" protobuf:"bytes,1,opt,name=jsonPath"`
}
// CustomResourceColumnDefinition specifies a column for server side printing.
@@ -269,6 +302,7 @@ type CustomResourceDefinitionNames struct {
// and used by clients to support invocations like `kubectl get `.
// It must be all lowercase.
// +optional
+ // +listType=atomic
ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,3,opt,name=shortNames"`
// kind is the serialized kind of the resource. It is normally CamelCase and singular.
// Custom resource instances will use this value as the `kind` attribute in API calls.
@@ -280,6 +314,7 @@ type CustomResourceDefinitionNames struct {
// This is published in API discovery documents, and used by clients to support invocations like
// `kubectl get all`.
// +optional
+ // +listType=atomic
Categories []string `json:"categories,omitempty" protobuf:"bytes,6,rep,name=categories"`
}
@@ -377,6 +412,7 @@ type CustomResourceDefinitionStatus struct {
// versions from this list.
// Versions may not be removed from `spec.versions` while they exist in this list.
// +optional
+ // +listType=atomic
StoredVersions []string `json:"storedVersions" protobuf:"bytes,3,rep,name=storedVersions"`
}
@@ -509,6 +545,7 @@ type ConversionRequest struct {
// desiredAPIVersion is the version to convert given objects to. e.g. "myapi.example.com/v1"
DesiredAPIVersion string `json:"desiredAPIVersion" protobuf:"bytes,2,name=desiredAPIVersion"`
// objects is the list of custom resource objects to be converted.
+ // +listType=atomic
Objects []runtime.RawExtension `json:"objects" protobuf:"bytes,3,rep,name=objects"`
}
@@ -521,6 +558,7 @@ type ConversionResponse struct {
// The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list
// must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace).
// The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored.
+ // +listType=atomic
ConvertedObjects []runtime.RawExtension `json:"convertedObjects" protobuf:"bytes,2,rep,name=convertedObjects"`
// result contains the result of conversion with extra details if the conversion failed. `result.status` determines if
// the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go
index 24c45bb04eb..3ed584dd9de 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go
@@ -76,25 +76,30 @@ type JSONSchemaProps struct {
// default is a default value for undefined object fields.
// Defaulting is a beta feature under the CustomResourceDefaulting feature gate.
// CustomResourceDefinitions with defaults must be created using the v1 (or newer) CustomResourceDefinition API.
- Default *JSON `json:"default,omitempty" protobuf:"bytes,8,opt,name=default"`
- Maximum *float64 `json:"maximum,omitempty" protobuf:"bytes,9,opt,name=maximum"`
- ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty" protobuf:"bytes,10,opt,name=exclusiveMaximum"`
- Minimum *float64 `json:"minimum,omitempty" protobuf:"bytes,11,opt,name=minimum"`
- ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty" protobuf:"bytes,12,opt,name=exclusiveMinimum"`
- MaxLength *int64 `json:"maxLength,omitempty" protobuf:"bytes,13,opt,name=maxLength"`
- MinLength *int64 `json:"minLength,omitempty" protobuf:"bytes,14,opt,name=minLength"`
- Pattern string `json:"pattern,omitempty" protobuf:"bytes,15,opt,name=pattern"`
- MaxItems *int64 `json:"maxItems,omitempty" protobuf:"bytes,16,opt,name=maxItems"`
- MinItems *int64 `json:"minItems,omitempty" protobuf:"bytes,17,opt,name=minItems"`
- UniqueItems bool `json:"uniqueItems,omitempty" protobuf:"bytes,18,opt,name=uniqueItems"`
- MultipleOf *float64 `json:"multipleOf,omitempty" protobuf:"bytes,19,opt,name=multipleOf"`
- Enum []JSON `json:"enum,omitempty" protobuf:"bytes,20,rep,name=enum"`
- MaxProperties *int64 `json:"maxProperties,omitempty" protobuf:"bytes,21,opt,name=maxProperties"`
- MinProperties *int64 `json:"minProperties,omitempty" protobuf:"bytes,22,opt,name=minProperties"`
- Required []string `json:"required,omitempty" protobuf:"bytes,23,rep,name=required"`
- Items *JSONSchemaPropsOrArray `json:"items,omitempty" protobuf:"bytes,24,opt,name=items"`
- AllOf []JSONSchemaProps `json:"allOf,omitempty" protobuf:"bytes,25,rep,name=allOf"`
- OneOf []JSONSchemaProps `json:"oneOf,omitempty" protobuf:"bytes,26,rep,name=oneOf"`
+ Default *JSON `json:"default,omitempty" protobuf:"bytes,8,opt,name=default"`
+ Maximum *float64 `json:"maximum,omitempty" protobuf:"bytes,9,opt,name=maximum"`
+ ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty" protobuf:"bytes,10,opt,name=exclusiveMaximum"`
+ Minimum *float64 `json:"minimum,omitempty" protobuf:"bytes,11,opt,name=minimum"`
+ ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty" protobuf:"bytes,12,opt,name=exclusiveMinimum"`
+ MaxLength *int64 `json:"maxLength,omitempty" protobuf:"bytes,13,opt,name=maxLength"`
+ MinLength *int64 `json:"minLength,omitempty" protobuf:"bytes,14,opt,name=minLength"`
+ Pattern string `json:"pattern,omitempty" protobuf:"bytes,15,opt,name=pattern"`
+ MaxItems *int64 `json:"maxItems,omitempty" protobuf:"bytes,16,opt,name=maxItems"`
+ MinItems *int64 `json:"minItems,omitempty" protobuf:"bytes,17,opt,name=minItems"`
+ UniqueItems bool `json:"uniqueItems,omitempty" protobuf:"bytes,18,opt,name=uniqueItems"`
+ MultipleOf *float64 `json:"multipleOf,omitempty" protobuf:"bytes,19,opt,name=multipleOf"`
+ // +listType=atomic
+ Enum []JSON `json:"enum,omitempty" protobuf:"bytes,20,rep,name=enum"`
+ MaxProperties *int64 `json:"maxProperties,omitempty" protobuf:"bytes,21,opt,name=maxProperties"`
+ MinProperties *int64 `json:"minProperties,omitempty" protobuf:"bytes,22,opt,name=minProperties"`
+ // +listType=atomic
+ Required []string `json:"required,omitempty" protobuf:"bytes,23,rep,name=required"`
+ Items *JSONSchemaPropsOrArray `json:"items,omitempty" protobuf:"bytes,24,opt,name=items"`
+ // +listType=atomic
+ AllOf []JSONSchemaProps `json:"allOf,omitempty" protobuf:"bytes,25,rep,name=allOf"`
+ // +listType=atomic
+ OneOf []JSONSchemaProps `json:"oneOf,omitempty" protobuf:"bytes,26,rep,name=oneOf"`
+ // +listType=atomic
AnyOf []JSONSchemaProps `json:"anyOf,omitempty" protobuf:"bytes,27,rep,name=anyOf"`
Not *JSONSchemaProps `json:"not,omitempty" protobuf:"bytes,28,opt,name=not"`
Properties map[string]JSONSchemaProps `json:"properties,omitempty" protobuf:"bytes,29,rep,name=properties"`
@@ -150,6 +155,7 @@ type JSONSchemaProps struct {
// to ensure those properties are present for all list items.
//
// +optional
+ // +listType=atomic
XListMapKeys []string `json:"x-kubernetes-list-map-keys,omitempty" protobuf:"bytes,41,rep,name=xKubernetesListMapKeys"`
// x-kubernetes-list-type annotates an array to further describe its topology.
@@ -183,7 +189,6 @@ type JSONSchemaProps struct {
XMapType *string `json:"x-kubernetes-map-type,omitempty" protobuf:"bytes,43,opt,name=xKubernetesMapType"`
// x-kubernetes-validations describes a list of validation rules written in the CEL expression language.
- // This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled.
// +patchMergeKey=rule
// +patchStrategy=merge
// +listType=map
@@ -343,7 +348,8 @@ type JSONSchemaURL string
// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps
// or an array of JSONSchemaProps. Mainly here for serialization purposes.
type JSONSchemaPropsOrArray struct {
- Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
+ Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
+ // +listType=atomic
JSONSchemas []JSONSchemaProps `protobuf:"bytes,2,rep,name=jSONSchemas"`
}
@@ -385,8 +391,9 @@ type JSONSchemaDependencies map[string]JSONSchemaPropsOrStringArray
// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array.
type JSONSchemaPropsOrStringArray struct {
- Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
- Property []string `protobuf:"bytes,2,rep,name=property"`
+ Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"`
+ // +listType=atomic
+ Property []string `protobuf:"bytes,2,rep,name=property"`
}
// OpenAPISchemaType is used by the kube-openapi generator when constructing
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go
index fa6e0ef24e7..d59274e8da6 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go
@@ -212,6 +212,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddGeneratedConversionFunc((*SelectableField)(nil), (*apiextensions.SelectableField)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_SelectableField_To_apiextensions_SelectableField(a.(*SelectableField), b.(*apiextensions.SelectableField), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiextensions.SelectableField)(nil), (*SelectableField)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiextensions_SelectableField_To_v1beta1_SelectableField(a.(*apiextensions.SelectableField), b.(*SelectableField), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddGeneratedConversionFunc((*ServiceReference)(nil), (*apiextensions.ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_ServiceReference_To_apiextensions_ServiceReference(a.(*ServiceReference), b.(*apiextensions.ServiceReference), scope)
}); err != nil {
@@ -491,6 +501,7 @@ func autoConvert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomRes
out.Versions = nil
}
out.AdditionalPrinterColumns = *(*[]apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns))
+ out.SelectableFields = *(*[]apiextensions.SelectableField)(unsafe.Pointer(&in.SelectableFields))
if in.Conversion != nil {
in, out := &in.Conversion, &out.Conversion
*out = new(apiextensions.CustomResourceConversion)
@@ -538,6 +549,7 @@ func autoConvert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomRes
out.Versions = nil
}
out.AdditionalPrinterColumns = *(*[]CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns))
+ out.SelectableFields = *(*[]SelectableField)(unsafe.Pointer(&in.SelectableFields))
if in.Conversion != nil {
in, out := &in.Conversion, &out.Conversion
*out = new(CustomResourceConversion)
@@ -601,6 +613,7 @@ func autoConvert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_Custom
}
out.Subresources = (*apiextensions.CustomResourceSubresources)(unsafe.Pointer(in.Subresources))
out.AdditionalPrinterColumns = *(*[]apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns))
+ out.SelectableFields = *(*[]apiextensions.SelectableField)(unsafe.Pointer(&in.SelectableFields))
return nil
}
@@ -626,6 +639,7 @@ func autoConvert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_Custom
}
out.Subresources = (*CustomResourceSubresources)(unsafe.Pointer(in.Subresources))
out.AdditionalPrinterColumns = *(*[]CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns))
+ out.SelectableFields = *(*[]SelectableField)(unsafe.Pointer(&in.SelectableFields))
return nil
}
@@ -1273,6 +1287,26 @@ func Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPro
return autoConvert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPropsOrStringArray(in, out, s)
}
+func autoConvert_v1beta1_SelectableField_To_apiextensions_SelectableField(in *SelectableField, out *apiextensions.SelectableField, s conversion.Scope) error {
+ out.JSONPath = in.JSONPath
+ return nil
+}
+
+// Convert_v1beta1_SelectableField_To_apiextensions_SelectableField is an autogenerated conversion function.
+func Convert_v1beta1_SelectableField_To_apiextensions_SelectableField(in *SelectableField, out *apiextensions.SelectableField, s conversion.Scope) error {
+ return autoConvert_v1beta1_SelectableField_To_apiextensions_SelectableField(in, out, s)
+}
+
+func autoConvert_apiextensions_SelectableField_To_v1beta1_SelectableField(in *apiextensions.SelectableField, out *SelectableField, s conversion.Scope) error {
+ out.JSONPath = in.JSONPath
+ return nil
+}
+
+// Convert_apiextensions_SelectableField_To_v1beta1_SelectableField is an autogenerated conversion function.
+func Convert_apiextensions_SelectableField_To_v1beta1_SelectableField(in *apiextensions.SelectableField, out *SelectableField, s conversion.Scope) error {
+ return autoConvert_apiextensions_SelectableField_To_v1beta1_SelectableField(in, out, s)
+}
+
func autoConvert_v1beta1_ServiceReference_To_apiextensions_ServiceReference(in *ServiceReference, out *apiextensions.ServiceReference, s conversion.Scope) error {
out.Namespace = in.Namespace
out.Name = in.Name
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go
index bb8ab06cb95..18740925c35 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go
@@ -279,6 +279,11 @@ func (in *CustomResourceDefinitionSpec) DeepCopyInto(out *CustomResourceDefiniti
*out = make([]CustomResourceColumnDefinition, len(*in))
copy(*out, *in)
}
+ if in.SelectableFields != nil {
+ in, out := &in.SelectableFields, &out.SelectableFields
+ *out = make([]SelectableField, len(*in))
+ copy(*out, *in)
+ }
if in.Conversion != nil {
in, out := &in.Conversion, &out.Conversion
*out = new(CustomResourceConversion)
@@ -354,6 +359,11 @@ func (in *CustomResourceDefinitionVersion) DeepCopyInto(out *CustomResourceDefin
*out = make([]CustomResourceColumnDefinition, len(*in))
copy(*out, *in)
}
+ if in.SelectableFields != nil {
+ in, out := &in.SelectableFields, &out.SelectableFields
+ *out = make([]SelectableField, len(*in))
+ copy(*out, *in)
+ }
return
}
@@ -610,6 +620,22 @@ func (in *JSONSchemaPropsOrStringArray) DeepCopy() *JSONSchemaPropsOrStringArray
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SelectableField) DeepCopyInto(out *SelectableField) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectableField.
+func (in *SelectableField) DeepCopy() *SelectableField {
+ if in == nil {
+ return nil
+ }
+ out := new(SelectableField)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceReference) DeepCopyInto(out *ServiceReference) {
*out = *in
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go
index b5e5c35c550..3be35f30858 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go
@@ -197,6 +197,11 @@ func (in *CustomResourceDefinitionSpec) DeepCopyInto(out *CustomResourceDefiniti
*out = make([]CustomResourceColumnDefinition, len(*in))
copy(*out, *in)
}
+ if in.SelectableFields != nil {
+ in, out := &in.SelectableFields, &out.SelectableFields
+ *out = make([]SelectableField, len(*in))
+ copy(*out, *in)
+ }
if in.Conversion != nil {
in, out := &in.Conversion, &out.Conversion
*out = new(CustomResourceConversion)
@@ -272,6 +277,11 @@ func (in *CustomResourceDefinitionVersion) DeepCopyInto(out *CustomResourceDefin
*out = make([]CustomResourceColumnDefinition, len(*in))
copy(*out, *in)
}
+ if in.SelectableFields != nil {
+ in, out := &in.SelectableFields, &out.SelectableFields
+ *out = make([]SelectableField, len(*in))
+ copy(*out, *in)
+ }
return
}
@@ -507,6 +517,22 @@ func (in *JSONSchemaPropsOrStringArray) DeepCopy() *JSONSchemaPropsOrStringArray
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SelectableField) DeepCopyInto(out *SelectableField) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectableField.
+func (in *SelectableField) DeepCopy() *SelectableField {
+ if in == nil {
+ return nil
+ }
+ out := new(SelectableField)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceReference) DeepCopyInto(out *ServiceReference) {
*out = *in
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcecolumndefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcecolumndefinition.go
index b83de1c419b..eb77daba353 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcecolumndefinition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcecolumndefinition.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1
-// CustomResourceColumnDefinitionApplyConfiguration represents an declarative configuration of the CustomResourceColumnDefinition type for use
+// CustomResourceColumnDefinitionApplyConfiguration represents a declarative configuration of the CustomResourceColumnDefinition type for use
// with apply.
type CustomResourceColumnDefinitionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -29,7 +29,7 @@ type CustomResourceColumnDefinitionApplyConfiguration struct {
JSONPath *string `json:"jsonPath,omitempty"`
}
-// CustomResourceColumnDefinitionApplyConfiguration constructs an declarative configuration of the CustomResourceColumnDefinition type for use with
+// CustomResourceColumnDefinitionApplyConfiguration constructs a declarative configuration of the CustomResourceColumnDefinition type for use with
// apply.
func CustomResourceColumnDefinition() *CustomResourceColumnDefinitionApplyConfiguration {
return &CustomResourceColumnDefinitionApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourceconversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourceconversion.go
index 8705d1a219f..973e614e327 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourceconversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourceconversion.go
@@ -22,14 +22,14 @@ import (
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
-// CustomResourceConversionApplyConfiguration represents an declarative configuration of the CustomResourceConversion type for use
+// CustomResourceConversionApplyConfiguration represents a declarative configuration of the CustomResourceConversion type for use
// with apply.
type CustomResourceConversionApplyConfiguration struct {
Strategy *v1.ConversionStrategyType `json:"strategy,omitempty"`
Webhook *WebhookConversionApplyConfiguration `json:"webhook,omitempty"`
}
-// CustomResourceConversionApplyConfiguration constructs an declarative configuration of the CustomResourceConversion type for use with
+// CustomResourceConversionApplyConfiguration constructs a declarative configuration of the CustomResourceConversion type for use with
// apply.
func CustomResourceConversion() *CustomResourceConversionApplyConfiguration {
return &CustomResourceConversionApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go
index f6b6edb7fdb..12417b2e621 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go
@@ -24,7 +24,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// CustomResourceDefinitionApplyConfiguration represents an declarative configuration of the CustomResourceDefinition type for use
+// CustomResourceDefinitionApplyConfiguration represents a declarative configuration of the CustomResourceDefinition type for use
// with apply.
type CustomResourceDefinitionApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -33,7 +33,7 @@ type CustomResourceDefinitionApplyConfiguration struct {
Status *CustomResourceDefinitionStatusApplyConfiguration `json:"status,omitempty"`
}
-// CustomResourceDefinition constructs an declarative configuration of the CustomResourceDefinition type for use with
+// CustomResourceDefinition constructs a declarative configuration of the CustomResourceDefinition type for use with
// apply.
func CustomResourceDefinition(name string) *CustomResourceDefinitionApplyConfiguration {
b := &CustomResourceDefinitionApplyConfiguration{}
@@ -216,3 +216,9 @@ func (b *CustomResourceDefinitionApplyConfiguration) WithStatus(value *CustomRes
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *CustomResourceDefinitionApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitioncondition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitioncondition.go
index 2cf9dd4e50e..fb070cb6a87 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitioncondition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitioncondition.go
@@ -23,7 +23,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// CustomResourceDefinitionConditionApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionCondition type for use
+// CustomResourceDefinitionConditionApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionCondition type for use
// with apply.
type CustomResourceDefinitionConditionApplyConfiguration struct {
Type *v1.CustomResourceDefinitionConditionType `json:"type,omitempty"`
@@ -33,7 +33,7 @@ type CustomResourceDefinitionConditionApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
-// CustomResourceDefinitionConditionApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionCondition type for use with
+// CustomResourceDefinitionConditionApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionCondition type for use with
// apply.
func CustomResourceDefinitionCondition() *CustomResourceDefinitionConditionApplyConfiguration {
return &CustomResourceDefinitionConditionApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionnames.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionnames.go
index 06b7a40428d..ca0c02f0e09 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionnames.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionnames.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1
-// CustomResourceDefinitionNamesApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionNames type for use
+// CustomResourceDefinitionNamesApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionNames type for use
// with apply.
type CustomResourceDefinitionNamesApplyConfiguration struct {
Plural *string `json:"plural,omitempty"`
@@ -29,7 +29,7 @@ type CustomResourceDefinitionNamesApplyConfiguration struct {
Categories []string `json:"categories,omitempty"`
}
-// CustomResourceDefinitionNamesApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionNames type for use with
+// CustomResourceDefinitionNamesApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionNames type for use with
// apply.
func CustomResourceDefinitionNames() *CustomResourceDefinitionNamesApplyConfiguration {
return &CustomResourceDefinitionNamesApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionspec.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionspec.go
index 0f52e4b16b9..9d0573f44be 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionspec.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionspec.go
@@ -22,7 +22,7 @@ import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
-// CustomResourceDefinitionSpecApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionSpec type for use
+// CustomResourceDefinitionSpecApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionSpec type for use
// with apply.
type CustomResourceDefinitionSpecApplyConfiguration struct {
Group *string `json:"group,omitempty"`
@@ -33,7 +33,7 @@ type CustomResourceDefinitionSpecApplyConfiguration struct {
PreserveUnknownFields *bool `json:"preserveUnknownFields,omitempty"`
}
-// CustomResourceDefinitionSpecApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionSpec type for use with
+// CustomResourceDefinitionSpecApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionSpec type for use with
// apply.
func CustomResourceDefinitionSpec() *CustomResourceDefinitionSpecApplyConfiguration {
return &CustomResourceDefinitionSpecApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionstatus.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionstatus.go
index a30fb726bc8..4fd09be5a0e 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionstatus.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionstatus.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1
-// CustomResourceDefinitionStatusApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionStatus type for use
+// CustomResourceDefinitionStatusApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionStatus type for use
// with apply.
type CustomResourceDefinitionStatusApplyConfiguration struct {
Conditions []CustomResourceDefinitionConditionApplyConfiguration `json:"conditions,omitempty"`
@@ -26,7 +26,7 @@ type CustomResourceDefinitionStatusApplyConfiguration struct {
StoredVersions []string `json:"storedVersions,omitempty"`
}
-// CustomResourceDefinitionStatusApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionStatus type for use with
+// CustomResourceDefinitionStatusApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionStatus type for use with
// apply.
func CustomResourceDefinitionStatus() *CustomResourceDefinitionStatusApplyConfiguration {
return &CustomResourceDefinitionStatusApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionversion.go
index 1019b03e9dc..f96ba88f467 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinitionversion.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1
-// CustomResourceDefinitionVersionApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionVersion type for use
+// CustomResourceDefinitionVersionApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionVersion type for use
// with apply.
type CustomResourceDefinitionVersionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -29,9 +29,10 @@ type CustomResourceDefinitionVersionApplyConfiguration struct {
Schema *CustomResourceValidationApplyConfiguration `json:"schema,omitempty"`
Subresources *CustomResourceSubresourcesApplyConfiguration `json:"subresources,omitempty"`
AdditionalPrinterColumns []CustomResourceColumnDefinitionApplyConfiguration `json:"additionalPrinterColumns,omitempty"`
+ SelectableFields []SelectableFieldApplyConfiguration `json:"selectableFields,omitempty"`
}
-// CustomResourceDefinitionVersionApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionVersion type for use with
+// CustomResourceDefinitionVersionApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionVersion type for use with
// apply.
func CustomResourceDefinitionVersion() *CustomResourceDefinitionVersionApplyConfiguration {
return &CustomResourceDefinitionVersionApplyConfiguration{}
@@ -105,3 +106,16 @@ func (b *CustomResourceDefinitionVersionApplyConfiguration) WithAdditionalPrinte
}
return b
}
+
+// WithSelectableFields adds the given value to the SelectableFields field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the SelectableFields field.
+func (b *CustomResourceDefinitionVersionApplyConfiguration) WithSelectableFields(values ...*SelectableFieldApplyConfiguration) *CustomResourceDefinitionVersionApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithSelectableFields")
+ }
+ b.SelectableFields = append(b.SelectableFields, *values[i])
+ }
+ return b
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresources.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresources.go
index e91ede17827..e66e710c401 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresources.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresources.go
@@ -22,14 +22,14 @@ import (
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
-// CustomResourceSubresourcesApplyConfiguration represents an declarative configuration of the CustomResourceSubresources type for use
+// CustomResourceSubresourcesApplyConfiguration represents a declarative configuration of the CustomResourceSubresources type for use
// with apply.
type CustomResourceSubresourcesApplyConfiguration struct {
Status *v1.CustomResourceSubresourceStatus `json:"status,omitempty"`
Scale *CustomResourceSubresourceScaleApplyConfiguration `json:"scale,omitempty"`
}
-// CustomResourceSubresourcesApplyConfiguration constructs an declarative configuration of the CustomResourceSubresources type for use with
+// CustomResourceSubresourcesApplyConfiguration constructs a declarative configuration of the CustomResourceSubresources type for use with
// apply.
func CustomResourceSubresources() *CustomResourceSubresourcesApplyConfiguration {
return &CustomResourceSubresourcesApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresourcescale.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresourcescale.go
index 8159cec2a74..7859675fdd1 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresourcescale.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcesubresourcescale.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1
-// CustomResourceSubresourceScaleApplyConfiguration represents an declarative configuration of the CustomResourceSubresourceScale type for use
+// CustomResourceSubresourceScaleApplyConfiguration represents a declarative configuration of the CustomResourceSubresourceScale type for use
// with apply.
type CustomResourceSubresourceScaleApplyConfiguration struct {
SpecReplicasPath *string `json:"specReplicasPath,omitempty"`
@@ -26,7 +26,7 @@ type CustomResourceSubresourceScaleApplyConfiguration struct {
LabelSelectorPath *string `json:"labelSelectorPath,omitempty"`
}
-// CustomResourceSubresourceScaleApplyConfiguration constructs an declarative configuration of the CustomResourceSubresourceScale type for use with
+// CustomResourceSubresourceScaleApplyConfiguration constructs a declarative configuration of the CustomResourceSubresourceScale type for use with
// apply.
func CustomResourceSubresourceScale() *CustomResourceSubresourceScaleApplyConfiguration {
return &CustomResourceSubresourceScaleApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcevalidation.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcevalidation.go
index 2e0bcbcb5f7..6a8cf17d551 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcevalidation.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcevalidation.go
@@ -18,13 +18,13 @@ limitations under the License.
package v1
-// CustomResourceValidationApplyConfiguration represents an declarative configuration of the CustomResourceValidation type for use
+// CustomResourceValidationApplyConfiguration represents a declarative configuration of the CustomResourceValidation type for use
// with apply.
type CustomResourceValidationApplyConfiguration struct {
OpenAPIV3Schema *JSONSchemaPropsApplyConfiguration `json:"openAPIV3Schema,omitempty"`
}
-// CustomResourceValidationApplyConfiguration constructs an declarative configuration of the CustomResourceValidation type for use with
+// CustomResourceValidationApplyConfiguration constructs a declarative configuration of the CustomResourceValidation type for use with
// apply.
func CustomResourceValidation() *CustomResourceValidationApplyConfiguration {
return &CustomResourceValidationApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/externaldocumentation.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/externaldocumentation.go
index 61856a15cea..761a957a025 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/externaldocumentation.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/externaldocumentation.go
@@ -18,14 +18,14 @@ limitations under the License.
package v1
-// ExternalDocumentationApplyConfiguration represents an declarative configuration of the ExternalDocumentation type for use
+// ExternalDocumentationApplyConfiguration represents a declarative configuration of the ExternalDocumentation type for use
// with apply.
type ExternalDocumentationApplyConfiguration struct {
Description *string `json:"description,omitempty"`
URL *string `json:"url,omitempty"`
}
-// ExternalDocumentationApplyConfiguration constructs an declarative configuration of the ExternalDocumentation type for use with
+// ExternalDocumentationApplyConfiguration constructs a declarative configuration of the ExternalDocumentation type for use with
// apply.
func ExternalDocumentation() *ExternalDocumentationApplyConfiguration {
return &ExternalDocumentationApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/jsonschemaprops.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/jsonschemaprops.go
index 730203add1a..1acbe613077 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/jsonschemaprops.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/jsonschemaprops.go
@@ -22,7 +22,7 @@ import (
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
-// JSONSchemaPropsApplyConfiguration represents an declarative configuration of the JSONSchemaProps type for use
+// JSONSchemaPropsApplyConfiguration represents a declarative configuration of the JSONSchemaProps type for use
// with apply.
type JSONSchemaPropsApplyConfiguration struct {
ID *string `json:"id,omitempty"`
@@ -71,7 +71,7 @@ type JSONSchemaPropsApplyConfiguration struct {
XValidations *v1.ValidationRules `json:"x-kubernetes-validations,omitempty"`
}
-// JSONSchemaPropsApplyConfiguration constructs an declarative configuration of the JSONSchemaProps type for use with
+// JSONSchemaPropsApplyConfiguration constructs a declarative configuration of the JSONSchemaProps type for use with
// apply.
func JSONSchemaProps() *JSONSchemaPropsApplyConfiguration {
return &JSONSchemaPropsApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/selectablefield.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/selectablefield.go
new file mode 100644
index 00000000000..33f655a7648
--- /dev/null
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/selectablefield.go
@@ -0,0 +1,39 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// SelectableFieldApplyConfiguration represents a declarative configuration of the SelectableField type for use
+// with apply.
+type SelectableFieldApplyConfiguration struct {
+ JSONPath *string `json:"jsonPath,omitempty"`
+}
+
+// SelectableFieldApplyConfiguration constructs a declarative configuration of the SelectableField type for use with
+// apply.
+func SelectableField() *SelectableFieldApplyConfiguration {
+ return &SelectableFieldApplyConfiguration{}
+}
+
+// WithJSONPath sets the JSONPath field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the JSONPath field is set to the value of the last call.
+func (b *SelectableFieldApplyConfiguration) WithJSONPath(value string) *SelectableFieldApplyConfiguration {
+ b.JSONPath = &value
+ return b
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/servicereference.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/servicereference.go
index 2cd55d9ea20..239780664df 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/servicereference.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/servicereference.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1
-// ServiceReferenceApplyConfiguration represents an declarative configuration of the ServiceReference type for use
+// ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use
// with apply.
type ServiceReferenceApplyConfiguration struct {
Namespace *string `json:"namespace,omitempty"`
@@ -27,7 +27,7 @@ type ServiceReferenceApplyConfiguration struct {
Port *int32 `json:"port,omitempty"`
}
-// ServiceReferenceApplyConfiguration constructs an declarative configuration of the ServiceReference type for use with
+// ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with
// apply.
func ServiceReference() *ServiceReferenceApplyConfiguration {
return &ServiceReferenceApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go
index c0eb0b51bd8..e5fc80c7e91 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/validationrule.go
@@ -22,7 +22,7 @@ import (
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
-// ValidationRuleApplyConfiguration represents an declarative configuration of the ValidationRule type for use
+// ValidationRuleApplyConfiguration represents a declarative configuration of the ValidationRule type for use
// with apply.
type ValidationRuleApplyConfiguration struct {
Rule *string `json:"rule,omitempty"`
@@ -33,7 +33,7 @@ type ValidationRuleApplyConfiguration struct {
OptionalOldSelf *bool `json:"optionalOldSelf,omitempty"`
}
-// ValidationRuleApplyConfiguration constructs an declarative configuration of the ValidationRule type for use with
+// ValidationRuleApplyConfiguration constructs a declarative configuration of the ValidationRule type for use with
// apply.
func ValidationRule() *ValidationRuleApplyConfiguration {
return &ValidationRuleApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookclientconfig.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookclientconfig.go
index aa358ae2059..77f2227b95c 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookclientconfig.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookclientconfig.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1
-// WebhookClientConfigApplyConfiguration represents an declarative configuration of the WebhookClientConfig type for use
+// WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use
// with apply.
type WebhookClientConfigApplyConfiguration struct {
URL *string `json:"url,omitempty"`
@@ -26,7 +26,7 @@ type WebhookClientConfigApplyConfiguration struct {
CABundle []byte `json:"caBundle,omitempty"`
}
-// WebhookClientConfigApplyConfiguration constructs an declarative configuration of the WebhookClientConfig type for use with
+// WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with
// apply.
func WebhookClientConfig() *WebhookClientConfigApplyConfiguration {
return &WebhookClientConfigApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookconversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookconversion.go
index 2af1b70ba49..884fbc5fa85 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookconversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/webhookconversion.go
@@ -18,14 +18,14 @@ limitations under the License.
package v1
-// WebhookConversionApplyConfiguration represents an declarative configuration of the WebhookConversion type for use
+// WebhookConversionApplyConfiguration represents a declarative configuration of the WebhookConversion type for use
// with apply.
type WebhookConversionApplyConfiguration struct {
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
ConversionReviewVersions []string `json:"conversionReviewVersions,omitempty"`
}
-// WebhookConversionApplyConfiguration constructs an declarative configuration of the WebhookConversion type for use with
+// WebhookConversionApplyConfiguration constructs a declarative configuration of the WebhookConversion type for use with
// apply.
func WebhookConversion() *WebhookConversionApplyConfiguration {
return &WebhookConversionApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcecolumndefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcecolumndefinition.go
index e4731784345..9ee2318d1a5 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcecolumndefinition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcecolumndefinition.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1beta1
-// CustomResourceColumnDefinitionApplyConfiguration represents an declarative configuration of the CustomResourceColumnDefinition type for use
+// CustomResourceColumnDefinitionApplyConfiguration represents a declarative configuration of the CustomResourceColumnDefinition type for use
// with apply.
type CustomResourceColumnDefinitionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -29,7 +29,7 @@ type CustomResourceColumnDefinitionApplyConfiguration struct {
JSONPath *string `json:"JSONPath,omitempty"`
}
-// CustomResourceColumnDefinitionApplyConfiguration constructs an declarative configuration of the CustomResourceColumnDefinition type for use with
+// CustomResourceColumnDefinitionApplyConfiguration constructs a declarative configuration of the CustomResourceColumnDefinition type for use with
// apply.
func CustomResourceColumnDefinition() *CustomResourceColumnDefinitionApplyConfiguration {
return &CustomResourceColumnDefinitionApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourceconversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourceconversion.go
index d9825f85a91..b0171f16a02 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourceconversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourceconversion.go
@@ -22,7 +22,7 @@ import (
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
)
-// CustomResourceConversionApplyConfiguration represents an declarative configuration of the CustomResourceConversion type for use
+// CustomResourceConversionApplyConfiguration represents a declarative configuration of the CustomResourceConversion type for use
// with apply.
type CustomResourceConversionApplyConfiguration struct {
Strategy *v1beta1.ConversionStrategyType `json:"strategy,omitempty"`
@@ -30,7 +30,7 @@ type CustomResourceConversionApplyConfiguration struct {
ConversionReviewVersions []string `json:"conversionReviewVersions,omitempty"`
}
-// CustomResourceConversionApplyConfiguration constructs an declarative configuration of the CustomResourceConversion type for use with
+// CustomResourceConversionApplyConfiguration constructs a declarative configuration of the CustomResourceConversion type for use with
// apply.
func CustomResourceConversion() *CustomResourceConversionApplyConfiguration {
return &CustomResourceConversionApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go
index 9117748c758..bbda3793248 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go
@@ -24,7 +24,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// CustomResourceDefinitionApplyConfiguration represents an declarative configuration of the CustomResourceDefinition type for use
+// CustomResourceDefinitionApplyConfiguration represents a declarative configuration of the CustomResourceDefinition type for use
// with apply.
type CustomResourceDefinitionApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -33,7 +33,7 @@ type CustomResourceDefinitionApplyConfiguration struct {
Status *CustomResourceDefinitionStatusApplyConfiguration `json:"status,omitempty"`
}
-// CustomResourceDefinition constructs an declarative configuration of the CustomResourceDefinition type for use with
+// CustomResourceDefinition constructs a declarative configuration of the CustomResourceDefinition type for use with
// apply.
func CustomResourceDefinition(name string) *CustomResourceDefinitionApplyConfiguration {
b := &CustomResourceDefinitionApplyConfiguration{}
@@ -216,3 +216,9 @@ func (b *CustomResourceDefinitionApplyConfiguration) WithStatus(value *CustomRes
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *CustomResourceDefinitionApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitioncondition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitioncondition.go
index cf2400c9c28..7f2f132ac78 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitioncondition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitioncondition.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// CustomResourceDefinitionConditionApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionCondition type for use
+// CustomResourceDefinitionConditionApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionCondition type for use
// with apply.
type CustomResourceDefinitionConditionApplyConfiguration struct {
Type *v1beta1.CustomResourceDefinitionConditionType `json:"type,omitempty"`
@@ -33,7 +33,7 @@ type CustomResourceDefinitionConditionApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
-// CustomResourceDefinitionConditionApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionCondition type for use with
+// CustomResourceDefinitionConditionApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionCondition type for use with
// apply.
func CustomResourceDefinitionCondition() *CustomResourceDefinitionConditionApplyConfiguration {
return &CustomResourceDefinitionConditionApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionnames.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionnames.go
index a20200723ce..44b49bcbbeb 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionnames.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionnames.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1beta1
-// CustomResourceDefinitionNamesApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionNames type for use
+// CustomResourceDefinitionNamesApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionNames type for use
// with apply.
type CustomResourceDefinitionNamesApplyConfiguration struct {
Plural *string `json:"plural,omitempty"`
@@ -29,7 +29,7 @@ type CustomResourceDefinitionNamesApplyConfiguration struct {
Categories []string `json:"categories,omitempty"`
}
-// CustomResourceDefinitionNamesApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionNames type for use with
+// CustomResourceDefinitionNamesApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionNames type for use with
// apply.
func CustomResourceDefinitionNames() *CustomResourceDefinitionNamesApplyConfiguration {
return &CustomResourceDefinitionNamesApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionspec.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionspec.go
index f8c2903757b..5046882ae10 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionspec.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionspec.go
@@ -22,7 +22,7 @@ import (
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
)
-// CustomResourceDefinitionSpecApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionSpec type for use
+// CustomResourceDefinitionSpecApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionSpec type for use
// with apply.
type CustomResourceDefinitionSpecApplyConfiguration struct {
Group *string `json:"group,omitempty"`
@@ -33,11 +33,12 @@ type CustomResourceDefinitionSpecApplyConfiguration struct {
Subresources *CustomResourceSubresourcesApplyConfiguration `json:"subresources,omitempty"`
Versions []CustomResourceDefinitionVersionApplyConfiguration `json:"versions,omitempty"`
AdditionalPrinterColumns []CustomResourceColumnDefinitionApplyConfiguration `json:"additionalPrinterColumns,omitempty"`
+ SelectableFields []SelectableFieldApplyConfiguration `json:"selectableFields,omitempty"`
Conversion *CustomResourceConversionApplyConfiguration `json:"conversion,omitempty"`
PreserveUnknownFields *bool `json:"preserveUnknownFields,omitempty"`
}
-// CustomResourceDefinitionSpecApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionSpec type for use with
+// CustomResourceDefinitionSpecApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionSpec type for use with
// apply.
func CustomResourceDefinitionSpec() *CustomResourceDefinitionSpecApplyConfiguration {
return &CustomResourceDefinitionSpecApplyConfiguration{}
@@ -117,6 +118,19 @@ func (b *CustomResourceDefinitionSpecApplyConfiguration) WithAdditionalPrinterCo
return b
}
+// WithSelectableFields adds the given value to the SelectableFields field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the SelectableFields field.
+func (b *CustomResourceDefinitionSpecApplyConfiguration) WithSelectableFields(values ...*SelectableFieldApplyConfiguration) *CustomResourceDefinitionSpecApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithSelectableFields")
+ }
+ b.SelectableFields = append(b.SelectableFields, *values[i])
+ }
+ return b
+}
+
// WithConversion sets the Conversion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Conversion field is set to the value of the last call.
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionstatus.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionstatus.go
index 79b2ebdabba..2c9c5e23c1a 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionstatus.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionstatus.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1beta1
-// CustomResourceDefinitionStatusApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionStatus type for use
+// CustomResourceDefinitionStatusApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionStatus type for use
// with apply.
type CustomResourceDefinitionStatusApplyConfiguration struct {
Conditions []CustomResourceDefinitionConditionApplyConfiguration `json:"conditions,omitempty"`
@@ -26,7 +26,7 @@ type CustomResourceDefinitionStatusApplyConfiguration struct {
StoredVersions []string `json:"storedVersions,omitempty"`
}
-// CustomResourceDefinitionStatusApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionStatus type for use with
+// CustomResourceDefinitionStatusApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionStatus type for use with
// apply.
func CustomResourceDefinitionStatus() *CustomResourceDefinitionStatusApplyConfiguration {
return &CustomResourceDefinitionStatusApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionversion.go
index 605a9f0a3fc..19ac26b039a 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionversion.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinitionversion.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1beta1
-// CustomResourceDefinitionVersionApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionVersion type for use
+// CustomResourceDefinitionVersionApplyConfiguration represents a declarative configuration of the CustomResourceDefinitionVersion type for use
// with apply.
type CustomResourceDefinitionVersionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -29,9 +29,10 @@ type CustomResourceDefinitionVersionApplyConfiguration struct {
Schema *CustomResourceValidationApplyConfiguration `json:"schema,omitempty"`
Subresources *CustomResourceSubresourcesApplyConfiguration `json:"subresources,omitempty"`
AdditionalPrinterColumns []CustomResourceColumnDefinitionApplyConfiguration `json:"additionalPrinterColumns,omitempty"`
+ SelectableFields []SelectableFieldApplyConfiguration `json:"selectableFields,omitempty"`
}
-// CustomResourceDefinitionVersionApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionVersion type for use with
+// CustomResourceDefinitionVersionApplyConfiguration constructs a declarative configuration of the CustomResourceDefinitionVersion type for use with
// apply.
func CustomResourceDefinitionVersion() *CustomResourceDefinitionVersionApplyConfiguration {
return &CustomResourceDefinitionVersionApplyConfiguration{}
@@ -105,3 +106,16 @@ func (b *CustomResourceDefinitionVersionApplyConfiguration) WithAdditionalPrinte
}
return b
}
+
+// WithSelectableFields adds the given value to the SelectableFields field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the SelectableFields field.
+func (b *CustomResourceDefinitionVersionApplyConfiguration) WithSelectableFields(values ...*SelectableFieldApplyConfiguration) *CustomResourceDefinitionVersionApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithSelectableFields")
+ }
+ b.SelectableFields = append(b.SelectableFields, *values[i])
+ }
+ return b
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresources.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresources.go
index a62f8a20504..3847b8789c8 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresources.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresources.go
@@ -22,14 +22,14 @@ import (
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
)
-// CustomResourceSubresourcesApplyConfiguration represents an declarative configuration of the CustomResourceSubresources type for use
+// CustomResourceSubresourcesApplyConfiguration represents a declarative configuration of the CustomResourceSubresources type for use
// with apply.
type CustomResourceSubresourcesApplyConfiguration struct {
Status *v1beta1.CustomResourceSubresourceStatus `json:"status,omitempty"`
Scale *CustomResourceSubresourceScaleApplyConfiguration `json:"scale,omitempty"`
}
-// CustomResourceSubresourcesApplyConfiguration constructs an declarative configuration of the CustomResourceSubresources type for use with
+// CustomResourceSubresourcesApplyConfiguration constructs a declarative configuration of the CustomResourceSubresources type for use with
// apply.
func CustomResourceSubresources() *CustomResourceSubresourcesApplyConfiguration {
return &CustomResourceSubresourcesApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresourcescale.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresourcescale.go
index 72934ce97e4..b94d0e6685f 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresourcescale.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcesubresourcescale.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1beta1
-// CustomResourceSubresourceScaleApplyConfiguration represents an declarative configuration of the CustomResourceSubresourceScale type for use
+// CustomResourceSubresourceScaleApplyConfiguration represents a declarative configuration of the CustomResourceSubresourceScale type for use
// with apply.
type CustomResourceSubresourceScaleApplyConfiguration struct {
SpecReplicasPath *string `json:"specReplicasPath,omitempty"`
@@ -26,7 +26,7 @@ type CustomResourceSubresourceScaleApplyConfiguration struct {
LabelSelectorPath *string `json:"labelSelectorPath,omitempty"`
}
-// CustomResourceSubresourceScaleApplyConfiguration constructs an declarative configuration of the CustomResourceSubresourceScale type for use with
+// CustomResourceSubresourceScaleApplyConfiguration constructs a declarative configuration of the CustomResourceSubresourceScale type for use with
// apply.
func CustomResourceSubresourceScale() *CustomResourceSubresourceScaleApplyConfiguration {
return &CustomResourceSubresourceScaleApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcevalidation.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcevalidation.go
index 9f65653da00..a5cf3c096b6 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcevalidation.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcevalidation.go
@@ -18,13 +18,13 @@ limitations under the License.
package v1beta1
-// CustomResourceValidationApplyConfiguration represents an declarative configuration of the CustomResourceValidation type for use
+// CustomResourceValidationApplyConfiguration represents a declarative configuration of the CustomResourceValidation type for use
// with apply.
type CustomResourceValidationApplyConfiguration struct {
OpenAPIV3Schema *JSONSchemaPropsApplyConfiguration `json:"openAPIV3Schema,omitempty"`
}
-// CustomResourceValidationApplyConfiguration constructs an declarative configuration of the CustomResourceValidation type for use with
+// CustomResourceValidationApplyConfiguration constructs a declarative configuration of the CustomResourceValidation type for use with
// apply.
func CustomResourceValidation() *CustomResourceValidationApplyConfiguration {
return &CustomResourceValidationApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/externaldocumentation.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/externaldocumentation.go
index 360f6d9695b..5140d66ceb9 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/externaldocumentation.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/externaldocumentation.go
@@ -18,14 +18,14 @@ limitations under the License.
package v1beta1
-// ExternalDocumentationApplyConfiguration represents an declarative configuration of the ExternalDocumentation type for use
+// ExternalDocumentationApplyConfiguration represents a declarative configuration of the ExternalDocumentation type for use
// with apply.
type ExternalDocumentationApplyConfiguration struct {
Description *string `json:"description,omitempty"`
URL *string `json:"url,omitempty"`
}
-// ExternalDocumentationApplyConfiguration constructs an declarative configuration of the ExternalDocumentation type for use with
+// ExternalDocumentationApplyConfiguration constructs a declarative configuration of the ExternalDocumentation type for use with
// apply.
func ExternalDocumentation() *ExternalDocumentationApplyConfiguration {
return &ExternalDocumentationApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/jsonschemaprops.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/jsonschemaprops.go
index 158b5750d0f..9c588e2a129 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/jsonschemaprops.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/jsonschemaprops.go
@@ -22,7 +22,7 @@ import (
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
)
-// JSONSchemaPropsApplyConfiguration represents an declarative configuration of the JSONSchemaProps type for use
+// JSONSchemaPropsApplyConfiguration represents a declarative configuration of the JSONSchemaProps type for use
// with apply.
type JSONSchemaPropsApplyConfiguration struct {
ID *string `json:"id,omitempty"`
@@ -71,7 +71,7 @@ type JSONSchemaPropsApplyConfiguration struct {
XValidations *v1beta1.ValidationRules `json:"x-kubernetes-validations,omitempty"`
}
-// JSONSchemaPropsApplyConfiguration constructs an declarative configuration of the JSONSchemaProps type for use with
+// JSONSchemaPropsApplyConfiguration constructs a declarative configuration of the JSONSchemaProps type for use with
// apply.
func JSONSchemaProps() *JSONSchemaPropsApplyConfiguration {
return &JSONSchemaPropsApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/selectablefield.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/selectablefield.go
new file mode 100644
index 00000000000..1a372e6fafd
--- /dev/null
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/selectablefield.go
@@ -0,0 +1,39 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// SelectableFieldApplyConfiguration represents a declarative configuration of the SelectableField type for use
+// with apply.
+type SelectableFieldApplyConfiguration struct {
+ JSONPath *string `json:"jsonPath,omitempty"`
+}
+
+// SelectableFieldApplyConfiguration constructs a declarative configuration of the SelectableField type for use with
+// apply.
+func SelectableField() *SelectableFieldApplyConfiguration {
+ return &SelectableFieldApplyConfiguration{}
+}
+
+// WithJSONPath sets the JSONPath field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the JSONPath field is set to the value of the last call.
+func (b *SelectableFieldApplyConfiguration) WithJSONPath(value string) *SelectableFieldApplyConfiguration {
+ b.JSONPath = &value
+ return b
+}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/servicereference.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/servicereference.go
index c21b5749085..70cc6b5b271 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/servicereference.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/servicereference.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1beta1
-// ServiceReferenceApplyConfiguration represents an declarative configuration of the ServiceReference type for use
+// ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use
// with apply.
type ServiceReferenceApplyConfiguration struct {
Namespace *string `json:"namespace,omitempty"`
@@ -27,7 +27,7 @@ type ServiceReferenceApplyConfiguration struct {
Port *int32 `json:"port,omitempty"`
}
-// ServiceReferenceApplyConfiguration constructs an declarative configuration of the ServiceReference type for use with
+// ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with
// apply.
func ServiceReference() *ServiceReferenceApplyConfiguration {
return &ServiceReferenceApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go
index 1b0df078b5b..e245ded1a1d 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/validationrule.go
@@ -22,7 +22,7 @@ import (
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
)
-// ValidationRuleApplyConfiguration represents an declarative configuration of the ValidationRule type for use
+// ValidationRuleApplyConfiguration represents a declarative configuration of the ValidationRule type for use
// with apply.
type ValidationRuleApplyConfiguration struct {
Rule *string `json:"rule,omitempty"`
@@ -33,7 +33,7 @@ type ValidationRuleApplyConfiguration struct {
OptionalOldSelf *bool `json:"optionalOldSelf,omitempty"`
}
-// ValidationRuleApplyConfiguration constructs an declarative configuration of the ValidationRule type for use with
+// ValidationRuleApplyConfiguration constructs a declarative configuration of the ValidationRule type for use with
// apply.
func ValidationRule() *ValidationRuleApplyConfiguration {
return &ValidationRuleApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/webhookclientconfig.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/webhookclientconfig.go
index 490f9d5f3f8..76ff71b4aec 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/webhookclientconfig.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/webhookclientconfig.go
@@ -18,7 +18,7 @@ limitations under the License.
package v1beta1
-// WebhookClientConfigApplyConfiguration represents an declarative configuration of the WebhookClientConfig type for use
+// WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use
// with apply.
type WebhookClientConfigApplyConfiguration struct {
URL *string `json:"url,omitempty"`
@@ -26,7 +26,7 @@ type WebhookClientConfigApplyConfiguration struct {
CABundle []byte `json:"caBundle,omitempty"`
}
-// WebhookClientConfigApplyConfiguration constructs an declarative configuration of the WebhookClientConfig type for use with
+// WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with
// apply.
func WebhookClientConfig() *WebhookClientConfigApplyConfiguration {
return &WebhookClientConfigApplyConfiguration{}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go
index 3949426cb74..03d3dea8209 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go
@@ -20,9 +20,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1"
@@ -30,7 +27,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// CustomResourceDefinitionsGetter has a method to return a CustomResourceDefinitionInterface.
@@ -43,6 +40,7 @@ type CustomResourceDefinitionsGetter interface {
type CustomResourceDefinitionInterface interface {
Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.CreateOptions) (*v1.CustomResourceDefinition, error)
Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -51,193 +49,25 @@ type CustomResourceDefinitionInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CustomResourceDefinition, err error)
Apply(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error)
CustomResourceDefinitionExpansion
}
// customResourceDefinitions implements CustomResourceDefinitionInterface
type customResourceDefinitions struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.CustomResourceDefinition, *v1.CustomResourceDefinitionList, *apiextensionsv1.CustomResourceDefinitionApplyConfiguration]
}
// newCustomResourceDefinitions returns a CustomResourceDefinitions
func newCustomResourceDefinitions(c *ApiextensionsV1Client) *customResourceDefinitions {
return &customResourceDefinitions{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.CustomResourceDefinition, *v1.CustomResourceDefinitionList, *apiextensionsv1.CustomResourceDefinitionApplyConfiguration](
+ "customresourcedefinitions",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.CustomResourceDefinition { return &v1.CustomResourceDefinition{} },
+ func() *v1.CustomResourceDefinitionList { return &v1.CustomResourceDefinitionList{} }),
}
}
-
-// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any.
-func (c *customResourceDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CustomResourceDefinition, err error) {
- result = &v1.CustomResourceDefinition{}
- err = c.client.Get().
- Resource("customresourcedefinitions").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors.
-func (c *customResourceDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CustomResourceDefinitionList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.CustomResourceDefinitionList{}
- err = c.client.Get().
- Resource("customresourcedefinitions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested customResourceDefinitions.
-func (c *customResourceDefinitions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("customresourcedefinitions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
-func (c *customResourceDefinitions) Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.CreateOptions) (result *v1.CustomResourceDefinition, err error) {
- result = &v1.CustomResourceDefinition{}
- err = c.client.Post().
- Resource("customresourcedefinitions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(customResourceDefinition).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
-func (c *customResourceDefinitions) Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (result *v1.CustomResourceDefinition, err error) {
- result = &v1.CustomResourceDefinition{}
- err = c.client.Put().
- Resource("customresourcedefinitions").
- Name(customResourceDefinition.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(customResourceDefinition).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *customResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (result *v1.CustomResourceDefinition, err error) {
- result = &v1.CustomResourceDefinition{}
- err = c.client.Put().
- Resource("customresourcedefinitions").
- Name(customResourceDefinition.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(customResourceDefinition).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs.
-func (c *customResourceDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("customresourcedefinitions").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *customResourceDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("customresourcedefinitions").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched customResourceDefinition.
-func (c *customResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CustomResourceDefinition, err error) {
- result = &v1.CustomResourceDefinition{}
- err = c.client.Patch(pt).
- Resource("customresourcedefinitions").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied customResourceDefinition.
-func (c *customResourceDefinitions) Apply(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) {
- if customResourceDefinition == nil {
- return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(customResourceDefinition)
- if err != nil {
- return nil, err
- }
- name := customResourceDefinition.Name
- if name == nil {
- return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply")
- }
- result = &v1.CustomResourceDefinition{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("customresourcedefinitions").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *customResourceDefinitions) ApplyStatus(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) {
- if customResourceDefinition == nil {
- return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(customResourceDefinition)
- if err != nil {
- return nil, err
- }
-
- name := customResourceDefinition.Name
- if name == nil {
- return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply")
- }
-
- result = &v1.CustomResourceDefinition{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("customresourcedefinitions").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go
index 0e5b482a30b..47f9655975e 100644
--- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go
+++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go
@@ -20,9 +20,6 @@ package v1beta1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1"
@@ -30,7 +27,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// CustomResourceDefinitionsGetter has a method to return a CustomResourceDefinitionInterface.
@@ -43,6 +40,7 @@ type CustomResourceDefinitionsGetter interface {
type CustomResourceDefinitionInterface interface {
Create(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.CreateOptions) (*v1beta1.CustomResourceDefinition, error)
Update(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.UpdateOptions) (*v1beta1.CustomResourceDefinition, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.UpdateOptions) (*v1beta1.CustomResourceDefinition, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -51,193 +49,25 @@ type CustomResourceDefinitionInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error)
Apply(ctx context.Context, customResourceDefinition *apiextensionsv1beta1.CustomResourceDefinitionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CustomResourceDefinition, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, customResourceDefinition *apiextensionsv1beta1.CustomResourceDefinitionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CustomResourceDefinition, err error)
CustomResourceDefinitionExpansion
}
// customResourceDefinitions implements CustomResourceDefinitionInterface
type customResourceDefinitions struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1beta1.CustomResourceDefinition, *v1beta1.CustomResourceDefinitionList, *apiextensionsv1beta1.CustomResourceDefinitionApplyConfiguration]
}
// newCustomResourceDefinitions returns a CustomResourceDefinitions
func newCustomResourceDefinitions(c *ApiextensionsV1beta1Client) *customResourceDefinitions {
return &customResourceDefinitions{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1beta1.CustomResourceDefinition, *v1beta1.CustomResourceDefinitionList, *apiextensionsv1beta1.CustomResourceDefinitionApplyConfiguration](
+ "customresourcedefinitions",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1beta1.CustomResourceDefinition { return &v1beta1.CustomResourceDefinition{} },
+ func() *v1beta1.CustomResourceDefinitionList { return &v1beta1.CustomResourceDefinitionList{} }),
}
}
-
-// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any.
-func (c *customResourceDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) {
- result = &v1beta1.CustomResourceDefinition{}
- err = c.client.Get().
- Resource("customresourcedefinitions").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors.
-func (c *customResourceDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1beta1.CustomResourceDefinitionList{}
- err = c.client.Get().
- Resource("customresourcedefinitions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested customResourceDefinitions.
-func (c *customResourceDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("customresourcedefinitions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
-func (c *customResourceDefinitions) Create(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.CreateOptions) (result *v1beta1.CustomResourceDefinition, err error) {
- result = &v1beta1.CustomResourceDefinition{}
- err = c.client.Post().
- Resource("customresourcedefinitions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(customResourceDefinition).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
-func (c *customResourceDefinitions) Update(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.UpdateOptions) (result *v1beta1.CustomResourceDefinition, err error) {
- result = &v1beta1.CustomResourceDefinition{}
- err = c.client.Put().
- Resource("customresourcedefinitions").
- Name(customResourceDefinition.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(customResourceDefinition).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *customResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.UpdateOptions) (result *v1beta1.CustomResourceDefinition, err error) {
- result = &v1beta1.CustomResourceDefinition{}
- err = c.client.Put().
- Resource("customresourcedefinitions").
- Name(customResourceDefinition.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(customResourceDefinition).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs.
-func (c *customResourceDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("customresourcedefinitions").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *customResourceDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("customresourcedefinitions").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched customResourceDefinition.
-func (c *customResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) {
- result = &v1beta1.CustomResourceDefinition{}
- err = c.client.Patch(pt).
- Resource("customresourcedefinitions").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied customResourceDefinition.
-func (c *customResourceDefinitions) Apply(ctx context.Context, customResourceDefinition *apiextensionsv1beta1.CustomResourceDefinitionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CustomResourceDefinition, err error) {
- if customResourceDefinition == nil {
- return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(customResourceDefinition)
- if err != nil {
- return nil, err
- }
- name := customResourceDefinition.Name
- if name == nil {
- return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply")
- }
- result = &v1beta1.CustomResourceDefinition{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("customresourcedefinitions").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *customResourceDefinitions) ApplyStatus(ctx context.Context, customResourceDefinition *apiextensionsv1beta1.CustomResourceDefinitionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CustomResourceDefinition, err error) {
- if customResourceDefinition == nil {
- return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(customResourceDefinition)
- if err != nil {
- return nil, err
- }
-
- name := customResourceDefinition.Name
- if name == nil {
- return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply")
- }
-
- result = &v1beta1.CustomResourceDefinition{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("customresourcedefinitions").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go b/vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go
new file mode 100644
index 00000000000..72c6438cb61
--- /dev/null
+++ b/vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go
@@ -0,0 +1,165 @@
+/*
+Copyright 2018 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package testrestmapper
+
+import (
+ "k8s.io/apimachinery/pkg/api/meta"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/apimachinery/pkg/util/sets"
+)
+
+// TestOnlyStaticRESTMapper returns a union RESTMapper of all known types with priorities chosen in the following order:
+// 1. legacy kube group preferred version, extensions preferred version, metrics preferred version, legacy
+// kube any version, extensions any version, metrics any version, all other groups alphabetical preferred version,
+// all other groups alphabetical.
+//
+// TODO callers of this method should be updated to build their own specific restmapper based on their scheme for their tests
+// TODO the things being tested are related to whether various cases are handled, not tied to the particular types being checked.
+func TestOnlyStaticRESTMapper(scheme *runtime.Scheme, versionPatterns ...schema.GroupVersion) meta.RESTMapper {
+ unionMapper := meta.MultiRESTMapper{}
+ unionedGroups := sets.NewString()
+ for _, enabledVersion := range scheme.PrioritizedVersionsAllGroups() {
+ if !unionedGroups.Has(enabledVersion.Group) {
+ unionedGroups.Insert(enabledVersion.Group)
+ unionMapper = append(unionMapper, newRESTMapper(enabledVersion.Group, scheme))
+ }
+ }
+
+ if len(versionPatterns) != 0 {
+ resourcePriority := []schema.GroupVersionResource{}
+ kindPriority := []schema.GroupVersionKind{}
+ for _, versionPriority := range versionPatterns {
+ resourcePriority = append(resourcePriority, versionPriority.WithResource(meta.AnyResource))
+ kindPriority = append(kindPriority, versionPriority.WithKind(meta.AnyKind))
+ }
+
+ return meta.PriorityRESTMapper{Delegate: unionMapper, ResourcePriority: resourcePriority, KindPriority: kindPriority}
+ }
+
+ prioritizedGroups := []string{"", "extensions", "metrics"}
+ resourcePriority, kindPriority := prioritiesForGroups(scheme, prioritizedGroups...)
+
+ prioritizedGroupsSet := sets.NewString(prioritizedGroups...)
+ remainingGroups := sets.String{}
+ for _, enabledVersion := range scheme.PrioritizedVersionsAllGroups() {
+ if !prioritizedGroupsSet.Has(enabledVersion.Group) {
+ remainingGroups.Insert(enabledVersion.Group)
+ }
+ }
+
+ remainingResourcePriority, remainingKindPriority := prioritiesForGroups(scheme, remainingGroups.List()...)
+ resourcePriority = append(resourcePriority, remainingResourcePriority...)
+ kindPriority = append(kindPriority, remainingKindPriority...)
+
+ return meta.PriorityRESTMapper{Delegate: unionMapper, ResourcePriority: resourcePriority, KindPriority: kindPriority}
+}
+
+// prioritiesForGroups returns the resource and kind priorities for a PriorityRESTMapper, preferring the preferred version of each group first,
+// then any non-preferred version of the group second.
+func prioritiesForGroups(scheme *runtime.Scheme, groups ...string) ([]schema.GroupVersionResource, []schema.GroupVersionKind) {
+ resourcePriority := []schema.GroupVersionResource{}
+ kindPriority := []schema.GroupVersionKind{}
+
+ for _, group := range groups {
+ availableVersions := scheme.PrioritizedVersionsForGroup(group)
+ if len(availableVersions) > 0 {
+ resourcePriority = append(resourcePriority, availableVersions[0].WithResource(meta.AnyResource))
+ kindPriority = append(kindPriority, availableVersions[0].WithKind(meta.AnyKind))
+ }
+ }
+ for _, group := range groups {
+ resourcePriority = append(resourcePriority, schema.GroupVersionResource{Group: group, Version: meta.AnyVersion, Resource: meta.AnyResource})
+ kindPriority = append(kindPriority, schema.GroupVersionKind{Group: group, Version: meta.AnyVersion, Kind: meta.AnyKind})
+ }
+
+ return resourcePriority, kindPriority
+}
+
+func newRESTMapper(group string, scheme *runtime.Scheme) meta.RESTMapper {
+ mapper := meta.NewDefaultRESTMapper(scheme.PrioritizedVersionsForGroup(group))
+ for _, gv := range scheme.PrioritizedVersionsForGroup(group) {
+ for kind := range scheme.KnownTypes(gv) {
+ if ignoredKinds.Has(kind) {
+ continue
+ }
+ scope := meta.RESTScopeNamespace
+ if rootScopedKinds[gv.WithKind(kind).GroupKind()] {
+ scope = meta.RESTScopeRoot
+ }
+ mapper.Add(gv.WithKind(kind), scope)
+ }
+ }
+
+ return mapper
+}
+
+// hardcoded is good enough for the test we're running
+var rootScopedKinds = map[schema.GroupKind]bool{
+ {Group: "admission.k8s.io", Kind: "AdmissionReview"}: true,
+
+ {Group: "admissionregistration.k8s.io", Kind: "ValidatingWebhookConfiguration"}: true,
+ {Group: "admissionregistration.k8s.io", Kind: "MutatingWebhookConfiguration"}: true,
+
+ {Group: "authentication.k8s.io", Kind: "TokenReview"}: true,
+
+ {Group: "authorization.k8s.io", Kind: "SubjectAccessReview"}: true,
+ {Group: "authorization.k8s.io", Kind: "SelfSubjectAccessReview"}: true,
+ {Group: "authorization.k8s.io", Kind: "SelfSubjectRulesReview"}: true,
+
+ {Group: "certificates.k8s.io", Kind: "CertificateSigningRequest"}: true,
+
+ {Group: "", Kind: "Node"}: true,
+ {Group: "", Kind: "Namespace"}: true,
+ {Group: "", Kind: "PersistentVolume"}: true,
+ {Group: "", Kind: "ComponentStatus"}: true,
+
+ {Group: "rbac.authorization.k8s.io", Kind: "ClusterRole"}: true,
+ {Group: "rbac.authorization.k8s.io", Kind: "ClusterRoleBinding"}: true,
+
+ {Group: "scheduling.k8s.io", Kind: "PriorityClass"}: true,
+
+ {Group: "storage.k8s.io", Kind: "StorageClass"}: true,
+ {Group: "storage.k8s.io", Kind: "VolumeAttachment"}: true,
+
+ {Group: "apiextensions.k8s.io", Kind: "CustomResourceDefinition"}: true,
+
+ {Group: "apiserver.k8s.io", Kind: "AdmissionConfiguration"}: true,
+
+ {Group: "audit.k8s.io", Kind: "Event"}: true,
+ {Group: "audit.k8s.io", Kind: "Policy"}: true,
+
+ {Group: "apiregistration.k8s.io", Kind: "APIService"}: true,
+
+ {Group: "metrics.k8s.io", Kind: "NodeMetrics"}: true,
+
+ {Group: "wardle.example.com", Kind: "Fischer"}: true,
+}
+
+// hardcoded is good enough for the test we're running
+var ignoredKinds = sets.NewString(
+ "ListOptions",
+ "DeleteOptions",
+ "Status",
+ "PodLogOptions",
+ "PodExecOptions",
+ "PodAttachOptions",
+ "PodPortForwardOptions",
+ "PodProxyOptions",
+ "NodeProxyOptions",
+ "ServiceProxyOptions",
+)
diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
index 69f1bc336d3..50af8334f01 100644
--- a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
+++ b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
@@ -25,6 +25,8 @@ import (
"strconv"
"strings"
+ cbor "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
+
inf "gopkg.in/inf.v0"
)
@@ -683,6 +685,12 @@ func (q Quantity) MarshalJSON() ([]byte, error) {
return result, nil
}
+func (q Quantity) MarshalCBOR() ([]byte, error) {
+ // The call to String() should never return the string "" because the receiver's
+ // address will never be nil.
+ return cbor.Marshal(q.String())
+}
+
// ToUnstructured implements the value.UnstructuredConverter interface.
func (q Quantity) ToUnstructured() interface{} {
return q.String()
@@ -711,6 +719,27 @@ func (q *Quantity) UnmarshalJSON(value []byte) error {
return nil
}
+func (q *Quantity) UnmarshalCBOR(value []byte) error {
+ var s *string
+ if err := cbor.Unmarshal(value, &s); err != nil {
+ return err
+ }
+
+ if s == nil {
+ q.d.Dec = nil
+ q.i = int64Amount{}
+ return nil
+ }
+
+ parsed, err := ParseQuantity(strings.TrimSpace(*s))
+ if err != nil {
+ return err
+ }
+
+ *q = parsed
+ return nil
+}
+
// NewDecimalQuantity returns a new Quantity representing the given
// value in the given format.
func NewDecimalQuantity(b inf.Dec, format Format) *Quantity {
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/controller_ref.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/controller_ref.go
index 15b45ffa84b..5005beb12db 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/controller_ref.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/controller_ref.go
@@ -18,6 +18,7 @@ package v1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/utils/ptr"
)
// IsControlledBy checks if the object has a controllerRef set to the given owner
@@ -36,10 +37,14 @@ func GetControllerOf(controllee Object) *OwnerReference {
return nil
}
cp := *ref
+ cp.Controller = ptr.To(*ref.Controller)
+ if ref.BlockOwnerDeletion != nil {
+ cp.BlockOwnerDeletion = ptr.To(*ref.BlockOwnerDeletion)
+ }
return &cp
}
-// GetControllerOf returns a pointer to the controllerRef if controllee has a controller
+// GetControllerOfNoCopy returns a pointer to the controllerRef if controllee has a controller
func GetControllerOfNoCopy(controllee Object) *OwnerReference {
refs := controllee.GetOwnerReferences()
for i := range refs {
@@ -52,14 +57,12 @@ func GetControllerOfNoCopy(controllee Object) *OwnerReference {
// NewControllerRef creates an OwnerReference pointing to the given owner.
func NewControllerRef(owner Object, gvk schema.GroupVersionKind) *OwnerReference {
- blockOwnerDeletion := true
- isController := true
return &OwnerReference{
APIVersion: gvk.GroupVersion().String(),
Kind: gvk.Kind,
Name: owner.GetName(),
UID: owner.GetUID(),
- BlockOwnerDeletion: &blockOwnerDeletion,
- Controller: &isController,
+ BlockOwnerDeletion: ptr.To(true),
+ Controller: ptr.To(true),
}
}
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
index 75b88890f6f..229ea2c2c20 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
@@ -329,10 +329,38 @@ func (m *Duration) XXX_DiscardUnknown() {
var xxx_messageInfo_Duration proto.InternalMessageInfo
+func (m *FieldSelectorRequirement) Reset() { *m = FieldSelectorRequirement{} }
+func (*FieldSelectorRequirement) ProtoMessage() {}
+func (*FieldSelectorRequirement) Descriptor() ([]byte, []int) {
+ return fileDescriptor_a8431b6e0aeeb761, []int{10}
+}
+func (m *FieldSelectorRequirement) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *FieldSelectorRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (m *FieldSelectorRequirement) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FieldSelectorRequirement.Merge(m, src)
+}
+func (m *FieldSelectorRequirement) XXX_Size() int {
+ return m.Size()
+}
+func (m *FieldSelectorRequirement) XXX_DiscardUnknown() {
+ xxx_messageInfo_FieldSelectorRequirement.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FieldSelectorRequirement proto.InternalMessageInfo
+
func (m *FieldsV1) Reset() { *m = FieldsV1{} }
func (*FieldsV1) ProtoMessage() {}
func (*FieldsV1) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{10}
+ return fileDescriptor_a8431b6e0aeeb761, []int{11}
}
func (m *FieldsV1) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -360,7 +388,7 @@ var xxx_messageInfo_FieldsV1 proto.InternalMessageInfo
func (m *GetOptions) Reset() { *m = GetOptions{} }
func (*GetOptions) ProtoMessage() {}
func (*GetOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{11}
+ return fileDescriptor_a8431b6e0aeeb761, []int{12}
}
func (m *GetOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -388,7 +416,7 @@ var xxx_messageInfo_GetOptions proto.InternalMessageInfo
func (m *GroupKind) Reset() { *m = GroupKind{} }
func (*GroupKind) ProtoMessage() {}
func (*GroupKind) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{12}
+ return fileDescriptor_a8431b6e0aeeb761, []int{13}
}
func (m *GroupKind) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -416,7 +444,7 @@ var xxx_messageInfo_GroupKind proto.InternalMessageInfo
func (m *GroupResource) Reset() { *m = GroupResource{} }
func (*GroupResource) ProtoMessage() {}
func (*GroupResource) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{13}
+ return fileDescriptor_a8431b6e0aeeb761, []int{14}
}
func (m *GroupResource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -444,7 +472,7 @@ var xxx_messageInfo_GroupResource proto.InternalMessageInfo
func (m *GroupVersion) Reset() { *m = GroupVersion{} }
func (*GroupVersion) ProtoMessage() {}
func (*GroupVersion) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{14}
+ return fileDescriptor_a8431b6e0aeeb761, []int{15}
}
func (m *GroupVersion) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -472,7 +500,7 @@ var xxx_messageInfo_GroupVersion proto.InternalMessageInfo
func (m *GroupVersionForDiscovery) Reset() { *m = GroupVersionForDiscovery{} }
func (*GroupVersionForDiscovery) ProtoMessage() {}
func (*GroupVersionForDiscovery) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{15}
+ return fileDescriptor_a8431b6e0aeeb761, []int{16}
}
func (m *GroupVersionForDiscovery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -500,7 +528,7 @@ var xxx_messageInfo_GroupVersionForDiscovery proto.InternalMessageInfo
func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} }
func (*GroupVersionKind) ProtoMessage() {}
func (*GroupVersionKind) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{16}
+ return fileDescriptor_a8431b6e0aeeb761, []int{17}
}
func (m *GroupVersionKind) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -528,7 +556,7 @@ var xxx_messageInfo_GroupVersionKind proto.InternalMessageInfo
func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
func (*GroupVersionResource) ProtoMessage() {}
func (*GroupVersionResource) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{17}
+ return fileDescriptor_a8431b6e0aeeb761, []int{18}
}
func (m *GroupVersionResource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -556,7 +584,7 @@ var xxx_messageInfo_GroupVersionResource proto.InternalMessageInfo
func (m *LabelSelector) Reset() { *m = LabelSelector{} }
func (*LabelSelector) ProtoMessage() {}
func (*LabelSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{18}
+ return fileDescriptor_a8431b6e0aeeb761, []int{19}
}
func (m *LabelSelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -584,7 +612,7 @@ var xxx_messageInfo_LabelSelector proto.InternalMessageInfo
func (m *LabelSelectorRequirement) Reset() { *m = LabelSelectorRequirement{} }
func (*LabelSelectorRequirement) ProtoMessage() {}
func (*LabelSelectorRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{19}
+ return fileDescriptor_a8431b6e0aeeb761, []int{20}
}
func (m *LabelSelectorRequirement) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -612,7 +640,7 @@ var xxx_messageInfo_LabelSelectorRequirement proto.InternalMessageInfo
func (m *List) Reset() { *m = List{} }
func (*List) ProtoMessage() {}
func (*List) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{20}
+ return fileDescriptor_a8431b6e0aeeb761, []int{21}
}
func (m *List) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -640,7 +668,7 @@ var xxx_messageInfo_List proto.InternalMessageInfo
func (m *ListMeta) Reset() { *m = ListMeta{} }
func (*ListMeta) ProtoMessage() {}
func (*ListMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{21}
+ return fileDescriptor_a8431b6e0aeeb761, []int{22}
}
func (m *ListMeta) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -668,7 +696,7 @@ var xxx_messageInfo_ListMeta proto.InternalMessageInfo
func (m *ListOptions) Reset() { *m = ListOptions{} }
func (*ListOptions) ProtoMessage() {}
func (*ListOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{22}
+ return fileDescriptor_a8431b6e0aeeb761, []int{23}
}
func (m *ListOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -696,7 +724,7 @@ var xxx_messageInfo_ListOptions proto.InternalMessageInfo
func (m *ManagedFieldsEntry) Reset() { *m = ManagedFieldsEntry{} }
func (*ManagedFieldsEntry) ProtoMessage() {}
func (*ManagedFieldsEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{23}
+ return fileDescriptor_a8431b6e0aeeb761, []int{24}
}
func (m *ManagedFieldsEntry) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -724,7 +752,7 @@ var xxx_messageInfo_ManagedFieldsEntry proto.InternalMessageInfo
func (m *MicroTime) Reset() { *m = MicroTime{} }
func (*MicroTime) ProtoMessage() {}
func (*MicroTime) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{24}
+ return fileDescriptor_a8431b6e0aeeb761, []int{25}
}
func (m *MicroTime) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MicroTime.Unmarshal(m, b)
@@ -747,7 +775,7 @@ var xxx_messageInfo_MicroTime proto.InternalMessageInfo
func (m *ObjectMeta) Reset() { *m = ObjectMeta{} }
func (*ObjectMeta) ProtoMessage() {}
func (*ObjectMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{25}
+ return fileDescriptor_a8431b6e0aeeb761, []int{26}
}
func (m *ObjectMeta) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -775,7 +803,7 @@ var xxx_messageInfo_ObjectMeta proto.InternalMessageInfo
func (m *OwnerReference) Reset() { *m = OwnerReference{} }
func (*OwnerReference) ProtoMessage() {}
func (*OwnerReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{26}
+ return fileDescriptor_a8431b6e0aeeb761, []int{27}
}
func (m *OwnerReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -803,7 +831,7 @@ var xxx_messageInfo_OwnerReference proto.InternalMessageInfo
func (m *PartialObjectMetadata) Reset() { *m = PartialObjectMetadata{} }
func (*PartialObjectMetadata) ProtoMessage() {}
func (*PartialObjectMetadata) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{27}
+ return fileDescriptor_a8431b6e0aeeb761, []int{28}
}
func (m *PartialObjectMetadata) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -831,7 +859,7 @@ var xxx_messageInfo_PartialObjectMetadata proto.InternalMessageInfo
func (m *PartialObjectMetadataList) Reset() { *m = PartialObjectMetadataList{} }
func (*PartialObjectMetadataList) ProtoMessage() {}
func (*PartialObjectMetadataList) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{28}
+ return fileDescriptor_a8431b6e0aeeb761, []int{29}
}
func (m *PartialObjectMetadataList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -859,7 +887,7 @@ var xxx_messageInfo_PartialObjectMetadataList proto.InternalMessageInfo
func (m *Patch) Reset() { *m = Patch{} }
func (*Patch) ProtoMessage() {}
func (*Patch) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{29}
+ return fileDescriptor_a8431b6e0aeeb761, []int{30}
}
func (m *Patch) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -887,7 +915,7 @@ var xxx_messageInfo_Patch proto.InternalMessageInfo
func (m *PatchOptions) Reset() { *m = PatchOptions{} }
func (*PatchOptions) ProtoMessage() {}
func (*PatchOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{30}
+ return fileDescriptor_a8431b6e0aeeb761, []int{31}
}
func (m *PatchOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -915,7 +943,7 @@ var xxx_messageInfo_PatchOptions proto.InternalMessageInfo
func (m *Preconditions) Reset() { *m = Preconditions{} }
func (*Preconditions) ProtoMessage() {}
func (*Preconditions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{31}
+ return fileDescriptor_a8431b6e0aeeb761, []int{32}
}
func (m *Preconditions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -943,7 +971,7 @@ var xxx_messageInfo_Preconditions proto.InternalMessageInfo
func (m *RootPaths) Reset() { *m = RootPaths{} }
func (*RootPaths) ProtoMessage() {}
func (*RootPaths) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{32}
+ return fileDescriptor_a8431b6e0aeeb761, []int{33}
}
func (m *RootPaths) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -971,7 +999,7 @@ var xxx_messageInfo_RootPaths proto.InternalMessageInfo
func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} }
func (*ServerAddressByClientCIDR) ProtoMessage() {}
func (*ServerAddressByClientCIDR) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{33}
+ return fileDescriptor_a8431b6e0aeeb761, []int{34}
}
func (m *ServerAddressByClientCIDR) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -999,7 +1027,7 @@ var xxx_messageInfo_ServerAddressByClientCIDR proto.InternalMessageInfo
func (m *Status) Reset() { *m = Status{} }
func (*Status) ProtoMessage() {}
func (*Status) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{34}
+ return fileDescriptor_a8431b6e0aeeb761, []int{35}
}
func (m *Status) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1027,7 +1055,7 @@ var xxx_messageInfo_Status proto.InternalMessageInfo
func (m *StatusCause) Reset() { *m = StatusCause{} }
func (*StatusCause) ProtoMessage() {}
func (*StatusCause) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{35}
+ return fileDescriptor_a8431b6e0aeeb761, []int{36}
}
func (m *StatusCause) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1055,7 +1083,7 @@ var xxx_messageInfo_StatusCause proto.InternalMessageInfo
func (m *StatusDetails) Reset() { *m = StatusDetails{} }
func (*StatusDetails) ProtoMessage() {}
func (*StatusDetails) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{36}
+ return fileDescriptor_a8431b6e0aeeb761, []int{37}
}
func (m *StatusDetails) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1083,7 +1111,7 @@ var xxx_messageInfo_StatusDetails proto.InternalMessageInfo
func (m *TableOptions) Reset() { *m = TableOptions{} }
func (*TableOptions) ProtoMessage() {}
func (*TableOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{37}
+ return fileDescriptor_a8431b6e0aeeb761, []int{38}
}
func (m *TableOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1111,7 +1139,7 @@ var xxx_messageInfo_TableOptions proto.InternalMessageInfo
func (m *Time) Reset() { *m = Time{} }
func (*Time) ProtoMessage() {}
func (*Time) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{38}
+ return fileDescriptor_a8431b6e0aeeb761, []int{39}
}
func (m *Time) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Time.Unmarshal(m, b)
@@ -1134,7 +1162,7 @@ var xxx_messageInfo_Time proto.InternalMessageInfo
func (m *Timestamp) Reset() { *m = Timestamp{} }
func (*Timestamp) ProtoMessage() {}
func (*Timestamp) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{39}
+ return fileDescriptor_a8431b6e0aeeb761, []int{40}
}
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1162,7 +1190,7 @@ var xxx_messageInfo_Timestamp proto.InternalMessageInfo
func (m *TypeMeta) Reset() { *m = TypeMeta{} }
func (*TypeMeta) ProtoMessage() {}
func (*TypeMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{40}
+ return fileDescriptor_a8431b6e0aeeb761, []int{41}
}
func (m *TypeMeta) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1190,7 +1218,7 @@ var xxx_messageInfo_TypeMeta proto.InternalMessageInfo
func (m *UpdateOptions) Reset() { *m = UpdateOptions{} }
func (*UpdateOptions) ProtoMessage() {}
func (*UpdateOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{41}
+ return fileDescriptor_a8431b6e0aeeb761, []int{42}
}
func (m *UpdateOptions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1218,7 +1246,7 @@ var xxx_messageInfo_UpdateOptions proto.InternalMessageInfo
func (m *Verbs) Reset() { *m = Verbs{} }
func (*Verbs) ProtoMessage() {}
func (*Verbs) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{42}
+ return fileDescriptor_a8431b6e0aeeb761, []int{43}
}
func (m *Verbs) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1246,7 +1274,7 @@ var xxx_messageInfo_Verbs proto.InternalMessageInfo
func (m *WatchEvent) Reset() { *m = WatchEvent{} }
func (*WatchEvent) ProtoMessage() {}
func (*WatchEvent) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{43}
+ return fileDescriptor_a8431b6e0aeeb761, []int{44}
}
func (m *WatchEvent) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1282,6 +1310,7 @@ func init() {
proto.RegisterType((*CreateOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions")
proto.RegisterType((*DeleteOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions")
proto.RegisterType((*Duration)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Duration")
+ proto.RegisterType((*FieldSelectorRequirement)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.FieldSelectorRequirement")
proto.RegisterType((*FieldsV1)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.FieldsV1")
proto.RegisterType((*GetOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.GetOptions")
proto.RegisterType((*GroupKind)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.GroupKind")
@@ -1326,186 +1355,187 @@ func init() {
}
var fileDescriptor_a8431b6e0aeeb761 = []byte{
- // 2853 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x1a, 0x4b, 0x6f, 0x24, 0x47,
- 0xd9, 0x3d, 0x0f, 0x7b, 0xe6, 0x9b, 0x19, 0x3f, 0x6a, 0xbd, 0x30, 0x6b, 0x84, 0xc7, 0xe9, 0x44,
- 0xd1, 0x06, 0x92, 0x71, 0x76, 0x09, 0xd1, 0x66, 0x43, 0x02, 0x1e, 0xcf, 0x7a, 0xe3, 0x64, 0x1d,
- 0x5b, 0xe5, 0xdd, 0x05, 0x42, 0x84, 0xd2, 0x9e, 0x2e, 0x8f, 0x1b, 0xf7, 0x74, 0x4f, 0xaa, 0x7a,
- 0xbc, 0x19, 0x38, 0x90, 0x03, 0x08, 0x90, 0x50, 0x14, 0x6e, 0x9c, 0x50, 0x22, 0xf8, 0x01, 0x88,
- 0x13, 0x77, 0x90, 0xc8, 0x31, 0x88, 0x4b, 0x24, 0xd0, 0x28, 0x31, 0x07, 0x8e, 0x88, 0xab, 0x85,
- 0x04, 0xaa, 0x47, 0x77, 0x57, 0xcf, 0x63, 0xdd, 0x93, 0x5d, 0x22, 0x6e, 0xd3, 0xdf, 0xbb, 0xaa,
- 0xbe, 0xfa, 0xea, 0x7b, 0x0c, 0x3c, 0x73, 0x7c, 0x8d, 0xd5, 0x1d, 0x7f, 0xdd, 0xea, 0x3a, 0x1d,
- 0xab, 0x75, 0xe4, 0x78, 0x84, 0xf6, 0xd7, 0xbb, 0xc7, 0x6d, 0x0e, 0x60, 0xeb, 0x1d, 0x12, 0x58,
- 0xeb, 0x27, 0x57, 0xd6, 0xdb, 0xc4, 0x23, 0xd4, 0x0a, 0x88, 0x5d, 0xef, 0x52, 0x3f, 0xf0, 0xd1,
- 0x63, 0x92, 0xab, 0xae, 0x73, 0xd5, 0xbb, 0xc7, 0x6d, 0x0e, 0x60, 0x75, 0xce, 0x55, 0x3f, 0xb9,
- 0xb2, 0xf2, 0x54, 0xdb, 0x09, 0x8e, 0x7a, 0x07, 0xf5, 0x96, 0xdf, 0x59, 0x6f, 0xfb, 0x6d, 0x7f,
- 0x5d, 0x30, 0x1f, 0xf4, 0x0e, 0xc5, 0x97, 0xf8, 0x10, 0xbf, 0xa4, 0xd0, 0x95, 0xf5, 0x49, 0xa6,
- 0xd0, 0x9e, 0x17, 0x38, 0x1d, 0x32, 0x6c, 0xc5, 0xca, 0xb3, 0xe7, 0x31, 0xb0, 0xd6, 0x11, 0xe9,
- 0x58, 0xc3, 0x7c, 0xe6, 0x9f, 0xb2, 0x50, 0xd8, 0xd8, 0xdb, 0xbe, 0x49, 0xfd, 0x5e, 0x17, 0xad,
- 0x41, 0xce, 0xb3, 0x3a, 0xa4, 0x6a, 0xac, 0x19, 0x97, 0x8b, 0x8d, 0xf2, 0x07, 0x83, 0xda, 0xcc,
- 0xe9, 0xa0, 0x96, 0x7b, 0xd5, 0xea, 0x10, 0x2c, 0x30, 0xc8, 0x85, 0xc2, 0x09, 0xa1, 0xcc, 0xf1,
- 0x3d, 0x56, 0xcd, 0xac, 0x65, 0x2f, 0x97, 0xae, 0xbe, 0x58, 0x4f, 0xb3, 0xfe, 0xba, 0x50, 0x70,
- 0x57, 0xb2, 0x6e, 0xf9, 0xb4, 0xe9, 0xb0, 0x96, 0x7f, 0x42, 0x68, 0xbf, 0xb1, 0xa8, 0xb4, 0x14,
- 0x14, 0x92, 0xe1, 0x48, 0x03, 0xfa, 0x91, 0x01, 0x8b, 0x5d, 0x4a, 0x0e, 0x09, 0xa5, 0xc4, 0x56,
- 0xf8, 0x6a, 0x76, 0xcd, 0x78, 0x08, 0x6a, 0xab, 0x4a, 0xed, 0xe2, 0xde, 0x90, 0x7c, 0x3c, 0xa2,
- 0x11, 0xfd, 0xda, 0x80, 0x15, 0x46, 0xe8, 0x09, 0xa1, 0x1b, 0xb6, 0x4d, 0x09, 0x63, 0x8d, 0xfe,
- 0xa6, 0xeb, 0x10, 0x2f, 0xd8, 0xdc, 0x6e, 0x62, 0x56, 0xcd, 0x89, 0x7d, 0xf8, 0x7a, 0x3a, 0x83,
- 0xf6, 0x27, 0xc9, 0x69, 0x98, 0xca, 0xa2, 0x95, 0x89, 0x24, 0x0c, 0xdf, 0xc7, 0x0c, 0xf3, 0x10,
- 0xca, 0xe1, 0x41, 0xde, 0x72, 0x58, 0x80, 0xee, 0xc2, 0x6c, 0x9b, 0x7f, 0xb0, 0xaa, 0x21, 0x0c,
- 0xac, 0xa7, 0x33, 0x30, 0x94, 0xd1, 0x98, 0x57, 0xf6, 0xcc, 0x8a, 0x4f, 0x86, 0x95, 0x34, 0xf3,
- 0x67, 0x39, 0x28, 0x6d, 0xec, 0x6d, 0x63, 0xc2, 0xfc, 0x1e, 0x6d, 0x91, 0x14, 0x4e, 0x73, 0x0d,
- 0xca, 0xcc, 0xf1, 0xda, 0x3d, 0xd7, 0xa2, 0x1c, 0x5a, 0x9d, 0x15, 0x94, 0xcb, 0x8a, 0xb2, 0xbc,
- 0xaf, 0xe1, 0x70, 0x82, 0x12, 0x5d, 0x05, 0xe0, 0x12, 0x58, 0xd7, 0x6a, 0x11, 0xbb, 0x9a, 0x59,
- 0x33, 0x2e, 0x17, 0x1a, 0x48, 0xf1, 0xc1, 0xab, 0x11, 0x06, 0x6b, 0x54, 0xe8, 0x51, 0xc8, 0x0b,
- 0x4b, 0xab, 0x05, 0xa1, 0xa6, 0xa2, 0xc8, 0xf3, 0x62, 0x19, 0x58, 0xe2, 0xd0, 0x13, 0x30, 0xa7,
- 0xbc, 0xac, 0x5a, 0x14, 0x64, 0x0b, 0x8a, 0x6c, 0x2e, 0x74, 0x83, 0x10, 0xcf, 0xd7, 0x77, 0xec,
- 0x78, 0xb6, 0xf0, 0x3b, 0x6d, 0x7d, 0xaf, 0x38, 0x9e, 0x8d, 0x05, 0x06, 0xdd, 0x82, 0xfc, 0x09,
- 0xa1, 0x07, 0xdc, 0x13, 0xb8, 0x6b, 0x7e, 0x39, 0xdd, 0x46, 0xdf, 0xe5, 0x2c, 0x8d, 0x22, 0x37,
- 0x4d, 0xfc, 0xc4, 0x52, 0x08, 0xaa, 0x03, 0xb0, 0x23, 0x9f, 0x06, 0x62, 0x79, 0xd5, 0xfc, 0x5a,
- 0xf6, 0x72, 0xb1, 0x31, 0xcf, 0xd7, 0xbb, 0x1f, 0x41, 0xb1, 0x46, 0xc1, 0xe9, 0x5b, 0x56, 0x40,
- 0xda, 0x3e, 0x75, 0x08, 0xab, 0xce, 0xc5, 0xf4, 0x9b, 0x11, 0x14, 0x6b, 0x14, 0xe8, 0x65, 0x40,
- 0x2c, 0xf0, 0xa9, 0xd5, 0x26, 0x6a, 0xa9, 0x2f, 0x59, 0xec, 0xa8, 0x0a, 0x62, 0x75, 0x2b, 0x6a,
- 0x75, 0x68, 0x7f, 0x84, 0x02, 0x8f, 0xe1, 0x32, 0x7f, 0x67, 0xc0, 0x82, 0xe6, 0x0b, 0xc2, 0xef,
- 0xae, 0x41, 0xb9, 0xad, 0xdd, 0x3a, 0xe5, 0x17, 0xd1, 0x69, 0xeb, 0x37, 0x12, 0x27, 0x28, 0x11,
- 0x81, 0x22, 0x55, 0x92, 0xc2, 0xe8, 0x72, 0x25, 0xb5, 0xd3, 0x86, 0x36, 0xc4, 0x9a, 0x34, 0x20,
- 0xc3, 0xb1, 0x64, 0xf3, 0x1f, 0x86, 0x70, 0xe0, 0x30, 0xde, 0xa0, 0xcb, 0x5a, 0x4c, 0x33, 0xc4,
- 0xf6, 0x95, 0x27, 0xc4, 0xa3, 0x73, 0x02, 0x41, 0xe6, 0xff, 0x22, 0x10, 0x5c, 0x2f, 0xfc, 0xf2,
- 0xbd, 0xda, 0xcc, 0xdb, 0x7f, 0x5b, 0x9b, 0x31, 0x7f, 0x61, 0x40, 0x79, 0xa3, 0xdb, 0x75, 0xfb,
- 0xbb, 0xdd, 0x40, 0x2c, 0xc0, 0x84, 0x59, 0x9b, 0xf6, 0x71, 0xcf, 0x53, 0x0b, 0x05, 0x7e, 0xbf,
- 0x9b, 0x02, 0x82, 0x15, 0x86, 0xdf, 0x9f, 0x43, 0x9f, 0xb6, 0x88, 0xba, 0x6e, 0xd1, 0xfd, 0xd9,
- 0xe2, 0x40, 0x2c, 0x71, 0xfc, 0x90, 0x0f, 0x1d, 0xe2, 0xda, 0x3b, 0x96, 0x67, 0xb5, 0x09, 0x55,
- 0x97, 0x23, 0xda, 0xfa, 0x2d, 0x0d, 0x87, 0x13, 0x94, 0xe6, 0x7f, 0x32, 0x50, 0xdc, 0xf4, 0x3d,
- 0xdb, 0x09, 0xd4, 0xe5, 0x0a, 0xfa, 0xdd, 0x91, 0xe0, 0x71, 0xbb, 0xdf, 0x25, 0x58, 0x60, 0xd0,
- 0x73, 0x30, 0xcb, 0x02, 0x2b, 0xe8, 0x31, 0x61, 0x4f, 0xb1, 0xf1, 0x48, 0x18, 0x96, 0xf6, 0x05,
- 0xf4, 0x6c, 0x50, 0x5b, 0x88, 0xc4, 0x49, 0x10, 0x56, 0x0c, 0xdc, 0xd3, 0xfd, 0x03, 0xb1, 0x51,
- 0xf6, 0x4d, 0xf9, 0xec, 0x85, 0xef, 0x47, 0x36, 0xf6, 0xf4, 0xdd, 0x11, 0x0a, 0x3c, 0x86, 0x0b,
- 0x9d, 0x00, 0x72, 0x2d, 0x16, 0xdc, 0xa6, 0x96, 0xc7, 0x84, 0xae, 0xdb, 0x4e, 0x87, 0xa8, 0x0b,
- 0xff, 0xa5, 0x74, 0x27, 0xce, 0x39, 0x62, 0xbd, 0xb7, 0x46, 0xa4, 0xe1, 0x31, 0x1a, 0xd0, 0xe3,
- 0x30, 0x4b, 0x89, 0xc5, 0x7c, 0xaf, 0x9a, 0x17, 0xcb, 0x8f, 0xa2, 0x32, 0x16, 0x50, 0xac, 0xb0,
- 0x3c, 0xa0, 0x75, 0x08, 0x63, 0x56, 0x3b, 0x0c, 0xaf, 0x51, 0x40, 0xdb, 0x91, 0x60, 0x1c, 0xe2,
- 0xcd, 0xdf, 0x1a, 0x50, 0xd9, 0xa4, 0xc4, 0x0a, 0xc8, 0x34, 0x6e, 0xf1, 0xa9, 0x4f, 0x1c, 0x6d,
- 0xc0, 0x82, 0xf8, 0xbe, 0x6b, 0xb9, 0x8e, 0x2d, 0xcf, 0x20, 0x27, 0x98, 0x3f, 0xaf, 0x98, 0x17,
- 0xb6, 0x92, 0x68, 0x3c, 0x4c, 0x6f, 0xfe, 0x24, 0x0b, 0x95, 0x26, 0x71, 0x49, 0x6c, 0xf2, 0x16,
- 0xa0, 0x36, 0xb5, 0x5a, 0x64, 0x8f, 0x50, 0xc7, 0xb7, 0xf7, 0x49, 0xcb, 0xf7, 0x6c, 0x26, 0xdc,
- 0x28, 0xdb, 0xf8, 0x1c, 0xdf, 0xdf, 0x9b, 0x23, 0x58, 0x3c, 0x86, 0x03, 0xb9, 0x50, 0xe9, 0x52,
- 0xf1, 0x5b, 0xec, 0xb9, 0xf4, 0xb2, 0xd2, 0xd5, 0xaf, 0xa4, 0x3b, 0xd2, 0x3d, 0x9d, 0xb5, 0xb1,
- 0x74, 0x3a, 0xa8, 0x55, 0x12, 0x20, 0x9c, 0x14, 0x8e, 0xbe, 0x01, 0x8b, 0x3e, 0xed, 0x1e, 0x59,
- 0x5e, 0x93, 0x74, 0x89, 0x67, 0x13, 0x2f, 0x60, 0x62, 0x23, 0x0b, 0x8d, 0x65, 0x9e, 0x8b, 0xec,
- 0x0e, 0xe1, 0xf0, 0x08, 0x35, 0x7a, 0x0d, 0x96, 0xba, 0xd4, 0xef, 0x5a, 0x6d, 0xb1, 0x31, 0x7b,
- 0xbe, 0xeb, 0xb4, 0xfa, 0x6a, 0x3b, 0x9f, 0x3c, 0x1d, 0xd4, 0x96, 0xf6, 0x86, 0x91, 0x67, 0x83,
- 0xda, 0x05, 0xb1, 0x75, 0x1c, 0x12, 0x23, 0xf1, 0xa8, 0x18, 0xcd, 0x0d, 0xf2, 0x93, 0xdc, 0xc0,
- 0xdc, 0x86, 0x42, 0xb3, 0xa7, 0xee, 0xc4, 0x0b, 0x50, 0xb0, 0xd5, 0x6f, 0xb5, 0xf3, 0xe1, 0xe5,
- 0x8c, 0x68, 0xce, 0x06, 0xb5, 0x0a, 0x4f, 0x3f, 0xeb, 0x21, 0x00, 0x47, 0x2c, 0xe6, 0xe3, 0x50,
- 0x10, 0x07, 0xcf, 0xee, 0x5e, 0x41, 0x8b, 0x90, 0xc5, 0xd6, 0x3d, 0x21, 0xa5, 0x8c, 0xf9, 0x4f,
- 0x2d, 0x8a, 0xed, 0x02, 0xdc, 0x24, 0x41, 0x78, 0xf0, 0x1b, 0xb0, 0x10, 0x86, 0xf2, 0xe4, 0x0b,
- 0x13, 0x79, 0x13, 0x4e, 0xa2, 0xf1, 0x30, 0xbd, 0xf9, 0x3a, 0x14, 0xc5, 0x2b, 0xc4, 0x9f, 0xf0,
- 0x38, 0x5d, 0x30, 0xee, 0x93, 0x2e, 0x84, 0x39, 0x40, 0x66, 0x52, 0x0e, 0xa0, 0x99, 0xeb, 0x42,
- 0x45, 0xf2, 0x86, 0x09, 0x52, 0x2a, 0x0d, 0x4f, 0x42, 0x21, 0x34, 0x53, 0x69, 0x89, 0x12, 0xe3,
- 0x50, 0x10, 0x8e, 0x28, 0x34, 0x6d, 0x47, 0x90, 0x78, 0x51, 0xd3, 0x29, 0xd3, 0xb2, 0x9f, 0xcc,
- 0xfd, 0xb3, 0x1f, 0x4d, 0xd3, 0x0f, 0xa1, 0x3a, 0x29, 0x9b, 0x7e, 0x80, 0x37, 0x3f, 0xbd, 0x29,
- 0xe6, 0x3b, 0x06, 0x2c, 0xea, 0x92, 0xd2, 0x1f, 0x5f, 0x7a, 0x25, 0xe7, 0x67, 0x7b, 0xda, 0x8e,
- 0xfc, 0xca, 0x80, 0xe5, 0xc4, 0xd2, 0xa6, 0x3a, 0xf1, 0x29, 0x8c, 0xd2, 0x9d, 0x23, 0x3b, 0x85,
- 0x73, 0xfc, 0x25, 0x03, 0x95, 0x5b, 0xd6, 0x01, 0x71, 0xf7, 0x89, 0x4b, 0x5a, 0x81, 0x4f, 0xd1,
- 0x0f, 0xa0, 0xd4, 0xb1, 0x82, 0xd6, 0x91, 0x80, 0x86, 0x95, 0x41, 0x33, 0x5d, 0xb0, 0x4b, 0x48,
- 0xaa, 0xef, 0xc4, 0x62, 0x6e, 0x78, 0x01, 0xed, 0x37, 0x2e, 0x28, 0x93, 0x4a, 0x1a, 0x06, 0xeb,
- 0xda, 0x44, 0x39, 0x27, 0xbe, 0x6f, 0xbc, 0xd5, 0xe5, 0x69, 0xcb, 0xf4, 0x55, 0x64, 0xc2, 0x04,
- 0x4c, 0xde, 0xec, 0x39, 0x94, 0x74, 0x88, 0x17, 0xc4, 0xe5, 0xdc, 0xce, 0x90, 0x7c, 0x3c, 0xa2,
- 0x71, 0xe5, 0x45, 0x58, 0x1c, 0x36, 0x9e, 0xc7, 0x9f, 0x63, 0xd2, 0x97, 0xe7, 0x85, 0xf9, 0x4f,
- 0xb4, 0x0c, 0xf9, 0x13, 0xcb, 0xed, 0xa9, 0xdb, 0x88, 0xe5, 0xc7, 0xf5, 0xcc, 0x35, 0xc3, 0xfc,
- 0x8d, 0x01, 0xd5, 0x49, 0x86, 0xa0, 0x2f, 0x6a, 0x82, 0x1a, 0x25, 0x65, 0x55, 0xf6, 0x15, 0xd2,
- 0x97, 0x52, 0x6f, 0x40, 0xc1, 0xef, 0xf2, 0x9c, 0xc2, 0xa7, 0xea, 0xd4, 0x9f, 0x08, 0x4f, 0x72,
- 0x57, 0xc1, 0xcf, 0x06, 0xb5, 0x8b, 0x09, 0xf1, 0x21, 0x02, 0x47, 0xac, 0x3c, 0x52, 0x0b, 0x7b,
- 0xf8, 0xeb, 0x11, 0x45, 0xea, 0xbb, 0x02, 0x82, 0x15, 0xc6, 0xfc, 0xbd, 0x01, 0x39, 0x91, 0x90,
- 0xbf, 0x0e, 0x05, 0xbe, 0x7f, 0xb6, 0x15, 0x58, 0xc2, 0xae, 0xd4, 0xa5, 0x20, 0xe7, 0xde, 0x21,
- 0x81, 0x15, 0x7b, 0x5b, 0x08, 0xc1, 0x91, 0x44, 0x84, 0x21, 0xef, 0x04, 0xa4, 0x13, 0x1e, 0xe4,
- 0x53, 0x13, 0x45, 0xab, 0x46, 0x44, 0x1d, 0x5b, 0xf7, 0x6e, 0xbc, 0x15, 0x10, 0x8f, 0x1f, 0x46,
- 0x7c, 0x35, 0xb6, 0xb9, 0x0c, 0x2c, 0x45, 0x99, 0xff, 0x32, 0x20, 0x52, 0xc5, 0x9d, 0x9f, 0x11,
- 0xf7, 0xf0, 0x96, 0xe3, 0x1d, 0xab, 0x6d, 0x8d, 0xcc, 0xd9, 0x57, 0x70, 0x1c, 0x51, 0x8c, 0x7b,
- 0x1e, 0x32, 0xd3, 0x3d, 0x0f, 0x5c, 0x61, 0xcb, 0xf7, 0x02, 0xc7, 0xeb, 0x8d, 0xdc, 0xb6, 0x4d,
- 0x05, 0xc7, 0x11, 0x05, 0x4f, 0x44, 0x28, 0xe9, 0x58, 0x8e, 0xe7, 0x78, 0x6d, 0xbe, 0x88, 0x4d,
- 0xbf, 0xe7, 0x05, 0xe2, 0x45, 0x56, 0x89, 0x08, 0x1e, 0xc1, 0xe2, 0x31, 0x1c, 0xe6, 0xbf, 0x73,
- 0x50, 0xe2, 0x6b, 0x0e, 0xdf, 0xb9, 0xe7, 0xa1, 0xe2, 0xea, 0x5e, 0xa0, 0xd6, 0x7e, 0x51, 0x99,
- 0x92, 0xbc, 0xd7, 0x38, 0x49, 0xcb, 0x99, 0x45, 0x0a, 0x15, 0x31, 0x67, 0x92, 0xcc, 0x5b, 0x3a,
- 0x12, 0x27, 0x69, 0x79, 0xf4, 0xba, 0xc7, 0xef, 0x87, 0xca, 0x4c, 0xa2, 0x23, 0xfa, 0x26, 0x07,
- 0x62, 0x89, 0x43, 0x3b, 0x70, 0xc1, 0x72, 0x5d, 0xff, 0x9e, 0x00, 0x36, 0x7c, 0xff, 0xb8, 0x63,
- 0xd1, 0x63, 0x26, 0x8a, 0xe9, 0x42, 0xe3, 0x0b, 0x8a, 0xe5, 0xc2, 0xc6, 0x28, 0x09, 0x1e, 0xc7,
- 0x37, 0xee, 0xd8, 0x72, 0x53, 0x1e, 0xdb, 0x11, 0x2c, 0x0f, 0x81, 0xc4, 0x2d, 0x57, 0x95, 0xed,
- 0x33, 0x4a, 0xce, 0x32, 0x1e, 0x43, 0x73, 0x36, 0x01, 0x8e, 0xc7, 0x4a, 0x44, 0xd7, 0x61, 0x9e,
- 0x7b, 0xb2, 0xdf, 0x0b, 0xc2, 0xbc, 0x33, 0x2f, 0x8e, 0x1b, 0x9d, 0x0e, 0x6a, 0xf3, 0xb7, 0x13,
- 0x18, 0x3c, 0x44, 0xc9, 0x37, 0xd7, 0x75, 0x3a, 0x4e, 0x50, 0x9d, 0x13, 0x2c, 0xd1, 0xe6, 0xde,
- 0xe2, 0x40, 0x2c, 0x71, 0x09, 0x0f, 0x2c, 0x9c, 0xeb, 0x81, 0x9b, 0xb0, 0xc4, 0x88, 0x67, 0x6f,
- 0x7b, 0x4e, 0xe0, 0x58, 0xee, 0x8d, 0x13, 0x91, 0x55, 0x96, 0xc4, 0x41, 0x5c, 0xe4, 0x29, 0xe1,
- 0xfe, 0x30, 0x12, 0x8f, 0xd2, 0x9b, 0x7f, 0xce, 0x02, 0x92, 0x09, 0xbb, 0x2d, 0x93, 0x32, 0x19,
- 0x17, 0x79, 0x59, 0xa1, 0x12, 0x7e, 0x63, 0xa8, 0xac, 0x50, 0xb9, 0x7e, 0x88, 0x47, 0x3b, 0x50,
- 0x94, 0xf1, 0x29, 0xbe, 0x73, 0xeb, 0x8a, 0xb8, 0xb8, 0x1b, 0x22, 0xce, 0x06, 0xb5, 0x95, 0x84,
- 0x9a, 0x08, 0x23, 0x4a, 0xbe, 0x58, 0x02, 0xba, 0x0a, 0x60, 0x75, 0x1d, 0xbd, 0xe9, 0x57, 0x8c,
- 0x5b, 0x3f, 0x71, 0xf9, 0x8e, 0x35, 0x2a, 0xf4, 0x12, 0xe4, 0x82, 0x4f, 0x57, 0x96, 0x15, 0x44,
- 0xd5, 0xc9, 0x8b, 0x30, 0x21, 0x81, 0x6b, 0x17, 0x97, 0x82, 0x71, 0xb3, 0x54, 0x45, 0x15, 0x69,
- 0xdf, 0x8a, 0x30, 0x58, 0xa3, 0x42, 0xdf, 0x82, 0xc2, 0xa1, 0xca, 0x67, 0xc5, 0xe9, 0xa6, 0x8e,
- 0xb3, 0x61, 0x16, 0x2c, 0xfb, 0x0e, 0xe1, 0x17, 0x8e, 0xa4, 0xa1, 0xaf, 0x42, 0x89, 0xf5, 0x0e,
- 0xa2, 0x14, 0x40, 0xba, 0x44, 0xf4, 0xde, 0xee, 0xc7, 0x28, 0xac, 0xd3, 0x99, 0x6f, 0x42, 0x71,
- 0xc7, 0x69, 0x51, 0x5f, 0x14, 0x92, 0x4f, 0xc0, 0x1c, 0x4b, 0x54, 0x49, 0xd1, 0x49, 0x86, 0xae,
- 0x1a, 0xe2, 0xb9, 0x8f, 0x7a, 0x96, 0xe7, 0xcb, 0x5a, 0x28, 0x1f, 0xfb, 0xe8, 0xab, 0x1c, 0x88,
- 0x25, 0xee, 0xfa, 0x32, 0xcf, 0x32, 0x7e, 0xfa, 0x7e, 0x6d, 0xe6, 0xdd, 0xf7, 0x6b, 0x33, 0xef,
- 0xbd, 0xaf, 0x32, 0x8e, 0x3f, 0x00, 0xc0, 0xee, 0xc1, 0xf7, 0x48, 0x4b, 0xc6, 0xee, 0x54, 0xbd,
- 0xc1, 0xb0, 0x25, 0x2d, 0x7a, 0x83, 0x99, 0xa1, 0xcc, 0x51, 0xc3, 0xe1, 0x04, 0x25, 0x5a, 0x87,
- 0x62, 0xd4, 0xf5, 0x53, 0xfe, 0xb1, 0x14, 0xfa, 0x5b, 0xd4, 0x1a, 0xc4, 0x31, 0x4d, 0xe2, 0x21,
- 0xc9, 0x9d, 0xfb, 0x90, 0x34, 0x20, 0xdb, 0x73, 0x6c, 0x55, 0x75, 0x3f, 0x1d, 0x3e, 0xe4, 0x77,
- 0xb6, 0x9b, 0x67, 0x83, 0xda, 0x23, 0x93, 0x9a, 0xed, 0x41, 0xbf, 0x4b, 0x58, 0xfd, 0xce, 0x76,
- 0x13, 0x73, 0xe6, 0x71, 0x51, 0x6d, 0x76, 0xca, 0xa8, 0x76, 0x15, 0xa0, 0x1d, 0xf7, 0x2e, 0x64,
- 0xd0, 0x88, 0x1c, 0x51, 0xeb, 0x59, 0x68, 0x54, 0x88, 0xc1, 0x52, 0x8b, 0xd7, 0xf7, 0xaa, 0x87,
- 0xc0, 0x02, 0xab, 0x23, 0xbb, 0xa1, 0xd3, 0xdd, 0x89, 0x4b, 0x4a, 0xcd, 0xd2, 0xe6, 0xb0, 0x30,
- 0x3c, 0x2a, 0x1f, 0xf9, 0xb0, 0x64, 0xab, 0x32, 0x33, 0x56, 0x5a, 0x9c, 0x5a, 0xa9, 0x88, 0x58,
- 0xcd, 0x61, 0x41, 0x78, 0x54, 0x36, 0xfa, 0x2e, 0xac, 0x84, 0xc0, 0xd1, 0x5a, 0x5f, 0x44, 0xfd,
- 0x6c, 0x63, 0xf5, 0x74, 0x50, 0x5b, 0x69, 0x4e, 0xa4, 0xc2, 0xf7, 0x91, 0x80, 0x6c, 0x98, 0x75,
- 0x65, 0x96, 0x5c, 0x12, 0x99, 0xcd, 0xd7, 0xd2, 0xad, 0x22, 0xf6, 0xfe, 0xba, 0x9e, 0x1d, 0x47,
- 0x7d, 0x1b, 0x95, 0x18, 0x2b, 0xd9, 0xe8, 0x2d, 0x28, 0x59, 0x9e, 0xe7, 0x07, 0x96, 0xec, 0x3e,
- 0x94, 0x85, 0xaa, 0x8d, 0xa9, 0x55, 0x6d, 0xc4, 0x32, 0x86, 0xb2, 0x71, 0x0d, 0x83, 0x75, 0x55,
- 0xe8, 0x1e, 0x2c, 0xf8, 0xf7, 0x3c, 0x42, 0x31, 0x39, 0x24, 0x94, 0x78, 0x2d, 0xc2, 0xaa, 0x15,
- 0xa1, 0xfd, 0x99, 0x94, 0xda, 0x13, 0xcc, 0xb1, 0x4b, 0x27, 0xe1, 0x0c, 0x0f, 0x6b, 0x41, 0x75,
- 0x1e, 0x5b, 0x3d, 0xcb, 0x75, 0xbe, 0x4f, 0x28, 0xab, 0xce, 0xc7, 0x0d, 0xeb, 0xad, 0x08, 0x8a,
- 0x35, 0x0a, 0xd4, 0x83, 0x4a, 0x47, 0x7f, 0x32, 0xaa, 0x4b, 0xc2, 0xcc, 0x6b, 0xe9, 0xcc, 0x1c,
- 0x7d, 0xd4, 0xe2, 0x34, 0x28, 0x81, 0xc3, 0x49, 0x2d, 0x2b, 0xcf, 0x41, 0xe9, 0x53, 0x56, 0x08,
- 0xbc, 0xc2, 0x18, 0x3e, 0x90, 0xa9, 0x2a, 0x8c, 0x3f, 0x66, 0x60, 0x3e, 0xb9, 0x8d, 0x43, 0xcf,
- 0x61, 0x3e, 0xd5, 0x73, 0x18, 0xd6, 0xb2, 0xc6, 0xc4, 0xc9, 0x45, 0x18, 0x9f, 0xb3, 0x13, 0xe3,
- 0xb3, 0x0a, 0x83, 0xb9, 0x07, 0x09, 0x83, 0x75, 0x00, 0x9e, 0xac, 0x50, 0xdf, 0x75, 0x09, 0x15,
- 0x11, 0xb0, 0xa0, 0x26, 0x14, 0x11, 0x14, 0x6b, 0x14, 0x3c, 0xa5, 0x3e, 0x70, 0xfd, 0xd6, 0xb1,
- 0xd8, 0x82, 0xf0, 0xf6, 0x8a, 0xd8, 0x57, 0x90, 0x29, 0x75, 0x63, 0x04, 0x8b, 0xc7, 0x70, 0x98,
- 0x7d, 0xb8, 0xb8, 0x67, 0x51, 0x9e, 0xe4, 0xc4, 0x37, 0x45, 0xd4, 0x2c, 0x6f, 0x8c, 0x54, 0x44,
- 0x4f, 0x4f, 0x7b, 0xe3, 0xe2, 0xcd, 0x8f, 0x61, 0x71, 0x55, 0x64, 0xfe, 0xd5, 0x80, 0x4b, 0x63,
- 0x75, 0x7f, 0x06, 0x15, 0xd9, 0x1b, 0xc9, 0x8a, 0xec, 0xf9, 0x94, 0xad, 0xcc, 0x71, 0xd6, 0x4e,
- 0xa8, 0xcf, 0xe6, 0x20, 0xbf, 0xc7, 0x33, 0x61, 0xf3, 0x43, 0x03, 0xca, 0xe2, 0xd7, 0x34, 0x9d,
- 0xe4, 0x5a, 0x72, 0xc0, 0x50, 0x7c, 0x78, 0xc3, 0x85, 0x87, 0xd1, 0x6a, 0x7e, 0xc7, 0x80, 0x64,
- 0x0f, 0x17, 0xbd, 0x28, 0xaf, 0x80, 0x11, 0x35, 0x59, 0xa7, 0x74, 0xff, 0x17, 0x26, 0x95, 0xa4,
- 0x17, 0x52, 0x75, 0x2b, 0x9f, 0x84, 0x22, 0xf6, 0xfd, 0x60, 0xcf, 0x0a, 0x8e, 0x18, 0xdf, 0xbb,
- 0x2e, 0xff, 0xa1, 0xb6, 0x57, 0xec, 0x9d, 0xc0, 0x60, 0x09, 0x37, 0x7f, 0x6e, 0xc0, 0xa5, 0x89,
- 0x73, 0x23, 0x1e, 0x45, 0x5a, 0xd1, 0x97, 0x5a, 0x51, 0xe4, 0xc8, 0x31, 0x1d, 0xd6, 0xa8, 0x78,
- 0x2d, 0x99, 0x18, 0x36, 0x0d, 0xd7, 0x92, 0x09, 0x6d, 0x38, 0x49, 0x6b, 0xfe, 0x33, 0x03, 0x6a,
- 0x50, 0xf3, 0x3f, 0x76, 0xfa, 0xc7, 0x87, 0xc6, 0x44, 0xf3, 0xc9, 0x31, 0x51, 0x34, 0x13, 0xd2,
- 0xe6, 0x24, 0xd9, 0xfb, 0xcf, 0x49, 0xd0, 0xb3, 0xd1, 0xe8, 0x45, 0xfa, 0xd0, 0x6a, 0x72, 0xf4,
- 0x72, 0x36, 0xa8, 0x95, 0x95, 0xf0, 0xe4, 0x28, 0xe6, 0x35, 0x98, 0xb3, 0x49, 0x60, 0x39, 0xae,
- 0xac, 0x0b, 0x53, 0x0f, 0x13, 0xa4, 0xb0, 0xa6, 0x64, 0x6d, 0x94, 0xb8, 0x4d, 0xea, 0x03, 0x87,
- 0x02, 0x79, 0xc0, 0x6e, 0xf9, 0xb6, 0xac, 0x48, 0xf2, 0x71, 0xc0, 0xde, 0xf4, 0x6d, 0x82, 0x05,
- 0xc6, 0x7c, 0xd7, 0x80, 0x92, 0x94, 0xb4, 0x69, 0xf5, 0x18, 0x41, 0x57, 0xa2, 0x55, 0xc8, 0xe3,
- 0xbe, 0xa4, 0xcf, 0xd8, 0xce, 0x06, 0xb5, 0xa2, 0x20, 0x13, 0xc5, 0xcc, 0x98, 0x59, 0x52, 0xe6,
- 0x9c, 0x3d, 0x7a, 0x14, 0xf2, 0xe2, 0x02, 0xa9, 0xcd, 0x8c, 0x87, 0x85, 0x1c, 0x88, 0x25, 0xce,
- 0xfc, 0x38, 0x03, 0x95, 0xc4, 0xe2, 0x52, 0xd4, 0x05, 0x51, 0x0b, 0x35, 0x93, 0xa2, 0x2d, 0x3f,
- 0x79, 0x34, 0xaf, 0x9e, 0xaf, 0xd9, 0x07, 0x79, 0xbe, 0xbe, 0x0d, 0xb3, 0x2d, 0xbe, 0x47, 0xe1,
- 0x3f, 0x3d, 0xae, 0x4c, 0x73, 0x9c, 0x62, 0x77, 0x63, 0x6f, 0x14, 0x9f, 0x0c, 0x2b, 0x81, 0xe8,
- 0x26, 0x2c, 0x51, 0x12, 0xd0, 0xfe, 0xc6, 0x61, 0x40, 0xa8, 0xde, 0x4c, 0xc8, 0xc7, 0xd9, 0x37,
- 0x1e, 0x26, 0xc0, 0xa3, 0x3c, 0xe6, 0x01, 0x94, 0x6f, 0x5b, 0x07, 0x6e, 0x34, 0x1e, 0xc3, 0x50,
- 0x71, 0xbc, 0x96, 0xdb, 0xb3, 0x89, 0x0c, 0xe8, 0x61, 0xf4, 0x0a, 0x2f, 0xed, 0xb6, 0x8e, 0x3c,
- 0x1b, 0xd4, 0x2e, 0x24, 0x00, 0x72, 0x1e, 0x84, 0x93, 0x22, 0x4c, 0x17, 0x72, 0x9f, 0x61, 0x25,
- 0xf9, 0x1d, 0x28, 0xc6, 0xb9, 0xfe, 0x43, 0x56, 0x69, 0xbe, 0x01, 0x05, 0xee, 0xf1, 0x61, 0x8d,
- 0x7a, 0x4e, 0x96, 0x94, 0xcc, 0xbd, 0x32, 0x69, 0x72, 0x2f, 0x31, 0x64, 0xbd, 0xd3, 0xb5, 0x1f,
- 0x70, 0xc8, 0x9a, 0x79, 0x90, 0x97, 0x2f, 0x3b, 0xe5, 0xcb, 0x77, 0x15, 0xe4, 0x1f, 0x51, 0xf8,
- 0x23, 0x23, 0x13, 0x08, 0xed, 0x91, 0xd1, 0xdf, 0x7f, 0x6d, 0xc2, 0xf0, 0x63, 0x03, 0x40, 0xb4,
- 0xf2, 0x44, 0x1b, 0x29, 0xc5, 0x38, 0xff, 0x0e, 0xcc, 0xfa, 0xd2, 0x23, 0xe5, 0xa0, 0x75, 0xca,
- 0x7e, 0x71, 0x74, 0x91, 0xa4, 0x4f, 0x62, 0x25, 0xac, 0xf1, 0xf2, 0x07, 0x9f, 0xac, 0xce, 0x7c,
- 0xf8, 0xc9, 0xea, 0xcc, 0x47, 0x9f, 0xac, 0xce, 0xbc, 0x7d, 0xba, 0x6a, 0x7c, 0x70, 0xba, 0x6a,
- 0x7c, 0x78, 0xba, 0x6a, 0x7c, 0x74, 0xba, 0x6a, 0x7c, 0x7c, 0xba, 0x6a, 0xbc, 0xfb, 0xf7, 0xd5,
- 0x99, 0xd7, 0x1e, 0x4b, 0xf3, 0x07, 0xbf, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x82, 0xff,
- 0xd4, 0x07, 0x28, 0x00, 0x00,
+ // 2873 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x1a, 0x5d, 0x6f, 0x23, 0x57,
+ 0x35, 0x63, 0xc7, 0x89, 0x7d, 0x6c, 0xe7, 0xe3, 0x6e, 0x16, 0xbc, 0x41, 0xc4, 0xe9, 0xb4, 0xaa,
+ 0xb6, 0xd0, 0x3a, 0xdd, 0xa5, 0x54, 0xdb, 0x2d, 0x2d, 0xc4, 0xf1, 0x66, 0x9b, 0x76, 0xd3, 0x44,
+ 0x37, 0xbb, 0x0b, 0x94, 0x0a, 0x75, 0xe2, 0xb9, 0x71, 0x86, 0x8c, 0x67, 0xdc, 0x7b, 0xc7, 0x49,
+ 0x0d, 0x0f, 0xf4, 0x01, 0x04, 0x48, 0xa8, 0x2a, 0x6f, 0x3c, 0xa1, 0x56, 0xf0, 0x03, 0x10, 0x4f,
+ 0xbc, 0x83, 0x44, 0x1f, 0x8b, 0x78, 0xa9, 0x04, 0xb2, 0xba, 0xe1, 0x81, 0x47, 0xc4, 0x6b, 0x84,
+ 0x04, 0xba, 0x1f, 0x33, 0x73, 0xc7, 0x1f, 0x9b, 0xf1, 0xee, 0x52, 0xf1, 0xe6, 0x39, 0xdf, 0xf7,
+ 0xde, 0x73, 0xce, 0x3d, 0xe7, 0x5c, 0xc3, 0x73, 0x47, 0xd7, 0x58, 0xcd, 0xf1, 0xd7, 0xac, 0x8e,
+ 0xd3, 0xb6, 0x9a, 0x87, 0x8e, 0x47, 0x68, 0x6f, 0xad, 0x73, 0xd4, 0xe2, 0x00, 0xb6, 0xd6, 0x26,
+ 0x81, 0xb5, 0x76, 0x7c, 0x65, 0xad, 0x45, 0x3c, 0x42, 0xad, 0x80, 0xd8, 0xb5, 0x0e, 0xf5, 0x03,
+ 0x1f, 0x3d, 0x21, 0xb9, 0x6a, 0x3a, 0x57, 0xad, 0x73, 0xd4, 0xe2, 0x00, 0x56, 0xe3, 0x5c, 0xb5,
+ 0xe3, 0x2b, 0xcb, 0xcf, 0xb4, 0x9c, 0xe0, 0xb0, 0xbb, 0x5f, 0x6b, 0xfa, 0xed, 0xb5, 0x96, 0xdf,
+ 0xf2, 0xd7, 0x04, 0xf3, 0x7e, 0xf7, 0x40, 0x7c, 0x89, 0x0f, 0xf1, 0x4b, 0x0a, 0x5d, 0x5e, 0x1b,
+ 0x67, 0x0a, 0xed, 0x7a, 0x81, 0xd3, 0x26, 0x83, 0x56, 0x2c, 0x3f, 0x7f, 0x1e, 0x03, 0x6b, 0x1e,
+ 0x92, 0xb6, 0x35, 0xc8, 0x67, 0xfe, 0x29, 0x0b, 0xf9, 0xf5, 0xdd, 0xad, 0x9b, 0xd4, 0xef, 0x76,
+ 0xd0, 0x2a, 0x4c, 0x7b, 0x56, 0x9b, 0x54, 0x8c, 0x55, 0xe3, 0x72, 0xa1, 0x5e, 0xfa, 0xa8, 0x5f,
+ 0x9d, 0x3a, 0xed, 0x57, 0xa7, 0x5f, 0xb7, 0xda, 0x04, 0x0b, 0x0c, 0x72, 0x21, 0x7f, 0x4c, 0x28,
+ 0x73, 0x7c, 0x8f, 0x55, 0x32, 0xab, 0xd9, 0xcb, 0xc5, 0xab, 0x2f, 0xd7, 0xd2, 0xac, 0xbf, 0x26,
+ 0x14, 0xdc, 0x95, 0xac, 0x9b, 0x3e, 0x6d, 0x38, 0xac, 0xe9, 0x1f, 0x13, 0xda, 0xab, 0x2f, 0x28,
+ 0x2d, 0x79, 0x85, 0x64, 0x38, 0xd2, 0x80, 0x7e, 0x64, 0xc0, 0x42, 0x87, 0x92, 0x03, 0x42, 0x29,
+ 0xb1, 0x15, 0xbe, 0x92, 0x5d, 0x35, 0x1e, 0x81, 0xda, 0x8a, 0x52, 0xbb, 0xb0, 0x3b, 0x20, 0x1f,
+ 0x0f, 0x69, 0x44, 0xbf, 0x36, 0x60, 0x99, 0x11, 0x7a, 0x4c, 0xe8, 0xba, 0x6d, 0x53, 0xc2, 0x58,
+ 0xbd, 0xb7, 0xe1, 0x3a, 0xc4, 0x0b, 0x36, 0xb6, 0x1a, 0x98, 0x55, 0xa6, 0xc5, 0x3e, 0x7c, 0x3d,
+ 0x9d, 0x41, 0x7b, 0xe3, 0xe4, 0xd4, 0x4d, 0x65, 0xd1, 0xf2, 0x58, 0x12, 0x86, 0xef, 0x63, 0x86,
+ 0x79, 0x00, 0xa5, 0xf0, 0x20, 0x6f, 0x39, 0x2c, 0x40, 0x77, 0x61, 0xa6, 0xc5, 0x3f, 0x58, 0xc5,
+ 0x10, 0x06, 0xd6, 0xd2, 0x19, 0x18, 0xca, 0xa8, 0xcf, 0x29, 0x7b, 0x66, 0xc4, 0x27, 0xc3, 0x4a,
+ 0x9a, 0xf9, 0xb3, 0x69, 0x28, 0xae, 0xef, 0x6e, 0x61, 0xc2, 0xfc, 0x2e, 0x6d, 0x92, 0x14, 0x4e,
+ 0x73, 0x0d, 0x4a, 0xcc, 0xf1, 0x5a, 0x5d, 0xd7, 0xa2, 0x1c, 0x5a, 0x99, 0x11, 0x94, 0x4b, 0x8a,
+ 0xb2, 0xb4, 0xa7, 0xe1, 0x70, 0x82, 0x12, 0x5d, 0x05, 0xe0, 0x12, 0x58, 0xc7, 0x6a, 0x12, 0xbb,
+ 0x92, 0x59, 0x35, 0x2e, 0xe7, 0xeb, 0x48, 0xf1, 0xc1, 0xeb, 0x11, 0x06, 0x6b, 0x54, 0xe8, 0x71,
+ 0xc8, 0x09, 0x4b, 0x2b, 0x79, 0xa1, 0xa6, 0xac, 0xc8, 0x73, 0x62, 0x19, 0x58, 0xe2, 0xd0, 0x53,
+ 0x30, 0xab, 0xbc, 0xac, 0x52, 0x10, 0x64, 0xf3, 0x8a, 0x6c, 0x36, 0x74, 0x83, 0x10, 0xcf, 0xd7,
+ 0x77, 0xe4, 0x78, 0xb6, 0xf0, 0x3b, 0x6d, 0x7d, 0xaf, 0x39, 0x9e, 0x8d, 0x05, 0x06, 0xdd, 0x82,
+ 0xdc, 0x31, 0xa1, 0xfb, 0xdc, 0x13, 0xb8, 0x6b, 0x7e, 0x39, 0xdd, 0x46, 0xdf, 0xe5, 0x2c, 0xf5,
+ 0x02, 0x37, 0x4d, 0xfc, 0xc4, 0x52, 0x08, 0xaa, 0x01, 0xb0, 0x43, 0x9f, 0x06, 0x62, 0x79, 0x95,
+ 0xdc, 0x6a, 0xf6, 0x72, 0xa1, 0x3e, 0xc7, 0xd7, 0xbb, 0x17, 0x41, 0xb1, 0x46, 0xc1, 0xe9, 0x9b,
+ 0x56, 0x40, 0x5a, 0x3e, 0x75, 0x08, 0xab, 0xcc, 0xc6, 0xf4, 0x1b, 0x11, 0x14, 0x6b, 0x14, 0xe8,
+ 0x55, 0x40, 0x2c, 0xf0, 0xa9, 0xd5, 0x22, 0x6a, 0xa9, 0xaf, 0x58, 0xec, 0xb0, 0x02, 0x62, 0x75,
+ 0xcb, 0x6a, 0x75, 0x68, 0x6f, 0x88, 0x02, 0x8f, 0xe0, 0x32, 0x7f, 0x67, 0xc0, 0xbc, 0xe6, 0x0b,
+ 0xc2, 0xef, 0xae, 0x41, 0xa9, 0xa5, 0x45, 0x9d, 0xf2, 0x8b, 0xe8, 0xb4, 0xf5, 0x88, 0xc4, 0x09,
+ 0x4a, 0x44, 0xa0, 0x40, 0x95, 0xa4, 0x30, 0xbb, 0x5c, 0x49, 0xed, 0xb4, 0xa1, 0x0d, 0xb1, 0x26,
+ 0x0d, 0xc8, 0x70, 0x2c, 0xd9, 0xfc, 0x87, 0x21, 0x1c, 0x38, 0xcc, 0x37, 0xe8, 0xb2, 0x96, 0xd3,
+ 0x0c, 0xb1, 0x7d, 0xa5, 0x31, 0xf9, 0xe8, 0x9c, 0x44, 0x90, 0xf9, 0xbf, 0x48, 0x04, 0xd7, 0xf3,
+ 0xbf, 0xfc, 0xa0, 0x3a, 0xf5, 0xee, 0xdf, 0x56, 0xa7, 0xcc, 0x5f, 0x18, 0x50, 0x5a, 0xef, 0x74,
+ 0xdc, 0xde, 0x4e, 0x27, 0x10, 0x0b, 0x30, 0x61, 0xc6, 0xa6, 0x3d, 0xdc, 0xf5, 0xd4, 0x42, 0x81,
+ 0xc7, 0x77, 0x43, 0x40, 0xb0, 0xc2, 0xf0, 0xf8, 0x39, 0xf0, 0x69, 0x93, 0xa8, 0x70, 0x8b, 0xe2,
+ 0x67, 0x93, 0x03, 0xb1, 0xc4, 0xf1, 0x43, 0x3e, 0x70, 0x88, 0x6b, 0x6f, 0x5b, 0x9e, 0xd5, 0x22,
+ 0x54, 0x05, 0x47, 0xb4, 0xf5, 0x9b, 0x1a, 0x0e, 0x27, 0x28, 0xcd, 0xff, 0x64, 0xa0, 0xb0, 0xe1,
+ 0x7b, 0xb6, 0x13, 0xa8, 0xe0, 0x0a, 0x7a, 0x9d, 0xa1, 0xe4, 0x71, 0xbb, 0xd7, 0x21, 0x58, 0x60,
+ 0xd0, 0x0b, 0x30, 0xc3, 0x02, 0x2b, 0xe8, 0x32, 0x61, 0x4f, 0xa1, 0xfe, 0x58, 0x98, 0x96, 0xf6,
+ 0x04, 0xf4, 0xac, 0x5f, 0x9d, 0x8f, 0xc4, 0x49, 0x10, 0x56, 0x0c, 0xdc, 0xd3, 0xfd, 0x7d, 0xb1,
+ 0x51, 0xf6, 0x4d, 0x79, 0xed, 0x85, 0xf7, 0x47, 0x36, 0xf6, 0xf4, 0x9d, 0x21, 0x0a, 0x3c, 0x82,
+ 0x0b, 0x1d, 0x03, 0x72, 0x2d, 0x16, 0xdc, 0xa6, 0x96, 0xc7, 0x84, 0xae, 0xdb, 0x4e, 0x9b, 0xa8,
+ 0x80, 0xff, 0x52, 0xba, 0x13, 0xe7, 0x1c, 0xb1, 0xde, 0x5b, 0x43, 0xd2, 0xf0, 0x08, 0x0d, 0xe8,
+ 0x49, 0x98, 0xa1, 0xc4, 0x62, 0xbe, 0x57, 0xc9, 0x89, 0xe5, 0x47, 0x59, 0x19, 0x0b, 0x28, 0x56,
+ 0x58, 0x9e, 0xd0, 0xda, 0x84, 0x31, 0xab, 0x15, 0xa6, 0xd7, 0x28, 0xa1, 0x6d, 0x4b, 0x30, 0x0e,
+ 0xf1, 0xe6, 0x6f, 0x0d, 0x28, 0x6f, 0x50, 0x62, 0x05, 0x64, 0x12, 0xb7, 0x78, 0xe0, 0x13, 0x47,
+ 0xeb, 0x30, 0x2f, 0xbe, 0xef, 0x5a, 0xae, 0x63, 0xcb, 0x33, 0x98, 0x16, 0xcc, 0x9f, 0x57, 0xcc,
+ 0xf3, 0x9b, 0x49, 0x34, 0x1e, 0xa4, 0x37, 0x7f, 0x92, 0x85, 0x72, 0x83, 0xb8, 0x24, 0x36, 0x79,
+ 0x13, 0x50, 0x8b, 0x5a, 0x4d, 0xb2, 0x4b, 0xa8, 0xe3, 0xdb, 0x7b, 0xa4, 0xe9, 0x7b, 0x36, 0x13,
+ 0x6e, 0x94, 0xad, 0x7f, 0x8e, 0xef, 0xef, 0xcd, 0x21, 0x2c, 0x1e, 0xc1, 0x81, 0x5c, 0x28, 0x77,
+ 0xa8, 0xf8, 0x2d, 0xf6, 0x5c, 0x7a, 0x59, 0xf1, 0xea, 0x57, 0xd2, 0x1d, 0xe9, 0xae, 0xce, 0x5a,
+ 0x5f, 0x3c, 0xed, 0x57, 0xcb, 0x09, 0x10, 0x4e, 0x0a, 0x47, 0xdf, 0x80, 0x05, 0x9f, 0x76, 0x0e,
+ 0x2d, 0xaf, 0x41, 0x3a, 0xc4, 0xb3, 0x89, 0x17, 0x30, 0xb1, 0x91, 0xf9, 0xfa, 0x12, 0xaf, 0x45,
+ 0x76, 0x06, 0x70, 0x78, 0x88, 0x1a, 0xbd, 0x01, 0x8b, 0x1d, 0xea, 0x77, 0xac, 0x96, 0xd8, 0x98,
+ 0x5d, 0xdf, 0x75, 0x9a, 0x3d, 0xb5, 0x9d, 0x4f, 0x9f, 0xf6, 0xab, 0x8b, 0xbb, 0x83, 0xc8, 0xb3,
+ 0x7e, 0xf5, 0x82, 0xd8, 0x3a, 0x0e, 0x89, 0x91, 0x78, 0x58, 0x8c, 0xe6, 0x06, 0xb9, 0x71, 0x6e,
+ 0x60, 0x6e, 0x41, 0xbe, 0xd1, 0x55, 0x31, 0xf1, 0x12, 0xe4, 0x6d, 0xf5, 0x5b, 0xed, 0x7c, 0x18,
+ 0x9c, 0x11, 0xcd, 0x59, 0xbf, 0x5a, 0xe6, 0xe5, 0x67, 0x2d, 0x04, 0xe0, 0x88, 0xc5, 0xfc, 0x8d,
+ 0x01, 0x15, 0x71, 0xf2, 0x7b, 0xc4, 0x25, 0xcd, 0xc0, 0xa7, 0x98, 0xbc, 0xdd, 0x75, 0x28, 0x69,
+ 0x13, 0x2f, 0x40, 0x5f, 0x84, 0xec, 0x11, 0xe9, 0xa9, 0xbc, 0x50, 0x54, 0x62, 0xb3, 0xaf, 0x91,
+ 0x1e, 0xe6, 0x70, 0x74, 0x03, 0xf2, 0x7e, 0x87, 0xc7, 0xa6, 0x4f, 0x55, 0x5e, 0x78, 0x2a, 0x54,
+ 0xbd, 0xa3, 0xe0, 0x67, 0xfd, 0xea, 0xc5, 0x84, 0xf8, 0x10, 0x81, 0x23, 0x56, 0xbe, 0xe2, 0x63,
+ 0xcb, 0xed, 0x12, 0x7e, 0x0a, 0xd1, 0x8a, 0xef, 0x0a, 0x08, 0x56, 0x18, 0xf3, 0x49, 0xc8, 0x0b,
+ 0x31, 0xec, 0xee, 0x15, 0xb4, 0x00, 0x59, 0x6c, 0x9d, 0x08, 0xab, 0x4a, 0x98, 0xff, 0xd4, 0x92,
+ 0xed, 0x0e, 0xc0, 0x4d, 0x12, 0x84, 0xfe, 0xb9, 0x0e, 0xf3, 0xe1, 0x8d, 0x93, 0xbc, 0x08, 0x23,
+ 0xa7, 0xc7, 0x49, 0x34, 0x1e, 0xa4, 0x37, 0xdf, 0x84, 0x82, 0xb8, 0x2c, 0x79, 0xa5, 0x11, 0x57,
+ 0x35, 0xc6, 0x7d, 0xaa, 0x9a, 0xb0, 0x54, 0xc9, 0x8c, 0x2b, 0x55, 0x34, 0x73, 0x5d, 0x28, 0x4b,
+ 0xde, 0xb0, 0x8e, 0x4b, 0xa5, 0xe1, 0x69, 0xc8, 0x87, 0x66, 0x2a, 0x2d, 0x51, 0xfd, 0x1e, 0x0a,
+ 0xc2, 0x11, 0x85, 0xa6, 0xed, 0x10, 0x12, 0x17, 0x7f, 0x3a, 0x65, 0x5a, 0x91, 0x96, 0xb9, 0x7f,
+ 0x91, 0xa6, 0x69, 0xfa, 0x21, 0x54, 0xc6, 0x15, 0xfd, 0x0f, 0x51, 0x9a, 0xa4, 0x37, 0xc5, 0x7c,
+ 0xcf, 0x80, 0x05, 0x5d, 0x52, 0xfa, 0xe3, 0x4b, 0xaf, 0xe4, 0xfc, 0xa2, 0x54, 0xdb, 0x91, 0x5f,
+ 0x19, 0xb0, 0x94, 0x58, 0xda, 0x44, 0x27, 0x3e, 0x81, 0x51, 0xba, 0x73, 0x64, 0x27, 0x70, 0x8e,
+ 0xbf, 0x64, 0xa0, 0x7c, 0xcb, 0xda, 0x27, 0x6e, 0x18, 0xa9, 0xe8, 0x07, 0x50, 0x6c, 0x5b, 0x41,
+ 0xf3, 0x50, 0x40, 0xc3, 0x06, 0xa6, 0x91, 0x2e, 0x27, 0x27, 0x24, 0xd5, 0xb6, 0x63, 0x31, 0x37,
+ 0xbc, 0x80, 0xf6, 0xea, 0x17, 0x94, 0x49, 0x45, 0x0d, 0x83, 0x75, 0x6d, 0xa2, 0xeb, 0x14, 0xdf,
+ 0x37, 0xde, 0xe9, 0xf0, 0xea, 0x6a, 0xf2, 0x66, 0x37, 0x61, 0x82, 0x96, 0xd5, 0xe2, 0xae, 0x73,
+ 0x7b, 0x40, 0x3e, 0x1e, 0xd2, 0xb8, 0xfc, 0x32, 0x2c, 0x0c, 0x1a, 0xcf, 0xf3, 0x4f, 0x94, 0x15,
+ 0x65, 0x22, 0x5c, 0x82, 0x9c, 0xc8, 0x53, 0xf2, 0x70, 0xb0, 0xfc, 0xb8, 0x9e, 0xb9, 0x66, 0x88,
+ 0xf4, 0x3a, 0xce, 0x90, 0x47, 0x94, 0x5e, 0x13, 0xe2, 0x1f, 0x30, 0xbd, 0xfe, 0xde, 0x80, 0x69,
+ 0xd1, 0x37, 0xbc, 0x09, 0x79, 0xbe, 0x7f, 0xb6, 0x15, 0x58, 0xc2, 0xae, 0xd4, 0x1d, 0x2b, 0xe7,
+ 0xde, 0x26, 0x81, 0x15, 0x7b, 0x5b, 0x08, 0xc1, 0x91, 0x44, 0x84, 0x21, 0xe7, 0x04, 0xa4, 0x1d,
+ 0x1e, 0xe4, 0x33, 0x63, 0x45, 0xab, 0x79, 0x49, 0x0d, 0x5b, 0x27, 0x37, 0xde, 0x09, 0x88, 0xc7,
+ 0x0f, 0x23, 0x0e, 0x8d, 0x2d, 0x2e, 0x03, 0x4b, 0x51, 0xe6, 0xbf, 0x0c, 0x88, 0x54, 0x71, 0xe7,
+ 0x67, 0xc4, 0x3d, 0xb8, 0xe5, 0x78, 0x47, 0x6a, 0x5b, 0x23, 0x73, 0xf6, 0x14, 0x1c, 0x47, 0x14,
+ 0xa3, 0xae, 0x87, 0xcc, 0x64, 0xd7, 0x03, 0x57, 0xd8, 0xf4, 0xbd, 0xc0, 0xf1, 0xba, 0x43, 0xd1,
+ 0xb6, 0xa1, 0xe0, 0x38, 0xa2, 0xe0, 0xf5, 0x12, 0x25, 0x6d, 0xcb, 0xf1, 0x1c, 0xaf, 0xc5, 0x17,
+ 0xb1, 0xe1, 0x77, 0xbd, 0x40, 0x14, 0x0e, 0xaa, 0x5e, 0xc2, 0x43, 0x58, 0x3c, 0x82, 0xc3, 0xfc,
+ 0xf7, 0x34, 0x14, 0xf9, 0x9a, 0xc3, 0x7b, 0xee, 0x45, 0x28, 0xbb, 0xba, 0x17, 0xa8, 0xb5, 0x5f,
+ 0x54, 0xa6, 0x24, 0xe3, 0x1a, 0x27, 0x69, 0x39, 0xf3, 0x81, 0x7e, 0x43, 0xab, 0x3d, 0x88, 0x98,
+ 0x93, 0xd5, 0x41, 0x92, 0x96, 0x67, 0xaf, 0x13, 0x1e, 0x1f, 0xaa, 0x80, 0x8a, 0x8e, 0xe8, 0x9b,
+ 0x1c, 0x88, 0x25, 0x0e, 0x6d, 0xc3, 0x05, 0xcb, 0x75, 0xfd, 0x13, 0x01, 0xac, 0xfb, 0xfe, 0x51,
+ 0xdb, 0xa2, 0x47, 0x4c, 0xf4, 0xfc, 0xf9, 0xfa, 0x17, 0x14, 0xcb, 0x85, 0xf5, 0x61, 0x12, 0x3c,
+ 0x8a, 0x6f, 0xd4, 0xb1, 0x4d, 0x4f, 0x78, 0x6c, 0x87, 0xb0, 0x34, 0x00, 0x12, 0x51, 0xae, 0x1a,
+ 0xf0, 0xe7, 0x94, 0x9c, 0x25, 0x3c, 0x82, 0xe6, 0x6c, 0x0c, 0x1c, 0x8f, 0x94, 0x88, 0xae, 0xc3,
+ 0x1c, 0xf7, 0x64, 0xbf, 0x1b, 0x84, 0xe5, 0x71, 0x4e, 0x1c, 0x37, 0x3a, 0xed, 0x57, 0xe7, 0x6e,
+ 0x27, 0x30, 0x78, 0x80, 0x92, 0x6f, 0xae, 0xeb, 0xb4, 0x9d, 0xa0, 0x32, 0x2b, 0x58, 0xa2, 0xcd,
+ 0xbd, 0xc5, 0x81, 0x58, 0xe2, 0x12, 0x1e, 0x98, 0x3f, 0xd7, 0x03, 0x37, 0x60, 0x91, 0x11, 0xcf,
+ 0xde, 0xf2, 0x9c, 0xc0, 0xb1, 0xdc, 0x1b, 0xc7, 0xa2, 0xf8, 0x2d, 0x8a, 0x83, 0xb8, 0xc8, 0x2b,
+ 0xd7, 0xbd, 0x41, 0x24, 0x1e, 0xa6, 0x37, 0xff, 0x9c, 0x05, 0x24, 0xfb, 0x0a, 0x5b, 0x16, 0x65,
+ 0x32, 0x2f, 0xf2, 0xee, 0x47, 0xf5, 0x25, 0xc6, 0x40, 0xf7, 0xa3, 0x5a, 0x92, 0x10, 0x8f, 0xb6,
+ 0xa1, 0x20, 0xf3, 0x53, 0x1c, 0x73, 0x6b, 0x8a, 0xb8, 0xb0, 0x13, 0x22, 0xce, 0xfa, 0xd5, 0xe5,
+ 0x84, 0x9a, 0x08, 0x23, 0x3a, 0xd3, 0x58, 0x02, 0xba, 0x0a, 0x60, 0x75, 0x1c, 0x7d, 0x36, 0x59,
+ 0x88, 0x27, 0x54, 0xf1, 0x94, 0x01, 0x6b, 0x54, 0xe8, 0x15, 0x98, 0x0e, 0x1e, 0xac, 0x7b, 0xcc,
+ 0x8b, 0xe6, 0x98, 0xf7, 0x8a, 0x42, 0x02, 0xd7, 0x2e, 0x82, 0x82, 0x71, 0xb3, 0x54, 0xe3, 0x17,
+ 0x69, 0xdf, 0x8c, 0x30, 0x58, 0xa3, 0x42, 0xdf, 0x82, 0xfc, 0x81, 0xaa, 0x67, 0xc5, 0xe9, 0xa6,
+ 0xce, 0xb3, 0x61, 0x15, 0x2c, 0xc7, 0x23, 0xe1, 0x17, 0x8e, 0xa4, 0xa1, 0xaf, 0x42, 0x91, 0x75,
+ 0xf7, 0xa3, 0x12, 0x40, 0xba, 0x44, 0x74, 0xdf, 0xee, 0xc5, 0x28, 0xac, 0xd3, 0x99, 0x6f, 0x43,
+ 0x61, 0xdb, 0x69, 0x52, 0x5f, 0xf4, 0xbb, 0x4f, 0xc1, 0x2c, 0x4b, 0x34, 0x73, 0xd1, 0x49, 0x86,
+ 0xae, 0x1a, 0xe2, 0xb9, 0x8f, 0x7a, 0x96, 0xe7, 0xcb, 0x96, 0x2d, 0x17, 0xfb, 0xe8, 0xeb, 0x1c,
+ 0x88, 0x25, 0xee, 0xfa, 0x12, 0xaf, 0x32, 0x7e, 0xfa, 0x61, 0x75, 0xea, 0xfd, 0x0f, 0xab, 0x53,
+ 0x1f, 0x7c, 0xa8, 0x2a, 0x8e, 0x3f, 0x00, 0xc0, 0xce, 0xfe, 0xf7, 0x48, 0x53, 0xe6, 0xee, 0x54,
+ 0x23, 0xcc, 0x70, 0x72, 0x2e, 0x46, 0x98, 0x99, 0x81, 0xca, 0x51, 0xc3, 0xe1, 0x04, 0x25, 0x5a,
+ 0x83, 0x42, 0x34, 0x9c, 0x54, 0xfe, 0xb1, 0x18, 0xfa, 0x5b, 0x34, 0xc1, 0xc4, 0x31, 0x4d, 0xe2,
+ 0x22, 0x99, 0x3e, 0xf7, 0x22, 0xa9, 0x43, 0xb6, 0xeb, 0xd8, 0x6a, 0x38, 0xf0, 0x6c, 0x78, 0x91,
+ 0xdf, 0xd9, 0x6a, 0x9c, 0xf5, 0xab, 0x8f, 0x8d, 0x7b, 0x13, 0x08, 0x7a, 0x1d, 0xc2, 0x6a, 0x77,
+ 0xb6, 0x1a, 0x98, 0x33, 0x8f, 0xca, 0x6a, 0x33, 0x13, 0x66, 0xb5, 0xab, 0x00, 0xad, 0x78, 0xc4,
+ 0x22, 0x93, 0x46, 0xe4, 0x88, 0xda, 0x68, 0x45, 0xa3, 0x42, 0x0c, 0x16, 0x9b, 0x94, 0x58, 0xe1,
+ 0xa8, 0x83, 0x05, 0x56, 0x5b, 0x0e, 0x6d, 0x27, 0x8b, 0x89, 0x4b, 0x4a, 0xcd, 0xe2, 0xc6, 0xa0,
+ 0x30, 0x3c, 0x2c, 0x1f, 0xf9, 0xb0, 0x68, 0xab, 0x6e, 0x38, 0x56, 0x5a, 0x98, 0x58, 0xa9, 0xc8,
+ 0x58, 0x8d, 0x41, 0x41, 0x78, 0x58, 0x36, 0xfa, 0x2e, 0x2c, 0x87, 0xc0, 0xe1, 0x91, 0x84, 0xc8,
+ 0xfa, 0xd9, 0xfa, 0xca, 0x69, 0xbf, 0xba, 0xdc, 0x18, 0x4b, 0x85, 0xef, 0x23, 0x01, 0xd9, 0x30,
+ 0xe3, 0xca, 0x2a, 0xb9, 0x28, 0x2a, 0x9b, 0xaf, 0xa5, 0x5b, 0x45, 0xec, 0xfd, 0x35, 0xbd, 0x3a,
+ 0x8e, 0xc6, 0x4b, 0xaa, 0x30, 0x56, 0xb2, 0xd1, 0x3b, 0x50, 0xb4, 0x3c, 0xcf, 0x0f, 0x2c, 0x39,
+ 0x24, 0x29, 0x09, 0x55, 0xeb, 0x13, 0xab, 0x5a, 0x8f, 0x65, 0x0c, 0x54, 0xe3, 0x1a, 0x06, 0xeb,
+ 0xaa, 0xd0, 0x09, 0xcc, 0xfb, 0x27, 0x1e, 0xa1, 0x98, 0x1c, 0x10, 0x4a, 0xbc, 0x26, 0x61, 0x95,
+ 0xb2, 0xd0, 0xfe, 0x5c, 0x4a, 0xed, 0x09, 0xe6, 0xd8, 0xa5, 0x93, 0x70, 0x86, 0x07, 0xb5, 0xa0,
+ 0x1a, 0xcf, 0xad, 0x9e, 0xe5, 0x3a, 0xdf, 0x27, 0x94, 0x55, 0xe6, 0xe2, 0xb9, 0xfa, 0x66, 0x04,
+ 0xc5, 0x1a, 0x05, 0xea, 0x42, 0xb9, 0xad, 0x5f, 0x19, 0x95, 0x45, 0x61, 0xe6, 0xb5, 0x74, 0x66,
+ 0x0e, 0x5f, 0x6a, 0x71, 0x19, 0x94, 0xc0, 0xe1, 0xa4, 0x96, 0xe5, 0x17, 0xa0, 0xf8, 0x80, 0x1d,
+ 0x02, 0xef, 0x30, 0x06, 0x0f, 0x64, 0xa2, 0x0e, 0xe3, 0x8f, 0x19, 0x98, 0x4b, 0x6e, 0xe3, 0xc0,
+ 0x75, 0x98, 0x4b, 0x75, 0x1d, 0x86, 0xbd, 0xac, 0x31, 0xf6, 0x81, 0x25, 0xcc, 0xcf, 0xd9, 0xb1,
+ 0xf9, 0x59, 0xa5, 0xc1, 0xe9, 0x87, 0x49, 0x83, 0x35, 0x00, 0x5e, 0xac, 0x50, 0xdf, 0x75, 0x09,
+ 0x15, 0x19, 0x30, 0xaf, 0x1e, 0x52, 0x22, 0x28, 0xd6, 0x28, 0x78, 0x49, 0xbd, 0xef, 0xfa, 0xcd,
+ 0x23, 0xb1, 0x05, 0x61, 0xf4, 0x8a, 0xdc, 0x97, 0x97, 0x25, 0x75, 0x7d, 0x08, 0x8b, 0x47, 0x70,
+ 0x98, 0x3d, 0xb8, 0xb8, 0x6b, 0x51, 0x5e, 0xe4, 0xc4, 0x91, 0x22, 0x7a, 0x96, 0xb7, 0x86, 0x3a,
+ 0xa2, 0x67, 0x27, 0x8d, 0xb8, 0x78, 0xf3, 0x63, 0x58, 0xdc, 0x15, 0x99, 0x7f, 0x35, 0xe0, 0xd2,
+ 0x48, 0xdd, 0x9f, 0x41, 0x47, 0xf6, 0x56, 0xb2, 0x23, 0x7b, 0x31, 0xe5, 0xc4, 0x75, 0x94, 0xb5,
+ 0x63, 0xfa, 0xb3, 0x59, 0xc8, 0xed, 0xf2, 0x4a, 0xd8, 0xfc, 0xd8, 0x80, 0x92, 0xf8, 0x35, 0xc9,
+ 0xc0, 0xbb, 0x9a, 0x7c, 0x07, 0x29, 0x3c, 0xba, 0x37, 0x90, 0x47, 0x31, 0x11, 0x7f, 0xcf, 0x80,
+ 0xe4, 0xa8, 0x19, 0xbd, 0x2c, 0x43, 0xc0, 0x88, 0x66, 0xc1, 0x13, 0xba, 0xff, 0x4b, 0xe3, 0x5a,
+ 0xd2, 0x0b, 0xa9, 0xa6, 0x95, 0x4f, 0x43, 0x01, 0xfb, 0x7e, 0xb0, 0x6b, 0x05, 0x87, 0x8c, 0xef,
+ 0x5d, 0x87, 0xff, 0x50, 0xdb, 0x2b, 0xf6, 0x4e, 0x60, 0xb0, 0x84, 0x9b, 0x3f, 0x37, 0xe0, 0xd2,
+ 0xd8, 0xe7, 0x2d, 0x9e, 0x45, 0x9a, 0xd1, 0x97, 0x5a, 0x51, 0xe4, 0xc8, 0x31, 0x1d, 0xd6, 0xa8,
+ 0x78, 0x2f, 0x99, 0x78, 0x13, 0x1b, 0xec, 0x25, 0x13, 0xda, 0x70, 0x92, 0xd6, 0xfc, 0x67, 0x06,
+ 0xd4, 0x7b, 0xd2, 0xff, 0xd8, 0xe9, 0x9f, 0x1c, 0x78, 0xcd, 0x9a, 0x4b, 0xbe, 0x66, 0x45, 0x4f,
+ 0x57, 0xda, 0x73, 0x4e, 0xf6, 0xfe, 0xcf, 0x39, 0xe8, 0xf9, 0xe8, 0x85, 0x48, 0xfa, 0xd0, 0x4a,
+ 0xf2, 0x85, 0xe8, 0xac, 0x5f, 0x2d, 0x29, 0xe1, 0xc9, 0x17, 0xa3, 0x37, 0x60, 0xd6, 0x26, 0x81,
+ 0xe5, 0xb8, 0xb2, 0x2f, 0x4c, 0xfd, 0xe6, 0x21, 0x85, 0x35, 0x24, 0x6b, 0xbd, 0xc8, 0x6d, 0x52,
+ 0x1f, 0x38, 0x14, 0xc8, 0x13, 0x76, 0xd3, 0xb7, 0x65, 0x47, 0x92, 0x8b, 0x13, 0xf6, 0x86, 0x6f,
+ 0x13, 0x2c, 0x30, 0xe6, 0xfb, 0x06, 0x14, 0xa5, 0xa4, 0x0d, 0xab, 0xcb, 0x08, 0xba, 0x12, 0xad,
+ 0x42, 0x1e, 0xf7, 0x25, 0xfd, 0x29, 0xf0, 0xac, 0x5f, 0x2d, 0x08, 0x32, 0xd1, 0xcc, 0x8c, 0x78,
+ 0xf2, 0xca, 0x9c, 0xb3, 0x47, 0x8f, 0x43, 0x4e, 0x04, 0x90, 0xda, 0xcc, 0xf8, 0x4d, 0x93, 0x03,
+ 0xb1, 0xc4, 0x99, 0x9f, 0x66, 0xa0, 0x9c, 0x58, 0x5c, 0x8a, 0xbe, 0x20, 0x1a, 0xa1, 0x66, 0x52,
+ 0x8c, 0xe5, 0xc7, 0xff, 0x83, 0x40, 0x5d, 0x5f, 0x33, 0x0f, 0x73, 0x7d, 0x7d, 0x1b, 0x66, 0x9a,
+ 0x7c, 0x8f, 0xc2, 0x3f, 0xa4, 0x5c, 0x99, 0xe4, 0x38, 0xc5, 0xee, 0xc6, 0xde, 0x28, 0x3e, 0x19,
+ 0x56, 0x02, 0xd1, 0x4d, 0x58, 0xa4, 0x24, 0xa0, 0xbd, 0xf5, 0x83, 0x80, 0x50, 0x7d, 0x98, 0x90,
+ 0x8b, 0xab, 0x6f, 0x3c, 0x48, 0x80, 0x87, 0x79, 0xcc, 0x7d, 0x28, 0xdd, 0xb6, 0xf6, 0xdd, 0xe8,
+ 0x15, 0x0f, 0x43, 0xd9, 0xf1, 0x9a, 0x6e, 0xd7, 0x26, 0x32, 0xa1, 0x87, 0xd9, 0x2b, 0x0c, 0xda,
+ 0x2d, 0x1d, 0x79, 0xd6, 0xaf, 0x5e, 0x48, 0x00, 0xe4, 0xb3, 0x15, 0x4e, 0x8a, 0x30, 0x5d, 0x98,
+ 0xfe, 0x0c, 0x3b, 0xc9, 0xef, 0x40, 0x21, 0xae, 0xf5, 0x1f, 0xb1, 0x4a, 0xf3, 0x2d, 0xc8, 0x73,
+ 0x8f, 0x0f, 0x7b, 0xd4, 0x73, 0xaa, 0xa4, 0x64, 0xed, 0x95, 0x49, 0x53, 0x7b, 0x89, 0xb7, 0xe0,
+ 0x3b, 0x1d, 0xfb, 0x21, 0xdf, 0x82, 0x33, 0x0f, 0x73, 0xf3, 0x65, 0x27, 0xbc, 0xf9, 0xae, 0x82,
+ 0xfc, 0xbf, 0x0c, 0xbf, 0x64, 0x64, 0x01, 0xa1, 0x5d, 0x32, 0xfa, 0xfd, 0xaf, 0xbd, 0x30, 0xfc,
+ 0xd8, 0x00, 0x10, 0xa3, 0x3c, 0x31, 0x46, 0x4a, 0xf1, 0xaf, 0x83, 0x3b, 0x30, 0xe3, 0x4b, 0x8f,
+ 0x94, 0xef, 0xc1, 0x13, 0xce, 0x8b, 0xa3, 0x40, 0x92, 0x3e, 0x89, 0x95, 0xb0, 0xfa, 0xab, 0x1f,
+ 0xdd, 0x5b, 0x99, 0xfa, 0xf8, 0xde, 0xca, 0xd4, 0x27, 0xf7, 0x56, 0xa6, 0xde, 0x3d, 0x5d, 0x31,
+ 0x3e, 0x3a, 0x5d, 0x31, 0x3e, 0x3e, 0x5d, 0x31, 0x3e, 0x39, 0x5d, 0x31, 0x3e, 0x3d, 0x5d, 0x31,
+ 0xde, 0xff, 0xfb, 0xca, 0xd4, 0x1b, 0x4f, 0xa4, 0xf9, 0x1f, 0xe2, 0x7f, 0x03, 0x00, 0x00, 0xff,
+ 0xff, 0xd3, 0xee, 0xe4, 0x1c, 0xae, 0x28, 0x00, 0x00,
}
func (m *APIGroup) Marshal() (dAtA []byte, err error) {
@@ -2025,6 +2055,48 @@ func (m *Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *FieldSelectorRequirement) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *FieldSelectorRequirement) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *FieldSelectorRequirement) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Values) > 0 {
+ for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Values[iNdEx])
+ copy(dAtA[i:], m.Values[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Values[iNdEx])))
+ i--
+ dAtA[i] = 0x1a
+ }
+ }
+ i -= len(m.Operator)
+ copy(dAtA[i:], m.Operator)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operator)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(m.Key)
+ copy(dAtA[i:], m.Key)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key)))
+ i--
+ dAtA[i] = 0xa
+ return len(dAtA) - i, nil
+}
+
func (m *FieldsV1) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -3714,6 +3786,25 @@ func (m *Duration) Size() (n int) {
return n
}
+func (m *FieldSelectorRequirement) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Key)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.Operator)
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Values) > 0 {
+ for _, s := range m.Values {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
func (m *FieldsV1) Size() (n int) {
if m == nil {
return 0
@@ -4429,6 +4520,18 @@ func (this *Duration) String() string {
}, "")
return s
}
+func (this *FieldSelectorRequirement) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&FieldSelectorRequirement{`,
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
+ `Operator:` + fmt.Sprintf("%v", this.Operator) + `,`,
+ `Values:` + fmt.Sprintf("%v", this.Values) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func (this *GetOptions) String() string {
if this == nil {
return "nil"
@@ -6443,6 +6546,152 @@ func (m *Duration) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *FieldSelectorRequirement) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: FieldSelectorRequirement: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: FieldSelectorRequirement: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Key = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Operator = FieldSelectorOperator(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Values = append(m.Values, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *FieldsV1) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
index 2b95700f720..18dd0b067cc 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
@@ -324,6 +324,25 @@ message Duration {
optional int64 duration = 1;
}
+// FieldSelectorRequirement is a selector that contains values, a key, and an operator that
+// relates the key and values.
+message FieldSelectorRequirement {
+ // key is the field selector key that the requirement applies to.
+ optional string key = 1;
+
+ // operator represents a key's relationship to a set of values.
+ // Valid operators are In, NotIn, Exists, DoesNotExist.
+ // The list of operators may grow in the future.
+ optional string operator = 2;
+
+ // values is an array of string values.
+ // If the operator is In or NotIn, the values array must be non-empty.
+ // If the operator is Exists or DoesNotExist, the values array must be empty.
+ // +optional
+ // +listType=atomic
+ repeated string values = 3;
+}
+
// FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.
//
// Each key is either a '.' representing the field itself, and will always map to an empty set,
@@ -460,7 +479,7 @@ message List {
optional ListMeta metadata = 1;
// List of objects
- repeated k8s.io.apimachinery.pkg.runtime.RawExtension items = 2;
+ repeated .k8s.io.apimachinery.pkg.runtime.RawExtension items = 2;
}
// ListMeta describes metadata that synthetic resources must have, including lists and
@@ -1209,6 +1228,6 @@ message WatchEvent {
// * If Type is Deleted: the state of the object immediately before deletion.
// * If Type is Error: *Status is recommended; other types may make sense
// depending on context.
- optional k8s.io.apimachinery.pkg.runtime.RawExtension object = 2;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension object = 2;
}
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go
index 592dcb8a746..c748071ed7f 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go
@@ -24,8 +24,10 @@ import (
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
+ cbor "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
"k8s.io/apimachinery/pkg/selection"
"k8s.io/apimachinery/pkg/types"
+ utiljson "k8s.io/apimachinery/pkg/util/json"
)
// LabelSelectorAsSelector converts the LabelSelector api type into a struct that implements
@@ -280,13 +282,20 @@ func (f FieldsV1) MarshalJSON() ([]byte, error) {
if f.Raw == nil {
return []byte("null"), nil
}
+ if f.getContentType() == fieldsV1InvalidOrValidCBORObject {
+ var u map[string]interface{}
+ if err := cbor.Unmarshal(f.Raw, &u); err != nil {
+ return nil, fmt.Errorf("metav1.FieldsV1 cbor invalid: %w", err)
+ }
+ return utiljson.Marshal(u)
+ }
return f.Raw, nil
}
// UnmarshalJSON implements json.Unmarshaler
func (f *FieldsV1) UnmarshalJSON(b []byte) error {
if f == nil {
- return errors.New("metav1.Fields: UnmarshalJSON on nil pointer")
+ return errors.New("metav1.FieldsV1: UnmarshalJSON on nil pointer")
}
if !bytes.Equal(b, []byte("null")) {
f.Raw = append(f.Raw[0:0], b...)
@@ -296,3 +305,75 @@ func (f *FieldsV1) UnmarshalJSON(b []byte) error {
var _ json.Marshaler = FieldsV1{}
var _ json.Unmarshaler = &FieldsV1{}
+
+func (f FieldsV1) MarshalCBOR() ([]byte, error) {
+ if f.Raw == nil {
+ return cbor.Marshal(nil)
+ }
+ if f.getContentType() == fieldsV1InvalidOrValidJSONObject {
+ var u map[string]interface{}
+ if err := utiljson.Unmarshal(f.Raw, &u); err != nil {
+ return nil, fmt.Errorf("metav1.FieldsV1 json invalid: %w", err)
+ }
+ return cbor.Marshal(u)
+ }
+ return f.Raw, nil
+}
+
+var cborNull = []byte{0xf6}
+
+func (f *FieldsV1) UnmarshalCBOR(b []byte) error {
+ if f == nil {
+ return errors.New("metav1.FieldsV1: UnmarshalCBOR on nil pointer")
+ }
+ if !bytes.Equal(b, cborNull) {
+ f.Raw = append(f.Raw[0:0], b...)
+ }
+ return nil
+}
+
+const (
+ // fieldsV1InvalidOrEmpty indicates that a FieldsV1 either contains no raw bytes or its raw
+ // bytes don't represent an allowable value in any supported encoding.
+ fieldsV1InvalidOrEmpty = iota
+
+ // fieldsV1InvalidOrValidJSONObject indicates that a FieldV1 either contains raw bytes that
+ // are a valid JSON encoding of an allowable value or don't represent an allowable value in
+ // any supported encoding.
+ fieldsV1InvalidOrValidJSONObject
+
+ // fieldsV1InvalidOrValidCBORObject indicates that a FieldV1 either contains raw bytes that
+ // are a valid CBOR encoding of an allowable value or don't represent an allowable value in
+ // any supported encoding.
+ fieldsV1InvalidOrValidCBORObject
+)
+
+// getContentType returns one of fieldsV1InvalidOrEmpty, fieldsV1InvalidOrValidJSONObject,
+// fieldsV1InvalidOrValidCBORObject based on the value of Raw.
+//
+// Raw can be encoded in JSON or CBOR and is only valid if it is empty, null, or an object (map)
+// value. It is invalid if it contains a JSON string, number, boolean, or array. If Raw is nonempty
+// and represents an allowable value, then the initial byte unambiguously distinguishes a
+// JSON-encoded value from a CBOR-encoded value.
+//
+// A valid JSON-encoded value can begin with any of the four JSON whitespace characters, the first
+// character 'n' of null, or '{' (0x09, 0x0a, 0x0d, 0x20, 0x6e, or 0x7b, respectively). A valid
+// CBOR-encoded value can begin with the null simple value, an initial byte with major type "map",
+// or, if a tag-enclosed map, an initial byte with major type "tag" (0xf6, 0xa0...0xbf, or
+// 0xc6...0xdb). The two sets of valid initial bytes don't intersect.
+func (f FieldsV1) getContentType() int {
+ if len(f.Raw) > 0 {
+ p := f.Raw[0]
+ switch p {
+ case 'n', '{', '\t', '\r', '\n', ' ':
+ return fieldsV1InvalidOrValidJSONObject
+ case 0xf6: // null
+ return fieldsV1InvalidOrValidCBORObject
+ default:
+ if p >= 0xa0 && p <= 0xbf /* map */ || p >= 0xc6 && p <= 0xdb /* tag */ {
+ return fieldsV1InvalidOrValidCBORObject
+ }
+ }
+ }
+ return fieldsV1InvalidOrEmpty
+}
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
index 8eb37f43670..9f302b3f364 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
@@ -19,6 +19,8 @@ package v1
import (
"encoding/json"
"time"
+
+ cbor "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
)
const RFC3339Micro = "2006-01-02T15:04:05.000000Z07:00"
@@ -129,6 +131,25 @@ func (t *MicroTime) UnmarshalJSON(b []byte) error {
return nil
}
+func (t *MicroTime) UnmarshalCBOR(b []byte) error {
+ var s *string
+ if err := cbor.Unmarshal(b, &s); err != nil {
+ return err
+ }
+ if s == nil {
+ t.Time = time.Time{}
+ return nil
+ }
+
+ parsed, err := time.Parse(RFC3339Micro, *s)
+ if err != nil {
+ return err
+ }
+
+ t.Time = parsed.Local()
+ return nil
+}
+
// UnmarshalQueryParameter converts from a URL query parameter value to an object
func (t *MicroTime) UnmarshalQueryParameter(str string) error {
if len(str) == 0 {
@@ -160,6 +181,13 @@ func (t MicroTime) MarshalJSON() ([]byte, error) {
return json.Marshal(t.UTC().Format(RFC3339Micro))
}
+func (t MicroTime) MarshalCBOR() ([]byte, error) {
+ if t.IsZero() {
+ return cbor.Marshal(nil)
+ }
+ return cbor.Marshal(t.UTC().Format(RFC3339Micro))
+}
+
// OpenAPISchemaType is used by the kube-openapi generator when constructing
// the OpenAPI spec of this type.
//
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
index 421770d4320..0333cfdb337 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
@@ -19,6 +19,8 @@ package v1
import (
"encoding/json"
"time"
+
+ cbor "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
)
// Time is a wrapper around time.Time which supports correct
@@ -116,6 +118,25 @@ func (t *Time) UnmarshalJSON(b []byte) error {
return nil
}
+func (t *Time) UnmarshalCBOR(b []byte) error {
+ var s *string
+ if err := cbor.Unmarshal(b, &s); err != nil {
+ return err
+ }
+ if s == nil {
+ t.Time = time.Time{}
+ return nil
+ }
+
+ parsed, err := time.Parse(time.RFC3339, *s)
+ if err != nil {
+ return err
+ }
+
+ t.Time = parsed.Local()
+ return nil
+}
+
// UnmarshalQueryParameter converts from a URL query parameter value to an object
func (t *Time) UnmarshalQueryParameter(str string) error {
if len(str) == 0 {
@@ -151,6 +172,14 @@ func (t Time) MarshalJSON() ([]byte, error) {
return buf, nil
}
+func (t Time) MarshalCBOR() ([]byte, error) {
+ if t.IsZero() {
+ return cbor.Marshal(nil)
+ }
+
+ return cbor.Marshal(t.UTC().Format(time.RFC3339))
+}
+
// ToUnstructured implements the value.UnstructuredConverter interface.
func (t Time) ToUnstructured() interface{} {
if t.IsZero() {
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
index 9695ba50b4d..473adb9ef53 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
@@ -1278,6 +1278,33 @@ const (
LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist"
)
+// FieldSelectorRequirement is a selector that contains values, a key, and an operator that
+// relates the key and values.
+type FieldSelectorRequirement struct {
+ // key is the field selector key that the requirement applies to.
+ Key string `json:"key" protobuf:"bytes,1,opt,name=key"`
+ // operator represents a key's relationship to a set of values.
+ // Valid operators are In, NotIn, Exists, DoesNotExist.
+ // The list of operators may grow in the future.
+ Operator FieldSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=FieldSelectorOperator"`
+ // values is an array of string values.
+ // If the operator is In or NotIn, the values array must be non-empty.
+ // If the operator is Exists or DoesNotExist, the values array must be empty.
+ // +optional
+ // +listType=atomic
+ Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
+}
+
+// A field selector operator is the set of operators that can be used in a selector requirement.
+type FieldSelectorOperator string
+
+const (
+ FieldSelectorOpIn FieldSelectorOperator = "In"
+ FieldSelectorOpNotIn FieldSelectorOperator = "NotIn"
+ FieldSelectorOpExists FieldSelectorOperator = "Exists"
+ FieldSelectorOpDoesNotExist FieldSelectorOperator = "DoesNotExist"
+)
+
// ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource
// that the fieldset applies to.
type ManagedFieldsEntry struct {
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go
index b736e837126..1fa37215cd0 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go
@@ -135,6 +135,17 @@ func (DeleteOptions) SwaggerDoc() map[string]string {
return map_DeleteOptions
}
+var map_FieldSelectorRequirement = map[string]string{
+ "": "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.",
+ "key": "key is the field selector key that the requirement applies to.",
+ "operator": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.",
+ "values": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.",
+}
+
+func (FieldSelectorRequirement) SwaggerDoc() map[string]string {
+ return map_FieldSelectorRequirement
+}
+
var map_FieldsV1 = map[string]string{
"": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff",
}
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go
index a0f709ad862..3eba5ba5417 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go
@@ -32,6 +32,10 @@ import (
type LabelSelectorValidationOptions struct {
// Allow invalid label value in selector
AllowInvalidLabelValueInSelector bool
+
+ // Allows an operator that is not interpretable to pass validation. This is useful for cases where a broader check
+ // can be performed, as in a *SubjectAccessReview
+ AllowUnknownOperatorInRequirement bool
}
// LabelSelectorHasInvalidLabelValue returns true if the given selector contains an invalid label value in a match expression.
@@ -79,7 +83,9 @@ func ValidateLabelSelectorRequirement(sr metav1.LabelSelectorRequirement, opts L
allErrs = append(allErrs, field.Forbidden(fldPath.Child("values"), "may not be specified when `operator` is 'Exists' or 'DoesNotExist'"))
}
default:
- allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), sr.Operator, "not a valid selector operator"))
+ if !opts.AllowUnknownOperatorInRequirement {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), sr.Operator, "not a valid selector operator"))
+ }
}
allErrs = append(allErrs, ValidateLabelName(sr.Key, fldPath.Child("key"))...)
if !opts.AllowInvalidLabelValueInSelector {
@@ -113,6 +119,39 @@ func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorLi
return allErrs
}
+// FieldSelectorValidationOptions is a struct that can be passed to ValidateFieldSelectorRequirement to record the validate options
+type FieldSelectorValidationOptions struct {
+ // Allows an operator that is not interpretable to pass validation. This is useful for cases where a broader check
+ // can be performed, as in a *SubjectAccessReview
+ AllowUnknownOperatorInRequirement bool
+}
+
+// ValidateLabelSelectorRequirement validates the requirement according to the opts and returns any validation errors.
+func ValidateFieldSelectorRequirement(requirement metav1.FieldSelectorRequirement, opts FieldSelectorValidationOptions, fldPath *field.Path) field.ErrorList {
+ allErrs := field.ErrorList{}
+
+ if len(requirement.Key) == 0 {
+ allErrs = append(allErrs, field.Required(fldPath.Child("key"), "must be specified"))
+ }
+
+ switch requirement.Operator {
+ case metav1.FieldSelectorOpIn, metav1.FieldSelectorOpNotIn:
+ if len(requirement.Values) == 0 {
+ allErrs = append(allErrs, field.Required(fldPath.Child("values"), "must be specified when `operator` is 'In' or 'NotIn'"))
+ }
+ case metav1.FieldSelectorOpExists, metav1.FieldSelectorOpDoesNotExist:
+ if len(requirement.Values) > 0 {
+ allErrs = append(allErrs, field.Forbidden(fldPath.Child("values"), "may not be specified when `operator` is 'Exists' or 'DoesNotExist'"))
+ }
+ default:
+ if !opts.AllowUnknownOperatorInRequirement {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), requirement.Operator, "not a valid selector operator"))
+ }
+ }
+
+ return allErrs
+}
+
func ValidateDeleteOptions(options *metav1.DeleteOptions) field.ErrorList {
allErrs := field.ErrorList{}
//lint:file-ignore SA1019 Keep validation for deprecated OrphanDependents option until it's being removed
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go
index 7d29c504ab9..90cc54a7e76 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go
@@ -327,6 +327,27 @@ func (in *Duration) DeepCopy() *Duration {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *FieldSelectorRequirement) DeepCopyInto(out *FieldSelectorRequirement) {
+ *out = *in
+ if in.Values != nil {
+ in, out := &in.Values, &out.Values
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FieldSelectorRequirement.
+func (in *FieldSelectorRequirement) DeepCopy() *FieldSelectorRequirement {
+ if in == nil {
+ return nil
+ }
+ out := new(FieldSelectorRequirement)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FieldsV1) DeepCopyInto(out *FieldsV1) {
*out = *in
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto
index d14d42591bb..fcec5535425 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto
@@ -33,9 +33,9 @@ message PartialObjectMetadataList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 2;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 2;
// items contains each of the included items.
- repeated k8s.io.apimachinery.pkg.apis.meta.v1.PartialObjectMetadata items = 1;
+ repeated .k8s.io.apimachinery.pkg.apis.meta.v1.PartialObjectMetadata items = 1;
}
diff --git a/vendor/k8s.io/apimachinery/pkg/labels/selector.go b/vendor/k8s.io/apimachinery/pkg/labels/selector.go
index 5e601424051..9e22a005642 100644
--- a/vendor/k8s.io/apimachinery/pkg/labels/selector.go
+++ b/vendor/k8s.io/apimachinery/pkg/labels/selector.go
@@ -45,6 +45,19 @@ var (
// Requirements is AND of all requirements.
type Requirements []Requirement
+func (r Requirements) String() string {
+ var sb strings.Builder
+
+ for i, requirement := range r {
+ if i > 0 {
+ sb.WriteString(", ")
+ }
+ sb.WriteString(requirement.String())
+ }
+
+ return sb.String()
+}
+
// Selector represents a label selector.
type Selector interface {
// Matches returns true if this selector matches the given set of labels.
@@ -285,6 +298,13 @@ func (r *Requirement) Values() sets.String {
return ret
}
+// ValuesUnsorted returns a copy of requirement values as passed to NewRequirement without sorting.
+func (r *Requirement) ValuesUnsorted() []string {
+ ret := make([]string, 0, len(r.strValues))
+ ret = append(ret, r.strValues...)
+ return ret
+}
+
// Equal checks the equality of requirement.
func (r Requirement) Equal(x Requirement) bool {
if r.key != x.key {
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/extension.go b/vendor/k8s.io/apimachinery/pkg/runtime/extension.go
index 9056397fa51..60c000bcb71 100644
--- a/vendor/k8s.io/apimachinery/pkg/runtime/extension.go
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/extension.go
@@ -18,16 +18,77 @@ package runtime
import (
"bytes"
- "encoding/json"
"errors"
+ "fmt"
+
+ cbor "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
+ "k8s.io/apimachinery/pkg/util/json"
)
+// RawExtension intentionally avoids implementing value.UnstructuredConverter for now because the
+// signature of ToUnstructured does not allow returning an error value in cases where the conversion
+// is not possible (content type is unrecognized or bytes don't match content type).
+func rawToUnstructured(raw []byte, contentType string) (interface{}, error) {
+ switch contentType {
+ case ContentTypeJSON:
+ var u interface{}
+ if err := json.Unmarshal(raw, &u); err != nil {
+ return nil, fmt.Errorf("failed to parse RawExtension bytes as JSON: %w", err)
+ }
+ return u, nil
+ case ContentTypeCBOR:
+ var u interface{}
+ if err := cbor.Unmarshal(raw, &u); err != nil {
+ return nil, fmt.Errorf("failed to parse RawExtension bytes as CBOR: %w", err)
+ }
+ return u, nil
+ default:
+ return nil, fmt.Errorf("cannot convert RawExtension with unrecognized content type to unstructured")
+ }
+}
+
+func (re RawExtension) guessContentType() string {
+ switch {
+ case bytes.HasPrefix(re.Raw, cborSelfDescribed):
+ return ContentTypeCBOR
+ case len(re.Raw) > 0:
+ switch re.Raw[0] {
+ case '\t', '\r', '\n', ' ', '{', '[', 'n', 't', 'f', '"', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
+ // Prefixes for the four whitespace characters, objects, arrays, strings, numbers, true, false, and null.
+ return ContentTypeJSON
+ }
+ }
+ return ""
+}
+
func (re *RawExtension) UnmarshalJSON(in []byte) error {
if re == nil {
return errors.New("runtime.RawExtension: UnmarshalJSON on nil pointer")
}
- if !bytes.Equal(in, []byte("null")) {
- re.Raw = append(re.Raw[0:0], in...)
+ if bytes.Equal(in, []byte("null")) {
+ return nil
+ }
+ re.Raw = append(re.Raw[0:0], in...)
+ return nil
+}
+
+var (
+ cborNull = []byte{0xf6}
+ cborSelfDescribed = []byte{0xd9, 0xd9, 0xf7}
+)
+
+func (re *RawExtension) UnmarshalCBOR(in []byte) error {
+ if re == nil {
+ return errors.New("runtime.RawExtension: UnmarshalCBOR on nil pointer")
+ }
+ if !bytes.Equal(in, cborNull) {
+ if !bytes.HasPrefix(in, cborSelfDescribed) {
+ // The self-described CBOR tag doesn't change the interpretation of the data
+ // item it encloses, but it is useful as a magic number. Its encoding is
+ // also what is used to implement the CBOR RecognizingDecoder.
+ re.Raw = append(re.Raw[:0], cborSelfDescribed...)
+ }
+ re.Raw = append(re.Raw, in...)
}
return nil
}
@@ -46,6 +107,35 @@ func (re RawExtension) MarshalJSON() ([]byte, error) {
}
return []byte("null"), nil
}
- // TODO: Check whether ContentType is actually JSON before returning it.
- return re.Raw, nil
+
+ contentType := re.guessContentType()
+ if contentType == ContentTypeJSON {
+ return re.Raw, nil
+ }
+
+ u, err := rawToUnstructured(re.Raw, contentType)
+ if err != nil {
+ return nil, err
+ }
+ return json.Marshal(u)
+}
+
+func (re RawExtension) MarshalCBOR() ([]byte, error) {
+ if re.Raw == nil {
+ if re.Object != nil {
+ return cbor.Marshal(re.Object)
+ }
+ return cbor.Marshal(nil)
+ }
+
+ contentType := re.guessContentType()
+ if contentType == ContentTypeCBOR {
+ return re.Raw, nil
+ }
+
+ u, err := rawToUnstructured(re.Raw, contentType)
+ if err != nil {
+ return nil, err
+ }
+ return cbor.Marshal(u)
}
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct/direct.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct/direct.go
new file mode 100644
index 00000000000..cd78b1df266
--- /dev/null
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct/direct.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package direct provides functions for marshaling and unmarshaling between arbitrary Go values and
+// CBOR data, with behavior that is compatible with that of the CBOR serializer. In particular,
+// types that implement cbor.Marshaler and cbor.Unmarshaler should use these functions.
+package direct
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes"
+)
+
+func Marshal(src interface{}) ([]byte, error) {
+ return modes.Encode.Marshal(src)
+}
+
+func Unmarshal(src []byte, dst interface{}) error {
+ return modes.Decode.Unmarshal(src, dst)
+}
+
+func Diagnose(src []byte) (string, error) {
+ return modes.Diagnostic.Diagnose(src)
+}
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/buffers.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/buffers.go
new file mode 100644
index 00000000000..f14cbd6b586
--- /dev/null
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/buffers.go
@@ -0,0 +1,65 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package modes
+
+import (
+ "bytes"
+ "sync"
+)
+
+var buffers = BufferProvider{p: new(sync.Pool)}
+
+type buffer struct {
+ bytes.Buffer
+}
+
+type pool interface {
+ Get() interface{}
+ Put(interface{})
+}
+
+type BufferProvider struct {
+ p pool
+}
+
+func (b *BufferProvider) Get() *buffer {
+ if buf, ok := b.p.Get().(*buffer); ok {
+ return buf
+ }
+ return &buffer{}
+}
+
+func (b *BufferProvider) Put(buf *buffer) {
+ if buf.Cap() > 3*1024*1024 /* Default MaxRequestBodyBytes */ {
+ // Objects in a sync.Pool are assumed to be fungible. This is not a good assumption
+ // for pools of *bytes.Buffer because a *bytes.Buffer's underlying array grows as
+ // needed to accommodate writes. In Kubernetes, apiservers tend to encode "small"
+ // objects very frequently and much larger objects (especially large lists) only
+ // occasionally. Under steady load, pooled buffers tend to be borrowed frequently
+ // enough to prevent them from being released. Over time, each buffer is used to
+ // encode a large object and its capacity increases accordingly. The result is that
+ // practically all buffers in the pool retain much more capacity than needed to
+ // encode most objects.
+
+ // As a basic mitigation for the worst case, buffers with more capacity than the
+ // default max request body size are never returned to the pool.
+ // TODO: Optimize for higher buffer utilization.
+ return
+ }
+ buf.Reset()
+ b.p.Put(buf)
+}
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/custom.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/custom.go
new file mode 100644
index 00000000000..858529e958a
--- /dev/null
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/custom.go
@@ -0,0 +1,422 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package modes
+
+import (
+ "encoding"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "reflect"
+ "sync"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+// Returns a non-nil error if and only if the argument's type (or one of its component types, for
+// composite types) implements json.Marshaler or encoding.TextMarshaler without also implementing
+// cbor.Marshaler and likewise for the respective Unmarshaler interfaces.
+//
+// This is a temporary, graduation-blocking restriction and will be removed in favor of automatic
+// transcoding between CBOR and JSON/text for these types. This restriction allows CBOR to be
+// exercised for in-tree and unstructured types while mitigating the risk of mangling out-of-tree
+// types in client programs.
+func RejectCustomMarshalers(v interface{}) error {
+ if v == nil {
+ return nil
+ }
+ rv := reflect.ValueOf(v)
+ if err := marshalerCache.getChecker(rv.Type()).check(rv, maxDepth); err != nil {
+ return fmt.Errorf("unable to serialize %T: %w", v, err)
+ }
+ if err := unmarshalerCache.getChecker(rv.Type()).check(rv, maxDepth); err != nil {
+ return fmt.Errorf("unable to serialize %T: %w", v, err)
+ }
+ return nil
+}
+
+// Recursion depth is limited as a basic mitigation against cyclic objects. Objects created by the
+// decoder shouldn't be able to contain cycles, but practically any object can be passed to the
+// encoder.
+var errMaxDepthExceeded = errors.New("object depth exceeds limit (possible cycle?)")
+
+// The JSON encoder begins detecting cycles after depth 1000. Use a generous limit here, knowing
+// that it can might deeply nested acyclic objects. The limit will be removed along with the rest of
+// this mechanism.
+const maxDepth = 2048
+
+var marshalerCache = checkers{
+ cborInterface: reflect.TypeFor[cbor.Marshaler](),
+ nonCBORInterfaces: []reflect.Type{
+ reflect.TypeFor[json.Marshaler](),
+ reflect.TypeFor[encoding.TextMarshaler](),
+ },
+}
+
+var unmarshalerCache = checkers{
+ cborInterface: reflect.TypeFor[cbor.Unmarshaler](),
+ nonCBORInterfaces: []reflect.Type{
+ reflect.TypeFor[json.Unmarshaler](),
+ reflect.TypeFor[encoding.TextUnmarshaler](),
+ },
+ assumeAddressableValues: true,
+}
+
+// checker wraps a function for dynamically checking a value of a specific type for custom JSON
+// behaviors not matched by a custom CBOR behavior.
+type checker struct {
+ // check returns a non-nil error if the given value might be marshalled to or from CBOR
+ // using the default behavior for its kind, but marshalled to or from JSON using custom
+ // behavior.
+ check func(rv reflect.Value, depth int) error
+
+ // safe returns true if all values of this type are safe from mismatched custom marshalers.
+ safe func() bool
+}
+
+// TODO: stale
+// Having a single addressable checker for comparisons lets us prune and collapse parts of the
+// object traversal that are statically known to be safe. Depending on the type, it may be
+// unnecessary to inspect each value of that type. For example, no value of the built-in type bool
+// can implement json.Marshaler (a named type whose underlying type is bool could, but it is a
+// distinct type from bool).
+var noop = checker{
+ safe: func() bool {
+ return true
+ },
+ check: func(rv reflect.Value, depth int) error {
+ return nil
+ },
+}
+
+type checkers struct {
+ m sync.Map // reflect.Type => *checker
+
+ cborInterface reflect.Type
+ nonCBORInterfaces []reflect.Type
+
+ assumeAddressableValues bool
+}
+
+func (cache *checkers) getChecker(rt reflect.Type) checker {
+ if ptr, ok := cache.m.Load(rt); ok {
+ return *ptr.(*checker)
+ }
+
+ return cache.getCheckerInternal(rt, nil)
+}
+
+// linked list node representing the path from a composite type to an element type
+type path struct {
+ Type reflect.Type
+ Parent *path
+}
+
+func (p path) cyclic(rt reflect.Type) bool {
+ for ancestor := &p; ancestor != nil; ancestor = ancestor.Parent {
+ if ancestor.Type == rt {
+ return true
+ }
+ }
+ return false
+}
+
+func (cache *checkers) getCheckerInternal(rt reflect.Type, parent *path) (c checker) {
+ // Store a placeholder cache entry first to handle cyclic types.
+ var wg sync.WaitGroup
+ wg.Add(1)
+ defer wg.Done()
+ c = checker{
+ safe: func() bool {
+ wg.Wait()
+ return c.safe()
+ },
+ check: func(rv reflect.Value, depth int) error {
+ wg.Wait()
+ return c.check(rv, depth)
+ },
+ }
+ if actual, loaded := cache.m.LoadOrStore(rt, &c); loaded {
+ // Someone else stored an entry for this type, use it.
+ return *actual.(*checker)
+ }
+
+ // Take a nonreflective path for the unstructured container types. They're common and
+ // usually nested inside one another.
+ switch rt {
+ case reflect.TypeFor[map[string]interface{}](), reflect.TypeFor[[]interface{}]():
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(rv reflect.Value, depth int) error {
+ return checkUnstructuredValue(cache, rv.Interface(), depth)
+ },
+ }
+ }
+
+ // It's possible that one of the relevant interfaces is implemented on a type with a pointer
+ // receiver, but that a particular value of that type is not addressable. For example:
+ //
+ // func (Foo) MarshalText() ([]byte, error) { ... }
+ // func (*Foo) MarshalCBOR() ([]byte, error) { ... }
+ //
+ // Both methods are in the method set of *Foo, but the method set of Foo contains only
+ // MarshalText.
+ //
+ // Both the unmarshaler and marshaler checks assume that methods implementing a JSON or text
+ // interface with a pointer receiver are always accessible. Only the unmarshaler check
+ // assumes that CBOR methods with pointer receivers are accessible.
+
+ if rt.Implements(cache.cborInterface) {
+ return noop
+ }
+ for _, unsafe := range cache.nonCBORInterfaces {
+ if rt.Implements(unsafe) {
+ err := fmt.Errorf("%v implements %v without corresponding cbor interface", rt, unsafe)
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(reflect.Value, int) error {
+ return err
+ },
+ }
+ }
+ }
+
+ if cache.assumeAddressableValues && reflect.PointerTo(rt).Implements(cache.cborInterface) {
+ return noop
+ }
+ for _, unsafe := range cache.nonCBORInterfaces {
+ if reflect.PointerTo(rt).Implements(unsafe) {
+ err := fmt.Errorf("%v implements %v without corresponding cbor interface", reflect.PointerTo(rt), unsafe)
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(reflect.Value, int) error {
+ return err
+ },
+ }
+ }
+ }
+
+ self := &path{Type: rt, Parent: parent}
+
+ switch rt.Kind() {
+ case reflect.Array:
+ ce := cache.getCheckerInternal(rt.Elem(), self)
+ rtlen := rt.Len()
+ if rtlen == 0 || (!self.cyclic(rt.Elem()) && ce.safe()) {
+ return noop
+ }
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(rv reflect.Value, depth int) error {
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ for i := 0; i < rtlen; i++ {
+ if err := ce.check(rv.Index(i), depth-1); err != nil {
+ return err
+ }
+ }
+ return nil
+ },
+ }
+
+ case reflect.Interface:
+ // All interface values have to be checked because their dynamic type might
+ // implement one of the interesting interfaces or be composed of another type that
+ // does.
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(rv reflect.Value, depth int) error {
+ if rv.IsNil() {
+ return nil
+ }
+ // Unpacking interfaces must count against recursion depth,
+ // consider this cycle:
+ // > var i interface{}
+ // > var p *interface{} = &i
+ // > i = p
+ // > rv := reflect.ValueOf(i)
+ // > for {
+ // > rv = rv.Elem()
+ // > }
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ rv = rv.Elem()
+ return cache.getChecker(rv.Type()).check(rv, depth-1)
+ },
+ }
+
+ case reflect.Map:
+ rtk := rt.Key()
+ ck := cache.getCheckerInternal(rtk, self)
+ rte := rt.Elem()
+ ce := cache.getCheckerInternal(rte, self)
+ if !self.cyclic(rtk) && !self.cyclic(rte) && ck.safe() && ce.safe() {
+ return noop
+ }
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(rv reflect.Value, depth int) error {
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ iter := rv.MapRange()
+ rvk := reflect.New(rtk).Elem()
+ rve := reflect.New(rte).Elem()
+ for iter.Next() {
+ rvk.SetIterKey(iter)
+ if err := ck.check(rvk, depth-1); err != nil {
+ return err
+ }
+ rve.SetIterValue(iter)
+ if err := ce.check(rve, depth-1); err != nil {
+ return err
+ }
+ }
+ return nil
+ },
+ }
+
+ case reflect.Pointer:
+ ce := cache.getCheckerInternal(rt.Elem(), self)
+ if !self.cyclic(rt.Elem()) && ce.safe() {
+ return noop
+ }
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(rv reflect.Value, depth int) error {
+ if rv.IsNil() {
+ return nil
+ }
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ return ce.check(rv.Elem(), depth-1)
+ },
+ }
+
+ case reflect.Slice:
+ ce := cache.getCheckerInternal(rt.Elem(), self)
+ if !self.cyclic(rt.Elem()) && ce.safe() {
+ return noop
+ }
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(rv reflect.Value, depth int) error {
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ for i := 0; i < rv.Len(); i++ {
+ if err := ce.check(rv.Index(i), depth-1); err != nil {
+ return err
+ }
+ }
+ return nil
+ },
+ }
+
+ case reflect.Struct:
+ type field struct {
+ Index int
+ Checker checker
+ }
+ var fields []field
+ for i := 0; i < rt.NumField(); i++ {
+ f := rt.Field(i)
+ cf := cache.getCheckerInternal(f.Type, self)
+ if !self.cyclic(f.Type) && cf.safe() {
+ continue
+ }
+ fields = append(fields, field{Index: i, Checker: cf})
+ }
+ if len(fields) == 0 {
+ return noop
+ }
+ return checker{
+ safe: func() bool {
+ return false
+ },
+ check: func(rv reflect.Value, depth int) error {
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ for _, fi := range fields {
+ if err := fi.Checker.check(rv.Field(fi.Index), depth-1); err != nil {
+ return err
+ }
+ }
+ return nil
+ },
+ }
+
+ default:
+ // Not a serializable composite type (funcs and channels are composite types but are
+ // rejected by JSON and CBOR serialization).
+ return noop
+
+ }
+}
+
+func checkUnstructuredValue(cache *checkers, v interface{}, depth int) error {
+ switch v := v.(type) {
+ case nil, bool, int64, float64, string:
+ return nil
+ case []interface{}:
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ for _, element := range v {
+ if err := checkUnstructuredValue(cache, element, depth-1); err != nil {
+ return err
+ }
+ }
+ return nil
+ case map[string]interface{}:
+ if depth <= 0 {
+ return errMaxDepthExceeded
+ }
+ for _, element := range v {
+ if err := checkUnstructuredValue(cache, element, depth-1); err != nil {
+ return err
+ }
+ }
+ return nil
+ default:
+ // Unmarshaling an unstructured doesn't use other dynamic types, but nothing
+ // prevents inserting values with arbitrary dynamic types into unstructured content,
+ // as long as they can be marshalled.
+ rv := reflect.ValueOf(v)
+ return cache.getChecker(rv.Type()).check(rv, depth)
+ }
+}
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go
new file mode 100644
index 00000000000..895b0deff95
--- /dev/null
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go
@@ -0,0 +1,158 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package modes
+
+import (
+ "reflect"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+var simpleValues *cbor.SimpleValueRegistry = func() *cbor.SimpleValueRegistry {
+ var opts []func(*cbor.SimpleValueRegistry) error
+ for sv := 0; sv <= 255; sv++ {
+ // Reject simple values 0-19, 23, and 32-255. The simple values 24-31 are reserved
+ // and considered ill-formed by the CBOR specification. We only accept false (20),
+ // true (21), and null (22).
+ switch sv {
+ case 20: // false
+ case 21: // true
+ case 22: // null
+ case 24, 25, 26, 27, 28, 29, 30, 31: // reserved
+ default:
+ opts = append(opts, cbor.WithRejectedSimpleValue(cbor.SimpleValue(sv)))
+ }
+ }
+ simpleValues, err := cbor.NewSimpleValueRegistryFromDefaults(opts...)
+ if err != nil {
+ panic(err)
+ }
+ return simpleValues
+}()
+
+var Decode cbor.DecMode = func() cbor.DecMode {
+ decode, err := cbor.DecOptions{
+ // Maps with duplicate keys are well-formed but invalid according to the CBOR spec
+ // and never acceptable. Unlike the JSON serializer, inputs containing duplicate map
+ // keys are rejected outright and not surfaced as a strict decoding error.
+ DupMapKey: cbor.DupMapKeyEnforcedAPF,
+
+ // For JSON parity, decoding an RFC3339 string into time.Time needs to be accepted
+ // with or without tagging. If a tag number is present, it must be valid.
+ TimeTag: cbor.DecTagOptional,
+
+ // Observed depth up to 16 in fuzzed batch/v1 CronJobList. JSON implementation limit
+ // is 10000.
+ MaxNestedLevels: 64,
+
+ MaxArrayElements: 1024,
+ MaxMapPairs: 1024,
+
+ // Indefinite-length sequences aren't produced by this serializer, but other
+ // implementations can.
+ IndefLength: cbor.IndefLengthAllowed,
+
+ // Accept inputs that contain CBOR tags.
+ TagsMd: cbor.TagsAllowed,
+
+ // Decode type 0 (unsigned integer) as int64.
+ // TODO: IntDecConvertSignedOrFail errors on overflow, JSON will try to fall back to float64.
+ IntDec: cbor.IntDecConvertSignedOrFail,
+
+ // Disable producing map[cbor.ByteString]interface{}, which is not acceptable for
+ // decodes into interface{}.
+ MapKeyByteString: cbor.MapKeyByteStringForbidden,
+
+ // Error on map keys that don't map to a field in the destination struct.
+ ExtraReturnErrors: cbor.ExtraDecErrorUnknownField,
+
+ // Decode maps into concrete type map[string]interface{} when the destination is an
+ // interface{}.
+ DefaultMapType: reflect.TypeOf(map[string]interface{}(nil)),
+
+ // A CBOR text string whose content is not a valid UTF-8 sequence is well-formed but
+ // invalid according to the CBOR spec. Reject invalid inputs. Encoders are
+ // responsible for ensuring that all text strings they produce contain valid UTF-8
+ // sequences and may use the byte string major type to encode strings that have not
+ // been validated.
+ UTF8: cbor.UTF8RejectInvalid,
+
+ // Never make a case-insensitive match between a map key and a struct field.
+ FieldNameMatching: cbor.FieldNameMatchingCaseSensitive,
+
+ // Produce string concrete values when decoding a CBOR byte string into interface{}.
+ DefaultByteStringType: reflect.TypeOf(""),
+
+ // Allow CBOR byte strings to be decoded into string destination values. If a byte
+ // string is enclosed in an "expected later encoding" tag
+ // (https://www.rfc-editor.org/rfc/rfc8949.html#section-3.4.5.2), then the text
+ // encoding indicated by that tag (e.g. base64) will be applied to the contents of
+ // the byte string.
+ ByteStringToString: cbor.ByteStringToStringAllowedWithExpectedLaterEncoding,
+
+ // Allow CBOR byte strings to match struct fields when appearing as a map key.
+ FieldNameByteString: cbor.FieldNameByteStringAllowed,
+
+ // When decoding an unrecognized tag to interface{}, return the decoded tag content
+ // instead of the default, a cbor.Tag representing a (number, content) pair.
+ UnrecognizedTagToAny: cbor.UnrecognizedTagContentToAny,
+
+ // Decode time tags to interface{} as strings containing RFC 3339 timestamps.
+ TimeTagToAny: cbor.TimeTagToRFC3339Nano,
+
+ // For parity with JSON, strings can be decoded into time.Time if they are RFC 3339
+ // timestamps.
+ ByteStringToTime: cbor.ByteStringToTimeAllowed,
+
+ // Reject NaN and infinite floating-point values since they don't have a JSON
+ // representation (RFC 8259 Section 6).
+ NaN: cbor.NaNDecodeForbidden,
+ Inf: cbor.InfDecodeForbidden,
+
+ // When unmarshaling a byte string into a []byte, assume that the byte string
+ // contains base64-encoded bytes, unless explicitly counterindicated by an "expected
+ // later encoding" tag. This is consistent with the because of unmarshaling a JSON
+ // text into a []byte.
+ ByteStringExpectedFormat: cbor.ByteStringExpectedBase64,
+
+ // Reject the arbitrary-precision integer tags because they can't be faithfully
+ // roundtripped through the allowable Unstructured types.
+ BignumTag: cbor.BignumTagForbidden,
+
+ // Reject anything other than the simple values true, false, and null.
+ SimpleValues: simpleValues,
+
+ // Disable default recognition of types implementing encoding.BinaryUnmarshaler,
+ // which is not recognized for JSON decoding.
+ BinaryUnmarshaler: cbor.BinaryUnmarshalerNone,
+ }.DecMode()
+ if err != nil {
+ panic(err)
+ }
+ return decode
+}()
+
+// DecodeLax is derived from Decode, but does not complain about unknown fields in the input.
+var DecodeLax cbor.DecMode = func() cbor.DecMode {
+ opts := Decode.DecOptions()
+ opts.ExtraReturnErrors &^= cbor.ExtraDecErrorUnknownField // clear bit
+ dm, err := opts.DecMode()
+ if err != nil {
+ panic(err)
+ }
+ return dm
+}()
diff --git a/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/diagnostic.go
similarity index 56%
rename from vendor/k8s.io/gengo/examples/set-gen/generators/tags.go
rename to vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/diagnostic.go
index 52e87677183..61f3f145f55 100644
--- a/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/diagnostic.go
@@ -1,5 +1,5 @@
/*
-Copyright 2016 The Kubernetes Authors.
+Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,20 +14,23 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package generators
+package modes
import (
- "k8s.io/gengo/types"
- "k8s.io/klog/v2"
+ "github.com/fxamacker/cbor/v2"
)
-// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if
-// it exists, the value is boolean. If the tag did not exist, it returns
-// false.
-func extractBoolTagOrDie(key string, lines []string) bool {
- val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines)
+var Diagnostic cbor.DiagMode = func() cbor.DiagMode {
+ opts := Decode.DecOptions()
+ diagnostic, err := cbor.DiagOptions{
+ ByteStringText: true,
+
+ MaxNestedLevels: opts.MaxNestedLevels,
+ MaxArrayElements: opts.MaxArrayElements,
+ MaxMapPairs: opts.MaxMapPairs,
+ }.DiagMode()
if err != nil {
- klog.Fatalf(err.Error())
+ panic(err)
}
- return val
-}
+ return diagnostic
+}()
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go
new file mode 100644
index 00000000000..c6693138444
--- /dev/null
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go
@@ -0,0 +1,155 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package modes
+
+import (
+ "io"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+var Encode = EncMode{
+ delegate: func() cbor.UserBufferEncMode {
+ encode, err := cbor.EncOptions{
+ // Map keys need to be sorted to have deterministic output, and this is the order
+ // defined in RFC 8949 4.2.1 "Core Deterministic Encoding Requirements".
+ Sort: cbor.SortBytewiseLexical,
+
+ // CBOR supports distinct types for IEEE-754 float16, float32, and float64. Store
+ // floats in the smallest width that preserves value so that equivalent float32 and
+ // float64 values encode to identical bytes, as they do in a JSON
+ // encoding. Satisfies one of the "Core Deterministic Encoding Requirements".
+ ShortestFloat: cbor.ShortestFloat16,
+
+ // Error on attempt to encode NaN and infinite values. This is what the JSON
+ // serializer does.
+ NaNConvert: cbor.NaNConvertReject,
+ InfConvert: cbor.InfConvertReject,
+
+ // Error on attempt to encode math/big.Int values, which can't be faithfully
+ // roundtripped through Unstructured in general (the dynamic numeric types allowed
+ // in Unstructured are limited to float64 and int64).
+ BigIntConvert: cbor.BigIntConvertReject,
+
+ // MarshalJSON for time.Time writes RFC3339 with nanos.
+ Time: cbor.TimeRFC3339Nano,
+
+ // The decoder must be able to accept RFC3339 strings with or without tag 0 (e.g. by
+ // the end of time.Time -> JSON -> Unstructured -> CBOR, the CBOR encoder has no
+ // reliable way of knowing that a particular string originated from serializing a
+ // time.Time), so producing tag 0 has little use.
+ TimeTag: cbor.EncTagNone,
+
+ // Indefinite-length items have multiple encodings and aren't being used anyway, so
+ // disable to avoid an opportunity for nondeterminism.
+ IndefLength: cbor.IndefLengthForbidden,
+
+ // Preserve distinction between nil and empty for slices and maps.
+ NilContainers: cbor.NilContainerAsNull,
+
+ // OK to produce tags.
+ TagsMd: cbor.TagsAllowed,
+
+ // Use the same definition of "empty" as encoding/json.
+ OmitEmpty: cbor.OmitEmptyGoValue,
+
+ // The CBOR types text string and byte string are structurally equivalent, with the
+ // semantic difference that a text string whose content is an invalid UTF-8 sequence
+ // is itself invalid. We reject all invalid text strings at decode time and do not
+ // validate or sanitize all Go strings at encode time. Encoding Go strings to the
+ // byte string type is comparable to the existing Protobuf behavior and cheaply
+ // ensures that the output is valid CBOR.
+ String: cbor.StringToByteString,
+
+ // Encode struct field names to the byte string type rather than the text string
+ // type.
+ FieldName: cbor.FieldNameToByteString,
+
+ // Marshal Go byte arrays to CBOR arrays of integers (as in JSON) instead of byte
+ // strings.
+ ByteArray: cbor.ByteArrayToArray,
+
+ // Marshal []byte to CBOR byte string enclosed in tag 22 (expected later base64
+ // encoding, https://www.rfc-editor.org/rfc/rfc8949.html#section-3.4.5.2), to
+ // interoperate with the existing JSON behavior. This indicates to the decoder that,
+ // when decoding into a string (or unstructured), the resulting value should be the
+ // base64 encoding of the original bytes. No base64 encoding or decoding needs to be
+ // performed for []byte-to-CBOR-to-[]byte roundtrips.
+ ByteSliceLaterFormat: cbor.ByteSliceLaterFormatBase64,
+
+ // Disable default recognition of types implementing encoding.BinaryMarshaler, which
+ // is not recognized for JSON encoding.
+ BinaryMarshaler: cbor.BinaryMarshalerNone,
+ }.UserBufferEncMode()
+ if err != nil {
+ panic(err)
+ }
+ return encode
+ }(),
+}
+
+var EncodeNondeterministic = EncMode{
+ delegate: func() cbor.UserBufferEncMode {
+ opts := Encode.options()
+ opts.Sort = cbor.SortNone // TODO: Use cbor.SortFastShuffle after bump to v2.7.0.
+ em, err := opts.UserBufferEncMode()
+ if err != nil {
+ panic(err)
+ }
+ return em
+ }(),
+}
+
+type EncMode struct {
+ delegate cbor.UserBufferEncMode
+}
+
+func (em EncMode) options() cbor.EncOptions {
+ return em.delegate.EncOptions()
+}
+
+func (em EncMode) MarshalTo(v interface{}, w io.Writer) error {
+ if buf, ok := w.(*buffer); ok {
+ return em.delegate.MarshalToBuffer(v, &buf.Buffer)
+ }
+
+ buf := buffers.Get()
+ defer buffers.Put(buf)
+ if err := em.delegate.MarshalToBuffer(v, &buf.Buffer); err != nil {
+ return err
+ }
+
+ if _, err := io.Copy(w, buf); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (em EncMode) Marshal(v interface{}) ([]byte, error) {
+ buf := buffers.Get()
+ defer buffers.Put(buf)
+
+ if err := em.MarshalTo(v, &buf.Buffer); err != nil {
+ return nil, err
+ }
+
+ clone := make([]byte, buf.Len())
+ copy(clone, buf.Bytes())
+
+ return clone, nil
+}
diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/types.go b/vendor/k8s.io/apimachinery/pkg/runtime/types.go
index ce77c7910a9..1680c149f95 100644
--- a/vendor/k8s.io/apimachinery/pkg/runtime/types.go
+++ b/vendor/k8s.io/apimachinery/pkg/runtime/types.go
@@ -46,6 +46,7 @@ const (
ContentTypeJSON string = "application/json"
ContentTypeYAML string = "application/yaml"
ContentTypeProtobuf string = "application/vnd.kubernetes.protobuf"
+ ContentTypeCBOR string = "application/cbor"
)
// RawExtension is used to hold extensions in external versions.
diff --git a/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go b/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go
index 9b3c9c8d5ac..1ab8fd396ed 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/framer/framer.go
@@ -147,7 +147,6 @@ func (r *jsonFrameReader) Read(data []byte) (int, error) {
// RawMessage#Unmarshal appends to data - we reset the slice down to 0 and will either see
// data written to data, or be larger than data and a different array.
- n := len(data)
m := json.RawMessage(data[:0])
if err := r.decoder.Decode(&m); err != nil {
return 0, err
@@ -156,12 +155,19 @@ func (r *jsonFrameReader) Read(data []byte) (int, error) {
// If capacity of data is less than length of the message, decoder will allocate a new slice
// and set m to it, which means we need to copy the partial result back into data and preserve
// the remaining result for subsequent reads.
- if len(m) > n {
- //nolint:staticcheck // SA4006,SA4010 underlying array of data is modified here.
- data = append(data[0:0], m[:n]...)
- r.remaining = m[n:]
- return n, io.ErrShortBuffer
+ if len(m) > cap(data) {
+ copy(data, m)
+ r.remaining = m[len(data):]
+ return len(data), io.ErrShortBuffer
}
+
+ if len(m) > len(data) {
+ // The bytes beyond len(data) were stored in data's underlying array, which we do
+ // not own after this function returns.
+ r.remaining = append([]byte(nil), m[len(data):]...)
+ return len(data), io.ErrShortBuffer
+ }
+
return len(m), nil
}
diff --git a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
index f358c794d10..5fd2e16c842 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
@@ -25,6 +25,7 @@ import (
"strconv"
"strings"
+ cbor "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
"k8s.io/klog/v2"
)
@@ -92,6 +93,20 @@ func (intstr *IntOrString) UnmarshalJSON(value []byte) error {
return json.Unmarshal(value, &intstr.IntVal)
}
+func (intstr *IntOrString) UnmarshalCBOR(value []byte) error {
+ if err := cbor.Unmarshal(value, &intstr.StrVal); err == nil {
+ intstr.Type = String
+ return nil
+ }
+
+ if err := cbor.Unmarshal(value, &intstr.IntVal); err != nil {
+ return err
+ }
+
+ intstr.Type = Int
+ return nil
+}
+
// String returns the string value, or the Itoa of the int value.
func (intstr *IntOrString) String() string {
if intstr == nil {
@@ -126,6 +141,17 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) {
}
}
+func (intstr IntOrString) MarshalCBOR() ([]byte, error) {
+ switch intstr.Type {
+ case Int:
+ return cbor.Marshal(intstr.IntVal)
+ case String:
+ return cbor.Marshal(intstr.StrVal)
+ default:
+ return nil, fmt.Errorf("impossible IntOrString.Type")
+ }
+}
+
// OpenAPISchemaType is used by the kube-openapi generator when constructing
// the OpenAPI spec of this type.
//
diff --git a/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go b/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go
index 3674914f701..4fe0c5eb250 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go
@@ -17,6 +17,7 @@ limitations under the License.
package runtime
import (
+ "context"
"fmt"
"net/http"
"runtime"
@@ -35,7 +36,7 @@ var (
)
// PanicHandlers is a list of functions which will be invoked when a panic happens.
-var PanicHandlers = []func(interface{}){logPanic}
+var PanicHandlers = []func(context.Context, interface{}){logPanic}
// HandleCrash simply catches a crash and logs an error. Meant to be called via
// defer. Additional context-specific handlers can be provided, and will be
@@ -43,23 +44,54 @@ var PanicHandlers = []func(interface{}){logPanic}
// handlers and logging the panic message.
//
// E.g., you can provide one or more additional handlers for something like shutting down go routines gracefully.
+//
+// TODO(pohly): logcheck:context // HandleCrashWithContext should be used instead of HandleCrash in code which supports contextual logging.
func HandleCrash(additionalHandlers ...func(interface{})) {
if r := recover(); r != nil {
- for _, fn := range PanicHandlers {
- fn(r)
- }
- for _, fn := range additionalHandlers {
- fn(r)
- }
- if ReallyCrash {
- // Actually proceed to panic.
- panic(r)
+ additionalHandlersWithContext := make([]func(context.Context, interface{}), len(additionalHandlers))
+ for i, handler := range additionalHandlers {
+ handler := handler // capture loop variable
+ additionalHandlersWithContext[i] = func(_ context.Context, r interface{}) {
+ handler(r)
+ }
}
+
+ handleCrash(context.Background(), r, additionalHandlersWithContext...)
+ }
+}
+
+// HandleCrashWithContext simply catches a crash and logs an error. Meant to be called via
+// defer. Additional context-specific handlers can be provided, and will be
+// called in case of panic. HandleCrash actually crashes, after calling the
+// handlers and logging the panic message.
+//
+// E.g., you can provide one or more additional handlers for something like shutting down go routines gracefully.
+//
+// The context is used to determine how to log.
+func HandleCrashWithContext(ctx context.Context, additionalHandlers ...func(context.Context, interface{})) {
+ if r := recover(); r != nil {
+ handleCrash(ctx, r, additionalHandlers...)
+ }
+}
+
+// handleCrash is the common implementation of HandleCrash and HandleCrash.
+// Having those call a common implementation ensures that the stack depth
+// is the same regardless through which path the handlers get invoked.
+func handleCrash(ctx context.Context, r any, additionalHandlers ...func(context.Context, interface{})) {
+ for _, fn := range PanicHandlers {
+ fn(ctx, r)
+ }
+ for _, fn := range additionalHandlers {
+ fn(ctx, r)
+ }
+ if ReallyCrash {
+ // Actually proceed to panic.
+ panic(r)
}
}
// logPanic logs the caller tree when a panic occurs (except in the special case of http.ErrAbortHandler).
-func logPanic(r interface{}) {
+func logPanic(ctx context.Context, r interface{}) {
if r == http.ErrAbortHandler {
// honor the http.ErrAbortHandler sentinel panic value:
// ErrAbortHandler is a sentinel panic value to abort a handler.
@@ -73,10 +105,20 @@ func logPanic(r interface{}) {
const size = 64 << 10
stacktrace := make([]byte, size)
stacktrace = stacktrace[:runtime.Stack(stacktrace, false)]
+
+ // We don't really know how many call frames to skip because the Go
+ // panic handler is between us and the code where the panic occurred.
+ // If it's one function (as in Go 1.21), then skipping four levels
+ // gets us to the function which called the `defer HandleCrashWithontext(...)`.
+ logger := klog.FromContext(ctx).WithCallDepth(4)
+
+ // For backwards compatibility, conversion to string
+ // is handled here instead of defering to the logging
+ // backend.
if _, ok := r.(string); ok {
- klog.Errorf("Observed a panic: %s\n%s", r, stacktrace)
+ logger.Error(nil, "Observed a panic", "panic", r, "stacktrace", string(stacktrace))
} else {
- klog.Errorf("Observed a panic: %#v (%v)\n%s", r, r, stacktrace)
+ logger.Error(nil, "Observed a panic", "panic", fmt.Sprintf("%v", r), "panicGoValue", fmt.Sprintf("%#v", r), "stacktrace", string(stacktrace))
}
}
@@ -84,35 +126,76 @@ func logPanic(r interface{}) {
// error occurs.
// TODO(lavalamp): for testability, this and the below HandleError function
// should be packaged up into a testable and reusable object.
-var ErrorHandlers = []func(error){
+var ErrorHandlers = []ErrorHandler{
logError,
- (&rudimentaryErrorBackoff{
- lastErrorTime: time.Now(),
- // 1ms was the number folks were able to stomach as a global rate limit.
- // If you need to log errors more than 1000 times a second you
- // should probably consider fixing your code instead. :)
- minPeriod: time.Millisecond,
- }).OnError,
+ func(_ context.Context, _ error, _ string, _ ...interface{}) {
+ (&rudimentaryErrorBackoff{
+ lastErrorTime: time.Now(),
+ // 1ms was the number folks were able to stomach as a global rate limit.
+ // If you need to log errors more than 1000 times a second you
+ // should probably consider fixing your code instead. :)
+ minPeriod: time.Millisecond,
+ }).OnError()
+ },
}
+type ErrorHandler func(ctx context.Context, err error, msg string, keysAndValues ...interface{})
+
// HandlerError is a method to invoke when a non-user facing piece of code cannot
// return an error and needs to indicate it has been ignored. Invoking this method
// is preferable to logging the error - the default behavior is to log but the
// errors may be sent to a remote server for analysis.
+//
+// TODO(pohly): logcheck:context // HandleErrorWithContext should be used instead of HandleError in code which supports contextual logging.
func HandleError(err error) {
// this is sometimes called with a nil error. We probably shouldn't fail and should do nothing instead
if err == nil {
return
}
+ handleError(context.Background(), err, "Unhandled Error")
+}
+
+// HandlerErrorWithContext is a method to invoke when a non-user facing piece of code cannot
+// return an error and needs to indicate it has been ignored. Invoking this method
+// is preferable to logging the error - the default behavior is to log but the
+// errors may be sent to a remote server for analysis. The context is used to
+// determine how to log the error.
+//
+// If contextual logging is enabled, the default log output is equivalent to
+//
+// logr.FromContext(ctx).WithName("UnhandledError").Error(err, msg, keysAndValues...)
+//
+// Without contextual logging, it is equivalent to:
+//
+// klog.ErrorS(err, msg, keysAndValues...)
+//
+// In contrast to HandleError, passing nil for the error is still going to
+// trigger a log entry. Don't construct a new error or wrap an error
+// with fmt.Errorf. Instead, add additional information via the mssage
+// and key/value pairs.
+//
+// This variant should be used instead of HandleError because it supports
+// structured, contextual logging.
+func HandleErrorWithContext(ctx context.Context, err error, msg string, keysAndValues ...interface{}) {
+ handleError(ctx, err, msg, keysAndValues...)
+}
+
+// handleError is the common implementation of HandleError and HandleErrorWithContext.
+// Using this common implementation ensures that the stack depth
+// is the same regardless through which path the handlers get invoked.
+func handleError(ctx context.Context, err error, msg string, keysAndValues ...interface{}) {
for _, fn := range ErrorHandlers {
- fn(err)
+ fn(ctx, err, msg, keysAndValues...)
}
}
-// logError prints an error with the call stack of the location it was reported
-func logError(err error) {
- klog.ErrorDepth(2, err)
+// logError prints an error with the call stack of the location it was reported.
+// It expects to be called as -> HandleError[WithContext] -> handleError -> logError.
+func logError(ctx context.Context, err error, msg string, keysAndValues ...interface{}) {
+ logger := klog.FromContext(ctx).WithCallDepth(3)
+ logger = klog.LoggerWithName(logger, "UnhandledError")
+ logger.Error(err, msg, keysAndValues...) //nolint:logcheck // logcheck complains about unknown key/value pairs.
}
type rudimentaryErrorBackoff struct {
@@ -125,7 +208,7 @@ type rudimentaryErrorBackoff struct {
// OnError will block if it is called more often than the embedded period time.
// This will prevent overly tight hot error loops.
-func (r *rudimentaryErrorBackoff) OnError(error) {
+func (r *rudimentaryErrorBackoff) OnError() {
now := time.Now() // start the timer before acquiring the lock
r.lastErrorTimeLock.Lock()
d := now.Sub(r.lastErrorTime)
diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/set.go b/vendor/k8s.io/apimachinery/pkg/util/sets/set.go
index b76129a1ca2..cd961c8c593 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/sets/set.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/sets/set.go
@@ -68,14 +68,8 @@ func (s Set[T]) Delete(items ...T) Set[T] {
// Clear empties the set.
// It is preferable to replace the set with a newly constructed set,
// but not all callers can do that (when there are other references to the map).
-// In some cases the set *won't* be fully cleared, e.g. a Set[float32] containing NaN
-// can't be cleared because NaN can't be removed.
-// For sets containing items of a type that is reflexive for ==,
-// this is optimized to a single call to runtime.mapclear().
func (s Set[T]) Clear() Set[T] {
- for key := range s {
- delete(s, key)
- }
+ clear(s)
return s
}
diff --git a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go
index 920c113bbd7..6825a808e67 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go
@@ -1361,6 +1361,10 @@ func mergeMap(original, patch map[string]interface{}, schema LookupPatchMeta, me
// original. Otherwise, check if we want to preserve it or skip it.
// Preserving the null value is useful when we want to send an explicit
// delete to the API server.
+ // In some cases, this may lead to inconsistent behavior with create.
+ // ref: https://github.com/kubernetes/kubernetes/issues/123304
+ // To avoid breaking compatibility,
+ // we made corresponding changes on the client side to ensure that the create and patch behaviors are idempotent.
if patchV == nil {
delete(original, k)
if mergeOptions.IgnoreUnmatchedNulls {
diff --git a/vendor/k8s.io/apimachinery/pkg/util/version/version.go b/vendor/k8s.io/apimachinery/pkg/util/version/version.go
index 2292ba13765..b7812ff2d15 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/version/version.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/version/version.go
@@ -23,6 +23,8 @@ import (
"regexp"
"strconv"
"strings"
+
+ apimachineryversion "k8s.io/apimachinery/pkg/version"
)
// Version is an opaque representation of a version number
@@ -31,6 +33,7 @@ type Version struct {
semver bool
preRelease string
buildMetadata string
+ info apimachineryversion.Info
}
var (
@@ -145,6 +148,43 @@ func MustParseGeneric(str string) *Version {
return v
}
+// Parse tries to do ParseSemantic first to keep more information.
+// If ParseSemantic fails, it would just do ParseGeneric.
+func Parse(str string) (*Version, error) {
+ v, err := parse(str, true)
+ if err != nil {
+ return parse(str, false)
+ }
+ return v, err
+}
+
+// MustParse is like Parse except that it panics on error
+func MustParse(str string) *Version {
+ v, err := Parse(str)
+ if err != nil {
+ panic(err)
+ }
+ return v
+}
+
+// ParseMajorMinor parses a "generic" version string and returns a version with the major and minor version.
+func ParseMajorMinor(str string) (*Version, error) {
+ v, err := ParseGeneric(str)
+ if err != nil {
+ return nil, err
+ }
+ return MajorMinor(v.Major(), v.Minor()), nil
+}
+
+// MustParseMajorMinor is like ParseMajorMinor except that it panics on error
+func MustParseMajorMinor(str string) *Version {
+ v, err := ParseMajorMinor(str)
+ if err != nil {
+ panic(err)
+ }
+ return v
+}
+
// ParseSemantic parses a version string that exactly obeys the syntax and semantics of
// the "Semantic Versioning" specification (http://semver.org/) (although it ignores
// leading and trailing whitespace, and allows the version to be preceded by "v"). For
@@ -215,6 +255,32 @@ func (v *Version) WithMinor(minor uint) *Version {
return &result
}
+// SubtractMinor returns the version with offset from the original minor, with the same major and no patch.
+// If -offset >= current minor, the minor would be 0.
+func (v *Version) OffsetMinor(offset int) *Version {
+ var minor uint
+ if offset >= 0 {
+ minor = v.Minor() + uint(offset)
+ } else {
+ diff := uint(-offset)
+ if diff < v.Minor() {
+ minor = v.Minor() - diff
+ }
+ }
+ return MajorMinor(v.Major(), minor)
+}
+
+// SubtractMinor returns the version diff minor versions back, with the same major and no patch.
+// If diff >= current minor, the minor would be 0.
+func (v *Version) SubtractMinor(diff uint) *Version {
+ return v.OffsetMinor(-int(diff))
+}
+
+// AddMinor returns the version diff minor versions forward, with the same major and no patch.
+func (v *Version) AddMinor(diff uint) *Version {
+ return v.OffsetMinor(int(diff))
+}
+
// WithPatch returns copy of the version object with requested patch number
func (v *Version) WithPatch(patch uint) *Version {
result := *v
@@ -224,6 +290,9 @@ func (v *Version) WithPatch(patch uint) *Version {
// WithPreRelease returns copy of the version object with requested prerelease
func (v *Version) WithPreRelease(preRelease string) *Version {
+ if len(preRelease) == 0 {
+ return v
+ }
result := *v
result.components = []uint{v.Major(), v.Minor(), v.Patch()}
result.preRelease = preRelease
@@ -345,6 +414,17 @@ func onlyZeros(array []uint) bool {
return true
}
+// EqualTo tests if a version is equal to a given version.
+func (v *Version) EqualTo(other *Version) bool {
+ if v == nil {
+ return other == nil
+ }
+ if other == nil {
+ return false
+ }
+ return v.compareInternal(other) == 0
+}
+
// AtLeast tests if a version is at least equal to a given minimum version. If both
// Versions are Semantic Versions, this will use the Semantic Version comparison
// algorithm. Otherwise, it will compare only the numeric components, with non-present
@@ -360,6 +440,11 @@ func (v *Version) LessThan(other *Version) bool {
return v.compareInternal(other) == -1
}
+// GreaterThan tests if a version is greater than a given version.
+func (v *Version) GreaterThan(other *Version) bool {
+ return v.compareInternal(other) == 1
+}
+
// Compare compares v against a version string (which will be parsed as either Semantic
// or non-Semantic depending on v). On success it returns -1 if v is less than other, 1 if
// it is greater than other, or 0 if they are equal.
@@ -370,3 +455,30 @@ func (v *Version) Compare(other string) (int, error) {
}
return v.compareInternal(ov), nil
}
+
+// WithInfo returns copy of the version object with requested info
+func (v *Version) WithInfo(info apimachineryversion.Info) *Version {
+ result := *v
+ result.info = info
+ return &result
+}
+
+func (v *Version) Info() *apimachineryversion.Info {
+ if v == nil {
+ return nil
+ }
+ // in case info is empty, or the major and minor in info is different from the actual major and minor
+ v.info.Major = itoa(v.Major())
+ v.info.Minor = itoa(v.Minor())
+ if v.info.GitVersion == "" {
+ v.info.GitVersion = v.String()
+ }
+ return &v.info
+}
+
+func itoa(i uint) string {
+ if i == 0 {
+ return ""
+ }
+ return strconv.Itoa(int(i))
+}
diff --git a/vendor/k8s.io/apimachinery/pkg/watch/watch.go b/vendor/k8s.io/apimachinery/pkg/watch/watch.go
index b6c7bbfa8fa..ce37fd8c183 100644
--- a/vendor/k8s.io/apimachinery/pkg/watch/watch.go
+++ b/vendor/k8s.io/apimachinery/pkg/watch/watch.go
@@ -27,13 +27,25 @@ import (
// Interface can be implemented by anything that knows how to watch and report changes.
type Interface interface {
- // Stop stops watching. Will close the channel returned by ResultChan(). Releases
- // any resources used by the watch.
+ // Stop tells the producer that the consumer is done watching, so the
+ // producer should stop sending events and close the result channel. The
+ // consumer should keep watching for events until the result channel is
+ // closed.
+ //
+ // Because some implementations may create channels when constructed, Stop
+ // must always be called, even if the consumer has not yet called
+ // ResultChan().
+ //
+ // Only the consumer should call Stop(), not the producer. If the producer
+ // errors and needs to stop the watch prematurely, it should instead send
+ // an error event and close the result channel.
Stop()
- // ResultChan returns a chan which will receive all the events. If an error occurs
- // or Stop() is called, the implementation will close this channel and
- // release any resources used by the watch.
+ // ResultChan returns a channel which will receive events from the event
+ // producer. If an error occurs or Stop() is called, the producer must
+ // close this channel and release any resources used by the watch.
+ // Closing the result channel tells the consumer that no more events will be
+ // sent.
ResultChan() <-chan Event
}
@@ -322,3 +334,21 @@ func (pw *ProxyWatcher) ResultChan() <-chan Event {
func (pw *ProxyWatcher) StopChan() <-chan struct{} {
return pw.stopCh
}
+
+// MockWatcher implements watch.Interface with mockable functions.
+type MockWatcher struct {
+ StopFunc func()
+ ResultChanFunc func() <-chan Event
+}
+
+var _ Interface = &MockWatcher{}
+
+// Stop calls StopFunc
+func (mw MockWatcher) Stop() {
+ mw.StopFunc()
+}
+
+// ResultChan calls ResultChanFunc
+func (mw MockWatcher) ResultChan() <-chan Event {
+ return mw.ResultChanFunc()
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/initializer/initializer.go b/vendor/k8s.io/apiserver/pkg/admission/initializer/initializer.go
index 2d293d79ac6..21ee8c80121 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/initializer/initializer.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/initializer/initializer.go
@@ -17,6 +17,7 @@ limitations under the License.
package initializer
import (
+ "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/authorization/authorizer"
"k8s.io/client-go/dynamic"
@@ -32,6 +33,7 @@ type pluginInitializer struct {
authorizer authorizer.Authorizer
featureGates featuregate.FeatureGate
stopCh <-chan struct{}
+ restMapper meta.RESTMapper
}
// New creates an instance of admission plugins initializer.
@@ -44,6 +46,7 @@ func New(
authz authorizer.Authorizer,
featureGates featuregate.FeatureGate,
stopCh <-chan struct{},
+ restMapper meta.RESTMapper,
) pluginInitializer {
return pluginInitializer{
externalClient: extClientset,
@@ -52,6 +55,7 @@ func New(
authorizer: authz,
featureGates: featureGates,
stopCh: stopCh,
+ restMapper: restMapper,
}
}
@@ -83,6 +87,9 @@ func (i pluginInitializer) Initialize(plugin admission.Interface) {
if wants, ok := plugin.(WantsAuthorizer); ok {
wants.SetAuthorizer(i.authorizer)
}
+ if wants, ok := plugin.(WantsRESTMapper); ok {
+ wants.SetRESTMapper(i.restMapper)
+ }
}
var _ admission.PluginInitializer = pluginInitializer{}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/initializer/interfaces.go b/vendor/k8s.io/apiserver/pkg/admission/initializer/interfaces.go
index 6077c89de84..21202bd7920 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/initializer/interfaces.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/initializer/interfaces.go
@@ -18,6 +18,7 @@ package initializer
import (
"k8s.io/apimachinery/pkg/api/meta"
+ "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/authorization/authorizer"
"k8s.io/apiserver/pkg/cel/openapi/resolver"
@@ -89,3 +90,10 @@ type WantsSchemaResolver interface {
SetSchemaResolver(resolver resolver.SchemaResolver)
admission.InitializationValidator
}
+
+// WantsExcludedAdmissionResources defines a function which sets the ExcludedAdmissionResources
+// for an admission plugin that needs it.
+type WantsExcludedAdmissionResources interface {
+ SetExcludedAdmissionResources(excludedAdmissionResources []schema.GroupResource)
+ admission.InitializationValidator
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go
index b7b589d273a..06035f6b9e9 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go
@@ -163,11 +163,12 @@ type variableDeclEnvs map[OptionalVariableDeclarations]*environment.EnvSet
// CompileCELExpression returns a compiled CEL expression.
// perCallLimit was added for testing purpose only. Callers should always use const PerCallLimit from k8s.io/apiserver/pkg/apis/cel/config.go as input.
func (c compiler) CompileCELExpression(expressionAccessor ExpressionAccessor, options OptionalVariableDeclarations, envType environment.Type) CompilationResult {
- resultError := func(errorString string, errType apiservercel.ErrorType) CompilationResult {
+ resultError := func(errorString string, errType apiservercel.ErrorType, cause error) CompilationResult {
return CompilationResult{
Error: &apiservercel.Error{
Type: errType,
Detail: errorString,
+ Cause: cause,
},
ExpressionAccessor: expressionAccessor,
}
@@ -175,12 +176,12 @@ func (c compiler) CompileCELExpression(expressionAccessor ExpressionAccessor, op
env, err := c.varEnvs[options].Env(envType)
if err != nil {
- return resultError(fmt.Sprintf("unexpected error loading CEL environment: %v", err), apiservercel.ErrorTypeInternal)
+ return resultError(fmt.Sprintf("unexpected error loading CEL environment: %v", err), apiservercel.ErrorTypeInternal, nil)
}
ast, issues := env.Compile(expressionAccessor.GetExpression())
if issues != nil {
- return resultError("compilation failed: "+issues.String(), apiservercel.ErrorTypeInvalid)
+ return resultError("compilation failed: "+issues.String(), apiservercel.ErrorTypeInvalid, apiservercel.NewCompilationError(issues))
}
found := false
returnTypes := expressionAccessor.ReturnTypes()
@@ -198,19 +199,19 @@ func (c compiler) CompileCELExpression(expressionAccessor ExpressionAccessor, op
reason = fmt.Sprintf("must evaluate to one of %v", returnTypes)
}
- return resultError(reason, apiservercel.ErrorTypeInvalid)
+ return resultError(reason, apiservercel.ErrorTypeInvalid, nil)
}
_, err = cel.AstToCheckedExpr(ast)
if err != nil {
// should be impossible since env.Compile returned no issues
- return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal)
+ return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal, nil)
}
prog, err := env.Program(ast,
cel.InterruptCheckFrequency(celconfig.CheckFrequency),
)
if err != nil {
- return resultError("program instantiation failed: "+err.Error(), apiservercel.ErrorTypeInternal)
+ return resultError("program instantiation failed: "+err.Error(), apiservercel.ErrorTypeInternal, nil)
}
return CompilationResult{
Program: prog,
@@ -222,40 +223,48 @@ func (c compiler) CompileCELExpression(expressionAccessor ExpressionAccessor, op
func mustBuildEnvs(baseEnv *environment.EnvSet) variableDeclEnvs {
requestType := BuildRequestType()
namespaceType := BuildNamespaceType()
- envs := make(variableDeclEnvs, 4) // since the number of variable combinations is small, pre-build a environment for each
+ envs := make(variableDeclEnvs, 8) // since the number of variable combinations is small, pre-build a environment for each
for _, hasParams := range []bool{false, true} {
for _, hasAuthorizer := range []bool{false, true} {
- var envOpts []cel.EnvOption
- if hasParams {
- envOpts = append(envOpts, cel.Variable(ParamsVarName, cel.DynType))
- }
- if hasAuthorizer {
+ for _, strictCost := range []bool{false, true} {
+ var envOpts []cel.EnvOption
+ if hasParams {
+ envOpts = append(envOpts, cel.Variable(ParamsVarName, cel.DynType))
+ }
+ if hasAuthorizer {
+ envOpts = append(envOpts,
+ cel.Variable(AuthorizerVarName, library.AuthorizerType),
+ cel.Variable(RequestResourceAuthorizerVarName, library.ResourceCheckType))
+ }
envOpts = append(envOpts,
- cel.Variable(AuthorizerVarName, library.AuthorizerType),
- cel.Variable(RequestResourceAuthorizerVarName, library.ResourceCheckType))
- }
- envOpts = append(envOpts,
- cel.Variable(ObjectVarName, cel.DynType),
- cel.Variable(OldObjectVarName, cel.DynType),
- cel.Variable(NamespaceVarName, namespaceType.CelType()),
- cel.Variable(RequestVarName, requestType.CelType()))
+ cel.Variable(ObjectVarName, cel.DynType),
+ cel.Variable(OldObjectVarName, cel.DynType),
+ cel.Variable(NamespaceVarName, namespaceType.CelType()),
+ cel.Variable(RequestVarName, requestType.CelType()))
- extended, err := baseEnv.Extend(
- environment.VersionedOptions{
- // Feature epoch was actually 1.26, but we artificially set it to 1.0 because these
- // options should always be present.
- IntroducedVersion: version.MajorMinor(1, 0),
- EnvOptions: envOpts,
- DeclTypes: []*apiservercel.DeclType{
- namespaceType,
- requestType,
+ extended, err := baseEnv.Extend(
+ environment.VersionedOptions{
+ // Feature epoch was actually 1.26, but we artificially set it to 1.0 because these
+ // options should always be present.
+ IntroducedVersion: version.MajorMinor(1, 0),
+ EnvOptions: envOpts,
+ DeclTypes: []*apiservercel.DeclType{
+ namespaceType,
+ requestType,
+ },
},
- },
- )
- if err != nil {
- panic(fmt.Sprintf("environment misconfigured: %v", err))
+ )
+ if err != nil {
+ panic(fmt.Sprintf("environment misconfigured: %v", err))
+ }
+ if strictCost {
+ extended, err = extended.Extend(environment.StrictCostOpt)
+ if err != nil {
+ panic(fmt.Sprintf("environment misconfigured: %v", err))
+ }
+ }
+ envs[OptionalVariableDeclarations{HasParams: hasParams, HasAuthorizer: hasAuthorizer, StrictCost: strictCost}] = extended
}
- envs[OptionalVariableDeclarations{HasParams: hasParams, HasAuthorizer: hasAuthorizer}] = extended
}
}
return envs
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go
index 2dbfa099164..9c449ecda2f 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go
@@ -54,13 +54,22 @@ func NewCompositedCompiler(envSet *environment.EnvSet) (*CompositedCompiler, err
if err != nil {
return nil, err
}
- compiler := NewCompiler(compositionContext.EnvSet)
- filterCompiler := NewFilterCompiler(compositionContext.EnvSet)
+ return NewCompositedCompilerFromTemplate(compositionContext), nil
+}
+
+func NewCompositedCompilerFromTemplate(context *CompositionEnv) *CompositedCompiler {
+ context = &CompositionEnv{
+ MapType: context.MapType,
+ EnvSet: context.EnvSet,
+ CompiledVariables: map[string]CompilationResult{},
+ }
+ compiler := NewCompiler(context.EnvSet)
+ filterCompiler := NewFilterCompiler(context.EnvSet)
return &CompositedCompiler{
Compiler: compiler,
FilterCompiler: filterCompiler,
- CompositionEnv: compositionContext,
- }, nil
+ CompositionEnv: context,
+ }
}
func (c *CompositedCompiler) CompileAndStoreVariables(variables []NamedExpressionAccessor, options OptionalVariableDeclarations, mode environment.Type) {
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/filter.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/filter.go
index 3e2a63e75ca..216a474d23e 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/filter.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/filter.go
@@ -192,6 +192,7 @@ func (f *filter) ForInput(ctx context.Context, versionedAttr *admission.Versione
evaluation.Error = &cel.Error{
Type: cel.ErrorTypeInvalid,
Detail: fmt.Sprintf("compilation error: %v", compilationResult.Error),
+ Cause: compilationResult.Error,
}
continue
}
@@ -211,6 +212,7 @@ func (f *filter) ForInput(ctx context.Context, versionedAttr *admission.Versione
return nil, -1, &cel.Error{
Type: cel.ErrorTypeInvalid,
Detail: fmt.Sprintf("validation failed due to running out of cost budget, no further validation rules will be run"),
+ Cause: cel.ErrOutOfBudget,
}
}
remainingBudget -= compositionCost
@@ -228,12 +230,14 @@ func (f *filter) ForInput(ctx context.Context, versionedAttr *admission.Versione
return nil, -1, &cel.Error{
Type: cel.ErrorTypeInvalid,
Detail: fmt.Sprintf("runtime cost could not be calculated for expression: %v, no further expression will be run", compilationResult.ExpressionAccessor.GetExpression()),
+ Cause: cel.ErrOutOfBudget,
}
} else {
if *rtCost > math.MaxInt64 || int64(*rtCost) > remainingBudget {
return nil, -1, &cel.Error{
Type: cel.ErrorTypeInvalid,
Detail: fmt.Sprintf("validation failed due to running out of cost budget, no further validation rules will be run"),
+ Cause: cel.ErrOutOfBudget,
}
}
remainingBudget -= int64(*rtCost)
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/interface.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/interface.go
index c9f4e63369f..ae61dc826c4 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/interface.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/interface.go
@@ -57,10 +57,12 @@ type OptionalVariableDeclarations struct {
// HasParams specifies if the "params" variable is declared.
// The "params" variable may still be bound to "null" when declared.
HasParams bool
- // HasAuthorizer specifies if the"authorizer" and "authorizer.requestResource"
+ // HasAuthorizer specifies if the "authorizer" and "authorizer.requestResource"
// variables are declared. When declared, the authorizer variables are
// expected to be non-null.
HasAuthorizer bool
+ // StrictCost specifies if the CEL cost limitation is strict for extended libraries as well as native libraries.
+ StrictCost bool
}
// FilterCompiler contains a function to assist with converting types and values to/from CEL-typed values.
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/accessor.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/accessor.go
new file mode 100644
index 00000000000..85b18612f87
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/accessor.go
@@ -0,0 +1,42 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generic
+
+import (
+ "k8s.io/api/admissionregistration/v1"
+ "k8s.io/apimachinery/pkg/types"
+)
+
+type PolicyAccessor interface {
+ GetName() string
+ GetNamespace() string
+ GetParamKind() *v1.ParamKind
+ GetMatchConstraints() *v1.MatchResources
+}
+
+type BindingAccessor interface {
+ GetName() string
+ GetNamespace() string
+
+ // GetPolicyName returns the name of the (Validating/Mutating)AdmissionPolicy,
+ // which is cluster-scoped, so namespace is usually left blank.
+ // But we leave the door open to add a namespaced vesion in the future
+ GetPolicyName() types.NamespacedName
+ GetParamRef() *v1.ParamRef
+
+ GetMatchResources() *v1.MatchResources
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/interfaces.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/interfaces.go
new file mode 100644
index 00000000000..d4dbfb0aa52
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/interfaces.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generic
+
+import (
+ "context"
+
+ "k8s.io/apiserver/pkg/admission"
+)
+
+// Hook represents a dynamic admission hook. The hook may be a webhook or a
+// policy. For webhook, the Hook may describe how to contact the endpoint, expected
+// cert, etc. For policies, the hook may describe a compiled policy-binding pair.
+type Hook interface {
+ // All hooks are expected to contain zero or more match conditions, object
+ // selectors, namespace selectors to help the dispatcher decide when to apply
+ // the hook.
+ //
+ // Methods of matching logic is applied are specific to the hook and left up
+ // to the implementation.
+}
+
+// Source can list dynamic admission plugins.
+type Source[H Hook] interface {
+ // Hooks returns the list of currently known admission hooks.
+ Hooks() []H
+
+ // Run the source. This method should be called only once at startup.
+ Run(ctx context.Context) error
+
+ // HasSynced returns true if the source has completed its initial sync.
+ HasSynced() bool
+}
+
+// Dispatcher dispatches evaluates an admission request against the currently
+// active hooks returned by the source.
+type Dispatcher[H Hook] interface {
+ // Dispatch a request to the policies. Dispatcher may choose not to
+ // call a hook, either because the rules of the hook does not match, or
+ // the namespaceSelector or the objectSelector of the hook does not
+ // match. A non-nil error means the request is rejected.
+ Dispatch(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces, hooks []H) error
+}
+
+// An evaluator represents a compiled CEL expression that can be evaluated a
+// given a set of inputs used by the generic PolicyHook for Mutating and
+// ValidatingAdmissionPolicy.
+// Mutating and Validating may have different forms of evaluators
+type Evaluator interface {
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/plugin.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/plugin.go
new file mode 100644
index 00000000000..ed1c621bc8e
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/plugin.go
@@ -0,0 +1,215 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generic
+
+import (
+ "context"
+ "errors"
+ "fmt"
+
+ admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
+ "k8s.io/apimachinery/pkg/api/meta"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/apiserver/pkg/admission"
+ "k8s.io/apiserver/pkg/admission/initializer"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/matching"
+ "k8s.io/apiserver/pkg/authorization/authorizer"
+ "k8s.io/client-go/dynamic"
+ "k8s.io/client-go/informers"
+ "k8s.io/client-go/kubernetes"
+)
+
+// H is the Hook type generated by the source and consumed by the dispatcher.
+type sourceFactory[H any] func(informers.SharedInformerFactory, kubernetes.Interface, dynamic.Interface, meta.RESTMapper) Source[H]
+type dispatcherFactory[H any] func(authorizer.Authorizer, *matching.Matcher) Dispatcher[H]
+
+// admissionResources is the list of resources related to CEL-based admission
+// features.
+var admissionResources = []schema.GroupResource{
+ {Group: admissionregistrationv1.GroupName, Resource: "validatingadmissionpolicies"},
+ {Group: admissionregistrationv1.GroupName, Resource: "validatingadmissionpolicybindings"},
+ {Group: admissionregistrationv1.GroupName, Resource: "mutatingadmissionpolicies"},
+ {Group: admissionregistrationv1.GroupName, Resource: "mutatingadmissionpolicybindings"},
+}
+
+// AdmissionPolicyManager is an abstract admission plugin with all the
+// infrastructure to define Admit or Validate on-top.
+type Plugin[H any] struct {
+ *admission.Handler
+
+ sourceFactory sourceFactory[H]
+ dispatcherFactory dispatcherFactory[H]
+
+ source Source[H]
+ dispatcher Dispatcher[H]
+ matcher *matching.Matcher
+
+ informerFactory informers.SharedInformerFactory
+ client kubernetes.Interface
+ restMapper meta.RESTMapper
+ dynamicClient dynamic.Interface
+ excludedResources sets.Set[schema.GroupResource]
+ stopCh <-chan struct{}
+ authorizer authorizer.Authorizer
+ enabled bool
+}
+
+var (
+ _ initializer.WantsExternalKubeInformerFactory = &Plugin[any]{}
+ _ initializer.WantsExternalKubeClientSet = &Plugin[any]{}
+ _ initializer.WantsRESTMapper = &Plugin[any]{}
+ _ initializer.WantsDynamicClient = &Plugin[any]{}
+ _ initializer.WantsDrainedNotification = &Plugin[any]{}
+ _ initializer.WantsAuthorizer = &Plugin[any]{}
+ _ initializer.WantsExcludedAdmissionResources = &Plugin[any]{}
+ _ admission.InitializationValidator = &Plugin[any]{}
+)
+
+func NewPlugin[H any](
+ handler *admission.Handler,
+ sourceFactory sourceFactory[H],
+ dispatcherFactory dispatcherFactory[H],
+) *Plugin[H] {
+ return &Plugin[H]{
+ Handler: handler,
+ sourceFactory: sourceFactory,
+ dispatcherFactory: dispatcherFactory,
+
+ // always exclude admission/mutating policies and bindings
+ excludedResources: sets.New(admissionResources...),
+ }
+}
+
+func (c *Plugin[H]) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) {
+ c.informerFactory = f
+}
+
+func (c *Plugin[H]) SetExternalKubeClientSet(client kubernetes.Interface) {
+ c.client = client
+}
+
+func (c *Plugin[H]) SetRESTMapper(mapper meta.RESTMapper) {
+ c.restMapper = mapper
+}
+
+func (c *Plugin[H]) SetDynamicClient(client dynamic.Interface) {
+ c.dynamicClient = client
+}
+
+func (c *Plugin[H]) SetDrainedNotification(stopCh <-chan struct{}) {
+ c.stopCh = stopCh
+}
+
+func (c *Plugin[H]) SetAuthorizer(authorizer authorizer.Authorizer) {
+ c.authorizer = authorizer
+}
+
+func (c *Plugin[H]) SetMatcher(matcher *matching.Matcher) {
+ c.matcher = matcher
+}
+
+func (c *Plugin[H]) SetEnabled(enabled bool) {
+ c.enabled = enabled
+}
+
+func (c *Plugin[H]) SetExcludedAdmissionResources(excludedResources []schema.GroupResource) {
+ c.excludedResources.Insert(excludedResources...)
+}
+
+// ValidateInitialization - once clientset and informer factory are provided, creates and starts the admission controller
+func (c *Plugin[H]) ValidateInitialization() error {
+ // By default enabled is set to false. It is up to types which embed this
+ // struct to set it to true (if feature gate is enabled, or other conditions)
+ if !c.enabled {
+ return nil
+ }
+ if c.Handler == nil {
+ return errors.New("missing handler")
+ }
+ if c.informerFactory == nil {
+ return errors.New("missing informer factory")
+ }
+ if c.client == nil {
+ return errors.New("missing kubernetes client")
+ }
+ if c.restMapper == nil {
+ return errors.New("missing rest mapper")
+ }
+ if c.dynamicClient == nil {
+ return errors.New("missing dynamic client")
+ }
+ if c.stopCh == nil {
+ return errors.New("missing stop channel")
+ }
+ if c.authorizer == nil {
+ return errors.New("missing authorizer")
+ }
+
+ // Use default matcher
+ namespaceInformer := c.informerFactory.Core().V1().Namespaces()
+ c.matcher = matching.NewMatcher(namespaceInformer.Lister(), c.client)
+
+ if err := c.matcher.ValidateInitialization(); err != nil {
+ return err
+ }
+
+ c.source = c.sourceFactory(c.informerFactory, c.client, c.dynamicClient, c.restMapper)
+ c.dispatcher = c.dispatcherFactory(c.authorizer, c.matcher)
+
+ pluginContext, pluginContextCancel := context.WithCancel(context.Background())
+ go func() {
+ defer pluginContextCancel()
+ <-c.stopCh
+ }()
+
+ go func() {
+ err := c.source.Run(pluginContext)
+ if err != nil && !errors.Is(err, context.Canceled) {
+ utilruntime.HandleError(fmt.Errorf("policy source context unexpectedly closed: %v", err))
+ }
+ }()
+
+ c.SetReadyFunc(func() bool {
+ return namespaceInformer.Informer().HasSynced() && c.source.HasSynced()
+ })
+ return nil
+}
+
+func (c *Plugin[H]) Dispatch(
+ ctx context.Context,
+ a admission.Attributes,
+ o admission.ObjectInterfaces,
+) (err error) {
+ if !c.enabled {
+ return nil
+ } else if c.shouldIgnoreResource(a) {
+ return nil
+ } else if !c.WaitForReady() {
+ return admission.NewForbidden(a, fmt.Errorf("not yet ready to handle request"))
+ }
+
+ return c.dispatcher.Dispatch(ctx, a, o, c.source.Hooks())
+}
+
+func (c *Plugin[H]) shouldIgnoreResource(attr admission.Attributes) bool {
+ gvr := attr.GetResource()
+ // exclusion decision ignores the version.
+ gr := gvr.GroupResource()
+ return c.excludedResources.Has(gr)
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_dispatcher.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_dispatcher.go
new file mode 100644
index 00000000000..62ed7bc6c69
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_dispatcher.go
@@ -0,0 +1,354 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generic
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "time"
+
+ "k8s.io/api/admissionregistration/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apiserver/pkg/admission"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/matching"
+ webhookgeneric "k8s.io/apiserver/pkg/admission/plugin/webhook/generic"
+ "k8s.io/client-go/informers"
+ "k8s.io/client-go/tools/cache"
+)
+
+// A policy invocation is a single policy-binding-param tuple from a Policy Hook
+// in the context of a specific request. The params have already been resolved
+// and any error in configuration or setting up the invocation is stored in
+// the Error field.
+type PolicyInvocation[P runtime.Object, B runtime.Object, E Evaluator] struct {
+ // Relevant policy for this hook.
+ // This field is always populated
+ Policy P
+
+ // Matched Kind for the request given the policy's matchconstraints
+ // May be empty if there was an error matching the resource
+ Kind schema.GroupVersionKind
+
+ // Matched Resource for the request given the policy's matchconstraints
+ // May be empty if there was an error matching the resource
+ Resource schema.GroupVersionResource
+
+ // Relevant binding for this hook.
+ // May be empty if there was an error with the policy's configuration itself
+ Binding B
+
+ // Compiled policy evaluator
+ Evaluator E
+
+ // Params fetched by the binding to use to evaluate the policy
+ Param runtime.Object
+
+ // Error is set if there was an error with the policy or binding or its
+ // params, etc
+ Error error
+}
+
+// dispatcherDelegate is called during a request with a pre-filtered list
+// of (Policy, Binding, Param) tuples that are active and match the request.
+// The dispatcher delegate is responsible for updating the object on the
+// admission attributes in the case of mutation, or returning a status error in
+// the case of validation.
+//
+// The delegate provides the "validation" or "mutation" aspect of dispatcher functionality
+// (in contrast to generic.PolicyDispatcher which only selects active policies and params)
+type dispatcherDelegate[P, B runtime.Object, E Evaluator] func(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces, versionedAttributes webhookgeneric.VersionedAttributeAccessor, invocations []PolicyInvocation[P, B, E]) error
+
+type policyDispatcher[P runtime.Object, B runtime.Object, E Evaluator] struct {
+ newPolicyAccessor func(P) PolicyAccessor
+ newBindingAccessor func(B) BindingAccessor
+ matcher PolicyMatcher
+ delegate dispatcherDelegate[P, B, E]
+}
+
+func NewPolicyDispatcher[P runtime.Object, B runtime.Object, E Evaluator](
+ newPolicyAccessor func(P) PolicyAccessor,
+ newBindingAccessor func(B) BindingAccessor,
+ matcher *matching.Matcher,
+ delegate dispatcherDelegate[P, B, E],
+) Dispatcher[PolicyHook[P, B, E]] {
+ return &policyDispatcher[P, B, E]{
+ newPolicyAccessor: newPolicyAccessor,
+ newBindingAccessor: newBindingAccessor,
+ matcher: NewPolicyMatcher(matcher),
+ delegate: delegate,
+ }
+}
+
+// Dispatch implements generic.Dispatcher. It loops through all active hooks
+// (policy x binding pairs) and selects those which are active for the current
+// request. It then resolves all params and creates an Invocation for each
+// matching policy-binding-param tuple. The delegate is then called with the
+// list of tuples.
+//
+// Note: MatchConditions expressions are not evaluated here. The dispatcher delegate
+// is expected to ignore the result of any policies whose match conditions dont pass.
+// This may be possible to refactor so matchconditions are checked here instead.
+func (d *policyDispatcher[P, B, E]) Dispatch(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces, hooks []PolicyHook[P, B, E]) error {
+ var relevantHooks []PolicyInvocation[P, B, E]
+ // Construct all the versions we need to call our webhooks
+ versionedAttrAccessor := &versionedAttributeAccessor{
+ versionedAttrs: map[schema.GroupVersionKind]*admission.VersionedAttributes{},
+ attr: a,
+ objectInterfaces: o,
+ }
+
+ for _, hook := range hooks {
+ policyAccessor := d.newPolicyAccessor(hook.Policy)
+ matches, matchGVR, matchGVK, err := d.matcher.DefinitionMatches(a, o, policyAccessor)
+ if err != nil {
+ // There was an error evaluating if this policy matches anything.
+ utilruntime.HandleError(err)
+ relevantHooks = append(relevantHooks, PolicyInvocation[P, B, E]{
+ Policy: hook.Policy,
+ Error: err,
+ })
+ continue
+ } else if !matches {
+ continue
+ } else if hook.ConfigurationError != nil {
+ // The policy matches but there is a configuration error with the
+ // policy itself
+ relevantHooks = append(relevantHooks, PolicyInvocation[P, B, E]{
+ Policy: hook.Policy,
+ Error: hook.ConfigurationError,
+ Resource: matchGVR,
+ Kind: matchGVK,
+ })
+ utilruntime.HandleError(hook.ConfigurationError)
+ continue
+ }
+
+ for _, binding := range hook.Bindings {
+ bindingAccessor := d.newBindingAccessor(binding)
+ matches, err = d.matcher.BindingMatches(a, o, bindingAccessor)
+ if err != nil {
+ // There was an error evaluating if this binding matches anything.
+ utilruntime.HandleError(err)
+ relevantHooks = append(relevantHooks, PolicyInvocation[P, B, E]{
+ Policy: hook.Policy,
+ Binding: binding,
+ Error: err,
+ Resource: matchGVR,
+ Kind: matchGVK,
+ })
+ continue
+ } else if !matches {
+ continue
+ }
+
+ // Collect params for this binding
+ params, err := CollectParams(
+ policyAccessor.GetParamKind(),
+ hook.ParamInformer,
+ hook.ParamScope,
+ bindingAccessor.GetParamRef(),
+ a.GetNamespace(),
+ )
+ if err != nil {
+ // There was an error collecting params for this binding.
+ utilruntime.HandleError(err)
+ relevantHooks = append(relevantHooks, PolicyInvocation[P, B, E]{
+ Policy: hook.Policy,
+ Binding: binding,
+ Error: err,
+ Resource: matchGVR,
+ Kind: matchGVK,
+ })
+ continue
+ }
+
+ // If params is empty and there was no error, that means that
+ // ParamNotFoundAction is ignore, so it shouldnt be added to list
+ for _, param := range params {
+ relevantHooks = append(relevantHooks, PolicyInvocation[P, B, E]{
+ Policy: hook.Policy,
+ Binding: binding,
+ Kind: matchGVK,
+ Resource: matchGVR,
+ Param: param,
+ Evaluator: hook.Evaluator,
+ })
+ }
+
+ // VersionedAttr result will be cached and reused later during parallel
+ // hook calls
+ _, err = versionedAttrAccessor.VersionedAttribute(matchGVK)
+ if err != nil {
+ return apierrors.NewInternalError(err)
+ }
+ }
+
+ }
+
+ if len(relevantHooks) == 0 {
+ // no matching hooks
+ return nil
+ }
+
+ return d.delegate(ctx, a, o, versionedAttrAccessor, relevantHooks)
+}
+
+// Returns params to use to evaluate a policy-binding with given param
+// configuration. If the policy-binding has no param configuration, it
+// returns a single-element list with a nil param.
+func CollectParams(
+ paramKind *v1.ParamKind,
+ paramInformer informers.GenericInformer,
+ paramScope meta.RESTScope,
+ paramRef *v1.ParamRef,
+ namespace string,
+) ([]runtime.Object, error) {
+ // If definition has paramKind, paramRef is required in binding.
+ // If definition has no paramKind, paramRef set in binding will be ignored.
+ var params []runtime.Object
+ var paramStore cache.GenericNamespaceLister
+
+ // Make sure the param kind is ready to use
+ if paramKind != nil && paramRef != nil {
+ if paramInformer == nil {
+ return nil, fmt.Errorf("paramKind kind `%v` not known",
+ paramKind.String())
+ }
+
+ // Set up cluster-scoped, or namespaced access to the params
+ // "default" if not provided, and paramKind is namespaced
+ paramStore = paramInformer.Lister()
+ if paramScope.Name() == meta.RESTScopeNameNamespace {
+ paramsNamespace := namespace
+ if len(paramRef.Namespace) > 0 {
+ paramsNamespace = paramRef.Namespace
+ } else if len(paramsNamespace) == 0 {
+ // You must supply namespace if your matcher can possibly
+ // match a cluster-scoped resource
+ return nil, fmt.Errorf("cannot use namespaced paramRef in policy binding that matches cluster-scoped resources")
+ }
+
+ paramStore = paramInformer.Lister().ByNamespace(paramsNamespace)
+ }
+
+ // If the param informer for this admission policy has not yet
+ // had time to perform an initial listing, don't attempt to use
+ // it.
+ timeoutCtx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
+ defer cancel()
+
+ if !cache.WaitForCacheSync(timeoutCtx.Done(), paramInformer.Informer().HasSynced) {
+ return nil, fmt.Errorf("paramKind kind `%v` not yet synced to use for admission",
+ paramKind.String())
+ }
+ }
+
+ // Find params to use with policy
+ switch {
+ case paramKind == nil:
+ // ParamKind is unset. Ignore any globalParamRef or namespaceParamRef
+ // setting.
+ return []runtime.Object{nil}, nil
+ case paramRef == nil:
+ // Policy ParamKind is set, but binding does not use it.
+ // Validate with nil params
+ return []runtime.Object{nil}, nil
+ case len(paramRef.Namespace) > 0 && paramScope.Name() == meta.RESTScopeRoot.Name():
+ // Not allowed to set namespace for cluster-scoped param
+ return nil, fmt.Errorf("paramRef.namespace must not be provided for a cluster-scoped `paramKind`")
+
+ case len(paramRef.Name) > 0:
+ if paramRef.Selector != nil {
+ // This should be validated, but just in case.
+ return nil, fmt.Errorf("paramRef.name and paramRef.selector are mutually exclusive")
+ }
+
+ switch param, err := paramStore.Get(paramRef.Name); {
+ case err == nil:
+ params = []runtime.Object{param}
+ case apierrors.IsNotFound(err):
+ // Param not yet available. User may need to wait a bit
+ // before being able to use it for validation.
+ //
+ // Set params to nil to prepare for not found action
+ params = nil
+ case apierrors.IsInvalid(err):
+ // Param mis-configured
+ // require to set namespace for namespaced resource
+ // and unset namespace for cluster scoped resource
+ return nil, err
+ default:
+ // Internal error
+ utilruntime.HandleError(err)
+ return nil, err
+ }
+ case paramRef.Selector != nil:
+ // Select everything by default if empty name and selector
+ selector, err := metav1.LabelSelectorAsSelector(paramRef.Selector)
+ if err != nil {
+ // Cannot parse label selector: configuration error
+ return nil, err
+
+ }
+
+ paramList, err := paramStore.List(selector)
+ if err != nil {
+ // There was a bad internal error
+ utilruntime.HandleError(err)
+ return nil, err
+ }
+
+ // Successfully grabbed params
+ params = paramList
+ default:
+ // Should be unreachable due to validation
+ return nil, fmt.Errorf("one of name or selector must be provided")
+ }
+
+ // Apply fail action for params not found case
+ if len(params) == 0 && paramRef.ParameterNotFoundAction != nil && *paramRef.ParameterNotFoundAction == v1.DenyAction {
+ return nil, errors.New("no params found for policy binding with `Deny` parameterNotFoundAction")
+ }
+
+ return params, nil
+}
+
+var _ webhookgeneric.VersionedAttributeAccessor = &versionedAttributeAccessor{}
+
+type versionedAttributeAccessor struct {
+ versionedAttrs map[schema.GroupVersionKind]*admission.VersionedAttributes
+ attr admission.Attributes
+ objectInterfaces admission.ObjectInterfaces
+}
+
+func (v *versionedAttributeAccessor) VersionedAttribute(gvk schema.GroupVersionKind) (*admission.VersionedAttributes, error) {
+ if val, ok := v.versionedAttrs[gvk]; ok {
+ return val, nil
+ }
+ versionedAttr, err := admission.NewVersionedAttributes(v.attr, gvk, v.objectInterfaces)
+ if err != nil {
+ return nil, err
+ }
+ v.versionedAttrs[gvk] = versionedAttr
+ return versionedAttr, nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matcher.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_matcher.go
similarity index 55%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matcher.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_matcher.go
index 397f2c26714..d243b0710bc 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matcher.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_matcher.go
@@ -14,44 +14,42 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package generic
import (
- "k8s.io/api/admissionregistration/v1beta1"
+ "fmt"
+
+ admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/admission"
- "k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/matching"
)
-var _ matching.MatchCriteria = &matchCriteria{}
-
-type matchCriteria struct {
- constraints *v1beta1.MatchResources
-}
+// Matcher is used for matching ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding to attributes
+type PolicyMatcher interface {
+ admission.InitializationValidator
-// GetParsedNamespaceSelector returns the converted LabelSelector which implements labels.Selector
-func (m *matchCriteria) GetParsedNamespaceSelector() (labels.Selector, error) {
- return metav1.LabelSelectorAsSelector(m.constraints.NamespaceSelector)
-}
+ // DefinitionMatches says whether this policy definition matches the provided admission
+ // resource request
+ DefinitionMatches(a admission.Attributes, o admission.ObjectInterfaces, definition PolicyAccessor) (bool, schema.GroupVersionResource, schema.GroupVersionKind, error)
-// GetParsedObjectSelector returns the converted LabelSelector which implements labels.Selector
-func (m *matchCriteria) GetParsedObjectSelector() (labels.Selector, error) {
- return metav1.LabelSelectorAsSelector(m.constraints.ObjectSelector)
-}
+ // BindingMatches says whether this policy definition matches the provided admission
+ // resource request
+ BindingMatches(a admission.Attributes, o admission.ObjectInterfaces, binding BindingAccessor) (bool, error)
-// GetMatchResources returns the matchConstraints
-func (m *matchCriteria) GetMatchResources() v1beta1.MatchResources {
- return *m.constraints
+ // GetNamespace retrieves the Namespace resource by the given name. The name may be empty, in which case
+ // GetNamespace must return nil, nil
+ GetNamespace(name string) (*corev1.Namespace, error)
}
type matcher struct {
Matcher *matching.Matcher
}
-func NewMatcher(m *matching.Matcher) Matcher {
+func NewPolicyMatcher(m *matching.Matcher) PolicyMatcher {
return &matcher{
Matcher: m,
}
@@ -63,17 +61,23 @@ func (c *matcher) ValidateInitialization() error {
}
// DefinitionMatches returns whether this ValidatingAdmissionPolicy matches the provided admission resource request
-func (c *matcher) DefinitionMatches(a admission.Attributes, o admission.ObjectInterfaces, definition *v1beta1.ValidatingAdmissionPolicy) (bool, schema.GroupVersionResource, schema.GroupVersionKind, error) {
- criteria := matchCriteria{constraints: definition.Spec.MatchConstraints}
+func (c *matcher) DefinitionMatches(a admission.Attributes, o admission.ObjectInterfaces, definition PolicyAccessor) (bool, schema.GroupVersionResource, schema.GroupVersionKind, error) {
+ constraints := definition.GetMatchConstraints()
+ if constraints == nil {
+ return false, schema.GroupVersionResource{}, schema.GroupVersionKind{}, fmt.Errorf("policy contained no match constraints, a required field")
+ }
+ criteria := matchCriteria{constraints: constraints}
return c.Matcher.Matches(a, o, &criteria)
}
// BindingMatches returns whether this ValidatingAdmissionPolicyBinding matches the provided admission resource request
-func (c *matcher) BindingMatches(a admission.Attributes, o admission.ObjectInterfaces, binding *v1beta1.ValidatingAdmissionPolicyBinding) (bool, error) {
- if binding.Spec.MatchResources == nil {
+func (c *matcher) BindingMatches(a admission.Attributes, o admission.ObjectInterfaces, binding BindingAccessor) (bool, error) {
+ matchResources := binding.GetMatchResources()
+ if matchResources == nil {
return true, nil
}
- criteria := matchCriteria{constraints: binding.Spec.MatchResources}
+
+ criteria := matchCriteria{constraints: matchResources}
isMatch, _, _, err := c.Matcher.Matches(a, o, &criteria)
return isMatch, err
}
@@ -81,3 +85,24 @@ func (c *matcher) BindingMatches(a admission.Attributes, o admission.ObjectInter
func (c *matcher) GetNamespace(name string) (*corev1.Namespace, error) {
return c.Matcher.GetNamespace(name)
}
+
+var _ matching.MatchCriteria = &matchCriteria{}
+
+type matchCriteria struct {
+ constraints *admissionregistrationv1.MatchResources
+}
+
+// GetParsedNamespaceSelector returns the converted LabelSelector which implements labels.Selector
+func (m *matchCriteria) GetParsedNamespaceSelector() (labels.Selector, error) {
+ return metav1.LabelSelectorAsSelector(m.constraints.NamespaceSelector)
+}
+
+// GetParsedObjectSelector returns the converted LabelSelector which implements labels.Selector
+func (m *matchCriteria) GetParsedObjectSelector() (labels.Selector, error) {
+ return metav1.LabelSelectorAsSelector(m.constraints.ObjectSelector)
+}
+
+// GetMatchResources returns the matchConstraints
+func (m *matchCriteria) GetMatchResources() admissionregistrationv1.MatchResources {
+ return *m.constraints
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_source.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_source.go
new file mode 100644
index 00000000000..9b2e2146a8f
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_source.go
@@ -0,0 +1,477 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generic
+
+import (
+ "context"
+ goerrors "errors"
+ "fmt"
+ "sync"
+ "sync/atomic"
+ "time"
+
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/api/meta"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/apimachinery/pkg/types"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic"
+ "k8s.io/client-go/dynamic"
+ "k8s.io/client-go/dynamic/dynamicinformer"
+ "k8s.io/client-go/informers"
+ "k8s.io/client-go/tools/cache"
+ "k8s.io/klog/v2"
+)
+
+type policySource[P runtime.Object, B runtime.Object, E Evaluator] struct {
+ ctx context.Context
+ policyInformer generic.Informer[P]
+ bindingInformer generic.Informer[B]
+ restMapper meta.RESTMapper
+ newPolicyAccessor func(P) PolicyAccessor
+ newBindingAccessor func(B) BindingAccessor
+
+ informerFactory informers.SharedInformerFactory
+ dynamicClient dynamic.Interface
+
+ compiler func(P) E
+
+ // Currently compiled list of valid/active policy-binding pairs
+ policies atomic.Pointer[[]PolicyHook[P, B, E]]
+ // Whether the cache of policies is dirty and needs to be recompiled
+ policiesDirty atomic.Bool
+
+ lock sync.Mutex
+ compiledPolicies map[types.NamespacedName]compiledPolicyEntry[E]
+
+ // Temporary until we use the dynamic informer factory
+ paramsCRDControllers map[schema.GroupVersionKind]*paramInfo
+}
+
+type paramInfo struct {
+ mapping meta.RESTMapping
+
+ // When the param is changed, or the informer is done being used, the cancel
+ // func should be called to stop/cleanup the original informer
+ cancelFunc func()
+
+ // The lister for this param
+ informer informers.GenericInformer
+}
+
+type compiledPolicyEntry[E Evaluator] struct {
+ policyVersion string
+ evaluator E
+}
+
+type PolicyHook[P runtime.Object, B runtime.Object, E Evaluator] struct {
+ Policy P
+ Bindings []B
+
+ // ParamInformer is the informer for the param CRD for this policy, or nil if
+ // there is no param or if there was a configuration error
+ ParamInformer informers.GenericInformer
+ ParamScope meta.RESTScope
+
+ Evaluator E
+ ConfigurationError error
+}
+
+var _ Source[PolicyHook[runtime.Object, runtime.Object, Evaluator]] = &policySource[runtime.Object, runtime.Object, Evaluator]{}
+
+func NewPolicySource[P runtime.Object, B runtime.Object, E Evaluator](
+ policyInformer cache.SharedIndexInformer,
+ bindingInformer cache.SharedIndexInformer,
+ newPolicyAccessor func(P) PolicyAccessor,
+ newBindingAccessor func(B) BindingAccessor,
+ compiler func(P) E,
+ paramInformerFactory informers.SharedInformerFactory,
+ dynamicClient dynamic.Interface,
+ restMapper meta.RESTMapper,
+) Source[PolicyHook[P, B, E]] {
+ res := &policySource[P, B, E]{
+ compiler: compiler,
+ policyInformer: generic.NewInformer[P](policyInformer),
+ bindingInformer: generic.NewInformer[B](bindingInformer),
+ compiledPolicies: map[types.NamespacedName]compiledPolicyEntry[E]{},
+ newPolicyAccessor: newPolicyAccessor,
+ newBindingAccessor: newBindingAccessor,
+ paramsCRDControllers: map[schema.GroupVersionKind]*paramInfo{},
+ informerFactory: paramInformerFactory,
+ dynamicClient: dynamicClient,
+ restMapper: restMapper,
+ }
+ return res
+}
+
+func (s *policySource[P, B, E]) Run(ctx context.Context) error {
+ if s.ctx != nil {
+ return fmt.Errorf("policy source already running")
+ }
+
+ // Wait for initial cache sync of policies and informers before reconciling
+ // any
+ if !cache.WaitForNamedCacheSync(fmt.Sprintf("%T", s), ctx.Done(), s.UpstreamHasSynced) {
+ err := ctx.Err()
+ if err == nil {
+ err = fmt.Errorf("initial cache sync for %T failed", s)
+ }
+ return err
+ }
+
+ s.ctx = ctx
+
+ // Perform initial policy compilation after initial list has finished
+ s.notify()
+ s.refreshPolicies()
+
+ notifyFuncs := cache.ResourceEventHandlerFuncs{
+ AddFunc: func(_ interface{}) {
+ s.notify()
+ },
+ UpdateFunc: func(_, _ interface{}) {
+ s.notify()
+ },
+ DeleteFunc: func(_ interface{}) {
+ s.notify()
+ },
+ }
+ handle, err := s.policyInformer.AddEventHandler(notifyFuncs)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err := s.policyInformer.RemoveEventHandler(handle); err != nil {
+ utilruntime.HandleError(fmt.Errorf("failed to remove policy event handler: %w", err))
+ }
+ }()
+
+ bindingHandle, err := s.bindingInformer.AddEventHandler(notifyFuncs)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err := s.bindingInformer.RemoveEventHandler(bindingHandle); err != nil {
+ utilruntime.HandleError(fmt.Errorf("failed to remove binding event handler: %w", err))
+ }
+ }()
+
+ // Start a worker that checks every second to see if policy data is dirty
+ // and needs to be recompiled
+ go func() {
+ // Loop every 1 second until context is cancelled, refreshing policies
+ wait.Until(s.refreshPolicies, 1*time.Second, ctx.Done())
+ }()
+
+ <-ctx.Done()
+ return nil
+}
+
+func (s *policySource[P, B, E]) UpstreamHasSynced() bool {
+ return s.policyInformer.HasSynced() && s.bindingInformer.HasSynced()
+}
+
+// HasSynced implements Source.
+func (s *policySource[P, B, E]) HasSynced() bool {
+ // As an invariant we never store `nil` into the atomic list of processed
+ // policy hooks. If it is nil, then we haven't compiled all the policies
+ // and stored them yet.
+ return s.Hooks() != nil
+}
+
+// Hooks implements Source.
+func (s *policySource[P, B, E]) Hooks() []PolicyHook[P, B, E] {
+ res := s.policies.Load()
+
+ // Error case should not happen since evaluation function never
+ // returns error
+ if res == nil {
+ // Not yet synced
+ return nil
+ }
+
+ return *res
+}
+
+func (s *policySource[P, B, E]) refreshPolicies() {
+ if !s.UpstreamHasSynced() {
+ return
+ } else if !s.policiesDirty.Swap(false) {
+ return
+ }
+
+ // It is ok the cache gets marked dirty again between us clearing the
+ // flag and us calculating the policies. The dirty flag would be marked again,
+ // and we'd have a no-op after comparing resource versions on the next sync.
+ klog.Infof("refreshing policies")
+ policies, err := s.calculatePolicyData()
+
+ // Intentionally store policy list regardless of error. There may be
+ // an error returned if there was a configuration error in one of the policies,
+ // but we would still want those policies evaluated
+ // (for instance to return error on failaction). Or if there was an error
+ // listing all policies at all, we would want to wipe the list.
+ s.policies.Store(&policies)
+
+ if err != nil {
+ // An error was generated while syncing policies. Mark it as dirty again
+ // so we can retry later
+ utilruntime.HandleError(fmt.Errorf("encountered error syncing policies: %w. Rescheduling policy sync", err))
+ s.notify()
+ }
+}
+
+func (s *policySource[P, B, E]) notify() {
+ s.policiesDirty.Store(true)
+}
+
+// calculatePolicyData calculates the list of policies and bindings for each
+// policy. If there is an error in generation, it will return the error and
+// the partial list of policies that were able to be generated. Policies that
+// have an error will have a non-nil ConfigurationError field, but still be
+// included in the result.
+//
+// This function caches the result of the intermediate compilations
+func (s *policySource[P, B, E]) calculatePolicyData() ([]PolicyHook[P, B, E], error) {
+ if !s.UpstreamHasSynced() {
+ return nil, fmt.Errorf("cannot calculate policy data until upstream has synced")
+ }
+
+ // Fat-fingered lock that can be made more fine-tuned if required
+ s.lock.Lock()
+ defer s.lock.Unlock()
+
+ // Create a local copy of all policies and bindings
+ policiesToBindings := map[types.NamespacedName][]B{}
+ bindingList, err := s.bindingInformer.List(labels.Everything())
+ if err != nil {
+ // This should never happen unless types are misconfigured
+ // (can't use meta.accessor on them)
+ return nil, err
+ }
+
+ // Gather a list of all active policy bindings
+ for _, bindingSpec := range bindingList {
+ bindingAccessor := s.newBindingAccessor(bindingSpec)
+ policyKey := bindingAccessor.GetPolicyName()
+
+ // Add this binding to the list of bindings for this policy
+ policiesToBindings[policyKey] = append(policiesToBindings[policyKey], bindingSpec)
+ }
+
+ result := make([]PolicyHook[P, B, E], 0, len(bindingList))
+ usedParams := map[schema.GroupVersionKind]struct{}{}
+ var errs []error
+ for policyKey, bindingSpecs := range policiesToBindings {
+ var inf generic.NamespacedLister[P] = s.policyInformer
+ if len(policyKey.Namespace) > 0 {
+ inf = s.policyInformer.Namespaced(policyKey.Namespace)
+ }
+ policySpec, err := inf.Get(policyKey.Name)
+ if errors.IsNotFound(err) {
+ // Policy for bindings doesn't exist. This can happen if the policy
+ // was deleted before the binding, or the binding was created first.
+ //
+ // Just skip bindings that refer to non-existent policies
+ // If the policy is recreated, the cache will be marked dirty and
+ // this function will run again.
+ continue
+ } else if err != nil {
+ // This should never happen since fetching from a cache should never
+ // fail and this function checks that the cache was synced before
+ // even getting to this point.
+ errs = append(errs, err)
+ continue
+ }
+
+ var parsedParamKind *schema.GroupVersionKind
+ policyAccessor := s.newPolicyAccessor(policySpec)
+
+ if paramKind := policyAccessor.GetParamKind(); paramKind != nil {
+ groupVersion, err := schema.ParseGroupVersion(paramKind.APIVersion)
+ if err != nil {
+ errs = append(errs, fmt.Errorf("failed to parse paramKind APIVersion: %w", err))
+ continue
+ }
+ parsedParamKind = &schema.GroupVersionKind{
+ Group: groupVersion.Group,
+ Version: groupVersion.Version,
+ Kind: paramKind.Kind,
+ }
+
+ // TEMPORARY UNTIL WE HAVE SHARED PARAM INFORMERS
+ usedParams[*parsedParamKind] = struct{}{}
+ }
+
+ paramInformer, paramScope, configurationError := s.ensureParamsForPolicyLocked(parsedParamKind)
+ result = append(result, PolicyHook[P, B, E]{
+ Policy: policySpec,
+ Bindings: bindingSpecs,
+ Evaluator: s.compilePolicyLocked(policySpec),
+ ParamInformer: paramInformer,
+ ParamScope: paramScope,
+ ConfigurationError: configurationError,
+ })
+
+ // Should queue a re-sync for policy sync error. If our shared param
+ // informer can notify us when CRD discovery changes we can remove this
+ // and just rely on the informer to notify us when the CRDs change
+ if configurationError != nil {
+ errs = append(errs, configurationError)
+ }
+ }
+
+ // Clean up orphaned policies by replacing the old cache of compiled policies
+ // (the map of used policies is updated by `compilePolicy`)
+ for policyKey := range s.compiledPolicies {
+ if _, wasSeen := policiesToBindings[policyKey]; !wasSeen {
+ delete(s.compiledPolicies, policyKey)
+ }
+ }
+
+ // Clean up orphaned param informers
+ for paramKind, info := range s.paramsCRDControllers {
+ if _, wasSeen := usedParams[paramKind]; !wasSeen {
+ info.cancelFunc()
+ delete(s.paramsCRDControllers, paramKind)
+ }
+ }
+
+ err = nil
+ if len(errs) > 0 {
+ err = goerrors.Join(errs...)
+ }
+ return result, err
+}
+
+// ensureParamsForPolicyLocked ensures that the informer for the paramKind is
+// started and returns the informer and the scope of the paramKind.
+//
+// Must be called under write lock
+func (s *policySource[P, B, E]) ensureParamsForPolicyLocked(paramSource *schema.GroupVersionKind) (informers.GenericInformer, meta.RESTScope, error) {
+ if paramSource == nil {
+ return nil, nil, nil
+ } else if info, ok := s.paramsCRDControllers[*paramSource]; ok {
+ return info.informer, info.mapping.Scope, nil
+ }
+
+ mapping, err := s.restMapper.RESTMapping(schema.GroupKind{
+ Group: paramSource.Group,
+ Kind: paramSource.Kind,
+ }, paramSource.Version)
+
+ if err != nil {
+ // Failed to resolve. Return error so we retry again (rate limited)
+ // Save a record of this definition with an evaluator that unconditionally
+ return nil, nil, fmt.Errorf("failed to find resource referenced by paramKind: '%v'", *paramSource)
+ }
+
+ // We are not watching this param. Start an informer for it.
+ instanceContext, instanceCancel := context.WithCancel(s.ctx)
+
+ var informer informers.GenericInformer
+
+ // Try to see if our provided informer factory has an informer for this type.
+ // We assume the informer is already started, and starts all types associated
+ // with it.
+ if genericInformer, err := s.informerFactory.ForResource(mapping.Resource); err == nil {
+ informer = genericInformer
+
+ // Start the informer
+ s.informerFactory.Start(instanceContext.Done())
+
+ } else {
+ // Dynamic JSON informer fallback.
+ // Cannot use shared dynamic informer since it would be impossible
+ // to clean CRD informers properly with multiple dependents
+ // (cannot start ahead of time, and cannot track dependencies via stopCh)
+ informer = dynamicinformer.NewFilteredDynamicInformer(
+ s.dynamicClient,
+ mapping.Resource,
+ corev1.NamespaceAll,
+ // Use same interval as is used for k8s typed sharedInformerFactory
+ // https://github.com/kubernetes/kubernetes/blob/7e0923899fed622efbc8679cca6b000d43633e38/cmd/kube-apiserver/app/server.go#L430
+ 10*time.Minute,
+ cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
+ nil,
+ )
+ go informer.Informer().Run(instanceContext.Done())
+ }
+
+ klog.Infof("informer started for %v", *paramSource)
+ ret := ¶mInfo{
+ mapping: *mapping,
+ cancelFunc: instanceCancel,
+ informer: informer,
+ }
+ s.paramsCRDControllers[*paramSource] = ret
+ return ret.informer, mapping.Scope, nil
+}
+
+// For testing
+func (s *policySource[P, B, E]) getParamInformer(param schema.GroupVersionKind) (informers.GenericInformer, meta.RESTScope) {
+ s.lock.Lock()
+ defer s.lock.Unlock()
+
+ if info, ok := s.paramsCRDControllers[param]; ok {
+ return info.informer, info.mapping.Scope
+ }
+
+ return nil, nil
+}
+
+// compilePolicyLocked compiles the policy and returns the evaluator for it.
+// If the policy has not changed since the last compilation, it will return
+// the cached evaluator.
+//
+// Must be called under write lock
+func (s *policySource[P, B, E]) compilePolicyLocked(policySpec P) E {
+ policyMeta, err := meta.Accessor(policySpec)
+ if err != nil {
+ // This should not happen if P, and B have ObjectMeta, but
+ // unfortunately there is no way to express "able to call
+ // meta.Accessor" as a type constraint
+ utilruntime.HandleError(err)
+ var emptyEvaluator E
+ return emptyEvaluator
+ }
+ key := types.NamespacedName{
+ Namespace: policyMeta.GetNamespace(),
+ Name: policyMeta.GetName(),
+ }
+
+ compiledPolicy, wasCompiled := s.compiledPolicies[key]
+
+ // If the policy or binding has changed since it was last compiled,
+ // and if there is no configuration error (like a missing param CRD)
+ // then we recompile
+ if !wasCompiled ||
+ compiledPolicy.policyVersion != policyMeta.GetResourceVersion() {
+
+ compiledPolicy = compiledPolicyEntry[E]{
+ policyVersion: policyMeta.GetResourceVersion(),
+ evaluator: s.compiler(policySpec),
+ }
+ s.compiledPolicies[key] = compiledPolicy
+ }
+
+ return compiledPolicy.evaluator
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_test_context.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_test_context.go
new file mode 100644
index 00000000000..69b19fb2aa6
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_test_context.go
@@ -0,0 +1,639 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generic
+
+import (
+ "context"
+ "fmt"
+ "time"
+
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/apimachinery/pkg/runtime/serializer"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/apimachinery/pkg/util/uuid"
+ "k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/apimachinery/pkg/watch"
+ "k8s.io/client-go/dynamic"
+ dynamicfake "k8s.io/client-go/dynamic/fake"
+ "k8s.io/client-go/informers"
+ "k8s.io/client-go/kubernetes"
+ "k8s.io/client-go/kubernetes/fake"
+ clienttesting "k8s.io/client-go/testing"
+ "k8s.io/client-go/tools/cache"
+ "k8s.io/component-base/featuregate"
+
+ "k8s.io/apiserver/pkg/admission"
+ "k8s.io/apiserver/pkg/admission/initializer"
+ "k8s.io/apiserver/pkg/authorization/authorizer"
+ "k8s.io/apiserver/pkg/features"
+)
+
+// PolicyTestContext is everything you need to unit test a policy plugin
+type PolicyTestContext[P runtime.Object, B runtime.Object, E Evaluator] struct {
+ context.Context
+ Plugin *Plugin[PolicyHook[P, B, E]]
+ Source Source[PolicyHook[P, B, E]]
+ Start func() error
+
+ scheme *runtime.Scheme
+ restMapper *meta.DefaultRESTMapper
+ policyGVR schema.GroupVersionResource
+ bindingGVR schema.GroupVersionResource
+
+ policyGVK schema.GroupVersionKind
+ bindingGVK schema.GroupVersionKind
+
+ nativeTracker clienttesting.ObjectTracker
+ policyAndBindingTracker clienttesting.ObjectTracker
+ unstructuredTracker clienttesting.ObjectTracker
+}
+
+func NewPolicyTestContext[P, B runtime.Object, E Evaluator](
+ newPolicyAccessor func(P) PolicyAccessor,
+ newBindingAccessor func(B) BindingAccessor,
+ compileFunc func(P) E,
+ dispatcher dispatcherFactory[PolicyHook[P, B, E]],
+ initialObjects []runtime.Object,
+ paramMappings []meta.RESTMapping,
+) (*PolicyTestContext[P, B, E], func(), error) {
+ var Pexample P
+ var Bexample B
+
+ // Create a fake resource and kind for the provided policy and binding types
+ fakePolicyGVR := schema.GroupVersionResource{
+ Group: "policy.example.com",
+ Version: "v1",
+ Resource: "fakepolicies",
+ }
+ fakeBindingGVR := schema.GroupVersionResource{
+ Group: "policy.example.com",
+ Version: "v1",
+ Resource: "fakebindings",
+ }
+ fakePolicyGVK := fakePolicyGVR.GroupVersion().WithKind("FakePolicy")
+ fakeBindingGVK := fakeBindingGVR.GroupVersion().WithKind("FakeBinding")
+
+ policySourceTestScheme, err := func() (*runtime.Scheme, error) {
+ scheme := runtime.NewScheme()
+
+ if err := fake.AddToScheme(scheme); err != nil {
+ return nil, err
+ }
+
+ scheme.AddKnownTypeWithName(fakePolicyGVK, Pexample)
+ scheme.AddKnownTypeWithName(fakeBindingGVK, Bexample)
+ scheme.AddKnownTypeWithName(fakePolicyGVK.GroupVersion().WithKind(fakePolicyGVK.Kind+"List"), &FakeList[P]{})
+ scheme.AddKnownTypeWithName(fakeBindingGVK.GroupVersion().WithKind(fakeBindingGVK.Kind+"List"), &FakeList[B]{})
+
+ for _, mapping := range paramMappings {
+ // Skip if it is in the scheme already
+ if scheme.Recognizes(mapping.GroupVersionKind) {
+ continue
+ }
+ scheme.AddKnownTypeWithName(mapping.GroupVersionKind, &unstructured.Unstructured{})
+ scheme.AddKnownTypeWithName(mapping.GroupVersionKind.GroupVersion().WithKind(mapping.GroupVersionKind.Kind+"List"), &unstructured.UnstructuredList{})
+ }
+
+ return scheme, nil
+ }()
+ if err != nil {
+ return nil, nil, err
+ }
+
+ fakeRestMapper := func() *meta.DefaultRESTMapper {
+ res := meta.NewDefaultRESTMapper([]schema.GroupVersion{
+ {
+ Group: "",
+ Version: "v1",
+ },
+ })
+
+ res.Add(fakePolicyGVK, meta.RESTScopeRoot)
+ res.Add(fakeBindingGVK, meta.RESTScopeRoot)
+ res.Add(corev1.SchemeGroupVersion.WithKind("ConfigMap"), meta.RESTScopeNamespace)
+
+ for _, mapping := range paramMappings {
+ res.AddSpecific(mapping.GroupVersionKind, mapping.Resource, mapping.Resource, mapping.Scope)
+ }
+
+ return res
+ }()
+
+ nativeClient := fake.NewSimpleClientset()
+ dynamicClient := dynamicfake.NewSimpleDynamicClient(policySourceTestScheme)
+ fakeInformerFactory := informers.NewSharedInformerFactory(nativeClient, 30*time.Second)
+
+ // Make an object tracker specifically for our policies and bindings
+ policiesAndBindingsTracker := clienttesting.NewObjectTracker(
+ policySourceTestScheme,
+ serializer.NewCodecFactory(policySourceTestScheme).UniversalDecoder())
+
+ // Make an informer for our policies and bindings
+
+ policyInformer := cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
+ return policiesAndBindingsTracker.List(fakePolicyGVR, fakePolicyGVK, "")
+ },
+ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
+ return policiesAndBindingsTracker.Watch(fakePolicyGVR, "")
+ },
+ },
+ Pexample,
+ 30*time.Second,
+ cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
+ )
+ bindingInformer := cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
+ return policiesAndBindingsTracker.List(fakeBindingGVR, fakeBindingGVK, "")
+ },
+ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
+ return policiesAndBindingsTracker.Watch(fakeBindingGVR, "")
+ },
+ },
+ Bexample,
+ 30*time.Second,
+ cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
+ )
+
+ var source Source[PolicyHook[P, B, E]]
+ plugin := NewPlugin[PolicyHook[P, B, E]](
+ admission.NewHandler(admission.Connect, admission.Create, admission.Delete, admission.Update),
+ func(sif informers.SharedInformerFactory, i1 kubernetes.Interface, i2 dynamic.Interface, r meta.RESTMapper) Source[PolicyHook[P, B, E]] {
+ source = NewPolicySource[P, B, E](
+ policyInformer,
+ bindingInformer,
+ newPolicyAccessor,
+ newBindingAccessor,
+ compileFunc,
+ sif,
+ i2,
+ r,
+ )
+ return source
+ }, dispatcher)
+ plugin.SetEnabled(true)
+
+ featureGate := featuregate.NewFeatureGate()
+ err = featureGate.Add(map[featuregate.Feature]featuregate.FeatureSpec{
+ //!TODO: move this to validating specific tests
+ features.ValidatingAdmissionPolicy: {
+ Default: true, PreRelease: featuregate.Beta}})
+ if err != nil {
+ return nil, nil, err
+ }
+ err = featureGate.SetFromMap(map[string]bool{string(features.ValidatingAdmissionPolicy): true})
+ if err != nil {
+ return nil, nil, err
+ }
+
+ testContext, testCancel := context.WithCancel(context.Background())
+ genericInitializer := initializer.New(
+ nativeClient,
+ dynamicClient,
+ fakeInformerFactory,
+ fakeAuthorizer{},
+ featureGate,
+ testContext.Done(),
+ fakeRestMapper,
+ )
+ genericInitializer.Initialize(plugin)
+ plugin.SetRESTMapper(fakeRestMapper)
+
+ if err := plugin.ValidateInitialization(); err != nil {
+ testCancel()
+ return nil, nil, err
+ }
+
+ res := &PolicyTestContext[P, B, E]{
+ Context: testContext,
+ Plugin: plugin,
+ Source: source,
+
+ restMapper: fakeRestMapper,
+ scheme: policySourceTestScheme,
+ policyGVK: fakePolicyGVK,
+ bindingGVK: fakeBindingGVK,
+ policyGVR: fakePolicyGVR,
+ bindingGVR: fakeBindingGVR,
+ nativeTracker: nativeClient.Tracker(),
+ policyAndBindingTracker: policiesAndBindingsTracker,
+ unstructuredTracker: dynamicClient.Tracker(),
+ }
+
+ for _, obj := range initialObjects {
+ err := res.updateOne(obj)
+ if err != nil {
+ testCancel()
+ return nil, nil, err
+ }
+ }
+
+ res.Start = func() error {
+ fakeInformerFactory.Start(res.Done())
+ go policyInformer.Run(res.Done())
+ go bindingInformer.Run(res.Done())
+
+ if !cache.WaitForCacheSync(res.Done(), res.Source.HasSynced) {
+ return fmt.Errorf("timed out waiting for initial cache sync")
+ }
+ return nil
+ }
+ return res, testCancel, nil
+}
+
+// UpdateAndWait updates the given object in the test, or creates it if it doesn't exist
+// Depending upon object type, waits afterward until the object is synced
+// by the policy source
+//
+// Be aware the UpdateAndWait will modify the ResourceVersion of the
+// provided objects.
+func (p *PolicyTestContext[P, B, E]) UpdateAndWait(objects ...runtime.Object) error {
+ return p.update(true, objects...)
+}
+
+// Update updates the given object in the test, or creates it if it doesn't exist
+//
+// Be aware the Update will modify the ResourceVersion of the
+// provided objects.
+func (p *PolicyTestContext[P, B, E]) Update(objects ...runtime.Object) error {
+ return p.update(false, objects...)
+}
+
+// Objects the given object in the test, or creates it if it doesn't exist
+// Depending upon object type, waits afterward until the object is synced
+// by the policy source
+func (p *PolicyTestContext[P, B, E]) update(wait bool, objects ...runtime.Object) error {
+ for _, object := range objects {
+ if err := p.updateOne(object); err != nil {
+ return err
+ }
+ }
+
+ if wait {
+ timeoutCtx, timeoutCancel := context.WithTimeout(p, 3*time.Second)
+ defer timeoutCancel()
+
+ for _, object := range objects {
+ if err := p.WaitForReconcile(timeoutCtx, object); err != nil {
+ return fmt.Errorf("error waiting for reconcile of %v: %v", object, err)
+ }
+ }
+ }
+ return nil
+}
+
+// Depending upon object type, waits afterward until the object is synced
+// by the policy source. Note that policies that are not bound are skipped,
+// so you should not try to wait for an unbound policy. Create both the binding
+// and policy, then wait.
+func (p *PolicyTestContext[P, B, E]) WaitForReconcile(timeoutCtx context.Context, object runtime.Object) error {
+ if !p.Source.HasSynced() {
+ return nil
+ }
+
+ objectMeta, err := meta.Accessor(object)
+ if err != nil {
+ return err
+ }
+
+ objectGVK, _, err := p.inferGVK(object)
+ if err != nil {
+ return err
+ }
+
+ switch objectGVK {
+ case p.policyGVK:
+ return wait.PollUntilContextCancel(timeoutCtx, 100*time.Millisecond, true, func(ctx context.Context) (done bool, err error) {
+ policies := p.Source.Hooks()
+ for _, policy := range policies {
+ policyMeta, err := meta.Accessor(policy.Policy)
+ if err != nil {
+ return true, err
+ } else if policyMeta.GetName() == objectMeta.GetName() && policyMeta.GetResourceVersion() == objectMeta.GetResourceVersion() {
+ return true, nil
+ }
+ }
+ return false, nil
+ })
+ case p.bindingGVK:
+ return wait.PollUntilContextCancel(timeoutCtx, 100*time.Millisecond, true, func(ctx context.Context) (done bool, err error) {
+ policies := p.Source.Hooks()
+ for _, policy := range policies {
+ for _, binding := range policy.Bindings {
+ bindingMeta, err := meta.Accessor(binding)
+ if err != nil {
+ return true, err
+ } else if bindingMeta.GetName() == objectMeta.GetName() && bindingMeta.GetResourceVersion() == objectMeta.GetResourceVersion() {
+ return true, nil
+ }
+ }
+ }
+ return false, nil
+ })
+
+ default:
+ // Do nothing, params are visible immediately
+ // Loop until one of the params is visible via get of the param informer
+ return wait.PollUntilContextCancel(timeoutCtx, 100*time.Millisecond, true, func(ctx context.Context) (done bool, err error) {
+ informer, scope := p.Source.(*policySource[P, B, E]).getParamInformer(objectGVK)
+ if informer == nil {
+ // Informer does not exist yet, keep waiting for sync
+ return false, nil
+ }
+
+ if !cache.WaitForCacheSync(timeoutCtx.Done(), informer.Informer().HasSynced) {
+ return false, fmt.Errorf("timed out waiting for cache sync of param informer")
+ }
+
+ var lister cache.GenericNamespaceLister = informer.Lister()
+ if scope == meta.RESTScopeNamespace {
+ lister = informer.Lister().ByNamespace(objectMeta.GetNamespace())
+ }
+
+ fetched, err := lister.Get(objectMeta.GetName())
+ if err != nil {
+ if errors.IsNotFound(err) {
+ return false, nil
+ }
+ return true, err
+ }
+
+ // Ensure RV matches
+ fetchedMeta, err := meta.Accessor(fetched)
+ if err != nil {
+ return true, err
+ } else if fetchedMeta.GetResourceVersion() != objectMeta.GetResourceVersion() {
+ return false, nil
+ }
+
+ return true, nil
+ })
+ }
+}
+
+func (p *PolicyTestContext[P, B, E]) waitForDelete(ctx context.Context, objectGVK schema.GroupVersionKind, name types.NamespacedName) error {
+ srce := p.Source.(*policySource[P, B, E])
+
+ return wait.PollUntilContextCancel(ctx, 100*time.Millisecond, true, func(ctx context.Context) (done bool, err error) {
+ switch objectGVK {
+ case p.policyGVK:
+ for _, hook := range p.Source.Hooks() {
+ accessor := srce.newPolicyAccessor(hook.Policy)
+ if accessor.GetName() == name.Name && accessor.GetNamespace() == name.Namespace {
+ return false, nil
+ }
+ }
+
+ return true, nil
+ case p.bindingGVK:
+ for _, hook := range p.Source.Hooks() {
+ for _, binding := range hook.Bindings {
+ accessor := srce.newBindingAccessor(binding)
+ if accessor.GetName() == name.Name && accessor.GetNamespace() == name.Namespace {
+ return false, nil
+ }
+ }
+ }
+ return true, nil
+ default:
+ // Do nothing, params are visible immediately
+ // Loop until one of the params is visible via get of the param informer
+ informer, scope := p.Source.(*policySource[P, B, E]).getParamInformer(objectGVK)
+ if informer == nil {
+ return true, nil
+ }
+
+ var lister cache.GenericNamespaceLister = informer.Lister()
+ if scope == meta.RESTScopeNamespace {
+ lister = informer.Lister().ByNamespace(name.Namespace)
+ }
+
+ _, err = lister.Get(name.Name)
+ if err != nil {
+ if errors.IsNotFound(err) {
+ return true, nil
+ }
+ return false, err
+ }
+ return false, nil
+ }
+ })
+}
+
+func (p *PolicyTestContext[P, B, E]) updateOne(object runtime.Object) error {
+ objectMeta, err := meta.Accessor(object)
+ if err != nil {
+ return err
+ }
+ objectMeta.SetResourceVersion(string(uuid.NewUUID()))
+ objectGVK, gvr, err := p.inferGVK(object)
+ if err != nil {
+ return err
+ }
+
+ switch objectGVK {
+ case p.policyGVK:
+ err := p.policyAndBindingTracker.Update(p.policyGVR, object, objectMeta.GetNamespace())
+ if errors.IsNotFound(err) {
+ err = p.policyAndBindingTracker.Create(p.policyGVR, object, objectMeta.GetNamespace())
+ }
+
+ return err
+ case p.bindingGVK:
+ err := p.policyAndBindingTracker.Update(p.bindingGVR, object, objectMeta.GetNamespace())
+ if errors.IsNotFound(err) {
+ err = p.policyAndBindingTracker.Create(p.bindingGVR, object, objectMeta.GetNamespace())
+ }
+
+ return err
+ default:
+ if _, ok := object.(*unstructured.Unstructured); ok {
+ if err := p.unstructuredTracker.Create(gvr, object, objectMeta.GetNamespace()); err != nil {
+ if errors.IsAlreadyExists(err) {
+ return p.unstructuredTracker.Update(gvr, object, objectMeta.GetNamespace())
+ }
+ return err
+ }
+ return nil
+ } else if err := p.nativeTracker.Create(gvr, object, objectMeta.GetNamespace()); err != nil {
+ if errors.IsAlreadyExists(err) {
+ return p.nativeTracker.Update(gvr, object, objectMeta.GetNamespace())
+ }
+ }
+ return nil
+ }
+}
+
+// Depending upon object type, waits afterward until the object is synced
+// by the policy source
+func (p *PolicyTestContext[P, B, E]) DeleteAndWait(object ...runtime.Object) error {
+ for _, object := range object {
+ if err := p.deleteOne(object); err != nil && !errors.IsNotFound(err) {
+ return err
+ }
+ }
+
+ timeoutCtx, timeoutCancel := context.WithTimeout(p, 3*time.Second)
+ defer timeoutCancel()
+
+ for _, object := range object {
+ accessor, err := meta.Accessor(object)
+ if err != nil {
+ return err
+ }
+
+ objectGVK, _, err := p.inferGVK(object)
+ if err != nil {
+ return err
+ }
+
+ if err := p.waitForDelete(
+ timeoutCtx,
+ objectGVK,
+ types.NamespacedName{Name: accessor.GetName(), Namespace: accessor.GetNamespace()}); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func (p *PolicyTestContext[P, B, E]) deleteOne(object runtime.Object) error {
+ objectMeta, err := meta.Accessor(object)
+ if err != nil {
+ return err
+ }
+ objectMeta.SetResourceVersion(string(uuid.NewUUID()))
+ objectGVK, gvr, err := p.inferGVK(object)
+ if err != nil {
+ return err
+ }
+
+ switch objectGVK {
+ case p.policyGVK:
+ return p.policyAndBindingTracker.Delete(p.policyGVR, objectMeta.GetNamespace(), objectMeta.GetName())
+ case p.bindingGVK:
+ return p.policyAndBindingTracker.Delete(p.bindingGVR, objectMeta.GetNamespace(), objectMeta.GetName())
+ default:
+ if _, ok := object.(*unstructured.Unstructured); ok {
+ return p.unstructuredTracker.Delete(gvr, objectMeta.GetNamespace(), objectMeta.GetName())
+ }
+ return p.nativeTracker.Delete(gvr, objectMeta.GetNamespace(), objectMeta.GetName())
+ }
+}
+
+func (p *PolicyTestContext[P, B, E]) Dispatch(
+ new, old runtime.Object,
+ operation admission.Operation,
+) error {
+ if old == nil && new == nil {
+ return fmt.Errorf("both old and new objects cannot be nil")
+ }
+
+ nonNilObject := new
+ if nonNilObject == nil {
+ nonNilObject = old
+ }
+
+ gvk, gvr, err := p.inferGVK(nonNilObject)
+ if err != nil {
+ return err
+ }
+
+ nonNilMeta, err := meta.Accessor(nonNilObject)
+ if err != nil {
+ return err
+ }
+
+ return p.Plugin.Dispatch(
+ p,
+ admission.NewAttributesRecord(
+ new,
+ old,
+ gvk,
+ nonNilMeta.GetName(),
+ nonNilMeta.GetNamespace(),
+ gvr,
+ "",
+ operation,
+ nil,
+ false,
+ nil,
+ ), admission.NewObjectInterfacesFromScheme(p.scheme))
+}
+
+func (p *PolicyTestContext[P, B, E]) inferGVK(object runtime.Object) (schema.GroupVersionKind, schema.GroupVersionResource, error) {
+ objectGVK := object.GetObjectKind().GroupVersionKind()
+ if objectGVK.Empty() {
+ // If the object doesn't have a GVK, ask the schema for preferred GVK
+ knownKinds, _, err := p.scheme.ObjectKinds(object)
+ if err != nil {
+ return schema.GroupVersionKind{}, schema.GroupVersionResource{}, err
+ } else if len(knownKinds) == 0 {
+ return schema.GroupVersionKind{}, schema.GroupVersionResource{}, fmt.Errorf("no known GVKs for object in schema: %T", object)
+ }
+ toTake := 0
+
+ // Prefer GVK if it is our fake policy or binding
+ for i, knownKind := range knownKinds {
+ if knownKind == p.policyGVK || knownKind == p.bindingGVK {
+ toTake = i
+ break
+ }
+ }
+
+ objectGVK = knownKinds[toTake]
+ }
+
+ // Make sure GVK is known to the fake rest mapper. To prevent cryptic error
+ mapping, err := p.restMapper.RESTMapping(objectGVK.GroupKind(), objectGVK.Version)
+ if err != nil {
+ return schema.GroupVersionKind{}, schema.GroupVersionResource{}, err
+ }
+ return objectGVK, mapping.Resource, nil
+}
+
+type FakeList[T runtime.Object] struct {
+ metav1.TypeMeta
+ metav1.ListMeta
+ Items []T
+}
+
+func (fl *FakeList[P]) DeepCopyObject() runtime.Object {
+ copiedItems := make([]P, len(fl.Items))
+ for i, item := range fl.Items {
+ copiedItems[i] = item.DeepCopyObject().(P)
+ }
+ return &FakeList[P]{
+ TypeMeta: fl.TypeMeta,
+ ListMeta: fl.ListMeta,
+ Items: copiedItems,
+ }
+}
+
+type fakeAuthorizer struct{}
+
+func (f fakeAuthorizer) Authorize(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) {
+ return authorizer.DecisionAllow, "", nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller.go
similarity index 90%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller.go
index 4334c0dd82c..f08e1cc5598 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller.go
@@ -40,7 +40,7 @@ var _ Controller[runtime.Object] = &controller[runtime.Object]{}
type controller[T runtime.Object] struct {
informer Informer[T]
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[string]
// Returns an error if there was a transient error during reconciliation
// and the object should be tried again later.
@@ -99,7 +99,10 @@ func (c *controller[T]) Run(ctx context.Context) error {
klog.Infof("starting %s", c.options.Name)
defer klog.Infof("stopping %s", c.options.Name)
- c.queue = workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), c.options.Name)
+ c.queue = workqueue.NewTypedRateLimitingQueueWithConfig(
+ workqueue.DefaultTypedControllerRateLimiter[string](),
+ workqueue.TypedRateLimitingQueueConfig[string]{Name: c.options.Name},
+ )
// Forcefully shutdown workqueue. Drop any enqueued items.
// Important to do this in a `defer` at the start of `Run`.
@@ -219,7 +222,7 @@ func (c *controller[T]) runWorker() {
}
// We wrap this block in a func so we can defer c.workqueue.Done.
- err := func(obj interface{}) error {
+ err := func(obj string) error {
// We call Done here so the workqueue knows we have finished
// processing this item. We also must remember to call Forget if we
// do not want this work item being re-queued. For example, we do
@@ -227,19 +230,6 @@ func (c *controller[T]) runWorker() {
// put back on the workqueue and attempted again after a back-off
// period.
defer c.queue.Done(obj)
- var key string
- var ok bool
- // We expect strings to come off the workqueue. These are of the
- // form namespace/name. We do this as the delayed nature of the
- // workqueue means the items in the informer cache may actually be
- // more up to date that when the item was initially put onto the
- // workqueue.
- if key, ok = obj.(string); !ok {
- // How did an incorrectly formatted key get in the workqueue?
- // Done is sufficient. (Forget resets rate limiter for the key,
- // but the key is invalid so there is no point in doing that)
- return fmt.Errorf("expected string in workqueue but got %#v", obj)
- }
defer c.hasProcessed.Finished(key)
if err := c.reconcile(key); err != nil {
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/doc.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/doc.go
similarity index 100%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/doc.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/doc.go
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/informer.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/informer.go
similarity index 79%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/informer.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/informer.go
index 3025aa19533..acb6316ec3a 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/informer.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/informer.go
@@ -28,6 +28,10 @@ type informer[T runtime.Object] struct {
lister[T]
}
+// Creates a generic informer around a type-erased cache.SharedIndexInformer
+// It is incumbent on the caller to ensure that the generic type argument is
+// consistent with the type of the objects stored inside the SharedIndexInformer
+// as they will be casted.
func NewInformer[T runtime.Object](informe cache.SharedIndexInformer) Informer[T] {
return informer[T]{
SharedIndexInformer: informe,
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/interface.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/interface.go
similarity index 100%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/interface.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/interface.go
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/lister.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/lister.go
similarity index 100%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/lister.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/lister.go
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching.go
similarity index 94%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching.go
index ebdb61db889..eebe7694340 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching.go
@@ -20,7 +20,6 @@ import (
"fmt"
v1 "k8s.io/api/admissionregistration/v1"
- "k8s.io/api/admissionregistration/v1beta1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/admission"
@@ -36,7 +35,7 @@ type MatchCriteria interface {
namespace.NamespaceSelectorProvider
object.ObjectSelectorProvider
- GetMatchResources() v1beta1.MatchResources
+ GetMatchResources() v1.MatchResources
}
// Matcher decides if a request matches against matchCriteria
@@ -121,7 +120,7 @@ func (m *Matcher) Matches(attr admission.Attributes, o admission.ObjectInterface
return true, matchResource, matchKind, nil
}
-func matchesResourceRules(namedRules []v1beta1.NamedRuleWithOperations, matchPolicy *v1beta1.MatchPolicyType, attr admission.Attributes, o admission.ObjectInterfaces) (bool, schema.GroupVersionResource, schema.GroupVersionKind, error) {
+func matchesResourceRules(namedRules []v1.NamedRuleWithOperations, matchPolicy *v1.MatchPolicyType, attr admission.Attributes, o admission.ObjectInterfaces) (bool, schema.GroupVersionResource, schema.GroupVersionKind, error) {
matchKind := attr.GetKind()
matchResource := attr.GetResource()
@@ -150,7 +149,7 @@ func matchesResourceRules(namedRules []v1beta1.NamedRuleWithOperations, matchPol
// if match policy is undefined or exact, don't perform fuzzy matching
// note that defaulting to fuzzy matching is set by the API
- if matchPolicy == nil || *matchPolicy == v1beta1.Exact {
+ if matchPolicy == nil || *matchPolicy == v1.Exact {
return false, schema.GroupVersionResource{}, schema.GroupVersionKind{}, nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/accessor.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/accessor.go
new file mode 100644
index 00000000000..97cef091480
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/accessor.go
@@ -0,0 +1,82 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package validating
+
+import (
+ "k8s.io/api/admissionregistration/v1"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/generic"
+)
+
+func NewValidatingAdmissionPolicyAccessor(obj *v1.ValidatingAdmissionPolicy) generic.PolicyAccessor {
+ return &validatingAdmissionPolicyAccessor{
+ ValidatingAdmissionPolicy: obj,
+ }
+}
+
+func NewValidatingAdmissionPolicyBindingAccessor(obj *v1.ValidatingAdmissionPolicyBinding) generic.BindingAccessor {
+ return &validatingAdmissionPolicyBindingAccessor{
+ ValidatingAdmissionPolicyBinding: obj,
+ }
+}
+
+type validatingAdmissionPolicyAccessor struct {
+ *v1.ValidatingAdmissionPolicy
+}
+
+func (v *validatingAdmissionPolicyAccessor) GetNamespace() string {
+ return v.Namespace
+}
+
+func (v *validatingAdmissionPolicyAccessor) GetName() string {
+ return v.Name
+}
+
+func (v *validatingAdmissionPolicyAccessor) GetParamKind() *v1.ParamKind {
+ return v.Spec.ParamKind
+}
+
+func (v *validatingAdmissionPolicyAccessor) GetMatchConstraints() *v1.MatchResources {
+ return v.Spec.MatchConstraints
+}
+
+type validatingAdmissionPolicyBindingAccessor struct {
+ *v1.ValidatingAdmissionPolicyBinding
+}
+
+func (v *validatingAdmissionPolicyBindingAccessor) GetNamespace() string {
+ return v.Namespace
+}
+
+func (v *validatingAdmissionPolicyBindingAccessor) GetName() string {
+ return v.Name
+}
+
+func (v *validatingAdmissionPolicyBindingAccessor) GetPolicyName() types.NamespacedName {
+ return types.NamespacedName{
+ Namespace: "",
+ Name: v.Spec.PolicyName,
+ }
+}
+
+func (v *validatingAdmissionPolicyBindingAccessor) GetMatchResources() *v1.MatchResources {
+ return v.Spec.MatchResources
+}
+
+func (v *validatingAdmissionPolicyBindingAccessor) GetParamRef() *v1.ParamRef {
+ return v.Spec.ParamRef
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/caching_authorizer.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/caching_authorizer.go
similarity index 72%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/caching_authorizer.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/caching_authorizer.go
index a295cb30dc0..ac13dbeee37 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/caching_authorizer.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/caching_authorizer.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
"context"
@@ -22,6 +22,8 @@ import (
"sort"
"strings"
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/labels"
"k8s.io/apiserver/pkg/authentication/user"
"k8s.io/apiserver/pkg/authorization/authorizer"
)
@@ -58,6 +60,8 @@ var _ authorizer.Attributes = (interface {
GetAPIVersion() string
IsResourceRequest() bool
GetPath() string
+ GetFieldSelector() (fields.Requirements, error)
+ GetLabelSelector() (labels.Requirements, error)
})(nil)
// The user info accessors known to cache key construction. If this fails to compile, the cache
@@ -72,16 +76,31 @@ var _ user.Info = (interface {
// Authorize returns an authorization decision by delegating to another Authorizer. If an equivalent
// check has already been performed, a cached result is returned. Not safe for concurrent use.
func (ca *cachingAuthorizer) Authorize(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) {
- serializableAttributes := authorizer.AttributesRecord{
- Verb: a.GetVerb(),
- Namespace: a.GetNamespace(),
- APIGroup: a.GetAPIGroup(),
- APIVersion: a.GetAPIVersion(),
- Resource: a.GetResource(),
- Subresource: a.GetSubresource(),
- Name: a.GetName(),
- ResourceRequest: a.IsResourceRequest(),
- Path: a.GetPath(),
+ type SerializableAttributes struct {
+ authorizer.AttributesRecord
+ LabelSelector string
+ }
+
+ serializableAttributes := SerializableAttributes{
+ AttributesRecord: authorizer.AttributesRecord{
+ Verb: a.GetVerb(),
+ Namespace: a.GetNamespace(),
+ APIGroup: a.GetAPIGroup(),
+ APIVersion: a.GetAPIVersion(),
+ Resource: a.GetResource(),
+ Subresource: a.GetSubresource(),
+ Name: a.GetName(),
+ ResourceRequest: a.IsResourceRequest(),
+ Path: a.GetPath(),
+ },
+ }
+ // in the error case, we won't honor this field selector, so the cache doesn't need it.
+ if fieldSelector, err := a.GetFieldSelector(); len(fieldSelector) > 0 {
+ serializableAttributes.FieldSelectorRequirements, serializableAttributes.FieldSelectorParsingErr = fieldSelector, err
+ }
+ if labelSelector, _ := a.GetLabelSelector(); len(labelSelector) > 0 {
+ // the labels requirements have private elements so those don't help us serialize to a unique key
+ serializableAttributes.LabelSelector = labelSelector.String()
}
if u := a.GetUser(); u != nil {
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/dispatcher.go
similarity index 50%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/dispatcher.go
index 46b76e06d5f..f0601142530 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/dispatcher.go
@@ -14,199 +14,75 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
"context"
"errors"
"fmt"
"strings"
- "sync"
- "sync/atomic"
- "time"
- "k8s.io/api/admissionregistration/v1beta1"
+ admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
v1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
- "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
utiljson "k8s.io/apimachinery/pkg/util/json"
- utilruntime "k8s.io/apimachinery/pkg/util/runtime"
- "k8s.io/apimachinery/pkg/util/sets"
- "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/admission"
- celmetrics "k8s.io/apiserver/pkg/admission/cel"
- "k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic"
- "k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/generic"
+ celmetrics "k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics"
celconfig "k8s.io/apiserver/pkg/apis/cel"
"k8s.io/apiserver/pkg/authorization/authorizer"
"k8s.io/apiserver/pkg/warning"
- "k8s.io/client-go/dynamic"
- "k8s.io/client-go/informers"
- "k8s.io/client-go/kubernetes"
- "k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"
)
-var _ CELPolicyEvaluator = &celAdmissionController{}
-
-// celAdmissionController is the top-level controller for admission control using CEL
-// it is responsible for watching policy definitions, bindings, and config param CRDs
-type celAdmissionController struct {
- // Controller which manages book-keeping for the cluster's dynamic policy
- // information.
- policyController *policyController
-
- // atomic []policyData
- // list of every known policy definition, and all informatoin required to
- // validate its bindings against an object.
- // A snapshot of the current policy configuration is synced with this field
- // asynchronously
- definitions atomic.Value
-
- authz authorizer.Authorizer
+type dispatcher struct {
+ matcher generic.PolicyMatcher
+ authz authorizer.Authorizer
}
-// Everything someone might need to validate a single ValidatingPolicyDefinition
-// against all of its registered bindings.
-type policyData struct {
- definitionInfo
- paramInfo
- bindings []bindingInfo
+var _ generic.Dispatcher[PolicyHook] = &dispatcher{}
+
+func NewDispatcher(
+ authorizer authorizer.Authorizer,
+ matcher generic.PolicyMatcher,
+) generic.Dispatcher[PolicyHook] {
+ return &dispatcher{
+ matcher: matcher,
+ authz: authorizer,
+ }
}
// contains the cel PolicyDecisions along with the ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding
// that determined the decision
type policyDecisionWithMetadata struct {
PolicyDecision
- Definition *v1beta1.ValidatingAdmissionPolicy
- Binding *v1beta1.ValidatingAdmissionPolicyBinding
-}
-
-// namespaceName is used as a key in definitionInfo and bindingInfos
-type namespacedName struct {
- namespace, name string
-}
-
-type definitionInfo struct {
- // Error about the state of the definition's configuration and the cluster
- // preventing its enforcement or compilation.
- // Reset every reconciliation
- configurationError error
-
- // Last value seen by this controller to be used in policy enforcement
- // May not be nil
- lastReconciledValue *v1beta1.ValidatingAdmissionPolicy
+ Definition *admissionregistrationv1.ValidatingAdmissionPolicy
+ Binding *admissionregistrationv1.ValidatingAdmissionPolicyBinding
}
-type bindingInfo struct {
- // Compiled CEL expression turned into an validator
- validator Validator
-
- // Last value seen by this controller to be used in policy enforcement
- // May not be nil
- lastReconciledValue *v1beta1.ValidatingAdmissionPolicyBinding
-}
-
-type paramInfo struct {
- // Controller which is watching this param CRD
- controller generic.Controller[runtime.Object]
-
- // Function to call to stop the informer and clean up the controller
- stop func()
-
- // Whether this param is cluster or namespace scoped
- scope meta.RESTScope
-
- // Policy Definitions which refer to this param CRD
- dependentDefinitions sets.Set[namespacedName]
-}
-
-func NewAdmissionController(
- // Injected Dependencies
- informerFactory informers.SharedInformerFactory,
- client kubernetes.Interface,
- restMapper meta.RESTMapper,
- dynamicClient dynamic.Interface,
- authz authorizer.Authorizer,
-) CELPolicyEvaluator {
- return &celAdmissionController{
- definitions: atomic.Value{},
- policyController: newPolicyController(
- restMapper,
- client,
- dynamicClient,
- informerFactory,
- nil,
- NewMatcher(matching.NewMatcher(informerFactory.Core().V1().Namespaces().Lister(), client)),
- generic.NewInformer[*v1beta1.ValidatingAdmissionPolicy](
- informerFactory.Admissionregistration().V1beta1().ValidatingAdmissionPolicies().Informer()),
- generic.NewInformer[*v1beta1.ValidatingAdmissionPolicyBinding](
- informerFactory.Admissionregistration().V1beta1().ValidatingAdmissionPolicyBindings().Informer()),
- ),
- authz: authz,
- }
-}
-
-func (c *celAdmissionController) Run(stopCh <-chan struct{}) {
- ctx, cancel := context.WithCancel(context.Background())
- wg := sync.WaitGroup{}
-
- wg.Add(1)
- go func() {
- defer wg.Done()
- c.policyController.Run(ctx)
- }()
-
- wg.Add(1)
- go func() {
- defer wg.Done()
-
- // Wait indefinitely until policies/bindings are listed & handled before
- // allowing policies to be refreshed
- if !cache.WaitForNamedCacheSync("cel-admission-controller", ctx.Done(), c.policyController.HasSynced) {
- return
- }
-
- // Loop every 1 second until context is cancelled, refreshing policies
- wait.Until(c.refreshPolicies, 1*time.Second, ctx.Done())
- }()
-
- <-stopCh
- cancel()
- wg.Wait()
-}
-
-const maxAuditAnnotationValueLength = 10 * 1024
-
-func (c *celAdmissionController) Validate(
- ctx context.Context,
- a admission.Attributes,
- o admission.ObjectInterfaces,
-) (err error) {
- if !c.HasSynced() {
- return admission.NewForbidden(a, fmt.Errorf("not yet ready to handle request"))
- }
+// Dispatch implements generic.Dispatcher.
+func (c *dispatcher) Dispatch(ctx context.Context, a admission.Attributes, o admission.ObjectInterfaces, hooks []PolicyHook) error {
var deniedDecisions []policyDecisionWithMetadata
- addConfigError := func(err error, definition *v1beta1.ValidatingAdmissionPolicy, binding *v1beta1.ValidatingAdmissionPolicyBinding) {
+ addConfigError := func(err error, definition *admissionregistrationv1.ValidatingAdmissionPolicy, binding *admissionregistrationv1.ValidatingAdmissionPolicyBinding) {
// we always default the FailurePolicy if it is unset and validate it in API level
- var policy v1beta1.FailurePolicyType
+ var policy admissionregistrationv1.FailurePolicyType
if definition.Spec.FailurePolicy == nil {
- policy = v1beta1.Fail
+ policy = admissionregistrationv1.Fail
} else {
policy = *definition.Spec.FailurePolicy
}
// apply FailurePolicy specified in ValidatingAdmissionPolicy, the default would be Fail
switch policy {
- case v1beta1.Ignore:
+ case admissionregistrationv1.Ignore:
// TODO: add metrics for ignored error here
return
- case v1beta1.Fail:
+ case admissionregistrationv1.Fail:
var message string
if binding == nil {
message = fmt.Errorf("failed to configure policy: %w", err).Error()
@@ -232,19 +108,18 @@ func (c *celAdmissionController) Validate(
})
}
}
- policyDatas := c.definitions.Load().([]policyData)
authz := newCachingAuthorizer(c.authz)
- for _, definitionInfo := range policyDatas {
+ for _, hook := range hooks {
// versionedAttributes will be set to non-nil inside of the loop, but
// is scoped outside of the param loop so we only convert once. We defer
// conversion so that it is only performed when we know a policy matches,
// saving the cost of converting non-matching requests.
var versionedAttr *admission.VersionedAttributes
- definition := definitionInfo.lastReconciledValue
- matches, matchResource, matchKind, err := c.policyController.matcher.DefinitionMatches(a, o, definition)
+ definition := hook.Policy
+ matches, matchResource, matchKind, err := c.matcher.DefinitionMatches(a, o, NewValidatingAdmissionPolicyAccessor(definition))
if err != nil {
// Configuration error.
addConfigError(err, definition, nil)
@@ -253,18 +128,17 @@ func (c *celAdmissionController) Validate(
if !matches {
// Policy definition does not match request
continue
- } else if definitionInfo.configurationError != nil {
+ } else if hook.ConfigurationError != nil {
// Configuration error.
- addConfigError(definitionInfo.configurationError, definition, nil)
+ addConfigError(hook.ConfigurationError, definition, nil)
continue
}
auditAnnotationCollector := newAuditAnnotationCollector()
- for _, bindingInfo := range definitionInfo.bindings {
+ for _, binding := range hook.Bindings {
// If the key is inside dependentBindings, there is guaranteed to
// be a bindingInfo for it
- binding := bindingInfo.lastReconciledValue
- matches, err := c.policyController.matcher.BindingMatches(a, o, binding)
+ matches, err := c.matcher.BindingMatches(a, o, NewValidatingAdmissionPolicyBindingAccessor(binding))
if err != nil {
// Configuration error.
addConfigError(err, definition, binding)
@@ -274,7 +148,14 @@ func (c *celAdmissionController) Validate(
continue
}
- params, err := c.collectParams(definition.Spec.ParamKind, definitionInfo.paramInfo, binding.Spec.ParamRef, a.GetNamespace())
+ params, err := generic.CollectParams(
+ hook.Policy.Spec.ParamKind,
+ hook.ParamInformer,
+ hook.ParamScope,
+ binding.Spec.ParamRef,
+ a.GetNamespace(),
+ )
+
if err != nil {
addConfigError(err, definition, binding)
continue
@@ -303,7 +184,7 @@ func (c *celAdmissionController) Validate(
// if it is cluster scoped, namespaceName will be empty
// Otherwise, get the Namespace resource.
if namespaceName != "" {
- namespace, err = c.policyController.matcher.GetNamespace(namespaceName)
+ namespace, err = c.matcher.GetNamespace(namespaceName)
if err != nil {
return err
}
@@ -323,7 +204,18 @@ func (c *celAdmissionController) Validate(
nested: param,
}
}
- validationResults = append(validationResults, bindingInfo.validator.Validate(ctx, matchResource, versionedAttr, p, namespace, celconfig.RuntimeCELCostBudget, authz))
+
+ validationResults = append(validationResults,
+ hook.Evaluator.Validate(
+ ctx,
+ matchResource,
+ versionedAttr,
+ p,
+ namespace,
+ celconfig.RuntimeCELCostBudget,
+ authz,
+ ),
+ )
}
for _, validationResult := range validationResults {
@@ -331,24 +223,24 @@ func (c *celAdmissionController) Validate(
switch decision.Action {
case ActionAdmit:
if decision.Evaluation == EvalError {
- celmetrics.Metrics.ObserveAdmissionWithError(ctx, decision.Elapsed, definition.Name, binding.Name, "active")
+ celmetrics.Metrics.ObserveAdmission(ctx, decision.Elapsed, definition.Name, binding.Name, ErrorType(&decision))
}
case ActionDeny:
for _, action := range binding.Spec.ValidationActions {
switch action {
- case v1beta1.Deny:
+ case admissionregistrationv1.Deny:
deniedDecisions = append(deniedDecisions, policyDecisionWithMetadata{
Definition: definition,
Binding: binding,
PolicyDecision: decision,
})
- celmetrics.Metrics.ObserveRejection(ctx, decision.Elapsed, definition.Name, binding.Name, "active")
- case v1beta1.Audit:
- c.publishValidationFailureAnnotation(binding, i, decision, versionedAttr)
- celmetrics.Metrics.ObserveAudit(ctx, decision.Elapsed, definition.Name, binding.Name, "active")
- case v1beta1.Warn:
+ celmetrics.Metrics.ObserveRejection(ctx, decision.Elapsed, definition.Name, binding.Name, ErrorType(&decision))
+ case admissionregistrationv1.Audit:
+ publishValidationFailureAnnotation(binding, i, decision, versionedAttr)
+ celmetrics.Metrics.ObserveAudit(ctx, decision.Elapsed, definition.Name, binding.Name, ErrorType(&decision))
+ case admissionregistrationv1.Warn:
warning.AddWarning(ctx, "", fmt.Sprintf("Validation failed for ValidatingAdmissionPolicy '%s' with binding '%s': %s", definition.Name, binding.Name, decision.Message))
- celmetrics.Metrics.ObserveWarn(ctx, decision.Elapsed, definition.Name, binding.Name, "active")
+ celmetrics.Metrics.ObserveWarn(ctx, decision.Elapsed, definition.Name, binding.Name, ErrorType(&decision))
}
}
default:
@@ -367,7 +259,7 @@ func (c *celAdmissionController) Validate(
auditAnnotationCollector.add(auditAnnotation.Key, value)
case AuditAnnotationActionError:
// When failurePolicy=fail, audit annotation errors result in deny
- deniedDecisions = append(deniedDecisions, policyDecisionWithMetadata{
+ d := policyDecisionWithMetadata{
Definition: definition,
Binding: binding,
PolicyDecision: PolicyDecision{
@@ -376,8 +268,9 @@ func (c *celAdmissionController) Validate(
Message: auditAnnotation.Error,
Elapsed: auditAnnotation.Elapsed,
},
- })
- celmetrics.Metrics.ObserveRejection(ctx, auditAnnotation.Elapsed, definition.Name, binding.Name, "active")
+ }
+ deniedDecisions = append(deniedDecisions, d)
+ celmetrics.Metrics.ObserveRejection(ctx, auditAnnotation.Elapsed, definition.Name, binding.Name, ErrorType(&d.PolicyDecision))
case AuditAnnotationActionExclude: // skip it
default:
return fmt.Errorf("unsupported AuditAnnotation Action: %s", auditAnnotation.Action)
@@ -410,127 +303,10 @@ func (c *celAdmissionController) Validate(
return nil
}
-// Returns objects to use to evaluate the policy
-func (c *celAdmissionController) collectParams(
- paramKind *v1beta1.ParamKind,
- info paramInfo,
- paramRef *v1beta1.ParamRef,
- namespace string,
-) ([]runtime.Object, error) {
- // If definition has paramKind, paramRef is required in binding.
- // If definition has no paramKind, paramRef set in binding will be ignored.
- var params []runtime.Object
- var paramStore generic.NamespacedLister[runtime.Object]
-
- // Make sure the param kind is ready to use
- if paramKind != nil && paramRef != nil {
- if info.controller == nil {
- return nil, fmt.Errorf("paramKind kind `%v` not known",
- paramKind.String())
- }
-
- // Set up cluster-scoped, or namespaced access to the params
- // "default" if not provided, and paramKind is namespaced
- paramStore = info.controller.Informer()
- if info.scope.Name() == meta.RESTScopeNameNamespace {
- paramsNamespace := namespace
- if len(paramRef.Namespace) > 0 {
- paramsNamespace = paramRef.Namespace
- } else if len(paramsNamespace) == 0 {
- // You must supply namespace if your matcher can possibly
- // match a cluster-scoped resource
- return nil, fmt.Errorf("cannot use namespaced paramRef in policy binding that matches cluster-scoped resources")
- }
-
- paramStore = info.controller.Informer().Namespaced(paramsNamespace)
- }
-
- // If the param informer for this admission policy has not yet
- // had time to perform an initial listing, don't attempt to use
- // it.
- timeoutCtx, cancel := context.WithTimeout(c.policyController.context, 1*time.Second)
- defer cancel()
-
- if !cache.WaitForCacheSync(timeoutCtx.Done(), info.controller.HasSynced) {
- return nil, fmt.Errorf("paramKind kind `%v` not yet synced to use for admission",
- paramKind.String())
- }
- }
-
- // Find params to use with policy
- switch {
- case paramKind == nil:
- // ParamKind is unset. Ignore any globalParamRef or namespaceParamRef
- // setting.
- return []runtime.Object{nil}, nil
- case paramRef == nil:
- // Policy ParamKind is set, but binding does not use it.
- // Validate with nil params
- return []runtime.Object{nil}, nil
- case len(paramRef.Namespace) > 0 && info.scope.Name() == meta.RESTScopeRoot.Name():
- // Not allowed to set namespace for cluster-scoped param
- return nil, fmt.Errorf("paramRef.namespace must not be provided for a cluster-scoped `paramKind`")
-
- case len(paramRef.Name) > 0:
- if paramRef.Selector != nil {
- // This should be validated, but just in case.
- return nil, fmt.Errorf("paramRef.name and paramRef.selector are mutually exclusive")
- }
-
- switch param, err := paramStore.Get(paramRef.Name); {
- case err == nil:
- params = []runtime.Object{param}
- case k8serrors.IsNotFound(err):
- // Param not yet available. User may need to wait a bit
- // before being able to use it for validation.
- //
- // Set params to nil to prepare for not found action
- params = nil
- case k8serrors.IsInvalid(err):
- // Param mis-configured
- // require to set namespace for namespaced resource
- // and unset namespace for cluster scoped resource
- return nil, err
- default:
- // Internal error
- utilruntime.HandleError(err)
- return nil, err
- }
- case paramRef.Selector != nil:
- // Select everything by default if empty name and selector
- selector, err := metav1.LabelSelectorAsSelector(paramRef.Selector)
- if err != nil {
- // Cannot parse label selector: configuration error
- return nil, err
-
- }
-
- paramList, err := paramStore.List(selector)
- if err != nil {
- // There was a bad internal error
- utilruntime.HandleError(err)
- return nil, err
- }
-
- // Successfully grabbed params
- params = paramList
- default:
- // Should be unreachable due to validation
- return nil, fmt.Errorf("one of name or selector must be provided")
- }
-
- // Apply fail action for params not found case
- if len(params) == 0 && paramRef.ParameterNotFoundAction != nil && *paramRef.ParameterNotFoundAction == v1beta1.DenyAction {
- return nil, errors.New("no params found for policy binding with `Deny` parameterNotFoundAction")
- }
-
- return params, nil
-}
-
-func (c *celAdmissionController) publishValidationFailureAnnotation(binding *v1beta1.ValidatingAdmissionPolicyBinding, expressionIndex int, decision PolicyDecision, attributes admission.Attributes) {
+func publishValidationFailureAnnotation(binding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, expressionIndex int, decision PolicyDecision, attributes admission.Attributes) {
key := "validation.policy.admission.k8s.io/validation_failure"
// Marshal to a list of failures since, in the future, we may need to support multiple failures
- valueJson, err := utiljson.Marshal([]validationFailureValue{{
+ valueJSON, err := utiljson.Marshal([]ValidationFailureValue{{
ExpressionIndex: expressionIndex,
Message: decision.Message,
ValidationActions: binding.Spec.ValidationActions,
@@ -540,32 +316,22 @@ func (c *celAdmissionController) publishValidationFailureAnnotation(binding *v1b
if err != nil {
klog.Warningf("Failed to set admission audit annotation %s for ValidatingAdmissionPolicy %s and ValidatingAdmissionPolicyBinding %s: %v", key, binding.Spec.PolicyName, binding.Name, err)
}
- value := string(valueJson)
+ value := string(valueJSON)
if err := attributes.AddAnnotation(key, value); err != nil {
klog.Warningf("Failed to set admission audit annotation %s to %s for ValidatingAdmissionPolicy %s and ValidatingAdmissionPolicyBinding %s: %v", key, value, binding.Spec.PolicyName, binding.Name, err)
}
}
-func (c *celAdmissionController) HasSynced() bool {
- return c.policyController.HasSynced() && c.definitions.Load() != nil
-}
-
-func (c *celAdmissionController) ValidateInitialization() error {
- return c.policyController.matcher.ValidateInitialization()
-}
-
-func (c *celAdmissionController) refreshPolicies() {
- c.definitions.Store(c.policyController.latestPolicyData())
-}
+const maxAuditAnnotationValueLength = 10 * 1024
// validationFailureValue defines the JSON format of a "validation.policy.admission.k8s.io/validation_failure" audit
// annotation value.
-type validationFailureValue struct {
- Message string `json:"message"`
- Policy string `json:"policy"`
- Binding string `json:"binding"`
- ExpressionIndex int `json:"expressionIndex"`
- ValidationActions []v1beta1.ValidationAction `json:"validationActions"`
+type ValidationFailureValue struct {
+ Message string `json:"message"`
+ Policy string `json:"policy"`
+ Binding string `json:"binding"`
+ ExpressionIndex int `json:"expressionIndex"`
+ ValidationActions []admissionregistrationv1.ValidationAction `json:"validationActions"`
}
type auditAnnotationCollector struct {
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/errors.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/errors.go
new file mode 100644
index 00000000000..0fcf40ff0d4
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/errors.go
@@ -0,0 +1,38 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package validating
+
+import (
+ "strings"
+
+ celmetrics "k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics"
+)
+
+// ErrorType decodes the error to determine the error type
+// that the metrics understand.
+func ErrorType(decision *PolicyDecision) celmetrics.ValidationErrorType {
+ if decision.Evaluation == EvalAdmit {
+ return celmetrics.ValidationNoError
+ }
+ if strings.HasPrefix(decision.Message, "compilation") {
+ return celmetrics.ValidationCompileError
+ }
+ if strings.HasPrefix(decision.Message, "validation failed due to running out of cost budget") {
+ return celmetrics.ValidatingOutOfBudget
+ }
+ return celmetrics.ValidatingInvalidError
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/initializer.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/initializer.go
similarity index 96%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/initializer.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/initializer.go
index 15b75798585..c7cb9c657ee 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/initializer.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/initializer.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
"context"
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/interface.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/interface.go
similarity index 75%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/interface.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/interface.go
index 206fc137831..97eeb95504a 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/interface.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/interface.go
@@ -14,14 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
"context"
celgo "github.com/google/cel-go/cel"
- "k8s.io/api/admissionregistration/v1beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -80,23 +79,6 @@ func (v *Variable) GetName() string {
return v.Name
}
-// Matcher is used for matching ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding to attributes
-type Matcher interface {
- admission.InitializationValidator
-
- // DefinitionMatches says whether this policy definition matches the provided admission
- // resource request
- DefinitionMatches(a admission.Attributes, o admission.ObjectInterfaces, definition *v1beta1.ValidatingAdmissionPolicy) (bool, schema.GroupVersionResource, schema.GroupVersionKind, error)
-
- // BindingMatches says whether this policy definition matches the provided admission
- // resource request
- BindingMatches(a admission.Attributes, o admission.ObjectInterfaces, definition *v1beta1.ValidatingAdmissionPolicyBinding) (bool, error)
-
- // GetNamespace retrieves the Namespace resource by the given name. The name may be empty, in which case
- // GetNamespace must return nil, nil
- GetNamespace(name string) (*corev1.Namespace, error)
-}
-
// ValidateResult defines the result of a Validator.Validate operation.
type ValidateResult struct {
// Decisions specifies the outcome of the validation as well as the details about the decision.
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/message.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/message.go
similarity index 96%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/message.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/message.go
index 772891e3c8b..8b7d973617d 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/message.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/message.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
celgo "github.com/google/cel-go/cel"
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/errors.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/errors.go
new file mode 100644
index 00000000000..4327252610a
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/errors.go
@@ -0,0 +1,38 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package cel
+
+import (
+ "errors"
+
+ apiservercel "k8s.io/apiserver/pkg/cel"
+)
+
+// ErrorType decodes the error to determine the error type
+// that the metrics understand.
+func ErrorType(err error) ValidationErrorType {
+ if err == nil {
+ return ValidationNoError
+ }
+ if errors.Is(err, apiservercel.ErrCompilation) {
+ return ValidationCompileError
+ }
+ if errors.Is(err, apiservercel.ErrOutOfBudget) {
+ return ValidatingOutOfBudget
+ }
+ return ValidatingInvalidError
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/cel/metrics.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/metrics.go
similarity index 62%
rename from vendor/k8s.io/apiserver/pkg/admission/cel/metrics.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/metrics.go
index 9f8a941105a..92c8ee2b85a 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/cel/metrics.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/metrics.go
@@ -29,6 +29,22 @@ const (
metricsSubsystem = "validating_admission_policy"
)
+// ValidationErrorType defines different error types that happen to a validation expression
+type ValidationErrorType string
+
+const (
+ // ValidationCompileError indicates that the expression fails to compile.
+ ValidationCompileError ValidationErrorType = "compile_error"
+ // ValidatingInvalidError indicates that the expression fails due to internal
+ // errors that are out of the control of the user.
+ ValidatingInvalidError ValidationErrorType = "invalid_error"
+ // ValidatingOutOfBudget indicates that the expression fails due to running
+ // out of cost budget, or the budget cannot be obtained.
+ ValidatingOutOfBudget ValidationErrorType = "out_of_budget"
+ // ValidationNoError indicates that the expression returns without an error.
+ ValidationNoError ValidationErrorType = "no_error"
+)
+
var (
// Metrics provides access to validation admission metrics.
Metrics = newValidationAdmissionMetrics()
@@ -36,9 +52,8 @@ var (
// ValidatingAdmissionPolicyMetrics aggregates Prometheus metrics related to validation admission control.
type ValidatingAdmissionPolicyMetrics struct {
- policyCheck *metrics.CounterVec
- policyDefinition *metrics.CounterVec
- policyLatency *metrics.HistogramVec
+ policyCheck *metrics.CounterVec
+ policyLatency *metrics.HistogramVec
}
func newValidationAdmissionMetrics() *ValidatingAdmissionPolicyMetrics {
@@ -47,25 +62,16 @@ func newValidationAdmissionMetrics() *ValidatingAdmissionPolicyMetrics {
Namespace: metricsNamespace,
Subsystem: metricsSubsystem,
Name: "check_total",
- Help: "Validation admission policy check total, labeled by policy and further identified by binding, enforcement action taken, and state.",
- StabilityLevel: metrics.ALPHA,
+ Help: "Validation admission policy check total, labeled by policy and further identified by binding and enforcement action taken.",
+ StabilityLevel: metrics.BETA,
},
- []string{"policy", "policy_binding", "enforcement_action", "state"},
- )
- definition := metrics.NewCounterVec(&metrics.CounterOpts{
- Namespace: metricsNamespace,
- Subsystem: metricsSubsystem,
- Name: "definition_total",
- Help: "Validation admission policy count total, labeled by state and enforcement action.",
- StabilityLevel: metrics.ALPHA,
- },
- []string{"state", "enforcement_action"},
+ []string{"policy", "policy_binding", "error_type", "enforcement_action"},
)
latency := metrics.NewHistogramVec(&metrics.HistogramOpts{
Namespace: metricsNamespace,
Subsystem: metricsSubsystem,
Name: "check_duration_seconds",
- Help: "Validation admission latency for individual validation expressions in seconds, labeled by policy and further including binding, state and enforcement action taken.",
+ Help: "Validation admission latency for individual validation expressions in seconds, labeled by policy and further including binding and enforcement action taken.",
// the bucket distribution here is based oo the benchmark suite at
// github.com/DangerOnTheRanger/cel-benchmark performed on 16-core Intel Xeon
// the lowest bucket was based around the 180ns/op figure for BenchmarkAccess,
@@ -75,49 +81,42 @@ func newValidationAdmissionMetrics() *ValidatingAdmissionPolicyMetrics {
// around 760ms, so that bucket should only ever have the slowest CEL expressions
// in it
Buckets: []float64{0.0000005, 0.001, 0.01, 0.1, 1.0},
- StabilityLevel: metrics.ALPHA,
+ StabilityLevel: metrics.BETA,
},
- []string{"policy", "policy_binding", "enforcement_action", "state"},
+ []string{"policy", "policy_binding", "error_type", "enforcement_action"},
)
legacyregistry.MustRegister(check)
- legacyregistry.MustRegister(definition)
legacyregistry.MustRegister(latency)
- return &ValidatingAdmissionPolicyMetrics{policyCheck: check, policyDefinition: definition, policyLatency: latency}
+ return &ValidatingAdmissionPolicyMetrics{policyCheck: check, policyLatency: latency}
}
// Reset resets all validation admission-related Prometheus metrics.
func (m *ValidatingAdmissionPolicyMetrics) Reset() {
m.policyCheck.Reset()
- m.policyDefinition.Reset()
m.policyLatency.Reset()
}
-// ObserveDefinition observes a policy definition.
-func (m *ValidatingAdmissionPolicyMetrics) ObserveDefinition(ctx context.Context, state, enforcementAction string) {
- m.policyDefinition.WithContext(ctx).WithLabelValues(state, enforcementAction).Inc()
-}
-
-// ObserveAdmissionWithError observes a policy validation error that was ignored due to failure policy.
-func (m *ValidatingAdmissionPolicyMetrics) ObserveAdmissionWithError(ctx context.Context, elapsed time.Duration, policy, binding, state string) {
- m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, "allow", state).Inc()
- m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, "allow", state).Observe(elapsed.Seconds())
+// ObserveAdmission observes a policy validation, with an optional error to indicate the error that may occur but ignored.
+func (m *ValidatingAdmissionPolicyMetrics) ObserveAdmission(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType) {
+ m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "allow").Inc()
+ m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "allow").Observe(elapsed.Seconds())
}
// ObserveRejection observes a policy validation error that was at least one of the reasons for a deny.
-func (m *ValidatingAdmissionPolicyMetrics) ObserveRejection(ctx context.Context, elapsed time.Duration, policy, binding, state string) {
- m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, "deny", state).Inc()
- m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, "deny", state).Observe(elapsed.Seconds())
+func (m *ValidatingAdmissionPolicyMetrics) ObserveRejection(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType) {
+ m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "deny").Inc()
+ m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "deny").Observe(elapsed.Seconds())
}
// ObserveAudit observes a policy validation audit annotation was published for a validation failure.
-func (m *ValidatingAdmissionPolicyMetrics) ObserveAudit(ctx context.Context, elapsed time.Duration, policy, binding, state string) {
- m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, "audit", state).Inc()
- m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, "audit", state).Observe(elapsed.Seconds())
+func (m *ValidatingAdmissionPolicyMetrics) ObserveAudit(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType) {
+ m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "audit").Inc()
+ m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "audit").Observe(elapsed.Seconds())
}
// ObserveWarn observes a policy validation warning was published for a validation failure.
-func (m *ValidatingAdmissionPolicyMetrics) ObserveWarn(ctx context.Context, elapsed time.Duration, policy, binding, state string) {
- m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, "warn", state).Inc()
- m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, "warn", state).Observe(elapsed.Seconds())
+func (m *ValidatingAdmissionPolicyMetrics) ObserveWarn(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType) {
+ m.policyCheck.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "warn").Inc()
+ m.policyLatency.WithContext(ctx).WithLabelValues(policy, binding, string(errorType), "warn").Observe(elapsed.Seconds())
}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/plugin.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/plugin.go
new file mode 100644
index 00000000000..06f4a8c7145
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/plugin.go
@@ -0,0 +1,215 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package validating
+
+import (
+ "context"
+ "io"
+ "sync"
+
+ v1 "k8s.io/api/admissionregistration/v1"
+ "k8s.io/apimachinery/pkg/api/meta"
+ "k8s.io/apiserver/pkg/admission"
+ "k8s.io/apiserver/pkg/admission/initializer"
+ "k8s.io/apiserver/pkg/admission/plugin/cel"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/generic"
+ "k8s.io/apiserver/pkg/admission/plugin/policy/matching"
+ "k8s.io/apiserver/pkg/admission/plugin/webhook/matchconditions"
+ "k8s.io/apiserver/pkg/authorization/authorizer"
+ "k8s.io/apiserver/pkg/cel/environment"
+ "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
+ "k8s.io/client-go/dynamic"
+ "k8s.io/client-go/informers"
+ "k8s.io/client-go/kubernetes"
+ "k8s.io/component-base/featuregate"
+)
+
+const (
+ // PluginName indicates the name of admission plug-in
+ PluginName = "ValidatingAdmissionPolicy"
+)
+
+var (
+ lazyCompositionEnvTemplateWithStrictCostInit sync.Once
+ lazyCompositionEnvTemplateWithStrictCost *cel.CompositionEnv
+
+ lazyCompositionEnvTemplateWithoutStrictCostInit sync.Once
+ lazyCompositionEnvTemplateWithoutStrictCost *cel.CompositionEnv
+)
+
+func getCompositionEnvTemplateWithStrictCost() *cel.CompositionEnv {
+ lazyCompositionEnvTemplateWithStrictCostInit.Do(func() {
+ env, err := cel.NewCompositionEnv(cel.VariablesTypeName, environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true))
+ if err != nil {
+ panic(err)
+ }
+ lazyCompositionEnvTemplateWithStrictCost = env
+ })
+ return lazyCompositionEnvTemplateWithStrictCost
+}
+
+func getCompositionEnvTemplateWithoutStrictCost() *cel.CompositionEnv {
+ lazyCompositionEnvTemplateWithoutStrictCostInit.Do(func() {
+ env, err := cel.NewCompositionEnv(cel.VariablesTypeName, environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), false))
+ if err != nil {
+ panic(err)
+ }
+ lazyCompositionEnvTemplateWithoutStrictCost = env
+ })
+ return lazyCompositionEnvTemplateWithoutStrictCost
+}
+
+// Register registers a plugin
+func Register(plugins *admission.Plugins) {
+ plugins.Register(PluginName, func(configFile io.Reader) (admission.Interface, error) {
+ return NewPlugin(configFile), nil
+ })
+}
+
+// Plugin is an implementation of admission.Interface.
+type Policy = v1.ValidatingAdmissionPolicy
+type PolicyBinding = v1.ValidatingAdmissionPolicyBinding
+type PolicyEvaluator = Validator
+type PolicyHook = generic.PolicyHook[*Policy, *PolicyBinding, PolicyEvaluator]
+
+type Plugin struct {
+ *generic.Plugin[PolicyHook]
+}
+
+var _ admission.Interface = &Plugin{}
+var _ admission.ValidationInterface = &Plugin{}
+var _ initializer.WantsFeatures = &Plugin{}
+var _ initializer.WantsExcludedAdmissionResources = &Plugin{}
+
+func NewPlugin(_ io.Reader) *Plugin {
+ handler := admission.NewHandler(admission.Connect, admission.Create, admission.Delete, admission.Update)
+
+ return &Plugin{
+ Plugin: generic.NewPlugin(
+ handler,
+ func(f informers.SharedInformerFactory, client kubernetes.Interface, dynamicClient dynamic.Interface, restMapper meta.RESTMapper) generic.Source[PolicyHook] {
+ return generic.NewPolicySource(
+ f.Admissionregistration().V1().ValidatingAdmissionPolicies().Informer(),
+ f.Admissionregistration().V1().ValidatingAdmissionPolicyBindings().Informer(),
+ NewValidatingAdmissionPolicyAccessor,
+ NewValidatingAdmissionPolicyBindingAccessor,
+ compilePolicy,
+ f,
+ dynamicClient,
+ restMapper,
+ )
+ },
+ func(a authorizer.Authorizer, m *matching.Matcher) generic.Dispatcher[PolicyHook] {
+ return NewDispatcher(a, generic.NewPolicyMatcher(m))
+ },
+ ),
+ }
+}
+
+// Validate makes an admission decision based on the request attributes.
+func (a *Plugin) Validate(ctx context.Context, attr admission.Attributes, o admission.ObjectInterfaces) error {
+ return a.Plugin.Dispatch(ctx, attr, o)
+}
+
+func (a *Plugin) InspectFeatureGates(featureGates featuregate.FeatureGate) {
+ a.Plugin.SetEnabled(featureGates.Enabled(features.ValidatingAdmissionPolicy))
+}
+
+func compilePolicy(policy *Policy) Validator {
+ hasParam := false
+ if policy.Spec.ParamKind != nil {
+ hasParam = true
+ }
+ strictCost := utilfeature.DefaultFeatureGate.Enabled(features.StrictCostEnforcementForVAP)
+ optionalVars := cel.OptionalVariableDeclarations{HasParams: hasParam, HasAuthorizer: true, StrictCost: strictCost}
+ expressionOptionalVars := cel.OptionalVariableDeclarations{HasParams: hasParam, HasAuthorizer: false, StrictCost: strictCost}
+ failurePolicy := policy.Spec.FailurePolicy
+ var matcher matchconditions.Matcher = nil
+ matchConditions := policy.Spec.MatchConditions
+ var compositionEnvTemplate *cel.CompositionEnv
+ if strictCost {
+ compositionEnvTemplate = getCompositionEnvTemplateWithStrictCost()
+ } else {
+ compositionEnvTemplate = getCompositionEnvTemplateWithoutStrictCost()
+ }
+ filterCompiler := cel.NewCompositedCompilerFromTemplate(compositionEnvTemplate)
+ filterCompiler.CompileAndStoreVariables(convertv1beta1Variables(policy.Spec.Variables), optionalVars, environment.StoredExpressions)
+
+ if len(matchConditions) > 0 {
+ matchExpressionAccessors := make([]cel.ExpressionAccessor, len(matchConditions))
+ for i := range matchConditions {
+ matchExpressionAccessors[i] = (*matchconditions.MatchCondition)(&matchConditions[i])
+ }
+ matcher = matchconditions.NewMatcher(filterCompiler.Compile(matchExpressionAccessors, optionalVars, environment.StoredExpressions), failurePolicy, "policy", "validate", policy.Name)
+ }
+ res := NewValidator(
+ filterCompiler.Compile(convertv1Validations(policy.Spec.Validations), optionalVars, environment.StoredExpressions),
+ matcher,
+ filterCompiler.Compile(convertv1AuditAnnotations(policy.Spec.AuditAnnotations), optionalVars, environment.StoredExpressions),
+ filterCompiler.Compile(convertv1MessageExpressions(policy.Spec.Validations), expressionOptionalVars, environment.StoredExpressions),
+ failurePolicy,
+ )
+
+ return res
+}
+
+func convertv1Validations(inputValidations []v1.Validation) []cel.ExpressionAccessor {
+ celExpressionAccessor := make([]cel.ExpressionAccessor, len(inputValidations))
+ for i, validation := range inputValidations {
+ validation := ValidationCondition{
+ Expression: validation.Expression,
+ Message: validation.Message,
+ Reason: validation.Reason,
+ }
+ celExpressionAccessor[i] = &validation
+ }
+ return celExpressionAccessor
+}
+
+func convertv1MessageExpressions(inputValidations []v1.Validation) []cel.ExpressionAccessor {
+ celExpressionAccessor := make([]cel.ExpressionAccessor, len(inputValidations))
+ for i, validation := range inputValidations {
+ if validation.MessageExpression != "" {
+ condition := MessageExpressionCondition{
+ MessageExpression: validation.MessageExpression,
+ }
+ celExpressionAccessor[i] = &condition
+ }
+ }
+ return celExpressionAccessor
+}
+
+func convertv1AuditAnnotations(inputValidations []v1.AuditAnnotation) []cel.ExpressionAccessor {
+ celExpressionAccessor := make([]cel.ExpressionAccessor, len(inputValidations))
+ for i, validation := range inputValidations {
+ validation := AuditAnnotationCondition{
+ Key: validation.Key,
+ ValueExpression: validation.ValueExpression,
+ }
+ celExpressionAccessor[i] = &validation
+ }
+ return celExpressionAccessor
+}
+
+func convertv1beta1Variables(variables []v1.Variable) []cel.NamedExpressionAccessor {
+ namedExpressions := make([]cel.NamedExpressionAccessor, len(variables))
+ for i, variable := range variables {
+ namedExpressions[i] = &Variable{Name: variable.Name, Expression: variable.Expression}
+ }
+ return namedExpressions
+}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/policy_decision.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/policy_decision.go
similarity index 98%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/policy_decision.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/policy_decision.go
index 939cbea70c0..3ea17038a39 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/policy_decision.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/policy_decision.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
"net/http"
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/typechecking.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/typechecking.go
similarity index 73%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/typechecking.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/typechecking.go
index 86c8479c3a4..192be9621bd 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/typechecking.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/typechecking.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
"errors"
@@ -25,9 +25,10 @@ import (
"github.com/google/cel-go/cel"
- "k8s.io/api/admissionregistration/v1beta1"
+ "k8s.io/api/admissionregistration/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime/schema"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/apimachinery/pkg/util/version"
@@ -38,6 +39,8 @@ import (
"k8s.io/apiserver/pkg/cel/library"
"k8s.io/apiserver/pkg/cel/openapi"
"k8s.io/apiserver/pkg/cel/openapi/resolver"
+ "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/klog/v2"
)
@@ -55,6 +58,8 @@ type TypeCheckingContext struct {
declTypes []*apiservercel.DeclType
paramGVK schema.GroupVersionKind
paramDeclType *apiservercel.DeclType
+
+ variables []v1.Variable
}
type typeOverwrite struct {
@@ -68,7 +73,7 @@ type TypeCheckingResult struct {
// GVK is the associated GVK
GVK schema.GroupVersionKind
// Issues contain machine-readable information about the typechecking result.
- Issues *cel.Issues
+ Issues error
// Err is the possible error that was encounter during type checking.
Err error
}
@@ -102,18 +107,18 @@ func (r *TypeCheckingResult) String() string {
// as []ExpressionWarning that is ready to be set in policy.Status
// The result is nil if type checking returns no warning.
// The policy object is NOT mutated. The caller should update Status accordingly
-func (c *TypeChecker) Check(policy *v1beta1.ValidatingAdmissionPolicy) []v1beta1.ExpressionWarning {
+func (c *TypeChecker) Check(policy *v1.ValidatingAdmissionPolicy) []v1.ExpressionWarning {
ctx := c.CreateContext(policy)
// warnings to return, note that the capacity is optimistically set to zero
- var warnings []v1beta1.ExpressionWarning // intentionally not setting capacity
+ var warnings []v1.ExpressionWarning // intentionally not setting capacity
// check main validation expressions and their message expressions, located in spec.validations[*]
fieldRef := field.NewPath("spec", "validations")
for i, v := range policy.Spec.Validations {
results := c.CheckExpression(ctx, v.Expression)
if len(results) != 0 {
- warnings = append(warnings, v1beta1.ExpressionWarning{
+ warnings = append(warnings, v1.ExpressionWarning{
FieldRef: fieldRef.Index(i).Child("expression").String(),
Warning: results.String(),
})
@@ -124,7 +129,7 @@ func (c *TypeChecker) Check(policy *v1beta1.ValidatingAdmissionPolicy) []v1beta1
}
results = c.CheckExpression(ctx, v.MessageExpression)
if len(results) != 0 {
- warnings = append(warnings, v1beta1.ExpressionWarning{
+ warnings = append(warnings, v1.ExpressionWarning{
FieldRef: fieldRef.Index(i).Child("messageExpression").String(),
Warning: results.String(),
})
@@ -135,7 +140,7 @@ func (c *TypeChecker) Check(policy *v1beta1.ValidatingAdmissionPolicy) []v1beta1
}
// CreateContext resolves all types and their schemas from a policy definition and creates the context.
-func (c *TypeChecker) CreateContext(policy *v1beta1.ValidatingAdmissionPolicy) *TypeCheckingContext {
+func (c *TypeChecker) CreateContext(policy *v1.ValidatingAdmissionPolicy) *TypeCheckingContext {
ctx := new(TypeCheckingContext)
allGvks := c.typesToCheck(policy)
gvks := make([]schema.GroupVersionKind, 0, len(allGvks))
@@ -168,26 +173,71 @@ func (c *TypeChecker) CreateContext(policy *v1beta1.ValidatingAdmissionPolicy) *
}
ctx.paramGVK = paramsGVK
ctx.paramDeclType = paramsDeclType
+ ctx.variables = policy.Spec.Variables
return ctx
}
+func (c *TypeChecker) compiler(ctx *TypeCheckingContext, typeOverwrite typeOverwrite) (*plugincel.CompositedCompiler, error) {
+ envSet, err := buildEnvSet(
+ /* hasParams */ ctx.paramDeclType != nil,
+ /* hasAuthorizer */ true,
+ typeOverwrite)
+ if err != nil {
+ return nil, err
+ }
+ env, err := plugincel.NewCompositionEnv(plugincel.VariablesTypeName, envSet)
+ if err != nil {
+ return nil, err
+ }
+ compiler := &plugincel.CompositedCompiler{
+ Compiler: &typeCheckingCompiler{typeOverwrite: typeOverwrite, compositionEnv: env},
+ CompositionEnv: env,
+ }
+ return compiler, nil
+}
+
// CheckExpression type checks a single expression, given the context
func (c *TypeChecker) CheckExpression(ctx *TypeCheckingContext, expression string) TypeCheckingResults {
var results TypeCheckingResults
for i, gvk := range ctx.gvks {
declType := ctx.declTypes[i]
- // TODO(jiahuif) hasAuthorizer always true for now, will change after expending type checking to all fields.
- issues, err := c.checkExpression(expression, ctx.paramDeclType != nil, true, typeOverwrite{
+ compiler, err := c.compiler(ctx, typeOverwrite{
object: declType,
params: ctx.paramDeclType,
})
- if issues != nil || err != nil {
- results = append(results, &TypeCheckingResult{Issues: issues, Err: err, GVK: gvk})
+ if err != nil {
+ utilruntime.HandleError(err)
+ continue
+ }
+ options := plugincel.OptionalVariableDeclarations{
+ HasParams: ctx.paramDeclType != nil,
+ HasAuthorizer: true,
+ StrictCost: utilfeature.DefaultFeatureGate.Enabled(features.StrictCostEnforcementForVAP),
+ }
+ compiler.CompileAndStoreVariables(convertv1beta1Variables(ctx.variables), options, environment.StoredExpressions)
+ result := compiler.CompileCELExpression(celExpression(expression), options, environment.StoredExpressions)
+ if err := result.Error; err != nil {
+ typeCheckingResult := &TypeCheckingResult{GVK: gvk}
+ if err.Type == apiservercel.ErrorTypeInvalid {
+ typeCheckingResult.Issues = err
+ } else {
+ typeCheckingResult.Err = err
+ }
+ results = append(results, typeCheckingResult)
}
}
return results
}
+type celExpression string
+
+func (c celExpression) GetExpression() string {
+ return string(c)
+}
+
+func (c celExpression) ReturnTypes() []*cel.Type {
+ return []*cel.Type{cel.AnyType}
+}
func generateUniqueTypeName(kind string) string {
return fmt.Sprintf("%s%d", kind, time.Now().Nanosecond())
}
@@ -203,7 +253,7 @@ func (c *TypeChecker) declType(gvk schema.GroupVersionKind) (*apiservercel.DeclT
return common.SchemaDeclType(&openapi.Schema{Schema: s}, true).MaybeAssignTypeName(generateUniqueTypeName(gvk.Kind)), nil
}
-func (c *TypeChecker) paramsGVK(policy *v1beta1.ValidatingAdmissionPolicy) schema.GroupVersionKind {
+func (c *TypeChecker) paramsGVK(policy *v1.ValidatingAdmissionPolicy) schema.GroupVersionKind {
if policy.Spec.ParamKind == nil {
return schema.GroupVersionKind{}
}
@@ -214,26 +264,9 @@ func (c *TypeChecker) paramsGVK(policy *v1beta1.ValidatingAdmissionPolicy) schem
return gv.WithKind(policy.Spec.ParamKind.Kind)
}
-func (c *TypeChecker) checkExpression(expression string, hasParams, hasAuthorizer bool, types typeOverwrite) (*cel.Issues, error) {
- env, err := buildEnv(hasParams, hasAuthorizer, types)
- if err != nil {
- return nil, err
- }
-
- // We cannot reuse an AST that is parsed by another env, so reparse it here.
- // Compile = Parse + Check, we especially want the results of Check.
- //
- // Paradoxically, we discard the type-checked result and let the admission
- // controller use the dynamic typed program.
- // This is a compromise that is defined in the KEP. We can revisit this
- // decision and expect a change with limited size.
- _, issues := env.Compile(expression)
- return issues, nil
-}
-
// typesToCheck extracts a list of GVKs that needs type checking from the policy
// the result is sorted in the order of Group, Version, and Kind
-func (c *TypeChecker) typesToCheck(p *v1beta1.ValidatingAdmissionPolicy) []schema.GroupVersionKind {
+func (c *TypeChecker) typesToCheck(p *v1.ValidatingAdmissionPolicy) []schema.GroupVersionKind {
gvks := sets.New[schema.GroupVersionKind]()
if p.Spec.MatchConstraints == nil || len(p.Spec.MatchConstraints.ResourceRules) == 0 {
return nil
@@ -303,7 +336,7 @@ func (c *TypeChecker) typesToCheck(p *v1beta1.ValidatingAdmissionPolicy) []schem
return sortGVKList(gvks.UnsortedList())
}
-func extractGroups(rule *v1beta1.Rule) []string {
+func extractGroups(rule *v1.Rule) []string {
groups := make([]string, 0, len(rule.APIGroups))
for _, group := range rule.APIGroups {
// give up if wildcard
@@ -315,7 +348,7 @@ func extractGroups(rule *v1beta1.Rule) []string {
return groups
}
-func extractVersions(rule *v1beta1.Rule) []string {
+func extractVersions(rule *v1.Rule) []string {
versions := make([]string, 0, len(rule.APIVersions))
for _, version := range rule.APIVersions {
if strings.ContainsAny(version, "*") {
@@ -326,7 +359,7 @@ func extractVersions(rule *v1beta1.Rule) []string {
return versions
}
-func extractResources(rule *v1beta1.Rule) []string {
+func extractResources(rule *v1.Rule) []string {
resources := make([]string, 0, len(rule.Resources))
for _, resource := range rule.Resources {
// skip wildcard and subresources
@@ -360,8 +393,8 @@ func (c *TypeChecker) tryRefreshRESTMapper() {
}
}
-func buildEnv(hasParams bool, hasAuthorizer bool, types typeOverwrite) (*cel.Env, error) {
- baseEnv := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion())
+func buildEnvSet(hasParams bool, hasAuthorizer bool, types typeOverwrite) (*environment.EnvSet, error) {
+ baseEnv := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), utilfeature.DefaultFeatureGate.Enabled(features.StrictCostEnforcementForVAP))
requestType := plugincel.BuildRequestType()
namespaceType := plugincel.BuildNamespaceType()
@@ -392,7 +425,7 @@ func buildEnv(hasParams bool, hasAuthorizer bool, types typeOverwrite) (*cel.Env
varOpts = append(varOpts, cel.Variable("authorizer", library.AuthorizerType))
}
- env, err := baseEnv.Extend(
+ return baseEnv.Extend(
environment.VersionedOptions{
// Feature epoch was actually 1.26, but we artificially set it to 1.0 because these
// options should always be present.
@@ -401,10 +434,6 @@ func buildEnv(hasParams bool, hasAuthorizer bool, types typeOverwrite) (*cel.Env
DeclTypes: declTypes,
},
)
- if err != nil {
- return nil, err
- }
- return env.Env(environment.StoredExpressions)
}
// createVariableOpts creates a slice of EnvOption
@@ -421,3 +450,40 @@ func createVariableOpts(declType *apiservercel.DeclType, variables ...string) []
}
return opts
}
+
+type typeCheckingCompiler struct {
+ compositionEnv *plugincel.CompositionEnv
+ typeOverwrite typeOverwrite
+}
+
+// CompileCELExpression compiles the given expression.
+// The implementation is the same as that of staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go
+// except that:
+// - object, oldObject, and params are typed instead of Dyn
+// - compiler does not enforce the output type
+// - the compiler does not initialize the program
+func (c *typeCheckingCompiler) CompileCELExpression(expressionAccessor plugincel.ExpressionAccessor, options plugincel.OptionalVariableDeclarations, mode environment.Type) plugincel.CompilationResult {
+ resultError := func(errorString string, errType apiservercel.ErrorType) plugincel.CompilationResult {
+ return plugincel.CompilationResult{
+ Error: &apiservercel.Error{
+ Type: errType,
+ Detail: errorString,
+ },
+ ExpressionAccessor: expressionAccessor,
+ }
+ }
+ env, err := c.compositionEnv.Env(mode)
+ if err != nil {
+ return resultError(fmt.Sprintf("fail to build env: %v", err), apiservercel.ErrorTypeInternal)
+ }
+ ast, issues := env.Compile(expressionAccessor.GetExpression())
+ if issues != nil {
+ return resultError(issues.String(), apiservercel.ErrorTypeInvalid)
+ }
+ // type checker does not require the program, however the type must still be set.
+ return plugincel.CompilationResult{
+ OutputType: ast.OutputType(),
+ }
+}
+
+var _ plugincel.Compiler = (*typeCheckingCompiler)(nil)
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/validator.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/validator.go
similarity index 96%
rename from vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/validator.go
rename to vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/validator.go
index 9630a497471..c429ae22fcf 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/validator.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/validator.go
@@ -14,10 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package validatingadmissionpolicy
+package validating
import (
"context"
+ "errors"
"fmt"
"strings"
@@ -80,7 +81,6 @@ func (v *validator) Validate(ctx context.Context, matchedResource schema.GroupVe
} else {
f = *v.failPolicy
}
-
if v.celMatcher != nil {
matchResults := v.celMatcher.Match(ctx, versionedAttr, versionedParams, authz)
if matchResults.Error != nil {
@@ -133,19 +133,14 @@ func (v *validator) Validate(ctx context.Context, matchedResource schema.GroupVe
}
var messageResult *cel.EvaluationResult
- var messageError *apiservercel.Error
if len(messageResults) > i {
messageResult = &messageResults[i]
}
- messageError, _ = err.(*apiservercel.Error)
if evalResult.Error != nil {
decision.Action = policyDecisionActionForError(f)
decision.Evaluation = EvalError
decision.Message = evalResult.Error.Error()
- } else if messageError != nil &&
- (messageError.Type == apiservercel.ErrorTypeInternal ||
- (messageError.Type == apiservercel.ErrorTypeInvalid &&
- strings.HasPrefix(messageError.Detail, "validation failed due to running out of cost budget"))) {
+ } else if errors.Is(err, apiservercel.ErrInternal) || errors.Is(err, apiservercel.ErrOutOfBudget) {
decision.Action = policyDecisionActionForError(f)
decision.Evaluation = EvalError
decision.Message = fmt.Sprintf("failed messageExpression: %s", err)
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/OWNERS b/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/OWNERS
deleted file mode 100644
index 6a637d28d58..00000000000
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/OWNERS
+++ /dev/null
@@ -1,10 +0,0 @@
-# See the OWNERS docs at https://go.k8s.io/owners
-
-approvers:
- - jpbetz
- - cici37
- - alexzielenski
-reviewers:
- - jpbetz
- - cici37
- - alexzielenski
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission.go
deleted file mode 100644
index e51bc6e7379..00000000000
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission.go
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package validatingadmissionpolicy
-
-import (
- "context"
- "errors"
- "fmt"
- "io"
-
- "k8s.io/apimachinery/pkg/api/meta"
- "k8s.io/apiserver/pkg/authorization/authorizer"
- "k8s.io/apiserver/pkg/features"
- "k8s.io/client-go/dynamic"
- "k8s.io/component-base/featuregate"
-
- "k8s.io/apiserver/pkg/admission"
- "k8s.io/apiserver/pkg/admission/initializer"
- "k8s.io/client-go/informers"
- "k8s.io/client-go/kubernetes"
-)
-
-////////////////////////////////////////////////////////////////////////////////
-// Plugin Definition
-////////////////////////////////////////////////////////////////////////////////
-
-// Definition for CEL admission plugin. This is the entry point into the
-// CEL admission control system.
-//
-// Each plugin is asked to validate every object update.
-
-const (
- // PluginName indicates the name of admission plug-in
- PluginName = "ValidatingAdmissionPolicy"
-)
-
-// Register registers a plugin
-func Register(plugins *admission.Plugins) {
- plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) {
- return NewPlugin()
- })
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// Plugin Initialization & Dependency Injection
-////////////////////////////////////////////////////////////////////////////////
-
-type celAdmissionPlugin struct {
- *admission.Handler
- evaluator CELPolicyEvaluator
-
- inspectedFeatureGates bool
- enabled bool
-
- // Injected Dependencies
- informerFactory informers.SharedInformerFactory
- client kubernetes.Interface
- restMapper meta.RESTMapper
- dynamicClient dynamic.Interface
- stopCh <-chan struct{}
- authorizer authorizer.Authorizer
-}
-
-var _ initializer.WantsExternalKubeInformerFactory = &celAdmissionPlugin{}
-var _ initializer.WantsExternalKubeClientSet = &celAdmissionPlugin{}
-var _ initializer.WantsRESTMapper = &celAdmissionPlugin{}
-var _ initializer.WantsDynamicClient = &celAdmissionPlugin{}
-var _ initializer.WantsDrainedNotification = &celAdmissionPlugin{}
-var _ initializer.WantsAuthorizer = &celAdmissionPlugin{}
-var _ admission.InitializationValidator = &celAdmissionPlugin{}
-var _ admission.ValidationInterface = &celAdmissionPlugin{}
-
-func NewPlugin() (admission.Interface, error) {
- return &celAdmissionPlugin{
- Handler: admission.NewHandler(admission.Connect, admission.Create, admission.Delete, admission.Update),
- }, nil
-}
-
-func (c *celAdmissionPlugin) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) {
- c.informerFactory = f
-}
-
-func (c *celAdmissionPlugin) SetExternalKubeClientSet(client kubernetes.Interface) {
- c.client = client
-}
-
-func (c *celAdmissionPlugin) SetRESTMapper(mapper meta.RESTMapper) {
- c.restMapper = mapper
-}
-
-func (c *celAdmissionPlugin) SetDynamicClient(client dynamic.Interface) {
- c.dynamicClient = client
-}
-
-func (c *celAdmissionPlugin) SetDrainedNotification(stopCh <-chan struct{}) {
- c.stopCh = stopCh
-}
-
-func (c *celAdmissionPlugin) SetAuthorizer(authorizer authorizer.Authorizer) {
- c.authorizer = authorizer
-}
-func (c *celAdmissionPlugin) InspectFeatureGates(featureGates featuregate.FeatureGate) {
- if featureGates.Enabled(features.ValidatingAdmissionPolicy) {
- c.enabled = true
- }
- c.inspectedFeatureGates = true
-}
-
-// ValidateInitialization - once clientset and informer factory are provided, creates and starts the admission controller
-func (c *celAdmissionPlugin) ValidateInitialization() error {
- if !c.inspectedFeatureGates {
- return fmt.Errorf("%s did not see feature gates", PluginName)
- }
- if !c.enabled {
- return nil
- }
- if c.informerFactory == nil {
- return errors.New("missing informer factory")
- }
- if c.client == nil {
- return errors.New("missing kubernetes client")
- }
- if c.restMapper == nil {
- return errors.New("missing rest mapper")
- }
- if c.dynamicClient == nil {
- return errors.New("missing dynamic client")
- }
- if c.stopCh == nil {
- return errors.New("missing stop channel")
- }
- if c.authorizer == nil {
- return errors.New("missing authorizer")
- }
- c.evaluator = NewAdmissionController(c.informerFactory, c.client, c.restMapper, c.dynamicClient, c.authorizer)
- if err := c.evaluator.ValidateInitialization(); err != nil {
- return err
- }
-
- c.SetReadyFunc(c.evaluator.HasSynced)
- go c.evaluator.Run(c.stopCh)
- return nil
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// admission.ValidationInterface
-////////////////////////////////////////////////////////////////////////////////
-
-func (c *celAdmissionPlugin) Handles(operation admission.Operation) bool {
- return true
-}
-
-func (c *celAdmissionPlugin) Validate(
- ctx context.Context,
- a admission.Attributes,
- o admission.ObjectInterfaces,
-) (err error) {
- if !c.enabled {
- return nil
- }
-
- // isPolicyResource determines if an admission.Attributes object is describing
- // the admission of a ValidatingAdmissionPolicy or a ValidatingAdmissionPolicyBinding
- if isPolicyResource(a) {
- return
- }
-
- if !c.WaitForReady() {
- return admission.NewForbidden(a, fmt.Errorf("not yet ready to handle request"))
- }
-
- return c.evaluator.Validate(ctx, a, o)
-}
-
-func isPolicyResource(attr admission.Attributes) bool {
- gvk := attr.GetResource()
- if gvk.Group == "admissionregistration.k8s.io" {
- if gvk.Resource == "validatingadmissionpolicies" || gvk.Resource == "validatingadmissionpolicybindings" {
- return true
- }
- }
- return false
-}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller_reconcile.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller_reconcile.go
deleted file mode 100644
index 9cd3c01aed3..00000000000
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller_reconcile.go
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package validatingadmissionpolicy
-
-import (
- "context"
- "fmt"
- "sync"
- "time"
-
- v1 "k8s.io/api/admissionregistration/v1"
- "k8s.io/api/admissionregistration/v1beta1"
- corev1 "k8s.io/api/core/v1"
- apiequality "k8s.io/apimachinery/pkg/api/equality"
- "k8s.io/apimachinery/pkg/api/meta"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
- utilruntime "k8s.io/apimachinery/pkg/util/runtime"
- "k8s.io/apimachinery/pkg/util/sets"
- celmetrics "k8s.io/apiserver/pkg/admission/cel"
- "k8s.io/apiserver/pkg/admission/plugin/cel"
- "k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic"
- "k8s.io/apiserver/pkg/admission/plugin/webhook/matchconditions"
- "k8s.io/apiserver/pkg/cel/environment"
- "k8s.io/client-go/dynamic"
- "k8s.io/client-go/dynamic/dynamicinformer"
- "k8s.io/client-go/informers"
- "k8s.io/client-go/kubernetes"
- "k8s.io/client-go/tools/cache"
-)
-
-type policyController struct {
- once sync.Once
- context context.Context
- dynamicClient dynamic.Interface
- informerFactory informers.SharedInformerFactory
- restMapper meta.RESTMapper
- policyDefinitionsController generic.Controller[*v1beta1.ValidatingAdmissionPolicy]
- policyBindingController generic.Controller[*v1beta1.ValidatingAdmissionPolicyBinding]
-
- // Provided to the policy's Compile function as an injected dependency to
- // assist with compiling its expressions to CEL
- // pass nil to create filter compiler in demand
- filterCompiler cel.FilterCompiler
-
- matcher Matcher
-
- newValidator
-
- client kubernetes.Interface
- // Lock which protects
- // All Below fields
- // All above fields should be assumed constant
- mutex sync.RWMutex
-
- cachedPolicies []policyData
-
- // controller and metadata
- paramsCRDControllers map[v1beta1.ParamKind]*paramInfo
-
- // Index for each definition namespace/name, contains all binding
- // namespace/names known to exist for that definition
- definitionInfo map[namespacedName]*definitionInfo
-
- // Index for each bindings namespace/name. Contains compiled templates
- // for the binding depending on the policy/param combination.
- bindingInfos map[namespacedName]*bindingInfo
-
- // Map from namespace/name of a definition to a set of namespace/name
- // of bindings which depend on it.
- // All keys must have at least one dependent binding
- // All binding names MUST exist as a key bindingInfos
- definitionsToBindings map[namespacedName]sets.Set[namespacedName]
-}
-
-type newValidator func(validationFilter cel.Filter, celMatcher matchconditions.Matcher, auditAnnotationFilter, messageFilter cel.Filter, failurePolicy *v1.FailurePolicyType) Validator
-
-func newPolicyController(
- restMapper meta.RESTMapper,
- client kubernetes.Interface,
- dynamicClient dynamic.Interface,
- informerFactory informers.SharedInformerFactory,
- filterCompiler cel.FilterCompiler,
- matcher Matcher,
- policiesInformer generic.Informer[*v1beta1.ValidatingAdmissionPolicy],
- bindingsInformer generic.Informer[*v1beta1.ValidatingAdmissionPolicyBinding],
-) *policyController {
- res := &policyController{}
- *res = policyController{
- filterCompiler: filterCompiler,
- definitionInfo: make(map[namespacedName]*definitionInfo),
- bindingInfos: make(map[namespacedName]*bindingInfo),
- paramsCRDControllers: make(map[v1beta1.ParamKind]*paramInfo),
- definitionsToBindings: make(map[namespacedName]sets.Set[namespacedName]),
- matcher: matcher,
- newValidator: NewValidator,
- policyDefinitionsController: generic.NewController(
- policiesInformer,
- res.reconcilePolicyDefinition,
- generic.ControllerOptions{
- Workers: 1,
- Name: "cel-policy-definitions",
- },
- ),
- policyBindingController: generic.NewController(
- bindingsInformer,
- res.reconcilePolicyBinding,
- generic.ControllerOptions{
- Workers: 1,
- Name: "cel-policy-bindings",
- },
- ),
- restMapper: restMapper,
- dynamicClient: dynamicClient,
- informerFactory: informerFactory,
- client: client,
- }
- return res
-}
-
-func (c *policyController) Run(ctx context.Context) {
- // Only support being run once
- c.once.Do(func() {
- c.context = ctx
-
- wg := sync.WaitGroup{}
-
- wg.Add(1)
- go func() {
- defer wg.Done()
- c.policyDefinitionsController.Run(ctx)
- }()
-
- wg.Add(1)
- go func() {
- defer wg.Done()
- c.policyBindingController.Run(ctx)
- }()
-
- <-ctx.Done()
- wg.Wait()
- })
-}
-
-func (c *policyController) HasSynced() bool {
- return c.policyDefinitionsController.HasSynced() && c.policyBindingController.HasSynced()
-}
-
-func (c *policyController) reconcilePolicyDefinition(namespace, name string, definition *v1beta1.ValidatingAdmissionPolicy) error {
- c.mutex.Lock()
- defer c.mutex.Unlock()
- err := c.reconcilePolicyDefinitionSpec(namespace, name, definition)
- return err
-}
-
-func (c *policyController) reconcilePolicyDefinitionSpec(namespace, name string, definition *v1beta1.ValidatingAdmissionPolicy) error {
- c.cachedPolicies = nil // invalidate cachedPolicies
-
- // Namespace for policydefinition is empty.
- nn := getNamespaceName(namespace, name)
- info, ok := c.definitionInfo[nn]
- if !ok {
- info = &definitionInfo{}
- c.definitionInfo[nn] = info
- // TODO(DangerOnTheRanger): add support for "warn" being a valid enforcementAction
- celmetrics.Metrics.ObserveDefinition(context.TODO(), "active", "deny")
- }
-
- // Skip reconcile if the spec of the definition is unchanged and had a
- // successful previous sync
- if info.configurationError == nil && info.lastReconciledValue != nil && definition != nil &&
- apiequality.Semantic.DeepEqual(info.lastReconciledValue.Spec, definition.Spec) {
- return nil
- }
-
- var paramSource *v1beta1.ParamKind
- if definition != nil {
- paramSource = definition.Spec.ParamKind
- }
-
- // If param source has changed, remove definition as dependent of old params
- // If there are no more dependents of old param, stop and clean up controller
- if info.lastReconciledValue != nil && info.lastReconciledValue.Spec.ParamKind != nil {
- oldParamSource := *info.lastReconciledValue.Spec.ParamKind
-
- // If we are:
- // - switching from having a param to not having a param (includes deletion)
- // - or from having a param to a different one
- // we remove dependency on the controller.
- if paramSource == nil || *paramSource != oldParamSource {
- if oldParamInfo, ok := c.paramsCRDControllers[oldParamSource]; ok {
- oldParamInfo.dependentDefinitions.Delete(nn)
- if len(oldParamInfo.dependentDefinitions) == 0 {
- oldParamInfo.stop()
- delete(c.paramsCRDControllers, oldParamSource)
- }
- }
- }
- }
-
- // Reset all previously compiled evaluators in case something relevant in
- // definition has changed.
- for key := range c.definitionsToBindings[nn] {
- bindingInfo := c.bindingInfos[key]
- bindingInfo.validator = nil
- c.bindingInfos[key] = bindingInfo
- }
-
- if definition == nil {
- delete(c.definitionInfo, nn)
- return nil
- }
-
- // Update definition info
- info.lastReconciledValue = definition
- info.configurationError = nil
-
- if paramSource == nil {
- // Skip setting up controller for empty param type
- return nil
- }
- // find GVR for params
- // Parse param source into a GVK
-
- paramSourceGV, err := schema.ParseGroupVersion(paramSource.APIVersion)
- if err != nil {
- // Failed to resolve. Return error so we retry again (rate limited)
- // Save a record of this definition with an evaluator that unconditionally
- info.configurationError = fmt.Errorf("failed to parse apiVersion of paramKind '%v' with error: %w", paramSource.String(), err)
-
- // Return nil, since this error cannot be resolved by waiting more time
- return nil
- }
-
- paramsGVR, err := c.restMapper.RESTMapping(schema.GroupKind{
- Group: paramSourceGV.Group,
- Kind: paramSource.Kind,
- }, paramSourceGV.Version)
-
- if err != nil {
- // Failed to resolve. Return error so we retry again (rate limited)
- // Save a record of this definition with an evaluator that unconditionally
- //
- info.configurationError = fmt.Errorf("failed to find resource referenced by paramKind: '%v'", paramSourceGV.WithKind(paramSource.Kind))
- return info.configurationError
- }
-
- paramInfo := c.ensureParamInfo(paramSource, paramsGVR)
- paramInfo.dependentDefinitions.Insert(nn)
-
- return nil
-}
-
-// Ensures that there is an informer started for the given GVK to be used as a
-// param
-func (c *policyController) ensureParamInfo(paramSource *v1beta1.ParamKind, mapping *meta.RESTMapping) *paramInfo {
- if info, ok := c.paramsCRDControllers[*paramSource]; ok {
- return info
- }
-
- // We are not watching this param. Start an informer for it.
- instanceContext, instanceCancel := context.WithCancel(c.context)
-
- var informer cache.SharedIndexInformer
-
- // Try to see if our provided informer factory has an informer for this type.
- // We assume the informer is already started, and starts all types associated
- // with it.
- if genericInformer, err := c.informerFactory.ForResource(mapping.Resource); err == nil {
- informer = genericInformer.Informer()
-
- // Ensure the informer is started
- // Use policyController's context rather than the instance context.
- // PolicyController context is expected to last until app shutdown
- // This is due to behavior of informerFactory which would cause the
- // informer to stop running once the context is cancelled, and
- // never started again.
- c.informerFactory.Start(c.context.Done())
- } else {
- // Dynamic JSON informer fallback.
- // Cannot use shared dynamic informer since it would be impossible
- // to clean CRD informers properly with multiple dependents
- // (cannot start ahead of time, and cannot track dependencies via stopCh)
- informer = dynamicinformer.NewFilteredDynamicInformer(
- c.dynamicClient,
- mapping.Resource,
- corev1.NamespaceAll,
- // Use same interval as is used for k8s typed sharedInformerFactory
- // https://github.com/kubernetes/kubernetes/blob/7e0923899fed622efbc8679cca6b000d43633e38/cmd/kube-apiserver/app/server.go#L430
- 10*time.Minute,
- cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
- nil,
- ).Informer()
- go informer.Run(instanceContext.Done())
- }
-
- controller := generic.NewController(
- generic.NewInformer[runtime.Object](informer),
- c.reconcileParams,
- generic.ControllerOptions{
- Workers: 1,
- Name: paramSource.String() + "-controller",
- },
- )
-
- ret := ¶mInfo{
- controller: controller,
- stop: instanceCancel,
- scope: mapping.Scope,
- dependentDefinitions: sets.New[namespacedName](),
- }
- c.paramsCRDControllers[*paramSource] = ret
-
- go controller.Run(instanceContext)
- return ret
-
-}
-
-func (c *policyController) reconcilePolicyBinding(namespace, name string, binding *v1beta1.ValidatingAdmissionPolicyBinding) error {
- c.mutex.Lock()
- defer c.mutex.Unlock()
-
- c.cachedPolicies = nil // invalidate cachedPolicies
-
- // Namespace for PolicyBinding is empty. In the future a namespaced binding
- // may be added
- // https://github.com/kubernetes/enhancements/blob/bf5c3c81ea2081d60c1dc7c832faa98479e06209/keps/sig-api-machinery/3488-cel-admission-control/README.md?plain=1#L1042
- nn := getNamespaceName(namespace, name)
- info, ok := c.bindingInfos[nn]
- if !ok {
- info = &bindingInfo{}
- c.bindingInfos[nn] = info
- }
-
- // Skip if the spec of the binding is unchanged.
- if info.lastReconciledValue != nil && binding != nil &&
- apiequality.Semantic.DeepEqual(info.lastReconciledValue.Spec, binding.Spec) {
- return nil
- }
-
- var oldNamespacedDefinitionName namespacedName
- if info.lastReconciledValue != nil {
- // All validating policies are cluster-scoped so have empty namespace
- oldNamespacedDefinitionName = getNamespaceName("", info.lastReconciledValue.Spec.PolicyName)
- }
-
- var namespacedDefinitionName namespacedName
- if binding != nil {
- // All validating policies are cluster-scoped so have empty namespace
- namespacedDefinitionName = getNamespaceName("", binding.Spec.PolicyName)
- }
-
- // Remove record of binding from old definition if the referred policy
- // has changed
- if oldNamespacedDefinitionName != namespacedDefinitionName {
- if dependentBindings, ok := c.definitionsToBindings[oldNamespacedDefinitionName]; ok {
- dependentBindings.Delete(nn)
-
- // if there are no more dependent bindings, remove knowledge of the
- // definition altogether
- if len(dependentBindings) == 0 {
- delete(c.definitionsToBindings, oldNamespacedDefinitionName)
- }
- }
- }
-
- if binding == nil {
- delete(c.bindingInfos, nn)
- return nil
- }
-
- // Add record of binding to new definition
- if dependentBindings, ok := c.definitionsToBindings[namespacedDefinitionName]; ok {
- dependentBindings.Insert(nn)
- } else {
- c.definitionsToBindings[namespacedDefinitionName] = sets.New(nn)
- }
-
- // Remove compiled template for old binding
- info.validator = nil
- info.lastReconciledValue = binding
- return nil
-}
-
-func (c *policyController) reconcileParams(namespace, name string, params runtime.Object) error {
- // Do nothing.
- // When we add informational type checking we will need to compile in the
- // reconcile loops instead of lazily so we can add compiler errors / type
- // checker errors to the status of the resources.
- return nil
-}
-
-// Fetches the latest set of policy data or recalculates it if it has changed
-// since it was last fetched
-func (c *policyController) latestPolicyData() []policyData {
- existing := func() []policyData {
- c.mutex.RLock()
- defer c.mutex.RUnlock()
-
- return c.cachedPolicies
- }()
-
- if existing != nil {
- return existing
- }
-
- c.mutex.Lock()
- defer c.mutex.Unlock()
-
- var res []policyData
- for definitionNN, definitionInfo := range c.definitionInfo {
- var bindingInfos []bindingInfo
- for bindingNN := range c.definitionsToBindings[definitionNN] {
- bindingInfo := c.bindingInfos[bindingNN]
- if bindingInfo.validator == nil && definitionInfo.configurationError == nil {
- hasParam := false
- if definitionInfo.lastReconciledValue.Spec.ParamKind != nil {
- hasParam = true
- }
- optionalVars := cel.OptionalVariableDeclarations{HasParams: hasParam, HasAuthorizer: true}
- expressionOptionalVars := cel.OptionalVariableDeclarations{HasParams: hasParam, HasAuthorizer: false}
- failurePolicy := convertv1beta1FailurePolicyTypeTov1FailurePolicyType(definitionInfo.lastReconciledValue.Spec.FailurePolicy)
- var matcher matchconditions.Matcher = nil
- matchConditions := definitionInfo.lastReconciledValue.Spec.MatchConditions
-
- filterCompiler := c.filterCompiler
- if filterCompiler == nil {
- compositedCompiler, err := cel.NewCompositedCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion()))
- if err == nil {
- filterCompiler = compositedCompiler
- compositedCompiler.CompileAndStoreVariables(convertv1beta1Variables(definitionInfo.lastReconciledValue.Spec.Variables), optionalVars, environment.StoredExpressions)
- } else {
- utilruntime.HandleError(err)
- }
- }
- if len(matchConditions) > 0 {
- matchExpressionAccessors := make([]cel.ExpressionAccessor, len(matchConditions))
- for i := range matchConditions {
- matchExpressionAccessors[i] = (*matchconditions.MatchCondition)(&matchConditions[i])
- }
- matcher = matchconditions.NewMatcher(filterCompiler.Compile(matchExpressionAccessors, optionalVars, environment.StoredExpressions), failurePolicy, "policy", "validate", definitionInfo.lastReconciledValue.Name)
- }
- bindingInfo.validator = c.newValidator(
- filterCompiler.Compile(convertv1beta1Validations(definitionInfo.lastReconciledValue.Spec.Validations), optionalVars, environment.StoredExpressions),
- matcher,
- filterCompiler.Compile(convertv1beta1AuditAnnotations(definitionInfo.lastReconciledValue.Spec.AuditAnnotations), optionalVars, environment.StoredExpressions),
- filterCompiler.Compile(convertv1beta1MessageExpressions(definitionInfo.lastReconciledValue.Spec.Validations), expressionOptionalVars, environment.StoredExpressions),
- failurePolicy,
- )
- }
- bindingInfos = append(bindingInfos, *bindingInfo)
- }
-
- var pInfo paramInfo
- if paramKind := definitionInfo.lastReconciledValue.Spec.ParamKind; paramKind != nil {
- if info, ok := c.paramsCRDControllers[*paramKind]; ok {
- pInfo = *info
- }
- }
-
- res = append(res, policyData{
- definitionInfo: *definitionInfo,
- paramInfo: pInfo,
- bindings: bindingInfos,
- })
- }
-
- c.cachedPolicies = res
- return res
-}
-
-func convertv1beta1FailurePolicyTypeTov1FailurePolicyType(policyType *v1beta1.FailurePolicyType) *v1.FailurePolicyType {
- if policyType == nil {
- return nil
- }
-
- var v1FailPolicy v1.FailurePolicyType
- if *policyType == v1beta1.Fail {
- v1FailPolicy = v1.Fail
- } else if *policyType == v1beta1.Ignore {
- v1FailPolicy = v1.Ignore
- }
- return &v1FailPolicy
-}
-
-func convertv1beta1Validations(inputValidations []v1beta1.Validation) []cel.ExpressionAccessor {
- celExpressionAccessor := make([]cel.ExpressionAccessor, len(inputValidations))
- for i, validation := range inputValidations {
- validation := ValidationCondition{
- Expression: validation.Expression,
- Message: validation.Message,
- Reason: validation.Reason,
- }
- celExpressionAccessor[i] = &validation
- }
- return celExpressionAccessor
-}
-
-func convertv1beta1MessageExpressions(inputValidations []v1beta1.Validation) []cel.ExpressionAccessor {
- celExpressionAccessor := make([]cel.ExpressionAccessor, len(inputValidations))
- for i, validation := range inputValidations {
- if validation.MessageExpression != "" {
- condition := MessageExpressionCondition{
- MessageExpression: validation.MessageExpression,
- }
- celExpressionAccessor[i] = &condition
- }
- }
- return celExpressionAccessor
-}
-
-func convertv1beta1AuditAnnotations(inputValidations []v1beta1.AuditAnnotation) []cel.ExpressionAccessor {
- celExpressionAccessor := make([]cel.ExpressionAccessor, len(inputValidations))
- for i, validation := range inputValidations {
- validation := AuditAnnotationCondition{
- Key: validation.Key,
- ValueExpression: validation.ValueExpression,
- }
- celExpressionAccessor[i] = &validation
- }
- return celExpressionAccessor
-}
-
-func convertv1beta1Variables(variables []v1beta1.Variable) []cel.NamedExpressionAccessor {
- namedExpressions := make([]cel.NamedExpressionAccessor, len(variables))
- for i, variable := range variables {
- namedExpressions[i] = &Variable{Name: variable.Name, Expression: variable.Expression}
- }
- return namedExpressions
-}
-
-func getNamespaceName(namespace, name string) namespacedName {
- return namespacedName{
- namespace: namespace,
- name: name,
- }
-}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/accessors.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/accessors.go
index e60d245a621..f23580cc09f 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/accessors.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/accessors.go
@@ -27,6 +27,8 @@ import (
"k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace"
"k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object"
"k8s.io/apiserver/pkg/cel/environment"
+ "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
webhookutil "k8s.io/apiserver/pkg/util/webhook"
"k8s.io/client-go/rest"
)
@@ -139,11 +141,16 @@ func (m *mutatingWebhookAccessor) GetCompiledMatcher(compiler cel.FilterCompiler
Expression: matchCondition.Expression,
}
}
+ strictCost := false
+ if utilfeature.DefaultFeatureGate.Enabled(features.StrictCostEnforcementForWebhooks) {
+ strictCost = true
+ }
m.compiledMatcher = matchconditions.NewMatcher(compiler.Compile(
expressions,
cel.OptionalVariableDeclarations{
HasParams: false,
HasAuthorizer: true,
+ StrictCost: strictCost,
},
environment.StoredExpressions,
), m.FailurePolicy, "webhook", "admit", m.Name)
@@ -267,11 +274,16 @@ func (v *validatingWebhookAccessor) GetCompiledMatcher(compiler cel.FilterCompil
Expression: matchCondition.Expression,
}
}
+ strictCost := false
+ if utilfeature.DefaultFeatureGate.Enabled(features.StrictCostEnforcementForWebhooks) {
+ strictCost = true
+ }
v.compiledMatcher = matchconditions.NewMatcher(compiler.Compile(
expressions,
cel.OptionalVariableDeclarations{
HasParams: false,
HasAuthorizer: true,
+ StrictCost: strictCost,
},
environment.StoredExpressions,
), v.FailurePolicy, "webhook", "validating", v.Name)
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/doc.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/doc.go
index 63ab310393c..087162e36ae 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/doc.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/doc.go
@@ -16,4 +16,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package
-package webhookadmission
+package webhookadmission // import "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission"
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/doc.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/doc.go
index 92cfed10744..58875a59f20 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/doc.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1/doc.go
@@ -20,4 +20,4 @@ limitations under the License.
// +groupName=apiserver.config.k8s.io
// Package v1 is the v1 version of the API.
-package v1
+package v1 // import "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1"
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/doc.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/doc.go
index 703f467f9fc..c8ee58d5d9a 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/doc.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/doc.go
@@ -20,4 +20,4 @@ limitations under the License.
// +groupName=apiserver.config.k8s.io
// Package v1alpha1 is the v1alpha1 version of the API.
-package v1alpha1
+package v1alpha1 // import "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1"
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go
index 6a513f1c11a..f067b3f723c 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go
@@ -21,7 +21,6 @@ import (
"fmt"
"io"
- admissionmetrics "k8s.io/apiserver/pkg/admission/metrics"
"k8s.io/klog/v2"
admissionv1 "k8s.io/api/admission/v1"
@@ -31,6 +30,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/admission"
genericadmissioninit "k8s.io/apiserver/pkg/admission/initializer"
+ admissionmetrics "k8s.io/apiserver/pkg/admission/metrics"
"k8s.io/apiserver/pkg/admission/plugin/cel"
"k8s.io/apiserver/pkg/admission/plugin/webhook"
"k8s.io/apiserver/pkg/admission/plugin/webhook/config"
@@ -39,6 +39,8 @@ import (
"k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules"
"k8s.io/apiserver/pkg/authorization/authorizer"
"k8s.io/apiserver/pkg/cel/environment"
+ "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
webhookutil "k8s.io/apiserver/pkg/util/webhook"
"k8s.io/client-go/informers"
clientset "k8s.io/client-go/kubernetes"
@@ -100,7 +102,7 @@ func NewWebhook(handler *admission.Handler, configFile io.Reader, sourceFactory
namespaceMatcher: &namespace.Matcher{},
objectMatcher: &object.Matcher{},
dispatcher: dispatcherFactory(&cm),
- filterCompiler: cel.NewFilterCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion())),
+ filterCompiler: cel.NewFilterCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), utilfeature.DefaultFeatureGate.Enabled(features.StrictCostEnforcementForWebhooks))),
}, nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go
index 437e53dc93c..5bf80237f7f 100644
--- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go
+++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go
@@ -24,8 +24,8 @@ import (
"fmt"
"time"
- jsonpatch "github.com/evanphx/json-patch"
"go.opentelemetry.io/otel/attribute"
+ jsonpatch "gopkg.in/evanphx/json-patch.v4"
admissionv1 "k8s.io/api/admission/v1"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/conversion.go b/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/conversion.go
new file mode 100644
index 00000000000..e74323e5ced
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/conversion.go
@@ -0,0 +1,226 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was duplicated from the auto-generated file by conversion-gen in
+// k8s.io/kubernetes/pkg/apis/apidiscovery Unlike most k8s types discovery is
+// served by all apiservers and conversion is needed by all apiservers. The
+// concept of internal/hub type does not exist for discovery as we work directly
+// with the versioned types.
+
+// The conversion code here facilities conversion strictly between v2beta1 and
+// v2 types. It is only necessary in k8s versions where mixed state could be
+// possible before the full removal of the v2beta1 types. It is placed in this
+// directory such that all apiservers can benefit from the conversion without
+// having to implement their own if the client/server they're communicating with
+// only supports one version.
+
+// Once the v2beta1 types are removed (intended for Kubernetes v1.33), this file
+// will be removed.
+package v2
+
+import (
+ unsafe "unsafe"
+
+ v2 "k8s.io/api/apidiscovery/v2"
+ v2beta1 "k8s.io/api/apidiscovery/v2beta1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(s *runtime.Scheme) error {
+ if err := s.AddGeneratedConversionFunc((*v2beta1.APIGroupDiscovery)(nil), (*v2.APIGroupDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2beta1APIGroupDiscoveryTov2APIGroupDiscovery(a.(*v2beta1.APIGroupDiscovery), b.(*v2.APIGroupDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2.APIGroupDiscovery)(nil), (*v2beta1.APIGroupDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2APIGroupDiscoveryTov2beta1APIGroupDiscovery(a.(*v2.APIGroupDiscovery), b.(*v2beta1.APIGroupDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2beta1.APIGroupDiscoveryList)(nil), (*v2.APIGroupDiscoveryList)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2beta1APIGroupDiscoveryListTov2APIGroupDiscoveryList(a.(*v2beta1.APIGroupDiscoveryList), b.(*v2.APIGroupDiscoveryList), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2.APIGroupDiscoveryList)(nil), (*v2beta1.APIGroupDiscoveryList)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2APIGroupDiscoveryListTov2beta1APIGroupDiscoveryList(a.(*v2.APIGroupDiscoveryList), b.(*v2beta1.APIGroupDiscoveryList), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2beta1.APIResourceDiscovery)(nil), (*v2.APIResourceDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2beta1APIResourceDiscoveryTov2APIResourceDiscovery(a.(*v2beta1.APIResourceDiscovery), b.(*v2.APIResourceDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2.APIResourceDiscovery)(nil), (*v2beta1.APIResourceDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2APIResourceDiscoveryTov2beta1APIResourceDiscovery(a.(*v2.APIResourceDiscovery), b.(*v2beta1.APIResourceDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2beta1.APISubresourceDiscovery)(nil), (*v2.APISubresourceDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2beta1APISubresourceDiscoveryTov2APISubresourceDiscovery(a.(*v2beta1.APISubresourceDiscovery), b.(*v2.APISubresourceDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2.APISubresourceDiscovery)(nil), (*v2beta1.APISubresourceDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2APISubresourceDiscoveryTov2beta1APISubresourceDiscovery(a.(*v2.APISubresourceDiscovery), b.(*v2beta1.APISubresourceDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2beta1.APIVersionDiscovery)(nil), (*v2.APIVersionDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2beta1APIVersionDiscoveryTov2APIVersionDiscovery(a.(*v2beta1.APIVersionDiscovery), b.(*v2.APIVersionDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*v2.APIVersionDiscovery)(nil), (*v2beta1.APIVersionDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convertv2APIVersionDiscoveryTov2beta1APIVersionDiscovery(a.(*v2.APIVersionDiscovery), b.(*v2beta1.APIVersionDiscovery), scope)
+ }); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvertv2beta1APIGroupDiscoveryTov2APIGroupDiscovery(in *v2beta1.APIGroupDiscovery, out *v2.APIGroupDiscovery, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Versions = *(*[]v2.APIVersionDiscovery)(unsafe.Pointer(&in.Versions))
+ return nil
+}
+
+// Convertv2beta1APIGroupDiscoveryTov2APIGroupDiscovery is an autogenerated conversion function.
+func Convertv2beta1APIGroupDiscoveryTov2APIGroupDiscovery(in *v2beta1.APIGroupDiscovery, out *v2.APIGroupDiscovery, s conversion.Scope) error {
+ return autoConvertv2beta1APIGroupDiscoveryTov2APIGroupDiscovery(in, out, s)
+}
+
+func autoConvertv2APIGroupDiscoveryTov2beta1APIGroupDiscovery(in *v2.APIGroupDiscovery, out *v2beta1.APIGroupDiscovery, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Versions = *(*[]v2beta1.APIVersionDiscovery)(unsafe.Pointer(&in.Versions))
+ return nil
+}
+
+// Convertv2APIGroupDiscoveryTov2beta1APIGroupDiscovery is an autogenerated conversion function.
+func Convertv2APIGroupDiscoveryTov2beta1APIGroupDiscovery(in *v2.APIGroupDiscovery, out *v2beta1.APIGroupDiscovery, s conversion.Scope) error {
+ return autoConvertv2APIGroupDiscoveryTov2beta1APIGroupDiscovery(in, out, s)
+}
+
+func autoConvertv2beta1APIGroupDiscoveryListTov2APIGroupDiscoveryList(in *v2beta1.APIGroupDiscoveryList, out *v2.APIGroupDiscoveryList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]v2.APIGroupDiscovery)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convertv2beta1APIGroupDiscoveryListTov2APIGroupDiscoveryList is an autogenerated conversion function.
+func Convertv2beta1APIGroupDiscoveryListTov2APIGroupDiscoveryList(in *v2beta1.APIGroupDiscoveryList, out *v2.APIGroupDiscoveryList, s conversion.Scope) error {
+ return autoConvertv2beta1APIGroupDiscoveryListTov2APIGroupDiscoveryList(in, out, s)
+}
+
+func autoConvertv2APIGroupDiscoveryListTov2beta1APIGroupDiscoveryList(in *v2.APIGroupDiscoveryList, out *v2beta1.APIGroupDiscoveryList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]v2beta1.APIGroupDiscovery)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convertv2APIGroupDiscoveryListTov2beta1APIGroupDiscoveryList is an autogenerated conversion function.
+func Convertv2APIGroupDiscoveryListTov2beta1APIGroupDiscoveryList(in *v2.APIGroupDiscoveryList, out *v2beta1.APIGroupDiscoveryList, s conversion.Scope) error {
+ return autoConvertv2APIGroupDiscoveryListTov2beta1APIGroupDiscoveryList(in, out, s)
+}
+
+func autoConvertv2beta1APIResourceDiscoveryTov2APIResourceDiscovery(in *v2beta1.APIResourceDiscovery, out *v2.APIResourceDiscovery, s conversion.Scope) error {
+ out.Resource = in.Resource
+ out.ResponseKind = (*v1.GroupVersionKind)(unsafe.Pointer(in.ResponseKind))
+ out.Scope = v2.ResourceScope(in.Scope)
+ out.SingularResource = in.SingularResource
+ out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
+ out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames))
+ out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories))
+ out.Subresources = *(*[]v2.APISubresourceDiscovery)(unsafe.Pointer(&in.Subresources))
+ return nil
+}
+
+// Convertv2beta1APIResourceDiscoveryTov2APIResourceDiscovery is an autogenerated conversion function.
+func Convertv2beta1APIResourceDiscoveryTov2APIResourceDiscovery(in *v2beta1.APIResourceDiscovery, out *v2.APIResourceDiscovery, s conversion.Scope) error {
+ return autoConvertv2beta1APIResourceDiscoveryTov2APIResourceDiscovery(in, out, s)
+}
+
+func autoConvertv2APIResourceDiscoveryTov2beta1APIResourceDiscovery(in *v2.APIResourceDiscovery, out *v2beta1.APIResourceDiscovery, s conversion.Scope) error {
+ out.Resource = in.Resource
+ out.ResponseKind = (*v1.GroupVersionKind)(unsafe.Pointer(in.ResponseKind))
+ out.Scope = v2beta1.ResourceScope(in.Scope)
+ out.SingularResource = in.SingularResource
+ out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
+ out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames))
+ out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories))
+ out.Subresources = *(*[]v2beta1.APISubresourceDiscovery)(unsafe.Pointer(&in.Subresources))
+ return nil
+}
+
+// Convertv2APIResourceDiscoveryTov2beta1APIResourceDiscovery is an autogenerated conversion function.
+func Convertv2APIResourceDiscoveryTov2beta1APIResourceDiscovery(in *v2.APIResourceDiscovery, out *v2beta1.APIResourceDiscovery, s conversion.Scope) error {
+ return autoConvertv2APIResourceDiscoveryTov2beta1APIResourceDiscovery(in, out, s)
+}
+
+func autoConvertv2beta1APISubresourceDiscoveryTov2APISubresourceDiscovery(in *v2beta1.APISubresourceDiscovery, out *v2.APISubresourceDiscovery, s conversion.Scope) error {
+ out.Subresource = in.Subresource
+ out.ResponseKind = (*v1.GroupVersionKind)(unsafe.Pointer(in.ResponseKind))
+ out.AcceptedTypes = *(*[]v1.GroupVersionKind)(unsafe.Pointer(&in.AcceptedTypes))
+ out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
+ return nil
+}
+
+// Convertv2beta1APISubresourceDiscoveryTov2APISubresourceDiscovery is an autogenerated conversion function.
+func Convertv2beta1APISubresourceDiscoveryTov2APISubresourceDiscovery(in *v2beta1.APISubresourceDiscovery, out *v2.APISubresourceDiscovery, s conversion.Scope) error {
+ return autoConvertv2beta1APISubresourceDiscoveryTov2APISubresourceDiscovery(in, out, s)
+}
+
+func autoConvertv2APISubresourceDiscoveryTov2beta1APISubresourceDiscovery(in *v2.APISubresourceDiscovery, out *v2beta1.APISubresourceDiscovery, s conversion.Scope) error {
+ out.Subresource = in.Subresource
+ out.ResponseKind = (*v1.GroupVersionKind)(unsafe.Pointer(in.ResponseKind))
+ out.AcceptedTypes = *(*[]v1.GroupVersionKind)(unsafe.Pointer(&in.AcceptedTypes))
+ out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
+ return nil
+}
+
+// Convertv2APISubresourceDiscoveryTov2beta1APISubresourceDiscovery is an autogenerated conversion function.
+func Convertv2APISubresourceDiscoveryTov2beta1APISubresourceDiscovery(in *v2.APISubresourceDiscovery, out *v2beta1.APISubresourceDiscovery, s conversion.Scope) error {
+ return autoConvertv2APISubresourceDiscoveryTov2beta1APISubresourceDiscovery(in, out, s)
+}
+
+func autoConvertv2beta1APIVersionDiscoveryTov2APIVersionDiscovery(in *v2beta1.APIVersionDiscovery, out *v2.APIVersionDiscovery, s conversion.Scope) error {
+ out.Version = in.Version
+ out.Resources = *(*[]v2.APIResourceDiscovery)(unsafe.Pointer(&in.Resources))
+ out.Freshness = v2.DiscoveryFreshness(in.Freshness)
+ return nil
+}
+
+// Convertv2beta1APIVersionDiscoveryTov2APIVersionDiscovery is an autogenerated conversion function.
+func Convertv2beta1APIVersionDiscoveryTov2APIVersionDiscovery(in *v2beta1.APIVersionDiscovery, out *v2.APIVersionDiscovery, s conversion.Scope) error {
+ return autoConvertv2beta1APIVersionDiscoveryTov2APIVersionDiscovery(in, out, s)
+}
+
+func autoConvertv2APIVersionDiscoveryTov2beta1APIVersionDiscovery(in *v2.APIVersionDiscovery, out *v2beta1.APIVersionDiscovery, s conversion.Scope) error {
+ out.Version = in.Version
+ out.Resources = *(*[]v2beta1.APIResourceDiscovery)(unsafe.Pointer(&in.Resources))
+ out.Freshness = v2beta1.DiscoveryFreshness(in.Freshness)
+ return nil
+}
+
+// Convertv2APIVersionDiscoveryTov2beta1APIVersionDiscovery is an autogenerated conversion function.
+func Convertv2APIVersionDiscoveryTov2beta1APIVersionDiscovery(in *v2.APIVersionDiscovery, out *v2beta1.APIVersionDiscovery, s conversion.Scope) error {
+ return autoConvertv2APIVersionDiscoveryTov2beta1APIVersionDiscovery(in, out, s)
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/doc.go b/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/doc.go
similarity index 79%
rename from vendor/k8s.io/apiserver/pkg/apis/config/doc.go
rename to vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/doc.go
index 338d4cebfa8..579dc0bb25e 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/config/doc.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/doc.go
@@ -1,5 +1,5 @@
/*
-Copyright 2018 The Kubernetes Authors.
+Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// +k8s:deepcopy-gen=package
+// +groupName=apidiscovery.k8s.io
-package config // import "k8s.io/apiserver/pkg/apis/config"
+package v2 // import "k8s.io/apiserver/pkg/apis/apidiscovery/v2"
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/register.go b/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/register.go
new file mode 100644
index 00000000000..02c45b9cf8c
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/register.go
@@ -0,0 +1,39 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v2
+
+import (
+ apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "apidiscovery.k8s.io"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = &apidiscoveryv2.SchemeBuilder
+ // AddToScheme adds api to a scheme
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/register.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/register.go
index d42852d93e6..fd0b087c8dc 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/register.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/register.go
@@ -45,6 +45,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&AdmissionConfiguration{},
&AuthenticationConfiguration{},
&AuthorizationConfiguration{},
+ &EncryptionConfiguration{},
&EgressSelectorConfiguration{},
&TracingConfiguration{},
)
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go
index f3b4ae321ef..af70fe24460 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go
@@ -165,6 +165,25 @@ type AuthenticationConfiguration struct {
metav1.TypeMeta
JWT []JWTAuthenticator
+
+ // If present --anonymous-auth must not be set
+ Anonymous *AnonymousAuthConfig
+}
+
+// AnonymousAuthConfig provides the configuration for the anonymous authenticator.
+type AnonymousAuthConfig struct {
+ Enabled bool
+
+ // If set, anonymous auth is only allowed if the request meets one of the
+ // conditions.
+ Conditions []AnonymousAuthCondition
+}
+
+// AnonymousAuthCondition describes the condition under which anonymous auth
+// should be enabled.
+type AnonymousAuthCondition struct {
+ // Path for which anonymous auth is enabled.
+ Path string
}
// JWTAuthenticator provides the configuration for a single JWT authenticator.
@@ -175,13 +194,56 @@ type JWTAuthenticator struct {
UserValidationRules []UserValidationRule
}
-// Issuer provides the configuration for a external provider specific settings.
+// Issuer provides the configuration for an external provider's specific settings.
type Issuer struct {
- URL string
+ // url points to the issuer URL in a format https://url or https://url/path.
+ // This must match the "iss" claim in the presented JWT, and the issuer returned from discovery.
+ // Same value as the --oidc-issuer-url flag.
+ // Discovery information is fetched from "{url}/.well-known/openid-configuration" unless overridden by discoveryURL.
+ // Required to be unique across all JWT authenticators.
+ // Note that egress selection configuration is not used for this network connection.
+ // +required
+ URL string
+ // discoveryURL, if specified, overrides the URL used to fetch discovery
+ // information instead of using "{url}/.well-known/openid-configuration".
+ // The exact value specified is used, so "/.well-known/openid-configuration"
+ // must be included in discoveryURL if needed.
+ //
+ // The "issuer" field in the fetched discovery information must match the "issuer.url" field
+ // in the AuthenticationConfiguration and will be used to validate the "iss" claim in the presented JWT.
+ // This is for scenarios where the well-known and jwks endpoints are hosted at a different
+ // location than the issuer (such as locally in the cluster).
+ //
+ // Example:
+ // A discovery url that is exposed using kubernetes service 'oidc' in namespace 'oidc-namespace'
+ // and discovery information is available at '/.well-known/openid-configuration'.
+ // discoveryURL: "https://oidc.oidc-namespace/.well-known/openid-configuration"
+ // certificateAuthority is used to verify the TLS connection and the hostname on the leaf certificate
+ // must be set to 'oidc.oidc-namespace'.
+ //
+ // curl https://oidc.oidc-namespace/.well-known/openid-configuration (.discoveryURL field)
+ // {
+ // issuer: "https://oidc.example.com" (.url field)
+ // }
+ //
+ // discoveryURL must be different from url.
+ // Required to be unique across all JWT authenticators.
+ // Note that egress selection configuration is not used for this network connection.
+ // +optional
+ DiscoveryURL string
CertificateAuthority string
Audiences []string
+ AudienceMatchPolicy AudienceMatchPolicyType
}
+// AudienceMatchPolicyType is a set of valid values for Issuer.AudienceMatchPolicy
+type AudienceMatchPolicyType string
+
+// Valid types for AudienceMatchPolicyType
+const (
+ AudienceMatchPolicyMatchAny AudienceMatchPolicyType = "MatchAny"
+)
+
// ClaimValidationRule provides the configuration for a single claim validation rule.
type ClaimValidationRule struct {
Claim string
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/types.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/types_encryption.go
similarity index 99%
rename from vendor/k8s.io/apiserver/pkg/apis/config/types.go
rename to vendor/k8s.io/apiserver/pkg/apis/apiserver/types_encryption.go
index bae49e8eee2..fb66305050f 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/config/types.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/types_encryption.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package config
+package apiserver
import (
"fmt"
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/v1/defaults.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/defaults.go
similarity index 100%
rename from vendor/k8s.io/apiserver/pkg/apis/config/v1/defaults.go
rename to vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/defaults.go
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/register.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/register.go
index 8d3bf987f9c..0de8db49711 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/register.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/register.go
@@ -40,13 +40,17 @@ func init() {
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder.Register(addKnownTypes)
+ localSchemeBuilder.Register(addDefaultingFuncs)
}
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&AdmissionConfiguration{},
+ &EncryptionConfiguration{},
)
+ // also register into the v1 group as EncryptionConfig (due to a docs bug)
+ scheme.AddKnownTypeWithName(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "EncryptionConfig"}, &EncryptionConfiguration{})
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/v1/types.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/types_encryption.go
similarity index 100%
rename from vendor/k8s.io/apiserver/pkg/apis/config/v1/types.go
rename to vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/types_encryption.go
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.conversion.go
index 22562c87a07..c0f218742a3 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.conversion.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.conversion.go
@@ -24,6 +24,7 @@ package v1
import (
unsafe "unsafe"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
apiserver "k8s.io/apiserver/pkg/apis/apiserver"
@@ -36,6 +37,16 @@ func init() {
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
+ if err := s.AddGeneratedConversionFunc((*AESConfiguration)(nil), (*apiserver.AESConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_AESConfiguration_To_apiserver_AESConfiguration(a.(*AESConfiguration), b.(*apiserver.AESConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AESConfiguration)(nil), (*AESConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AESConfiguration_To_v1_AESConfiguration(a.(*apiserver.AESConfiguration), b.(*AESConfiguration), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddGeneratedConversionFunc((*AdmissionConfiguration)(nil), (*apiserver.AdmissionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_AdmissionConfiguration_To_apiserver_AdmissionConfiguration(a.(*AdmissionConfiguration), b.(*apiserver.AdmissionConfiguration), scope)
}); err != nil {
@@ -56,9 +67,99 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddGeneratedConversionFunc((*EncryptionConfiguration)(nil), (*apiserver.EncryptionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_EncryptionConfiguration_To_apiserver_EncryptionConfiguration(a.(*EncryptionConfiguration), b.(*apiserver.EncryptionConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.EncryptionConfiguration)(nil), (*EncryptionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_EncryptionConfiguration_To_v1_EncryptionConfiguration(a.(*apiserver.EncryptionConfiguration), b.(*EncryptionConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*IdentityConfiguration)(nil), (*apiserver.IdentityConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_IdentityConfiguration_To_apiserver_IdentityConfiguration(a.(*IdentityConfiguration), b.(*apiserver.IdentityConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.IdentityConfiguration)(nil), (*IdentityConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_IdentityConfiguration_To_v1_IdentityConfiguration(a.(*apiserver.IdentityConfiguration), b.(*IdentityConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*KMSConfiguration)(nil), (*apiserver.KMSConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_KMSConfiguration_To_apiserver_KMSConfiguration(a.(*KMSConfiguration), b.(*apiserver.KMSConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.KMSConfiguration)(nil), (*KMSConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_KMSConfiguration_To_v1_KMSConfiguration(a.(*apiserver.KMSConfiguration), b.(*KMSConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*Key)(nil), (*apiserver.Key)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_Key_To_apiserver_Key(a.(*Key), b.(*apiserver.Key), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.Key)(nil), (*Key)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_Key_To_v1_Key(a.(*apiserver.Key), b.(*Key), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*ProviderConfiguration)(nil), (*apiserver.ProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ProviderConfiguration_To_apiserver_ProviderConfiguration(a.(*ProviderConfiguration), b.(*apiserver.ProviderConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.ProviderConfiguration)(nil), (*ProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_ProviderConfiguration_To_v1_ProviderConfiguration(a.(*apiserver.ProviderConfiguration), b.(*ProviderConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*ResourceConfiguration)(nil), (*apiserver.ResourceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_ResourceConfiguration_To_apiserver_ResourceConfiguration(a.(*ResourceConfiguration), b.(*apiserver.ResourceConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.ResourceConfiguration)(nil), (*ResourceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_ResourceConfiguration_To_v1_ResourceConfiguration(a.(*apiserver.ResourceConfiguration), b.(*ResourceConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*SecretboxConfiguration)(nil), (*apiserver.SecretboxConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1_SecretboxConfiguration_To_apiserver_SecretboxConfiguration(a.(*SecretboxConfiguration), b.(*apiserver.SecretboxConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.SecretboxConfiguration)(nil), (*SecretboxConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_SecretboxConfiguration_To_v1_SecretboxConfiguration(a.(*apiserver.SecretboxConfiguration), b.(*SecretboxConfiguration), scope)
+ }); err != nil {
+ return err
+ }
return nil
}
+func autoConvert_v1_AESConfiguration_To_apiserver_AESConfiguration(in *AESConfiguration, out *apiserver.AESConfiguration, s conversion.Scope) error {
+ out.Keys = *(*[]apiserver.Key)(unsafe.Pointer(&in.Keys))
+ return nil
+}
+
+// Convert_v1_AESConfiguration_To_apiserver_AESConfiguration is an autogenerated conversion function.
+func Convert_v1_AESConfiguration_To_apiserver_AESConfiguration(in *AESConfiguration, out *apiserver.AESConfiguration, s conversion.Scope) error {
+ return autoConvert_v1_AESConfiguration_To_apiserver_AESConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_AESConfiguration_To_v1_AESConfiguration(in *apiserver.AESConfiguration, out *AESConfiguration, s conversion.Scope) error {
+ out.Keys = *(*[]Key)(unsafe.Pointer(&in.Keys))
+ return nil
+}
+
+// Convert_apiserver_AESConfiguration_To_v1_AESConfiguration is an autogenerated conversion function.
+func Convert_apiserver_AESConfiguration_To_v1_AESConfiguration(in *apiserver.AESConfiguration, out *AESConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_AESConfiguration_To_v1_AESConfiguration(in, out, s)
+}
+
func autoConvert_v1_AdmissionConfiguration_To_apiserver_AdmissionConfiguration(in *AdmissionConfiguration, out *apiserver.AdmissionConfiguration, s conversion.Scope) error {
out.Plugins = *(*[]apiserver.AdmissionPluginConfiguration)(unsafe.Pointer(&in.Plugins))
return nil
@@ -102,3 +203,161 @@ func autoConvert_apiserver_AdmissionPluginConfiguration_To_v1_AdmissionPluginCon
func Convert_apiserver_AdmissionPluginConfiguration_To_v1_AdmissionPluginConfiguration(in *apiserver.AdmissionPluginConfiguration, out *AdmissionPluginConfiguration, s conversion.Scope) error {
return autoConvert_apiserver_AdmissionPluginConfiguration_To_v1_AdmissionPluginConfiguration(in, out, s)
}
+
+func autoConvert_v1_EncryptionConfiguration_To_apiserver_EncryptionConfiguration(in *EncryptionConfiguration, out *apiserver.EncryptionConfiguration, s conversion.Scope) error {
+ out.Resources = *(*[]apiserver.ResourceConfiguration)(unsafe.Pointer(&in.Resources))
+ return nil
+}
+
+// Convert_v1_EncryptionConfiguration_To_apiserver_EncryptionConfiguration is an autogenerated conversion function.
+func Convert_v1_EncryptionConfiguration_To_apiserver_EncryptionConfiguration(in *EncryptionConfiguration, out *apiserver.EncryptionConfiguration, s conversion.Scope) error {
+ return autoConvert_v1_EncryptionConfiguration_To_apiserver_EncryptionConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_EncryptionConfiguration_To_v1_EncryptionConfiguration(in *apiserver.EncryptionConfiguration, out *EncryptionConfiguration, s conversion.Scope) error {
+ out.Resources = *(*[]ResourceConfiguration)(unsafe.Pointer(&in.Resources))
+ return nil
+}
+
+// Convert_apiserver_EncryptionConfiguration_To_v1_EncryptionConfiguration is an autogenerated conversion function.
+func Convert_apiserver_EncryptionConfiguration_To_v1_EncryptionConfiguration(in *apiserver.EncryptionConfiguration, out *EncryptionConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_EncryptionConfiguration_To_v1_EncryptionConfiguration(in, out, s)
+}
+
+func autoConvert_v1_IdentityConfiguration_To_apiserver_IdentityConfiguration(in *IdentityConfiguration, out *apiserver.IdentityConfiguration, s conversion.Scope) error {
+ return nil
+}
+
+// Convert_v1_IdentityConfiguration_To_apiserver_IdentityConfiguration is an autogenerated conversion function.
+func Convert_v1_IdentityConfiguration_To_apiserver_IdentityConfiguration(in *IdentityConfiguration, out *apiserver.IdentityConfiguration, s conversion.Scope) error {
+ return autoConvert_v1_IdentityConfiguration_To_apiserver_IdentityConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_IdentityConfiguration_To_v1_IdentityConfiguration(in *apiserver.IdentityConfiguration, out *IdentityConfiguration, s conversion.Scope) error {
+ return nil
+}
+
+// Convert_apiserver_IdentityConfiguration_To_v1_IdentityConfiguration is an autogenerated conversion function.
+func Convert_apiserver_IdentityConfiguration_To_v1_IdentityConfiguration(in *apiserver.IdentityConfiguration, out *IdentityConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_IdentityConfiguration_To_v1_IdentityConfiguration(in, out, s)
+}
+
+func autoConvert_v1_KMSConfiguration_To_apiserver_KMSConfiguration(in *KMSConfiguration, out *apiserver.KMSConfiguration, s conversion.Scope) error {
+ out.APIVersion = in.APIVersion
+ out.Name = in.Name
+ out.CacheSize = (*int32)(unsafe.Pointer(in.CacheSize))
+ out.Endpoint = in.Endpoint
+ out.Timeout = (*metav1.Duration)(unsafe.Pointer(in.Timeout))
+ return nil
+}
+
+// Convert_v1_KMSConfiguration_To_apiserver_KMSConfiguration is an autogenerated conversion function.
+func Convert_v1_KMSConfiguration_To_apiserver_KMSConfiguration(in *KMSConfiguration, out *apiserver.KMSConfiguration, s conversion.Scope) error {
+ return autoConvert_v1_KMSConfiguration_To_apiserver_KMSConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_KMSConfiguration_To_v1_KMSConfiguration(in *apiserver.KMSConfiguration, out *KMSConfiguration, s conversion.Scope) error {
+ out.APIVersion = in.APIVersion
+ out.Name = in.Name
+ out.CacheSize = (*int32)(unsafe.Pointer(in.CacheSize))
+ out.Endpoint = in.Endpoint
+ out.Timeout = (*metav1.Duration)(unsafe.Pointer(in.Timeout))
+ return nil
+}
+
+// Convert_apiserver_KMSConfiguration_To_v1_KMSConfiguration is an autogenerated conversion function.
+func Convert_apiserver_KMSConfiguration_To_v1_KMSConfiguration(in *apiserver.KMSConfiguration, out *KMSConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_KMSConfiguration_To_v1_KMSConfiguration(in, out, s)
+}
+
+func autoConvert_v1_Key_To_apiserver_Key(in *Key, out *apiserver.Key, s conversion.Scope) error {
+ out.Name = in.Name
+ out.Secret = in.Secret
+ return nil
+}
+
+// Convert_v1_Key_To_apiserver_Key is an autogenerated conversion function.
+func Convert_v1_Key_To_apiserver_Key(in *Key, out *apiserver.Key, s conversion.Scope) error {
+ return autoConvert_v1_Key_To_apiserver_Key(in, out, s)
+}
+
+func autoConvert_apiserver_Key_To_v1_Key(in *apiserver.Key, out *Key, s conversion.Scope) error {
+ out.Name = in.Name
+ out.Secret = in.Secret
+ return nil
+}
+
+// Convert_apiserver_Key_To_v1_Key is an autogenerated conversion function.
+func Convert_apiserver_Key_To_v1_Key(in *apiserver.Key, out *Key, s conversion.Scope) error {
+ return autoConvert_apiserver_Key_To_v1_Key(in, out, s)
+}
+
+func autoConvert_v1_ProviderConfiguration_To_apiserver_ProviderConfiguration(in *ProviderConfiguration, out *apiserver.ProviderConfiguration, s conversion.Scope) error {
+ out.AESGCM = (*apiserver.AESConfiguration)(unsafe.Pointer(in.AESGCM))
+ out.AESCBC = (*apiserver.AESConfiguration)(unsafe.Pointer(in.AESCBC))
+ out.Secretbox = (*apiserver.SecretboxConfiguration)(unsafe.Pointer(in.Secretbox))
+ out.Identity = (*apiserver.IdentityConfiguration)(unsafe.Pointer(in.Identity))
+ out.KMS = (*apiserver.KMSConfiguration)(unsafe.Pointer(in.KMS))
+ return nil
+}
+
+// Convert_v1_ProviderConfiguration_To_apiserver_ProviderConfiguration is an autogenerated conversion function.
+func Convert_v1_ProviderConfiguration_To_apiserver_ProviderConfiguration(in *ProviderConfiguration, out *apiserver.ProviderConfiguration, s conversion.Scope) error {
+ return autoConvert_v1_ProviderConfiguration_To_apiserver_ProviderConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_ProviderConfiguration_To_v1_ProviderConfiguration(in *apiserver.ProviderConfiguration, out *ProviderConfiguration, s conversion.Scope) error {
+ out.AESGCM = (*AESConfiguration)(unsafe.Pointer(in.AESGCM))
+ out.AESCBC = (*AESConfiguration)(unsafe.Pointer(in.AESCBC))
+ out.Secretbox = (*SecretboxConfiguration)(unsafe.Pointer(in.Secretbox))
+ out.Identity = (*IdentityConfiguration)(unsafe.Pointer(in.Identity))
+ out.KMS = (*KMSConfiguration)(unsafe.Pointer(in.KMS))
+ return nil
+}
+
+// Convert_apiserver_ProviderConfiguration_To_v1_ProviderConfiguration is an autogenerated conversion function.
+func Convert_apiserver_ProviderConfiguration_To_v1_ProviderConfiguration(in *apiserver.ProviderConfiguration, out *ProviderConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_ProviderConfiguration_To_v1_ProviderConfiguration(in, out, s)
+}
+
+func autoConvert_v1_ResourceConfiguration_To_apiserver_ResourceConfiguration(in *ResourceConfiguration, out *apiserver.ResourceConfiguration, s conversion.Scope) error {
+ out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
+ out.Providers = *(*[]apiserver.ProviderConfiguration)(unsafe.Pointer(&in.Providers))
+ return nil
+}
+
+// Convert_v1_ResourceConfiguration_To_apiserver_ResourceConfiguration is an autogenerated conversion function.
+func Convert_v1_ResourceConfiguration_To_apiserver_ResourceConfiguration(in *ResourceConfiguration, out *apiserver.ResourceConfiguration, s conversion.Scope) error {
+ return autoConvert_v1_ResourceConfiguration_To_apiserver_ResourceConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_ResourceConfiguration_To_v1_ResourceConfiguration(in *apiserver.ResourceConfiguration, out *ResourceConfiguration, s conversion.Scope) error {
+ out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
+ out.Providers = *(*[]ProviderConfiguration)(unsafe.Pointer(&in.Providers))
+ return nil
+}
+
+// Convert_apiserver_ResourceConfiguration_To_v1_ResourceConfiguration is an autogenerated conversion function.
+func Convert_apiserver_ResourceConfiguration_To_v1_ResourceConfiguration(in *apiserver.ResourceConfiguration, out *ResourceConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_ResourceConfiguration_To_v1_ResourceConfiguration(in, out, s)
+}
+
+func autoConvert_v1_SecretboxConfiguration_To_apiserver_SecretboxConfiguration(in *SecretboxConfiguration, out *apiserver.SecretboxConfiguration, s conversion.Scope) error {
+ out.Keys = *(*[]apiserver.Key)(unsafe.Pointer(&in.Keys))
+ return nil
+}
+
+// Convert_v1_SecretboxConfiguration_To_apiserver_SecretboxConfiguration is an autogenerated conversion function.
+func Convert_v1_SecretboxConfiguration_To_apiserver_SecretboxConfiguration(in *SecretboxConfiguration, out *apiserver.SecretboxConfiguration, s conversion.Scope) error {
+ return autoConvert_v1_SecretboxConfiguration_To_apiserver_SecretboxConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_SecretboxConfiguration_To_v1_SecretboxConfiguration(in *apiserver.SecretboxConfiguration, out *SecretboxConfiguration, s conversion.Scope) error {
+ out.Keys = *(*[]Key)(unsafe.Pointer(&in.Keys))
+ return nil
+}
+
+// Convert_apiserver_SecretboxConfiguration_To_v1_SecretboxConfiguration is an autogenerated conversion function.
+func Convert_apiserver_SecretboxConfiguration_To_v1_SecretboxConfiguration(in *apiserver.SecretboxConfiguration, out *SecretboxConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_SecretboxConfiguration_To_v1_SecretboxConfiguration(in, out, s)
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.deepcopy.go
index d1bc5e01f59..cbdcaa5a06c 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.deepcopy.go
@@ -22,9 +22,31 @@ limitations under the License.
package v1
import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AESConfiguration) DeepCopyInto(out *AESConfiguration) {
+ *out = *in
+ if in.Keys != nil {
+ in, out := &in.Keys, &out.Keys
+ *out = make([]Key, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AESConfiguration.
+func (in *AESConfiguration) DeepCopy() *AESConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(AESConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdmissionConfiguration) DeepCopyInto(out *AdmissionConfiguration) {
*out = *in
@@ -77,3 +99,183 @@ func (in *AdmissionPluginConfiguration) DeepCopy() *AdmissionPluginConfiguration
in.DeepCopyInto(out)
return out
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *EncryptionConfiguration) DeepCopyInto(out *EncryptionConfiguration) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]ResourceConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionConfiguration.
+func (in *EncryptionConfiguration) DeepCopy() *EncryptionConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(EncryptionConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *EncryptionConfiguration) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IdentityConfiguration) DeepCopyInto(out *IdentityConfiguration) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityConfiguration.
+func (in *IdentityConfiguration) DeepCopy() *IdentityConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(IdentityConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KMSConfiguration) DeepCopyInto(out *KMSConfiguration) {
+ *out = *in
+ if in.CacheSize != nil {
+ in, out := &in.CacheSize, &out.CacheSize
+ *out = new(int32)
+ **out = **in
+ }
+ if in.Timeout != nil {
+ in, out := &in.Timeout, &out.Timeout
+ *out = new(metav1.Duration)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSConfiguration.
+func (in *KMSConfiguration) DeepCopy() *KMSConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(KMSConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Key) DeepCopyInto(out *Key) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Key.
+func (in *Key) DeepCopy() *Key {
+ if in == nil {
+ return nil
+ }
+ out := new(Key)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ProviderConfiguration) DeepCopyInto(out *ProviderConfiguration) {
+ *out = *in
+ if in.AESGCM != nil {
+ in, out := &in.AESGCM, &out.AESGCM
+ *out = new(AESConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.AESCBC != nil {
+ in, out := &in.AESCBC, &out.AESCBC
+ *out = new(AESConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Secretbox != nil {
+ in, out := &in.Secretbox, &out.Secretbox
+ *out = new(SecretboxConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Identity != nil {
+ in, out := &in.Identity, &out.Identity
+ *out = new(IdentityConfiguration)
+ **out = **in
+ }
+ if in.KMS != nil {
+ in, out := &in.KMS, &out.KMS
+ *out = new(KMSConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfiguration.
+func (in *ProviderConfiguration) DeepCopy() *ProviderConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(ProviderConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResourceConfiguration) DeepCopyInto(out *ResourceConfiguration) {
+ *out = *in
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Providers != nil {
+ in, out := &in.Providers, &out.Providers
+ *out = make([]ProviderConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceConfiguration.
+func (in *ResourceConfiguration) DeepCopy() *ResourceConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(ResourceConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SecretboxConfiguration) DeepCopyInto(out *SecretboxConfiguration) {
+ *out = *in
+ if in.Keys != nil {
+ in, out := &in.Keys, &out.Keys
+ *out = make([]Key, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretboxConfiguration.
+func (in *SecretboxConfiguration) DeepCopy() *SecretboxConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(SecretboxConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.defaults.go
index dac177e93bd..82fec011102 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.defaults.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1/zz_generated.defaults.go
@@ -29,5 +29,18 @@ import (
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
+ scheme.AddTypeDefaultingFunc(&EncryptionConfiguration{}, func(obj interface{}) { SetObjectDefaults_EncryptionConfiguration(obj.(*EncryptionConfiguration)) })
return nil
}
+
+func SetObjectDefaults_EncryptionConfiguration(in *EncryptionConfiguration) {
+ for i := range in.Resources {
+ a := &in.Resources[i]
+ for j := range a.Providers {
+ b := &a.Providers[j]
+ if b.KMS != nil {
+ SetDefaults_KMSConfiguration(b.KMS)
+ }
+ }
+ }
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go
index 9394ba6f70a..214ef4e4fca 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go
@@ -176,7 +176,34 @@ type AuthenticationConfiguration struct {
// authenticators is neither defined nor stable across releases. Since
// each JWT authenticator must have a unique issuer URL, at most one
// JWT authenticator will attempt to cryptographically validate the token.
+ //
+ // The minimum valid JWT payload must contain the following claims:
+ // {
+ // "iss": "https://issuer.example.com",
+ // "aud": ["audience"],
+ // "exp": 1234567890,
+ // "": "username"
+ // }
JWT []JWTAuthenticator `json:"jwt"`
+
+ // If present --anonymous-auth must not be set
+ Anonymous *AnonymousAuthConfig `json:"anonymous,omitempty"`
+}
+
+// AnonymousAuthConfig provides the configuration for the anonymous authenticator.
+type AnonymousAuthConfig struct {
+ Enabled bool `json:"enabled"`
+
+ // If set, anonymous auth is only allowed if the request meets one of the
+ // conditions.
+ Conditions []AnonymousAuthCondition `json:"conditions,omitempty"`
+}
+
+// AnonymousAuthCondition describes the condition under which anonymous auth
+// should be enabled.
+type AnonymousAuthCondition struct {
+ // Path for which anonymous auth is enabled.
+ Path string `json:"path"`
}
// JWTAuthenticator provides the configuration for a single JWT authenticator.
@@ -201,17 +228,45 @@ type JWTAuthenticator struct {
UserValidationRules []UserValidationRule `json:"userValidationRules,omitempty"`
}
-// Issuer provides the configuration for a external provider specific settings.
+// Issuer provides the configuration for an external provider's specific settings.
type Issuer struct {
// url points to the issuer URL in a format https://url or https://url/path.
// This must match the "iss" claim in the presented JWT, and the issuer returned from discovery.
// Same value as the --oidc-issuer-url flag.
- // Used to fetch discovery information unless overridden by discoveryURL.
- // Required to be unique.
+ // Discovery information is fetched from "{url}/.well-known/openid-configuration" unless overridden by discoveryURL.
+ // Required to be unique across all JWT authenticators.
// Note that egress selection configuration is not used for this network connection.
// +required
URL string `json:"url"`
+ // discoveryURL, if specified, overrides the URL used to fetch discovery
+ // information instead of using "{url}/.well-known/openid-configuration".
+ // The exact value specified is used, so "/.well-known/openid-configuration"
+ // must be included in discoveryURL if needed.
+ //
+ // The "issuer" field in the fetched discovery information must match the "issuer.url" field
+ // in the AuthenticationConfiguration and will be used to validate the "iss" claim in the presented JWT.
+ // This is for scenarios where the well-known and jwks endpoints are hosted at a different
+ // location than the issuer (such as locally in the cluster).
+ //
+ // Example:
+ // A discovery url that is exposed using kubernetes service 'oidc' in namespace 'oidc-namespace'
+ // and discovery information is available at '/.well-known/openid-configuration'.
+ // discoveryURL: "https://oidc.oidc-namespace/.well-known/openid-configuration"
+ // certificateAuthority is used to verify the TLS connection and the hostname on the leaf certificate
+ // must be set to 'oidc.oidc-namespace'.
+ //
+ // curl https://oidc.oidc-namespace/.well-known/openid-configuration (.discoveryURL field)
+ // {
+ // issuer: "https://oidc.example.com" (.url field)
+ // }
+ //
+ // discoveryURL must be different from url.
+ // Required to be unique across all JWT authenticators.
+ // Note that egress selection configuration is not used for this network connection.
+ // +optional
+ DiscoveryURL *string `json:"discoveryURL,omitempty"`
+
// certificateAuthority contains PEM-encoded certificate authority certificates
// used to validate the connection when fetching discovery information.
// If unset, the system verifier is used.
@@ -225,8 +280,32 @@ type Issuer struct {
// Required to be non-empty.
// +required
Audiences []string `json:"audiences"`
+
+ // audienceMatchPolicy defines how the "audiences" field is used to match the "aud" claim in the presented JWT.
+ // Allowed values are:
+ // 1. "MatchAny" when multiple audiences are specified and
+ // 2. empty (or unset) or "MatchAny" when a single audience is specified.
+ //
+ // - MatchAny: the "aud" claim in the presented JWT must match at least one of the entries in the "audiences" field.
+ // For example, if "audiences" is ["foo", "bar"], the "aud" claim in the presented JWT must contain either "foo" or "bar" (and may contain both).
+ //
+ // - "": The match policy can be empty (or unset) when a single audience is specified in the "audiences" field. The "aud" claim in the presented JWT must contain the single audience (and may contain others).
+ //
+ // For more nuanced audience validation, use claimValidationRules.
+ // example: claimValidationRule[].expression: 'sets.equivalent(claims.aud, ["bar", "foo", "baz"])' to require an exact match.
+ // +optional
+ AudienceMatchPolicy AudienceMatchPolicyType `json:"audienceMatchPolicy,omitempty"`
}
+// AudienceMatchPolicyType is a set of valid values for issuer.audienceMatchPolicy
+type AudienceMatchPolicyType string
+
+// Valid types for AudienceMatchPolicyType
+const (
+ // MatchAny means the "aud" claim in the presented JWT must match at least one of the entries in the "audiences" field.
+ AudienceMatchPolicyMatchAny AudienceMatchPolicyType = "MatchAny"
+)
+
// ClaimValidationRule provides the configuration for a single claim validation rule.
type ClaimValidationRule struct {
// claim is the name of a required claim.
@@ -249,7 +328,7 @@ type ClaimValidationRule struct {
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
- // Nested claims can be accessed using dot notation, e.g. 'claims.email.verified'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
// Must return true for the validation to pass.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
@@ -270,6 +349,10 @@ type ClaimMappings struct {
// The claim's value must be a singular string.
// Same as the --oidc-username-claim and --oidc-username-prefix flags.
// If username.expression is set, the expression must produce a string value.
+ // If username.expression uses 'claims.email', then 'claims.email_verified' must be used in
+ // username.expression or extra[*].valueExpression or claimValidationRules[*].expression.
+ // An example claim validation rule expression that matches the validation automatically
+ // applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true)'.
//
// In the flag based approach, the --oidc-username-claim and --oidc-username-prefix are optional. If --oidc-username-claim is not set,
// the default value is "sub". For the authentication config, there is no defaulting for claim or prefix. The claim and prefix must be set explicitly.
@@ -279,7 +362,7 @@ type ClaimMappings struct {
// set username.prefix=""
// (2) --oidc-username-prefix="" and --oidc-username-claim != "email", prefix was "#". For the same
// behavior using authentication config, set username.prefix="#"
- // (3) --oidc-username-prefix="". For the same behavior using authentication config, set username.prefix=""
+ // (3) --oidc-username-prefix="". For the same behavior using authentication config, set username.prefix=""
// +required
Username PrefixedClaimOrExpression `json:"username"`
// groups represents an option for the groups attribute.
@@ -338,7 +421,7 @@ type PrefixedClaimOrExpression struct {
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
- // Nested claims can be accessed using dot notation, e.g. 'claims.email.verified'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
@@ -360,7 +443,7 @@ type ClaimOrExpression struct {
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
- // Nested claims can be accessed using dot notation, e.g. 'claims.email.verified'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
@@ -376,6 +459,7 @@ type ExtraMapping struct {
// subdomain as defined by RFC 1123. All characters trailing the first "/" must
// be valid HTTP Path characters as defined by RFC 3986.
// key must be lowercase.
+ // Required to be unique.
// +required
Key string `json:"key"`
@@ -387,7 +471,7 @@ type ExtraMapping struct {
// CEL expressions have access to the contents of the token claims, organized into CEL variable:
// - 'claims' is a map of claim names to claim values.
// For example, a variable named 'sub' can be accessed as 'claims.sub'.
- // Nested claims can be accessed using dot notation, e.g. 'claims.email.verified'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
//
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go
index 92060206840..3a6c66c3aac 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go
@@ -24,6 +24,7 @@ package v1alpha1
import (
unsafe "unsafe"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
apiserver "k8s.io/apiserver/pkg/apis/apiserver"
@@ -56,6 +57,26 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddGeneratedConversionFunc((*AnonymousAuthCondition)(nil), (*apiserver.AnonymousAuthCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(a.(*AnonymousAuthCondition), b.(*apiserver.AnonymousAuthCondition), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AnonymousAuthCondition)(nil), (*AnonymousAuthCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AnonymousAuthCondition_To_v1alpha1_AnonymousAuthCondition(a.(*apiserver.AnonymousAuthCondition), b.(*AnonymousAuthCondition), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*AnonymousAuthConfig)(nil), (*apiserver.AnonymousAuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(a.(*AnonymousAuthConfig), b.(*apiserver.AnonymousAuthConfig), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AnonymousAuthConfig)(nil), (*AnonymousAuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AnonymousAuthConfig_To_v1alpha1_AnonymousAuthConfig(a.(*apiserver.AnonymousAuthConfig), b.(*AnonymousAuthConfig), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddGeneratedConversionFunc((*AuthenticationConfiguration)(nil), (*apiserver.AuthenticationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_AuthenticationConfiguration_To_apiserver_AuthenticationConfiguration(a.(*AuthenticationConfiguration), b.(*apiserver.AuthenticationConfiguration), scope)
}); err != nil {
@@ -323,8 +344,61 @@ func Convert_apiserver_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginC
return autoConvert_apiserver_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration(in, out, s)
}
+func autoConvert_v1alpha1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(in *AnonymousAuthCondition, out *apiserver.AnonymousAuthCondition, s conversion.Scope) error {
+ out.Path = in.Path
+ return nil
+}
+
+// Convert_v1alpha1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition is an autogenerated conversion function.
+func Convert_v1alpha1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(in *AnonymousAuthCondition, out *apiserver.AnonymousAuthCondition, s conversion.Scope) error {
+ return autoConvert_v1alpha1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(in, out, s)
+}
+
+func autoConvert_apiserver_AnonymousAuthCondition_To_v1alpha1_AnonymousAuthCondition(in *apiserver.AnonymousAuthCondition, out *AnonymousAuthCondition, s conversion.Scope) error {
+ out.Path = in.Path
+ return nil
+}
+
+// Convert_apiserver_AnonymousAuthCondition_To_v1alpha1_AnonymousAuthCondition is an autogenerated conversion function.
+func Convert_apiserver_AnonymousAuthCondition_To_v1alpha1_AnonymousAuthCondition(in *apiserver.AnonymousAuthCondition, out *AnonymousAuthCondition, s conversion.Scope) error {
+ return autoConvert_apiserver_AnonymousAuthCondition_To_v1alpha1_AnonymousAuthCondition(in, out, s)
+}
+
+func autoConvert_v1alpha1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(in *AnonymousAuthConfig, out *apiserver.AnonymousAuthConfig, s conversion.Scope) error {
+ out.Enabled = in.Enabled
+ out.Conditions = *(*[]apiserver.AnonymousAuthCondition)(unsafe.Pointer(&in.Conditions))
+ return nil
+}
+
+// Convert_v1alpha1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig is an autogenerated conversion function.
+func Convert_v1alpha1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(in *AnonymousAuthConfig, out *apiserver.AnonymousAuthConfig, s conversion.Scope) error {
+ return autoConvert_v1alpha1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(in, out, s)
+}
+
+func autoConvert_apiserver_AnonymousAuthConfig_To_v1alpha1_AnonymousAuthConfig(in *apiserver.AnonymousAuthConfig, out *AnonymousAuthConfig, s conversion.Scope) error {
+ out.Enabled = in.Enabled
+ out.Conditions = *(*[]AnonymousAuthCondition)(unsafe.Pointer(&in.Conditions))
+ return nil
+}
+
+// Convert_apiserver_AnonymousAuthConfig_To_v1alpha1_AnonymousAuthConfig is an autogenerated conversion function.
+func Convert_apiserver_AnonymousAuthConfig_To_v1alpha1_AnonymousAuthConfig(in *apiserver.AnonymousAuthConfig, out *AnonymousAuthConfig, s conversion.Scope) error {
+ return autoConvert_apiserver_AnonymousAuthConfig_To_v1alpha1_AnonymousAuthConfig(in, out, s)
+}
+
func autoConvert_v1alpha1_AuthenticationConfiguration_To_apiserver_AuthenticationConfiguration(in *AuthenticationConfiguration, out *apiserver.AuthenticationConfiguration, s conversion.Scope) error {
- out.JWT = *(*[]apiserver.JWTAuthenticator)(unsafe.Pointer(&in.JWT))
+ if in.JWT != nil {
+ in, out := &in.JWT, &out.JWT
+ *out = make([]apiserver.JWTAuthenticator, len(*in))
+ for i := range *in {
+ if err := Convert_v1alpha1_JWTAuthenticator_To_apiserver_JWTAuthenticator(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.JWT = nil
+ }
+ out.Anonymous = (*apiserver.AnonymousAuthConfig)(unsafe.Pointer(in.Anonymous))
return nil
}
@@ -334,7 +408,18 @@ func Convert_v1alpha1_AuthenticationConfiguration_To_apiserver_AuthenticationCon
}
func autoConvert_apiserver_AuthenticationConfiguration_To_v1alpha1_AuthenticationConfiguration(in *apiserver.AuthenticationConfiguration, out *AuthenticationConfiguration, s conversion.Scope) error {
- out.JWT = *(*[]JWTAuthenticator)(unsafe.Pointer(&in.JWT))
+ if in.JWT != nil {
+ in, out := &in.JWT, &out.JWT
+ *out = make([]JWTAuthenticator, len(*in))
+ for i := range *in {
+ if err := Convert_apiserver_JWTAuthenticator_To_v1alpha1_JWTAuthenticator(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.JWT = nil
+ }
+ out.Anonymous = (*AnonymousAuthConfig)(unsafe.Pointer(in.Anonymous))
return nil
}
@@ -580,8 +665,12 @@ func Convert_apiserver_ExtraMapping_To_v1alpha1_ExtraMapping(in *apiserver.Extra
func autoConvert_v1alpha1_Issuer_To_apiserver_Issuer(in *Issuer, out *apiserver.Issuer, s conversion.Scope) error {
out.URL = in.URL
+ if err := v1.Convert_Pointer_string_To_string(&in.DiscoveryURL, &out.DiscoveryURL, s); err != nil {
+ return err
+ }
out.CertificateAuthority = in.CertificateAuthority
out.Audiences = *(*[]string)(unsafe.Pointer(&in.Audiences))
+ out.AudienceMatchPolicy = apiserver.AudienceMatchPolicyType(in.AudienceMatchPolicy)
return nil
}
@@ -592,8 +681,12 @@ func Convert_v1alpha1_Issuer_To_apiserver_Issuer(in *Issuer, out *apiserver.Issu
func autoConvert_apiserver_Issuer_To_v1alpha1_Issuer(in *apiserver.Issuer, out *Issuer, s conversion.Scope) error {
out.URL = in.URL
+ if err := v1.Convert_string_To_Pointer_string(&in.DiscoveryURL, &out.DiscoveryURL, s); err != nil {
+ return err
+ }
out.CertificateAuthority = in.CertificateAuthority
out.Audiences = *(*[]string)(unsafe.Pointer(&in.Audiences))
+ out.AudienceMatchPolicy = AudienceMatchPolicyType(in.AudienceMatchPolicy)
return nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go
index 932af612707..81b652254cb 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go
@@ -78,6 +78,43 @@ func (in *AdmissionPluginConfiguration) DeepCopy() *AdmissionPluginConfiguration
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AnonymousAuthCondition) DeepCopyInto(out *AnonymousAuthCondition) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnonymousAuthCondition.
+func (in *AnonymousAuthCondition) DeepCopy() *AnonymousAuthCondition {
+ if in == nil {
+ return nil
+ }
+ out := new(AnonymousAuthCondition)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AnonymousAuthConfig) DeepCopyInto(out *AnonymousAuthConfig) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]AnonymousAuthCondition, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnonymousAuthConfig.
+func (in *AnonymousAuthConfig) DeepCopy() *AnonymousAuthConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(AnonymousAuthConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AuthenticationConfiguration) DeepCopyInto(out *AuthenticationConfiguration) {
*out = *in
@@ -89,6 +126,11 @@ func (in *AuthenticationConfiguration) DeepCopyInto(out *AuthenticationConfigura
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.Anonymous != nil {
+ in, out := &in.Anonymous, &out.Anonymous
+ *out = new(AnonymousAuthConfig)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -308,6 +350,11 @@ func (in *ExtraMapping) DeepCopy() *ExtraMapping {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Issuer) DeepCopyInto(out *Issuer) {
*out = *in
+ if in.DiscoveryURL != nil {
+ in, out := &in.DiscoveryURL, &out.DiscoveryURL
+ *out = new(string)
+ **out = **in
+ }
if in.Audiences != nil {
in, out := &in.Audiences, &out.Audiences
*out = make([]string, len(*in))
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/defaults.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/defaults.go
new file mode 100644
index 00000000000..eebcb6c0025
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/defaults.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1beta1
+
+import (
+ "time"
+
+ "k8s.io/apimachinery/pkg/runtime"
+)
+
+func addDefaultingFuncs(scheme *runtime.Scheme) error {
+ return RegisterDefaults(scheme)
+}
+
+func SetDefaults_WebhookConfiguration(obj *WebhookConfiguration) {
+ if obj.AuthorizedTTL.Duration == 0 {
+ obj.AuthorizedTTL.Duration = 5 * time.Minute
+ }
+ if obj.UnauthorizedTTL.Duration == 0 {
+ obj.UnauthorizedTTL.Duration = 30 * time.Second
+ }
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/register.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/register.go
index 705d2e5eb31..3718a85d186 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/register.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/register.go
@@ -43,7 +43,7 @@ func init() {
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
- localSchemeBuilder.Register(addKnownTypes)
+ localSchemeBuilder.Register(addKnownTypes, addDefaultingFuncs)
}
// Adds the list of known types to the given scheme.
@@ -52,6 +52,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&EgressSelectorConfiguration{},
)
scheme.AddKnownTypes(ConfigSchemeGroupVersion,
+ &AuthenticationConfiguration{},
+ &AuthorizationConfiguration{},
&TracingConfiguration{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go
index c61baea9ff1..570f3c4682b 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go
@@ -129,3 +129,463 @@ type TracingConfiguration struct {
// Embed the component config tracing configuration struct
tracingapi.TracingConfiguration `json:",inline"`
}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// AuthenticationConfiguration provides versioned configuration for authentication.
+type AuthenticationConfiguration struct {
+ metav1.TypeMeta
+
+ // jwt is a list of authenticator to authenticate Kubernetes users using
+ // JWT compliant tokens. The authenticator will attempt to parse a raw ID token,
+ // verify it's been signed by the configured issuer. The public key to verify the
+ // signature is discovered from the issuer's public endpoint using OIDC discovery.
+ // For an incoming token, each JWT authenticator will be attempted in
+ // the order in which it is specified in this list. Note however that
+ // other authenticators may run before or after the JWT authenticators.
+ // The specific position of JWT authenticators in relation to other
+ // authenticators is neither defined nor stable across releases. Since
+ // each JWT authenticator must have a unique issuer URL, at most one
+ // JWT authenticator will attempt to cryptographically validate the token.
+ //
+ // The minimum valid JWT payload must contain the following claims:
+ // {
+ // "iss": "https://issuer.example.com",
+ // "aud": ["audience"],
+ // "exp": 1234567890,
+ // "": "username"
+ // }
+ JWT []JWTAuthenticator `json:"jwt"`
+
+ // If present --anonymous-auth must not be set
+ Anonymous *AnonymousAuthConfig `json:"anonymous,omitempty"`
+}
+
+// AnonymousAuthConfig provides the configuration for the anonymous authenticator.
+type AnonymousAuthConfig struct {
+ Enabled bool `json:"enabled"`
+
+ // If set, anonymous auth is only allowed if the request meets one of the
+ // conditions.
+ Conditions []AnonymousAuthCondition `json:"conditions,omitempty"`
+}
+
+// AnonymousAuthCondition describes the condition under which anonymous auth
+// should be enabled.
+type AnonymousAuthCondition struct {
+ // Path for which anonymous auth is enabled.
+ Path string `json:"path"`
+}
+
+// JWTAuthenticator provides the configuration for a single JWT authenticator.
+type JWTAuthenticator struct {
+ // issuer contains the basic OIDC provider connection options.
+ // +required
+ Issuer Issuer `json:"issuer"`
+
+ // claimValidationRules are rules that are applied to validate token claims to authenticate users.
+ // +optional
+ ClaimValidationRules []ClaimValidationRule `json:"claimValidationRules,omitempty"`
+
+ // claimMappings points claims of a token to be treated as user attributes.
+ // +required
+ ClaimMappings ClaimMappings `json:"claimMappings"`
+
+ // userValidationRules are rules that are applied to final user before completing authentication.
+ // These allow invariants to be applied to incoming identities such as preventing the
+ // use of the system: prefix that is commonly used by Kubernetes components.
+ // The validation rules are logically ANDed together and must all return true for the validation to pass.
+ // +optional
+ UserValidationRules []UserValidationRule `json:"userValidationRules,omitempty"`
+}
+
+// Issuer provides the configuration for an external provider's specific settings.
+type Issuer struct {
+ // url points to the issuer URL in a format https://url or https://url/path.
+ // This must match the "iss" claim in the presented JWT, and the issuer returned from discovery.
+ // Same value as the --oidc-issuer-url flag.
+ // Discovery information is fetched from "{url}/.well-known/openid-configuration" unless overridden by discoveryURL.
+ // Required to be unique across all JWT authenticators.
+ // Note that egress selection configuration is not used for this network connection.
+ // +required
+ URL string `json:"url"`
+
+ // discoveryURL, if specified, overrides the URL used to fetch discovery
+ // information instead of using "{url}/.well-known/openid-configuration".
+ // The exact value specified is used, so "/.well-known/openid-configuration"
+ // must be included in discoveryURL if needed.
+ //
+ // The "issuer" field in the fetched discovery information must match the "issuer.url" field
+ // in the AuthenticationConfiguration and will be used to validate the "iss" claim in the presented JWT.
+ // This is for scenarios where the well-known and jwks endpoints are hosted at a different
+ // location than the issuer (such as locally in the cluster).
+ //
+ // Example:
+ // A discovery url that is exposed using kubernetes service 'oidc' in namespace 'oidc-namespace'
+ // and discovery information is available at '/.well-known/openid-configuration'.
+ // discoveryURL: "https://oidc.oidc-namespace/.well-known/openid-configuration"
+ // certificateAuthority is used to verify the TLS connection and the hostname on the leaf certificate
+ // must be set to 'oidc.oidc-namespace'.
+ //
+ // curl https://oidc.oidc-namespace/.well-known/openid-configuration (.discoveryURL field)
+ // {
+ // issuer: "https://oidc.example.com" (.url field)
+ // }
+ //
+ // discoveryURL must be different from url.
+ // Required to be unique across all JWT authenticators.
+ // Note that egress selection configuration is not used for this network connection.
+ // +optional
+ DiscoveryURL *string `json:"discoveryURL,omitempty"`
+
+ // certificateAuthority contains PEM-encoded certificate authority certificates
+ // used to validate the connection when fetching discovery information.
+ // If unset, the system verifier is used.
+ // Same value as the content of the file referenced by the --oidc-ca-file flag.
+ // +optional
+ CertificateAuthority string `json:"certificateAuthority,omitempty"`
+
+ // audiences is the set of acceptable audiences the JWT must be issued to.
+ // At least one of the entries must match the "aud" claim in presented JWTs.
+ // Same value as the --oidc-client-id flag (though this field supports an array).
+ // Required to be non-empty.
+ // +required
+ Audiences []string `json:"audiences"`
+
+ // audienceMatchPolicy defines how the "audiences" field is used to match the "aud" claim in the presented JWT.
+ // Allowed values are:
+ // 1. "MatchAny" when multiple audiences are specified and
+ // 2. empty (or unset) or "MatchAny" when a single audience is specified.
+ //
+ // - MatchAny: the "aud" claim in the presented JWT must match at least one of the entries in the "audiences" field.
+ // For example, if "audiences" is ["foo", "bar"], the "aud" claim in the presented JWT must contain either "foo" or "bar" (and may contain both).
+ //
+ // - "": The match policy can be empty (or unset) when a single audience is specified in the "audiences" field. The "aud" claim in the presented JWT must contain the single audience (and may contain others).
+ //
+ // For more nuanced audience validation, use claimValidationRules.
+ // example: claimValidationRule[].expression: 'sets.equivalent(claims.aud, ["bar", "foo", "baz"])' to require an exact match.
+ // +optional
+ AudienceMatchPolicy AudienceMatchPolicyType `json:"audienceMatchPolicy,omitempty"`
+}
+
+// AudienceMatchPolicyType is a set of valid values for issuer.audienceMatchPolicy
+type AudienceMatchPolicyType string
+
+// Valid types for AudienceMatchPolicyType
+const (
+ // MatchAny means the "aud" claim in the presented JWT must match at least one of the entries in the "audiences" field.
+ AudienceMatchPolicyMatchAny AudienceMatchPolicyType = "MatchAny"
+)
+
+// ClaimValidationRule provides the configuration for a single claim validation rule.
+type ClaimValidationRule struct {
+ // claim is the name of a required claim.
+ // Same as --oidc-required-claim flag.
+ // Only string claim keys are supported.
+ // Mutually exclusive with expression and message.
+ // +optional
+ Claim string `json:"claim,omitempty"`
+ // requiredValue is the value of a required claim.
+ // Same as --oidc-required-claim flag.
+ // Only string claim values are supported.
+ // If claim is set and requiredValue is not set, the claim must be present with a value set to the empty string.
+ // Mutually exclusive with expression and message.
+ // +optional
+ RequiredValue string `json:"requiredValue,omitempty"`
+
+ // expression represents the expression which will be evaluated by CEL.
+ // Must produce a boolean.
+ //
+ // CEL expressions have access to the contents of the token claims, organized into CEL variable:
+ // - 'claims' is a map of claim names to claim values.
+ // For example, a variable named 'sub' can be accessed as 'claims.sub'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
+ // Must return true for the validation to pass.
+ //
+ // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
+ //
+ // Mutually exclusive with claim and requiredValue.
+ // +optional
+ Expression string `json:"expression,omitempty"`
+ // message customizes the returned error message when expression returns false.
+ // message is a literal string.
+ // Mutually exclusive with claim and requiredValue.
+ // +optional
+ Message string `json:"message,omitempty"`
+}
+
+// ClaimMappings provides the configuration for claim mapping
+type ClaimMappings struct {
+ // username represents an option for the username attribute.
+ // The claim's value must be a singular string.
+ // Same as the --oidc-username-claim and --oidc-username-prefix flags.
+ // If username.expression is set, the expression must produce a string value.
+ // If username.expression uses 'claims.email', then 'claims.email_verified' must be used in
+ // username.expression or extra[*].valueExpression or claimValidationRules[*].expression.
+ // An example claim validation rule expression that matches the validation automatically
+ // applied when username.claim is set to 'email' is 'claims.?email_verified.orValue(true)'.
+ //
+ // In the flag based approach, the --oidc-username-claim and --oidc-username-prefix are optional. If --oidc-username-claim is not set,
+ // the default value is "sub". For the authentication config, there is no defaulting for claim or prefix. The claim and prefix must be set explicitly.
+ // For claim, if --oidc-username-claim was not set with legacy flag approach, configure username.claim="sub" in the authentication config.
+ // For prefix:
+ // (1) --oidc-username-prefix="-", no prefix was added to the username. For the same behavior using authentication config,
+ // set username.prefix=""
+ // (2) --oidc-username-prefix="" and --oidc-username-claim != "email", prefix was "#". For the same
+ // behavior using authentication config, set username.prefix="#"
+ // (3) --oidc-username-prefix="". For the same behavior using authentication config, set username.prefix=""
+ // +required
+ Username PrefixedClaimOrExpression `json:"username"`
+ // groups represents an option for the groups attribute.
+ // The claim's value must be a string or string array claim.
+ // If groups.claim is set, the prefix must be specified (and can be the empty string).
+ // If groups.expression is set, the expression must produce a string or string array value.
+ // "", [], and null values are treated as the group mapping not being present.
+ // +optional
+ Groups PrefixedClaimOrExpression `json:"groups,omitempty"`
+
+ // uid represents an option for the uid attribute.
+ // Claim must be a singular string claim.
+ // If uid.expression is set, the expression must produce a string value.
+ // +optional
+ UID ClaimOrExpression `json:"uid"`
+
+ // extra represents an option for the extra attribute.
+ // expression must produce a string or string array value.
+ // If the value is empty, the extra mapping will not be present.
+ //
+ // hard-coded extra key/value
+ // - key: "foo"
+ // valueExpression: "'bar'"
+ // This will result in an extra attribute - foo: ["bar"]
+ //
+ // hard-coded key, value copying claim value
+ // - key: "foo"
+ // valueExpression: "claims.some_claim"
+ // This will result in an extra attribute - foo: [value of some_claim]
+ //
+ // hard-coded key, value derived from claim value
+ // - key: "admin"
+ // valueExpression: '(has(claims.is_admin) && claims.is_admin) ? "true":""'
+ // This will result in:
+ // - if is_admin claim is present and true, extra attribute - admin: ["true"]
+ // - if is_admin claim is present and false or is_admin claim is not present, no extra attribute will be added
+ //
+ // +optional
+ Extra []ExtraMapping `json:"extra,omitempty"`
+}
+
+// PrefixedClaimOrExpression provides the configuration for a single prefixed claim or expression.
+type PrefixedClaimOrExpression struct {
+ // claim is the JWT claim to use.
+ // Mutually exclusive with expression.
+ // +optional
+ Claim string `json:"claim,omitempty"`
+ // prefix is prepended to claim's value to prevent clashes with existing names.
+ // prefix needs to be set if claim is set and can be the empty string.
+ // Mutually exclusive with expression.
+ // +optional
+ Prefix *string `json:"prefix,omitempty"`
+
+ // expression represents the expression which will be evaluated by CEL.
+ //
+ // CEL expressions have access to the contents of the token claims, organized into CEL variable:
+ // - 'claims' is a map of claim names to claim values.
+ // For example, a variable named 'sub' can be accessed as 'claims.sub'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
+ //
+ // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
+ //
+ // Mutually exclusive with claim and prefix.
+ // +optional
+ Expression string `json:"expression,omitempty"`
+}
+
+// ClaimOrExpression provides the configuration for a single claim or expression.
+type ClaimOrExpression struct {
+ // claim is the JWT claim to use.
+ // Either claim or expression must be set.
+ // Mutually exclusive with expression.
+ // +optional
+ Claim string `json:"claim,omitempty"`
+
+ // expression represents the expression which will be evaluated by CEL.
+ //
+ // CEL expressions have access to the contents of the token claims, organized into CEL variable:
+ // - 'claims' is a map of claim names to claim values.
+ // For example, a variable named 'sub' can be accessed as 'claims.sub'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
+ //
+ // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
+ //
+ // Mutually exclusive with claim.
+ // +optional
+ Expression string `json:"expression,omitempty"`
+}
+
+// ExtraMapping provides the configuration for a single extra mapping.
+type ExtraMapping struct {
+ // key is a string to use as the extra attribute key.
+ // key must be a domain-prefix path (e.g. example.org/foo). All characters before the first "/" must be a valid
+ // subdomain as defined by RFC 1123. All characters trailing the first "/" must
+ // be valid HTTP Path characters as defined by RFC 3986.
+ // key must be lowercase.
+ // Required to be unique.
+ // +required
+ Key string `json:"key"`
+
+ // valueExpression is a CEL expression to extract extra attribute value.
+ // valueExpression must produce a string or string array value.
+ // "", [], and null values are treated as the extra mapping not being present.
+ // Empty string values contained within a string array are filtered out.
+ //
+ // CEL expressions have access to the contents of the token claims, organized into CEL variable:
+ // - 'claims' is a map of claim names to claim values.
+ // For example, a variable named 'sub' can be accessed as 'claims.sub'.
+ // Nested claims can be accessed using dot notation, e.g. 'claims.foo.bar'.
+ //
+ // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
+ //
+ // +required
+ ValueExpression string `json:"valueExpression"`
+}
+
+// UserValidationRule provides the configuration for a single user info validation rule.
+type UserValidationRule struct {
+ // expression represents the expression which will be evaluated by CEL.
+ // Must return true for the validation to pass.
+ //
+ // CEL expressions have access to the contents of UserInfo, organized into CEL variable:
+ // - 'user' - authentication.k8s.io/v1, Kind=UserInfo object
+ // Refer to https://github.com/kubernetes/api/blob/release-1.28/authentication/v1/types.go#L105-L122 for the definition.
+ // API documentation: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#userinfo-v1-authentication-k8s-io
+ //
+ // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
+ //
+ // +required
+ Expression string `json:"expression"`
+
+ // message customizes the returned error message when rule returns false.
+ // message is a literal string.
+ // +optional
+ Message string `json:"message,omitempty"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+type AuthorizationConfiguration struct {
+ metav1.TypeMeta
+
+ // Authorizers is an ordered list of authorizers to
+ // authorize requests against.
+ // This is similar to the --authorization-modes kube-apiserver flag
+ // Must be at least one.
+ Authorizers []AuthorizerConfiguration `json:"authorizers"`
+}
+
+const (
+ TypeWebhook AuthorizerType = "Webhook"
+ FailurePolicyNoOpinion string = "NoOpinion"
+ FailurePolicyDeny string = "Deny"
+ AuthorizationWebhookConnectionInfoTypeKubeConfigFile string = "KubeConfigFile"
+ AuthorizationWebhookConnectionInfoTypeInCluster string = "InClusterConfig"
+)
+
+type AuthorizerType string
+
+type AuthorizerConfiguration struct {
+ // Type refers to the type of the authorizer
+ // "Webhook" is supported in the generic API server
+ // Other API servers may support additional authorizer
+ // types like Node, RBAC, ABAC, etc.
+ Type string `json:"type"`
+
+ // Name used to describe the webhook
+ // This is explicitly used in monitoring machinery for metrics
+ // Note: Names must be DNS1123 labels like `myauthorizername` or
+ // subdomains like `myauthorizer.example.domain`
+ // Required, with no default
+ Name string `json:"name"`
+
+ // Webhook defines the configuration for a Webhook authorizer
+ // Must be defined when Type=Webhook
+ // Must not be defined when Type!=Webhook
+ Webhook *WebhookConfiguration `json:"webhook,omitempty"`
+}
+
+type WebhookConfiguration struct {
+ // The duration to cache 'authorized' responses from the webhook
+ // authorizer.
+ // Same as setting `--authorization-webhook-cache-authorized-ttl` flag
+ // Default: 5m0s
+ AuthorizedTTL metav1.Duration `json:"authorizedTTL"`
+ // The duration to cache 'unauthorized' responses from the webhook
+ // authorizer.
+ // Same as setting `--authorization-webhook-cache-unauthorized-ttl` flag
+ // Default: 30s
+ UnauthorizedTTL metav1.Duration `json:"unauthorizedTTL"`
+ // Timeout for the webhook request
+ // Maximum allowed value is 30s.
+ // Required, no default value.
+ Timeout metav1.Duration `json:"timeout"`
+ // The API version of the authorization.k8s.io SubjectAccessReview to
+ // send to and expect from the webhook.
+ // Same as setting `--authorization-webhook-version` flag
+ // Valid values: v1beta1, v1
+ // Required, no default value
+ SubjectAccessReviewVersion string `json:"subjectAccessReviewVersion"`
+ // MatchConditionSubjectAccessReviewVersion specifies the SubjectAccessReview
+ // version the CEL expressions are evaluated against
+ // Valid values: v1
+ // Required, no default value
+ MatchConditionSubjectAccessReviewVersion string `json:"matchConditionSubjectAccessReviewVersion"`
+ // Controls the authorization decision when a webhook request fails to
+ // complete or returns a malformed response or errors evaluating
+ // matchConditions.
+ // Valid values:
+ // - NoOpinion: continue to subsequent authorizers to see if one of
+ // them allows the request
+ // - Deny: reject the request without consulting subsequent authorizers
+ // Required, with no default.
+ FailurePolicy string `json:"failurePolicy"`
+
+ // ConnectionInfo defines how we talk to the webhook
+ ConnectionInfo WebhookConnectionInfo `json:"connectionInfo"`
+
+ // matchConditions is a list of conditions that must be met for a request to be sent to this
+ // webhook. An empty list of matchConditions matches all requests.
+ // There are a maximum of 64 match conditions allowed.
+ //
+ // The exact matching logic is (in order):
+ // 1. If at least one matchCondition evaluates to FALSE, then the webhook is skipped.
+ // 2. If ALL matchConditions evaluate to TRUE, then the webhook is called.
+ // 3. If at least one matchCondition evaluates to an error (but none are FALSE):
+ // - If failurePolicy=Deny, then the webhook rejects the request
+ // - If failurePolicy=NoOpinion, then the error is ignored and the webhook is skipped
+ MatchConditions []WebhookMatchCondition `json:"matchConditions"`
+}
+
+type WebhookConnectionInfo struct {
+ // Controls how the webhook should communicate with the server.
+ // Valid values:
+ // - KubeConfigFile: use the file specified in kubeConfigFile to locate the
+ // server.
+ // - InClusterConfig: use the in-cluster configuration to call the
+ // SubjectAccessReview API hosted by kube-apiserver. This mode is not
+ // allowed for kube-apiserver.
+ Type string `json:"type"`
+
+ // Path to KubeConfigFile for connection info
+ // Required, if connectionInfo.Type is KubeConfig
+ KubeConfigFile *string `json:"kubeConfigFile"`
+}
+
+type WebhookMatchCondition struct {
+ // expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
+ // CEL expressions have access to the contents of the SubjectAccessReview in v1 version.
+ // If version specified by subjectAccessReviewVersion in the request variable is v1beta1,
+ // the contents would be converted to the v1 version before evaluating the CEL expression.
+ //
+ // Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
+ Expression string `json:"expression"`
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.conversion.go
index ebf810b055b..30ef049d403 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.conversion.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.conversion.go
@@ -24,6 +24,7 @@ package v1beta1
import (
unsafe "unsafe"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
apiserver "k8s.io/apiserver/pkg/apis/apiserver"
@@ -36,6 +37,86 @@ func init() {
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
+ if err := s.AddGeneratedConversionFunc((*AnonymousAuthCondition)(nil), (*apiserver.AnonymousAuthCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(a.(*AnonymousAuthCondition), b.(*apiserver.AnonymousAuthCondition), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AnonymousAuthCondition)(nil), (*AnonymousAuthCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AnonymousAuthCondition_To_v1beta1_AnonymousAuthCondition(a.(*apiserver.AnonymousAuthCondition), b.(*AnonymousAuthCondition), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*AnonymousAuthConfig)(nil), (*apiserver.AnonymousAuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(a.(*AnonymousAuthConfig), b.(*apiserver.AnonymousAuthConfig), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AnonymousAuthConfig)(nil), (*AnonymousAuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AnonymousAuthConfig_To_v1beta1_AnonymousAuthConfig(a.(*apiserver.AnonymousAuthConfig), b.(*AnonymousAuthConfig), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*AuthenticationConfiguration)(nil), (*apiserver.AuthenticationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_AuthenticationConfiguration_To_apiserver_AuthenticationConfiguration(a.(*AuthenticationConfiguration), b.(*apiserver.AuthenticationConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AuthenticationConfiguration)(nil), (*AuthenticationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AuthenticationConfiguration_To_v1beta1_AuthenticationConfiguration(a.(*apiserver.AuthenticationConfiguration), b.(*AuthenticationConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*AuthorizationConfiguration)(nil), (*apiserver.AuthorizationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_AuthorizationConfiguration_To_apiserver_AuthorizationConfiguration(a.(*AuthorizationConfiguration), b.(*apiserver.AuthorizationConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AuthorizationConfiguration)(nil), (*AuthorizationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AuthorizationConfiguration_To_v1beta1_AuthorizationConfiguration(a.(*apiserver.AuthorizationConfiguration), b.(*AuthorizationConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*AuthorizerConfiguration)(nil), (*apiserver.AuthorizerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_AuthorizerConfiguration_To_apiserver_AuthorizerConfiguration(a.(*AuthorizerConfiguration), b.(*apiserver.AuthorizerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.AuthorizerConfiguration)(nil), (*AuthorizerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_AuthorizerConfiguration_To_v1beta1_AuthorizerConfiguration(a.(*apiserver.AuthorizerConfiguration), b.(*AuthorizerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*ClaimMappings)(nil), (*apiserver.ClaimMappings)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_ClaimMappings_To_apiserver_ClaimMappings(a.(*ClaimMappings), b.(*apiserver.ClaimMappings), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.ClaimMappings)(nil), (*ClaimMappings)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_ClaimMappings_To_v1beta1_ClaimMappings(a.(*apiserver.ClaimMappings), b.(*ClaimMappings), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*ClaimOrExpression)(nil), (*apiserver.ClaimOrExpression)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_ClaimOrExpression_To_apiserver_ClaimOrExpression(a.(*ClaimOrExpression), b.(*apiserver.ClaimOrExpression), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.ClaimOrExpression)(nil), (*ClaimOrExpression)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_ClaimOrExpression_To_v1beta1_ClaimOrExpression(a.(*apiserver.ClaimOrExpression), b.(*ClaimOrExpression), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*ClaimValidationRule)(nil), (*apiserver.ClaimValidationRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_ClaimValidationRule_To_apiserver_ClaimValidationRule(a.(*ClaimValidationRule), b.(*apiserver.ClaimValidationRule), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.ClaimValidationRule)(nil), (*ClaimValidationRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_ClaimValidationRule_To_v1beta1_ClaimValidationRule(a.(*apiserver.ClaimValidationRule), b.(*ClaimValidationRule), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddGeneratedConversionFunc((*Connection)(nil), (*apiserver.Connection)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_Connection_To_apiserver_Connection(a.(*Connection), b.(*apiserver.Connection), scope)
}); err != nil {
@@ -61,6 +142,46 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddGeneratedConversionFunc((*ExtraMapping)(nil), (*apiserver.ExtraMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_ExtraMapping_To_apiserver_ExtraMapping(a.(*ExtraMapping), b.(*apiserver.ExtraMapping), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.ExtraMapping)(nil), (*ExtraMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_ExtraMapping_To_v1beta1_ExtraMapping(a.(*apiserver.ExtraMapping), b.(*ExtraMapping), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*Issuer)(nil), (*apiserver.Issuer)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_Issuer_To_apiserver_Issuer(a.(*Issuer), b.(*apiserver.Issuer), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.Issuer)(nil), (*Issuer)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_Issuer_To_v1beta1_Issuer(a.(*apiserver.Issuer), b.(*Issuer), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*JWTAuthenticator)(nil), (*apiserver.JWTAuthenticator)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_JWTAuthenticator_To_apiserver_JWTAuthenticator(a.(*JWTAuthenticator), b.(*apiserver.JWTAuthenticator), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.JWTAuthenticator)(nil), (*JWTAuthenticator)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_JWTAuthenticator_To_v1beta1_JWTAuthenticator(a.(*apiserver.JWTAuthenticator), b.(*JWTAuthenticator), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*PrefixedClaimOrExpression)(nil), (*apiserver.PrefixedClaimOrExpression)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_PrefixedClaimOrExpression_To_apiserver_PrefixedClaimOrExpression(a.(*PrefixedClaimOrExpression), b.(*apiserver.PrefixedClaimOrExpression), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.PrefixedClaimOrExpression)(nil), (*PrefixedClaimOrExpression)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_PrefixedClaimOrExpression_To_v1beta1_PrefixedClaimOrExpression(a.(*apiserver.PrefixedClaimOrExpression), b.(*PrefixedClaimOrExpression), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddGeneratedConversionFunc((*TCPTransport)(nil), (*apiserver.TCPTransport)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_TCPTransport_To_apiserver_TCPTransport(a.(*TCPTransport), b.(*apiserver.TCPTransport), scope)
}); err != nil {
@@ -111,6 +232,46 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
+ if err := s.AddGeneratedConversionFunc((*UserValidationRule)(nil), (*apiserver.UserValidationRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_UserValidationRule_To_apiserver_UserValidationRule(a.(*UserValidationRule), b.(*apiserver.UserValidationRule), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.UserValidationRule)(nil), (*UserValidationRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_UserValidationRule_To_v1beta1_UserValidationRule(a.(*apiserver.UserValidationRule), b.(*UserValidationRule), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*WebhookConfiguration)(nil), (*apiserver.WebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_WebhookConfiguration_To_apiserver_WebhookConfiguration(a.(*WebhookConfiguration), b.(*apiserver.WebhookConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.WebhookConfiguration)(nil), (*WebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_WebhookConfiguration_To_v1beta1_WebhookConfiguration(a.(*apiserver.WebhookConfiguration), b.(*WebhookConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*WebhookConnectionInfo)(nil), (*apiserver.WebhookConnectionInfo)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_WebhookConnectionInfo_To_apiserver_WebhookConnectionInfo(a.(*WebhookConnectionInfo), b.(*apiserver.WebhookConnectionInfo), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.WebhookConnectionInfo)(nil), (*WebhookConnectionInfo)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_WebhookConnectionInfo_To_v1beta1_WebhookConnectionInfo(a.(*apiserver.WebhookConnectionInfo), b.(*WebhookConnectionInfo), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*WebhookMatchCondition)(nil), (*apiserver.WebhookMatchCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1beta1_WebhookMatchCondition_To_apiserver_WebhookMatchCondition(a.(*WebhookMatchCondition), b.(*apiserver.WebhookMatchCondition), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*apiserver.WebhookMatchCondition)(nil), (*WebhookMatchCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_apiserver_WebhookMatchCondition_To_v1beta1_WebhookMatchCondition(a.(*apiserver.WebhookMatchCondition), b.(*WebhookMatchCondition), scope)
+ }); err != nil {
+ return err
+ }
if err := s.AddConversionFunc((*EgressSelection)(nil), (*apiserver.EgressSelection)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_EgressSelection_To_apiserver_EgressSelection(a.(*EgressSelection), b.(*apiserver.EgressSelection), scope)
}); err != nil {
@@ -119,6 +280,220 @@ func RegisterConversions(s *runtime.Scheme) error {
return nil
}
+func autoConvert_v1beta1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(in *AnonymousAuthCondition, out *apiserver.AnonymousAuthCondition, s conversion.Scope) error {
+ out.Path = in.Path
+ return nil
+}
+
+// Convert_v1beta1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition is an autogenerated conversion function.
+func Convert_v1beta1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(in *AnonymousAuthCondition, out *apiserver.AnonymousAuthCondition, s conversion.Scope) error {
+ return autoConvert_v1beta1_AnonymousAuthCondition_To_apiserver_AnonymousAuthCondition(in, out, s)
+}
+
+func autoConvert_apiserver_AnonymousAuthCondition_To_v1beta1_AnonymousAuthCondition(in *apiserver.AnonymousAuthCondition, out *AnonymousAuthCondition, s conversion.Scope) error {
+ out.Path = in.Path
+ return nil
+}
+
+// Convert_apiserver_AnonymousAuthCondition_To_v1beta1_AnonymousAuthCondition is an autogenerated conversion function.
+func Convert_apiserver_AnonymousAuthCondition_To_v1beta1_AnonymousAuthCondition(in *apiserver.AnonymousAuthCondition, out *AnonymousAuthCondition, s conversion.Scope) error {
+ return autoConvert_apiserver_AnonymousAuthCondition_To_v1beta1_AnonymousAuthCondition(in, out, s)
+}
+
+func autoConvert_v1beta1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(in *AnonymousAuthConfig, out *apiserver.AnonymousAuthConfig, s conversion.Scope) error {
+ out.Enabled = in.Enabled
+ out.Conditions = *(*[]apiserver.AnonymousAuthCondition)(unsafe.Pointer(&in.Conditions))
+ return nil
+}
+
+// Convert_v1beta1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig is an autogenerated conversion function.
+func Convert_v1beta1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(in *AnonymousAuthConfig, out *apiserver.AnonymousAuthConfig, s conversion.Scope) error {
+ return autoConvert_v1beta1_AnonymousAuthConfig_To_apiserver_AnonymousAuthConfig(in, out, s)
+}
+
+func autoConvert_apiserver_AnonymousAuthConfig_To_v1beta1_AnonymousAuthConfig(in *apiserver.AnonymousAuthConfig, out *AnonymousAuthConfig, s conversion.Scope) error {
+ out.Enabled = in.Enabled
+ out.Conditions = *(*[]AnonymousAuthCondition)(unsafe.Pointer(&in.Conditions))
+ return nil
+}
+
+// Convert_apiserver_AnonymousAuthConfig_To_v1beta1_AnonymousAuthConfig is an autogenerated conversion function.
+func Convert_apiserver_AnonymousAuthConfig_To_v1beta1_AnonymousAuthConfig(in *apiserver.AnonymousAuthConfig, out *AnonymousAuthConfig, s conversion.Scope) error {
+ return autoConvert_apiserver_AnonymousAuthConfig_To_v1beta1_AnonymousAuthConfig(in, out, s)
+}
+
+func autoConvert_v1beta1_AuthenticationConfiguration_To_apiserver_AuthenticationConfiguration(in *AuthenticationConfiguration, out *apiserver.AuthenticationConfiguration, s conversion.Scope) error {
+ if in.JWT != nil {
+ in, out := &in.JWT, &out.JWT
+ *out = make([]apiserver.JWTAuthenticator, len(*in))
+ for i := range *in {
+ if err := Convert_v1beta1_JWTAuthenticator_To_apiserver_JWTAuthenticator(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.JWT = nil
+ }
+ out.Anonymous = (*apiserver.AnonymousAuthConfig)(unsafe.Pointer(in.Anonymous))
+ return nil
+}
+
+// Convert_v1beta1_AuthenticationConfiguration_To_apiserver_AuthenticationConfiguration is an autogenerated conversion function.
+func Convert_v1beta1_AuthenticationConfiguration_To_apiserver_AuthenticationConfiguration(in *AuthenticationConfiguration, out *apiserver.AuthenticationConfiguration, s conversion.Scope) error {
+ return autoConvert_v1beta1_AuthenticationConfiguration_To_apiserver_AuthenticationConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_AuthenticationConfiguration_To_v1beta1_AuthenticationConfiguration(in *apiserver.AuthenticationConfiguration, out *AuthenticationConfiguration, s conversion.Scope) error {
+ if in.JWT != nil {
+ in, out := &in.JWT, &out.JWT
+ *out = make([]JWTAuthenticator, len(*in))
+ for i := range *in {
+ if err := Convert_apiserver_JWTAuthenticator_To_v1beta1_JWTAuthenticator(&(*in)[i], &(*out)[i], s); err != nil {
+ return err
+ }
+ }
+ } else {
+ out.JWT = nil
+ }
+ out.Anonymous = (*AnonymousAuthConfig)(unsafe.Pointer(in.Anonymous))
+ return nil
+}
+
+// Convert_apiserver_AuthenticationConfiguration_To_v1beta1_AuthenticationConfiguration is an autogenerated conversion function.
+func Convert_apiserver_AuthenticationConfiguration_To_v1beta1_AuthenticationConfiguration(in *apiserver.AuthenticationConfiguration, out *AuthenticationConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_AuthenticationConfiguration_To_v1beta1_AuthenticationConfiguration(in, out, s)
+}
+
+func autoConvert_v1beta1_AuthorizationConfiguration_To_apiserver_AuthorizationConfiguration(in *AuthorizationConfiguration, out *apiserver.AuthorizationConfiguration, s conversion.Scope) error {
+ out.Authorizers = *(*[]apiserver.AuthorizerConfiguration)(unsafe.Pointer(&in.Authorizers))
+ return nil
+}
+
+// Convert_v1beta1_AuthorizationConfiguration_To_apiserver_AuthorizationConfiguration is an autogenerated conversion function.
+func Convert_v1beta1_AuthorizationConfiguration_To_apiserver_AuthorizationConfiguration(in *AuthorizationConfiguration, out *apiserver.AuthorizationConfiguration, s conversion.Scope) error {
+ return autoConvert_v1beta1_AuthorizationConfiguration_To_apiserver_AuthorizationConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_AuthorizationConfiguration_To_v1beta1_AuthorizationConfiguration(in *apiserver.AuthorizationConfiguration, out *AuthorizationConfiguration, s conversion.Scope) error {
+ out.Authorizers = *(*[]AuthorizerConfiguration)(unsafe.Pointer(&in.Authorizers))
+ return nil
+}
+
+// Convert_apiserver_AuthorizationConfiguration_To_v1beta1_AuthorizationConfiguration is an autogenerated conversion function.
+func Convert_apiserver_AuthorizationConfiguration_To_v1beta1_AuthorizationConfiguration(in *apiserver.AuthorizationConfiguration, out *AuthorizationConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_AuthorizationConfiguration_To_v1beta1_AuthorizationConfiguration(in, out, s)
+}
+
+func autoConvert_v1beta1_AuthorizerConfiguration_To_apiserver_AuthorizerConfiguration(in *AuthorizerConfiguration, out *apiserver.AuthorizerConfiguration, s conversion.Scope) error {
+ out.Type = apiserver.AuthorizerType(in.Type)
+ out.Name = in.Name
+ out.Webhook = (*apiserver.WebhookConfiguration)(unsafe.Pointer(in.Webhook))
+ return nil
+}
+
+// Convert_v1beta1_AuthorizerConfiguration_To_apiserver_AuthorizerConfiguration is an autogenerated conversion function.
+func Convert_v1beta1_AuthorizerConfiguration_To_apiserver_AuthorizerConfiguration(in *AuthorizerConfiguration, out *apiserver.AuthorizerConfiguration, s conversion.Scope) error {
+ return autoConvert_v1beta1_AuthorizerConfiguration_To_apiserver_AuthorizerConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_AuthorizerConfiguration_To_v1beta1_AuthorizerConfiguration(in *apiserver.AuthorizerConfiguration, out *AuthorizerConfiguration, s conversion.Scope) error {
+ out.Type = string(in.Type)
+ out.Name = in.Name
+ out.Webhook = (*WebhookConfiguration)(unsafe.Pointer(in.Webhook))
+ return nil
+}
+
+// Convert_apiserver_AuthorizerConfiguration_To_v1beta1_AuthorizerConfiguration is an autogenerated conversion function.
+func Convert_apiserver_AuthorizerConfiguration_To_v1beta1_AuthorizerConfiguration(in *apiserver.AuthorizerConfiguration, out *AuthorizerConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_AuthorizerConfiguration_To_v1beta1_AuthorizerConfiguration(in, out, s)
+}
+
+func autoConvert_v1beta1_ClaimMappings_To_apiserver_ClaimMappings(in *ClaimMappings, out *apiserver.ClaimMappings, s conversion.Scope) error {
+ if err := Convert_v1beta1_PrefixedClaimOrExpression_To_apiserver_PrefixedClaimOrExpression(&in.Username, &out.Username, s); err != nil {
+ return err
+ }
+ if err := Convert_v1beta1_PrefixedClaimOrExpression_To_apiserver_PrefixedClaimOrExpression(&in.Groups, &out.Groups, s); err != nil {
+ return err
+ }
+ if err := Convert_v1beta1_ClaimOrExpression_To_apiserver_ClaimOrExpression(&in.UID, &out.UID, s); err != nil {
+ return err
+ }
+ out.Extra = *(*[]apiserver.ExtraMapping)(unsafe.Pointer(&in.Extra))
+ return nil
+}
+
+// Convert_v1beta1_ClaimMappings_To_apiserver_ClaimMappings is an autogenerated conversion function.
+func Convert_v1beta1_ClaimMappings_To_apiserver_ClaimMappings(in *ClaimMappings, out *apiserver.ClaimMappings, s conversion.Scope) error {
+ return autoConvert_v1beta1_ClaimMappings_To_apiserver_ClaimMappings(in, out, s)
+}
+
+func autoConvert_apiserver_ClaimMappings_To_v1beta1_ClaimMappings(in *apiserver.ClaimMappings, out *ClaimMappings, s conversion.Scope) error {
+ if err := Convert_apiserver_PrefixedClaimOrExpression_To_v1beta1_PrefixedClaimOrExpression(&in.Username, &out.Username, s); err != nil {
+ return err
+ }
+ if err := Convert_apiserver_PrefixedClaimOrExpression_To_v1beta1_PrefixedClaimOrExpression(&in.Groups, &out.Groups, s); err != nil {
+ return err
+ }
+ if err := Convert_apiserver_ClaimOrExpression_To_v1beta1_ClaimOrExpression(&in.UID, &out.UID, s); err != nil {
+ return err
+ }
+ out.Extra = *(*[]ExtraMapping)(unsafe.Pointer(&in.Extra))
+ return nil
+}
+
+// Convert_apiserver_ClaimMappings_To_v1beta1_ClaimMappings is an autogenerated conversion function.
+func Convert_apiserver_ClaimMappings_To_v1beta1_ClaimMappings(in *apiserver.ClaimMappings, out *ClaimMappings, s conversion.Scope) error {
+ return autoConvert_apiserver_ClaimMappings_To_v1beta1_ClaimMappings(in, out, s)
+}
+
+func autoConvert_v1beta1_ClaimOrExpression_To_apiserver_ClaimOrExpression(in *ClaimOrExpression, out *apiserver.ClaimOrExpression, s conversion.Scope) error {
+ out.Claim = in.Claim
+ out.Expression = in.Expression
+ return nil
+}
+
+// Convert_v1beta1_ClaimOrExpression_To_apiserver_ClaimOrExpression is an autogenerated conversion function.
+func Convert_v1beta1_ClaimOrExpression_To_apiserver_ClaimOrExpression(in *ClaimOrExpression, out *apiserver.ClaimOrExpression, s conversion.Scope) error {
+ return autoConvert_v1beta1_ClaimOrExpression_To_apiserver_ClaimOrExpression(in, out, s)
+}
+
+func autoConvert_apiserver_ClaimOrExpression_To_v1beta1_ClaimOrExpression(in *apiserver.ClaimOrExpression, out *ClaimOrExpression, s conversion.Scope) error {
+ out.Claim = in.Claim
+ out.Expression = in.Expression
+ return nil
+}
+
+// Convert_apiserver_ClaimOrExpression_To_v1beta1_ClaimOrExpression is an autogenerated conversion function.
+func Convert_apiserver_ClaimOrExpression_To_v1beta1_ClaimOrExpression(in *apiserver.ClaimOrExpression, out *ClaimOrExpression, s conversion.Scope) error {
+ return autoConvert_apiserver_ClaimOrExpression_To_v1beta1_ClaimOrExpression(in, out, s)
+}
+
+func autoConvert_v1beta1_ClaimValidationRule_To_apiserver_ClaimValidationRule(in *ClaimValidationRule, out *apiserver.ClaimValidationRule, s conversion.Scope) error {
+ out.Claim = in.Claim
+ out.RequiredValue = in.RequiredValue
+ out.Expression = in.Expression
+ out.Message = in.Message
+ return nil
+}
+
+// Convert_v1beta1_ClaimValidationRule_To_apiserver_ClaimValidationRule is an autogenerated conversion function.
+func Convert_v1beta1_ClaimValidationRule_To_apiserver_ClaimValidationRule(in *ClaimValidationRule, out *apiserver.ClaimValidationRule, s conversion.Scope) error {
+ return autoConvert_v1beta1_ClaimValidationRule_To_apiserver_ClaimValidationRule(in, out, s)
+}
+
+func autoConvert_apiserver_ClaimValidationRule_To_v1beta1_ClaimValidationRule(in *apiserver.ClaimValidationRule, out *ClaimValidationRule, s conversion.Scope) error {
+ out.Claim = in.Claim
+ out.RequiredValue = in.RequiredValue
+ out.Expression = in.Expression
+ out.Message = in.Message
+ return nil
+}
+
+// Convert_apiserver_ClaimValidationRule_To_v1beta1_ClaimValidationRule is an autogenerated conversion function.
+func Convert_apiserver_ClaimValidationRule_To_v1beta1_ClaimValidationRule(in *apiserver.ClaimValidationRule, out *ClaimValidationRule, s conversion.Scope) error {
+ return autoConvert_apiserver_ClaimValidationRule_To_v1beta1_ClaimValidationRule(in, out, s)
+}
+
func autoConvert_v1beta1_Connection_To_apiserver_Connection(in *Connection, out *apiserver.Connection, s conversion.Scope) error {
out.ProxyProtocol = apiserver.ProtocolType(in.ProxyProtocol)
out.Transport = (*apiserver.Transport)(unsafe.Pointer(in.Transport))
@@ -202,6 +577,118 @@ func Convert_apiserver_EgressSelectorConfiguration_To_v1beta1_EgressSelectorConf
return autoConvert_apiserver_EgressSelectorConfiguration_To_v1beta1_EgressSelectorConfiguration(in, out, s)
}
+func autoConvert_v1beta1_ExtraMapping_To_apiserver_ExtraMapping(in *ExtraMapping, out *apiserver.ExtraMapping, s conversion.Scope) error {
+ out.Key = in.Key
+ out.ValueExpression = in.ValueExpression
+ return nil
+}
+
+// Convert_v1beta1_ExtraMapping_To_apiserver_ExtraMapping is an autogenerated conversion function.
+func Convert_v1beta1_ExtraMapping_To_apiserver_ExtraMapping(in *ExtraMapping, out *apiserver.ExtraMapping, s conversion.Scope) error {
+ return autoConvert_v1beta1_ExtraMapping_To_apiserver_ExtraMapping(in, out, s)
+}
+
+func autoConvert_apiserver_ExtraMapping_To_v1beta1_ExtraMapping(in *apiserver.ExtraMapping, out *ExtraMapping, s conversion.Scope) error {
+ out.Key = in.Key
+ out.ValueExpression = in.ValueExpression
+ return nil
+}
+
+// Convert_apiserver_ExtraMapping_To_v1beta1_ExtraMapping is an autogenerated conversion function.
+func Convert_apiserver_ExtraMapping_To_v1beta1_ExtraMapping(in *apiserver.ExtraMapping, out *ExtraMapping, s conversion.Scope) error {
+ return autoConvert_apiserver_ExtraMapping_To_v1beta1_ExtraMapping(in, out, s)
+}
+
+func autoConvert_v1beta1_Issuer_To_apiserver_Issuer(in *Issuer, out *apiserver.Issuer, s conversion.Scope) error {
+ out.URL = in.URL
+ if err := v1.Convert_Pointer_string_To_string(&in.DiscoveryURL, &out.DiscoveryURL, s); err != nil {
+ return err
+ }
+ out.CertificateAuthority = in.CertificateAuthority
+ out.Audiences = *(*[]string)(unsafe.Pointer(&in.Audiences))
+ out.AudienceMatchPolicy = apiserver.AudienceMatchPolicyType(in.AudienceMatchPolicy)
+ return nil
+}
+
+// Convert_v1beta1_Issuer_To_apiserver_Issuer is an autogenerated conversion function.
+func Convert_v1beta1_Issuer_To_apiserver_Issuer(in *Issuer, out *apiserver.Issuer, s conversion.Scope) error {
+ return autoConvert_v1beta1_Issuer_To_apiserver_Issuer(in, out, s)
+}
+
+func autoConvert_apiserver_Issuer_To_v1beta1_Issuer(in *apiserver.Issuer, out *Issuer, s conversion.Scope) error {
+ out.URL = in.URL
+ if err := v1.Convert_string_To_Pointer_string(&in.DiscoveryURL, &out.DiscoveryURL, s); err != nil {
+ return err
+ }
+ out.CertificateAuthority = in.CertificateAuthority
+ out.Audiences = *(*[]string)(unsafe.Pointer(&in.Audiences))
+ out.AudienceMatchPolicy = AudienceMatchPolicyType(in.AudienceMatchPolicy)
+ return nil
+}
+
+// Convert_apiserver_Issuer_To_v1beta1_Issuer is an autogenerated conversion function.
+func Convert_apiserver_Issuer_To_v1beta1_Issuer(in *apiserver.Issuer, out *Issuer, s conversion.Scope) error {
+ return autoConvert_apiserver_Issuer_To_v1beta1_Issuer(in, out, s)
+}
+
+func autoConvert_v1beta1_JWTAuthenticator_To_apiserver_JWTAuthenticator(in *JWTAuthenticator, out *apiserver.JWTAuthenticator, s conversion.Scope) error {
+ if err := Convert_v1beta1_Issuer_To_apiserver_Issuer(&in.Issuer, &out.Issuer, s); err != nil {
+ return err
+ }
+ out.ClaimValidationRules = *(*[]apiserver.ClaimValidationRule)(unsafe.Pointer(&in.ClaimValidationRules))
+ if err := Convert_v1beta1_ClaimMappings_To_apiserver_ClaimMappings(&in.ClaimMappings, &out.ClaimMappings, s); err != nil {
+ return err
+ }
+ out.UserValidationRules = *(*[]apiserver.UserValidationRule)(unsafe.Pointer(&in.UserValidationRules))
+ return nil
+}
+
+// Convert_v1beta1_JWTAuthenticator_To_apiserver_JWTAuthenticator is an autogenerated conversion function.
+func Convert_v1beta1_JWTAuthenticator_To_apiserver_JWTAuthenticator(in *JWTAuthenticator, out *apiserver.JWTAuthenticator, s conversion.Scope) error {
+ return autoConvert_v1beta1_JWTAuthenticator_To_apiserver_JWTAuthenticator(in, out, s)
+}
+
+func autoConvert_apiserver_JWTAuthenticator_To_v1beta1_JWTAuthenticator(in *apiserver.JWTAuthenticator, out *JWTAuthenticator, s conversion.Scope) error {
+ if err := Convert_apiserver_Issuer_To_v1beta1_Issuer(&in.Issuer, &out.Issuer, s); err != nil {
+ return err
+ }
+ out.ClaimValidationRules = *(*[]ClaimValidationRule)(unsafe.Pointer(&in.ClaimValidationRules))
+ if err := Convert_apiserver_ClaimMappings_To_v1beta1_ClaimMappings(&in.ClaimMappings, &out.ClaimMappings, s); err != nil {
+ return err
+ }
+ out.UserValidationRules = *(*[]UserValidationRule)(unsafe.Pointer(&in.UserValidationRules))
+ return nil
+}
+
+// Convert_apiserver_JWTAuthenticator_To_v1beta1_JWTAuthenticator is an autogenerated conversion function.
+func Convert_apiserver_JWTAuthenticator_To_v1beta1_JWTAuthenticator(in *apiserver.JWTAuthenticator, out *JWTAuthenticator, s conversion.Scope) error {
+ return autoConvert_apiserver_JWTAuthenticator_To_v1beta1_JWTAuthenticator(in, out, s)
+}
+
+func autoConvert_v1beta1_PrefixedClaimOrExpression_To_apiserver_PrefixedClaimOrExpression(in *PrefixedClaimOrExpression, out *apiserver.PrefixedClaimOrExpression, s conversion.Scope) error {
+ out.Claim = in.Claim
+ out.Prefix = (*string)(unsafe.Pointer(in.Prefix))
+ out.Expression = in.Expression
+ return nil
+}
+
+// Convert_v1beta1_PrefixedClaimOrExpression_To_apiserver_PrefixedClaimOrExpression is an autogenerated conversion function.
+func Convert_v1beta1_PrefixedClaimOrExpression_To_apiserver_PrefixedClaimOrExpression(in *PrefixedClaimOrExpression, out *apiserver.PrefixedClaimOrExpression, s conversion.Scope) error {
+ return autoConvert_v1beta1_PrefixedClaimOrExpression_To_apiserver_PrefixedClaimOrExpression(in, out, s)
+}
+
+func autoConvert_apiserver_PrefixedClaimOrExpression_To_v1beta1_PrefixedClaimOrExpression(in *apiserver.PrefixedClaimOrExpression, out *PrefixedClaimOrExpression, s conversion.Scope) error {
+ out.Claim = in.Claim
+ out.Prefix = (*string)(unsafe.Pointer(in.Prefix))
+ out.Expression = in.Expression
+ return nil
+}
+
+// Convert_apiserver_PrefixedClaimOrExpression_To_v1beta1_PrefixedClaimOrExpression is an autogenerated conversion function.
+func Convert_apiserver_PrefixedClaimOrExpression_To_v1beta1_PrefixedClaimOrExpression(in *apiserver.PrefixedClaimOrExpression, out *PrefixedClaimOrExpression, s conversion.Scope) error {
+ return autoConvert_apiserver_PrefixedClaimOrExpression_To_v1beta1_PrefixedClaimOrExpression(in, out, s)
+}
+
func autoConvert_v1beta1_TCPTransport_To_apiserver_TCPTransport(in *TCPTransport, out *apiserver.TCPTransport, s conversion.Scope) error {
out.URL = in.URL
out.TLSConfig = (*apiserver.TLSConfig)(unsafe.Pointer(in.TLSConfig))
@@ -309,3 +796,105 @@ func autoConvert_apiserver_UDSTransport_To_v1beta1_UDSTransport(in *apiserver.UD
func Convert_apiserver_UDSTransport_To_v1beta1_UDSTransport(in *apiserver.UDSTransport, out *UDSTransport, s conversion.Scope) error {
return autoConvert_apiserver_UDSTransport_To_v1beta1_UDSTransport(in, out, s)
}
+
+func autoConvert_v1beta1_UserValidationRule_To_apiserver_UserValidationRule(in *UserValidationRule, out *apiserver.UserValidationRule, s conversion.Scope) error {
+ out.Expression = in.Expression
+ out.Message = in.Message
+ return nil
+}
+
+// Convert_v1beta1_UserValidationRule_To_apiserver_UserValidationRule is an autogenerated conversion function.
+func Convert_v1beta1_UserValidationRule_To_apiserver_UserValidationRule(in *UserValidationRule, out *apiserver.UserValidationRule, s conversion.Scope) error {
+ return autoConvert_v1beta1_UserValidationRule_To_apiserver_UserValidationRule(in, out, s)
+}
+
+func autoConvert_apiserver_UserValidationRule_To_v1beta1_UserValidationRule(in *apiserver.UserValidationRule, out *UserValidationRule, s conversion.Scope) error {
+ out.Expression = in.Expression
+ out.Message = in.Message
+ return nil
+}
+
+// Convert_apiserver_UserValidationRule_To_v1beta1_UserValidationRule is an autogenerated conversion function.
+func Convert_apiserver_UserValidationRule_To_v1beta1_UserValidationRule(in *apiserver.UserValidationRule, out *UserValidationRule, s conversion.Scope) error {
+ return autoConvert_apiserver_UserValidationRule_To_v1beta1_UserValidationRule(in, out, s)
+}
+
+func autoConvert_v1beta1_WebhookConfiguration_To_apiserver_WebhookConfiguration(in *WebhookConfiguration, out *apiserver.WebhookConfiguration, s conversion.Scope) error {
+ out.AuthorizedTTL = in.AuthorizedTTL
+ out.UnauthorizedTTL = in.UnauthorizedTTL
+ out.Timeout = in.Timeout
+ out.SubjectAccessReviewVersion = in.SubjectAccessReviewVersion
+ out.MatchConditionSubjectAccessReviewVersion = in.MatchConditionSubjectAccessReviewVersion
+ out.FailurePolicy = in.FailurePolicy
+ if err := Convert_v1beta1_WebhookConnectionInfo_To_apiserver_WebhookConnectionInfo(&in.ConnectionInfo, &out.ConnectionInfo, s); err != nil {
+ return err
+ }
+ out.MatchConditions = *(*[]apiserver.WebhookMatchCondition)(unsafe.Pointer(&in.MatchConditions))
+ return nil
+}
+
+// Convert_v1beta1_WebhookConfiguration_To_apiserver_WebhookConfiguration is an autogenerated conversion function.
+func Convert_v1beta1_WebhookConfiguration_To_apiserver_WebhookConfiguration(in *WebhookConfiguration, out *apiserver.WebhookConfiguration, s conversion.Scope) error {
+ return autoConvert_v1beta1_WebhookConfiguration_To_apiserver_WebhookConfiguration(in, out, s)
+}
+
+func autoConvert_apiserver_WebhookConfiguration_To_v1beta1_WebhookConfiguration(in *apiserver.WebhookConfiguration, out *WebhookConfiguration, s conversion.Scope) error {
+ out.AuthorizedTTL = in.AuthorizedTTL
+ out.UnauthorizedTTL = in.UnauthorizedTTL
+ out.Timeout = in.Timeout
+ out.SubjectAccessReviewVersion = in.SubjectAccessReviewVersion
+ out.MatchConditionSubjectAccessReviewVersion = in.MatchConditionSubjectAccessReviewVersion
+ out.FailurePolicy = in.FailurePolicy
+ if err := Convert_apiserver_WebhookConnectionInfo_To_v1beta1_WebhookConnectionInfo(&in.ConnectionInfo, &out.ConnectionInfo, s); err != nil {
+ return err
+ }
+ out.MatchConditions = *(*[]WebhookMatchCondition)(unsafe.Pointer(&in.MatchConditions))
+ return nil
+}
+
+// Convert_apiserver_WebhookConfiguration_To_v1beta1_WebhookConfiguration is an autogenerated conversion function.
+func Convert_apiserver_WebhookConfiguration_To_v1beta1_WebhookConfiguration(in *apiserver.WebhookConfiguration, out *WebhookConfiguration, s conversion.Scope) error {
+ return autoConvert_apiserver_WebhookConfiguration_To_v1beta1_WebhookConfiguration(in, out, s)
+}
+
+func autoConvert_v1beta1_WebhookConnectionInfo_To_apiserver_WebhookConnectionInfo(in *WebhookConnectionInfo, out *apiserver.WebhookConnectionInfo, s conversion.Scope) error {
+ out.Type = in.Type
+ out.KubeConfigFile = (*string)(unsafe.Pointer(in.KubeConfigFile))
+ return nil
+}
+
+// Convert_v1beta1_WebhookConnectionInfo_To_apiserver_WebhookConnectionInfo is an autogenerated conversion function.
+func Convert_v1beta1_WebhookConnectionInfo_To_apiserver_WebhookConnectionInfo(in *WebhookConnectionInfo, out *apiserver.WebhookConnectionInfo, s conversion.Scope) error {
+ return autoConvert_v1beta1_WebhookConnectionInfo_To_apiserver_WebhookConnectionInfo(in, out, s)
+}
+
+func autoConvert_apiserver_WebhookConnectionInfo_To_v1beta1_WebhookConnectionInfo(in *apiserver.WebhookConnectionInfo, out *WebhookConnectionInfo, s conversion.Scope) error {
+ out.Type = in.Type
+ out.KubeConfigFile = (*string)(unsafe.Pointer(in.KubeConfigFile))
+ return nil
+}
+
+// Convert_apiserver_WebhookConnectionInfo_To_v1beta1_WebhookConnectionInfo is an autogenerated conversion function.
+func Convert_apiserver_WebhookConnectionInfo_To_v1beta1_WebhookConnectionInfo(in *apiserver.WebhookConnectionInfo, out *WebhookConnectionInfo, s conversion.Scope) error {
+ return autoConvert_apiserver_WebhookConnectionInfo_To_v1beta1_WebhookConnectionInfo(in, out, s)
+}
+
+func autoConvert_v1beta1_WebhookMatchCondition_To_apiserver_WebhookMatchCondition(in *WebhookMatchCondition, out *apiserver.WebhookMatchCondition, s conversion.Scope) error {
+ out.Expression = in.Expression
+ return nil
+}
+
+// Convert_v1beta1_WebhookMatchCondition_To_apiserver_WebhookMatchCondition is an autogenerated conversion function.
+func Convert_v1beta1_WebhookMatchCondition_To_apiserver_WebhookMatchCondition(in *WebhookMatchCondition, out *apiserver.WebhookMatchCondition, s conversion.Scope) error {
+ return autoConvert_v1beta1_WebhookMatchCondition_To_apiserver_WebhookMatchCondition(in, out, s)
+}
+
+func autoConvert_apiserver_WebhookMatchCondition_To_v1beta1_WebhookMatchCondition(in *apiserver.WebhookMatchCondition, out *WebhookMatchCondition, s conversion.Scope) error {
+ out.Expression = in.Expression
+ return nil
+}
+
+// Convert_apiserver_WebhookMatchCondition_To_v1beta1_WebhookMatchCondition is an autogenerated conversion function.
+func Convert_apiserver_WebhookMatchCondition_To_v1beta1_WebhookMatchCondition(in *apiserver.WebhookMatchCondition, out *WebhookMatchCondition, s conversion.Scope) error {
+ return autoConvert_apiserver_WebhookMatchCondition_To_v1beta1_WebhookMatchCondition(in, out, s)
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.deepcopy.go
index beb0b50b57b..0d78e51a96b 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.deepcopy.go
@@ -25,6 +25,189 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AnonymousAuthCondition) DeepCopyInto(out *AnonymousAuthCondition) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnonymousAuthCondition.
+func (in *AnonymousAuthCondition) DeepCopy() *AnonymousAuthCondition {
+ if in == nil {
+ return nil
+ }
+ out := new(AnonymousAuthCondition)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AnonymousAuthConfig) DeepCopyInto(out *AnonymousAuthConfig) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]AnonymousAuthCondition, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnonymousAuthConfig.
+func (in *AnonymousAuthConfig) DeepCopy() *AnonymousAuthConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(AnonymousAuthConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AuthenticationConfiguration) DeepCopyInto(out *AuthenticationConfiguration) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ if in.JWT != nil {
+ in, out := &in.JWT, &out.JWT
+ *out = make([]JWTAuthenticator, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.Anonymous != nil {
+ in, out := &in.Anonymous, &out.Anonymous
+ *out = new(AnonymousAuthConfig)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationConfiguration.
+func (in *AuthenticationConfiguration) DeepCopy() *AuthenticationConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(AuthenticationConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AuthenticationConfiguration) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AuthorizationConfiguration) DeepCopyInto(out *AuthorizationConfiguration) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ if in.Authorizers != nil {
+ in, out := &in.Authorizers, &out.Authorizers
+ *out = make([]AuthorizerConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizationConfiguration.
+func (in *AuthorizationConfiguration) DeepCopy() *AuthorizationConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(AuthorizationConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AuthorizationConfiguration) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AuthorizerConfiguration) DeepCopyInto(out *AuthorizerConfiguration) {
+ *out = *in
+ if in.Webhook != nil {
+ in, out := &in.Webhook, &out.Webhook
+ *out = new(WebhookConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizerConfiguration.
+func (in *AuthorizerConfiguration) DeepCopy() *AuthorizerConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(AuthorizerConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClaimMappings) DeepCopyInto(out *ClaimMappings) {
+ *out = *in
+ in.Username.DeepCopyInto(&out.Username)
+ in.Groups.DeepCopyInto(&out.Groups)
+ out.UID = in.UID
+ if in.Extra != nil {
+ in, out := &in.Extra, &out.Extra
+ *out = make([]ExtraMapping, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClaimMappings.
+func (in *ClaimMappings) DeepCopy() *ClaimMappings {
+ if in == nil {
+ return nil
+ }
+ out := new(ClaimMappings)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClaimOrExpression) DeepCopyInto(out *ClaimOrExpression) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClaimOrExpression.
+func (in *ClaimOrExpression) DeepCopy() *ClaimOrExpression {
+ if in == nil {
+ return nil
+ }
+ out := new(ClaimOrExpression)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClaimValidationRule) DeepCopyInto(out *ClaimValidationRule) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClaimValidationRule.
+func (in *ClaimValidationRule) DeepCopy() *ClaimValidationRule {
+ if in == nil {
+ return nil
+ }
+ out := new(ClaimValidationRule)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Connection) DeepCopyInto(out *Connection) {
*out = *in
@@ -95,6 +278,97 @@ func (in *EgressSelectorConfiguration) DeepCopyObject() runtime.Object {
return nil
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ExtraMapping) DeepCopyInto(out *ExtraMapping) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraMapping.
+func (in *ExtraMapping) DeepCopy() *ExtraMapping {
+ if in == nil {
+ return nil
+ }
+ out := new(ExtraMapping)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Issuer) DeepCopyInto(out *Issuer) {
+ *out = *in
+ if in.DiscoveryURL != nil {
+ in, out := &in.DiscoveryURL, &out.DiscoveryURL
+ *out = new(string)
+ **out = **in
+ }
+ if in.Audiences != nil {
+ in, out := &in.Audiences, &out.Audiences
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Issuer.
+func (in *Issuer) DeepCopy() *Issuer {
+ if in == nil {
+ return nil
+ }
+ out := new(Issuer)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *JWTAuthenticator) DeepCopyInto(out *JWTAuthenticator) {
+ *out = *in
+ in.Issuer.DeepCopyInto(&out.Issuer)
+ if in.ClaimValidationRules != nil {
+ in, out := &in.ClaimValidationRules, &out.ClaimValidationRules
+ *out = make([]ClaimValidationRule, len(*in))
+ copy(*out, *in)
+ }
+ in.ClaimMappings.DeepCopyInto(&out.ClaimMappings)
+ if in.UserValidationRules != nil {
+ in, out := &in.UserValidationRules, &out.UserValidationRules
+ *out = make([]UserValidationRule, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWTAuthenticator.
+func (in *JWTAuthenticator) DeepCopy() *JWTAuthenticator {
+ if in == nil {
+ return nil
+ }
+ out := new(JWTAuthenticator)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PrefixedClaimOrExpression) DeepCopyInto(out *PrefixedClaimOrExpression) {
+ *out = *in
+ if in.Prefix != nil {
+ in, out := &in.Prefix, &out.Prefix
+ *out = new(string)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrefixedClaimOrExpression.
+func (in *PrefixedClaimOrExpression) DeepCopy() *PrefixedClaimOrExpression {
+ if in == nil {
+ return nil
+ }
+ out := new(PrefixedClaimOrExpression)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TCPTransport) DeepCopyInto(out *TCPTransport) {
*out = *in
@@ -199,3 +473,81 @@ func (in *UDSTransport) DeepCopy() *UDSTransport {
in.DeepCopyInto(out)
return out
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *UserValidationRule) DeepCopyInto(out *UserValidationRule) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserValidationRule.
+func (in *UserValidationRule) DeepCopy() *UserValidationRule {
+ if in == nil {
+ return nil
+ }
+ out := new(UserValidationRule)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration) {
+ *out = *in
+ out.AuthorizedTTL = in.AuthorizedTTL
+ out.UnauthorizedTTL = in.UnauthorizedTTL
+ out.Timeout = in.Timeout
+ in.ConnectionInfo.DeepCopyInto(&out.ConnectionInfo)
+ if in.MatchConditions != nil {
+ in, out := &in.MatchConditions, &out.MatchConditions
+ *out = make([]WebhookMatchCondition, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfiguration.
+func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(WebhookConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *WebhookConnectionInfo) DeepCopyInto(out *WebhookConnectionInfo) {
+ *out = *in
+ if in.KubeConfigFile != nil {
+ in, out := &in.KubeConfigFile, &out.KubeConfigFile
+ *out = new(string)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConnectionInfo.
+func (in *WebhookConnectionInfo) DeepCopy() *WebhookConnectionInfo {
+ if in == nil {
+ return nil
+ }
+ out := new(WebhookConnectionInfo)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *WebhookMatchCondition) DeepCopyInto(out *WebhookMatchCondition) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookMatchCondition.
+func (in *WebhookMatchCondition) DeepCopy() *WebhookMatchCondition {
+ if in == nil {
+ return nil
+ }
+ out := new(WebhookMatchCondition)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.defaults.go
index 198b5be4af5..fdbb606a18a 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.defaults.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/zz_generated.defaults.go
@@ -29,5 +29,15 @@ import (
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
+ scheme.AddTypeDefaultingFunc(&AuthorizationConfiguration{}, func(obj interface{}) { SetObjectDefaults_AuthorizationConfiguration(obj.(*AuthorizationConfiguration)) })
return nil
}
+
+func SetObjectDefaults_AuthorizationConfiguration(in *AuthorizationConfiguration) {
+ for i := range in.Authorizers {
+ a := &in.Authorizers[i]
+ if a.Webhook != nil {
+ SetDefaults_WebhookConfiguration(a.Webhook)
+ }
+ }
+}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go
index 843324085cf..5e80e2dc69d 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go
@@ -25,6 +25,10 @@ import (
"strings"
"time"
+ celgo "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/operators"
+ exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+
v1 "k8s.io/api/authorization/v1"
"k8s.io/api/authorization/v1beta1"
"k8s.io/apimachinery/pkg/util/sets"
@@ -40,44 +44,47 @@ import (
"k8s.io/client-go/util/cert"
)
-const (
- atLeastOneRequiredErrFmt = "at least one %s is required"
-)
-
-var (
- root = field.NewPath("jwt")
-)
-
// ValidateAuthenticationConfiguration validates a given AuthenticationConfiguration.
-func ValidateAuthenticationConfiguration(c *api.AuthenticationConfiguration) field.ErrorList {
+func ValidateAuthenticationConfiguration(c *api.AuthenticationConfiguration, disallowedIssuers []string) field.ErrorList {
+ root := field.NewPath("jwt")
var allErrs field.ErrorList
- // This stricter validation is solely based on what the current implementation supports.
- // TODO(aramase): when StructuredAuthenticationConfiguration feature gate is added and wired up,
- // relax this check to allow 0 authenticators. This will allow us to support the case where
- // API server is initially configured with no authenticators and then authenticators are added
- // later via dynamic config.
- if len(c.JWT) == 0 {
- allErrs = append(allErrs, field.Required(root, fmt.Sprintf(atLeastOneRequiredErrFmt, root)))
- return allErrs
- }
+ // We allow 0 authenticators in the authentication configuration.
+ // This allows us to support scenarios where the API server is initially set up without
+ // any authenticators and then authenticators are added later via dynamic config.
- // This stricter validation is because the --oidc-* flag option is singular.
- // TODO(aramase): when StructuredAuthenticationConfiguration feature gate is added and wired up,
- // remove the 1 authenticator limit check and add set the limit to 64.
- if len(c.JWT) > 1 {
- allErrs = append(allErrs, field.TooMany(root, len(c.JWT), 1))
+ if len(c.JWT) > 64 {
+ allErrs = append(allErrs, field.TooMany(root, len(c.JWT), 64))
return allErrs
}
- // TODO(aramase): right now we only support a single JWT authenticator as
- // this is wired to the --oidc-* flags. When StructuredAuthenticationConfiguration
- // feature gate is added and wired up, we will remove the 1 authenticator limit
- // check and add validation for duplicate issuers.
+ seenIssuers := sets.New[string]()
+ seenDiscoveryURLs := sets.New[string]()
for i, a := range c.JWT {
fldPath := root.Index(i)
- _, errs := validateJWTAuthenticator(a, fldPath, utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthenticationConfiguration))
+ _, errs := validateJWTAuthenticator(a, fldPath, sets.New(disallowedIssuers...), utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthenticationConfiguration))
allErrs = append(allErrs, errs...)
+
+ if seenIssuers.Has(a.Issuer.URL) {
+ allErrs = append(allErrs, field.Duplicate(fldPath.Child("issuer").Child("url"), a.Issuer.URL))
+ }
+ seenIssuers.Insert(a.Issuer.URL)
+
+ if len(a.Issuer.DiscoveryURL) > 0 {
+ if seenDiscoveryURLs.Has(a.Issuer.DiscoveryURL) {
+ allErrs = append(allErrs, field.Duplicate(fldPath.Child("issuer").Child("discoveryURL"), a.Issuer.DiscoveryURL))
+ }
+ seenDiscoveryURLs.Insert(a.Issuer.DiscoveryURL)
+ }
+ }
+
+ if c.Anonymous != nil {
+ if !utilfeature.DefaultFeatureGate.Enabled(features.AnonymousAuthConfigurableEndpoints) {
+ allErrs = append(allErrs, field.Forbidden(field.NewPath("anonymous"), "anonymous is not supported when AnonymousAuthConfigurableEnpoints feature gate is disabled"))
+ }
+ if !c.Anonymous.Enabled && len(c.Anonymous.Conditions) > 0 {
+ allErrs = append(allErrs, field.Invalid(field.NewPath("anonymous", "conditions"), c.Anonymous.Conditions, "enabled should be set to true when conditions are defined"))
+ }
}
return allErrs
@@ -86,40 +93,71 @@ func ValidateAuthenticationConfiguration(c *api.AuthenticationConfiguration) fie
// CompileAndValidateJWTAuthenticator validates a given JWTAuthenticator and returns a CELMapper with the compiled
// CEL expressions for claim mappings and validation rules.
// This is exported for use in oidc package.
-func CompileAndValidateJWTAuthenticator(authenticator api.JWTAuthenticator) (authenticationcel.CELMapper, field.ErrorList) {
- return validateJWTAuthenticator(authenticator, nil, utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthenticationConfiguration))
+func CompileAndValidateJWTAuthenticator(authenticator api.JWTAuthenticator, disallowedIssuers []string) (authenticationcel.CELMapper, field.ErrorList) {
+ return validateJWTAuthenticator(authenticator, nil, sets.New(disallowedIssuers...), utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthenticationConfiguration))
}
-func validateJWTAuthenticator(authenticator api.JWTAuthenticator, fldPath *field.Path, structuredAuthnFeatureEnabled bool) (authenticationcel.CELMapper, field.ErrorList) {
+func validateJWTAuthenticator(authenticator api.JWTAuthenticator, fldPath *field.Path, disallowedIssuers sets.Set[string], structuredAuthnFeatureEnabled bool) (authenticationcel.CELMapper, field.ErrorList) {
var allErrs field.ErrorList
- compiler := authenticationcel.NewCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion()))
- mapper := &authenticationcel.CELMapper{}
+ // strictCost is set to true which enables the strict cost for CEL validation.
+ compiler := authenticationcel.NewCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true))
+ state := &validationState{}
- allErrs = append(allErrs, validateIssuer(authenticator.Issuer, fldPath.Child("issuer"))...)
- allErrs = append(allErrs, validateClaimValidationRules(compiler, mapper, authenticator.ClaimValidationRules, fldPath.Child("claimValidationRules"), structuredAuthnFeatureEnabled)...)
- allErrs = append(allErrs, validateClaimMappings(compiler, mapper, authenticator.ClaimMappings, fldPath.Child("claimMappings"), structuredAuthnFeatureEnabled)...)
- allErrs = append(allErrs, validateUserValidationRules(compiler, mapper, authenticator.UserValidationRules, fldPath.Child("userValidationRules"), structuredAuthnFeatureEnabled)...)
+ allErrs = append(allErrs, validateIssuer(authenticator.Issuer, disallowedIssuers, fldPath.Child("issuer"))...)
+ allErrs = append(allErrs, validateClaimValidationRules(compiler, state, authenticator.ClaimValidationRules, fldPath.Child("claimValidationRules"), structuredAuthnFeatureEnabled)...)
+ allErrs = append(allErrs, validateClaimMappings(compiler, state, authenticator.ClaimMappings, fldPath.Child("claimMappings"), structuredAuthnFeatureEnabled)...)
+ allErrs = append(allErrs, validateUserValidationRules(compiler, state, authenticator.UserValidationRules, fldPath.Child("userValidationRules"), structuredAuthnFeatureEnabled)...)
+
+ return state.mapper, allErrs
+}
- return *mapper, allErrs
+type validationState struct {
+ mapper authenticationcel.CELMapper
+ usesEmailClaim bool
+ usesEmailVerifiedClaim bool
}
-func validateIssuer(issuer api.Issuer, fldPath *field.Path) field.ErrorList {
+func validateIssuer(issuer api.Issuer, disallowedIssuers sets.Set[string], fldPath *field.Path) field.ErrorList {
var allErrs field.ErrorList
- allErrs = append(allErrs, validateURL(issuer.URL, fldPath.Child("url"))...)
- allErrs = append(allErrs, validateAudiences(issuer.Audiences, fldPath.Child("audiences"))...)
+ allErrs = append(allErrs, validateIssuerURL(issuer.URL, disallowedIssuers, fldPath.Child("url"))...)
+ allErrs = append(allErrs, validateIssuerDiscoveryURL(issuer.URL, issuer.DiscoveryURL, fldPath.Child("discoveryURL"))...)
+ allErrs = append(allErrs, validateAudiences(issuer.Audiences, issuer.AudienceMatchPolicy, fldPath.Child("audiences"), fldPath.Child("audienceMatchPolicy"))...)
allErrs = append(allErrs, validateCertificateAuthority(issuer.CertificateAuthority, fldPath.Child("certificateAuthority"))...)
return allErrs
}
-func validateURL(issuerURL string, fldPath *field.Path) field.ErrorList {
+func validateIssuerURL(issuerURL string, disallowedIssuers sets.Set[string], fldPath *field.Path) field.ErrorList {
+ if len(issuerURL) == 0 {
+ return field.ErrorList{field.Required(fldPath, "URL is required")}
+ }
+
+ return validateURL(issuerURL, disallowedIssuers, fldPath)
+}
+
+func validateIssuerDiscoveryURL(issuerURL, issuerDiscoveryURL string, fldPath *field.Path) field.ErrorList {
var allErrs field.ErrorList
- if len(issuerURL) == 0 {
- allErrs = append(allErrs, field.Required(fldPath, "URL is required"))
- return allErrs
+ if len(issuerDiscoveryURL) == 0 {
+ return nil
+ }
+
+ if len(issuerURL) > 0 && strings.TrimRight(issuerURL, "/") == strings.TrimRight(issuerDiscoveryURL, "/") {
+ allErrs = append(allErrs, field.Invalid(fldPath, issuerDiscoveryURL, "discoveryURL must be different from URL"))
+ }
+
+ // issuerDiscoveryURL is not an issuer URL and does not need to validated against any set of disallowed issuers
+ allErrs = append(allErrs, validateURL(issuerDiscoveryURL, nil, fldPath)...)
+ return allErrs
+}
+
+func validateURL(issuerURL string, disallowedIssuers sets.Set[string], fldPath *field.Path) field.ErrorList {
+ var allErrs field.ErrorList
+
+ if disallowedIssuers.Has(issuerURL) {
+ allErrs = append(allErrs, field.Invalid(fldPath, issuerURL, fmt.Sprintf("URL must not overlap with disallowed issuers: %s", sets.List(disallowedIssuers))))
}
u, err := url.Parse(issuerURL)
@@ -143,25 +181,31 @@ func validateURL(issuerURL string, fldPath *field.Path) field.ErrorList {
return allErrs
}
-func validateAudiences(audiences []string, fldPath *field.Path) field.ErrorList {
+func validateAudiences(audiences []string, audienceMatchPolicy api.AudienceMatchPolicyType, fldPath, audienceMatchPolicyFldPath *field.Path) field.ErrorList {
var allErrs field.ErrorList
if len(audiences) == 0 {
allErrs = append(allErrs, field.Required(fldPath, fmt.Sprintf(atLeastOneRequiredErrFmt, fldPath)))
return allErrs
}
- // This stricter validation is because the --oidc-client-id flag option is singular.
- // This will be removed when we support multiple audiences with the StructuredAuthenticationConfiguration feature gate.
- if len(audiences) > 1 {
- allErrs = append(allErrs, field.TooMany(fldPath, len(audiences), 1))
- return allErrs
- }
+ seenAudiences := sets.NewString()
for i, audience := range audiences {
fldPath := fldPath.Index(i)
if len(audience) == 0 {
allErrs = append(allErrs, field.Required(fldPath, "audience can't be empty"))
}
+ if seenAudiences.Has(audience) {
+ allErrs = append(allErrs, field.Duplicate(fldPath, audience))
+ }
+ seenAudiences.Insert(audience)
+ }
+
+ if len(audiences) > 1 && audienceMatchPolicy != api.AudienceMatchPolicyMatchAny {
+ allErrs = append(allErrs, field.Invalid(audienceMatchPolicyFldPath, audienceMatchPolicy, "audienceMatchPolicy must be MatchAny for multiple audiences"))
+ }
+ if len(audiences) == 1 && (len(audienceMatchPolicy) > 0 && audienceMatchPolicy != api.AudienceMatchPolicyMatchAny) {
+ allErrs = append(allErrs, field.Invalid(audienceMatchPolicyFldPath, audienceMatchPolicy, "audienceMatchPolicy must be empty or MatchAny for single audience"))
}
return allErrs
@@ -181,7 +225,7 @@ func validateCertificateAuthority(certificateAuthority string, fldPath *field.Pa
return allErrs
}
-func validateClaimValidationRules(compiler authenticationcel.Compiler, celMapper *authenticationcel.CELMapper, rules []api.ClaimValidationRule, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList {
+func validateClaimValidationRules(compiler authenticationcel.Compiler, state *validationState, rules []api.ClaimValidationRule, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList {
var allErrs field.ErrorList
seenClaims := sets.NewString()
@@ -220,6 +264,7 @@ func validateClaimValidationRules(compiler authenticationcel.Compiler, celMapper
compilationResult, err := compileClaimsCELExpression(compiler, &authenticationcel.ClaimValidationCondition{
Expression: rule.Expression,
+ Message: rule.Message,
}, fldPath.Child("expression"))
if err != nil {
@@ -233,13 +278,14 @@ func validateClaimValidationRules(compiler authenticationcel.Compiler, celMapper
}
if structuredAuthnFeatureEnabled && len(compilationResults) > 0 {
- celMapper.ClaimValidationRules = authenticationcel.NewClaimsMapper(compilationResults)
+ state.mapper.ClaimValidationRules = authenticationcel.NewClaimsMapper(compilationResults)
+ state.usesEmailVerifiedClaim = state.usesEmailVerifiedClaim || anyUsesEmailVerifiedClaim(compilationResults)
}
return allErrs
}
-func validateClaimMappings(compiler authenticationcel.Compiler, celMapper *authenticationcel.CELMapper, m api.ClaimMappings, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList {
+func validateClaimMappings(compiler authenticationcel.Compiler, state *validationState, m api.ClaimMappings, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList {
var allErrs field.ErrorList
if !structuredAuthnFeatureEnabled {
@@ -257,18 +303,20 @@ func validateClaimMappings(compiler authenticationcel.Compiler, celMapper *authe
}
}
- compilationResult, err := validatePrefixClaimOrExpression(compiler, m.Username, fldPath.Child("username"), true, structuredAuthnFeatureEnabled)
+ compilationResult, err := validatePrefixClaimOrExpression(compiler, m.Username, fldPath.Child("username"), true)
if err != nil {
allErrs = append(allErrs, err...)
} else if compilationResult != nil && structuredAuthnFeatureEnabled {
- celMapper.Username = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult})
+ state.usesEmailClaim = state.usesEmailClaim || usesEmailClaim(compilationResult.AST)
+ state.usesEmailVerifiedClaim = state.usesEmailVerifiedClaim || usesEmailVerifiedClaim(compilationResult.AST)
+ state.mapper.Username = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult})
}
- compilationResult, err = validatePrefixClaimOrExpression(compiler, m.Groups, fldPath.Child("groups"), false, structuredAuthnFeatureEnabled)
+ compilationResult, err = validatePrefixClaimOrExpression(compiler, m.Groups, fldPath.Child("groups"), false)
if err != nil {
allErrs = append(allErrs, err...)
} else if compilationResult != nil && structuredAuthnFeatureEnabled {
- celMapper.Groups = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult})
+ state.mapper.Groups = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult})
}
switch {
@@ -282,7 +330,7 @@ func validateClaimMappings(compiler authenticationcel.Compiler, celMapper *authe
if err != nil {
allErrs = append(allErrs, err)
} else if structuredAuthnFeatureEnabled && compilationResult != nil {
- celMapper.UID = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult})
+ state.mapper.UID = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult})
}
}
@@ -326,13 +374,124 @@ func validateClaimMappings(compiler authenticationcel.Compiler, celMapper *authe
}
if structuredAuthnFeatureEnabled && len(extraCompilationResults) > 0 {
- celMapper.Extra = authenticationcel.NewClaimsMapper(extraCompilationResults)
+ state.mapper.Extra = authenticationcel.NewClaimsMapper(extraCompilationResults)
+ state.usesEmailVerifiedClaim = state.usesEmailVerifiedClaim || anyUsesEmailVerifiedClaim(extraCompilationResults)
+ }
+
+ if structuredAuthnFeatureEnabled && state.usesEmailClaim && !state.usesEmailVerifiedClaim {
+ allErrs = append(allErrs, field.Invalid(fldPath.Child("username", "expression"), m.Username.Expression,
+ "claims.email_verified must be used in claimMappings.username.expression or claimMappings.extra[*].valueExpression or claimValidationRules[*].expression when claims.email is used in claimMappings.username.expression"))
}
return allErrs
}
-func validatePrefixClaimOrExpression(compiler authenticationcel.Compiler, mapping api.PrefixedClaimOrExpression, fldPath *field.Path, claimOrExpressionRequired, structuredAuthnFeatureEnabled bool) (*authenticationcel.CompilationResult, field.ErrorList) {
+func usesEmailClaim(ast *celgo.Ast) bool {
+ return hasSelectExp(ast.Expr(), "claims", "email")
+}
+
+func anyUsesEmailVerifiedClaim(results []authenticationcel.CompilationResult) bool {
+ for _, result := range results {
+ if usesEmailVerifiedClaim(result.AST) {
+ return true
+ }
+ }
+ return false
+}
+
+func usesEmailVerifiedClaim(ast *celgo.Ast) bool {
+ return hasSelectExp(ast.Expr(), "claims", "email_verified")
+}
+
+func hasSelectExp(exp *exprpb.Expr, operand, field string) bool {
+ if exp == nil {
+ return false
+ }
+ switch e := exp.ExprKind.(type) {
+ case *exprpb.Expr_ConstExpr,
+ *exprpb.Expr_IdentExpr:
+ return false
+ case *exprpb.Expr_SelectExpr:
+ s := e.SelectExpr
+ if s == nil {
+ return false
+ }
+ if isIdentOperand(s.Operand, operand) && s.Field == field {
+ return true
+ }
+ return hasSelectExp(s.Operand, operand, field)
+ case *exprpb.Expr_CallExpr:
+ c := e.CallExpr
+ if c == nil {
+ return false
+ }
+ if c.Target == nil && c.Function == operators.OptSelect && len(c.Args) == 2 &&
+ isIdentOperand(c.Args[0], operand) && isConstField(c.Args[1], field) {
+ return true
+ }
+ for _, arg := range c.Args {
+ if hasSelectExp(arg, operand, field) {
+ return true
+ }
+ }
+ return hasSelectExp(c.Target, operand, field)
+ case *exprpb.Expr_ListExpr:
+ l := e.ListExpr
+ if l == nil {
+ return false
+ }
+ for _, element := range l.Elements {
+ if hasSelectExp(element, operand, field) {
+ return true
+ }
+ }
+ return false
+ case *exprpb.Expr_StructExpr:
+ s := e.StructExpr
+ if s == nil {
+ return false
+ }
+ for _, entry := range s.Entries {
+ if hasSelectExp(entry.GetMapKey(), operand, field) {
+ return true
+ }
+ if hasSelectExp(entry.Value, operand, field) {
+ return true
+ }
+ }
+ return false
+ case *exprpb.Expr_ComprehensionExpr:
+ c := e.ComprehensionExpr
+ if c == nil {
+ return false
+ }
+ return hasSelectExp(c.IterRange, operand, field) ||
+ hasSelectExp(c.AccuInit, operand, field) ||
+ hasSelectExp(c.LoopCondition, operand, field) ||
+ hasSelectExp(c.LoopStep, operand, field) ||
+ hasSelectExp(c.Result, operand, field)
+ default:
+ return false
+ }
+}
+
+func isIdentOperand(exp *exprpb.Expr, operand string) bool {
+ if len(operand) == 0 {
+ return false // sanity check against default values
+ }
+ id := exp.GetIdentExpr() // does not panic even if exp is nil
+ return id != nil && id.Name == operand
+}
+
+func isConstField(exp *exprpb.Expr, field string) bool {
+ if len(field) == 0 {
+ return false // sanity check against default values
+ }
+ c := exp.GetConstExpr() // does not panic even if exp is nil
+ return c != nil && c.GetStringValue() == field // does not panic even if c is not a string
+}
+
+func validatePrefixClaimOrExpression(compiler authenticationcel.Compiler, mapping api.PrefixedClaimOrExpression, fldPath *field.Path, claimOrExpressionRequired bool) (*authenticationcel.CompilationResult, field.ErrorList) {
var allErrs field.ErrorList
var compilationResult *authenticationcel.CompilationResult
@@ -364,7 +523,7 @@ func validatePrefixClaimOrExpression(compiler authenticationcel.Compiler, mappin
return compilationResult, allErrs
}
-func validateUserValidationRules(compiler authenticationcel.Compiler, celMapper *authenticationcel.CELMapper, rules []api.UserValidationRule, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList {
+func validateUserValidationRules(compiler authenticationcel.Compiler, state *validationState, rules []api.UserValidationRule, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList {
var allErrs field.ErrorList
var compilationResults []authenticationcel.CompilationResult
@@ -403,7 +562,7 @@ func validateUserValidationRules(compiler authenticationcel.Compiler, celMapper
}
if structuredAuthnFeatureEnabled && len(compilationResults) > 0 {
- celMapper.UserValidationRules = authenticationcel.NewUserMapper(compilationResults)
+ state.mapper.UserValidationRules = authenticationcel.NewUserMapper(compilationResults)
}
return allErrs
@@ -412,7 +571,7 @@ func validateUserValidationRules(compiler authenticationcel.Compiler, celMapper
func compileClaimsCELExpression(compiler authenticationcel.Compiler, expression authenticationcel.ExpressionAccessor, fldPath *field.Path) (*authenticationcel.CompilationResult, *field.Error) {
compilationResult, err := compiler.CompileClaimsExpression(expression)
if err != nil {
- return nil, convertCELErrorToValidationError(fldPath, expression, err)
+ return nil, convertCELErrorToValidationError(fldPath, expression.GetExpression(), err)
}
return &compilationResult, nil
}
@@ -420,7 +579,7 @@ func compileClaimsCELExpression(compiler authenticationcel.Compiler, expression
func compileUserCELExpression(compiler authenticationcel.Compiler, expression authenticationcel.ExpressionAccessor, fldPath *field.Path) (*authenticationcel.CompilationResult, *field.Error) {
compilationResult, err := compiler.CompileUserExpression(expression)
if err != nil {
- return nil, convertCELErrorToValidationError(fldPath, expression, err)
+ return nil, convertCELErrorToValidationError(fldPath, expression.GetExpression(), err)
}
return &compilationResult, nil
}
@@ -573,9 +732,11 @@ func compileMatchConditions(matchConditions []api.WebhookMatchCondition, fldPath
return nil, allErrs
}
- compiler := authorizationcel.NewCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion()))
+ // strictCost is set to true which enables the strict cost for CEL validation.
+ compiler := authorizationcel.NewCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true))
seenExpressions := sets.NewString()
var compilationResults []authorizationcel.CompilationResult
+ var usesFieldSelector, usesLabelSelector bool
for i, condition := range matchConditions {
fldPath := fldPath.Child("matchConditions").Index(i).Child("expression")
@@ -594,12 +755,16 @@ func compileMatchConditions(matchConditions []api.WebhookMatchCondition, fldPath
continue
}
compilationResults = append(compilationResults, compilationResult)
+ usesFieldSelector = usesFieldSelector || compilationResult.UsesFieldSelector
+ usesLabelSelector = usesLabelSelector || compilationResult.UsesLabelSelector
}
if len(compilationResults) == 0 {
return nil, allErrs
}
return &authorizationcel.CELMatcher{
CompilationResults: compilationResults,
+ UsesFieldSelector: usesFieldSelector,
+ UsesLabelSelector: usesLabelSelector,
}, allErrs
}
@@ -609,19 +774,19 @@ func compileMatchConditionsExpression(fldPath *field.Path, compiler authorizatio
}
compilationResult, err := compiler.CompileCELExpression(authzExpression)
if err != nil {
- return compilationResult, convertCELErrorToValidationError(fldPath, authzExpression, err)
+ return compilationResult, convertCELErrorToValidationError(fldPath, authzExpression.GetExpression(), err)
}
return compilationResult, nil
}
-func convertCELErrorToValidationError(fldPath *field.Path, expression authorizationcel.ExpressionAccessor, err error) *field.Error {
+func convertCELErrorToValidationError(fldPath *field.Path, expression string, err error) *field.Error {
var celErr *cel.Error
if errors.As(err, &celErr) {
switch celErr.Type {
case cel.ErrorTypeRequired:
return field.Required(fldPath, celErr.Detail)
case cel.ErrorTypeInvalid:
- return field.Invalid(fldPath, expression.GetExpression(), celErr.Detail)
+ return field.Invalid(fldPath, expression, celErr.Detail)
default:
return field.InternalError(fldPath, celErr)
}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/validation/validation.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation_encryption.go
similarity index 91%
rename from vendor/k8s.io/apiserver/pkg/apis/config/validation/validation.go
rename to vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation_encryption.go
index 90708472a83..b8dd5fe0b54 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/config/validation/validation.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation_encryption.go
@@ -26,7 +26,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/apiserver/pkg/apis/config"
+ "k8s.io/apiserver/pkg/apis/apiserver"
)
const (
@@ -59,12 +59,11 @@ var (
// See https://godoc.org/golang.org/x/crypto/nacl/secretbox#Open for details on the supported key sizes for Secretbox.
secretBoxKeySizes = []int{32}
-
- root = field.NewPath("resources")
)
// ValidateEncryptionConfiguration validates a v1.EncryptionConfiguration.
-func ValidateEncryptionConfiguration(c *config.EncryptionConfiguration, reload bool) field.ErrorList {
+func ValidateEncryptionConfiguration(c *apiserver.EncryptionConfiguration, reload bool) field.ErrorList {
+ root := field.NewPath("resources")
allErrs := field.ErrorList{}
if c == nil {
@@ -78,7 +77,7 @@ func ValidateEncryptionConfiguration(c *config.EncryptionConfiguration, reload b
}
// kmsProviderNames is used to track config names to ensure they are unique.
- kmsProviderNames := sets.NewString()
+ kmsProviderNames := sets.New[string]()
for i, conf := range c.Resources {
r := root.Index(i).Child("resources")
p := root.Index(i).Child("providers")
@@ -284,7 +283,7 @@ func validateResourceNames(resources []string, fieldPath *field.Path) field.Erro
return allErrs
}
-func validateSingleProvider(provider config.ProviderConfiguration, fieldPath *field.Path) field.ErrorList {
+func validateSingleProvider(provider apiserver.ProviderConfiguration, fieldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
found := 0
@@ -315,7 +314,7 @@ func validateSingleProvider(provider config.ProviderConfiguration, fieldPath *fi
return allErrs
}
-func validateKeys(keys []config.Key, fieldPath *field.Path, expectedLen []int) field.ErrorList {
+func validateKeys(keys []apiserver.Key, fieldPath *field.Path, expectedLen []int) field.ErrorList {
allErrs := field.ErrorList{}
if len(keys) == 0 {
@@ -330,7 +329,7 @@ func validateKeys(keys []config.Key, fieldPath *field.Path, expectedLen []int) f
return allErrs
}
-func validateKey(key config.Key, fieldPath *field.Path, expectedLen []int) field.ErrorList {
+func validateKey(key apiserver.Key, fieldPath *field.Path, expectedLen []int) field.ErrorList {
allErrs := field.ErrorList{}
if key.Name == "" {
@@ -363,7 +362,7 @@ func validateKey(key config.Key, fieldPath *field.Path, expectedLen []int) field
return allErrs
}
-func validateKMSConfiguration(c *config.KMSConfiguration, fieldPath *field.Path, kmsProviderNames sets.String, reload bool) field.ErrorList {
+func validateKMSConfiguration(c *apiserver.KMSConfiguration, fieldPath *field.Path, kmsProviderNames sets.Set[string], reload bool) field.ErrorList {
allErrs := field.ErrorList{}
allErrs = append(allErrs, validateKMSConfigName(c, fieldPath.Child("name"), kmsProviderNames, reload)...)
@@ -374,7 +373,7 @@ func validateKMSConfiguration(c *config.KMSConfiguration, fieldPath *field.Path,
return allErrs
}
-func validateKMSCacheSize(c *config.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
+func validateKMSCacheSize(c *apiserver.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
// In defaulting, we set the cache size to the default value only when API version is v1.
@@ -389,7 +388,7 @@ func validateKMSCacheSize(c *config.KMSConfiguration, fieldPath *field.Path) fie
return allErrs
}
-func validateKMSTimeout(c *config.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
+func validateKMSTimeout(c *apiserver.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if c.Timeout.Duration <= 0 {
allErrs = append(allErrs, field.Invalid(fieldPath, c.Timeout, fmt.Sprintf(zeroOrNegativeErrFmt, "timeout")))
@@ -398,7 +397,7 @@ func validateKMSTimeout(c *config.KMSConfiguration, fieldPath *field.Path) field
return allErrs
}
-func validateKMSEndpoint(c *config.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
+func validateKMSEndpoint(c *apiserver.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if len(c.Endpoint) == 0 {
return append(allErrs, field.Invalid(fieldPath, "", fmt.Sprintf(mandatoryFieldErrFmt, "endpoint", "kms")))
@@ -416,7 +415,7 @@ func validateKMSEndpoint(c *config.KMSConfiguration, fieldPath *field.Path) fiel
return allErrs
}
-func validateKMSAPIVersion(c *config.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
+func validateKMSAPIVersion(c *apiserver.KMSConfiguration, fieldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if c.APIVersion != "v1" && c.APIVersion != "v2" {
allErrs = append(allErrs, field.Invalid(fieldPath, c.APIVersion, fmt.Sprintf(unsupportedKMSAPIVersionErrFmt, "apiVersion")))
@@ -425,7 +424,7 @@ func validateKMSAPIVersion(c *config.KMSConfiguration, fieldPath *field.Path) fi
return allErrs
}
-func validateKMSConfigName(c *config.KMSConfiguration, fieldPath *field.Path, kmsProviderNames sets.String, reload bool) field.ErrorList {
+func validateKMSConfigName(c *apiserver.KMSConfiguration, fieldPath *field.Path, kmsProviderNames sets.Set[string], reload bool) field.ErrorList {
allErrs := field.ErrorList{}
if c.Name == "" {
allErrs = append(allErrs, field.Required(fieldPath, fmt.Sprintf(mandatoryFieldErrFmt, "name", "provider")))
diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go
index 77e5c314219..6439e822081 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go
@@ -22,9 +22,31 @@ limitations under the License.
package apiserver
import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AESConfiguration) DeepCopyInto(out *AESConfiguration) {
+ *out = *in
+ if in.Keys != nil {
+ in, out := &in.Keys, &out.Keys
+ *out = make([]Key, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AESConfiguration.
+func (in *AESConfiguration) DeepCopy() *AESConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(AESConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdmissionConfiguration) DeepCopyInto(out *AdmissionConfiguration) {
*out = *in
@@ -78,6 +100,43 @@ func (in *AdmissionPluginConfiguration) DeepCopy() *AdmissionPluginConfiguration
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AnonymousAuthCondition) DeepCopyInto(out *AnonymousAuthCondition) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnonymousAuthCondition.
+func (in *AnonymousAuthCondition) DeepCopy() *AnonymousAuthCondition {
+ if in == nil {
+ return nil
+ }
+ out := new(AnonymousAuthCondition)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AnonymousAuthConfig) DeepCopyInto(out *AnonymousAuthConfig) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]AnonymousAuthCondition, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnonymousAuthConfig.
+func (in *AnonymousAuthConfig) DeepCopy() *AnonymousAuthConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(AnonymousAuthConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AuthenticationConfiguration) DeepCopyInto(out *AuthenticationConfiguration) {
*out = *in
@@ -89,6 +148,11 @@ func (in *AuthenticationConfiguration) DeepCopyInto(out *AuthenticationConfigura
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.Anonymous != nil {
+ in, out := &in.Anonymous, &out.Anonymous
+ *out = new(AnonymousAuthConfig)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -289,6 +353,38 @@ func (in *EgressSelectorConfiguration) DeepCopyObject() runtime.Object {
return nil
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *EncryptionConfiguration) DeepCopyInto(out *EncryptionConfiguration) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]ResourceConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionConfiguration.
+func (in *EncryptionConfiguration) DeepCopy() *EncryptionConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(EncryptionConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *EncryptionConfiguration) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ExtraMapping) DeepCopyInto(out *ExtraMapping) {
*out = *in
@@ -305,6 +401,22 @@ func (in *ExtraMapping) DeepCopy() *ExtraMapping {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IdentityConfiguration) DeepCopyInto(out *IdentityConfiguration) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityConfiguration.
+func (in *IdentityConfiguration) DeepCopy() *IdentityConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(IdentityConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Issuer) DeepCopyInto(out *Issuer) {
*out = *in
@@ -354,6 +466,48 @@ func (in *JWTAuthenticator) DeepCopy() *JWTAuthenticator {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KMSConfiguration) DeepCopyInto(out *KMSConfiguration) {
+ *out = *in
+ if in.CacheSize != nil {
+ in, out := &in.CacheSize, &out.CacheSize
+ *out = new(int32)
+ **out = **in
+ }
+ if in.Timeout != nil {
+ in, out := &in.Timeout, &out.Timeout
+ *out = new(v1.Duration)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSConfiguration.
+func (in *KMSConfiguration) DeepCopy() *KMSConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(KMSConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Key) DeepCopyInto(out *Key) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Key.
+func (in *Key) DeepCopy() *Key {
+ if in == nil {
+ return nil
+ }
+ out := new(Key)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PrefixedClaimOrExpression) DeepCopyInto(out *PrefixedClaimOrExpression) {
*out = *in
@@ -375,6 +529,96 @@ func (in *PrefixedClaimOrExpression) DeepCopy() *PrefixedClaimOrExpression {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ProviderConfiguration) DeepCopyInto(out *ProviderConfiguration) {
+ *out = *in
+ if in.AESGCM != nil {
+ in, out := &in.AESGCM, &out.AESGCM
+ *out = new(AESConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.AESCBC != nil {
+ in, out := &in.AESCBC, &out.AESCBC
+ *out = new(AESConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Secretbox != nil {
+ in, out := &in.Secretbox, &out.Secretbox
+ *out = new(SecretboxConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Identity != nil {
+ in, out := &in.Identity, &out.Identity
+ *out = new(IdentityConfiguration)
+ **out = **in
+ }
+ if in.KMS != nil {
+ in, out := &in.KMS, &out.KMS
+ *out = new(KMSConfiguration)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfiguration.
+func (in *ProviderConfiguration) DeepCopy() *ProviderConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(ProviderConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResourceConfiguration) DeepCopyInto(out *ResourceConfiguration) {
+ *out = *in
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Providers != nil {
+ in, out := &in.Providers, &out.Providers
+ *out = make([]ProviderConfiguration, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceConfiguration.
+func (in *ResourceConfiguration) DeepCopy() *ResourceConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(ResourceConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SecretboxConfiguration) DeepCopyInto(out *SecretboxConfiguration) {
+ *out = *in
+ if in.Keys != nil {
+ in, out := &in.Keys, &out.Keys
+ *out = make([]Key, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretboxConfiguration.
+func (in *SecretboxConfiguration) DeepCopy() *SecretboxConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(SecretboxConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TCPTransport) DeepCopyInto(out *TCPTransport) {
*out = *in
diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.pb.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.pb.go
index d7454c7a55c..27dab8c09ba 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.pb.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.pb.go
@@ -15,7 +15,7 @@ limitations under the License.
*/
// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto
+// source: k8s.io/apiserver/pkg/apis/audit/v1/generated.proto
package v1
@@ -52,7 +52,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func (m *Event) Reset() { *m = Event{} }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) {
- return fileDescriptor_4982ac40a460d730, []int{0}
+ return fileDescriptor_62937bb89ca7b6dd, []int{0}
}
func (m *Event) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -80,7 +80,7 @@ var xxx_messageInfo_Event proto.InternalMessageInfo
func (m *EventList) Reset() { *m = EventList{} }
func (*EventList) ProtoMessage() {}
func (*EventList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4982ac40a460d730, []int{1}
+ return fileDescriptor_62937bb89ca7b6dd, []int{1}
}
func (m *EventList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -108,7 +108,7 @@ var xxx_messageInfo_EventList proto.InternalMessageInfo
func (m *GroupResources) Reset() { *m = GroupResources{} }
func (*GroupResources) ProtoMessage() {}
func (*GroupResources) Descriptor() ([]byte, []int) {
- return fileDescriptor_4982ac40a460d730, []int{2}
+ return fileDescriptor_62937bb89ca7b6dd, []int{2}
}
func (m *GroupResources) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -136,7 +136,7 @@ var xxx_messageInfo_GroupResources proto.InternalMessageInfo
func (m *ObjectReference) Reset() { *m = ObjectReference{} }
func (*ObjectReference) ProtoMessage() {}
func (*ObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_4982ac40a460d730, []int{3}
+ return fileDescriptor_62937bb89ca7b6dd, []int{3}
}
func (m *ObjectReference) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -164,7 +164,7 @@ var xxx_messageInfo_ObjectReference proto.InternalMessageInfo
func (m *Policy) Reset() { *m = Policy{} }
func (*Policy) ProtoMessage() {}
func (*Policy) Descriptor() ([]byte, []int) {
- return fileDescriptor_4982ac40a460d730, []int{4}
+ return fileDescriptor_62937bb89ca7b6dd, []int{4}
}
func (m *Policy) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -192,7 +192,7 @@ var xxx_messageInfo_Policy proto.InternalMessageInfo
func (m *PolicyList) Reset() { *m = PolicyList{} }
func (*PolicyList) ProtoMessage() {}
func (*PolicyList) Descriptor() ([]byte, []int) {
- return fileDescriptor_4982ac40a460d730, []int{5}
+ return fileDescriptor_62937bb89ca7b6dd, []int{5}
}
func (m *PolicyList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -220,7 +220,7 @@ var xxx_messageInfo_PolicyList proto.InternalMessageInfo
func (m *PolicyRule) Reset() { *m = PolicyRule{} }
func (*PolicyRule) ProtoMessage() {}
func (*PolicyRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_4982ac40a460d730, []int{6}
+ return fileDescriptor_62937bb89ca7b6dd, []int{6}
}
func (m *PolicyRule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -257,92 +257,91 @@ func init() {
}
func init() {
- proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto", fileDescriptor_4982ac40a460d730)
-}
-
-var fileDescriptor_4982ac40a460d730 = []byte{
- // 1288 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
- 0x14, 0xcf, 0xc6, 0x71, 0x63, 0x8f, 0x1b, 0xc7, 0x99, 0x16, 0xba, 0xe4, 0x60, 0x1b, 0x23, 0xa1,
- 0x00, 0x61, 0xb7, 0x0d, 0x85, 0x56, 0x95, 0x40, 0xb2, 0x69, 0x69, 0x2d, 0x9a, 0x3f, 0x1a, 0xe3,
- 0x1e, 0x10, 0x87, 0xae, 0xd7, 0x2f, 0xf6, 0x62, 0x7b, 0x76, 0xbb, 0x33, 0x6b, 0x94, 0x1b, 0x5f,
- 0x00, 0x89, 0x3b, 0xdf, 0x82, 0x1b, 0xe2, 0xc4, 0x2d, 0xc7, 0x1e, 0x7b, 0xb2, 0x88, 0xe1, 0x53,
- 0xe4, 0x80, 0xd0, 0xcc, 0xce, 0xfe, 0xb1, 0x13, 0x2b, 0x0e, 0x07, 0x6e, 0x9e, 0xf7, 0x7e, 0xbf,
- 0xdf, 0x7b, 0xfb, 0xf6, 0xbd, 0x37, 0x6b, 0xf4, 0xf5, 0xe0, 0x21, 0x33, 0x1c, 0xd7, 0x1c, 0x04,
- 0x1d, 0xf0, 0x29, 0x70, 0x60, 0xe6, 0x18, 0x68, 0xd7, 0xf5, 0x4d, 0xe5, 0xb0, 0x3c, 0x87, 0x81,
- 0x3f, 0x06, 0xdf, 0xf4, 0x06, 0x3d, 0x79, 0x32, 0xad, 0xa0, 0xeb, 0x70, 0x73, 0x7c, 0xcf, 0xec,
- 0x01, 0x05, 0xdf, 0xe2, 0xd0, 0x35, 0x3c, 0xdf, 0xe5, 0x2e, 0xae, 0x85, 0x1c, 0x23, 0xe6, 0x18,
- 0xde, 0xa0, 0x27, 0x4f, 0x86, 0xe4, 0x18, 0xe3, 0x7b, 0xdb, 0x1f, 0xf7, 0x1c, 0xde, 0x0f, 0x3a,
- 0x86, 0xed, 0x8e, 0xcc, 0x9e, 0xdb, 0x73, 0x4d, 0x49, 0xed, 0x04, 0xc7, 0xf2, 0x24, 0x0f, 0xf2,
- 0x57, 0x28, 0xb9, 0xbd, 0x9b, 0xa4, 0x61, 0x5a, 0x01, 0xef, 0x03, 0xe5, 0x8e, 0x6d, 0x71, 0xc7,
- 0xa5, 0x97, 0x24, 0xb0, 0x7d, 0x3f, 0x41, 0x8f, 0x2c, 0xbb, 0xef, 0x50, 0xf0, 0x4f, 0x92, 0xbc,
- 0x47, 0xc0, 0xad, 0xcb, 0x58, 0xe6, 0x22, 0x96, 0x1f, 0x50, 0xee, 0x8c, 0xe0, 0x02, 0xe1, 0xb3,
- 0xab, 0x08, 0xcc, 0xee, 0xc3, 0xc8, 0x9a, 0xe7, 0xd5, 0xfe, 0x46, 0x28, 0xfb, 0x64, 0x0c, 0x94,
- 0xe3, 0x5d, 0x94, 0x1d, 0xc2, 0x18, 0x86, 0xba, 0x56, 0xd5, 0x76, 0xf2, 0x8d, 0xb7, 0x4f, 0x27,
- 0x95, 0x95, 0xe9, 0xa4, 0x92, 0x7d, 0x2e, 0x8c, 0xe7, 0xd1, 0x0f, 0x12, 0x82, 0xf0, 0x01, 0x5a,
- 0x97, 0xf5, 0x6b, 0x3e, 0xd6, 0x57, 0x25, 0xfe, 0xbe, 0xc2, 0xaf, 0xd7, 0x43, 0xf3, 0xf9, 0xa4,
- 0xf2, 0xee, 0xa2, 0x9c, 0xf8, 0x89, 0x07, 0xcc, 0x68, 0x37, 0x1f, 0x93, 0x48, 0x44, 0x44, 0x67,
- 0xdc, 0xea, 0x81, 0x9e, 0x99, 0x8d, 0xde, 0x12, 0xc6, 0xf3, 0xe8, 0x07, 0x09, 0x41, 0x78, 0x0f,
- 0x21, 0x1f, 0x5e, 0x05, 0xc0, 0x78, 0x9b, 0x34, 0xf5, 0x35, 0x49, 0xc1, 0x8a, 0x82, 0x48, 0xec,
- 0x21, 0x29, 0x14, 0xae, 0xa2, 0xb5, 0x31, 0xf8, 0x1d, 0x3d, 0x2b, 0xd1, 0x37, 0x15, 0x7a, 0xed,
- 0x05, 0xf8, 0x1d, 0x22, 0x3d, 0xf8, 0x19, 0x5a, 0x0b, 0x18, 0xf8, 0xfa, 0x8d, 0xaa, 0xb6, 0x53,
- 0xd8, 0x7b, 0xdf, 0x48, 0x5a, 0xc7, 0x98, 0x7d, 0xcf, 0xc6, 0xf8, 0x9e, 0xd1, 0x66, 0xe0, 0x37,
- 0xe9, 0xb1, 0x9b, 0x28, 0x09, 0x0b, 0x91, 0x0a, 0xb8, 0x8f, 0x4a, 0xce, 0xc8, 0x03, 0x9f, 0xb9,
- 0x54, 0xd4, 0x5a, 0x78, 0xf4, 0xf5, 0x6b, 0xa9, 0xde, 0x9e, 0x4e, 0x2a, 0xa5, 0xe6, 0x9c, 0x06,
- 0xb9, 0xa0, 0x8a, 0x3f, 0x42, 0x79, 0xe6, 0x06, 0xbe, 0x0d, 0xcd, 0x23, 0xa6, 0xe7, 0xaa, 0x99,
- 0x9d, 0x7c, 0x63, 0x63, 0x3a, 0xa9, 0xe4, 0x5b, 0x91, 0x91, 0x24, 0x7e, 0x6c, 0xa2, 0xbc, 0x48,
- 0xaf, 0xde, 0x03, 0xca, 0xf5, 0x92, 0xac, 0xc3, 0x96, 0xca, 0x3e, 0xdf, 0x8e, 0x1c, 0x24, 0xc1,
- 0xe0, 0x97, 0x28, 0xef, 0x76, 0xbe, 0x07, 0x9b, 0x13, 0x38, 0xd6, 0xf3, 0xf2, 0x01, 0x3e, 0x31,
- 0xae, 0x9e, 0x28, 0xe3, 0x30, 0x22, 0x81, 0x0f, 0xd4, 0x86, 0x30, 0xa5, 0xd8, 0x48, 0x12, 0x51,
- 0xdc, 0x47, 0x45, 0x1f, 0x98, 0xe7, 0x52, 0x06, 0x2d, 0x6e, 0xf1, 0x80, 0xe9, 0x48, 0x86, 0xd9,
- 0x4d, 0x85, 0x89, 0x9b, 0x27, 0x89, 0x24, 0xe6, 0x46, 0x04, 0x0a, 0x39, 0x0d, 0x3c, 0x9d, 0x54,
- 0x8a, 0x64, 0x46, 0x87, 0xcc, 0xe9, 0x62, 0x0b, 0x6d, 0xa8, 0x6e, 0x08, 0x13, 0xd1, 0x0b, 0x32,
- 0xd0, 0xce, 0xc2, 0x40, 0x6a, 0x72, 0x8c, 0x36, 0x1d, 0x50, 0xf7, 0x07, 0xda, 0xd8, 0x9a, 0x4e,
- 0x2a, 0x1b, 0x24, 0x2d, 0x41, 0x66, 0x15, 0x71, 0x37, 0x79, 0x18, 0x15, 0xe3, 0xe6, 0x35, 0x63,
- 0xcc, 0x3c, 0x88, 0x0a, 0x32, 0xa7, 0x89, 0x7f, 0xd2, 0x90, 0xae, 0xe2, 0x12, 0xb0, 0xc1, 0x19,
- 0x43, 0xf7, 0x1b, 0x67, 0x04, 0x8c, 0x5b, 0x23, 0x4f, 0xdf, 0x90, 0x01, 0xcd, 0xe5, 0xaa, 0xb7,
- 0xef, 0xd8, 0xbe, 0x2b, 0xb8, 0x8d, 0xaa, 0x6a, 0x03, 0x9d, 0x2c, 0x10, 0x26, 0x0b, 0x43, 0x62,
- 0x17, 0x15, 0xe5, 0x54, 0x26, 0x49, 0x14, 0xff, 0x5b, 0x12, 0xd1, 0xd0, 0x17, 0x5b, 0x33, 0x72,
- 0x64, 0x4e, 0x1e, 0xbf, 0x42, 0x05, 0x8b, 0x52, 0x97, 0xcb, 0xa9, 0x61, 0xfa, 0x66, 0x35, 0xb3,
- 0x53, 0xd8, 0x7b, 0xb4, 0x4c, 0x5f, 0xca, 0x4d, 0x67, 0xd4, 0x13, 0xf2, 0x13, 0xca, 0xfd, 0x93,
- 0xc6, 0x2d, 0x15, 0xb8, 0x90, 0xf2, 0x90, 0x74, 0x8c, 0xed, 0x2f, 0x50, 0x69, 0x9e, 0x85, 0x4b,
- 0x28, 0x33, 0x80, 0x93, 0x70, 0x5d, 0x12, 0xf1, 0x13, 0xdf, 0x46, 0xd9, 0xb1, 0x35, 0x0c, 0x20,
- 0x5c, 0x89, 0x24, 0x3c, 0x3c, 0x5a, 0x7d, 0xa8, 0xd5, 0x7e, 0xd3, 0x50, 0x5e, 0x06, 0x7f, 0xee,
- 0x30, 0x8e, 0xbf, 0x43, 0x39, 0xf1, 0xf4, 0x5d, 0x8b, 0x5b, 0x92, 0x5e, 0xd8, 0x33, 0x96, 0xab,
- 0x95, 0x60, 0xef, 0x03, 0xb7, 0x1a, 0x25, 0x95, 0x71, 0x2e, 0xb2, 0x90, 0x58, 0x11, 0x1f, 0xa0,
- 0xac, 0xc3, 0x61, 0xc4, 0xf4, 0x55, 0x59, 0x98, 0x0f, 0x96, 0x2e, 0x4c, 0x63, 0x23, 0xda, 0xba,
- 0x4d, 0xc1, 0x27, 0xa1, 0x4c, 0xed, 0x17, 0x0d, 0x15, 0x9f, 0xfa, 0x6e, 0xe0, 0x11, 0x08, 0x57,
- 0x09, 0xc3, 0xef, 0xa1, 0x6c, 0x4f, 0x58, 0xd4, 0x5d, 0x11, 0xf3, 0x42, 0x58, 0xe8, 0x13, 0xab,
- 0xc9, 0x8f, 0x18, 0x32, 0x17, 0xb5, 0x9a, 0x62, 0x19, 0x92, 0xf8, 0xf1, 0x03, 0x31, 0x9d, 0xe1,
- 0xe1, 0xc0, 0x1a, 0x01, 0xd3, 0x33, 0x92, 0xa0, 0x66, 0x2e, 0xe5, 0x20, 0xb3, 0xb8, 0xda, 0xaf,
- 0x19, 0xb4, 0x39, 0xb7, 0x6e, 0xf0, 0x2e, 0xca, 0x45, 0x20, 0x95, 0x61, 0x5c, 0xaf, 0x48, 0x8b,
- 0xc4, 0x08, 0xb1, 0x15, 0xa9, 0x90, 0xf2, 0x2c, 0x5b, 0xbd, 0xb9, 0x64, 0x2b, 0x1e, 0x44, 0x0e,
- 0x92, 0x60, 0xc4, 0x4d, 0x22, 0x0e, 0xea, 0xaa, 0x8a, 0xf7, 0xbf, 0xc0, 0x12, 0xe9, 0xc1, 0x0d,
- 0x94, 0x09, 0x9c, 0xae, 0xba, 0x98, 0xee, 0x2a, 0x40, 0xa6, 0xbd, 0xec, 0xad, 0x28, 0xc8, 0xe2,
- 0x21, 0x2c, 0xcf, 0x91, 0x15, 0x55, 0x77, 0x56, 0xfc, 0x10, 0xf5, 0xa3, 0x66, 0x58, 0xe9, 0x18,
- 0x21, 0x6e, 0x44, 0xcb, 0x73, 0x5e, 0x80, 0xcf, 0x1c, 0x97, 0xca, 0x1b, 0x2c, 0x75, 0x23, 0xd6,
- 0x8f, 0x9a, 0xca, 0x43, 0x52, 0x28, 0x5c, 0x47, 0x9b, 0x51, 0x11, 0x22, 0xe2, 0xba, 0x24, 0xde,
- 0x51, 0xc4, 0x4d, 0x32, 0xeb, 0x26, 0xf3, 0x78, 0xfc, 0x29, 0x2a, 0xb0, 0xa0, 0x13, 0x17, 0x3b,
- 0x27, 0xe9, 0xf1, 0x38, 0xb5, 0x12, 0x17, 0x49, 0xe3, 0x6a, 0x7f, 0xac, 0xa2, 0x1b, 0x47, 0xee,
- 0xd0, 0xb1, 0x4f, 0xf0, 0xcb, 0x0b, 0xb3, 0x70, 0x77, 0xb9, 0x59, 0x08, 0x5f, 0xba, 0x9c, 0x86,
- 0xf8, 0x41, 0x13, 0x5b, 0x6a, 0x1e, 0x5a, 0x28, 0xeb, 0x07, 0x43, 0x88, 0xe6, 0xc1, 0x58, 0x66,
- 0x1e, 0xc2, 0xe4, 0x48, 0x30, 0x84, 0xa4, 0xb9, 0xc5, 0x89, 0x91, 0x50, 0x0b, 0x3f, 0x40, 0xc8,
- 0x1d, 0x39, 0x5c, 0x6e, 0xaa, 0xa8, 0x59, 0xef, 0xc8, 0x14, 0x62, 0x6b, 0xf2, 0xd5, 0x92, 0x82,
- 0xe2, 0xa7, 0x68, 0x4b, 0x9c, 0xf6, 0x2d, 0x6a, 0xf5, 0xa0, 0xfb, 0x95, 0x03, 0xc3, 0x2e, 0x93,
- 0x8d, 0x92, 0x6b, 0xbc, 0xa3, 0x22, 0x6d, 0x1d, 0xce, 0x03, 0xc8, 0x45, 0x4e, 0xed, 0x77, 0x0d,
- 0xa1, 0x30, 0xcd, 0xff, 0x61, 0xa7, 0x1c, 0xce, 0xee, 0x94, 0x0f, 0x97, 0xaf, 0xe1, 0x82, 0xa5,
- 0xf2, 0x4f, 0x26, 0xca, 0x5e, 0x94, 0xf5, 0x9a, 0x1f, 0x9f, 0x15, 0x94, 0x15, 0xdf, 0x28, 0xd1,
- 0x56, 0xc9, 0x0b, 0xa4, 0xf8, 0x7e, 0x61, 0x24, 0xb4, 0x63, 0x03, 0x21, 0xf1, 0x43, 0x8e, 0x46,
- 0xf4, 0x76, 0x8a, 0xe2, 0xed, 0xb4, 0x63, 0x2b, 0x49, 0x21, 0x84, 0xa0, 0xf8, 0x02, 0x14, 0x2f,
- 0x22, 0x16, 0x14, 0x1f, 0x86, 0x8c, 0x84, 0x76, 0x6c, 0xa7, 0x77, 0x59, 0x56, 0xd6, 0x60, 0x6f,
- 0x99, 0x1a, 0xcc, 0xee, 0xcd, 0x64, 0xaf, 0x5c, 0xba, 0x03, 0x0d, 0x84, 0xe2, 0x25, 0xc3, 0xf4,
- 0x1b, 0x49, 0xd6, 0xf1, 0x16, 0x62, 0x24, 0x85, 0xc0, 0x9f, 0xa3, 0x4d, 0xea, 0xd2, 0x48, 0xaa,
- 0x4d, 0x9e, 0x33, 0x7d, 0x5d, 0x92, 0x6e, 0x89, 0xd9, 0x3d, 0x98, 0x75, 0x91, 0x79, 0xec, 0x5c,
- 0x0b, 0xe7, 0x96, 0x6f, 0xe1, 0x2f, 0x2f, 0x6b, 0xe1, 0xbc, 0x6c, 0xe1, 0xb7, 0x96, 0x6d, 0xdf,
- 0xc6, 0xb3, 0xd3, 0xb3, 0xf2, 0xca, 0xeb, 0xb3, 0xf2, 0xca, 0x9b, 0xb3, 0xf2, 0xca, 0x8f, 0xd3,
- 0xb2, 0x76, 0x3a, 0x2d, 0x6b, 0xaf, 0xa7, 0x65, 0xed, 0xcd, 0xb4, 0xac, 0xfd, 0x39, 0x2d, 0x6b,
- 0x3f, 0xff, 0x55, 0x5e, 0xf9, 0xb6, 0x76, 0xf5, 0x5f, 0xbe, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff,
- 0xef, 0x9b, 0x7d, 0x75, 0x30, 0x0e, 0x00, 0x00,
+ proto.RegisterFile("k8s.io/apiserver/pkg/apis/audit/v1/generated.proto", fileDescriptor_62937bb89ca7b6dd)
+}
+
+var fileDescriptor_62937bb89ca7b6dd = []byte{
+ // 1275 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0xd5,
+ 0x13, 0xcf, 0xc6, 0x71, 0x63, 0x8f, 0x1b, 0xc7, 0x79, 0xed, 0xf7, 0xdb, 0x25, 0x07, 0xdb, 0x18,
+ 0x09, 0x05, 0x08, 0xeb, 0xd6, 0x14, 0x5a, 0x55, 0x02, 0xc9, 0xa6, 0xa5, 0xb5, 0xd4, 0xa6, 0xd1,
+ 0x33, 0xee, 0x01, 0x71, 0xe8, 0x7a, 0x3d, 0xb5, 0x97, 0xd8, 0xbb, 0xdb, 0x7d, 0x6f, 0x8d, 0x72,
+ 0xe3, 0x1f, 0x40, 0xe2, 0xce, 0x7f, 0xc1, 0x0d, 0x71, 0xe2, 0x96, 0x63, 0x8f, 0x3d, 0x59, 0xc4,
+ 0xf0, 0x57, 0xe4, 0x80, 0xd0, 0x7b, 0xfb, 0xf6, 0x87, 0x9d, 0x58, 0x71, 0x38, 0x70, 0xf3, 0x9b,
+ 0xf9, 0x7c, 0x3e, 0x33, 0x3b, 0x3b, 0x33, 0x6f, 0x0d, 0x8d, 0xa3, 0xfb, 0xcc, 0xb0, 0xdd, 0xba,
+ 0xe9, 0xd9, 0x0c, 0xfd, 0x09, 0xfa, 0x75, 0xef, 0x68, 0x20, 0x4f, 0x75, 0x33, 0xe8, 0xdb, 0xbc,
+ 0x3e, 0xb9, 0x53, 0x1f, 0xa0, 0x83, 0xbe, 0xc9, 0xb1, 0x6f, 0x78, 0xbe, 0xcb, 0x5d, 0x52, 0x0b,
+ 0x39, 0x46, 0xcc, 0x31, 0xbc, 0xa3, 0x81, 0x3c, 0x19, 0x92, 0x63, 0x4c, 0xee, 0xec, 0x7e, 0x3c,
+ 0xb0, 0xf9, 0x30, 0xe8, 0x19, 0x96, 0x3b, 0xae, 0x0f, 0xdc, 0x81, 0x5b, 0x97, 0xd4, 0x5e, 0xf0,
+ 0x4a, 0x9e, 0xe4, 0x41, 0xfe, 0x0a, 0x25, 0x77, 0xf7, 0x93, 0x34, 0xea, 0x66, 0xc0, 0x87, 0xe8,
+ 0x70, 0xdb, 0x32, 0xb9, 0xed, 0x3a, 0x17, 0x24, 0xb0, 0x7b, 0x37, 0x41, 0x8f, 0x4d, 0x6b, 0x68,
+ 0x3b, 0xe8, 0x1f, 0x27, 0x79, 0x8f, 0x91, 0x9b, 0x17, 0xb1, 0xea, 0xcb, 0x58, 0x7e, 0xe0, 0x70,
+ 0x7b, 0x8c, 0xe7, 0x08, 0x9f, 0x5d, 0x46, 0x60, 0xd6, 0x10, 0xc7, 0xe6, 0x22, 0xaf, 0xf6, 0x17,
+ 0x40, 0xf6, 0xd1, 0x04, 0x1d, 0x4e, 0xf6, 0x21, 0x3b, 0xc2, 0x09, 0x8e, 0x74, 0xad, 0xaa, 0xed,
+ 0xe5, 0x5b, 0xff, 0x3f, 0x99, 0x56, 0xd6, 0x66, 0xd3, 0x4a, 0xf6, 0xa9, 0x30, 0x9e, 0x45, 0x3f,
+ 0x68, 0x08, 0x22, 0x07, 0xb0, 0x29, 0xeb, 0xd7, 0x7e, 0xa8, 0xaf, 0x4b, 0xfc, 0x5d, 0x85, 0xdf,
+ 0x6c, 0x86, 0xe6, 0xb3, 0x69, 0xe5, 0xdd, 0x65, 0x39, 0xf1, 0x63, 0x0f, 0x99, 0xd1, 0x6d, 0x3f,
+ 0xa4, 0x91, 0x88, 0x88, 0xce, 0xb8, 0x39, 0x40, 0x3d, 0x33, 0x1f, 0xbd, 0x23, 0x8c, 0x67, 0xd1,
+ 0x0f, 0x1a, 0x82, 0x48, 0x03, 0xc0, 0xc7, 0xd7, 0x01, 0x32, 0xde, 0xa5, 0x6d, 0x7d, 0x43, 0x52,
+ 0x88, 0xa2, 0x00, 0x8d, 0x3d, 0x34, 0x85, 0x22, 0x55, 0xd8, 0x98, 0xa0, 0xdf, 0xd3, 0xb3, 0x12,
+ 0x7d, 0x5d, 0xa1, 0x37, 0x5e, 0xa0, 0xdf, 0xa3, 0xd2, 0x43, 0x9e, 0xc0, 0x46, 0xc0, 0xd0, 0xd7,
+ 0xaf, 0x55, 0xb5, 0xbd, 0x42, 0xe3, 0x7d, 0x23, 0x69, 0x1d, 0x63, 0xfe, 0x3d, 0x1b, 0x93, 0x3b,
+ 0x46, 0x97, 0xa1, 0xdf, 0x76, 0x5e, 0xb9, 0x89, 0x92, 0xb0, 0x50, 0xa9, 0x40, 0x86, 0x50, 0xb2,
+ 0xc7, 0x1e, 0xfa, 0xcc, 0x75, 0x44, 0xad, 0x85, 0x47, 0xdf, 0xbc, 0x92, 0xea, 0xcd, 0xd9, 0xb4,
+ 0x52, 0x6a, 0x2f, 0x68, 0xd0, 0x73, 0xaa, 0xe4, 0x23, 0xc8, 0x33, 0x37, 0xf0, 0x2d, 0x6c, 0x1f,
+ 0x32, 0x3d, 0x57, 0xcd, 0xec, 0xe5, 0x5b, 0x5b, 0xb3, 0x69, 0x25, 0xdf, 0x89, 0x8c, 0x34, 0xf1,
+ 0x93, 0x3a, 0xe4, 0x45, 0x7a, 0xcd, 0x01, 0x3a, 0x5c, 0x2f, 0xc9, 0x3a, 0xec, 0xa8, 0xec, 0xf3,
+ 0xdd, 0xc8, 0x41, 0x13, 0x0c, 0x79, 0x09, 0x79, 0xb7, 0xf7, 0x1d, 0x5a, 0x9c, 0xe2, 0x2b, 0x3d,
+ 0x2f, 0x1f, 0xe0, 0x13, 0xe3, 0xf2, 0x89, 0x32, 0x9e, 0x47, 0x24, 0xf4, 0xd1, 0xb1, 0x30, 0x4c,
+ 0x29, 0x36, 0xd2, 0x44, 0x94, 0x0c, 0xa1, 0xe8, 0x23, 0xf3, 0x5c, 0x87, 0x61, 0x87, 0x9b, 0x3c,
+ 0x60, 0x3a, 0xc8, 0x30, 0xfb, 0xa9, 0x30, 0x71, 0xf3, 0x24, 0x91, 0xc4, 0xdc, 0x88, 0x40, 0x21,
+ 0xa7, 0x45, 0x66, 0xd3, 0x4a, 0x91, 0xce, 0xe9, 0xd0, 0x05, 0x5d, 0x62, 0xc2, 0x96, 0xea, 0x86,
+ 0x30, 0x11, 0xbd, 0x20, 0x03, 0xed, 0x2d, 0x0d, 0xa4, 0x26, 0xc7, 0xe8, 0x3a, 0x47, 0x8e, 0xfb,
+ 0xbd, 0xd3, 0xda, 0x99, 0x4d, 0x2b, 0x5b, 0x34, 0x2d, 0x41, 0xe7, 0x15, 0x49, 0x3f, 0x79, 0x18,
+ 0x15, 0xe3, 0xfa, 0x15, 0x63, 0xcc, 0x3d, 0x88, 0x0a, 0xb2, 0xa0, 0x49, 0x7e, 0xd4, 0x40, 0x57,
+ 0x71, 0x29, 0x5a, 0x68, 0x4f, 0xb0, 0xff, 0xb5, 0x3d, 0x46, 0xc6, 0xcd, 0xb1, 0xa7, 0x6f, 0xc9,
+ 0x80, 0xf5, 0xd5, 0xaa, 0xf7, 0xcc, 0xb6, 0x7c, 0x57, 0x70, 0x5b, 0x55, 0xd5, 0x06, 0x3a, 0x5d,
+ 0x22, 0x4c, 0x97, 0x86, 0x24, 0x2e, 0x14, 0xe5, 0x54, 0x26, 0x49, 0x14, 0xff, 0x5d, 0x12, 0xd1,
+ 0xd0, 0x17, 0x3b, 0x73, 0x72, 0x74, 0x41, 0x9e, 0xbc, 0x86, 0x82, 0xe9, 0x38, 0x2e, 0x97, 0x53,
+ 0xc3, 0xf4, 0xed, 0x6a, 0x66, 0xaf, 0xd0, 0x78, 0xb0, 0x4a, 0x5f, 0xca, 0x4d, 0x67, 0x34, 0x13,
+ 0xf2, 0x23, 0x87, 0xfb, 0xc7, 0xad, 0x1b, 0x2a, 0x70, 0x21, 0xe5, 0xa1, 0xe9, 0x18, 0xbb, 0x5f,
+ 0x40, 0x69, 0x91, 0x45, 0x4a, 0x90, 0x39, 0xc2, 0xe3, 0x70, 0x5d, 0x52, 0xf1, 0x93, 0xdc, 0x84,
+ 0xec, 0xc4, 0x1c, 0x05, 0x18, 0xae, 0x44, 0x1a, 0x1e, 0x1e, 0xac, 0xdf, 0xd7, 0x6a, 0xbf, 0x6a,
+ 0x90, 0x97, 0xc1, 0x9f, 0xda, 0x8c, 0x93, 0x6f, 0x21, 0x27, 0x9e, 0xbe, 0x6f, 0x72, 0x53, 0xd2,
+ 0x0b, 0x0d, 0x63, 0xb5, 0x5a, 0x09, 0xf6, 0x33, 0xe4, 0x66, 0xab, 0xa4, 0x32, 0xce, 0x45, 0x16,
+ 0x1a, 0x2b, 0x92, 0x03, 0xc8, 0xda, 0x1c, 0xc7, 0x4c, 0x5f, 0x97, 0x85, 0xf9, 0x60, 0xe5, 0xc2,
+ 0xb4, 0xb6, 0xa2, 0xad, 0xdb, 0x16, 0x7c, 0x1a, 0xca, 0xd4, 0x7e, 0xd6, 0xa0, 0xf8, 0xd8, 0x77,
+ 0x03, 0x8f, 0x62, 0xb8, 0x4a, 0x18, 0x79, 0x0f, 0xb2, 0x03, 0x61, 0x51, 0x77, 0x45, 0xcc, 0x0b,
+ 0x61, 0xa1, 0x4f, 0xac, 0x26, 0x3f, 0x62, 0xc8, 0x5c, 0xd4, 0x6a, 0x8a, 0x65, 0x68, 0xe2, 0x27,
+ 0xf7, 0xc4, 0x74, 0x86, 0x87, 0x03, 0x73, 0x8c, 0x4c, 0xcf, 0x48, 0x82, 0x9a, 0xb9, 0x94, 0x83,
+ 0xce, 0xe3, 0x6a, 0xbf, 0x64, 0x60, 0x7b, 0x61, 0xdd, 0x90, 0x7d, 0xc8, 0x45, 0x20, 0x95, 0x61,
+ 0x5c, 0xaf, 0x48, 0x8b, 0xc6, 0x08, 0xb1, 0x15, 0x1d, 0x21, 0xe5, 0x99, 0x96, 0x7a, 0x73, 0xc9,
+ 0x56, 0x3c, 0x88, 0x1c, 0x34, 0xc1, 0x88, 0x9b, 0x44, 0x1c, 0xd4, 0x55, 0x15, 0xef, 0x7f, 0x81,
+ 0xa5, 0xd2, 0x43, 0x5a, 0x90, 0x09, 0xec, 0xbe, 0xba, 0x98, 0x6e, 0x2b, 0x40, 0xa6, 0xbb, 0xea,
+ 0xad, 0x28, 0xc8, 0xe2, 0x21, 0x4c, 0xcf, 0x96, 0x15, 0x55, 0x77, 0x56, 0xfc, 0x10, 0xcd, 0xc3,
+ 0x76, 0x58, 0xe9, 0x18, 0x21, 0x6e, 0x44, 0xd3, 0xb3, 0x5f, 0xa0, 0xcf, 0x6c, 0xd7, 0x91, 0x37,
+ 0x58, 0xea, 0x46, 0x6c, 0x1e, 0xb6, 0x95, 0x87, 0xa6, 0x50, 0xa4, 0x09, 0xdb, 0x51, 0x11, 0x22,
+ 0xe2, 0xa6, 0x24, 0xde, 0x52, 0xc4, 0x6d, 0x3a, 0xef, 0xa6, 0x8b, 0x78, 0xf2, 0x29, 0x14, 0x58,
+ 0xd0, 0x8b, 0x8b, 0x9d, 0x93, 0xf4, 0x78, 0x9c, 0x3a, 0x89, 0x8b, 0xa6, 0x71, 0xb5, 0xdf, 0xd7,
+ 0xe1, 0xda, 0xa1, 0x3b, 0xb2, 0xad, 0x63, 0xf2, 0xf2, 0xdc, 0x2c, 0xdc, 0x5e, 0x6d, 0x16, 0xc2,
+ 0x97, 0x2e, 0xa7, 0x21, 0x7e, 0xd0, 0xc4, 0x96, 0x9a, 0x87, 0x0e, 0x64, 0xfd, 0x60, 0x84, 0xd1,
+ 0x3c, 0x18, 0xab, 0xcc, 0x43, 0x98, 0x1c, 0x0d, 0x46, 0x98, 0x34, 0xb7, 0x38, 0x31, 0x1a, 0x6a,
+ 0x91, 0x7b, 0x00, 0xee, 0xd8, 0xe6, 0x72, 0x53, 0x45, 0xcd, 0x7a, 0x4b, 0xa6, 0x10, 0x5b, 0x93,
+ 0xaf, 0x96, 0x14, 0x94, 0x3c, 0x86, 0x1d, 0x71, 0x7a, 0x66, 0x3a, 0xe6, 0x00, 0xfb, 0x5f, 0xd9,
+ 0x38, 0xea, 0x33, 0xd9, 0x28, 0xb9, 0xd6, 0x3b, 0x2a, 0xd2, 0xce, 0xf3, 0x45, 0x00, 0x3d, 0xcf,
+ 0xa9, 0xfd, 0xa6, 0x01, 0x84, 0x69, 0xfe, 0x07, 0x3b, 0xe5, 0xf9, 0xfc, 0x4e, 0xf9, 0x70, 0xf5,
+ 0x1a, 0x2e, 0x59, 0x2a, 0x7f, 0x67, 0xa2, 0xec, 0x45, 0x59, 0xaf, 0xf8, 0xf1, 0x59, 0x81, 0xac,
+ 0xf8, 0x46, 0x89, 0xb6, 0x4a, 0x5e, 0x20, 0xc5, 0xf7, 0x0b, 0xa3, 0xa1, 0x9d, 0x18, 0x00, 0xe2,
+ 0x87, 0x1c, 0x8d, 0xe8, 0xed, 0x14, 0xc5, 0xdb, 0xe9, 0xc6, 0x56, 0x9a, 0x42, 0x08, 0x41, 0xf1,
+ 0x05, 0x28, 0x5e, 0x44, 0x2c, 0x28, 0x3e, 0x0c, 0x19, 0x0d, 0xed, 0xc4, 0x4a, 0xef, 0xb2, 0xac,
+ 0xac, 0x41, 0x63, 0x95, 0x1a, 0xcc, 0xef, 0xcd, 0x64, 0xaf, 0x5c, 0xb8, 0x03, 0x0d, 0x80, 0x78,
+ 0xc9, 0x30, 0xfd, 0x5a, 0x92, 0x75, 0xbc, 0x85, 0x18, 0x4d, 0x21, 0xc8, 0xe7, 0xb0, 0xed, 0xb8,
+ 0x4e, 0x24, 0xd5, 0xa5, 0x4f, 0x99, 0xbe, 0x29, 0x49, 0x37, 0xc4, 0xec, 0x1e, 0xcc, 0xbb, 0xe8,
+ 0x22, 0x76, 0xa1, 0x85, 0x73, 0xab, 0xb7, 0xf0, 0x97, 0x17, 0xb5, 0x70, 0x5e, 0xb6, 0xf0, 0xff,
+ 0x56, 0x6d, 0xdf, 0xd6, 0x93, 0x93, 0xd3, 0xf2, 0xda, 0x9b, 0xd3, 0xf2, 0xda, 0xdb, 0xd3, 0xf2,
+ 0xda, 0x0f, 0xb3, 0xb2, 0x76, 0x32, 0x2b, 0x6b, 0x6f, 0x66, 0x65, 0xed, 0xed, 0xac, 0xac, 0xfd,
+ 0x31, 0x2b, 0x6b, 0x3f, 0xfd, 0x59, 0x5e, 0xfb, 0xa6, 0x76, 0xf9, 0x5f, 0xbe, 0x7f, 0x02, 0x00,
+ 0x00, 0xff, 0xff, 0x81, 0x06, 0x4f, 0x58, 0x17, 0x0e, 0x00, 0x00,
}
func (m *Event) Marshal() (dAtA []byte, err error) {
diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto b/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto
index 13c41e54ce6..032c5869139 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto
+++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto
@@ -48,11 +48,11 @@ message Event {
optional string verb = 5;
// Authenticated user information.
- optional k8s.io.api.authentication.v1.UserInfo user = 6;
+ optional .k8s.io.api.authentication.v1.UserInfo user = 6;
// Impersonated user information.
// +optional
- optional k8s.io.api.authentication.v1.UserInfo impersonatedUser = 7;
+ optional .k8s.io.api.authentication.v1.UserInfo impersonatedUser = 7;
// Source IPs, from where the request originated and intermediate proxies.
// The source IPs are listed from (in order):
@@ -62,6 +62,7 @@ message Event {
// IP in the list up to here (X-Forwarded-For or X-Real-Ip).
// Note: All but the last IP can be arbitrarily set by the client.
// +optional
+ // +listType=atomic
repeated string sourceIPs = 8;
// UserAgent records the user agent string reported by the client.
@@ -78,28 +79,28 @@ message Event {
// For successful responses, this will only include the Code and StatusSuccess.
// For non-status type error responses, this will be auto-populated with the error Message.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Status responseStatus = 10;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status responseStatus = 10;
// API object from the request, in JSON format. The RequestObject is recorded as-is in the request
// (possibly re-encoded as JSON), prior to version conversion, defaulting, admission or
// merging. It is an external versioned object type, and may not be a valid object on its own.
// Omitted for non-resource requests. Only logged at Request Level and higher.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.Unknown requestObject = 11;
+ optional .k8s.io.apimachinery.pkg.runtime.Unknown requestObject = 11;
// API object returned in the response, in JSON. The ResponseObject is recorded after conversion
// to the external type, and serialized as JSON. Omitted for non-resource requests. Only logged
// at Response Level.
// +optional
- optional k8s.io.apimachinery.pkg.runtime.Unknown responseObject = 12;
+ optional .k8s.io.apimachinery.pkg.runtime.Unknown responseObject = 12;
// Time the request reached the apiserver.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime requestReceivedTimestamp = 13;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime requestReceivedTimestamp = 13;
// Time the request reached current audit stage.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime stageTimestamp = 14;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime stageTimestamp = 14;
// Annotations is an unstructured key value map stored with an audit event that may be set by
// plugins invoked in the request serving chain, including authentication, authorization and
@@ -114,7 +115,7 @@ message Event {
// EventList is a list of audit Events.
message EventList {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated Event items = 2;
}
@@ -140,12 +141,14 @@ message GroupResources {
//
// An empty list implies all resources and subresources in this API groups apply.
// +optional
+ // +listType=atomic
repeated string resources = 2;
// ResourceNames is a list of resource instance names that the policy matches.
// Using this field requires Resources to be specified.
// An empty list implies that every instance of the resource is matched.
// +optional
+ // +listType=atomic
repeated string resourceNames = 3;
}
@@ -184,17 +187,19 @@ message ObjectReference {
message Policy {
// ObjectMeta is included for interoperability with API infrastructure.
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Rules specify the audit Level a request should be recorded at.
// A request may match multiple rules, in which case the FIRST matching rule is used.
// The default audit level is None, but can be overridden by a catch-all rule at the end of the list.
// PolicyRules are strictly ordered.
+ // +listType=atomic
repeated PolicyRule rules = 2;
// OmitStages is a list of stages for which no events are created. Note that this can also
// be specified per rule in which case the union of both are omitted.
// +optional
+ // +listType=atomic
repeated string omitStages = 3;
// OmitManagedFields indicates whether to omit the managed fields of the request
@@ -210,7 +215,7 @@ message Policy {
// PolicyList is a list of audit Policies.
message PolicyList {
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated Policy items = 2;
}
@@ -224,27 +229,32 @@ message PolicyRule {
// The users (by authenticated user name) this rule applies to.
// An empty list implies every user.
// +optional
+ // +listType=atomic
repeated string users = 2;
// The user groups this rule applies to. A user is considered matching
// if it is a member of any of the UserGroups.
// An empty list implies every user group.
// +optional
+ // +listType=atomic
repeated string userGroups = 3;
// The verbs that match this rule.
// An empty list implies every verb.
// +optional
+ // +listType=atomic
repeated string verbs = 4;
// Resources that this rule matches. An empty list implies all kinds in all API groups.
// +optional
+ // +listType=atomic
repeated GroupResources resources = 5;
// Namespaces that this rule matches.
// The empty string "" matches non-namespaced resources.
// An empty list implies every namespace.
// +optional
+ // +listType=atomic
repeated string namespaces = 6;
// NonResourceURLs is a set of URL paths that should be audited.
@@ -253,12 +263,14 @@ message PolicyRule {
// - `/metrics` - Log requests for apiserver metrics
// - `/healthz*` - Log all health checks
// +optional
+ // +listType=atomic
repeated string nonResourceURLs = 7;
// OmitStages is a list of stages for which no events are created. Note that this can also
// be specified policy wide in which case the union of both are omitted.
// An empty list means no restrictions will apply.
// +optional
+ // +listType=atomic
repeated string omitStages = 8;
// OmitManagedFields indicates whether to omit the managed fields of the request
diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go
index 151c56c689b..ae122d6c4db 100644
--- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go
+++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go
@@ -98,6 +98,7 @@ type Event struct {
// IP in the list up to here (X-Forwarded-For or X-Real-Ip).
// Note: All but the last IP can be arbitrarily set by the client.
// +optional
+ // +listType=atomic
SourceIPs []string `json:"sourceIPs,omitempty" protobuf:"bytes,8,rep,name=sourceIPs"`
// UserAgent records the user agent string reported by the client.
// Note that the UserAgent is provided by the client, and must not be trusted.
@@ -166,11 +167,13 @@ type Policy struct {
// A request may match multiple rules, in which case the FIRST matching rule is used.
// The default audit level is None, but can be overridden by a catch-all rule at the end of the list.
// PolicyRules are strictly ordered.
+ // +listType=atomic
Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
// OmitStages is a list of stages for which no events are created. Note that this can also
// be specified per rule in which case the union of both are omitted.
// +optional
+ // +listType=atomic
OmitStages []Stage `json:"omitStages,omitempty" protobuf:"bytes,3,rep,name=omitStages"`
// OmitManagedFields indicates whether to omit the managed fields of the request
@@ -203,16 +206,19 @@ type PolicyRule struct {
// The users (by authenticated user name) this rule applies to.
// An empty list implies every user.
// +optional
+ // +listType=atomic
Users []string `json:"users,omitempty" protobuf:"bytes,2,rep,name=users"`
// The user groups this rule applies to. A user is considered matching
// if it is a member of any of the UserGroups.
// An empty list implies every user group.
// +optional
+ // +listType=atomic
UserGroups []string `json:"userGroups,omitempty" protobuf:"bytes,3,rep,name=userGroups"`
// The verbs that match this rule.
// An empty list implies every verb.
// +optional
+ // +listType=atomic
Verbs []string `json:"verbs,omitempty" protobuf:"bytes,4,rep,name=verbs"`
// Rules can apply to API resources (such as "pods" or "secrets"),
@@ -221,11 +227,13 @@ type PolicyRule struct {
// Resources that this rule matches. An empty list implies all kinds in all API groups.
// +optional
+ // +listType=atomic
Resources []GroupResources `json:"resources,omitempty" protobuf:"bytes,5,rep,name=resources"`
// Namespaces that this rule matches.
// The empty string "" matches non-namespaced resources.
// An empty list implies every namespace.
// +optional
+ // +listType=atomic
Namespaces []string `json:"namespaces,omitempty" protobuf:"bytes,6,rep,name=namespaces"`
// NonResourceURLs is a set of URL paths that should be audited.
@@ -234,12 +242,14 @@ type PolicyRule struct {
// - `/metrics` - Log requests for apiserver metrics
// - `/healthz*` - Log all health checks
// +optional
+ // +listType=atomic
NonResourceURLs []string `json:"nonResourceURLs,omitempty" protobuf:"bytes,7,rep,name=nonResourceURLs"`
// OmitStages is a list of stages for which no events are created. Note that this can also
// be specified policy wide in which case the union of both are omitted.
// An empty list means no restrictions will apply.
// +optional
+ // +listType=atomic
OmitStages []Stage `json:"omitStages,omitempty" protobuf:"bytes,8,rep,name=omitStages"`
// OmitManagedFields indicates whether to omit the managed fields of the request
@@ -274,11 +284,13 @@ type GroupResources struct {
//
// An empty list implies all resources and subresources in this API groups apply.
// +optional
+ // +listType=atomic
Resources []string `json:"resources,omitempty" protobuf:"bytes,2,rep,name=resources"`
// ResourceNames is a list of resource instance names that the policy matches.
// Using this field requires Resources to be specified.
// An empty list implies that every instance of the resource is matched.
// +optional
+ // +listType=atomic
ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,3,rep,name=resourceNames"`
}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.conversion.go
deleted file mode 100644
index 8585428632b..00000000000
--- a/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.conversion.go
+++ /dev/null
@@ -1,299 +0,0 @@
-//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
-
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by conversion-gen. DO NOT EDIT.
-
-package v1
-
-import (
- unsafe "unsafe"
-
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- conversion "k8s.io/apimachinery/pkg/conversion"
- runtime "k8s.io/apimachinery/pkg/runtime"
- config "k8s.io/apiserver/pkg/apis/config"
-)
-
-func init() {
- localSchemeBuilder.Register(RegisterConversions)
-}
-
-// RegisterConversions adds conversion functions to the given scheme.
-// Public to allow building arbitrary schemes.
-func RegisterConversions(s *runtime.Scheme) error {
- if err := s.AddGeneratedConversionFunc((*AESConfiguration)(nil), (*config.AESConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_AESConfiguration_To_config_AESConfiguration(a.(*AESConfiguration), b.(*config.AESConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.AESConfiguration)(nil), (*AESConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_AESConfiguration_To_v1_AESConfiguration(a.(*config.AESConfiguration), b.(*AESConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*EncryptionConfiguration)(nil), (*config.EncryptionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_EncryptionConfiguration_To_config_EncryptionConfiguration(a.(*EncryptionConfiguration), b.(*config.EncryptionConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.EncryptionConfiguration)(nil), (*EncryptionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_EncryptionConfiguration_To_v1_EncryptionConfiguration(a.(*config.EncryptionConfiguration), b.(*EncryptionConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*IdentityConfiguration)(nil), (*config.IdentityConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_IdentityConfiguration_To_config_IdentityConfiguration(a.(*IdentityConfiguration), b.(*config.IdentityConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.IdentityConfiguration)(nil), (*IdentityConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_IdentityConfiguration_To_v1_IdentityConfiguration(a.(*config.IdentityConfiguration), b.(*IdentityConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*KMSConfiguration)(nil), (*config.KMSConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_KMSConfiguration_To_config_KMSConfiguration(a.(*KMSConfiguration), b.(*config.KMSConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.KMSConfiguration)(nil), (*KMSConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_KMSConfiguration_To_v1_KMSConfiguration(a.(*config.KMSConfiguration), b.(*KMSConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*Key)(nil), (*config.Key)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_Key_To_config_Key(a.(*Key), b.(*config.Key), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.Key)(nil), (*Key)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_Key_To_v1_Key(a.(*config.Key), b.(*Key), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*ProviderConfiguration)(nil), (*config.ProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration(a.(*ProviderConfiguration), b.(*config.ProviderConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.ProviderConfiguration)(nil), (*ProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_ProviderConfiguration_To_v1_ProviderConfiguration(a.(*config.ProviderConfiguration), b.(*ProviderConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*ResourceConfiguration)(nil), (*config.ResourceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_ResourceConfiguration_To_config_ResourceConfiguration(a.(*ResourceConfiguration), b.(*config.ResourceConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.ResourceConfiguration)(nil), (*ResourceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_ResourceConfiguration_To_v1_ResourceConfiguration(a.(*config.ResourceConfiguration), b.(*ResourceConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*SecretboxConfiguration)(nil), (*config.SecretboxConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_SecretboxConfiguration_To_config_SecretboxConfiguration(a.(*SecretboxConfiguration), b.(*config.SecretboxConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.SecretboxConfiguration)(nil), (*SecretboxConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_SecretboxConfiguration_To_v1_SecretboxConfiguration(a.(*config.SecretboxConfiguration), b.(*SecretboxConfiguration), scope)
- }); err != nil {
- return err
- }
- return nil
-}
-
-func autoConvert_v1_AESConfiguration_To_config_AESConfiguration(in *AESConfiguration, out *config.AESConfiguration, s conversion.Scope) error {
- out.Keys = *(*[]config.Key)(unsafe.Pointer(&in.Keys))
- return nil
-}
-
-// Convert_v1_AESConfiguration_To_config_AESConfiguration is an autogenerated conversion function.
-func Convert_v1_AESConfiguration_To_config_AESConfiguration(in *AESConfiguration, out *config.AESConfiguration, s conversion.Scope) error {
- return autoConvert_v1_AESConfiguration_To_config_AESConfiguration(in, out, s)
-}
-
-func autoConvert_config_AESConfiguration_To_v1_AESConfiguration(in *config.AESConfiguration, out *AESConfiguration, s conversion.Scope) error {
- out.Keys = *(*[]Key)(unsafe.Pointer(&in.Keys))
- return nil
-}
-
-// Convert_config_AESConfiguration_To_v1_AESConfiguration is an autogenerated conversion function.
-func Convert_config_AESConfiguration_To_v1_AESConfiguration(in *config.AESConfiguration, out *AESConfiguration, s conversion.Scope) error {
- return autoConvert_config_AESConfiguration_To_v1_AESConfiguration(in, out, s)
-}
-
-func autoConvert_v1_EncryptionConfiguration_To_config_EncryptionConfiguration(in *EncryptionConfiguration, out *config.EncryptionConfiguration, s conversion.Scope) error {
- out.Resources = *(*[]config.ResourceConfiguration)(unsafe.Pointer(&in.Resources))
- return nil
-}
-
-// Convert_v1_EncryptionConfiguration_To_config_EncryptionConfiguration is an autogenerated conversion function.
-func Convert_v1_EncryptionConfiguration_To_config_EncryptionConfiguration(in *EncryptionConfiguration, out *config.EncryptionConfiguration, s conversion.Scope) error {
- return autoConvert_v1_EncryptionConfiguration_To_config_EncryptionConfiguration(in, out, s)
-}
-
-func autoConvert_config_EncryptionConfiguration_To_v1_EncryptionConfiguration(in *config.EncryptionConfiguration, out *EncryptionConfiguration, s conversion.Scope) error {
- out.Resources = *(*[]ResourceConfiguration)(unsafe.Pointer(&in.Resources))
- return nil
-}
-
-// Convert_config_EncryptionConfiguration_To_v1_EncryptionConfiguration is an autogenerated conversion function.
-func Convert_config_EncryptionConfiguration_To_v1_EncryptionConfiguration(in *config.EncryptionConfiguration, out *EncryptionConfiguration, s conversion.Scope) error {
- return autoConvert_config_EncryptionConfiguration_To_v1_EncryptionConfiguration(in, out, s)
-}
-
-func autoConvert_v1_IdentityConfiguration_To_config_IdentityConfiguration(in *IdentityConfiguration, out *config.IdentityConfiguration, s conversion.Scope) error {
- return nil
-}
-
-// Convert_v1_IdentityConfiguration_To_config_IdentityConfiguration is an autogenerated conversion function.
-func Convert_v1_IdentityConfiguration_To_config_IdentityConfiguration(in *IdentityConfiguration, out *config.IdentityConfiguration, s conversion.Scope) error {
- return autoConvert_v1_IdentityConfiguration_To_config_IdentityConfiguration(in, out, s)
-}
-
-func autoConvert_config_IdentityConfiguration_To_v1_IdentityConfiguration(in *config.IdentityConfiguration, out *IdentityConfiguration, s conversion.Scope) error {
- return nil
-}
-
-// Convert_config_IdentityConfiguration_To_v1_IdentityConfiguration is an autogenerated conversion function.
-func Convert_config_IdentityConfiguration_To_v1_IdentityConfiguration(in *config.IdentityConfiguration, out *IdentityConfiguration, s conversion.Scope) error {
- return autoConvert_config_IdentityConfiguration_To_v1_IdentityConfiguration(in, out, s)
-}
-
-func autoConvert_v1_KMSConfiguration_To_config_KMSConfiguration(in *KMSConfiguration, out *config.KMSConfiguration, s conversion.Scope) error {
- out.APIVersion = in.APIVersion
- out.Name = in.Name
- out.CacheSize = (*int32)(unsafe.Pointer(in.CacheSize))
- out.Endpoint = in.Endpoint
- out.Timeout = (*metav1.Duration)(unsafe.Pointer(in.Timeout))
- return nil
-}
-
-// Convert_v1_KMSConfiguration_To_config_KMSConfiguration is an autogenerated conversion function.
-func Convert_v1_KMSConfiguration_To_config_KMSConfiguration(in *KMSConfiguration, out *config.KMSConfiguration, s conversion.Scope) error {
- return autoConvert_v1_KMSConfiguration_To_config_KMSConfiguration(in, out, s)
-}
-
-func autoConvert_config_KMSConfiguration_To_v1_KMSConfiguration(in *config.KMSConfiguration, out *KMSConfiguration, s conversion.Scope) error {
- out.APIVersion = in.APIVersion
- out.Name = in.Name
- out.CacheSize = (*int32)(unsafe.Pointer(in.CacheSize))
- out.Endpoint = in.Endpoint
- out.Timeout = (*metav1.Duration)(unsafe.Pointer(in.Timeout))
- return nil
-}
-
-// Convert_config_KMSConfiguration_To_v1_KMSConfiguration is an autogenerated conversion function.
-func Convert_config_KMSConfiguration_To_v1_KMSConfiguration(in *config.KMSConfiguration, out *KMSConfiguration, s conversion.Scope) error {
- return autoConvert_config_KMSConfiguration_To_v1_KMSConfiguration(in, out, s)
-}
-
-func autoConvert_v1_Key_To_config_Key(in *Key, out *config.Key, s conversion.Scope) error {
- out.Name = in.Name
- out.Secret = in.Secret
- return nil
-}
-
-// Convert_v1_Key_To_config_Key is an autogenerated conversion function.
-func Convert_v1_Key_To_config_Key(in *Key, out *config.Key, s conversion.Scope) error {
- return autoConvert_v1_Key_To_config_Key(in, out, s)
-}
-
-func autoConvert_config_Key_To_v1_Key(in *config.Key, out *Key, s conversion.Scope) error {
- out.Name = in.Name
- out.Secret = in.Secret
- return nil
-}
-
-// Convert_config_Key_To_v1_Key is an autogenerated conversion function.
-func Convert_config_Key_To_v1_Key(in *config.Key, out *Key, s conversion.Scope) error {
- return autoConvert_config_Key_To_v1_Key(in, out, s)
-}
-
-func autoConvert_v1_ProviderConfiguration_To_config_ProviderConfiguration(in *ProviderConfiguration, out *config.ProviderConfiguration, s conversion.Scope) error {
- out.AESGCM = (*config.AESConfiguration)(unsafe.Pointer(in.AESGCM))
- out.AESCBC = (*config.AESConfiguration)(unsafe.Pointer(in.AESCBC))
- out.Secretbox = (*config.SecretboxConfiguration)(unsafe.Pointer(in.Secretbox))
- out.Identity = (*config.IdentityConfiguration)(unsafe.Pointer(in.Identity))
- out.KMS = (*config.KMSConfiguration)(unsafe.Pointer(in.KMS))
- return nil
-}
-
-// Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration is an autogenerated conversion function.
-func Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration(in *ProviderConfiguration, out *config.ProviderConfiguration, s conversion.Scope) error {
- return autoConvert_v1_ProviderConfiguration_To_config_ProviderConfiguration(in, out, s)
-}
-
-func autoConvert_config_ProviderConfiguration_To_v1_ProviderConfiguration(in *config.ProviderConfiguration, out *ProviderConfiguration, s conversion.Scope) error {
- out.AESGCM = (*AESConfiguration)(unsafe.Pointer(in.AESGCM))
- out.AESCBC = (*AESConfiguration)(unsafe.Pointer(in.AESCBC))
- out.Secretbox = (*SecretboxConfiguration)(unsafe.Pointer(in.Secretbox))
- out.Identity = (*IdentityConfiguration)(unsafe.Pointer(in.Identity))
- out.KMS = (*KMSConfiguration)(unsafe.Pointer(in.KMS))
- return nil
-}
-
-// Convert_config_ProviderConfiguration_To_v1_ProviderConfiguration is an autogenerated conversion function.
-func Convert_config_ProviderConfiguration_To_v1_ProviderConfiguration(in *config.ProviderConfiguration, out *ProviderConfiguration, s conversion.Scope) error {
- return autoConvert_config_ProviderConfiguration_To_v1_ProviderConfiguration(in, out, s)
-}
-
-func autoConvert_v1_ResourceConfiguration_To_config_ResourceConfiguration(in *ResourceConfiguration, out *config.ResourceConfiguration, s conversion.Scope) error {
- out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
- out.Providers = *(*[]config.ProviderConfiguration)(unsafe.Pointer(&in.Providers))
- return nil
-}
-
-// Convert_v1_ResourceConfiguration_To_config_ResourceConfiguration is an autogenerated conversion function.
-func Convert_v1_ResourceConfiguration_To_config_ResourceConfiguration(in *ResourceConfiguration, out *config.ResourceConfiguration, s conversion.Scope) error {
- return autoConvert_v1_ResourceConfiguration_To_config_ResourceConfiguration(in, out, s)
-}
-
-func autoConvert_config_ResourceConfiguration_To_v1_ResourceConfiguration(in *config.ResourceConfiguration, out *ResourceConfiguration, s conversion.Scope) error {
- out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
- out.Providers = *(*[]ProviderConfiguration)(unsafe.Pointer(&in.Providers))
- return nil
-}
-
-// Convert_config_ResourceConfiguration_To_v1_ResourceConfiguration is an autogenerated conversion function.
-func Convert_config_ResourceConfiguration_To_v1_ResourceConfiguration(in *config.ResourceConfiguration, out *ResourceConfiguration, s conversion.Scope) error {
- return autoConvert_config_ResourceConfiguration_To_v1_ResourceConfiguration(in, out, s)
-}
-
-func autoConvert_v1_SecretboxConfiguration_To_config_SecretboxConfiguration(in *SecretboxConfiguration, out *config.SecretboxConfiguration, s conversion.Scope) error {
- out.Keys = *(*[]config.Key)(unsafe.Pointer(&in.Keys))
- return nil
-}
-
-// Convert_v1_SecretboxConfiguration_To_config_SecretboxConfiguration is an autogenerated conversion function.
-func Convert_v1_SecretboxConfiguration_To_config_SecretboxConfiguration(in *SecretboxConfiguration, out *config.SecretboxConfiguration, s conversion.Scope) error {
- return autoConvert_v1_SecretboxConfiguration_To_config_SecretboxConfiguration(in, out, s)
-}
-
-func autoConvert_config_SecretboxConfiguration_To_v1_SecretboxConfiguration(in *config.SecretboxConfiguration, out *SecretboxConfiguration, s conversion.Scope) error {
- out.Keys = *(*[]Key)(unsafe.Pointer(&in.Keys))
- return nil
-}
-
-// Convert_config_SecretboxConfiguration_To_v1_SecretboxConfiguration is an autogenerated conversion function.
-func Convert_config_SecretboxConfiguration_To_v1_SecretboxConfiguration(in *config.SecretboxConfiguration, out *SecretboxConfiguration, s conversion.Scope) error {
- return autoConvert_config_SecretboxConfiguration_To_v1_SecretboxConfiguration(in, out, s)
-}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.deepcopy.go
deleted file mode 100644
index 3d2ac484b0c..00000000000
--- a/vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,228 +0,0 @@
-//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
-
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by deepcopy-gen. DO NOT EDIT.
-
-package v1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *AESConfiguration) DeepCopyInto(out *AESConfiguration) {
- *out = *in
- if in.Keys != nil {
- in, out := &in.Keys, &out.Keys
- *out = make([]Key, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AESConfiguration.
-func (in *AESConfiguration) DeepCopy() *AESConfiguration {
- if in == nil {
- return nil
- }
- out := new(AESConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *EncryptionConfiguration) DeepCopyInto(out *EncryptionConfiguration) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.Resources != nil {
- in, out := &in.Resources, &out.Resources
- *out = make([]ResourceConfiguration, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionConfiguration.
-func (in *EncryptionConfiguration) DeepCopy() *EncryptionConfiguration {
- if in == nil {
- return nil
- }
- out := new(EncryptionConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *EncryptionConfiguration) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IdentityConfiguration) DeepCopyInto(out *IdentityConfiguration) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityConfiguration.
-func (in *IdentityConfiguration) DeepCopy() *IdentityConfiguration {
- if in == nil {
- return nil
- }
- out := new(IdentityConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KMSConfiguration) DeepCopyInto(out *KMSConfiguration) {
- *out = *in
- if in.CacheSize != nil {
- in, out := &in.CacheSize, &out.CacheSize
- *out = new(int32)
- **out = **in
- }
- if in.Timeout != nil {
- in, out := &in.Timeout, &out.Timeout
- *out = new(metav1.Duration)
- **out = **in
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSConfiguration.
-func (in *KMSConfiguration) DeepCopy() *KMSConfiguration {
- if in == nil {
- return nil
- }
- out := new(KMSConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Key) DeepCopyInto(out *Key) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Key.
-func (in *Key) DeepCopy() *Key {
- if in == nil {
- return nil
- }
- out := new(Key)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ProviderConfiguration) DeepCopyInto(out *ProviderConfiguration) {
- *out = *in
- if in.AESGCM != nil {
- in, out := &in.AESGCM, &out.AESGCM
- *out = new(AESConfiguration)
- (*in).DeepCopyInto(*out)
- }
- if in.AESCBC != nil {
- in, out := &in.AESCBC, &out.AESCBC
- *out = new(AESConfiguration)
- (*in).DeepCopyInto(*out)
- }
- if in.Secretbox != nil {
- in, out := &in.Secretbox, &out.Secretbox
- *out = new(SecretboxConfiguration)
- (*in).DeepCopyInto(*out)
- }
- if in.Identity != nil {
- in, out := &in.Identity, &out.Identity
- *out = new(IdentityConfiguration)
- **out = **in
- }
- if in.KMS != nil {
- in, out := &in.KMS, &out.KMS
- *out = new(KMSConfiguration)
- (*in).DeepCopyInto(*out)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfiguration.
-func (in *ProviderConfiguration) DeepCopy() *ProviderConfiguration {
- if in == nil {
- return nil
- }
- out := new(ProviderConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceConfiguration) DeepCopyInto(out *ResourceConfiguration) {
- *out = *in
- if in.Resources != nil {
- in, out := &in.Resources, &out.Resources
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.Providers != nil {
- in, out := &in.Providers, &out.Providers
- *out = make([]ProviderConfiguration, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceConfiguration.
-func (in *ResourceConfiguration) DeepCopy() *ResourceConfiguration {
- if in == nil {
- return nil
- }
- out := new(ResourceConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *SecretboxConfiguration) DeepCopyInto(out *SecretboxConfiguration) {
- *out = *in
- if in.Keys != nil {
- in, out := &in.Keys, &out.Keys
- *out = make([]Key, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretboxConfiguration.
-func (in *SecretboxConfiguration) DeepCopy() *SecretboxConfiguration {
- if in == nil {
- return nil
- }
- out := new(SecretboxConfiguration)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/vendor/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go
deleted file mode 100644
index 13e5cffca80..00000000000
--- a/vendor/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,228 +0,0 @@
-//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
-
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by deepcopy-gen. DO NOT EDIT.
-
-package config
-
-import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *AESConfiguration) DeepCopyInto(out *AESConfiguration) {
- *out = *in
- if in.Keys != nil {
- in, out := &in.Keys, &out.Keys
- *out = make([]Key, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AESConfiguration.
-func (in *AESConfiguration) DeepCopy() *AESConfiguration {
- if in == nil {
- return nil
- }
- out := new(AESConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *EncryptionConfiguration) DeepCopyInto(out *EncryptionConfiguration) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.Resources != nil {
- in, out := &in.Resources, &out.Resources
- *out = make([]ResourceConfiguration, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionConfiguration.
-func (in *EncryptionConfiguration) DeepCopy() *EncryptionConfiguration {
- if in == nil {
- return nil
- }
- out := new(EncryptionConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *EncryptionConfiguration) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IdentityConfiguration) DeepCopyInto(out *IdentityConfiguration) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityConfiguration.
-func (in *IdentityConfiguration) DeepCopy() *IdentityConfiguration {
- if in == nil {
- return nil
- }
- out := new(IdentityConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KMSConfiguration) DeepCopyInto(out *KMSConfiguration) {
- *out = *in
- if in.CacheSize != nil {
- in, out := &in.CacheSize, &out.CacheSize
- *out = new(int32)
- **out = **in
- }
- if in.Timeout != nil {
- in, out := &in.Timeout, &out.Timeout
- *out = new(v1.Duration)
- **out = **in
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSConfiguration.
-func (in *KMSConfiguration) DeepCopy() *KMSConfiguration {
- if in == nil {
- return nil
- }
- out := new(KMSConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Key) DeepCopyInto(out *Key) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Key.
-func (in *Key) DeepCopy() *Key {
- if in == nil {
- return nil
- }
- out := new(Key)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ProviderConfiguration) DeepCopyInto(out *ProviderConfiguration) {
- *out = *in
- if in.AESGCM != nil {
- in, out := &in.AESGCM, &out.AESGCM
- *out = new(AESConfiguration)
- (*in).DeepCopyInto(*out)
- }
- if in.AESCBC != nil {
- in, out := &in.AESCBC, &out.AESCBC
- *out = new(AESConfiguration)
- (*in).DeepCopyInto(*out)
- }
- if in.Secretbox != nil {
- in, out := &in.Secretbox, &out.Secretbox
- *out = new(SecretboxConfiguration)
- (*in).DeepCopyInto(*out)
- }
- if in.Identity != nil {
- in, out := &in.Identity, &out.Identity
- *out = new(IdentityConfiguration)
- **out = **in
- }
- if in.KMS != nil {
- in, out := &in.KMS, &out.KMS
- *out = new(KMSConfiguration)
- (*in).DeepCopyInto(*out)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfiguration.
-func (in *ProviderConfiguration) DeepCopy() *ProviderConfiguration {
- if in == nil {
- return nil
- }
- out := new(ProviderConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceConfiguration) DeepCopyInto(out *ResourceConfiguration) {
- *out = *in
- if in.Resources != nil {
- in, out := &in.Resources, &out.Resources
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.Providers != nil {
- in, out := &in.Providers, &out.Providers
- *out = make([]ProviderConfiguration, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceConfiguration.
-func (in *ResourceConfiguration) DeepCopy() *ResourceConfiguration {
- if in == nil {
- return nil
- }
- out := new(ResourceConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *SecretboxConfiguration) DeepCopyInto(out *SecretboxConfiguration) {
- *out = *in
- if in.Keys != nil {
- in, out := &in.Keys, &out.Keys
- *out = make([]Key, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretboxConfiguration.
-func (in *SecretboxConfiguration) DeepCopy() *SecretboxConfiguration {
- if in == nil {
- return nil
- }
- out := new(SecretboxConfiguration)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go b/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go
index 8e568c7e4d9..76ef44732ed 100644
--- a/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go
+++ b/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go
@@ -21,6 +21,7 @@ import (
"time"
"k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/apiserver/pkg/apis/apiserver"
"k8s.io/apiserver/pkg/authentication/authenticator"
"k8s.io/apiserver/pkg/authentication/group"
"k8s.io/apiserver/pkg/authentication/request/anonymous"
@@ -39,7 +40,7 @@ import (
// DelegatingAuthenticatorConfig is the minimal configuration needed to create an authenticator
// built to delegate authentication to a kube API server
type DelegatingAuthenticatorConfig struct {
- Anonymous bool
+ Anonymous *apiserver.AnonymousAuthConfig
// TokenAccessReviewClient is a client to do token review. It can be nil. Then every token is ignored.
TokenAccessReviewClient authenticationclient.AuthenticationV1Interface
@@ -112,15 +113,15 @@ func (c DelegatingAuthenticatorConfig) New() (authenticator.Request, *spec.Secur
}
if len(authenticators) == 0 {
- if c.Anonymous {
- return anonymous.NewAuthenticator(), &securityDefinitions, nil
+ if c.Anonymous != nil && c.Anonymous.Enabled {
+ return anonymous.NewAuthenticator(c.Anonymous.Conditions), &securityDefinitions, nil
}
- return nil, nil, errors.New("No authentication method configured")
+ return nil, nil, errors.New("no authentication method configured")
}
authenticator := group.NewAuthenticatedGroupAdder(unionauth.New(authenticators...))
- if c.Anonymous {
- authenticator = unionauth.NewFailOnError(authenticator, anonymous.NewAuthenticator())
+ if c.Anonymous != nil && c.Anonymous.Enabled {
+ authenticator = unionauth.NewFailOnError(authenticator, anonymous.NewAuthenticator(c.Anonymous.Conditions))
}
return authenticator, &securityDefinitions, nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go b/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go
index 3bcff5e9051..5550955af92 100644
--- a/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go
+++ b/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go
@@ -106,6 +106,7 @@ func (c compiler) compile(expressionAccessor ExpressionAccessor, envVarName stri
return CompilationResult{
Program: prog,
+ AST: ast,
ExpressionAccessor: expressionAccessor,
}, nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go b/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go
index 7ec0c9af6af..0fc208414e4 100644
--- a/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go
+++ b/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go
@@ -35,6 +35,7 @@ type ExpressionAccessor interface {
// CompilationResult represents a compiled validations expression.
type CompilationResult struct {
Program celgo.Program
+ AST *celgo.Ast
ExpressionAccessor ExpressionAccessor
}
diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous.go b/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous.go
index f9177d15137..8a881043530 100644
--- a/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous.go
+++ b/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous.go
@@ -19,25 +19,44 @@ package anonymous
import (
"net/http"
+ "k8s.io/apiserver/pkg/apis/apiserver"
"k8s.io/apiserver/pkg/authentication/authenticator"
"k8s.io/apiserver/pkg/authentication/user"
)
const (
- anonymousUser = user.Anonymous
-
+ anonymousUser = user.Anonymous
unauthenticatedGroup = user.AllUnauthenticated
)
-func NewAuthenticator() authenticator.Request {
- return authenticator.RequestFunc(func(req *http.Request) (*authenticator.Response, bool, error) {
- auds, _ := authenticator.AudiencesFrom(req.Context())
- return &authenticator.Response{
- User: &user.DefaultInfo{
- Name: anonymousUser,
- Groups: []string{unauthenticatedGroup},
- },
- Audiences: auds,
- }, true, nil
- })
+type Authenticator struct {
+ allowedPaths map[string]bool
+}
+
+func (a *Authenticator) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error) {
+ if len(a.allowedPaths) > 0 && !a.allowedPaths[req.URL.Path] {
+ return nil, false, nil
+ }
+
+ auds, _ := authenticator.AudiencesFrom(req.Context())
+ return &authenticator.Response{
+ User: &user.DefaultInfo{
+ Name: anonymousUser,
+ Groups: []string{unauthenticatedGroup},
+ },
+ Audiences: auds,
+ }, true, nil
+}
+
+// NewAuthenticator returns a new anonymous authenticator.
+// When conditions is empty all requests are authenticated as anonymous.
+// When conditions are non-empty only those requests that match the at-least one
+// condition are authenticated as anonymous.
+func NewAuthenticator(conditions []apiserver.AnonymousAuthCondition) authenticator.Request {
+ allowedPaths := make(map[string]bool)
+ for _, c := range conditions {
+ allowedPaths[c.Path] = true
+ }
+
+ return &Authenticator{allowedPaths: allowedPaths}
}
diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader.go b/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader.go
index d0273273989..18261639394 100644
--- a/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader.go
+++ b/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader.go
@@ -17,9 +17,7 @@ limitations under the License.
package headerrequest
import (
- "crypto/x509"
"fmt"
- "io/ioutil"
"net/http"
"net/url"
"strings"
@@ -27,7 +25,6 @@ import (
"k8s.io/apiserver/pkg/authentication/authenticator"
x509request "k8s.io/apiserver/pkg/authentication/request/x509"
"k8s.io/apiserver/pkg/authentication/user"
- utilcert "k8s.io/client-go/util/cert"
)
// StringSliceProvider is a way to get a string slice value. It is heavily used for authentication headers among other places.
@@ -106,48 +103,6 @@ func trimHeaders(headerNames ...string) ([]string, error) {
return ret, nil
}
-func NewSecure(clientCA string, proxyClientNames []string, nameHeaders []string, groupHeaders []string, extraHeaderPrefixes []string) (authenticator.Request, error) {
- if len(clientCA) == 0 {
- return nil, fmt.Errorf("missing clientCA file")
- }
-
- // Wrap with an x509 verifier
- caData, err := ioutil.ReadFile(clientCA)
- if err != nil {
- return nil, fmt.Errorf("error reading %s: %v", clientCA, err)
- }
- opts := x509request.DefaultVerifyOptions()
- opts.Roots = x509.NewCertPool()
- certs, err := utilcert.ParseCertsPEM(caData)
- if err != nil {
- return nil, fmt.Errorf("error loading certs from %s: %v", clientCA, err)
- }
- for _, cert := range certs {
- opts.Roots.AddCert(cert)
- }
-
- trimmedNameHeaders, err := trimHeaders(nameHeaders...)
- if err != nil {
- return nil, err
- }
- trimmedGroupHeaders, err := trimHeaders(groupHeaders...)
- if err != nil {
- return nil, err
- }
- trimmedExtraHeaderPrefixes, err := trimHeaders(extraHeaderPrefixes...)
- if err != nil {
- return nil, err
- }
-
- return NewDynamicVerifyOptionsSecure(
- x509request.StaticVerifierFn(opts),
- StaticStringSlice(proxyClientNames),
- StaticStringSlice(trimmedNameHeaders),
- StaticStringSlice(trimmedGroupHeaders),
- StaticStringSlice(trimmedExtraHeaderPrefixes),
- ), nil
-}
-
func NewDynamicVerifyOptionsSecure(verifyOptionFn x509request.VerifyOptionFunc, proxyClientNames, nameHeaders, groupHeaders, extraHeaderPrefixes StringSliceProvider) authenticator.Request {
headerAuthenticator := NewDynamic(nameHeaders, groupHeaders, extraHeaderPrefixes)
diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader_controller.go b/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader_controller.go
index d8c4090b12a..dc844ee73bf 100644
--- a/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader_controller.go
+++ b/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader_controller.go
@@ -20,6 +20,7 @@ import (
"context"
"encoding/json"
"fmt"
+ "sync/atomic"
"time"
corev1 "k8s.io/api/core/v1"
@@ -35,7 +36,6 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
"k8s.io/klog/v2"
- "sync/atomic"
)
const (
@@ -74,7 +74,7 @@ type RequestHeaderAuthRequestController struct {
configmapInformer cache.SharedIndexInformer
configmapInformerSynced cache.InformerSynced
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[string]
// exportedRequestHeaderBundle is a requestHeaderBundle that contains the last read, non-zero length content of the configmap
exportedRequestHeaderBundle atomic.Value
@@ -104,7 +104,10 @@ func NewRequestHeaderAuthRequestController(
extraHeaderPrefixesKey: extraHeaderPrefixesKey,
allowedClientNamesKey: allowedClientNamesKey,
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "RequestHeaderAuthRequestController"),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig(
+ workqueue.DefaultTypedControllerRateLimiter[string](),
+ workqueue.TypedRateLimitingQueueConfig[string]{Name: "RequestHeaderAuthRequestController"},
+ ),
}
// we construct our own informer because we need such a small subset of the information available. Just one namespace.
diff --git a/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/util.go b/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/util.go
index c55fe5d2ed6..3e29d4e71c9 100644
--- a/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/util.go
+++ b/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/util.go
@@ -39,6 +39,12 @@ const (
// CredentialIDKey is the key used in a user's "extra" to specify the unique
// identifier for this identity document).
CredentialIDKey = "authentication.kubernetes.io/credential-id"
+ // IssuedCredentialIDAuditAnnotationKey is the annotation key used in the audit event that is persisted to the
+ // '/token' endpoint for service accounts.
+ // This annotation indicates the generated credential identifier for the service account token being issued.
+ // This is useful when tracing back the origin of tokens that have gone on to make request that have persisted
+ // their credential-identifier into the audit log via the user's extra info stored on subsequent audit events.
+ IssuedCredentialIDAuditAnnotationKey = "authentication.kubernetes.io/issued-credential-id"
// PodNameKey is the key used in a user's "extra" to specify the pod name of
// the authenticating request.
PodNameKey = "authentication.kubernetes.io/pod-name"
diff --git a/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go b/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go
index 2a826981cfd..d39deb17eb2 100644
--- a/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go
+++ b/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go
@@ -20,6 +20,8 @@ import (
"context"
"net/http"
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/labels"
"k8s.io/apiserver/pkg/authentication/user"
)
@@ -62,6 +64,16 @@ type Attributes interface {
// GetPath returns the path of the request
GetPath() string
+
+ // ParseFieldSelector is lazy, thread-safe, and stores the parsed result and error.
+ // It returns an error if the field selector cannot be parsed.
+ // The returned requirements must be treated as readonly and not modified.
+ GetFieldSelector() (fields.Requirements, error)
+
+ // ParseLabelSelector is lazy, thread-safe, and stores the parsed result and error.
+ // It returns an error if the label selector cannot be parsed.
+ // The returned requirements must be treated as readonly and not modified.
+ GetLabelSelector() (labels.Requirements, error)
}
// Authorizer makes an authorization decision based on information gained by making
@@ -100,6 +112,11 @@ type AttributesRecord struct {
Name string
ResourceRequest bool
Path string
+
+ FieldSelectorRequirements fields.Requirements
+ FieldSelectorParsingErr error
+ LabelSelectorRequirements labels.Requirements
+ LabelSelectorParsingErr error
}
func (a AttributesRecord) GetUser() user.Info {
@@ -146,6 +163,14 @@ func (a AttributesRecord) GetPath() string {
return a.Path
}
+func (a AttributesRecord) GetFieldSelector() (fields.Requirements, error) {
+ return a.FieldSelectorRequirements, a.FieldSelectorParsingErr
+}
+
+func (a AttributesRecord) GetLabelSelector() (labels.Requirements, error) {
+ return a.LabelSelectorRequirements, a.LabelSelectorParsingErr
+}
+
type Decision int
const (
@@ -153,7 +178,7 @@ const (
DecisionDeny Decision = iota
// DecisionAllow means that an authorizer decided to allow the action.
DecisionAllow
- // DecisionNoOpionion means that an authorizer has no opinion on whether
+ // DecisionNoOpinion means that an authorizer has no opinion on whether
// to allow or deny an action.
DecisionNoOpinion
)
diff --git a/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/delegating.go b/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/delegating.go
index a8355ee6191..070189145af 100644
--- a/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/delegating.go
+++ b/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/delegating.go
@@ -26,7 +26,7 @@ import (
authorizationclient "k8s.io/client-go/kubernetes/typed/authorization/v1"
)
-// DelegatingAuthorizerConfig is the minimal configuration needed to create an authenticator
+// DelegatingAuthorizerConfig is the minimal configuration needed to create an authorizer
// built to delegate authorization to a kube API server
type DelegatingAuthorizerConfig struct {
SubjectAccessReviewClient authorizationclient.AuthorizationV1Interface
@@ -55,9 +55,6 @@ func (c DelegatingAuthorizerConfig) New() (authorizer.Authorizer, error) {
c.DenyCacheTTL,
*c.WebhookRetryBackoff,
authorizer.DecisionNoOpinion,
- webhook.AuthorizerMetrics{
- RecordRequestTotal: RecordRequestTotal,
- RecordRequestLatency: RecordRequestLatency,
- },
+ NewDelegatingAuthorizerMetrics(),
)
}
diff --git a/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/metrics.go b/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/metrics.go
index 08b3d54ab9e..3f72a25b78b 100644
--- a/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/metrics.go
+++ b/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/metrics.go
@@ -18,18 +18,22 @@ package authorizerfactory
import (
"context"
+ "sync"
+ celmetrics "k8s.io/apiserver/pkg/authorization/cel"
+ webhookmetrics "k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics"
compbasemetrics "k8s.io/component-base/metrics"
"k8s.io/component-base/metrics/legacyregistry"
)
-type registerables []compbasemetrics.Registerable
+var registerMetrics sync.Once
-// init registers all metrics
-func init() {
- for _, metric := range metrics {
- legacyregistry.MustRegister(metric)
- }
+// RegisterMetrics registers authorizer metrics.
+func RegisterMetrics() {
+ registerMetrics.Do(func() {
+ legacyregistry.MustRegister(requestTotal)
+ legacyregistry.MustRegister(requestLatency)
+ })
}
var (
@@ -51,19 +55,28 @@ var (
},
[]string{"code"},
)
-
- metrics = registerables{
- requestTotal,
- requestLatency,
- }
)
+var _ = webhookmetrics.AuthorizerMetrics(delegatingAuthorizerMetrics{})
+
+type delegatingAuthorizerMetrics struct {
+ // no-op for webhook metrics for now, delegating authorization reports original total/latency metrics
+ webhookmetrics.NoopWebhookMetrics
+ // no-op for matchCondition metrics for now, delegating authorization doesn't configure match conditions
+ celmetrics.NoopMatcherMetrics
+}
+
+func NewDelegatingAuthorizerMetrics() delegatingAuthorizerMetrics {
+ RegisterMetrics()
+ return delegatingAuthorizerMetrics{}
+}
+
// RecordRequestTotal increments the total number of requests for the delegated authorization.
-func RecordRequestTotal(ctx context.Context, code string) {
+func (delegatingAuthorizerMetrics) RecordRequestTotal(ctx context.Context, code string) {
requestTotal.WithContext(ctx).WithLabelValues(code).Add(1)
}
// RecordRequestLatency measures request latency in seconds for the delegated authorization. Broken down by status code.
-func RecordRequestLatency(ctx context.Context, code string, latency float64) {
+func (delegatingAuthorizerMetrics) RecordRequestLatency(ctx context.Context, code string, latency float64) {
requestLatency.WithContext(ctx).WithLabelValues(code).Observe(latency)
}
diff --git a/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go b/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go
index 0d9293dd704..829ff91d395 100644
--- a/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go
+++ b/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go
@@ -20,22 +20,34 @@ import (
"fmt"
"github.com/google/cel-go/cel"
+ celast "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types/ref"
authorizationv1 "k8s.io/api/authorization/v1"
"k8s.io/apimachinery/pkg/util/version"
apiservercel "k8s.io/apiserver/pkg/cel"
"k8s.io/apiserver/pkg/cel/environment"
+ genericfeatures "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
)
const (
subjectAccessReviewRequestVarName = "request"
+
+ fieldSelectorVarName = "fieldSelector"
+ labelSelectorVarName = "labelSelector"
)
// CompilationResult represents a compiled authorization cel expression.
type CompilationResult struct {
Program cel.Program
ExpressionAccessor ExpressionAccessor
+
+ // These track if a given expression uses fieldSelector and labelSelector,
+ // so construction of data passed to the CEL expression can be optimized if those fields are unused.
+ UsesFieldSelector bool
+ UsesLabelSelector bool
}
// EvaluationResult contains the minimal required fields and metadata of a cel evaluation
@@ -96,11 +108,50 @@ func (c compiler) CompileCELExpression(expressionAccessor ExpressionAccessor) (C
return resultError(reason, apiservercel.ErrorTypeInvalid)
}
- _, err = cel.AstToCheckedExpr(ast)
+ checkedExpr, err := cel.AstToCheckedExpr(ast)
if err != nil {
// should be impossible since env.Compile returned no issues
return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal)
}
+ celAST, err := celast.ToAST(checkedExpr)
+ if err != nil {
+ // should be impossible since env.Compile returned no issues
+ return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal)
+ }
+
+ var usesFieldSelector, usesLabelSelector bool
+ celast.PreOrderVisit(celast.NavigateAST(celAST), celast.NewExprVisitor(func(e celast.Expr) {
+ // we already know we use both, no need to inspect more
+ if usesFieldSelector && usesLabelSelector {
+ return
+ }
+
+ var fieldName string
+ switch e.Kind() {
+ case celast.SelectKind:
+ // simple select (.fieldSelector / .labelSelector)
+ fieldName = e.AsSelect().FieldName()
+ case celast.CallKind:
+ // optional select (.?fieldSelector / .?labelSelector)
+ if e.AsCall().FunctionName() != operators.OptSelect {
+ return
+ }
+ args := e.AsCall().Args()
+ // args[0] is the receiver (what comes before the `.?`), args[1] is the field name being optionally selected (what comes after the `.?`)
+ if len(args) != 2 || args[1].Kind() != celast.LiteralKind || args[1].AsLiteral().Type() != cel.StringType {
+ return
+ }
+ fieldName, _ = args[1].AsLiteral().Value().(string)
+ }
+
+ switch fieldName {
+ case fieldSelectorVarName:
+ usesFieldSelector = true
+ case labelSelectorVarName:
+ usesLabelSelector = true
+ }
+ }))
+
prog, err := env.Program(ast)
if err != nil {
return resultError("program instantiation failed: "+err.Error(), apiservercel.ErrorTypeInternal)
@@ -108,6 +159,8 @@ func (c compiler) CompileCELExpression(expressionAccessor ExpressionAccessor) (C
return CompilationResult{
Program: prog,
ExpressionAccessor: expressionAccessor,
+ UsesFieldSelector: usesFieldSelector,
+ UsesLabelSelector: usesLabelSelector,
}, nil
}
@@ -161,7 +214,7 @@ func buildRequestType(field func(name string, declType *apiservercel.DeclType, r
// buildResourceAttributesType generates a DeclType for ResourceAttributes.
// if attributes are added here, also add to convertObjectToUnstructured.
func buildResourceAttributesType(field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType {
- return apiservercel.NewObjectType("kubernetes.ResourceAttributes", fields(
+ resourceAttributesFields := []*apiservercel.DeclField{
field("namespace", apiservercel.StringType, false),
field("verb", apiservercel.StringType, false),
field("group", apiservercel.StringType, false),
@@ -169,6 +222,33 @@ func buildResourceAttributesType(field func(name string, declType *apiservercel.
field("resource", apiservercel.StringType, false),
field("subresource", apiservercel.StringType, false),
field("name", apiservercel.StringType, false),
+ }
+ if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AuthorizeWithSelectors) {
+ resourceAttributesFields = append(resourceAttributesFields, field("fieldSelector", buildFieldSelectorType(field, fields), false))
+ resourceAttributesFields = append(resourceAttributesFields, field("labelSelector", buildLabelSelectorType(field, fields), false))
+ }
+ return apiservercel.NewObjectType("kubernetes.ResourceAttributes", fields(resourceAttributesFields...))
+}
+
+func buildFieldSelectorType(field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType {
+ return apiservercel.NewObjectType("kubernetes.FieldSelectorAttributes", fields(
+ field("rawSelector", apiservercel.StringType, false),
+ field("requirements", apiservercel.NewListType(buildSelectorRequirementType(field, fields), -1), false),
+ ))
+}
+
+func buildLabelSelectorType(field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType {
+ return apiservercel.NewObjectType("kubernetes.LabelSelectorAttributes", fields(
+ field("rawSelector", apiservercel.StringType, false),
+ field("requirements", apiservercel.NewListType(buildSelectorRequirementType(field, fields), -1), false),
+ ))
+}
+
+func buildSelectorRequirementType(field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType {
+ return apiservercel.NewObjectType("kubernetes.SelectorRequirement", fields(
+ field("key", apiservercel.StringType, false),
+ field("operator", apiservercel.StringType, false),
+ field("values", apiservercel.NewListType(apiservercel.StringType, -1), false),
))
}
@@ -181,7 +261,7 @@ func buildNonResourceAttributesType(field func(name string, declType *apiserverc
))
}
-func convertObjectToUnstructured(obj *authorizationv1.SubjectAccessReviewSpec) map[string]interface{} {
+func convertObjectToUnstructured(obj *authorizationv1.SubjectAccessReviewSpec, includeFieldSelector, includeLabelSelector bool) map[string]interface{} {
// Construct version containing every SubjectAccessReview user and string attribute field, even omitempty ones, for evaluation by CEL
extra := obj.Extra
if extra == nil {
@@ -194,7 +274,7 @@ func convertObjectToUnstructured(obj *authorizationv1.SubjectAccessReviewSpec) m
"extra": extra,
}
if obj.ResourceAttributes != nil {
- ret["resourceAttributes"] = map[string]string{
+ resourceAttributes := map[string]interface{}{
"namespace": obj.ResourceAttributes.Namespace,
"verb": obj.ResourceAttributes.Verb,
"group": obj.ResourceAttributes.Group,
@@ -203,6 +283,42 @@ func convertObjectToUnstructured(obj *authorizationv1.SubjectAccessReviewSpec) m
"subresource": obj.ResourceAttributes.Subresource,
"name": obj.ResourceAttributes.Name,
}
+
+ if includeFieldSelector && obj.ResourceAttributes.FieldSelector != nil {
+ if len(obj.ResourceAttributes.FieldSelector.Requirements) > 0 {
+ requirements := make([]map[string]interface{}, 0, len(obj.ResourceAttributes.FieldSelector.Requirements))
+ for _, r := range obj.ResourceAttributes.FieldSelector.Requirements {
+ requirements = append(requirements, map[string]interface{}{
+ "key": r.Key,
+ "operator": r.Operator,
+ "values": r.Values,
+ })
+ }
+ resourceAttributes[fieldSelectorVarName] = map[string]interface{}{"requirements": requirements}
+ }
+ if len(obj.ResourceAttributes.FieldSelector.RawSelector) > 0 {
+ resourceAttributes[fieldSelectorVarName] = map[string]interface{}{"rawSelector": obj.ResourceAttributes.FieldSelector.RawSelector}
+ }
+ }
+
+ if includeLabelSelector && obj.ResourceAttributes.LabelSelector != nil {
+ if len(obj.ResourceAttributes.LabelSelector.Requirements) > 0 {
+ requirements := make([]map[string]interface{}, 0, len(obj.ResourceAttributes.LabelSelector.Requirements))
+ for _, r := range obj.ResourceAttributes.LabelSelector.Requirements {
+ requirements = append(requirements, map[string]interface{}{
+ "key": r.Key,
+ "operator": r.Operator,
+ "values": r.Values,
+ })
+ }
+ resourceAttributes[labelSelectorVarName] = map[string]interface{}{"requirements": requirements}
+ }
+ if len(obj.ResourceAttributes.LabelSelector.RawSelector) > 0 {
+ resourceAttributes[labelSelectorVarName] = map[string]interface{}{"rawSelector": obj.ResourceAttributes.LabelSelector.RawSelector}
+ }
+ }
+
+ ret["resourceAttributes"] = resourceAttributes
}
if obj.NonResourceAttributes != nil {
ret["nonResourceAttributes"] = map[string]string{
diff --git a/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go b/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go
index 30ce5b69c99..eac97100c13 100644
--- a/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go
+++ b/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go
@@ -19,6 +19,7 @@ package cel
import (
"context"
"fmt"
+ "time"
celgo "github.com/google/cel-go/cel"
@@ -28,13 +29,36 @@ import (
type CELMatcher struct {
CompilationResults []CompilationResult
+
+ // These track if any expressions use fieldSelector and labelSelector,
+ // so construction of data passed to the CEL expression can be optimized if those fields are unused.
+ UsesLabelSelector bool
+ UsesFieldSelector bool
+
+ // These are optional fields which can be populated if metrics reporting is desired
+ Metrics MatcherMetrics
+ AuthorizerType string
+ AuthorizerName string
}
// eval evaluates the given SubjectAccessReview against all cel matchCondition expression
func (c *CELMatcher) Eval(ctx context.Context, r *authorizationv1.SubjectAccessReview) (bool, error) {
var evalErrors []error
+
+ metrics := c.Metrics
+ if metrics == nil {
+ metrics = NoopMatcherMetrics{}
+ }
+ start := time.Now()
+ defer func() {
+ metrics.RecordAuthorizationMatchConditionEvaluation(ctx, c.AuthorizerType, c.AuthorizerName, time.Since(start))
+ if len(evalErrors) > 0 {
+ metrics.RecordAuthorizationMatchConditionEvaluationFailure(ctx, c.AuthorizerType, c.AuthorizerName)
+ }
+ }()
+
va := map[string]interface{}{
- "request": convertObjectToUnstructured(&r.Spec),
+ "request": convertObjectToUnstructured(&r.Spec, c.UsesFieldSelector, c.UsesLabelSelector),
}
for _, compilationResult := range c.CompilationResults {
evalResult, _, err := compilationResult.Program.ContextEval(ctx, va)
@@ -54,6 +78,7 @@ func (c *CELMatcher) Eval(ctx context.Context, r *authorizationv1.SubjectAccessR
// If at least one matchCondition successfully evaluates to FALSE,
// return early
if !match {
+ metrics.RecordAuthorizationMatchConditionExclusion(ctx, c.AuthorizerType, c.AuthorizerName)
return false, nil
}
}
diff --git a/vendor/k8s.io/apiserver/pkg/authorization/cel/metrics.go b/vendor/k8s.io/apiserver/pkg/authorization/cel/metrics.go
new file mode 100644
index 00000000000..c9431a705d4
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/authorization/cel/metrics.go
@@ -0,0 +1,120 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package cel
+
+import (
+ "context"
+ "sync"
+ "time"
+
+ "k8s.io/component-base/metrics"
+ "k8s.io/component-base/metrics/legacyregistry"
+)
+
+// MatcherMetrics defines methods for reporting matchCondition metrics
+type MatcherMetrics interface {
+ // RecordAuthorizationMatchConditionEvaluation records the total time taken to evaluate matchConditions for an Authorize() call to the given authorizer
+ RecordAuthorizationMatchConditionEvaluation(ctx context.Context, authorizerType, authorizerName string, elapsed time.Duration)
+ // RecordAuthorizationMatchConditionEvaluationFailure increments if any evaluation error was encountered evaluating matchConditions for an Authorize() call to the given authorizer
+ RecordAuthorizationMatchConditionEvaluationFailure(ctx context.Context, authorizerType, authorizerName string)
+ // RecordAuthorizationMatchConditionExclusion records increments when at least one matchCondition evaluates to false and excludes an Authorize() call to the given authorizer
+ RecordAuthorizationMatchConditionExclusion(ctx context.Context, authorizerType, authorizerName string)
+}
+
+type NoopMatcherMetrics struct{}
+
+func (NoopMatcherMetrics) RecordAuthorizationMatchConditionEvaluation(ctx context.Context, authorizerType, authorizerName string, elapsed time.Duration) {
+}
+func (NoopMatcherMetrics) RecordAuthorizationMatchConditionEvaluationFailure(ctx context.Context, authorizerType, authorizerName string) {
+}
+func (NoopMatcherMetrics) RecordAuthorizationMatchConditionExclusion(ctx context.Context, authorizerType, authorizerName string) {
+}
+
+type matcherMetrics struct{}
+
+func NewMatcherMetrics() MatcherMetrics {
+ RegisterMetrics()
+ return matcherMetrics{}
+}
+
+const (
+ namespace = "apiserver"
+ subsystem = "authorization"
+)
+
+var (
+ authorizationMatchConditionEvaluationErrorsTotal = metrics.NewCounterVec(
+ &metrics.CounterOpts{
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "match_condition_evaluation_errors_total",
+ Help: "Total number of errors when an authorization webhook encounters a match condition error split by authorizer type and name.",
+ StabilityLevel: metrics.ALPHA,
+ },
+ []string{"type", "name"},
+ )
+ authorizationMatchConditionExclusionsTotal = metrics.NewCounterVec(
+ &metrics.CounterOpts{
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "match_condition_exclusions_total",
+ Help: "Total number of exclusions when an authorization webhook is skipped because match conditions exclude it.",
+ StabilityLevel: metrics.ALPHA,
+ },
+ []string{"type", "name"},
+ )
+ authorizationMatchConditionEvaluationSeconds = metrics.NewHistogramVec(
+ &metrics.HistogramOpts{
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "match_condition_evaluation_seconds",
+ Help: "Authorization match condition evaluation time in seconds, split by authorizer type and name.",
+ Buckets: []float64{0.001, 0.005, 0.01, 0.025, 0.1, 0.2, 0.25},
+ StabilityLevel: metrics.ALPHA,
+ },
+ []string{"type", "name"},
+ )
+)
+
+var registerMetrics sync.Once
+
+func RegisterMetrics() {
+ registerMetrics.Do(func() {
+ legacyregistry.MustRegister(authorizationMatchConditionEvaluationErrorsTotal)
+ legacyregistry.MustRegister(authorizationMatchConditionExclusionsTotal)
+ legacyregistry.MustRegister(authorizationMatchConditionEvaluationSeconds)
+ })
+}
+
+func ResetMetricsForTest() {
+ authorizationMatchConditionEvaluationErrorsTotal.Reset()
+ authorizationMatchConditionExclusionsTotal.Reset()
+ authorizationMatchConditionEvaluationSeconds.Reset()
+}
+
+func (matcherMetrics) RecordAuthorizationMatchConditionEvaluationFailure(ctx context.Context, authorizerType, authorizerName string) {
+ authorizationMatchConditionEvaluationErrorsTotal.WithContext(ctx).WithLabelValues(authorizerType, authorizerName).Inc()
+}
+
+func (matcherMetrics) RecordAuthorizationMatchConditionExclusion(ctx context.Context, authorizerType, authorizerName string) {
+ authorizationMatchConditionExclusionsTotal.WithContext(ctx).WithLabelValues(authorizerType, authorizerName).Inc()
+}
+
+func (matcherMetrics) RecordAuthorizationMatchConditionEvaluation(ctx context.Context, authorizerType, authorizerName string, elapsed time.Duration) {
+ elapsedSeconds := elapsed.Seconds()
+ authorizationMatchConditionEvaluationSeconds.WithContext(ctx).WithLabelValues(authorizerType, authorizerName).Observe(elapsedSeconds)
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/cidr.go b/vendor/k8s.io/apiserver/pkg/cel/cidr.go
new file mode 100644
index 00000000000..8e97f63cd74
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/cel/cidr.go
@@ -0,0 +1,87 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package cel
+
+import (
+ "fmt"
+ "math"
+ "net/netip"
+ "reflect"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+// CIDR provides a CEL representation of an network address.
+type CIDR struct {
+ netip.Prefix
+}
+
+var (
+ CIDRType = cel.OpaqueType("net.CIDR")
+)
+
+// ConvertToNative implements ref.Val.ConvertToNative.
+func (d CIDR) ConvertToNative(typeDesc reflect.Type) (any, error) {
+ if reflect.TypeOf(d.Prefix).AssignableTo(typeDesc) {
+ return d.Prefix, nil
+ }
+ if reflect.TypeOf("").AssignableTo(typeDesc) {
+ return d.Prefix.String(), nil
+ }
+ return nil, fmt.Errorf("type conversion error from 'CIDR' to '%v'", typeDesc)
+}
+
+// ConvertToType implements ref.Val.ConvertToType.
+func (d CIDR) ConvertToType(typeVal ref.Type) ref.Val {
+ switch typeVal {
+ case CIDRType:
+ return d
+ case types.TypeType:
+ return CIDRType
+ case types.StringType:
+ return types.String(d.Prefix.String())
+ }
+ return types.NewErr("type conversion error from '%s' to '%s'", CIDRType, typeVal)
+}
+
+// Equal implements ref.Val.Equal.
+func (d CIDR) Equal(other ref.Val) ref.Val {
+ otherD, ok := other.(CIDR)
+ if !ok {
+ return types.ValOrErr(other, "no such overload")
+ }
+
+ return types.Bool(d.Prefix == otherD.Prefix)
+}
+
+// Type implements ref.Val.Type.
+func (d CIDR) Type() ref.Type {
+ return CIDRType
+}
+
+// Value implements ref.Val.Value.
+func (d CIDR) Value() any {
+ return d.Prefix
+}
+
+// Size returns the size of the CIDR prefix address in bytes.
+// Used in the size estimation of the runtime cost.
+func (d CIDR) Size() ref.Val {
+ return types.Int(int(math.Ceil(float64(d.Prefix.Bits()) / 8)))
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/environment/base.go b/vendor/k8s.io/apiserver/pkg/cel/environment/base.go
index 0c1dee82dc5..563d34e13f7 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/environment/base.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/environment/base.go
@@ -20,6 +20,7 @@ import (
"fmt"
"strconv"
"sync"
+ "sync/atomic"
"github.com/google/cel-go/cel"
"github.com/google/cel-go/checker"
@@ -30,23 +31,34 @@ import (
"k8s.io/apimachinery/pkg/util/version"
celconfig "k8s.io/apiserver/pkg/apis/cel"
"k8s.io/apiserver/pkg/cel/library"
+ genericfeatures "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
+ utilversion "k8s.io/apiserver/pkg/util/version"
)
// DefaultCompatibilityVersion returns a default compatibility version for use with EnvSet
// that guarantees compatibility with CEL features/libraries/parameters understood by
-// an n-1 version
+// the api server min compatibility version
//
-// This default will be set to no more than n-1 the current Kubernetes major.minor version.
+// This default will be set to no more than the current Kubernetes major.minor version.
//
-// Note that a default version number less than n-1 indicates a wider range of version
-// compatibility than strictly required for rollback. A wide range of compatibility is
-// desirable because it means that CEL expressions are portable across a wider range
-// of Kubernetes versions.
+// Note that a default version number less than n-1 the current Kubernetes major.minor version
+// indicates a wider range of version compatibility than strictly required for rollback.
+// A wide range of compatibility is desirable because it means that CEL expressions are portable
+// across a wider range of Kubernetes versions.
+// A default version number equal to the current Kubernetes major.minor version
+// indicates fast forward CEL features that can be used when rollback is no longer needed.
func DefaultCompatibilityVersion() *version.Version {
- return version.MajorMinor(1, 28)
+ effectiveVer := utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent)
+ if effectiveVer == nil {
+ effectiveVer = utilversion.DefaultKubeEffectiveVersion()
+ }
+ return effectiveVer.MinCompatibilityVersion()
}
-var baseOpts = []VersionedOptions{
+var baseOpts = append(baseOptsWithoutStrictCost, StrictCostOpt)
+
+var baseOptsWithoutStrictCost = []VersionedOptions{
{
// CEL epoch was actually 1.23, but we artificially set it to 1.0 because these
// options should always be present.
@@ -123,6 +135,60 @@ var baseOpts = []VersionedOptions{
ext.Sets(),
},
},
+ {
+ IntroducedVersion: version.MajorMinor(1, 30),
+ EnvOptions: []cel.EnvOption{
+ library.IP(),
+ library.CIDR(),
+ },
+ },
+ // Format Library
+ {
+ IntroducedVersion: version.MajorMinor(1, 31),
+ EnvOptions: []cel.EnvOption{
+ library.Format(),
+ },
+ },
+ // Authz selectors
+ {
+ IntroducedVersion: version.MajorMinor(1, 31),
+ FeatureEnabled: func() bool {
+ enabled := utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AuthorizeWithSelectors)
+ authzSelectorsLibraryInit.Do(func() {
+ // Record the first time feature enablement was checked for this library.
+ // This is checked from integration tests to ensure no cached cel envs
+ // are constructed before feature enablement is effectively set.
+ authzSelectorsLibraryEnabled.Store(enabled)
+ // Uncomment to debug where the first initialization is coming from if needed.
+ // debug.PrintStack()
+ })
+ return enabled
+ },
+ EnvOptions: []cel.EnvOption{
+ library.AuthzSelectors(),
+ },
+ },
+}
+
+var (
+ authzSelectorsLibraryInit sync.Once
+ authzSelectorsLibraryEnabled atomic.Value
+)
+
+// AuthzSelectorsLibraryEnabled returns whether the AuthzSelectors library was enabled when it was constructed.
+// If it has not been contructed yet, this returns `false, false`.
+// This is solely for the benefit of the integration tests making sure feature gates get correctly parsed before AuthzSelector ever has to check for enablement.
+func AuthzSelectorsLibraryEnabled() (enabled, constructed bool) {
+ enabled, constructed = authzSelectorsLibraryEnabled.Load().(bool)
+ return
+}
+
+var StrictCostOpt = VersionedOptions{
+ // This is to configure the cost calculation for extended libraries
+ IntroducedVersion: version.MajorMinor(1, 0),
+ ProgramOptions: []cel.ProgramOption{
+ cel.CostTracking(&library.CostEstimator{}),
+ },
}
// MustBaseEnvSet returns the common CEL base environments for Kubernetes for Version, or panics
@@ -134,7 +200,8 @@ var baseOpts = []VersionedOptions{
// The returned environment contains no CEL variable definitions or custom type declarations and
// should be extended to construct environments with the appropriate variable definitions,
// type declarations and any other needed configuration.
-func MustBaseEnvSet(ver *version.Version) *EnvSet {
+// strictCost is used to determine whether to enforce strict cost calculation for CEL expressions.
+func MustBaseEnvSet(ver *version.Version, strictCost bool) *EnvSet {
if ver == nil {
panic("version must be non-nil")
}
@@ -142,19 +209,33 @@ func MustBaseEnvSet(ver *version.Version) *EnvSet {
panic(fmt.Sprintf("version must contain an major and minor component, but got: %s", ver.String()))
}
key := strconv.FormatUint(uint64(ver.Major()), 10) + "." + strconv.FormatUint(uint64(ver.Minor()), 10)
- if entry, ok := baseEnvs.Load(key); ok {
- return entry.(*EnvSet)
+ var entry interface{}
+ if strictCost {
+ if entry, ok := baseEnvs.Load(key); ok {
+ return entry.(*EnvSet)
+ }
+ entry, _, _ = baseEnvsSingleflight.Do(key, func() (interface{}, error) {
+ entry := mustNewEnvSet(ver, baseOpts)
+ baseEnvs.Store(key, entry)
+ return entry, nil
+ })
+ } else {
+ if entry, ok := baseEnvsWithOption.Load(key); ok {
+ return entry.(*EnvSet)
+ }
+ entry, _, _ = baseEnvsWithOptionSingleflight.Do(key, func() (interface{}, error) {
+ entry := mustNewEnvSet(ver, baseOptsWithoutStrictCost)
+ baseEnvsWithOption.Store(key, entry)
+ return entry, nil
+ })
}
- entry, _, _ := baseEnvsSingleflight.Do(key, func() (interface{}, error) {
- entry := mustNewEnvSet(ver, baseOpts)
- baseEnvs.Store(key, entry)
- return entry, nil
- })
return entry.(*EnvSet)
}
var (
- baseEnvs = sync.Map{}
- baseEnvsSingleflight = &singleflight.Group{}
+ baseEnvs = sync.Map{}
+ baseEnvsWithOption = sync.Map{}
+ baseEnvsSingleflight = &singleflight.Group{}
+ baseEnvsWithOptionSingleflight = &singleflight.Group{}
)
diff --git a/vendor/k8s.io/apiserver/pkg/cel/environment/environment.go b/vendor/k8s.io/apiserver/pkg/cel/environment/environment.go
index b47bc8e984b..07b9e8f5466 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/environment/environment.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/environment/environment.go
@@ -175,7 +175,15 @@ type VersionedOptions struct {
//
// Optional.
RemovedVersion *version.Version
-
+ // FeatureEnabled returns true if these options are enabled by feature gates,
+ // and returns false if these options are not enabled due to feature gates.
+ //
+ // This takes priority over IntroducedVersion / RemovedVersion for the NewExpressions environment.
+ //
+ // The StoredExpressions environment ignores this function.
+ //
+ // Optional.
+ FeatureEnabled func() bool
// EnvOptions provides CEL EnvOptions. This may be used to add a cel.Variable, a
// cel.Library, or to enable other CEL EnvOptions such as language settings.
//
@@ -210,7 +218,7 @@ type VersionedOptions struct {
// making multiple calls to Extend.
func (e *EnvSet) Extend(options ...VersionedOptions) (*EnvSet, error) {
if len(options) > 0 {
- newExprOpts, err := e.filterAndBuildOpts(e.newExpressions, e.compatibilityVersion, options)
+ newExprOpts, err := e.filterAndBuildOpts(e.newExpressions, e.compatibilityVersion, true, options)
if err != nil {
return nil, err
}
@@ -218,7 +226,7 @@ func (e *EnvSet) Extend(options ...VersionedOptions) (*EnvSet, error) {
if err != nil {
return nil, err
}
- storedExprOpt, err := e.filterAndBuildOpts(e.storedExpressions, version.MajorMinor(math.MaxUint, math.MaxUint), options)
+ storedExprOpt, err := e.filterAndBuildOpts(e.storedExpressions, version.MajorMinor(math.MaxUint, math.MaxUint), false, options)
if err != nil {
return nil, err
}
@@ -231,13 +239,26 @@ func (e *EnvSet) Extend(options ...VersionedOptions) (*EnvSet, error) {
return e, nil
}
-func (e *EnvSet) filterAndBuildOpts(base *cel.Env, compatVer *version.Version, opts []VersionedOptions) (cel.EnvOption, error) {
+func (e *EnvSet) filterAndBuildOpts(base *cel.Env, compatVer *version.Version, honorFeatureGateEnablement bool, opts []VersionedOptions) (cel.EnvOption, error) {
var envOpts []cel.EnvOption
var progOpts []cel.ProgramOption
var declTypes []*apiservercel.DeclType
for _, opt := range opts {
+ var allowedByFeatureGate, allowedByVersion bool
+ if opt.FeatureEnabled != nil && honorFeatureGateEnablement {
+ // Feature-gate-enabled libraries must follow compatible default feature enablement.
+ // Enabling alpha features in their first release enables libraries the previous API server is unaware of.
+ allowedByFeatureGate = opt.FeatureEnabled()
+ if !allowedByFeatureGate {
+ continue
+ }
+ }
if compatVer.AtLeast(opt.IntroducedVersion) && (opt.RemovedVersion == nil || compatVer.LessThan(opt.RemovedVersion)) {
+ allowedByVersion = true
+ }
+
+ if allowedByFeatureGate || allowedByVersion {
envOpts = append(envOpts, opt.EnvOptions...)
progOpts = append(progOpts, opt.ProgramOptions...)
declTypes = append(declTypes, opt.DeclTypes...)
@@ -246,7 +267,10 @@ func (e *EnvSet) filterAndBuildOpts(base *cel.Env, compatVer *version.Version, o
if len(declTypes) > 0 {
provider := apiservercel.NewDeclTypeProvider(declTypes...)
- providerOpts, err := provider.EnvOptions(base.TypeProvider())
+ if compatVer.AtLeast(version.MajorMinor(1, 31)) {
+ provider.SetRecognizeKeywordAsFieldName(true)
+ }
+ providerOpts, err := provider.EnvOptions(base.CELTypeProvider())
if err != nil {
return nil, err
}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/errors.go b/vendor/k8s.io/apiserver/pkg/cel/errors.go
index 907ca6ec8f1..d7b052fc9e7 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/errors.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/errors.go
@@ -16,11 +16,46 @@ limitations under the License.
package cel
+import (
+ "fmt"
+
+ "github.com/google/cel-go/cel"
+)
+
+// ErrInternal the basic error that occurs when the expression fails to evaluate
+// due to internal reasons. Any Error that has the Type of
+// ErrorInternal is considered equal to ErrInternal
+var ErrInternal = fmt.Errorf("internal")
+
+// ErrInvalid is the basic error that occurs when the expression fails to
+// evaluate but not due to internal reasons. Any Error that has the Type of
+// ErrorInvalid is considered equal to ErrInvalid.
+var ErrInvalid = fmt.Errorf("invalid")
+
+// ErrRequired is the basic error that occurs when the expression is required
+// but absent.
+// Any Error that has the Type of ErrorRequired is considered equal
+// to ErrRequired.
+var ErrRequired = fmt.Errorf("required")
+
+// ErrCompilation is the basic error that occurs when the expression fails to
+// compile. Any CompilationError wraps ErrCompilation.
+// ErrCompilation wraps ErrInvalid
+var ErrCompilation = fmt.Errorf("%w: compilation error", ErrInvalid)
+
+// ErrOutOfBudget is the basic error that occurs when the expression fails due to
+// exceeding budget.
+var ErrOutOfBudget = fmt.Errorf("out of budget")
+
// Error is an implementation of the 'error' interface, which represents a
// XValidation error.
type Error struct {
Type ErrorType
Detail string
+
+ // Cause is an optional wrapped errors that can be useful to
+ // programmatically retrieve detailed errors.
+ Cause error
}
var _ error = &Error{}
@@ -30,7 +65,24 @@ func (v *Error) Error() string {
return v.Detail
}
-// ErrorType is a machine readable value providing more detail about why
+func (v *Error) Is(err error) bool {
+ switch v.Type {
+ case ErrorTypeRequired:
+ return err == ErrRequired
+ case ErrorTypeInvalid:
+ return err == ErrInvalid
+ case ErrorTypeInternal:
+ return err == ErrInternal
+ }
+ return false
+}
+
+// Unwrap returns the wrapped Cause.
+func (v *Error) Unwrap() error {
+ return v.Cause
+}
+
+// ErrorType is a machine-readable value providing more detail about why
// a XValidation is invalid.
type ErrorType string
@@ -45,3 +97,28 @@ const (
// to user input. See InternalError().
ErrorTypeInternal ErrorType = "InternalError"
)
+
+// CompilationError indicates an error during expression compilation.
+// It wraps ErrCompilation.
+type CompilationError struct {
+ err *Error
+ Issues *cel.Issues
+}
+
+// NewCompilationError wraps a cel.Issues to indicate a compilation failure.
+func NewCompilationError(issues *cel.Issues) *CompilationError {
+ return &CompilationError{
+ Issues: issues,
+ err: &Error{
+ Type: ErrorTypeInvalid,
+ Detail: fmt.Sprintf("compilation error: %s", issues),
+ }}
+}
+
+func (e *CompilationError) Error() string {
+ return e.err.Error()
+}
+
+func (e *CompilationError) Unwrap() []error {
+ return []error{e.err, ErrCompilation}
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/format.go b/vendor/k8s.io/apiserver/pkg/cel/format.go
new file mode 100644
index 00000000000..1bcfddfe765
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/cel/format.go
@@ -0,0 +1,73 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package cel
+
+import (
+ "fmt"
+ "reflect"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/checker/decls"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+var (
+ FormatObject = decls.NewObjectType("kubernetes.NamedFormat")
+ FormatType = cel.ObjectType("kubernetes.NamedFormat")
+)
+
+// Format provdes a CEL representation of kubernetes format
+type Format struct {
+ Name string
+ ValidateFunc func(string) []string
+
+ // Size of the regex string or estimated equivalent regex string used
+ // for cost estimation
+ MaxRegexSize int
+}
+
+func (d *Format) ConvertToNative(typeDesc reflect.Type) (interface{}, error) {
+ return nil, fmt.Errorf("type conversion error from 'Format' to '%v'", typeDesc)
+}
+
+func (d *Format) ConvertToType(typeVal ref.Type) ref.Val {
+ switch typeVal {
+ case FormatType:
+ return d
+ case types.TypeType:
+ return FormatType
+ default:
+ return types.NewErr("type conversion error from '%s' to '%s'", FormatType, typeVal)
+ }
+}
+
+func (d *Format) Equal(other ref.Val) ref.Val {
+ otherDur, ok := other.(*Format)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(other)
+ }
+ return types.Bool(d.Name == otherDur.Name)
+}
+
+func (d *Format) Type() ref.Type {
+ return FormatType
+}
+
+func (d *Format) Value() interface{} {
+ return d
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/ip.go b/vendor/k8s.io/apiserver/pkg/cel/ip.go
new file mode 100644
index 00000000000..f91c6cb7a86
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/cel/ip.go
@@ -0,0 +1,86 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package cel
+
+import (
+ "fmt"
+ "math"
+ "net/netip"
+ "reflect"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+// IP provides a CEL representation of an IP address.
+type IP struct {
+ netip.Addr
+}
+
+var (
+ IPType = cel.OpaqueType("net.IP")
+)
+
+// ConvertToNative implements ref.Val.ConvertToNative.
+func (d IP) ConvertToNative(typeDesc reflect.Type) (any, error) {
+ if reflect.TypeOf(d.Addr).AssignableTo(typeDesc) {
+ return d.Addr, nil
+ }
+ if reflect.TypeOf("").AssignableTo(typeDesc) {
+ return d.Addr.String(), nil
+ }
+ return nil, fmt.Errorf("type conversion error from 'IP' to '%v'", typeDesc)
+}
+
+// ConvertToType implements ref.Val.ConvertToType.
+func (d IP) ConvertToType(typeVal ref.Type) ref.Val {
+ switch typeVal {
+ case IPType:
+ return d
+ case types.TypeType:
+ return IPType
+ case types.StringType:
+ return types.String(d.Addr.String())
+ }
+ return types.NewErr("type conversion error from '%s' to '%s'", IPType, typeVal)
+}
+
+// Equal implements ref.Val.Equal.
+func (d IP) Equal(other ref.Val) ref.Val {
+ otherD, ok := other.(IP)
+ if !ok {
+ return types.ValOrErr(other, "no such overload")
+ }
+ return types.Bool(d.Addr == otherD.Addr)
+}
+
+// Type implements ref.Val.Type.
+func (d IP) Type() ref.Type {
+ return IPType
+}
+
+// Value implements ref.Val.Value.
+func (d IP) Value() any {
+ return d.Addr
+}
+
+// Size returns the size of the IP address in bytes.
+// Used in the size estimation of the runtime cost.
+func (d IP) Size() ref.Val {
+ return types.Int(int(math.Ceil(float64(d.Addr.BitLen()) / 8)))
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/library/authz.go b/vendor/k8s.io/apiserver/pkg/cel/library/authz.go
index df4bf080714..1fd489fc916 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/library/authz.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/library/authz.go
@@ -22,6 +22,11 @@ import (
"reflect"
"strings"
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/labels"
+ genericfeatures "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
+
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
@@ -194,6 +199,30 @@ import (
// Examples:
//
// authorizer.group('').resource('pods').namespace('default').check('create').error()
+//
+// fieldSelector
+//
+// Takes a string field selector, parses it to field selector requirements, and includes it in the authorization check.
+// If the field selector does not parse successfully, no field selector requirements are included in the authorization check.
+// Added in Kubernetes 1.31+, Authz library version 1.
+//
+// .fieldSelector()
+//
+// Examples:
+//
+// authorizer.group('').resource('pods').fieldSelector('spec.nodeName=mynode').check('list').allowed()
+//
+// labelSelector (added in v1, Kubernetes 1.31+)
+//
+// Takes a string label selector, parses it to label selector requirements, and includes it in the authorization check.
+// If the label selector does not parse successfully, no label selector requirements are included in the authorization check.
+// Added in Kubernetes 1.31+, Authz library version 1.
+//
+// .labelSelector()
+//
+// Examples:
+//
+// authorizer.group('').resource('pods').labelSelector('app=example').check('list').allowed()
func Authz() cel.EnvOption {
return cel.Lib(authzLib)
}
@@ -259,6 +288,66 @@ func (*authz) ProgramOptions() []cel.ProgramOption {
return []cel.ProgramOption{}
}
+// AuthzSelectors provides a CEL function library extension for adding fieldSelector and
+// labelSelector filters to authorization checks. This requires the Authz library.
+// See documentation of the Authz library for use and availability of the authorizer variable.
+//
+// fieldSelector
+//
+// Takes a string field selector, parses it to field selector requirements, and includes it in the authorization check.
+// If the field selector does not parse successfully, no field selector requirements are included in the authorization check.
+// Added in Kubernetes 1.31+.
+//
+// .fieldSelector()
+//
+// Examples:
+//
+// authorizer.group('').resource('pods').fieldSelector('spec.nodeName=mynode').check('list').allowed()
+//
+// labelSelector
+//
+// Takes a string label selector, parses it to label selector requirements, and includes it in the authorization check.
+// If the label selector does not parse successfully, no label selector requirements are included in the authorization check.
+// Added in Kubernetes 1.31+.
+//
+// .labelSelector()
+//
+// Examples:
+//
+// authorizer.group('').resource('pods').labelSelector('app=example').check('list').allowed()
+func AuthzSelectors() cel.EnvOption {
+ return cel.Lib(authzSelectorsLib)
+}
+
+var authzSelectorsLib = &authzSelectors{}
+
+type authzSelectors struct{}
+
+func (*authzSelectors) LibraryName() string {
+ return "k8s.authzSelectors"
+}
+
+var authzSelectorsLibraryDecls = map[string][]cel.FunctionOpt{
+ "fieldSelector": {
+ cel.MemberOverload("authorizer_fieldselector", []*cel.Type{ResourceCheckType, cel.StringType}, ResourceCheckType,
+ cel.BinaryBinding(resourceCheckFieldSelector))},
+ "labelSelector": {
+ cel.MemberOverload("authorizer_labelselector", []*cel.Type{ResourceCheckType, cel.StringType}, ResourceCheckType,
+ cel.BinaryBinding(resourceCheckLabelSelector))},
+}
+
+func (*authzSelectors) CompileOptions() []cel.EnvOption {
+ options := make([]cel.EnvOption, 0, len(authzSelectorsLibraryDecls))
+ for name, overloads := range authzSelectorsLibraryDecls {
+ options = append(options, cel.Function(name, overloads...))
+ }
+ return options
+}
+
+func (*authzSelectors) ProgramOptions() []cel.ProgramOption {
+ return []cel.ProgramOption{}
+}
+
func authorizerPath(arg1, arg2 ref.Val) ref.Val {
authz, ok := arg1.(authorizerVal)
if !ok {
@@ -354,6 +443,38 @@ func resourceCheckSubresource(arg1, arg2 ref.Val) ref.Val {
return result
}
+func resourceCheckFieldSelector(arg1, arg2 ref.Val) ref.Val {
+ resourceCheck, ok := arg1.(resourceCheckVal)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg1)
+ }
+
+ fieldSelector, ok := arg2.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg1)
+ }
+
+ result := resourceCheck
+ result.fieldSelector = fieldSelector
+ return result
+}
+
+func resourceCheckLabelSelector(arg1, arg2 ref.Val) ref.Val {
+ resourceCheck, ok := arg1.(resourceCheckVal)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg1)
+ }
+
+ labelSelector, ok := arg2.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg1)
+ }
+
+ result := resourceCheck
+ result.labelSelector = labelSelector
+ return result
+}
+
func resourceCheckNamespace(arg1, arg2 ref.Val) ref.Val {
resourceCheck, ok := arg1.(resourceCheckVal)
if !ok {
@@ -544,11 +665,13 @@ func (g groupCheckVal) resourceCheck(resource string) resourceCheckVal {
type resourceCheckVal struct {
receiverOnlyObjectVal
- groupCheck groupCheckVal
- resource string
- subresource string
- namespace string
- name string
+ groupCheck groupCheckVal
+ resource string
+ subresource string
+ namespace string
+ name string
+ fieldSelector string
+ labelSelector string
}
func (a resourceCheckVal) Authorize(ctx context.Context, verb string) ref.Val {
@@ -563,6 +686,26 @@ func (a resourceCheckVal) Authorize(ctx context.Context, verb string) ref.Val {
Verb: verb,
User: a.groupCheck.authorizer.userInfo,
}
+
+ if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AuthorizeWithSelectors) {
+ if len(a.fieldSelector) > 0 {
+ selector, err := fields.ParseSelector(a.fieldSelector)
+ if err != nil {
+ attr.FieldSelectorRequirements, attr.FieldSelectorParsingErr = nil, err
+ } else {
+ attr.FieldSelectorRequirements, attr.FieldSelectorParsingErr = selector.Requirements(), nil
+ }
+ }
+ if len(a.labelSelector) > 0 {
+ requirements, err := labels.ParseToRequirements(a.labelSelector)
+ if err != nil {
+ attr.LabelSelectorRequirements, attr.LabelSelectorParsingErr = nil, err
+ } else {
+ attr.LabelSelectorRequirements, attr.LabelSelectorParsingErr = requirements, nil
+ }
+ }
+ }
+
decision, reason, err := a.groupCheck.authorizer.authAuthorizer.Authorize(ctx, attr)
return newDecision(decision, err, reason)
}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/library/cidr.go b/vendor/k8s.io/apiserver/pkg/cel/library/cidr.go
new file mode 100644
index 00000000000..c4259daed97
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/cel/library/cidr.go
@@ -0,0 +1,287 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package library
+
+import (
+ "fmt"
+ "net/netip"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+
+ apiservercel "k8s.io/apiserver/pkg/cel"
+)
+
+// CIDR provides a CEL function library extension of CIDR notation parsing functions.
+//
+// cidr
+//
+// Converts a string in CIDR notation to a network address representation or results in an error if the string is not a valid CIDR notation.
+// The CIDR must be an IPv4 or IPv6 subnet address with a mask.
+// Leading zeros in IPv4 address octets are not allowed.
+// IPv4-mapped IPv6 addresses (e.g. ::ffff:1.2.3.4/24) are not allowed.
+//
+// cidr()
+//
+// Examples:
+//
+// cidr('192.168.0.0/16') // returns an IPv4 address with a CIDR mask
+// cidr('::1/128') // returns an IPv6 address with a CIDR mask
+// cidr('192.168.0.0/33') // error
+// cidr('::1/129') // error
+// cidr('192.168.0.1/16') // error, because there are non-0 bits after the prefix
+//
+// isCIDR
+//
+// Returns true if a string is a valid CIDR notation respresentation of a subnet with mask.
+// The CIDR must be an IPv4 or IPv6 subnet address with a mask.
+// Leading zeros in IPv4 address octets are not allowed.
+// IPv4-mapped IPv6 addresses (e.g. ::ffff:1.2.3.4/24) are not allowed.
+//
+// isCIDR()
+//
+// Examples:
+//
+// isCIDR('192.168.0.0/16') // returns true
+// isCIDR('::1/128') // returns true
+// isCIDR('192.168.0.0/33') // returns false
+// isCIDR('::1/129') // returns false
+//
+// containsIP / containerCIDR / ip / masked / prefixLength
+//
+// - containsIP: Returns true if a the CIDR contains the given IP address.
+// The IP address must be an IPv4 or IPv6 address.
+// May take either a string or IP address as an argument.
+//
+// - containsCIDR: Returns true if a the CIDR contains the given CIDR.
+// The CIDR must be an IPv4 or IPv6 subnet address with a mask.
+// May take either a string or CIDR as an argument.
+//
+// - ip: Returns the IP address representation of the CIDR.
+//
+// - masked: Returns the CIDR representation of the network address with a masked prefix.
+// This can be used to return the canonical form of the CIDR network.
+//
+// - prefixLength: Returns the prefix length of the CIDR in bits.
+// This is the number of bits in the mask.
+//
+// Examples:
+//
+// cidr('192.168.0.0/24').containsIP(ip('192.168.0.1')) // returns true
+// cidr('192.168.0.0/24').containsIP(ip('192.168.1.1')) // returns false
+// cidr('192.168.0.0/24').containsIP('192.168.0.1') // returns true
+// cidr('192.168.0.0/24').containsIP('192.168.1.1') // returns false
+// cidr('192.168.0.0/16').containsCIDR(cidr('192.168.10.0/24')) // returns true
+// cidr('192.168.1.0/24').containsCIDR(cidr('192.168.2.0/24')) // returns false
+// cidr('192.168.0.0/16').containsCIDR('192.168.10.0/24') // returns true
+// cidr('192.168.1.0/24').containsCIDR('192.168.2.0/24') // returns false
+// cidr('192.168.0.1/24').ip() // returns ipAddr('192.168.0.1')
+// cidr('192.168.0.1/24').ip().family() // returns '4'
+// cidr('::1/128').ip() // returns ipAddr('::1')
+// cidr('::1/128').ip().family() // returns '6'
+// cidr('192.168.0.0/24').masked() // returns cidr('192.168.0.0/24')
+// cidr('192.168.0.1/24').masked() // returns cidr('192.168.0.0/24')
+// cidr('192.168.0.0/24') == cidr('192.168.0.0/24').masked() // returns true, CIDR was already in canonical format
+// cidr('192.168.0.1/24') == cidr('192.168.0.1/24').masked() // returns false, CIDR was not in canonical format
+// cidr('192.168.0.0/16').prefixLength() // returns 16
+// cidr('::1/128').prefixLength() // returns 128
+func CIDR() cel.EnvOption {
+ return cel.Lib(cidrsLib)
+}
+
+var cidrsLib = &cidrs{}
+
+type cidrs struct{}
+
+func (*cidrs) LibraryName() string {
+ return "net.cidr"
+}
+
+var cidrLibraryDecls = map[string][]cel.FunctionOpt{
+ "cidr": {
+ cel.Overload("string_to_cidr", []*cel.Type{cel.StringType}, apiservercel.CIDRType,
+ cel.UnaryBinding(stringToCIDR)),
+ },
+ "containsIP": {
+ cel.MemberOverload("cidr_contains_ip_string", []*cel.Type{apiservercel.CIDRType, cel.StringType}, cel.BoolType,
+ cel.BinaryBinding(cidrContainsIPString)),
+ cel.MemberOverload("cidr_contains_ip_ip", []*cel.Type{apiservercel.CIDRType, apiservercel.IPType}, cel.BoolType,
+ cel.BinaryBinding(cidrContainsIP)),
+ },
+ "containsCIDR": {
+ cel.MemberOverload("cidr_contains_cidr_string", []*cel.Type{apiservercel.CIDRType, cel.StringType}, cel.BoolType,
+ cel.BinaryBinding(cidrContainsCIDRString)),
+ cel.MemberOverload("cidr_contains_cidr", []*cel.Type{apiservercel.CIDRType, apiservercel.CIDRType}, cel.BoolType,
+ cel.BinaryBinding(cidrContainsCIDR)),
+ },
+ "ip": {
+ cel.MemberOverload("cidr_ip", []*cel.Type{apiservercel.CIDRType}, apiservercel.IPType,
+ cel.UnaryBinding(cidrToIP)),
+ },
+ "prefixLength": {
+ cel.MemberOverload("cidr_prefix_length", []*cel.Type{apiservercel.CIDRType}, cel.IntType,
+ cel.UnaryBinding(prefixLength)),
+ },
+ "masked": {
+ cel.MemberOverload("cidr_masked", []*cel.Type{apiservercel.CIDRType}, apiservercel.CIDRType,
+ cel.UnaryBinding(masked)),
+ },
+ "isCIDR": {
+ cel.Overload("is_cidr", []*cel.Type{cel.StringType}, cel.BoolType,
+ cel.UnaryBinding(isCIDR)),
+ },
+ "string": {
+ cel.Overload("cidr_to_string", []*cel.Type{apiservercel.CIDRType}, cel.StringType,
+ cel.UnaryBinding(cidrToString)),
+ },
+}
+
+func (*cidrs) CompileOptions() []cel.EnvOption {
+ options := []cel.EnvOption{cel.Types(apiservercel.CIDRType),
+ cel.Variable(apiservercel.CIDRType.TypeName(), types.NewTypeTypeWithParam(apiservercel.CIDRType)),
+ }
+ for name, overloads := range cidrLibraryDecls {
+ options = append(options, cel.Function(name, overloads...))
+ }
+ return options
+}
+
+func (*cidrs) ProgramOptions() []cel.ProgramOption {
+ return []cel.ProgramOption{}
+}
+
+func stringToCIDR(arg ref.Val) ref.Val {
+ s, ok := arg.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ net, err := parseCIDR(s)
+ if err != nil {
+ return types.NewErr("network address parse error during conversion from string: %v", err)
+ }
+
+ return apiservercel.CIDR{
+ Prefix: net,
+ }
+}
+
+func cidrToString(arg ref.Val) ref.Val {
+ cidr, ok := arg.(apiservercel.CIDR)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.String(cidr.Prefix.String())
+}
+
+func cidrContainsIPString(arg ref.Val, other ref.Val) ref.Val {
+ return cidrContainsIP(arg, stringToIP(other))
+}
+
+func cidrContainsCIDRString(arg ref.Val, other ref.Val) ref.Val {
+ return cidrContainsCIDR(arg, stringToCIDR(other))
+}
+
+func cidrContainsIP(arg ref.Val, other ref.Val) ref.Val {
+ cidr, ok := arg.(apiservercel.CIDR)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(other)
+ }
+
+ ip, ok := other.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.Bool(cidr.Contains(ip.Addr))
+}
+
+func cidrContainsCIDR(arg ref.Val, other ref.Val) ref.Val {
+ cidr, ok := arg.(apiservercel.CIDR)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ containsCIDR, ok := other.(apiservercel.CIDR)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(other)
+ }
+
+ equalMasked := cidr.Prefix.Masked() == netip.PrefixFrom(containsCIDR.Prefix.Addr(), cidr.Prefix.Bits())
+ return types.Bool(equalMasked && cidr.Prefix.Bits() <= containsCIDR.Prefix.Bits())
+}
+
+func prefixLength(arg ref.Val) ref.Val {
+ cidr, ok := arg.(apiservercel.CIDR)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.Int(cidr.Prefix.Bits())
+}
+
+func isCIDR(arg ref.Val) ref.Val {
+ s, ok := arg.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ _, err := parseCIDR(s)
+ return types.Bool(err == nil)
+}
+
+func cidrToIP(arg ref.Val) ref.Val {
+ cidr, ok := arg.(apiservercel.CIDR)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return apiservercel.IP{
+ Addr: cidr.Prefix.Addr(),
+ }
+}
+
+func masked(arg ref.Val) ref.Val {
+ cidr, ok := arg.(apiservercel.CIDR)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ maskedCIDR := cidr.Prefix.Masked()
+ return apiservercel.CIDR{
+ Prefix: maskedCIDR,
+ }
+}
+
+// parseCIDR parses a string into an CIDR.
+// We use this function to parse CIDR notation in the CEL library
+// so that we can share the common logic of rejecting strings
+// that IPv4-mapped IPv6 addresses or contain non-zero bits after the mask.
+func parseCIDR(raw string) (netip.Prefix, error) {
+ net, err := netip.ParsePrefix(raw)
+ if err != nil {
+ return netip.Prefix{}, fmt.Errorf("network address parse error during conversion from string: %v", err)
+ }
+
+ if net.Addr().Is4In6() {
+ return netip.Prefix{}, fmt.Errorf("IPv4-mapped IPv6 address %q is not allowed", raw)
+ }
+
+ return net, nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/library/cost.go b/vendor/k8s.io/apiserver/pkg/cel/library/cost.go
index d18c138ec8f..b71686309ab 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/library/cost.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/library/cost.go
@@ -17,16 +17,37 @@ limitations under the License.
package library
import (
+ "fmt"
"math"
"github.com/google/cel-go/checker"
"github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+
+ "k8s.io/apiserver/pkg/cel"
)
+// panicOnUnknown makes cost estimate functions panic on unrecognized functions.
+// This is only set to true for unit tests.
+var panicOnUnknown = false
+
+// builtInFunctions is a list of functions used in cost tests that are not handled by CostEstimator.
+var knownUnhandledFunctions = map[string]bool{
+ "uint": true,
+ "duration": true,
+ "bytes": true,
+ "timestamp": true,
+ "value": true,
+ "_==_": true,
+ "_&&_": true,
+ "_>_": true,
+ "!_": true,
+ "strings.quote": true,
+}
+
// CostEstimator implements CEL's interpretable.ActualCostEstimator and checker.CostEstimator.
type CostEstimator struct {
// SizeEstimator provides a CostEstimator.EstimateSize that this CostEstimator will delegate size estimation
@@ -34,6 +55,25 @@ type CostEstimator struct {
SizeEstimator checker.CostEstimator
}
+const (
+ // shortest repeatable selector requirement that allocates a values slice is 2 characters: k,
+ selectorLengthToRequirementCount = float64(.5)
+ // the expensive parts to represent each requirement are a struct and a values slice
+ costPerRequirement = float64(common.ListCreateBaseCost + common.StructCreateBaseCost)
+)
+
+// a selector consists of a list of requirements held in a slice
+var baseSelectorCost = checker.CostEstimate{Min: common.ListCreateBaseCost, Max: common.ListCreateBaseCost}
+
+func selectorCostEstimate(selectorLength checker.SizeEstimate) checker.CostEstimate {
+ parseCost := selectorLength.MultiplyByCostFactor(common.StringTraversalCostFactor)
+
+ requirementCount := selectorLength.MultiplyByCostFactor(selectorLengthToRequirementCount)
+ requirementCost := requirementCount.MultiplyByCostFactor(costPerRequirement)
+
+ return baseSelectorCost.Add(parseCost).Add(requirementCost)
+}
+
func (l *CostEstimator) CallCost(function, overloadId string, args []ref.Val, result ref.Val) *uint64 {
switch function {
case "check":
@@ -45,6 +85,13 @@ func (l *CostEstimator) CallCost(function, overloadId string, args []ref.Val, re
// All authorization builder and accessor functions have a nominal cost
cost := uint64(1)
return &cost
+ case "fieldSelector", "labelSelector":
+ // field and label selector parse is a string parse into a structured set of requirements
+ if len(args) >= 2 {
+ selectorLength := actualSize(args[1])
+ cost := selectorCostEstimate(checker.SizeEstimate{Min: selectorLength, Max: selectorLength})
+ return &cost.Max
+ }
case "isSorted", "sum", "max", "min", "indexOf", "lastIndexOf":
var cost uint64
if len(args) > 0 {
@@ -79,6 +126,118 @@ func (l *CostEstimator) CallCost(function, overloadId string, args []ref.Val, re
cost := strCost * regexCost
return &cost
}
+ case "cidr", "isIP", "isCIDR":
+ // IP and CIDR parsing is a string traversal.
+ if len(args) >= 1 {
+ cost := uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor))
+ return &cost
+ }
+ case "ip":
+ // IP and CIDR parsing is a string traversal.
+ if len(args) >= 1 {
+ if overloadId == "cidr_ip" {
+ // The IP member of the CIDR object is just accessing a field.
+ // Nominal cost.
+ cost := uint64(1)
+ return &cost
+ }
+
+ cost := uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor))
+ return &cost
+ }
+ case "ip.isCanonical":
+ if len(args) >= 1 {
+ // We have to parse the string and then compare the parsed string to the original string.
+ // So we double the cost of parsing the string.
+ cost := uint64(math.Ceil(float64(actualSize(args[0])) * 2 * common.StringTraversalCostFactor))
+ return &cost
+ }
+ case "masked", "prefixLength", "family", "isUnspecified", "isLoopback", "isLinkLocalMulticast", "isLinkLocalUnicast", "isGlobalUnicast":
+ // IP and CIDR accessors are nominal cost.
+ cost := uint64(1)
+ return &cost
+ case "containsIP":
+ if len(args) >= 2 {
+ cidrSize := actualSize(args[0])
+ otherSize := actualSize(args[1])
+
+ // This is the base cost of comparing two byte lists.
+ // We will compare only up to the length of the CIDR prefix in bytes, so use the cidrSize twice.
+ cost := uint64(math.Ceil(float64(cidrSize+cidrSize) * common.StringTraversalCostFactor))
+
+ if overloadId == "cidr_contains_ip_string" {
+ // If we are comparing a string, we must parse the string to into the right type, so add the cost of traversing the string again.
+ cost += uint64(math.Ceil(float64(otherSize) * common.StringTraversalCostFactor))
+
+ }
+
+ return &cost
+ }
+ case "containsCIDR":
+ if len(args) >= 2 {
+ cidrSize := actualSize(args[0])
+ otherSize := actualSize(args[1])
+
+ // This is the base cost of comparing two byte lists.
+ // We will compare only up to the length of the CIDR prefix in bytes, so use the cidrSize twice.
+ cost := uint64(math.Ceil(float64(cidrSize+cidrSize) * common.StringTraversalCostFactor))
+
+ // As we are comparing if a CIDR is within another CIDR, we first mask the base CIDR and
+ // also compare the CIDR bits.
+ // This has an additional cost of the length of the IP being traversed again, plus 1.
+ cost += uint64(math.Ceil(float64(cidrSize)*common.StringTraversalCostFactor)) + 1
+
+ if overloadId == "cidr_contains_cidr_string" {
+ // If we are comparing a string, we must parse the string to into the right type, so add the cost of traversing the string again.
+ cost += uint64(math.Ceil(float64(otherSize) * common.StringTraversalCostFactor))
+ }
+
+ return &cost
+ }
+ case "quantity", "isQuantity":
+ if len(args) >= 1 {
+ cost := uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor))
+ return &cost
+ }
+ case "validate":
+ if len(args) >= 2 {
+ format, isFormat := args[0].Value().(*cel.Format)
+ if isFormat {
+ strSize := actualSize(args[1])
+
+ // Dont have access to underlying regex, estimate a long regexp
+ regexSize := format.MaxRegexSize
+
+ // Copied from CEL implementation for regex cost
+ //
+ // https://swtch.com/~rsc/regexp/regexp1.html applies to RE2 implementation supported by CEL
+ // Add one to string length for purposes of cost calculation to prevent product of string and regex to be 0
+ // in case where string is empty but regex is still expensive.
+ strCost := uint64(math.Ceil((1.0 + float64(strSize)) * common.StringTraversalCostFactor))
+ // We don't know how many expressions are in the regex, just the string length (a huge
+ // improvement here would be to somehow get a count the number of expressions in the regex or
+ // how many states are in the regex state machine and use that to measure regex cost).
+ // For now, we're making a guess that each expression in a regex is typically at least 4 chars
+ // in length.
+ regexCost := uint64(math.Ceil(float64(regexSize) * common.RegexStringLengthCostFactor))
+ cost := strCost * regexCost
+ return &cost
+ }
+ }
+ case "format.named":
+ // Simply dictionary lookup
+ cost := uint64(1)
+ return &cost
+ case "sign", "asInteger", "isInteger", "asApproximateFloat", "isGreaterThan", "isLessThan", "compareTo", "add", "sub":
+ cost := uint64(1)
+ return &cost
+ case "getScheme", "getHostname", "getHost", "getPort", "getEscapedPath", "getQuery":
+ // url accessors
+ cost := uint64(1)
+ return &cost
+ }
+ if panicOnUnknown && !knownUnhandledFunctions[function] {
+ panic(fmt.Errorf("CallCost: unhandled function %q or args %v", function, args))
}
return nil
}
@@ -94,6 +253,11 @@ func (l *CostEstimator) EstimateCallCost(function, overloadId string, target *ch
case "serviceAccount", "path", "group", "resource", "subresource", "namespace", "name", "allowed", "reason", "error", "errored":
// All authorization builder and accessor functions have a nominal cost
return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: 1, Max: 1}}
+ case "fieldSelector", "labelSelector":
+ // field and label selector parse is a string parse into a structured set of requirements
+ if len(args) == 1 {
+ return &checker.CallEstimate{CostEstimate: selectorCostEstimate(l.sizeEstimate(args[0]))}
+ }
case "isSorted", "sum", "max", "min", "indexOf", "lastIndexOf":
if target != nil {
// Charge 1 cost for comparing each element in the list
@@ -179,8 +343,10 @@ func (l *CostEstimator) EstimateCallCost(function, overloadId string, target *ch
// Worst case size is where is that a separator of "" is used, and each char is returned as a list element.
max := sz.Max
if len(args) > 1 {
- if c := args[1].Expr().GetConstExpr(); c != nil {
- max = uint64(c.GetInt64Value())
+ if v := args[1].Expr().AsLiteral(); v != nil {
+ if i, ok := v.Value().(int64); ok {
+ max = uint64(i)
+ }
}
}
// Cost is the traversal plus the construction of the result.
@@ -225,6 +391,93 @@ func (l *CostEstimator) EstimateCallCost(function, overloadId string, target *ch
// worst case size of result is that every char is returned as separate find result.
return &checker.CallEstimate{CostEstimate: strCost.Multiply(regexCost), ResultSize: &checker.SizeEstimate{Min: 0, Max: sz.Max}}
}
+ case "cidr", "isIP", "isCIDR":
+ if target != nil {
+ sz := l.sizeEstimate(args[0])
+ return &checker.CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor)}
+ }
+ case "ip":
+ if target != nil && len(args) >= 1 {
+ if overloadId == "cidr_ip" {
+ // The IP member of the CIDR object is just accessing a field.
+ // Nominal cost.
+ return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: 1, Max: 1}}
+ }
+
+ sz := l.sizeEstimate(args[0])
+ return &checker.CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor)}
+ } else if target != nil {
+ // The IP member of a CIDR is a just accessing a field, nominal cost.
+ return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: 1, Max: 1}}
+ }
+ case "ip.isCanonical":
+ if target != nil && len(args) >= 1 {
+ sz := l.sizeEstimate(args[0])
+ // We have to parse the string and then compare the parsed string to the original string.
+ // So we double the cost of parsing the string.
+ return &checker.CallEstimate{CostEstimate: sz.MultiplyByCostFactor(2 * common.StringTraversalCostFactor)}
+ }
+ case "masked", "prefixLength", "family", "isUnspecified", "isLoopback", "isLinkLocalMulticast", "isLinkLocalUnicast", "isGlobalUnicast":
+ // IP and CIDR accessors are nominal cost.
+ return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: 1, Max: 1}}
+ case "containsIP":
+ if target != nil && len(args) >= 1 {
+ // The base cost of the function is the cost of comparing two byte lists.
+ // The byte lists will be either ipv4 or ipv6 so will have a length of 4, or 16 bytes.
+ sz := checker.SizeEstimate{Min: 4, Max: 16}
+
+ // We have to compare the two strings to determine if the CIDR/IP is in the other CIDR.
+ ipCompCost := sz.Add(sz).MultiplyByCostFactor(common.StringTraversalCostFactor)
+
+ if overloadId == "cidr_contains_ip_string" {
+ // If we are comparing a string, we must parse the string to into the right type, so add the cost of traversing the string again.
+ ipCompCost = ipCompCost.Add(checker.CostEstimate(l.sizeEstimate(args[0])).MultiplyByCostFactor(common.StringTraversalCostFactor))
+ }
+
+ return &checker.CallEstimate{CostEstimate: ipCompCost}
+ }
+ case "containsCIDR":
+ if target != nil && len(args) >= 1 {
+ // The base cost of the function is the cost of comparing two byte lists.
+ // The byte lists will be either ipv4 or ipv6 so will have a length of 4, or 16 bytes.
+ sz := checker.SizeEstimate{Min: 4, Max: 16}
+
+ // We have to compare the two strings to determine if the CIDR/IP is in the other CIDR.
+ ipCompCost := sz.Add(sz).MultiplyByCostFactor(common.StringTraversalCostFactor)
+
+ // As we are comparing if a CIDR is within another CIDR, we first mask the base CIDR and
+ // also compare the CIDR bits.
+ // This has an additional cost of the length of the IP being traversed again, plus 1.
+ ipCompCost = ipCompCost.Add(sz.MultiplyByCostFactor(common.StringTraversalCostFactor))
+ ipCompCost = ipCompCost.Add(checker.CostEstimate{Min: 1, Max: 1})
+
+ if overloadId == "cidr_contains_cidr_string" {
+ // If we are comparing a string, we must parse the string to into the right type, so add the cost of traversing the string again.
+ ipCompCost = ipCompCost.Add(checker.CostEstimate(l.sizeEstimate(args[0])).MultiplyByCostFactor(common.StringTraversalCostFactor))
+ }
+
+ return &checker.CallEstimate{CostEstimate: ipCompCost}
+ }
+ case "quantity", "isQuantity":
+ if target != nil {
+ sz := l.sizeEstimate(args[0])
+ return &checker.CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor)}
+ }
+ case "validate":
+ if target != nil {
+ sz := l.sizeEstimate(args[0])
+ return &checker.CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).MultiplyByCostFactor(cel.MaxNameFormatRegexSize * common.RegexStringLengthCostFactor)}
+ }
+ case "format.named":
+ return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: 1, Max: 1}}
+ case "sign", "asInteger", "isInteger", "asApproximateFloat", "isGreaterThan", "isLessThan", "compareTo", "add", "sub":
+ return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: 1, Max: 1}}
+ case "getScheme", "getHostname", "getHost", "getPort", "getEscapedPath", "getQuery":
+ // url accessors
+ return &checker.CallEstimate{CostEstimate: checker.CostEstimate{Min: 1, Max: 1}}
+ }
+ if panicOnUnknown && !knownUnhandledFunctions[function] {
+ panic(fmt.Errorf("EstimateCallCost: unhandled function %q, target %v, args %v", function, target, args))
}
return nil
}
@@ -233,6 +486,10 @@ func actualSize(value ref.Val) uint64 {
if sz, ok := value.(traits.Sizer); ok {
return uint64(sz.Size().(types.Int))
}
+ if panicOnUnknown {
+ // debug.PrintStack()
+ panic(fmt.Errorf("actualSize: non-sizer type %T", value))
+ }
return 1
}
@@ -275,7 +532,7 @@ func (l *CostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstim
type itemsNode struct {
path []string
t *types.Type
- expr *exprpb.Expr
+ expr ast.Expr
}
func (i *itemsNode) Path() []string {
@@ -286,7 +543,7 @@ func (i *itemsNode) Type() *types.Type {
return i.t
}
-func (i *itemsNode) Expr() *exprpb.Expr {
+func (i *itemsNode) Expr() ast.Expr {
return i.expr
}
@@ -294,6 +551,8 @@ func (i *itemsNode) ComputedSize() *checker.SizeEstimate {
return nil
}
+var _ checker.AstNode = (*itemsNode)(nil)
+
// traversalCost computes the cost of traversing a ref.Val as a data tree.
func traversalCost(v ref.Val) uint64 {
// TODO: This could potentially be optimized by sampling maps and lists instead of traversing.
diff --git a/vendor/k8s.io/apiserver/pkg/cel/library/format.go b/vendor/k8s.io/apiserver/pkg/cel/library/format.go
new file mode 100644
index 00000000000..c051f33c006
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/cel/library/format.go
@@ -0,0 +1,270 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package library
+
+import (
+ "fmt"
+ "net/url"
+
+ "github.com/asaskevich/govalidator"
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+ apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation"
+ "k8s.io/apimachinery/pkg/util/validation"
+ apiservercel "k8s.io/apiserver/pkg/cel"
+ "k8s.io/kube-openapi/pkg/validation/strfmt"
+)
+
+// Format provides a CEL library exposing common named Kubernetes string
+// validations. Can be used in CRD ValidationRules messageExpression.
+//
+// Example:
+//
+// rule: format.dns1123label.validate(object.metadata.name).hasValue()
+// messageExpression: format.dns1123label.validate(object.metadata.name).value().join("\n")
+//
+// format.named(name: string) -> ?Format
+//
+// Returns the Format with the given name, if it exists. Otherwise, optional.none
+// Allowed names are:
+// - `dns1123Label`
+// - `dns1123Subdomain`
+// - `dns1035Label`
+// - `qualifiedName`
+// - `dns1123LabelPrefix`
+// - `dns1123SubdomainPrefix`
+// - `dns1035LabelPrefix`
+// - `labelValue`
+// - `uri`
+// - `uuid`
+// - `byte`
+// - `date`
+// - `datetime`
+//
+// format.() -> Format
+//
+// Convenience functions for all the named formats are also available
+//
+// Examples:
+// format.dns1123Label().validate("my-label-name")
+// format.dns1123Subdomain().validate("apiextensions.k8s.io")
+// format.dns1035Label().validate("my-label-name")
+// format.qualifiedName().validate("apiextensions.k8s.io/v1beta1")
+// format.dns1123LabelPrefix().validate("my-label-prefix-")
+// format.dns1123SubdomainPrefix().validate("mysubdomain.prefix.-")
+// format.dns1035LabelPrefix().validate("my-label-prefix-")
+// format.uri().validate("http://example.com")
+// Uses same pattern as isURL, but returns an error
+// format.uuid().validate("123e4567-e89b-12d3-a456-426614174000")
+// format.byte().validate("aGVsbG8=")
+// format.date().validate("2021-01-01")
+// format.datetime().validate("2021-01-01T00:00:00Z")
+//
+
+// .validate(str: string) -> ?list
+//
+// Validates the given string against the given format. Returns optional.none
+// if the string is valid, otherwise a list of validation error strings.
+func Format() cel.EnvOption {
+ return cel.Lib(formatLib)
+}
+
+var formatLib = &format{}
+
+type format struct{}
+
+func (*format) LibraryName() string {
+ return "format"
+}
+
+func ZeroArgumentFunctionBinding(binding func() ref.Val) decls.OverloadOpt {
+ return func(o *decls.OverloadDecl) (*decls.OverloadDecl, error) {
+ wrapped, err := decls.FunctionBinding(func(values ...ref.Val) ref.Val { return binding() })(o)
+ if err != nil {
+ return nil, err
+ }
+ if len(wrapped.ArgTypes()) != 0 {
+ return nil, fmt.Errorf("function binding must have 0 arguments")
+ }
+ return o, nil
+ }
+}
+
+func (*format) CompileOptions() []cel.EnvOption {
+ options := make([]cel.EnvOption, 0, len(formatLibraryDecls))
+ for name, overloads := range formatLibraryDecls {
+ options = append(options, cel.Function(name, overloads...))
+ }
+ for name, constantValue := range ConstantFormats {
+ prefixedName := "format." + name
+ options = append(options, cel.Function(prefixedName, cel.Overload(prefixedName, []*cel.Type{}, apiservercel.FormatType, ZeroArgumentFunctionBinding(func() ref.Val {
+ return constantValue
+ }))))
+ }
+ return options
+}
+
+func (*format) ProgramOptions() []cel.ProgramOption {
+ return []cel.ProgramOption{}
+}
+
+var ConstantFormats map[string]*apiservercel.Format = map[string]*apiservercel.Format{
+ "dns1123Label": {
+ Name: "DNS1123Label",
+ ValidateFunc: func(s string) []string { return apimachineryvalidation.NameIsDNSLabel(s, false) },
+ MaxRegexSize: 30,
+ },
+ "dns1123Subdomain": {
+ Name: "DNS1123Subdomain",
+ ValidateFunc: func(s string) []string { return apimachineryvalidation.NameIsDNSSubdomain(s, false) },
+ MaxRegexSize: 60,
+ },
+ "dns1035Label": {
+ Name: "DNS1035Label",
+ ValidateFunc: func(s string) []string { return apimachineryvalidation.NameIsDNS1035Label(s, false) },
+ MaxRegexSize: 30,
+ },
+ "qualifiedName": {
+ Name: "QualifiedName",
+ ValidateFunc: validation.IsQualifiedName,
+ MaxRegexSize: 60, // uses subdomain regex
+ },
+
+ "dns1123LabelPrefix": {
+ Name: "DNS1123LabelPrefix",
+ ValidateFunc: func(s string) []string { return apimachineryvalidation.NameIsDNSLabel(s, true) },
+ MaxRegexSize: 30,
+ },
+ "dns1123SubdomainPrefix": {
+ Name: "DNS1123SubdomainPrefix",
+ ValidateFunc: func(s string) []string { return apimachineryvalidation.NameIsDNSSubdomain(s, true) },
+ MaxRegexSize: 60,
+ },
+ "dns1035LabelPrefix": {
+ Name: "DNS1035LabelPrefix",
+ ValidateFunc: func(s string) []string { return apimachineryvalidation.NameIsDNS1035Label(s, true) },
+ MaxRegexSize: 30,
+ },
+ "labelValue": {
+ Name: "LabelValue",
+ ValidateFunc: validation.IsValidLabelValue,
+ MaxRegexSize: 40,
+ },
+
+ // CRD formats
+ // Implementations sourced from strfmt, which kube-openapi uses as its
+ // format library. There are other CRD formats supported, but they are
+ // covered by other portions of the CEL library (like IP/CIDR), or their
+ // use is discouraged (like bsonobjectid, email, etc)
+ "uri": {
+ Name: "URI",
+ ValidateFunc: func(s string) []string {
+ // Directly call ParseRequestURI since we can get a better error message
+ _, err := url.ParseRequestURI(s)
+ if err != nil {
+ return []string{err.Error()}
+ }
+ return nil
+ },
+ // Use govalidator url regex to estimate, since ParseRequestURI
+ // doesnt use regex
+ MaxRegexSize: len(govalidator.URL),
+ },
+ "uuid": {
+ Name: "uuid",
+ ValidateFunc: func(s string) []string {
+ if !strfmt.Default.Validates("uuid", s) {
+ return []string{"does not match the UUID format"}
+ }
+ return nil
+ },
+ MaxRegexSize: len(strfmt.UUIDPattern),
+ },
+ "byte": {
+ Name: "byte",
+ ValidateFunc: func(s string) []string {
+ if !strfmt.Default.Validates("byte", s) {
+ return []string{"invalid base64"}
+ }
+ return nil
+ },
+ MaxRegexSize: len(govalidator.Base64),
+ },
+ "date": {
+ Name: "date",
+ ValidateFunc: func(s string) []string {
+ if !strfmt.Default.Validates("date", s) {
+ return []string{"invalid date"}
+ }
+ return nil
+ },
+ // Estimated regex size for RFC3339FullDate which is
+ // a date format. Assume a date-time pattern is longer
+ // so use that to conservatively estimate this
+ MaxRegexSize: len(strfmt.DateTimePattern),
+ },
+ "datetime": {
+ Name: "datetime",
+ ValidateFunc: func(s string) []string {
+ if !strfmt.Default.Validates("datetime", s) {
+ return []string{"invalid datetime"}
+ }
+ return nil
+ },
+ MaxRegexSize: len(strfmt.DateTimePattern),
+ },
+}
+
+var formatLibraryDecls = map[string][]cel.FunctionOpt{
+ "validate": {
+ cel.MemberOverload("format-validate", []*cel.Type{apiservercel.FormatType, cel.StringType}, cel.OptionalType(cel.ListType(cel.StringType)), cel.BinaryBinding(formatValidate)),
+ },
+ "format.named": {
+ cel.Overload("format-named", []*cel.Type{cel.StringType}, cel.OptionalType(apiservercel.FormatType), cel.UnaryBinding(func(name ref.Val) ref.Val {
+ nameString, ok := name.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(name)
+ }
+
+ f, ok := ConstantFormats[nameString]
+ if !ok {
+ return types.OptionalNone
+ }
+ return types.OptionalOf(f)
+ })),
+ },
+}
+
+func formatValidate(arg1, arg2 ref.Val) ref.Val {
+ f, ok := arg1.Value().(*apiservercel.Format)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg1)
+ }
+
+ str, ok := arg2.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg2)
+ }
+
+ res := f.ValidateFunc(str)
+ if len(res) == 0 {
+ return types.OptionalNone
+ }
+ return types.OptionalOf(types.NewStringList(types.DefaultTypeAdapter, res))
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/library/ip.go b/vendor/k8s.io/apiserver/pkg/cel/library/ip.go
new file mode 100644
index 00000000000..cdfeb1daf2b
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/cel/library/ip.go
@@ -0,0 +1,329 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package library
+
+import (
+ "fmt"
+ "net/netip"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+
+ apiservercel "k8s.io/apiserver/pkg/cel"
+)
+
+// IP provides a CEL function library extension of IP address parsing functions.
+//
+// ip
+//
+// Converts a string to an IP address or results in an error if the string is not a valid IP address.
+// The IP address must be an IPv4 or IPv6 address.
+// IPv4-mapped IPv6 addresses (e.g. ::ffff:1.2.3.4) are not allowed.
+// IP addresses with zones (e.g. fe80::1%eth0) are not allowed.
+// Leading zeros in IPv4 address octets are not allowed.
+//
+// ip()
+//
+// Examples:
+//
+// ip('127.0.0.1') // returns an IPv4 address
+// ip('::1') // returns an IPv6 address
+// ip('127.0.0.256') // error
+// ip(':::1') // error
+//
+// isIP
+//
+// Returns true if a string is a valid IP address.
+// The IP address must be an IPv4 or IPv6 address.
+// IPv4-mapped IPv6 addresses (e.g. ::ffff:1.2.3.4) are not allowed.
+// IP addresses with zones (e.g. fe80::1%eth0) are not allowed.
+// Leading zeros in IPv4 address octets are not allowed.
+//
+// isIP()
+//
+// Examples:
+//
+// isIP('127.0.0.1') // returns true
+// isIP('::1') // returns true
+// isIP('127.0.0.256') // returns false
+// isIP(':::1') // returns false
+//
+// ip.isCanonical
+//
+// Returns true if the IP address is in its canonical form.
+// There is exactly one canonical form for every IP address, so fields containing
+// IPs in canonical form can just be treated as strings when checking for equality or uniqueness.
+//
+// ip.isCanonical()
+//
+// Examples:
+//
+// ip.isCanonical('127.0.0.1') // returns true; all valid IPv4 addresses are canonical
+// ip.isCanonical('2001:db8::abcd') // returns true
+// ip.isCanonical('2001:DB8::ABCD') // returns false
+// ip.isCanonical('2001:db8::0:0:0:abcd') // returns false
+//
+// family / isUnspecified / isLoopback / isLinkLocalMulticast / isLinkLocalUnicast / isGlobalUnicast
+//
+// - family: returns the IP addresses' family (IPv4 or IPv6) as an integer, either '4' or '6'.
+//
+// - isUnspecified: returns true if the IP address is the unspecified address.
+// Either the IPv4 address "0.0.0.0" or the IPv6 address "::".
+//
+// - isLoopback: returns true if the IP address is the loopback address.
+// Either an IPv4 address with a value of 127.x.x.x or an IPv6 address with a value of ::1.
+//
+// - isLinkLocalMulticast: returns true if the IP address is a link-local multicast address.
+// Either an IPv4 address with a value of 224.0.0.x or an IPv6 address in the network ff00::/8.
+//
+// - isLinkLocalUnicast: returns true if the IP address is a link-local unicast address.
+// Either an IPv4 address with a value of 169.254.x.x or an IPv6 address in the network fe80::/10.
+//
+// - isGlobalUnicast: returns true if the IP address is a global unicast address.
+// Either an IPv4 address that is not zero or 255.255.255.255 or an IPv6 address that is not a link-local unicast, loopback or multicast address.
+//
+// Examples:
+//
+// ip('127.0.0.1').family() // returns '4”
+// ip('::1').family() // returns '6'
+// ip('127.0.0.1').family() == 4 // returns true
+// ip('::1').family() == 6 // returns true
+// ip('0.0.0.0').isUnspecified() // returns true
+// ip('127.0.0.1').isUnspecified() // returns false
+// ip('::').isUnspecified() // returns true
+// ip('::1').isUnspecified() // returns false
+// ip('127.0.0.1').isLoopback() // returns true
+// ip('192.168.0.1').isLoopback() // returns false
+// ip('::1').isLoopback() // returns true
+// ip('2001:db8::abcd').isLoopback() // returns false
+// ip('224.0.0.1').isLinkLocalMulticast() // returns true
+// ip('224.0.1.1').isLinkLocalMulticast() // returns false
+// ip('ff02::1').isLinkLocalMulticast() // returns true
+// ip('fd00::1').isLinkLocalMulticast() // returns false
+// ip('169.254.169.254').isLinkLocalUnicast() // returns true
+// ip('192.168.0.1').isLinkLocalUnicast() // returns false
+// ip('fe80::1').isLinkLocalUnicast() // returns true
+// ip('fd80::1').isLinkLocalUnicast() // returns false
+// ip('192.168.0.1').isGlobalUnicast() // returns true
+// ip('255.255.255.255').isGlobalUnicast() // returns false
+// ip('2001:db8::abcd').isGlobalUnicast() // returns true
+// ip('ff00::1').isGlobalUnicast() // returns false
+func IP() cel.EnvOption {
+ return cel.Lib(ipLib)
+}
+
+var ipLib = &ip{}
+
+type ip struct{}
+
+func (*ip) LibraryName() string {
+ return "net.ip"
+}
+
+var ipLibraryDecls = map[string][]cel.FunctionOpt{
+ "ip": {
+ cel.Overload("string_to_ip", []*cel.Type{cel.StringType}, apiservercel.IPType,
+ cel.UnaryBinding(stringToIP)),
+ },
+ "family": {
+ cel.MemberOverload("ip_family", []*cel.Type{apiservercel.IPType}, cel.IntType,
+ cel.UnaryBinding(family)),
+ },
+ "ip.isCanonical": {
+ cel.Overload("ip_is_canonical", []*cel.Type{cel.StringType}, cel.BoolType,
+ cel.UnaryBinding(ipIsCanonical)),
+ },
+ "isUnspecified": {
+ cel.MemberOverload("ip_is_unspecified", []*cel.Type{apiservercel.IPType}, cel.BoolType,
+ cel.UnaryBinding(isUnspecified)),
+ },
+ "isLoopback": {
+ cel.MemberOverload("ip_is_loopback", []*cel.Type{apiservercel.IPType}, cel.BoolType,
+ cel.UnaryBinding(isLoopback)),
+ },
+ "isLinkLocalMulticast": {
+ cel.MemberOverload("ip_is_link_local_multicast", []*cel.Type{apiservercel.IPType}, cel.BoolType,
+ cel.UnaryBinding(isLinkLocalMulticast)),
+ },
+ "isLinkLocalUnicast": {
+ cel.MemberOverload("ip_is_link_local_unicast", []*cel.Type{apiservercel.IPType}, cel.BoolType,
+ cel.UnaryBinding(isLinkLocalUnicast)),
+ },
+ "isGlobalUnicast": {
+ cel.MemberOverload("ip_is_global_unicast", []*cel.Type{apiservercel.IPType}, cel.BoolType,
+ cel.UnaryBinding(isGlobalUnicast)),
+ },
+ "isIP": {
+ cel.Overload("is_ip", []*cel.Type{cel.StringType}, cel.BoolType,
+ cel.UnaryBinding(isIP)),
+ },
+ "string": {
+ cel.Overload("ip_to_string", []*cel.Type{apiservercel.IPType}, cel.StringType,
+ cel.UnaryBinding(ipToString)),
+ },
+}
+
+func (*ip) CompileOptions() []cel.EnvOption {
+ options := []cel.EnvOption{cel.Types(apiservercel.IPType),
+ cel.Variable(apiservercel.IPType.TypeName(), types.NewTypeTypeWithParam(apiservercel.IPType)),
+ }
+ for name, overloads := range ipLibraryDecls {
+ options = append(options, cel.Function(name, overloads...))
+ }
+ return options
+}
+
+func (*ip) ProgramOptions() []cel.ProgramOption {
+ return []cel.ProgramOption{}
+}
+
+func stringToIP(arg ref.Val) ref.Val {
+ s, ok := arg.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ addr, err := parseIPAddr(s)
+ if err != nil {
+ // Don't add context, we control the error message already.
+ return types.NewErr("%v", err)
+ }
+
+ return apiservercel.IP{
+ Addr: addr,
+ }
+}
+
+func ipToString(arg ref.Val) ref.Val {
+ ip, ok := arg.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.String(ip.Addr.String())
+}
+
+func family(arg ref.Val) ref.Val {
+ ip, ok := arg.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ switch {
+ case ip.Addr.Is4():
+ return types.Int(4)
+ case ip.Addr.Is6():
+ return types.Int(6)
+ default:
+ return types.NewErr("IP address %q is not an IPv4 or IPv6 address", ip.Addr.String())
+ }
+}
+
+func ipIsCanonical(arg ref.Val) ref.Val {
+ s, ok := arg.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ addr, err := parseIPAddr(s)
+ if err != nil {
+ // Don't add context, we control the error message already.
+ return types.NewErr("%v", err)
+ }
+
+ // Addr.String() always returns the canonical form of the IP address.
+ // Therefore comparing this with the original string representation
+ // will tell us if the IP address is in its canonical form.
+ return types.Bool(addr.String() == s)
+}
+
+func isIP(arg ref.Val) ref.Val {
+ s, ok := arg.Value().(string)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ _, err := parseIPAddr(s)
+ return types.Bool(err == nil)
+}
+
+func isUnspecified(arg ref.Val) ref.Val {
+ ip, ok := arg.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.Bool(ip.Addr.IsUnspecified())
+}
+
+func isLoopback(arg ref.Val) ref.Val {
+ ip, ok := arg.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.Bool(ip.Addr.IsLoopback())
+}
+
+func isLinkLocalMulticast(arg ref.Val) ref.Val {
+ ip, ok := arg.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.Bool(ip.Addr.IsLinkLocalMulticast())
+}
+
+func isLinkLocalUnicast(arg ref.Val) ref.Val {
+ ip, ok := arg.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.Bool(ip.Addr.IsLinkLocalUnicast())
+}
+
+func isGlobalUnicast(arg ref.Val) ref.Val {
+ ip, ok := arg.(apiservercel.IP)
+ if !ok {
+ return types.MaybeNoSuchOverloadErr(arg)
+ }
+
+ return types.Bool(ip.Addr.IsGlobalUnicast())
+}
+
+// parseIPAddr parses a string into an IP address.
+// We use this function to parse IP addresses in the CEL library
+// so that we can share the common logic of rejecting IP addresses
+// that contain zones or are IPv4-mapped IPv6 addresses.
+func parseIPAddr(raw string) (netip.Addr, error) {
+ addr, err := netip.ParseAddr(raw)
+ if err != nil {
+ return netip.Addr{}, fmt.Errorf("IP Address %q parse error during conversion from string: %v", raw, err)
+ }
+
+ if addr.Zone() != "" {
+ return netip.Addr{}, fmt.Errorf("IP address %q with zone value is not allowed", raw)
+ }
+
+ if addr.Is4In6() {
+ return netip.Addr{}, fmt.Errorf("IPv4-mapped IPv6 address %q is not allowed", raw)
+ }
+
+ return addr, nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/cel/limits.go b/vendor/k8s.io/apiserver/pkg/cel/limits.go
index 65c6ad5f3a3..66ab4e44c91 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/limits.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/limits.go
@@ -47,4 +47,6 @@ const (
MinBoolSize = 4
// MinNumberSize is the length of literal 0
MinNumberSize = 1
+
+ MaxNameFormatRegexSize = 128
)
diff --git a/vendor/k8s.io/apiserver/pkg/cel/quantity.go b/vendor/k8s.io/apiserver/pkg/cel/quantity.go
index 1057e33fe8e..ce823964369 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/quantity.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/quantity.go
@@ -50,7 +50,7 @@ func (d Quantity) ConvertToNative(typeDesc reflect.Type) (interface{}, error) {
func (d Quantity) ConvertToType(typeVal ref.Type) ref.Val {
switch typeVal {
- case typeValue:
+ case quantityTypeValue:
return d
case types.TypeType:
return quantityTypeValue
diff --git a/vendor/k8s.io/apiserver/pkg/cel/types.go b/vendor/k8s.io/apiserver/pkg/cel/types.go
index bd14e169744..83c90c8916e 100644
--- a/vendor/k8s.io/apiserver/pkg/cel/types.go
+++ b/vendor/k8s.io/apiserver/pkg/cel/types.go
@@ -27,7 +27,7 @@ import (
"github.com/google/cel-go/common/types/traits"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
- "google.golang.org/protobuf/proto"
+ "k8s.io/apimachinery/pkg/api/resource"
)
const (
@@ -348,9 +348,14 @@ func NewDeclTypeProvider(rootTypes ...*DeclType) *DeclTypeProvider {
// DeclTypeProvider extends the CEL ref.TypeProvider interface and provides an Open API Schema-based
// type-system.
type DeclTypeProvider struct {
- registeredTypes map[string]*DeclType
- typeProvider ref.TypeProvider
- typeAdapter ref.TypeAdapter
+ registeredTypes map[string]*DeclType
+ typeProvider types.Provider
+ typeAdapter types.Adapter
+ recognizeKeywordAsFieldName bool
+}
+
+func (rt *DeclTypeProvider) SetRecognizeKeywordAsFieldName(recognize bool) {
+ rt.recognizeKeywordAsFieldName = recognize
}
func (rt *DeclTypeProvider) EnumValue(enumName string) ref.Val {
@@ -365,7 +370,7 @@ func (rt *DeclTypeProvider) FindIdent(identName string) (ref.Val, bool) {
// as well as a custom ref.TypeProvider.
//
// If the DeclTypeProvider value is nil, an empty []cel.EnvOption set is returned.
-func (rt *DeclTypeProvider) EnvOptions(tp ref.TypeProvider) ([]cel.EnvOption, error) {
+func (rt *DeclTypeProvider) EnvOptions(tp types.Provider) ([]cel.EnvOption, error) {
if rt == nil {
return []cel.EnvOption{}, nil
}
@@ -381,54 +386,52 @@ func (rt *DeclTypeProvider) EnvOptions(tp ref.TypeProvider) ([]cel.EnvOption, er
// WithTypeProvider returns a new DeclTypeProvider that sets the given TypeProvider
// If the original DeclTypeProvider is nil, the returned DeclTypeProvider is still nil.
-func (rt *DeclTypeProvider) WithTypeProvider(tp ref.TypeProvider) (*DeclTypeProvider, error) {
+func (rt *DeclTypeProvider) WithTypeProvider(tp types.Provider) (*DeclTypeProvider, error) {
if rt == nil {
return nil, nil
}
- var ta ref.TypeAdapter = types.DefaultTypeAdapter
- tpa, ok := tp.(ref.TypeAdapter)
+ var ta types.Adapter = types.DefaultTypeAdapter
+ tpa, ok := tp.(types.Adapter)
if ok {
ta = tpa
}
rtWithTypes := &DeclTypeProvider{
- typeProvider: tp,
- typeAdapter: ta,
- registeredTypes: rt.registeredTypes,
+ typeProvider: tp,
+ typeAdapter: ta,
+ registeredTypes: rt.registeredTypes,
+ recognizeKeywordAsFieldName: rt.recognizeKeywordAsFieldName,
}
for name, declType := range rt.registeredTypes {
- tpType, found := tp.FindType(name)
- expT, err := declType.ExprType()
- if err != nil {
- return nil, fmt.Errorf("fail to get cel type: %s", err)
- }
- if found && !proto.Equal(tpType, expT) {
+ tpType, found := tp.FindStructType(name)
+ // cast celType to types.type
+
+ expT := declType.CelType()
+ if found && !expT.IsExactType(tpType) {
return nil, fmt.Errorf(
"type %s definition differs between CEL environment and type provider", name)
}
+
}
return rtWithTypes, nil
}
-// FindType attempts to resolve the typeName provided from the rule's rule-schema, or if not
+// FindStructType attempts to resolve the typeName provided from the rule's rule-schema, or if not
// from the embedded ref.TypeProvider.
//
-// FindType overrides the default type-finding behavior of the embedded TypeProvider.
+// FindStructType overrides the default type-finding behavior of the embedded TypeProvider.
//
// Note, when the type name is based on the Open API Schema, the name will reflect the object path
// where the type definition appears.
-func (rt *DeclTypeProvider) FindType(typeName string) (*exprpb.Type, bool) {
+func (rt *DeclTypeProvider) FindStructType(typeName string) (*types.Type, bool) {
if rt == nil {
return nil, false
}
declType, found := rt.findDeclType(typeName)
if found {
- expT, err := declType.ExprType()
- if err != nil {
- return expT, false
- }
+ expT := declType.CelType()
return expT, found
}
- return rt.typeProvider.FindType(typeName)
+ return rt.typeProvider.FindStructType(typeName)
}
// FindDeclType returns the CPT type description which can be mapped to a CEL type.
@@ -439,37 +442,41 @@ func (rt *DeclTypeProvider) FindDeclType(typeName string) (*DeclType, bool) {
return rt.findDeclType(typeName)
}
-// FindFieldType returns a field type given a type name and field name, if found.
+// FindStructFieldNames returns the field names associated with the type, if the type
+// is found.
+func (rt *DeclTypeProvider) FindStructFieldNames(typeName string) ([]string, bool) {
+ return []string{}, false
+}
+
+// FindStructFieldType returns a field type given a type name and field name, if found.
//
// Note, the type name for an Open API Schema type is likely to be its qualified object path.
// If, in the future an object instance rather than a type name were provided, the field
// resolution might more accurately reflect the expected type model. However, in this case
// concessions were made to align with the existing CEL interfaces.
-func (rt *DeclTypeProvider) FindFieldType(typeName, fieldName string) (*ref.FieldType, bool) {
+func (rt *DeclTypeProvider) FindStructFieldType(typeName, fieldName string) (*types.FieldType, bool) {
st, found := rt.findDeclType(typeName)
if !found {
- return rt.typeProvider.FindFieldType(typeName, fieldName)
+ return rt.typeProvider.FindStructFieldType(typeName, fieldName)
}
f, found := st.Fields[fieldName]
+ if rt.recognizeKeywordAsFieldName && !found && celReservedSymbols.Has(fieldName) {
+ f, found = st.Fields["__"+fieldName+"__"]
+ }
+
if found {
ft := f.Type
- expT, err := ft.ExprType()
- if err != nil {
- return nil, false
- }
- return &ref.FieldType{
+ expT := ft.CelType()
+ return &types.FieldType{
Type: expT,
}, true
}
// This could be a dynamic map.
if st.IsMap() {
et := st.ElemType
- expT, err := et.ExprType()
- if err != nil {
- return nil, false
- }
- return &ref.FieldType{
+ expT := et.CelType()
+ return &types.FieldType{
Type: expT,
}, true
}
@@ -576,6 +583,10 @@ var (
// labeled as Timestamp will necessarily have the same MinSerializedSize.
TimestampType = NewSimpleTypeWithMinSize("timestamp", cel.TimestampType, types.Timestamp{Time: time.Time{}}, JSONDateSize)
+ // QuantityDeclType wraps a [QuantityType] and makes it usable with functions that expect
+ // a [DeclType].
+ QuantityDeclType = NewSimpleTypeWithMinSize("quantity", QuantityType, Quantity{Quantity: resource.NewQuantity(0, resource.DecimalSI)}, 8)
+
// UintType is equivalent to the CEL 'uint' type.
UintType = NewSimpleTypeWithMinSize("uint", cel.UintType, types.Uint(0), 1)
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/etag.go b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/etag.go
index 0151f6c1085..09f8a616dda 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/etag.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/etag.go
@@ -24,6 +24,7 @@ import (
"strconv"
"k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/endpoints/handlers/responsewriters"
)
@@ -39,6 +40,7 @@ import (
func ServeHTTPWithETag(
object runtime.Object,
hash string,
+ targetGV schema.GroupVersion,
serializer runtime.NegotiatedSerializer,
w http.ResponseWriter,
req *http.Request,
@@ -64,7 +66,7 @@ func ServeHTTPWithETag(
responsewriters.WriteObjectNegotiated(
serializer,
DiscoveryEndpointRestrictions,
- AggregatedDiscoveryGV,
+ targetGV,
w,
req,
http.StatusOK,
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/fake.go b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/fake.go
index a819fe28fc3..e3c7fcfa7e5 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/fake.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/fake.go
@@ -26,7 +26,7 @@ import (
"github.com/emicklei/go-restful/v3"
"github.com/google/go-cmp/cmp"
- apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
+ apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
)
@@ -122,7 +122,7 @@ func (f *recorderResourceManager) SetGroupVersionPriority(gv metav1.GroupVersion
})
}
-func (f *recorderResourceManager) AddGroupVersion(groupName string, value apidiscoveryv2beta1.APIVersionDiscovery) {
+func (f *recorderResourceManager) AddGroupVersion(groupName string, value apidiscoveryv2.APIVersionDiscovery) {
f.lock.Lock()
defer f.lock.Unlock()
@@ -153,7 +153,7 @@ func (f *recorderResourceManager) RemoveGroupVersion(gv metav1.GroupVersion) {
})
}
-func (f *recorderResourceManager) SetGroups(values []apidiscoveryv2beta1.APIGroupDiscovery) {
+func (f *recorderResourceManager) SetGroups(values []apidiscoveryv2.APIGroupDiscovery) {
f.lock.Lock()
defer f.lock.Unlock()
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler.go b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler.go
index 254a223481d..338be85a287 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler.go
@@ -17,15 +17,22 @@ limitations under the License.
package aggregated
import (
+ "fmt"
"net/http"
"reflect"
"sort"
"sync"
+ apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
+ "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/version"
+ apidiscoveryv2conversion "k8s.io/apiserver/pkg/apis/apidiscovery/v2"
+
"k8s.io/apiserver/pkg/endpoints/handlers/responsewriters"
+
+ "k8s.io/apiserver/pkg/endpoints/handlers/negotiation"
"k8s.io/apiserver/pkg/endpoints/metrics"
"sync/atomic"
@@ -51,7 +58,7 @@ type ResourceManager interface {
// Adds knowledge of the given groupversion to the discovery document
// If it was already being tracked, updates the stored APIVersionDiscovery
// Thread-safe
- AddGroupVersion(groupName string, value apidiscoveryv2beta1.APIVersionDiscovery)
+ AddGroupVersion(groupName string, value apidiscoveryv2.APIVersionDiscovery)
// Sets a priority to be used while sorting a specific group and
// group-version. If two versions report different priorities for
@@ -72,7 +79,7 @@ type ResourceManager interface {
// Resets the manager's known list of group-versions and replaces them
// with the given groups
// Thread-Safe
- SetGroups([]apidiscoveryv2beta1.APIGroupDiscovery)
+ SetGroups([]apidiscoveryv2.APIGroupDiscovery)
// Returns the same resource manager using a different source
// The source is used to decide how to de-duplicate groups.
@@ -87,7 +94,7 @@ type resourceManager struct {
*resourceDiscoveryManager
}
-func (rm resourceManager) AddGroupVersion(groupName string, value apidiscoveryv2beta1.APIVersionDiscovery) {
+func (rm resourceManager) AddGroupVersion(groupName string, value apidiscoveryv2.APIVersionDiscovery) {
rm.resourceDiscoveryManager.AddGroupVersion(rm.source, groupName, value)
}
func (rm resourceManager) SetGroupVersionPriority(gv metav1.GroupVersion, grouppriority, versionpriority int) {
@@ -99,7 +106,7 @@ func (rm resourceManager) RemoveGroup(groupName string) {
func (rm resourceManager) RemoveGroupVersion(gv metav1.GroupVersion) {
rm.resourceDiscoveryManager.RemoveGroupVersion(rm.source, gv)
}
-func (rm resourceManager) SetGroups(groups []apidiscoveryv2beta1.APIGroupDiscovery) {
+func (rm resourceManager) SetGroups(groups []apidiscoveryv2.APIGroupDiscovery) {
rm.resourceDiscoveryManager.SetGroups(rm.source, groups)
}
@@ -133,7 +140,7 @@ type resourceDiscoveryManager struct {
// Writes protected by the lock.
// List of all apigroups & resources indexed by the resource manager
lock sync.RWMutex
- apiGroups map[groupKey]*apidiscoveryv2beta1.APIGroupDiscovery
+ apiGroups map[groupKey]*apidiscoveryv2.APIGroupDiscovery
versionPriorities map[groupVersionKey]priorityInfo
}
@@ -144,8 +151,12 @@ type priorityInfo struct {
func NewResourceManager(path string) ResourceManager {
scheme := runtime.NewScheme()
- codecs := serializer.NewCodecFactory(scheme)
+ utilruntime.Must(apidiscoveryv2.AddToScheme(scheme))
utilruntime.Must(apidiscoveryv2beta1.AddToScheme(scheme))
+ // Register conversion for apidiscovery
+ utilruntime.Must(apidiscoveryv2conversion.RegisterConversions(scheme))
+
+ codecs := serializer.NewCodecFactory(scheme)
rdm := &resourceDiscoveryManager{
serializer: codecs,
versionPriorities: make(map[groupVersionKey]priorityInfo),
@@ -181,7 +192,7 @@ func (rdm *resourceDiscoveryManager) SetGroupVersionPriority(source Source, gv m
rdm.cache.Store(nil)
}
-func (rdm *resourceDiscoveryManager) SetGroups(source Source, groups []apidiscoveryv2beta1.APIGroupDiscovery) {
+func (rdm *resourceDiscoveryManager) SetGroups(source Source, groups []apidiscoveryv2.APIGroupDiscovery) {
rdm.lock.Lock()
defer rdm.lock.Unlock()
@@ -221,17 +232,17 @@ func (rdm *resourceDiscoveryManager) SetGroups(source Source, groups []apidiscov
}
}
-func (rdm *resourceDiscoveryManager) AddGroupVersion(source Source, groupName string, value apidiscoveryv2beta1.APIVersionDiscovery) {
+func (rdm *resourceDiscoveryManager) AddGroupVersion(source Source, groupName string, value apidiscoveryv2.APIVersionDiscovery) {
rdm.lock.Lock()
defer rdm.lock.Unlock()
rdm.addGroupVersionLocked(source, groupName, value)
}
-func (rdm *resourceDiscoveryManager) addGroupVersionLocked(source Source, groupName string, value apidiscoveryv2beta1.APIVersionDiscovery) {
+func (rdm *resourceDiscoveryManager) addGroupVersionLocked(source Source, groupName string, value apidiscoveryv2.APIVersionDiscovery) {
if rdm.apiGroups == nil {
- rdm.apiGroups = make(map[groupKey]*apidiscoveryv2beta1.APIGroupDiscovery)
+ rdm.apiGroups = make(map[groupKey]*apidiscoveryv2.APIGroupDiscovery)
}
key := groupKey{
@@ -264,11 +275,11 @@ func (rdm *resourceDiscoveryManager) addGroupVersionLocked(source Source, groupN
}
} else {
- group := &apidiscoveryv2beta1.APIGroupDiscovery{
+ group := &apidiscoveryv2.APIGroupDiscovery{
ObjectMeta: metav1.ObjectMeta{
Name: groupName,
},
- Versions: []apidiscoveryv2beta1.APIVersionDiscovery{value},
+ Versions: []apidiscoveryv2.APIVersionDiscovery{value},
}
rdm.apiGroups[key] = group
}
@@ -354,12 +365,12 @@ func (rdm *resourceDiscoveryManager) RemoveGroup(source Source, groupName string
// Prepares the api group list for serving by converting them from map into
// list and sorting them according to insertion order
-func (rdm *resourceDiscoveryManager) calculateAPIGroupsLocked() []apidiscoveryv2beta1.APIGroupDiscovery {
+func (rdm *resourceDiscoveryManager) calculateAPIGroupsLocked() []apidiscoveryv2.APIGroupDiscovery {
regenerationCounter.Inc()
// Re-order the apiGroups by their priority.
- groups := []apidiscoveryv2beta1.APIGroupDiscovery{}
+ groups := []apidiscoveryv2.APIGroupDiscovery{}
- groupsToUse := map[string]apidiscoveryv2beta1.APIGroupDiscovery{}
+ groupsToUse := map[string]apidiscoveryv2.APIGroupDiscovery{}
sourcesUsed := map[metav1.GroupVersion]Source{}
for key, group := range rdm.apiGroups {
@@ -475,7 +486,7 @@ func (rdm *resourceDiscoveryManager) fetchFromCache() *cachedGroupList {
if cacheLoad != nil {
return cacheLoad
}
- response := apidiscoveryv2beta1.APIGroupDiscoveryList{
+ response := apidiscoveryv2.APIGroupDiscoveryList{
Items: rdm.calculateAPIGroupsLocked(),
}
etag, err := calculateETag(response)
@@ -492,7 +503,13 @@ func (rdm *resourceDiscoveryManager) fetchFromCache() *cachedGroupList {
}
type cachedGroupList struct {
- cachedResponse apidiscoveryv2beta1.APIGroupDiscoveryList
+ cachedResponse apidiscoveryv2.APIGroupDiscoveryList
+ // etag is calculated based on a SHA hash of only the JSON object.
+ // A response via different Accept encodings (eg: protobuf, json) will
+ // yield the same etag. This is okay because Accept is part of the Vary header.
+ // Per RFC7231 a client must only cache a response etag pair if the header field
+ // matches as indicated by the Vary field. Thus, protobuf and json and other Accept
+ // encodings will not be cached as the same response despite having the same etag.
cachedResponseETag string
}
@@ -505,11 +522,30 @@ func (rdm *resourceDiscoveryManager) serveHTTP(resp http.ResponseWriter, req *ht
response := cache.cachedResponse
etag := cache.cachedResponseETag
+ mediaType, _, err := negotiation.NegotiateOutputMediaType(req, rdm.serializer, DiscoveryEndpointRestrictions)
+ if err != nil {
+ // Should never happen. wrapper.go will only proxy requests to this
+ // handler if the media type passes DiscoveryEndpointRestrictions
+ utilruntime.HandleError(err)
+ resp.WriteHeader(http.StatusInternalServerError)
+ return
+ }
+ var targetGV schema.GroupVersion
+ if mediaType.Convert == nil ||
+ (mediaType.Convert.GroupVersion() != apidiscoveryv2.SchemeGroupVersion &&
+ mediaType.Convert.GroupVersion() != apidiscoveryv2beta1.SchemeGroupVersion) {
+ utilruntime.HandleError(fmt.Errorf("expected aggregated discovery group version, got group: %s, version %s", mediaType.Convert.Group, mediaType.Convert.Version))
+ resp.WriteHeader(http.StatusInternalServerError)
+ return
+ }
+ targetGV = mediaType.Convert.GroupVersion()
+
if len(etag) > 0 {
// Use proper e-tag headers if one is available
ServeHTTPWithETag(
&response,
etag,
+ targetGV,
rdm.serializer,
resp,
req,
@@ -520,7 +556,7 @@ func (rdm *resourceDiscoveryManager) serveHTTP(resp http.ResponseWriter, req *ht
responsewriters.WriteObjectNegotiated(
rdm.serializer,
DiscoveryEndpointRestrictions,
- AggregatedDiscoveryGV,
+ targetGV,
resp,
req,
http.StatusOK,
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/negotiation.go b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/negotiation.go
index 9e58dad8542..9900021a432 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/negotiation.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/negotiation.go
@@ -20,8 +20,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)
-var AggregatedDiscoveryGV = schema.GroupVersion{Group: "apidiscovery.k8s.io", Version: "v2beta1"}
-
// Interface is from "k8s.io/apiserver/pkg/endpoints/handlers/negotiation"
// DiscoveryEndpointRestrictions allows requests to /apis to provide a Content Negotiation GVK for aggregated discovery.
@@ -39,7 +37,7 @@ func (discoveryEndpointRestrictions) AllowsStreamSchema(s string) bool { return
// IsAggregatedDiscoveryGVK checks if a provided GVK is the GVK for serving aggregated discovery.
func IsAggregatedDiscoveryGVK(gvk *schema.GroupVersionKind) bool {
if gvk != nil {
- return gvk.Group == "apidiscovery.k8s.io" && gvk.Version == "v2beta1" && gvk.Kind == "APIGroupDiscoveryList"
+ return gvk.Group == "apidiscovery.k8s.io" && (gvk.Version == "v2beta1" || gvk.Version == "v2") && gvk.Kind == "APIGroupDiscoveryList"
}
return false
}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper.go b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper.go
index 8516c154c88..25fe90fa4ba 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper.go
@@ -19,8 +19,10 @@ package aggregated
import (
"net/http"
+ apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
"k8s.io/apimachinery/pkg/runtime/serializer"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"github.com/emicklei/go-restful/v3"
"k8s.io/apimachinery/pkg/runtime"
@@ -69,10 +71,11 @@ func (wrapped *WrappedHandler) GenerateWebService(prefix string, returnType inte
// WrapAggregatedDiscoveryToHandler wraps a handler with an option to
// emit the aggregated discovery by passing in the aggregated
// discovery type in content negotiation headers: eg: (Accept:
-// application/json;v=v2beta1;g=apidiscovery.k8s.io;as=APIGroupDiscoveryList)
+// application/json;v=v2;g=apidiscovery.k8s.io;as=APIGroupDiscoveryList)
func WrapAggregatedDiscoveryToHandler(handler http.Handler, aggHandler http.Handler) *WrappedHandler {
scheme := runtime.NewScheme()
- apidiscoveryv2beta1.AddToScheme(scheme)
+ utilruntime.Must(apidiscoveryv2.AddToScheme(scheme))
+ utilruntime.Must(apidiscoveryv2beta1.AddToScheme(scheme))
codecs := serializer.NewCodecFactory(scheme)
return &WrappedHandler{codecs, handler, aggHandler}
}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go
index e102a1e3281..eec02e5722f 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go
@@ -22,6 +22,11 @@ import (
"net/http"
"time"
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/labels"
+ genericfeatures "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
+
"k8s.io/klog/v2"
"k8s.io/apimachinery/pkg/runtime"
@@ -117,5 +122,31 @@ func GetAuthorizerAttributes(ctx context.Context) (authorizer.Attributes, error)
attribs.Namespace = requestInfo.Namespace
attribs.Name = requestInfo.Name
+ if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AuthorizeWithSelectors) {
+ // parsing here makes it easy to keep the AttributesRecord type value-only and avoids any mutex copies when
+ // doing shallow copies in other steps.
+ if len(requestInfo.FieldSelector) > 0 {
+ fieldSelector, err := fields.ParseSelector(requestInfo.FieldSelector)
+ if err != nil {
+ attribs.FieldSelectorRequirements, attribs.FieldSelectorParsingErr = nil, err
+ } else {
+ if requirements := fieldSelector.Requirements(); len(requirements) > 0 {
+ attribs.FieldSelectorRequirements, attribs.FieldSelectorParsingErr = fieldSelector.Requirements(), nil
+ }
+ }
+ }
+
+ if len(requestInfo.LabelSelector) > 0 {
+ labelSelector, err := labels.Parse(requestInfo.LabelSelector)
+ if err != nil {
+ attribs.LabelSelectorRequirements, attribs.LabelSelectorParsingErr = nil, err
+ } else {
+ if requirements, _ /*selectable*/ := labelSelector.Requirements(); len(requirements) > 0 {
+ attribs.LabelSelectorRequirements, attribs.LabelSelectorParsingErr = requirements, nil
+ }
+ }
+ }
+ }
+
return &attribs, nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/request_deadline.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/request_deadline.go
index 51425bb8acd..7497bc38a42 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/request_deadline.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/request_deadline.go
@@ -58,7 +58,7 @@ func withRequestDeadline(handler http.Handler, sink audit.Sink, policy audit.Pol
requestInfo, ok := request.RequestInfoFrom(ctx)
if !ok {
- handleError(w, req, http.StatusInternalServerError, fmt.Errorf("no RequestInfo found in context, handler chain must be wrong"))
+ handleError(w, req, http.StatusInternalServerError, nil, "no RequestInfo found in context, handler chain must be wrong")
return
}
if longRunning(req, requestInfo) {
@@ -166,8 +166,12 @@ func parseTimeout(req *http.Request) (time.Duration, bool, error) {
return timeout, true, nil
}
-func handleError(w http.ResponseWriter, r *http.Request, code int, err error) {
- errorMsg := fmt.Sprintf("Error - %s: %#v", err.Error(), r.RequestURI)
- http.Error(w, errorMsg, code)
- klog.Errorf(errorMsg)
+// handleError does the following:
+// a) it writes the specified error code, and msg to the ResponseWriter
+// object, it does not print the given innerErr into the ResponseWriter object.
+// b) additionally, it prints the given msg, and innerErr to the log with other
+// request scoped data that helps identify the given request.
+func handleError(w http.ResponseWriter, r *http.Request, code int, innerErr error, msg string) {
+ http.Error(w, msg, code)
+ klog.ErrorSDepth(1, innerErr, msg, "method", r.Method, "URI", r.RequestURI, "auditID", audit.GetAuditIDTruncated(r.Context()))
}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/traces.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/traces.go
index 1ecf59d4543..6e36ffec862 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/traces.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/traces.go
@@ -22,6 +22,7 @@ import (
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"go.opentelemetry.io/otel/trace"
+ "k8s.io/apiserver/pkg/endpoints/request"
tracing "k8s.io/component-base/tracing"
)
@@ -32,6 +33,14 @@ func WithTracing(handler http.Handler, tp trace.TracerProvider) http.Handler {
otelhttp.WithPropagators(tracing.Propagators()),
otelhttp.WithPublicEndpoint(),
otelhttp.WithTracerProvider(tp),
+ otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string {
+ ctx := r.Context()
+ info, exist := request.RequestInfoFrom(ctx)
+ if !exist || !info.IsResourceRequest {
+ return r.Method
+ }
+ return getSpanNameFromRequestInfo(info, r)
+ }),
}
wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Add the http.target attribute to the otelhttp span
@@ -45,3 +54,22 @@ func WithTracing(handler http.Handler, tp trace.TracerProvider) http.Handler {
// See https://github.com/open-telemetry/opentelemetry-go/tree/main/example/passthrough
return otelhttp.NewHandler(wrappedHandler, "KubernetesAPI", opts...)
}
+
+func getSpanNameFromRequestInfo(info *request.RequestInfo, r *http.Request) string {
+ spanName := "/" + info.APIPrefix
+ if info.APIGroup != "" {
+ spanName += "/" + info.APIGroup
+ }
+ spanName += "/" + info.APIVersion
+ if info.Namespace != "" {
+ spanName += "/namespaces/{:namespace}"
+ }
+ spanName += "/" + info.Resource
+ if info.Name != "" {
+ spanName += "/" + "{:name}"
+ }
+ if info.Subresource != "" {
+ spanName += "/" + info.Subresource
+ }
+ return r.Method + " " + spanName
+}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/webhook_duration.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/webhook_duration.go
index 8ac47422a4e..e1c89da78dd 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/webhook_duration.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/webhook_duration.go
@@ -18,7 +18,6 @@ package filters
import (
"context"
- "fmt"
"net/http"
"time"
@@ -39,7 +38,7 @@ func WithLatencyTrackers(handler http.Handler) http.Handler {
ctx := req.Context()
requestInfo, ok := request.RequestInfoFrom(ctx)
if !ok {
- handleError(w, req, http.StatusInternalServerError, fmt.Errorf("no RequestInfo found in context, handler chain must be wrong"))
+ handleError(w, req, http.StatusInternalServerError, nil, "no RequestInfo found in context, handler chain must be wrong")
return
}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go b/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go
index 0ce06ab1069..a60485d20c1 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go
@@ -22,7 +22,7 @@ import (
restful "github.com/emicklei/go-restful/v3"
- apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
+ apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -107,7 +107,7 @@ type APIGroupVersion struct {
// InstallREST registers the REST handlers (storage, watch, proxy and redirect) into a restful Container.
// It is expected that the provided path root prefix will serve all operations. Root MUST NOT end
// in a slash.
-func (g *APIGroupVersion) InstallREST(container *restful.Container) ([]apidiscoveryv2beta1.APIResourceDiscovery, []*storageversion.ResourceInfo, error) {
+func (g *APIGroupVersion) InstallREST(container *restful.Container) ([]apidiscoveryv2.APIResourceDiscovery, []*storageversion.ResourceInfo, error) {
prefix := path.Join(g.Root, g.GroupVersion.Group, g.GroupVersion.Version)
installer := &APIInstaller{
group: g,
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/equality.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/equality.go
index a1f27f1d106..6065607d5a0 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/equality.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/equality.go
@@ -28,6 +28,7 @@ import (
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/endpoints/metrics"
@@ -51,7 +52,7 @@ func getAvoidTimestampEqualities() conversion.Equalities {
}
var eqs = equality.Semantic.Copy()
- err := eqs.AddFunc(
+ err := eqs.AddFuncs(
func(a, b metav1.ManagedFieldsEntry) bool {
// Two objects' managed fields are equivalent if, ignoring timestamp,
// the objects are deeply equal.
@@ -59,6 +60,14 @@ func getAvoidTimestampEqualities() conversion.Equalities {
b.Time = nil
return reflect.DeepEqual(a, b)
},
+ func(a, b unstructured.Unstructured) bool {
+ // Check if the managed fields are equal by converting to structured types and leveraging the above
+ // function, then, ignoring the managed fields, equality check the rest of the unstructured data.
+ if !avoidTimestampEqualities.DeepEqual(a.GetManagedFields(), b.GetManagedFields()) {
+ return false
+ }
+ return equalIgnoringValueAtPath(a.Object, b.Object, []string{"metadata", "managedFields"})
+ },
)
if err != nil {
@@ -70,6 +79,36 @@ func getAvoidTimestampEqualities() conversion.Equalities {
return avoidTimestampEqualities
}
+func equalIgnoringValueAtPath(a, b any, path []string) bool {
+ if len(path) == 0 { // found the value to ignore
+ return true
+ }
+ aMap, aOk := a.(map[string]any)
+ bMap, bOk := b.(map[string]any)
+ if !aOk || !bOk {
+ // Can't traverse into non-maps, ignore
+ return true
+ }
+ if len(aMap) != len(bMap) {
+ return false
+ }
+ pathHead := path[0]
+ for k, aVal := range aMap {
+ bVal, ok := bMap[k]
+ if !ok {
+ return false
+ }
+ if k == pathHead {
+ if !equalIgnoringValueAtPath(aVal, bVal, path[1:]) {
+ return false
+ }
+ } else if !avoidTimestampEqualities.DeepEqual(aVal, bVal) {
+ return false
+ }
+ }
+ return true
+}
+
// IgnoreManagedFieldsTimestampsTransformer reverts timestamp updates
// if the non-managed parts of the object are equivalent
func IgnoreManagedFieldsTimestampsTransformer(
@@ -152,14 +191,20 @@ func IgnoreManagedFieldsTimestampsTransformer(
return newObj, nil
}
+ eqFn := equalities.DeepEqual
+ if _, ok := newObj.(*unstructured.Unstructured); ok {
+ // Use strict equality with unstructured
+ eqFn = equalities.DeepEqualWithNilDifferentFromEmpty
+ }
+
// This condition ensures the managed fields are always compared first. If
// this check fails, the if statement will short circuit. If the check
// succeeds the slow path is taken which compares entire objects.
- if !equalities.DeepEqualWithNilDifferentFromEmpty(oldManagedFields, newManagedFields) {
+ if !eqFn(oldManagedFields, newManagedFields) {
return newObj, nil
}
- if equalities.DeepEqualWithNilDifferentFromEmpty(newObj, oldObj) {
+ if eqFn(newObj, oldObj) {
// Remove any changed timestamps, so that timestamp is not the only
// change seen by etcd.
//
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/node.yaml b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/node.yaml
index 66e849f23fb..a7f2d54fdf7 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/node.yaml
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/node.yaml
@@ -120,7 +120,7 @@ status:
type: PIDPressure
- lastHeartbeatTime: "2019-09-20T19:32:50Z"
lastTransitionTime: "2019-07-09T16:17:49Z"
- message: kubelet is posting ready status. AppArmor enabled
+ message: kubelet is posting ready status
reason: KubeletReady
status: "True"
type: Ready
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/get.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/get.go
index d3b501cf52a..3cc4a728a57 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/get.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/get.go
@@ -41,6 +41,7 @@ import (
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/features"
"k8s.io/apiserver/pkg/registry/rest"
+ "k8s.io/apiserver/pkg/server/routine"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/component-base/tracing"
"k8s.io/klog/v2"
@@ -259,16 +260,37 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope *RequestScope, forceWatc
}
klog.V(3).InfoS("Starting watch", "path", req.URL.Path, "resourceVersion", opts.ResourceVersion, "labels", opts.LabelSelector, "fields", opts.FieldSelector, "timeout", timeout)
ctx, cancel := context.WithTimeout(ctx, timeout)
- defer cancel()
+ defer func() { cancel() }()
watcher, err := rw.Watch(ctx, &opts)
if err != nil {
scope.err(err, w, req)
return
}
- requestInfo, _ := request.RequestInfoFrom(ctx)
- metrics.RecordLongRunning(req, requestInfo, metrics.APIServerComponent, func() {
- serveWatch(watcher, scope, outputMediaType, req, w, timeout, metrics.CleanListScope(ctx, &opts))
- })
+ handler, err := serveWatchHandler(watcher, scope, outputMediaType, req, w, timeout, metrics.CleanListScope(ctx, &opts))
+ if err != nil {
+ scope.err(err, w, req)
+ return
+ }
+ // Invalidate cancel() to defer until serve() is complete.
+ deferredCancel := cancel
+ cancel = func() {}
+
+ serve := func() {
+ defer deferredCancel()
+ requestInfo, _ := request.RequestInfoFrom(ctx)
+ metrics.RecordLongRunning(req, requestInfo, metrics.APIServerComponent, func() {
+ defer watcher.Stop()
+ handler.ServeHTTP(w, req)
+ })
+ }
+
+ // Run watch serving in a separate goroutine to allow freeing current stack memory
+ t := routine.TaskFrom(req.Context())
+ if t != nil {
+ t.Func = serve
+ } else {
+ serve()
+ }
return
}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go
index 8209efef708..14278aed743 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go
@@ -23,8 +23,8 @@ import (
"strings"
"time"
- jsonpatch "github.com/evanphx/json-patch"
"go.opentelemetry.io/otel/attribute"
+ jsonpatch "gopkg.in/evanphx/json-patch.v4"
kjson "sigs.k8s.io/json"
"k8s.io/apimachinery/pkg/api/errors"
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/watch.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/watch.go
index 6e86b79be55..6a9257d10e0 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/watch.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/watch.go
@@ -17,8 +17,9 @@ limitations under the License.
package handlers
import (
- "bytes"
+ "context"
"fmt"
+ "io"
"net/http"
"time"
@@ -61,30 +62,25 @@ func (w *realTimeoutFactory) TimeoutCh() (<-chan time.Time, func() bool) {
return t.C, t.Stop
}
-// serveWatch will serve a watch response.
+// serveWatchHandler returns a handle to serve a watch response.
// TODO: the functionality in this method and in WatchServer.Serve is not cleanly decoupled.
-func serveWatch(watcher watch.Interface, scope *RequestScope, mediaTypeOptions negotiation.MediaTypeOptions, req *http.Request, w http.ResponseWriter, timeout time.Duration, metricsScope string) {
- defer watcher.Stop()
-
+func serveWatchHandler(watcher watch.Interface, scope *RequestScope, mediaTypeOptions negotiation.MediaTypeOptions, req *http.Request, w http.ResponseWriter, timeout time.Duration, metricsScope string) (http.Handler, error) {
options, err := optionsForTransform(mediaTypeOptions, req)
if err != nil {
- scope.err(err, w, req)
- return
+ return nil, err
}
// negotiate for the stream serializer from the scope's serializer
serializer, err := negotiation.NegotiateOutputMediaTypeStream(req, scope.Serializer, scope)
if err != nil {
- scope.err(err, w, req)
- return
+ return nil, err
}
framer := serializer.StreamSerializer.Framer
streamSerializer := serializer.StreamSerializer.Serializer
encoder := scope.Serializer.EncoderForVersion(streamSerializer, scope.Kind.GroupVersion())
useTextFraming := serializer.EncodesAsText
if framer == nil {
- scope.err(fmt.Errorf("no framer defined for %q available for embedded encoding", serializer.MediaType), w, req)
- return
+ return nil, fmt.Errorf("no framer defined for %q available for embedded encoding", serializer.MediaType)
}
// TODO: next step, get back mediaTypeOptions from negotiate and return the exact value here
mediaType := serializer.MediaType
@@ -100,8 +96,7 @@ func serveWatch(watcher watch.Interface, scope *RequestScope, mediaTypeOptions n
if transform {
info, ok := runtime.SerializerInfoForMediaType(contentSerializer.SupportedMediaTypes(), serializer.MediaType)
if !ok {
- scope.err(fmt.Errorf("no encoder for %q exists in the requested target %#v", serializer.MediaType, contentSerializer), w, req)
- return
+ return nil, fmt.Errorf("no encoder for %q exists in the requested target %#v", serializer.MediaType, contentSerializer)
}
embeddedEncoder = contentSerializer.EncoderForVersion(info.Serializer, contentKind.GroupVersion())
} else {
@@ -114,7 +109,6 @@ func serveWatch(watcher watch.Interface, scope *RequestScope, mediaTypeOptions n
// don't put the allocator inside the embeddedEncodeFn as that would allocate memory on every call.
// instead, we allocate the buffer for the entire watch session and release it when we close the connection.
memoryAllocator = runtime.AllocatorPool.Get().(*runtime.Allocator)
- defer runtime.AllocatorPool.Put(memoryAllocator)
embeddedEncoder = runtime.NewEncoderWithAllocator(encoderWithAllocator, memoryAllocator)
}
var tableOptions *metav1.TableOptions
@@ -122,8 +116,7 @@ func serveWatch(watcher watch.Interface, scope *RequestScope, mediaTypeOptions n
if passedOptions, ok := options.(*metav1.TableOptions); ok {
tableOptions = passedOptions
} else {
- scope.err(fmt.Errorf("unexpected options type: %T", options), w, req)
- return
+ return nil, fmt.Errorf("unexpected options type: %T", options)
}
}
embeddedEncoder = newWatchEmbeddedEncoder(ctx, embeddedEncoder, mediaTypeOptions.Convert, tableOptions, scope)
@@ -133,7 +126,6 @@ func serveWatch(watcher watch.Interface, scope *RequestScope, mediaTypeOptions n
// don't put the allocator inside the embeddedEncodeFn as that would allocate memory on every call.
// instead, we allocate the buffer for the entire watch session and release it when we close the connection.
memoryAllocator = runtime.AllocatorPool.Get().(*runtime.Allocator)
- defer runtime.AllocatorPool.Put(memoryAllocator)
}
encoder = runtime.NewEncoderWithAllocator(encoderWithAllocator, memoryAllocator)
}
@@ -153,13 +145,18 @@ func serveWatch(watcher watch.Interface, scope *RequestScope, mediaTypeOptions n
Encoder: encoder,
EmbeddedEncoder: embeddedEncoder,
+ MemoryAllocator: memoryAllocator,
TimeoutFactory: &realTimeoutFactory{timeout},
ServerShuttingDownCh: serverShuttingDownCh,
metricsScope: metricsScope,
}
- server.ServeHTTP(w, req)
+ if wsstream.IsWebSocketRequest(req) {
+ w.Header().Set("Content-Type", server.MediaType)
+ return websocket.Handler(server.HandleWS), nil
+ }
+ return http.HandlerFunc(server.HandleHTTP), nil
}
// WatchServer serves a watch.Interface over a websocket or vanilla HTTP.
@@ -178,22 +175,21 @@ type WatchServer struct {
// used to encode the nested object in the watch stream
EmbeddedEncoder runtime.Encoder
+ MemoryAllocator runtime.MemoryAllocator
TimeoutFactory TimeoutFactory
ServerShuttingDownCh <-chan struct{}
metricsScope string
}
-// ServeHTTP serves a series of encoded events via HTTP with Transfer-Encoding: chunked
+// HandleHTTP serves a series of encoded events via HTTP with Transfer-Encoding: chunked.
// or over a websocket connection.
-func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
- kind := s.Scope.Kind
-
- if wsstream.IsWebSocketRequest(req) {
- w.Header().Set("Content-Type", s.MediaType)
- websocket.Handler(s.HandleWS).ServeHTTP(w, req)
- return
- }
+func (s *WatchServer) HandleHTTP(w http.ResponseWriter, req *http.Request) {
+ defer func() {
+ if s.MemoryAllocator != nil {
+ runtime.AllocatorPool.Put(s.MemoryAllocator)
+ }
+ }()
flusher, ok := w.(http.Flusher)
if !ok {
@@ -222,6 +218,7 @@ func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(http.StatusOK)
flusher.Flush()
+ kind := s.Scope.Kind
watchEncoder := newWatchEncoder(req.Context(), kind, s.EmbeddedEncoder, s.Encoder, framer)
ch := s.Watching.ResultChan()
done := req.Context().Done()
@@ -265,10 +262,19 @@ func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
}
-// HandleWS implements a websocket handler.
+// HandleWS serves a series of encoded events over a websocket connection.
func (s *WatchServer) HandleWS(ws *websocket.Conn) {
+ defer func() {
+ if s.MemoryAllocator != nil {
+ runtime.AllocatorPool.Put(s.MemoryAllocator)
+ }
+ }()
+
defer ws.Close()
done := make(chan struct{})
+ // ensure the connection times out
+ timeoutCh, cleanup := s.TimeoutFactory.TimeoutCh()
+ defer cleanup()
go func() {
defer utilruntime.HandleCrash()
@@ -279,67 +285,62 @@ func (s *WatchServer) HandleWS(ws *websocket.Conn) {
close(done)
}()
- var unknown runtime.Unknown
- internalEvent := &metav1.InternalEvent{}
- buf := &bytes.Buffer{}
- streamBuf := &bytes.Buffer{}
+ framer := newWebsocketFramer(ws, s.UseTextFraming)
+
+ kind := s.Scope.Kind
+ watchEncoder := newWatchEncoder(context.TODO(), kind, s.EmbeddedEncoder, s.Encoder, framer)
ch := s.Watching.ResultChan()
for {
select {
case <-done:
return
+ case <-timeoutCh:
+ return
case event, ok := <-ch:
if !ok {
// End of results.
return
}
- if err := s.EmbeddedEncoder.Encode(event.Object, buf); err != nil {
- // unexpected error
- utilruntime.HandleError(fmt.Errorf("unable to encode watch object %T: %v", event.Object, err))
- return
- }
-
- // ContentType is not required here because we are defaulting to the serializer
- // type
- unknown.Raw = buf.Bytes()
- event.Object = &unknown
-
- // the internal event will be versioned by the encoder
- // create the external type directly and encode it. Clients will only recognize the serialization we provide.
- // The internal event is being reused, not reallocated so its just a few extra assignments to do it this way
- // and we get the benefit of using conversion functions which already have to stay in sync
- outEvent := &metav1.WatchEvent{}
- *internalEvent = metav1.InternalEvent(event)
- err := metav1.Convert_v1_InternalEvent_To_v1_WatchEvent(internalEvent, outEvent, nil)
- if err != nil {
- utilruntime.HandleError(fmt.Errorf("unable to convert watch object: %v", err))
+ if err := watchEncoder.Encode(event); err != nil {
+ utilruntime.HandleError(err)
// client disconnect.
return
}
- if err := s.Encoder.Encode(outEvent, streamBuf); err != nil {
- // encoding error
- utilruntime.HandleError(fmt.Errorf("unable to encode event: %v", err))
- return
- }
- if s.UseTextFraming {
- if err := websocket.Message.Send(ws, streamBuf.String()); err != nil {
- // Client disconnect.
- return
- }
- } else {
- if err := websocket.Message.Send(ws, streamBuf.Bytes()); err != nil {
- // Client disconnect.
- return
- }
- }
- buf.Reset()
- streamBuf.Reset()
}
}
}
+type websocketFramer struct {
+ ws *websocket.Conn
+ useTextFraming bool
+}
+
+func newWebsocketFramer(ws *websocket.Conn, useTextFraming bool) io.Writer {
+ return &websocketFramer{
+ ws: ws,
+ useTextFraming: useTextFraming,
+ }
+}
+
+func (w *websocketFramer) Write(p []byte) (int, error) {
+ if w.useTextFraming {
+ // bytes.Buffer::String() has a special handling of nil value, but given
+ // we're writing serialized watch events, this will never happen here.
+ if err := websocket.Message.Send(w.ws, string(p)); err != nil {
+ return 0, err
+ }
+ return len(p), nil
+ }
+ if err := websocket.Message.Send(w.ws, p); err != nil {
+ return 0, err
+ }
+ return len(p), nil
+}
+
+var _ io.Writer = &websocketFramer{}
+
func shouldRecordWatchListLatency(event watch.Event) bool {
if event.Type != watch.Bookmark || !utilfeature.DefaultFeatureGate.Enabled(features.WatchList) {
return false
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/installer.go b/vendor/k8s.io/apiserver/pkg/endpoints/installer.go
index ffd4a7dcbfb..0a0fdde0d78 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/installer.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/installer.go
@@ -26,7 +26,9 @@ import (
"unicode"
restful "github.com/emicklei/go-restful/v3"
- apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
+ "sigs.k8s.io/structured-merge-diff/v4/fieldpath"
+
+ apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
@@ -46,12 +48,12 @@ import (
"k8s.io/apiserver/pkg/storageversion"
utilfeature "k8s.io/apiserver/pkg/util/feature"
versioninfo "k8s.io/component-base/version"
- "sigs.k8s.io/structured-merge-diff/v4/fieldpath"
)
const (
- ROUTE_META_GVK = "x-kubernetes-group-version-kind"
- ROUTE_META_ACTION = "x-kubernetes-action"
+ RouteMetaGVK = "x-kubernetes-group-version-kind"
+ RouteMetaSelectableFields = "x-kubernetes-selectable-fields"
+ RouteMetaAction = "x-kubernetes-action"
)
type APIInstaller struct {
@@ -69,8 +71,8 @@ type action struct {
AllNamespaces bool // true iff the action is namespaced but works on aggregate result for all namespaces
}
-func ConvertGroupVersionIntoToDiscovery(list []metav1.APIResource) ([]apidiscoveryv2beta1.APIResourceDiscovery, error) {
- var apiResourceList []apidiscoveryv2beta1.APIResourceDiscovery
+func ConvertGroupVersionIntoToDiscovery(list []metav1.APIResource) ([]apidiscoveryv2.APIResourceDiscovery, error) {
+ var apiResourceList []apidiscoveryv2.APIResourceDiscovery
parentResources := make(map[string]int)
// Loop through all top-level resources
@@ -80,14 +82,14 @@ func ConvertGroupVersionIntoToDiscovery(list []metav1.APIResource) ([]apidiscove
continue
}
- var scope apidiscoveryv2beta1.ResourceScope
+ var scope apidiscoveryv2.ResourceScope
if r.Namespaced {
- scope = apidiscoveryv2beta1.ScopeNamespace
+ scope = apidiscoveryv2.ScopeNamespace
} else {
- scope = apidiscoveryv2beta1.ScopeCluster
+ scope = apidiscoveryv2.ScopeCluster
}
- resource := apidiscoveryv2beta1.APIResourceDiscovery{
+ resource := apidiscoveryv2.APIResourceDiscovery{
Resource: r.Name,
Scope: scope,
ResponseKind: &metav1.GroupVersionKind{
@@ -114,17 +116,17 @@ func ConvertGroupVersionIntoToDiscovery(list []metav1.APIResource) ([]apidiscove
continue
}
- var scope apidiscoveryv2beta1.ResourceScope
+ var scope apidiscoveryv2.ResourceScope
if r.Namespaced {
- scope = apidiscoveryv2beta1.ScopeNamespace
+ scope = apidiscoveryv2.ScopeNamespace
} else {
- scope = apidiscoveryv2beta1.ScopeCluster
+ scope = apidiscoveryv2.ScopeCluster
}
parentidx, exists := parentResources[split[0]]
if !exists {
// If a subresource exists without a parent, create a parent
- apiResourceList = append(apiResourceList, apidiscoveryv2beta1.APIResourceDiscovery{
+ apiResourceList = append(apiResourceList, apidiscoveryv2.APIResourceDiscovery{
Resource: split[0],
Scope: scope,
// avoid nil panics in v0.26.0-v0.26.3 client-go clients
@@ -140,7 +142,7 @@ func ConvertGroupVersionIntoToDiscovery(list []metav1.APIResource) ([]apidiscove
//
}
- subresource := apidiscoveryv2beta1.APISubresourceDiscovery{
+ subresource := apidiscoveryv2.APISubresourceDiscovery{
Subresource: split[1],
Verbs: r.Verbs,
// avoid nil panics in v0.26.0-v0.26.3 client-go clients
@@ -1059,12 +1061,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
return nil, nil, fmt.Errorf("unrecognized action verb: %s", action.Verb)
}
for _, route := range routes {
- route.Metadata(ROUTE_META_GVK, metav1.GroupVersionKind{
+ route.Metadata(RouteMetaGVK, metav1.GroupVersionKind{
Group: reqScope.Kind.Group,
Version: reqScope.Kind.Version,
Kind: reqScope.Kind.Kind,
})
- route.Metadata(ROUTE_META_ACTION, strings.ToLower(action.Verb))
+ route.Metadata(RouteMetaAction, strings.ToLower(action.Verb))
ws.Route(route)
}
// Note: update GetAuthorizerAttributes() when adding a custom handler.
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go b/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go
index 2558494bd9a..808943d1615 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go
@@ -27,6 +27,8 @@ import (
metainternalversionscheme "k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
+ genericfeatures "k8s.io/apiserver/pkg/features"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/klog/v2"
)
@@ -62,6 +64,13 @@ type RequestInfo struct {
Name string
// Parts are the path parts for the request, always starting with /{resource}/{name}
Parts []string
+
+ // FieldSelector contains the unparsed field selector from a request. It is only present if the apiserver
+ // honors field selectors for the verb this request is associated with.
+ FieldSelector string
+ // LabelSelector contains the unparsed field selector from a request. It is only present if the apiserver
+ // honors field selectors for the verb this request is associated with.
+ LabelSelector string
}
// specialVerbs contains just strings which are used in REST paths for special actions that don't fall under the normal
@@ -77,6 +86,9 @@ var specialVerbsNoSubresources = sets.NewString("proxy")
// this list allows the parser to distinguish between a namespace subresource, and a namespaced resource
var namespaceSubresources = sets.NewString("status", "finalize")
+// verbsWithSelectors is the list of verbs which support fieldSelector and labelSelector parameters
+var verbsWithSelectors = sets.NewString("list", "watch", "deletecollection")
+
// NamespaceSubResourcesForTest exports namespaceSubresources for testing in pkg/controlplane/master_test.go, so we never drift
var NamespaceSubResourcesForTest = sets.NewString(namespaceSubresources.List()...)
@@ -151,6 +163,7 @@ func (r *RequestInfoFactory) NewRequestInfo(req *http.Request) (*RequestInfo, er
currentParts = currentParts[1:]
// handle input of form /{specialVerb}/*
+ verbViaPathPrefix := false
if specialVerbs.Has(currentParts[0]) {
if len(currentParts) < 2 {
return &requestInfo, fmt.Errorf("unable to determine kind and namespace from url, %v", req.URL)
@@ -158,6 +171,7 @@ func (r *RequestInfoFactory) NewRequestInfo(req *http.Request) (*RequestInfo, er
requestInfo.Verb = currentParts[0]
currentParts = currentParts[1:]
+ verbViaPathPrefix = true
} else {
switch req.Method {
@@ -238,11 +252,28 @@ func (r *RequestInfoFactory) NewRequestInfo(req *http.Request) (*RequestInfo, er
}
}
}
+
// if there's no name on the request and we thought it was a delete before, then the actual verb is deletecollection
if len(requestInfo.Name) == 0 && requestInfo.Verb == "delete" {
requestInfo.Verb = "deletecollection"
}
+ if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AuthorizeWithSelectors) {
+ // Don't support selector authorization on requests that used the deprecated verb-via-path mechanism, since they don't support selectors consistently.
+ // There are multi-object and single-object watch endpoints, and only the multi-object one supports selectors.
+ if !verbViaPathPrefix && verbsWithSelectors.Has(requestInfo.Verb) {
+ // interestingly these are parsed above, but the current structure there means that if one (or anything) in the
+ // listOptions fails to decode, the field and label selectors are lost.
+ // therefore, do the straight query param read here.
+ if vals := req.URL.Query()["fieldSelector"]; len(vals) > 0 {
+ requestInfo.FieldSelector = vals[0]
+ }
+ if vals := req.URL.Query()["labelSelector"]; len(vals) > 0 {
+ requestInfo.LabelSelector = vals[0]
+ }
+ }
+ }
+
return &requestInfo, nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/request/webhook_duration.go b/vendor/k8s.io/apiserver/pkg/endpoints/request/webhook_duration.go
index 612c671d85b..435af8e7cf1 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/request/webhook_duration.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/request/webhook_duration.go
@@ -152,6 +152,13 @@ type LatencyTrackers struct {
// The Write method can be invoked multiple times, so we use a
// latency tracker that sums up the duration from each call.
ResponseWriteTracker DurationTracker
+
+ // DecodeTracker is used to track latency incurred inside the function
+ // that takes an object returned from the underlying storage layer
+ // (etcd) and performs decoding of the response object.
+ // When called multiple times, the latency incurred inside to
+ // decode func each time will be summed up.
+ DecodeTracker DurationTracker
}
type latencyTrackersKeyType int
@@ -177,6 +184,7 @@ func WithLatencyTrackersAndCustomClock(parent context.Context, c clock.Clock) co
TransformTracker: newSumLatencyTracker(c),
SerializationTracker: newSumLatencyTracker(c),
ResponseWriteTracker: newSumLatencyTracker(c),
+ DecodeTracker: newSumLatencyTracker(c),
})
}
@@ -243,6 +251,17 @@ func TrackAPFQueueWaitLatency(ctx context.Context, d time.Duration) {
}
}
+// TrackDecodeLatency is used to track latency incurred inside the function
+// that takes an object returned from the underlying storage layer
+// (etcd) and performs decoding of the response object.
+// When called multiple times, the latency incurred inside to
+// decode func each time will be summed up.
+func TrackDecodeLatency(ctx context.Context, d time.Duration) {
+ if tracker, ok := LatencyTrackersFrom(ctx); ok {
+ tracker.DecodeTracker.TrackDuration(d)
+ }
+}
+
// AuditAnnotationsFromLatencyTrackers will inspect each latency tracker
// associated with the request context and return a set of audit
// annotations that can be added to the API audit entry.
@@ -254,6 +273,8 @@ func AuditAnnotationsFromLatencyTrackers(ctx context.Context) map[string]string
responseWriteLatencyKey = "apiserver.latency.k8s.io/response-write"
mutatingWebhookLatencyKey = "apiserver.latency.k8s.io/mutating-webhook"
validatingWebhookLatencyKey = "apiserver.latency.k8s.io/validating-webhook"
+ decodeLatencyKey = "apiserver.latency.k8s.io/decode-response-object"
+ apfQueueWaitLatencyKey = "apiserver.latency.k8s.io/apf-queue-wait"
)
tracker, ok := LatencyTrackersFrom(ctx)
@@ -280,6 +301,11 @@ func AuditAnnotationsFromLatencyTrackers(ctx context.Context) map[string]string
if latency := tracker.ValidatingWebhookTracker.GetLatency(); latency != 0 {
annotations[validatingWebhookLatencyKey] = latency.String()
}
-
+ if latency := tracker.DecodeTracker.GetLatency(); latency != 0 {
+ annotations[decodeLatencyKey] = latency.String()
+ }
+ if latency := tracker.APFQueueWaitTracker.GetLatency(); latency != 0 {
+ annotations[apfQueueWaitLatencyKey] = latency.String()
+ }
return annotations
}
diff --git a/vendor/k8s.io/apiserver/pkg/features/kube_features.go b/vendor/k8s.io/apiserver/pkg/features/kube_features.go
index e524e0c6474..27d9761b827 100644
--- a/vendor/k8s.io/apiserver/pkg/features/kube_features.go
+++ b/vendor/k8s.io/apiserver/pkg/features/kube_features.go
@@ -18,7 +18,6 @@ package features
import (
"k8s.io/apimachinery/pkg/util/runtime"
-
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/component-base/featuregate"
)
@@ -38,6 +37,7 @@ const (
// owner: @ivelichkovich, @tallclair
// alpha: v1.27
// beta: v1.28
+ // stable: v1.30
// kep: https://kep.k8s.io/3716
//
// Enables usage of MatchConditions fields to use CEL expressions for matching on admission webhooks
@@ -46,11 +46,19 @@ const (
// owner: @jefftree @alexzielenski
// alpha: v1.26
// beta: v1.27
+ // stable: v1.30
//
// Enables an single HTTP endpoint /discovery/ which supports native HTTP
// caching with ETags containing all APIResources known to the apiserver.
AggregatedDiscoveryEndpoint featuregate.Feature = "AggregatedDiscoveryEndpoint"
+ // owner: @vinayakankugoyal
+ // kep: https://kep.k8s.io/4633
+ // alpha: v1.31
+ //
+ // Allows us to enable anonymous auth for only certain apiserver endpoints.
+ AnonymousAuthConfigurableEndpoints featuregate.Feature = "AnonymousAuthConfigurableEndpoints"
+
// owner: @smarterclayton
// alpha: v1.8
// beta: v1.9
@@ -60,16 +68,6 @@ const (
// all at once.
APIListChunking featuregate.Feature = "APIListChunking"
- // owner: @MikeSpreitzer @yue9944882
- // alpha: v1.18
- // beta: v1.20
- // stable: 1.29
- //
- // Enables managing request concurrency with prioritization and fairness at each server.
- // The FeatureGate was introduced in release 1.15 but the feature
- // was not really implemented before 1.18.
- APIPriorityAndFairness featuregate.Feature = "APIPriorityAndFairness"
-
// owner: @ilackams
// alpha: v1.7
// beta: v1.16
@@ -90,21 +88,40 @@ const (
// Add support for distributed tracing in the API Server
APIServerTracing featuregate.Feature = "APIServerTracing"
+ // owner: @linxiulei
+ // beta: v1.30
+ //
+ // Enables serving watch requests in separate goroutines.
+ APIServingWithRoutine featuregate.Feature = "APIServingWithRoutine"
+
+ // owner: @deads2k
+ // kep: https://kep.k8s.io/4601
+ // alpha: v1.31
+ //
+ // Allows authorization to use field and label selectors.
+ AuthorizeWithSelectors featuregate.Feature = "AuthorizeWithSelectors"
+
+ // owner: @serathius
+ // beta: v1.31
+ // Enables concurrent watch object decoding to avoid starving watch cache when conversion webhook is installed.
+ ConcurrentWatchObjectDecode featuregate.Feature = "ConcurrentWatchObjectDecode"
+
// owner: @cici37 @jpbetz
// kep: http://kep.k8s.io/3488
// alpha: v1.26
+ // beta: v1.28
+ // stable: v1.30
//
+ // Note: the feature gate can be removed in 1.32
// Enables expression validation in Admission Control
ValidatingAdmissionPolicy featuregate.Feature = "ValidatingAdmissionPolicy"
- // owner: @cici37
- // kep: https://kep.k8s.io/2876
- // alpha: v1.23
- // beta: v1.25
- // stable: v1.29
+ // owner: @jefftree
+ // kep: https://kep.k8s.io/4355
+ // alpha: v1.31
//
- // Enables expression validation for Custom Resource
- CustomResourceValidationExpressions featuregate.Feature = "CustomResourceValidationExpressions"
+ // Enables coordinated leader election in the API server
+ CoordinatedLeaderElection featuregate.Feature = "CoordinatedLeaderElection"
// alpha: v1.20
// beta: v1.21
@@ -137,6 +154,13 @@ const (
// Enables the use of derived encryption keys with KMS v2.
KMSv2KDF featuregate.Feature = "KMSv2KDF"
+ // owner: @alexzielenski, @cici37, @jiahuif
+ // kep: https://kep.k8s.io/3962
+ // alpha: v1.30
+ //
+ // Enables the MutatingAdmissionPolicy in Admission Chain
+ MutatingAdmissionPolicy featuregate.Feature = "MutatingAdmissionPolicy"
+
// owner: @jiahuif
// kep: https://kep.k8s.io/2887
// alpha: v1.23
@@ -156,12 +180,11 @@ const (
RemainingItemCount featuregate.Feature = "RemainingItemCount"
// owner: @wojtek-t
- // alpha: v1.16
- // beta: v1.20
- // GA: v1.24
+ // beta: v1.31
//
- // Deprecates and removes SelfLink from ObjectMeta and ListMeta.
- RemoveSelfLink featuregate.Feature = "RemoveSelfLink"
+ // Enables resilient watchcache initialization to avoid controlplane
+ // overload.
+ ResilientWatchCacheInitialization featuregate.Feature = "ResilientWatchCacheInitialization"
// owner: @serathius
// beta: v1.30
@@ -204,6 +227,30 @@ const (
// clients.
UnauthenticatedHTTP2DOSMitigation featuregate.Feature = "UnauthenticatedHTTP2DOSMitigation"
+ // owner: @jpbetz
+ // alpha: v1.30
+ // Resource create requests using generateName are retried automatically by the apiserver
+ // if the generated name conflicts with an existing resource name, up to a maximum number of 7 retries.
+ RetryGenerateName featuregate.Feature = "RetryGenerateName"
+
+ // owner: @cici37
+ // alpha: v1.30
+ //
+ // StrictCostEnforcementForVAP is used to apply strict CEL cost validation for ValidatingAdmissionPolicy.
+ // It will be set to off by default for certain time of period to prevent the impact on the existing users.
+ // It is strongly recommended to enable this feature gate as early as possible.
+ // The strict cost is specific for the extended libraries whose cost defined under k8s/apiserver/pkg/cel/library.
+ StrictCostEnforcementForVAP featuregate.Feature = "StrictCostEnforcementForVAP"
+
+ // owner: @cici37
+ // alpha: v1.30
+ //
+ // StrictCostEnforcementForWebhooks is used to apply strict CEL cost validation for matchConditions in Webhooks.
+ // It will be set to off by default for certain time of period to prevent the impact on the existing users.
+ // It is strongly recommended to enable this feature gate as early as possible.
+ // The strict cost is specific for the extended libraries whose cost defined under k8s/apiserver/pkg/cel/library.
+ StrictCostEnforcementForWebhooks featuregate.Feature = "StrictCostEnforcementForWebhooks"
+
// owner: @caesarxuchao @roycaihw
// alpha: v1.20
//
@@ -221,6 +268,7 @@ const (
// owner: @aramase, @enj, @nabokihms
// kep: https://kep.k8s.io/3331
// alpha: v1.29
+ // beta: v1.30
//
// Enables Structured Authentication Configuration
StructuredAuthenticationConfiguration featuregate.Feature = "StructuredAuthenticationConfiguration"
@@ -228,6 +276,7 @@ const (
// owner: @palnabarun
// kep: https://kep.k8s.io/3221
// alpha: v1.29
+ // beta: v1.30
//
// Enables Structured Authorization Configuration
StructuredAuthorizationConfiguration featuregate.Feature = "StructuredAuthorizationConfiguration"
@@ -240,6 +289,12 @@ const (
// Enables support for watch bookmark events.
WatchBookmark featuregate.Feature = "WatchBookmark"
+ // owner: @wojtek-t
+ // beta: v1.31
+ //
+ // Enables post-start-hook for storage readiness
+ WatchCacheInitializationPostStartHook featuregate.Feature = "WatchCacheInitializationPostStartHook"
+
// owner: @serathius
// beta: 1.30
// Enables watches without resourceVersion to be served from storage.
@@ -262,12 +317,14 @@ const (
// owner: @serathius
// kep: http://kep.k8s.io/2340
// alpha: v1.28
+ // beta: v1.31
//
// Allow the API server to serve consistent lists from cache
ConsistentListFromCache featuregate.Feature = "ConsistentListFromCache"
// owner: @tkashem
// beta: v1.29
+ // GA: v1.30
//
// Allow Priority & Fairness in the API server to use a zero value for
// the 'nominalConcurrencyShares' field of the 'limited' section of a
@@ -277,6 +334,17 @@ const (
func init() {
runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates))
+ runtime.Must(utilfeature.DefaultMutableFeatureGate.AddVersioned(defaultVersionedKubernetesFeatureGates))
+}
+
+// defaultVersionedKubernetesFeatureGates consists of all known Kubernetes-specific feature keys with VersionedSpecs.
+// To add a new feature, define a key for it above and add it here. The features will be
+// available throughout Kubernetes binaries.
+var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{
+ // Example:
+ // EmulationVersion: {
+ // {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha},
+ // },
}
// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys.
@@ -284,13 +352,13 @@ func init() {
// available throughout Kubernetes binaries.
var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
- AggregatedDiscoveryEndpoint: {Default: true, PreRelease: featuregate.Beta},
+ AnonymousAuthConfigurableEndpoints: {Default: false, PreRelease: featuregate.Alpha},
- AdmissionWebhookMatchConditions: {Default: true, PreRelease: featuregate.Beta},
+ AggregatedDiscoveryEndpoint: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33
- APIListChunking: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32
+ AdmissionWebhookMatchConditions: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33
- APIPriorityAndFairness: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.31
+ APIListChunking: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32
APIResponseCompression: {Default: true, PreRelease: featuregate.Beta},
@@ -298,9 +366,15 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
APIServerTracing: {Default: true, PreRelease: featuregate.Beta},
- ValidatingAdmissionPolicy: {Default: false, PreRelease: featuregate.Beta},
+ APIServingWithRoutine: {Default: false, PreRelease: featuregate.Alpha},
+
+ AuthorizeWithSelectors: {Default: false, PreRelease: featuregate.Alpha},
+
+ ConcurrentWatchObjectDecode: {Default: false, PreRelease: featuregate.Beta},
- CustomResourceValidationExpressions: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.31
+ ValidatingAdmissionPolicy: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32
+
+ CoordinatedLeaderElection: {Default: false, PreRelease: featuregate.Alpha},
EfficientWatchResumption: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
@@ -314,7 +388,9 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
RemainingItemCount: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32
- RemoveSelfLink: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
+ ResilientWatchCacheInitialization: {Default: true, PreRelease: featuregate.Beta},
+
+ RetryGenerateName: {Default: true, PreRelease: featuregate.Beta},
SeparateCacheWatchRPC: {Default: true, PreRelease: featuregate.Beta},
@@ -326,21 +402,27 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
StorageVersionHash: {Default: true, PreRelease: featuregate.Beta},
- StructuredAuthenticationConfiguration: {Default: false, PreRelease: featuregate.Alpha},
+ StrictCostEnforcementForVAP: {Default: false, PreRelease: featuregate.Beta},
+
+ StrictCostEnforcementForWebhooks: {Default: false, PreRelease: featuregate.Beta},
- StructuredAuthorizationConfiguration: {Default: false, PreRelease: featuregate.Alpha},
+ StructuredAuthenticationConfiguration: {Default: true, PreRelease: featuregate.Beta},
+
+ StructuredAuthorizationConfiguration: {Default: true, PreRelease: featuregate.Beta},
UnauthenticatedHTTP2DOSMitigation: {Default: true, PreRelease: featuregate.Beta},
WatchBookmark: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
+ WatchCacheInitializationPostStartHook: {Default: false, PreRelease: featuregate.Beta},
+
WatchFromStorageWithoutResourceVersion: {Default: false, PreRelease: featuregate.Beta},
InPlacePodVerticalScaling: {Default: false, PreRelease: featuregate.Alpha},
WatchList: {Default: false, PreRelease: featuregate.Alpha},
- ConsistentListFromCache: {Default: false, PreRelease: featuregate.Alpha},
+ ConsistentListFromCache: {Default: true, PreRelease: featuregate.Beta},
- ZeroLimitedNominalConcurrencyShares: {Default: false, PreRelease: featuregate.Beta},
+ ZeroLimitedNominalConcurrencyShares: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32
}
diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/options.go b/vendor/k8s.io/apiserver/pkg/registry/generic/options.go
index d675a258f5e..44d07c0e241 100644
--- a/vendor/k8s.io/apiserver/pkg/registry/generic/options.go
+++ b/vendor/k8s.io/apiserver/pkg/registry/generic/options.go
@@ -19,6 +19,7 @@ package generic
import (
"time"
+ "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/storagebackend"
@@ -39,12 +40,15 @@ type RESTOptions struct {
}
// Implement RESTOptionsGetter so that RESTOptions can directly be used when available (i.e. tests)
-func (opts RESTOptions) GetRESTOptions(schema.GroupResource) (RESTOptions, error) {
+func (opts RESTOptions) GetRESTOptions(schema.GroupResource, runtime.Object) (RESTOptions, error) {
return opts, nil
}
type RESTOptionsGetter interface {
- GetRESTOptions(resource schema.GroupResource) (RESTOptions, error)
+ // GetRESTOptions returns the RESTOptions for the given resource and example object.
+ // The example object is used to determine the storage version for the resource.
+ // If the example object is nil, the storage version will be determined by the resource's default storage version.
+ GetRESTOptions(resource schema.GroupResource, example runtime.Object) (RESTOptions, error)
}
// StoreOptions is set of configuration options used to complete generic registries.
diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go
index 028053952a3..198c09f6b8e 100644
--- a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go
+++ b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go
@@ -23,6 +23,8 @@ import (
"sync"
"time"
+ "sigs.k8s.io/structured-merge-diff/v4/fieldpath"
+
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/api/validation"
@@ -40,15 +42,16 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
+ "k8s.io/apiserver/pkg/features"
"k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/rest"
"k8s.io/apiserver/pkg/storage"
storeerr "k8s.io/apiserver/pkg/storage/errors"
"k8s.io/apiserver/pkg/storage/etcd3/metrics"
"k8s.io/apiserver/pkg/util/dryrun"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
flowcontrolrequest "k8s.io/apiserver/pkg/util/flowcontrol/request"
"k8s.io/client-go/tools/cache"
- "sigs.k8s.io/structured-merge-diff/v4/fieldpath"
"k8s.io/klog/v2"
)
@@ -223,6 +226,10 @@ type Store struct {
// storageVersionHash as empty in the discovery document.
StorageVersioner runtime.GroupVersioner
+ // ReadinessCheckFunc checks if the storage is ready for accepting requests.
+ // The field is optional, if set needs to be thread-safe.
+ ReadinessCheckFunc func() error
+
// DestroyFunc cleans up clients used by the underlying Storage; optional.
// If set, DestroyFunc has to be implemented in thread-safe way and
// be prepared for being called more than once.
@@ -231,6 +238,7 @@ type Store struct {
// Note: the rest.StandardStorage interface aggregates the common REST verbs
var _ rest.StandardStorage = &Store{}
+var _ rest.StorageWithReadiness = &Store{}
var _ rest.TableConvertor = &Store{}
var _ GenericStore = &Store{}
@@ -289,6 +297,14 @@ func (e *Store) New() runtime.Object {
return e.NewFunc()
}
+// ReadinessCheck checks if the storage is ready for accepting requests.
+func (e *Store) ReadinessCheck() error {
+ if e.ReadinessCheckFunc != nil {
+ return e.ReadinessCheckFunc()
+ }
+ return nil
+}
+
// Destroy cleans up its resources on shutdown.
func (e *Store) Destroy() {
if e.DestroyFunc != nil {
@@ -392,11 +408,54 @@ func (e *Store) ListPredicate(ctx context.Context, p storage.SelectionPredicate,
// finishNothing is a do-nothing FinishFunc.
func finishNothing(context.Context, bool) {}
+// maxNameGenerationCreateAttempts is the maximum number of
+// times create will be attempted when generateName is used
+// and create attempts fails due to name conflict errors.
+// Each attempt uses a newly randomly generated name.
+// 8 was selected as the max because it is sufficient to generate
+// 1 million names per generateName prefix, with only a 0.1%
+// probability of any generated name conflicting with existing names.
+// Without retry, a 0.1% probability occurs at ~500
+// generated names and a 50% probability occurs at ~4500
+// generated names.
+const maxNameGenerationCreateAttempts = 8
+
// Create inserts a new item according to the unique key from the object.
// Note that registries may mutate the input object (e.g. in the strategy
// hooks). Tests which call this might want to call DeepCopy if they expect to
// be able to examine the input and output objects for differences.
func (e *Store) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
+ if utilfeature.DefaultFeatureGate.Enabled(features.RetryGenerateName) && needsNameGeneration(obj) {
+ return e.createWithGenerateNameRetry(ctx, obj, createValidation, options)
+ }
+
+ return e.create(ctx, obj, createValidation, options)
+}
+
+// needsNameGeneration returns true if the obj has a generateName but no name.
+func needsNameGeneration(obj runtime.Object) bool {
+ if objectMeta, err := meta.Accessor(obj); err == nil {
+ if len(objectMeta.GetGenerateName()) > 0 && len(objectMeta.GetName()) == 0 {
+ return true
+ }
+ }
+ return false
+}
+
+// createWithGenerateNameRetry attempts to create obj up to maxNameGenerationCreateAttempts
+// when create fails due to a name conflict error. Each attempt randomly generates a new
+// name based on generateName.
+func (e *Store) createWithGenerateNameRetry(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (resultObj runtime.Object, err error) {
+ for i := 0; i < maxNameGenerationCreateAttempts; i++ {
+ resultObj, err = e.create(ctx, obj.DeepCopyObject(), createValidation, options)
+ if err == nil || !apierrors.IsAlreadyExists(err) {
+ return resultObj, err
+ }
+ }
+ return resultObj, err
+}
+
+func (e *Store) create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
var finishCreate FinishFunc = finishNothing
// Init metadata as early as possible.
@@ -1472,7 +1531,7 @@ func (e *Store) CompleteWithOptions(options *generic.StoreOptions) error {
return err
}
- opts, err := options.RESTOptions.GetRESTOptions(e.DefaultQualifiedResource)
+ opts, err := options.RESTOptions.GetRESTOptions(e.DefaultQualifiedResource, e.NewFunc())
if err != nil {
return err
}
@@ -1568,6 +1627,9 @@ func (e *Store) CompleteWithOptions(options *generic.StoreOptions) error {
}
}
}
+ if e.Storage.Storage != nil {
+ e.ReadinessCheckFunc = e.Storage.Storage.ReadinessCheck
+ }
return nil
}
diff --git a/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go b/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go
index 78b6ea8b0ef..03cea7bb70b 100644
--- a/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go
+++ b/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go
@@ -52,6 +52,8 @@ import (
// Storage is a generic interface for RESTful storage services.
// Resources which are exported to the RESTful API of apiserver need to implement this interface. It is expected
// that objects may implement any of the below interfaces.
+//
+// Consider using StorageWithReadiness whenever possible.
type Storage interface {
// New returns an empty object that can be used with Create and Update after request data has been put into it.
// This object must be a pointer type for use with Codec.DecodeInto([]byte, runtime.Object)
@@ -63,6 +65,14 @@ type Storage interface {
Destroy()
}
+// StorageWithReadiness extends Storage interface with the readiness check.
+type StorageWithReadiness interface {
+ Storage
+
+ // ReadinessCheck allows for checking storage readiness.
+ ReadinessCheck() error
+}
+
// Scoper indicates what scope the resource is at. It must be specified.
// It is usually provided automatically based on your strategy.
type Scoper interface {
diff --git a/vendor/k8s.io/apiserver/pkg/server/config.go b/vendor/k8s.io/apiserver/pkg/server/config.go
index beff08f14d0..a326e7335ae 100644
--- a/vendor/k8s.io/apiserver/pkg/server/config.go
+++ b/vendor/k8s.io/apiserver/pkg/server/config.go
@@ -32,9 +32,9 @@ import (
"sync/atomic"
"time"
- jsonpatch "github.com/evanphx/json-patch"
"github.com/google/uuid"
"golang.org/x/crypto/cryptobyte"
+ jsonpatch "gopkg.in/evanphx/json-patch.v4"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -42,8 +42,8 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/apimachinery/pkg/util/version"
utilwaitgroup "k8s.io/apimachinery/pkg/util/waitgroup"
- "k8s.io/apimachinery/pkg/version"
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/audit"
"k8s.io/apiserver/pkg/authentication/authenticator"
@@ -64,14 +64,17 @@ import (
genericfilters "k8s.io/apiserver/pkg/server/filters"
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/apiserver/pkg/server/routes"
+ "k8s.io/apiserver/pkg/server/routine"
serverstore "k8s.io/apiserver/pkg/server/storage"
storagevalue "k8s.io/apiserver/pkg/storage/value"
"k8s.io/apiserver/pkg/storageversion"
utilfeature "k8s.io/apiserver/pkg/util/feature"
utilflowcontrol "k8s.io/apiserver/pkg/util/flowcontrol"
flowcontrolrequest "k8s.io/apiserver/pkg/util/flowcontrol/request"
+ utilversion "k8s.io/apiserver/pkg/util/version"
"k8s.io/client-go/informers"
restclient "k8s.io/client-go/rest"
+ "k8s.io/component-base/featuregate"
"k8s.io/component-base/logs"
"k8s.io/component-base/metrics/features"
"k8s.io/component-base/metrics/prometheus/slis"
@@ -147,8 +150,11 @@ type Config struct {
// done values in this values for this map are ignored.
PostStartHooks map[string]PostStartHookConfigEntry
- // Version will enable the /version endpoint if non-nil
- Version *version.Info
+ // EffectiveVersion determines which apis and features are available
+ // based on when the api/feature lifecyle.
+ EffectiveVersion utilversion.EffectiveVersion
+ // FeatureGate is a way to plumb feature gate through if you have them.
+ FeatureGate featuregate.FeatureGate
// AuditBackend is where audit events are sent to.
AuditBackend audit.Backend
// AuditPolicyRuleEvaluator makes the decision of whether and how to audit log a request.
@@ -211,6 +217,10 @@ type Config struct {
// twice this value. Note that it is up to the request handlers to ignore or honor this timeout. In seconds.
MinRequestTimeout int
+ // StorageInitializationTimeout defines the maximum amount of time to wait for storage initialization
+ // before declaring apiserver ready.
+ StorageInitializationTimeout time.Duration
+
// This represents the maximum amount of time it should take for apiserver to complete its startup
// sequence and become healthy. From apiserver's start time to when this amount of time has
// elapsed, /livez will assume that unfinished post-start hooks will complete successfully and
@@ -421,6 +431,7 @@ func NewConfig(codecs serializer.CodecFactory) *Config {
MaxMutatingRequestsInFlight: 200,
RequestTimeout: time.Duration(60) * time.Second,
MinRequestTimeout: 1800,
+ StorageInitializationTimeout: time.Minute,
LivezGracePeriod: time.Duration(0),
ShutdownDelayDuration: time.Duration(0),
// 1.5MB is the default client request size in bytes
@@ -585,7 +596,7 @@ func (c *Config) AddPostStartHookOrDie(name string, hook PostStartHookFunc) {
}
}
-func completeOpenAPI(config *openapicommon.Config, version *version.Info) {
+func completeOpenAPI(config *openapicommon.Config, version *version.Version) {
if config == nil {
return
}
@@ -624,7 +635,7 @@ func completeOpenAPI(config *openapicommon.Config, version *version.Info) {
}
}
-func completeOpenAPIV3(config *openapicommon.OpenAPIV3Config, version *version.Info) {
+func completeOpenAPIV3(config *openapicommon.OpenAPIV3Config, version *version.Version) {
if config == nil {
return
}
@@ -668,9 +679,17 @@ func (c *Config) DrainedNotify() <-chan struct{} {
return c.lifecycleSignals.InFlightRequestsDrained.Signaled()
}
+// ShutdownInitiated returns a lifecycle signal of apiserver shutdown having been initiated.
+func (c *Config) ShutdownInitiatedNotify() <-chan struct{} {
+ return c.lifecycleSignals.ShutdownInitiated.Signaled()
+}
+
// Complete fills in any fields not set that are required to have valid data and can be derived
// from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.
func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedConfig {
+ if c.FeatureGate == nil {
+ c.FeatureGate = utilfeature.DefaultFeatureGate
+ }
if len(c.ExternalAddress) == 0 && c.PublicAddress != nil {
c.ExternalAddress = c.PublicAddress.String()
}
@@ -686,9 +705,8 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedCo
}
c.ExternalAddress = net.JoinHostPort(c.ExternalAddress, strconv.Itoa(port))
}
-
- completeOpenAPI(c.OpenAPIConfig, c.Version)
- completeOpenAPIV3(c.OpenAPIV3Config, c.Version)
+ completeOpenAPI(c.OpenAPIConfig, c.EffectiveVersion.EmulationVersion())
+ completeOpenAPIV3(c.OpenAPIV3Config, c.EffectiveVersion.EmulationVersion())
if c.DiscoveryAddresses == nil {
c.DiscoveryAddresses = discovery.DefaultAddresses{DefaultAddress: c.ExternalAddress}
@@ -706,7 +724,7 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedCo
} else {
c.EquivalentResourceRegistry = runtime.NewEquivalentResourceRegistryWithIdentity(func(groupResource schema.GroupResource) string {
// use the storage prefix as the key if possible
- if opts, err := c.RESTOptionsGetter.GetRESTOptions(groupResource); err == nil {
+ if opts, err := c.RESTOptionsGetter.GetRESTOptions(groupResource, nil); err == nil {
return opts.ResourcePrefix
}
// otherwise return "" to use the default key (parent GV name)
@@ -799,28 +817,29 @@ func (c completedConfig) New(name string, delegationTarget DelegationTarget) (*G
preShutdownHooks: map[string]preShutdownHookEntry{},
disabledPostStartHooks: c.DisabledPostStartHooks,
- healthzChecks: c.HealthzChecks,
- livezChecks: c.LivezChecks,
- readyzChecks: c.ReadyzChecks,
+ healthzRegistry: healthCheckRegistry{path: "/healthz", checks: c.HealthzChecks},
+ livezRegistry: healthCheckRegistry{path: "/livez", checks: c.LivezChecks, clock: clock.RealClock{}},
+ readyzRegistry: healthCheckRegistry{path: "/readyz", checks: c.ReadyzChecks},
livezGracePeriod: c.LivezGracePeriod,
DiscoveryGroupManager: discovery.NewRootAPIsHandler(c.DiscoveryAddresses, c.Serializer),
maxRequestBodyBytes: c.MaxRequestBodyBytes,
- livezClock: clock.RealClock{},
lifecycleSignals: c.lifecycleSignals,
ShutdownSendRetryAfter: c.ShutdownSendRetryAfter,
APIServerID: c.APIServerID,
+ StorageReadinessHook: NewStorageReadinessHook(c.StorageInitializationTimeout),
StorageVersionManager: c.StorageVersionManager,
- Version: c.Version,
+ EffectiveVersion: c.EffectiveVersion,
+ FeatureGate: c.FeatureGate,
muxAndDiscoveryCompleteSignals: map[string]<-chan struct{}{},
}
- if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) {
+ if c.FeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) {
manager := c.AggregatedDiscoveryGroupManager
if manager == nil {
manager = discoveryendpoint.NewResourceManager("apis")
@@ -1012,6 +1031,10 @@ func DefaultBuildHandlerChain(apiHandler http.Handler, c *Config) http.Handler {
handler = genericfilters.WithCORS(handler, c.CorsAllowedOriginList, nil, nil, nil, "true")
+ // WithWarningRecorder must be wrapped by the timeout handler
+ // to make the addition of warning headers threadsafe
+ handler = genericapifilters.WithWarningRecorder(handler)
+
// WithTimeoutForNonLongRunningRequests will call the rest of the request handling in a go-routine with the
// context with deadline. The go-routine can keep running, while the timeout logic will return a timeout to the client.
handler = genericfilters.WithTimeoutForNonLongRunningRequests(handler, c.LongRunningFunc)
@@ -1025,17 +1048,22 @@ func DefaultBuildHandlerChain(apiHandler http.Handler, c *Config) http.Handler {
if c.SecureServing != nil && !c.SecureServing.DisableHTTP2 && c.GoawayChance > 0 {
handler = genericfilters.WithProbabilisticGoaway(handler, c.GoawayChance)
}
- handler = genericapifilters.WithWarningRecorder(handler)
handler = genericapifilters.WithCacheControl(handler)
handler = genericfilters.WithHSTS(handler, c.HSTSDirectives)
if c.ShutdownSendRetryAfter {
handler = genericfilters.WithRetryAfter(handler, c.lifecycleSignals.NotAcceptingNewRequest.Signaled())
}
handler = genericfilters.WithHTTPLogging(handler)
- if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerTracing) {
+ if c.FeatureGate.Enabled(genericfeatures.APIServerTracing) {
handler = genericapifilters.WithTracing(handler, c.TracerProvider)
}
handler = genericapifilters.WithLatencyTrackers(handler)
+ // WithRoutine will execute future handlers in a separate goroutine and serving
+ // handler in current goroutine to minimize the stack memory usage. It must be
+ // after WithPanicRecover() to be protected from panics.
+ if c.FeatureGate.Enabled(genericfeatures.APIServingWithRoutine) {
+ handler = routine.WithRoutine(handler, c.LongRunningFunc)
+ }
handler = genericapifilters.WithRequestInfo(handler, c.RequestInfoResolver)
handler = genericapifilters.WithRequestReceivedTimestamp(handler)
handler = genericapifilters.WithMuxAndDiscoveryComplete(handler, c.lifecycleSignals.MuxAndDiscoveryComplete.Signaled())
@@ -1074,10 +1102,10 @@ func installAPI(s *GenericAPIServer, c *Config) {
}
}
- routes.Version{Version: c.Version}.Install(s.Handler.GoRestfulContainer)
+ routes.Version{Version: c.EffectiveVersion.BinaryVersion().Info()}.Install(s.Handler.GoRestfulContainer)
if c.EnableDiscovery {
- if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) {
+ if c.FeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) {
wrapped := discoveryendpoint.WrapAggregatedDiscoveryToHandler(s.DiscoveryGroupManager, s.AggregatedDiscoveryGroupManager)
s.Handler.GoRestfulContainer.Add(wrapped.GenerateWebService("/apis", metav1.APIGroupList{}))
} else {
diff --git a/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go b/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go
index f14ed9213d1..28cc0bf05d3 100644
--- a/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go
+++ b/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go
@@ -17,6 +17,7 @@ limitations under the License.
package server
import (
+ "fmt"
"os"
"strconv"
"strings"
@@ -25,16 +26,15 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
- apimachineryversion "k8s.io/apimachinery/pkg/version"
+ apimachineryversion "k8s.io/apimachinery/pkg/util/version"
"k8s.io/apiserver/pkg/registry/rest"
"k8s.io/klog/v2"
)
// resourceExpirationEvaluator holds info for deciding if a particular rest.Storage needs to excluded from the API
type resourceExpirationEvaluator struct {
- currentMajor int
- currentMinor int
- isAlpha bool
+ currentVersion *apimachineryversion.Version
+ isAlpha bool
// This is usually set for testing for which tests need to be removed. This prevent insta-failing CI.
// Set KUBE_APISERVER_STRICT_REMOVED_API_HANDLING_IN_ALPHA to see what will be removed when we tag beta
strictRemovedHandlingInAlpha bool
@@ -53,30 +53,17 @@ type ResourceExpirationEvaluator interface {
ShouldServeForVersion(majorRemoved, minorRemoved int) bool
}
-func NewResourceExpirationEvaluator(currentVersion apimachineryversion.Info) (ResourceExpirationEvaluator, error) {
+func NewResourceExpirationEvaluator(currentVersion *apimachineryversion.Version) (ResourceExpirationEvaluator, error) {
+ if currentVersion == nil {
+ return nil, fmt.Errorf("empty NewResourceExpirationEvaluator currentVersion")
+ }
+ klog.V(1).Infof("NewResourceExpirationEvaluator with currentVersion: %s.", currentVersion)
ret := &resourceExpirationEvaluator{
strictRemovedHandlingInAlpha: false,
}
- if len(currentVersion.Major) > 0 {
- currentMajor64, err := strconv.ParseInt(currentVersion.Major, 10, 32)
- if err != nil {
- return nil, err
- }
- ret.currentMajor = int(currentMajor64)
- }
- if len(currentVersion.Minor) > 0 {
- // split the "normal" + and - for semver stuff
- minorString := strings.Split(currentVersion.Minor, "+")[0]
- minorString = strings.Split(minorString, "-")[0]
- minorString = strings.Split(minorString, ".")[0]
- currentMinor64, err := strconv.ParseInt(minorString, 10, 32)
- if err != nil {
- return nil, err
- }
- ret.currentMinor = int(currentMinor64)
- }
-
- ret.isAlpha = strings.Contains(currentVersion.GitVersion, "alpha")
+ // Only keeps the major and minor versions from input version.
+ ret.currentVersion = apimachineryversion.MajorMinor(currentVersion.Major(), currentVersion.Minor())
+ ret.isAlpha = strings.Contains(currentVersion.PreRelease(), "alpha")
if envString, ok := os.LookupEnv("KUBE_APISERVER_STRICT_REMOVED_API_HANDLING_IN_ALPHA"); !ok {
// do nothing
@@ -112,6 +99,15 @@ func (e *resourceExpirationEvaluator) shouldServe(gv schema.GroupVersion, versio
return false
}
+ introduced, ok := versionedPtr.(introducedInterface)
+ if ok {
+ majorIntroduced, minorIntroduced := introduced.APILifecycleIntroduced()
+ verIntroduced := apimachineryversion.MajorMinor(uint(majorIntroduced), uint(minorIntroduced))
+ if e.currentVersion.LessThan(verIntroduced) {
+ return false
+ }
+ }
+
removed, ok := versionedPtr.(removedInterface)
if !ok {
return true
@@ -121,16 +117,11 @@ func (e *resourceExpirationEvaluator) shouldServe(gv schema.GroupVersion, versio
}
func (e *resourceExpirationEvaluator) ShouldServeForVersion(majorRemoved, minorRemoved int) bool {
- if e.currentMajor < majorRemoved {
+ removedVer := apimachineryversion.MajorMinor(uint(majorRemoved), uint(minorRemoved))
+ if removedVer.GreaterThan(e.currentVersion) {
return true
}
- if e.currentMajor > majorRemoved {
- return false
- }
- if e.currentMinor < minorRemoved {
- return true
- }
- if e.currentMinor > minorRemoved {
+ if removedVer.LessThan(e.currentVersion) {
return false
}
// at this point major and minor are equal, so this API should be removed when the current release GAs.
@@ -152,6 +143,11 @@ type removedInterface interface {
APILifecycleRemoved() (major, minor int)
}
+// Object interface generated from "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+type introducedInterface interface {
+ APILifecycleIntroduced() (major, minor int)
+}
+
// removeDeletedKinds inspects the storage map and modifies it in place by removing storage for kinds that have been deleted.
// versionedResourcesStorageMap mirrors the field on APIGroupInfo, it's a map from version to resource to the storage.
func (e *resourceExpirationEvaluator) RemoveDeletedKinds(groupName string, versioner runtime.ObjectVersioner, versionedResourcesStorageMap map[string]map[string]rest.Storage) {
@@ -171,6 +167,8 @@ func (e *resourceExpirationEvaluator) RemoveDeletedKinds(groupName string, versi
}
klog.V(1).Infof("Removing resource %v.%v.%v because it is time to stop serving it per APILifecycle.", resourceName, apiVersion, groupName)
+ storage := versionToResource[resourceName]
+ storage.Destroy()
delete(versionToResource, resourceName)
}
versionedResourcesStorageMap[apiVersion] = versionToResource
diff --git a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go
index 428fd66bae7..845a45fab31 100644
--- a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go
+++ b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go
@@ -54,7 +54,7 @@ type ConfigMapCAController struct {
listeners []Listener
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[string]
// preRunCaches are the caches to sync before starting the work of this control loop
preRunCaches []cache.InformerSynced
}
@@ -94,7 +94,10 @@ func NewDynamicCAFromConfigMapController(purpose, namespace, name, key string, k
configmapLister: configmapLister,
configMapInformer: uncastConfigmapInformer,
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), fmt.Sprintf("DynamicConfigMapCABundle-%s", purpose)),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig(
+ workqueue.DefaultTypedControllerRateLimiter[string](),
+ workqueue.TypedRateLimitingQueueConfig[string]{Name: fmt.Sprintf("DynamicConfigMapCABundle-%s", purpose)},
+ ),
preRunCaches: []cache.InformerSynced{uncastConfigmapInformer.HasSynced},
}
diff --git a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go
index 75bc49e9931..1f32adf9e46 100644
--- a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go
+++ b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go
@@ -60,7 +60,7 @@ type DynamicFileCAContent struct {
listeners []Listener
// queue only ever has one item, but it has nice error handling backoff/retry semantics
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[string]
}
var _ Notifier = &DynamicFileCAContent{}
@@ -82,7 +82,10 @@ func NewDynamicCAContentFromFile(purpose, filename string) (*DynamicFileCAConten
ret := &DynamicFileCAContent{
name: name,
filename: filename,
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), fmt.Sprintf("DynamicCABundle-%s", purpose)),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig(
+ workqueue.DefaultTypedControllerRateLimiter[string](),
+ workqueue.TypedRateLimitingQueueConfig[string]{Name: fmt.Sprintf("DynamicCABundle-%s", purpose)},
+ ),
}
if err := ret.loadCABundle(); err != nil {
return nil, err
diff --git a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go
index 62aef4992c5..e0dd0474b1c 100644
--- a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go
+++ b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go
@@ -47,7 +47,7 @@ type DynamicCertKeyPairContent struct {
listeners []Listener
// queue only ever has one item, but it has nice error handling backoff/retry semantics
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[string]
}
var _ CertKeyContentProvider = &DynamicCertKeyPairContent{}
@@ -64,7 +64,10 @@ func NewDynamicServingContentFromFiles(purpose, certFile, keyFile string) (*Dyna
name: name,
certFile: certFile,
keyFile: keyFile,
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), fmt.Sprintf("DynamicCABundle-%s", purpose)),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig(
+ workqueue.DefaultTypedControllerRateLimiter[string](),
+ workqueue.TypedRateLimitingQueueConfig[string]{Name: fmt.Sprintf("DynamicCABundle-%s", purpose)},
+ ),
}
if err := ret.loadCertKeyPair(); err != nil {
return nil, err
diff --git a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go
index 56e7ffd2755..61bd6fded6a 100644
--- a/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go
+++ b/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go
@@ -56,7 +56,7 @@ type DynamicServingCertificateController struct {
currentServingTLSConfig atomic.Value
// queue only ever has one item, but it has nice error handling backoff/retry semantics
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[string]
eventRecorder events.EventRecorder
}
@@ -76,7 +76,10 @@ func NewDynamicServingCertificateController(
servingCert: servingCert,
sniCerts: sniCerts,
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "DynamicServingCertificateController"),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig(
+ workqueue.DefaultTypedControllerRateLimiter[string](),
+ workqueue.TypedRateLimitingQueueConfig[string]{Name: "DynamicServingCertificateController"},
+ ),
eventRecorder: eventRecorder,
}
diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go b/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go
index 432851a631c..e9438732213 100644
--- a/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go
+++ b/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go
@@ -137,9 +137,7 @@ func (t *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
metrics.RecordRequestPostTimeout(metrics.PostTimeoutSourceTimeoutHandler, status)
- err := fmt.Errorf("post-timeout activity - time-elapsed: %s, %v %q result: %v",
- time.Since(timedOutAt), r.Method, r.URL.Path, res)
- utilruntime.HandleError(err)
+ utilruntime.HandleErrorWithContext(r.Context(), nil, "Post-timeout activity", "timeElapsed", time.Since(timedOutAt), "method", r.Method, "path", r.URL.Path, "result", res)
}()
}()
httplog.SetStacktracePredicate(r.Context(), func(status int) bool {
diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go b/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go
index a981eae78a8..73ce2702604 100644
--- a/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go
+++ b/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go
@@ -17,7 +17,6 @@ limitations under the License.
package filters
import (
- "fmt"
"net/http"
"k8s.io/apimachinery/pkg/util/runtime"
@@ -51,7 +50,7 @@ func WithPanicRecovery(handler http.Handler, resolver request.RequestInfoResolve
// This call can have different handlers, but the default chain rate limits. Call it after the metrics are updated
// in case the rate limit delays it. If you outrun the rate for this one timed out requests, something has gone
// seriously wrong with your server, but generally having a logging signal for timeouts is useful.
- runtime.HandleError(fmt.Errorf("timeout or abort while handling: method=%v URI=%q audit-ID=%q", req.Method, req.RequestURI, audit.GetAuditIDTruncated(req.Context())))
+ runtime.HandleErrorWithContext(req.Context(), nil, "Timeout or abort while handling", "method", req.Method, "URI", req.RequestURI, "auditID", audit.GetAuditIDTruncated(req.Context()))
return
}
http.Error(w, "This request caused apiserver to panic. Look in the logs for details.", http.StatusInternalServerError)
diff --git a/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go b/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go
index 450c7d4f64b..52fb449ac6e 100644
--- a/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go
+++ b/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go
@@ -29,7 +29,7 @@ import (
systemd "github.com/coreos/go-systemd/v22/daemon"
"golang.org/x/time/rate"
- apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
+ apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -38,8 +38,8 @@ import (
"k8s.io/apimachinery/pkg/util/managedfields"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/apimachinery/pkg/util/wait"
utilwaitgroup "k8s.io/apimachinery/pkg/util/waitgroup"
- "k8s.io/apimachinery/pkg/version"
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/audit"
"k8s.io/apiserver/pkg/authorization/authorizer"
@@ -51,8 +51,9 @@ import (
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/apiserver/pkg/server/routes"
"k8s.io/apiserver/pkg/storageversion"
- utilfeature "k8s.io/apiserver/pkg/util/feature"
+ utilversion "k8s.io/apiserver/pkg/util/version"
restclient "k8s.io/client-go/rest"
+ "k8s.io/component-base/featuregate"
"k8s.io/klog/v2"
openapibuilder3 "k8s.io/kube-openapi/pkg/builder3"
openapicommon "k8s.io/kube-openapi/pkg/common"
@@ -60,7 +61,6 @@ import (
"k8s.io/kube-openapi/pkg/handler3"
openapiutil "k8s.io/kube-openapi/pkg/util"
"k8s.io/kube-openapi/pkg/validation/spec"
- "k8s.io/utils/clock"
)
// Info about an API group.
@@ -191,19 +191,11 @@ type GenericAPIServer struct {
preShutdownHooksCalled bool
// healthz checks
- healthzLock sync.Mutex
- healthzChecks []healthz.HealthChecker
- healthzChecksInstalled bool
- // livez checks
- livezLock sync.Mutex
- livezChecks []healthz.HealthChecker
- livezChecksInstalled bool
- // readyz checks
- readyzLock sync.Mutex
- readyzChecks []healthz.HealthChecker
- readyzChecksInstalled bool
- livezGracePeriod time.Duration
- livezClock clock.Clock
+ healthzRegistry healthCheckRegistry
+ readyzRegistry healthCheckRegistry
+ livezRegistry healthCheckRegistry
+
+ livezGracePeriod time.Duration
// auditing. The backend is started before the server starts listening.
AuditBackend audit.Backend
@@ -241,11 +233,18 @@ type GenericAPIServer struct {
// APIServerID is the ID of this API server
APIServerID string
+ // StorageReadinessHook implements post-start-hook functionality for checking readiness
+ // of underlying storage for registered resources.
+ StorageReadinessHook *StorageReadinessHook
+
// StorageVersionManager holds the storage versions of the API resources installed by this server.
StorageVersionManager storageversion.Manager
- // Version will enable the /version endpoint if non-nil
- Version *version.Info
+ // EffectiveVersion determines which apis and features are available
+ // based on when the api/feature lifecyle.
+ EffectiveVersion utilversion.EffectiveVersion
+ // FeatureGate is a way to plumb feature gate through if you have them.
+ FeatureGate featuregate.FeatureGate
// lifecycleSignals provides access to the various signals that happen during the life cycle of the apiserver.
lifecycleSignals lifecycleSignals
@@ -330,7 +329,7 @@ func (s *GenericAPIServer) PreShutdownHooks() map[string]preShutdownHookEntry {
return s.preShutdownHooks
}
func (s *GenericAPIServer) HealthzChecks() []healthz.HealthChecker {
- return s.healthzChecks
+ return s.healthzRegistry.checks
}
func (s *GenericAPIServer) ListedPaths() []string {
return s.listedPathProvider.ListedPaths()
@@ -451,9 +450,19 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
// Run spawns the secure http server. It only returns if stopCh is closed
// or the secure port cannot be listened on initially.
-// This is the diagram of what channels/signals are dependent on each other:
//
-// | stopCh
+// Deprecated: use RunWithContext instead. Run will not get removed to avoid
+// breaking consumers, but should not be used in new code.
+func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
+ ctx := wait.ContextForChannel(stopCh)
+ return s.RunWithContext(ctx)
+}
+
+// RunWithContext spawns the secure http server. It only returns if ctx is canceled
+// or the secure port cannot be listened on initially.
+// This is the diagram of what contexts/channels/signals are dependent on each other:
+//
+// | ctx
// | |
// | ---------------------------------------------------------
// | | |
@@ -486,12 +495,13 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
// | | | |
// | |-------------------|---------------------|----------------------------------------|
// | | |
-// | stopHttpServerCh (AuditBackend::Shutdown())
+// | stopHttpServerCtx (AuditBackend::Shutdown())
// | |
// | listenerStoppedCh
// | |
// | HTTPServerStoppedListening (httpServerStoppedListeningCh)
-func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
+func (s preparedGenericAPIServer) RunWithContext(ctx context.Context) error {
+ stopCh := ctx.Done()
delayedStopCh := s.lifecycleSignals.AfterShutdownDelayDuration
shutdownInitiatedCh := s.lifecycleSignals.ShutdownInitiated
@@ -553,9 +563,11 @@ func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
notAcceptingNewRequestCh := s.lifecycleSignals.NotAcceptingNewRequest
drainedCh := s.lifecycleSignals.InFlightRequestsDrained
- stopHttpServerCh := make(chan struct{})
+ // Canceling the parent context does not immediately cancel the HTTP server.
+ // We only inherit context values here and deal with cancellation ourselves.
+ stopHTTPServerCtx, stopHTTPServer := context.WithCancelCause(context.WithoutCancel(ctx))
go func() {
- defer close(stopHttpServerCh)
+ defer stopHTTPServer(errors.New("time to stop HTTP server"))
timeToStopHttpServerCh := notAcceptingNewRequestCh.Signaled()
if s.ShutdownSendRetryAfter {
@@ -574,7 +586,7 @@ func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
}
}
- stoppedCh, listenerStoppedCh, err := s.NonBlockingRun(stopHttpServerCh, shutdownTimeout)
+ stoppedCh, listenerStoppedCh, err := s.NonBlockingRunWithContext(stopHTTPServerCtx, shutdownTimeout)
if err != nil {
return err
}
@@ -703,7 +715,18 @@ func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
// NonBlockingRun spawns the secure http server. An error is
// returned if the secure port cannot be listened on.
// The returned channel is closed when the (asynchronous) termination is finished.
+//
+// Deprecated: use RunWithContext instead. Run will not get removed to avoid
+// breaking consumers, but should not be used in new code.
func (s preparedGenericAPIServer) NonBlockingRun(stopCh <-chan struct{}, shutdownTimeout time.Duration) (<-chan struct{}, <-chan struct{}, error) {
+ ctx := wait.ContextForChannel(stopCh)
+ return s.NonBlockingRunWithContext(ctx, shutdownTimeout)
+}
+
+// NonBlockingRunWithContext spawns the secure http server. An error is
+// returned if the secure port cannot be listened on.
+// The returned channel is closed when the (asynchronous) termination is finished.
+func (s preparedGenericAPIServer) NonBlockingRunWithContext(ctx context.Context, shutdownTimeout time.Duration) (<-chan struct{}, <-chan struct{}, error) {
// Use an internal stop channel to allow cleanup of the listeners on error.
internalStopCh := make(chan struct{})
var stoppedCh <-chan struct{}
@@ -721,11 +744,11 @@ func (s preparedGenericAPIServer) NonBlockingRun(stopCh <-chan struct{}, shutdow
// responsibility of the caller to close the provided channel to
// ensure cleanup.
go func() {
- <-stopCh
+ <-ctx.Done()
close(internalStopCh)
}()
- s.RunPostStartHooks(stopCh)
+ s.RunPostStartHooks(ctx)
if _, err := systemd.SdNotify(true, "READY=1\n"); err != nil {
klog.Errorf("Unable to send systemd daemon successful start message: %v\n", err)
@@ -760,13 +783,13 @@ func (s *GenericAPIServer) installAPIResources(apiPrefix string, apiGroupInfo *A
}
resourceInfos = append(resourceInfos, r...)
- if utilfeature.DefaultFeatureGate.Enabled(features.AggregatedDiscoveryEndpoint) {
+ if s.FeatureGate.Enabled(features.AggregatedDiscoveryEndpoint) {
// Aggregated discovery only aggregates resources under /apis
if apiPrefix == APIGroupPrefix {
s.AggregatedDiscoveryGroupManager.AddGroupVersion(
groupVersion.Group,
- apidiscoveryv2beta1.APIVersionDiscovery{
- Freshness: apidiscoveryv2beta1.DiscoveryFreshnessCurrent,
+ apidiscoveryv2.APIVersionDiscovery{
+ Freshness: apidiscoveryv2.DiscoveryFreshnessCurrent,
Version: groupVersion.Version,
Resources: discoveryAPIResources,
},
@@ -775,8 +798,8 @@ func (s *GenericAPIServer) installAPIResources(apiPrefix string, apiGroupInfo *A
// There is only one group version for legacy resources, priority can be defaulted to 0.
s.AggregatedLegacyDiscoveryGroupManager.AddGroupVersion(
groupVersion.Group,
- apidiscoveryv2beta1.APIVersionDiscovery{
- Freshness: apidiscoveryv2beta1.DiscoveryFreshnessCurrent,
+ apidiscoveryv2.APIVersionDiscovery{
+ Freshness: apidiscoveryv2.DiscoveryFreshnessCurrent,
Version: groupVersion.Version,
Resources: discoveryAPIResources,
},
@@ -788,8 +811,8 @@ func (s *GenericAPIServer) installAPIResources(apiPrefix string, apiGroupInfo *A
s.RegisterDestroyFunc(apiGroupInfo.destroyStorage)
- if utilfeature.DefaultFeatureGate.Enabled(features.StorageVersionAPI) &&
- utilfeature.DefaultFeatureGate.Enabled(features.APIServerIdentity) {
+ if s.FeatureGate.Enabled(features.StorageVersionAPI) &&
+ s.FeatureGate.Enabled(features.APIServerIdentity) {
// API installation happens before we start listening on the handlers,
// therefore it is safe to register ResourceInfos here. The handler will block
// write requests until the storage versions of the targeting resources are updated.
@@ -819,12 +842,13 @@ func (s *GenericAPIServer) InstallLegacyAPIGroup(apiPrefix string, apiGroupInfo
// Install the version handler.
// Add a handler at / to enumerate the supported api versions.
legacyRootAPIHandler := discovery.NewLegacyRootAPIHandler(s.discoveryAddresses, s.Serializer, apiPrefix)
- if utilfeature.DefaultFeatureGate.Enabled(features.AggregatedDiscoveryEndpoint) {
+ if s.FeatureGate.Enabled(features.AggregatedDiscoveryEndpoint) {
wrapped := discoveryendpoint.WrapAggregatedDiscoveryToHandler(legacyRootAPIHandler, s.AggregatedLegacyDiscoveryGroupManager)
s.Handler.GoRestfulContainer.Add(wrapped.GenerateWebService("/api", metav1.APIVersions{}))
} else {
s.Handler.GoRestfulContainer.Add(legacyRootAPIHandler.WebService())
}
+ s.registerStorageReadinessCheck("", apiGroupInfo)
return nil
}
@@ -883,10 +907,28 @@ func (s *GenericAPIServer) InstallAPIGroups(apiGroupInfos ...*APIGroupInfo) erro
s.DiscoveryGroupManager.AddGroup(apiGroup)
s.Handler.GoRestfulContainer.Add(discovery.NewAPIGroupHandler(s.Serializer, apiGroup).WebService())
+ s.registerStorageReadinessCheck(apiGroupInfo.PrioritizedVersions[0].Group, apiGroupInfo)
}
return nil
}
+// registerStorageReadinessCheck registers the readiness checks for all underlying storages
+// for a given APIGroup.
+func (s *GenericAPIServer) registerStorageReadinessCheck(groupName string, apiGroupInfo *APIGroupInfo) {
+ for version, storageMap := range apiGroupInfo.VersionedResourcesStorageMap {
+ for resource, storage := range storageMap {
+ if withReadiness, ok := storage.(rest.StorageWithReadiness); ok {
+ gvr := metav1.GroupVersionResource{
+ Group: groupName,
+ Version: version,
+ Resource: resource,
+ }
+ s.StorageReadinessHook.RegisterStorage(gvr, withReadiness)
+ }
+ }
+ }
+}
+
// InstallAPIGroup exposes the given api group in the API.
// The passed into this function shouldn't be used elsewhere as the
// underlying storage will be destroyed on this servers shutdown.
diff --git a/vendor/k8s.io/apiserver/pkg/server/healthz.go b/vendor/k8s.io/apiserver/pkg/server/healthz.go
index d6d13444d70..96da308e8c5 100644
--- a/vendor/k8s.io/apiserver/pkg/server/healthz.go
+++ b/vendor/k8s.io/apiserver/pkg/server/healthz.go
@@ -19,12 +19,60 @@ package server
import (
"fmt"
"net/http"
+ "sync"
"time"
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/utils/clock"
)
+// healthMux is an interface describing the methods InstallHandler requires.
+type healthMux interface {
+ Handle(pattern string, handler http.Handler)
+}
+
+type healthCheckRegistry struct {
+ path string
+ lock sync.Mutex
+ checks []healthz.HealthChecker
+ checksInstalled bool
+ clock clock.Clock
+}
+
+func (reg *healthCheckRegistry) addHealthChecks(checks ...healthz.HealthChecker) error {
+ return reg.addDelayedHealthChecks(0, checks...)
+}
+
+func (reg *healthCheckRegistry) addDelayedHealthChecks(delay time.Duration, checks ...healthz.HealthChecker) error {
+ if delay > 0 && reg.clock == nil {
+ return fmt.Errorf("nil clock in healthCheckRegistry for %s endpoint", reg.path)
+ }
+ reg.lock.Lock()
+ defer reg.lock.Unlock()
+ if reg.checksInstalled {
+ return fmt.Errorf("unable to add because the %s endpoint has already been created", reg.path)
+ }
+ if delay > 0 {
+ for _, check := range checks {
+ reg.checks = append(reg.checks, delayedHealthCheck(check, reg.clock, delay))
+ }
+ } else {
+ reg.checks = append(reg.checks, checks...)
+ }
+ return nil
+}
+
+func (reg *healthCheckRegistry) installHandler(mux healthMux) {
+ reg.installHandlerWithHealthyFunc(mux, nil)
+}
+
+func (reg *healthCheckRegistry) installHandlerWithHealthyFunc(mux healthMux, firstTimeHealthy func()) {
+ reg.lock.Lock()
+ defer reg.lock.Unlock()
+ reg.checksInstalled = true
+ healthz.InstallPathHandlerWithHealthyFunc(mux, reg.path, firstTimeHealthy, reg.checks...)
+}
+
// AddHealthChecks adds HealthCheck(s) to health endpoints (healthz, livez, readyz) but
// configures the liveness grace period to be zero, which means we expect this health check
// to immediately indicate that the apiserver is unhealthy.
@@ -47,93 +95,48 @@ func (s *GenericAPIServer) AddBootSequenceHealthChecks(checks ...healthz.HealthC
// addHealthChecks adds health checks to healthz, livez, and readyz. The delay passed in will set
// a corresponding grace period on livez.
func (s *GenericAPIServer) addHealthChecks(livezGracePeriod time.Duration, checks ...healthz.HealthChecker) error {
- s.healthzLock.Lock()
- defer s.healthzLock.Unlock()
- if s.healthzChecksInstalled {
- return fmt.Errorf("unable to add because the healthz endpoint has already been created")
+ if err := s.healthzRegistry.addHealthChecks(checks...); err != nil {
+ return err
}
- s.healthzChecks = append(s.healthzChecks, checks...)
- if err := s.AddLivezChecks(livezGracePeriod, checks...); err != nil {
+ if err := s.livezRegistry.addDelayedHealthChecks(livezGracePeriod, checks...); err != nil {
return err
}
- return s.AddReadyzChecks(checks...)
+ return s.readyzRegistry.addHealthChecks(checks...)
}
// AddReadyzChecks allows you to add a HealthCheck to readyz.
func (s *GenericAPIServer) AddReadyzChecks(checks ...healthz.HealthChecker) error {
- s.readyzLock.Lock()
- defer s.readyzLock.Unlock()
- if s.readyzChecksInstalled {
- return fmt.Errorf("unable to add because the readyz endpoint has already been created")
- }
- s.readyzChecks = append(s.readyzChecks, checks...)
- return nil
+ return s.readyzRegistry.addHealthChecks(checks...)
}
// AddLivezChecks allows you to add a HealthCheck to livez.
func (s *GenericAPIServer) AddLivezChecks(delay time.Duration, checks ...healthz.HealthChecker) error {
- s.livezLock.Lock()
- defer s.livezLock.Unlock()
- if s.livezChecksInstalled {
- return fmt.Errorf("unable to add because the livez endpoint has already been created")
- }
- for _, check := range checks {
- s.livezChecks = append(s.livezChecks, delayedHealthCheck(check, s.livezClock, delay))
- }
- return nil
+ return s.livezRegistry.addDelayedHealthChecks(delay, checks...)
}
// addReadyzShutdownCheck is a convenience function for adding a readyz shutdown check, so
// that we can register that the api-server is no longer ready while we attempt to gracefully
// shutdown.
func (s *GenericAPIServer) addReadyzShutdownCheck(stopCh <-chan struct{}) error {
- return s.AddReadyzChecks(shutdownCheck{stopCh})
+ return s.AddReadyzChecks(healthz.NewShutdownHealthz(stopCh))
}
// installHealthz creates the healthz endpoint for this server
func (s *GenericAPIServer) installHealthz() {
- s.healthzLock.Lock()
- defer s.healthzLock.Unlock()
- s.healthzChecksInstalled = true
- healthz.InstallHandler(s.Handler.NonGoRestfulMux, s.healthzChecks...)
+ s.healthzRegistry.installHandler(s.Handler.NonGoRestfulMux)
}
// installReadyz creates the readyz endpoint for this server.
func (s *GenericAPIServer) installReadyz() {
- s.readyzLock.Lock()
- defer s.readyzLock.Unlock()
- s.readyzChecksInstalled = true
- healthz.InstallReadyzHandlerWithHealthyFunc(s.Handler.NonGoRestfulMux, func() {
- // note: InstallReadyzHandlerWithHealthyFunc guarantees that this is called only once
+ s.readyzRegistry.installHandlerWithHealthyFunc(s.Handler.NonGoRestfulMux, func() {
+ // note: installHandlerWithHealthyFunc guarantees that this is called only once
s.lifecycleSignals.HasBeenReady.Signal()
- }, s.readyzChecks...)
+ })
}
// installLivez creates the livez endpoint for this server.
func (s *GenericAPIServer) installLivez() {
- s.livezLock.Lock()
- defer s.livezLock.Unlock()
- s.livezChecksInstalled = true
- healthz.InstallLivezHandler(s.Handler.NonGoRestfulMux, s.livezChecks...)
-}
-
-// shutdownCheck fails if the embedded channel is closed. This is intended to allow for graceful shutdown sequences
-// for the apiserver.
-type shutdownCheck struct {
- StopCh <-chan struct{}
-}
-
-func (shutdownCheck) Name() string {
- return "shutdown"
-}
-
-func (c shutdownCheck) Check(req *http.Request) error {
- select {
- case <-c.StopCh:
- return fmt.Errorf("process is shutting down")
- default:
- }
- return nil
+ s.livezRegistry.installHandler(s.Handler.NonGoRestfulMux)
}
// delayedHealthCheck wraps a health check which will not fail until the explicitly defined delay has elapsed. This
diff --git a/vendor/k8s.io/apiserver/pkg/server/healthz/healthz.go b/vendor/k8s.io/apiserver/pkg/server/healthz/healthz.go
index 63ff59750f0..76f5745b336 100644
--- a/vendor/k8s.io/apiserver/pkg/server/healthz/healthz.go
+++ b/vendor/k8s.io/apiserver/pkg/server/healthz/healthz.go
@@ -105,6 +105,29 @@ func (i *informerSync) Name() string {
return "informer-sync"
}
+type shutdown struct {
+ stopCh <-chan struct{}
+}
+
+// NewShutdownHealthz returns a new HealthChecker that will fail if the embedded channel is closed.
+// This is intended to allow for graceful shutdown sequences.
+func NewShutdownHealthz(stopCh <-chan struct{}) HealthChecker {
+ return &shutdown{stopCh}
+}
+
+func (s *shutdown) Name() string {
+ return "shutdown"
+}
+
+func (s *shutdown) Check(req *http.Request) error {
+ select {
+ case <-s.stopCh:
+ return fmt.Errorf("process is shutting down")
+ default:
+ }
+ return nil
+}
+
func (i *informerSync) Check(_ *http.Request) error {
stopCh := make(chan struct{})
// Close stopCh to force checking if informers are synced now.
@@ -142,12 +165,6 @@ func InstallReadyzHandler(mux mux, checks ...HealthChecker) {
InstallPathHandler(mux, "/readyz", checks...)
}
-// InstallReadyzHandlerWithHealthyFunc is like InstallReadyzHandler, but in addition call firstTimeReady
-// the first time /readyz succeeds.
-func InstallReadyzHandlerWithHealthyFunc(mux mux, firstTimeReady func(), checks ...HealthChecker) {
- InstallPathHandlerWithHealthyFunc(mux, "/readyz", firstTimeReady, checks...)
-}
-
// InstallLivezHandler registers handlers for liveness checking on the path
// "/livez" to mux. *All handlers* for mux must be specified in
// exactly one call to InstallHandler. Calling InstallHandler more
diff --git a/vendor/k8s.io/apiserver/pkg/server/hooks.go b/vendor/k8s.io/apiserver/pkg/server/hooks.go
index 065df6bc5cc..1561d7a8475 100644
--- a/vendor/k8s.io/apiserver/pkg/server/hooks.go
+++ b/vendor/k8s.io/apiserver/pkg/server/hooks.go
@@ -17,6 +17,7 @@ limitations under the License.
package server
import (
+ "context"
"errors"
"fmt"
"net/http"
@@ -48,8 +49,13 @@ type PreShutdownHookFunc func() error
type PostStartHookContext struct {
// LoopbackClientConfig is a config for a privileged loopback connection to the API server
LoopbackClientConfig *restclient.Config
- // StopCh is the channel that will be closed when the server stops
+ // StopCh is the channel that will be closed when the server stops.
+ //
+ // Deprecated: use the PostStartHookContext itself instead, it contains a context that
+ // gets cancelled when the server stops. StopCh keeps getting provided for existing code.
StopCh <-chan struct{}
+ // Context gets cancelled when the server stops.
+ context.Context
}
// PostStartHookProvider is an interface in addition to provide a post start hook for the api server
@@ -151,15 +157,16 @@ func (s *GenericAPIServer) AddPreShutdownHookOrDie(name string, hook PreShutdown
}
}
-// RunPostStartHooks runs the PostStartHooks for the server
-func (s *GenericAPIServer) RunPostStartHooks(stopCh <-chan struct{}) {
+// RunPostStartHooks runs the PostStartHooks for the server.
+func (s *GenericAPIServer) RunPostStartHooks(ctx context.Context) {
s.postStartHookLock.Lock()
defer s.postStartHookLock.Unlock()
s.postStartHooksCalled = true
context := PostStartHookContext{
LoopbackClientConfig: s.LoopbackClientConfig,
- StopCh: stopCh,
+ StopCh: ctx.Done(),
+ Context: ctx,
}
for hookName, hookEntry := range s.postStartHooks {
diff --git a/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go b/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go
index a4b4c5899fd..c64f5771d8b 100644
--- a/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go
+++ b/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go
@@ -31,6 +31,7 @@ import (
"k8s.io/apiserver/pkg/endpoints/metrics"
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/endpoints/responsewriter"
+ "k8s.io/apiserver/pkg/server/routine"
"k8s.io/klog/v2"
)
@@ -125,10 +126,26 @@ func withLogging(handler http.Handler, stackTracePred StacktracePred, shouldLogR
rl := newLoggedWithStartTime(req, w, startTime)
rl.StacktraceWhen(stackTracePred)
req = req.WithContext(context.WithValue(ctx, respLoggerContextKey, rl))
- defer rl.Log()
+
+ var logFunc func()
+ logFunc = rl.Log
+ defer func() {
+ if logFunc != nil {
+ logFunc()
+ }
+ }()
w = responsewriter.WrapForHTTP1Or2(rl)
handler.ServeHTTP(w, req)
+
+ // We need to ensure that the request is logged after it is processed.
+ // In case the request is executed in a separate goroutine created via
+ // WithRoutine handler in the handler chain (i.e. above handler.ServeHTTP()
+ // would return request is completely responsed), we want the logging to
+ // happen in that goroutine too, so we append it to the task.
+ if routine.AppendTask(ctx, &routine.Task{Func: rl.Log}) {
+ logFunc = nil
+ }
})
}
diff --git a/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go b/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go
index beb7a8d807c..3ed92d96c6d 100644
--- a/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go
+++ b/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go
@@ -96,9 +96,11 @@ func NewPathRecorderMux(name string) *PathRecorderMux {
// ListedPaths returns the registered handler exposedPaths.
func (m *PathRecorderMux) ListedPaths() []string {
+ m.lock.Lock()
handledPaths := append([]string{}, m.exposedPaths...)
- sort.Strings(handledPaths)
+ m.lock.Unlock()
+ sort.Strings(handledPaths)
return handledPaths
}
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/admission.go b/vendor/k8s.io/apiserver/pkg/server/options/admission.go
index 6f4990a7e2c..61085e94ebd 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/admission.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/admission.go
@@ -19,26 +19,30 @@ package options
import (
"fmt"
"strings"
+ "time"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
+ utilwait "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/admission/initializer"
admissionmetrics "k8s.io/apiserver/pkg/admission/metrics"
"k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle"
- "k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy"
+ validatingadmissionpolicy "k8s.io/apiserver/pkg/admission/plugin/policy/validating"
mutatingwebhook "k8s.io/apiserver/pkg/admission/plugin/webhook/mutating"
validatingwebhook "k8s.io/apiserver/pkg/admission/plugin/webhook/validating"
apiserverapi "k8s.io/apiserver/pkg/apis/apiserver"
apiserverapiv1 "k8s.io/apiserver/pkg/apis/apiserver/v1"
apiserverapiv1alpha1 "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1"
"k8s.io/apiserver/pkg/server"
+ cacheddiscovery "k8s.io/client-go/discovery/cached/memory"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
+ "k8s.io/client-go/restmapper"
"k8s.io/component-base/featuregate"
)
@@ -55,7 +59,7 @@ type AdmissionOptions struct {
// RecommendedPluginOrder holds an ordered list of plugin names we recommend to use by default
RecommendedPluginOrder []string
// DefaultOffPlugins is a set of plugin names that is disabled by default
- DefaultOffPlugins sets.String
+ DefaultOffPlugins sets.Set[string]
// EnablePlugins indicates plugins to be enabled passed through `--enable-admission-plugins`.
EnablePlugins []string
@@ -87,7 +91,7 @@ func NewAdmissionOptions() *AdmissionOptions {
// after all the mutating ones, so their relative order in this list
// doesn't matter.
RecommendedPluginOrder: []string{lifecycle.PluginName, mutatingwebhook.PluginName, validatingadmissionpolicy.PluginName, validatingwebhook.PluginName},
- DefaultOffPlugins: sets.NewString(),
+ DefaultOffPlugins: sets.Set[string]{},
}
server.RegisterAllAdmissionPlugins(options.Plugins)
return options
@@ -135,6 +139,9 @@ func (a *AdmissionOptions) ApplyTo(
if informers == nil {
return fmt.Errorf("admission depends on a Kubernetes core API shared informer, it cannot be nil")
}
+ if kubeClient == nil || dynamicClient == nil {
+ return fmt.Errorf("admission depends on a Kubernetes core API client, it cannot be nil")
+ }
pluginNames := a.enabledPluginNames()
@@ -143,11 +150,24 @@ func (a *AdmissionOptions) ApplyTo(
return fmt.Errorf("failed to read plugin config: %v", err)
}
+ discoveryClient := cacheddiscovery.NewMemCacheClient(kubeClient.Discovery())
+ discoveryRESTMapper := restmapper.NewDeferredDiscoveryRESTMapper(discoveryClient)
genericInitializer := initializer.New(kubeClient, dynamicClient, informers, c.Authorization.Authorizer, features,
- c.DrainedNotify())
+ c.DrainedNotify(), discoveryRESTMapper)
initializersChain := admission.PluginInitializers{genericInitializer}
initializersChain = append(initializersChain, pluginInitializers...)
+ admissionPostStartHook := func(context server.PostStartHookContext) error {
+ discoveryRESTMapper.Reset()
+ go utilwait.Until(discoveryRESTMapper.Reset, 30*time.Second, context.StopCh)
+ return nil
+ }
+
+ err = c.AddPostStartHook("start-apiserver-admission-initializer", admissionPostStartHook)
+ if err != nil {
+ return fmt.Errorf("failed to add post start hook for policy admission: %w", err)
+ }
+
admissionChain, err := a.Plugins.NewFromPlugins(pluginNames, pluginsConfigProvider, initializersChain, a.Decorators)
if err != nil {
return err
@@ -206,7 +226,7 @@ func (a *AdmissionOptions) Validate() []error {
// EnablePlugins, DisablePlugins fields
// to prepare a list of ordered plugin names that are enabled.
func (a *AdmissionOptions) enabledPluginNames() []string {
- allOffPlugins := append(a.DefaultOffPlugins.List(), a.DisablePlugins...)
+ allOffPlugins := append(sets.List[string](a.DefaultOffPlugins), a.DisablePlugins...)
disabledPlugins := sets.NewString(allOffPlugins...)
enabledPlugins := sets.NewString(a.EnablePlugins...)
disabledPlugins = disabledPlugins.Difference(enabledPlugins)
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/authentication.go b/vendor/k8s.io/apiserver/pkg/server/options/authentication.go
index e9a61d30b96..c40e4cf4344 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/authentication.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/authentication.go
@@ -26,6 +26,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/apiserver/pkg/apis/apiserver"
"k8s.io/apiserver/pkg/authentication/authenticatorfactory"
"k8s.io/apiserver/pkg/authentication/request/headerrequest"
"k8s.io/apiserver/pkg/server"
@@ -222,8 +223,8 @@ type DelegatingAuthenticationOptions struct {
// CustomRoundTripperFn allows for specifying a middleware function for custom HTTP behaviour for the authentication webhook client.
CustomRoundTripperFn transport.WrapperFunc
- // DisableAnonymous gives user an option to disable Anonymous authentication.
- DisableAnonymous bool
+ // Anonymous gives user an option to enable/disable Anonymous authentication.
+ Anonymous *apiserver.AnonymousAuthConfig
}
func NewDelegatingAuthenticationOptions() *DelegatingAuthenticationOptions {
@@ -238,6 +239,7 @@ func NewDelegatingAuthenticationOptions() *DelegatingAuthenticationOptions {
},
WebhookRetryBackoff: DefaultAuthWebhookRetryBackoff(),
TokenRequestTimeout: 10 * time.Second,
+ Anonymous: &apiserver.AnonymousAuthConfig{Enabled: true},
}
}
@@ -305,7 +307,7 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(authenticationInfo *server.Aut
}
cfg := authenticatorfactory.DelegatingAuthenticatorConfig{
- Anonymous: !s.DisableAnonymous,
+ Anonymous: &apiserver.AnonymousAuthConfig{Enabled: true},
CacheTTL: s.CacheTTL,
WebhookRetryBackoff: s.WebhookRetryBackoff,
TokenAccessReviewTimeout: s.TokenRequestTimeout,
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/deprecated_insecure_serving.go b/vendor/k8s.io/apiserver/pkg/server/options/deprecated_insecure_serving.go
deleted file mode 100644
index dd05bfecdb5..00000000000
--- a/vendor/k8s.io/apiserver/pkg/server/options/deprecated_insecure_serving.go
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-Copyright 2017 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package options
-
-import (
- "fmt"
- "net"
-
- "github.com/spf13/pflag"
-
- "k8s.io/apiserver/pkg/server"
-)
-
-// DeprecatedInsecureServingOptions are for creating an unauthenticated, unauthorized, insecure port.
-// No one should be using these anymore.
-// DEPRECATED: all insecure serving options are removed in a future version
-type DeprecatedInsecureServingOptions struct {
- BindAddress net.IP
- BindPort int
- // BindNetwork is the type of network to bind to - defaults to "tcp", accepts "tcp",
- // "tcp4", and "tcp6".
- BindNetwork string
-
- // Listener is the secure server network listener.
- // either Listener or BindAddress/BindPort/BindNetwork is set,
- // if Listener is set, use it and omit BindAddress/BindPort/BindNetwork.
- Listener net.Listener
-
- // ListenFunc can be overridden to create a custom listener, e.g. for mocking in tests.
- // It defaults to options.CreateListener.
- ListenFunc func(network, addr string, config net.ListenConfig) (net.Listener, int, error)
-}
-
-// Validate ensures that the insecure port values within the range of the port.
-func (s *DeprecatedInsecureServingOptions) Validate() []error {
- if s == nil {
- return nil
- }
-
- errors := []error{}
-
- if s.BindPort < 0 || s.BindPort > 65535 {
- errors = append(errors, fmt.Errorf("insecure port %v must be between 0 and 65535, inclusive. 0 for turning off insecure (HTTP) port", s.BindPort))
- }
-
- return errors
-}
-
-// AddFlags adds flags related to insecure serving to the specified FlagSet.
-func (s *DeprecatedInsecureServingOptions) AddFlags(fs *pflag.FlagSet) {
- if s == nil {
- return
- }
-
- fs.IPVar(&s.BindAddress, "insecure-bind-address", s.BindAddress, ""+
- "The IP address on which to serve the --insecure-port (set to 0.0.0.0 or :: for listening on all interfaces and IP address families).")
- // Though this flag is deprecated, we discovered security concerns over how to do health checks without it e.g. #43784
- fs.MarkDeprecated("insecure-bind-address", "This flag will be removed in a future version.")
- fs.Lookup("insecure-bind-address").Hidden = false
-
- fs.IntVar(&s.BindPort, "insecure-port", s.BindPort, ""+
- "The port on which to serve unsecured, unauthenticated access.")
- // Though this flag is deprecated, we discovered security concerns over how to do health checks without it e.g. #43784
- fs.MarkDeprecated("insecure-port", "This flag will be removed in a future version.")
- fs.Lookup("insecure-port").Hidden = false
-}
-
-// AddUnqualifiedFlags adds flags related to insecure serving without the --insecure prefix to the specified FlagSet.
-func (s *DeprecatedInsecureServingOptions) AddUnqualifiedFlags(fs *pflag.FlagSet) {
- if s == nil {
- return
- }
-
- fs.IPVar(&s.BindAddress, "address", s.BindAddress,
- "The IP address on which to serve the insecure --port (set to '0.0.0.0' or '::' for listening on all interfaces and IP address families).")
- fs.MarkDeprecated("address", "see --bind-address instead.")
- fs.Lookup("address").Hidden = false
-
- fs.IntVar(&s.BindPort, "port", s.BindPort, "The port on which to serve unsecured, unauthenticated access. Set to 0 to disable.")
- fs.MarkDeprecated("port", "see --secure-port instead.")
- fs.Lookup("port").Hidden = false
-}
-
-// ApplyTo adds DeprecatedInsecureServingOptions to the insecureserverinfo and kube-controller manager configuration.
-// Note: the double pointer allows to set the *DeprecatedInsecureServingInfo to nil without referencing the struct hosting this pointer.
-func (s *DeprecatedInsecureServingOptions) ApplyTo(c **server.DeprecatedInsecureServingInfo) error {
- if s == nil {
- return nil
- }
- if s.BindPort <= 0 {
- return nil
- }
-
- if s.Listener == nil {
- var err error
- listen := CreateListener
- if s.ListenFunc != nil {
- listen = s.ListenFunc
- }
- addr := net.JoinHostPort(s.BindAddress.String(), fmt.Sprintf("%d", s.BindPort))
- s.Listener, s.BindPort, err = listen(s.BindNetwork, addr, net.ListenConfig{})
- if err != nil {
- return fmt.Errorf("failed to create listener: %v", err)
- }
- }
-
- *c = &server.DeprecatedInsecureServingInfo{
- Listener: s.Listener,
- }
-
- return nil
-}
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go
index 5b3da51faf8..40879f78e06 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go
@@ -24,7 +24,6 @@ import (
"encoding/base64"
"errors"
"fmt"
- "io"
"net/http"
"os"
"sync"
@@ -38,9 +37,9 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
- apiserverconfig "k8s.io/apiserver/pkg/apis/config"
- apiserverconfigv1 "k8s.io/apiserver/pkg/apis/config/v1"
- "k8s.io/apiserver/pkg/apis/config/validation"
+ "k8s.io/apiserver/pkg/apis/apiserver"
+ apiserverv1 "k8s.io/apiserver/pkg/apis/apiserver/v1"
+ "k8s.io/apiserver/pkg/apis/apiserver/validation"
"k8s.io/apiserver/pkg/features"
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics"
@@ -129,9 +128,9 @@ func GetKDF() bool {
func init() {
configScheme := runtime.NewScheme()
- utilruntime.Must(apiserverconfig.AddToScheme(configScheme))
- utilruntime.Must(apiserverconfigv1.AddToScheme(configScheme))
- codecs = serializer.NewCodecFactory(configScheme)
+ utilruntime.Must(apiserver.AddToScheme(configScheme))
+ utilruntime.Must(apiserverv1.AddToScheme(configScheme))
+ codecs = serializer.NewCodecFactory(configScheme, serializer.EnableStrict)
envelopemetrics.RegisterMetrics()
storagevalue.RegisterMetrics()
metrics.RegisterMetrics()
@@ -243,7 +242,7 @@ func LoadEncryptionConfig(ctx context.Context, filepath string, reload bool, api
// getTransformerOverridesAndKMSPluginHealthzCheckers creates the set of transformers and KMS healthz checks based on the given config.
// It may launch multiple go routines whose lifecycle is controlled by ctx.
// In case of an error, the caller is responsible for canceling ctx to clean up any go routines that may have been launched.
-func getTransformerOverridesAndKMSPluginHealthzCheckers(ctx context.Context, config *apiserverconfig.EncryptionConfiguration, apiServerID string) (map[schema.GroupResource]storagevalue.Transformer, []healthz.HealthChecker, *kmsState, error) {
+func getTransformerOverridesAndKMSPluginHealthzCheckers(ctx context.Context, config *apiserver.EncryptionConfiguration, apiServerID string) (map[schema.GroupResource]storagevalue.Transformer, []healthz.HealthChecker, *kmsState, error) {
var kmsHealthChecks []healthz.HealthChecker
transformers, probes, kmsUsed, err := getTransformerOverridesAndKMSPluginProbes(ctx, config, apiServerID)
if err != nil {
@@ -264,7 +263,7 @@ type healthChecker interface {
// getTransformerOverridesAndKMSPluginProbes creates the set of transformers and KMS probes based on the given config.
// It may launch multiple go routines whose lifecycle is controlled by ctx.
// In case of an error, the caller is responsible for canceling ctx to clean up any go routines that may have been launched.
-func getTransformerOverridesAndKMSPluginProbes(ctx context.Context, config *apiserverconfig.EncryptionConfiguration, apiServerID string) (map[schema.GroupResource]storagevalue.Transformer, []healthChecker, *kmsState, error) {
+func getTransformerOverridesAndKMSPluginProbes(ctx context.Context, config *apiserver.EncryptionConfiguration, apiServerID string) (map[schema.GroupResource]storagevalue.Transformer, []healthChecker, *kmsState, error) {
resourceToPrefixTransformer := map[schema.GroupResource][]storagevalue.PrefixTransformer{}
var probes []healthChecker
var kmsUsed kmsState
@@ -503,7 +502,7 @@ func (h *kmsv2PluginProbe) isKMSv2ProviderHealthyAndMaybeRotateDEK(ctx context.C
}
// loadConfig parses the encryption configuration file at filepath and returns the parsed config and hash of the file.
-func loadConfig(filepath string, reload bool) (*apiserverconfig.EncryptionConfiguration, string, error) {
+func loadConfig(filepath string, reload bool) (*apiserver.EncryptionConfiguration, string, error) {
data, contentHash, err := loadDataAndHash(filepath)
if err != nil {
return nil, "", fmt.Errorf("error while loading file: %w", err)
@@ -513,7 +512,7 @@ func loadConfig(filepath string, reload bool) (*apiserverconfig.EncryptionConfig
if err != nil {
return nil, "", fmt.Errorf("error decoding encryption provider configuration file %q: %w", filepath, err)
}
- config, ok := configObj.(*apiserverconfig.EncryptionConfiguration)
+ config, ok := configObj.(*apiserver.EncryptionConfiguration)
if !ok {
return nil, "", fmt.Errorf("got unexpected config type: %v", gvk)
}
@@ -522,15 +521,9 @@ func loadConfig(filepath string, reload bool) (*apiserverconfig.EncryptionConfig
}
func loadDataAndHash(filepath string) ([]byte, string, error) {
- f, err := os.Open(filepath)
+ data, err := os.ReadFile(filepath)
if err != nil {
- return nil, "", fmt.Errorf("error opening encryption provider configuration file %q: %w", filepath, err)
- }
- defer f.Close()
-
- data, err := io.ReadAll(f)
- if err != nil {
- return nil, "", fmt.Errorf("could not read contents: %w", err)
+ return nil, "", fmt.Errorf("error reading encryption provider configuration file %q: %w", filepath, err)
}
if len(data) == 0 {
return nil, "", fmt.Errorf("encryption provider configuration file %q is empty", filepath)
@@ -549,7 +542,7 @@ func GetEncryptionConfigHash(filepath string) (string, error) {
// prefixTransformersAndProbes creates the set of transformers and KMS probes based on the given resource config.
// It may launch multiple go routines whose lifecycle is controlled by ctx.
// In case of an error, the caller is responsible for canceling ctx to clean up any go routines that may have been launched.
-func prefixTransformersAndProbes(ctx context.Context, config apiserverconfig.ResourceConfiguration, apiServerID string) ([]storagevalue.PrefixTransformer, []healthChecker, *kmsState, error) {
+func prefixTransformersAndProbes(ctx context.Context, config apiserver.ResourceConfiguration, apiServerID string) ([]storagevalue.PrefixTransformer, []healthChecker, *kmsState, error) {
var transformers []storagevalue.PrefixTransformer
var probes []healthChecker
var kmsUsed kmsState
@@ -605,7 +598,7 @@ func prefixTransformersAndProbes(ctx context.Context, config apiserverconfig.Res
type blockTransformerFunc func(cipher.Block) (storagevalue.Transformer, error)
-func aesPrefixTransformer(config *apiserverconfig.AESConfiguration, fn blockTransformerFunc, prefix string) (storagevalue.PrefixTransformer, error) {
+func aesPrefixTransformer(config *apiserver.AESConfiguration, fn blockTransformerFunc, prefix string) (storagevalue.PrefixTransformer, error) {
var result storagevalue.PrefixTransformer
if len(config.Keys) == 0 {
@@ -658,7 +651,7 @@ func aesPrefixTransformer(config *apiserverconfig.AESConfiguration, fn blockTran
return result, nil
}
-func secretboxPrefixTransformer(config *apiserverconfig.SecretboxConfiguration) (storagevalue.PrefixTransformer, error) {
+func secretboxPrefixTransformer(config *apiserver.SecretboxConfiguration) (storagevalue.PrefixTransformer, error) {
var result storagevalue.PrefixTransformer
if len(config.Keys) == 0 {
@@ -736,7 +729,7 @@ func (s *kmsState) accumulate(other *kmsState) {
// kmsPrefixTransformer creates a KMS transformer and probe based on the given KMS config.
// It may launch multiple go routines whose lifecycle is controlled by ctx.
// In case of an error, the caller is responsible for canceling ctx to clean up any go routines that may have been launched.
-func kmsPrefixTransformer(ctx context.Context, config *apiserverconfig.KMSConfiguration, apiServerID string) (storagevalue.PrefixTransformer, healthChecker, *kmsState, error) {
+func kmsPrefixTransformer(ctx context.Context, config *apiserver.KMSConfiguration, apiServerID string) (storagevalue.PrefixTransformer, healthChecker, *kmsState, error) {
kmsName := config.Name
switch config.APIVersion {
case kmsAPIVersionV1:
@@ -853,7 +846,7 @@ func primeAndProbeKMSv2(ctx context.Context, probe *kmsv2PluginProbe, kmsName st
})
}
-func envelopePrefixTransformer(config *apiserverconfig.KMSConfiguration, envelopeService envelope.Service, prefix string) storagevalue.PrefixTransformer {
+func envelopePrefixTransformer(config *apiserver.KMSConfiguration, envelopeService envelope.Service, prefix string) storagevalue.PrefixTransformer {
baseTransformerFunc := func(block cipher.Block) (storagevalue.Transformer, error) {
gcm, err := aestransformer.NewGCMTransformer(block)
if err != nil {
@@ -902,7 +895,7 @@ func (u unionTransformers) TransformToStorage(ctx context.Context, data []byte,
// We use a hash instead of the raw file contents when tracking changes to avoid holding any encryption keys in memory outside of their associated transformers.
// This hash must be used in-memory and not externalized to the process because it has no cross-release stability guarantees.
func computeEncryptionConfigHash(data []byte) string {
- return fmt.Sprintf("%x", sha256.Sum256(data))
+ return fmt.Sprintf("k8s:enc:unstable:1:%x", sha256.Sum256(data))
}
var _ storagevalue.ResourceTransformers = &DynamicTransformers{}
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/controller/controller.go b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/controller/controller.go
index cde6a379ecd..fd783f41a44 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/controller/controller.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/controller/controller.go
@@ -49,7 +49,7 @@ type DynamicEncryptionConfigContent struct {
lastLoadedEncryptionConfigHash string
// queue for processing changes in encryption config file.
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[string]
// dynamicTransformers updates the transformers when encryption config file changes.
dynamicTransformers *encryptionconfig.DynamicTransformers
@@ -78,8 +78,11 @@ func NewDynamicEncryptionConfiguration(
filePath: filePath,
lastLoadedEncryptionConfigHash: configContentHash,
dynamicTransformers: dynamicTransformers,
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), name),
- apiServerID: apiServerID,
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig(
+ workqueue.DefaultTypedControllerRateLimiter[string](),
+ workqueue.TypedRateLimitingQueueConfig[string]{Name: name},
+ ),
+ apiServerID: apiServerID,
getEncryptionConfigHash: func(_ context.Context, filepath string) (string, error) {
return encryptionconfig.GetEncryptionConfigHash(filepath)
},
@@ -150,7 +153,7 @@ func (d *DynamicEncryptionConfigContent) processNextWorkItem(serverCtx context.C
return true
}
-func (d *DynamicEncryptionConfigContent) processWorkItem(serverCtx context.Context, workqueueKey interface{}) {
+func (d *DynamicEncryptionConfigContent) processWorkItem(serverCtx context.Context, workqueueKey string) {
var (
updatedEffectiveConfig bool
err error
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go
index 70414035fed..745277002be 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go
@@ -32,24 +32,41 @@ const (
)
var (
- encryptionConfigAutomaticReloadFailureTotal = metrics.NewCounterVec(
+ encryptionConfigAutomaticReloadsTotal = metrics.NewCounterVec(
&metrics.CounterOpts{
Namespace: namespace,
Subsystem: subsystem,
- Name: "automatic_reload_failures_total",
- Help: "Total number of failed automatic reloads of encryption configuration split by apiserver identity.",
+ Name: "automatic_reloads_total",
+ Help: "Total number of reload successes and failures of encryption configuration split by apiserver identity.",
StabilityLevel: metrics.ALPHA,
},
+ []string{"status", "apiserver_id_hash"},
+ )
+
+ // deprecatedEncryptionConfigAutomaticReloadFailureTotal has been deprecated in 1.30.0
+ // use encryptionConfigAutomaticReloadsTotal instead
+ deprecatedEncryptionConfigAutomaticReloadFailureTotal = metrics.NewCounterVec(
+ &metrics.CounterOpts{
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "automatic_reload_failures_total",
+ Help: "Total number of failed automatic reloads of encryption configuration split by apiserver identity.",
+ StabilityLevel: metrics.ALPHA,
+ DeprecatedVersion: "1.30.0",
+ },
[]string{"apiserver_id_hash"},
)
- encryptionConfigAutomaticReloadSuccessTotal = metrics.NewCounterVec(
+ // deprecatedEncryptionConfigAutomaticReloadSuccessTotal has been deprecated in 1.30.0
+ // use encryptionConfigAutomaticReloadsTotal instead
+ deprecatedEncryptionConfigAutomaticReloadSuccessTotal = metrics.NewCounterVec(
&metrics.CounterOpts{
- Namespace: namespace,
- Subsystem: subsystem,
- Name: "automatic_reload_success_total",
- Help: "Total number of successful automatic reloads of encryption configuration split by apiserver identity.",
- StabilityLevel: metrics.ALPHA,
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "automatic_reload_success_total",
+ Help: "Total number of successful automatic reloads of encryption configuration split by apiserver identity.",
+ StabilityLevel: metrics.ALPHA,
+ DeprecatedVersion: "1.30.0",
},
[]string{"apiserver_id_hash"},
)
@@ -76,21 +93,24 @@ func RegisterMetrics() {
return sha256.New()
},
}
- legacyregistry.MustRegister(encryptionConfigAutomaticReloadFailureTotal)
- legacyregistry.MustRegister(encryptionConfigAutomaticReloadSuccessTotal)
+ legacyregistry.MustRegister(encryptionConfigAutomaticReloadsTotal)
+ legacyregistry.MustRegister(deprecatedEncryptionConfigAutomaticReloadFailureTotal)
+ legacyregistry.MustRegister(deprecatedEncryptionConfigAutomaticReloadSuccessTotal)
legacyregistry.MustRegister(encryptionConfigAutomaticReloadLastTimestampSeconds)
})
}
func RecordEncryptionConfigAutomaticReloadFailure(apiServerID string) {
apiServerIDHash := getHash(apiServerID)
- encryptionConfigAutomaticReloadFailureTotal.WithLabelValues(apiServerIDHash).Inc()
+ encryptionConfigAutomaticReloadsTotal.WithLabelValues("failure", apiServerIDHash).Inc()
+ deprecatedEncryptionConfigAutomaticReloadFailureTotal.WithLabelValues(apiServerIDHash).Inc()
recordEncryptionConfigAutomaticReloadTimestamp("failure", apiServerIDHash)
}
func RecordEncryptionConfigAutomaticReloadSuccess(apiServerID string) {
apiServerIDHash := getHash(apiServerID)
- encryptionConfigAutomaticReloadSuccessTotal.WithLabelValues(apiServerIDHash).Inc()
+ encryptionConfigAutomaticReloadsTotal.WithLabelValues("success", apiServerIDHash).Inc()
+ deprecatedEncryptionConfigAutomaticReloadSuccessTotal.WithLabelValues(apiServerIDHash).Inc()
recordEncryptionConfigAutomaticReloadTimestamp("success", apiServerIDHash)
}
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/etcd.go b/vendor/k8s.io/apiserver/pkg/server/options/etcd.go
index a1fc3168c5d..af7696c40ae 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/etcd.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/etcd.go
@@ -383,8 +383,8 @@ type StorageFactoryRestOptionsFactory struct {
StorageFactory serverstorage.StorageFactory
}
-func (f *StorageFactoryRestOptionsFactory) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error) {
- storageConfig, err := f.StorageFactory.NewConfig(resource)
+func (f *StorageFactoryRestOptionsFactory) GetRESTOptions(resource schema.GroupResource, example runtime.Object) (generic.RESTOptions, error) {
+ storageConfig, err := f.StorageFactory.NewConfig(resource, example)
if err != nil {
return generic.RESTOptions{}, fmt.Errorf("unable to find storage destination for %v, due to %v", resource, err.Error())
}
@@ -399,6 +399,10 @@ func (f *StorageFactoryRestOptionsFactory) GetRESTOptions(resource schema.GroupR
StorageObjectCountTracker: f.Options.StorageConfig.StorageObjectCountTracker,
}
+ if ret.StorageObjectCountTracker == nil {
+ ret.StorageObjectCountTracker = storageConfig.StorageObjectCountTracker
+ }
+
if f.Options.EnableWatchCache {
sizes, err := ParseWatchCacheSizes(f.Options.WatchCacheSizes)
if err != nil {
@@ -465,7 +469,7 @@ type SimpleStorageFactory struct {
StorageConfig storagebackend.Config
}
-func (s *SimpleStorageFactory) NewConfig(resource schema.GroupResource) (*storagebackend.ConfigForResource, error) {
+func (s *SimpleStorageFactory) NewConfig(resource schema.GroupResource, example runtime.Object) (*storagebackend.ConfigForResource, error) {
return s.StorageConfig.ForResource(resource), nil
}
@@ -489,8 +493,8 @@ type transformerStorageFactory struct {
resourceTransformers storagevalue.ResourceTransformers
}
-func (t *transformerStorageFactory) NewConfig(resource schema.GroupResource) (*storagebackend.ConfigForResource, error) {
- config, err := t.delegate.NewConfig(resource)
+func (t *transformerStorageFactory) NewConfig(resource schema.GroupResource, example runtime.Object) (*storagebackend.ConfigForResource, error) {
+ config, err := t.delegate.NewConfig(resource, example)
if err != nil {
return nil, err
}
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/feature.go b/vendor/k8s.io/apiserver/pkg/server/options/feature.go
index f01195560a4..a5b1372da47 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/feature.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/feature.go
@@ -71,6 +71,9 @@ func (o *FeatureOptions) ApplyTo(c *server.Config, clientset kubernetes.Interfac
c.EnableContentionProfiling = o.EnableContentionProfiling
if o.EnablePriorityAndFairness {
+ if clientset == nil {
+ return fmt.Errorf("invalid configuration: priority and fairness requires a core Kubernetes client")
+ }
if c.MaxRequestsInFlight+c.MaxMutatingRequestsInFlight <= 0 {
return fmt.Errorf("invalid configuration: MaxRequestsInFlight=%d and MaxMutatingRequestsInFlight=%d; they must add up to something positive", c.MaxRequestsInFlight, c.MaxMutatingRequestsInFlight)
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/recommended.go b/vendor/k8s.io/apiserver/pkg/server/options/recommended.go
index eb7e67b3670..779c4e3da92 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/recommended.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/recommended.go
@@ -120,9 +120,18 @@ func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error {
if err := o.CoreAPI.ApplyTo(config); err != nil {
return err
}
- kubeClient, err := kubernetes.NewForConfig(config.ClientConfig)
- if err != nil {
- return err
+ var kubeClient *kubernetes.Clientset
+ var dynamicClient *dynamic.DynamicClient
+ if config.ClientConfig != nil {
+ var err error
+ kubeClient, err = kubernetes.NewForConfig(config.ClientConfig)
+ if err != nil {
+ return err
+ }
+ dynamicClient, err = dynamic.NewForConfig(config.ClientConfig)
+ if err != nil {
+ return err
+ }
}
if err := o.Features.ApplyTo(&config.Config, kubeClient, config.SharedInformerFactory); err != nil {
return err
@@ -131,10 +140,6 @@ func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error {
if err != nil {
return err
}
- dynamicClient, err := dynamic.NewForConfig(config.ClientConfig)
- if err != nil {
- return err
- }
if err := o.Admission.ApplyTo(&config.Config, config.SharedInformerFactory, kubeClient, dynamicClient, o.FeatureGate,
initializers...); err != nil {
return err
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/server_run_options.go b/vendor/k8s.io/apiserver/pkg/server/options/server_run_options.go
index 1373d8a4d73..9246366dd63 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/server_run_options.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/server_run_options.go
@@ -25,8 +25,10 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/errors"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apiserver/pkg/server"
utilfeature "k8s.io/apiserver/pkg/util/feature"
+ utilversion "k8s.io/apiserver/pkg/util/version"
"github.com/spf13/pflag"
)
@@ -45,16 +47,17 @@ const (
type ServerRunOptions struct {
AdvertiseAddress net.IP
- CorsAllowedOriginList []string
- HSTSDirectives []string
- ExternalHost string
- MaxRequestsInFlight int
- MaxMutatingRequestsInFlight int
- RequestTimeout time.Duration
- GoawayChance float64
- LivezGracePeriod time.Duration
- MinRequestTimeout int
- ShutdownDelayDuration time.Duration
+ CorsAllowedOriginList []string
+ HSTSDirectives []string
+ ExternalHost string
+ MaxRequestsInFlight int
+ MaxMutatingRequestsInFlight int
+ RequestTimeout time.Duration
+ GoawayChance float64
+ LivezGracePeriod time.Duration
+ MinRequestTimeout int
+ StorageInitializationTimeout time.Duration
+ ShutdownDelayDuration time.Duration
// We intentionally did not add a flag for this option. Users of the
// apiserver library can wire it to a flag.
JSONPatchMaxCopyBytes int64
@@ -89,9 +92,24 @@ type ServerRunOptions struct {
// This grace period is orthogonal to other grace periods, and
// it is not overridden by any other grace period.
ShutdownWatchTerminationGracePeriod time.Duration
+
+ // ComponentGlobalsRegistry is the registry where the effective versions and feature gates for all components are stored.
+ ComponentGlobalsRegistry utilversion.ComponentGlobalsRegistry
+ // ComponentName is name under which the server's global variabled are registered in the ComponentGlobalsRegistry.
+ ComponentName string
}
func NewServerRunOptions() *ServerRunOptions {
+ if utilversion.DefaultComponentGlobalsRegistry.EffectiveVersionFor(utilversion.DefaultKubeComponent) == nil {
+ featureGate := utilfeature.DefaultMutableFeatureGate
+ effectiveVersion := utilversion.DefaultKubeEffectiveVersion()
+ utilruntime.Must(utilversion.DefaultComponentGlobalsRegistry.Register(utilversion.DefaultKubeComponent, effectiveVersion, featureGate))
+ }
+
+ return NewServerRunOptionsForComponent(utilversion.DefaultKubeComponent, utilversion.DefaultComponentGlobalsRegistry)
+}
+
+func NewServerRunOptionsForComponent(componentName string, componentGlobalsRegistry utilversion.ComponentGlobalsRegistry) *ServerRunOptions {
defaults := server.NewConfig(serializer.CodecFactory{})
return &ServerRunOptions{
MaxRequestsInFlight: defaults.MaxRequestsInFlight,
@@ -99,16 +117,22 @@ func NewServerRunOptions() *ServerRunOptions {
RequestTimeout: defaults.RequestTimeout,
LivezGracePeriod: defaults.LivezGracePeriod,
MinRequestTimeout: defaults.MinRequestTimeout,
+ StorageInitializationTimeout: defaults.StorageInitializationTimeout,
ShutdownDelayDuration: defaults.ShutdownDelayDuration,
ShutdownWatchTerminationGracePeriod: defaults.ShutdownWatchTerminationGracePeriod,
JSONPatchMaxCopyBytes: defaults.JSONPatchMaxCopyBytes,
MaxRequestBodyBytes: defaults.MaxRequestBodyBytes,
ShutdownSendRetryAfter: false,
+ ComponentName: componentName,
+ ComponentGlobalsRegistry: componentGlobalsRegistry,
}
}
// ApplyTo applies the run options to the method receiver and returns self
func (s *ServerRunOptions) ApplyTo(c *server.Config) error {
+ if err := s.ComponentGlobalsRegistry.SetFallback(); err != nil {
+ return err
+ }
c.CorsAllowedOriginList = s.CorsAllowedOriginList
c.HSTSDirectives = s.HSTSDirectives
c.ExternalAddress = s.ExternalHost
@@ -118,12 +142,15 @@ func (s *ServerRunOptions) ApplyTo(c *server.Config) error {
c.RequestTimeout = s.RequestTimeout
c.GoawayChance = s.GoawayChance
c.MinRequestTimeout = s.MinRequestTimeout
+ c.StorageInitializationTimeout = s.StorageInitializationTimeout
c.ShutdownDelayDuration = s.ShutdownDelayDuration
c.JSONPatchMaxCopyBytes = s.JSONPatchMaxCopyBytes
c.MaxRequestBodyBytes = s.MaxRequestBodyBytes
c.PublicAddress = s.AdvertiseAddress
c.ShutdownSendRetryAfter = s.ShutdownSendRetryAfter
c.ShutdownWatchTerminationGracePeriod = s.ShutdownWatchTerminationGracePeriod
+ c.EffectiveVersion = s.ComponentGlobalsRegistry.EffectiveVersionFor(s.ComponentName)
+ c.FeatureGate = s.ComponentGlobalsRegistry.FeatureGateFor(s.ComponentName)
return nil
}
@@ -173,6 +200,10 @@ func (s *ServerRunOptions) Validate() []error {
errors = append(errors, fmt.Errorf("--min-request-timeout can not be negative value"))
}
+ if s.StorageInitializationTimeout < 0 {
+ errors = append(errors, fmt.Errorf("--storage-initialization-timeout can not be negative value"))
+ }
+
if s.ShutdownDelayDuration < 0 {
errors = append(errors, fmt.Errorf("--shutdown-delay-duration can not be negative value"))
}
@@ -196,6 +227,9 @@ func (s *ServerRunOptions) Validate() []error {
if err := validateCorsAllowedOriginList(s.CorsAllowedOriginList); err != nil {
errors = append(errors, err)
}
+ if errs := s.ComponentGlobalsRegistry.Validate(); len(errs) != 0 {
+ errors = append(errors, errs...)
+ }
return errors
}
@@ -323,6 +357,9 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
"handler, which picks a randomized value above this number as the connection timeout, "+
"to spread out load.")
+ fs.DurationVar(&s.StorageInitializationTimeout, "storage-initialization-timeout", s.StorageInitializationTimeout,
+ "Maximum amount of time to wait for storage initialization before declaring apiserver ready. Defaults to 1m.")
+
fs.DurationVar(&s.ShutdownDelayDuration, "shutdown-delay-duration", s.ShutdownDelayDuration, ""+
"Time to delay the termination. During that time the server keeps serving requests normally. The endpoints /healthz and /livez "+
"will return success, but /readyz immediately returns failure. Graceful termination starts after this delay "+
@@ -337,5 +374,10 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
"This option, if set, represents the maximum amount of grace period the apiserver will wait "+
"for active watch request(s) to drain during the graceful server shutdown window.")
- utilfeature.DefaultMutableFeatureGate.AddFlag(fs)
+ s.ComponentGlobalsRegistry.AddFlags(fs)
+}
+
+// Complete fills missing fields with defaults.
+func (s *ServerRunOptions) Complete() error {
+ return s.ComponentGlobalsRegistry.SetFallback()
}
diff --git a/vendor/k8s.io/apiserver/pkg/server/options/serving.go b/vendor/k8s.io/apiserver/pkg/server/options/serving.go
index 842ab7ee0d1..21a2736e107 100644
--- a/vendor/k8s.io/apiserver/pkg/server/options/serving.go
+++ b/vendor/k8s.io/apiserver/pkg/server/options/serving.go
@@ -44,6 +44,8 @@ type SecureServingOptions struct {
// BindNetwork is the type of network to bind to - defaults to "tcp", accepts "tcp",
// "tcp4", and "tcp6".
BindNetwork string
+ // DisableHTTP2Serving indicates that http2 serving should not be enabled.
+ DisableHTTP2Serving bool
// Required set to true means that BindPort cannot be zero.
Required bool
// ExternalAddress is the address advertised, even if BindAddress is a loopback. By default this
@@ -163,6 +165,9 @@ func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet) {
}
fs.IntVar(&s.BindPort, "secure-port", s.BindPort, desc)
+ fs.BoolVar(&s.DisableHTTP2Serving, "disable-http2-serving", s.DisableHTTP2Serving,
+ "If true, HTTP2 serving will be disabled [default=false]")
+
fs.StringVar(&s.ServerCert.CertDirectory, "cert-dir", s.ServerCert.CertDirectory, ""+
"The directory where the TLS certs are located. "+
"If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored.")
@@ -256,6 +261,7 @@ func (s *SecureServingOptions) ApplyTo(config **server.SecureServingInfo) error
*config = &server.SecureServingInfo{
Listener: s.Listener,
HTTP2MaxStreamsPerConnection: s.HTTP2MaxStreamsPerConnection,
+ DisableHTTP2: s.DisableHTTP2Serving,
}
c := *config
diff --git a/vendor/k8s.io/apiserver/pkg/server/plugins.go b/vendor/k8s.io/apiserver/pkg/server/plugins.go
index 25acf92dc87..2390446419c 100644
--- a/vendor/k8s.io/apiserver/pkg/server/plugins.go
+++ b/vendor/k8s.io/apiserver/pkg/server/plugins.go
@@ -20,7 +20,7 @@ package server
import (
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle"
- "k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy"
+ validatingadmissionpolicy "k8s.io/apiserver/pkg/admission/plugin/policy/validating"
mutatingwebhook "k8s.io/apiserver/pkg/admission/plugin/webhook/mutating"
validatingwebhook "k8s.io/apiserver/pkg/admission/plugin/webhook/validating"
)
diff --git a/vendor/k8s.io/apiserver/pkg/server/routine/routine.go b/vendor/k8s.io/apiserver/pkg/server/routine/routine.go
new file mode 100644
index 00000000000..c4b23c59034
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/server/routine/routine.go
@@ -0,0 +1,91 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package routine
+
+import (
+ "context"
+ "net/http"
+
+ "k8s.io/apiserver/pkg/endpoints/request"
+)
+
+type taskKeyType int
+
+const taskKey taskKeyType = iota
+
+type Task struct {
+ Func func()
+}
+
+func WithTask(parent context.Context, t *Task) context.Context {
+ return request.WithValue(parent, taskKey, t)
+}
+
+// AppendTask appends a task executed after completion of existing task.
+// It is a no-op if there is no existing task.
+func AppendTask(ctx context.Context, t *Task) bool {
+ if existTask := TaskFrom(ctx); existTask != nil && existTask.Func != nil {
+ existFunc := existTask.Func
+ existTask.Func = func() {
+ existFunc()
+ t.Func()
+ }
+ return true
+ }
+ return false
+}
+
+func TaskFrom(ctx context.Context) *Task {
+ t, _ := ctx.Value(taskKey).(*Task)
+ return t
+}
+
+// WithRoutine returns an http.Handler that executes preparation of long running requests (i.e. watches)
+// in a separate Goroutine and then serves the long running request in the main Goroutine. Doing so allows
+// freeing stack memory used in preparation Goroutine for better memory efficiency.
+func WithRoutine(handler http.Handler, longRunning request.LongRunningRequestCheck) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
+ ctx := req.Context()
+ requestInfo, _ := request.RequestInfoFrom(ctx)
+ if !longRunning(req, requestInfo) {
+ handler.ServeHTTP(w, req)
+ return
+ }
+
+ req = req.WithContext(WithTask(ctx, &Task{}))
+ panicCh := make(chan any, 1)
+ go func() {
+ defer func() {
+ if r := recover(); r != nil {
+ panicCh <- r
+ }
+ close(panicCh)
+ }()
+ handler.ServeHTTP(w, req)
+ }()
+
+ if p, ok := <-panicCh; ok {
+ panic(p)
+ }
+
+ ctx = req.Context()
+ if t := TaskFrom(ctx); t != nil && t.Func != nil {
+ t.Func()
+ }
+
+ })
+}
diff --git a/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go b/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go
index efb22fbc8d6..d73c8e62c61 100644
--- a/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go
+++ b/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go
@@ -21,6 +21,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
+ apimachineryversion "k8s.io/apimachinery/pkg/util/version"
+ "k8s.io/apiserver/pkg/util/version"
)
type ResourceEncodingConfig interface {
@@ -33,10 +35,15 @@ type ResourceEncodingConfig interface {
InMemoryEncodingFor(schema.GroupResource) (schema.GroupVersion, error)
}
+type CompatibilityResourceEncodingConfig interface {
+ BackwardCompatibileStorageEncodingFor(schema.GroupResource, runtime.Object) (schema.GroupVersion, error)
+}
+
type DefaultResourceEncodingConfig struct {
// resources records the overriding encoding configs for individual resources.
- resources map[schema.GroupResource]*OverridingResourceEncoding
- scheme *runtime.Scheme
+ resources map[schema.GroupResource]*OverridingResourceEncoding
+ scheme *runtime.Scheme
+ effectiveVersion version.EffectiveVersion
}
type OverridingResourceEncoding struct {
@@ -47,7 +54,7 @@ type OverridingResourceEncoding struct {
var _ ResourceEncodingConfig = &DefaultResourceEncodingConfig{}
func NewDefaultResourceEncodingConfig(scheme *runtime.Scheme) *DefaultResourceEncodingConfig {
- return &DefaultResourceEncodingConfig{resources: map[schema.GroupResource]*OverridingResourceEncoding{}, scheme: scheme}
+ return &DefaultResourceEncodingConfig{resources: map[schema.GroupResource]*OverridingResourceEncoding{}, scheme: scheme, effectiveVersion: version.DefaultKubeEffectiveVersion()}
}
func (o *DefaultResourceEncodingConfig) SetResourceEncoding(resourceBeingStored schema.GroupResource, externalEncodingVersion, internalVersion schema.GroupVersion) {
@@ -57,6 +64,10 @@ func (o *DefaultResourceEncodingConfig) SetResourceEncoding(resourceBeingStored
}
}
+func (o *DefaultResourceEncodingConfig) SetEffectiveVersion(effectiveVersion version.EffectiveVersion) {
+ o.effectiveVersion = effectiveVersion
+}
+
func (o *DefaultResourceEncodingConfig) StorageEncodingFor(resource schema.GroupResource) (schema.GroupVersion, error) {
if !o.scheme.IsGroupRegistered(resource.Group) {
return schema.GroupVersion{}, fmt.Errorf("group %q is not registered in scheme", resource.Group)
@@ -71,6 +82,24 @@ func (o *DefaultResourceEncodingConfig) StorageEncodingFor(resource schema.Group
return o.scheme.PrioritizedVersionsForGroup(resource.Group)[0], nil
}
+func (o *DefaultResourceEncodingConfig) BackwardCompatibileStorageEncodingFor(resource schema.GroupResource, example runtime.Object) (schema.GroupVersion, error) {
+ if !o.scheme.IsGroupRegistered(resource.Group) {
+ return schema.GroupVersion{}, fmt.Errorf("group %q is not registered in scheme", resource.Group)
+ }
+
+ // Always respect overrides
+ resourceOverride, resourceExists := o.resources[resource]
+ if resourceExists {
+ return resourceOverride.ExternalResourceEncoding, nil
+ }
+
+ return emulatedStorageVersion(
+ o.scheme.PrioritizedVersionsForGroup(resource.Group)[0],
+ example,
+ o.effectiveVersion,
+ o.scheme)
+}
+
func (o *DefaultResourceEncodingConfig) InMemoryEncodingFor(resource schema.GroupResource) (schema.GroupVersion, error) {
if !o.scheme.IsGroupRegistered(resource.Group) {
return schema.GroupVersion{}, fmt.Errorf("group %q is not registered in scheme", resource.Group)
@@ -82,3 +111,79 @@ func (o *DefaultResourceEncodingConfig) InMemoryEncodingFor(resource schema.Grou
}
return schema.GroupVersion{Group: resource.Group, Version: runtime.APIVersionInternal}, nil
}
+
+// Object interface generated from "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
+type introducedInterface interface {
+ APILifecycleIntroduced() (major, minor int)
+}
+
+func emulatedStorageVersion(binaryVersionOfResource schema.GroupVersion, example runtime.Object, effectiveVersion version.EffectiveVersion, scheme *runtime.Scheme) (schema.GroupVersion, error) {
+ if example == nil || effectiveVersion == nil {
+ return binaryVersionOfResource, nil
+ }
+
+ // Look up example in scheme to find all objects of the same Group-Kind
+ // Use the highest priority version for that group-kind whose lifecycle window
+ // includes the current emulation version.
+ // If no version is found, use the binary version
+ // (in this case the API should be disabled anyway)
+ gvks, _, err := scheme.ObjectKinds(example)
+ if err != nil {
+ return schema.GroupVersion{}, err
+ } else if len(gvks) == 0 {
+ // Probably shouldn't happen if err is non-nil
+ return schema.GroupVersion{}, fmt.Errorf("object %T has no GVKs registered in scheme", example)
+ }
+
+ // VersionsForGroupKind returns versions in priority order
+ versions := scheme.VersionsForGroupKind(schema.GroupKind{Group: gvks[0].Group, Kind: gvks[0].Kind})
+
+ compatibilityVersion := effectiveVersion.MinCompatibilityVersion()
+
+ for _, gv := range versions {
+ if gv.Version == runtime.APIVersionInternal {
+ continue
+ }
+
+ gvk := schema.GroupVersionKind{
+ Group: gv.Group,
+ Version: gv.Version,
+ Kind: gvks[0].Kind,
+ }
+
+ exampleOfGVK, err := scheme.New(gvk)
+ if err != nil {
+ return schema.GroupVersion{}, err
+ }
+
+ // If it was introduced after current compatibility version, don't use it
+ // skip the introduced check for test when currentVersion is 0.0 to test all apis
+ if introduced, hasIntroduced := exampleOfGVK.(introducedInterface); hasIntroduced && (compatibilityVersion.Major() > 0 || compatibilityVersion.Minor() > 0) {
+ // API resource lifecycles should be relative to k8s api version
+ majorIntroduced, minorIntroduced := introduced.APILifecycleIntroduced()
+ introducedVer := apimachineryversion.MajorMinor(uint(majorIntroduced), uint(minorIntroduced))
+ if introducedVer.GreaterThan(compatibilityVersion) {
+ continue
+ }
+ }
+
+ // versions is returned in priority order, so just use first result
+ return gvk.GroupVersion(), nil
+ }
+
+ // Getting here means we're serving a version that is unknown to the
+ // min-compatibility-version server.
+ //
+ // This is only expected to happen when serving an alpha API type due
+ // to missing pre-release lifecycle information
+ // (which doesn't happen by default), or when emulation-version and
+ // min-compatibility-version are several versions apart so a beta or GA API
+ // was being served which didn't exist at all in min-compatibility-version.
+ //
+ // In the alpha case - we do not support compatibility versioning of
+ // alpha types and recommend users do not mix the two.
+ // In the skip-level case - The version of apiserver we are retaining
+ // compatibility with has no knowledge of the type,
+ // so storing it in another type is no issue.
+ return binaryVersionOfResource, nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go b/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go
index 0dc50cea61d..ad01c5a5d89 100644
--- a/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go
+++ b/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go
@@ -42,7 +42,7 @@ type Backend struct {
type StorageFactory interface {
// New finds the storage destination for the given group and resource. It will
// return an error if the group has no storage destination configured.
- NewConfig(groupResource schema.GroupResource) (*storagebackend.ConfigForResource, error)
+ NewConfig(groupResource schema.GroupResource, example runtime.Object) (*storagebackend.ConfigForResource, error)
// ResourcePrefix returns the overridden resource prefix for the GroupResource
// This allows for cohabitation of resources with different native types and provides
@@ -226,7 +226,7 @@ func (s *DefaultStorageFactory) getStorageGroupResource(groupResource schema.Gro
// New finds the storage destination for the given group and resource. It will
// return an error if the group has no storage destination configured.
-func (s *DefaultStorageFactory) NewConfig(groupResource schema.GroupResource) (*storagebackend.ConfigForResource, error) {
+func (s *DefaultStorageFactory) NewConfig(groupResource schema.GroupResource, example runtime.Object) (*storagebackend.ConfigForResource, error) {
chosenStorageResource := s.getStorageGroupResource(groupResource)
// operate on copy
@@ -244,14 +244,23 @@ func (s *DefaultStorageFactory) NewConfig(groupResource schema.GroupResource) (*
}
var err error
- codecConfig.StorageVersion, err = s.ResourceEncodingConfig.StorageEncodingFor(chosenStorageResource)
- if err != nil {
- return nil, err
+ if backwardCompatibleInterface, ok := s.ResourceEncodingConfig.(CompatibilityResourceEncodingConfig); ok {
+ codecConfig.StorageVersion, err = backwardCompatibleInterface.BackwardCompatibileStorageEncodingFor(groupResource, example)
+ if err != nil {
+ return nil, err
+ }
+ } else {
+ codecConfig.StorageVersion, err = s.ResourceEncodingConfig.StorageEncodingFor(chosenStorageResource)
+ if err != nil {
+ return nil, err
+ }
}
+
codecConfig.MemoryVersion, err = s.ResourceEncodingConfig.InMemoryEncodingFor(groupResource)
if err != nil {
return nil, err
}
+
codecConfig.Config = storageConfig
storageConfig.Codec, storageConfig.EncodeVersioner, err = s.newStorageCodecFn(codecConfig)
diff --git a/vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go b/vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go
new file mode 100644
index 00000000000..64fc241a6d3
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go
@@ -0,0 +1,91 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package server
+
+import (
+ "context"
+ "errors"
+ "sync"
+ "time"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/apiserver/pkg/registry/rest"
+ "k8s.io/klog/v2"
+)
+
+// StorageReadinessHook implements PostStartHook functionality for checking readiness
+// of underlying storage for registered resources.
+type StorageReadinessHook struct {
+ timeout time.Duration
+
+ lock sync.Mutex
+ checks map[string]func() error
+}
+
+// NewStorageReadinessHook created new StorageReadinessHook.
+func NewStorageReadinessHook(timeout time.Duration) *StorageReadinessHook {
+ return &StorageReadinessHook{
+ checks: make(map[string]func() error),
+ timeout: timeout,
+ }
+}
+
+func (h *StorageReadinessHook) RegisterStorage(gvr metav1.GroupVersionResource, storage rest.StorageWithReadiness) {
+ h.lock.Lock()
+ defer h.lock.Unlock()
+
+ if _, ok := h.checks[gvr.String()]; !ok {
+ h.checks[gvr.String()] = storage.ReadinessCheck
+ } else {
+ klog.Errorf("Registering storage readiness hook for %s again: ", gvr.String())
+ }
+}
+
+func (h *StorageReadinessHook) check() bool {
+ h.lock.Lock()
+ defer h.lock.Unlock()
+
+ failedChecks := []string{}
+ for gvr, check := range h.checks {
+ if err := check(); err != nil {
+ failedChecks = append(failedChecks, gvr)
+ }
+ }
+ if len(failedChecks) == 0 {
+ klog.Infof("Storage is ready for all registered resources")
+ return true
+ }
+ klog.V(4).Infof("Storage is not ready for: %v", failedChecks)
+ return false
+}
+
+func (h *StorageReadinessHook) Hook(ctx PostStartHookContext) error {
+ deadlineCtx, cancel := context.WithTimeout(ctx, h.timeout)
+ defer cancel()
+ err := wait.PollUntilContextCancel(deadlineCtx, 100*time.Millisecond, true,
+ func(_ context.Context) (bool, error) {
+ if ok := h.check(); ok {
+ return true, nil
+ }
+ return false, nil
+ })
+ if errors.Is(err, context.DeadlineExceeded) {
+ klog.Warningf("Deadline exceeded while waiting for storage readiness... ignoring")
+ }
+ return nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go
index 1bfc08d582c..48791bd7b63 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go
@@ -21,6 +21,7 @@ import (
"fmt"
"net/http"
"reflect"
+ "strings"
"sync"
"time"
@@ -42,12 +43,13 @@ import (
"k8s.io/apiserver/pkg/features"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/cacher/metrics"
+ etcdfeature "k8s.io/apiserver/pkg/storage/feature"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/client-go/tools/cache"
"k8s.io/component-base/tracing"
-
"k8s.io/klog/v2"
"k8s.io/utils/clock"
+ "k8s.io/utils/ptr"
)
var (
@@ -423,7 +425,7 @@ func NewCacherFromConfig(config Config) (*Cacher, error) {
reflector.MaxInternalErrorRetryDuration = time.Second * 30
// since the watch-list is provided by the watch cache instruct
// the reflector to issue a regular LIST against the store
- reflector.UseWatchList = false
+ reflector.UseWatchList = ptr.To(false)
cacher.watchCache = watchCache
cacher.reflector = reflector
@@ -523,6 +525,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
if !utilfeature.DefaultFeatureGate.Enabled(features.WatchList) && opts.SendInitialEvents != nil {
opts.SendInitialEvents = nil
}
+ // TODO: we should eventually get rid of this legacy case
if utilfeature.DefaultFeatureGate.Enabled(features.WatchFromStorageWithoutResourceVersion) && opts.SendInitialEvents == nil && opts.ResourceVersion == "" {
return c.storage.Watch(ctx, key, opts)
}
@@ -531,9 +534,18 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
return nil, err
}
- readyGeneration, err := c.ready.waitAndReadGeneration(ctx)
- if err != nil {
- return nil, errors.NewServiceUnavailable(err.Error())
+ var readyGeneration int
+ if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
+ var ok bool
+ readyGeneration, ok = c.ready.checkAndReadGeneration()
+ if !ok {
+ return nil, errors.NewTooManyRequests("storage is (re)initializing", 1)
+ }
+ } else {
+ readyGeneration, err = c.ready.waitAndReadGeneration(ctx)
+ if err != nil {
+ return nil, errors.NewServiceUnavailable(err.Error())
+ }
}
// determine the namespace and name scope of the watch, first from the request, secondarily from the field selector
@@ -561,6 +573,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
if field == c.indexedTrigger.indexName {
if value, ok := pred.Field.RequiresExactMatch(field); ok {
triggerValue, triggerSupported = value, true
+ break
}
}
}
@@ -573,14 +586,20 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
// watchers on our watcher having a processing hiccup
chanSize := c.watchCache.suggestedWatchChannelSize(c.indexedTrigger != nil, triggerSupported)
- // Determine a function that computes the bookmarkAfterResourceVersion
- bookmarkAfterResourceVersionFn, err := c.getBookmarkAfterResourceVersionLockedFunc(ctx, requestedWatchRV, opts)
+ // client-go is going to fall back to a standard LIST on any error
+ // returned for watch-list requests
+ if isListWatchRequest(opts) && !etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress) {
+ return newErrWatcher(fmt.Errorf("a watch stream was requested by the client but the required storage feature %s is disabled", storage.RequestWatchProgress)), nil
+ }
+
+ // Determine the ResourceVersion to which the watch cache must be synchronized
+ requiredResourceVersion, err := c.getWatchCacheResourceVersion(ctx, requestedWatchRV, opts)
if err != nil {
return newErrWatcher(err), nil
}
- // Determine a function that computes the watchRV we should start from
- startWatchResourceVersionFn, err := c.getStartResourceVersionForWatchLockedFunc(ctx, requestedWatchRV, opts)
+ // Determine a function that computes the bookmarkAfterResourceVersion
+ bookmarkAfterResourceVersionFn, err := c.getBookmarkAfterResourceVersionLockedFunc(requestedWatchRV, requiredResourceVersion, opts)
if err != nil {
return newErrWatcher(err), nil
}
@@ -596,7 +615,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
// to compute watcher.forget function (which has to happen under lock).
watcher := newCacheWatcher(
chanSize,
- filterWithAttrsFunction(key, pred),
+ filterWithAttrsAndPrefixFunction(key, pred),
emptyFunc,
c.versioner,
deadline,
@@ -612,7 +631,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
// moreover even though the c.waitUntilWatchCacheFreshAndForceAllEvents acquires a lock
// it is safe to release the lock after the method finishes because we don't require
// any atomicity between the call to the method and further calls that actually get the events.
- forceAllEvents, err := c.waitUntilWatchCacheFreshAndForceAllEvents(ctx, requestedWatchRV, opts)
+ err = c.waitUntilWatchCacheFreshAndForceAllEvents(ctx, requiredResourceVersion, opts)
if err != nil {
return newErrWatcher(err), nil
}
@@ -625,13 +644,8 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
c.watchCache.RLock()
defer c.watchCache.RUnlock()
- startWatchRV := startWatchResourceVersionFn()
var cacheInterval *watchCacheInterval
- if forceAllEvents {
- cacheInterval, err = c.watchCache.getIntervalFromStoreLocked()
- } else {
- cacheInterval, err = c.watchCache.getAllEventsSinceLocked(startWatchRV)
- }
+ cacheInterval, err = c.watchCache.getAllEventsSinceLocked(requiredResourceVersion, key, opts)
if err != nil {
// To match the uncached watch implementation, once we have passed authn/authz/admission,
// and successfully parsed a resource version, other errors must fail with a watch event of type ERROR,
@@ -673,7 +687,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
return newImmediateCloseWatcher(), nil
}
- go watcher.processInterval(ctx, cacheInterval, startWatchRV)
+ go watcher.processInterval(ctx, cacheInterval, requiredResourceVersion)
return watcher, nil
}
@@ -685,6 +699,14 @@ func (c *Cacher) Get(ctx context.Context, key string, opts storage.GetOptions, o
return c.storage.Get(ctx, key, opts, objPtr)
}
+ if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
+ if !c.ready.check() {
+ // If Cache is not initialized, delegate Get requests to storage
+ // as described in https://kep.k8s.io/4568
+ return c.storage.Get(ctx, key, opts, objPtr)
+ }
+ }
+
// If resourceVersion is specified, serve it from cache.
// It's guaranteed that the returned value is at least that
// fresh as the given resourceVersion.
@@ -693,16 +715,18 @@ func (c *Cacher) Get(ctx context.Context, key string, opts storage.GetOptions, o
return err
}
- if getRV == 0 && !c.ready.check() {
- // If Cacher is not yet initialized and we don't require any specific
- // minimal resource version, simply forward the request to storage.
- return c.storage.Get(ctx, key, opts, objPtr)
- }
-
// Do not create a trace - it's not for free and there are tons
// of Get requests. We can add it if it will be really needed.
- if err := c.ready.wait(ctx); err != nil {
- return errors.NewServiceUnavailable(err.Error())
+
+ if !utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
+ if getRV == 0 && !c.ready.check() {
+ // If Cacher is not yet initialized and we don't require any specific
+ // minimal resource version, simply forward the request to storage.
+ return c.storage.Get(ctx, key, opts, objPtr)
+ }
+ if err := c.ready.wait(ctx); err != nil {
+ return errors.NewServiceUnavailable(err.Error())
+ }
}
objVal, err := conversion.EnforcePtr(objPtr)
@@ -738,17 +762,40 @@ func shouldDelegateList(opts storage.ListOptions) bool {
pred := opts.Predicate
match := opts.ResourceVersionMatch
consistentListFromCacheEnabled := utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache)
+ requestWatchProgressSupported := etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress)
// Serve consistent reads from storage if ConsistentListFromCache is disabled
- consistentReadFromStorage := resourceVersion == "" && !consistentListFromCacheEnabled
+ consistentReadFromStorage := resourceVersion == "" && !(consistentListFromCacheEnabled && requestWatchProgressSupported)
// Watch cache doesn't support continuations, so serve them from etcd.
hasContinuation := len(pred.Continue) > 0
- // Serve paginated requests about revision "0" from watch cache to avoid overwhelming etcd.
- hasLimit := pred.Limit > 0 && resourceVersion != "0"
// Watch cache only supports ResourceVersionMatchNotOlderThan (default).
- unsupportedMatch := match != "" && match != metav1.ResourceVersionMatchNotOlderThan
+ // see https://kubernetes.io/docs/reference/using-api/api-concepts/#semantics-for-get-and-list
+ isLegacyExactMatch := opts.Predicate.Limit > 0 && match == "" && len(resourceVersion) > 0 && resourceVersion != "0"
+ unsupportedMatch := match != "" && match != metav1.ResourceVersionMatchNotOlderThan || isLegacyExactMatch
+
+ return consistentReadFromStorage || hasContinuation || unsupportedMatch
+}
+
+// computeListLimit determines whether the cacher should
+// apply a limit to an incoming LIST request and returns its value.
+//
+// note that this function doesn't check RVM nor the Continuation token.
+// these parameters are validated by the shouldDelegateList function.
+//
+// as of today, the limit is ignored for requests that set RV == 0
+func computeListLimit(opts storage.ListOptions) int64 {
+ if opts.Predicate.Limit <= 0 || opts.ResourceVersion == "0" {
+ return 0
+ }
+ return opts.Predicate.Limit
+}
- return consistentReadFromStorage || hasContinuation || hasLimit || unsupportedMatch
+func shouldDelegateListOnNotReadyCache(opts storage.ListOptions) bool {
+ pred := opts.Predicate
+ noLabelSelector := pred.Label == nil || pred.Label.Empty()
+ noFieldSelector := pred.Field == nil || pred.Field.Empty()
+ hasLimit := pred.Limit > 0
+ return noLabelSelector && noFieldSelector && hasLimit
}
func (c *Cacher) listItems(ctx context.Context, listRV uint64, key string, pred storage.SelectionPredicate, recursive bool) ([]interface{}, uint64, string, error) {
@@ -762,7 +809,7 @@ func (c *Cacher) listItems(ctx context.Context, listRV uint64, key string, pred
}
return nil, readResourceVersion, "", nil
}
- return c.watchCache.WaitUntilFreshAndList(ctx, listRV, pred.MatcherIndex())
+ return c.watchCache.WaitUntilFreshAndList(ctx, listRV, key, pred.MatcherIndex(ctx))
}
// GetList implements storage.Interface
@@ -778,12 +825,31 @@ func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptio
if err != nil {
return err
}
- if listRV == 0 && !c.ready.check() {
- // If Cacher is not yet initialized and we don't require any specific
- // minimal resource version, simply forward the request to storage.
- return c.storage.GetList(ctx, key, opts, listObj)
+
+ if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
+ if !c.ready.check() && shouldDelegateListOnNotReadyCache(opts) {
+ // If Cacher is not initialized, delegate List requests to storage
+ // as described in https://kep.k8s.io/4568
+ return c.storage.GetList(ctx, key, opts, listObj)
+ }
+ } else {
+ if listRV == 0 && !c.ready.check() {
+ // If Cacher is not yet initialized and we don't require any specific
+ // minimal resource version, simply forward the request to storage.
+ return c.storage.GetList(ctx, key, opts, listObj)
+ }
}
- if listRV == 0 && utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) {
+ // For recursive lists, we need to make sure the key ended with "/" so that we only
+ // get children "directories". e.g. if we have key "/a", "/a/b", "/ab", getting keys
+ // with prefix "/a" will return all three, while with prefix "/a/" will return only
+ // "/a/b" which is the correct answer.
+ preparedKey := key
+ if opts.Recursive && !strings.HasSuffix(key, "/") {
+ preparedKey += "/"
+ }
+ requestWatchProgressSupported := etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress)
+ consistentRead := resourceVersion == "" && utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) && requestWatchProgressSupported
+ if consistentRead {
listRV, err = storage.GetCurrentResourceVersionFromStorage(ctx, c.storage, c.newListFunc, c.resourcePrefix, c.objectType.String())
if err != nil {
return err
@@ -795,8 +861,16 @@ func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptio
attribute.Stringer("type", c.groupResource))
defer span.End(500 * time.Millisecond)
- if err := c.ready.wait(ctx); err != nil {
- return errors.NewServiceUnavailable(err.Error())
+ if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
+ if !c.ready.check() {
+ // If Cacher is not initialized, reject List requests
+ // as described in https://kep.k8s.io/4568
+ return errors.NewTooManyRequests("storage is (re)initializing", 1)
+ }
+ } else {
+ if err := c.ready.wait(ctx); err != nil {
+ return errors.NewServiceUnavailable(err.Error())
+ }
}
span.AddEvent("Ready")
@@ -812,25 +886,47 @@ func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptio
if listVal.Kind() != reflect.Slice {
return fmt.Errorf("need a pointer to slice, got %v", listVal.Kind())
}
- filter := filterWithAttrsFunction(key, pred)
- objs, readResourceVersion, indexUsed, err := c.listItems(ctx, listRV, key, pred, recursive)
+ objs, readResourceVersion, indexUsed, err := c.listItems(ctx, listRV, preparedKey, pred, recursive)
+ success := "true"
+ fallback := "false"
if err != nil {
+ if consistentRead {
+ if storage.IsTooLargeResourceVersion(err) {
+ fallback = "true"
+ err = c.storage.GetList(ctx, key, opts, listObj)
+ }
+ if err != nil {
+ success = "false"
+ }
+ metrics.ConsistentReadTotal.WithLabelValues(c.resourcePrefix, success, fallback).Add(1)
+ }
return err
}
+ if consistentRead {
+ metrics.ConsistentReadTotal.WithLabelValues(c.resourcePrefix, success, fallback).Add(1)
+ }
span.AddEvent("Listed items from cache", attribute.Int("count", len(objs)))
// store pointer of eligible objects,
// Why not directly put object in the items of listObj?
// the elements in ListObject are Struct type, making slice will bring excessive memory consumption.
// so we try to delay this action as much as possible
var selectedObjects []runtime.Object
- for _, obj := range objs {
+ var lastSelectedObjectKey string
+ var hasMoreListItems bool
+ limit := computeListLimit(opts)
+ for i, obj := range objs {
elem, ok := obj.(*storeElement)
if !ok {
return fmt.Errorf("non *storeElement returned from storage: %v", obj)
}
- if filter(elem.Key, elem.Labels, elem.Fields) {
+ if pred.MatchesObjectAttributes(elem.Labels, elem.Fields) {
selectedObjects = append(selectedObjects, elem.Object)
+ lastSelectedObjectKey = elem.Key
+ }
+ if limit > 0 && int64(len(selectedObjects)) >= limit {
+ hasMoreListItems = i < len(objs)-1
+ break
}
}
if len(selectedObjects) == 0 {
@@ -846,7 +942,12 @@ func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptio
}
span.AddEvent("Filtered items", attribute.Int("count", listVal.Len()))
if c.versioner != nil {
- if err := c.versioner.UpdateList(listObj, readResourceVersion, "", nil); err != nil {
+ continueValue, remainingItemCount, err := storage.PrepareContinueToken(lastSelectedObjectKey, key, int64(readResourceVersion), int64(len(objs)), hasMoreListItems, opts)
+ if err != nil {
+ return err
+ }
+
+ if err = c.versioner.UpdateList(listObj, readResourceVersion, continueValue, remainingItemCount); err != nil {
return err
}
}
@@ -877,6 +978,14 @@ func (c *Cacher) Count(pathPrefix string) (int64, error) {
return c.storage.Count(pathPrefix)
}
+// ReadinessCheck implements storage.Interface.
+func (c *Cacher) ReadinessCheck() error {
+ if !c.ready.check() {
+ return storage.ErrStorageNotReady
+ }
+ return nil
+}
+
// baseObjectThreadUnsafe omits locking for cachingObject.
func baseObjectThreadUnsafe(object runtime.Object) runtime.Object {
if co, ok := object.(*cachingObject); ok {
@@ -915,7 +1024,23 @@ func (c *Cacher) dispatchEvents() {
bookmarkTimer := c.clock.NewTimer(wait.Jitter(time.Second, 0.25))
defer bookmarkTimer.Stop()
+ // The internal informer populates the RV as soon as it conducts
+ // The first successful sync with the underlying store.
+ // The cache must wait until this first sync is completed to be deemed ready.
+ // Since we cannot send a bookmark when the lastProcessedResourceVersion is 0,
+ // we poll aggressively for the first list RV before entering the dispatch loop.
lastProcessedResourceVersion := uint64(0)
+ if err := wait.PollUntilContextCancel(wait.ContextForChannel(c.stopCh), 10*time.Millisecond, true, func(_ context.Context) (bool, error) {
+ if rv := c.watchCache.getListResourceVersion(); rv != 0 {
+ lastProcessedResourceVersion = rv
+ return true, nil
+ }
+ return false, nil
+ }); err != nil {
+ // given the function above never returns error,
+ // the non-empty error means that the stopCh was closed
+ return
+ }
for {
select {
case event, ok := <-c.incoming:
@@ -939,29 +1064,6 @@ func (c *Cacher) dispatchEvents() {
metrics.EventsCounter.WithLabelValues(c.groupResource.String()).Inc()
case <-bookmarkTimer.C():
bookmarkTimer.Reset(wait.Jitter(time.Second, 0.25))
- // Never send a bookmark event if we did not see an event here, this is fine
- // because we don't provide any guarantees on sending bookmarks.
- //
- // Just pop closed watchers and requeue others if needed.
- //
- // TODO(#115478): rework the following logic
- // in a way that would allow more
- // efficient cleanup of closed watchers
- if lastProcessedResourceVersion == 0 {
- func() {
- c.Lock()
- defer c.Unlock()
- for _, watchers := range c.bookmarkWatchers.popExpiredWatchersThreadUnsafe() {
- for _, watcher := range watchers {
- if watcher.stopped {
- continue
- }
- c.bookmarkWatchers.addWatcherThreadUnsafe(watcher)
- }
- }
- }()
- continue
- }
bookmarkEvent := &watchCacheEvent{
Type: watch.Bookmark,
Object: c.newFunc(),
@@ -1241,7 +1343,7 @@ func forgetWatcher(c *Cacher, w *cacheWatcher, index int, scope namespacedName,
}
}
-func filterWithAttrsFunction(key string, p storage.SelectionPredicate) filterWithAttrsFunc {
+func filterWithAttrsAndPrefixFunction(key string, p storage.SelectionPredicate) filterWithAttrsFunc {
filterFunc := func(objKey string, label labels.Set, field fields.Set) bool {
if !hasPathPrefix(objKey, key) {
return false
@@ -1265,59 +1367,76 @@ func (c *Cacher) LastSyncResourceVersion() (uint64, error) {
// spits a ResourceVersion after which the bookmark event will be delivered.
//
// The returned function must be called under the watchCache lock.
-func (c *Cacher) getBookmarkAfterResourceVersionLockedFunc(ctx context.Context, parsedResourceVersion uint64, opts storage.ListOptions) (func() uint64, error) {
- if opts.SendInitialEvents == nil || !*opts.SendInitialEvents || !opts.Predicate.AllowWatchBookmarks {
+func (c *Cacher) getBookmarkAfterResourceVersionLockedFunc(parsedResourceVersion, requiredResourceVersion uint64, opts storage.ListOptions) (func() uint64, error) {
+ if !isListWatchRequest(opts) {
return func() uint64 { return 0 }, nil
}
- return c.getCommonResourceVersionLockedFunc(ctx, parsedResourceVersion, opts)
-}
-
-// getStartResourceVersionForWatchLockedFunc returns a function that
-// spits a ResourceVersion the watch will be started from.
-// Depending on the input parameters the semantics of the returned ResourceVersion are:
-// - start at Exact (return parsedWatchResourceVersion)
-// - start at Most Recent (return an RV from etcd)
-// - start at Any (return the current watchCache's RV)
-//
-// The returned function must be called under the watchCache lock.
-func (c *Cacher) getStartResourceVersionForWatchLockedFunc(ctx context.Context, parsedWatchResourceVersion uint64, opts storage.ListOptions) (func() uint64, error) {
- if opts.SendInitialEvents == nil || *opts.SendInitialEvents {
- return func() uint64 { return parsedWatchResourceVersion }, nil
- }
- return c.getCommonResourceVersionLockedFunc(ctx, parsedWatchResourceVersion, opts)
-}
-// getCommonResourceVersionLockedFunc a helper that simply computes a ResourceVersion
-// based on the input parameters. Please examine callers of this method to get more context.
-//
-// The returned function must be called under the watchCache lock.
-func (c *Cacher) getCommonResourceVersionLockedFunc(ctx context.Context, parsedWatchResourceVersion uint64, opts storage.ListOptions) (func() uint64, error) {
switch {
case len(opts.ResourceVersion) == 0:
- rv, err := storage.GetCurrentResourceVersionFromStorage(ctx, c.storage, c.newListFunc, c.resourcePrefix, c.objectType.String())
- if err != nil {
- return nil, err
- }
- return func() uint64 { return rv }, nil
- case parsedWatchResourceVersion == 0:
+ return func() uint64 { return requiredResourceVersion }, nil
+ case parsedResourceVersion == 0:
// here we assume that watchCache locked is already held
return func() uint64 { return c.watchCache.resourceVersion }, nil
default:
- return func() uint64 { return parsedWatchResourceVersion }, nil
+ return func() uint64 { return parsedResourceVersion }, nil
}
}
+func isListWatchRequest(opts storage.ListOptions) bool {
+ return opts.SendInitialEvents != nil && *opts.SendInitialEvents && opts.Predicate.AllowWatchBookmarks
+}
+
+// getWatchCacheResourceVersion returns a ResourceVersion to which the watch cache must be synchronized to
+//
+// Depending on the input parameters, the semantics of the returned ResourceVersion are:
+// - must be at Exact RV (when parsedWatchResourceVersion > 0)
+// - can be at Any RV (when parsedWatchResourceVersion = 0)
+// - must be at Most Recent RV (return an RV from etcd)
+//
+// note that the above semantic is enforced by the API validation (defined elsewhere):
+//
+// if SendInitiaEvents != nil => ResourceVersionMatch = NotOlderThan
+// if ResourceVersionmatch != nil => ResourceVersionMatch = NotOlderThan & SendInitialEvents != nil
+func (c *Cacher) getWatchCacheResourceVersion(ctx context.Context, parsedWatchResourceVersion uint64, opts storage.ListOptions) (uint64, error) {
+ if len(opts.ResourceVersion) != 0 {
+ return parsedWatchResourceVersion, nil
+ }
+ // legacy case
+ if !utilfeature.DefaultFeatureGate.Enabled(features.WatchFromStorageWithoutResourceVersion) && opts.SendInitialEvents == nil && opts.ResourceVersion == "" {
+ return 0, nil
+ }
+ rv, err := storage.GetCurrentResourceVersionFromStorage(ctx, c.storage, c.newListFunc, c.resourcePrefix, c.objectType.String())
+ return rv, err
+}
+
// waitUntilWatchCacheFreshAndForceAllEvents waits until cache is at least
// as fresh as given requestedWatchRV if sendInitialEvents was requested.
-// Additionally, it instructs the caller whether it should ask for
-// all events from the cache (full state) or not.
-func (c *Cacher) waitUntilWatchCacheFreshAndForceAllEvents(ctx context.Context, requestedWatchRV uint64, opts storage.ListOptions) (bool, error) {
+// otherwise, we allow for establishing the connection because the clients
+// can wait for events without unnecessary blocking.
+func (c *Cacher) waitUntilWatchCacheFreshAndForceAllEvents(ctx context.Context, requestedWatchRV uint64, opts storage.ListOptions) error {
if opts.SendInitialEvents != nil && *opts.SendInitialEvents {
+ // Here be dragons:
+ // Since the etcd feature checker needs to check all members
+ // to determine whether a given feature is supported,
+ // we may receive a positive response even if the feature is not supported.
+ //
+ // In this very rare scenario, the worst case will be that this
+ // request will wait for 3 seconds before it fails.
+ if etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress) && c.watchCache.notFresh(requestedWatchRV) {
+ c.watchCache.waitingUntilFresh.Add()
+ defer c.watchCache.waitingUntilFresh.Remove()
+ }
err := c.watchCache.waitUntilFreshAndBlock(ctx, requestedWatchRV)
defer c.watchCache.RUnlock()
- return err == nil, err
+ return err
}
- return false, nil
+ return nil
+}
+
+// Wait blocks until the cacher is Ready or Stopped, it returns an error if Stopped.
+func (c *Cacher) Wait(ctx context.Context) error {
+ return c.ready.wait(ctx)
}
// errWatcher implements watch.Interface to return a single error
diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go
index d0b3cdc9048..dd77febb930 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go
@@ -106,6 +106,17 @@ var (
[]string{"resource"},
)
+ watchCacheResourceVersion = compbasemetrics.NewGaugeVec(
+ &compbasemetrics.GaugeOpts{
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "resource_version",
+ Help: "Current resource version of watch cache broken by resource type.",
+ StabilityLevel: compbasemetrics.ALPHA,
+ },
+ []string{"resource"},
+ )
+
watchCacheCapacityIncreaseTotal = compbasemetrics.NewCounterVec(
&compbasemetrics.CounterOpts{
Subsystem: subsystem,
@@ -146,6 +157,25 @@ var (
},
[]string{"resource"},
)
+
+ WatchCacheReadWait = compbasemetrics.NewHistogramVec(
+ &compbasemetrics.HistogramOpts{
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "read_wait_seconds",
+ Help: "Histogram of time spent waiting for a watch cache to become fresh.",
+ StabilityLevel: compbasemetrics.ALPHA,
+ Buckets: []float64{0.005, 0.025, 0.05, 0.1, 0.2, 0.4, 0.6, 0.8, 1.0, 1.25, 1.5, 2, 3},
+ }, []string{"resource"})
+
+ ConsistentReadTotal = compbasemetrics.NewCounterVec(
+ &compbasemetrics.CounterOpts{
+ Namespace: namespace,
+ Subsystem: subsystem,
+ Name: "consistent_read_total",
+ Help: "Counter for consistent reads from cache.",
+ StabilityLevel: compbasemetrics.ALPHA,
+ }, []string{"resource", "success", "fallback"})
)
var registerMetrics sync.Once
@@ -161,10 +191,13 @@ func Register() {
legacyregistry.MustRegister(EventsReceivedCounter)
legacyregistry.MustRegister(EventsCounter)
legacyregistry.MustRegister(TerminatedWatchersCounter)
+ legacyregistry.MustRegister(watchCacheResourceVersion)
legacyregistry.MustRegister(watchCacheCapacityIncreaseTotal)
legacyregistry.MustRegister(watchCacheCapacityDecreaseTotal)
legacyregistry.MustRegister(WatchCacheCapacity)
legacyregistry.MustRegister(WatchCacheInitializations)
+ legacyregistry.MustRegister(WatchCacheReadWait)
+ legacyregistry.MustRegister(ConsistentReadTotal)
})
}
@@ -175,6 +208,11 @@ func RecordListCacheMetrics(resourcePrefix, indexName string, numFetched, numRet
listCacheNumReturned.WithLabelValues(resourcePrefix).Add(float64(numReturned))
}
+// RecordResourceVersion sets the current resource version for a given resource type.
+func RecordResourceVersion(resourcePrefix string, resourceVersion uint64) {
+ watchCacheResourceVersion.WithLabelValues(resourcePrefix).Set(float64(resourceVersion))
+}
+
// RecordsWatchCacheCapacityChange record watchCache capacity resize(increase or decrease) operations.
func RecordsWatchCacheCapacityChange(objType string, old, new int) {
WatchCacheCapacity.WithLabelValues(objType).Set(float64(new))
diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go
index 7943a93dcab..63a23800f02 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go
@@ -44,17 +44,3 @@ func hasPathPrefix(s, pathPrefix string) bool {
}
return false
}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
-
-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go
index c27ca053b78..34a48ac637d 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go
@@ -33,6 +33,7 @@ import (
"k8s.io/apiserver/pkg/features"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/cacher/metrics"
+ etcdfeature "k8s.io/apiserver/pkg/storage/feature"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/client-go/tools/cache"
"k8s.io/component-base/tracing"
@@ -311,25 +312,26 @@ func (w *watchCache) processEvent(event watch.Event, resourceVersion uint64, upd
RecordTime: w.clock.Now(),
}
+ // We can call w.store.Get() outside of a critical section,
+ // because the w.store itself is thread-safe and the only
+ // place where w.store is modified is below (via updateFunc)
+ // and these calls are serialized because reflector is processing
+ // events one-by-one.
+ previous, exists, err := w.store.Get(elem)
+ if err != nil {
+ return err
+ }
+ if exists {
+ previousElem := previous.(*storeElement)
+ wcEvent.PrevObject = previousElem.Object
+ wcEvent.PrevObjLabels = previousElem.Labels
+ wcEvent.PrevObjFields = previousElem.Fields
+ }
+
if err := func() error {
- // TODO: We should consider moving this lock below after the watchCacheEvent
- // is created. In such situation, the only problematic scenario is Replace()
- // happening after getting object from store and before acquiring a lock.
- // Maybe introduce another lock for this purpose.
w.Lock()
defer w.Unlock()
- previous, exists, err := w.store.Get(elem)
- if err != nil {
- return err
- }
- if exists {
- previousElem := previous.(*storeElement)
- wcEvent.PrevObject = previousElem.Object
- wcEvent.PrevObjLabels = previousElem.Labels
- wcEvent.PrevObjFields = previousElem.Fields
- }
-
w.updateCache(wcEvent)
w.resourceVersion = resourceVersion
defer w.cond.Broadcast()
@@ -346,6 +348,7 @@ func (w *watchCache) processEvent(event watch.Event, resourceVersion uint64, upd
if w.eventHandler != nil {
w.eventHandler(wcEvent)
}
+ metrics.RecordResourceVersion(w.groupResource.String(), resourceVersion)
return nil
}
@@ -428,6 +431,7 @@ func (w *watchCache) UpdateResourceVersion(resourceVersion string) {
}
w.eventHandler(wcEvent)
}
+ metrics.RecordResourceVersion(w.groupResource.String(), rv)
}
// List returns list of pointers to objects.
@@ -440,6 +444,11 @@ func (w *watchCache) List() []interface{} {
// You HAVE TO explicitly call w.RUnlock() after this function.
func (w *watchCache) waitUntilFreshAndBlock(ctx context.Context, resourceVersion uint64) error {
startTime := w.clock.Now()
+ defer func() {
+ if resourceVersion > 0 {
+ metrics.WatchCacheReadWait.WithContext(ctx).WithLabelValues(w.groupResource.String()).Observe(w.clock.Since(startTime).Seconds())
+ }
+ }()
// In case resourceVersion is 0, we accept arbitrarily stale result.
// As a result, the condition in the below for loop will never be
@@ -492,8 +501,31 @@ func (s sortableStoreElements) Swap(i, j int) {
// WaitUntilFreshAndList returns list of pointers to `storeElement` objects along
// with their ResourceVersion and the name of the index, if any, that was used.
-func (w *watchCache) WaitUntilFreshAndList(ctx context.Context, resourceVersion uint64, matchValues []storage.MatchValue) (result []interface{}, rv uint64, index string, err error) {
- if utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) && w.notFresh(resourceVersion) {
+func (w *watchCache) WaitUntilFreshAndList(ctx context.Context, resourceVersion uint64, key string, matchValues []storage.MatchValue) ([]interface{}, uint64, string, error) {
+ items, rv, index, err := w.waitUntilFreshAndListItems(ctx, resourceVersion, key, matchValues)
+ if err != nil {
+ return nil, 0, "", err
+ }
+
+ var result []interface{}
+ for _, item := range items {
+ elem, ok := item.(*storeElement)
+ if !ok {
+ return nil, 0, "", fmt.Errorf("non *storeElement returned from storage: %v", item)
+ }
+ if !hasPathPrefix(elem.Key, key) {
+ continue
+ }
+ result = append(result, item)
+ }
+
+ sort.Sort(sortableStoreElements(result))
+ return result, rv, index, nil
+}
+
+func (w *watchCache) waitUntilFreshAndListItems(ctx context.Context, resourceVersion uint64, key string, matchValues []storage.MatchValue) (result []interface{}, rv uint64, index string, err error) {
+ requestWatchProgressSupported := etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress)
+ if utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) && requestWatchProgressSupported && w.notFresh(resourceVersion) {
w.waitingUntilFresh.Add()
err = w.waitUntilFreshAndBlock(ctx, resourceVersion)
w.waitingUntilFresh.Remove()
@@ -501,7 +533,6 @@ func (w *watchCache) WaitUntilFreshAndList(ctx context.Context, resourceVersion
err = w.waitUntilFreshAndBlock(ctx, resourceVersion)
}
- defer func() { sort.Sort(sortableStoreElements(result)) }()
defer w.RUnlock()
if err != nil {
return result, rv, index, err
@@ -531,7 +562,14 @@ func (w *watchCache) notFresh(resourceVersion uint64) bool {
// WaitUntilFreshAndGet returns a pointers to object.
func (w *watchCache) WaitUntilFreshAndGet(ctx context.Context, resourceVersion uint64, key string) (interface{}, bool, uint64, error) {
- err := w.waitUntilFreshAndBlock(ctx, resourceVersion)
+ var err error
+ if utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) && w.notFresh(resourceVersion) {
+ w.waitingUntilFresh.Add()
+ err = w.waitUntilFreshAndBlock(ctx, resourceVersion)
+ w.waitingUntilFresh.Remove()
+ } else {
+ err = w.waitUntilFreshAndBlock(ctx, resourceVersion)
+ }
defer w.RUnlock()
if err != nil {
return nil, false, 0, err
@@ -614,7 +652,9 @@ func (w *watchCache) Replace(objs []interface{}, resourceVersion string) error {
w.onReplace()
}
w.cond.Broadcast()
- klog.V(3).Infof("Replace watchCache (rev: %v) ", resourceVersion)
+
+ metrics.RecordResourceVersion(w.groupResource.String(), version)
+ klog.V(3).Infof("Replaced watchCache (rev: %v) ", resourceVersion)
return nil
}
@@ -629,6 +669,12 @@ func (w *watchCache) Resync() error {
return nil
}
+func (w *watchCache) getListResourceVersion() uint64 {
+ w.RLock()
+ defer w.RUnlock()
+ return w.listResourceVersion
+}
+
func (w *watchCache) currentCapacity() int {
w.RLock()
defer w.RUnlock()
@@ -691,7 +737,12 @@ func (w *watchCache) isIndexValidLocked(index int) bool {
// getAllEventsSinceLocked returns a watchCacheInterval that can be used to
// retrieve events since a certain resourceVersion. This function assumes to
// be called under the watchCache lock.
-func (w *watchCache) getAllEventsSinceLocked(resourceVersion uint64) (*watchCacheInterval, error) {
+func (w *watchCache) getAllEventsSinceLocked(resourceVersion uint64, key string, opts storage.ListOptions) (*watchCacheInterval, error) {
+ _, matchesSingle := opts.Predicate.MatchesSingle()
+ if opts.SendInitialEvents != nil && *opts.SendInitialEvents {
+ return w.getIntervalFromStoreLocked(key, matchesSingle)
+ }
+
size := w.endIndex - w.startIndex
var oldest uint64
switch {
@@ -711,13 +762,19 @@ func (w *watchCache) getAllEventsSinceLocked(resourceVersion uint64) (*watchCach
}
if resourceVersion == 0 {
- // resourceVersion = 0 means that we don't require any specific starting point
- // and we would like to start watching from ~now.
- // However, to keep backward compatibility, we additionally need to return the
- // current state and only then start watching from that point.
- //
- // TODO: In v2 api, we should stop returning the current state - #13969.
- return w.getIntervalFromStoreLocked()
+ if opts.SendInitialEvents == nil {
+ // resourceVersion = 0 means that we don't require any specific starting point
+ // and we would like to start watching from ~now.
+ // However, to keep backward compatibility, we additionally need to return the
+ // current state and only then start watching from that point.
+ //
+ // TODO: In v2 api, we should stop returning the current state - #13969.
+ return w.getIntervalFromStoreLocked(key, matchesSingle)
+ }
+ // SendInitialEvents = false and resourceVersion = 0
+ // means that the request would like to start watching
+ // from Any resourceVersion
+ resourceVersion = w.resourceVersion
}
if resourceVersion < oldest-1 {
return nil, errors.NewResourceExpired(fmt.Sprintf("too old resource version: %d (%d)", resourceVersion, oldest-1))
@@ -731,15 +788,15 @@ func (w *watchCache) getAllEventsSinceLocked(resourceVersion uint64) (*watchCach
indexerFunc := func(i int) *watchCacheEvent {
return w.cache[i%w.capacity]
}
- ci := newCacheInterval(w.startIndex+first, w.endIndex, indexerFunc, w.indexValidator, &w.RWMutex)
+ ci := newCacheInterval(w.startIndex+first, w.endIndex, indexerFunc, w.indexValidator, w.RWMutex.RLocker())
return ci, nil
}
// getIntervalFromStoreLocked returns a watchCacheInterval
// that covers the entire storage state.
// This function assumes to be called under the watchCache lock.
-func (w *watchCache) getIntervalFromStoreLocked() (*watchCacheInterval, error) {
- ci, err := newCacheIntervalFromStore(w.resourceVersion, w.store, w.getAttrsFunc)
+func (w *watchCache) getIntervalFromStoreLocked(key string, matchesSingle bool) (*watchCacheInterval, error) {
+ ci, err := newCacheIntervalFromStore(w.resourceVersion, w.store, w.getAttrsFunc, key, matchesSingle)
if err != nil {
return nil, err
}
diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go
index 2b57dd16509..fa7d3894686 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go
@@ -133,9 +133,22 @@ func (s sortableWatchCacheEvents) Swap(i, j int) {
// returned by Next() need to be events from a List() done on the underlying store of
// the watch cache.
// The items returned in the interval will be sorted by Key.
-func newCacheIntervalFromStore(resourceVersion uint64, store cache.Indexer, getAttrsFunc attrFunc) (*watchCacheInterval, error) {
+func newCacheIntervalFromStore(resourceVersion uint64, store cache.Indexer, getAttrsFunc attrFunc, key string, matchesSingle bool) (*watchCacheInterval, error) {
buffer := &watchCacheIntervalBuffer{}
- allItems := store.List()
+ var allItems []interface{}
+
+ if matchesSingle {
+ item, exists, err := store.GetByKey(key)
+ if err != nil {
+ return nil, err
+ }
+
+ if exists {
+ allItems = append(allItems, item)
+ }
+ } else {
+ allItems = store.List()
+ }
buffer.buffer = make([]*watchCacheEvent, len(allItems))
for i, item := range allItems {
elem, ok := item.(*storeElement)
diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go b/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go
index 13f50bc187d..087fb14e546 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go
@@ -42,14 +42,14 @@ func newConditionalProgressRequester(requestWatchProgress WatchProgressRequester
requestWatchProgress: requestWatchProgress,
contextMetadata: contextMetadata,
}
- pr.cond = sync.NewCond(pr.mux.RLocker())
+ pr.cond = sync.NewCond(&pr.mux)
return pr
}
type WatchProgressRequester func(ctx context.Context) error
type TickerFactory interface {
- NewTicker(time.Duration) clock.Ticker
+ NewTimer(time.Duration) clock.Timer
}
// conditionalProgressRequester will request progress notification if there
@@ -59,7 +59,7 @@ type conditionalProgressRequester struct {
requestWatchProgress WatchProgressRequester
contextMetadata metadata.MD
- mux sync.RWMutex
+ mux sync.Mutex
cond *sync.Cond
waiting int
stopped bool
@@ -78,12 +78,12 @@ func (pr *conditionalProgressRequester) Run(stopCh <-chan struct{}) {
pr.stopped = true
pr.cond.Signal()
}()
- ticker := pr.clock.NewTicker(progressRequestPeriod)
- defer ticker.Stop()
+ timer := pr.clock.NewTimer(progressRequestPeriod)
+ defer timer.Stop()
for {
stopped := func() bool {
- pr.mux.RLock()
- defer pr.mux.RUnlock()
+ pr.mux.Lock()
+ defer pr.mux.Unlock()
for pr.waiting == 0 && !pr.stopped {
pr.cond.Wait()
}
@@ -94,15 +94,17 @@ func (pr *conditionalProgressRequester) Run(stopCh <-chan struct{}) {
}
select {
- case <-ticker.C():
+ case <-timer.C():
shouldRequest := func() bool {
- pr.mux.RLock()
- defer pr.mux.RUnlock()
+ pr.mux.Lock()
+ defer pr.mux.Unlock()
return pr.waiting > 0 && !pr.stopped
}()
if !shouldRequest {
+ timer.Reset(0)
continue
}
+ timer.Reset(progressRequestPeriod)
err := pr.requestWatchProgress(ctx)
if err != nil {
klog.V(4).InfoS("Error requesting bookmark", "err", err)
@@ -124,5 +126,4 @@ func (pr *conditionalProgressRequester) Remove() {
pr.mux.Lock()
defer pr.mux.Unlock()
pr.waiting -= 1
- pr.cond.Signal()
}
diff --git a/vendor/k8s.io/apiserver/pkg/storage/continue.go b/vendor/k8s.io/apiserver/pkg/storage/continue.go
index fcd95af9b3d..1d7976690a8 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/continue.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/continue.go
@@ -91,3 +91,30 @@ func EncodeContinue(key, keyPrefix string, resourceVersion int64) (string, error
}
return base64.RawURLEncoding.EncodeToString(out), nil
}
+
+// PrepareContinueToken prepares optional
+// parameters for retrieving additional results for a paginated request.
+//
+// This function sets up parameters that a client can use to fetch the remaining results
+// from the server if they are available.
+func PrepareContinueToken(keyLastItem, keyPrefix string, resourceVersion int64, itemsCount int64, hasMoreItems bool, opts ListOptions) (string, *int64, error) {
+ var remainingItemCount *int64
+ var continueValue string
+ var err error
+
+ if hasMoreItems {
+ // Instruct the client to begin querying from immediately after the last key.
+ continueValue, err = EncodeContinue(keyLastItem+"\x00", keyPrefix, resourceVersion)
+ if err != nil {
+ return "", remainingItemCount, err
+ }
+ // Etcd response counts in objects that do not match the pred.
+ // Instead of returning inaccurate count for non-empty selectors, we return nil.
+ // We only set remainingItemCount if the predicate is empty.
+ if opts.Predicate.Empty() {
+ remainingItems := itemsCount - opts.Predicate.Limit
+ remainingItemCount = &remainingItems
+ }
+ }
+ return continueValue, remainingItemCount, err
+}
diff --git a/vendor/k8s.io/apiserver/pkg/storage/errors.go b/vendor/k8s.io/apiserver/pkg/storage/errors.go
index 5f29097c59c..cc2c1c974d4 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/errors.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/errors.go
@@ -25,7 +25,10 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"
)
-var ErrResourceVersionSetOnCreate = errors.New("resourceVersion should not be set on objects to be created")
+var (
+ ErrResourceVersionSetOnCreate = errors.New("resourceVersion should not be set on objects to be created")
+ ErrStorageNotReady = errors.New("storage not ready")
+)
const (
ErrCodeKeyNotFound int = iota + 1
@@ -33,6 +36,7 @@ const (
ErrCodeResourceVersionConflicts
ErrCodeInvalidObj
ErrCodeUnreachable
+ ErrCodeTimeout
)
var errCodeToMessage = map[int]string{
@@ -41,6 +45,7 @@ var errCodeToMessage = map[int]string{
ErrCodeResourceVersionConflicts: "resource version conflicts",
ErrCodeInvalidObj: "invalid object",
ErrCodeUnreachable: "server unreachable",
+ ErrCodeTimeout: "request timeout",
}
func NewKeyNotFoundError(key string, rv int64) *StorageError {
@@ -75,6 +80,14 @@ func NewUnreachableError(key string, rv int64) *StorageError {
}
}
+func NewTimeoutError(key, msg string) *StorageError {
+ return &StorageError{
+ Code: ErrCodeTimeout,
+ Key: key,
+ AdditionalErrorMsg: msg,
+ }
+}
+
func NewInvalidObjError(key, msg string) *StorageError {
return &StorageError{
Code: ErrCodeInvalidObj,
@@ -115,6 +128,11 @@ func IsConflict(err error) bool {
return isErrCode(err, ErrCodeResourceVersionConflicts)
}
+// IsRequestTimeout returns true if and only if err indicates that the request has timed out.
+func IsRequestTimeout(err error) bool {
+ return isErrCode(err, ErrCodeTimeout)
+}
+
// IsInvalidObj returns true if and only if err is invalid error
func IsInvalidObj(err error) bool {
return isErrCode(err, ErrCodeInvalidObj)
diff --git a/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go b/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go
index 89f34539801..60a6d5cd869 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go
@@ -28,7 +28,7 @@ func InterpretListError(err error, qualifiedResource schema.GroupResource) error
switch {
case storage.IsNotFound(err):
return errors.NewNotFound(qualifiedResource, "")
- case storage.IsUnreachable(err):
+ case storage.IsUnreachable(err), storage.IsRequestTimeout(err):
return errors.NewServerTimeout(qualifiedResource, "list", 2) // TODO: make configurable or handled at a higher level
case storage.IsInternalError(err):
return errors.NewInternalError(err)
diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS b/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS
index 6b7e2928ea1..33809ed8c8e 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS
+++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS
@@ -2,3 +2,6 @@
reviewers:
- wojtek-t
+ - serathius
+labels:
+ - sig/etcd
diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go
index 1c0307bd913..747e120dc74 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go
@@ -84,7 +84,7 @@ var (
},
[]string{"endpoint"},
)
- storageSizeDescription = compbasemetrics.NewDesc("apiserver_storage_size_bytes", "Size of the storage database file physically allocated in bytes.", []string{"storage_cluster_id"}, nil, compbasemetrics.ALPHA, "")
+ storageSizeDescription = compbasemetrics.NewDesc("apiserver_storage_size_bytes", "Size of the storage database file physically allocated in bytes.", []string{"storage_cluster_id"}, nil, compbasemetrics.STABLE, "")
storageMonitor = &monitorCollector{monitorGetter: func() ([]Monitor, error) { return nil, nil }}
etcdEventsReceivedCounts = compbasemetrics.NewCounterVec(
&compbasemetrics.CounterOpts{
@@ -167,6 +167,7 @@ func Register() {
legacyregistry.MustRegister(objectCounts)
legacyregistry.MustRegister(dbTotalSize)
legacyregistry.CustomMustRegister(storageMonitor)
+ legacyregistry.MustRegister(etcdEventsReceivedCounts)
legacyregistry.MustRegister(etcdBookmarkCounts)
legacyregistry.MustRegister(etcdLeaseObjectCounts)
legacyregistry.MustRegister(listStorageCount)
diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go
index 1e5e40d6235..3eb967188b6 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go
@@ -38,9 +38,13 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/apiserver/pkg/audit"
+ endpointsrequest "k8s.io/apiserver/pkg/endpoints/request"
+ "k8s.io/apiserver/pkg/features"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/etcd3/metrics"
+ etcdfeature "k8s.io/apiserver/pkg/storage/feature"
"k8s.io/apiserver/pkg/storage/value"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/component-base/tracing"
"k8s.io/klog/v2"
)
@@ -138,6 +142,9 @@ func newStore(c *clientv3.Client, codec runtime.Codec, newFunc, newListFunc func
w.getCurrentStorageRV = func(ctx context.Context) (uint64, error) {
return storage.GetCurrentResourceVersionFromStorage(ctx, s, newListFunc, resourcePrefix, w.objectType)
}
+ if utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) || utilfeature.DefaultFeatureGate.Enabled(features.WatchList) {
+ etcdfeature.DefaultFeatureSupportChecker.CheckClient(c.Ctx(), c, storage.RequestWatchProgress)
+ }
return s
}
@@ -584,6 +591,52 @@ func (s *store) Count(key string) (int64, error) {
return getResp.Count, nil
}
+// ReadinessCheck implements storage.Interface.
+func (s *store) ReadinessCheck() error {
+ return nil
+}
+
+// resolveGetListRev is used by GetList to resolve the rev to use in the client.KV.Get request.
+func (s *store) resolveGetListRev(continueKey string, continueRV int64, opts storage.ListOptions) (int64, error) {
+ var withRev int64
+ // Uses continueRV if this is a continuation request.
+ if len(continueKey) > 0 {
+ if len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
+ return withRev, apierrors.NewBadRequest("specifying resource version is not allowed when using continue")
+ }
+ // If continueRV > 0, the LIST request needs a specific resource version.
+ // continueRV==0 is invalid.
+ // If continueRV < 0, the request is for the latest resource version.
+ if continueRV > 0 {
+ withRev = continueRV
+ }
+ return withRev, nil
+ }
+ // Returns 0 if ResourceVersion is not specified.
+ if len(opts.ResourceVersion) == 0 {
+ return withRev, nil
+ }
+ parsedRV, err := s.versioner.ParseResourceVersion(opts.ResourceVersion)
+ if err != nil {
+ return withRev, apierrors.NewBadRequest(fmt.Sprintf("invalid resource version: %v", err))
+ }
+
+ switch opts.ResourceVersionMatch {
+ case metav1.ResourceVersionMatchNotOlderThan:
+ // The not older than constraint is checked after we get a response from etcd,
+ // and returnedRV is then set to the revision we get from the etcd response.
+ case metav1.ResourceVersionMatchExact:
+ withRev = int64(parsedRV)
+ case "": // legacy case
+ if opts.Recursive && opts.Predicate.Limit > 0 && parsedRV > 0 {
+ withRev = int64(parsedRV)
+ }
+ default:
+ return withRev, fmt.Errorf("unknown ResourceVersionMatch value: %v", opts.ResourceVersionMatch)
+ }
+ return withRev, nil
+}
+
// GetList implements storage.Interface.
func (s *store) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error {
preparedKey, err := s.prepareKey(key)
@@ -636,41 +689,15 @@ func (s *store) GetList(ctx context.Context, key string, opts storage.ListOption
var continueRV, withRev int64
var continueKey string
- switch {
- case opts.Recursive && len(opts.Predicate.Continue) > 0:
+ if opts.Recursive && len(opts.Predicate.Continue) > 0 {
continueKey, continueRV, err = storage.DecodeContinue(opts.Predicate.Continue, keyPrefix)
if err != nil {
return apierrors.NewBadRequest(fmt.Sprintf("invalid continue token: %v", err))
}
-
- if len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
- return apierrors.NewBadRequest("specifying resource version is not allowed when using continue")
- }
preparedKey = continueKey
- // If continueRV > 0, the LIST request needs a specific resource version.
- // continueRV==0 is invalid.
- // If continueRV < 0, the request is for the latest resource version.
- if continueRV > 0 {
- withRev = continueRV
- }
- case len(opts.ResourceVersion) > 0:
- parsedRV, err := s.versioner.ParseResourceVersion(opts.ResourceVersion)
- if err != nil {
- return apierrors.NewBadRequest(fmt.Sprintf("invalid resource version: %v", err))
- }
- switch opts.ResourceVersionMatch {
- case metav1.ResourceVersionMatchNotOlderThan:
- // The not older than constraint is checked after we get a response from etcd,
- // and returnedRV is then set to the revision we get from the etcd response.
- case metav1.ResourceVersionMatchExact:
- withRev = int64(parsedRV)
- case "": // legacy case
- if opts.Recursive && opts.Predicate.Limit > 0 && parsedRV > 0 {
- withRev = int64(parsedRV)
- }
- default:
- return fmt.Errorf("unknown ResourceVersionMatch value: %v", opts.ResourceVersionMatch)
- }
+ }
+ if withRev, err = s.resolveGetListRev(continueKey, continueRV, opts); err != nil {
+ return err
}
if withRev != 0 {
@@ -738,10 +765,25 @@ func (s *store) GetList(ctx context.Context, key string, opts storage.ListOption
return storage.NewInternalErrorf("unable to transform key %q: %v", kv.Key, err)
}
- if err := appendListItem(v, data, uint64(kv.ModRevision), opts.Predicate, s.codec, s.versioner, newItemFunc); err != nil {
+ // Check if the request has already timed out before decode object
+ select {
+ case <-ctx.Done():
+ // parent context is canceled or timed out, no point in continuing
+ return storage.NewTimeoutError(string(kv.Key), "request did not complete within requested timeout")
+ default:
+ }
+
+ obj, err := decodeListItem(ctx, data, uint64(kv.ModRevision), s.codec, s.versioner, newItemFunc)
+ if err != nil {
recordDecodeError(s.groupResourceString, string(kv.Key))
return err
}
+
+ // being unable to set the version does not prevent the object from being extracted
+ if matched, err := opts.Predicate.Matches(obj); err == nil && matched {
+ v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem()))
+ }
+
numEvald++
// free kv early. Long lists can take O(seconds) to decode.
@@ -774,27 +816,11 @@ func (s *store) GetList(ctx context.Context, key string, opts storage.ListOption
v.Set(reflect.MakeSlice(v.Type(), 0, 0))
}
- // instruct the client to begin querying from immediately after the last key we returned
- // we never return a key that the client wouldn't be allowed to see
- if hasMore {
- // we want to start immediately after the last key
- next, err := storage.EncodeContinue(string(lastKey)+"\x00", keyPrefix, withRev)
- if err != nil {
- return err
- }
- var remainingItemCount *int64
- // getResp.Count counts in objects that do not match the pred.
- // Instead of returning inaccurate count for non-empty selectors, we return nil.
- // Only set remainingItemCount if the predicate is empty.
- if opts.Predicate.Empty() {
- c := int64(getResp.Count - opts.Predicate.Limit)
- remainingItemCount = &c
- }
- return s.versioner.UpdateList(listObj, uint64(withRev), next, remainingItemCount)
+ continueValue, remainingItemCount, err := storage.PrepareContinueToken(string(lastKey), keyPrefix, withRev, getResp.Count, hasMore, opts)
+ if err != nil {
+ return err
}
-
- // no continuation
- return s.versioner.UpdateList(listObj, uint64(withRev), "", nil)
+ return s.versioner.UpdateList(listObj, uint64(withRev), continueValue, remainingItemCount)
}
// growSlice takes a slice value and grows its capacity up
@@ -1015,20 +1041,23 @@ func decode(codec runtime.Codec, versioner storage.Versioner, value []byte, objP
return nil
}
-// appendListItem decodes and appends the object (if it passes filter) to v, which must be a slice.
-func appendListItem(v reflect.Value, data []byte, rev uint64, pred storage.SelectionPredicate, codec runtime.Codec, versioner storage.Versioner, newItemFunc func() runtime.Object) error {
+// decodeListItem decodes bytes value in array into object.
+func decodeListItem(ctx context.Context, data []byte, rev uint64, codec runtime.Codec, versioner storage.Versioner, newItemFunc func() runtime.Object) (runtime.Object, error) {
+ startedAt := time.Now()
+ defer func() {
+ endpointsrequest.TrackDecodeLatency(ctx, time.Since(startedAt))
+ }()
+
obj, _, err := codec.Decode(data, nil, newItemFunc())
if err != nil {
- return err
+ return nil, err
}
- // being unable to set the version does not prevent the object from being extracted
+
if err := versioner.UpdateObject(obj, rev); err != nil {
klog.Errorf("failed to update object version: %v", err)
}
- if matched, err := pred.Matches(obj); err == nil && matched {
- v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem()))
- }
- return nil
+
+ return obj, nil
}
// recordDecodeError record decode error split by object type.
diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go
index 85acf44f86b..536f2e1c086 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go
@@ -46,8 +46,9 @@ import (
const (
// We have set a buffer in order to reduce times of context switches.
- incomingBufSize = 100
- outgoingBufSize = 100
+ incomingBufSize = 100
+ outgoingBufSize = 100
+ processEventConcurrency = 10
)
// defaultWatcherMaxLimit is used to facilitate construction tests
@@ -230,8 +231,7 @@ func (wc *watchChan) run(initialEventsEndBookmarkRequired, forceInitialEvents bo
go wc.startWatching(watchClosedCh, initialEventsEndBookmarkRequired, forceInitialEvents)
var resultChanWG sync.WaitGroup
- resultChanWG.Add(1)
- go wc.processEvent(&resultChanWG)
+ wc.processEvents(&resultChanWG)
select {
case err := <-wc.errChan:
@@ -424,10 +424,17 @@ func (wc *watchChan) startWatching(watchClosedCh chan struct{}, initialEventsEnd
close(watchClosedCh)
}
-// processEvent processes events from etcd watcher and sends results to resultChan.
-func (wc *watchChan) processEvent(wg *sync.WaitGroup) {
+// processEvents processes events from etcd watcher and sends results to resultChan.
+func (wc *watchChan) processEvents(wg *sync.WaitGroup) {
+ if utilfeature.DefaultFeatureGate.Enabled(features.ConcurrentWatchObjectDecode) {
+ wc.concurrentProcessEvents(wg)
+ } else {
+ wg.Add(1)
+ go wc.serialProcessEvents(wg)
+ }
+}
+func (wc *watchChan) serialProcessEvents(wg *sync.WaitGroup) {
defer wg.Done()
-
for {
select {
case e := <-wc.incomingEventChan:
@@ -435,7 +442,7 @@ func (wc *watchChan) processEvent(wg *sync.WaitGroup) {
if res == nil {
continue
}
- if len(wc.resultChan) == outgoingBufSize {
+ if len(wc.resultChan) == cap(wc.resultChan) {
klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize, "objectType", wc.watcher.objectType, "groupResource", wc.watcher.groupResource)
}
// If user couldn't receive results fast enough, we also block incoming events from watcher.
@@ -452,6 +459,95 @@ func (wc *watchChan) processEvent(wg *sync.WaitGroup) {
}
}
+func (wc *watchChan) concurrentProcessEvents(wg *sync.WaitGroup) {
+ p := concurrentOrderedEventProcessing{
+ input: wc.incomingEventChan,
+ processFunc: wc.transform,
+ output: wc.resultChan,
+ processingQueue: make(chan chan *watch.Event, processEventConcurrency-1),
+
+ objectType: wc.watcher.objectType,
+ groupResource: wc.watcher.groupResource,
+ }
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ p.scheduleEventProcessing(wc.ctx, wg)
+ }()
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ p.collectEventProcessing(wc.ctx)
+ }()
+}
+
+type concurrentOrderedEventProcessing struct {
+ input chan *event
+ processFunc func(*event) *watch.Event
+ output chan watch.Event
+
+ processingQueue chan chan *watch.Event
+ // Metadata for logging
+ objectType string
+ groupResource schema.GroupResource
+}
+
+func (p *concurrentOrderedEventProcessing) scheduleEventProcessing(ctx context.Context, wg *sync.WaitGroup) {
+ var e *event
+ for {
+ select {
+ case <-ctx.Done():
+ return
+ case e = <-p.input:
+ }
+ processingResponse := make(chan *watch.Event, 1)
+ select {
+ case <-ctx.Done():
+ return
+ case p.processingQueue <- processingResponse:
+ }
+ wg.Add(1)
+ go func(e *event, response chan<- *watch.Event) {
+ defer wg.Done()
+ select {
+ case <-ctx.Done():
+ case response <- p.processFunc(e):
+ }
+ }(e, processingResponse)
+ }
+}
+
+func (p *concurrentOrderedEventProcessing) collectEventProcessing(ctx context.Context) {
+ var processingResponse chan *watch.Event
+ var e *watch.Event
+ for {
+ select {
+ case <-ctx.Done():
+ return
+ case processingResponse = <-p.processingQueue:
+ }
+ select {
+ case <-ctx.Done():
+ return
+ case e = <-processingResponse:
+ }
+ if e == nil {
+ continue
+ }
+ if len(p.output) == cap(p.output) {
+ klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize, "objectType", p.objectType, "groupResource", p.groupResource)
+ }
+ // If user couldn't receive results fast enough, we also block incoming events from watcher.
+ // Because storing events in local will cause more memory usage.
+ // The worst case would be closing the fast watcher.
+ select {
+ case <-ctx.Done():
+ return
+ case p.output <- *e:
+ }
+ }
+}
+
func (wc *watchChan) filter(obj runtime.Object) bool {
if wc.internalPred.Empty() {
return true
diff --git a/vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go b/vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go
new file mode 100644
index 00000000000..77f5ab05c9c
--- /dev/null
+++ b/vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go
@@ -0,0 +1,172 @@
+/*
+Copyright 2024 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package feature
+
+import (
+ "context"
+ "fmt"
+ "sync"
+ "time"
+
+ clientv3 "go.etcd.io/etcd/client/v3"
+ "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apimachinery/pkg/util/version"
+ "k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/apiserver/pkg/storage"
+ "k8s.io/klog/v2"
+ "k8s.io/utils/ptr"
+)
+
+var (
+ // Define these static versions to use for checking version of etcd, issue on kubernetes #123192
+ v3_4_31 = version.MustParseSemantic("3.4.31")
+ v3_5_0 = version.MustParseSemantic("3.5.0")
+ v3_5_13 = version.MustParseSemantic("3.5.13")
+
+ // DefaultFeatureSupportChecker is a shared global etcd FeatureSupportChecker.
+ DefaultFeatureSupportChecker FeatureSupportChecker = newDefaultFeatureSupportChecker()
+)
+
+// FeatureSupportChecker to define Supports functions.
+type FeatureSupportChecker interface {
+ // Supports check if the feature is supported or not by checking internal cache.
+ // By default all calls to this function before calling CheckClient returns false.
+ // Returns true if all endpoints in etcd clients are supporting the feature.
+ // If client A supports and client B doesn't support the feature, the `Supports` will
+ // first return true at client A initializtion and then return false on client B
+ // initialzation, it can flip the support at runtime.
+ Supports(feature storage.Feature) bool
+ // CheckClient works with etcd client to recalcualte feature support and cache it internally.
+ // All etcd clients should support feature to cause `Supports` return true.
+ // If client A supports and client B doesn't support the feature, the `Supports` will
+ // first return true at client A initializtion and then return false on client B
+ // initialzation, it can flip the support at runtime.
+ CheckClient(ctx context.Context, c client, feature storage.Feature)
+}
+
+type defaultFeatureSupportChecker struct {
+ lock sync.Mutex
+ progressNotifySupported *bool
+ checkingEndpoint map[string]struct{}
+}
+
+func newDefaultFeatureSupportChecker() *defaultFeatureSupportChecker {
+ return &defaultFeatureSupportChecker{
+ checkingEndpoint: make(map[string]struct{}),
+ }
+}
+
+// Supports can check the featue from anywhere without storage if it was cached before.
+func (f *defaultFeatureSupportChecker) Supports(feature storage.Feature) bool {
+ switch feature {
+ case storage.RequestWatchProgress:
+ f.lock.Lock()
+ defer f.lock.Unlock()
+
+ return ptr.Deref(f.progressNotifySupported, false)
+ default:
+ runtime.HandleError(fmt.Errorf("feature %q is not implemented in DefaultFeatureSupportChecker", feature))
+ return false
+ }
+}
+
+// CheckClient accepts client and calculate the support per endpoint and caches it.
+func (f *defaultFeatureSupportChecker) CheckClient(ctx context.Context, c client, feature storage.Feature) {
+ switch feature {
+ case storage.RequestWatchProgress:
+ f.checkClient(ctx, c)
+ default:
+ runtime.HandleError(fmt.Errorf("feature %q is not implemented in DefaultFeatureSupportChecker", feature))
+ }
+}
+
+func (f *defaultFeatureSupportChecker) checkClient(ctx context.Context, c client) {
+ // start with 10 ms, multiply by 2 each step, until 15 s and stays on 15 seconds.
+ delayFunc := wait.Backoff{
+ Duration: 10 * time.Millisecond,
+ Cap: 15 * time.Second,
+ Factor: 2.0,
+ Steps: 11}.DelayFunc()
+ f.lock.Lock()
+ defer f.lock.Unlock()
+ for _, ep := range c.Endpoints() {
+ if _, found := f.checkingEndpoint[ep]; found {
+ continue
+ }
+ f.checkingEndpoint[ep] = struct{}{}
+ go func(ep string) {
+ defer runtime.HandleCrash()
+ err := delayFunc.Until(ctx, true, true, func(ctx context.Context) (done bool, err error) {
+ internalErr := f.clientSupportsRequestWatchProgress(ctx, c, ep)
+ return internalErr == nil, nil
+ })
+ if err != nil {
+ klog.ErrorS(err, "Failed to check if RequestWatchProgress is supported by etcd after retrying")
+ }
+ }(ep)
+ }
+}
+
+func (f *defaultFeatureSupportChecker) clientSupportsRequestWatchProgress(ctx context.Context, c client, ep string) error {
+ supported, err := endpointSupportsRequestWatchProgress(ctx, c, ep)
+ if err != nil {
+ return err
+ }
+ f.lock.Lock()
+ defer f.lock.Unlock()
+
+ if !supported {
+ klog.Infof("RequestWatchProgress feature is not supported by %q endpoint", ep)
+ f.progressNotifySupported = ptr.To(false)
+ return nil
+ }
+ if f.progressNotifySupported == nil {
+ f.progressNotifySupported = ptr.To(true)
+ }
+ return nil
+}
+
+// Sub interface of etcd client.
+type client interface {
+ // Endpoints returns list of endpoints in etcd client.
+ Endpoints() []string
+ // Status retrieves the status information from the etcd client connected to the specified endpoint.
+ // It takes a context.Context parameter for cancellation or timeout control.
+ // It returns a clientv3.StatusResponse containing the status information or an error if the operation fails.
+ Status(ctx context.Context, endpoint string) (*clientv3.StatusResponse, error)
+}
+
+// endpointSupportsRequestWatchProgress evaluates whether RequestWatchProgress supported by current version of etcd endpoint.
+// Based on this issues:
+// - https://github.com/etcd-io/etcd/issues/15220 - Fixed in etcd v3.4.25+ and v3.5.8+
+// - https://github.com/etcd-io/etcd/issues/17507 - Fixed in etcd v3.4.31+ and v3.5.13+
+func endpointSupportsRequestWatchProgress(ctx context.Context, c client, endpoint string) (bool, error) {
+ resp, err := c.Status(ctx, endpoint)
+ if err != nil {
+ return false, fmt.Errorf("failed checking etcd version, endpoint: %q: %w", endpoint, err)
+ }
+ ver, err := version.ParseSemantic(resp.Version)
+ if err != nil {
+ // Assume feature is not supported if etcd version cannot be parsed.
+ klog.ErrorS(err, "Failed to parse etcd version", "version", resp.Version)
+ return false, nil
+ }
+ if ver.LessThan(v3_4_31) || ver.AtLeast(v3_5_0) && ver.LessThan(v3_5_13) {
+ return false, nil
+ }
+ return true, nil
+}
diff --git a/vendor/k8s.io/apiserver/pkg/storage/interfaces.go b/vendor/k8s.io/apiserver/pkg/storage/interfaces.go
index 5489660809d..cff804b285d 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/interfaces.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/interfaces.go
@@ -29,6 +29,12 @@ import (
"k8s.io/apimachinery/pkg/watch"
)
+// Feature is the name of each feature in storage that we check in feature_support_checker.
+type Feature = string
+
+// RequestWatchProgress is an etcd feature that may use to check if it supported or not.
+var RequestWatchProgress Feature = "RequestWatchProgress"
+
// Versioner abstracts setting and retrieving metadata fields from database response
// onto the object ot list. It is required to maintain storage invariants - updating an
// object twice with the same data except for the ResourceVersion and SelfLink must be
@@ -237,6 +243,9 @@ type Interface interface {
// Count returns number of different entries under the key (generally being path prefix).
Count(key string) (int64, error)
+ // ReadinessCheck checks if the storage is ready for accepting requests.
+ ReadinessCheck() error
+
// RequestWatchProgress requests the a watch stream progress status be sent in the
// watch response stream as soon as possible.
// Used for monitor watch progress even if watching resources with no changes.
diff --git a/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go b/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go
index a0a14366f2a..480b5a89342 100644
--- a/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go
+++ b/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go
@@ -17,10 +17,13 @@ limitations under the License.
package storage
import (
+ "context"
+
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apiserver/pkg/endpoints/request"
)
// AttrFunc returns label and field sets and the uninitialized flag for List or Watch to match.
@@ -115,7 +118,7 @@ func (s *SelectionPredicate) MatchesObjectAttributes(l labels.Set, f fields.Set)
// MatchesSingleNamespace will return (namespace, true) if and only if s.Field matches on the object's
// namespace.
func (s *SelectionPredicate) MatchesSingleNamespace() (string, bool) {
- if len(s.Continue) > 0 {
+ if len(s.Continue) > 0 || s.Field == nil {
return "", false
}
if namespace, ok := s.Field.RequiresExactMatch("metadata.namespace"); ok {
@@ -127,7 +130,7 @@ func (s *SelectionPredicate) MatchesSingleNamespace() (string, bool) {
// MatchesSingle will return (name, true) if and only if s.Field matches on the object's
// name.
func (s *SelectionPredicate) MatchesSingle() (string, bool) {
- if len(s.Continue) > 0 {
+ if len(s.Continue) > 0 || s.Field == nil {
return "", false
}
// TODO: should be namespace.name
@@ -145,11 +148,16 @@ func (s *SelectionPredicate) Empty() bool {
// For any index defined by IndexFields, if a matcher can match only (a subset)
// of objects that return for a given index, a pair (, |